if (!global) { var global = globalThis || window; }

function getDefaultExportFromNamespaceIfPresent (n) {
	return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
}

var eslintLinterBrowserify = {};

var global$1 = (typeof global !== "undefined" ? global :
  typeof self !== "undefined" ? self :
  typeof window !== "undefined" ? window : {});

// shim for using process in browser
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js

function defaultSetTimout() {
    throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
    throw new Error('clearTimeout has not been defined');
}
var cachedSetTimeout = defaultSetTimout;
var cachedClearTimeout = defaultClearTimeout;
if (typeof global$1.setTimeout === 'function') {
    cachedSetTimeout = setTimeout;
}
if (typeof global$1.clearTimeout === 'function') {
    cachedClearTimeout = clearTimeout;
}

function runTimeout(fun) {
    if (cachedSetTimeout === setTimeout) {
        //normal enviroments in sane situations
        return setTimeout(fun, 0);
    }
    // if setTimeout wasn't available but was latter defined
    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
        cachedSetTimeout = setTimeout;
        return setTimeout(fun, 0);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedSetTimeout(fun, 0);
    } catch(e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
            return cachedSetTimeout.call(null, fun, 0);
        } catch(e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
            return cachedSetTimeout.call(this, fun, 0);
        }
    }


}
function runClearTimeout(marker) {
    if (cachedClearTimeout === clearTimeout) {
        //normal enviroments in sane situations
        return clearTimeout(marker);
    }
    // if clearTimeout wasn't available but was latter defined
    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
        cachedClearTimeout = clearTimeout;
        return clearTimeout(marker);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedClearTimeout(marker);
    } catch (e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
            return cachedClearTimeout.call(null, marker);
        } catch (e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
            return cachedClearTimeout.call(this, marker);
        }
    }



}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;

function cleanUpNextTick() {
    if (!draining || !currentQueue) {
        return;
    }
    draining = false;
    if (currentQueue.length) {
        queue = currentQueue.concat(queue);
    } else {
        queueIndex = -1;
    }
    if (queue.length) {
        drainQueue();
    }
}

function drainQueue() {
    if (draining) {
        return;
    }
    var timeout = runTimeout(cleanUpNextTick);
    draining = true;

    var len = queue.length;
    while(len) {
        currentQueue = queue;
        queue = [];
        while (++queueIndex < len) {
            if (currentQueue) {
                currentQueue[queueIndex].run();
            }
        }
        queueIndex = -1;
        len = queue.length;
    }
    currentQueue = null;
    draining = false;
    runClearTimeout(timeout);
}
function nextTick(fun) {
    var args = new Array(arguments.length - 1);
    if (arguments.length > 1) {
        for (var i = 1; i < arguments.length; i++) {
            args[i - 1] = arguments[i];
        }
    }
    queue.push(new Item(fun, args));
    if (queue.length === 1 && !draining) {
        runTimeout(drainQueue);
    }
}
// v8 likes predictible objects
function Item(fun, array) {
    this.fun = fun;
    this.array = array;
}
Item.prototype.run = function () {
    this.fun.apply(null, this.array);
};
var title$1 = 'browser';
var platform = 'browser';
var browser$2 = true;
var env = {};
var argv = [];
var version$2 = ''; // empty string to avoid regexp issues
var versions = {};
var release = {};
var config$1 = {};

function noop() {}

var on = noop;
var addListener = noop;
var once = noop;
var off = noop;
var removeListener = noop;
var removeAllListeners = noop;
var emit = noop;

function binding(name) {
    throw new Error('process.binding is not supported');
}

function cwd () { return '/' }
function chdir (dir) {
    throw new Error('process.chdir is not supported');
}function umask() { return 0; }

// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
var performance = global$1.performance || {};
var performanceNow =
  performance.now        ||
  performance.mozNow     ||
  performance.msNow      ||
  performance.oNow       ||
  performance.webkitNow  ||
  function(){ return (new Date()).getTime() };

// generate timestamp or delta
// see http://nodejs.org/api/process.html#process_process_hrtime
function hrtime(previousTimestamp){
  var clocktime = performanceNow.call(performance)*1e-3;
  var seconds = Math.floor(clocktime);
  var nanoseconds = Math.floor((clocktime%1)*1e9);
  if (previousTimestamp) {
    seconds = seconds - previousTimestamp[0];
    nanoseconds = nanoseconds - previousTimestamp[1];
    if (nanoseconds<0) {
      seconds--;
      nanoseconds += 1e9;
    }
  }
  return [seconds,nanoseconds]
}

var startTime = new Date();
function uptime() {
  var currentTime = new Date();
  var dif = currentTime - startTime;
  return dif / 1000;
}

var browser$1$1 = {
  nextTick: nextTick,
  title: title$1,
  browser: browser$2,
  env: env,
  argv: argv,
  version: version$2,
  versions: versions,
  on: on,
  addListener: addListener,
  once: once,
  off: off,
  removeListener: removeListener,
  removeAllListeners: removeAllListeners,
  emit: emit,
  binding: binding,
  cwd: cwd,
  chdir: chdir,
  umask: umask,
  hrtime: hrtime,
  platform: platform,
  release: release,
  config: config$1,
  uptime: uptime
};

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// resolves . and .. elements in a path array with directory names there
// must be no slashes, empty elements, or device names (c:\) in the array
// (so also no leading and trailing slashes - it does not distinguish
// relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) {
  // if the path tries to go above the root, `up` ends up > 0
  var up = 0;
  for (var i = parts.length - 1; i >= 0; i--) {
    var last = parts[i];
    if (last === '.') {
      parts.splice(i, 1);
    } else if (last === '..') {
      parts.splice(i, 1);
      up++;
    } else if (up) {
      parts.splice(i, 1);
      up--;
    }
  }

  // if the path is allowed to go above the root, restore leading ..s
  if (allowAboveRoot) {
    for (; up--; up) {
      parts.unshift('..');
    }
  }

  return parts;
}

// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
    /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
var splitPath = function(filename) {
  return splitPathRe.exec(filename).slice(1);
};

// path.resolve([from ...], to)
// posix version
function resolve() {
  var resolvedPath = '',
      resolvedAbsolute = false;

  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
    var path = (i >= 0) ? arguments[i] : '/';

    // Skip empty and invalid entries
    if (typeof path !== 'string') {
      throw new TypeError('Arguments to path.resolve must be strings');
    } else if (!path) {
      continue;
    }

    resolvedPath = path + '/' + resolvedPath;
    resolvedAbsolute = path.charAt(0) === '/';
  }

  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when process.cwd() fails)

  // Normalize the path
  resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
    return !!p;
  }), !resolvedAbsolute).join('/');

  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
}
// path.normalize(path)
// posix version
function normalize(path) {
  var isPathAbsolute = isAbsolute(path),
      trailingSlash = substr(path, -1) === '/';

  // Normalize the path
  path = normalizeArray(filter(path.split('/'), function(p) {
    return !!p;
  }), !isPathAbsolute).join('/');

  if (!path && !isPathAbsolute) {
    path = '.';
  }
  if (path && trailingSlash) {
    path += '/';
  }

  return (isPathAbsolute ? '/' : '') + path;
}
// posix version
function isAbsolute(path) {
  return path.charAt(0) === '/';
}

// posix version
function join() {
  var paths = Array.prototype.slice.call(arguments, 0);
  return normalize(filter(paths, function(p, index) {
    if (typeof p !== 'string') {
      throw new TypeError('Arguments to path.join must be strings');
    }
    return p;
  }).join('/'));
}


// path.relative(from, to)
// posix version
function relative(from, to) {
  from = resolve(from).substr(1);
  to = resolve(to).substr(1);

  function trim(arr) {
    var start = 0;
    for (; start < arr.length; start++) {
      if (arr[start] !== '') break;
    }

    var end = arr.length - 1;
    for (; end >= 0; end--) {
      if (arr[end] !== '') break;
    }

    if (start > end) return [];
    return arr.slice(start, end - start + 1);
  }

  var fromParts = trim(from.split('/'));
  var toParts = trim(to.split('/'));

  var length = Math.min(fromParts.length, toParts.length);
  var samePartsLength = length;
  for (var i = 0; i < length; i++) {
    if (fromParts[i] !== toParts[i]) {
      samePartsLength = i;
      break;
    }
  }

  var outputParts = [];
  for (var i = samePartsLength; i < fromParts.length; i++) {
    outputParts.push('..');
  }

  outputParts = outputParts.concat(toParts.slice(samePartsLength));

  return outputParts.join('/');
}

var sep = '/';
var delimiter = ':';

function dirname(path) {
  var result = splitPath(path),
      root = result[0],
      dir = result[1];

  if (!root && !dir) {
    // No dirname whatsoever
    return '.';
  }

  if (dir) {
    // It has a dirname, strip trailing slash
    dir = dir.substr(0, dir.length - 1);
  }

  return root + dir;
}

function basename(path, ext) {
  var f = splitPath(path)[2];
  // TODO: make this comparison case-insensitive on windows?
  if (ext && f.substr(-1 * ext.length) === ext) {
    f = f.substr(0, f.length - ext.length);
  }
  return f;
}


function extname(path) {
  return splitPath(path)[3];
}
var _polyfillNode_path = {
  extname: extname,
  basename: basename,
  dirname: dirname,
  sep: sep,
  delimiter: delimiter,
  relative: relative,
  join: join,
  isAbsolute: isAbsolute,
  normalize: normalize,
  resolve: resolve
};
function filter (xs, f) {
    if (xs.filter) return xs.filter(f);
    var res = [];
    for (var i = 0; i < xs.length; i++) {
        if (f(xs[i], i, xs)) res.push(xs[i]);
    }
    return res;
}

// String.prototype.substr - negative index don't work in IE8
var substr = 'ab'.substr(-1) === 'b' ?
    function (str, start, len) { return str.substr(start, len) } :
    function (str, start, len) {
        if (start < 0) start = str.length + start;
        return str.substr(start, len);
    }
;

var _polyfillNode_path$1 = /*#__PURE__*/Object.freeze({
	__proto__: null,
	basename: basename,
	default: _polyfillNode_path,
	delimiter: delimiter,
	dirname: dirname,
	extname: extname,
	isAbsolute: isAbsolute,
	join: join,
	normalize: normalize,
	relative: relative,
	resolve: resolve,
	sep: sep
});

var require$$0$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_path$1);

var eslintScope = {};

var estraverse = {};

/*
  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredEstraverse;

function requireEstraverse () {
	if (hasRequiredEstraverse) return estraverse;
	hasRequiredEstraverse = 1;
	(function (exports) {
		/*jslint vars:false, bitwise:true*/
		/*jshint indent:4*/
		/*global exports:true*/
		(function clone(exports) {

		    var Syntax,
		        VisitorOption,
		        VisitorKeys,
		        BREAK,
		        SKIP,
		        REMOVE;

		    function deepCopy(obj) {
		        var ret = {}, key, val;
		        for (key in obj) {
		            if (obj.hasOwnProperty(key)) {
		                val = obj[key];
		                if (typeof val === 'object' && val !== null) {
		                    ret[key] = deepCopy(val);
		                } else {
		                    ret[key] = val;
		                }
		            }
		        }
		        return ret;
		    }

		    // based on LLVM libc++ upper_bound / lower_bound
		    // MIT License

		    function upperBound(array, func) {
		        var diff, len, i, current;

		        len = array.length;
		        i = 0;

		        while (len) {
		            diff = len >>> 1;
		            current = i + diff;
		            if (func(array[current])) {
		                len = diff;
		            } else {
		                i = current + 1;
		                len -= diff + 1;
		            }
		        }
		        return i;
		    }

		    Syntax = {
		        AssignmentExpression: 'AssignmentExpression',
		        AssignmentPattern: 'AssignmentPattern',
		        ArrayExpression: 'ArrayExpression',
		        ArrayPattern: 'ArrayPattern',
		        ArrowFunctionExpression: 'ArrowFunctionExpression',
		        AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
		        BlockStatement: 'BlockStatement',
		        BinaryExpression: 'BinaryExpression',
		        BreakStatement: 'BreakStatement',
		        CallExpression: 'CallExpression',
		        CatchClause: 'CatchClause',
		        ChainExpression: 'ChainExpression',
		        ClassBody: 'ClassBody',
		        ClassDeclaration: 'ClassDeclaration',
		        ClassExpression: 'ClassExpression',
		        ComprehensionBlock: 'ComprehensionBlock',  // CAUTION: It's deferred to ES7.
		        ComprehensionExpression: 'ComprehensionExpression',  // CAUTION: It's deferred to ES7.
		        ConditionalExpression: 'ConditionalExpression',
		        ContinueStatement: 'ContinueStatement',
		        DebuggerStatement: 'DebuggerStatement',
		        DirectiveStatement: 'DirectiveStatement',
		        DoWhileStatement: 'DoWhileStatement',
		        EmptyStatement: 'EmptyStatement',
		        ExportAllDeclaration: 'ExportAllDeclaration',
		        ExportDefaultDeclaration: 'ExportDefaultDeclaration',
		        ExportNamedDeclaration: 'ExportNamedDeclaration',
		        ExportSpecifier: 'ExportSpecifier',
		        ExpressionStatement: 'ExpressionStatement',
		        ForStatement: 'ForStatement',
		        ForInStatement: 'ForInStatement',
		        ForOfStatement: 'ForOfStatement',
		        FunctionDeclaration: 'FunctionDeclaration',
		        FunctionExpression: 'FunctionExpression',
		        GeneratorExpression: 'GeneratorExpression',  // CAUTION: It's deferred to ES7.
		        Identifier: 'Identifier',
		        IfStatement: 'IfStatement',
		        ImportExpression: 'ImportExpression',
		        ImportDeclaration: 'ImportDeclaration',
		        ImportDefaultSpecifier: 'ImportDefaultSpecifier',
		        ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
		        ImportSpecifier: 'ImportSpecifier',
		        Literal: 'Literal',
		        LabeledStatement: 'LabeledStatement',
		        LogicalExpression: 'LogicalExpression',
		        MemberExpression: 'MemberExpression',
		        MetaProperty: 'MetaProperty',
		        MethodDefinition: 'MethodDefinition',
		        ModuleSpecifier: 'ModuleSpecifier',
		        NewExpression: 'NewExpression',
		        ObjectExpression: 'ObjectExpression',
		        ObjectPattern: 'ObjectPattern',
		        PrivateIdentifier: 'PrivateIdentifier',
		        Program: 'Program',
		        Property: 'Property',
		        PropertyDefinition: 'PropertyDefinition',
		        RestElement: 'RestElement',
		        ReturnStatement: 'ReturnStatement',
		        SequenceExpression: 'SequenceExpression',
		        SpreadElement: 'SpreadElement',
		        Super: 'Super',
		        SwitchStatement: 'SwitchStatement',
		        SwitchCase: 'SwitchCase',
		        TaggedTemplateExpression: 'TaggedTemplateExpression',
		        TemplateElement: 'TemplateElement',
		        TemplateLiteral: 'TemplateLiteral',
		        ThisExpression: 'ThisExpression',
		        ThrowStatement: 'ThrowStatement',
		        TryStatement: 'TryStatement',
		        UnaryExpression: 'UnaryExpression',
		        UpdateExpression: 'UpdateExpression',
		        VariableDeclaration: 'VariableDeclaration',
		        VariableDeclarator: 'VariableDeclarator',
		        WhileStatement: 'WhileStatement',
		        WithStatement: 'WithStatement',
		        YieldExpression: 'YieldExpression'
		    };

		    VisitorKeys = {
		        AssignmentExpression: ['left', 'right'],
		        AssignmentPattern: ['left', 'right'],
		        ArrayExpression: ['elements'],
		        ArrayPattern: ['elements'],
		        ArrowFunctionExpression: ['params', 'body'],
		        AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
		        BlockStatement: ['body'],
		        BinaryExpression: ['left', 'right'],
		        BreakStatement: ['label'],
		        CallExpression: ['callee', 'arguments'],
		        CatchClause: ['param', 'body'],
		        ChainExpression: ['expression'],
		        ClassBody: ['body'],
		        ClassDeclaration: ['id', 'superClass', 'body'],
		        ClassExpression: ['id', 'superClass', 'body'],
		        ComprehensionBlock: ['left', 'right'],  // CAUTION: It's deferred to ES7.
		        ComprehensionExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.
		        ConditionalExpression: ['test', 'consequent', 'alternate'],
		        ContinueStatement: ['label'],
		        DebuggerStatement: [],
		        DirectiveStatement: [],
		        DoWhileStatement: ['body', 'test'],
		        EmptyStatement: [],
		        ExportAllDeclaration: ['source'],
		        ExportDefaultDeclaration: ['declaration'],
		        ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
		        ExportSpecifier: ['exported', 'local'],
		        ExpressionStatement: ['expression'],
		        ForStatement: ['init', 'test', 'update', 'body'],
		        ForInStatement: ['left', 'right', 'body'],
		        ForOfStatement: ['left', 'right', 'body'],
		        FunctionDeclaration: ['id', 'params', 'body'],
		        FunctionExpression: ['id', 'params', 'body'],
		        GeneratorExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.
		        Identifier: [],
		        IfStatement: ['test', 'consequent', 'alternate'],
		        ImportExpression: ['source'],
		        ImportDeclaration: ['specifiers', 'source'],
		        ImportDefaultSpecifier: ['local'],
		        ImportNamespaceSpecifier: ['local'],
		        ImportSpecifier: ['imported', 'local'],
		        Literal: [],
		        LabeledStatement: ['label', 'body'],
		        LogicalExpression: ['left', 'right'],
		        MemberExpression: ['object', 'property'],
		        MetaProperty: ['meta', 'property'],
		        MethodDefinition: ['key', 'value'],
		        ModuleSpecifier: [],
		        NewExpression: ['callee', 'arguments'],
		        ObjectExpression: ['properties'],
		        ObjectPattern: ['properties'],
		        PrivateIdentifier: [],
		        Program: ['body'],
		        Property: ['key', 'value'],
		        PropertyDefinition: ['key', 'value'],
		        RestElement: [ 'argument' ],
		        ReturnStatement: ['argument'],
		        SequenceExpression: ['expressions'],
		        SpreadElement: ['argument'],
		        Super: [],
		        SwitchStatement: ['discriminant', 'cases'],
		        SwitchCase: ['test', 'consequent'],
		        TaggedTemplateExpression: ['tag', 'quasi'],
		        TemplateElement: [],
		        TemplateLiteral: ['quasis', 'expressions'],
		        ThisExpression: [],
		        ThrowStatement: ['argument'],
		        TryStatement: ['block', 'handler', 'finalizer'],
		        UnaryExpression: ['argument'],
		        UpdateExpression: ['argument'],
		        VariableDeclaration: ['declarations'],
		        VariableDeclarator: ['id', 'init'],
		        WhileStatement: ['test', 'body'],
		        WithStatement: ['object', 'body'],
		        YieldExpression: ['argument']
		    };

		    // unique id
		    BREAK = {};
		    SKIP = {};
		    REMOVE = {};

		    VisitorOption = {
		        Break: BREAK,
		        Skip: SKIP,
		        Remove: REMOVE
		    };

		    function Reference(parent, key) {
		        this.parent = parent;
		        this.key = key;
		    }

		    Reference.prototype.replace = function replace(node) {
		        this.parent[this.key] = node;
		    };

		    Reference.prototype.remove = function remove() {
		        if (Array.isArray(this.parent)) {
		            this.parent.splice(this.key, 1);
		            return true;
		        } else {
		            this.replace(null);
		            return false;
		        }
		    };

		    function Element(node, path, wrap, ref) {
		        this.node = node;
		        this.path = path;
		        this.wrap = wrap;
		        this.ref = ref;
		    }

		    function Controller() { }

		    // API:
		    // return property path array from root to current node
		    Controller.prototype.path = function path() {
		        var i, iz, j, jz, result, element;

		        function addToPath(result, path) {
		            if (Array.isArray(path)) {
		                for (j = 0, jz = path.length; j < jz; ++j) {
		                    result.push(path[j]);
		                }
		            } else {
		                result.push(path);
		            }
		        }

		        // root node
		        if (!this.__current.path) {
		            return null;
		        }

		        // first node is sentinel, second node is root element
		        result = [];
		        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
		            element = this.__leavelist[i];
		            addToPath(result, element.path);
		        }
		        addToPath(result, this.__current.path);
		        return result;
		    };

		    // API:
		    // return type of current node
		    Controller.prototype.type = function () {
		        var node = this.current();
		        return node.type || this.__current.wrap;
		    };

		    // API:
		    // return array of parent elements
		    Controller.prototype.parents = function parents() {
		        var i, iz, result;

		        // first node is sentinel
		        result = [];
		        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
		            result.push(this.__leavelist[i].node);
		        }

		        return result;
		    };

		    // API:
		    // return current node
		    Controller.prototype.current = function current() {
		        return this.__current.node;
		    };

		    Controller.prototype.__execute = function __execute(callback, element) {
		        var previous, result;

		        result = undefined;

		        previous  = this.__current;
		        this.__current = element;
		        this.__state = null;
		        if (callback) {
		            result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
		        }
		        this.__current = previous;

		        return result;
		    };

		    // API:
		    // notify control skip / break
		    Controller.prototype.notify = function notify(flag) {
		        this.__state = flag;
		    };

		    // API:
		    // skip child nodes of current node
		    Controller.prototype.skip = function () {
		        this.notify(SKIP);
		    };

		    // API:
		    // break traversals
		    Controller.prototype['break'] = function () {
		        this.notify(BREAK);
		    };

		    // API:
		    // remove node
		    Controller.prototype.remove = function () {
		        this.notify(REMOVE);
		    };

		    Controller.prototype.__initialize = function(root, visitor) {
		        this.visitor = visitor;
		        this.root = root;
		        this.__worklist = [];
		        this.__leavelist = [];
		        this.__current = null;
		        this.__state = null;
		        this.__fallback = null;
		        if (visitor.fallback === 'iteration') {
		            this.__fallback = Object.keys;
		        } else if (typeof visitor.fallback === 'function') {
		            this.__fallback = visitor.fallback;
		        }

		        this.__keys = VisitorKeys;
		        if (visitor.keys) {
		            this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
		        }
		    };

		    function isNode(node) {
		        if (node == null) {
		            return false;
		        }
		        return typeof node === 'object' && typeof node.type === 'string';
		    }

		    function isProperty(nodeType, key) {
		        return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
		    }
		  
		    function candidateExistsInLeaveList(leavelist, candidate) {
		        for (var i = leavelist.length - 1; i >= 0; --i) {
		            if (leavelist[i].node === candidate) {
		                return true;
		            }
		        }
		        return false;
		    }

		    Controller.prototype.traverse = function traverse(root, visitor) {
		        var worklist,
		            leavelist,
		            element,
		            node,
		            nodeType,
		            ret,
		            key,
		            current,
		            current2,
		            candidates,
		            candidate,
		            sentinel;

		        this.__initialize(root, visitor);

		        sentinel = {};

		        // reference
		        worklist = this.__worklist;
		        leavelist = this.__leavelist;

		        // initialize
		        worklist.push(new Element(root, null, null, null));
		        leavelist.push(new Element(null, null, null, null));

		        while (worklist.length) {
		            element = worklist.pop();

		            if (element === sentinel) {
		                element = leavelist.pop();

		                ret = this.__execute(visitor.leave, element);

		                if (this.__state === BREAK || ret === BREAK) {
		                    return;
		                }
		                continue;
		            }

		            if (element.node) {

		                ret = this.__execute(visitor.enter, element);

		                if (this.__state === BREAK || ret === BREAK) {
		                    return;
		                }

		                worklist.push(sentinel);
		                leavelist.push(element);

		                if (this.__state === SKIP || ret === SKIP) {
		                    continue;
		                }

		                node = element.node;
		                nodeType = node.type || element.wrap;
		                candidates = this.__keys[nodeType];
		                if (!candidates) {
		                    if (this.__fallback) {
		                        candidates = this.__fallback(node);
		                    } else {
		                        throw new Error('Unknown node type ' + nodeType + '.');
		                    }
		                }

		                current = candidates.length;
		                while ((current -= 1) >= 0) {
		                    key = candidates[current];
		                    candidate = node[key];
		                    if (!candidate) {
		                        continue;
		                    }

		                    if (Array.isArray(candidate)) {
		                        current2 = candidate.length;
		                        while ((current2 -= 1) >= 0) {
		                            if (!candidate[current2]) {
		                                continue;
		                            }

		                            if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
		                              continue;
		                            }

		                            if (isProperty(nodeType, candidates[current])) {
		                                element = new Element(candidate[current2], [key, current2], 'Property', null);
		                            } else if (isNode(candidate[current2])) {
		                                element = new Element(candidate[current2], [key, current2], null, null);
		                            } else {
		                                continue;
		                            }
		                            worklist.push(element);
		                        }
		                    } else if (isNode(candidate)) {
		                        if (candidateExistsInLeaveList(leavelist, candidate)) {
		                          continue;
		                        }

		                        worklist.push(new Element(candidate, key, null, null));
		                    }
		                }
		            }
		        }
		    };

		    Controller.prototype.replace = function replace(root, visitor) {
		        var worklist,
		            leavelist,
		            node,
		            nodeType,
		            target,
		            element,
		            current,
		            current2,
		            candidates,
		            candidate,
		            sentinel,
		            outer,
		            key;

		        function removeElem(element) {
		            var i,
		                key,
		                nextElem,
		                parent;

		            if (element.ref.remove()) {
		                // When the reference is an element of an array.
		                key = element.ref.key;
		                parent = element.ref.parent;

		                // If removed from array, then decrease following items' keys.
		                i = worklist.length;
		                while (i--) {
		                    nextElem = worklist[i];
		                    if (nextElem.ref && nextElem.ref.parent === parent) {
		                        if  (nextElem.ref.key < key) {
		                            break;
		                        }
		                        --nextElem.ref.key;
		                    }
		                }
		            }
		        }

		        this.__initialize(root, visitor);

		        sentinel = {};

		        // reference
		        worklist = this.__worklist;
		        leavelist = this.__leavelist;

		        // initialize
		        outer = {
		            root: root
		        };
		        element = new Element(root, null, null, new Reference(outer, 'root'));
		        worklist.push(element);
		        leavelist.push(element);

		        while (worklist.length) {
		            element = worklist.pop();

		            if (element === sentinel) {
		                element = leavelist.pop();

		                target = this.__execute(visitor.leave, element);

		                // node may be replaced with null,
		                // so distinguish between undefined and null in this place
		                if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
		                    // replace
		                    element.ref.replace(target);
		                }

		                if (this.__state === REMOVE || target === REMOVE) {
		                    removeElem(element);
		                }

		                if (this.__state === BREAK || target === BREAK) {
		                    return outer.root;
		                }
		                continue;
		            }

		            target = this.__execute(visitor.enter, element);

		            // node may be replaced with null,
		            // so distinguish between undefined and null in this place
		            if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
		                // replace
		                element.ref.replace(target);
		                element.node = target;
		            }

		            if (this.__state === REMOVE || target === REMOVE) {
		                removeElem(element);
		                element.node = null;
		            }

		            if (this.__state === BREAK || target === BREAK) {
		                return outer.root;
		            }

		            // node may be null
		            node = element.node;
		            if (!node) {
		                continue;
		            }

		            worklist.push(sentinel);
		            leavelist.push(element);

		            if (this.__state === SKIP || target === SKIP) {
		                continue;
		            }

		            nodeType = node.type || element.wrap;
		            candidates = this.__keys[nodeType];
		            if (!candidates) {
		                if (this.__fallback) {
		                    candidates = this.__fallback(node);
		                } else {
		                    throw new Error('Unknown node type ' + nodeType + '.');
		                }
		            }

		            current = candidates.length;
		            while ((current -= 1) >= 0) {
		                key = candidates[current];
		                candidate = node[key];
		                if (!candidate) {
		                    continue;
		                }

		                if (Array.isArray(candidate)) {
		                    current2 = candidate.length;
		                    while ((current2 -= 1) >= 0) {
		                        if (!candidate[current2]) {
		                            continue;
		                        }
		                        if (isProperty(nodeType, candidates[current])) {
		                            element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
		                        } else if (isNode(candidate[current2])) {
		                            element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
		                        } else {
		                            continue;
		                        }
		                        worklist.push(element);
		                    }
		                } else if (isNode(candidate)) {
		                    worklist.push(new Element(candidate, key, null, new Reference(node, key)));
		                }
		            }
		        }

		        return outer.root;
		    };

		    function traverse(root, visitor) {
		        var controller = new Controller();
		        return controller.traverse(root, visitor);
		    }

		    function replace(root, visitor) {
		        var controller = new Controller();
		        return controller.replace(root, visitor);
		    }

		    function extendCommentRange(comment, tokens) {
		        var target;

		        target = upperBound(tokens, function search(token) {
		            return token.range[0] > comment.range[0];
		        });

		        comment.extendedRange = [comment.range[0], comment.range[1]];

		        if (target !== tokens.length) {
		            comment.extendedRange[1] = tokens[target].range[0];
		        }

		        target -= 1;
		        if (target >= 0) {
		            comment.extendedRange[0] = tokens[target].range[1];
		        }

		        return comment;
		    }

		    function attachComments(tree, providedComments, tokens) {
		        // At first, we should calculate extended comment ranges.
		        var comments = [], comment, len, i, cursor;

		        if (!tree.range) {
		            throw new Error('attachComments needs range information');
		        }

		        // tokens array is empty, we attach comments to tree as 'leadingComments'
		        if (!tokens.length) {
		            if (providedComments.length) {
		                for (i = 0, len = providedComments.length; i < len; i += 1) {
		                    comment = deepCopy(providedComments[i]);
		                    comment.extendedRange = [0, tree.range[0]];
		                    comments.push(comment);
		                }
		                tree.leadingComments = comments;
		            }
		            return tree;
		        }

		        for (i = 0, len = providedComments.length; i < len; i += 1) {
		            comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
		        }

		        // This is based on John Freeman's implementation.
		        cursor = 0;
		        traverse(tree, {
		            enter: function (node) {
		                var comment;

		                while (cursor < comments.length) {
		                    comment = comments[cursor];
		                    if (comment.extendedRange[1] > node.range[0]) {
		                        break;
		                    }

		                    if (comment.extendedRange[1] === node.range[0]) {
		                        if (!node.leadingComments) {
		                            node.leadingComments = [];
		                        }
		                        node.leadingComments.push(comment);
		                        comments.splice(cursor, 1);
		                    } else {
		                        cursor += 1;
		                    }
		                }

		                // already out of owned node
		                if (cursor === comments.length) {
		                    return VisitorOption.Break;
		                }

		                if (comments[cursor].extendedRange[0] > node.range[1]) {
		                    return VisitorOption.Skip;
		                }
		            }
		        });

		        cursor = 0;
		        traverse(tree, {
		            leave: function (node) {
		                var comment;

		                while (cursor < comments.length) {
		                    comment = comments[cursor];
		                    if (node.range[1] < comment.extendedRange[0]) {
		                        break;
		                    }

		                    if (node.range[1] === comment.extendedRange[0]) {
		                        if (!node.trailingComments) {
		                            node.trailingComments = [];
		                        }
		                        node.trailingComments.push(comment);
		                        comments.splice(cursor, 1);
		                    } else {
		                        cursor += 1;
		                    }
		                }

		                // already out of owned node
		                if (cursor === comments.length) {
		                    return VisitorOption.Break;
		                }

		                if (comments[cursor].extendedRange[0] > node.range[1]) {
		                    return VisitorOption.Skip;
		                }
		            }
		        });

		        return tree;
		    }

		    exports.Syntax = Syntax;
		    exports.traverse = traverse;
		    exports.replace = replace;
		    exports.attachComments = attachComments;
		    exports.VisitorKeys = VisitorKeys;
		    exports.VisitorOption = VisitorOption;
		    exports.Controller = Controller;
		    exports.cloneEnvironment = function () { return clone({}); };

		    return exports;
		}(exports));
		/* vim: set sw=4 ts=4 et tw=80 : */ 
	} (estraverse));
	return estraverse;
}

var esrecurse = {};

var version$1 = "4.3.0";
var require$$1$2 = {
	version: version$1};

/*
  Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredEsrecurse;

function requireEsrecurse () {
	if (hasRequiredEsrecurse) return esrecurse;
	hasRequiredEsrecurse = 1;
	(function () {

	    var estraverse = requireEstraverse();

	    function isNode(node) {
	        if (node == null) {
	            return false;
	        }
	        return typeof node === 'object' && typeof node.type === 'string';
	    }

	    function isProperty(nodeType, key) {
	        return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties';
	    }

	    function Visitor(visitor, options) {
	        options = options || {};

	        this.__visitor = visitor ||  this;
	        this.__childVisitorKeys = options.childVisitorKeys
	            ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys)
	            : estraverse.VisitorKeys;
	        if (options.fallback === 'iteration') {
	            this.__fallback = Object.keys;
	        } else if (typeof options.fallback === 'function') {
	            this.__fallback = options.fallback;
	        }
	    }

	    /* Default method for visiting children.
	     * When you need to call default visiting operation inside custom visiting
	     * operation, you can use it with `this.visitChildren(node)`.
	     */
	    Visitor.prototype.visitChildren = function (node) {
	        var type, children, i, iz, j, jz, child;

	        if (node == null) {
	            return;
	        }

	        type = node.type || estraverse.Syntax.Property;

	        children = this.__childVisitorKeys[type];
	        if (!children) {
	            if (this.__fallback) {
	                children = this.__fallback(node);
	            } else {
	                throw new Error('Unknown node type ' + type + '.');
	            }
	        }

	        for (i = 0, iz = children.length; i < iz; ++i) {
	            child = node[children[i]];
	            if (child) {
	                if (Array.isArray(child)) {
	                    for (j = 0, jz = child.length; j < jz; ++j) {
	                        if (child[j]) {
	                            if (isNode(child[j]) || isProperty(type, children[i])) {
	                                this.visit(child[j]);
	                            }
	                        }
	                    }
	                } else if (isNode(child)) {
	                    this.visit(child);
	                }
	            }
	        }
	    };

	    /* Dispatching node. */
	    Visitor.prototype.visit = function (node) {
	        var type;

	        if (node == null) {
	            return;
	        }

	        type = node.type || estraverse.Syntax.Property;
	        if (this.__visitor[type]) {
	            this.__visitor[type].call(this, node);
	            return;
	        }
	        this.visitChildren(node);
	    };

	    esrecurse.version = require$$1$2.version;
	    esrecurse.Visitor = Visitor;
	    esrecurse.visit = function (node, visitor, options) {
	        var v = new Visitor(visitor, options);
	        v.visit(node);
	    };
	}());
	/* vim: set sw=4 ts=4 et tw=80 : */
	return esrecurse;
}

var hasRequiredEslintScope;

function requireEslintScope () {
	if (hasRequiredEslintScope) return eslintScope;
	hasRequiredEslintScope = 1;

	Object.defineProperty(eslintScope, '__esModule', { value: true });

	var estraverse = requireEstraverse();
	var esrecurse = requireEsrecurse();

	function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

	var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse);
	var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse);

	/**
	 * @fileoverview Assertion utilities.
	 * @author Nicholas C. Zakas
	 */

	/**
	 * Throws an error if the given condition is not truthy.
	 * @param {boolean} condition The condition to check.
	 * @param {string} message The message to include with the error.
	 * @returns {void}
	 * @throws {Error} When the condition is not truthy.
	 */
	function assert(condition, message = "Assertion failed.") {
	    if (!condition) {
	        throw new Error(message);
	    }
	}

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	const READ = 0x1;
	const WRITE = 0x2;
	const RW = READ | WRITE;

	/**
	 * A Reference represents a single occurrence of an identifier in code.
	 * @constructor Reference
	 */
	class Reference {
	    constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {

	        /**
	         * Identifier syntax node.
	         * @member {espreeIdentifier} Reference#identifier
	         */
	        this.identifier = ident;

	        /**
	         * Reference to the enclosing Scope.
	         * @member {Scope} Reference#from
	         */
	        this.from = scope;

	        /**
	         * Whether the reference comes from a dynamic scope (such as 'eval',
	         * 'with', etc.), and may be trapped by dynamic scopes.
	         * @member {boolean} Reference#tainted
	         */
	        this.tainted = false;

	        /**
	         * The variable this reference is resolved with.
	         * @member {Variable} Reference#resolved
	         */
	        this.resolved = null;

	        /**
	         * The read-write mode of the reference. (Value is one of {@link
	         * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
	         * @member {number} Reference#flag
	         * @private
	         */
	        this.flag = flag;
	        if (this.isWrite()) {

	            /**
	             * If reference is writeable, this is the tree being written to it.
	             * @member {espreeNode} Reference#writeExpr
	             */
	            this.writeExpr = writeExpr;

	            /**
	             * Whether the Reference might refer to a partial value of writeExpr.
	             * @member {boolean} Reference#partial
	             */
	            this.partial = partial;

	            /**
	             * Whether the Reference is to write of initialization.
	             * @member {boolean} Reference#init
	             */
	            this.init = init;
	        }
	        this.__maybeImplicitGlobal = maybeImplicitGlobal;
	    }

	    /**
	     * Whether the reference is static.
	     * @function Reference#isStatic
	     * @returns {boolean} static
	     */
	    isStatic() {
	        return !this.tainted && this.resolved && this.resolved.scope.isStatic();
	    }

	    /**
	     * Whether the reference is writeable.
	     * @function Reference#isWrite
	     * @returns {boolean} write
	     */
	    isWrite() {
	        return !!(this.flag & Reference.WRITE);
	    }

	    /**
	     * Whether the reference is readable.
	     * @function Reference#isRead
	     * @returns {boolean} read
	     */
	    isRead() {
	        return !!(this.flag & Reference.READ);
	    }

	    /**
	     * Whether the reference is read-only.
	     * @function Reference#isReadOnly
	     * @returns {boolean} read only
	     */
	    isReadOnly() {
	        return this.flag === Reference.READ;
	    }

	    /**
	     * Whether the reference is write-only.
	     * @function Reference#isWriteOnly
	     * @returns {boolean} write only
	     */
	    isWriteOnly() {
	        return this.flag === Reference.WRITE;
	    }

	    /**
	     * Whether the reference is read-write.
	     * @function Reference#isReadWrite
	     * @returns {boolean} read write
	     */
	    isReadWrite() {
	        return this.flag === Reference.RW;
	    }
	}

	/**
	 * @constant Reference.READ
	 * @private
	 */
	Reference.READ = READ;

	/**
	 * @constant Reference.WRITE
	 * @private
	 */
	Reference.WRITE = WRITE;

	/**
	 * @constant Reference.RW
	 * @private
	 */
	Reference.RW = RW;

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	/**
	 * A Variable represents a locally scoped identifier. These include arguments to
	 * functions.
	 * @constructor Variable
	 */
	class Variable {
	    constructor(name, scope) {

	        /**
	         * The variable name, as given in the source code.
	         * @member {string} Variable#name
	         */
	        this.name = name;

	        /**
	         * List of defining occurrences of this variable (like in 'var ...'
	         * statements or as parameter), as AST nodes.
	         * @member {espree.Identifier[]} Variable#identifiers
	         */
	        this.identifiers = [];

	        /**
	         * List of {@link Reference|references} of this variable (excluding parameter entries)
	         * in its defining scope and all nested scopes. For defining
	         * occurrences only see {@link Variable#defs}.
	         * @member {Reference[]} Variable#references
	         */
	        this.references = [];

	        /**
	         * List of defining occurrences of this variable (like in 'var ...'
	         * statements or as parameter), as custom objects.
	         * @member {Definition[]} Variable#defs
	         */
	        this.defs = [];

	        this.tainted = false;

	        /**
	         * Whether this is a stack variable.
	         * @member {boolean} Variable#stack
	         */
	        this.stack = true;

	        /**
	         * Reference to the enclosing Scope.
	         * @member {Scope} Variable#scope
	         */
	        this.scope = scope;
	    }
	}

	Variable.CatchClause = "CatchClause";
	Variable.Parameter = "Parameter";
	Variable.FunctionName = "FunctionName";
	Variable.ClassName = "ClassName";
	Variable.Variable = "Variable";
	Variable.ImportBinding = "ImportBinding";
	Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	/**
	 * @constructor Definition
	 */
	class Definition {
	    constructor(type, name, node, parent, index, kind) {

	        /**
	         * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
	         */
	        this.type = type;

	        /**
	         * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
	         */
	        this.name = name;

	        /**
	         * @member {espree.Node} Definition#node - the enclosing node of the identifier.
	         */
	        this.node = node;

	        /**
	         * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
	         */
	        this.parent = parent;

	        /**
	         * @member {number?} Definition#index - the index in the declaration statement.
	         */
	        this.index = index;

	        /**
	         * @member {string?} Definition#kind - the kind of the declaration statement.
	         */
	        this.kind = kind;
	    }
	}

	/**
	 * @constructor ParameterDefinition
	 */
	class ParameterDefinition extends Definition {
	    constructor(name, node, index, rest) {
	        super(Variable.Parameter, name, node, null, index, null);

	        /**
	         * Whether the parameter definition is a part of a rest parameter.
	         * @member {boolean} ParameterDefinition#rest
	         */
	        this.rest = rest;
	    }
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	const { Syntax: Syntax$2 } = estraverse__default["default"];

	/**
	 * Test if scope is struct
	 * @param {Scope} scope scope
	 * @param {Block} block block
	 * @param {boolean} isMethodDefinition is method definition
	 * @returns {boolean} is strict scope
	 */
	function isStrictScope(scope, block, isMethodDefinition) {
	    let body;

	    // When upper scope is exists and strict, inner scope is also strict.
	    if (scope.upper && scope.upper.isStrict) {
	        return true;
	    }

	    if (isMethodDefinition) {
	        return true;
	    }

	    if (scope.type === "class" || scope.type === "module") {
	        return true;
	    }

	    if (scope.type === "block" || scope.type === "switch") {
	        return false;
	    }

	    if (scope.type === "function") {
	        if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) {
	            return false;
	        }

	        if (block.type === Syntax$2.Program) {
	            body = block;
	        } else {
	            body = block.body;
	        }

	        if (!body) {
	            return false;
	        }
	    } else if (scope.type === "global") {
	        body = block;
	    } else {
	        return false;
	    }

	    // Search for a 'use strict' directive.
	    for (let i = 0, iz = body.body.length; i < iz; ++i) {
	        const stmt = body.body[i];

	        /*
	         * Check if the current statement is a directive.
	         * If it isn't, then we're past the directive prologue
	         * so stop the search because directives cannot
	         * appear after this point.
	         *
	         * Some parsers set `directive:null` on non-directive
	         * statements, so the `typeof` check is safer than
	         * checking for property existence.
	         */
	        if (typeof stmt.directive !== "string") {
	            break;
	        }

	        if (stmt.directive === "use strict") {
	            return true;
	        }
	    }

	    return false;
	}

	/**
	 * Register scope
	 * @param {ScopeManager} scopeManager scope manager
	 * @param {Scope} scope scope
	 * @returns {void}
	 */
	function registerScope(scopeManager, scope) {
	    scopeManager.scopes.push(scope);

	    const scopes = scopeManager.__nodeToScope.get(scope.block);

	    if (scopes) {
	        scopes.push(scope);
	    } else {
	        scopeManager.__nodeToScope.set(scope.block, [scope]);
	    }
	}

	/**
	 * Should be statically
	 * @param {Object} def def
	 * @returns {boolean} should be statically
	 */
	function shouldBeStatically(def) {
	    return (
	        (def.type === Variable.ClassName) ||
	        (def.type === Variable.Variable && def.parent.kind !== "var")
	    );
	}

	/**
	 * @constructor Scope
	 */
	class Scope {
	    constructor(scopeManager, type, upperScope, block, isMethodDefinition) {

	        /**
	         * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for",
	         * "class", "class-field-initializer", "class-static-block".
	         * @member {string} Scope#type
	         */
	        this.type = type;

	        /**
	         * The scoped {@link Variable}s of this scope, as <code>{ Variable.name
	         * : Variable }</code>.
	         * @member {Map} Scope#set
	         */
	        this.set = new Map();

	        /**
	         * The tainted variables of this scope, as <code>{ Variable.name :
	         * boolean }</code>.
	         *  @member {Map} Scope#taints
	         */
	        this.taints = new Map();

	        /**
	         * Generally, through the lexical scoping of JS you can always know
	         * which variable an identifier in the source code refers to. There are
	         * a few exceptions to this rule. With 'global' and 'with' scopes you
	         * can only decide at runtime which variable a reference refers to.
	         * Moreover, if 'eval()' is used in a scope, it might introduce new
	         * bindings in this or its parent scopes.
	         * All those scopes are considered 'dynamic'.
	         * @member {boolean} Scope#dynamic
	         */
	        this.dynamic = this.type === "global" || this.type === "with";

	        /**
	         * A reference to the scope-defining syntax node.
	         * @member {espree.Node} Scope#block
	         */
	        this.block = block;

	        /**
	         * The {@link Reference|references} that are not resolved with this scope.
	         * @member {Reference[]} Scope#through
	         */
	        this.through = [];

	        /**
	         * The scoped {@link Variable}s of this scope. In the case of a
	         * 'function' scope this includes the automatic argument <em>arguments</em> as
	         * its first element, as well as all further formal arguments.
	         * @member {Variable[]} Scope#variables
	         */
	        this.variables = [];

	        /**
	         * Any variable {@link Reference|reference} found in this scope. This
	         * includes occurrences of local variables as well as variables from
	         * parent scopes (including the global scope). For local variables
	         * this also includes defining occurrences (like in a 'var' statement).
	         * In a 'function' scope this does not include the occurrences of the
	         * formal parameter in the parameter list.
	         * @member {Reference[]} Scope#references
	         */
	        this.references = [];

	        /**
	         * For 'global' and 'function' scopes, this is a self-reference. For
	         * other scope types this is the <em>variableScope</em> value of the
	         * parent scope.
	         * @member {Scope} Scope#variableScope
	         */
	        this.variableScope =
	            this.type === "global" ||
	            this.type === "module" ||
	            this.type === "function" ||
	            this.type === "class-field-initializer" ||
	            this.type === "class-static-block"
	                ? this
	                : upperScope.variableScope;

	        /**
	         * Whether this scope is created by a FunctionExpression.
	         * @member {boolean} Scope#functionExpressionScope
	         */
	        this.functionExpressionScope = false;

	        /**
	         * Whether this is a scope that contains an 'eval()' invocation.
	         * @member {boolean} Scope#directCallToEvalScope
	         */
	        this.directCallToEvalScope = false;

	        /**
	         * @member {boolean} Scope#thisFound
	         */
	        this.thisFound = false;

	        this.__left = [];

	        /**
	         * Reference to the parent {@link Scope|scope}.
	         * @member {Scope} Scope#upper
	         */
	        this.upper = upperScope;

	        /**
	         * Whether 'use strict' is in effect in this scope.
	         * @member {boolean} Scope#isStrict
	         */
	        this.isStrict = scopeManager.isStrictModeSupported()
	            ? isStrictScope(this, block, isMethodDefinition)
	            : false;

	        /**
	         * List of nested {@link Scope}s.
	         * @member {Scope[]} Scope#childScopes
	         */
	        this.childScopes = [];
	        if (this.upper) {
	            this.upper.childScopes.push(this);
	        }

	        this.__declaredVariables = scopeManager.__declaredVariables;

	        registerScope(scopeManager, this);
	    }

	    __shouldStaticallyClose(scopeManager) {
	        return (!this.dynamic || scopeManager.__isOptimistic());
	    }

	    __shouldStaticallyCloseForGlobal(ref) {

	        // On global scope, let/const/class declarations should be resolved statically.
	        const name = ref.identifier.name;

	        if (!this.set.has(name)) {
	            return false;
	        }

	        const variable = this.set.get(name);
	        const defs = variable.defs;

	        return defs.length > 0 && defs.every(shouldBeStatically);
	    }

	    __staticCloseRef(ref) {
	        if (!this.__resolve(ref)) {
	            this.__delegateToUpperScope(ref);
	        }
	    }

	    __dynamicCloseRef(ref) {

	        // notify all names are through to global
	        let current = this;

	        do {
	            current.through.push(ref);
	            current = current.upper;
	        } while (current);
	    }

	    __globalCloseRef(ref) {

	        // let/const/class declarations should be resolved statically.
	        // others should be resolved dynamically.
	        if (this.__shouldStaticallyCloseForGlobal(ref)) {
	            this.__staticCloseRef(ref);
	        } else {
	            this.__dynamicCloseRef(ref);
	        }
	    }

	    __close(scopeManager) {
	        let closeRef;

	        if (this.__shouldStaticallyClose(scopeManager)) {
	            closeRef = this.__staticCloseRef;
	        } else if (this.type !== "global") {
	            closeRef = this.__dynamicCloseRef;
	        } else {
	            closeRef = this.__globalCloseRef;
	        }

	        // Try Resolving all references in this scope.
	        for (let i = 0, iz = this.__left.length; i < iz; ++i) {
	            const ref = this.__left[i];

	            closeRef.call(this, ref);
	        }
	        this.__left = null;

	        return this.upper;
	    }

	    // To override by function scopes.
	    // References in default parameters isn't resolved to variables which are in their function body.
	    __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars  -- Desired as instance method with signature
	        return true;
	    }

	    __resolve(ref) {
	        const name = ref.identifier.name;

	        if (!this.set.has(name)) {
	            return false;
	        }
	        const variable = this.set.get(name);

	        if (!this.__isValidResolution(ref, variable)) {
	            return false;
	        }
	        variable.references.push(ref);
	        variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
	        if (ref.tainted) {
	            variable.tainted = true;
	            this.taints.set(variable.name, true);
	        }
	        ref.resolved = variable;

	        return true;
	    }

	    __delegateToUpperScope(ref) {
	        if (this.upper) {
	            this.upper.__left.push(ref);
	        }
	        this.through.push(ref);
	    }

	    __addDeclaredVariablesOfNode(variable, node) {
	        if (node === null || node === void 0) {
	            return;
	        }

	        let variables = this.__declaredVariables.get(node);

	        if (variables === null || variables === void 0) {
	            variables = [];
	            this.__declaredVariables.set(node, variables);
	        }
	        if (!variables.includes(variable)) {
	            variables.push(variable);
	        }
	    }

	    __defineGeneric(name, set, variables, node, def) {
	        let variable;

	        variable = set.get(name);
	        if (!variable) {
	            variable = new Variable(name, this);
	            set.set(name, variable);
	            variables.push(variable);
	        }

	        if (def) {
	            variable.defs.push(def);
	            this.__addDeclaredVariablesOfNode(variable, def.node);
	            this.__addDeclaredVariablesOfNode(variable, def.parent);
	        }
	        if (node) {
	            variable.identifiers.push(node);
	        }
	    }

	    __define(node, def) {
	        if (node && node.type === Syntax$2.Identifier) {
	            this.__defineGeneric(
	                node.name,
	                this.set,
	                this.variables,
	                node,
	                def
	            );
	        }
	    }

	    __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {

	        // because Array element may be null
	        if (!node || (node.type !== Syntax$2.Identifier && node.type !== "JSXIdentifier")) {
	            return;
	        }

	        // Specially handle like `this`.
	        if (node.name === "super") {
	            return;
	        }

	        const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);

	        this.references.push(ref);
	        this.__left.push(ref);
	    }

	    __detectEval() {
	        let current = this;

	        this.directCallToEvalScope = true;
	        do {
	            current.dynamic = true;
	            current = current.upper;
	        } while (current);
	    }

	    __detectThis() {
	        this.thisFound = true;
	    }

	    __isClosed() {
	        return this.__left === null;
	    }

	    /**
	     * returns resolved {Reference}
	     * @function Scope#resolve
	     * @param {Espree.Identifier} ident identifier to be resolved.
	     * @returns {Reference} reference
	     */
	    resolve(ident) {
	        let ref, i, iz;

	        assert(this.__isClosed(), "Scope should be closed.");
	        assert(ident.type === Syntax$2.Identifier, "Target should be identifier.");
	        for (i = 0, iz = this.references.length; i < iz; ++i) {
	            ref = this.references[i];
	            if (ref.identifier === ident) {
	                return ref;
	            }
	        }
	        return null;
	    }

	    /**
	     * returns this scope is static
	     * @function Scope#isStatic
	     * @returns {boolean} static
	     */
	    isStatic() {
	        return !this.dynamic;
	    }

	    /**
	     * returns this scope has materialized arguments
	     * @function Scope#isArgumentsMaterialized
	     * @returns {boolean} arguemnts materialized
	     */
	    isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method
	        return true;
	    }

	    /**
	     * returns this scope has materialized `this` reference
	     * @function Scope#isThisMaterialized
	     * @returns {boolean} this materialized
	     */
	    isThisMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method
	        return true;
	    }

	    isUsedName(name) {
	        if (this.set.has(name)) {
	            return true;
	        }
	        for (let i = 0, iz = this.through.length; i < iz; ++i) {
	            if (this.through[i].identifier.name === name) {
	                return true;
	            }
	        }
	        return false;
	    }
	}

	/**
	 * Global scope.
	 */
	class GlobalScope extends Scope {
	    constructor(scopeManager, block) {
	        super(scopeManager, "global", null, block, false);
	        this.implicit = {
	            set: new Map(),
	            variables: [],

	            /**
	             * List of {@link Reference}s that are left to be resolved (i.e. which
	             * need to be linked to the variable they refer to).
	             * @member {Reference[]} Scope#implicit#left
	             */
	            left: []
	        };
	    }

	    __close(scopeManager) {
	        const implicit = [];

	        for (let i = 0, iz = this.__left.length; i < iz; ++i) {
	            const ref = this.__left[i];

	            if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
	                implicit.push(ref.__maybeImplicitGlobal);
	            }
	        }

	        // create an implicit global variable from assignment expression
	        for (let i = 0, iz = implicit.length; i < iz; ++i) {
	            const info = implicit[i];

	            this.__defineImplicit(info.pattern,
	                new Definition(
	                    Variable.ImplicitGlobalVariable,
	                    info.pattern,
	                    info.node,
	                    null,
	                    null,
	                    null
	                ));

	        }

	        this.implicit.left = this.__left;

	        return super.__close(scopeManager);
	    }

	    __defineImplicit(node, def) {
	        if (node && node.type === Syntax$2.Identifier) {
	            this.__defineGeneric(
	                node.name,
	                this.implicit.set,
	                this.implicit.variables,
	                node,
	                def
	            );
	        }
	    }
	}

	/**
	 * Module scope.
	 */
	class ModuleScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "module", upperScope, block, false);
	    }
	}

	/**
	 * Function expression name scope.
	 */
	class FunctionExpressionNameScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "function-expression-name", upperScope, block, false);
	        this.__define(block.id,
	            new Definition(
	                Variable.FunctionName,
	                block.id,
	                block,
	                null,
	                null,
	                null
	            ));
	        this.functionExpressionScope = true;
	    }
	}

	/**
	 * Catch scope.
	 */
	class CatchScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "catch", upperScope, block, false);
	    }
	}

	/**
	 * With statement scope.
	 */
	class WithScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "with", upperScope, block, false);
	    }

	    __close(scopeManager) {
	        if (this.__shouldStaticallyClose(scopeManager)) {
	            return super.__close(scopeManager);
	        }

	        for (let i = 0, iz = this.__left.length; i < iz; ++i) {
	            const ref = this.__left[i];

	            ref.tainted = true;
	            this.__delegateToUpperScope(ref);
	        }
	        this.__left = null;

	        return this.upper;
	    }
	}

	/**
	 * Block scope.
	 */
	class BlockScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "block", upperScope, block, false);
	    }
	}

	/**
	 * Switch scope.
	 */
	class SwitchScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "switch", upperScope, block, false);
	    }
	}

	/**
	 * Function scope.
	 */
	class FunctionScope extends Scope {
	    constructor(scopeManager, upperScope, block, isMethodDefinition) {
	        super(scopeManager, "function", upperScope, block, isMethodDefinition);

	        // section 9.2.13, FunctionDeclarationInstantiation.
	        // NOTE Arrow functions never have an arguments objects.
	        if (this.block.type !== Syntax$2.ArrowFunctionExpression) {
	            this.__defineArguments();
	        }
	    }

	    isArgumentsMaterialized() {

	        // TODO(Constellation)
	        // We can more aggressive on this condition like this.
	        //
	        // function t() {
	        //     // arguments of t is always hidden.
	        //     function arguments() {
	        //     }
	        // }
	        if (this.block.type === Syntax$2.ArrowFunctionExpression) {
	            return false;
	        }

	        if (!this.isStatic()) {
	            return true;
	        }

	        const variable = this.set.get("arguments");

	        assert(variable, "Always have arguments variable.");
	        return variable.tainted || variable.references.length !== 0;
	    }

	    isThisMaterialized() {
	        if (!this.isStatic()) {
	            return true;
	        }
	        return this.thisFound;
	    }

	    __defineArguments() {
	        this.__defineGeneric(
	            "arguments",
	            this.set,
	            this.variables,
	            null,
	            null
	        );
	        this.taints.set("arguments", true);
	    }

	    // References in default parameters isn't resolved to variables which are in their function body.
	    //     const x = 1
	    //     function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
	    //         const x = 2
	    //         console.log(a)
	    //     }
	    __isValidResolution(ref, variable) {

	        // If `options.nodejsScope` is true, `this.block` becomes a Program node.
	        if (this.block.type === "Program") {
	            return true;
	        }

	        const bodyStart = this.block.body.range[0];

	        // It's invalid resolution in the following case:
	        return !(
	            variable.scope === this &&
	            ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
	            variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
	        );
	    }
	}

	/**
	 * Scope of for, for-in, and for-of statements.
	 */
	class ForScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "for", upperScope, block, false);
	    }
	}

	/**
	 * Class scope.
	 */
	class ClassScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "class", upperScope, block, false);
	    }
	}

	/**
	 * Class field initializer scope.
	 */
	class ClassFieldInitializerScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "class-field-initializer", upperScope, block, true);
	    }
	}

	/**
	 * Class static block scope.
	 */
	class ClassStaticBlockScope extends Scope {
	    constructor(scopeManager, upperScope, block) {
	        super(scopeManager, "class-static-block", upperScope, block, true);
	    }
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	/**
	 * @constructor ScopeManager
	 */
	class ScopeManager {
	    constructor(options) {
	        this.scopes = [];
	        this.globalScope = null;
	        this.__nodeToScope = new WeakMap();
	        this.__currentScope = null;
	        this.__options = options;
	        this.__declaredVariables = new WeakMap();
	    }

	    __isOptimistic() {
	        return this.__options.optimistic;
	    }

	    __ignoreEval() {
	        return this.__options.ignoreEval;
	    }

	    __isJSXEnabled() {
	        return this.__options.jsx === true;
	    }

	    isGlobalReturn() {
	        return this.__options.nodejsScope || this.__options.sourceType === "commonjs";
	    }

	    isModule() {
	        return this.__options.sourceType === "module";
	    }

	    isImpliedStrict() {
	        return this.__options.impliedStrict;
	    }

	    isStrictModeSupported() {
	        return this.__options.ecmaVersion >= 5;
	    }

	    // Returns appropriate scope for this node.
	    __get(node) {
	        return this.__nodeToScope.get(node);
	    }

	    /**
	     * Get variables that are declared by the node.
	     *
	     * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
	     * If the node declares nothing, this method returns an empty array.
	     * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
	     * @param {Espree.Node} node a node to get.
	     * @returns {Variable[]} variables that declared by the node.
	     */
	    getDeclaredVariables(node) {
	        return this.__declaredVariables.get(node) || [];
	    }

	    /**
	     * acquire scope from node.
	     * @function ScopeManager#acquire
	     * @param {Espree.Node} node node for the acquired scope.
	     * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	     * @returns {Scope?} Scope from node
	     */
	    acquire(node, inner) {

	        /**
	         * predicate
	         * @param {Scope} testScope scope to test
	         * @returns {boolean} predicate
	         */
	        function predicate(testScope) {
	            if (testScope.type === "function" && testScope.functionExpressionScope) {
	                return false;
	            }
	            return true;
	        }

	        const scopes = this.__get(node);

	        if (!scopes || scopes.length === 0) {
	            return null;
	        }

	        // Heuristic selection from all scopes.
	        // If you would like to get all scopes, please use ScopeManager#acquireAll.
	        if (scopes.length === 1) {
	            return scopes[0];
	        }

	        if (inner) {
	            for (let i = scopes.length - 1; i >= 0; --i) {
	                const scope = scopes[i];

	                if (predicate(scope)) {
	                    return scope;
	                }
	            }
	        } else {
	            for (let i = 0, iz = scopes.length; i < iz; ++i) {
	                const scope = scopes[i];

	                if (predicate(scope)) {
	                    return scope;
	                }
	            }
	        }

	        return null;
	    }

	    /**
	     * acquire all scopes from node.
	     * @function ScopeManager#acquireAll
	     * @param {Espree.Node} node node for the acquired scope.
	     * @returns {Scopes?} Scope array
	     */
	    acquireAll(node) {
	        return this.__get(node);
	    }

	    /**
	     * release the node.
	     * @function ScopeManager#release
	     * @param {Espree.Node} node releasing node.
	     * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	     * @returns {Scope?} upper scope for the node.
	     */
	    release(node, inner) {
	        const scopes = this.__get(node);

	        if (scopes && scopes.length) {
	            const scope = scopes[0].upper;

	            if (!scope) {
	                return null;
	            }
	            return this.acquire(scope.block, inner);
	        }
	        return null;
	    }

	    attach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method

	    detach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method

	    __nestScope(scope) {
	        if (scope instanceof GlobalScope) {
	            assert(this.__currentScope === null);
	            this.globalScope = scope;
	        }
	        this.__currentScope = scope;
	        return scope;
	    }

	    __nestGlobalScope(node) {
	        return this.__nestScope(new GlobalScope(this, node));
	    }

	    __nestBlockScope(node) {
	        return this.__nestScope(new BlockScope(this, this.__currentScope, node));
	    }

	    __nestFunctionScope(node, isMethodDefinition) {
	        return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
	    }

	    __nestForScope(node) {
	        return this.__nestScope(new ForScope(this, this.__currentScope, node));
	    }

	    __nestCatchScope(node) {
	        return this.__nestScope(new CatchScope(this, this.__currentScope, node));
	    }

	    __nestWithScope(node) {
	        return this.__nestScope(new WithScope(this, this.__currentScope, node));
	    }

	    __nestClassScope(node) {
	        return this.__nestScope(new ClassScope(this, this.__currentScope, node));
	    }

	    __nestClassFieldInitializerScope(node) {
	        return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
	    }

	    __nestClassStaticBlockScope(node) {
	        return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node));
	    }

	    __nestSwitchScope(node) {
	        return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
	    }

	    __nestModuleScope(node) {
	        return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
	    }

	    __nestFunctionExpressionNameScope(node) {
	        return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
	    }

	    __isES6() {
	        return this.__options.ecmaVersion >= 6;
	    }
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	const { Syntax: Syntax$1 } = estraverse__default["default"];

	/**
	 * Get last array element
	 * @param {Array} xs array
	 * @returns {any} Last elment
	 */
	function getLast(xs) {
	    return xs.at(-1) || null;
	}

	/**
	 * Visitor for destructuring patterns.
	 */
	class PatternVisitor extends esrecurse__default["default"].Visitor {
	    static isPattern(node) {
	        const nodeType = node.type;

	        return (
	            nodeType === Syntax$1.Identifier ||
	            nodeType === Syntax$1.ObjectPattern ||
	            nodeType === Syntax$1.ArrayPattern ||
	            nodeType === Syntax$1.SpreadElement ||
	            nodeType === Syntax$1.RestElement ||
	            nodeType === Syntax$1.AssignmentPattern
	        );
	    }

	    constructor(options, rootPattern, callback) {
	        super(null, options);
	        this.rootPattern = rootPattern;
	        this.callback = callback;
	        this.assignments = [];
	        this.rightHandNodes = [];
	        this.restElements = [];
	    }

	    Identifier(pattern) {
	        const lastRestElement = getLast(this.restElements);

	        this.callback(pattern, {
	            topLevel: pattern === this.rootPattern,
	            rest: lastRestElement !== null && lastRestElement !== void 0 && lastRestElement.argument === pattern,
	            assignments: this.assignments
	        });
	    }

	    Property(property) {

	        // Computed property's key is a right hand node.
	        if (property.computed) {
	            this.rightHandNodes.push(property.key);
	        }

	        // If it's shorthand, its key is same as its value.
	        // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
	        // If it's not shorthand, the name of new variable is its value's.
	        this.visit(property.value);
	    }

	    ArrayPattern(pattern) {
	        for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
	            const element = pattern.elements[i];

	            this.visit(element);
	        }
	    }

	    AssignmentPattern(pattern) {
	        this.assignments.push(pattern);
	        this.visit(pattern.left);
	        this.rightHandNodes.push(pattern.right);
	        this.assignments.pop();
	    }

	    RestElement(pattern) {
	        this.restElements.push(pattern);
	        this.visit(pattern.argument);
	        this.restElements.pop();
	    }

	    MemberExpression(node) {

	        // Computed property's key is a right hand node.
	        if (node.computed) {
	            this.rightHandNodes.push(node.property);
	        }

	        // the object is only read, write to its property.
	        this.rightHandNodes.push(node.object);
	    }

	    //
	    // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
	    // By spec, LeftHandSideExpression is Pattern or MemberExpression.
	    //   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
	    // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
	    //

	    SpreadElement(node) {
	        this.visit(node.argument);
	    }

	    ArrayExpression(node) {
	        node.elements.forEach(this.visit, this);
	    }

	    AssignmentExpression(node) {
	        this.assignments.push(node);
	        this.visit(node.left);
	        this.rightHandNodes.push(node.right);
	        this.assignments.pop();
	    }

	    CallExpression(node) {

	        // arguments are right hand nodes.
	        node.arguments.forEach(a => {
	            this.rightHandNodes.push(a);
	        });
	        this.visit(node.callee);
	    }
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	/*
	  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	const { Syntax } = estraverse__default["default"];

	/**
	 * Traverse identifier in pattern
	 * @param {Object} options options
	 * @param {pattern} rootPattern root pattern
	 * @param {Refencer} referencer referencer
	 * @param {callback} callback callback
	 * @returns {void}
	 */
	function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {

	    // Call the callback at left hand identifier nodes, and Collect right hand nodes.
	    const visitor = new PatternVisitor(options, rootPattern, callback);

	    visitor.visit(rootPattern);

	    // Process the right hand nodes recursively.
	    if (referencer !== null && referencer !== void 0) {
	        visitor.rightHandNodes.forEach(referencer.visit, referencer);
	    }
	}

	// Importing ImportDeclaration.
	// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
	// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
	// FIXME: Now, we don't create module environment, because the context is
	// implementation dependent.

	/**
	 * Visitor for import specifiers.
	 */
	class Importer extends esrecurse__default["default"].Visitor {
	    constructor(declaration, referencer) {
	        super(null, referencer.options);
	        this.declaration = declaration;
	        this.referencer = referencer;
	    }

	    visitImport(id, specifier) {
	        this.referencer.visitPattern(id, pattern => {
	            this.referencer.currentScope().__define(pattern,
	                new Definition(
	                    Variable.ImportBinding,
	                    pattern,
	                    specifier,
	                    this.declaration,
	                    null,
	                    null
	                ));
	        });
	    }

	    ImportNamespaceSpecifier(node) {
	        const local = (node.local || node.id);

	        if (local) {
	            this.visitImport(local, node);
	        }
	    }

	    ImportDefaultSpecifier(node) {
	        const local = (node.local || node.id);

	        this.visitImport(local, node);
	    }

	    ImportSpecifier(node) {
	        const local = (node.local || node.id);

	        if (node.name) {
	            this.visitImport(node.name, node);
	        } else {
	            this.visitImport(local, node);
	        }
	    }
	}

	/**
	 * Referencing variables and creating bindings.
	 */
	class Referencer extends esrecurse__default["default"].Visitor {
	    constructor(options, scopeManager) {
	        super(null, options);
	        this.options = options;
	        this.scopeManager = scopeManager;
	        this.parent = null;
	        this.isInnerMethodDefinition = false;
	    }

	    currentScope() {
	        return this.scopeManager.__currentScope;
	    }

	    close(node) {
	        while (this.currentScope() && node === this.currentScope().block) {
	            this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
	        }
	    }

	    pushInnerMethodDefinition(isInnerMethodDefinition) {
	        const previous = this.isInnerMethodDefinition;

	        this.isInnerMethodDefinition = isInnerMethodDefinition;
	        return previous;
	    }

	    popInnerMethodDefinition(isInnerMethodDefinition) {
	        this.isInnerMethodDefinition = isInnerMethodDefinition;
	    }

	    referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
	        const scope = this.currentScope();

	        assignments.forEach(assignment => {
	            scope.__referencing(
	                pattern,
	                Reference.WRITE,
	                assignment.right,
	                maybeImplicitGlobal,
	                pattern !== assignment.left,
	                init
	            );
	        });
	    }

	    visitPattern(node, options, callback) {
	        let visitPatternOptions = options;
	        let visitPatternCallback = callback;

	        if (typeof options === "function") {
	            visitPatternCallback = options;
	            visitPatternOptions = { processRightHandNodes: false };
	        }

	        traverseIdentifierInPattern(
	            this.options,
	            node,
	            visitPatternOptions.processRightHandNodes ? this : null,
	            visitPatternCallback
	        );
	    }

	    visitFunction(node) {
	        let i, iz;

	        // FunctionDeclaration name is defined in upper scope
	        // NOTE: Not referring variableScope. It is intended.
	        // Since
	        //  in ES5, FunctionDeclaration should be in FunctionBody.
	        //  in ES6, FunctionDeclaration should be block scoped.

	        if (node.type === Syntax.FunctionDeclaration) {

	            // id is defined in upper scope
	            this.currentScope().__define(node.id,
	                new Definition(
	                    Variable.FunctionName,
	                    node.id,
	                    node,
	                    null,
	                    null,
	                    null
	                ));
	        }

	        // FunctionExpression with name creates its special scope;
	        // FunctionExpressionNameScope.
	        if (node.type === Syntax.FunctionExpression && node.id) {
	            this.scopeManager.__nestFunctionExpressionNameScope(node);
	        }

	        // Consider this function is in the MethodDefinition.
	        this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);

	        const that = this;

	        /**
	         * Visit pattern callback
	         * @param {pattern} pattern pattern
	         * @param {Object} info info
	         * @returns {void}
	         */
	        function visitPatternCallback(pattern, info) {
	            that.currentScope().__define(pattern,
	                new ParameterDefinition(
	                    pattern,
	                    node,
	                    i,
	                    info.rest
	                ));

	            that.referencingDefaultValue(pattern, info.assignments, null, true);
	        }

	        // Process parameter declarations.
	        for (i = 0, iz = node.params.length; i < iz; ++i) {
	            this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback);
	        }

	        // if there's a rest argument, add that
	        if (node.rest) {
	            this.visitPattern({
	                type: "RestElement",
	                argument: node.rest
	            }, pattern => {
	                this.currentScope().__define(pattern,
	                    new ParameterDefinition(
	                        pattern,
	                        node,
	                        node.params.length,
	                        true
	                    ));
	            });
	        }

	        // In TypeScript there are a number of function-like constructs which have no body,
	        // so check it exists before traversing
	        if (node.body) {

	            // Skip BlockStatement to prevent creating BlockStatement scope.
	            if (node.body.type === Syntax.BlockStatement) {
	                this.visitChildren(node.body);
	            } else {
	                this.visit(node.body);
	            }
	        }

	        this.close(node);
	    }

	    visitClass(node) {
	        if (node.type === Syntax.ClassDeclaration) {
	            this.currentScope().__define(node.id,
	                new Definition(
	                    Variable.ClassName,
	                    node.id,
	                    node,
	                    null,
	                    null,
	                    null
	                ));
	        }

	        this.scopeManager.__nestClassScope(node);

	        if (node.id) {
	            this.currentScope().__define(node.id,
	                new Definition(
	                    Variable.ClassName,
	                    node.id,
	                    node
	                ));
	        }

	        this.visit(node.superClass);
	        this.visit(node.body);

	        this.close(node);
	    }

	    visitProperty(node) {
	        let previous;

	        if (node.computed) {
	            this.visit(node.key);
	        }

	        const isMethodDefinition = node.type === Syntax.MethodDefinition;

	        if (isMethodDefinition) {
	            previous = this.pushInnerMethodDefinition(true);
	        }
	        this.visit(node.value);
	        if (isMethodDefinition) {
	            this.popInnerMethodDefinition(previous);
	        }
	    }

	    visitForIn(node) {
	        if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
	            this.scopeManager.__nestForScope(node);
	        }

	        if (node.left.type === Syntax.VariableDeclaration) {
	            this.visit(node.left);
	            this.visitPattern(node.left.declarations[0].id, pattern => {
	                this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
	            });
	        } else {
	            this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
	                let maybeImplicitGlobal = null;

	                if (!this.currentScope().isStrict) {
	                    maybeImplicitGlobal = {
	                        pattern,
	                        node
	                    };
	                }
	                this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
	                this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
	            });
	        }
	        this.visit(node.right);
	        this.visit(node.body);

	        this.close(node);
	    }

	    visitVariableDeclaration(variableTargetScope, type, node, index) {

	        const decl = node.declarations[index];
	        const init = decl.init;

	        this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => {
	            variableTargetScope.__define(
	                pattern,
	                new Definition(
	                    type,
	                    pattern,
	                    decl,
	                    node,
	                    index,
	                    node.kind
	                )
	            );

	            this.referencingDefaultValue(pattern, info.assignments, null, true);
	            if (init) {
	                this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
	            }
	        });
	    }

	    AssignmentExpression(node) {
	        if (PatternVisitor.isPattern(node.left)) {
	            if (node.operator === "=") {
	                this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
	                    let maybeImplicitGlobal = null;

	                    if (!this.currentScope().isStrict) {
	                        maybeImplicitGlobal = {
	                            pattern,
	                            node
	                        };
	                    }
	                    this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
	                    this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
	                });
	            } else {
	                this.currentScope().__referencing(node.left, Reference.RW, node.right);
	            }
	        } else {
	            this.visit(node.left);
	        }
	        this.visit(node.right);
	    }

	    CatchClause(node) {
	        this.scopeManager.__nestCatchScope(node);

	        this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => {
	            this.currentScope().__define(pattern,
	                new Definition(
	                    Variable.CatchClause,
	                    pattern,
	                    node,
	                    null,
	                    null,
	                    null
	                ));
	            this.referencingDefaultValue(pattern, info.assignments, null, true);
	        });
	        this.visit(node.body);

	        this.close(node);
	    }

	    Program(node) {
	        this.scopeManager.__nestGlobalScope(node);

	        if (this.scopeManager.isGlobalReturn()) {

	            // Force strictness of GlobalScope to false when using node.js scope.
	            this.currentScope().isStrict = false;
	            this.scopeManager.__nestFunctionScope(node, false);
	        }

	        if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
	            this.scopeManager.__nestModuleScope(node);
	        }

	        if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
	            this.currentScope().isStrict = true;
	        }

	        this.visitChildren(node);
	        this.close(node);
	    }

	    Identifier(node) {
	        this.currentScope().__referencing(node);
	    }

	    // eslint-disable-next-line class-methods-use-this -- Desired as instance method
	    PrivateIdentifier() {

	        // Do nothing.
	    }

	    UpdateExpression(node) {
	        if (PatternVisitor.isPattern(node.argument)) {
	            this.currentScope().__referencing(node.argument, Reference.RW, null);
	        } else {
	            this.visitChildren(node);
	        }
	    }

	    MemberExpression(node) {
	        this.visit(node.object);
	        if (node.computed) {
	            this.visit(node.property);
	        }
	    }

	    Property(node) {
	        this.visitProperty(node);
	    }

	    PropertyDefinition(node) {
	        const { computed, key, value } = node;

	        if (computed) {
	            this.visit(key);
	        }
	        if (value) {
	            this.scopeManager.__nestClassFieldInitializerScope(value);
	            this.visit(value);
	            this.close(value);
	        }
	    }

	    StaticBlock(node) {
	        this.scopeManager.__nestClassStaticBlockScope(node);

	        this.visitChildren(node);

	        this.close(node);
	    }

	    MethodDefinition(node) {
	        this.visitProperty(node);
	    }

	    BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	    ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	    LabeledStatement(node) {
	        this.visit(node.body);
	    }

	    ForStatement(node) {

	        // Create ForStatement declaration.
	        // NOTE: In ES6, ForStatement dynamically generates
	        // per iteration environment. However, escope is
	        // a static analyzer, we only generate one scope for ForStatement.
	        if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
	            this.scopeManager.__nestForScope(node);
	        }

	        this.visitChildren(node);

	        this.close(node);
	    }

	    ClassExpression(node) {
	        this.visitClass(node);
	    }

	    ClassDeclaration(node) {
	        this.visitClass(node);
	    }

	    CallExpression(node) {

	        // Check this is direct call to eval
	        if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {

	            // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
	            // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
	            this.currentScope().variableScope.__detectEval();
	        }
	        this.visitChildren(node);
	    }

	    BlockStatement(node) {
	        if (this.scopeManager.__isES6()) {
	            this.scopeManager.__nestBlockScope(node);
	        }

	        this.visitChildren(node);

	        this.close(node);
	    }

	    ThisExpression() {
	        this.currentScope().variableScope.__detectThis();
	    }

	    WithStatement(node) {
	        this.visit(node.object);

	        // Then nest scope for WithStatement.
	        this.scopeManager.__nestWithScope(node);

	        this.visit(node.body);

	        this.close(node);
	    }

	    VariableDeclaration(node) {
	        const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope();

	        for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
	            const decl = node.declarations[i];

	            this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
	            if (decl.init) {
	                this.visit(decl.init);
	            }
	        }
	    }

	    // sec 13.11.8
	    SwitchStatement(node) {
	        this.visit(node.discriminant);

	        if (this.scopeManager.__isES6()) {
	            this.scopeManager.__nestSwitchScope(node);
	        }

	        for (let i = 0, iz = node.cases.length; i < iz; ++i) {
	            this.visit(node.cases[i]);
	        }

	        this.close(node);
	    }

	    FunctionDeclaration(node) {
	        this.visitFunction(node);
	    }

	    FunctionExpression(node) {
	        this.visitFunction(node);
	    }

	    ForOfStatement(node) {
	        this.visitForIn(node);
	    }

	    ForInStatement(node) {
	        this.visitForIn(node);
	    }

	    ArrowFunctionExpression(node) {
	        this.visitFunction(node);
	    }

	    ImportDeclaration(node) {
	        assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");

	        const importer = new Importer(node, this);

	        importer.visit(node);
	    }

	    visitExportDeclaration(node) {
	        if (node.source) {
	            return;
	        }
	        if (node.declaration) {
	            this.visit(node.declaration);
	            return;
	        }

	        this.visitChildren(node);
	    }

	    // TODO: ExportDeclaration doesn't exist. for bc?
	    ExportDeclaration(node) {
	        this.visitExportDeclaration(node);
	    }

	    ExportAllDeclaration(node) {
	        this.visitExportDeclaration(node);
	    }

	    ExportDefaultDeclaration(node) {
	        this.visitExportDeclaration(node);
	    }

	    ExportNamedDeclaration(node) {
	        this.visitExportDeclaration(node);
	    }

	    ExportSpecifier(node) {

	        // TODO: `node.id` doesn't exist. for bc?
	        const local = (node.id || node.local);

	        this.visit(local);
	    }

	    MetaProperty() { // eslint-disable-line class-methods-use-this -- Desired as instance method

	        // do nothing.
	    }

	    JSXIdentifier(node) {

	        // Special case: "this" should not count as a reference
	        if (this.scopeManager.__isJSXEnabled() && node.name !== "this") {
	            this.currentScope().__referencing(node);
	        }
	    }

	    JSXMemberExpression(node) {
	        this.visit(node.object);
	    }

	    JSXElement(node) {
	        if (this.scopeManager.__isJSXEnabled()) {
	            this.visit(node.openingElement);
	            node.children.forEach(this.visit, this);
	        } else {
	            this.visitChildren(node);
	        }
	    }

	    JSXOpeningElement(node) {
	        if (this.scopeManager.__isJSXEnabled()) {

	            const nameNode = node.name;
	            const isComponentName = nameNode.type === "JSXIdentifier" && nameNode.name[0].toUpperCase() === nameNode.name[0];
	            const isComponent = isComponentName || nameNode.type === "JSXMemberExpression";

	            // we only want to visit JSXIdentifier nodes if they are capitalized
	            if (isComponent) {
	                this.visit(nameNode);
	            }
	        }

	        node.attributes.forEach(this.visit, this);
	    }

	    JSXAttribute(node) {
	        if (node.value) {
	            this.visit(node.value);
	        }
	    }

	    JSXExpressionContainer(node) {
	        this.visit(node.expression);
	    }

	    JSXNamespacedName(node) {
	        this.visit(node.namespace);
	        this.visit(node.name);
	    }
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	const version = "8.3.0";

	/*
	  Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
	  Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
	  Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>

	  Redistribution and use in source and binary forms, with or without
	  modification, are permitted provided that the following conditions are met:

	    * Redistributions of source code must retain the above copyright
	      notice, this list of conditions and the following disclaimer.
	    * Redistributions in binary form must reproduce the above copyright
	      notice, this list of conditions and the following disclaimer in the
	      documentation and/or other materials provided with the distribution.

	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	/**
	 * Set the default options
	 * @returns {Object} options
	 */
	function defaultOptions() {
	    return {
	        optimistic: false,
	        nodejsScope: false,
	        impliedStrict: false,
	        sourceType: "script", // one of ['script', 'module', 'commonjs']
	        ecmaVersion: 5,
	        childVisitorKeys: null,
	        fallback: "iteration"
	    };
	}

	/**
	 * Preform deep update on option object
	 * @param {Object} target Options
	 * @param {Object} override Updates
	 * @returns {Object} Updated options
	 */
	function updateDeeply(target, override) {

	    /**
	     * Is hash object
	     * @param {Object} value Test value
	     * @returns {boolean} Result
	     */
	    function isHashObject(value) {
	        return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
	    }

	    for (const key in override) {
	        if (Object.hasOwn(override, key)) {
	            const val = override[key];

	            if (isHashObject(val)) {
	                if (isHashObject(target[key])) {
	                    updateDeeply(target[key], val);
	                } else {
	                    target[key] = updateDeeply({}, val);
	                }
	            } else {
	                target[key] = val;
	            }
	        }
	    }
	    return target;
	}

	/**
	 * Main interface function. Takes an Espree syntax tree and returns the
	 * analyzed scopes.
	 * @function analyze
	 * @param {espree.Tree} tree Abstract Syntax Tree
	 * @param {Object} providedOptions Options that tailor the scope analysis
	 * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
	 * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
	 * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
	 * script is executed under node.js environment. When enabled, escope adds
	 * a function scope immediately following the global scope.
	 * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
	 * (if ecmaVersion >= 5).
	 * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
	 * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
	 * @param {boolean} [providedOptions.jsx=false] support JSX references
	 * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
	 * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
	 * @returns {ScopeManager} ScopeManager
	 */
	function analyze(tree, providedOptions) {
	    const options = updateDeeply(defaultOptions(), providedOptions);
	    const scopeManager = new ScopeManager(options);
	    const referencer = new Referencer(options, scopeManager);

	    referencer.visit(tree);

	    assert(scopeManager.__currentScope === null, "currentScope should be null.");

	    return scopeManager;
	}

	/* vim: set sw=4 ts=4 et tw=80 : */

	eslintScope.Definition = Definition;
	eslintScope.PatternVisitor = PatternVisitor;
	eslintScope.Reference = Reference;
	eslintScope.Referencer = Referencer;
	eslintScope.Scope = Scope;
	eslintScope.ScopeManager = ScopeManager;
	eslintScope.Variable = Variable;
	eslintScope.analyze = analyze;
	eslintScope.version = version;
	
	return eslintScope;
}

var eslintVisitorKeys$2 = {};

var hasRequiredEslintVisitorKeys$2;

function requireEslintVisitorKeys$2 () {
	if (hasRequiredEslintVisitorKeys$2) return eslintVisitorKeys$2;
	hasRequiredEslintVisitorKeys$2 = 1;

	/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
	   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
	*/
	/**
	 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
	 */
	/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */

	/**
	 * @type {VisitorKeys}
	 */
	const KEYS = {
	    ArrayExpression: [
	        "elements"
	    ],
	    ArrayPattern: [
	        "elements"
	    ],
	    ArrowFunctionExpression: [
	        "params",
	        "body"
	    ],
	    AssignmentExpression: [
	        "left",
	        "right"
	    ],
	    AssignmentPattern: [
	        "left",
	        "right"
	    ],
	    AwaitExpression: [
	        "argument"
	    ],
	    BinaryExpression: [
	        "left",
	        "right"
	    ],
	    BlockStatement: [
	        "body"
	    ],
	    BreakStatement: [
	        "label"
	    ],
	    CallExpression: [
	        "callee",
	        "arguments"
	    ],
	    CatchClause: [
	        "param",
	        "body"
	    ],
	    ChainExpression: [
	        "expression"
	    ],
	    ClassBody: [
	        "body"
	    ],
	    ClassDeclaration: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ClassExpression: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ConditionalExpression: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ContinueStatement: [
	        "label"
	    ],
	    DebuggerStatement: [],
	    DoWhileStatement: [
	        "body",
	        "test"
	    ],
	    EmptyStatement: [],
	    ExperimentalRestProperty: [
	        "argument"
	    ],
	    ExperimentalSpreadProperty: [
	        "argument"
	    ],
	    ExportAllDeclaration: [
	        "exported",
	        "source",
	        "attributes"
	    ],
	    ExportDefaultDeclaration: [
	        "declaration"
	    ],
	    ExportNamedDeclaration: [
	        "declaration",
	        "specifiers",
	        "source",
	        "attributes"
	    ],
	    ExportSpecifier: [
	        "exported",
	        "local"
	    ],
	    ExpressionStatement: [
	        "expression"
	    ],
	    ForInStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForOfStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForStatement: [
	        "init",
	        "test",
	        "update",
	        "body"
	    ],
	    FunctionDeclaration: [
	        "id",
	        "params",
	        "body"
	    ],
	    FunctionExpression: [
	        "id",
	        "params",
	        "body"
	    ],
	    Identifier: [],
	    IfStatement: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ImportAttribute: [
	        "key",
	        "value"
	    ],
	    ImportDeclaration: [
	        "specifiers",
	        "source",
	        "attributes"
	    ],
	    ImportDefaultSpecifier: [
	        "local"
	    ],
	    ImportExpression: [
	        "source",
	        "options"
	    ],
	    ImportNamespaceSpecifier: [
	        "local"
	    ],
	    ImportSpecifier: [
	        "imported",
	        "local"
	    ],
	    JSXAttribute: [
	        "name",
	        "value"
	    ],
	    JSXClosingElement: [
	        "name"
	    ],
	    JSXClosingFragment: [],
	    JSXElement: [
	        "openingElement",
	        "children",
	        "closingElement"
	    ],
	    JSXEmptyExpression: [],
	    JSXExpressionContainer: [
	        "expression"
	    ],
	    JSXFragment: [
	        "openingFragment",
	        "children",
	        "closingFragment"
	    ],
	    JSXIdentifier: [],
	    JSXMemberExpression: [
	        "object",
	        "property"
	    ],
	    JSXNamespacedName: [
	        "namespace",
	        "name"
	    ],
	    JSXOpeningElement: [
	        "name",
	        "attributes"
	    ],
	    JSXOpeningFragment: [],
	    JSXSpreadAttribute: [
	        "argument"
	    ],
	    JSXSpreadChild: [
	        "expression"
	    ],
	    JSXText: [],
	    LabeledStatement: [
	        "label",
	        "body"
	    ],
	    Literal: [],
	    LogicalExpression: [
	        "left",
	        "right"
	    ],
	    MemberExpression: [
	        "object",
	        "property"
	    ],
	    MetaProperty: [
	        "meta",
	        "property"
	    ],
	    MethodDefinition: [
	        "key",
	        "value"
	    ],
	    NewExpression: [
	        "callee",
	        "arguments"
	    ],
	    ObjectExpression: [
	        "properties"
	    ],
	    ObjectPattern: [
	        "properties"
	    ],
	    PrivateIdentifier: [],
	    Program: [
	        "body"
	    ],
	    Property: [
	        "key",
	        "value"
	    ],
	    PropertyDefinition: [
	        "key",
	        "value"
	    ],
	    RestElement: [
	        "argument"
	    ],
	    ReturnStatement: [
	        "argument"
	    ],
	    SequenceExpression: [
	        "expressions"
	    ],
	    SpreadElement: [
	        "argument"
	    ],
	    StaticBlock: [
	        "body"
	    ],
	    Super: [],
	    SwitchCase: [
	        "test",
	        "consequent"
	    ],
	    SwitchStatement: [
	        "discriminant",
	        "cases"
	    ],
	    TaggedTemplateExpression: [
	        "tag",
	        "quasi"
	    ],
	    TemplateElement: [],
	    TemplateLiteral: [
	        "quasis",
	        "expressions"
	    ],
	    ThisExpression: [],
	    ThrowStatement: [
	        "argument"
	    ],
	    TryStatement: [
	        "block",
	        "handler",
	        "finalizer"
	    ],
	    UnaryExpression: [
	        "argument"
	    ],
	    UpdateExpression: [
	        "argument"
	    ],
	    VariableDeclaration: [
	        "declarations"
	    ],
	    VariableDeclarator: [
	        "id",
	        "init"
	    ],
	    WhileStatement: [
	        "test",
	        "body"
	    ],
	    WithStatement: [
	        "object",
	        "body"
	    ],
	    YieldExpression: [
	        "argument"
	    ]
	};

	// Types.
	const NODE_TYPES = Object.keys(KEYS);

	// Freeze the keys.
	for (const type of NODE_TYPES) {
	    Object.freeze(KEYS[type]);
	}
	Object.freeze(KEYS);

	/**
	 * @author Toru Nagashima <https://github.com/mysticatea>
	 * See LICENSE file in root directory for full license.
	 */

	/**
	 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
	 */

	// List to ignore keys.
	const KEY_BLACKLIST = new Set([
	    "parent",
	    "leadingComments",
	    "trailingComments"
	]);

	/**
	 * Check whether a given key should be used or not.
	 * @param {string} key The key to check.
	 * @returns {boolean} `true` if the key should be used.
	 */
	function filterKey(key) {
	    return !KEY_BLACKLIST.has(key) && key[0] !== "_";
	}


	/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
	   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
	*/
	/**
	 * Get visitor keys of a given node.
	 * @param {Object} node The AST node to get keys.
	 * @returns {readonly string[]} Visitor keys of the node.
	 */
	function getKeys(node) {
	    return Object.keys(node).filter(filterKey);
	}
	/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */

	/**
	 * Make the union set with `KEYS` and given keys.
	 * @param {VisitorKeys} additionalKeys The additional keys.
	 * @returns {VisitorKeys} The union set.
	 */
	function unionWith(additionalKeys) {
	    const retv = /** @type {{ [type: string]: ReadonlyArray<string> }} */
	        (Object.assign({}, KEYS));

	    for (const type of Object.keys(additionalKeys)) {
	        if (Object.hasOwn(retv, type)) {
	            const keys = new Set(additionalKeys[type]);

	            for (const key of retv[type]) {
	                keys.add(key);
	            }

	            retv[type] = Object.freeze(Array.from(keys));
	        } else {
	            retv[type] = Object.freeze(Array.from(additionalKeys[type]));
	        }
	    }

	    return Object.freeze(retv);
	}

	eslintVisitorKeys$2.KEYS = KEYS;
	eslintVisitorKeys$2.getKeys = getKeys;
	eslintVisitorKeys$2.unionWith = unionWith;
	return eslintVisitorKeys$2;
}

var espree = {};

var acorn = {exports: {}};

var hasRequiredAcorn;

function requireAcorn () {
	if (hasRequiredAcorn) return acorn.exports;
	hasRequiredAcorn = 1;
	(function (module, exports) {
		(function (global, factory) {
		  factory(exports) ;
		})(this, (function (exports) {
		  // This file was generated. Do not modify manually!
		  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];

		  // This file was generated. Do not modify manually!
		  var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];

		  // This file was generated. Do not modify manually!
		  var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";

		  // This file was generated. Do not modify manually!
		  var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\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-\u088e\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\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\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-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";

		  // These are a run-length and offset encoded representation of the
		  // >0xffff code points that are a valid part of identifiers. The
		  // offset starts at 0x10000, and each pair of numbers represents an
		  // offset to the next range, and then a size of the range.

		  // Reserved word lists for various dialects of the language

		  var reservedWords = {
		    3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
		    5: "class enum extends super const export import",
		    6: "enum",
		    strict: "implements interface let package private protected public static yield",
		    strictBind: "eval arguments"
		  };

		  // And the keywords

		  var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";

		  var keywords$1 = {
		    5: ecma5AndLessKeywords,
		    "5module": ecma5AndLessKeywords + " export import",
		    6: ecma5AndLessKeywords + " const class extends export import super"
		  };

		  var keywordRelationalOperator = /^in(stanceof)?$/;

		  // ## Character categories

		  var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
		  var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");

		  // This has a complexity linear to the value of the code. The
		  // assumption is that looking up astral identifier characters is
		  // rare.
		  function isInAstralSet(code, set) {
		    var pos = 0x10000;
		    for (var i = 0; i < set.length; i += 2) {
		      pos += set[i];
		      if (pos > code) { return false }
		      pos += set[i + 1];
		      if (pos >= code) { return true }
		    }
		    return false
		  }

		  // Test whether a given character code starts an identifier.

		  function isIdentifierStart(code, astral) {
		    if (code < 65) { return code === 36 }
		    if (code < 91) { return true }
		    if (code < 97) { return code === 95 }
		    if (code < 123) { return true }
		    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
		    if (astral === false) { return false }
		    return isInAstralSet(code, astralIdentifierStartCodes)
		  }

		  // Test whether a given character is part of an identifier.

		  function isIdentifierChar(code, astral) {
		    if (code < 48) { return code === 36 }
		    if (code < 58) { return true }
		    if (code < 65) { return false }
		    if (code < 91) { return true }
		    if (code < 97) { return code === 95 }
		    if (code < 123) { return true }
		    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
		    if (astral === false) { return false }
		    return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
		  }

		  // ## Token types

		  // The assignment of fine-grained, information-carrying type objects
		  // allows the tokenizer to store the information it has about a
		  // token in a way that is very cheap for the parser to look up.

		  // All token type variables start with an underscore, to make them
		  // easy to recognize.

		  // The `beforeExpr` property is used to disambiguate between regular
		  // expressions and divisions. It is set on all token types that can
		  // be followed by an expression (thus, a slash after them would be a
		  // regular expression).
		  //
		  // The `startsExpr` property is used to check if the token ends a
		  // `yield` expression. It is set on all token types that either can
		  // directly start an expression (like a quotation mark) or can
		  // continue an expression (like the body of a string).
		  //
		  // `isLoop` marks a keyword as starting a loop, which is important
		  // to know when parsing a label, in order to allow or disallow
		  // continue jumps to that label.

		  var TokenType = function TokenType(label, conf) {
		    if ( conf === void 0 ) conf = {};

		    this.label = label;
		    this.keyword = conf.keyword;
		    this.beforeExpr = !!conf.beforeExpr;
		    this.startsExpr = !!conf.startsExpr;
		    this.isLoop = !!conf.isLoop;
		    this.isAssign = !!conf.isAssign;
		    this.prefix = !!conf.prefix;
		    this.postfix = !!conf.postfix;
		    this.binop = conf.binop || null;
		    this.updateContext = null;
		  };

		  function binop(name, prec) {
		    return new TokenType(name, {beforeExpr: true, binop: prec})
		  }
		  var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};

		  // Map keyword names to token types.

		  var keywords = {};

		  // Succinct definitions of keyword token types
		  function kw(name, options) {
		    if ( options === void 0 ) options = {};

		    options.keyword = name;
		    return keywords[name] = new TokenType(name, options)
		  }

		  var types$1 = {
		    num: new TokenType("num", startsExpr),
		    regexp: new TokenType("regexp", startsExpr),
		    string: new TokenType("string", startsExpr),
		    name: new TokenType("name", startsExpr),
		    privateId: new TokenType("privateId", startsExpr),
		    eof: new TokenType("eof"),

		    // Punctuation token types.
		    bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
		    bracketR: new TokenType("]"),
		    braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
		    braceR: new TokenType("}"),
		    parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
		    parenR: new TokenType(")"),
		    comma: new TokenType(",", beforeExpr),
		    semi: new TokenType(";", beforeExpr),
		    colon: new TokenType(":", beforeExpr),
		    dot: new TokenType("."),
		    question: new TokenType("?", beforeExpr),
		    questionDot: new TokenType("?."),
		    arrow: new TokenType("=>", beforeExpr),
		    template: new TokenType("template"),
		    invalidTemplate: new TokenType("invalidTemplate"),
		    ellipsis: new TokenType("...", beforeExpr),
		    backQuote: new TokenType("`", startsExpr),
		    dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),

		    // Operators. These carry several kinds of properties to help the
		    // parser use them properly (the presence of these properties is
		    // what categorizes them as operators).
		    //
		    // `binop`, when present, specifies that this operator is a binary
		    // operator, and will refer to its precedence.
		    //
		    // `prefix` and `postfix` mark the operator as a prefix or postfix
		    // unary operator.
		    //
		    // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
		    // binary operators with a very low precedence, that should result
		    // in AssignmentExpression nodes.

		    eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
		    assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
		    incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
		    prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
		    logicalOR: binop("||", 1),
		    logicalAND: binop("&&", 2),
		    bitwiseOR: binop("|", 3),
		    bitwiseXOR: binop("^", 4),
		    bitwiseAND: binop("&", 5),
		    equality: binop("==/!=/===/!==", 6),
		    relational: binop("</>/<=/>=", 7),
		    bitShift: binop("<</>>/>>>", 8),
		    plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
		    modulo: binop("%", 10),
		    star: binop("*", 10),
		    slash: binop("/", 10),
		    starstar: new TokenType("**", {beforeExpr: true}),
		    coalesce: binop("??", 1),

		    // Keyword token types.
		    _break: kw("break"),
		    _case: kw("case", beforeExpr),
		    _catch: kw("catch"),
		    _continue: kw("continue"),
		    _debugger: kw("debugger"),
		    _default: kw("default", beforeExpr),
		    _do: kw("do", {isLoop: true, beforeExpr: true}),
		    _else: kw("else", beforeExpr),
		    _finally: kw("finally"),
		    _for: kw("for", {isLoop: true}),
		    _function: kw("function", startsExpr),
		    _if: kw("if"),
		    _return: kw("return", beforeExpr),
		    _switch: kw("switch"),
		    _throw: kw("throw", beforeExpr),
		    _try: kw("try"),
		    _var: kw("var"),
		    _const: kw("const"),
		    _while: kw("while", {isLoop: true}),
		    _with: kw("with"),
		    _new: kw("new", {beforeExpr: true, startsExpr: true}),
		    _this: kw("this", startsExpr),
		    _super: kw("super", startsExpr),
		    _class: kw("class", startsExpr),
		    _extends: kw("extends", beforeExpr),
		    _export: kw("export"),
		    _import: kw("import", startsExpr),
		    _null: kw("null", startsExpr),
		    _true: kw("true", startsExpr),
		    _false: kw("false", startsExpr),
		    _in: kw("in", {beforeExpr: true, binop: 7}),
		    _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
		    _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
		    _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
		    _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
		  };

		  // Matches a whole line break (where CRLF is considered a single
		  // line break). Used to count lines.

		  var lineBreak = /\r\n?|\n|\u2028|\u2029/;
		  var lineBreakG = new RegExp(lineBreak.source, "g");

		  function isNewLine(code) {
		    return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
		  }

		  function nextLineBreak(code, from, end) {
		    if ( end === void 0 ) end = code.length;

		    for (var i = from; i < end; i++) {
		      var next = code.charCodeAt(i);
		      if (isNewLine(next))
		        { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
		    }
		    return -1
		  }

		  var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;

		  var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;

		  var ref = Object.prototype;
		  var hasOwnProperty = ref.hasOwnProperty;
		  var toString = ref.toString;

		  var hasOwn = Object.hasOwn || (function (obj, propName) { return (
		    hasOwnProperty.call(obj, propName)
		  ); });

		  var isArray = Array.isArray || (function (obj) { return (
		    toString.call(obj) === "[object Array]"
		  ); });

		  var regexpCache = Object.create(null);

		  function wordsRegexp(words) {
		    return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
		  }

		  function codePointToString(code) {
		    // UTF-16 Decoding
		    if (code <= 0xFFFF) { return String.fromCharCode(code) }
		    code -= 0x10000;
		    return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
		  }

		  var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;

		  // These are used when `options.locations` is on, for the
		  // `startLoc` and `endLoc` properties.

		  var Position = function Position(line, col) {
		    this.line = line;
		    this.column = col;
		  };

		  Position.prototype.offset = function offset (n) {
		    return new Position(this.line, this.column + n)
		  };

		  var SourceLocation = function SourceLocation(p, start, end) {
		    this.start = start;
		    this.end = end;
		    if (p.sourceFile !== null) { this.source = p.sourceFile; }
		  };

		  // The `getLineInfo` function is mostly useful when the
		  // `locations` option is off (for performance reasons) and you
		  // want to find the line/column position for a given character
		  // offset. `input` should be the code string that the offset refers
		  // into.

		  function getLineInfo(input, offset) {
		    for (var line = 1, cur = 0;;) {
		      var nextBreak = nextLineBreak(input, cur, offset);
		      if (nextBreak < 0) { return new Position(line, offset - cur) }
		      ++line;
		      cur = nextBreak;
		    }
		  }

		  // A second argument must be given to configure the parser process.
		  // These options are recognized (only `ecmaVersion` is required):

		  var defaultOptions = {
		    // `ecmaVersion` indicates the ECMAScript version to parse. Must be
		    // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
		    // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
		    // (the latest version the library supports). This influences
		    // support for strict mode, the set of reserved words, and support
		    // for new syntax features.
		    ecmaVersion: null,
		    // `sourceType` indicates the mode the code should be parsed in.
		    // Can be either `"script"` or `"module"`. This influences global
		    // strict mode and parsing of `import` and `export` declarations.
		    sourceType: "script",
		    // `onInsertedSemicolon` can be a callback that will be called when
		    // a semicolon is automatically inserted. It will be passed the
		    // position of the inserted semicolon as an offset, and if
		    // `locations` is enabled, it is given the location as a `{line,
		    // column}` object as second argument.
		    onInsertedSemicolon: null,
		    // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
		    // trailing commas.
		    onTrailingComma: null,
		    // By default, reserved words are only enforced if ecmaVersion >= 5.
		    // Set `allowReserved` to a boolean value to explicitly turn this on
		    // an off. When this option has the value "never", reserved words
		    // and keywords can also not be used as property names.
		    allowReserved: null,
		    // When enabled, a return at the top level is not considered an
		    // error.
		    allowReturnOutsideFunction: false,
		    // When enabled, import/export statements are not constrained to
		    // appearing at the top of the program, and an import.meta expression
		    // in a script isn't considered an error.
		    allowImportExportEverywhere: false,
		    // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
		    // When enabled, await identifiers are allowed to appear at the top-level scope,
		    // but they are still not allowed in non-async functions.
		    allowAwaitOutsideFunction: null,
		    // When enabled, super identifiers are not constrained to
		    // appearing in methods and do not raise an error when they appear elsewhere.
		    allowSuperOutsideMethod: null,
		    // When enabled, hashbang directive in the beginning of file is
		    // allowed and treated as a line comment. Enabled by default when
		    // `ecmaVersion` >= 2023.
		    allowHashBang: false,
		    // By default, the parser will verify that private properties are
		    // only used in places where they are valid and have been declared.
		    // Set this to false to turn such checks off.
		    checkPrivateFields: true,
		    // When `locations` is on, `loc` properties holding objects with
		    // `start` and `end` properties in `{line, column}` form (with
		    // line being 1-based and column 0-based) will be attached to the
		    // nodes.
		    locations: false,
		    // A function can be passed as `onToken` option, which will
		    // cause Acorn to call that function with object in the same
		    // format as tokens returned from `tokenizer().getToken()`. Note
		    // that you are not allowed to call the parser from the
		    // callback—that will corrupt its internal state.
		    onToken: null,
		    // A function can be passed as `onComment` option, which will
		    // cause Acorn to call that function with `(block, text, start,
		    // end)` parameters whenever a comment is skipped. `block` is a
		    // boolean indicating whether this is a block (`/* */`) comment,
		    // `text` is the content of the comment, and `start` and `end` are
		    // character offsets that denote the start and end of the comment.
		    // When the `locations` option is on, two more parameters are
		    // passed, the full `{line, column}` locations of the start and
		    // end of the comments. Note that you are not allowed to call the
		    // parser from the callback—that will corrupt its internal state.
		    // When this option has an array as value, objects representing the
		    // comments are pushed to it.
		    onComment: null,
		    // Nodes have their start and end characters offsets recorded in
		    // `start` and `end` properties (directly on the node, rather than
		    // the `loc` object, which holds line/column data. To also add a
		    // [semi-standardized][range] `range` property holding a `[start,
		    // end]` array with the same numbers, set the `ranges` option to
		    // `true`.
		    //
		    // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
		    ranges: false,
		    // It is possible to parse multiple files into a single AST by
		    // passing the tree produced by parsing the first file as
		    // `program` option in subsequent parses. This will add the
		    // toplevel forms of the parsed file to the `Program` (top) node
		    // of an existing parse tree.
		    program: null,
		    // When `locations` is on, you can pass this to record the source
		    // file in every node's `loc` object.
		    sourceFile: null,
		    // This value, if given, is stored in every node, whether
		    // `locations` is on or off.
		    directSourceFile: null,
		    // When enabled, parenthesized expressions are represented by
		    // (non-standard) ParenthesizedExpression nodes
		    preserveParens: false
		  };

		  // Interpret and default an options object

		  var warnedAboutEcmaVersion = false;

		  function getOptions(opts) {
		    var options = {};

		    for (var opt in defaultOptions)
		      { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }

		    if (options.ecmaVersion === "latest") {
		      options.ecmaVersion = 1e8;
		    } else if (options.ecmaVersion == null) {
		      if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
		        warnedAboutEcmaVersion = true;
		        console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
		      }
		      options.ecmaVersion = 11;
		    } else if (options.ecmaVersion >= 2015) {
		      options.ecmaVersion -= 2009;
		    }

		    if (options.allowReserved == null)
		      { options.allowReserved = options.ecmaVersion < 5; }

		    if (!opts || opts.allowHashBang == null)
		      { options.allowHashBang = options.ecmaVersion >= 14; }

		    if (isArray(options.onToken)) {
		      var tokens = options.onToken;
		      options.onToken = function (token) { return tokens.push(token); };
		    }
		    if (isArray(options.onComment))
		      { options.onComment = pushComment(options, options.onComment); }

		    return options
		  }

		  function pushComment(options, array) {
		    return function(block, text, start, end, startLoc, endLoc) {
		      var comment = {
		        type: block ? "Block" : "Line",
		        value: text,
		        start: start,
		        end: end
		      };
		      if (options.locations)
		        { comment.loc = new SourceLocation(this, startLoc, endLoc); }
		      if (options.ranges)
		        { comment.range = [start, end]; }
		      array.push(comment);
		    }
		  }

		  // Each scope gets a bitset that may contain these flags
		  var
		      SCOPE_TOP = 1,
		      SCOPE_FUNCTION = 2,
		      SCOPE_ASYNC = 4,
		      SCOPE_GENERATOR = 8,
		      SCOPE_ARROW = 16,
		      SCOPE_SIMPLE_CATCH = 32,
		      SCOPE_SUPER = 64,
		      SCOPE_DIRECT_SUPER = 128,
		      SCOPE_CLASS_STATIC_BLOCK = 256,
		      SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;

		  function functionFlags(async, generator) {
		    return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
		  }

		  // Used in checkLVal* and declareName to determine the type of a binding
		  var
		      BIND_NONE = 0, // Not a binding
		      BIND_VAR = 1, // Var-style binding
		      BIND_LEXICAL = 2, // Let- or const-style binding
		      BIND_FUNCTION = 3, // Function declaration
		      BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
		      BIND_OUTSIDE = 5; // Special case for function names as bound inside the function

		  var Parser = function Parser(options, input, startPos) {
		    this.options = options = getOptions(options);
		    this.sourceFile = options.sourceFile;
		    this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
		    var reserved = "";
		    if (options.allowReserved !== true) {
		      reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
		      if (options.sourceType === "module") { reserved += " await"; }
		    }
		    this.reservedWords = wordsRegexp(reserved);
		    var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
		    this.reservedWordsStrict = wordsRegexp(reservedStrict);
		    this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
		    this.input = String(input);

		    // Used to signal to callers of `readWord1` whether the word
		    // contained any escape sequences. This is needed because words with
		    // escape sequences must not be interpreted as keywords.
		    this.containsEsc = false;

		    // Set up token state

		    // The current position of the tokenizer in the input.
		    if (startPos) {
		      this.pos = startPos;
		      this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
		      this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
		    } else {
		      this.pos = this.lineStart = 0;
		      this.curLine = 1;
		    }

		    // Properties of the current token:
		    // Its type
		    this.type = types$1.eof;
		    // For tokens that include more information than their type, the value
		    this.value = null;
		    // Its start and end offset
		    this.start = this.end = this.pos;
		    // And, if locations are used, the {line, column} object
		    // corresponding to those offsets
		    this.startLoc = this.endLoc = this.curPosition();

		    // Position information for the previous token
		    this.lastTokEndLoc = this.lastTokStartLoc = null;
		    this.lastTokStart = this.lastTokEnd = this.pos;

		    // The context stack is used to superficially track syntactic
		    // context to predict whether a regular expression is allowed in a
		    // given position.
		    this.context = this.initialContext();
		    this.exprAllowed = true;

		    // Figure out if it's a module code.
		    this.inModule = options.sourceType === "module";
		    this.strict = this.inModule || this.strictDirective(this.pos);

		    // Used to signify the start of a potential arrow function
		    this.potentialArrowAt = -1;
		    this.potentialArrowInForAwait = false;

		    // Positions to delayed-check that yield/await does not exist in default parameters.
		    this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
		    // Labels in scope.
		    this.labels = [];
		    // Thus-far undefined exports.
		    this.undefinedExports = Object.create(null);

		    // If enabled, skip leading hashbang line.
		    if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
		      { this.skipLineComment(2); }

		    // Scope tracking for duplicate variable names (see scope.js)
		    this.scopeStack = [];
		    this.enterScope(SCOPE_TOP);

		    // For RegExp validation
		    this.regexpState = null;

		    // The stack of private names.
		    // Each element has two properties: 'declared' and 'used'.
		    // When it exited from the outermost class definition, all used private names must be declared.
		    this.privateNameStack = [];
		  };

		  var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };

		  Parser.prototype.parse = function parse () {
		    var node = this.options.program || this.startNode();
		    this.nextToken();
		    return this.parseTopLevel(node)
		  };

		  prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };

		  prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };

		  prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };

		  prototypeAccessors.canAwait.get = function () {
		    for (var i = this.scopeStack.length - 1; i >= 0; i--) {
		      var scope = this.scopeStack[i];
		      if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }
		      if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }
		    }
		    return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
		  };

		  prototypeAccessors.allowSuper.get = function () {
		    var ref = this.currentThisScope();
		      var flags = ref.flags;
		      var inClassFieldInit = ref.inClassFieldInit;
		    return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
		  };

		  prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };

		  prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };

		  prototypeAccessors.allowNewDotTarget.get = function () {
		    var ref = this.currentThisScope();
		      var flags = ref.flags;
		      var inClassFieldInit = ref.inClassFieldInit;
		    return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit
		  };

		  prototypeAccessors.inClassStaticBlock.get = function () {
		    return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
		  };

		  Parser.extend = function extend () {
		      var plugins = [], len = arguments.length;
		      while ( len-- ) plugins[ len ] = arguments[ len ];

		    var cls = this;
		    for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
		    return cls
		  };

		  Parser.parse = function parse (input, options) {
		    return new this(options, input).parse()
		  };

		  Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
		    var parser = new this(options, input, pos);
		    parser.nextToken();
		    return parser.parseExpression()
		  };

		  Parser.tokenizer = function tokenizer (input, options) {
		    return new this(options, input)
		  };

		  Object.defineProperties( Parser.prototype, prototypeAccessors );

		  var pp$9 = Parser.prototype;

		  // ## Parser utilities

		  var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
		  pp$9.strictDirective = function(start) {
		    if (this.options.ecmaVersion < 5) { return false }
		    for (;;) {
		      // Try to find string literal.
		      skipWhiteSpace.lastIndex = start;
		      start += skipWhiteSpace.exec(this.input)[0].length;
		      var match = literal.exec(this.input.slice(start));
		      if (!match) { return false }
		      if ((match[1] || match[2]) === "use strict") {
		        skipWhiteSpace.lastIndex = start + match[0].length;
		        var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
		        var next = this.input.charAt(end);
		        return next === ";" || next === "}" ||
		          (lineBreak.test(spaceAfter[0]) &&
		           !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
		      }
		      start += match[0].length;

		      // Skip semicolon, if any.
		      skipWhiteSpace.lastIndex = start;
		      start += skipWhiteSpace.exec(this.input)[0].length;
		      if (this.input[start] === ";")
		        { start++; }
		    }
		  };

		  // Predicate that tests whether the next token is of the given
		  // type, and if yes, consumes it as a side effect.

		  pp$9.eat = function(type) {
		    if (this.type === type) {
		      this.next();
		      return true
		    } else {
		      return false
		    }
		  };

		  // Tests whether parsed token is a contextual keyword.

		  pp$9.isContextual = function(name) {
		    return this.type === types$1.name && this.value === name && !this.containsEsc
		  };

		  // Consumes contextual keyword if possible.

		  pp$9.eatContextual = function(name) {
		    if (!this.isContextual(name)) { return false }
		    this.next();
		    return true
		  };

		  // Asserts that following token is given contextual keyword.

		  pp$9.expectContextual = function(name) {
		    if (!this.eatContextual(name)) { this.unexpected(); }
		  };

		  // Test whether a semicolon can be inserted at the current position.

		  pp$9.canInsertSemicolon = function() {
		    return this.type === types$1.eof ||
		      this.type === types$1.braceR ||
		      lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
		  };

		  pp$9.insertSemicolon = function() {
		    if (this.canInsertSemicolon()) {
		      if (this.options.onInsertedSemicolon)
		        { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
		      return true
		    }
		  };

		  // Consume a semicolon, or, failing that, see if we are allowed to
		  // pretend that there is a semicolon at this position.

		  pp$9.semicolon = function() {
		    if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }
		  };

		  pp$9.afterTrailingComma = function(tokType, notNext) {
		    if (this.type === tokType) {
		      if (this.options.onTrailingComma)
		        { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
		      if (!notNext)
		        { this.next(); }
		      return true
		    }
		  };

		  // Expect a token of a given type. If found, consume it, otherwise,
		  // raise an unexpected token error.

		  pp$9.expect = function(type) {
		    this.eat(type) || this.unexpected();
		  };

		  // Raise an unexpected token error.

		  pp$9.unexpected = function(pos) {
		    this.raise(pos != null ? pos : this.start, "Unexpected token");
		  };

		  var DestructuringErrors = function DestructuringErrors() {
		    this.shorthandAssign =
		    this.trailingComma =
		    this.parenthesizedAssign =
		    this.parenthesizedBind =
		    this.doubleProto =
		      -1;
		  };

		  pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
		    if (!refDestructuringErrors) { return }
		    if (refDestructuringErrors.trailingComma > -1)
		      { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
		    var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
		    if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
		  };

		  pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
		    if (!refDestructuringErrors) { return false }
		    var shorthandAssign = refDestructuringErrors.shorthandAssign;
		    var doubleProto = refDestructuringErrors.doubleProto;
		    if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
		    if (shorthandAssign >= 0)
		      { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
		    if (doubleProto >= 0)
		      { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
		  };

		  pp$9.checkYieldAwaitInDefaultParams = function() {
		    if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
		      { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
		    if (this.awaitPos)
		      { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
		  };

		  pp$9.isSimpleAssignTarget = function(expr) {
		    if (expr.type === "ParenthesizedExpression")
		      { return this.isSimpleAssignTarget(expr.expression) }
		    return expr.type === "Identifier" || expr.type === "MemberExpression"
		  };

		  var pp$8 = Parser.prototype;

		  // ### Statement parsing

		  // Parse a program. Initializes the parser, reads any number of
		  // statements, and wraps them in a Program node.  Optionally takes a
		  // `program` argument.  If present, the statements will be appended
		  // to its body instead of creating a new node.

		  pp$8.parseTopLevel = function(node) {
		    var exports = Object.create(null);
		    if (!node.body) { node.body = []; }
		    while (this.type !== types$1.eof) {
		      var stmt = this.parseStatement(null, true, exports);
		      node.body.push(stmt);
		    }
		    if (this.inModule)
		      { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
		        {
		          var name = list[i];

		          this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
		        } }
		    this.adaptDirectivePrologue(node.body);
		    this.next();
		    node.sourceType = this.options.sourceType;
		    return this.finishNode(node, "Program")
		  };

		  var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};

		  pp$8.isLet = function(context) {
		    if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
		    skipWhiteSpace.lastIndex = this.pos;
		    var skip = skipWhiteSpace.exec(this.input);
		    var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
		    // For ambiguous cases, determine if a LexicalDeclaration (or only a
		    // Statement) is allowed here. If context is not empty then only a Statement
		    // is allowed. However, `let [` is an explicit negative lookahead for
		    // ExpressionStatement, so special-case it first.
		    if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
		    if (context) { return false }

		    if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
		    if (isIdentifierStart(nextCh, true)) {
		      var pos = next + 1;
		      while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }
		      if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }
		      var ident = this.input.slice(next, pos);
		      if (!keywordRelationalOperator.test(ident)) { return true }
		    }
		    return false
		  };

		  // check 'async [no LineTerminator here] function'
		  // - 'async /*foo*/ function' is OK.
		  // - 'async /*\n*/ function' is invalid.
		  pp$8.isAsyncFunction = function() {
		    if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
		      { return false }

		    skipWhiteSpace.lastIndex = this.pos;
		    var skip = skipWhiteSpace.exec(this.input);
		    var next = this.pos + skip[0].length, after;
		    return !lineBreak.test(this.input.slice(this.pos, next)) &&
		      this.input.slice(next, next + 8) === "function" &&
		      (next + 8 === this.input.length ||
		       !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))
		  };

		  // Parse a single statement.
		  //
		  // If expecting a statement and finding a slash operator, parse a
		  // regular expression literal. This is to handle cases like
		  // `if (foo) /blah/.exec(foo)`, where looking at the previous token
		  // does not help.

		  pp$8.parseStatement = function(context, topLevel, exports) {
		    var starttype = this.type, node = this.startNode(), kind;

		    if (this.isLet(context)) {
		      starttype = types$1._var;
		      kind = "let";
		    }

		    // Most types of statements are recognized by the keyword they
		    // start with. Many are trivial to parse, some require a bit of
		    // complexity.

		    switch (starttype) {
		    case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
		    case types$1._debugger: return this.parseDebuggerStatement(node)
		    case types$1._do: return this.parseDoStatement(node)
		    case types$1._for: return this.parseForStatement(node)
		    case types$1._function:
		      // Function as sole body of either an if statement or a labeled statement
		      // works, but not when it is part of a labeled statement that is the sole
		      // body of an if statement.
		      if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
		      return this.parseFunctionStatement(node, false, !context)
		    case types$1._class:
		      if (context) { this.unexpected(); }
		      return this.parseClass(node, true)
		    case types$1._if: return this.parseIfStatement(node)
		    case types$1._return: return this.parseReturnStatement(node)
		    case types$1._switch: return this.parseSwitchStatement(node)
		    case types$1._throw: return this.parseThrowStatement(node)
		    case types$1._try: return this.parseTryStatement(node)
		    case types$1._const: case types$1._var:
		      kind = kind || this.value;
		      if (context && kind !== "var") { this.unexpected(); }
		      return this.parseVarStatement(node, kind)
		    case types$1._while: return this.parseWhileStatement(node)
		    case types$1._with: return this.parseWithStatement(node)
		    case types$1.braceL: return this.parseBlock(true, node)
		    case types$1.semi: return this.parseEmptyStatement(node)
		    case types$1._export:
		    case types$1._import:
		      if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
		        skipWhiteSpace.lastIndex = this.pos;
		        var skip = skipWhiteSpace.exec(this.input);
		        var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
		        if (nextCh === 40 || nextCh === 46) // '(' or '.'
		          { return this.parseExpressionStatement(node, this.parseExpression()) }
		      }

		      if (!this.options.allowImportExportEverywhere) {
		        if (!topLevel)
		          { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
		        if (!this.inModule)
		          { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
		      }
		      return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)

		      // If the statement does not start with a statement keyword or a
		      // brace, it's an ExpressionStatement or LabeledStatement. We
		      // simply start parsing an expression, and afterwards, if the
		      // next token is a colon and the expression was a simple
		      // Identifier node, we switch to interpreting it as a label.
		    default:
		      if (this.isAsyncFunction()) {
		        if (context) { this.unexpected(); }
		        this.next();
		        return this.parseFunctionStatement(node, true, !context)
		      }

		      var maybeName = this.value, expr = this.parseExpression();
		      if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
		        { return this.parseLabeledStatement(node, maybeName, expr, context) }
		      else { return this.parseExpressionStatement(node, expr) }
		    }
		  };

		  pp$8.parseBreakContinueStatement = function(node, keyword) {
		    var isBreak = keyword === "break";
		    this.next();
		    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }
		    else if (this.type !== types$1.name) { this.unexpected(); }
		    else {
		      node.label = this.parseIdent();
		      this.semicolon();
		    }

		    // Verify that there is an actual destination to break or
		    // continue to.
		    var i = 0;
		    for (; i < this.labels.length; ++i) {
		      var lab = this.labels[i];
		      if (node.label == null || lab.name === node.label.name) {
		        if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
		        if (node.label && isBreak) { break }
		      }
		    }
		    if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
		    return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
		  };

		  pp$8.parseDebuggerStatement = function(node) {
		    this.next();
		    this.semicolon();
		    return this.finishNode(node, "DebuggerStatement")
		  };

		  pp$8.parseDoStatement = function(node) {
		    this.next();
		    this.labels.push(loopLabel);
		    node.body = this.parseStatement("do");
		    this.labels.pop();
		    this.expect(types$1._while);
		    node.test = this.parseParenExpression();
		    if (this.options.ecmaVersion >= 6)
		      { this.eat(types$1.semi); }
		    else
		      { this.semicolon(); }
		    return this.finishNode(node, "DoWhileStatement")
		  };

		  // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
		  // loop is non-trivial. Basically, we have to parse the init `var`
		  // statement or expression, disallowing the `in` operator (see
		  // the second parameter to `parseExpression`), and then check
		  // whether the next token is `in` or `of`. When there is no init
		  // part (semicolon immediately after the opening parenthesis), it
		  // is a regular `for` loop.

		  pp$8.parseForStatement = function(node) {
		    this.next();
		    var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1;
		    this.labels.push(loopLabel);
		    this.enterScope(0);
		    this.expect(types$1.parenL);
		    if (this.type === types$1.semi) {
		      if (awaitAt > -1) { this.unexpected(awaitAt); }
		      return this.parseFor(node, null)
		    }
		    var isLet = this.isLet();
		    if (this.type === types$1._var || this.type === types$1._const || isLet) {
		      var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
		      this.next();
		      this.parseVar(init$1, true, kind);
		      this.finishNode(init$1, "VariableDeclaration");
		      if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
		        if (this.options.ecmaVersion >= 9) {
		          if (this.type === types$1._in) {
		            if (awaitAt > -1) { this.unexpected(awaitAt); }
		          } else { node.await = awaitAt > -1; }
		        }
		        return this.parseForIn(node, init$1)
		      }
		      if (awaitAt > -1) { this.unexpected(awaitAt); }
		      return this.parseFor(node, init$1)
		    }
		    var startsWithLet = this.isContextual("let"), isForOf = false;
		    var containsEsc = this.containsEsc;
		    var refDestructuringErrors = new DestructuringErrors;
		    var initPos = this.start;
		    var init = awaitAt > -1
		      ? this.parseExprSubscripts(refDestructuringErrors, "await")
		      : this.parseExpression(true, refDestructuringErrors);
		    if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
		      if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
		        if (this.type === types$1._in) { this.unexpected(awaitAt); }
		        node.await = true;
		      } else if (isForOf && this.options.ecmaVersion >= 8) {
		        if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
		        else if (this.options.ecmaVersion >= 9) { node.await = false; }
		      }
		      if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
		      this.toAssignable(init, false, refDestructuringErrors);
		      this.checkLValPattern(init);
		      return this.parseForIn(node, init)
		    } else {
		      this.checkExpressionErrors(refDestructuringErrors, true);
		    }
		    if (awaitAt > -1) { this.unexpected(awaitAt); }
		    return this.parseFor(node, init)
		  };

		  pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
		    this.next();
		    return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
		  };

		  pp$8.parseIfStatement = function(node) {
		    this.next();
		    node.test = this.parseParenExpression();
		    // allow function declarations in branches, but only in non-strict mode
		    node.consequent = this.parseStatement("if");
		    node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
		    return this.finishNode(node, "IfStatement")
		  };

		  pp$8.parseReturnStatement = function(node) {
		    if (!this.inFunction && !this.options.allowReturnOutsideFunction)
		      { this.raise(this.start, "'return' outside of function"); }
		    this.next();

		    // In `return` (and `break`/`continue`), the keywords with
		    // optional arguments, we eagerly look for a semicolon or the
		    // possibility to insert one.

		    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }
		    else { node.argument = this.parseExpression(); this.semicolon(); }
		    return this.finishNode(node, "ReturnStatement")
		  };

		  pp$8.parseSwitchStatement = function(node) {
		    this.next();
		    node.discriminant = this.parseParenExpression();
		    node.cases = [];
		    this.expect(types$1.braceL);
		    this.labels.push(switchLabel);
		    this.enterScope(0);

		    // Statements under must be grouped (by label) in SwitchCase
		    // nodes. `cur` is used to keep the node that we are currently
		    // adding statements to.

		    var cur;
		    for (var sawDefault = false; this.type !== types$1.braceR;) {
		      if (this.type === types$1._case || this.type === types$1._default) {
		        var isCase = this.type === types$1._case;
		        if (cur) { this.finishNode(cur, "SwitchCase"); }
		        node.cases.push(cur = this.startNode());
		        cur.consequent = [];
		        this.next();
		        if (isCase) {
		          cur.test = this.parseExpression();
		        } else {
		          if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
		          sawDefault = true;
		          cur.test = null;
		        }
		        this.expect(types$1.colon);
		      } else {
		        if (!cur) { this.unexpected(); }
		        cur.consequent.push(this.parseStatement(null));
		      }
		    }
		    this.exitScope();
		    if (cur) { this.finishNode(cur, "SwitchCase"); }
		    this.next(); // Closing brace
		    this.labels.pop();
		    return this.finishNode(node, "SwitchStatement")
		  };

		  pp$8.parseThrowStatement = function(node) {
		    this.next();
		    if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
		      { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
		    node.argument = this.parseExpression();
		    this.semicolon();
		    return this.finishNode(node, "ThrowStatement")
		  };

		  // Reused empty array added for node fields that are always empty.

		  var empty$1 = [];

		  pp$8.parseCatchClauseParam = function() {
		    var param = this.parseBindingAtom();
		    var simple = param.type === "Identifier";
		    this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
		    this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
		    this.expect(types$1.parenR);

		    return param
		  };

		  pp$8.parseTryStatement = function(node) {
		    this.next();
		    node.block = this.parseBlock();
		    node.handler = null;
		    if (this.type === types$1._catch) {
		      var clause = this.startNode();
		      this.next();
		      if (this.eat(types$1.parenL)) {
		        clause.param = this.parseCatchClauseParam();
		      } else {
		        if (this.options.ecmaVersion < 10) { this.unexpected(); }
		        clause.param = null;
		        this.enterScope(0);
		      }
		      clause.body = this.parseBlock(false);
		      this.exitScope();
		      node.handler = this.finishNode(clause, "CatchClause");
		    }
		    node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
		    if (!node.handler && !node.finalizer)
		      { this.raise(node.start, "Missing catch or finally clause"); }
		    return this.finishNode(node, "TryStatement")
		  };

		  pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
		    this.next();
		    this.parseVar(node, false, kind, allowMissingInitializer);
		    this.semicolon();
		    return this.finishNode(node, "VariableDeclaration")
		  };

		  pp$8.parseWhileStatement = function(node) {
		    this.next();
		    node.test = this.parseParenExpression();
		    this.labels.push(loopLabel);
		    node.body = this.parseStatement("while");
		    this.labels.pop();
		    return this.finishNode(node, "WhileStatement")
		  };

		  pp$8.parseWithStatement = function(node) {
		    if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
		    this.next();
		    node.object = this.parseParenExpression();
		    node.body = this.parseStatement("with");
		    return this.finishNode(node, "WithStatement")
		  };

		  pp$8.parseEmptyStatement = function(node) {
		    this.next();
		    return this.finishNode(node, "EmptyStatement")
		  };

		  pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
		    for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
		      {
		      var label = list[i$1];

		      if (label.name === maybeName)
		        { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
		    } }
		    var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
		    for (var i = this.labels.length - 1; i >= 0; i--) {
		      var label$1 = this.labels[i];
		      if (label$1.statementStart === node.start) {
		        // Update information about previous labels on this node
		        label$1.statementStart = this.start;
		        label$1.kind = kind;
		      } else { break }
		    }
		    this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
		    node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
		    this.labels.pop();
		    node.label = expr;
		    return this.finishNode(node, "LabeledStatement")
		  };

		  pp$8.parseExpressionStatement = function(node, expr) {
		    node.expression = expr;
		    this.semicolon();
		    return this.finishNode(node, "ExpressionStatement")
		  };

		  // Parse a semicolon-enclosed block of statements, handling `"use
		  // strict"` declarations when `allowStrict` is true (used for
		  // function bodies).

		  pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
		    if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
		    if ( node === void 0 ) node = this.startNode();

		    node.body = [];
		    this.expect(types$1.braceL);
		    if (createNewLexicalScope) { this.enterScope(0); }
		    while (this.type !== types$1.braceR) {
		      var stmt = this.parseStatement(null);
		      node.body.push(stmt);
		    }
		    if (exitStrict) { this.strict = false; }
		    this.next();
		    if (createNewLexicalScope) { this.exitScope(); }
		    return this.finishNode(node, "BlockStatement")
		  };

		  // Parse a regular `for` loop. The disambiguation code in
		  // `parseStatement` will already have parsed the init statement or
		  // expression.

		  pp$8.parseFor = function(node, init) {
		    node.init = init;
		    this.expect(types$1.semi);
		    node.test = this.type === types$1.semi ? null : this.parseExpression();
		    this.expect(types$1.semi);
		    node.update = this.type === types$1.parenR ? null : this.parseExpression();
		    this.expect(types$1.parenR);
		    node.body = this.parseStatement("for");
		    this.exitScope();
		    this.labels.pop();
		    return this.finishNode(node, "ForStatement")
		  };

		  // Parse a `for`/`in` and `for`/`of` loop, which are almost
		  // same from parser's perspective.

		  pp$8.parseForIn = function(node, init) {
		    var isForIn = this.type === types$1._in;
		    this.next();

		    if (
		      init.type === "VariableDeclaration" &&
		      init.declarations[0].init != null &&
		      (
		        !isForIn ||
		        this.options.ecmaVersion < 8 ||
		        this.strict ||
		        init.kind !== "var" ||
		        init.declarations[0].id.type !== "Identifier"
		      )
		    ) {
		      this.raise(
		        init.start,
		        ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
		      );
		    }
		    node.left = init;
		    node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
		    this.expect(types$1.parenR);
		    node.body = this.parseStatement("for");
		    this.exitScope();
		    this.labels.pop();
		    return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
		  };

		  // Parse a list of variable declarations.

		  pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
		    node.declarations = [];
		    node.kind = kind;
		    for (;;) {
		      var decl = this.startNode();
		      this.parseVarId(decl, kind);
		      if (this.eat(types$1.eq)) {
		        decl.init = this.parseMaybeAssign(isFor);
		      } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
		        this.unexpected();
		      } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
		        this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
		      } else {
		        decl.init = null;
		      }
		      node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
		      if (!this.eat(types$1.comma)) { break }
		    }
		    return node
		  };

		  pp$8.parseVarId = function(decl, kind) {
		    decl.id = this.parseBindingAtom();
		    this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
		  };

		  var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;

		  // Parse a function declaration or literal (depending on the
		  // `statement & FUNC_STATEMENT`).

		  // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
		  pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
		    this.initFunction(node);
		    if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
		      if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
		        { this.unexpected(); }
		      node.generator = this.eat(types$1.star);
		    }
		    if (this.options.ecmaVersion >= 8)
		      { node.async = !!isAsync; }

		    if (statement & FUNC_STATEMENT) {
		      node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();
		      if (node.id && !(statement & FUNC_HANGING_STATEMENT))
		        // If it is a regular function declaration in sloppy mode, then it is
		        // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
		        // mode depends on properties of the current scope (see
		        // treatFunctionsAsVar).
		        { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
		    }

		    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
		    this.yieldPos = 0;
		    this.awaitPos = 0;
		    this.awaitIdentPos = 0;
		    this.enterScope(functionFlags(node.async, node.generator));

		    if (!(statement & FUNC_STATEMENT))
		      { node.id = this.type === types$1.name ? this.parseIdent() : null; }

		    this.parseFunctionParams(node);
		    this.parseFunctionBody(node, allowExpressionBody, false, forInit);

		    this.yieldPos = oldYieldPos;
		    this.awaitPos = oldAwaitPos;
		    this.awaitIdentPos = oldAwaitIdentPos;
		    return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
		  };

		  pp$8.parseFunctionParams = function(node) {
		    this.expect(types$1.parenL);
		    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
		    this.checkYieldAwaitInDefaultParams();
		  };

		  // Parse a class declaration or literal (depending on the
		  // `isStatement` parameter).

		  pp$8.parseClass = function(node, isStatement) {
		    this.next();

		    // ecma-262 14.6 Class Definitions
		    // A class definition is always strict mode code.
		    var oldStrict = this.strict;
		    this.strict = true;

		    this.parseClassId(node, isStatement);
		    this.parseClassSuper(node);
		    var privateNameMap = this.enterClassBody();
		    var classBody = this.startNode();
		    var hadConstructor = false;
		    classBody.body = [];
		    this.expect(types$1.braceL);
		    while (this.type !== types$1.braceR) {
		      var element = this.parseClassElement(node.superClass !== null);
		      if (element) {
		        classBody.body.push(element);
		        if (element.type === "MethodDefinition" && element.kind === "constructor") {
		          if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); }
		          hadConstructor = true;
		        } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
		          this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
		        }
		      }
		    }
		    this.strict = oldStrict;
		    this.next();
		    node.body = this.finishNode(classBody, "ClassBody");
		    this.exitClassBody();
		    return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
		  };

		  pp$8.parseClassElement = function(constructorAllowsSuper) {
		    if (this.eat(types$1.semi)) { return null }

		    var ecmaVersion = this.options.ecmaVersion;
		    var node = this.startNode();
		    var keyName = "";
		    var isGenerator = false;
		    var isAsync = false;
		    var kind = "method";
		    var isStatic = false;

		    if (this.eatContextual("static")) {
		      // Parse static init block
		      if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
		        this.parseClassStaticBlock(node);
		        return node
		      }
		      if (this.isClassElementNameStart() || this.type === types$1.star) {
		        isStatic = true;
		      } else {
		        keyName = "static";
		      }
		    }
		    node.static = isStatic;
		    if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
		      if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
		        isAsync = true;
		      } else {
		        keyName = "async";
		      }
		    }
		    if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
		      isGenerator = true;
		    }
		    if (!keyName && !isAsync && !isGenerator) {
		      var lastValue = this.value;
		      if (this.eatContextual("get") || this.eatContextual("set")) {
		        if (this.isClassElementNameStart()) {
		          kind = lastValue;
		        } else {
		          keyName = lastValue;
		        }
		      }
		    }

		    // Parse element name
		    if (keyName) {
		      // 'async', 'get', 'set', or 'static' were not a keyword contextually.
		      // The last token is any of those. Make it the element name.
		      node.computed = false;
		      node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
		      node.key.name = keyName;
		      this.finishNode(node.key, "Identifier");
		    } else {
		      this.parseClassElementName(node);
		    }

		    // Parse element value
		    if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
		      var isConstructor = !node.static && checkKeyName(node, "constructor");
		      var allowsDirectSuper = isConstructor && constructorAllowsSuper;
		      // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
		      if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
		      node.kind = isConstructor ? "constructor" : kind;
		      this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
		    } else {
		      this.parseClassField(node);
		    }

		    return node
		  };

		  pp$8.isClassElementNameStart = function() {
		    return (
		      this.type === types$1.name ||
		      this.type === types$1.privateId ||
		      this.type === types$1.num ||
		      this.type === types$1.string ||
		      this.type === types$1.bracketL ||
		      this.type.keyword
		    )
		  };

		  pp$8.parseClassElementName = function(element) {
		    if (this.type === types$1.privateId) {
		      if (this.value === "constructor") {
		        this.raise(this.start, "Classes can't have an element named '#constructor'");
		      }
		      element.computed = false;
		      element.key = this.parsePrivateIdent();
		    } else {
		      this.parsePropertyName(element);
		    }
		  };

		  pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
		    // Check key and flags
		    var key = method.key;
		    if (method.kind === "constructor") {
		      if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
		      if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
		    } else if (method.static && checkKeyName(method, "prototype")) {
		      this.raise(key.start, "Classes may not have a static property named prototype");
		    }

		    // Parse value
		    var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);

		    // Check value
		    if (method.kind === "get" && value.params.length !== 0)
		      { this.raiseRecoverable(value.start, "getter should have no params"); }
		    if (method.kind === "set" && value.params.length !== 1)
		      { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
		    if (method.kind === "set" && value.params[0].type === "RestElement")
		      { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }

		    return this.finishNode(method, "MethodDefinition")
		  };

		  pp$8.parseClassField = function(field) {
		    if (checkKeyName(field, "constructor")) {
		      this.raise(field.key.start, "Classes can't have a field named 'constructor'");
		    } else if (field.static && checkKeyName(field, "prototype")) {
		      this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
		    }

		    if (this.eat(types$1.eq)) {
		      // To raise SyntaxError if 'arguments' exists in the initializer.
		      var scope = this.currentThisScope();
		      var inClassFieldInit = scope.inClassFieldInit;
		      scope.inClassFieldInit = true;
		      field.value = this.parseMaybeAssign();
		      scope.inClassFieldInit = inClassFieldInit;
		    } else {
		      field.value = null;
		    }
		    this.semicolon();

		    return this.finishNode(field, "PropertyDefinition")
		  };

		  pp$8.parseClassStaticBlock = function(node) {
		    node.body = [];

		    var oldLabels = this.labels;
		    this.labels = [];
		    this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
		    while (this.type !== types$1.braceR) {
		      var stmt = this.parseStatement(null);
		      node.body.push(stmt);
		    }
		    this.next();
		    this.exitScope();
		    this.labels = oldLabels;

		    return this.finishNode(node, "StaticBlock")
		  };

		  pp$8.parseClassId = function(node, isStatement) {
		    if (this.type === types$1.name) {
		      node.id = this.parseIdent();
		      if (isStatement)
		        { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
		    } else {
		      if (isStatement === true)
		        { this.unexpected(); }
		      node.id = null;
		    }
		  };

		  pp$8.parseClassSuper = function(node) {
		    node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
		  };

		  pp$8.enterClassBody = function() {
		    var element = {declared: Object.create(null), used: []};
		    this.privateNameStack.push(element);
		    return element.declared
		  };

		  pp$8.exitClassBody = function() {
		    var ref = this.privateNameStack.pop();
		    var declared = ref.declared;
		    var used = ref.used;
		    if (!this.options.checkPrivateFields) { return }
		    var len = this.privateNameStack.length;
		    var parent = len === 0 ? null : this.privateNameStack[len - 1];
		    for (var i = 0; i < used.length; ++i) {
		      var id = used[i];
		      if (!hasOwn(declared, id.name)) {
		        if (parent) {
		          parent.used.push(id);
		        } else {
		          this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class"));
		        }
		      }
		    }
		  };

		  function isPrivateNameConflicted(privateNameMap, element) {
		    var name = element.key.name;
		    var curr = privateNameMap[name];

		    var next = "true";
		    if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
		      next = (element.static ? "s" : "i") + element.kind;
		    }

		    // `class { get #a(){}; static set #a(_){} }` is also conflict.
		    if (
		      curr === "iget" && next === "iset" ||
		      curr === "iset" && next === "iget" ||
		      curr === "sget" && next === "sset" ||
		      curr === "sset" && next === "sget"
		    ) {
		      privateNameMap[name] = "true";
		      return false
		    } else if (!curr) {
		      privateNameMap[name] = next;
		      return false
		    } else {
		      return true
		    }
		  }

		  function checkKeyName(node, name) {
		    var computed = node.computed;
		    var key = node.key;
		    return !computed && (
		      key.type === "Identifier" && key.name === name ||
		      key.type === "Literal" && key.value === name
		    )
		  }

		  // Parses module export declaration.

		  pp$8.parseExportAllDeclaration = function(node, exports) {
		    if (this.options.ecmaVersion >= 11) {
		      if (this.eatContextual("as")) {
		        node.exported = this.parseModuleExportName();
		        this.checkExport(exports, node.exported, this.lastTokStart);
		      } else {
		        node.exported = null;
		      }
		    }
		    this.expectContextual("from");
		    if (this.type !== types$1.string) { this.unexpected(); }
		    node.source = this.parseExprAtom();
		    if (this.options.ecmaVersion >= 16)
		      { node.attributes = this.parseWithClause(); }
		    this.semicolon();
		    return this.finishNode(node, "ExportAllDeclaration")
		  };

		  pp$8.parseExport = function(node, exports) {
		    this.next();
		    // export * from '...'
		    if (this.eat(types$1.star)) {
		      return this.parseExportAllDeclaration(node, exports)
		    }
		    if (this.eat(types$1._default)) { // export default ...
		      this.checkExport(exports, "default", this.lastTokStart);
		      node.declaration = this.parseExportDefaultDeclaration();
		      return this.finishNode(node, "ExportDefaultDeclaration")
		    }
		    // export var|const|let|function|class ...
		    if (this.shouldParseExportStatement()) {
		      node.declaration = this.parseExportDeclaration(node);
		      if (node.declaration.type === "VariableDeclaration")
		        { this.checkVariableExport(exports, node.declaration.declarations); }
		      else
		        { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
		      node.specifiers = [];
		      node.source = null;
		    } else { // export { x, y as z } [from '...']
		      node.declaration = null;
		      node.specifiers = this.parseExportSpecifiers(exports);
		      if (this.eatContextual("from")) {
		        if (this.type !== types$1.string) { this.unexpected(); }
		        node.source = this.parseExprAtom();
		        if (this.options.ecmaVersion >= 16)
		          { node.attributes = this.parseWithClause(); }
		      } else {
		        for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
		          // check for keywords used as local names
		          var spec = list[i];

		          this.checkUnreserved(spec.local);
		          // check if export is defined
		          this.checkLocalExport(spec.local);

		          if (spec.local.type === "Literal") {
		            this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
		          }
		        }

		        node.source = null;
		      }
		      this.semicolon();
		    }
		    return this.finishNode(node, "ExportNamedDeclaration")
		  };

		  pp$8.parseExportDeclaration = function(node) {
		    return this.parseStatement(null)
		  };

		  pp$8.parseExportDefaultDeclaration = function() {
		    var isAsync;
		    if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
		      var fNode = this.startNode();
		      this.next();
		      if (isAsync) { this.next(); }
		      return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)
		    } else if (this.type === types$1._class) {
		      var cNode = this.startNode();
		      return this.parseClass(cNode, "nullableID")
		    } else {
		      var declaration = this.parseMaybeAssign();
		      this.semicolon();
		      return declaration
		    }
		  };

		  pp$8.checkExport = function(exports, name, pos) {
		    if (!exports) { return }
		    if (typeof name !== "string")
		      { name = name.type === "Identifier" ? name.name : name.value; }
		    if (hasOwn(exports, name))
		      { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
		    exports[name] = true;
		  };

		  pp$8.checkPatternExport = function(exports, pat) {
		    var type = pat.type;
		    if (type === "Identifier")
		      { this.checkExport(exports, pat, pat.start); }
		    else if (type === "ObjectPattern")
		      { for (var i = 0, list = pat.properties; i < list.length; i += 1)
		        {
		          var prop = list[i];

		          this.checkPatternExport(exports, prop);
		        } }
		    else if (type === "ArrayPattern")
		      { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
		        var elt = list$1[i$1];

		          if (elt) { this.checkPatternExport(exports, elt); }
		      } }
		    else if (type === "Property")
		      { this.checkPatternExport(exports, pat.value); }
		    else if (type === "AssignmentPattern")
		      { this.checkPatternExport(exports, pat.left); }
		    else if (type === "RestElement")
		      { this.checkPatternExport(exports, pat.argument); }
		  };

		  pp$8.checkVariableExport = function(exports, decls) {
		    if (!exports) { return }
		    for (var i = 0, list = decls; i < list.length; i += 1)
		      {
		      var decl = list[i];

		      this.checkPatternExport(exports, decl.id);
		    }
		  };

		  pp$8.shouldParseExportStatement = function() {
		    return this.type.keyword === "var" ||
		      this.type.keyword === "const" ||
		      this.type.keyword === "class" ||
		      this.type.keyword === "function" ||
		      this.isLet() ||
		      this.isAsyncFunction()
		  };

		  // Parses a comma-separated list of module exports.

		  pp$8.parseExportSpecifier = function(exports) {
		    var node = this.startNode();
		    node.local = this.parseModuleExportName();

		    node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
		    this.checkExport(
		      exports,
		      node.exported,
		      node.exported.start
		    );

		    return this.finishNode(node, "ExportSpecifier")
		  };

		  pp$8.parseExportSpecifiers = function(exports) {
		    var nodes = [], first = true;
		    // export { x, y as z } [from '...']
		    this.expect(types$1.braceL);
		    while (!this.eat(types$1.braceR)) {
		      if (!first) {
		        this.expect(types$1.comma);
		        if (this.afterTrailingComma(types$1.braceR)) { break }
		      } else { first = false; }

		      nodes.push(this.parseExportSpecifier(exports));
		    }
		    return nodes
		  };

		  // Parses import declaration.

		  pp$8.parseImport = function(node) {
		    this.next();

		    // import '...'
		    if (this.type === types$1.string) {
		      node.specifiers = empty$1;
		      node.source = this.parseExprAtom();
		    } else {
		      node.specifiers = this.parseImportSpecifiers();
		      this.expectContextual("from");
		      node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
		    }
		    if (this.options.ecmaVersion >= 16)
		      { node.attributes = this.parseWithClause(); }
		    this.semicolon();
		    return this.finishNode(node, "ImportDeclaration")
		  };

		  // Parses a comma-separated list of module imports.

		  pp$8.parseImportSpecifier = function() {
		    var node = this.startNode();
		    node.imported = this.parseModuleExportName();

		    if (this.eatContextual("as")) {
		      node.local = this.parseIdent();
		    } else {
		      this.checkUnreserved(node.imported);
		      node.local = node.imported;
		    }
		    this.checkLValSimple(node.local, BIND_LEXICAL);

		    return this.finishNode(node, "ImportSpecifier")
		  };

		  pp$8.parseImportDefaultSpecifier = function() {
		    // import defaultObj, { x, y as z } from '...'
		    var node = this.startNode();
		    node.local = this.parseIdent();
		    this.checkLValSimple(node.local, BIND_LEXICAL);
		    return this.finishNode(node, "ImportDefaultSpecifier")
		  };

		  pp$8.parseImportNamespaceSpecifier = function() {
		    var node = this.startNode();
		    this.next();
		    this.expectContextual("as");
		    node.local = this.parseIdent();
		    this.checkLValSimple(node.local, BIND_LEXICAL);
		    return this.finishNode(node, "ImportNamespaceSpecifier")
		  };

		  pp$8.parseImportSpecifiers = function() {
		    var nodes = [], first = true;
		    if (this.type === types$1.name) {
		      nodes.push(this.parseImportDefaultSpecifier());
		      if (!this.eat(types$1.comma)) { return nodes }
		    }
		    if (this.type === types$1.star) {
		      nodes.push(this.parseImportNamespaceSpecifier());
		      return nodes
		    }
		    this.expect(types$1.braceL);
		    while (!this.eat(types$1.braceR)) {
		      if (!first) {
		        this.expect(types$1.comma);
		        if (this.afterTrailingComma(types$1.braceR)) { break }
		      } else { first = false; }

		      nodes.push(this.parseImportSpecifier());
		    }
		    return nodes
		  };

		  pp$8.parseWithClause = function() {
		    var nodes = [];
		    if (!this.eat(types$1._with)) {
		      return nodes
		    }
		    this.expect(types$1.braceL);
		    var attributeKeys = {};
		    var first = true;
		    while (!this.eat(types$1.braceR)) {
		      if (!first) {
		        this.expect(types$1.comma);
		        if (this.afterTrailingComma(types$1.braceR)) { break }
		      } else { first = false; }

		      var attr = this.parseImportAttribute();
		      var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
		      if (hasOwn(attributeKeys, keyName))
		        { this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
		      attributeKeys[keyName] = true;
		      nodes.push(attr);
		    }
		    return nodes
		  };

		  pp$8.parseImportAttribute = function() {
		    var node = this.startNode();
		    node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
		    this.expect(types$1.colon);
		    if (this.type !== types$1.string) {
		      this.unexpected();
		    }
		    node.value = this.parseExprAtom();
		    return this.finishNode(node, "ImportAttribute")
		  };

		  pp$8.parseModuleExportName = function() {
		    if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
		      var stringLiteral = this.parseLiteral(this.value);
		      if (loneSurrogate.test(stringLiteral.value)) {
		        this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
		      }
		      return stringLiteral
		    }
		    return this.parseIdent(true)
		  };

		  // Set `ExpressionStatement#directive` property for directive prologues.
		  pp$8.adaptDirectivePrologue = function(statements) {
		    for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
		      statements[i].directive = statements[i].expression.raw.slice(1, -1);
		    }
		  };
		  pp$8.isDirectiveCandidate = function(statement) {
		    return (
		      this.options.ecmaVersion >= 5 &&
		      statement.type === "ExpressionStatement" &&
		      statement.expression.type === "Literal" &&
		      typeof statement.expression.value === "string" &&
		      // Reject parenthesized strings.
		      (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
		    )
		  };

		  var pp$7 = Parser.prototype;

		  // Convert existing expression atom to assignable pattern
		  // if possible.

		  pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
		    if (this.options.ecmaVersion >= 6 && node) {
		      switch (node.type) {
		      case "Identifier":
		        if (this.inAsync && node.name === "await")
		          { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
		        break

		      case "ObjectPattern":
		      case "ArrayPattern":
		      case "AssignmentPattern":
		      case "RestElement":
		        break

		      case "ObjectExpression":
		        node.type = "ObjectPattern";
		        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
		        for (var i = 0, list = node.properties; i < list.length; i += 1) {
		          var prop = list[i];

		        this.toAssignable(prop, isBinding);
		          // Early error:
		          //   AssignmentRestProperty[Yield, Await] :
		          //     `...` DestructuringAssignmentTarget[Yield, Await]
		          //
		          //   It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
		          if (
		            prop.type === "RestElement" &&
		            (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
		          ) {
		            this.raise(prop.argument.start, "Unexpected token");
		          }
		        }
		        break

		      case "Property":
		        // AssignmentProperty has type === "Property"
		        if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
		        this.toAssignable(node.value, isBinding);
		        break

		      case "ArrayExpression":
		        node.type = "ArrayPattern";
		        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
		        this.toAssignableList(node.elements, isBinding);
		        break

		      case "SpreadElement":
		        node.type = "RestElement";
		        this.toAssignable(node.argument, isBinding);
		        if (node.argument.type === "AssignmentPattern")
		          { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
		        break

		      case "AssignmentExpression":
		        if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
		        node.type = "AssignmentPattern";
		        delete node.operator;
		        this.toAssignable(node.left, isBinding);
		        break

		      case "ParenthesizedExpression":
		        this.toAssignable(node.expression, isBinding, refDestructuringErrors);
		        break

		      case "ChainExpression":
		        this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
		        break

		      case "MemberExpression":
		        if (!isBinding) { break }

		      default:
		        this.raise(node.start, "Assigning to rvalue");
		      }
		    } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
		    return node
		  };

		  // Convert list of expression atoms to binding list.

		  pp$7.toAssignableList = function(exprList, isBinding) {
		    var end = exprList.length;
		    for (var i = 0; i < end; i++) {
		      var elt = exprList[i];
		      if (elt) { this.toAssignable(elt, isBinding); }
		    }
		    if (end) {
		      var last = exprList[end - 1];
		      if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
		        { this.unexpected(last.argument.start); }
		    }
		    return exprList
		  };

		  // Parses spread element.

		  pp$7.parseSpread = function(refDestructuringErrors) {
		    var node = this.startNode();
		    this.next();
		    node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
		    return this.finishNode(node, "SpreadElement")
		  };

		  pp$7.parseRestBinding = function() {
		    var node = this.startNode();
		    this.next();

		    // RestElement inside of a function parameter must be an identifier
		    if (this.options.ecmaVersion === 6 && this.type !== types$1.name)
		      { this.unexpected(); }

		    node.argument = this.parseBindingAtom();

		    return this.finishNode(node, "RestElement")
		  };

		  // Parses lvalue (assignable) atom.

		  pp$7.parseBindingAtom = function() {
		    if (this.options.ecmaVersion >= 6) {
		      switch (this.type) {
		      case types$1.bracketL:
		        var node = this.startNode();
		        this.next();
		        node.elements = this.parseBindingList(types$1.bracketR, true, true);
		        return this.finishNode(node, "ArrayPattern")

		      case types$1.braceL:
		        return this.parseObj(true)
		      }
		    }
		    return this.parseIdent()
		  };

		  pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
		    var elts = [], first = true;
		    while (!this.eat(close)) {
		      if (first) { first = false; }
		      else { this.expect(types$1.comma); }
		      if (allowEmpty && this.type === types$1.comma) {
		        elts.push(null);
		      } else if (allowTrailingComma && this.afterTrailingComma(close)) {
		        break
		      } else if (this.type === types$1.ellipsis) {
		        var rest = this.parseRestBinding();
		        this.parseBindingListItem(rest);
		        elts.push(rest);
		        if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); }
		        this.expect(close);
		        break
		      } else {
		        elts.push(this.parseAssignableListItem(allowModifiers));
		      }
		    }
		    return elts
		  };

		  pp$7.parseAssignableListItem = function(allowModifiers) {
		    var elem = this.parseMaybeDefault(this.start, this.startLoc);
		    this.parseBindingListItem(elem);
		    return elem
		  };

		  pp$7.parseBindingListItem = function(param) {
		    return param
		  };

		  // Parses assignment pattern around given atom if possible.

		  pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
		    left = left || this.parseBindingAtom();
		    if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }
		    var node = this.startNodeAt(startPos, startLoc);
		    node.left = left;
		    node.right = this.parseMaybeAssign();
		    return this.finishNode(node, "AssignmentPattern")
		  };

		  // The following three functions all verify that a node is an lvalue —
		  // something that can be bound, or assigned to. In order to do so, they perform
		  // a variety of checks:
		  //
		  // - Check that none of the bound/assigned-to identifiers are reserved words.
		  // - Record name declarations for bindings in the appropriate scope.
		  // - Check duplicate argument names, if checkClashes is set.
		  //
		  // If a complex binding pattern is encountered (e.g., object and array
		  // destructuring), the entire pattern is recursively checked.
		  //
		  // There are three versions of checkLVal*() appropriate for different
		  // circumstances:
		  //
		  // - checkLValSimple() shall be used if the syntactic construct supports
		  //   nothing other than identifiers and member expressions. Parenthesized
		  //   expressions are also correctly handled. This is generally appropriate for
		  //   constructs for which the spec says
		  //
		  //   > It is a Syntax Error if AssignmentTargetType of [the production] is not
		  //   > simple.
		  //
		  //   It is also appropriate for checking if an identifier is valid and not
		  //   defined elsewhere, like import declarations or function/class identifiers.
		  //
		  //   Examples where this is used include:
		  //     a += …;
		  //     import a from '…';
		  //   where a is the node to be checked.
		  //
		  // - checkLValPattern() shall be used if the syntactic construct supports
		  //   anything checkLValSimple() supports, as well as object and array
		  //   destructuring patterns. This is generally appropriate for constructs for
		  //   which the spec says
		  //
		  //   > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
		  //   > an ArrayLiteral and AssignmentTargetType of [the production] is not
		  //   > simple.
		  //
		  //   Examples where this is used include:
		  //     (a = …);
		  //     const a = …;
		  //     try { … } catch (a) { … }
		  //   where a is the node to be checked.
		  //
		  // - checkLValInnerPattern() shall be used if the syntactic construct supports
		  //   anything checkLValPattern() supports, as well as default assignment
		  //   patterns, rest elements, and other constructs that may appear within an
		  //   object or array destructuring pattern.
		  //
		  //   As a special case, function parameters also use checkLValInnerPattern(),
		  //   as they also support defaults and rest constructs.
		  //
		  // These functions deliberately support both assignment and binding constructs,
		  // as the logic for both is exceedingly similar. If the node is the target of
		  // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
		  // should be set to the appropriate BIND_* constant, like BIND_VAR or
		  // BIND_LEXICAL.
		  //
		  // If the function is called with a non-BIND_NONE bindingType, then
		  // additionally a checkClashes object may be specified to allow checking for
		  // duplicate argument names. checkClashes is ignored if the provided construct
		  // is an assignment (i.e., bindingType is BIND_NONE).

		  pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
		    if ( bindingType === void 0 ) bindingType = BIND_NONE;

		    var isBind = bindingType !== BIND_NONE;

		    switch (expr.type) {
		    case "Identifier":
		      if (this.strict && this.reservedWordsStrictBind.test(expr.name))
		        { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
		      if (isBind) {
		        if (bindingType === BIND_LEXICAL && expr.name === "let")
		          { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
		        if (checkClashes) {
		          if (hasOwn(checkClashes, expr.name))
		            { this.raiseRecoverable(expr.start, "Argument name clash"); }
		          checkClashes[expr.name] = true;
		        }
		        if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
		      }
		      break

		    case "ChainExpression":
		      this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
		      break

		    case "MemberExpression":
		      if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
		      break

		    case "ParenthesizedExpression":
		      if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
		      return this.checkLValSimple(expr.expression, bindingType, checkClashes)

		    default:
		      this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
		    }
		  };

		  pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
		    if ( bindingType === void 0 ) bindingType = BIND_NONE;

		    switch (expr.type) {
		    case "ObjectPattern":
		      for (var i = 0, list = expr.properties; i < list.length; i += 1) {
		        var prop = list[i];

		      this.checkLValInnerPattern(prop, bindingType, checkClashes);
		      }
		      break

		    case "ArrayPattern":
		      for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
		        var elem = list$1[i$1];

		      if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
		      }
		      break

		    default:
		      this.checkLValSimple(expr, bindingType, checkClashes);
		    }
		  };

		  pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
		    if ( bindingType === void 0 ) bindingType = BIND_NONE;

		    switch (expr.type) {
		    case "Property":
		      // AssignmentProperty has type === "Property"
		      this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
		      break

		    case "AssignmentPattern":
		      this.checkLValPattern(expr.left, bindingType, checkClashes);
		      break

		    case "RestElement":
		      this.checkLValPattern(expr.argument, bindingType, checkClashes);
		      break

		    default:
		      this.checkLValPattern(expr, bindingType, checkClashes);
		    }
		  };

		  // The algorithm used to determine whether a regexp can appear at a
		  // given point in the program is loosely based on sweet.js' approach.
		  // See https://github.com/mozilla/sweet.js/wiki/design


		  var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
		    this.token = token;
		    this.isExpr = !!isExpr;
		    this.preserveSpace = !!preserveSpace;
		    this.override = override;
		    this.generator = !!generator;
		  };

		  var types = {
		    b_stat: new TokContext("{", false),
		    b_expr: new TokContext("{", true),
		    b_tmpl: new TokContext("${", false),
		    p_stat: new TokContext("(", false),
		    p_expr: new TokContext("(", true),
		    q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
		    f_stat: new TokContext("function", false),
		    f_expr: new TokContext("function", true),
		    f_expr_gen: new TokContext("function", true, false, null, true),
		    f_gen: new TokContext("function", false, false, null, true)
		  };

		  var pp$6 = Parser.prototype;

		  pp$6.initialContext = function() {
		    return [types.b_stat]
		  };

		  pp$6.curContext = function() {
		    return this.context[this.context.length - 1]
		  };

		  pp$6.braceIsBlock = function(prevType) {
		    var parent = this.curContext();
		    if (parent === types.f_expr || parent === types.f_stat)
		      { return true }
		    if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))
		      { return !parent.isExpr }

		    // The check for `tt.name && exprAllowed` detects whether we are
		    // after a `yield` or `of` construct. See the `updateContext` for
		    // `tt.name`.
		    if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)
		      { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
		    if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)
		      { return true }
		    if (prevType === types$1.braceL)
		      { return parent === types.b_stat }
		    if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)
		      { return false }
		    return !this.exprAllowed
		  };

		  pp$6.inGeneratorContext = function() {
		    for (var i = this.context.length - 1; i >= 1; i--) {
		      var context = this.context[i];
		      if (context.token === "function")
		        { return context.generator }
		    }
		    return false
		  };

		  pp$6.updateContext = function(prevType) {
		    var update, type = this.type;
		    if (type.keyword && prevType === types$1.dot)
		      { this.exprAllowed = false; }
		    else if (update = type.updateContext)
		      { update.call(this, prevType); }
		    else
		      { this.exprAllowed = type.beforeExpr; }
		  };

		  // Used to handle edge cases when token context could not be inferred correctly during tokenization phase

		  pp$6.overrideContext = function(tokenCtx) {
		    if (this.curContext() !== tokenCtx) {
		      this.context[this.context.length - 1] = tokenCtx;
		    }
		  };

		  // Token-specific context update code

		  types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
		    if (this.context.length === 1) {
		      this.exprAllowed = true;
		      return
		    }
		    var out = this.context.pop();
		    if (out === types.b_stat && this.curContext().token === "function") {
		      out = this.context.pop();
		    }
		    this.exprAllowed = !out.isExpr;
		  };

		  types$1.braceL.updateContext = function(prevType) {
		    this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
		    this.exprAllowed = true;
		  };

		  types$1.dollarBraceL.updateContext = function() {
		    this.context.push(types.b_tmpl);
		    this.exprAllowed = true;
		  };

		  types$1.parenL.updateContext = function(prevType) {
		    var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
		    this.context.push(statementParens ? types.p_stat : types.p_expr);
		    this.exprAllowed = true;
		  };

		  types$1.incDec.updateContext = function() {
		    // tokExprAllowed stays unchanged
		  };

		  types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
		    if (prevType.beforeExpr && prevType !== types$1._else &&
		        !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&
		        !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
		        !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))
		      { this.context.push(types.f_expr); }
		    else
		      { this.context.push(types.f_stat); }
		    this.exprAllowed = false;
		  };

		  types$1.colon.updateContext = function() {
		    if (this.curContext().token === "function") { this.context.pop(); }
		    this.exprAllowed = true;
		  };

		  types$1.backQuote.updateContext = function() {
		    if (this.curContext() === types.q_tmpl)
		      { this.context.pop(); }
		    else
		      { this.context.push(types.q_tmpl); }
		    this.exprAllowed = false;
		  };

		  types$1.star.updateContext = function(prevType) {
		    if (prevType === types$1._function) {
		      var index = this.context.length - 1;
		      if (this.context[index] === types.f_expr)
		        { this.context[index] = types.f_expr_gen; }
		      else
		        { this.context[index] = types.f_gen; }
		    }
		    this.exprAllowed = true;
		  };

		  types$1.name.updateContext = function(prevType) {
		    var allowed = false;
		    if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
		      if (this.value === "of" && !this.exprAllowed ||
		          this.value === "yield" && this.inGeneratorContext())
		        { allowed = true; }
		    }
		    this.exprAllowed = allowed;
		  };

		  // A recursive descent parser operates by defining functions for all
		  // syntactic elements, and recursively calling those, each function
		  // advancing the input stream and returning an AST node. Precedence
		  // of constructs (for example, the fact that `!x[1]` means `!(x[1])`
		  // instead of `(!x)[1]` is handled by the fact that the parser
		  // function that parses unary prefix operators is called first, and
		  // in turn calls the function that parses `[]` subscripts — that
		  // way, it'll receive the node for `x[1]` already parsed, and wraps
		  // *that* in the unary operator node.
		  //
		  // Acorn uses an [operator precedence parser][opp] to handle binary
		  // operator precedence, because it is much more compact than using
		  // the technique outlined above, which uses different, nesting
		  // functions to specify precedence, for all of the ten binary
		  // precedence levels that JavaScript defines.
		  //
		  // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser


		  var pp$5 = Parser.prototype;

		  // Check if property name clashes with already added.
		  // Object/class getters and setters are not allowed to clash —
		  // either with each other or with an init property — and in
		  // strict mode, init properties are also not allowed to be repeated.

		  pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
		    if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
		      { return }
		    if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
		      { return }
		    var key = prop.key;
		    var name;
		    switch (key.type) {
		    case "Identifier": name = key.name; break
		    case "Literal": name = String(key.value); break
		    default: return
		    }
		    var kind = prop.kind;
		    if (this.options.ecmaVersion >= 6) {
		      if (name === "__proto__" && kind === "init") {
		        if (propHash.proto) {
		          if (refDestructuringErrors) {
		            if (refDestructuringErrors.doubleProto < 0) {
		              refDestructuringErrors.doubleProto = key.start;
		            }
		          } else {
		            this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
		          }
		        }
		        propHash.proto = true;
		      }
		      return
		    }
		    name = "$" + name;
		    var other = propHash[name];
		    if (other) {
		      var redefinition;
		      if (kind === "init") {
		        redefinition = this.strict && other.init || other.get || other.set;
		      } else {
		        redefinition = other.init || other[kind];
		      }
		      if (redefinition)
		        { this.raiseRecoverable(key.start, "Redefinition of property"); }
		    } else {
		      other = propHash[name] = {
		        init: false,
		        get: false,
		        set: false
		      };
		    }
		    other[kind] = true;
		  };

		  // ### Expression parsing

		  // These nest, from the most general expression type at the top to
		  // 'atomic', nondivisible expression types at the bottom. Most of
		  // the functions will simply let the function(s) below them parse,
		  // and, *if* the syntactic construct they handle is present, wrap
		  // the AST node that the inner parser gave them in another node.

		  // Parse a full expression. The optional arguments are used to
		  // forbid the `in` operator (in for loops initalization expressions)
		  // and provide reference for storing '=' operator inside shorthand
		  // property assignment in contexts where both object expression
		  // and object pattern might appear (so it's possible to raise
		  // delayed syntax error at correct position).

		  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
		    var startPos = this.start, startLoc = this.startLoc;
		    var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
		    if (this.type === types$1.comma) {
		      var node = this.startNodeAt(startPos, startLoc);
		      node.expressions = [expr];
		      while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
		      return this.finishNode(node, "SequenceExpression")
		    }
		    return expr
		  };

		  // Parse an assignment expression. This includes applications of
		  // operators like `+=`.

		  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
		    if (this.isContextual("yield")) {
		      if (this.inGenerator) { return this.parseYield(forInit) }
		      // The tokenizer will assume an expression is allowed after
		      // `yield`, but this isn't that kind of yield
		      else { this.exprAllowed = false; }
		    }

		    var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
		    if (refDestructuringErrors) {
		      oldParenAssign = refDestructuringErrors.parenthesizedAssign;
		      oldTrailingComma = refDestructuringErrors.trailingComma;
		      oldDoubleProto = refDestructuringErrors.doubleProto;
		      refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
		    } else {
		      refDestructuringErrors = new DestructuringErrors;
		      ownDestructuringErrors = true;
		    }

		    var startPos = this.start, startLoc = this.startLoc;
		    if (this.type === types$1.parenL || this.type === types$1.name) {
		      this.potentialArrowAt = this.start;
		      this.potentialArrowInForAwait = forInit === "await";
		    }
		    var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
		    if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
		    if (this.type.isAssign) {
		      var node = this.startNodeAt(startPos, startLoc);
		      node.operator = this.value;
		      if (this.type === types$1.eq)
		        { left = this.toAssignable(left, false, refDestructuringErrors); }
		      if (!ownDestructuringErrors) {
		        refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
		      }
		      if (refDestructuringErrors.shorthandAssign >= left.start)
		        { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
		      if (this.type === types$1.eq)
		        { this.checkLValPattern(left); }
		      else
		        { this.checkLValSimple(left); }
		      node.left = left;
		      this.next();
		      node.right = this.parseMaybeAssign(forInit);
		      if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }
		      return this.finishNode(node, "AssignmentExpression")
		    } else {
		      if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
		    }
		    if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
		    if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
		    return left
		  };

		  // Parse a ternary conditional (`?:`) operator.

		  pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
		    var startPos = this.start, startLoc = this.startLoc;
		    var expr = this.parseExprOps(forInit, refDestructuringErrors);
		    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
		    if (this.eat(types$1.question)) {
		      var node = this.startNodeAt(startPos, startLoc);
		      node.test = expr;
		      node.consequent = this.parseMaybeAssign();
		      this.expect(types$1.colon);
		      node.alternate = this.parseMaybeAssign(forInit);
		      return this.finishNode(node, "ConditionalExpression")
		    }
		    return expr
		  };

		  // Start the precedence parser.

		  pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
		    var startPos = this.start, startLoc = this.startLoc;
		    var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
		    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
		    return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)
		  };

		  // Parse binary operators with the operator precedence parsing
		  // algorithm. `left` is the left-hand side of the operator.
		  // `minPrec` provides context that allows the function to stop and
		  // defer further parser to one of its callers when it encounters an
		  // operator that has a lower precedence than the set it is parsing.

		  pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
		    var prec = this.type.binop;
		    if (prec != null && (!forInit || this.type !== types$1._in)) {
		      if (prec > minPrec) {
		        var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
		        var coalesce = this.type === types$1.coalesce;
		        if (coalesce) {
		          // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
		          // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
		          prec = types$1.logicalAND.binop;
		        }
		        var op = this.value;
		        this.next();
		        var startPos = this.start, startLoc = this.startLoc;
		        var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
		        var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
		        if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {
		          this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
		        }
		        return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)
		      }
		    }
		    return left
		  };

		  pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
		    if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); }
		    var node = this.startNodeAt(startPos, startLoc);
		    node.left = left;
		    node.operator = op;
		    node.right = right;
		    return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
		  };

		  // Parse unary operators, both prefix and postfix.

		  pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
		    var startPos = this.start, startLoc = this.startLoc, expr;
		    if (this.isContextual("await") && this.canAwait) {
		      expr = this.parseAwait(forInit);
		      sawUnary = true;
		    } else if (this.type.prefix) {
		      var node = this.startNode(), update = this.type === types$1.incDec;
		      node.operator = this.value;
		      node.prefix = true;
		      this.next();
		      node.argument = this.parseMaybeUnary(null, true, update, forInit);
		      this.checkExpressionErrors(refDestructuringErrors, true);
		      if (update) { this.checkLValSimple(node.argument); }
		      else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
		        { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
		      else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
		        { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
		      else { sawUnary = true; }
		      expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
		    } else if (!sawUnary && this.type === types$1.privateId) {
		      if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
		      expr = this.parsePrivateIdent();
		      // only could be private fields in 'in', such as #x in obj
		      if (this.type !== types$1._in) { this.unexpected(); }
		    } else {
		      expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
		      if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
		      while (this.type.postfix && !this.canInsertSemicolon()) {
		        var node$1 = this.startNodeAt(startPos, startLoc);
		        node$1.operator = this.value;
		        node$1.prefix = false;
		        node$1.argument = expr;
		        this.checkLValSimple(expr);
		        this.next();
		        expr = this.finishNode(node$1, "UpdateExpression");
		      }
		    }

		    if (!incDec && this.eat(types$1.starstar)) {
		      if (sawUnary)
		        { this.unexpected(this.lastTokStart); }
		      else
		        { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
		    } else {
		      return expr
		    }
		  };

		  function isLocalVariableAccess(node) {
		    return (
		      node.type === "Identifier" ||
		      node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
		    )
		  }

		  function isPrivateFieldAccess(node) {
		    return (
		      node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
		      node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
		      node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
		    )
		  }

		  // Parse call, dot, and `[]`-subscript expressions.

		  pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
		    var startPos = this.start, startLoc = this.startLoc;
		    var expr = this.parseExprAtom(refDestructuringErrors, forInit);
		    if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
		      { return expr }
		    var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
		    if (refDestructuringErrors && result.type === "MemberExpression") {
		      if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
		      if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
		      if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }
		    }
		    return result
		  };

		  pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
		    var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
		        this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
		        this.potentialArrowAt === base.start;
		    var optionalChained = false;

		    while (true) {
		      var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);

		      if (element.optional) { optionalChained = true; }
		      if (element === base || element.type === "ArrowFunctionExpression") {
		        if (optionalChained) {
		          var chainNode = this.startNodeAt(startPos, startLoc);
		          chainNode.expression = element;
		          element = this.finishNode(chainNode, "ChainExpression");
		        }
		        return element
		      }

		      base = element;
		    }
		  };

		  pp$5.shouldParseAsyncArrow = function() {
		    return !this.canInsertSemicolon() && this.eat(types$1.arrow)
		  };

		  pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
		    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
		  };

		  pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
		    var optionalSupported = this.options.ecmaVersion >= 11;
		    var optional = optionalSupported && this.eat(types$1.questionDot);
		    if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }

		    var computed = this.eat(types$1.bracketL);
		    if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {
		      var node = this.startNodeAt(startPos, startLoc);
		      node.object = base;
		      if (computed) {
		        node.property = this.parseExpression();
		        this.expect(types$1.bracketR);
		      } else if (this.type === types$1.privateId && base.type !== "Super") {
		        node.property = this.parsePrivateIdent();
		      } else {
		        node.property = this.parseIdent(this.options.allowReserved !== "never");
		      }
		      node.computed = !!computed;
		      if (optionalSupported) {
		        node.optional = optional;
		      }
		      base = this.finishNode(node, "MemberExpression");
		    } else if (!noCalls && this.eat(types$1.parenL)) {
		      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
		      this.yieldPos = 0;
		      this.awaitPos = 0;
		      this.awaitIdentPos = 0;
		      var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
		      if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
		        this.checkPatternErrors(refDestructuringErrors, false);
		        this.checkYieldAwaitInDefaultParams();
		        if (this.awaitIdentPos > 0)
		          { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
		        this.yieldPos = oldYieldPos;
		        this.awaitPos = oldAwaitPos;
		        this.awaitIdentPos = oldAwaitIdentPos;
		        return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)
		      }
		      this.checkExpressionErrors(refDestructuringErrors, true);
		      this.yieldPos = oldYieldPos || this.yieldPos;
		      this.awaitPos = oldAwaitPos || this.awaitPos;
		      this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
		      var node$1 = this.startNodeAt(startPos, startLoc);
		      node$1.callee = base;
		      node$1.arguments = exprList;
		      if (optionalSupported) {
		        node$1.optional = optional;
		      }
		      base = this.finishNode(node$1, "CallExpression");
		    } else if (this.type === types$1.backQuote) {
		      if (optional || optionalChained) {
		        this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
		      }
		      var node$2 = this.startNodeAt(startPos, startLoc);
		      node$2.tag = base;
		      node$2.quasi = this.parseTemplate({isTagged: true});
		      base = this.finishNode(node$2, "TaggedTemplateExpression");
		    }
		    return base
		  };

		  // Parse an atomic expression — either a single token that is an
		  // expression, an expression started by a keyword like `function` or
		  // `new`, or an expression wrapped in punctuation like `()`, `[]`,
		  // or `{}`.

		  pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
		    // If a division operator appears in an expression position, the
		    // tokenizer got confused, and we force it to read a regexp instead.
		    if (this.type === types$1.slash) { this.readRegexp(); }

		    var node, canBeArrow = this.potentialArrowAt === this.start;
		    switch (this.type) {
		    case types$1._super:
		      if (!this.allowSuper)
		        { this.raise(this.start, "'super' keyword outside a method"); }
		      node = this.startNode();
		      this.next();
		      if (this.type === types$1.parenL && !this.allowDirectSuper)
		        { this.raise(node.start, "super() call outside constructor of a subclass"); }
		      // The `super` keyword can appear at below:
		      // SuperProperty:
		      //     super [ Expression ]
		      //     super . IdentifierName
		      // SuperCall:
		      //     super ( Arguments )
		      if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)
		        { this.unexpected(); }
		      return this.finishNode(node, "Super")

		    case types$1._this:
		      node = this.startNode();
		      this.next();
		      return this.finishNode(node, "ThisExpression")

		    case types$1.name:
		      var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
		      var id = this.parseIdent(false);
		      if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
		        this.overrideContext(types.f_expr);
		        return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)
		      }
		      if (canBeArrow && !this.canInsertSemicolon()) {
		        if (this.eat(types$1.arrow))
		          { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
		        if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc &&
		            (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
		          id = this.parseIdent(false);
		          if (this.canInsertSemicolon() || !this.eat(types$1.arrow))
		            { this.unexpected(); }
		          return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
		        }
		      }
		      return id

		    case types$1.regexp:
		      var value = this.value;
		      node = this.parseLiteral(value.value);
		      node.regex = {pattern: value.pattern, flags: value.flags};
		      return node

		    case types$1.num: case types$1.string:
		      return this.parseLiteral(this.value)

		    case types$1._null: case types$1._true: case types$1._false:
		      node = this.startNode();
		      node.value = this.type === types$1._null ? null : this.type === types$1._true;
		      node.raw = this.type.keyword;
		      this.next();
		      return this.finishNode(node, "Literal")

		    case types$1.parenL:
		      var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
		      if (refDestructuringErrors) {
		        if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
		          { refDestructuringErrors.parenthesizedAssign = start; }
		        if (refDestructuringErrors.parenthesizedBind < 0)
		          { refDestructuringErrors.parenthesizedBind = start; }
		      }
		      return expr

		    case types$1.bracketL:
		      node = this.startNode();
		      this.next();
		      node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
		      return this.finishNode(node, "ArrayExpression")

		    case types$1.braceL:
		      this.overrideContext(types.b_expr);
		      return this.parseObj(false, refDestructuringErrors)

		    case types$1._function:
		      node = this.startNode();
		      this.next();
		      return this.parseFunction(node, 0)

		    case types$1._class:
		      return this.parseClass(this.startNode(), false)

		    case types$1._new:
		      return this.parseNew()

		    case types$1.backQuote:
		      return this.parseTemplate()

		    case types$1._import:
		      if (this.options.ecmaVersion >= 11) {
		        return this.parseExprImport(forNew)
		      } else {
		        return this.unexpected()
		      }

		    default:
		      return this.parseExprAtomDefault()
		    }
		  };

		  pp$5.parseExprAtomDefault = function() {
		    this.unexpected();
		  };

		  pp$5.parseExprImport = function(forNew) {
		    var node = this.startNode();

		    // Consume `import` as an identifier for `import.meta`.
		    // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
		    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
		    this.next();

		    if (this.type === types$1.parenL && !forNew) {
		      return this.parseDynamicImport(node)
		    } else if (this.type === types$1.dot) {
		      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
		      meta.name = "import";
		      node.meta = this.finishNode(meta, "Identifier");
		      return this.parseImportMeta(node)
		    } else {
		      this.unexpected();
		    }
		  };

		  pp$5.parseDynamicImport = function(node) {
		    this.next(); // skip `(`

		    // Parse node.source.
		    node.source = this.parseMaybeAssign();

		    if (this.options.ecmaVersion >= 16) {
		      if (!this.eat(types$1.parenR)) {
		        this.expect(types$1.comma);
		        if (!this.afterTrailingComma(types$1.parenR)) {
		          node.options = this.parseMaybeAssign();
		          if (!this.eat(types$1.parenR)) {
		            this.expect(types$1.comma);
		            if (!this.afterTrailingComma(types$1.parenR)) {
		              this.unexpected();
		            }
		          }
		        } else {
		          node.options = null;
		        }
		      } else {
		        node.options = null;
		      }
		    } else {
		      // Verify ending.
		      if (!this.eat(types$1.parenR)) {
		        var errorPos = this.start;
		        if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
		          this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
		        } else {
		          this.unexpected(errorPos);
		        }
		      }
		    }

		    return this.finishNode(node, "ImportExpression")
		  };

		  pp$5.parseImportMeta = function(node) {
		    this.next(); // skip `.`

		    var containsEsc = this.containsEsc;
		    node.property = this.parseIdent(true);

		    if (node.property.name !== "meta")
		      { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
		    if (containsEsc)
		      { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
		    if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere)
		      { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }

		    return this.finishNode(node, "MetaProperty")
		  };

		  pp$5.parseLiteral = function(value) {
		    var node = this.startNode();
		    node.value = value;
		    node.raw = this.input.slice(this.start, this.end);
		    if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
		    this.next();
		    return this.finishNode(node, "Literal")
		  };

		  pp$5.parseParenExpression = function() {
		    this.expect(types$1.parenL);
		    var val = this.parseExpression();
		    this.expect(types$1.parenR);
		    return val
		  };

		  pp$5.shouldParseArrow = function(exprList) {
		    return !this.canInsertSemicolon()
		  };

		  pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
		    var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
		    if (this.options.ecmaVersion >= 6) {
		      this.next();

		      var innerStartPos = this.start, innerStartLoc = this.startLoc;
		      var exprList = [], first = true, lastIsComma = false;
		      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
		      this.yieldPos = 0;
		      this.awaitPos = 0;
		      // Do not save awaitIdentPos to allow checking awaits nested in parameters
		      while (this.type !== types$1.parenR) {
		        first ? first = false : this.expect(types$1.comma);
		        if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
		          lastIsComma = true;
		          break
		        } else if (this.type === types$1.ellipsis) {
		          spreadStart = this.start;
		          exprList.push(this.parseParenItem(this.parseRestBinding()));
		          if (this.type === types$1.comma) {
		            this.raiseRecoverable(
		              this.start,
		              "Comma is not permitted after the rest element"
		            );
		          }
		          break
		        } else {
		          exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
		        }
		      }
		      var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
		      this.expect(types$1.parenR);

		      if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
		        this.checkPatternErrors(refDestructuringErrors, false);
		        this.checkYieldAwaitInDefaultParams();
		        this.yieldPos = oldYieldPos;
		        this.awaitPos = oldAwaitPos;
		        return this.parseParenArrowList(startPos, startLoc, exprList, forInit)
		      }

		      if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
		      if (spreadStart) { this.unexpected(spreadStart); }
		      this.checkExpressionErrors(refDestructuringErrors, true);
		      this.yieldPos = oldYieldPos || this.yieldPos;
		      this.awaitPos = oldAwaitPos || this.awaitPos;

		      if (exprList.length > 1) {
		        val = this.startNodeAt(innerStartPos, innerStartLoc);
		        val.expressions = exprList;
		        this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
		      } else {
		        val = exprList[0];
		      }
		    } else {
		      val = this.parseParenExpression();
		    }

		    if (this.options.preserveParens) {
		      var par = this.startNodeAt(startPos, startLoc);
		      par.expression = val;
		      return this.finishNode(par, "ParenthesizedExpression")
		    } else {
		      return val
		    }
		  };

		  pp$5.parseParenItem = function(item) {
		    return item
		  };

		  pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
		    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)
		  };

		  // New's precedence is slightly tricky. It must allow its argument to
		  // be a `[]` or dot subscript expression, but not a call — at least,
		  // not without wrapping it in parentheses. Thus, it uses the noCalls
		  // argument to parseSubscripts to prevent it from consuming the
		  // argument list.

		  var empty = [];

		  pp$5.parseNew = function() {
		    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
		    var node = this.startNode();
		    this.next();
		    if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
		      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
		      meta.name = "new";
		      node.meta = this.finishNode(meta, "Identifier");
		      this.next();
		      var containsEsc = this.containsEsc;
		      node.property = this.parseIdent(true);
		      if (node.property.name !== "target")
		        { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
		      if (containsEsc)
		        { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
		      if (!this.allowNewDotTarget)
		        { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
		      return this.finishNode(node, "MetaProperty")
		    }
		    var startPos = this.start, startLoc = this.startLoc;
		    node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
		    if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
		    else { node.arguments = empty; }
		    return this.finishNode(node, "NewExpression")
		  };

		  // Parse template expression.

		  pp$5.parseTemplateElement = function(ref) {
		    var isTagged = ref.isTagged;

		    var elem = this.startNode();
		    if (this.type === types$1.invalidTemplate) {
		      if (!isTagged) {
		        this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
		      }
		      elem.value = {
		        raw: this.value.replace(/\r\n?/g, "\n"),
		        cooked: null
		      };
		    } else {
		      elem.value = {
		        raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
		        cooked: this.value
		      };
		    }
		    this.next();
		    elem.tail = this.type === types$1.backQuote;
		    return this.finishNode(elem, "TemplateElement")
		  };

		  pp$5.parseTemplate = function(ref) {
		    if ( ref === void 0 ) ref = {};
		    var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;

		    var node = this.startNode();
		    this.next();
		    node.expressions = [];
		    var curElt = this.parseTemplateElement({isTagged: isTagged});
		    node.quasis = [curElt];
		    while (!curElt.tail) {
		      if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); }
		      this.expect(types$1.dollarBraceL);
		      node.expressions.push(this.parseExpression());
		      this.expect(types$1.braceR);
		      node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
		    }
		    this.next();
		    return this.finishNode(node, "TemplateLiteral")
		  };

		  pp$5.isAsyncProp = function(prop) {
		    return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
		      (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&
		      !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
		  };

		  // Parse an object literal or binding pattern.

		  pp$5.parseObj = function(isPattern, refDestructuringErrors) {
		    var node = this.startNode(), first = true, propHash = {};
		    node.properties = [];
		    this.next();
		    while (!this.eat(types$1.braceR)) {
		      if (!first) {
		        this.expect(types$1.comma);
		        if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }
		      } else { first = false; }

		      var prop = this.parseProperty(isPattern, refDestructuringErrors);
		      if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
		      node.properties.push(prop);
		    }
		    return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
		  };

		  pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
		    var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
		    if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
		      if (isPattern) {
		        prop.argument = this.parseIdent(false);
		        if (this.type === types$1.comma) {
		          this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
		        }
		        return this.finishNode(prop, "RestElement")
		      }
		      // Parse argument.
		      prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
		      // To disallow trailing comma via `this.toAssignable()`.
		      if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
		        refDestructuringErrors.trailingComma = this.start;
		      }
		      // Finish
		      return this.finishNode(prop, "SpreadElement")
		    }
		    if (this.options.ecmaVersion >= 6) {
		      prop.method = false;
		      prop.shorthand = false;
		      if (isPattern || refDestructuringErrors) {
		        startPos = this.start;
		        startLoc = this.startLoc;
		      }
		      if (!isPattern)
		        { isGenerator = this.eat(types$1.star); }
		    }
		    var containsEsc = this.containsEsc;
		    this.parsePropertyName(prop);
		    if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
		      isAsync = true;
		      isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
		      this.parsePropertyName(prop);
		    } else {
		      isAsync = false;
		    }
		    this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
		    return this.finishNode(prop, "Property")
		  };

		  pp$5.parseGetterSetter = function(prop) {
		    prop.kind = prop.key.name;
		    this.parsePropertyName(prop);
		    prop.value = this.parseMethod(false);
		    var paramCount = prop.kind === "get" ? 0 : 1;
		    if (prop.value.params.length !== paramCount) {
		      var start = prop.value.start;
		      if (prop.kind === "get")
		        { this.raiseRecoverable(start, "getter should have no params"); }
		      else
		        { this.raiseRecoverable(start, "setter should have exactly one param"); }
		    } else {
		      if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
		        { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
		    }
		  };

		  pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
		    if ((isGenerator || isAsync) && this.type === types$1.colon)
		      { this.unexpected(); }

		    if (this.eat(types$1.colon)) {
		      prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
		      prop.kind = "init";
		    } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
		      if (isPattern) { this.unexpected(); }
		      prop.kind = "init";
		      prop.method = true;
		      prop.value = this.parseMethod(isGenerator, isAsync);
		    } else if (!isPattern && !containsEsc &&
		               this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
		               (prop.key.name === "get" || prop.key.name === "set") &&
		               (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
		      if (isGenerator || isAsync) { this.unexpected(); }
		      this.parseGetterSetter(prop);
		    } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
		      if (isGenerator || isAsync) { this.unexpected(); }
		      this.checkUnreserved(prop.key);
		      if (prop.key.name === "await" && !this.awaitIdentPos)
		        { this.awaitIdentPos = startPos; }
		      prop.kind = "init";
		      if (isPattern) {
		        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
		      } else if (this.type === types$1.eq && refDestructuringErrors) {
		        if (refDestructuringErrors.shorthandAssign < 0)
		          { refDestructuringErrors.shorthandAssign = this.start; }
		        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
		      } else {
		        prop.value = this.copyNode(prop.key);
		      }
		      prop.shorthand = true;
		    } else { this.unexpected(); }
		  };

		  pp$5.parsePropertyName = function(prop) {
		    if (this.options.ecmaVersion >= 6) {
		      if (this.eat(types$1.bracketL)) {
		        prop.computed = true;
		        prop.key = this.parseMaybeAssign();
		        this.expect(types$1.bracketR);
		        return prop.key
		      } else {
		        prop.computed = false;
		      }
		    }
		    return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
		  };

		  // Initialize empty function node.

		  pp$5.initFunction = function(node) {
		    node.id = null;
		    if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
		    if (this.options.ecmaVersion >= 8) { node.async = false; }
		  };

		  // Parse object or class method.

		  pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
		    var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

		    this.initFunction(node);
		    if (this.options.ecmaVersion >= 6)
		      { node.generator = isGenerator; }
		    if (this.options.ecmaVersion >= 8)
		      { node.async = !!isAsync; }

		    this.yieldPos = 0;
		    this.awaitPos = 0;
		    this.awaitIdentPos = 0;
		    this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));

		    this.expect(types$1.parenL);
		    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
		    this.checkYieldAwaitInDefaultParams();
		    this.parseFunctionBody(node, false, true, false);

		    this.yieldPos = oldYieldPos;
		    this.awaitPos = oldAwaitPos;
		    this.awaitIdentPos = oldAwaitIdentPos;
		    return this.finishNode(node, "FunctionExpression")
		  };

		  // Parse arrow function expression with given parameters.

		  pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
		    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

		    this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
		    this.initFunction(node);
		    if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }

		    this.yieldPos = 0;
		    this.awaitPos = 0;
		    this.awaitIdentPos = 0;

		    node.params = this.toAssignableList(params, true);
		    this.parseFunctionBody(node, true, false, forInit);

		    this.yieldPos = oldYieldPos;
		    this.awaitPos = oldAwaitPos;
		    this.awaitIdentPos = oldAwaitIdentPos;
		    return this.finishNode(node, "ArrowFunctionExpression")
		  };

		  // Parse function body and check parameters.

		  pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
		    var isExpression = isArrowFunction && this.type !== types$1.braceL;
		    var oldStrict = this.strict, useStrict = false;

		    if (isExpression) {
		      node.body = this.parseMaybeAssign(forInit);
		      node.expression = true;
		      this.checkParams(node, false);
		    } else {
		      var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
		      if (!oldStrict || nonSimple) {
		        useStrict = this.strictDirective(this.end);
		        // If this is a strict mode function, verify that argument names
		        // are not repeated, and it does not try to bind the words `eval`
		        // or `arguments`.
		        if (useStrict && nonSimple)
		          { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
		      }
		      // Start a new scope with regard to labels and the `inFunction`
		      // flag (restore them to their old value afterwards).
		      var oldLabels = this.labels;
		      this.labels = [];
		      if (useStrict) { this.strict = true; }

		      // Add the params to varDeclaredNames to ensure that an error is thrown
		      // if a let/const declaration in the function clashes with one of the params.
		      this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
		      // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
		      if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
		      node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
		      node.expression = false;
		      this.adaptDirectivePrologue(node.body.body);
		      this.labels = oldLabels;
		    }
		    this.exitScope();
		  };

		  pp$5.isSimpleParamList = function(params) {
		    for (var i = 0, list = params; i < list.length; i += 1)
		      {
		      var param = list[i];

		      if (param.type !== "Identifier") { return false
		    } }
		    return true
		  };

		  // Checks function params for various disallowed patterns such as using "eval"
		  // or "arguments" and duplicate parameters.

		  pp$5.checkParams = function(node, allowDuplicates) {
		    var nameHash = Object.create(null);
		    for (var i = 0, list = node.params; i < list.length; i += 1)
		      {
		      var param = list[i];

		      this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
		    }
		  };

		  // Parses a comma-separated list of expressions, and returns them as
		  // an array. `close` is the token type that ends the list, and
		  // `allowEmpty` can be turned on to allow subsequent commas with
		  // nothing in between them to be parsed as `null` (which is needed
		  // for array literals).

		  pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
		    var elts = [], first = true;
		    while (!this.eat(close)) {
		      if (!first) {
		        this.expect(types$1.comma);
		        if (allowTrailingComma && this.afterTrailingComma(close)) { break }
		      } else { first = false; }

		      var elt = (void 0);
		      if (allowEmpty && this.type === types$1.comma)
		        { elt = null; }
		      else if (this.type === types$1.ellipsis) {
		        elt = this.parseSpread(refDestructuringErrors);
		        if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)
		          { refDestructuringErrors.trailingComma = this.start; }
		      } else {
		        elt = this.parseMaybeAssign(false, refDestructuringErrors);
		      }
		      elts.push(elt);
		    }
		    return elts
		  };

		  pp$5.checkUnreserved = function(ref) {
		    var start = ref.start;
		    var end = ref.end;
		    var name = ref.name;

		    if (this.inGenerator && name === "yield")
		      { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
		    if (this.inAsync && name === "await")
		      { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
		    if (this.currentThisScope().inClassFieldInit && name === "arguments")
		      { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
		    if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
		      { this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
		    if (this.keywords.test(name))
		      { this.raise(start, ("Unexpected keyword '" + name + "'")); }
		    if (this.options.ecmaVersion < 6 &&
		      this.input.slice(start, end).indexOf("\\") !== -1) { return }
		    var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
		    if (re.test(name)) {
		      if (!this.inAsync && name === "await")
		        { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
		      this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
		    }
		  };

		  // Parse the next token as an identifier. If `liberal` is true (used
		  // when parsing properties), it will also convert keywords into
		  // identifiers.

		  pp$5.parseIdent = function(liberal) {
		    var node = this.parseIdentNode();
		    this.next(!!liberal);
		    this.finishNode(node, "Identifier");
		    if (!liberal) {
		      this.checkUnreserved(node);
		      if (node.name === "await" && !this.awaitIdentPos)
		        { this.awaitIdentPos = node.start; }
		    }
		    return node
		  };

		  pp$5.parseIdentNode = function() {
		    var node = this.startNode();
		    if (this.type === types$1.name) {
		      node.name = this.value;
		    } else if (this.type.keyword) {
		      node.name = this.type.keyword;

		      // To fix https://github.com/acornjs/acorn/issues/575
		      // `class` and `function` keywords push new context into this.context.
		      // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
		      // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
		      if ((node.name === "class" || node.name === "function") &&
		        (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
		        this.context.pop();
		      }
		      this.type = types$1.name;
		    } else {
		      this.unexpected();
		    }
		    return node
		  };

		  pp$5.parsePrivateIdent = function() {
		    var node = this.startNode();
		    if (this.type === types$1.privateId) {
		      node.name = this.value;
		    } else {
		      this.unexpected();
		    }
		    this.next();
		    this.finishNode(node, "PrivateIdentifier");

		    // For validating existence
		    if (this.options.checkPrivateFields) {
		      if (this.privateNameStack.length === 0) {
		        this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
		      } else {
		        this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
		      }
		    }

		    return node
		  };

		  // Parses yield expression inside generator.

		  pp$5.parseYield = function(forInit) {
		    if (!this.yieldPos) { this.yieldPos = this.start; }

		    var node = this.startNode();
		    this.next();
		    if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {
		      node.delegate = false;
		      node.argument = null;
		    } else {
		      node.delegate = this.eat(types$1.star);
		      node.argument = this.parseMaybeAssign(forInit);
		    }
		    return this.finishNode(node, "YieldExpression")
		  };

		  pp$5.parseAwait = function(forInit) {
		    if (!this.awaitPos) { this.awaitPos = this.start; }

		    var node = this.startNode();
		    this.next();
		    node.argument = this.parseMaybeUnary(null, true, false, forInit);
		    return this.finishNode(node, "AwaitExpression")
		  };

		  var pp$4 = Parser.prototype;

		  // This function is used to raise exceptions on parse errors. It
		  // takes an offset integer (into the current `input`) to indicate
		  // the location of the error, attaches the position to the end
		  // of the error message, and then raises a `SyntaxError` with that
		  // message.

		  pp$4.raise = function(pos, message) {
		    var loc = getLineInfo(this.input, pos);
		    message += " (" + loc.line + ":" + loc.column + ")";
		    var err = new SyntaxError(message);
		    err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
		    throw err
		  };

		  pp$4.raiseRecoverable = pp$4.raise;

		  pp$4.curPosition = function() {
		    if (this.options.locations) {
		      return new Position(this.curLine, this.pos - this.lineStart)
		    }
		  };

		  var pp$3 = Parser.prototype;

		  var Scope = function Scope(flags) {
		    this.flags = flags;
		    // A list of var-declared names in the current lexical scope
		    this.var = [];
		    // A list of lexically-declared names in the current lexical scope
		    this.lexical = [];
		    // A list of lexically-declared FunctionDeclaration names in the current lexical scope
		    this.functions = [];
		    // A switch to disallow the identifier reference 'arguments'
		    this.inClassFieldInit = false;
		  };

		  // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.

		  pp$3.enterScope = function(flags) {
		    this.scopeStack.push(new Scope(flags));
		  };

		  pp$3.exitScope = function() {
		    this.scopeStack.pop();
		  };

		  // The spec says:
		  // > At the top level of a function, or script, function declarations are
		  // > treated like var declarations rather than like lexical declarations.
		  pp$3.treatFunctionsAsVarInScope = function(scope) {
		    return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
		  };

		  pp$3.declareName = function(name, bindingType, pos) {
		    var redeclared = false;
		    if (bindingType === BIND_LEXICAL) {
		      var scope = this.currentScope();
		      redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
		      scope.lexical.push(name);
		      if (this.inModule && (scope.flags & SCOPE_TOP))
		        { delete this.undefinedExports[name]; }
		    } else if (bindingType === BIND_SIMPLE_CATCH) {
		      var scope$1 = this.currentScope();
		      scope$1.lexical.push(name);
		    } else if (bindingType === BIND_FUNCTION) {
		      var scope$2 = this.currentScope();
		      if (this.treatFunctionsAsVar)
		        { redeclared = scope$2.lexical.indexOf(name) > -1; }
		      else
		        { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
		      scope$2.functions.push(name);
		    } else {
		      for (var i = this.scopeStack.length - 1; i >= 0; --i) {
		        var scope$3 = this.scopeStack[i];
		        if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
		            !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
		          redeclared = true;
		          break
		        }
		        scope$3.var.push(name);
		        if (this.inModule && (scope$3.flags & SCOPE_TOP))
		          { delete this.undefinedExports[name]; }
		        if (scope$3.flags & SCOPE_VAR) { break }
		      }
		    }
		    if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
		  };

		  pp$3.checkLocalExport = function(id) {
		    // scope.functions must be empty as Module code is always strict.
		    if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
		        this.scopeStack[0].var.indexOf(id.name) === -1) {
		      this.undefinedExports[id.name] = id;
		    }
		  };

		  pp$3.currentScope = function() {
		    return this.scopeStack[this.scopeStack.length - 1]
		  };

		  pp$3.currentVarScope = function() {
		    for (var i = this.scopeStack.length - 1;; i--) {
		      var scope = this.scopeStack[i];
		      if (scope.flags & SCOPE_VAR) { return scope }
		    }
		  };

		  // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
		  pp$3.currentThisScope = function() {
		    for (var i = this.scopeStack.length - 1;; i--) {
		      var scope = this.scopeStack[i];
		      if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
		    }
		  };

		  var Node = function Node(parser, pos, loc) {
		    this.type = "";
		    this.start = pos;
		    this.end = 0;
		    if (parser.options.locations)
		      { this.loc = new SourceLocation(parser, loc); }
		    if (parser.options.directSourceFile)
		      { this.sourceFile = parser.options.directSourceFile; }
		    if (parser.options.ranges)
		      { this.range = [pos, 0]; }
		  };

		  // Start an AST node, attaching a start offset.

		  var pp$2 = Parser.prototype;

		  pp$2.startNode = function() {
		    return new Node(this, this.start, this.startLoc)
		  };

		  pp$2.startNodeAt = function(pos, loc) {
		    return new Node(this, pos, loc)
		  };

		  // Finish an AST node, adding `type` and `end` properties.

		  function finishNodeAt(node, type, pos, loc) {
		    node.type = type;
		    node.end = pos;
		    if (this.options.locations)
		      { node.loc.end = loc; }
		    if (this.options.ranges)
		      { node.range[1] = pos; }
		    return node
		  }

		  pp$2.finishNode = function(node, type) {
		    return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
		  };

		  // Finish node at given position

		  pp$2.finishNodeAt = function(node, type, pos, loc) {
		    return finishNodeAt.call(this, node, type, pos, loc)
		  };

		  pp$2.copyNode = function(node) {
		    var newNode = new Node(this, node.start, this.startLoc);
		    for (var prop in node) { newNode[prop] = node[prop]; }
		    return newNode
		  };

		  // This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
		  var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";

		  // This file contains Unicode properties extracted from the ECMAScript specification.
		  // The lists are extracted like so:
		  // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)

		  // #table-binary-unicode-properties
		  var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
		  var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
		  var ecma11BinaryProperties = ecma10BinaryProperties;
		  var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
		  var ecma13BinaryProperties = ecma12BinaryProperties;
		  var ecma14BinaryProperties = ecma13BinaryProperties;

		  var unicodeBinaryProperties = {
		    9: ecma9BinaryProperties,
		    10: ecma10BinaryProperties,
		    11: ecma11BinaryProperties,
		    12: ecma12BinaryProperties,
		    13: ecma13BinaryProperties,
		    14: ecma14BinaryProperties
		  };

		  // #table-binary-unicode-properties-of-strings
		  var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";

		  var unicodeBinaryPropertiesOfStrings = {
		    9: "",
		    10: "",
		    11: "",
		    12: "",
		    13: "",
		    14: ecma14BinaryPropertiesOfStrings
		  };

		  // #table-unicode-general-category-values
		  var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";

		  // #table-unicode-script-values
		  var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
		  var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
		  var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
		  var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
		  var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
		  var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;

		  var unicodeScriptValues = {
		    9: ecma9ScriptValues,
		    10: ecma10ScriptValues,
		    11: ecma11ScriptValues,
		    12: ecma12ScriptValues,
		    13: ecma13ScriptValues,
		    14: ecma14ScriptValues
		  };

		  var data = {};
		  function buildUnicodeData(ecmaVersion) {
		    var d = data[ecmaVersion] = {
		      binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
		      binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
		      nonBinary: {
		        General_Category: wordsRegexp(unicodeGeneralCategoryValues),
		        Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
		      }
		    };
		    d.nonBinary.Script_Extensions = d.nonBinary.Script;

		    d.nonBinary.gc = d.nonBinary.General_Category;
		    d.nonBinary.sc = d.nonBinary.Script;
		    d.nonBinary.scx = d.nonBinary.Script_Extensions;
		  }

		  for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
		    var ecmaVersion = list[i];

		    buildUnicodeData(ecmaVersion);
		  }

		  var pp$1 = Parser.prototype;

		  // Track disjunction structure to determine whether a duplicate
		  // capture group name is allowed because it is in a separate branch.
		  var BranchID = function BranchID(parent, base) {
		    // Parent disjunction branch
		    this.parent = parent;
		    // Identifies this set of sibling branches
		    this.base = base || this;
		  };

		  BranchID.prototype.separatedFrom = function separatedFrom (alt) {
		    // A branch is separate from another branch if they or any of
		    // their parents are siblings in a given disjunction
		    for (var self = this; self; self = self.parent) {
		      for (var other = alt; other; other = other.parent) {
		        if (self.base === other.base && self !== other) { return true }
		      }
		    }
		    return false
		  };

		  BranchID.prototype.sibling = function sibling () {
		    return new BranchID(this.parent, this.base)
		  };

		  var RegExpValidationState = function RegExpValidationState(parser) {
		    this.parser = parser;
		    this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
		    this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
		    this.source = "";
		    this.flags = "";
		    this.start = 0;
		    this.switchU = false;
		    this.switchV = false;
		    this.switchN = false;
		    this.pos = 0;
		    this.lastIntValue = 0;
		    this.lastStringValue = "";
		    this.lastAssertionIsQuantifiable = false;
		    this.numCapturingParens = 0;
		    this.maxBackReference = 0;
		    this.groupNames = Object.create(null);
		    this.backReferenceNames = [];
		    this.branchID = null;
		  };

		  RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
		    var unicodeSets = flags.indexOf("v") !== -1;
		    var unicode = flags.indexOf("u") !== -1;
		    this.start = start | 0;
		    this.source = pattern + "";
		    this.flags = flags;
		    if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
		      this.switchU = true;
		      this.switchV = true;
		      this.switchN = true;
		    } else {
		      this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
		      this.switchV = false;
		      this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
		    }
		  };

		  RegExpValidationState.prototype.raise = function raise (message) {
		    this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
		  };

		  // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
		  // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
		  RegExpValidationState.prototype.at = function at (i, forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    var s = this.source;
		    var l = s.length;
		    if (i >= l) {
		      return -1
		    }
		    var c = s.charCodeAt(i);
		    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
		      return c
		    }
		    var next = s.charCodeAt(i + 1);
		    return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
		  };

		  RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    var s = this.source;
		    var l = s.length;
		    if (i >= l) {
		      return l
		    }
		    var c = s.charCodeAt(i), next;
		    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
		        (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
		      return i + 1
		    }
		    return i + 2
		  };

		  RegExpValidationState.prototype.current = function current (forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    return this.at(this.pos, forceU)
		  };

		  RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    return this.at(this.nextIndex(this.pos, forceU), forceU)
		  };

		  RegExpValidationState.prototype.advance = function advance (forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    this.pos = this.nextIndex(this.pos, forceU);
		  };

		  RegExpValidationState.prototype.eat = function eat (ch, forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    if (this.current(forceU) === ch) {
		      this.advance(forceU);
		      return true
		    }
		    return false
		  };

		  RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {
		      if ( forceU === void 0 ) forceU = false;

		    var pos = this.pos;
		    for (var i = 0, list = chs; i < list.length; i += 1) {
		      var ch = list[i];

		        var current = this.at(pos, forceU);
		      if (current === -1 || current !== ch) {
		        return false
		      }
		      pos = this.nextIndex(pos, forceU);
		    }
		    this.pos = pos;
		    return true
		  };

		  /**
		   * Validate the flags part of a given RegExpLiteral.
		   *
		   * @param {RegExpValidationState} state The state to validate RegExp.
		   * @returns {void}
		   */
		  pp$1.validateRegExpFlags = function(state) {
		    var validFlags = state.validFlags;
		    var flags = state.flags;

		    var u = false;
		    var v = false;

		    for (var i = 0; i < flags.length; i++) {
		      var flag = flags.charAt(i);
		      if (validFlags.indexOf(flag) === -1) {
		        this.raise(state.start, "Invalid regular expression flag");
		      }
		      if (flags.indexOf(flag, i + 1) > -1) {
		        this.raise(state.start, "Duplicate regular expression flag");
		      }
		      if (flag === "u") { u = true; }
		      if (flag === "v") { v = true; }
		    }
		    if (this.options.ecmaVersion >= 15 && u && v) {
		      this.raise(state.start, "Invalid regular expression flag");
		    }
		  };

		  function hasProp(obj) {
		    for (var _ in obj) { return true }
		    return false
		  }

		  /**
		   * Validate the pattern part of a given RegExpLiteral.
		   *
		   * @param {RegExpValidationState} state The state to validate RegExp.
		   * @returns {void}
		   */
		  pp$1.validateRegExpPattern = function(state) {
		    this.regexp_pattern(state);

		    // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
		    // parsing contains a |GroupName|, reparse with the goal symbol
		    // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
		    // exception if _P_ did not conform to the grammar, if any elements of _P_
		    // were not matched by the parse, or if any Early Error conditions exist.
		    if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
		      state.switchN = true;
		      this.regexp_pattern(state);
		    }
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
		  pp$1.regexp_pattern = function(state) {
		    state.pos = 0;
		    state.lastIntValue = 0;
		    state.lastStringValue = "";
		    state.lastAssertionIsQuantifiable = false;
		    state.numCapturingParens = 0;
		    state.maxBackReference = 0;
		    state.groupNames = Object.create(null);
		    state.backReferenceNames.length = 0;
		    state.branchID = null;

		    this.regexp_disjunction(state);

		    if (state.pos !== state.source.length) {
		      // Make the same messages as V8.
		      if (state.eat(0x29 /* ) */)) {
		        state.raise("Unmatched ')'");
		      }
		      if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
		        state.raise("Lone quantifier brackets");
		      }
		    }
		    if (state.maxBackReference > state.numCapturingParens) {
		      state.raise("Invalid escape");
		    }
		    for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
		      var name = list[i];

		      if (!state.groupNames[name]) {
		        state.raise("Invalid named capture referenced");
		      }
		    }
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
		  pp$1.regexp_disjunction = function(state) {
		    var trackDisjunction = this.options.ecmaVersion >= 16;
		    if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
		    this.regexp_alternative(state);
		    while (state.eat(0x7C /* | */)) {
		      if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
		      this.regexp_alternative(state);
		    }
		    if (trackDisjunction) { state.branchID = state.branchID.parent; }

		    // Make the same message as V8.
		    if (this.regexp_eatQuantifier(state, true)) {
		      state.raise("Nothing to repeat");
		    }
		    if (state.eat(0x7B /* { */)) {
		      state.raise("Lone quantifier brackets");
		    }
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
		  pp$1.regexp_alternative = function(state) {
		    while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
		  pp$1.regexp_eatTerm = function(state) {
		    if (this.regexp_eatAssertion(state)) {
		      // Handle `QuantifiableAssertion Quantifier` alternative.
		      // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
		      // is a QuantifiableAssertion.
		      if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
		        // Make the same message as V8.
		        if (state.switchU) {
		          state.raise("Invalid quantifier");
		        }
		      }
		      return true
		    }

		    if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
		      this.regexp_eatQuantifier(state);
		      return true
		    }

		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
		  pp$1.regexp_eatAssertion = function(state) {
		    var start = state.pos;
		    state.lastAssertionIsQuantifiable = false;

		    // ^, $
		    if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
		      return true
		    }

		    // \b \B
		    if (state.eat(0x5C /* \ */)) {
		      if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
		        return true
		      }
		      state.pos = start;
		    }

		    // Lookahead / Lookbehind
		    if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
		      var lookbehind = false;
		      if (this.options.ecmaVersion >= 9) {
		        lookbehind = state.eat(0x3C /* < */);
		      }
		      if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
		        this.regexp_disjunction(state);
		        if (!state.eat(0x29 /* ) */)) {
		          state.raise("Unterminated group");
		        }
		        state.lastAssertionIsQuantifiable = !lookbehind;
		        return true
		      }
		    }

		    state.pos = start;
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
		  pp$1.regexp_eatQuantifier = function(state, noError) {
		    if ( noError === void 0 ) noError = false;

		    if (this.regexp_eatQuantifierPrefix(state, noError)) {
		      state.eat(0x3F /* ? */);
		      return true
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
		  pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
		    return (
		      state.eat(0x2A /* * */) ||
		      state.eat(0x2B /* + */) ||
		      state.eat(0x3F /* ? */) ||
		      this.regexp_eatBracedQuantifier(state, noError)
		    )
		  };
		  pp$1.regexp_eatBracedQuantifier = function(state, noError) {
		    var start = state.pos;
		    if (state.eat(0x7B /* { */)) {
		      var min = 0, max = -1;
		      if (this.regexp_eatDecimalDigits(state)) {
		        min = state.lastIntValue;
		        if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
		          max = state.lastIntValue;
		        }
		        if (state.eat(0x7D /* } */)) {
		          // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
		          if (max !== -1 && max < min && !noError) {
		            state.raise("numbers out of order in {} quantifier");
		          }
		          return true
		        }
		      }
		      if (state.switchU && !noError) {
		        state.raise("Incomplete quantifier");
		      }
		      state.pos = start;
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
		  pp$1.regexp_eatAtom = function(state) {
		    return (
		      this.regexp_eatPatternCharacters(state) ||
		      state.eat(0x2E /* . */) ||
		      this.regexp_eatReverseSolidusAtomEscape(state) ||
		      this.regexp_eatCharacterClass(state) ||
		      this.regexp_eatUncapturingGroup(state) ||
		      this.regexp_eatCapturingGroup(state)
		    )
		  };
		  pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
		    var start = state.pos;
		    if (state.eat(0x5C /* \ */)) {
		      if (this.regexp_eatAtomEscape(state)) {
		        return true
		      }
		      state.pos = start;
		    }
		    return false
		  };
		  pp$1.regexp_eatUncapturingGroup = function(state) {
		    var start = state.pos;
		    if (state.eat(0x28 /* ( */)) {
		      if (state.eat(0x3F /* ? */)) {
		        if (this.options.ecmaVersion >= 16) {
		          var addModifiers = this.regexp_eatModifiers(state);
		          var hasHyphen = state.eat(0x2D /* - */);
		          if (addModifiers || hasHyphen) {
		            for (var i = 0; i < addModifiers.length; i++) {
		              var modifier = addModifiers.charAt(i);
		              if (addModifiers.indexOf(modifier, i + 1) > -1) {
		                state.raise("Duplicate regular expression modifiers");
		              }
		            }
		            if (hasHyphen) {
		              var removeModifiers = this.regexp_eatModifiers(state);
		              if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
		                state.raise("Invalid regular expression modifiers");
		              }
		              for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
		                var modifier$1 = removeModifiers.charAt(i$1);
		                if (
		                  removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
		                  addModifiers.indexOf(modifier$1) > -1
		                ) {
		                  state.raise("Duplicate regular expression modifiers");
		                }
		              }
		            }
		          }
		        }
		        if (state.eat(0x3A /* : */)) {
		          this.regexp_disjunction(state);
		          if (state.eat(0x29 /* ) */)) {
		            return true
		          }
		          state.raise("Unterminated group");
		        }
		      }
		      state.pos = start;
		    }
		    return false
		  };
		  pp$1.regexp_eatCapturingGroup = function(state) {
		    if (state.eat(0x28 /* ( */)) {
		      if (this.options.ecmaVersion >= 9) {
		        this.regexp_groupSpecifier(state);
		      } else if (state.current() === 0x3F /* ? */) {
		        state.raise("Invalid group");
		      }
		      this.regexp_disjunction(state);
		      if (state.eat(0x29 /* ) */)) {
		        state.numCapturingParens += 1;
		        return true
		      }
		      state.raise("Unterminated group");
		    }
		    return false
		  };
		  // RegularExpressionModifiers ::
		  //   [empty]
		  //   RegularExpressionModifiers RegularExpressionModifier
		  pp$1.regexp_eatModifiers = function(state) {
		    var modifiers = "";
		    var ch = 0;
		    while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
		      modifiers += codePointToString(ch);
		      state.advance();
		    }
		    return modifiers
		  };
		  // RegularExpressionModifier :: one of
		  //   `i` `m` `s`
		  function isRegularExpressionModifier(ch) {
		    return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
		  pp$1.regexp_eatExtendedAtom = function(state) {
		    return (
		      state.eat(0x2E /* . */) ||
		      this.regexp_eatReverseSolidusAtomEscape(state) ||
		      this.regexp_eatCharacterClass(state) ||
		      this.regexp_eatUncapturingGroup(state) ||
		      this.regexp_eatCapturingGroup(state) ||
		      this.regexp_eatInvalidBracedQuantifier(state) ||
		      this.regexp_eatExtendedPatternCharacter(state)
		    )
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
		  pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
		    if (this.regexp_eatBracedQuantifier(state, true)) {
		      state.raise("Nothing to repeat");
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
		  pp$1.regexp_eatSyntaxCharacter = function(state) {
		    var ch = state.current();
		    if (isSyntaxCharacter(ch)) {
		      state.lastIntValue = ch;
		      state.advance();
		      return true
		    }
		    return false
		  };
		  function isSyntaxCharacter(ch) {
		    return (
		      ch === 0x24 /* $ */ ||
		      ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
		      ch === 0x2E /* . */ ||
		      ch === 0x3F /* ? */ ||
		      ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
		      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
		    )
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
		  // But eat eager.
		  pp$1.regexp_eatPatternCharacters = function(state) {
		    var start = state.pos;
		    var ch = 0;
		    while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
		      state.advance();
		    }
		    return state.pos !== start
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
		  pp$1.regexp_eatExtendedPatternCharacter = function(state) {
		    var ch = state.current();
		    if (
		      ch !== -1 &&
		      ch !== 0x24 /* $ */ &&
		      !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
		      ch !== 0x2E /* . */ &&
		      ch !== 0x3F /* ? */ &&
		      ch !== 0x5B /* [ */ &&
		      ch !== 0x5E /* ^ */ &&
		      ch !== 0x7C /* | */
		    ) {
		      state.advance();
		      return true
		    }
		    return false
		  };

		  // GroupSpecifier ::
		  //   [empty]
		  //   `?` GroupName
		  pp$1.regexp_groupSpecifier = function(state) {
		    if (state.eat(0x3F /* ? */)) {
		      if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
		      var trackDisjunction = this.options.ecmaVersion >= 16;
		      var known = state.groupNames[state.lastStringValue];
		      if (known) {
		        if (trackDisjunction) {
		          for (var i = 0, list = known; i < list.length; i += 1) {
		            var altID = list[i];

		            if (!altID.separatedFrom(state.branchID))
		              { state.raise("Duplicate capture group name"); }
		          }
		        } else {
		          state.raise("Duplicate capture group name");
		        }
		      }
		      if (trackDisjunction) {
		        (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
		      } else {
		        state.groupNames[state.lastStringValue] = true;
		      }
		    }
		  };

		  // GroupName ::
		  //   `<` RegExpIdentifierName `>`
		  // Note: this updates `state.lastStringValue` property with the eaten name.
		  pp$1.regexp_eatGroupName = function(state) {
		    state.lastStringValue = "";
		    if (state.eat(0x3C /* < */)) {
		      if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
		        return true
		      }
		      state.raise("Invalid capture group name");
		    }
		    return false
		  };

		  // RegExpIdentifierName ::
		  //   RegExpIdentifierStart
		  //   RegExpIdentifierName RegExpIdentifierPart
		  // Note: this updates `state.lastStringValue` property with the eaten name.
		  pp$1.regexp_eatRegExpIdentifierName = function(state) {
		    state.lastStringValue = "";
		    if (this.regexp_eatRegExpIdentifierStart(state)) {
		      state.lastStringValue += codePointToString(state.lastIntValue);
		      while (this.regexp_eatRegExpIdentifierPart(state)) {
		        state.lastStringValue += codePointToString(state.lastIntValue);
		      }
		      return true
		    }
		    return false
		  };

		  // RegExpIdentifierStart ::
		  //   UnicodeIDStart
		  //   `$`
		  //   `_`
		  //   `\` RegExpUnicodeEscapeSequence[+U]
		  pp$1.regexp_eatRegExpIdentifierStart = function(state) {
		    var start = state.pos;
		    var forceU = this.options.ecmaVersion >= 11;
		    var ch = state.current(forceU);
		    state.advance(forceU);

		    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
		      ch = state.lastIntValue;
		    }
		    if (isRegExpIdentifierStart(ch)) {
		      state.lastIntValue = ch;
		      return true
		    }

		    state.pos = start;
		    return false
		  };
		  function isRegExpIdentifierStart(ch) {
		    return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
		  }

		  // RegExpIdentifierPart ::
		  //   UnicodeIDContinue
		  //   `$`
		  //   `_`
		  //   `\` RegExpUnicodeEscapeSequence[+U]
		  //   <ZWNJ>
		  //   <ZWJ>
		  pp$1.regexp_eatRegExpIdentifierPart = function(state) {
		    var start = state.pos;
		    var forceU = this.options.ecmaVersion >= 11;
		    var ch = state.current(forceU);
		    state.advance(forceU);

		    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
		      ch = state.lastIntValue;
		    }
		    if (isRegExpIdentifierPart(ch)) {
		      state.lastIntValue = ch;
		      return true
		    }

		    state.pos = start;
		    return false
		  };
		  function isRegExpIdentifierPart(ch) {
		    return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
		  pp$1.regexp_eatAtomEscape = function(state) {
		    if (
		      this.regexp_eatBackReference(state) ||
		      this.regexp_eatCharacterClassEscape(state) ||
		      this.regexp_eatCharacterEscape(state) ||
		      (state.switchN && this.regexp_eatKGroupName(state))
		    ) {
		      return true
		    }
		    if (state.switchU) {
		      // Make the same message as V8.
		      if (state.current() === 0x63 /* c */) {
		        state.raise("Invalid unicode escape");
		      }
		      state.raise("Invalid escape");
		    }
		    return false
		  };
		  pp$1.regexp_eatBackReference = function(state) {
		    var start = state.pos;
		    if (this.regexp_eatDecimalEscape(state)) {
		      var n = state.lastIntValue;
		      if (state.switchU) {
		        // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
		        if (n > state.maxBackReference) {
		          state.maxBackReference = n;
		        }
		        return true
		      }
		      if (n <= state.numCapturingParens) {
		        return true
		      }
		      state.pos = start;
		    }
		    return false
		  };
		  pp$1.regexp_eatKGroupName = function(state) {
		    if (state.eat(0x6B /* k */)) {
		      if (this.regexp_eatGroupName(state)) {
		        state.backReferenceNames.push(state.lastStringValue);
		        return true
		      }
		      state.raise("Invalid named reference");
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
		  pp$1.regexp_eatCharacterEscape = function(state) {
		    return (
		      this.regexp_eatControlEscape(state) ||
		      this.regexp_eatCControlLetter(state) ||
		      this.regexp_eatZero(state) ||
		      this.regexp_eatHexEscapeSequence(state) ||
		      this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
		      (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
		      this.regexp_eatIdentityEscape(state)
		    )
		  };
		  pp$1.regexp_eatCControlLetter = function(state) {
		    var start = state.pos;
		    if (state.eat(0x63 /* c */)) {
		      if (this.regexp_eatControlLetter(state)) {
		        return true
		      }
		      state.pos = start;
		    }
		    return false
		  };
		  pp$1.regexp_eatZero = function(state) {
		    if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
		      state.lastIntValue = 0;
		      state.advance();
		      return true
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
		  pp$1.regexp_eatControlEscape = function(state) {
		    var ch = state.current();
		    if (ch === 0x74 /* t */) {
		      state.lastIntValue = 0x09; /* \t */
		      state.advance();
		      return true
		    }
		    if (ch === 0x6E /* n */) {
		      state.lastIntValue = 0x0A; /* \n */
		      state.advance();
		      return true
		    }
		    if (ch === 0x76 /* v */) {
		      state.lastIntValue = 0x0B; /* \v */
		      state.advance();
		      return true
		    }
		    if (ch === 0x66 /* f */) {
		      state.lastIntValue = 0x0C; /* \f */
		      state.advance();
		      return true
		    }
		    if (ch === 0x72 /* r */) {
		      state.lastIntValue = 0x0D; /* \r */
		      state.advance();
		      return true
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
		  pp$1.regexp_eatControlLetter = function(state) {
		    var ch = state.current();
		    if (isControlLetter(ch)) {
		      state.lastIntValue = ch % 0x20;
		      state.advance();
		      return true
		    }
		    return false
		  };
		  function isControlLetter(ch) {
		    return (
		      (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
		      (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
		    )
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
		  pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
		    if ( forceU === void 0 ) forceU = false;

		    var start = state.pos;
		    var switchU = forceU || state.switchU;

		    if (state.eat(0x75 /* u */)) {
		      if (this.regexp_eatFixedHexDigits(state, 4)) {
		        var lead = state.lastIntValue;
		        if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
		          var leadSurrogateEnd = state.pos;
		          if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
		            var trail = state.lastIntValue;
		            if (trail >= 0xDC00 && trail <= 0xDFFF) {
		              state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
		              return true
		            }
		          }
		          state.pos = leadSurrogateEnd;
		          state.lastIntValue = lead;
		        }
		        return true
		      }
		      if (
		        switchU &&
		        state.eat(0x7B /* { */) &&
		        this.regexp_eatHexDigits(state) &&
		        state.eat(0x7D /* } */) &&
		        isValidUnicode(state.lastIntValue)
		      ) {
		        return true
		      }
		      if (switchU) {
		        state.raise("Invalid unicode escape");
		      }
		      state.pos = start;
		    }

		    return false
		  };
		  function isValidUnicode(ch) {
		    return ch >= 0 && ch <= 0x10FFFF
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
		  pp$1.regexp_eatIdentityEscape = function(state) {
		    if (state.switchU) {
		      if (this.regexp_eatSyntaxCharacter(state)) {
		        return true
		      }
		      if (state.eat(0x2F /* / */)) {
		        state.lastIntValue = 0x2F; /* / */
		        return true
		      }
		      return false
		    }

		    var ch = state.current();
		    if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
		      state.lastIntValue = ch;
		      state.advance();
		      return true
		    }

		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
		  pp$1.regexp_eatDecimalEscape = function(state) {
		    state.lastIntValue = 0;
		    var ch = state.current();
		    if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
		      do {
		        state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
		        state.advance();
		      } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
		      return true
		    }
		    return false
		  };

		  // Return values used by character set parsing methods, needed to
		  // forbid negation of sets that can match strings.
		  var CharSetNone = 0; // Nothing parsed
		  var CharSetOk = 1; // Construct parsed, cannot contain strings
		  var CharSetString = 2; // Construct parsed, can contain strings

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
		  pp$1.regexp_eatCharacterClassEscape = function(state) {
		    var ch = state.current();

		    if (isCharacterClassEscape(ch)) {
		      state.lastIntValue = -1;
		      state.advance();
		      return CharSetOk
		    }

		    var negate = false;
		    if (
		      state.switchU &&
		      this.options.ecmaVersion >= 9 &&
		      ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)
		    ) {
		      state.lastIntValue = -1;
		      state.advance();
		      var result;
		      if (
		        state.eat(0x7B /* { */) &&
		        (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&
		        state.eat(0x7D /* } */)
		      ) {
		        if (negate && result === CharSetString) { state.raise("Invalid property name"); }
		        return result
		      }
		      state.raise("Invalid property name");
		    }

		    return CharSetNone
		  };

		  function isCharacterClassEscape(ch) {
		    return (
		      ch === 0x64 /* d */ ||
		      ch === 0x44 /* D */ ||
		      ch === 0x73 /* s */ ||
		      ch === 0x53 /* S */ ||
		      ch === 0x77 /* w */ ||
		      ch === 0x57 /* W */
		    )
		  }

		  // UnicodePropertyValueExpression ::
		  //   UnicodePropertyName `=` UnicodePropertyValue
		  //   LoneUnicodePropertyNameOrValue
		  pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
		    var start = state.pos;

		    // UnicodePropertyName `=` UnicodePropertyValue
		    if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
		      var name = state.lastStringValue;
		      if (this.regexp_eatUnicodePropertyValue(state)) {
		        var value = state.lastStringValue;
		        this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
		        return CharSetOk
		      }
		    }
		    state.pos = start;

		    // LoneUnicodePropertyNameOrValue
		    if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
		      var nameOrValue = state.lastStringValue;
		      return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
		    }
		    return CharSetNone
		  };

		  pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
		    if (!hasOwn(state.unicodeProperties.nonBinary, name))
		      { state.raise("Invalid property name"); }
		    if (!state.unicodeProperties.nonBinary[name].test(value))
		      { state.raise("Invalid property value"); }
		  };

		  pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
		    if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }
		    if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }
		    state.raise("Invalid property name");
		  };

		  // UnicodePropertyName ::
		  //   UnicodePropertyNameCharacters
		  pp$1.regexp_eatUnicodePropertyName = function(state) {
		    var ch = 0;
		    state.lastStringValue = "";
		    while (isUnicodePropertyNameCharacter(ch = state.current())) {
		      state.lastStringValue += codePointToString(ch);
		      state.advance();
		    }
		    return state.lastStringValue !== ""
		  };

		  function isUnicodePropertyNameCharacter(ch) {
		    return isControlLetter(ch) || ch === 0x5F /* _ */
		  }

		  // UnicodePropertyValue ::
		  //   UnicodePropertyValueCharacters
		  pp$1.regexp_eatUnicodePropertyValue = function(state) {
		    var ch = 0;
		    state.lastStringValue = "";
		    while (isUnicodePropertyValueCharacter(ch = state.current())) {
		      state.lastStringValue += codePointToString(ch);
		      state.advance();
		    }
		    return state.lastStringValue !== ""
		  };
		  function isUnicodePropertyValueCharacter(ch) {
		    return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
		  }

		  // LoneUnicodePropertyNameOrValue ::
		  //   UnicodePropertyValueCharacters
		  pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
		    return this.regexp_eatUnicodePropertyValue(state)
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
		  pp$1.regexp_eatCharacterClass = function(state) {
		    if (state.eat(0x5B /* [ */)) {
		      var negate = state.eat(0x5E /* ^ */);
		      var result = this.regexp_classContents(state);
		      if (!state.eat(0x5D /* ] */))
		        { state.raise("Unterminated character class"); }
		      if (negate && result === CharSetString)
		        { state.raise("Negated character class may contain strings"); }
		      return true
		    }
		    return false
		  };

		  // https://tc39.es/ecma262/#prod-ClassContents
		  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
		  pp$1.regexp_classContents = function(state) {
		    if (state.current() === 0x5D /* ] */) { return CharSetOk }
		    if (state.switchV) { return this.regexp_classSetExpression(state) }
		    this.regexp_nonEmptyClassRanges(state);
		    return CharSetOk
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
		  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
		  pp$1.regexp_nonEmptyClassRanges = function(state) {
		    while (this.regexp_eatClassAtom(state)) {
		      var left = state.lastIntValue;
		      if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
		        var right = state.lastIntValue;
		        if (state.switchU && (left === -1 || right === -1)) {
		          state.raise("Invalid character class");
		        }
		        if (left !== -1 && right !== -1 && left > right) {
		          state.raise("Range out of order in character class");
		        }
		      }
		    }
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
		  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
		  pp$1.regexp_eatClassAtom = function(state) {
		    var start = state.pos;

		    if (state.eat(0x5C /* \ */)) {
		      if (this.regexp_eatClassEscape(state)) {
		        return true
		      }
		      if (state.switchU) {
		        // Make the same message as V8.
		        var ch$1 = state.current();
		        if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
		          state.raise("Invalid class escape");
		        }
		        state.raise("Invalid escape");
		      }
		      state.pos = start;
		    }

		    var ch = state.current();
		    if (ch !== 0x5D /* ] */) {
		      state.lastIntValue = ch;
		      state.advance();
		      return true
		    }

		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
		  pp$1.regexp_eatClassEscape = function(state) {
		    var start = state.pos;

		    if (state.eat(0x62 /* b */)) {
		      state.lastIntValue = 0x08; /* <BS> */
		      return true
		    }

		    if (state.switchU && state.eat(0x2D /* - */)) {
		      state.lastIntValue = 0x2D; /* - */
		      return true
		    }

		    if (!state.switchU && state.eat(0x63 /* c */)) {
		      if (this.regexp_eatClassControlLetter(state)) {
		        return true
		      }
		      state.pos = start;
		    }

		    return (
		      this.regexp_eatCharacterClassEscape(state) ||
		      this.regexp_eatCharacterEscape(state)
		    )
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetExpression
		  // https://tc39.es/ecma262/#prod-ClassUnion
		  // https://tc39.es/ecma262/#prod-ClassIntersection
		  // https://tc39.es/ecma262/#prod-ClassSubtraction
		  pp$1.regexp_classSetExpression = function(state) {
		    var result = CharSetOk, subResult;
		    if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
		      if (subResult === CharSetString) { result = CharSetString; }
		      // https://tc39.es/ecma262/#prod-ClassIntersection
		      var start = state.pos;
		      while (state.eatChars([0x26, 0x26] /* && */)) {
		        if (
		          state.current() !== 0x26 /* & */ &&
		          (subResult = this.regexp_eatClassSetOperand(state))
		        ) {
		          if (subResult !== CharSetString) { result = CharSetOk; }
		          continue
		        }
		        state.raise("Invalid character in character class");
		      }
		      if (start !== state.pos) { return result }
		      // https://tc39.es/ecma262/#prod-ClassSubtraction
		      while (state.eatChars([0x2D, 0x2D] /* -- */)) {
		        if (this.regexp_eatClassSetOperand(state)) { continue }
		        state.raise("Invalid character in character class");
		      }
		      if (start !== state.pos) { return result }
		    } else {
		      state.raise("Invalid character in character class");
		    }
		    // https://tc39.es/ecma262/#prod-ClassUnion
		    for (;;) {
		      if (this.regexp_eatClassSetRange(state)) { continue }
		      subResult = this.regexp_eatClassSetOperand(state);
		      if (!subResult) { return result }
		      if (subResult === CharSetString) { result = CharSetString; }
		    }
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetRange
		  pp$1.regexp_eatClassSetRange = function(state) {
		    var start = state.pos;
		    if (this.regexp_eatClassSetCharacter(state)) {
		      var left = state.lastIntValue;
		      if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {
		        var right = state.lastIntValue;
		        if (left !== -1 && right !== -1 && left > right) {
		          state.raise("Range out of order in character class");
		        }
		        return true
		      }
		      state.pos = start;
		    }
		    return false
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetOperand
		  pp$1.regexp_eatClassSetOperand = function(state) {
		    if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }
		    return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)
		  };

		  // https://tc39.es/ecma262/#prod-NestedClass
		  pp$1.regexp_eatNestedClass = function(state) {
		    var start = state.pos;
		    if (state.eat(0x5B /* [ */)) {
		      var negate = state.eat(0x5E /* ^ */);
		      var result = this.regexp_classContents(state);
		      if (state.eat(0x5D /* ] */)) {
		        if (negate && result === CharSetString) {
		          state.raise("Negated character class may contain strings");
		        }
		        return result
		      }
		      state.pos = start;
		    }
		    if (state.eat(0x5C /* \ */)) {
		      var result$1 = this.regexp_eatCharacterClassEscape(state);
		      if (result$1) {
		        return result$1
		      }
		      state.pos = start;
		    }
		    return null
		  };

		  // https://tc39.es/ecma262/#prod-ClassStringDisjunction
		  pp$1.regexp_eatClassStringDisjunction = function(state) {
		    var start = state.pos;
		    if (state.eatChars([0x5C, 0x71] /* \q */)) {
		      if (state.eat(0x7B /* { */)) {
		        var result = this.regexp_classStringDisjunctionContents(state);
		        if (state.eat(0x7D /* } */)) {
		          return result
		        }
		      } else {
		        // Make the same message as V8.
		        state.raise("Invalid escape");
		      }
		      state.pos = start;
		    }
		    return null
		  };

		  // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents
		  pp$1.regexp_classStringDisjunctionContents = function(state) {
		    var result = this.regexp_classString(state);
		    while (state.eat(0x7C /* | */)) {
		      if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }
		    }
		    return result
		  };

		  // https://tc39.es/ecma262/#prod-ClassString
		  // https://tc39.es/ecma262/#prod-NonEmptyClassString
		  pp$1.regexp_classString = function(state) {
		    var count = 0;
		    while (this.regexp_eatClassSetCharacter(state)) { count++; }
		    return count === 1 ? CharSetOk : CharSetString
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetCharacter
		  pp$1.regexp_eatClassSetCharacter = function(state) {
		    var start = state.pos;
		    if (state.eat(0x5C /* \ */)) {
		      if (
		        this.regexp_eatCharacterEscape(state) ||
		        this.regexp_eatClassSetReservedPunctuator(state)
		      ) {
		        return true
		      }
		      if (state.eat(0x62 /* b */)) {
		        state.lastIntValue = 0x08; /* <BS> */
		        return true
		      }
		      state.pos = start;
		      return false
		    }
		    var ch = state.current();
		    if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }
		    if (isClassSetSyntaxCharacter(ch)) { return false }
		    state.advance();
		    state.lastIntValue = ch;
		    return true
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator
		  function isClassSetReservedDoublePunctuatorCharacter(ch) {
		    return (
		      ch === 0x21 /* ! */ ||
		      ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||
		      ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||
		      ch === 0x2E /* . */ ||
		      ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||
		      ch === 0x5E /* ^ */ ||
		      ch === 0x60 /* ` */ ||
		      ch === 0x7E /* ~ */
		    )
		  }

		  // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter
		  function isClassSetSyntaxCharacter(ch) {
		    return (
		      ch === 0x28 /* ( */ ||
		      ch === 0x29 /* ) */ ||
		      ch === 0x2D /* - */ ||
		      ch === 0x2F /* / */ ||
		      ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||
		      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
		    )
		  }

		  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
		  pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
		    var ch = state.current();
		    if (isClassSetReservedPunctuator(ch)) {
		      state.lastIntValue = ch;
		      state.advance();
		      return true
		    }
		    return false
		  };

		  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
		  function isClassSetReservedPunctuator(ch) {
		    return (
		      ch === 0x21 /* ! */ ||
		      ch === 0x23 /* # */ ||
		      ch === 0x25 /* % */ ||
		      ch === 0x26 /* & */ ||
		      ch === 0x2C /* , */ ||
		      ch === 0x2D /* - */ ||
		      ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||
		      ch === 0x40 /* @ */ ||
		      ch === 0x60 /* ` */ ||
		      ch === 0x7E /* ~ */
		    )
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
		  pp$1.regexp_eatClassControlLetter = function(state) {
		    var ch = state.current();
		    if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
		      state.lastIntValue = ch % 0x20;
		      state.advance();
		      return true
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
		  pp$1.regexp_eatHexEscapeSequence = function(state) {
		    var start = state.pos;
		    if (state.eat(0x78 /* x */)) {
		      if (this.regexp_eatFixedHexDigits(state, 2)) {
		        return true
		      }
		      if (state.switchU) {
		        state.raise("Invalid escape");
		      }
		      state.pos = start;
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
		  pp$1.regexp_eatDecimalDigits = function(state) {
		    var start = state.pos;
		    var ch = 0;
		    state.lastIntValue = 0;
		    while (isDecimalDigit(ch = state.current())) {
		      state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
		      state.advance();
		    }
		    return state.pos !== start
		  };
		  function isDecimalDigit(ch) {
		    return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
		  pp$1.regexp_eatHexDigits = function(state) {
		    var start = state.pos;
		    var ch = 0;
		    state.lastIntValue = 0;
		    while (isHexDigit(ch = state.current())) {
		      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
		      state.advance();
		    }
		    return state.pos !== start
		  };
		  function isHexDigit(ch) {
		    return (
		      (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
		      (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
		      (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
		    )
		  }
		  function hexToInt(ch) {
		    if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
		      return 10 + (ch - 0x41 /* A */)
		    }
		    if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
		      return 10 + (ch - 0x61 /* a */)
		    }
		    return ch - 0x30 /* 0 */
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
		  // Allows only 0-377(octal) i.e. 0-255(decimal).
		  pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
		    if (this.regexp_eatOctalDigit(state)) {
		      var n1 = state.lastIntValue;
		      if (this.regexp_eatOctalDigit(state)) {
		        var n2 = state.lastIntValue;
		        if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
		          state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
		        } else {
		          state.lastIntValue = n1 * 8 + n2;
		        }
		      } else {
		        state.lastIntValue = n1;
		      }
		      return true
		    }
		    return false
		  };

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
		  pp$1.regexp_eatOctalDigit = function(state) {
		    var ch = state.current();
		    if (isOctalDigit(ch)) {
		      state.lastIntValue = ch - 0x30; /* 0 */
		      state.advance();
		      return true
		    }
		    state.lastIntValue = 0;
		    return false
		  };
		  function isOctalDigit(ch) {
		    return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
		  }

		  // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
		  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
		  // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
		  pp$1.regexp_eatFixedHexDigits = function(state, length) {
		    var start = state.pos;
		    state.lastIntValue = 0;
		    for (var i = 0; i < length; ++i) {
		      var ch = state.current();
		      if (!isHexDigit(ch)) {
		        state.pos = start;
		        return false
		      }
		      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
		      state.advance();
		    }
		    return true
		  };

		  // Object type used to represent tokens. Note that normally, tokens
		  // simply exist as properties on the parser object. This is only
		  // used for the onToken callback and the external tokenizer.

		  var Token = function Token(p) {
		    this.type = p.type;
		    this.value = p.value;
		    this.start = p.start;
		    this.end = p.end;
		    if (p.options.locations)
		      { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
		    if (p.options.ranges)
		      { this.range = [p.start, p.end]; }
		  };

		  // ## Tokenizer

		  var pp = Parser.prototype;

		  // Move to the next token

		  pp.next = function(ignoreEscapeSequenceInKeyword) {
		    if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
		      { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
		    if (this.options.onToken)
		      { this.options.onToken(new Token(this)); }

		    this.lastTokEnd = this.end;
		    this.lastTokStart = this.start;
		    this.lastTokEndLoc = this.endLoc;
		    this.lastTokStartLoc = this.startLoc;
		    this.nextToken();
		  };

		  pp.getToken = function() {
		    this.next();
		    return new Token(this)
		  };

		  // If we're in an ES6 environment, make parsers iterable
		  if (typeof Symbol !== "undefined")
		    { pp[Symbol.iterator] = function() {
		      var this$1$1 = this;

		      return {
		        next: function () {
		          var token = this$1$1.getToken();
		          return {
		            done: token.type === types$1.eof,
		            value: token
		          }
		        }
		      }
		    }; }

		  // Toggle strict mode. Re-reads the next number or string to please
		  // pedantic tests (`"use strict"; 010;` should fail).

		  // Read a single token, updating the parser object's token-related
		  // properties.

		  pp.nextToken = function() {
		    var curContext = this.curContext();
		    if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }

		    this.start = this.pos;
		    if (this.options.locations) { this.startLoc = this.curPosition(); }
		    if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }

		    if (curContext.override) { return curContext.override(this) }
		    else { this.readToken(this.fullCharCodeAtPos()); }
		  };

		  pp.readToken = function(code) {
		    // Identifier or keyword. '\uXXXX' sequences are allowed in
		    // identifiers, so '\' also dispatches to that.
		    if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
		      { return this.readWord() }

		    return this.getTokenFromCode(code)
		  };

		  pp.fullCharCodeAtPos = function() {
		    var code = this.input.charCodeAt(this.pos);
		    if (code <= 0xd7ff || code >= 0xdc00) { return code }
		    var next = this.input.charCodeAt(this.pos + 1);
		    return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
		  };

		  pp.skipBlockComment = function() {
		    var startLoc = this.options.onComment && this.curPosition();
		    var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
		    if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
		    this.pos = end + 2;
		    if (this.options.locations) {
		      for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
		        ++this.curLine;
		        pos = this.lineStart = nextBreak;
		      }
		    }
		    if (this.options.onComment)
		      { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
		                             startLoc, this.curPosition()); }
		  };

		  pp.skipLineComment = function(startSkip) {
		    var start = this.pos;
		    var startLoc = this.options.onComment && this.curPosition();
		    var ch = this.input.charCodeAt(this.pos += startSkip);
		    while (this.pos < this.input.length && !isNewLine(ch)) {
		      ch = this.input.charCodeAt(++this.pos);
		    }
		    if (this.options.onComment)
		      { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
		                             startLoc, this.curPosition()); }
		  };

		  // Called at the start of the parse and after every token. Skips
		  // whitespace and comments, and.

		  pp.skipSpace = function() {
		    loop: while (this.pos < this.input.length) {
		      var ch = this.input.charCodeAt(this.pos);
		      switch (ch) {
		      case 32: case 160: // ' '
		        ++this.pos;
		        break
		      case 13:
		        if (this.input.charCodeAt(this.pos + 1) === 10) {
		          ++this.pos;
		        }
		      case 10: case 8232: case 8233:
		        ++this.pos;
		        if (this.options.locations) {
		          ++this.curLine;
		          this.lineStart = this.pos;
		        }
		        break
		      case 47: // '/'
		        switch (this.input.charCodeAt(this.pos + 1)) {
		        case 42: // '*'
		          this.skipBlockComment();
		          break
		        case 47:
		          this.skipLineComment(2);
		          break
		        default:
		          break loop
		        }
		        break
		      default:
		        if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
		          ++this.pos;
		        } else {
		          break loop
		        }
		      }
		    }
		  };

		  // Called at the end of every token. Sets `end`, `val`, and
		  // maintains `context` and `exprAllowed`, and skips the space after
		  // the token, so that the next one's `start` will point at the
		  // right position.

		  pp.finishToken = function(type, val) {
		    this.end = this.pos;
		    if (this.options.locations) { this.endLoc = this.curPosition(); }
		    var prevType = this.type;
		    this.type = type;
		    this.value = val;

		    this.updateContext(prevType);
		  };

		  // ### Token reading

		  // This is the function that is called to fetch the next token. It
		  // is somewhat obscure, because it works in character codes rather
		  // than characters, and because operator parsing has been inlined
		  // into it.
		  //
		  // All in the name of speed.
		  //
		  pp.readToken_dot = function() {
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (next >= 48 && next <= 57) { return this.readNumber(true) }
		    var next2 = this.input.charCodeAt(this.pos + 2);
		    if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
		      this.pos += 3;
		      return this.finishToken(types$1.ellipsis)
		    } else {
		      ++this.pos;
		      return this.finishToken(types$1.dot)
		    }
		  };

		  pp.readToken_slash = function() { // '/'
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
		    if (next === 61) { return this.finishOp(types$1.assign, 2) }
		    return this.finishOp(types$1.slash, 1)
		  };

		  pp.readToken_mult_modulo_exp = function(code) { // '%*'
		    var next = this.input.charCodeAt(this.pos + 1);
		    var size = 1;
		    var tokentype = code === 42 ? types$1.star : types$1.modulo;

		    // exponentiation operator ** and **=
		    if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
		      ++size;
		      tokentype = types$1.starstar;
		      next = this.input.charCodeAt(this.pos + 2);
		    }

		    if (next === 61) { return this.finishOp(types$1.assign, size + 1) }
		    return this.finishOp(tokentype, size)
		  };

		  pp.readToken_pipe_amp = function(code) { // '|&'
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (next === code) {
		      if (this.options.ecmaVersion >= 12) {
		        var next2 = this.input.charCodeAt(this.pos + 2);
		        if (next2 === 61) { return this.finishOp(types$1.assign, 3) }
		      }
		      return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)
		    }
		    if (next === 61) { return this.finishOp(types$1.assign, 2) }
		    return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)
		  };

		  pp.readToken_caret = function() { // '^'
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (next === 61) { return this.finishOp(types$1.assign, 2) }
		    return this.finishOp(types$1.bitwiseXOR, 1)
		  };

		  pp.readToken_plus_min = function(code) { // '+-'
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (next === code) {
		      if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
		          (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
		        // A `-->` line comment
		        this.skipLineComment(3);
		        this.skipSpace();
		        return this.nextToken()
		      }
		      return this.finishOp(types$1.incDec, 2)
		    }
		    if (next === 61) { return this.finishOp(types$1.assign, 2) }
		    return this.finishOp(types$1.plusMin, 1)
		  };

		  pp.readToken_lt_gt = function(code) { // '<>'
		    var next = this.input.charCodeAt(this.pos + 1);
		    var size = 1;
		    if (next === code) {
		      size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
		      if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
		      return this.finishOp(types$1.bitShift, size)
		    }
		    if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
		        this.input.charCodeAt(this.pos + 3) === 45) {
		      // `<!--`, an XML-style comment that should be interpreted as a line comment
		      this.skipLineComment(4);
		      this.skipSpace();
		      return this.nextToken()
		    }
		    if (next === 61) { size = 2; }
		    return this.finishOp(types$1.relational, size)
		  };

		  pp.readToken_eq_excl = function(code) { // '=!'
		    var next = this.input.charCodeAt(this.pos + 1);
		    if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
		    if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
		      this.pos += 2;
		      return this.finishToken(types$1.arrow)
		    }
		    return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)
		  };

		  pp.readToken_question = function() { // '?'
		    var ecmaVersion = this.options.ecmaVersion;
		    if (ecmaVersion >= 11) {
		      var next = this.input.charCodeAt(this.pos + 1);
		      if (next === 46) {
		        var next2 = this.input.charCodeAt(this.pos + 2);
		        if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }
		      }
		      if (next === 63) {
		        if (ecmaVersion >= 12) {
		          var next2$1 = this.input.charCodeAt(this.pos + 2);
		          if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }
		        }
		        return this.finishOp(types$1.coalesce, 2)
		      }
		    }
		    return this.finishOp(types$1.question, 1)
		  };

		  pp.readToken_numberSign = function() { // '#'
		    var ecmaVersion = this.options.ecmaVersion;
		    var code = 35; // '#'
		    if (ecmaVersion >= 13) {
		      ++this.pos;
		      code = this.fullCharCodeAtPos();
		      if (isIdentifierStart(code, true) || code === 92 /* '\' */) {
		        return this.finishToken(types$1.privateId, this.readWord1())
		      }
		    }

		    this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
		  };

		  pp.getTokenFromCode = function(code) {
		    switch (code) {
		    // The interpretation of a dot depends on whether it is followed
		    // by a digit or another two dots.
		    case 46: // '.'
		      return this.readToken_dot()

		    // Punctuation tokens.
		    case 40: ++this.pos; return this.finishToken(types$1.parenL)
		    case 41: ++this.pos; return this.finishToken(types$1.parenR)
		    case 59: ++this.pos; return this.finishToken(types$1.semi)
		    case 44: ++this.pos; return this.finishToken(types$1.comma)
		    case 91: ++this.pos; return this.finishToken(types$1.bracketL)
		    case 93: ++this.pos; return this.finishToken(types$1.bracketR)
		    case 123: ++this.pos; return this.finishToken(types$1.braceL)
		    case 125: ++this.pos; return this.finishToken(types$1.braceR)
		    case 58: ++this.pos; return this.finishToken(types$1.colon)

		    case 96: // '`'
		      if (this.options.ecmaVersion < 6) { break }
		      ++this.pos;
		      return this.finishToken(types$1.backQuote)

		    case 48: // '0'
		      var next = this.input.charCodeAt(this.pos + 1);
		      if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
		      if (this.options.ecmaVersion >= 6) {
		        if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
		        if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
		      }

		    // Anything else beginning with a digit is an integer, octal
		    // number, or float.
		    case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
		      return this.readNumber(false)

		    // Quotes produce strings.
		    case 34: case 39: // '"', "'"
		      return this.readString(code)

		    // Operators are parsed inline in tiny state machines. '=' (61) is
		    // often referred to. `finishOp` simply skips the amount of
		    // characters it is given as second argument, and returns a token
		    // of the type given by its first argument.
		    case 47: // '/'
		      return this.readToken_slash()

		    case 37: case 42: // '%*'
		      return this.readToken_mult_modulo_exp(code)

		    case 124: case 38: // '|&'
		      return this.readToken_pipe_amp(code)

		    case 94: // '^'
		      return this.readToken_caret()

		    case 43: case 45: // '+-'
		      return this.readToken_plus_min(code)

		    case 60: case 62: // '<>'
		      return this.readToken_lt_gt(code)

		    case 61: case 33: // '=!'
		      return this.readToken_eq_excl(code)

		    case 63: // '?'
		      return this.readToken_question()

		    case 126: // '~'
		      return this.finishOp(types$1.prefix, 1)

		    case 35: // '#'
		      return this.readToken_numberSign()
		    }

		    this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
		  };

		  pp.finishOp = function(type, size) {
		    var str = this.input.slice(this.pos, this.pos + size);
		    this.pos += size;
		    return this.finishToken(type, str)
		  };

		  pp.readRegexp = function() {
		    var escaped, inClass, start = this.pos;
		    for (;;) {
		      if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
		      var ch = this.input.charAt(this.pos);
		      if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
		      if (!escaped) {
		        if (ch === "[") { inClass = true; }
		        else if (ch === "]" && inClass) { inClass = false; }
		        else if (ch === "/" && !inClass) { break }
		        escaped = ch === "\\";
		      } else { escaped = false; }
		      ++this.pos;
		    }
		    var pattern = this.input.slice(start, this.pos);
		    ++this.pos;
		    var flagsStart = this.pos;
		    var flags = this.readWord1();
		    if (this.containsEsc) { this.unexpected(flagsStart); }

		    // Validate pattern
		    var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
		    state.reset(start, pattern, flags);
		    this.validateRegExpFlags(state);
		    this.validateRegExpPattern(state);

		    // Create Literal#value property value.
		    var value = null;
		    try {
		      value = new RegExp(pattern, flags);
		    } catch (e) {
		      // ESTree requires null if it failed to instantiate RegExp object.
		      // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
		    }

		    return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})
		  };

		  // Read an integer in the given radix. Return null if zero digits
		  // were read, the integer value otherwise. When `len` is given, this
		  // will return `null` unless the integer has exactly `len` digits.

		  pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
		    // `len` is used for character escape sequences. In that case, disallow separators.
		    var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;

		    // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
		    // and isn't fraction part nor exponent part. In that case, if the first digit
		    // is zero then disallow separators.
		    var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;

		    var start = this.pos, total = 0, lastCode = 0;
		    for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
		      var code = this.input.charCodeAt(this.pos), val = (void 0);

		      if (allowSeparators && code === 95) {
		        if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
		        if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
		        if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
		        lastCode = code;
		        continue
		      }

		      if (code >= 97) { val = code - 97 + 10; } // a
		      else if (code >= 65) { val = code - 65 + 10; } // A
		      else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
		      else { val = Infinity; }
		      if (val >= radix) { break }
		      lastCode = code;
		      total = total * radix + val;
		    }

		    if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
		    if (this.pos === start || len != null && this.pos - start !== len) { return null }

		    return total
		  };

		  function stringToNumber(str, isLegacyOctalNumericLiteral) {
		    if (isLegacyOctalNumericLiteral) {
		      return parseInt(str, 8)
		    }

		    // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
		    return parseFloat(str.replace(/_/g, ""))
		  }

		  function stringToBigInt(str) {
		    if (typeof BigInt !== "function") {
		      return null
		    }

		    // `BigInt(value)` throws syntax error if the string contains numeric separators.
		    return BigInt(str.replace(/_/g, ""))
		  }

		  pp.readRadixNumber = function(radix) {
		    var start = this.pos;
		    this.pos += 2; // 0x
		    var val = this.readInt(radix);
		    if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
		    if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
		      val = stringToBigInt(this.input.slice(start, this.pos));
		      ++this.pos;
		    } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
		    return this.finishToken(types$1.num, val)
		  };

		  // Read an integer, octal integer, or floating-point number.

		  pp.readNumber = function(startsWithDot) {
		    var start = this.pos;
		    if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
		    var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
		    if (octal && this.strict) { this.raise(start, "Invalid number"); }
		    var next = this.input.charCodeAt(this.pos);
		    if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
		      var val$1 = stringToBigInt(this.input.slice(start, this.pos));
		      ++this.pos;
		      if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
		      return this.finishToken(types$1.num, val$1)
		    }
		    if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
		    if (next === 46 && !octal) { // '.'
		      ++this.pos;
		      this.readInt(10);
		      next = this.input.charCodeAt(this.pos);
		    }
		    if ((next === 69 || next === 101) && !octal) { // 'eE'
		      next = this.input.charCodeAt(++this.pos);
		      if (next === 43 || next === 45) { ++this.pos; } // '+-'
		      if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
		    }
		    if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }

		    var val = stringToNumber(this.input.slice(start, this.pos), octal);
		    return this.finishToken(types$1.num, val)
		  };

		  // Read a string value, interpreting backslash-escapes.

		  pp.readCodePoint = function() {
		    var ch = this.input.charCodeAt(this.pos), code;

		    if (ch === 123) { // '{'
		      if (this.options.ecmaVersion < 6) { this.unexpected(); }
		      var codePos = ++this.pos;
		      code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
		      ++this.pos;
		      if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
		    } else {
		      code = this.readHexChar(4);
		    }
		    return code
		  };

		  pp.readString = function(quote) {
		    var out = "", chunkStart = ++this.pos;
		    for (;;) {
		      if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
		      var ch = this.input.charCodeAt(this.pos);
		      if (ch === quote) { break }
		      if (ch === 92) { // '\'
		        out += this.input.slice(chunkStart, this.pos);
		        out += this.readEscapedChar(false);
		        chunkStart = this.pos;
		      } else if (ch === 0x2028 || ch === 0x2029) {
		        if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); }
		        ++this.pos;
		        if (this.options.locations) {
		          this.curLine++;
		          this.lineStart = this.pos;
		        }
		      } else {
		        if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); }
		        ++this.pos;
		      }
		    }
		    out += this.input.slice(chunkStart, this.pos++);
		    return this.finishToken(types$1.string, out)
		  };

		  // Reads template string tokens.

		  var INVALID_TEMPLATE_ESCAPE_ERROR = {};

		  pp.tryReadTemplateToken = function() {
		    this.inTemplateElement = true;
		    try {
		      this.readTmplToken();
		    } catch (err) {
		      if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
		        this.readInvalidTemplateToken();
		      } else {
		        throw err
		      }
		    }

		    this.inTemplateElement = false;
		  };

		  pp.invalidStringToken = function(position, message) {
		    if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
		      throw INVALID_TEMPLATE_ESCAPE_ERROR
		    } else {
		      this.raise(position, message);
		    }
		  };

		  pp.readTmplToken = function() {
		    var out = "", chunkStart = this.pos;
		    for (;;) {
		      if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
		      var ch = this.input.charCodeAt(this.pos);
		      if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
		        if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {
		          if (ch === 36) {
		            this.pos += 2;
		            return this.finishToken(types$1.dollarBraceL)
		          } else {
		            ++this.pos;
		            return this.finishToken(types$1.backQuote)
		          }
		        }
		        out += this.input.slice(chunkStart, this.pos);
		        return this.finishToken(types$1.template, out)
		      }
		      if (ch === 92) { // '\'
		        out += this.input.slice(chunkStart, this.pos);
		        out += this.readEscapedChar(true);
		        chunkStart = this.pos;
		      } else if (isNewLine(ch)) {
		        out += this.input.slice(chunkStart, this.pos);
		        ++this.pos;
		        switch (ch) {
		        case 13:
		          if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
		        case 10:
		          out += "\n";
		          break
		        default:
		          out += String.fromCharCode(ch);
		          break
		        }
		        if (this.options.locations) {
		          ++this.curLine;
		          this.lineStart = this.pos;
		        }
		        chunkStart = this.pos;
		      } else {
		        ++this.pos;
		      }
		    }
		  };

		  // Reads a template token to search for the end, without validating any escape sequences
		  pp.readInvalidTemplateToken = function() {
		    for (; this.pos < this.input.length; this.pos++) {
		      switch (this.input[this.pos]) {
		      case "\\":
		        ++this.pos;
		        break

		      case "$":
		        if (this.input[this.pos + 1] !== "{") { break }
		        // fall through
		      case "`":
		        return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))

		      case "\r":
		        if (this.input[this.pos + 1] === "\n") { ++this.pos; }
		        // fall through
		      case "\n": case "\u2028": case "\u2029":
		        ++this.curLine;
		        this.lineStart = this.pos + 1;
		        break
		      }
		    }
		    this.raise(this.start, "Unterminated template");
		  };

		  // Used to read escaped characters

		  pp.readEscapedChar = function(inTemplate) {
		    var ch = this.input.charCodeAt(++this.pos);
		    ++this.pos;
		    switch (ch) {
		    case 110: return "\n" // 'n' -> '\n'
		    case 114: return "\r" // 'r' -> '\r'
		    case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
		    case 117: return codePointToString(this.readCodePoint()) // 'u'
		    case 116: return "\t" // 't' -> '\t'
		    case 98: return "\b" // 'b' -> '\b'
		    case 118: return "\u000b" // 'v' -> '\u000b'
		    case 102: return "\f" // 'f' -> '\f'
		    case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
		    case 10: // ' \n'
		      if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
		      return ""
		    case 56:
		    case 57:
		      if (this.strict) {
		        this.invalidStringToken(
		          this.pos - 1,
		          "Invalid escape sequence"
		        );
		      }
		      if (inTemplate) {
		        var codePos = this.pos - 1;

		        this.invalidStringToken(
		          codePos,
		          "Invalid escape sequence in template string"
		        );
		      }
		    default:
		      if (ch >= 48 && ch <= 55) {
		        var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
		        var octal = parseInt(octalStr, 8);
		        if (octal > 255) {
		          octalStr = octalStr.slice(0, -1);
		          octal = parseInt(octalStr, 8);
		        }
		        this.pos += octalStr.length - 1;
		        ch = this.input.charCodeAt(this.pos);
		        if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
		          this.invalidStringToken(
		            this.pos - 1 - octalStr.length,
		            inTemplate
		              ? "Octal literal in template string"
		              : "Octal literal in strict mode"
		          );
		        }
		        return String.fromCharCode(octal)
		      }
		      if (isNewLine(ch)) {
		        // Unicode new line characters after \ get removed from output in both
		        // template literals and strings
		        if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
		        return ""
		      }
		      return String.fromCharCode(ch)
		    }
		  };

		  // Used to read character escape sequences ('\x', '\u', '\U').

		  pp.readHexChar = function(len) {
		    var codePos = this.pos;
		    var n = this.readInt(16, len);
		    if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
		    return n
		  };

		  // Read an identifier, and return it as a string. Sets `this.containsEsc`
		  // to whether the word contained a '\u' escape.
		  //
		  // Incrementally adds only escaped chars, adding other chunks as-is
		  // as a micro-optimization.

		  pp.readWord1 = function() {
		    this.containsEsc = false;
		    var word = "", first = true, chunkStart = this.pos;
		    var astral = this.options.ecmaVersion >= 6;
		    while (this.pos < this.input.length) {
		      var ch = this.fullCharCodeAtPos();
		      if (isIdentifierChar(ch, astral)) {
		        this.pos += ch <= 0xffff ? 1 : 2;
		      } else if (ch === 92) { // "\"
		        this.containsEsc = true;
		        word += this.input.slice(chunkStart, this.pos);
		        var escStart = this.pos;
		        if (this.input.charCodeAt(++this.pos) !== 117) // "u"
		          { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
		        ++this.pos;
		        var esc = this.readCodePoint();
		        if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
		          { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
		        word += codePointToString(esc);
		        chunkStart = this.pos;
		      } else {
		        break
		      }
		      first = false;
		    }
		    return word + this.input.slice(chunkStart, this.pos)
		  };

		  // Read an identifier or keyword token. Will check for reserved
		  // words when necessary.

		  pp.readWord = function() {
		    var word = this.readWord1();
		    var type = types$1.name;
		    if (this.keywords.test(word)) {
		      type = keywords[word];
		    }
		    return this.finishToken(type, word)
		  };

		  // Acorn is a tiny, fast JavaScript parser written in JavaScript.
		  //
		  // Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and
		  // various contributors and released under an MIT license.
		  //
		  // Git repositories for Acorn are available at
		  //
		  //     http://marijnhaverbeke.nl/git/acorn
		  //     https://github.com/acornjs/acorn.git
		  //
		  // Please use the [github bug tracker][ghbt] to report issues.
		  //
		  // [ghbt]: https://github.com/acornjs/acorn/issues
		  //
		  // [walk]: util/walk.js


		  var version = "8.14.0";

		  Parser.acorn = {
		    Parser: Parser,
		    version: version,
		    defaultOptions: defaultOptions,
		    Position: Position,
		    SourceLocation: SourceLocation,
		    getLineInfo: getLineInfo,
		    Node: Node,
		    TokenType: TokenType,
		    tokTypes: types$1,
		    keywordTypes: keywords,
		    TokContext: TokContext,
		    tokContexts: types,
		    isIdentifierChar: isIdentifierChar,
		    isIdentifierStart: isIdentifierStart,
		    Token: Token,
		    isNewLine: isNewLine,
		    lineBreak: lineBreak,
		    lineBreakG: lineBreakG,
		    nonASCIIwhitespace: nonASCIIwhitespace
		  };

		  // The main exported interface (under `self.acorn` when in the
		  // browser) is a `parse` function that takes a code string and returns
		  // an abstract syntax tree as specified by the [ESTree spec][estree].
		  //
		  // [estree]: https://github.com/estree/estree

		  function parse(input, options) {
		    return Parser.parse(input, options)
		  }

		  // This function tries to parse a single expression at a given
		  // offset in a string. Useful for parsing mixed-language formats
		  // that embed JavaScript expressions.

		  function parseExpressionAt(input, pos, options) {
		    return Parser.parseExpressionAt(input, pos, options)
		  }

		  // Acorn is organized as a tokenizer and a recursive-descent parser.
		  // The `tokenizer` export provides an interface to the tokenizer.

		  function tokenizer(input, options) {
		    return Parser.tokenizer(input, options)
		  }

		  exports.Node = Node;
		  exports.Parser = Parser;
		  exports.Position = Position;
		  exports.SourceLocation = SourceLocation;
		  exports.TokContext = TokContext;
		  exports.Token = Token;
		  exports.TokenType = TokenType;
		  exports.defaultOptions = defaultOptions;
		  exports.getLineInfo = getLineInfo;
		  exports.isIdentifierChar = isIdentifierChar;
		  exports.isIdentifierStart = isIdentifierStart;
		  exports.isNewLine = isNewLine;
		  exports.keywordTypes = keywords;
		  exports.lineBreak = lineBreak;
		  exports.lineBreakG = lineBreakG;
		  exports.nonASCIIwhitespace = nonASCIIwhitespace;
		  exports.parse = parse;
		  exports.parseExpressionAt = parseExpressionAt;
		  exports.tokContexts = types;
		  exports.tokTypes = types$1;
		  exports.tokenizer = tokenizer;
		  exports.version = version;

		})); 
	} (acorn, acorn.exports));
	return acorn.exports;
}

var acornJsx = {exports: {}};

var xhtml;
var hasRequiredXhtml;

function requireXhtml () {
	if (hasRequiredXhtml) return xhtml;
	hasRequiredXhtml = 1;
	xhtml = {
	  quot: '\u0022',
	  amp: '&',
	  apos: '\u0027',
	  lt: '<',
	  gt: '>',
	  nbsp: '\u00A0',
	  iexcl: '\u00A1',
	  cent: '\u00A2',
	  pound: '\u00A3',
	  curren: '\u00A4',
	  yen: '\u00A5',
	  brvbar: '\u00A6',
	  sect: '\u00A7',
	  uml: '\u00A8',
	  copy: '\u00A9',
	  ordf: '\u00AA',
	  laquo: '\u00AB',
	  not: '\u00AC',
	  shy: '\u00AD',
	  reg: '\u00AE',
	  macr: '\u00AF',
	  deg: '\u00B0',
	  plusmn: '\u00B1',
	  sup2: '\u00B2',
	  sup3: '\u00B3',
	  acute: '\u00B4',
	  micro: '\u00B5',
	  para: '\u00B6',
	  middot: '\u00B7',
	  cedil: '\u00B8',
	  sup1: '\u00B9',
	  ordm: '\u00BA',
	  raquo: '\u00BB',
	  frac14: '\u00BC',
	  frac12: '\u00BD',
	  frac34: '\u00BE',
	  iquest: '\u00BF',
	  Agrave: '\u00C0',
	  Aacute: '\u00C1',
	  Acirc: '\u00C2',
	  Atilde: '\u00C3',
	  Auml: '\u00C4',
	  Aring: '\u00C5',
	  AElig: '\u00C6',
	  Ccedil: '\u00C7',
	  Egrave: '\u00C8',
	  Eacute: '\u00C9',
	  Ecirc: '\u00CA',
	  Euml: '\u00CB',
	  Igrave: '\u00CC',
	  Iacute: '\u00CD',
	  Icirc: '\u00CE',
	  Iuml: '\u00CF',
	  ETH: '\u00D0',
	  Ntilde: '\u00D1',
	  Ograve: '\u00D2',
	  Oacute: '\u00D3',
	  Ocirc: '\u00D4',
	  Otilde: '\u00D5',
	  Ouml: '\u00D6',
	  times: '\u00D7',
	  Oslash: '\u00D8',
	  Ugrave: '\u00D9',
	  Uacute: '\u00DA',
	  Ucirc: '\u00DB',
	  Uuml: '\u00DC',
	  Yacute: '\u00DD',
	  THORN: '\u00DE',
	  szlig: '\u00DF',
	  agrave: '\u00E0',
	  aacute: '\u00E1',
	  acirc: '\u00E2',
	  atilde: '\u00E3',
	  auml: '\u00E4',
	  aring: '\u00E5',
	  aelig: '\u00E6',
	  ccedil: '\u00E7',
	  egrave: '\u00E8',
	  eacute: '\u00E9',
	  ecirc: '\u00EA',
	  euml: '\u00EB',
	  igrave: '\u00EC',
	  iacute: '\u00ED',
	  icirc: '\u00EE',
	  iuml: '\u00EF',
	  eth: '\u00F0',
	  ntilde: '\u00F1',
	  ograve: '\u00F2',
	  oacute: '\u00F3',
	  ocirc: '\u00F4',
	  otilde: '\u00F5',
	  ouml: '\u00F6',
	  divide: '\u00F7',
	  oslash: '\u00F8',
	  ugrave: '\u00F9',
	  uacute: '\u00FA',
	  ucirc: '\u00FB',
	  uuml: '\u00FC',
	  yacute: '\u00FD',
	  thorn: '\u00FE',
	  yuml: '\u00FF',
	  OElig: '\u0152',
	  oelig: '\u0153',
	  Scaron: '\u0160',
	  scaron: '\u0161',
	  Yuml: '\u0178',
	  fnof: '\u0192',
	  circ: '\u02C6',
	  tilde: '\u02DC',
	  Alpha: '\u0391',
	  Beta: '\u0392',
	  Gamma: '\u0393',
	  Delta: '\u0394',
	  Epsilon: '\u0395',
	  Zeta: '\u0396',
	  Eta: '\u0397',
	  Theta: '\u0398',
	  Iota: '\u0399',
	  Kappa: '\u039A',
	  Lambda: '\u039B',
	  Mu: '\u039C',
	  Nu: '\u039D',
	  Xi: '\u039E',
	  Omicron: '\u039F',
	  Pi: '\u03A0',
	  Rho: '\u03A1',
	  Sigma: '\u03A3',
	  Tau: '\u03A4',
	  Upsilon: '\u03A5',
	  Phi: '\u03A6',
	  Chi: '\u03A7',
	  Psi: '\u03A8',
	  Omega: '\u03A9',
	  alpha: '\u03B1',
	  beta: '\u03B2',
	  gamma: '\u03B3',
	  delta: '\u03B4',
	  epsilon: '\u03B5',
	  zeta: '\u03B6',
	  eta: '\u03B7',
	  theta: '\u03B8',
	  iota: '\u03B9',
	  kappa: '\u03BA',
	  lambda: '\u03BB',
	  mu: '\u03BC',
	  nu: '\u03BD',
	  xi: '\u03BE',
	  omicron: '\u03BF',
	  pi: '\u03C0',
	  rho: '\u03C1',
	  sigmaf: '\u03C2',
	  sigma: '\u03C3',
	  tau: '\u03C4',
	  upsilon: '\u03C5',
	  phi: '\u03C6',
	  chi: '\u03C7',
	  psi: '\u03C8',
	  omega: '\u03C9',
	  thetasym: '\u03D1',
	  upsih: '\u03D2',
	  piv: '\u03D6',
	  ensp: '\u2002',
	  emsp: '\u2003',
	  thinsp: '\u2009',
	  zwnj: '\u200C',
	  zwj: '\u200D',
	  lrm: '\u200E',
	  rlm: '\u200F',
	  ndash: '\u2013',
	  mdash: '\u2014',
	  lsquo: '\u2018',
	  rsquo: '\u2019',
	  sbquo: '\u201A',
	  ldquo: '\u201C',
	  rdquo: '\u201D',
	  bdquo: '\u201E',
	  dagger: '\u2020',
	  Dagger: '\u2021',
	  bull: '\u2022',
	  hellip: '\u2026',
	  permil: '\u2030',
	  prime: '\u2032',
	  Prime: '\u2033',
	  lsaquo: '\u2039',
	  rsaquo: '\u203A',
	  oline: '\u203E',
	  frasl: '\u2044',
	  euro: '\u20AC',
	  image: '\u2111',
	  weierp: '\u2118',
	  real: '\u211C',
	  trade: '\u2122',
	  alefsym: '\u2135',
	  larr: '\u2190',
	  uarr: '\u2191',
	  rarr: '\u2192',
	  darr: '\u2193',
	  harr: '\u2194',
	  crarr: '\u21B5',
	  lArr: '\u21D0',
	  uArr: '\u21D1',
	  rArr: '\u21D2',
	  dArr: '\u21D3',
	  hArr: '\u21D4',
	  forall: '\u2200',
	  part: '\u2202',
	  exist: '\u2203',
	  empty: '\u2205',
	  nabla: '\u2207',
	  isin: '\u2208',
	  notin: '\u2209',
	  ni: '\u220B',
	  prod: '\u220F',
	  sum: '\u2211',
	  minus: '\u2212',
	  lowast: '\u2217',
	  radic: '\u221A',
	  prop: '\u221D',
	  infin: '\u221E',
	  ang: '\u2220',
	  and: '\u2227',
	  or: '\u2228',
	  cap: '\u2229',
	  cup: '\u222A',
	  'int': '\u222B',
	  there4: '\u2234',
	  sim: '\u223C',
	  cong: '\u2245',
	  asymp: '\u2248',
	  ne: '\u2260',
	  equiv: '\u2261',
	  le: '\u2264',
	  ge: '\u2265',
	  sub: '\u2282',
	  sup: '\u2283',
	  nsub: '\u2284',
	  sube: '\u2286',
	  supe: '\u2287',
	  oplus: '\u2295',
	  otimes: '\u2297',
	  perp: '\u22A5',
	  sdot: '\u22C5',
	  lceil: '\u2308',
	  rceil: '\u2309',
	  lfloor: '\u230A',
	  rfloor: '\u230B',
	  lang: '\u2329',
	  rang: '\u232A',
	  loz: '\u25CA',
	  spades: '\u2660',
	  clubs: '\u2663',
	  hearts: '\u2665',
	  diams: '\u2666'
	};
	return xhtml;
}

var hasRequiredAcornJsx;

function requireAcornJsx () {
	if (hasRequiredAcornJsx) return acornJsx.exports;
	hasRequiredAcornJsx = 1;
	(function (module) {

		const XHTMLEntities = requireXhtml();

		const hexNumber = /^[\da-fA-F]+$/;
		const decimalNumber = /^\d+$/;

		// The map to `acorn-jsx` tokens from `acorn` namespace objects.
		const acornJsxMap = new WeakMap();

		// Get the original tokens for the given `acorn` namespace object.
		function getJsxTokens(acorn) {
		  acorn = acorn.Parser.acorn || acorn;
		  let acornJsx = acornJsxMap.get(acorn);
		  if (!acornJsx) {
		    const tt = acorn.tokTypes;
		    const TokContext = acorn.TokContext;
		    const TokenType = acorn.TokenType;
		    const tc_oTag = new TokContext('<tag', false);
		    const tc_cTag = new TokContext('</tag', false);
		    const tc_expr = new TokContext('<tag>...</tag>', true, true);
		    const tokContexts = {
		      tc_oTag: tc_oTag,
		      tc_cTag: tc_cTag,
		      tc_expr: tc_expr
		    };
		    const tokTypes = {
		      jsxName: new TokenType('jsxName'),
		      jsxText: new TokenType('jsxText', {beforeExpr: true}),
		      jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),
		      jsxTagEnd: new TokenType('jsxTagEnd')
		    };

		    tokTypes.jsxTagStart.updateContext = function() {
		      this.context.push(tc_expr); // treat as beginning of JSX expression
		      this.context.push(tc_oTag); // start opening tag context
		      this.exprAllowed = false;
		    };
		    tokTypes.jsxTagEnd.updateContext = function(prevType) {
		      let out = this.context.pop();
		      if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
		        this.context.pop();
		        this.exprAllowed = this.curContext() === tc_expr;
		      } else {
		        this.exprAllowed = true;
		      }
		    };

		    acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };
		    acornJsxMap.set(acorn, acornJsx);
		  }

		  return acornJsx;
		}

		// Transforms JSX element name to string.

		function getQualifiedJSXName(object) {
		  if (!object)
		    return object;

		  if (object.type === 'JSXIdentifier')
		    return object.name;

		  if (object.type === 'JSXNamespacedName')
		    return object.namespace.name + ':' + object.name.name;

		  if (object.type === 'JSXMemberExpression')
		    return getQualifiedJSXName(object.object) + '.' +
		    getQualifiedJSXName(object.property);
		}

		module.exports = function(options) {
		  options = options || {};
		  return function(Parser) {
		    return plugin({
		      allowNamespaces: options.allowNamespaces !== false,
		      allowNamespacedObjects: !!options.allowNamespacedObjects
		    }, Parser);
		  };
		};

		// This is `tokTypes` of the peer dep.
		// This can be different instances from the actual `tokTypes` this plugin uses.
		Object.defineProperty(module.exports, "tokTypes", {
		  get: function get_tokTypes() {
		    return getJsxTokens(requireAcorn()).tokTypes;
		  },
		  configurable: true,
		  enumerable: true
		});

		function plugin(options, Parser) {
		  const acorn = Parser.acorn || requireAcorn();
		  const acornJsx = getJsxTokens(acorn);
		  const tt = acorn.tokTypes;
		  const tok = acornJsx.tokTypes;
		  const tokContexts = acorn.tokContexts;
		  const tc_oTag = acornJsx.tokContexts.tc_oTag;
		  const tc_cTag = acornJsx.tokContexts.tc_cTag;
		  const tc_expr = acornJsx.tokContexts.tc_expr;
		  const isNewLine = acorn.isNewLine;
		  const isIdentifierStart = acorn.isIdentifierStart;
		  const isIdentifierChar = acorn.isIdentifierChar;

		  return class extends Parser {
		    // Expose actual `tokTypes` and `tokContexts` to other plugins.
		    static get acornJsx() {
		      return acornJsx;
		    }

		    // Reads inline JSX contents token.
		    jsx_readToken() {
		      let out = '', chunkStart = this.pos;
		      for (;;) {
		        if (this.pos >= this.input.length)
		          this.raise(this.start, 'Unterminated JSX contents');
		        let ch = this.input.charCodeAt(this.pos);

		        switch (ch) {
		        case 60: // '<'
		        case 123: // '{'
		          if (this.pos === this.start) {
		            if (ch === 60 && this.exprAllowed) {
		              ++this.pos;
		              return this.finishToken(tok.jsxTagStart);
		            }
		            return this.getTokenFromCode(ch);
		          }
		          out += this.input.slice(chunkStart, this.pos);
		          return this.finishToken(tok.jsxText, out);

		        case 38: // '&'
		          out += this.input.slice(chunkStart, this.pos);
		          out += this.jsx_readEntity();
		          chunkStart = this.pos;
		          break;

		        case 62: // '>'
		        case 125: // '}'
		          this.raise(
		            this.pos,
		            "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
		              (ch === 62 ? "&gt;" : "&rbrace;") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
		          );

		        default:
		          if (isNewLine(ch)) {
		            out += this.input.slice(chunkStart, this.pos);
		            out += this.jsx_readNewLine(true);
		            chunkStart = this.pos;
		          } else {
		            ++this.pos;
		          }
		        }
		      }
		    }

		    jsx_readNewLine(normalizeCRLF) {
		      let ch = this.input.charCodeAt(this.pos);
		      let out;
		      ++this.pos;
		      if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
		        ++this.pos;
		        out = normalizeCRLF ? '\n' : '\r\n';
		      } else {
		        out = String.fromCharCode(ch);
		      }
		      if (this.options.locations) {
		        ++this.curLine;
		        this.lineStart = this.pos;
		      }

		      return out;
		    }

		    jsx_readString(quote) {
		      let out = '', chunkStart = ++this.pos;
		      for (;;) {
		        if (this.pos >= this.input.length)
		          this.raise(this.start, 'Unterminated string constant');
		        let ch = this.input.charCodeAt(this.pos);
		        if (ch === quote) break;
		        if (ch === 38) { // '&'
		          out += this.input.slice(chunkStart, this.pos);
		          out += this.jsx_readEntity();
		          chunkStart = this.pos;
		        } else if (isNewLine(ch)) {
		          out += this.input.slice(chunkStart, this.pos);
		          out += this.jsx_readNewLine(false);
		          chunkStart = this.pos;
		        } else {
		          ++this.pos;
		        }
		      }
		      out += this.input.slice(chunkStart, this.pos++);
		      return this.finishToken(tt.string, out);
		    }

		    jsx_readEntity() {
		      let str = '', count = 0, entity;
		      let ch = this.input[this.pos];
		      if (ch !== '&')
		        this.raise(this.pos, 'Entity must start with an ampersand');
		      let startPos = ++this.pos;
		      while (this.pos < this.input.length && count++ < 10) {
		        ch = this.input[this.pos++];
		        if (ch === ';') {
		          if (str[0] === '#') {
		            if (str[1] === 'x') {
		              str = str.substr(2);
		              if (hexNumber.test(str))
		                entity = String.fromCharCode(parseInt(str, 16));
		            } else {
		              str = str.substr(1);
		              if (decimalNumber.test(str))
		                entity = String.fromCharCode(parseInt(str, 10));
		            }
		          } else {
		            entity = XHTMLEntities[str];
		          }
		          break;
		        }
		        str += ch;
		      }
		      if (!entity) {
		        this.pos = startPos;
		        return '&';
		      }
		      return entity;
		    }

		    // Read a JSX identifier (valid tag or attribute name).
		    //
		    // Optimized version since JSX identifiers can't contain
		    // escape characters and so can be read as single slice.
		    // Also assumes that first character was already checked
		    // by isIdentifierStart in readToken.

		    jsx_readWord() {
		      let ch, start = this.pos;
		      do {
		        ch = this.input.charCodeAt(++this.pos);
		      } while (isIdentifierChar(ch) || ch === 45); // '-'
		      return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));
		    }

		    // Parse next token as JSX identifier

		    jsx_parseIdentifier() {
		      let node = this.startNode();
		      if (this.type === tok.jsxName)
		        node.name = this.value;
		      else if (this.type.keyword)
		        node.name = this.type.keyword;
		      else
		        this.unexpected();
		      this.next();
		      return this.finishNode(node, 'JSXIdentifier');
		    }

		    // Parse namespaced identifier.

		    jsx_parseNamespacedName() {
		      let startPos = this.start, startLoc = this.startLoc;
		      let name = this.jsx_parseIdentifier();
		      if (!options.allowNamespaces || !this.eat(tt.colon)) return name;
		      var node = this.startNodeAt(startPos, startLoc);
		      node.namespace = name;
		      node.name = this.jsx_parseIdentifier();
		      return this.finishNode(node, 'JSXNamespacedName');
		    }

		    // Parses element name in any form - namespaced, member
		    // or single identifier.

		    jsx_parseElementName() {
		      if (this.type === tok.jsxTagEnd) return '';
		      let startPos = this.start, startLoc = this.startLoc;
		      let node = this.jsx_parseNamespacedName();
		      if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {
		        this.unexpected();
		      }
		      while (this.eat(tt.dot)) {
		        let newNode = this.startNodeAt(startPos, startLoc);
		        newNode.object = node;
		        newNode.property = this.jsx_parseIdentifier();
		        node = this.finishNode(newNode, 'JSXMemberExpression');
		      }
		      return node;
		    }

		    // Parses any type of JSX attribute value.

		    jsx_parseAttributeValue() {
		      switch (this.type) {
		      case tt.braceL:
		        let node = this.jsx_parseExpressionContainer();
		        if (node.expression.type === 'JSXEmptyExpression')
		          this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
		        return node;

		      case tok.jsxTagStart:
		      case tt.string:
		        return this.parseExprAtom();

		      default:
		        this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
		      }
		    }

		    // JSXEmptyExpression is unique type since it doesn't actually parse anything,
		    // and so it should start at the end of last read token (left brace) and finish
		    // at the beginning of the next one (right brace).

		    jsx_parseEmptyExpression() {
		      let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
		      return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
		    }

		    // Parses JSX expression enclosed into curly brackets.

		    jsx_parseExpressionContainer() {
		      let node = this.startNode();
		      this.next();
		      node.expression = this.type === tt.braceR
		        ? this.jsx_parseEmptyExpression()
		        : this.parseExpression();
		      this.expect(tt.braceR);
		      return this.finishNode(node, 'JSXExpressionContainer');
		    }

		    // Parses following JSX attribute name-value pair.

		    jsx_parseAttribute() {
		      let node = this.startNode();
		      if (this.eat(tt.braceL)) {
		        this.expect(tt.ellipsis);
		        node.argument = this.parseMaybeAssign();
		        this.expect(tt.braceR);
		        return this.finishNode(node, 'JSXSpreadAttribute');
		      }
		      node.name = this.jsx_parseNamespacedName();
		      node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
		      return this.finishNode(node, 'JSXAttribute');
		    }

		    // Parses JSX opening tag starting after '<'.

		    jsx_parseOpeningElementAt(startPos, startLoc) {
		      let node = this.startNodeAt(startPos, startLoc);
		      node.attributes = [];
		      let nodeName = this.jsx_parseElementName();
		      if (nodeName) node.name = nodeName;
		      while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
		        node.attributes.push(this.jsx_parseAttribute());
		      node.selfClosing = this.eat(tt.slash);
		      this.expect(tok.jsxTagEnd);
		      return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
		    }

		    // Parses JSX closing tag starting after '</'.

		    jsx_parseClosingElementAt(startPos, startLoc) {
		      let node = this.startNodeAt(startPos, startLoc);
		      let nodeName = this.jsx_parseElementName();
		      if (nodeName) node.name = nodeName;
		      this.expect(tok.jsxTagEnd);
		      return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');
		    }

		    // Parses entire JSX element, including it's opening tag
		    // (starting after '<'), attributes, contents and closing tag.

		    jsx_parseElementAt(startPos, startLoc) {
		      let node = this.startNodeAt(startPos, startLoc);
		      let children = [];
		      let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
		      let closingElement = null;

		      if (!openingElement.selfClosing) {
		        contents: for (;;) {
		          switch (this.type) {
		          case tok.jsxTagStart:
		            startPos = this.start; startLoc = this.startLoc;
		            this.next();
		            if (this.eat(tt.slash)) {
		              closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
		              break contents;
		            }
		            children.push(this.jsx_parseElementAt(startPos, startLoc));
		            break;

		          case tok.jsxText:
		            children.push(this.parseExprAtom());
		            break;

		          case tt.braceL:
		            children.push(this.jsx_parseExpressionContainer());
		            break;

		          default:
		            this.unexpected();
		          }
		        }
		        if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
		          this.raise(
		            closingElement.start,
		            'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
		        }
		      }
		      let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';

		      node['opening' + fragmentOrElement] = openingElement;
		      node['closing' + fragmentOrElement] = closingElement;
		      node.children = children;
		      if (this.type === tt.relational && this.value === "<") {
		        this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
		      }
		      return this.finishNode(node, 'JSX' + fragmentOrElement);
		    }

		    // Parse JSX text

		    jsx_parseText() {
		      let node = this.parseLiteral(this.value);
		      node.type = "JSXText";
		      return node;
		    }

		    // Parses entire JSX element from current position.

		    jsx_parseElement() {
		      let startPos = this.start, startLoc = this.startLoc;
		      this.next();
		      return this.jsx_parseElementAt(startPos, startLoc);
		    }

		    parseExprAtom(refShortHandDefaultPos) {
		      if (this.type === tok.jsxText)
		        return this.jsx_parseText();
		      else if (this.type === tok.jsxTagStart)
		        return this.jsx_parseElement();
		      else
		        return super.parseExprAtom(refShortHandDefaultPos);
		    }

		    readToken(code) {
		      let context = this.curContext();

		      if (context === tc_expr) return this.jsx_readToken();

		      if (context === tc_oTag || context === tc_cTag) {
		        if (isIdentifierStart(code)) return this.jsx_readWord();

		        if (code == 62) {
		          ++this.pos;
		          return this.finishToken(tok.jsxTagEnd);
		        }

		        if ((code === 34 || code === 39) && context == tc_oTag)
		          return this.jsx_readString(code);
		      }

		      if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
		        ++this.pos;
		        return this.finishToken(tok.jsxTagStart);
		      }
		      return super.readToken(code);
		    }

		    updateContext(prevType) {
		      if (this.type == tt.braceL) {
		        var curContext = this.curContext();
		        if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
		        else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
		        else super.updateContext(prevType);
		        this.exprAllowed = true;
		      } else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
		        this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
		        this.context.push(tc_cTag); // reconsider as closing tag context
		        this.exprAllowed = false;
		      } else {
		        return super.updateContext(prevType);
		      }
		    }
		  };
		} 
	} (acornJsx));
	return acornJsx.exports;
}

var eslintVisitorKeys$1 = {};

var hasRequiredEslintVisitorKeys$1;

function requireEslintVisitorKeys$1 () {
	if (hasRequiredEslintVisitorKeys$1) return eslintVisitorKeys$1;
	hasRequiredEslintVisitorKeys$1 = 1;

	/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
	   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
	*/
	/**
	 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
	 */
	/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */

	/**
	 * @type {VisitorKeys}
	 */
	const KEYS = {
	    ArrayExpression: [
	        "elements"
	    ],
	    ArrayPattern: [
	        "elements"
	    ],
	    ArrowFunctionExpression: [
	        "params",
	        "body"
	    ],
	    AssignmentExpression: [
	        "left",
	        "right"
	    ],
	    AssignmentPattern: [
	        "left",
	        "right"
	    ],
	    AwaitExpression: [
	        "argument"
	    ],
	    BinaryExpression: [
	        "left",
	        "right"
	    ],
	    BlockStatement: [
	        "body"
	    ],
	    BreakStatement: [
	        "label"
	    ],
	    CallExpression: [
	        "callee",
	        "arguments"
	    ],
	    CatchClause: [
	        "param",
	        "body"
	    ],
	    ChainExpression: [
	        "expression"
	    ],
	    ClassBody: [
	        "body"
	    ],
	    ClassDeclaration: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ClassExpression: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ConditionalExpression: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ContinueStatement: [
	        "label"
	    ],
	    DebuggerStatement: [],
	    DoWhileStatement: [
	        "body",
	        "test"
	    ],
	    EmptyStatement: [],
	    ExperimentalRestProperty: [
	        "argument"
	    ],
	    ExperimentalSpreadProperty: [
	        "argument"
	    ],
	    ExportAllDeclaration: [
	        "exported",
	        "source",
	        "attributes"
	    ],
	    ExportDefaultDeclaration: [
	        "declaration"
	    ],
	    ExportNamedDeclaration: [
	        "declaration",
	        "specifiers",
	        "source",
	        "attributes"
	    ],
	    ExportSpecifier: [
	        "exported",
	        "local"
	    ],
	    ExpressionStatement: [
	        "expression"
	    ],
	    ForInStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForOfStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForStatement: [
	        "init",
	        "test",
	        "update",
	        "body"
	    ],
	    FunctionDeclaration: [
	        "id",
	        "params",
	        "body"
	    ],
	    FunctionExpression: [
	        "id",
	        "params",
	        "body"
	    ],
	    Identifier: [],
	    IfStatement: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ImportAttribute: [
	        "key",
	        "value"
	    ],
	    ImportDeclaration: [
	        "specifiers",
	        "source",
	        "attributes"
	    ],
	    ImportDefaultSpecifier: [
	        "local"
	    ],
	    ImportExpression: [
	        "source",
	        "options"
	    ],
	    ImportNamespaceSpecifier: [
	        "local"
	    ],
	    ImportSpecifier: [
	        "imported",
	        "local"
	    ],
	    JSXAttribute: [
	        "name",
	        "value"
	    ],
	    JSXClosingElement: [
	        "name"
	    ],
	    JSXClosingFragment: [],
	    JSXElement: [
	        "openingElement",
	        "children",
	        "closingElement"
	    ],
	    JSXEmptyExpression: [],
	    JSXExpressionContainer: [
	        "expression"
	    ],
	    JSXFragment: [
	        "openingFragment",
	        "children",
	        "closingFragment"
	    ],
	    JSXIdentifier: [],
	    JSXMemberExpression: [
	        "object",
	        "property"
	    ],
	    JSXNamespacedName: [
	        "namespace",
	        "name"
	    ],
	    JSXOpeningElement: [
	        "name",
	        "attributes"
	    ],
	    JSXOpeningFragment: [],
	    JSXSpreadAttribute: [
	        "argument"
	    ],
	    JSXSpreadChild: [
	        "expression"
	    ],
	    JSXText: [],
	    LabeledStatement: [
	        "label",
	        "body"
	    ],
	    Literal: [],
	    LogicalExpression: [
	        "left",
	        "right"
	    ],
	    MemberExpression: [
	        "object",
	        "property"
	    ],
	    MetaProperty: [
	        "meta",
	        "property"
	    ],
	    MethodDefinition: [
	        "key",
	        "value"
	    ],
	    NewExpression: [
	        "callee",
	        "arguments"
	    ],
	    ObjectExpression: [
	        "properties"
	    ],
	    ObjectPattern: [
	        "properties"
	    ],
	    PrivateIdentifier: [],
	    Program: [
	        "body"
	    ],
	    Property: [
	        "key",
	        "value"
	    ],
	    PropertyDefinition: [
	        "key",
	        "value"
	    ],
	    RestElement: [
	        "argument"
	    ],
	    ReturnStatement: [
	        "argument"
	    ],
	    SequenceExpression: [
	        "expressions"
	    ],
	    SpreadElement: [
	        "argument"
	    ],
	    StaticBlock: [
	        "body"
	    ],
	    Super: [],
	    SwitchCase: [
	        "test",
	        "consequent"
	    ],
	    SwitchStatement: [
	        "discriminant",
	        "cases"
	    ],
	    TaggedTemplateExpression: [
	        "tag",
	        "quasi"
	    ],
	    TemplateElement: [],
	    TemplateLiteral: [
	        "quasis",
	        "expressions"
	    ],
	    ThisExpression: [],
	    ThrowStatement: [
	        "argument"
	    ],
	    TryStatement: [
	        "block",
	        "handler",
	        "finalizer"
	    ],
	    UnaryExpression: [
	        "argument"
	    ],
	    UpdateExpression: [
	        "argument"
	    ],
	    VariableDeclaration: [
	        "declarations"
	    ],
	    VariableDeclarator: [
	        "id",
	        "init"
	    ],
	    WhileStatement: [
	        "test",
	        "body"
	    ],
	    WithStatement: [
	        "object",
	        "body"
	    ],
	    YieldExpression: [
	        "argument"
	    ]
	};

	// Types.
	const NODE_TYPES = Object.keys(KEYS);

	// Freeze the keys.
	for (const type of NODE_TYPES) {
	    Object.freeze(KEYS[type]);
	}
	Object.freeze(KEYS);

	/**
	 * @author Toru Nagashima <https://github.com/mysticatea>
	 * See LICENSE file in root directory for full license.
	 */

	/**
	 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
	 */

	// List to ignore keys.
	const KEY_BLACKLIST = new Set([
	    "parent",
	    "leadingComments",
	    "trailingComments"
	]);

	/**
	 * Check whether a given key should be used or not.
	 * @param {string} key The key to check.
	 * @returns {boolean} `true` if the key should be used.
	 */
	function filterKey(key) {
	    return !KEY_BLACKLIST.has(key) && key[0] !== "_";
	}


	/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
	   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
	*/
	/**
	 * Get visitor keys of a given node.
	 * @param {Object} node The AST node to get keys.
	 * @returns {readonly string[]} Visitor keys of the node.
	 */
	function getKeys(node) {
	    return Object.keys(node).filter(filterKey);
	}
	/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */

	/**
	 * Make the union set with `KEYS` and given keys.
	 * @param {VisitorKeys} additionalKeys The additional keys.
	 * @returns {VisitorKeys} The union set.
	 */
	function unionWith(additionalKeys) {
	    const retv = /** @type {{ [type: string]: ReadonlyArray<string> }} */
	        (Object.assign({}, KEYS));

	    for (const type of Object.keys(additionalKeys)) {
	        if (Object.hasOwn(retv, type)) {
	            const keys = new Set(additionalKeys[type]);

	            for (const key of retv[type]) {
	                keys.add(key);
	            }

	            retv[type] = Object.freeze(Array.from(keys));
	        } else {
	            retv[type] = Object.freeze(Array.from(additionalKeys[type]));
	        }
	    }

	    return Object.freeze(retv);
	}

	eslintVisitorKeys$1.KEYS = KEYS;
	eslintVisitorKeys$1.getKeys = getKeys;
	eslintVisitorKeys$1.unionWith = unionWith;
	return eslintVisitorKeys$1;
}

var hasRequiredEspree;

function requireEspree () {
	if (hasRequiredEspree) return espree;
	hasRequiredEspree = 1;

	Object.defineProperty(espree, '__esModule', { value: true });

	var acorn = requireAcorn();
	var jsx = requireAcornJsx();
	var visitorKeys = requireEslintVisitorKeys$1();

	function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

	function _interopNamespace(e) {
	    if (e && e.__esModule) return e;
	    var n = Object.create(null);
	    if (e) {
	        Object.keys(e).forEach(function (k) {
	            if (k !== 'default') {
	                var d = Object.getOwnPropertyDescriptor(e, k);
	                Object.defineProperty(n, k, d.get ? d : {
	                    enumerable: true,
	                    get: function () { return e[k]; }
	                });
	            }
	        });
	    }
	    n["default"] = e;
	    return Object.freeze(n);
	}

	var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
	var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
	var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys);

	/**
	 * @fileoverview Translates tokens between Acorn format and Esprima format.
	 * @author Nicholas C. Zakas
	 */

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	// none!

	//------------------------------------------------------------------------------
	// Private
	//------------------------------------------------------------------------------


	// Esprima Token Types
	const Token = {
	    Boolean: "Boolean",
	    Identifier: "Identifier",
	    PrivateIdentifier: "PrivateIdentifier",
	    Keyword: "Keyword",
	    Null: "Null",
	    Numeric: "Numeric",
	    Punctuator: "Punctuator",
	    String: "String",
	    RegularExpression: "RegularExpression",
	    Template: "Template",
	    JSXIdentifier: "JSXIdentifier",
	    JSXText: "JSXText"
	};

	/**
	 * Converts part of a template into an Esprima token.
	 * @param {AcornToken[]} tokens The Acorn tokens representing the template.
	 * @param {string} code The source code.
	 * @returns {EsprimaToken} The Esprima equivalent of the template token.
	 * @private
	 */
	function convertTemplatePart(tokens, code) {
	    const firstToken = tokens[0],
	        lastTemplateToken = tokens.at(-1);

	    const token = {
	        type: Token.Template,
	        value: code.slice(firstToken.start, lastTemplateToken.end)
	    };

	    if (firstToken.loc) {
	        token.loc = {
	            start: firstToken.loc.start,
	            end: lastTemplateToken.loc.end
	        };
	    }

	    if (firstToken.range) {
	        token.start = firstToken.range[0];
	        token.end = lastTemplateToken.range[1];
	        token.range = [token.start, token.end];
	    }

	    return token;
	}

	/**
	 * Contains logic to translate Acorn tokens into Esprima tokens.
	 * @param {Object} acornTokTypes The Acorn token types.
	 * @param {string} code The source code Acorn is parsing. This is necessary
	 *      to correct the "value" property of some tokens.
	 * @constructor
	 */
	function TokenTranslator(acornTokTypes, code) {

	    // token types
	    this._acornTokTypes = acornTokTypes;

	    // token buffer for templates
	    this._tokens = [];

	    // track the last curly brace
	    this._curlyBrace = null;

	    // the source code
	    this._code = code;

	}

	TokenTranslator.prototype = {
	    constructor: TokenTranslator,

	    /**
	     * Translates a single Esprima token to a single Acorn token. This may be
	     * inaccurate due to how templates are handled differently in Esprima and
	     * Acorn, but should be accurate for all other tokens.
	     * @param {AcornToken} token The Acorn token to translate.
	     * @param {Object} extra Espree extra object.
	     * @returns {EsprimaToken} The Esprima version of the token.
	     */
	    translate(token, extra) {

	        const type = token.type,
	            tt = this._acornTokTypes;

	        if (type === tt.name) {
	            token.type = Token.Identifier;

	            // TODO: See if this is an Acorn bug
	            if (token.value === "static") {
	                token.type = Token.Keyword;
	            }

	            if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) {
	                token.type = Token.Keyword;
	            }

	        } else if (type === tt.privateId) {
	            token.type = Token.PrivateIdentifier;

	        } else if (type === tt.semi || type === tt.comma ||
	                 type === tt.parenL || type === tt.parenR ||
	                 type === tt.braceL || type === tt.braceR ||
	                 type === tt.dot || type === tt.bracketL ||
	                 type === tt.colon || type === tt.question ||
	                 type === tt.bracketR || type === tt.ellipsis ||
	                 type === tt.arrow || type === tt.jsxTagStart ||
	                 type === tt.incDec || type === tt.starstar ||
	                 type === tt.jsxTagEnd || type === tt.prefix ||
	                 type === tt.questionDot ||
	                 (type.binop && !type.keyword) ||
	                 type.isAssign) {

	            token.type = Token.Punctuator;
	            token.value = this._code.slice(token.start, token.end);
	        } else if (type === tt.jsxName) {
	            token.type = Token.JSXIdentifier;
	        } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
	            token.type = Token.JSXText;
	        } else if (type.keyword) {
	            if (type.keyword === "true" || type.keyword === "false") {
	                token.type = Token.Boolean;
	            } else if (type.keyword === "null") {
	                token.type = Token.Null;
	            } else {
	                token.type = Token.Keyword;
	            }
	        } else if (type === tt.num) {
	            token.type = Token.Numeric;
	            token.value = this._code.slice(token.start, token.end);
	        } else if (type === tt.string) {

	            if (extra.jsxAttrValueToken) {
	                extra.jsxAttrValueToken = false;
	                token.type = Token.JSXText;
	            } else {
	                token.type = Token.String;
	            }

	            token.value = this._code.slice(token.start, token.end);
	        } else if (type === tt.regexp) {
	            token.type = Token.RegularExpression;
	            const value = token.value;

	            token.regex = {
	                flags: value.flags,
	                pattern: value.pattern
	            };
	            token.value = `/${value.pattern}/${value.flags}`;
	        }

	        return token;
	    },

	    /**
	     * Function to call during Acorn's onToken handler.
	     * @param {AcornToken} token The Acorn token.
	     * @param {Object} extra The Espree extra object.
	     * @returns {void}
	     */
	    onToken(token, extra) {

	        const tt = this._acornTokTypes,
	            tokens = extra.tokens,
	            templateTokens = this._tokens;

	        /**
	         * Flushes the buffered template tokens and resets the template
	         * tracking.
	         * @returns {void}
	         * @private
	         */
	        const translateTemplateTokens = () => {
	            tokens.push(convertTemplatePart(this._tokens, this._code));
	            this._tokens = [];
	        };

	        if (token.type === tt.eof) {

	            // might be one last curlyBrace
	            if (this._curlyBrace) {
	                tokens.push(this.translate(this._curlyBrace, extra));
	            }

	            return;
	        }

	        if (token.type === tt.backQuote) {

	            // if there's already a curly, it's not part of the template
	            if (this._curlyBrace) {
	                tokens.push(this.translate(this._curlyBrace, extra));
	                this._curlyBrace = null;
	            }

	            templateTokens.push(token);

	            // it's the end
	            if (templateTokens.length > 1) {
	                translateTemplateTokens();
	            }

	            return;
	        }
	        if (token.type === tt.dollarBraceL) {
	            templateTokens.push(token);
	            translateTemplateTokens();
	            return;
	        }
	        if (token.type === tt.braceR) {

	            // if there's already a curly, it's not part of the template
	            if (this._curlyBrace) {
	                tokens.push(this.translate(this._curlyBrace, extra));
	            }

	            // store new curly for later
	            this._curlyBrace = token;
	            return;
	        }
	        if (token.type === tt.template || token.type === tt.invalidTemplate) {
	            if (this._curlyBrace) {
	                templateTokens.push(this._curlyBrace);
	                this._curlyBrace = null;
	            }

	            templateTokens.push(token);
	            return;
	        }

	        if (this._curlyBrace) {
	            tokens.push(this.translate(this._curlyBrace, extra));
	            this._curlyBrace = null;
	        }

	        tokens.push(this.translate(token, extra));
	    }
	};

	/**
	 * @fileoverview A collection of methods for processing Espree's options.
	 * @author Kai Cataldo
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SUPPORTED_VERSIONS = [
	    3,
	    5,
	    6, // 2015
	    7, // 2016
	    8, // 2017
	    9, // 2018
	    10, // 2019
	    11, // 2020
	    12, // 2021
	    13, // 2022
	    14, // 2023
	    15, // 2024
	    16 // 2025
	];

	/**
	 * Get the latest ECMAScript version supported by Espree.
	 * @returns {number} The latest ECMAScript version.
	 */
	function getLatestEcmaVersion() {
	    return SUPPORTED_VERSIONS.at(-1);
	}

	/**
	 * Get the list of ECMAScript versions supported by Espree.
	 * @returns {number[]} An array containing the supported ECMAScript versions.
	 */
	function getSupportedEcmaVersions() {
	    return [...SUPPORTED_VERSIONS];
	}

	/**
	 * Normalize ECMAScript version from the initial config
	 * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
	 * @throws {Error} throws an error if the ecmaVersion is invalid.
	 * @returns {number} normalized ECMAScript version
	 */
	function normalizeEcmaVersion(ecmaVersion = 5) {

	    let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;

	    if (typeof version !== "number") {
	        throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
	    }

	    // Calculate ECMAScript edition number from official year version starting with
	    // ES2015, which corresponds with ES6 (or a difference of 2009).
	    if (version >= 2015) {
	        version -= 2009;
	    }

	    if (!SUPPORTED_VERSIONS.includes(version)) {
	        throw new Error("Invalid ecmaVersion.");
	    }

	    return version;
	}

	/**
	 * Normalize sourceType from the initial config
	 * @param {string} sourceType to normalize
	 * @throws {Error} throw an error if sourceType is invalid
	 * @returns {string} normalized sourceType
	 */
	function normalizeSourceType(sourceType = "script") {
	    if (sourceType === "script" || sourceType === "module") {
	        return sourceType;
	    }

	    if (sourceType === "commonjs") {
	        return "script";
	    }

	    throw new Error("Invalid sourceType.");
	}

	/**
	 * Normalize parserOptions
	 * @param {Object} options the parser options to normalize
	 * @throws {Error} throw an error if found invalid option.
	 * @returns {Object} normalized options
	 */
	function normalizeOptions(options) {
	    const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
	    const sourceType = normalizeSourceType(options.sourceType);
	    const ranges = options.range === true;
	    const locations = options.loc === true;

	    if (ecmaVersion !== 3 && options.allowReserved) {

	        // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
	        throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
	    }
	    if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {
	        throw new Error("`allowReserved`, when present, must be `true` or `false`");
	    }
	    const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;
	    const ecmaFeatures = options.ecmaFeatures || {};
	    const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
	        Boolean(ecmaFeatures.globalReturn);

	    if (sourceType === "module" && ecmaVersion < 6) {
	        throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
	    }

	    return Object.assign({}, options, {
	        ecmaVersion,
	        sourceType,
	        ranges,
	        locations,
	        allowReserved,
	        allowReturnOutsideFunction
	    });
	}

	/* eslint no-param-reassign: 0 -- stylistic choice */


	const STATE = Symbol("espree's internal state");
	const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");


	/**
	 * Converts an Acorn comment to a Esprima comment.
	 * @param {boolean} block True if it's a block comment, false if not.
	 * @param {string} text The text of the comment.
	 * @param {int} start The index at which the comment starts.
	 * @param {int} end The index at which the comment ends.
	 * @param {Location} startLoc The location at which the comment starts.
	 * @param {Location} endLoc The location at which the comment ends.
	 * @param {string} code The source code being parsed.
	 * @returns {Object} The comment object.
	 * @private
	 */
	function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
	    let type;

	    if (block) {
	        type = "Block";
	    } else if (code.slice(start, start + 2) === "#!") {
	        type = "Hashbang";
	    } else {
	        type = "Line";
	    }

	    const comment = {
	        type,
	        value: text
	    };

	    if (typeof start === "number") {
	        comment.start = start;
	        comment.end = end;
	        comment.range = [start, end];
	    }

	    if (typeof startLoc === "object") {
	        comment.loc = {
	            start: startLoc,
	            end: endLoc
	        };
	    }

	    return comment;
	}

	var espree$1 = () => Parser => {
	    const tokTypes = Object.assign({}, Parser.acorn.tokTypes);

	    if (Parser.acornJsx) {
	        Object.assign(tokTypes, Parser.acornJsx.tokTypes);
	    }

	    return class Espree extends Parser {
	        constructor(opts, code) {
	            if (typeof opts !== "object" || opts === null) {
	                opts = {};
	            }
	            if (typeof code !== "string" && !(code instanceof String)) {
	                code = String(code);
	            }

	            // save original source type in case of commonjs
	            const originalSourceType = opts.sourceType;
	            const options = normalizeOptions(opts);
	            const ecmaFeatures = options.ecmaFeatures || {};
	            const tokenTranslator =
	                options.tokens === true
	                    ? new TokenTranslator(tokTypes, code)
	                    : null;

	            /*
	             * Data that is unique to Espree and is not represented internally
	             * in Acorn.
	             *
	             * For ES2023 hashbangs, Espree will call `onComment()` during the
	             * constructor, so we must define state before having access to
	             * `this`.
	             */
	            const state = {
	                originalSourceType: originalSourceType || options.sourceType,
	                tokens: tokenTranslator ? [] : null,
	                comments: options.comment === true ? [] : null,
	                impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5,
	                ecmaVersion: options.ecmaVersion,
	                jsxAttrValueToken: false,
	                lastToken: null,
	                templateElements: []
	            };

	            // Initialize acorn parser.
	            super({

	                // do not use spread, because we don't want to pass any unknown options to acorn
	                ecmaVersion: options.ecmaVersion,
	                sourceType: options.sourceType,
	                ranges: options.ranges,
	                locations: options.locations,
	                allowReserved: options.allowReserved,

	                // Truthy value is true for backward compatibility.
	                allowReturnOutsideFunction: options.allowReturnOutsideFunction,

	                // Collect tokens
	                onToken(token) {
	                    if (tokenTranslator) {

	                        // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
	                        tokenTranslator.onToken(token, state);
	                    }
	                    if (token.type !== tokTypes.eof) {
	                        state.lastToken = token;
	                    }
	                },

	                // Collect comments
	                onComment(block, text, start, end, startLoc, endLoc) {
	                    if (state.comments) {
	                        const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);

	                        state.comments.push(comment);
	                    }
	                }
	            }, code);

	            /*
	             * We put all of this data into a symbol property as a way to avoid
	             * potential naming conflicts with future versions of Acorn.
	             */
	            this[STATE] = state;
	        }

	        tokenize() {
	            do {
	                this.next();
	            } while (this.type !== tokTypes.eof);

	            // Consume the final eof token
	            this.next();

	            const extra = this[STATE];
	            const tokens = extra.tokens;

	            if (extra.comments) {
	                tokens.comments = extra.comments;
	            }

	            return tokens;
	        }

	        finishNode(...args) {
	            const result = super.finishNode(...args);

	            return this[ESPRIMA_FINISH_NODE](result);
	        }

	        finishNodeAt(...args) {
	            const result = super.finishNodeAt(...args);

	            return this[ESPRIMA_FINISH_NODE](result);
	        }

	        parse() {
	            const extra = this[STATE];
	            const program = super.parse();

	            program.sourceType = extra.originalSourceType;

	            if (extra.comments) {
	                program.comments = extra.comments;
	            }
	            if (extra.tokens) {
	                program.tokens = extra.tokens;
	            }

	            /*
	             * Adjust opening and closing position of program to match Esprima.
	             * Acorn always starts programs at range 0 whereas Esprima starts at the
	             * first AST node's start (the only real difference is when there's leading
	             * whitespace or leading comments). Acorn also counts trailing whitespace
	             * as part of the program whereas Esprima only counts up to the last token.
	             */
	            if (program.body.length) {
	                const [firstNode] = program.body;

	                if (program.range) {
	                    program.range[0] = firstNode.range[0];
	                }
	                if (program.loc) {
	                    program.loc.start = firstNode.loc.start;
	                }
	                program.start = firstNode.start;
	            }
	            if (extra.lastToken) {
	                if (program.range) {
	                    program.range[1] = extra.lastToken.range[1];
	                }
	                if (program.loc) {
	                    program.loc.end = extra.lastToken.loc.end;
	                }
	                program.end = extra.lastToken.end;
	            }


	            /*
	             * https://github.com/eslint/espree/issues/349
	             * Ensure that template elements have correct range information.
	             * This is one location where Acorn produces a different value
	             * for its start and end properties vs. the values present in the
	             * range property. In order to avoid confusion, we set the start
	             * and end properties to the values that are present in range.
	             * This is done here, instead of in finishNode(), because Acorn
	             * uses the values of start and end internally while parsing, making
	             * it dangerous to change those values while parsing is ongoing.
	             * By waiting until the end of parsing, we can safely change these
	             * values without affect any other part of the process.
	             */
	            this[STATE].templateElements.forEach(templateElement => {
	                const startOffset = -1;
	                const endOffset = templateElement.tail ? 1 : 2;

	                templateElement.start += startOffset;
	                templateElement.end += endOffset;

	                if (templateElement.range) {
	                    templateElement.range[0] += startOffset;
	                    templateElement.range[1] += endOffset;
	                }

	                if (templateElement.loc) {
	                    templateElement.loc.start.column += startOffset;
	                    templateElement.loc.end.column += endOffset;
	                }
	            });

	            return program;
	        }

	        parseTopLevel(node) {
	            if (this[STATE].impliedStrict) {
	                this.strict = true;
	            }
	            return super.parseTopLevel(node);
	        }

	        /**
	         * Overwrites the default raise method to throw Esprima-style errors.
	         * @param {int} pos The position of the error.
	         * @param {string} message The error message.
	         * @throws {SyntaxError} A syntax error.
	         * @returns {void}
	         */
	        raise(pos, message) {
	            const loc = Parser.acorn.getLineInfo(this.input, pos);
	            const err = new SyntaxError(message);

	            err.index = pos;
	            err.lineNumber = loc.line;
	            err.column = loc.column + 1; // acorn uses 0-based columns
	            throw err;
	        }

	        /**
	         * Overwrites the default raise method to throw Esprima-style errors.
	         * @param {int} pos The position of the error.
	         * @param {string} message The error message.
	         * @throws {SyntaxError} A syntax error.
	         * @returns {void}
	         */
	        raiseRecoverable(pos, message) {
	            this.raise(pos, message);
	        }

	        /**
	         * Overwrites the default unexpected method to throw Esprima-style errors.
	         * @param {int} pos The position of the error.
	         * @throws {SyntaxError} A syntax error.
	         * @returns {void}
	         */
	        unexpected(pos) {
	            let message = "Unexpected token";

	            if (pos !== null && pos !== void 0) {
	                this.pos = pos;

	                if (this.options.locations) {
	                    while (this.pos < this.lineStart) {
	                        this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1;
	                        --this.curLine;
	                    }
	                }

	                this.nextToken();
	            }

	            if (this.end > this.start) {
	                message += ` ${this.input.slice(this.start, this.end)}`;
	            }

	            this.raise(this.start, message);
	        }

	        /*
	        * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
	        * uses regular tt.string without any distinction between this and regular JS
	        * strings. As such, we intercept an attempt to read a JSX string and set a flag
	        * on extra so that when tokens are converted, the next token will be switched
	        * to JSXText via onToken.
	        */
	        jsx_readString(quote) { // eslint-disable-line camelcase -- required by API
	            const result = super.jsx_readString(quote);

	            if (this.type === tokTypes.string) {
	                this[STATE].jsxAttrValueToken = true;
	            }
	            return result;
	        }

	        /**
	         * Performs last-minute Esprima-specific compatibility checks and fixes.
	         * @param {ASTNode} result The node to check.
	         * @returns {ASTNode} The finished node.
	         */
	        [ESPRIMA_FINISH_NODE](result) {

	            // Acorn doesn't count the opening and closing backticks as part of templates
	            // so we have to adjust ranges/locations appropriately.
	            if (result.type === "TemplateElement") {

	                // save template element references to fix start/end later
	                this[STATE].templateElements.push(result);
	            }

	            if (result.type.includes("Function") && !result.generator) {
	                result.generator = false;
	            }

	            return result;
	        }
	    };
	};

	const version$1 = "10.3.0";

	/**
	 * @fileoverview Main Espree file that converts Acorn into Esprima output.
	 *
	 * This file contains code from the following MIT-licensed projects:
	 * 1. Acorn
	 * 2. Babylon
	 * 3. Babel-ESLint
	 *
	 * This file also contains code from Esprima, which is BSD licensed.
	 *
	 * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
	 * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
	 * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
	 *
	 * Redistribution and use in source and binary forms, with or without
	 * modification, are permitted provided that the following conditions are met:
	 *
	 * * Redistributions of source code must retain the above copyright
	 *   notice, this list of conditions and the following disclaimer.
	 * * Redistributions in binary form must reproduce the above copyright
	 *   notice, this list of conditions and the following disclaimer in the
	 *   documentation and/or other materials provided with the distribution.
	 *
	 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	 *
	 * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
	 *
	 * Redistribution and use in source and binary forms, with or without
	 * modification, are permitted provided that the following conditions are met:
	 *
	 *   * Redistributions of source code must retain the above copyright
	 *     notice, this list of conditions and the following disclaimer.
	 *   * Redistributions in binary form must reproduce the above copyright
	 *     notice, this list of conditions and the following disclaimer in the
	 *     documentation and/or other materials provided with the distribution.
	 *
	 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
	 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
	 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	 */


	// To initialize lazily.
	const parsers = {
	    _regular: null,
	    _jsx: null,

	    get regular() {
	        if (this._regular === null) {
	            this._regular = acorn__namespace.Parser.extend(espree$1());
	        }
	        return this._regular;
	    },

	    get jsx() {
	        if (this._jsx === null) {
	            this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree$1());
	        }
	        return this._jsx;
	    },

	    get(options) {
	        const useJsx = Boolean(
	            options &&
	            options.ecmaFeatures &&
	            options.ecmaFeatures.jsx
	        );

	        return useJsx ? this.jsx : this.regular;
	    }
	};

	//------------------------------------------------------------------------------
	// Tokenizer
	//------------------------------------------------------------------------------

	/**
	 * Tokenizes the given code.
	 * @param {string} code The code to tokenize.
	 * @param {Object} options Options defining how to tokenize.
	 * @returns {Token[]} An array of tokens.
	 * @throws {SyntaxError} If the input code is invalid.
	 * @private
	 */
	function tokenize(code, options) {
	    const Parser = parsers.get(options);

	    // Ensure to collect tokens.
	    if (!options || options.tokens !== true) {
	        options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
	    }

	    return new Parser(options, code).tokenize();
	}

	//------------------------------------------------------------------------------
	// Parser
	//------------------------------------------------------------------------------

	/**
	 * Parses the given code.
	 * @param {string} code The code to tokenize.
	 * @param {Object} options Options defining how to tokenize.
	 * @returns {ASTNode} The "Program" AST node.
	 * @throws {SyntaxError} If the input code is invalid.
	 */
	function parse(code, options) {
	    const Parser = parsers.get(options);

	    return new Parser(options, code).parse();
	}

	//------------------------------------------------------------------------------
	// Public
	//------------------------------------------------------------------------------

	const version = version$1;
	const name = "espree";

	/* istanbul ignore next */
	const VisitorKeys = (function() {
	    return visitorKeys__namespace.KEYS;
	}());

	// Derive node types from VisitorKeys
	/* istanbul ignore next */
	const Syntax = (function() {
	    let key,
	        types = {};

	    if (typeof Object.create === "function") {
	        types = Object.create(null);
	    }

	    for (key in VisitorKeys) {
	        if (Object.hasOwn(VisitorKeys, key)) {
	            types[key] = key;
	        }
	    }

	    if (typeof Object.freeze === "function") {
	        Object.freeze(types);
	    }

	    return types;
	}());

	const latestEcmaVersion = getLatestEcmaVersion();

	const supportedEcmaVersions = getSupportedEcmaVersions();

	espree.Syntax = Syntax;
	espree.VisitorKeys = VisitorKeys;
	espree.latestEcmaVersion = latestEcmaVersion;
	espree.name = name;
	espree.parse = parse;
	espree.supportedEcmaVersions = supportedEcmaVersions;
	espree.tokenize = tokenize;
	espree.version = version;
	return espree;
}

var lodash_merge = {exports: {}};

lodash_merge.exports;

var hasRequiredLodash_merge;

function requireLodash_merge () {
	if (hasRequiredLodash_merge) return lodash_merge.exports;
	hasRequiredLodash_merge = 1;
	(function (module, exports) {
		/** Used as the size to enable large array optimizations. */
		var LARGE_ARRAY_SIZE = 200;

		/** Used to stand-in for `undefined` hash values. */
		var HASH_UNDEFINED = '__lodash_hash_undefined__';

		/** Used to detect hot functions by number of calls within a span of milliseconds. */
		var HOT_COUNT = 800,
		    HOT_SPAN = 16;

		/** Used as references for various `Number` constants. */
		var MAX_SAFE_INTEGER = 9007199254740991;

		/** `Object#toString` result references. */
		var argsTag = '[object Arguments]',
		    arrayTag = '[object Array]',
		    asyncTag = '[object AsyncFunction]',
		    boolTag = '[object Boolean]',
		    dateTag = '[object Date]',
		    errorTag = '[object Error]',
		    funcTag = '[object Function]',
		    genTag = '[object GeneratorFunction]',
		    mapTag = '[object Map]',
		    numberTag = '[object Number]',
		    nullTag = '[object Null]',
		    objectTag = '[object Object]',
		    proxyTag = '[object Proxy]',
		    regexpTag = '[object RegExp]',
		    setTag = '[object Set]',
		    stringTag = '[object String]',
		    undefinedTag = '[object Undefined]',
		    weakMapTag = '[object WeakMap]';

		var arrayBufferTag = '[object ArrayBuffer]',
		    dataViewTag = '[object DataView]',
		    float32Tag = '[object Float32Array]',
		    float64Tag = '[object Float64Array]',
		    int8Tag = '[object Int8Array]',
		    int16Tag = '[object Int16Array]',
		    int32Tag = '[object Int32Array]',
		    uint8Tag = '[object Uint8Array]',
		    uint8ClampedTag = '[object Uint8ClampedArray]',
		    uint16Tag = '[object Uint16Array]',
		    uint32Tag = '[object Uint32Array]';

		/**
		 * Used to match `RegExp`
		 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
		 */
		var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

		/** Used to detect host constructors (Safari). */
		var reIsHostCtor = /^\[object .+?Constructor\]$/;

		/** Used to detect unsigned integer values. */
		var reIsUint = /^(?:0|[1-9]\d*)$/;

		/** Used to identify `toStringTag` values of typed arrays. */
		var typedArrayTags = {};
		typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
		typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
		typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
		typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
		typedArrayTags[uint32Tag] = true;
		typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
		typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
		typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
		typedArrayTags[errorTag] = typedArrayTags[funcTag] =
		typedArrayTags[mapTag] = typedArrayTags[numberTag] =
		typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
		typedArrayTags[setTag] = typedArrayTags[stringTag] =
		typedArrayTags[weakMapTag] = false;

		/** Detect free variable `global` from Node.js. */
		var freeGlobal = typeof global$1 == 'object' && global$1 && global$1.Object === Object && global$1;

		/** Detect free variable `self`. */
		var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

		/** Used as a reference to the global object. */
		var root = freeGlobal || freeSelf || Function('return this')();

		/** Detect free variable `exports`. */
		var freeExports = exports && !exports.nodeType && exports;

		/** Detect free variable `module`. */
		var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;

		/** Detect the popular CommonJS extension `module.exports`. */
		var moduleExports = freeModule && freeModule.exports === freeExports;

		/** Detect free variable `process` from Node.js. */
		var freeProcess = moduleExports && freeGlobal.process;

		/** Used to access faster Node.js helpers. */
		var nodeUtil = (function() {
		  try {
		    // Use `util.types` for Node.js 10+.
		    var types = freeModule && freeModule.require && freeModule.require('util').types;

		    if (types) {
		      return types;
		    }

		    // Legacy `process.binding('util')` for Node.js < 10.
		    return freeProcess && freeProcess.binding && freeProcess.binding('util');
		  } catch (e) {}
		}());

		/* Node.js helper references. */
		var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

		/**
		 * A faster alternative to `Function#apply`, this function invokes `func`
		 * with the `this` binding of `thisArg` and the arguments of `args`.
		 *
		 * @private
		 * @param {Function} func The function to invoke.
		 * @param {*} thisArg The `this` binding of `func`.
		 * @param {Array} args The arguments to invoke `func` with.
		 * @returns {*} Returns the result of `func`.
		 */
		function apply(func, thisArg, args) {
		  switch (args.length) {
		    case 0: return func.call(thisArg);
		    case 1: return func.call(thisArg, args[0]);
		    case 2: return func.call(thisArg, args[0], args[1]);
		    case 3: return func.call(thisArg, args[0], args[1], args[2]);
		  }
		  return func.apply(thisArg, args);
		}

		/**
		 * The base implementation of `_.times` without support for iteratee shorthands
		 * or max array length checks.
		 *
		 * @private
		 * @param {number} n The number of times to invoke `iteratee`.
		 * @param {Function} iteratee The function invoked per iteration.
		 * @returns {Array} Returns the array of results.
		 */
		function baseTimes(n, iteratee) {
		  var index = -1,
		      result = Array(n);

		  while (++index < n) {
		    result[index] = iteratee(index);
		  }
		  return result;
		}

		/**
		 * The base implementation of `_.unary` without support for storing metadata.
		 *
		 * @private
		 * @param {Function} func The function to cap arguments for.
		 * @returns {Function} Returns the new capped function.
		 */
		function baseUnary(func) {
		  return function(value) {
		    return func(value);
		  };
		}

		/**
		 * Gets the value at `key` of `object`.
		 *
		 * @private
		 * @param {Object} [object] The object to query.
		 * @param {string} key The key of the property to get.
		 * @returns {*} Returns the property value.
		 */
		function getValue(object, key) {
		  return object == null ? undefined : object[key];
		}

		/**
		 * Creates a unary function that invokes `func` with its argument transformed.
		 *
		 * @private
		 * @param {Function} func The function to wrap.
		 * @param {Function} transform The argument transform.
		 * @returns {Function} Returns the new function.
		 */
		function overArg(func, transform) {
		  return function(arg) {
		    return func(transform(arg));
		  };
		}

		/** Used for built-in method references. */
		var arrayProto = Array.prototype,
		    funcProto = Function.prototype,
		    objectProto = Object.prototype;

		/** Used to detect overreaching core-js shims. */
		var coreJsData = root['__core-js_shared__'];

		/** Used to resolve the decompiled source of functions. */
		var funcToString = funcProto.toString;

		/** Used to check objects for own properties. */
		var hasOwnProperty = objectProto.hasOwnProperty;

		/** Used to detect methods masquerading as native. */
		var maskSrcKey = (function() {
		  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
		  return uid ? ('Symbol(src)_1.' + uid) : '';
		}());

		/**
		 * Used to resolve the
		 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
		 * of values.
		 */
		var nativeObjectToString = objectProto.toString;

		/** Used to infer the `Object` constructor. */
		var objectCtorString = funcToString.call(Object);

		/** Used to detect if a method is native. */
		var reIsNative = RegExp('^' +
		  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
		  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
		);

		/** Built-in value references. */
		var Buffer = moduleExports ? root.Buffer : undefined,
		    Symbol = root.Symbol,
		    Uint8Array = root.Uint8Array;
		    Buffer ? Buffer.allocUnsafe : undefined;
		    var getPrototype = overArg(Object.getPrototypeOf, Object),
		    objectCreate = Object.create,
		    propertyIsEnumerable = objectProto.propertyIsEnumerable,
		    splice = arrayProto.splice,
		    symToStringTag = Symbol ? Symbol.toStringTag : undefined;

		var defineProperty = (function() {
		  try {
		    var func = getNative(Object, 'defineProperty');
		    func({}, '', {});
		    return func;
		  } catch (e) {}
		}());

		/* Built-in method references for those with the same name as other `lodash` methods. */
		var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
		    nativeMax = Math.max,
		    nativeNow = Date.now;

		/* Built-in method references that are verified to be native. */
		var Map = getNative(root, 'Map'),
		    nativeCreate = getNative(Object, 'create');

		/**
		 * The base implementation of `_.create` without support for assigning
		 * properties to the created object.
		 *
		 * @private
		 * @param {Object} proto The object to inherit from.
		 * @returns {Object} Returns the new object.
		 */
		var baseCreate = (function() {
		  function object() {}
		  return function(proto) {
		    if (!isObject(proto)) {
		      return {};
		    }
		    if (objectCreate) {
		      return objectCreate(proto);
		    }
		    object.prototype = proto;
		    var result = new object;
		    object.prototype = undefined;
		    return result;
		  };
		}());

		/**
		 * Creates a hash object.
		 *
		 * @private
		 * @constructor
		 * @param {Array} [entries] The key-value pairs to cache.
		 */
		function Hash(entries) {
		  var index = -1,
		      length = entries == null ? 0 : entries.length;

		  this.clear();
		  while (++index < length) {
		    var entry = entries[index];
		    this.set(entry[0], entry[1]);
		  }
		}

		/**
		 * Removes all key-value entries from the hash.
		 *
		 * @private
		 * @name clear
		 * @memberOf Hash
		 */
		function hashClear() {
		  this.__data__ = nativeCreate ? nativeCreate(null) : {};
		  this.size = 0;
		}

		/**
		 * Removes `key` and its value from the hash.
		 *
		 * @private
		 * @name delete
		 * @memberOf Hash
		 * @param {Object} hash The hash to modify.
		 * @param {string} key The key of the value to remove.
		 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
		 */
		function hashDelete(key) {
		  var result = this.has(key) && delete this.__data__[key];
		  this.size -= result ? 1 : 0;
		  return result;
		}

		/**
		 * Gets the hash value for `key`.
		 *
		 * @private
		 * @name get
		 * @memberOf Hash
		 * @param {string} key The key of the value to get.
		 * @returns {*} Returns the entry value.
		 */
		function hashGet(key) {
		  var data = this.__data__;
		  if (nativeCreate) {
		    var result = data[key];
		    return result === HASH_UNDEFINED ? undefined : result;
		  }
		  return hasOwnProperty.call(data, key) ? data[key] : undefined;
		}

		/**
		 * Checks if a hash value for `key` exists.
		 *
		 * @private
		 * @name has
		 * @memberOf Hash
		 * @param {string} key The key of the entry to check.
		 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		 */
		function hashHas(key) {
		  var data = this.__data__;
		  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
		}

		/**
		 * Sets the hash `key` to `value`.
		 *
		 * @private
		 * @name set
		 * @memberOf Hash
		 * @param {string} key The key of the value to set.
		 * @param {*} value The value to set.
		 * @returns {Object} Returns the hash instance.
		 */
		function hashSet(key, value) {
		  var data = this.__data__;
		  this.size += this.has(key) ? 0 : 1;
		  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
		  return this;
		}

		// Add methods to `Hash`.
		Hash.prototype.clear = hashClear;
		Hash.prototype['delete'] = hashDelete;
		Hash.prototype.get = hashGet;
		Hash.prototype.has = hashHas;
		Hash.prototype.set = hashSet;

		/**
		 * Creates an list cache object.
		 *
		 * @private
		 * @constructor
		 * @param {Array} [entries] The key-value pairs to cache.
		 */
		function ListCache(entries) {
		  var index = -1,
		      length = entries == null ? 0 : entries.length;

		  this.clear();
		  while (++index < length) {
		    var entry = entries[index];
		    this.set(entry[0], entry[1]);
		  }
		}

		/**
		 * Removes all key-value entries from the list cache.
		 *
		 * @private
		 * @name clear
		 * @memberOf ListCache
		 */
		function listCacheClear() {
		  this.__data__ = [];
		  this.size = 0;
		}

		/**
		 * Removes `key` and its value from the list cache.
		 *
		 * @private
		 * @name delete
		 * @memberOf ListCache
		 * @param {string} key The key of the value to remove.
		 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
		 */
		function listCacheDelete(key) {
		  var data = this.__data__,
		      index = assocIndexOf(data, key);

		  if (index < 0) {
		    return false;
		  }
		  var lastIndex = data.length - 1;
		  if (index == lastIndex) {
		    data.pop();
		  } else {
		    splice.call(data, index, 1);
		  }
		  --this.size;
		  return true;
		}

		/**
		 * Gets the list cache value for `key`.
		 *
		 * @private
		 * @name get
		 * @memberOf ListCache
		 * @param {string} key The key of the value to get.
		 * @returns {*} Returns the entry value.
		 */
		function listCacheGet(key) {
		  var data = this.__data__,
		      index = assocIndexOf(data, key);

		  return index < 0 ? undefined : data[index][1];
		}

		/**
		 * Checks if a list cache value for `key` exists.
		 *
		 * @private
		 * @name has
		 * @memberOf ListCache
		 * @param {string} key The key of the entry to check.
		 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		 */
		function listCacheHas(key) {
		  return assocIndexOf(this.__data__, key) > -1;
		}

		/**
		 * Sets the list cache `key` to `value`.
		 *
		 * @private
		 * @name set
		 * @memberOf ListCache
		 * @param {string} key The key of the value to set.
		 * @param {*} value The value to set.
		 * @returns {Object} Returns the list cache instance.
		 */
		function listCacheSet(key, value) {
		  var data = this.__data__,
		      index = assocIndexOf(data, key);

		  if (index < 0) {
		    ++this.size;
		    data.push([key, value]);
		  } else {
		    data[index][1] = value;
		  }
		  return this;
		}

		// Add methods to `ListCache`.
		ListCache.prototype.clear = listCacheClear;
		ListCache.prototype['delete'] = listCacheDelete;
		ListCache.prototype.get = listCacheGet;
		ListCache.prototype.has = listCacheHas;
		ListCache.prototype.set = listCacheSet;

		/**
		 * Creates a map cache object to store key-value pairs.
		 *
		 * @private
		 * @constructor
		 * @param {Array} [entries] The key-value pairs to cache.
		 */
		function MapCache(entries) {
		  var index = -1,
		      length = entries == null ? 0 : entries.length;

		  this.clear();
		  while (++index < length) {
		    var entry = entries[index];
		    this.set(entry[0], entry[1]);
		  }
		}

		/**
		 * Removes all key-value entries from the map.
		 *
		 * @private
		 * @name clear
		 * @memberOf MapCache
		 */
		function mapCacheClear() {
		  this.size = 0;
		  this.__data__ = {
		    'hash': new Hash,
		    'map': new (Map || ListCache),
		    'string': new Hash
		  };
		}

		/**
		 * Removes `key` and its value from the map.
		 *
		 * @private
		 * @name delete
		 * @memberOf MapCache
		 * @param {string} key The key of the value to remove.
		 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
		 */
		function mapCacheDelete(key) {
		  var result = getMapData(this, key)['delete'](key);
		  this.size -= result ? 1 : 0;
		  return result;
		}

		/**
		 * Gets the map value for `key`.
		 *
		 * @private
		 * @name get
		 * @memberOf MapCache
		 * @param {string} key The key of the value to get.
		 * @returns {*} Returns the entry value.
		 */
		function mapCacheGet(key) {
		  return getMapData(this, key).get(key);
		}

		/**
		 * Checks if a map value for `key` exists.
		 *
		 * @private
		 * @name has
		 * @memberOf MapCache
		 * @param {string} key The key of the entry to check.
		 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		 */
		function mapCacheHas(key) {
		  return getMapData(this, key).has(key);
		}

		/**
		 * Sets the map `key` to `value`.
		 *
		 * @private
		 * @name set
		 * @memberOf MapCache
		 * @param {string} key The key of the value to set.
		 * @param {*} value The value to set.
		 * @returns {Object} Returns the map cache instance.
		 */
		function mapCacheSet(key, value) {
		  var data = getMapData(this, key),
		      size = data.size;

		  data.set(key, value);
		  this.size += data.size == size ? 0 : 1;
		  return this;
		}

		// Add methods to `MapCache`.
		MapCache.prototype.clear = mapCacheClear;
		MapCache.prototype['delete'] = mapCacheDelete;
		MapCache.prototype.get = mapCacheGet;
		MapCache.prototype.has = mapCacheHas;
		MapCache.prototype.set = mapCacheSet;

		/**
		 * Creates a stack cache object to store key-value pairs.
		 *
		 * @private
		 * @constructor
		 * @param {Array} [entries] The key-value pairs to cache.
		 */
		function Stack(entries) {
		  var data = this.__data__ = new ListCache(entries);
		  this.size = data.size;
		}

		/**
		 * Removes all key-value entries from the stack.
		 *
		 * @private
		 * @name clear
		 * @memberOf Stack
		 */
		function stackClear() {
		  this.__data__ = new ListCache;
		  this.size = 0;
		}

		/**
		 * Removes `key` and its value from the stack.
		 *
		 * @private
		 * @name delete
		 * @memberOf Stack
		 * @param {string} key The key of the value to remove.
		 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
		 */
		function stackDelete(key) {
		  var data = this.__data__,
		      result = data['delete'](key);

		  this.size = data.size;
		  return result;
		}

		/**
		 * Gets the stack value for `key`.
		 *
		 * @private
		 * @name get
		 * @memberOf Stack
		 * @param {string} key The key of the value to get.
		 * @returns {*} Returns the entry value.
		 */
		function stackGet(key) {
		  return this.__data__.get(key);
		}

		/**
		 * Checks if a stack value for `key` exists.
		 *
		 * @private
		 * @name has
		 * @memberOf Stack
		 * @param {string} key The key of the entry to check.
		 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		 */
		function stackHas(key) {
		  return this.__data__.has(key);
		}

		/**
		 * Sets the stack `key` to `value`.
		 *
		 * @private
		 * @name set
		 * @memberOf Stack
		 * @param {string} key The key of the value to set.
		 * @param {*} value The value to set.
		 * @returns {Object} Returns the stack cache instance.
		 */
		function stackSet(key, value) {
		  var data = this.__data__;
		  if (data instanceof ListCache) {
		    var pairs = data.__data__;
		    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
		      pairs.push([key, value]);
		      this.size = ++data.size;
		      return this;
		    }
		    data = this.__data__ = new MapCache(pairs);
		  }
		  data.set(key, value);
		  this.size = data.size;
		  return this;
		}

		// Add methods to `Stack`.
		Stack.prototype.clear = stackClear;
		Stack.prototype['delete'] = stackDelete;
		Stack.prototype.get = stackGet;
		Stack.prototype.has = stackHas;
		Stack.prototype.set = stackSet;

		/**
		 * Creates an array of the enumerable property names of the array-like `value`.
		 *
		 * @private
		 * @param {*} value The value to query.
		 * @param {boolean} inherited Specify returning inherited property names.
		 * @returns {Array} Returns the array of property names.
		 */
		function arrayLikeKeys(value, inherited) {
		  var isArr = isArray(value),
		      isArg = !isArr && isArguments(value),
		      isBuff = !isArr && !isArg && isBuffer(value),
		      isType = !isArr && !isArg && !isBuff && isTypedArray(value),
		      skipIndexes = isArr || isArg || isBuff || isType,
		      result = skipIndexes ? baseTimes(value.length, String) : [],
		      length = result.length;

		  for (var key in value) {
		    if (!(skipIndexes && (
		           // Safari 9 has enumerable `arguments.length` in strict mode.
		           key == 'length' ||
		           // Node.js 0.10 has enumerable non-index properties on buffers.
		           (isBuff && (key == 'offset' || key == 'parent')) ||
		           // PhantomJS 2 has enumerable non-index properties on typed arrays.
		           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
		           // Skip index properties.
		           isIndex(key, length)
		        ))) {
		      result.push(key);
		    }
		  }
		  return result;
		}

		/**
		 * This function is like `assignValue` except that it doesn't assign
		 * `undefined` values.
		 *
		 * @private
		 * @param {Object} object The object to modify.
		 * @param {string} key The key of the property to assign.
		 * @param {*} value The value to assign.
		 */
		function assignMergeValue(object, key, value) {
		  if ((value !== undefined && !eq(object[key], value)) ||
		      (value === undefined && !(key in object))) {
		    baseAssignValue(object, key, value);
		  }
		}

		/**
		 * Assigns `value` to `key` of `object` if the existing value is not equivalent
		 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
		 * for equality comparisons.
		 *
		 * @private
		 * @param {Object} object The object to modify.
		 * @param {string} key The key of the property to assign.
		 * @param {*} value The value to assign.
		 */
		function assignValue(object, key, value) {
		  var objValue = object[key];
		  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
		      (value === undefined && !(key in object))) {
		    baseAssignValue(object, key, value);
		  }
		}

		/**
		 * Gets the index at which the `key` is found in `array` of key-value pairs.
		 *
		 * @private
		 * @param {Array} array The array to inspect.
		 * @param {*} key The key to search for.
		 * @returns {number} Returns the index of the matched value, else `-1`.
		 */
		function assocIndexOf(array, key) {
		  var length = array.length;
		  while (length--) {
		    if (eq(array[length][0], key)) {
		      return length;
		    }
		  }
		  return -1;
		}

		/**
		 * The base implementation of `assignValue` and `assignMergeValue` without
		 * value checks.
		 *
		 * @private
		 * @param {Object} object The object to modify.
		 * @param {string} key The key of the property to assign.
		 * @param {*} value The value to assign.
		 */
		function baseAssignValue(object, key, value) {
		  if (key == '__proto__' && defineProperty) {
		    defineProperty(object, key, {
		      'configurable': true,
		      'enumerable': true,
		      'value': value,
		      'writable': true
		    });
		  } else {
		    object[key] = value;
		  }
		}

		/**
		 * The base implementation of `baseForOwn` which iterates over `object`
		 * properties returned by `keysFunc` and invokes `iteratee` for each property.
		 * Iteratee functions may exit iteration early by explicitly returning `false`.
		 *
		 * @private
		 * @param {Object} object The object to iterate over.
		 * @param {Function} iteratee The function invoked per iteration.
		 * @param {Function} keysFunc The function to get the keys of `object`.
		 * @returns {Object} Returns `object`.
		 */
		var baseFor = createBaseFor();

		/**
		 * The base implementation of `getTag` without fallbacks for buggy environments.
		 *
		 * @private
		 * @param {*} value The value to query.
		 * @returns {string} Returns the `toStringTag`.
		 */
		function baseGetTag(value) {
		  if (value == null) {
		    return value === undefined ? undefinedTag : nullTag;
		  }
		  return (symToStringTag && symToStringTag in Object(value))
		    ? getRawTag(value)
		    : objectToString(value);
		}

		/**
		 * The base implementation of `_.isArguments`.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
		 */
		function baseIsArguments(value) {
		  return isObjectLike(value) && baseGetTag(value) == argsTag;
		}

		/**
		 * The base implementation of `_.isNative` without bad shim checks.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a native function,
		 *  else `false`.
		 */
		function baseIsNative(value) {
		  if (!isObject(value) || isMasked(value)) {
		    return false;
		  }
		  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
		  return pattern.test(toSource(value));
		}

		/**
		 * The base implementation of `_.isTypedArray` without Node.js optimizations.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
		 */
		function baseIsTypedArray(value) {
		  return isObjectLike(value) &&
		    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
		}

		/**
		 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
		 *
		 * @private
		 * @param {Object} object The object to query.
		 * @returns {Array} Returns the array of property names.
		 */
		function baseKeysIn(object) {
		  if (!isObject(object)) {
		    return nativeKeysIn(object);
		  }
		  var isProto = isPrototype(object),
		      result = [];

		  for (var key in object) {
		    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
		      result.push(key);
		    }
		  }
		  return result;
		}

		/**
		 * The base implementation of `_.merge` without support for multiple sources.
		 *
		 * @private
		 * @param {Object} object The destination object.
		 * @param {Object} source The source object.
		 * @param {number} srcIndex The index of `source`.
		 * @param {Function} [customizer] The function to customize merged values.
		 * @param {Object} [stack] Tracks traversed source values and their merged
		 *  counterparts.
		 */
		function baseMerge(object, source, srcIndex, customizer, stack) {
		  if (object === source) {
		    return;
		  }
		  baseFor(source, function(srcValue, key) {
		    stack || (stack = new Stack);
		    if (isObject(srcValue)) {
		      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
		    }
		    else {
		      var newValue = customizer
		        ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
		        : undefined;

		      if (newValue === undefined) {
		        newValue = srcValue;
		      }
		      assignMergeValue(object, key, newValue);
		    }
		  }, keysIn);
		}

		/**
		 * A specialized version of `baseMerge` for arrays and objects which performs
		 * deep merges and tracks traversed objects enabling objects with circular
		 * references to be merged.
		 *
		 * @private
		 * @param {Object} object The destination object.
		 * @param {Object} source The source object.
		 * @param {string} key The key of the value to merge.
		 * @param {number} srcIndex The index of `source`.
		 * @param {Function} mergeFunc The function to merge values.
		 * @param {Function} [customizer] The function to customize assigned values.
		 * @param {Object} [stack] Tracks traversed source values and their merged
		 *  counterparts.
		 */
		function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
		  var objValue = safeGet(object, key),
		      srcValue = safeGet(source, key),
		      stacked = stack.get(srcValue);

		  if (stacked) {
		    assignMergeValue(object, key, stacked);
		    return;
		  }
		  var newValue = customizer
		    ? customizer(objValue, srcValue, (key + ''), object, source, stack)
		    : undefined;

		  var isCommon = newValue === undefined;

		  if (isCommon) {
		    var isArr = isArray(srcValue),
		        isBuff = !isArr && isBuffer(srcValue),
		        isTyped = !isArr && !isBuff && isTypedArray(srcValue);

		    newValue = srcValue;
		    if (isArr || isBuff || isTyped) {
		      if (isArray(objValue)) {
		        newValue = objValue;
		      }
		      else if (isArrayLikeObject(objValue)) {
		        newValue = copyArray(objValue);
		      }
		      else if (isBuff) {
		        isCommon = false;
		        newValue = cloneBuffer(srcValue);
		      }
		      else if (isTyped) {
		        isCommon = false;
		        newValue = cloneTypedArray(srcValue);
		      }
		      else {
		        newValue = [];
		      }
		    }
		    else if (isPlainObject(srcValue) || isArguments(srcValue)) {
		      newValue = objValue;
		      if (isArguments(objValue)) {
		        newValue = toPlainObject(objValue);
		      }
		      else if (!isObject(objValue) || isFunction(objValue)) {
		        newValue = initCloneObject(srcValue);
		      }
		    }
		    else {
		      isCommon = false;
		    }
		  }
		  if (isCommon) {
		    // Recursively merge objects and arrays (susceptible to call stack limits).
		    stack.set(srcValue, newValue);
		    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
		    stack['delete'](srcValue);
		  }
		  assignMergeValue(object, key, newValue);
		}

		/**
		 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
		 *
		 * @private
		 * @param {Function} func The function to apply a rest parameter to.
		 * @param {number} [start=func.length-1] The start position of the rest parameter.
		 * @returns {Function} Returns the new function.
		 */
		function baseRest(func, start) {
		  return setToString(overRest(func, start, identity), func + '');
		}

		/**
		 * The base implementation of `setToString` without support for hot loop shorting.
		 *
		 * @private
		 * @param {Function} func The function to modify.
		 * @param {Function} string The `toString` result.
		 * @returns {Function} Returns `func`.
		 */
		var baseSetToString = !defineProperty ? identity : function(func, string) {
		  return defineProperty(func, 'toString', {
		    'configurable': true,
		    'enumerable': false,
		    'value': constant(string),
		    'writable': true
		  });
		};

		/**
		 * Creates a clone of  `buffer`.
		 *
		 * @private
		 * @param {Buffer} buffer The buffer to clone.
		 * @param {boolean} [isDeep] Specify a deep clone.
		 * @returns {Buffer} Returns the cloned buffer.
		 */
		function cloneBuffer(buffer, isDeep) {
		  {
		    return buffer.slice();
		  }
		}

		/**
		 * Creates a clone of `arrayBuffer`.
		 *
		 * @private
		 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
		 * @returns {ArrayBuffer} Returns the cloned array buffer.
		 */
		function cloneArrayBuffer(arrayBuffer) {
		  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
		  new Uint8Array(result).set(new Uint8Array(arrayBuffer));
		  return result;
		}

		/**
		 * Creates a clone of `typedArray`.
		 *
		 * @private
		 * @param {Object} typedArray The typed array to clone.
		 * @param {boolean} [isDeep] Specify a deep clone.
		 * @returns {Object} Returns the cloned typed array.
		 */
		function cloneTypedArray(typedArray, isDeep) {
		  var buffer = cloneArrayBuffer(typedArray.buffer) ;
		  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
		}

		/**
		 * Copies the values of `source` to `array`.
		 *
		 * @private
		 * @param {Array} source The array to copy values from.
		 * @param {Array} [array=[]] The array to copy values to.
		 * @returns {Array} Returns `array`.
		 */
		function copyArray(source, array) {
		  var index = -1,
		      length = source.length;

		  array || (array = Array(length));
		  while (++index < length) {
		    array[index] = source[index];
		  }
		  return array;
		}

		/**
		 * Copies properties of `source` to `object`.
		 *
		 * @private
		 * @param {Object} source The object to copy properties from.
		 * @param {Array} props The property identifiers to copy.
		 * @param {Object} [object={}] The object to copy properties to.
		 * @param {Function} [customizer] The function to customize copied values.
		 * @returns {Object} Returns `object`.
		 */
		function copyObject(source, props, object, customizer) {
		  var isNew = !object;
		  object || (object = {});

		  var index = -1,
		      length = props.length;

		  while (++index < length) {
		    var key = props[index];

		    var newValue = undefined;

		    if (newValue === undefined) {
		      newValue = source[key];
		    }
		    if (isNew) {
		      baseAssignValue(object, key, newValue);
		    } else {
		      assignValue(object, key, newValue);
		    }
		  }
		  return object;
		}

		/**
		 * Creates a function like `_.assign`.
		 *
		 * @private
		 * @param {Function} assigner The function to assign values.
		 * @returns {Function} Returns the new assigner function.
		 */
		function createAssigner(assigner) {
		  return baseRest(function(object, sources) {
		    var index = -1,
		        length = sources.length,
		        customizer = length > 1 ? sources[length - 1] : undefined,
		        guard = length > 2 ? sources[2] : undefined;

		    customizer = (assigner.length > 3 && typeof customizer == 'function')
		      ? (length--, customizer)
		      : undefined;

		    if (guard && isIterateeCall(sources[0], sources[1], guard)) {
		      customizer = length < 3 ? undefined : customizer;
		      length = 1;
		    }
		    object = Object(object);
		    while (++index < length) {
		      var source = sources[index];
		      if (source) {
		        assigner(object, source, index, customizer);
		      }
		    }
		    return object;
		  });
		}

		/**
		 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
		 *
		 * @private
		 * @param {boolean} [fromRight] Specify iterating from right to left.
		 * @returns {Function} Returns the new base function.
		 */
		function createBaseFor(fromRight) {
		  return function(object, iteratee, keysFunc) {
		    var index = -1,
		        iterable = Object(object),
		        props = keysFunc(object),
		        length = props.length;

		    while (length--) {
		      var key = props[++index];
		      if (iteratee(iterable[key], key, iterable) === false) {
		        break;
		      }
		    }
		    return object;
		  };
		}

		/**
		 * Gets the data for `map`.
		 *
		 * @private
		 * @param {Object} map The map to query.
		 * @param {string} key The reference key.
		 * @returns {*} Returns the map data.
		 */
		function getMapData(map, key) {
		  var data = map.__data__;
		  return isKeyable(key)
		    ? data[typeof key == 'string' ? 'string' : 'hash']
		    : data.map;
		}

		/**
		 * Gets the native function at `key` of `object`.
		 *
		 * @private
		 * @param {Object} object The object to query.
		 * @param {string} key The key of the method to get.
		 * @returns {*} Returns the function if it's native, else `undefined`.
		 */
		function getNative(object, key) {
		  var value = getValue(object, key);
		  return baseIsNative(value) ? value : undefined;
		}

		/**
		 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
		 *
		 * @private
		 * @param {*} value The value to query.
		 * @returns {string} Returns the raw `toStringTag`.
		 */
		function getRawTag(value) {
		  var isOwn = hasOwnProperty.call(value, symToStringTag),
		      tag = value[symToStringTag];

		  try {
		    value[symToStringTag] = undefined;
		    var unmasked = true;
		  } catch (e) {}

		  var result = nativeObjectToString.call(value);
		  if (unmasked) {
		    if (isOwn) {
		      value[symToStringTag] = tag;
		    } else {
		      delete value[symToStringTag];
		    }
		  }
		  return result;
		}

		/**
		 * Initializes an object clone.
		 *
		 * @private
		 * @param {Object} object The object to clone.
		 * @returns {Object} Returns the initialized clone.
		 */
		function initCloneObject(object) {
		  return (typeof object.constructor == 'function' && !isPrototype(object))
		    ? baseCreate(getPrototype(object))
		    : {};
		}

		/**
		 * Checks if `value` is a valid array-like index.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
		 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
		 */
		function isIndex(value, length) {
		  var type = typeof value;
		  length = length == null ? MAX_SAFE_INTEGER : length;

		  return !!length &&
		    (type == 'number' ||
		      (type != 'symbol' && reIsUint.test(value))) &&
		        (value > -1 && value % 1 == 0 && value < length);
		}

		/**
		 * Checks if the given arguments are from an iteratee call.
		 *
		 * @private
		 * @param {*} value The potential iteratee value argument.
		 * @param {*} index The potential iteratee index or key argument.
		 * @param {*} object The potential iteratee object argument.
		 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
		 *  else `false`.
		 */
		function isIterateeCall(value, index, object) {
		  if (!isObject(object)) {
		    return false;
		  }
		  var type = typeof index;
		  if (type == 'number'
		        ? (isArrayLike(object) && isIndex(index, object.length))
		        : (type == 'string' && index in object)
		      ) {
		    return eq(object[index], value);
		  }
		  return false;
		}

		/**
		 * Checks if `value` is suitable for use as unique object key.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
		 */
		function isKeyable(value) {
		  var type = typeof value;
		  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
		    ? (value !== '__proto__')
		    : (value === null);
		}

		/**
		 * Checks if `func` has its source masked.
		 *
		 * @private
		 * @param {Function} func The function to check.
		 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
		 */
		function isMasked(func) {
		  return !!maskSrcKey && (maskSrcKey in func);
		}

		/**
		 * Checks if `value` is likely a prototype object.
		 *
		 * @private
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
		 */
		function isPrototype(value) {
		  var Ctor = value && value.constructor,
		      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

		  return value === proto;
		}

		/**
		 * This function is like
		 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
		 * except that it includes inherited enumerable properties.
		 *
		 * @private
		 * @param {Object} object The object to query.
		 * @returns {Array} Returns the array of property names.
		 */
		function nativeKeysIn(object) {
		  var result = [];
		  if (object != null) {
		    for (var key in Object(object)) {
		      result.push(key);
		    }
		  }
		  return result;
		}

		/**
		 * Converts `value` to a string using `Object.prototype.toString`.
		 *
		 * @private
		 * @param {*} value The value to convert.
		 * @returns {string} Returns the converted string.
		 */
		function objectToString(value) {
		  return nativeObjectToString.call(value);
		}

		/**
		 * A specialized version of `baseRest` which transforms the rest array.
		 *
		 * @private
		 * @param {Function} func The function to apply a rest parameter to.
		 * @param {number} [start=func.length-1] The start position of the rest parameter.
		 * @param {Function} transform The rest array transform.
		 * @returns {Function} Returns the new function.
		 */
		function overRest(func, start, transform) {
		  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
		  return function() {
		    var args = arguments,
		        index = -1,
		        length = nativeMax(args.length - start, 0),
		        array = Array(length);

		    while (++index < length) {
		      array[index] = args[start + index];
		    }
		    index = -1;
		    var otherArgs = Array(start + 1);
		    while (++index < start) {
		      otherArgs[index] = args[index];
		    }
		    otherArgs[start] = transform(array);
		    return apply(func, this, otherArgs);
		  };
		}

		/**
		 * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
		 *
		 * @private
		 * @param {Object} object The object to query.
		 * @param {string} key The key of the property to get.
		 * @returns {*} Returns the property value.
		 */
		function safeGet(object, key) {
		  if (key === 'constructor' && typeof object[key] === 'function') {
		    return;
		  }

		  if (key == '__proto__') {
		    return;
		  }

		  return object[key];
		}

		/**
		 * Sets the `toString` method of `func` to return `string`.
		 *
		 * @private
		 * @param {Function} func The function to modify.
		 * @param {Function} string The `toString` result.
		 * @returns {Function} Returns `func`.
		 */
		var setToString = shortOut(baseSetToString);

		/**
		 * Creates a function that'll short out and invoke `identity` instead
		 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
		 * milliseconds.
		 *
		 * @private
		 * @param {Function} func The function to restrict.
		 * @returns {Function} Returns the new shortable function.
		 */
		function shortOut(func) {
		  var count = 0,
		      lastCalled = 0;

		  return function() {
		    var stamp = nativeNow(),
		        remaining = HOT_SPAN - (stamp - lastCalled);

		    lastCalled = stamp;
		    if (remaining > 0) {
		      if (++count >= HOT_COUNT) {
		        return arguments[0];
		      }
		    } else {
		      count = 0;
		    }
		    return func.apply(undefined, arguments);
		  };
		}

		/**
		 * Converts `func` to its source code.
		 *
		 * @private
		 * @param {Function} func The function to convert.
		 * @returns {string} Returns the source code.
		 */
		function toSource(func) {
		  if (func != null) {
		    try {
		      return funcToString.call(func);
		    } catch (e) {}
		    try {
		      return (func + '');
		    } catch (e) {}
		  }
		  return '';
		}

		/**
		 * Performs a
		 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
		 * comparison between two values to determine if they are equivalent.
		 *
		 * @static
		 * @memberOf _
		 * @since 4.0.0
		 * @category Lang
		 * @param {*} value The value to compare.
		 * @param {*} other The other value to compare.
		 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
		 * @example
		 *
		 * var object = { 'a': 1 };
		 * var other = { 'a': 1 };
		 *
		 * _.eq(object, object);
		 * // => true
		 *
		 * _.eq(object, other);
		 * // => false
		 *
		 * _.eq('a', 'a');
		 * // => true
		 *
		 * _.eq('a', Object('a'));
		 * // => false
		 *
		 * _.eq(NaN, NaN);
		 * // => true
		 */
		function eq(value, other) {
		  return value === other || (value !== value && other !== other);
		}

		/**
		 * Checks if `value` is likely an `arguments` object.
		 *
		 * @static
		 * @memberOf _
		 * @since 0.1.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
		 *  else `false`.
		 * @example
		 *
		 * _.isArguments(function() { return arguments; }());
		 * // => true
		 *
		 * _.isArguments([1, 2, 3]);
		 * // => false
		 */
		var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
		  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
		    !propertyIsEnumerable.call(value, 'callee');
		};

		/**
		 * Checks if `value` is classified as an `Array` object.
		 *
		 * @static
		 * @memberOf _
		 * @since 0.1.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
		 * @example
		 *
		 * _.isArray([1, 2, 3]);
		 * // => true
		 *
		 * _.isArray(document.body.children);
		 * // => false
		 *
		 * _.isArray('abc');
		 * // => false
		 *
		 * _.isArray(_.noop);
		 * // => false
		 */
		var isArray = Array.isArray;

		/**
		 * Checks if `value` is array-like. A value is considered array-like if it's
		 * not a function and has a `value.length` that's an integer greater than or
		 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
		 *
		 * @static
		 * @memberOf _
		 * @since 4.0.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
		 * @example
		 *
		 * _.isArrayLike([1, 2, 3]);
		 * // => true
		 *
		 * _.isArrayLike(document.body.children);
		 * // => true
		 *
		 * _.isArrayLike('abc');
		 * // => true
		 *
		 * _.isArrayLike(_.noop);
		 * // => false
		 */
		function isArrayLike(value) {
		  return value != null && isLength(value.length) && !isFunction(value);
		}

		/**
		 * This method is like `_.isArrayLike` except that it also checks if `value`
		 * is an object.
		 *
		 * @static
		 * @memberOf _
		 * @since 4.0.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is an array-like object,
		 *  else `false`.
		 * @example
		 *
		 * _.isArrayLikeObject([1, 2, 3]);
		 * // => true
		 *
		 * _.isArrayLikeObject(document.body.children);
		 * // => true
		 *
		 * _.isArrayLikeObject('abc');
		 * // => false
		 *
		 * _.isArrayLikeObject(_.noop);
		 * // => false
		 */
		function isArrayLikeObject(value) {
		  return isObjectLike(value) && isArrayLike(value);
		}

		/**
		 * Checks if `value` is a buffer.
		 *
		 * @static
		 * @memberOf _
		 * @since 4.3.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
		 * @example
		 *
		 * _.isBuffer(new Buffer(2));
		 * // => true
		 *
		 * _.isBuffer(new Uint8Array(2));
		 * // => false
		 */
		var isBuffer = nativeIsBuffer || stubFalse;

		/**
		 * Checks if `value` is classified as a `Function` object.
		 *
		 * @static
		 * @memberOf _
		 * @since 0.1.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
		 * @example
		 *
		 * _.isFunction(_);
		 * // => true
		 *
		 * _.isFunction(/abc/);
		 * // => false
		 */
		function isFunction(value) {
		  if (!isObject(value)) {
		    return false;
		  }
		  // The use of `Object#toString` avoids issues with the `typeof` operator
		  // in Safari 9 which returns 'object' for typed arrays and other constructors.
		  var tag = baseGetTag(value);
		  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
		}

		/**
		 * Checks if `value` is a valid array-like length.
		 *
		 * **Note:** This method is loosely based on
		 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
		 *
		 * @static
		 * @memberOf _
		 * @since 4.0.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
		 * @example
		 *
		 * _.isLength(3);
		 * // => true
		 *
		 * _.isLength(Number.MIN_VALUE);
		 * // => false
		 *
		 * _.isLength(Infinity);
		 * // => false
		 *
		 * _.isLength('3');
		 * // => false
		 */
		function isLength(value) {
		  return typeof value == 'number' &&
		    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
		}

		/**
		 * Checks if `value` is the
		 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
		 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
		 *
		 * @static
		 * @memberOf _
		 * @since 0.1.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
		 * @example
		 *
		 * _.isObject({});
		 * // => true
		 *
		 * _.isObject([1, 2, 3]);
		 * // => true
		 *
		 * _.isObject(_.noop);
		 * // => true
		 *
		 * _.isObject(null);
		 * // => false
		 */
		function isObject(value) {
		  var type = typeof value;
		  return value != null && (type == 'object' || type == 'function');
		}

		/**
		 * Checks if `value` is object-like. A value is object-like if it's not `null`
		 * and has a `typeof` result of "object".
		 *
		 * @static
		 * @memberOf _
		 * @since 4.0.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
		 * @example
		 *
		 * _.isObjectLike({});
		 * // => true
		 *
		 * _.isObjectLike([1, 2, 3]);
		 * // => true
		 *
		 * _.isObjectLike(_.noop);
		 * // => false
		 *
		 * _.isObjectLike(null);
		 * // => false
		 */
		function isObjectLike(value) {
		  return value != null && typeof value == 'object';
		}

		/**
		 * Checks if `value` is a plain object, that is, an object created by the
		 * `Object` constructor or one with a `[[Prototype]]` of `null`.
		 *
		 * @static
		 * @memberOf _
		 * @since 0.8.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
		 * @example
		 *
		 * function Foo() {
		 *   this.a = 1;
		 * }
		 *
		 * _.isPlainObject(new Foo);
		 * // => false
		 *
		 * _.isPlainObject([1, 2, 3]);
		 * // => false
		 *
		 * _.isPlainObject({ 'x': 0, 'y': 0 });
		 * // => true
		 *
		 * _.isPlainObject(Object.create(null));
		 * // => true
		 */
		function isPlainObject(value) {
		  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
		    return false;
		  }
		  var proto = getPrototype(value);
		  if (proto === null) {
		    return true;
		  }
		  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
		  return typeof Ctor == 'function' && Ctor instanceof Ctor &&
		    funcToString.call(Ctor) == objectCtorString;
		}

		/**
		 * Checks if `value` is classified as a typed array.
		 *
		 * @static
		 * @memberOf _
		 * @since 3.0.0
		 * @category Lang
		 * @param {*} value The value to check.
		 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
		 * @example
		 *
		 * _.isTypedArray(new Uint8Array);
		 * // => true
		 *
		 * _.isTypedArray([]);
		 * // => false
		 */
		var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

		/**
		 * Converts `value` to a plain object flattening inherited enumerable string
		 * keyed properties of `value` to own properties of the plain object.
		 *
		 * @static
		 * @memberOf _
		 * @since 3.0.0
		 * @category Lang
		 * @param {*} value The value to convert.
		 * @returns {Object} Returns the converted plain object.
		 * @example
		 *
		 * function Foo() {
		 *   this.b = 2;
		 * }
		 *
		 * Foo.prototype.c = 3;
		 *
		 * _.assign({ 'a': 1 }, new Foo);
		 * // => { 'a': 1, 'b': 2 }
		 *
		 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
		 * // => { 'a': 1, 'b': 2, 'c': 3 }
		 */
		function toPlainObject(value) {
		  return copyObject(value, keysIn(value));
		}

		/**
		 * Creates an array of the own and inherited enumerable property names of `object`.
		 *
		 * **Note:** Non-object values are coerced to objects.
		 *
		 * @static
		 * @memberOf _
		 * @since 3.0.0
		 * @category Object
		 * @param {Object} object The object to query.
		 * @returns {Array} Returns the array of property names.
		 * @example
		 *
		 * function Foo() {
		 *   this.a = 1;
		 *   this.b = 2;
		 * }
		 *
		 * Foo.prototype.c = 3;
		 *
		 * _.keysIn(new Foo);
		 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
		 */
		function keysIn(object) {
		  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeysIn(object);
		}

		/**
		 * This method is like `_.assign` except that it recursively merges own and
		 * inherited enumerable string keyed properties of source objects into the
		 * destination object. Source properties that resolve to `undefined` are
		 * skipped if a destination value exists. Array and plain object properties
		 * are merged recursively. Other objects and value types are overridden by
		 * assignment. Source objects are applied from left to right. Subsequent
		 * sources overwrite property assignments of previous sources.
		 *
		 * **Note:** This method mutates `object`.
		 *
		 * @static
		 * @memberOf _
		 * @since 0.5.0
		 * @category Object
		 * @param {Object} object The destination object.
		 * @param {...Object} [sources] The source objects.
		 * @returns {Object} Returns `object`.
		 * @example
		 *
		 * var object = {
		 *   'a': [{ 'b': 2 }, { 'd': 4 }]
		 * };
		 *
		 * var other = {
		 *   'a': [{ 'c': 3 }, { 'e': 5 }]
		 * };
		 *
		 * _.merge(object, other);
		 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
		 */
		var merge = createAssigner(function(object, source, srcIndex) {
		  baseMerge(object, source, srcIndex);
		});

		/**
		 * Creates a function that returns `value`.
		 *
		 * @static
		 * @memberOf _
		 * @since 2.4.0
		 * @category Util
		 * @param {*} value The value to return from the new function.
		 * @returns {Function} Returns the new constant function.
		 * @example
		 *
		 * var objects = _.times(2, _.constant({ 'a': 1 }));
		 *
		 * console.log(objects);
		 * // => [{ 'a': 1 }, { 'a': 1 }]
		 *
		 * console.log(objects[0] === objects[1]);
		 * // => true
		 */
		function constant(value) {
		  return function() {
		    return value;
		  };
		}

		/**
		 * This method returns the first argument it receives.
		 *
		 * @static
		 * @since 0.1.0
		 * @memberOf _
		 * @category Util
		 * @param {*} value Any value.
		 * @returns {*} Returns `value`.
		 * @example
		 *
		 * var object = { 'a': 1 };
		 *
		 * console.log(_.identity(object) === object);
		 * // => true
		 */
		function identity(value) {
		  return value;
		}

		/**
		 * This method returns `false`.
		 *
		 * @static
		 * @memberOf _
		 * @since 4.13.0
		 * @category Util
		 * @returns {boolean} Returns `false`.
		 * @example
		 *
		 * _.times(2, _.stubFalse);
		 * // => [false, false]
		 */
		function stubFalse() {
		  return false;
		}

		module.exports = merge; 
	} (lodash_merge, lodash_merge.exports));
	return lodash_merge.exports;
}

var version = "9.23.0";
var require$$5 = {
	version: version};

var eslintrcUniversal = {};

var lookup = [];
var revLookup = [];
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
var inited = false;
function init () {
  inited = true;
  var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  for (var i = 0, len = code.length; i < len; ++i) {
    lookup[i] = code[i];
    revLookup[code.charCodeAt(i)] = i;
  }

  revLookup['-'.charCodeAt(0)] = 62;
  revLookup['_'.charCodeAt(0)] = 63;
}

function toByteArray (b64) {
  if (!inited) {
    init();
  }
  var i, j, l, tmp, placeHolders, arr;
  var len = b64.length;

  if (len % 4 > 0) {
    throw new Error('Invalid string. Length must be a multiple of 4')
  }

  // the number of equal signs (place holders)
  // if there are two placeholders, than the two characters before it
  // represent one byte
  // if there is only one, then the three characters before it represent 2 bytes
  // this is just a cheap hack to not do indexOf twice
  placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;

  // base64 is 4/3 + up to two characters of the original data
  arr = new Arr(len * 3 / 4 - placeHolders);

  // if there are placeholders, only get up to the last complete 4 chars
  l = placeHolders > 0 ? len - 4 : len;

  var L = 0;

  for (i = 0, j = 0; i < l; i += 4, j += 3) {
    tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
    arr[L++] = (tmp >> 16) & 0xFF;
    arr[L++] = (tmp >> 8) & 0xFF;
    arr[L++] = tmp & 0xFF;
  }

  if (placeHolders === 2) {
    tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
    arr[L++] = tmp & 0xFF;
  } else if (placeHolders === 1) {
    tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
    arr[L++] = (tmp >> 8) & 0xFF;
    arr[L++] = tmp & 0xFF;
  }

  return arr
}

function tripletToBase64 (num) {
  return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}

function encodeChunk (uint8, start, end) {
  var tmp;
  var output = [];
  for (var i = start; i < end; i += 3) {
    tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
    output.push(tripletToBase64(tmp));
  }
  return output.join('')
}

function fromByteArray (uint8) {
  if (!inited) {
    init();
  }
  var tmp;
  var len = uint8.length;
  var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
  var output = '';
  var parts = [];
  var maxChunkLength = 16383; // must be multiple of 3

  // go through the array every three bytes, we'll deal with trailing stuff later
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
  }

  // pad the end with zeros, but make sure to not forget the extra bytes
  if (extraBytes === 1) {
    tmp = uint8[len - 1];
    output += lookup[tmp >> 2];
    output += lookup[(tmp << 4) & 0x3F];
    output += '==';
  } else if (extraBytes === 2) {
    tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
    output += lookup[tmp >> 10];
    output += lookup[(tmp >> 4) & 0x3F];
    output += lookup[(tmp << 2) & 0x3F];
    output += '=';
  }

  parts.push(output);

  return parts.join('')
}

function read (buffer, offset, isLE, mLen, nBytes) {
  var e, m;
  var eLen = nBytes * 8 - mLen - 1;
  var eMax = (1 << eLen) - 1;
  var eBias = eMax >> 1;
  var nBits = -7;
  var i = isLE ? (nBytes - 1) : 0;
  var d = isLE ? -1 : 1;
  var s = buffer[offset + i];

  i += d;

  e = s & ((1 << (-nBits)) - 1);
  s >>= (-nBits);
  nBits += eLen;
  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}

  m = e & ((1 << (-nBits)) - 1);
  e >>= (-nBits);
  nBits += mLen;
  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}

  if (e === 0) {
    e = 1 - eBias;
  } else if (e === eMax) {
    return m ? NaN : ((s ? -1 : 1) * Infinity)
  } else {
    m = m + Math.pow(2, mLen);
    e = e - eBias;
  }
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}

function write (buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c;
  var eLen = nBytes * 8 - mLen - 1;
  var eMax = (1 << eLen) - 1;
  var eBias = eMax >> 1;
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
  var i = isLE ? 0 : (nBytes - 1);
  var d = isLE ? 1 : -1;
  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;

  value = Math.abs(value);

  if (isNaN(value) || value === Infinity) {
    m = isNaN(value) ? 1 : 0;
    e = eMax;
  } else {
    e = Math.floor(Math.log(value) / Math.LN2);
    if (value * (c = Math.pow(2, -e)) < 1) {
      e--;
      c *= 2;
    }
    if (e + eBias >= 1) {
      value += rt / c;
    } else {
      value += rt * Math.pow(2, 1 - eBias);
    }
    if (value * c >= 2) {
      e++;
      c /= 2;
    }

    if (e + eBias >= eMax) {
      m = 0;
      e = eMax;
    } else if (e + eBias >= 1) {
      m = (value * c - 1) * Math.pow(2, mLen);
      e = e + eBias;
    } else {
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
      e = 0;
    }
  }

  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

  e = (e << mLen) | m;
  eLen += mLen;
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

  buffer[offset + i - d] |= s * 128;
}

var toString = {}.toString;

var isArray$1 = Array.isArray || function (arr) {
  return toString.call(arr) == '[object Array]';
};

/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
/* eslint-disable no-proto */


var INSPECT_MAX_BYTES = 50;

/**
 * If `Buffer.TYPED_ARRAY_SUPPORT`:
 *   === true    Use Uint8Array implementation (fastest)
 *   === false   Use Object implementation (most compatible, even IE6)
 *
 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
 * Opera 11.6+, iOS 4.2+.
 *
 * Due to various browser bugs, sometimes the Object implementation will be used even
 * when the browser supports typed arrays.
 *
 * Note:
 *
 *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
 *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
 *
 *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
 *
 *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
 *     incorrect length in some situations.

 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
 * get the Object implementation, which is slower but behaves correctly.
 */
Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
  ? global$1.TYPED_ARRAY_SUPPORT
  : true;

/*
 * Export kMaxLength after typed array support is determined.
 */
kMaxLength();

function kMaxLength () {
  return Buffer.TYPED_ARRAY_SUPPORT
    ? 0x7fffffff
    : 0x3fffffff
}

function createBuffer (that, length) {
  if (kMaxLength() < length) {
    throw new RangeError('Invalid typed array length')
  }
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = new Uint8Array(length);
    that.__proto__ = Buffer.prototype;
  } else {
    // Fallback: Return an object instance of the Buffer class
    if (that === null) {
      that = new Buffer(length);
    }
    that.length = length;
  }

  return that
}

/**
 * The Buffer constructor returns instances of `Uint8Array` that have their
 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
 * returns a single octet.
 *
 * The `Uint8Array` prototype remains unmodified.
 */

function Buffer (arg, encodingOrOffset, length) {
  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
    return new Buffer(arg, encodingOrOffset, length)
  }

  // Common case.
  if (typeof arg === 'number') {
    if (typeof encodingOrOffset === 'string') {
      throw new Error(
        'If encoding is specified then the first argument must be a string'
      )
    }
    return allocUnsafe(this, arg)
  }
  return from(this, arg, encodingOrOffset, length)
}

Buffer.poolSize = 8192; // not used by this implementation

// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
  arr.__proto__ = Buffer.prototype;
  return arr
};

function from (that, value, encodingOrOffset, length) {
  if (typeof value === 'number') {
    throw new TypeError('"value" argument must not be a number')
  }

  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
    return fromArrayBuffer(that, value, encodingOrOffset, length)
  }

  if (typeof value === 'string') {
    return fromString(that, value, encodingOrOffset)
  }

  return fromObject(that, value)
}

/**
 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
 * if value is a number.
 * Buffer.from(str[, encoding])
 * Buffer.from(array)
 * Buffer.from(buffer)
 * Buffer.from(arrayBuffer[, byteOffset[, length]])
 **/
Buffer.from = function (value, encodingOrOffset, length) {
  return from(null, value, encodingOrOffset, length)
};

if (Buffer.TYPED_ARRAY_SUPPORT) {
  Buffer.prototype.__proto__ = Uint8Array.prototype;
  Buffer.__proto__ = Uint8Array;
  if (typeof Symbol !== 'undefined' && Symbol.species &&
      Buffer[Symbol.species] === Buffer) ;
}

function assertSize (size) {
  if (typeof size !== 'number') {
    throw new TypeError('"size" argument must be a number')
  } else if (size < 0) {
    throw new RangeError('"size" argument must not be negative')
  }
}

function alloc (that, size, fill, encoding) {
  assertSize(size);
  if (size <= 0) {
    return createBuffer(that, size)
  }
  if (fill !== undefined) {
    // Only pay attention to encoding if it's a string. This
    // prevents accidentally sending in a number that would
    // be interpretted as a start offset.
    return typeof encoding === 'string'
      ? createBuffer(that, size).fill(fill, encoding)
      : createBuffer(that, size).fill(fill)
  }
  return createBuffer(that, size)
}

/**
 * Creates a new filled Buffer instance.
 * alloc(size[, fill[, encoding]])
 **/
Buffer.alloc = function (size, fill, encoding) {
  return alloc(null, size, fill, encoding)
};

function allocUnsafe (that, size) {
  assertSize(size);
  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
  if (!Buffer.TYPED_ARRAY_SUPPORT) {
    for (var i = 0; i < size; ++i) {
      that[i] = 0;
    }
  }
  return that
}

/**
 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
 * */
Buffer.allocUnsafe = function (size) {
  return allocUnsafe(null, size)
};
/**
 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
 */
Buffer.allocUnsafeSlow = function (size) {
  return allocUnsafe(null, size)
};

function fromString (that, string, encoding) {
  if (typeof encoding !== 'string' || encoding === '') {
    encoding = 'utf8';
  }

  if (!Buffer.isEncoding(encoding)) {
    throw new TypeError('"encoding" must be a valid string encoding')
  }

  var length = byteLength(string, encoding) | 0;
  that = createBuffer(that, length);

  var actual = that.write(string, encoding);

  if (actual !== length) {
    // Writing a hex string, for example, that contains invalid characters will
    // cause everything after the first invalid character to be ignored. (e.g.
    // 'abxxcd' will be treated as 'ab')
    that = that.slice(0, actual);
  }

  return that
}

function fromArrayLike (that, array) {
  var length = array.length < 0 ? 0 : checked(array.length) | 0;
  that = createBuffer(that, length);
  for (var i = 0; i < length; i += 1) {
    that[i] = array[i] & 255;
  }
  return that
}

function fromArrayBuffer (that, array, byteOffset, length) {
  array.byteLength; // this throws if `array` is not a valid ArrayBuffer

  if (byteOffset < 0 || array.byteLength < byteOffset) {
    throw new RangeError('\'offset\' is out of bounds')
  }

  if (array.byteLength < byteOffset + (length || 0)) {
    throw new RangeError('\'length\' is out of bounds')
  }

  if (byteOffset === undefined && length === undefined) {
    array = new Uint8Array(array);
  } else if (length === undefined) {
    array = new Uint8Array(array, byteOffset);
  } else {
    array = new Uint8Array(array, byteOffset, length);
  }

  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = array;
    that.__proto__ = Buffer.prototype;
  } else {
    // Fallback: Return an object instance of the Buffer class
    that = fromArrayLike(that, array);
  }
  return that
}

function fromObject (that, obj) {
  if (internalIsBuffer(obj)) {
    var len = checked(obj.length) | 0;
    that = createBuffer(that, len);

    if (that.length === 0) {
      return that
    }

    obj.copy(that, 0, 0, len);
    return that
  }

  if (obj) {
    if ((typeof ArrayBuffer !== 'undefined' &&
        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
      if (typeof obj.length !== 'number' || isnan(obj.length)) {
        return createBuffer(that, 0)
      }
      return fromArrayLike(that, obj)
    }

    if (obj.type === 'Buffer' && isArray$1(obj.data)) {
      return fromArrayLike(that, obj.data)
    }
  }

  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}

function checked (length) {
  // Note: cannot use `length < kMaxLength()` here because that fails when
  // length is NaN (which is otherwise coerced to zero.)
  if (length >= kMaxLength()) {
    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                         'size: 0x' + kMaxLength().toString(16) + ' bytes')
  }
  return length | 0
}
Buffer.isBuffer = isBuffer$1;
function internalIsBuffer (b) {
  return !!(b != null && b._isBuffer)
}

Buffer.compare = function compare (a, b) {
  if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
    throw new TypeError('Arguments must be Buffers')
  }

  if (a === b) return 0

  var x = a.length;
  var y = b.length;

  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
    if (a[i] !== b[i]) {
      x = a[i];
      y = b[i];
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
};

Buffer.isEncoding = function isEncoding (encoding) {
  switch (String(encoding).toLowerCase()) {
    case 'hex':
    case 'utf8':
    case 'utf-8':
    case 'ascii':
    case 'latin1':
    case 'binary':
    case 'base64':
    case 'ucs2':
    case 'ucs-2':
    case 'utf16le':
    case 'utf-16le':
      return true
    default:
      return false
  }
};

Buffer.concat = function concat (list, length) {
  if (!isArray$1(list)) {
    throw new TypeError('"list" argument must be an Array of Buffers')
  }

  if (list.length === 0) {
    return Buffer.alloc(0)
  }

  var i;
  if (length === undefined) {
    length = 0;
    for (i = 0; i < list.length; ++i) {
      length += list[i].length;
    }
  }

  var buffer = Buffer.allocUnsafe(length);
  var pos = 0;
  for (i = 0; i < list.length; ++i) {
    var buf = list[i];
    if (!internalIsBuffer(buf)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    }
    buf.copy(buffer, pos);
    pos += buf.length;
  }
  return buffer
};

function byteLength (string, encoding) {
  if (internalIsBuffer(string)) {
    return string.length
  }
  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
    return string.byteLength
  }
  if (typeof string !== 'string') {
    string = '' + string;
  }

  var len = string.length;
  if (len === 0) return 0

  // Use a for loop to avoid recursion
  var loweredCase = false;
  for (;;) {
    switch (encoding) {
      case 'ascii':
      case 'latin1':
      case 'binary':
        return len
      case 'utf8':
      case 'utf-8':
      case undefined:
        return utf8ToBytes(string).length
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return len * 2
      case 'hex':
        return len >>> 1
      case 'base64':
        return base64ToBytes(string).length
      default:
        if (loweredCase) return utf8ToBytes(string).length // assume utf8
        encoding = ('' + encoding).toLowerCase();
        loweredCase = true;
    }
  }
}
Buffer.byteLength = byteLength;

function slowToString (encoding, start, end) {
  var loweredCase = false;

  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  // property of a typed array.

  // This behaves neither like String nor Uint8Array in that we set start/end
  // to their upper/lower bounds if the value passed is out of range.
  // undefined is handled specially as per ECMA-262 6th Edition,
  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  if (start === undefined || start < 0) {
    start = 0;
  }
  // Return early if start > this.length. Done here to prevent potential uint32
  // coercion fail below.
  if (start > this.length) {
    return ''
  }

  if (end === undefined || end > this.length) {
    end = this.length;
  }

  if (end <= 0) {
    return ''
  }

  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  end >>>= 0;
  start >>>= 0;

  if (end <= start) {
    return ''
  }

  if (!encoding) encoding = 'utf8';

  while (true) {
    switch (encoding) {
      case 'hex':
        return hexSlice(this, start, end)

      case 'utf8':
      case 'utf-8':
        return utf8Slice(this, start, end)

      case 'ascii':
        return asciiSlice(this, start, end)

      case 'latin1':
      case 'binary':
        return latin1Slice(this, start, end)

      case 'base64':
        return base64Slice(this, start, end)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return utf16leSlice(this, start, end)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = (encoding + '').toLowerCase();
        loweredCase = true;
    }
  }
}

// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true;

function swap (b, n, m) {
  var i = b[n];
  b[n] = b[m];
  b[m] = i;
}

Buffer.prototype.swap16 = function swap16 () {
  var len = this.length;
  if (len % 2 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 16-bits')
  }
  for (var i = 0; i < len; i += 2) {
    swap(this, i, i + 1);
  }
  return this
};

Buffer.prototype.swap32 = function swap32 () {
  var len = this.length;
  if (len % 4 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 32-bits')
  }
  for (var i = 0; i < len; i += 4) {
    swap(this, i, i + 3);
    swap(this, i + 1, i + 2);
  }
  return this
};

Buffer.prototype.swap64 = function swap64 () {
  var len = this.length;
  if (len % 8 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 64-bits')
  }
  for (var i = 0; i < len; i += 8) {
    swap(this, i, i + 7);
    swap(this, i + 1, i + 6);
    swap(this, i + 2, i + 5);
    swap(this, i + 3, i + 4);
  }
  return this
};

Buffer.prototype.toString = function toString () {
  var length = this.length | 0;
  if (length === 0) return ''
  if (arguments.length === 0) return utf8Slice(this, 0, length)
  return slowToString.apply(this, arguments)
};

Buffer.prototype.equals = function equals (b) {
  if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
  if (this === b) return true
  return Buffer.compare(this, b) === 0
};

Buffer.prototype.inspect = function inspect () {
  var str = '';
  var max = INSPECT_MAX_BYTES;
  if (this.length > 0) {
    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
    if (this.length > max) str += ' ... ';
  }
  return '<Buffer ' + str + '>'
};

Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  if (!internalIsBuffer(target)) {
    throw new TypeError('Argument must be a Buffer')
  }

  if (start === undefined) {
    start = 0;
  }
  if (end === undefined) {
    end = target ? target.length : 0;
  }
  if (thisStart === undefined) {
    thisStart = 0;
  }
  if (thisEnd === undefined) {
    thisEnd = this.length;
  }

  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
    throw new RangeError('out of range index')
  }

  if (thisStart >= thisEnd && start >= end) {
    return 0
  }
  if (thisStart >= thisEnd) {
    return -1
  }
  if (start >= end) {
    return 1
  }

  start >>>= 0;
  end >>>= 0;
  thisStart >>>= 0;
  thisEnd >>>= 0;

  if (this === target) return 0

  var x = thisEnd - thisStart;
  var y = end - start;
  var len = Math.min(x, y);

  var thisCopy = this.slice(thisStart, thisEnd);
  var targetCopy = target.slice(start, end);

  for (var i = 0; i < len; ++i) {
    if (thisCopy[i] !== targetCopy[i]) {
      x = thisCopy[i];
      y = targetCopy[i];
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
};

// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  // Empty buffer means no match
  if (buffer.length === 0) return -1

  // Normalize byteOffset
  if (typeof byteOffset === 'string') {
    encoding = byteOffset;
    byteOffset = 0;
  } else if (byteOffset > 0x7fffffff) {
    byteOffset = 0x7fffffff;
  } else if (byteOffset < -2147483648) {
    byteOffset = -2147483648;
  }
  byteOffset = +byteOffset;  // Coerce to Number.
  if (isNaN(byteOffset)) {
    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
    byteOffset = dir ? 0 : (buffer.length - 1);
  }

  // Normalize byteOffset: negative offsets start from the end of the buffer
  if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
  if (byteOffset >= buffer.length) {
    if (dir) return -1
    else byteOffset = buffer.length - 1;
  } else if (byteOffset < 0) {
    if (dir) byteOffset = 0;
    else return -1
  }

  // Normalize val
  if (typeof val === 'string') {
    val = Buffer.from(val, encoding);
  }

  // Finally, search either indexOf (if dir is true) or lastIndexOf
  if (internalIsBuffer(val)) {
    // Special case: looking for empty string/buffer always fails
    if (val.length === 0) {
      return -1
    }
    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  } else if (typeof val === 'number') {
    val = val & 0xFF; // Search for a byte value [0-255]
    if (Buffer.TYPED_ARRAY_SUPPORT &&
        typeof Uint8Array.prototype.indexOf === 'function') {
      if (dir) {
        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
      } else {
        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
      }
    }
    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  }

  throw new TypeError('val must be string, number or Buffer')
}

function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  var indexSize = 1;
  var arrLength = arr.length;
  var valLength = val.length;

  if (encoding !== undefined) {
    encoding = String(encoding).toLowerCase();
    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
        encoding === 'utf16le' || encoding === 'utf-16le') {
      if (arr.length < 2 || val.length < 2) {
        return -1
      }
      indexSize = 2;
      arrLength /= 2;
      valLength /= 2;
      byteOffset /= 2;
    }
  }

  function read (buf, i) {
    if (indexSize === 1) {
      return buf[i]
    } else {
      return buf.readUInt16BE(i * indexSize)
    }
  }

  var i;
  if (dir) {
    var foundIndex = -1;
    for (i = byteOffset; i < arrLength; i++) {
      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
        if (foundIndex === -1) foundIndex = i;
        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
      } else {
        if (foundIndex !== -1) i -= i - foundIndex;
        foundIndex = -1;
      }
    }
  } else {
    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
    for (i = byteOffset; i >= 0; i--) {
      var found = true;
      for (var j = 0; j < valLength; j++) {
        if (read(arr, i + j) !== read(val, j)) {
          found = false;
          break
        }
      }
      if (found) return i
    }
  }

  return -1
}

Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  return this.indexOf(val, byteOffset, encoding) !== -1
};

Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
};

Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
};

function hexWrite (buf, string, offset, length) {
  offset = Number(offset) || 0;
  var remaining = buf.length - offset;
  if (!length) {
    length = remaining;
  } else {
    length = Number(length);
    if (length > remaining) {
      length = remaining;
    }
  }

  // must be an even number of digits
  var strLen = string.length;
  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')

  if (length > strLen / 2) {
    length = strLen / 2;
  }
  for (var i = 0; i < length; ++i) {
    var parsed = parseInt(string.substr(i * 2, 2), 16);
    if (isNaN(parsed)) return i
    buf[offset + i] = parsed;
  }
  return i
}

function utf8Write (buf, string, offset, length) {
  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}

function asciiWrite (buf, string, offset, length) {
  return blitBuffer(asciiToBytes(string), buf, offset, length)
}

function latin1Write (buf, string, offset, length) {
  return asciiWrite(buf, string, offset, length)
}

function base64Write (buf, string, offset, length) {
  return blitBuffer(base64ToBytes(string), buf, offset, length)
}

function ucs2Write (buf, string, offset, length) {
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8';
    length = this.length;
    offset = 0;
  // Buffer#write(string, encoding)
  } else if (length === undefined && typeof offset === 'string') {
    encoding = offset;
    length = this.length;
    offset = 0;
  // Buffer#write(string, offset[, length][, encoding])
  } else if (isFinite(offset)) {
    offset = offset | 0;
    if (isFinite(length)) {
      length = length | 0;
      if (encoding === undefined) encoding = 'utf8';
    } else {
      encoding = length;
      length = undefined;
    }
  // legacy write(string, encoding, offset, length) - remove in v0.13
  } else {
    throw new Error(
      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
    )
  }

  var remaining = this.length - offset;
  if (length === undefined || length > remaining) length = remaining;

  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
    throw new RangeError('Attempt to write outside buffer bounds')
  }

  if (!encoding) encoding = 'utf8';

  var loweredCase = false;
  for (;;) {
    switch (encoding) {
      case 'hex':
        return hexWrite(this, string, offset, length)

      case 'utf8':
      case 'utf-8':
        return utf8Write(this, string, offset, length)

      case 'ascii':
        return asciiWrite(this, string, offset, length)

      case 'latin1':
      case 'binary':
        return latin1Write(this, string, offset, length)

      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        return base64Write(this, string, offset, length)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return ucs2Write(this, string, offset, length)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = ('' + encoding).toLowerCase();
        loweredCase = true;
    }
  }
};

Buffer.prototype.toJSON = function toJSON () {
  return {
    type: 'Buffer',
    data: Array.prototype.slice.call(this._arr || this, 0)
  }
};

function base64Slice (buf, start, end) {
  if (start === 0 && end === buf.length) {
    return fromByteArray(buf)
  } else {
    return fromByteArray(buf.slice(start, end))
  }
}

function utf8Slice (buf, start, end) {
  end = Math.min(buf.length, end);
  var res = [];

  var i = start;
  while (i < end) {
    var firstByte = buf[i];
    var codePoint = null;
    var bytesPerSequence = (firstByte > 0xEF) ? 4
      : (firstByte > 0xDF) ? 3
      : (firstByte > 0xBF) ? 2
      : 1;

    if (i + bytesPerSequence <= end) {
      var secondByte, thirdByte, fourthByte, tempCodePoint;

      switch (bytesPerSequence) {
        case 1:
          if (firstByte < 0x80) {
            codePoint = firstByte;
          }
          break
        case 2:
          secondByte = buf[i + 1];
          if ((secondByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
            if (tempCodePoint > 0x7F) {
              codePoint = tempCodePoint;
            }
          }
          break
        case 3:
          secondByte = buf[i + 1];
          thirdByte = buf[i + 2];
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
              codePoint = tempCodePoint;
            }
          }
          break
        case 4:
          secondByte = buf[i + 1];
          thirdByte = buf[i + 2];
          fourthByte = buf[i + 3];
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
              codePoint = tempCodePoint;
            }
          }
      }
    }

    if (codePoint === null) {
      // we did not generate a valid codePoint so insert a
      // replacement char (U+FFFD) and advance only 1 byte
      codePoint = 0xFFFD;
      bytesPerSequence = 1;
    } else if (codePoint > 0xFFFF) {
      // encode to utf16 (surrogate pair dance)
      codePoint -= 0x10000;
      res.push(codePoint >>> 10 & 0x3FF | 0xD800);
      codePoint = 0xDC00 | codePoint & 0x3FF;
    }

    res.push(codePoint);
    i += bytesPerSequence;
  }

  return decodeCodePointsArray(res)
}

// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000;

function decodeCodePointsArray (codePoints) {
  var len = codePoints.length;
  if (len <= MAX_ARGUMENTS_LENGTH) {
    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  }

  // Decode in chunks to avoid "call stack size exceeded".
  var res = '';
  var i = 0;
  while (i < len) {
    res += String.fromCharCode.apply(
      String,
      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
    );
  }
  return res
}

function asciiSlice (buf, start, end) {
  var ret = '';
  end = Math.min(buf.length, end);

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i] & 0x7F);
  }
  return ret
}

function latin1Slice (buf, start, end) {
  var ret = '';
  end = Math.min(buf.length, end);

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i]);
  }
  return ret
}

function hexSlice (buf, start, end) {
  var len = buf.length;

  if (!start || start < 0) start = 0;
  if (!end || end < 0 || end > len) end = len;

  var out = '';
  for (var i = start; i < end; ++i) {
    out += toHex(buf[i]);
  }
  return out
}

function utf16leSlice (buf, start, end) {
  var bytes = buf.slice(start, end);
  var res = '';
  for (var i = 0; i < bytes.length; i += 2) {
    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
  }
  return res
}

Buffer.prototype.slice = function slice (start, end) {
  var len = this.length;
  start = ~~start;
  end = end === undefined ? len : ~~end;

  if (start < 0) {
    start += len;
    if (start < 0) start = 0;
  } else if (start > len) {
    start = len;
  }

  if (end < 0) {
    end += len;
    if (end < 0) end = 0;
  } else if (end > len) {
    end = len;
  }

  if (end < start) end = start;

  var newBuf;
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    newBuf = this.subarray(start, end);
    newBuf.__proto__ = Buffer.prototype;
  } else {
    var sliceLen = end - start;
    newBuf = new Buffer(sliceLen, undefined);
    for (var i = 0; i < sliceLen; ++i) {
      newBuf[i] = this[i + start];
    }
  }

  return newBuf
};

/*
 * Need to make sure that buffer isn't trying to write out of bounds.
 */
function checkOffset (offset, ext, length) {
  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}

Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) checkOffset(offset, byteLength, this.length);

  var val = this[offset];
  var mul = 1;
  var i = 0;
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul;
  }

  return val
};

Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) {
    checkOffset(offset, byteLength, this.length);
  }

  var val = this[offset + --byteLength];
  var mul = 1;
  while (byteLength > 0 && (mul *= 0x100)) {
    val += this[offset + --byteLength] * mul;
  }

  return val
};

Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length);
  return this[offset]
};

Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length);
  return this[offset] | (this[offset + 1] << 8)
};

Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length);
  return (this[offset] << 8) | this[offset + 1]
};

Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);

  return ((this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16)) +
      (this[offset + 3] * 0x1000000)
};

Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);

  return (this[offset] * 0x1000000) +
    ((this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    this[offset + 3])
};

Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) checkOffset(offset, byteLength, this.length);

  var val = this[offset];
  var mul = 1;
  var i = 0;
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul;
  }
  mul *= 0x80;

  if (val >= mul) val -= Math.pow(2, 8 * byteLength);

  return val
};

Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) checkOffset(offset, byteLength, this.length);

  var i = byteLength;
  var mul = 1;
  var val = this[offset + --i];
  while (i > 0 && (mul *= 0x100)) {
    val += this[offset + --i] * mul;
  }
  mul *= 0x80;

  if (val >= mul) val -= Math.pow(2, 8 * byteLength);

  return val
};

Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length);
  if (!(this[offset] & 0x80)) return (this[offset])
  return ((0xff - this[offset] + 1) * -1)
};

Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length);
  var val = this[offset] | (this[offset + 1] << 8);
  return (val & 0x8000) ? val | 0xFFFF0000 : val
};

Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length);
  var val = this[offset + 1] | (this[offset] << 8);
  return (val & 0x8000) ? val | 0xFFFF0000 : val
};

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);

  return (this[offset]) |
    (this[offset + 1] << 8) |
    (this[offset + 2] << 16) |
    (this[offset + 3] << 24)
};

Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);

  return (this[offset] << 24) |
    (this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    (this[offset + 3])
};

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);
  return read(this, offset, true, 23, 4)
};

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length);
  return read(this, offset, false, 23, 4)
};

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length);
  return read(this, offset, true, 52, 8)
};

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length);
  return read(this, offset, false, 52, 8)
};

function checkInt (buf, value, offset, ext, max, min) {
  if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  value = +value;
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1;
    checkInt(this, value, offset, byteLength, maxBytes, 0);
  }

  var mul = 1;
  var i = 0;
  this[offset] = value & 0xFF;
  while (++i < byteLength && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF;
  }

  return offset + byteLength
};

Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  value = +value;
  offset = offset | 0;
  byteLength = byteLength | 0;
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1;
    checkInt(this, value, offset, byteLength, maxBytes, 0);
  }

  var i = byteLength - 1;
  var mul = 1;
  this[offset + i] = value & 0xFF;
  while (--i >= 0 && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF;
  }

  return offset + byteLength
};

Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
  this[offset] = (value & 0xff);
  return offset + 1
};

function objectWriteUInt16 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffff + value + 1;
  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
      (littleEndian ? i : 1 - i) * 8;
  }
}

Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff);
    this[offset + 1] = (value >>> 8);
  } else {
    objectWriteUInt16(this, value, offset, true);
  }
  return offset + 2
};

Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8);
    this[offset + 1] = (value & 0xff);
  } else {
    objectWriteUInt16(this, value, offset, false);
  }
  return offset + 2
};

function objectWriteUInt32 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffffffff + value + 1;
  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
  }
}

Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset + 3] = (value >>> 24);
    this[offset + 2] = (value >>> 16);
    this[offset + 1] = (value >>> 8);
    this[offset] = (value & 0xff);
  } else {
    objectWriteUInt32(this, value, offset, true);
  }
  return offset + 4
};

Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24);
    this[offset + 1] = (value >>> 16);
    this[offset + 2] = (value >>> 8);
    this[offset + 3] = (value & 0xff);
  } else {
    objectWriteUInt32(this, value, offset, false);
  }
  return offset + 4
};

Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1);

    checkInt(this, value, offset, byteLength, limit - 1, -limit);
  }

  var i = 0;
  var mul = 1;
  var sub = 0;
  this[offset] = value & 0xFF;
  while (++i < byteLength && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
      sub = 1;
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
  }

  return offset + byteLength
};

Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1);

    checkInt(this, value, offset, byteLength, limit - 1, -limit);
  }

  var i = byteLength - 1;
  var mul = 1;
  var sub = 0;
  this[offset + i] = value & 0xFF;
  while (--i >= 0 && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
      sub = 1;
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
  }

  return offset + byteLength
};

Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128);
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
  if (value < 0) value = 0xff + value + 1;
  this[offset] = (value & 0xff);
  return offset + 1
};

Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff);
    this[offset + 1] = (value >>> 8);
  } else {
    objectWriteUInt16(this, value, offset, true);
  }
  return offset + 2
};

Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8);
    this[offset + 1] = (value & 0xff);
  } else {
    objectWriteUInt16(this, value, offset, false);
  }
  return offset + 2
};

Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff);
    this[offset + 1] = (value >>> 8);
    this[offset + 2] = (value >>> 16);
    this[offset + 3] = (value >>> 24);
  } else {
    objectWriteUInt32(this, value, offset, true);
  }
  return offset + 4
};

Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  value = +value;
  offset = offset | 0;
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
  if (value < 0) value = 0xffffffff + value + 1;
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24);
    this[offset + 1] = (value >>> 16);
    this[offset + 2] = (value >>> 8);
    this[offset + 3] = (value & 0xff);
  } else {
    objectWriteUInt32(this, value, offset, false);
  }
  return offset + 4
};

function checkIEEE754 (buf, value, offset, ext, max, min) {
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
  if (offset < 0) throw new RangeError('Index out of range')
}

function writeFloat (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 4);
  }
  write(buf, value, offset, littleEndian, 23, 4);
  return offset + 4
}

Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  return writeFloat(this, value, offset, true, noAssert)
};

Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  return writeFloat(this, value, offset, false, noAssert)
};

function writeDouble (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 8);
  }
  write(buf, value, offset, littleEndian, 52, 8);
  return offset + 8
}

Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  return writeDouble(this, value, offset, true, noAssert)
};

Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  return writeDouble(this, value, offset, false, noAssert)
};

// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  if (!start) start = 0;
  if (!end && end !== 0) end = this.length;
  if (targetStart >= target.length) targetStart = target.length;
  if (!targetStart) targetStart = 0;
  if (end > 0 && end < start) end = start;

  // Copy 0 bytes; we're done
  if (end === start) return 0
  if (target.length === 0 || this.length === 0) return 0

  // Fatal error conditions
  if (targetStart < 0) {
    throw new RangeError('targetStart out of bounds')
  }
  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  if (end < 0) throw new RangeError('sourceEnd out of bounds')

  // Are we oob?
  if (end > this.length) end = this.length;
  if (target.length - targetStart < end - start) {
    end = target.length - targetStart + start;
  }

  var len = end - start;
  var i;

  if (this === target && start < targetStart && targetStart < end) {
    // descending copy from end
    for (i = len - 1; i >= 0; --i) {
      target[i + targetStart] = this[i + start];
    }
  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
    // ascending copy from start
    for (i = 0; i < len; ++i) {
      target[i + targetStart] = this[i + start];
    }
  } else {
    Uint8Array.prototype.set.call(
      target,
      this.subarray(start, start + len),
      targetStart
    );
  }

  return len
};

// Usage:
//    buffer.fill(number[, offset[, end]])
//    buffer.fill(buffer[, offset[, end]])
//    buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
  // Handle string cases:
  if (typeof val === 'string') {
    if (typeof start === 'string') {
      encoding = start;
      start = 0;
      end = this.length;
    } else if (typeof end === 'string') {
      encoding = end;
      end = this.length;
    }
    if (val.length === 1) {
      var code = val.charCodeAt(0);
      if (code < 256) {
        val = code;
      }
    }
    if (encoding !== undefined && typeof encoding !== 'string') {
      throw new TypeError('encoding must be a string')
    }
    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
      throw new TypeError('Unknown encoding: ' + encoding)
    }
  } else if (typeof val === 'number') {
    val = val & 255;
  }

  // Invalid ranges are not set to a default, so can range check early.
  if (start < 0 || this.length < start || this.length < end) {
    throw new RangeError('Out of range index')
  }

  if (end <= start) {
    return this
  }

  start = start >>> 0;
  end = end === undefined ? this.length : end >>> 0;

  if (!val) val = 0;

  var i;
  if (typeof val === 'number') {
    for (i = start; i < end; ++i) {
      this[i] = val;
    }
  } else {
    var bytes = internalIsBuffer(val)
      ? val
      : utf8ToBytes(new Buffer(val, encoding).toString());
    var len = bytes.length;
    for (i = 0; i < end - start; ++i) {
      this[i + start] = bytes[i % len];
    }
  }

  return this
};

// HELPER FUNCTIONS
// ================

var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;

function base64clean (str) {
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
  str = stringtrim(str).replace(INVALID_BASE64_RE, '');
  // Node converts strings with length < 2 to ''
  if (str.length < 2) return ''
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  while (str.length % 4 !== 0) {
    str = str + '=';
  }
  return str
}

function stringtrim (str) {
  if (str.trim) return str.trim()
  return str.replace(/^\s+|\s+$/g, '')
}

function toHex (n) {
  if (n < 16) return '0' + n.toString(16)
  return n.toString(16)
}

function utf8ToBytes (string, units) {
  units = units || Infinity;
  var codePoint;
  var length = string.length;
  var leadSurrogate = null;
  var bytes = [];

  for (var i = 0; i < length; ++i) {
    codePoint = string.charCodeAt(i);

    // is surrogate component
    if (codePoint > 0xD7FF && codePoint < 0xE000) {
      // last char was a lead
      if (!leadSurrogate) {
        // no lead yet
        if (codePoint > 0xDBFF) {
          // unexpected trail
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
          continue
        } else if (i + 1 === length) {
          // unpaired lead
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
          continue
        }

        // valid lead
        leadSurrogate = codePoint;

        continue
      }

      // 2 leads in a row
      if (codePoint < 0xDC00) {
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
        leadSurrogate = codePoint;
        continue
      }

      // valid surrogate pair
      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
    } else if (leadSurrogate) {
      // valid bmp char, but last char was a lead
      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
    }

    leadSurrogate = null;

    // encode utf8
    if (codePoint < 0x80) {
      if ((units -= 1) < 0) break
      bytes.push(codePoint);
    } else if (codePoint < 0x800) {
      if ((units -= 2) < 0) break
      bytes.push(
        codePoint >> 0x6 | 0xC0,
        codePoint & 0x3F | 0x80
      );
    } else if (codePoint < 0x10000) {
      if ((units -= 3) < 0) break
      bytes.push(
        codePoint >> 0xC | 0xE0,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      );
    } else if (codePoint < 0x110000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      );
    } else {
      throw new Error('Invalid code point')
    }
  }

  return bytes
}

function asciiToBytes (str) {
  var byteArray = [];
  for (var i = 0; i < str.length; ++i) {
    // Node's code seems to be doing this and not & 0x7F..
    byteArray.push(str.charCodeAt(i) & 0xFF);
  }
  return byteArray
}

function utf16leToBytes (str, units) {
  var c, hi, lo;
  var byteArray = [];
  for (var i = 0; i < str.length; ++i) {
    if ((units -= 2) < 0) break

    c = str.charCodeAt(i);
    hi = c >> 8;
    lo = c % 256;
    byteArray.push(lo);
    byteArray.push(hi);
  }

  return byteArray
}


function base64ToBytes (str) {
  return toByteArray(base64clean(str))
}

function blitBuffer (src, dst, offset, length) {
  for (var i = 0; i < length; ++i) {
    if ((i + offset >= dst.length) || (i >= src.length)) break
    dst[i + offset] = src[i];
  }
  return i
}

function isnan (val) {
  return val !== val // eslint-disable-line no-self-compare
}


// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
function isBuffer$1(obj) {
  return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
}

function isFastBuffer (obj) {
  return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}

// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
}

var inherits;
if (typeof Object.create === 'function'){
  inherits = function inherits(ctor, superCtor) {
    // implementation from standard node.js 'util' module
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
      constructor: {
        value: ctor,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
  };
} else {
  inherits = function inherits(ctor, superCtor) {
    ctor.super_ = superCtor;
    var TempCtor = function () {};
    TempCtor.prototype = superCtor.prototype;
    ctor.prototype = new TempCtor();
    ctor.prototype.constructor = ctor;
  };
}

var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||
  function getOwnPropertyDescriptors(obj) {
    var keys = Object.keys(obj);
    var descriptors = {};
    for (var i = 0; i < keys.length; i++) {
      descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
    }
    return descriptors;
  };

var formatRegExp = /%[sdj%]/g;
function format$1(f) {
  if (!isString(f)) {
    var objects = [];
    for (var i = 0; i < arguments.length; i++) {
      objects.push(inspect(arguments[i]));
    }
    return objects.join(' ');
  }

  var i = 1;
  var args = arguments;
  var len = args.length;
  var str = String(f).replace(formatRegExp, function(x) {
    if (x === '%%') return '%';
    if (i >= len) return x;
    switch (x) {
      case '%s': return String(args[i++]);
      case '%d': return Number(args[i++]);
      case '%j':
        try {
          return JSON.stringify(args[i++]);
        } catch (_) {
          return '[Circular]';
        }
      default:
        return x;
    }
  });
  for (var x = args[i]; i < len; x = args[++i]) {
    if (isNull(x) || !isObject(x)) {
      str += ' ' + x;
    } else {
      str += ' ' + inspect(x);
    }
  }
  return str;
}

// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
function deprecate(fn, msg) {
  // Allow for deprecating things in the process of starting up.
  if (isUndefined(global$1.process)) {
    return function() {
      return deprecate(fn, msg).apply(this, arguments);
    };
  }

  if (browser$1$1.noDeprecation === true) {
    return fn;
  }

  var warned = false;
  function deprecated() {
    if (!warned) {
      if (browser$1$1.throwDeprecation) {
        throw new Error(msg);
      } else if (browser$1$1.traceDeprecation) {
        console.trace(msg);
      } else {
        console.error(msg);
      }
      warned = true;
    }
    return fn.apply(this, arguments);
  }

  return deprecated;
}

var debugs = {};
var debugEnviron;
function debuglog(set) {
  if (isUndefined(debugEnviron))
    debugEnviron = browser$1$1.env.NODE_DEBUG || '';
  set = set.toUpperCase();
  if (!debugs[set]) {
    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
      var pid = 0;
      debugs[set] = function() {
        var msg = format$1.apply(null, arguments);
        console.error('%s %d: %s', set, pid, msg);
      };
    } else {
      debugs[set] = function() {};
    }
  }
  return debugs[set];
}

/**
 * Echos the value of a value. Trys to print the value out
 * in the best way possible given the different types.
 *
 * @param {Object} obj The object to print out.
 * @param {Object} opts Optional options object that alters the output.
 */
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
  // default options
  var ctx = {
    seen: [],
    stylize: stylizeNoColor
  };
  // legacy...
  if (arguments.length >= 3) ctx.depth = arguments[2];
  if (arguments.length >= 4) ctx.colors = arguments[3];
  if (isBoolean(opts)) {
    // legacy...
    ctx.showHidden = opts;
  } else if (opts) {
    // got an "options" object
    _extend(ctx, opts);
  }
  // set default options
  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  if (isUndefined(ctx.depth)) ctx.depth = 2;
  if (isUndefined(ctx.colors)) ctx.colors = false;
  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  if (ctx.colors) ctx.stylize = stylizeWithColor;
  return formatValue(ctx, obj, ctx.depth);
}

// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
  'bold' : [1, 22],
  'italic' : [3, 23],
  'underline' : [4, 24],
  'inverse' : [7, 27],
  'white' : [37, 39],
  'grey' : [90, 39],
  'black' : [30, 39],
  'blue' : [34, 39],
  'cyan' : [36, 39],
  'green' : [32, 39],
  'magenta' : [35, 39],
  'red' : [31, 39],
  'yellow' : [33, 39]
};

// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
  'special': 'cyan',
  'number': 'yellow',
  'boolean': 'yellow',
  'undefined': 'grey',
  'null': 'bold',
  'string': 'green',
  'date': 'magenta',
  // "name": intentionally not styling
  'regexp': 'red'
};


function stylizeWithColor(str, styleType) {
  var style = inspect.styles[styleType];

  if (style) {
    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
           '\u001b[' + inspect.colors[style][1] + 'm';
  } else {
    return str;
  }
}


function stylizeNoColor(str, styleType) {
  return str;
}


function arrayToHash(array) {
  var hash = {};

  array.forEach(function(val, idx) {
    hash[val] = true;
  });

  return hash;
}


function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (ctx.customInspect &&
      value &&
      isFunction(value.inspect) &&
      // Filter out the util module, it's inspect function is special
      value.inspect !== inspect &&
      // Also filter out any prototype objects using the circular check.
      !(value.constructor && value.constructor.prototype === value)) {
    var ret = value.inspect(recurseTimes, ctx);
    if (!isString(ret)) {
      ret = formatValue(ctx, ret, recurseTimes);
    }
    return ret;
  }

  // Primitive types cannot have properties
  var primitive = formatPrimitive(ctx, value);
  if (primitive) {
    return primitive;
  }

  // Look up the keys of the object.
  var keys = Object.keys(value);
  var visibleKeys = arrayToHash(keys);

  if (ctx.showHidden) {
    keys = Object.getOwnPropertyNames(value);
  }

  // IE doesn't make error fields non-enumerable
  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  if (isError(value)
      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
    return formatError(value);
  }

  // Some type of object without properties can be shortcutted.
  if (keys.length === 0) {
    if (isFunction(value)) {
      var name = value.name ? ': ' + value.name : '';
      return ctx.stylize('[Function' + name + ']', 'special');
    }
    if (isRegExp(value)) {
      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
    }
    if (isDate(value)) {
      return ctx.stylize(Date.prototype.toString.call(value), 'date');
    }
    if (isError(value)) {
      return formatError(value);
    }
  }

  var base = '', array = false, braces = ['{', '}'];

  // Make Array say that they are Array
  if (isArray(value)) {
    array = true;
    braces = ['[', ']'];
  }

  // Make functions say that they are functions
  if (isFunction(value)) {
    var n = value.name ? ': ' + value.name : '';
    base = ' [Function' + n + ']';
  }

  // Make RegExps say that they are RegExps
  if (isRegExp(value)) {
    base = ' ' + RegExp.prototype.toString.call(value);
  }

  // Make dates with properties first say the date
  if (isDate(value)) {
    base = ' ' + Date.prototype.toUTCString.call(value);
  }

  // Make error with message first say the error
  if (isError(value)) {
    base = ' ' + formatError(value);
  }

  if (keys.length === 0 && (!array || value.length == 0)) {
    return braces[0] + base + braces[1];
  }

  if (recurseTimes < 0) {
    if (isRegExp(value)) {
      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
    } else {
      return ctx.stylize('[Object]', 'special');
    }
  }

  ctx.seen.push(value);

  var output;
  if (array) {
    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  } else {
    output = keys.map(function(key) {
      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
    });
  }

  ctx.seen.pop();

  return reduceToSingleString(output, base, braces);
}


function formatPrimitive(ctx, value) {
  if (isUndefined(value))
    return ctx.stylize('undefined', 'undefined');
  if (isString(value)) {
    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
                                             .replace(/'/g, "\\'")
                                             .replace(/\\"/g, '"') + '\'';
    return ctx.stylize(simple, 'string');
  }
  if (isNumber(value))
    return ctx.stylize('' + value, 'number');
  if (isBoolean(value))
    return ctx.stylize('' + value, 'boolean');
  // For some reason typeof null is "object", so special case here.
  if (isNull(value))
    return ctx.stylize('null', 'null');
}


function formatError(value) {
  return '[' + Error.prototype.toString.call(value) + ']';
}


function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  var output = [];
  for (var i = 0, l = value.length; i < l; ++i) {
    if (hasOwnProperty(value, String(i))) {
      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
          String(i), true));
    } else {
      output.push('');
    }
  }
  keys.forEach(function(key) {
    if (!key.match(/^\d+$/)) {
      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
          key, true));
    }
  });
  return output;
}


function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  var name, str, desc;
  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  if (desc.get) {
    if (desc.set) {
      str = ctx.stylize('[Getter/Setter]', 'special');
    } else {
      str = ctx.stylize('[Getter]', 'special');
    }
  } else {
    if (desc.set) {
      str = ctx.stylize('[Setter]', 'special');
    }
  }
  if (!hasOwnProperty(visibleKeys, key)) {
    name = '[' + key + ']';
  }
  if (!str) {
    if (ctx.seen.indexOf(desc.value) < 0) {
      if (isNull(recurseTimes)) {
        str = formatValue(ctx, desc.value, null);
      } else {
        str = formatValue(ctx, desc.value, recurseTimes - 1);
      }
      if (str.indexOf('\n') > -1) {
        if (array) {
          str = str.split('\n').map(function(line) {
            return '  ' + line;
          }).join('\n').substr(2);
        } else {
          str = '\n' + str.split('\n').map(function(line) {
            return '   ' + line;
          }).join('\n');
        }
      }
    } else {
      str = ctx.stylize('[Circular]', 'special');
    }
  }
  if (isUndefined(name)) {
    if (array && key.match(/^\d+$/)) {
      return str;
    }
    name = JSON.stringify('' + key);
    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
      name = name.substr(1, name.length - 2);
      name = ctx.stylize(name, 'name');
    } else {
      name = name.replace(/'/g, "\\'")
                 .replace(/\\"/g, '"')
                 .replace(/(^"|"$)/g, "'");
      name = ctx.stylize(name, 'string');
    }
  }

  return name + ': ' + str;
}


function reduceToSingleString(output, base, braces) {
  var length = output.reduce(function(prev, cur) {
    if (cur.indexOf('\n') >= 0) ;
    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  }, 0);

  if (length > 60) {
    return braces[0] +
           (base === '' ? '' : base + '\n ') +
           ' ' +
           output.join(',\n  ') +
           ' ' +
           braces[1];
  }

  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}


// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
  return Array.isArray(ar);
}

function isBoolean(arg) {
  return typeof arg === 'boolean';
}

function isNull(arg) {
  return arg === null;
}

function isNullOrUndefined(arg) {
  return arg == null;
}

function isNumber(arg) {
  return typeof arg === 'number';
}

function isString(arg) {
  return typeof arg === 'string';
}

function isSymbol(arg) {
  return typeof arg === 'symbol';
}

function isUndefined(arg) {
  return arg === void 0;
}

function isRegExp(re) {
  return isObject(re) && objectToString(re) === '[object RegExp]';
}

function isObject(arg) {
  return typeof arg === 'object' && arg !== null;
}

function isDate(d) {
  return isObject(d) && objectToString(d) === '[object Date]';
}

function isError(e) {
  return isObject(e) &&
      (objectToString(e) === '[object Error]' || e instanceof Error);
}

function isFunction(arg) {
  return typeof arg === 'function';
}

function isPrimitive(arg) {
  return arg === null ||
         typeof arg === 'boolean' ||
         typeof arg === 'number' ||
         typeof arg === 'string' ||
         typeof arg === 'symbol' ||  // ES6 symbol
         typeof arg === 'undefined';
}

function isBuffer(maybeBuf) {
  return Buffer.isBuffer(maybeBuf);
}

function objectToString(o) {
  return Object.prototype.toString.call(o);
}


function pad(n) {
  return n < 10 ? '0' + n.toString(10) : n.toString(10);
}


var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
              'Oct', 'Nov', 'Dec'];

// 26 Feb 16:19:34
function timestamp() {
  var d = new Date();
  var time = [pad(d.getHours()),
              pad(d.getMinutes()),
              pad(d.getSeconds())].join(':');
  return [d.getDate(), months[d.getMonth()], time].join(' ');
}


// log is just a thin wrapper to console.log that prepends a timestamp
function log() {
  console.log('%s - %s', timestamp(), format$1.apply(null, arguments));
}

function _extend(origin, add) {
  // Don't do anything if add isn't an object
  if (!add || !isObject(add)) return origin;

  var keys = Object.keys(add);
  var i = keys.length;
  while (i--) {
    origin[keys[i]] = add[keys[i]];
  }
  return origin;
}
function hasOwnProperty(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}

var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;

function promisify(original) {
  if (typeof original !== 'function')
    throw new TypeError('The "original" argument must be of type Function');

  if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
    var fn = original[kCustomPromisifiedSymbol];
    if (typeof fn !== 'function') {
      throw new TypeError('The "util.promisify.custom" argument must be of type Function');
    }
    Object.defineProperty(fn, kCustomPromisifiedSymbol, {
      value: fn, enumerable: false, writable: false, configurable: true
    });
    return fn;
  }

  function fn() {
    var promiseResolve, promiseReject;
    var promise = new Promise(function (resolve, reject) {
      promiseResolve = resolve;
      promiseReject = reject;
    });

    var args = [];
    for (var i = 0; i < arguments.length; i++) {
      args.push(arguments[i]);
    }
    args.push(function (err, value) {
      if (err) {
        promiseReject(err);
      } else {
        promiseResolve(value);
      }
    });

    try {
      original.apply(this, args);
    } catch (err) {
      promiseReject(err);
    }

    return promise;
  }

  Object.setPrototypeOf(fn, Object.getPrototypeOf(original));

  if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
    value: fn, enumerable: false, writable: false, configurable: true
  });
  return Object.defineProperties(
    fn,
    getOwnPropertyDescriptors(original)
  );
}

promisify.custom = kCustomPromisifiedSymbol;

function callbackifyOnRejected(reason, cb) {
  // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
  // Because `null` is a special error value in callbacks which means "no error
  // occurred", we error-wrap so the callback consumer can distinguish between
  // "the promise rejected with null" or "the promise fulfilled with undefined".
  if (!reason) {
    var newReason = new Error('Promise was rejected with a falsy value');
    newReason.reason = reason;
    reason = newReason;
  }
  return cb(reason);
}

function callbackify(original) {
  if (typeof original !== 'function') {
    throw new TypeError('The "original" argument must be of type Function');
  }

  // We DO NOT return the promise as it gives the user a false sense that
  // the promise is actually somehow related to the callback's execution
  // and that the callback throwing will reject the promise.
  function callbackified() {
    var args = [];
    for (var i = 0; i < arguments.length; i++) {
      args.push(arguments[i]);
    }

    var maybeCb = args.pop();
    if (typeof maybeCb !== 'function') {
      throw new TypeError('The last argument must be of type Function');
    }
    var self = this;
    var cb = function() {
      return maybeCb.apply(self, arguments);
    };
    // In true node style we process the callback on `nextTick` with all the
    // implications (stack, `uncaughtException`, `async_hooks`)
    original.apply(this, args)
      .then(function(ret) { browser$1$1.nextTick(cb.bind(null, null, ret)); },
        function(rej) { browser$1$1.nextTick(callbackifyOnRejected.bind(null, rej, cb)); });
  }

  Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  Object.defineProperties(callbackified, getOwnPropertyDescriptors(original));
  return callbackified;
}

var _polyfillNode_util = {
  inherits: inherits,
  _extend: _extend,
  log: log,
  isBuffer: isBuffer,
  isPrimitive: isPrimitive,
  isFunction: isFunction,
  isError: isError,
  isDate: isDate,
  isObject: isObject,
  isRegExp: isRegExp,
  isUndefined: isUndefined,
  isSymbol: isSymbol,
  isString: isString,
  isNumber: isNumber,
  isNullOrUndefined: isNullOrUndefined,
  isNull: isNull,
  isBoolean: isBoolean,
  isArray: isArray,
  inspect: inspect,
  deprecate: deprecate,
  format: format$1,
  debuglog: debuglog,
  promisify: promisify,
  callbackify: callbackify,
};

var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({
	__proto__: null,
	_extend: _extend,
	callbackify: callbackify,
	debuglog: debuglog,
	default: _polyfillNode_util,
	deprecate: deprecate,
	format: format$1,
	inherits: inherits,
	inspect: inspect,
	isArray: isArray,
	isBoolean: isBoolean,
	isBuffer: isBuffer,
	isDate: isDate,
	isError: isError,
	isFunction: isFunction,
	isNull: isNull,
	isNullOrUndefined: isNullOrUndefined,
	isNumber: isNumber,
	isObject: isObject,
	isPrimitive: isPrimitive,
	isRegExp: isRegExp,
	isString: isString,
	isSymbol: isSymbol,
	isUndefined: isUndefined,
	log: log,
	promisify: promisify
});

var require$$1$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(_polyfillNode_util$1);

var uri_all = {exports: {}};

/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */

var hasRequiredUri_all;

function requireUri_all () {
	if (hasRequiredUri_all) return uri_all.exports;
	hasRequiredUri_all = 1;
	(function (module, exports) {
		(function (global, factory) {
			factory(exports) ;
		}(this, (function (exports) {
		function merge() {
		    for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
		        sets[_key] = arguments[_key];
		    }

		    if (sets.length > 1) {
		        sets[0] = sets[0].slice(0, -1);
		        var xl = sets.length - 1;
		        for (var x = 1; x < xl; ++x) {
		            sets[x] = sets[x].slice(1, -1);
		        }
		        sets[xl] = sets[xl].slice(1);
		        return sets.join('');
		    } else {
		        return sets[0];
		    }
		}
		function subexp(str) {
		    return "(?:" + str + ")";
		}
		function typeOf(o) {
		    return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
		}
		function toUpperCase(str) {
		    return str.toUpperCase();
		}
		function toArray(obj) {
		    return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
		}
		function assign(target, source) {
		    var obj = target;
		    if (source) {
		        for (var key in source) {
		            obj[key] = source[key];
		        }
		    }
		    return obj;
		}

		function buildExps(isIRI) {
		    var ALPHA$$ = "[A-Za-z]",
		        DIGIT$$ = "[0-9]",
		        HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
		        PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
		        //expanded
		    GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
		        SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
		        RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
		        UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
		        //subset, excludes bidi control characters
		    IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
		        //subset
		    UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
		        subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
		        subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
		        var DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
		        //relaxed parsing rules
		    IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
		        H16$ = subexp(HEXDIG$$ + "{1,4}"),
		        LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
		        IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
		        //                           6( h16 ":" ) ls32
		    IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
		        //                      "::" 5( h16 ":" ) ls32
		    IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
		        //[               h16 ] "::" 4( h16 ":" ) ls32
		    IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
		        //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
		    IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
		        //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
		    IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
		        //[ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
		    IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
		        //[ *4( h16 ":" ) h16 ] "::"              ls32
		    IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
		        //[ *5( h16 ":" ) h16 ] "::"              h16
		    IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
		        //[ *6( h16 ":" ) h16 ] "::"
		    IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
		        ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
		        //RFC 6874, with relaxed parsing rules
		    subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
		        //RFC 6874
		    subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
		        var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
		        subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
		        subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
		    return {
		        NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
		        NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
		        NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
		        NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
		        NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
		        NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
		        NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
		        ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
		        UNRESERVED: new RegExp(UNRESERVED$$, "g"),
		        OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
		        PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
		        IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
		        IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
		    };
		}
		var URI_PROTOCOL = buildExps(false);

		var IRI_PROTOCOL = buildExps(true);

		var slicedToArray = function () {
		  function sliceIterator(arr, i) {
		    var _arr = [];
		    var _n = true;
		    var _d = false;
		    var _e = undefined;

		    try {
		      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
		        _arr.push(_s.value);

		        if (i && _arr.length === i) break;
		      }
		    } catch (err) {
		      _d = true;
		      _e = err;
		    } finally {
		      try {
		        if (!_n && _i["return"]) _i["return"]();
		      } finally {
		        if (_d) throw _e;
		      }
		    }

		    return _arr;
		  }

		  return function (arr, i) {
		    if (Array.isArray(arr)) {
		      return arr;
		    } else if (Symbol.iterator in Object(arr)) {
		      return sliceIterator(arr, i);
		    } else {
		      throw new TypeError("Invalid attempt to destructure non-iterable instance");
		    }
		  };
		}();













		var toConsumableArray = function (arr) {
		  if (Array.isArray(arr)) {
		    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

		    return arr2;
		  } else {
		    return Array.from(arr);
		  }
		};

		/** Highest positive signed 32-bit float value */

		var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

		/** Bootstring parameters */
		var base = 36;
		var tMin = 1;
		var tMax = 26;
		var skew = 38;
		var damp = 700;
		var initialBias = 72;
		var initialN = 128; // 0x80
		var delimiter = '-'; // '\x2D'

		/** Regular expressions */
		var regexPunycode = /^xn--/;
		var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
		var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

		/** Error messages */
		var errors = {
			'overflow': 'Overflow: input needs wider integers to process',
			'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
			'invalid-input': 'Invalid input'
		};

		/** Convenience shortcuts */
		var baseMinusTMin = base - tMin;
		var floor = Math.floor;
		var stringFromCharCode = String.fromCharCode;

		/*--------------------------------------------------------------------------*/

		/**
		 * A generic error utility function.
		 * @private
		 * @param {String} type The error type.
		 * @returns {Error} Throws a `RangeError` with the applicable error message.
		 */
		function error$1(type) {
			throw new RangeError(errors[type]);
		}

		/**
		 * A generic `Array#map` utility function.
		 * @private
		 * @param {Array} array The array to iterate over.
		 * @param {Function} callback The function that gets called for every array
		 * item.
		 * @returns {Array} A new array of values returned by the callback function.
		 */
		function map(array, fn) {
			var result = [];
			var length = array.length;
			while (length--) {
				result[length] = fn(array[length]);
			}
			return result;
		}

		/**
		 * A simple `Array#map`-like wrapper to work with domain name strings or email
		 * addresses.
		 * @private
		 * @param {String} domain The domain name or email address.
		 * @param {Function} callback The function that gets called for every
		 * character.
		 * @returns {Array} A new string of characters returned by the callback
		 * function.
		 */
		function mapDomain(string, fn) {
			var parts = string.split('@');
			var result = '';
			if (parts.length > 1) {
				// In email addresses, only the domain name should be punycoded. Leave
				// the local part (i.e. everything up to `@`) intact.
				result = parts[0] + '@';
				string = parts[1];
			}
			// Avoid `split(regex)` for IE8 compatibility. See #17.
			string = string.replace(regexSeparators, '\x2E');
			var labels = string.split('.');
			var encoded = map(labels, fn).join('.');
			return result + encoded;
		}

		/**
		 * Creates an array containing the numeric code points of each Unicode
		 * character in the string. While JavaScript uses UCS-2 internally,
		 * this function will convert a pair of surrogate halves (each of which
		 * UCS-2 exposes as separate characters) into a single code point,
		 * matching UTF-16.
		 * @see `punycode.ucs2.encode`
		 * @see <https://mathiasbynens.be/notes/javascript-encoding>
		 * @memberOf punycode.ucs2
		 * @name decode
		 * @param {String} string The Unicode input string (UCS-2).
		 * @returns {Array} The new array of code points.
		 */
		function ucs2decode(string) {
			var output = [];
			var counter = 0;
			var length = string.length;
			while (counter < length) {
				var value = string.charCodeAt(counter++);
				if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
					// It's a high surrogate, and there is a next character.
					var extra = string.charCodeAt(counter++);
					if ((extra & 0xFC00) == 0xDC00) {
						// Low surrogate.
						output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
					} else {
						// It's an unmatched surrogate; only append this code unit, in case the
						// next code unit is the high surrogate of a surrogate pair.
						output.push(value);
						counter--;
					}
				} else {
					output.push(value);
				}
			}
			return output;
		}

		/**
		 * Creates a string based on an array of numeric code points.
		 * @see `punycode.ucs2.decode`
		 * @memberOf punycode.ucs2
		 * @name encode
		 * @param {Array} codePoints The array of numeric code points.
		 * @returns {String} The new Unicode string (UCS-2).
		 */
		var ucs2encode = function ucs2encode(array) {
			return String.fromCodePoint.apply(String, toConsumableArray(array));
		};

		/**
		 * Converts a basic code point into a digit/integer.
		 * @see `digitToBasic()`
		 * @private
		 * @param {Number} codePoint The basic numeric code point value.
		 * @returns {Number} The numeric value of a basic code point (for use in
		 * representing integers) in the range `0` to `base - 1`, or `base` if
		 * the code point does not represent a value.
		 */
		var basicToDigit = function basicToDigit(codePoint) {
			if (codePoint - 0x30 < 0x0A) {
				return codePoint - 0x16;
			}
			if (codePoint - 0x41 < 0x1A) {
				return codePoint - 0x41;
			}
			if (codePoint - 0x61 < 0x1A) {
				return codePoint - 0x61;
			}
			return base;
		};

		/**
		 * Converts a digit/integer into a basic code point.
		 * @see `basicToDigit()`
		 * @private
		 * @param {Number} digit The numeric value of a basic code point.
		 * @returns {Number} The basic code point whose value (when used for
		 * representing integers) is `digit`, which needs to be in the range
		 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
		 * used; else, the lowercase form is used. The behavior is undefined
		 * if `flag` is non-zero and `digit` has no uppercase form.
		 */
		var digitToBasic = function digitToBasic(digit, flag) {
			//  0..25 map to ASCII a..z or A..Z
			// 26..35 map to ASCII 0..9
			return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
		};

		/**
		 * Bias adaptation function as per section 3.4 of RFC 3492.
		 * https://tools.ietf.org/html/rfc3492#section-3.4
		 * @private
		 */
		var adapt = function adapt(delta, numPoints, firstTime) {
			var k = 0;
			delta = firstTime ? floor(delta / damp) : delta >> 1;
			delta += floor(delta / numPoints);
			for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
				delta = floor(delta / baseMinusTMin);
			}
			return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
		};

		/**
		 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
		 * symbols.
		 * @memberOf punycode
		 * @param {String} input The Punycode string of ASCII-only symbols.
		 * @returns {String} The resulting string of Unicode symbols.
		 */
		var decode = function decode(input) {
			// Don't use UCS-2.
			var output = [];
			var inputLength = input.length;
			var i = 0;
			var n = initialN;
			var bias = initialBias;

			// Handle the basic code points: let `basic` be the number of input code
			// points before the last delimiter, or `0` if there is none, then copy
			// the first basic code points to the output.

			var basic = input.lastIndexOf(delimiter);
			if (basic < 0) {
				basic = 0;
			}

			for (var j = 0; j < basic; ++j) {
				// if it's not a basic code point
				if (input.charCodeAt(j) >= 0x80) {
					error$1('not-basic');
				}
				output.push(input.charCodeAt(j));
			}

			// Main decoding loop: start just after the last delimiter if any basic code
			// points were copied; start at the beginning otherwise.

			for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{

				// `index` is the index of the next character to be consumed.
				// Decode a generalized variable-length integer into `delta`,
				// which gets added to `i`. The overflow checking is easier
				// if we increase `i` as we go, then subtract off its starting
				// value at the end to obtain `delta`.
				var oldi = i;
				for (var w = 1, k = base;; /* no condition */k += base) {

					if (index >= inputLength) {
						error$1('invalid-input');
					}

					var digit = basicToDigit(input.charCodeAt(index++));

					if (digit >= base || digit > floor((maxInt - i) / w)) {
						error$1('overflow');
					}

					i += digit * w;
					var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;

					if (digit < t) {
						break;
					}

					var baseMinusT = base - t;
					if (w > floor(maxInt / baseMinusT)) {
						error$1('overflow');
					}

					w *= baseMinusT;
				}

				var out = output.length + 1;
				bias = adapt(i - oldi, out, oldi == 0);

				// `i` was supposed to wrap around from `out` to `0`,
				// incrementing `n` each time, so we'll fix that now:
				if (floor(i / out) > maxInt - n) {
					error$1('overflow');
				}

				n += floor(i / out);
				i %= out;

				// Insert `n` at position `i` of the output.
				output.splice(i++, 0, n);
			}

			return String.fromCodePoint.apply(String, output);
		};

		/**
		 * Converts a string of Unicode symbols (e.g. a domain name label) to a
		 * Punycode string of ASCII-only symbols.
		 * @memberOf punycode
		 * @param {String} input The string of Unicode symbols.
		 * @returns {String} The resulting Punycode string of ASCII-only symbols.
		 */
		var encode = function encode(input) {
			var output = [];

			// Convert the input in UCS-2 to an array of Unicode code points.
			input = ucs2decode(input);

			// Cache the length.
			var inputLength = input.length;

			// Initialize the state.
			var n = initialN;
			var delta = 0;
			var bias = initialBias;

			// Handle the basic code points.
			var _iteratorNormalCompletion = true;
			var _didIteratorError = false;
			var _iteratorError = undefined;

			try {
				for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					var _currentValue2 = _step.value;

					if (_currentValue2 < 0x80) {
						output.push(stringFromCharCode(_currentValue2));
					}
				}
			} catch (err) {
				_didIteratorError = true;
				_iteratorError = err;
			} finally {
				try {
					if (!_iteratorNormalCompletion && _iterator.return) {
						_iterator.return();
					}
				} finally {
					if (_didIteratorError) {
						throw _iteratorError;
					}
				}
			}

			var basicLength = output.length;
			var handledCPCount = basicLength;

			// `handledCPCount` is the number of code points that have been handled;
			// `basicLength` is the number of basic code points.

			// Finish the basic string with a delimiter unless it's empty.
			if (basicLength) {
				output.push(delimiter);
			}

			// Main encoding loop:
			while (handledCPCount < inputLength) {

				// All non-basic code points < n have been handled already. Find the next
				// larger one:
				var m = maxInt;
				var _iteratorNormalCompletion2 = true;
				var _didIteratorError2 = false;
				var _iteratorError2 = undefined;

				try {
					for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
						var currentValue = _step2.value;

						if (currentValue >= n && currentValue < m) {
							m = currentValue;
						}
					}

					// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
					// but guard against overflow.
				} catch (err) {
					_didIteratorError2 = true;
					_iteratorError2 = err;
				} finally {
					try {
						if (!_iteratorNormalCompletion2 && _iterator2.return) {
							_iterator2.return();
						}
					} finally {
						if (_didIteratorError2) {
							throw _iteratorError2;
						}
					}
				}

				var handledCPCountPlusOne = handledCPCount + 1;
				if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
					error$1('overflow');
				}

				delta += (m - n) * handledCPCountPlusOne;
				n = m;

				var _iteratorNormalCompletion3 = true;
				var _didIteratorError3 = false;
				var _iteratorError3 = undefined;

				try {
					for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
						var _currentValue = _step3.value;

						if (_currentValue < n && ++delta > maxInt) {
							error$1('overflow');
						}
						if (_currentValue == n) {
							// Represent delta as a generalized variable-length integer.
							var q = delta;
							for (var k = base;; /* no condition */k += base) {
								var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
								if (q < t) {
									break;
								}
								var qMinusT = q - t;
								var baseMinusT = base - t;
								output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
								q = floor(qMinusT / baseMinusT);
							}

							output.push(stringFromCharCode(digitToBasic(q, 0)));
							bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
							delta = 0;
							++handledCPCount;
						}
					}
				} catch (err) {
					_didIteratorError3 = true;
					_iteratorError3 = err;
				} finally {
					try {
						if (!_iteratorNormalCompletion3 && _iterator3.return) {
							_iterator3.return();
						}
					} finally {
						if (_didIteratorError3) {
							throw _iteratorError3;
						}
					}
				}

				++delta;
				++n;
			}
			return output.join('');
		};

		/**
		 * Converts a Punycode string representing a domain name or an email address
		 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
		 * it doesn't matter if you call it on a string that has already been
		 * converted to Unicode.
		 * @memberOf punycode
		 * @param {String} input The Punycoded domain name or email address to
		 * convert to Unicode.
		 * @returns {String} The Unicode representation of the given Punycode
		 * string.
		 */
		var toUnicode = function toUnicode(input) {
			return mapDomain(input, function (string) {
				return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
			});
		};

		/**
		 * Converts a Unicode string representing a domain name or an email address to
		 * Punycode. Only the non-ASCII parts of the domain name will be converted,
		 * i.e. it doesn't matter if you call it with a domain that's already in
		 * ASCII.
		 * @memberOf punycode
		 * @param {String} input The domain name or email address to convert, as a
		 * Unicode string.
		 * @returns {String} The Punycode representation of the given domain name or
		 * email address.
		 */
		var toASCII = function toASCII(input) {
			return mapDomain(input, function (string) {
				return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
			});
		};

		/*--------------------------------------------------------------------------*/

		/** Define the public API */
		var punycode = {
			/**
		  * A string representing the current Punycode.js version number.
		  * @memberOf punycode
		  * @type String
		  */
			'version': '2.1.0',
			/**
		  * An object of methods to convert from JavaScript's internal character
		  * representation (UCS-2) to Unicode code points, and back.
		  * @see <https://mathiasbynens.be/notes/javascript-encoding>
		  * @memberOf punycode
		  * @type Object
		  */
			'ucs2': {
				'decode': ucs2decode,
				'encode': ucs2encode
			},
			'decode': decode,
			'encode': encode,
			'toASCII': toASCII,
			'toUnicode': toUnicode
		};

		/**
		 * URI.js
		 *
		 * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
		 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
		 * @see http://github.com/garycourt/uri-js
		 */
		/**
		 * Copyright 2011 Gary Court. All rights reserved.
		 *
		 * Redistribution and use in source and binary forms, with or without modification, are
		 * permitted provided that the following conditions are met:
		 *
		 *    1. Redistributions of source code must retain the above copyright notice, this list of
		 *       conditions and the following disclaimer.
		 *
		 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
		 *       of conditions and the following disclaimer in the documentation and/or other materials
		 *       provided with the distribution.
		 *
		 * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
		 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
		 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
		 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
		 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
		 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
		 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
		 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
		 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
		 *
		 * The views and conclusions contained in the software and documentation are those of the
		 * authors and should not be interpreted as representing official policies, either expressed
		 * or implied, of Gary Court.
		 */
		var SCHEMES = {};
		function pctEncChar(chr) {
		    var c = chr.charCodeAt(0);
		    var e = void 0;
		    if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
		    return e;
		}
		function pctDecChars(str) {
		    var newStr = "";
		    var i = 0;
		    var il = str.length;
		    while (i < il) {
		        var c = parseInt(str.substr(i + 1, 2), 16);
		        if (c < 128) {
		            newStr += String.fromCharCode(c);
		            i += 3;
		        } else if (c >= 194 && c < 224) {
		            if (il - i >= 6) {
		                var c2 = parseInt(str.substr(i + 4, 2), 16);
		                newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
		            } else {
		                newStr += str.substr(i, 6);
		            }
		            i += 6;
		        } else if (c >= 224) {
		            if (il - i >= 9) {
		                var _c = parseInt(str.substr(i + 4, 2), 16);
		                var c3 = parseInt(str.substr(i + 7, 2), 16);
		                newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
		            } else {
		                newStr += str.substr(i, 9);
		            }
		            i += 9;
		        } else {
		            newStr += str.substr(i, 3);
		            i += 3;
		        }
		    }
		    return newStr;
		}
		function _normalizeComponentEncoding(components, protocol) {
		    function decodeUnreserved(str) {
		        var decStr = pctDecChars(str);
		        return !decStr.match(protocol.UNRESERVED) ? str : decStr;
		    }
		    if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
		    if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
		    if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
		    if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
		    if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
		    if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
		    return components;
		}

		function _stripLeadingZeros(str) {
		    return str.replace(/^0*(.*)/, "$1") || "0";
		}
		function _normalizeIPv4(host, protocol) {
		    var matches = host.match(protocol.IPV4ADDRESS) || [];

		    var _matches = slicedToArray(matches, 2),
		        address = _matches[1];

		    if (address) {
		        return address.split(".").map(_stripLeadingZeros).join(".");
		    } else {
		        return host;
		    }
		}
		function _normalizeIPv6(host, protocol) {
		    var matches = host.match(protocol.IPV6ADDRESS) || [];

		    var _matches2 = slicedToArray(matches, 3),
		        address = _matches2[1],
		        zone = _matches2[2];

		    if (address) {
		        var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
		            _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
		            last = _address$toLowerCase$2[0],
		            first = _address$toLowerCase$2[1];

		        var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
		        var lastFields = last.split(":").map(_stripLeadingZeros);
		        var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
		        var fieldCount = isLastFieldIPv4Address ? 7 : 8;
		        var lastFieldsStart = lastFields.length - fieldCount;
		        var fields = Array(fieldCount);
		        for (var x = 0; x < fieldCount; ++x) {
		            fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
		        }
		        if (isLastFieldIPv4Address) {
		            fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
		        }
		        var allZeroFields = fields.reduce(function (acc, field, index) {
		            if (!field || field === "0") {
		                var lastLongest = acc[acc.length - 1];
		                if (lastLongest && lastLongest.index + lastLongest.length === index) {
		                    lastLongest.length++;
		                } else {
		                    acc.push({ index: index, length: 1 });
		                }
		            }
		            return acc;
		        }, []);
		        var longestZeroFields = allZeroFields.sort(function (a, b) {
		            return b.length - a.length;
		        })[0];
		        var newHost = void 0;
		        if (longestZeroFields && longestZeroFields.length > 1) {
		            var newFirst = fields.slice(0, longestZeroFields.index);
		            var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
		            newHost = newFirst.join(":") + "::" + newLast.join(":");
		        } else {
		            newHost = fields.join(":");
		        }
		        if (zone) {
		            newHost += "%" + zone;
		        }
		        return newHost;
		    } else {
		        return host;
		    }
		}
		var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
		var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
		function parse(uriString) {
		    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

		    var components = {};
		    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
		    if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
		    var matches = uriString.match(URI_PARSE);
		    if (matches) {
		        if (NO_MATCH_IS_UNDEFINED) {
		            //store each component
		            components.scheme = matches[1];
		            components.userinfo = matches[3];
		            components.host = matches[4];
		            components.port = parseInt(matches[5], 10);
		            components.path = matches[6] || "";
		            components.query = matches[7];
		            components.fragment = matches[8];
		            //fix port number
		            if (isNaN(components.port)) {
		                components.port = matches[5];
		            }
		        } else {
		            //IE FIX for improper RegExp matching
		            //store each component
		            components.scheme = matches[1] || undefined;
		            components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
		            components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
		            components.port = parseInt(matches[5], 10);
		            components.path = matches[6] || "";
		            components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
		            components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
		            //fix port number
		            if (isNaN(components.port)) {
		                components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
		            }
		        }
		        if (components.host) {
		            //normalize IP hosts
		            components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
		        }
		        //determine reference type
		        if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
		            components.reference = "same-document";
		        } else if (components.scheme === undefined) {
		            components.reference = "relative";
		        } else if (components.fragment === undefined) {
		            components.reference = "absolute";
		        } else {
		            components.reference = "uri";
		        }
		        //check for reference errors
		        if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
		            components.error = components.error || "URI is not a " + options.reference + " reference.";
		        }
		        //find scheme handler
		        var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
		        //check if scheme can't handle IRIs
		        if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
		            //if host component is a domain name
		            if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
		                //convert Unicode IDN -> ASCII IDN
		                try {
		                    components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
		                } catch (e) {
		                    components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
		                }
		            }
		            //convert IRI -> URI
		            _normalizeComponentEncoding(components, URI_PROTOCOL);
		        } else {
		            //normalize encodings
		            _normalizeComponentEncoding(components, protocol);
		        }
		        //perform scheme specific parsing
		        if (schemeHandler && schemeHandler.parse) {
		            schemeHandler.parse(components, options);
		        }
		    } else {
		        components.error = components.error || "URI can not be parsed.";
		    }
		    return components;
		}

		function _recomposeAuthority(components, options) {
		    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
		    var uriTokens = [];
		    if (components.userinfo !== undefined) {
		        uriTokens.push(components.userinfo);
		        uriTokens.push("@");
		    }
		    if (components.host !== undefined) {
		        //normalize IP hosts, add brackets and escape zone separator for IPv6
		        uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
		            return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
		        }));
		    }
		    if (typeof components.port === "number" || typeof components.port === "string") {
		        uriTokens.push(":");
		        uriTokens.push(String(components.port));
		    }
		    return uriTokens.length ? uriTokens.join("") : undefined;
		}

		var RDS1 = /^\.\.?\//;
		var RDS2 = /^\/\.(\/|$)/;
		var RDS3 = /^\/\.\.(\/|$)/;
		var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
		function removeDotSegments(input) {
		    var output = [];
		    while (input.length) {
		        if (input.match(RDS1)) {
		            input = input.replace(RDS1, "");
		        } else if (input.match(RDS2)) {
		            input = input.replace(RDS2, "/");
		        } else if (input.match(RDS3)) {
		            input = input.replace(RDS3, "/");
		            output.pop();
		        } else if (input === "." || input === "..") {
		            input = "";
		        } else {
		            var im = input.match(RDS5);
		            if (im) {
		                var s = im[0];
		                input = input.slice(s.length);
		                output.push(s);
		            } else {
		                throw new Error("Unexpected dot segment condition");
		            }
		        }
		    }
		    return output.join("");
		}

		function serialize(components) {
		    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

		    var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
		    var uriTokens = [];
		    //find scheme handler
		    var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
		    //perform scheme specific serialization
		    if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
		    if (components.host) {
		        //if host component is an IPv6 address
		        if (protocol.IPV6ADDRESS.test(components.host)) ;
		        //TODO: normalize IPv6 address as per RFC 5952

		        //if host component is a domain name
		        else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
		                //convert IDN via punycode
		                try {
		                    components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
		                } catch (e) {
		                    components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
		                }
		            }
		    }
		    //normalize encoding
		    _normalizeComponentEncoding(components, protocol);
		    if (options.reference !== "suffix" && components.scheme) {
		        uriTokens.push(components.scheme);
		        uriTokens.push(":");
		    }
		    var authority = _recomposeAuthority(components, options);
		    if (authority !== undefined) {
		        if (options.reference !== "suffix") {
		            uriTokens.push("//");
		        }
		        uriTokens.push(authority);
		        if (components.path && components.path.charAt(0) !== "/") {
		            uriTokens.push("/");
		        }
		    }
		    if (components.path !== undefined) {
		        var s = components.path;
		        if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
		            s = removeDotSegments(s);
		        }
		        if (authority === undefined) {
		            s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
		        }
		        uriTokens.push(s);
		    }
		    if (components.query !== undefined) {
		        uriTokens.push("?");
		        uriTokens.push(components.query);
		    }
		    if (components.fragment !== undefined) {
		        uriTokens.push("#");
		        uriTokens.push(components.fragment);
		    }
		    return uriTokens.join(""); //merge tokens into a string
		}

		function resolveComponents(base, relative) {
		    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
		    var skipNormalization = arguments[3];

		    var target = {};
		    if (!skipNormalization) {
		        base = parse(serialize(base, options), options); //normalize base components
		        relative = parse(serialize(relative, options), options); //normalize relative components
		    }
		    options = options || {};
		    if (!options.tolerant && relative.scheme) {
		        target.scheme = relative.scheme;
		        //target.authority = relative.authority;
		        target.userinfo = relative.userinfo;
		        target.host = relative.host;
		        target.port = relative.port;
		        target.path = removeDotSegments(relative.path || "");
		        target.query = relative.query;
		    } else {
		        if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
		            //target.authority = relative.authority;
		            target.userinfo = relative.userinfo;
		            target.host = relative.host;
		            target.port = relative.port;
		            target.path = removeDotSegments(relative.path || "");
		            target.query = relative.query;
		        } else {
		            if (!relative.path) {
		                target.path = base.path;
		                if (relative.query !== undefined) {
		                    target.query = relative.query;
		                } else {
		                    target.query = base.query;
		                }
		            } else {
		                if (relative.path.charAt(0) === "/") {
		                    target.path = removeDotSegments(relative.path);
		                } else {
		                    if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
		                        target.path = "/" + relative.path;
		                    } else if (!base.path) {
		                        target.path = relative.path;
		                    } else {
		                        target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
		                    }
		                    target.path = removeDotSegments(target.path);
		                }
		                target.query = relative.query;
		            }
		            //target.authority = base.authority;
		            target.userinfo = base.userinfo;
		            target.host = base.host;
		            target.port = base.port;
		        }
		        target.scheme = base.scheme;
		    }
		    target.fragment = relative.fragment;
		    return target;
		}

		function resolve(baseURI, relativeURI, options) {
		    var schemelessOptions = assign({ scheme: 'null' }, options);
		    return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
		}

		function normalize(uri, options) {
		    if (typeof uri === "string") {
		        uri = serialize(parse(uri, options), options);
		    } else if (typeOf(uri) === "object") {
		        uri = parse(serialize(uri, options), options);
		    }
		    return uri;
		}

		function equal(uriA, uriB, options) {
		    if (typeof uriA === "string") {
		        uriA = serialize(parse(uriA, options), options);
		    } else if (typeOf(uriA) === "object") {
		        uriA = serialize(uriA, options);
		    }
		    if (typeof uriB === "string") {
		        uriB = serialize(parse(uriB, options), options);
		    } else if (typeOf(uriB) === "object") {
		        uriB = serialize(uriB, options);
		    }
		    return uriA === uriB;
		}

		function escapeComponent(str, options) {
		    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
		}

		function unescapeComponent(str, options) {
		    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
		}

		var handler = {
		    scheme: "http",
		    domainHost: true,
		    parse: function parse(components, options) {
		        //report missing host
		        if (!components.host) {
		            components.error = components.error || "HTTP URIs must have a host.";
		        }
		        return components;
		    },
		    serialize: function serialize(components, options) {
		        var secure = String(components.scheme).toLowerCase() === "https";
		        //normalize the default port
		        if (components.port === (secure ? 443 : 80) || components.port === "") {
		            components.port = undefined;
		        }
		        //normalize the empty path
		        if (!components.path) {
		            components.path = "/";
		        }
		        //NOTE: We do not parse query strings for HTTP URIs
		        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
		        //and not the HTTP spec.
		        return components;
		    }
		};

		var handler$1 = {
		    scheme: "https",
		    domainHost: handler.domainHost,
		    parse: handler.parse,
		    serialize: handler.serialize
		};

		function isSecure(wsComponents) {
		    return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
		}
		//RFC 6455
		var handler$2 = {
		    scheme: "ws",
		    domainHost: true,
		    parse: function parse(components, options) {
		        var wsComponents = components;
		        //indicate if the secure flag is set
		        wsComponents.secure = isSecure(wsComponents);
		        //construct resouce name
		        wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
		        wsComponents.path = undefined;
		        wsComponents.query = undefined;
		        return wsComponents;
		    },
		    serialize: function serialize(wsComponents, options) {
		        //normalize the default port
		        if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
		            wsComponents.port = undefined;
		        }
		        //ensure scheme matches secure flag
		        if (typeof wsComponents.secure === 'boolean') {
		            wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
		            wsComponents.secure = undefined;
		        }
		        //reconstruct path from resource name
		        if (wsComponents.resourceName) {
		            var _wsComponents$resourc = wsComponents.resourceName.split('?'),
		                _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
		                path = _wsComponents$resourc2[0],
		                query = _wsComponents$resourc2[1];

		            wsComponents.path = path && path !== '/' ? path : undefined;
		            wsComponents.query = query;
		            wsComponents.resourceName = undefined;
		        }
		        //forbid fragment component
		        wsComponents.fragment = undefined;
		        return wsComponents;
		    }
		};

		var handler$3 = {
		    scheme: "wss",
		    domainHost: handler$2.domainHost,
		    parse: handler$2.parse,
		    serialize: handler$2.serialize
		};

		var O = {};
		//RFC 3986
		var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
		var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
		var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
		//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
		//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
		//const WSP$$ = "[\\x20\\x09]";
		//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]";  //(%d1-8 / %d11-12 / %d14-31 / %d127)
		//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext
		//const VCHAR$$ = "[\\x21-\\x7E]";
		//const WSP$$ = "[\\x20\\x09]";
		//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext
		//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
		//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
		//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
		var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
		var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
		var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
		var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
		var UNRESERVED = new RegExp(UNRESERVED$$, "g");
		var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
		var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
		var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
		var NOT_HFVALUE = NOT_HFNAME;
		function decodeUnreserved(str) {
		    var decStr = pctDecChars(str);
		    return !decStr.match(UNRESERVED) ? str : decStr;
		}
		var handler$4 = {
		    scheme: "mailto",
		    parse: function parse$$1(components, options) {
		        var mailtoComponents = components;
		        var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
		        mailtoComponents.path = undefined;
		        if (mailtoComponents.query) {
		            var unknownHeaders = false;
		            var headers = {};
		            var hfields = mailtoComponents.query.split("&");
		            for (var x = 0, xl = hfields.length; x < xl; ++x) {
		                var hfield = hfields[x].split("=");
		                switch (hfield[0]) {
		                    case "to":
		                        var toAddrs = hfield[1].split(",");
		                        for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
		                            to.push(toAddrs[_x]);
		                        }
		                        break;
		                    case "subject":
		                        mailtoComponents.subject = unescapeComponent(hfield[1], options);
		                        break;
		                    case "body":
		                        mailtoComponents.body = unescapeComponent(hfield[1], options);
		                        break;
		                    default:
		                        unknownHeaders = true;
		                        headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
		                        break;
		                }
		            }
		            if (unknownHeaders) mailtoComponents.headers = headers;
		        }
		        mailtoComponents.query = undefined;
		        for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
		            var addr = to[_x2].split("@");
		            addr[0] = unescapeComponent(addr[0]);
		            if (!options.unicodeSupport) {
		                //convert Unicode IDN -> ASCII IDN
		                try {
		                    addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
		                } catch (e) {
		                    mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
		                }
		            } else {
		                addr[1] = unescapeComponent(addr[1], options).toLowerCase();
		            }
		            to[_x2] = addr.join("@");
		        }
		        return mailtoComponents;
		    },
		    serialize: function serialize$$1(mailtoComponents, options) {
		        var components = mailtoComponents;
		        var to = toArray(mailtoComponents.to);
		        if (to) {
		            for (var x = 0, xl = to.length; x < xl; ++x) {
		                var toAddr = String(to[x]);
		                var atIdx = toAddr.lastIndexOf("@");
		                var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
		                var domain = toAddr.slice(atIdx + 1);
		                //convert IDN via punycode
		                try {
		                    domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
		                } catch (e) {
		                    components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
		                }
		                to[x] = localPart + "@" + domain;
		            }
		            components.path = to.join(",");
		        }
		        var headers = mailtoComponents.headers = mailtoComponents.headers || {};
		        if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
		        if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
		        var fields = [];
		        for (var name in headers) {
		            if (headers[name] !== O[name]) {
		                fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
		            }
		        }
		        if (fields.length) {
		            components.query = fields.join("&");
		        }
		        return components;
		    }
		};

		var URN_PARSE = /^([^\:]+)\:(.*)/;
		//RFC 2141
		var handler$5 = {
		    scheme: "urn",
		    parse: function parse$$1(components, options) {
		        var matches = components.path && components.path.match(URN_PARSE);
		        var urnComponents = components;
		        if (matches) {
		            var scheme = options.scheme || urnComponents.scheme || "urn";
		            var nid = matches[1].toLowerCase();
		            var nss = matches[2];
		            var urnScheme = scheme + ":" + (options.nid || nid);
		            var schemeHandler = SCHEMES[urnScheme];
		            urnComponents.nid = nid;
		            urnComponents.nss = nss;
		            urnComponents.path = undefined;
		            if (schemeHandler) {
		                urnComponents = schemeHandler.parse(urnComponents, options);
		            }
		        } else {
		            urnComponents.error = urnComponents.error || "URN can not be parsed.";
		        }
		        return urnComponents;
		    },
		    serialize: function serialize$$1(urnComponents, options) {
		        var scheme = options.scheme || urnComponents.scheme || "urn";
		        var nid = urnComponents.nid;
		        var urnScheme = scheme + ":" + (options.nid || nid);
		        var schemeHandler = SCHEMES[urnScheme];
		        if (schemeHandler) {
		            urnComponents = schemeHandler.serialize(urnComponents, options);
		        }
		        var uriComponents = urnComponents;
		        var nss = urnComponents.nss;
		        uriComponents.path = (nid || options.nid) + ":" + nss;
		        return uriComponents;
		    }
		};

		var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
		//RFC 4122
		var handler$6 = {
		    scheme: "urn:uuid",
		    parse: function parse(urnComponents, options) {
		        var uuidComponents = urnComponents;
		        uuidComponents.uuid = uuidComponents.nss;
		        uuidComponents.nss = undefined;
		        if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
		            uuidComponents.error = uuidComponents.error || "UUID is not valid.";
		        }
		        return uuidComponents;
		    },
		    serialize: function serialize(uuidComponents, options) {
		        var urnComponents = uuidComponents;
		        //normalize UUID
		        urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
		        return urnComponents;
		    }
		};

		SCHEMES[handler.scheme] = handler;
		SCHEMES[handler$1.scheme] = handler$1;
		SCHEMES[handler$2.scheme] = handler$2;
		SCHEMES[handler$3.scheme] = handler$3;
		SCHEMES[handler$4.scheme] = handler$4;
		SCHEMES[handler$5.scheme] = handler$5;
		SCHEMES[handler$6.scheme] = handler$6;

		exports.SCHEMES = SCHEMES;
		exports.pctEncChar = pctEncChar;
		exports.pctDecChars = pctDecChars;
		exports.parse = parse;
		exports.removeDotSegments = removeDotSegments;
		exports.serialize = serialize;
		exports.resolveComponents = resolveComponents;
		exports.resolve = resolve;
		exports.normalize = normalize;
		exports.equal = equal;
		exports.escapeComponent = escapeComponent;
		exports.unescapeComponent = unescapeComponent;

		Object.defineProperty(exports, '__esModule', { value: true });

		})));
		
	} (uri_all, uri_all.exports));
	return uri_all.exports;
}

var fastDeepEqual;
var hasRequiredFastDeepEqual;

function requireFastDeepEqual () {
	if (hasRequiredFastDeepEqual) return fastDeepEqual;
	hasRequiredFastDeepEqual = 1;

	// do not edit .js files directly - edit src/index.jst



	fastDeepEqual = function equal(a, b) {
	  if (a === b) return true;

	  if (a && b && typeof a == 'object' && typeof b == 'object') {
	    if (a.constructor !== b.constructor) return false;

	    var length, i, keys;
	    if (Array.isArray(a)) {
	      length = a.length;
	      if (length != b.length) return false;
	      for (i = length; i-- !== 0;)
	        if (!equal(a[i], b[i])) return false;
	      return true;
	    }



	    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
	    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
	    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

	    keys = Object.keys(a);
	    length = keys.length;
	    if (length !== Object.keys(b).length) return false;

	    for (i = length; i-- !== 0;)
	      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

	    for (i = length; i-- !== 0;) {
	      var key = keys[i];

	      if (!equal(a[key], b[key])) return false;
	    }

	    return true;
	  }

	  // true if both NaN, false otherwise
	  return a!==a && b!==b;
	};
	return fastDeepEqual;
}

var ucs2length;
var hasRequiredUcs2length;

function requireUcs2length () {
	if (hasRequiredUcs2length) return ucs2length;
	hasRequiredUcs2length = 1;

	// https://mathiasbynens.be/notes/javascript-encoding
	// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
	ucs2length = function ucs2length(str) {
	  var length = 0
	    , len = str.length
	    , pos = 0
	    , value;
	  while (pos < len) {
	    length++;
	    value = str.charCodeAt(pos++);
	    if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
	      // high surrogate, and there is a next character
	      value = str.charCodeAt(pos);
	      if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
	    }
	  }
	  return length;
	};
	return ucs2length;
}

var util;
var hasRequiredUtil;

function requireUtil () {
	if (hasRequiredUtil) return util;
	hasRequiredUtil = 1;


	util = {
	  copy: copy,
	  checkDataType: checkDataType,
	  checkDataTypes: checkDataTypes,
	  coerceToTypes: coerceToTypes,
	  toHash: toHash,
	  getProperty: getProperty,
	  escapeQuotes: escapeQuotes,
	  equal: requireFastDeepEqual(),
	  ucs2length: requireUcs2length(),
	  varOccurences: varOccurences,
	  varReplace: varReplace,
	  schemaHasRules: schemaHasRules,
	  schemaHasRulesExcept: schemaHasRulesExcept,
	  schemaUnknownRules: schemaUnknownRules,
	  toQuotedString: toQuotedString,
	  getPathExpr: getPathExpr,
	  getPath: getPath,
	  getData: getData,
	  unescapeFragment: unescapeFragment,
	  unescapeJsonPointer: unescapeJsonPointer,
	  escapeFragment: escapeFragment,
	  escapeJsonPointer: escapeJsonPointer
	};


	function copy(o, to) {
	  to = to || {};
	  for (var key in o) to[key] = o[key];
	  return to;
	}


	function checkDataType(dataType, data, strictNumbers, negate) {
	  var EQUAL = negate ? ' !== ' : ' === '
	    , AND = negate ? ' || ' : ' && '
	    , OK = negate ? '!' : ''
	    , NOT = negate ? '' : '!';
	  switch (dataType) {
	    case 'null': return data + EQUAL + 'null';
	    case 'array': return OK + 'Array.isArray(' + data + ')';
	    case 'object': return '(' + OK + data + AND +
	                          'typeof ' + data + EQUAL + '"object"' + AND +
	                          NOT + 'Array.isArray(' + data + '))';
	    case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
	                           NOT + '(' + data + ' % 1)' +
	                           AND + data + EQUAL + data +
	                           (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
	    case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' +
	                          (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
	    default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
	  }
	}


	function checkDataTypes(dataTypes, data, strictNumbers) {
	  switch (dataTypes.length) {
	    case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
	    default:
	      var code = '';
	      var types = toHash(dataTypes);
	      if (types.array && types.object) {
	        code = types.null ? '(': '(!' + data + ' || ';
	        code += 'typeof ' + data + ' !== "object")';
	        delete types.null;
	        delete types.array;
	        delete types.object;
	      }
	      if (types.number) delete types.integer;
	      for (var t in types)
	        code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);

	      return code;
	  }
	}


	var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
	function coerceToTypes(optionCoerceTypes, dataTypes) {
	  if (Array.isArray(dataTypes)) {
	    var types = [];
	    for (var i=0; i<dataTypes.length; i++) {
	      var t = dataTypes[i];
	      if (COERCE_TO_TYPES[t]) types[types.length] = t;
	      else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
	    }
	    if (types.length) return types;
	  } else if (COERCE_TO_TYPES[dataTypes]) {
	    return [dataTypes];
	  } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
	    return ['array'];
	  }
	}


	function toHash(arr) {
	  var hash = {};
	  for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
	  return hash;
	}


	var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
	var SINGLE_QUOTE = /'|\\/g;
	function getProperty(key) {
	  return typeof key == 'number'
	          ? '[' + key + ']'
	          : IDENTIFIER.test(key)
	            ? '.' + key
	            : "['" + escapeQuotes(key) + "']";
	}


	function escapeQuotes(str) {
	  return str.replace(SINGLE_QUOTE, '\\$&')
	            .replace(/\n/g, '\\n')
	            .replace(/\r/g, '\\r')
	            .replace(/\f/g, '\\f')
	            .replace(/\t/g, '\\t');
	}


	function varOccurences(str, dataVar) {
	  dataVar += '[^0-9]';
	  var matches = str.match(new RegExp(dataVar, 'g'));
	  return matches ? matches.length : 0;
	}


	function varReplace(str, dataVar, expr) {
	  dataVar += '([^0-9])';
	  expr = expr.replace(/\$/g, '$$$$');
	  return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
	}


	function schemaHasRules(schema, rules) {
	  if (typeof schema == 'boolean') return !schema;
	  for (var key in schema) if (rules[key]) return true;
	}


	function schemaHasRulesExcept(schema, rules, exceptKeyword) {
	  if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';
	  for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
	}


	function schemaUnknownRules(schema, rules) {
	  if (typeof schema == 'boolean') return;
	  for (var key in schema) if (!rules[key]) return key;
	}


	function toQuotedString(str) {
	  return '\'' + escapeQuotes(str) + '\'';
	}


	function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
	  var path = jsonPointers // false by default
	              ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
	              : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
	  return joinPaths(currentPath, path);
	}


	function getPath(currentPath, prop, jsonPointers) {
	  var path = jsonPointers // false by default
	              ? toQuotedString('/' + escapeJsonPointer(prop))
	              : toQuotedString(getProperty(prop));
	  return joinPaths(currentPath, path);
	}


	var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
	var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
	function getData($data, lvl, paths) {
	  var up, jsonPointer, data, matches;
	  if ($data === '') return 'rootData';
	  if ($data[0] == '/') {
	    if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
	    jsonPointer = $data;
	    data = 'rootData';
	  } else {
	    matches = $data.match(RELATIVE_JSON_POINTER);
	    if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
	    up = +matches[1];
	    jsonPointer = matches[2];
	    if (jsonPointer == '#') {
	      if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
	      return paths[lvl - up];
	    }

	    if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
	    data = 'data' + ((lvl - up) || '');
	    if (!jsonPointer) return data;
	  }

	  var expr = data;
	  var segments = jsonPointer.split('/');
	  for (var i=0; i<segments.length; i++) {
	    var segment = segments[i];
	    if (segment) {
	      data += getProperty(unescapeJsonPointer(segment));
	      expr += ' && ' + data;
	    }
	  }
	  return expr;
	}


	function joinPaths (a, b) {
	  if (a == '""') return b;
	  return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1');
	}


	function unescapeFragment(str) {
	  return unescapeJsonPointer(decodeURIComponent(str));
	}


	function escapeFragment(str) {
	  return encodeURIComponent(escapeJsonPointer(str));
	}


	function escapeJsonPointer(str) {
	  return str.replace(/~/g, '~0').replace(/\//g, '~1');
	}


	function unescapeJsonPointer(str) {
	  return str.replace(/~1/g, '/').replace(/~0/g, '~');
	}
	return util;
}

var schema_obj;
var hasRequiredSchema_obj;

function requireSchema_obj () {
	if (hasRequiredSchema_obj) return schema_obj;
	hasRequiredSchema_obj = 1;

	var util = requireUtil();

	schema_obj = SchemaObject;

	function SchemaObject(obj) {
	  util.copy(obj, this);
	}
	return schema_obj;
}

var jsonSchemaTraverse = {exports: {}};

var hasRequiredJsonSchemaTraverse;

function requireJsonSchemaTraverse () {
	if (hasRequiredJsonSchemaTraverse) return jsonSchemaTraverse.exports;
	hasRequiredJsonSchemaTraverse = 1;

	var traverse = jsonSchemaTraverse.exports = function (schema, opts, cb) {
	  // Legacy support for v0.3.1 and earlier.
	  if (typeof opts == 'function') {
	    cb = opts;
	    opts = {};
	  }

	  cb = opts.cb || cb;
	  var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
	  var post = cb.post || function() {};

	  _traverse(opts, pre, post, schema, '', schema);
	};


	traverse.keywords = {
	  additionalItems: true,
	  items: true,
	  contains: true,
	  additionalProperties: true,
	  propertyNames: true,
	  not: true
	};

	traverse.arrayKeywords = {
	  items: true,
	  allOf: true,
	  anyOf: true,
	  oneOf: true
	};

	traverse.propsKeywords = {
	  definitions: true,
	  properties: true,
	  patternProperties: true,
	  dependencies: true
	};

	traverse.skipKeywords = {
	  default: true,
	  enum: true,
	  const: true,
	  required: true,
	  maximum: true,
	  minimum: true,
	  exclusiveMaximum: true,
	  exclusiveMinimum: true,
	  multipleOf: true,
	  maxLength: true,
	  minLength: true,
	  pattern: true,
	  format: true,
	  maxItems: true,
	  minItems: true,
	  uniqueItems: true,
	  maxProperties: true,
	  minProperties: true
	};


	function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
	  if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
	    pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
	    for (var key in schema) {
	      var sch = schema[key];
	      if (Array.isArray(sch)) {
	        if (key in traverse.arrayKeywords) {
	          for (var i=0; i<sch.length; i++)
	            _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
	        }
	      } else if (key in traverse.propsKeywords) {
	        if (sch && typeof sch == 'object') {
	          for (var prop in sch)
	            _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
	        }
	      } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
	        _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
	      }
	    }
	    post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
	  }
	}


	function escapeJsonPtr(str) {
	  return str.replace(/~/g, '~0').replace(/\//g, '~1');
	}
	return jsonSchemaTraverse.exports;
}

var resolve_1;
var hasRequiredResolve;

function requireResolve () {
	if (hasRequiredResolve) return resolve_1;
	hasRequiredResolve = 1;

	var URI = requireUri_all()
	  , equal = requireFastDeepEqual()
	  , util = requireUtil()
	  , SchemaObject = requireSchema_obj()
	  , traverse = requireJsonSchemaTraverse();

	resolve_1 = resolve;

	resolve.normalizeId = normalizeId;
	resolve.fullPath = getFullPath;
	resolve.url = resolveUrl;
	resolve.ids = resolveIds;
	resolve.inlineRef = inlineRef;
	resolve.schema = resolveSchema;

	/**
	 * [resolve and compile the references ($ref)]
	 * @this   Ajv
	 * @param  {Function} compile reference to schema compilation funciton (localCompile)
	 * @param  {Object} root object with information about the root schema for the current schema
	 * @param  {String} ref reference to resolve
	 * @return {Object|Function} schema object (if the schema can be inlined) or validation function
	 */
	function resolve(compile, root, ref) {
	  /* jshint validthis: true */
	  var refVal = this._refs[ref];
	  if (typeof refVal == 'string') {
	    if (this._refs[refVal]) refVal = this._refs[refVal];
	    else return resolve.call(this, compile, root, refVal);
	  }

	  refVal = refVal || this._schemas[ref];
	  if (refVal instanceof SchemaObject) {
	    return inlineRef(refVal.schema, this._opts.inlineRefs)
	            ? refVal.schema
	            : refVal.validate || this._compile(refVal);
	  }

	  var res = resolveSchema.call(this, root, ref);
	  var schema, v, baseId;
	  if (res) {
	    schema = res.schema;
	    root = res.root;
	    baseId = res.baseId;
	  }

	  if (schema instanceof SchemaObject) {
	    v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
	  } else if (schema !== undefined) {
	    v = inlineRef(schema, this._opts.inlineRefs)
	        ? schema
	        : compile.call(this, schema, root, undefined, baseId);
	  }

	  return v;
	}


	/**
	 * Resolve schema, its root and baseId
	 * @this Ajv
	 * @param  {Object} root root object with properties schema, refVal, refs
	 * @param  {String} ref  reference to resolve
	 * @return {Object} object with properties schema, root, baseId
	 */
	function resolveSchema(root, ref) {
	  /* jshint validthis: true */
	  var p = URI.parse(ref)
	    , refPath = _getFullPath(p)
	    , baseId = getFullPath(this._getId(root.schema));
	  if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
	    var id = normalizeId(refPath);
	    var refVal = this._refs[id];
	    if (typeof refVal == 'string') {
	      return resolveRecursive.call(this, root, refVal, p);
	    } else if (refVal instanceof SchemaObject) {
	      if (!refVal.validate) this._compile(refVal);
	      root = refVal;
	    } else {
	      refVal = this._schemas[id];
	      if (refVal instanceof SchemaObject) {
	        if (!refVal.validate) this._compile(refVal);
	        if (id == normalizeId(ref))
	          return { schema: refVal, root: root, baseId: baseId };
	        root = refVal;
	      } else {
	        return;
	      }
	    }
	    if (!root.schema) return;
	    baseId = getFullPath(this._getId(root.schema));
	  }
	  return getJsonPointer.call(this, p, baseId, root.schema, root);
	}


	/* @this Ajv */
	function resolveRecursive(root, ref, parsedRef) {
	  /* jshint validthis: true */
	  var res = resolveSchema.call(this, root, ref);
	  if (res) {
	    var schema = res.schema;
	    var baseId = res.baseId;
	    root = res.root;
	    var id = this._getId(schema);
	    if (id) baseId = resolveUrl(baseId, id);
	    return getJsonPointer.call(this, parsedRef, baseId, schema, root);
	  }
	}


	var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
	/* @this Ajv */
	function getJsonPointer(parsedRef, baseId, schema, root) {
	  /* jshint validthis: true */
	  parsedRef.fragment = parsedRef.fragment || '';
	  if (parsedRef.fragment.slice(0,1) != '/') return;
	  var parts = parsedRef.fragment.split('/');

	  for (var i = 1; i < parts.length; i++) {
	    var part = parts[i];
	    if (part) {
	      part = util.unescapeFragment(part);
	      schema = schema[part];
	      if (schema === undefined) break;
	      var id;
	      if (!PREVENT_SCOPE_CHANGE[part]) {
	        id = this._getId(schema);
	        if (id) baseId = resolveUrl(baseId, id);
	        if (schema.$ref) {
	          var $ref = resolveUrl(baseId, schema.$ref);
	          var res = resolveSchema.call(this, root, $ref);
	          if (res) {
	            schema = res.schema;
	            root = res.root;
	            baseId = res.baseId;
	          }
	        }
	      }
	    }
	  }
	  if (schema !== undefined && schema !== root.schema)
	    return { schema: schema, root: root, baseId: baseId };
	}


	var SIMPLE_INLINED = util.toHash([
	  'type', 'format', 'pattern',
	  'maxLength', 'minLength',
	  'maxProperties', 'minProperties',
	  'maxItems', 'minItems',
	  'maximum', 'minimum',
	  'uniqueItems', 'multipleOf',
	  'required', 'enum'
	]);
	function inlineRef(schema, limit) {
	  if (limit === false) return false;
	  if (limit === undefined || limit === true) return checkNoRef(schema);
	  else if (limit) return countKeys(schema) <= limit;
	}


	function checkNoRef(schema) {
	  var item;
	  if (Array.isArray(schema)) {
	    for (var i=0; i<schema.length; i++) {
	      item = schema[i];
	      if (typeof item == 'object' && !checkNoRef(item)) return false;
	    }
	  } else {
	    for (var key in schema) {
	      if (key == '$ref') return false;
	      item = schema[key];
	      if (typeof item == 'object' && !checkNoRef(item)) return false;
	    }
	  }
	  return true;
	}


	function countKeys(schema) {
	  var count = 0, item;
	  if (Array.isArray(schema)) {
	    for (var i=0; i<schema.length; i++) {
	      item = schema[i];
	      if (typeof item == 'object') count += countKeys(item);
	      if (count == Infinity) return Infinity;
	    }
	  } else {
	    for (var key in schema) {
	      if (key == '$ref') return Infinity;
	      if (SIMPLE_INLINED[key]) {
	        count++;
	      } else {
	        item = schema[key];
	        if (typeof item == 'object') count += countKeys(item) + 1;
	        if (count == Infinity) return Infinity;
	      }
	    }
	  }
	  return count;
	}


	function getFullPath(id, normalize) {
	  if (normalize !== false) id = normalizeId(id);
	  var p = URI.parse(id);
	  return _getFullPath(p);
	}


	function _getFullPath(p) {
	  return URI.serialize(p).split('#')[0] + '#';
	}


	var TRAILING_SLASH_HASH = /#\/?$/;
	function normalizeId(id) {
	  return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
	}


	function resolveUrl(baseId, id) {
	  id = normalizeId(id);
	  return URI.resolve(baseId, id);
	}


	/* @this Ajv */
	function resolveIds(schema) {
	  var schemaId = normalizeId(this._getId(schema));
	  var baseIds = {'': schemaId};
	  var fullPaths = {'': getFullPath(schemaId, false)};
	  var localRefs = {};
	  var self = this;

	  traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
	    if (jsonPtr === '') return;
	    var id = self._getId(sch);
	    var baseId = baseIds[parentJsonPtr];
	    var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
	    if (keyIndex !== undefined)
	      fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));

	    if (typeof id == 'string') {
	      id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);

	      var refVal = self._refs[id];
	      if (typeof refVal == 'string') refVal = self._refs[refVal];
	      if (refVal && refVal.schema) {
	        if (!equal(sch, refVal.schema))
	          throw new Error('id "' + id + '" resolves to more than one schema');
	      } else if (id != normalizeId(fullPath)) {
	        if (id[0] == '#') {
	          if (localRefs[id] && !equal(sch, localRefs[id]))
	            throw new Error('id "' + id + '" resolves to more than one schema');
	          localRefs[id] = sch;
	        } else {
	          self._refs[id] = fullPath;
	        }
	      }
	    }
	    baseIds[jsonPtr] = baseId;
	    fullPaths[jsonPtr] = fullPath;
	  });

	  return localRefs;
	}
	return resolve_1;
}

var error_classes;
var hasRequiredError_classes;

function requireError_classes () {
	if (hasRequiredError_classes) return error_classes;
	hasRequiredError_classes = 1;

	var resolve = requireResolve();

	error_classes = {
	  Validation: errorSubclass(ValidationError),
	  MissingRef: errorSubclass(MissingRefError)
	};


	function ValidationError(errors) {
	  this.message = 'validation failed';
	  this.errors = errors;
	  this.ajv = this.validation = true;
	}


	MissingRefError.message = function (baseId, ref) {
	  return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
	};


	function MissingRefError(baseId, ref, message) {
	  this.message = message || MissingRefError.message(baseId, ref);
	  this.missingRef = resolve.url(baseId, ref);
	  this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
	}


	function errorSubclass(Subclass) {
	  Subclass.prototype = Object.create(Error.prototype);
	  Subclass.prototype.constructor = Subclass;
	  return Subclass;
	}
	return error_classes;
}

var fastJsonStableStringify;
var hasRequiredFastJsonStableStringify;

function requireFastJsonStableStringify () {
	if (hasRequiredFastJsonStableStringify) return fastJsonStableStringify;
	hasRequiredFastJsonStableStringify = 1;

	fastJsonStableStringify = function (data, opts) {
	    if (!opts) opts = {};
	    if (typeof opts === 'function') opts = { cmp: opts };
	    var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;

	    var cmp = opts.cmp && (function (f) {
	        return function (node) {
	            return function (a, b) {
	                var aobj = { key: a, value: node[a] };
	                var bobj = { key: b, value: node[b] };
	                return f(aobj, bobj);
	            };
	        };
	    })(opts.cmp);

	    var seen = [];
	    return (function stringify (node) {
	        if (node && node.toJSON && typeof node.toJSON === 'function') {
	            node = node.toJSON();
	        }

	        if (node === undefined) return;
	        if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
	        if (typeof node !== 'object') return JSON.stringify(node);

	        var i, out;
	        if (Array.isArray(node)) {
	            out = '[';
	            for (i = 0; i < node.length; i++) {
	                if (i) out += ',';
	                out += stringify(node[i]) || 'null';
	            }
	            return out + ']';
	        }

	        if (node === null) return 'null';

	        if (seen.indexOf(node) !== -1) {
	            if (cycles) return JSON.stringify('__cycle__');
	            throw new TypeError('Converting circular structure to JSON');
	        }

	        var seenIndex = seen.push(node) - 1;
	        var keys = Object.keys(node).sort(cmp && cmp(node));
	        out = '';
	        for (i = 0; i < keys.length; i++) {
	            var key = keys[i];
	            var value = stringify(node[key]);

	            if (!value) continue;
	            if (out) out += ',';
	            out += JSON.stringify(key) + ':' + value;
	        }
	        seen.splice(seenIndex, 1);
	        return '{' + out + '}';
	    })(data);
	};
	return fastJsonStableStringify;
}

var validate;
var hasRequiredValidate;

function requireValidate () {
	if (hasRequiredValidate) return validate;
	hasRequiredValidate = 1;
	validate = function generate_validate(it, $keyword, $ruleType) {
	  var out = '';
	  var $async = it.schema.$async === true,
	    $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
	    $id = it.self._getId(it.schema);
	  if (it.opts.strictKeywords) {
	    var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
	    if ($unknownKwd) {
	      var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;
	      if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);
	      else throw new Error($keywordsMsg);
	    }
	  }
	  if (it.isTop) {
	    out += ' var validate = ';
	    if ($async) {
	      it.async = true;
	      out += 'async ';
	    }
	    out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';
	    if ($id && (it.opts.sourceCode || it.opts.processCode)) {
	      out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' ';
	    }
	  }
	  if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {
	    var $keyword = 'false schema';
	    var $lvl = it.level;
	    var $dataLvl = it.dataLevel;
	    var $schema = it.schema[$keyword];
	    var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	    var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	    var $breakOnError = !it.opts.allErrors;
	    var $errorKeyword;
	    var $data = 'data' + ($dataLvl || '');
	    var $valid = 'valid' + $lvl;
	    if (it.schema === false) {
	      if (it.isTop) {
	        $breakOnError = true;
	      } else {
	        out += ' var ' + ($valid) + ' = false; ';
	      }
	      var $$outStack = $$outStack || [];
	      $$outStack.push(out);
	      out = ''; /* istanbul ignore else */
	      if (it.createErrors !== false) {
	        out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	        if (it.opts.messages !== false) {
	          out += ' , message: \'boolean schema is false\' ';
	        }
	        if (it.opts.verbose) {
	          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	        }
	        out += ' } ';
	      } else {
	        out += ' {} ';
	      }
	      var __err = out;
	      out = $$outStack.pop();
	      if (!it.compositeRule && $breakOnError) {
	        /* istanbul ignore if */
	        if (it.async) {
	          out += ' throw new ValidationError([' + (__err) + ']); ';
	        } else {
	          out += ' validate.errors = [' + (__err) + ']; return false; ';
	        }
	      } else {
	        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	      }
	    } else {
	      if (it.isTop) {
	        if ($async) {
	          out += ' return data; ';
	        } else {
	          out += ' validate.errors = null; return true; ';
	        }
	      } else {
	        out += ' var ' + ($valid) + ' = true; ';
	      }
	    }
	    if (it.isTop) {
	      out += ' }; return validate; ';
	    }
	    return out;
	  }
	  if (it.isTop) {
	    var $top = it.isTop,
	      $lvl = it.level = 0,
	      $dataLvl = it.dataLevel = 0,
	      $data = 'data';
	    it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
	    it.baseId = it.baseId || it.rootId;
	    delete it.isTop;
	    it.dataPathArr = [""];
	    if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
	      var $defaultMsg = 'default is ignored in the schema root';
	      if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
	      else throw new Error($defaultMsg);
	    }
	    out += ' var vErrors = null; ';
	    out += ' var errors = 0;     ';
	    out += ' if (rootData === undefined) rootData = data; ';
	  } else {
	    var $lvl = it.level,
	      $dataLvl = it.dataLevel,
	      $data = 'data' + ($dataLvl || '');
	    if ($id) it.baseId = it.resolve.url(it.baseId, $id);
	    if ($async && !it.async) throw new Error('async schema in sync schema');
	    out += ' var errs_' + ($lvl) + ' = errors;';
	  }
	  var $valid = 'valid' + $lvl,
	    $breakOnError = !it.opts.allErrors,
	    $closingBraces1 = '',
	    $closingBraces2 = '';
	  var $errorKeyword;
	  var $typeSchema = it.schema.type,
	    $typeIsArray = Array.isArray($typeSchema);
	  if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
	    if ($typeIsArray) {
	      if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');
	    } else if ($typeSchema != 'null') {
	      $typeSchema = [$typeSchema, 'null'];
	      $typeIsArray = true;
	    }
	  }
	  if ($typeIsArray && $typeSchema.length == 1) {
	    $typeSchema = $typeSchema[0];
	    $typeIsArray = false;
	  }
	  if (it.schema.$ref && $refKeywords) {
	    if (it.opts.extendRefs == 'fail') {
	      throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
	    } else if (it.opts.extendRefs !== true) {
	      $refKeywords = false;
	      it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
	    }
	  }
	  if (it.schema.$comment && it.opts.$comment) {
	    out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));
	  }
	  if ($typeSchema) {
	    if (it.opts.coerceTypes) {
	      var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
	    }
	    var $rulesGroup = it.RULES.types[$typeSchema];
	    if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {
	      var $schemaPath = it.schemaPath + '.type',
	        $errSchemaPath = it.errSchemaPath + '/type';
	      var $schemaPath = it.schemaPath + '.type',
	        $errSchemaPath = it.errSchemaPath + '/type',
	        $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
	      out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';
	      if ($coerceToTypes) {
	        var $dataType = 'dataType' + $lvl,
	          $coerced = 'coerced' + $lvl;
	        out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';
	        if (it.opts.coerceTypes == 'array') {
	          out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';
	        }
	        out += ' if (' + ($coerced) + ' !== undefined) ; ';
	        var arr1 = $coerceToTypes;
	        if (arr1) {
	          var $type, $i = -1,
	            l1 = arr1.length - 1;
	          while ($i < l1) {
	            $type = arr1[$i += 1];
	            if ($type == 'string') {
	              out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
	            } else if ($type == 'number' || $type == 'integer') {
	              out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
	              if ($type == 'integer') {
	                out += ' && !(' + ($data) + ' % 1)';
	              }
	              out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
	            } else if ($type == 'boolean') {
	              out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
	            } else if ($type == 'null') {
	              out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
	            } else if (it.opts.coerceTypes == 'array' && $type == 'array') {
	              out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
	            }
	          }
	        }
	        out += ' else {   ';
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
	          if ($typeIsArray) {
	            out += '' + ($typeSchema.join(","));
	          } else {
	            out += '' + ($typeSchema);
	          }
	          out += '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'should be ';
	            if ($typeIsArray) {
	              out += '' + ($typeSchema.join(","));
	            } else {
	              out += '' + ($typeSchema);
	            }
	            out += '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	        out += ' } if (' + ($coerced) + ' !== undefined) {  ';
	        var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
	          $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
	        out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
	        if (!$dataLvl) {
	          out += 'if (' + ($parentData) + ' !== undefined)';
	        }
	        out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';
	      } else {
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
	          if ($typeIsArray) {
	            out += '' + ($typeSchema.join(","));
	          } else {
	            out += '' + ($typeSchema);
	          }
	          out += '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'should be ';
	            if ($typeIsArray) {
	              out += '' + ($typeSchema.join(","));
	            } else {
	              out += '' + ($typeSchema);
	            }
	            out += '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	      }
	      out += ' } ';
	    }
	  }
	  if (it.schema.$ref && !$refKeywords) {
	    out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';
	    if ($breakOnError) {
	      out += ' } if (errors === ';
	      if ($top) {
	        out += '0';
	      } else {
	        out += 'errs_' + ($lvl);
	      }
	      out += ') { ';
	      $closingBraces2 += '}';
	    }
	  } else {
	    var arr2 = it.RULES;
	    if (arr2) {
	      var $rulesGroup, i2 = -1,
	        l2 = arr2.length - 1;
	      while (i2 < l2) {
	        $rulesGroup = arr2[i2 += 1];
	        if ($shouldUseGroup($rulesGroup)) {
	          if ($rulesGroup.type) {
	            out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';
	          }
	          if (it.opts.useDefaults) {
	            if ($rulesGroup.type == 'object' && it.schema.properties) {
	              var $schema = it.schema.properties,
	                $schemaKeys = Object.keys($schema);
	              var arr3 = $schemaKeys;
	              if (arr3) {
	                var $propertyKey, i3 = -1,
	                  l3 = arr3.length - 1;
	                while (i3 < l3) {
	                  $propertyKey = arr3[i3 += 1];
	                  var $sch = $schema[$propertyKey];
	                  if ($sch.default !== undefined) {
	                    var $passData = $data + it.util.getProperty($propertyKey);
	                    if (it.compositeRule) {
	                      if (it.opts.strictDefaults) {
	                        var $defaultMsg = 'default is ignored for: ' + $passData;
	                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
	                        else throw new Error($defaultMsg);
	                      }
	                    } else {
	                      out += ' if (' + ($passData) + ' === undefined ';
	                      if (it.opts.useDefaults == 'empty') {
	                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
	                      }
	                      out += ' ) ' + ($passData) + ' = ';
	                      if (it.opts.useDefaults == 'shared') {
	                        out += ' ' + (it.useDefault($sch.default)) + ' ';
	                      } else {
	                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
	                      }
	                      out += '; ';
	                    }
	                  }
	                }
	              }
	            } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {
	              var arr4 = it.schema.items;
	              if (arr4) {
	                var $sch, $i = -1,
	                  l4 = arr4.length - 1;
	                while ($i < l4) {
	                  $sch = arr4[$i += 1];
	                  if ($sch.default !== undefined) {
	                    var $passData = $data + '[' + $i + ']';
	                    if (it.compositeRule) {
	                      if (it.opts.strictDefaults) {
	                        var $defaultMsg = 'default is ignored for: ' + $passData;
	                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
	                        else throw new Error($defaultMsg);
	                      }
	                    } else {
	                      out += ' if (' + ($passData) + ' === undefined ';
	                      if (it.opts.useDefaults == 'empty') {
	                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
	                      }
	                      out += ' ) ' + ($passData) + ' = ';
	                      if (it.opts.useDefaults == 'shared') {
	                        out += ' ' + (it.useDefault($sch.default)) + ' ';
	                      } else {
	                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
	                      }
	                      out += '; ';
	                    }
	                  }
	                }
	              }
	            }
	          }
	          var arr5 = $rulesGroup.rules;
	          if (arr5) {
	            var $rule, i5 = -1,
	              l5 = arr5.length - 1;
	            while (i5 < l5) {
	              $rule = arr5[i5 += 1];
	              if ($shouldUseRule($rule)) {
	                var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
	                if ($code) {
	                  out += ' ' + ($code) + ' ';
	                  if ($breakOnError) {
	                    $closingBraces1 += '}';
	                  }
	                }
	              }
	            }
	          }
	          if ($breakOnError) {
	            out += ' ' + ($closingBraces1) + ' ';
	            $closingBraces1 = '';
	          }
	          if ($rulesGroup.type) {
	            out += ' } ';
	            if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
	              out += ' else { ';
	              var $schemaPath = it.schemaPath + '.type',
	                $errSchemaPath = it.errSchemaPath + '/type';
	              var $$outStack = $$outStack || [];
	              $$outStack.push(out);
	              out = ''; /* istanbul ignore else */
	              if (it.createErrors !== false) {
	                out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
	                if ($typeIsArray) {
	                  out += '' + ($typeSchema.join(","));
	                } else {
	                  out += '' + ($typeSchema);
	                }
	                out += '\' } ';
	                if (it.opts.messages !== false) {
	                  out += ' , message: \'should be ';
	                  if ($typeIsArray) {
	                    out += '' + ($typeSchema.join(","));
	                  } else {
	                    out += '' + ($typeSchema);
	                  }
	                  out += '\' ';
	                }
	                if (it.opts.verbose) {
	                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	                }
	                out += ' } ';
	              } else {
	                out += ' {} ';
	              }
	              var __err = out;
	              out = $$outStack.pop();
	              if (!it.compositeRule && $breakOnError) {
	                /* istanbul ignore if */
	                if (it.async) {
	                  out += ' throw new ValidationError([' + (__err) + ']); ';
	                } else {
	                  out += ' validate.errors = [' + (__err) + ']; return false; ';
	                }
	              } else {
	                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	              }
	              out += ' } ';
	            }
	          }
	          if ($breakOnError) {
	            out += ' if (errors === ';
	            if ($top) {
	              out += '0';
	            } else {
	              out += 'errs_' + ($lvl);
	            }
	            out += ') { ';
	            $closingBraces2 += '}';
	          }
	        }
	      }
	    }
	  }
	  if ($breakOnError) {
	    out += ' ' + ($closingBraces2) + ' ';
	  }
	  if ($top) {
	    if ($async) {
	      out += ' if (errors === 0) return data;           ';
	      out += ' else throw new ValidationError(vErrors); ';
	    } else {
	      out += ' validate.errors = vErrors; ';
	      out += ' return errors === 0;       ';
	    }
	    out += ' }; return validate;';
	  } else {
	    out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
	  }

	  function $shouldUseGroup($rulesGroup) {
	    var rules = $rulesGroup.rules;
	    for (var i = 0; i < rules.length; i++)
	      if ($shouldUseRule(rules[i])) return true;
	  }

	  function $shouldUseRule($rule) {
	    return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));
	  }

	  function $ruleImplementsSomeKeyword($rule) {
	    var impl = $rule.implements;
	    for (var i = 0; i < impl.length; i++)
	      if (it.schema[impl[i]] !== undefined) return true;
	  }
	  return out;
	};
	return validate;
}

var compile_1;
var hasRequiredCompile;

function requireCompile () {
	if (hasRequiredCompile) return compile_1;
	hasRequiredCompile = 1;

	var resolve = requireResolve()
	  , util = requireUtil()
	  , errorClasses = requireError_classes()
	  , stableStringify = requireFastJsonStableStringify();

	var validateGenerator = requireValidate();

	/**
	 * Functions below are used inside compiled validations function
	 */

	var ucs2length = util.ucs2length;
	var equal = requireFastDeepEqual();

	// this error is thrown by async schemas to return validation errors via exception
	var ValidationError = errorClasses.Validation;

	compile_1 = compile;


	/**
	 * Compiles schema to validation function
	 * @this   Ajv
	 * @param  {Object} schema schema object
	 * @param  {Object} root object with information about the root schema for this schema
	 * @param  {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
	 * @param  {String} baseId base ID for IDs in the schema
	 * @return {Function} validation function
	 */
	function compile(schema, root, localRefs, baseId) {
	  /* jshint validthis: true, evil: true */
	  /* eslint no-shadow: 0 */
	  var self = this
	    , opts = this._opts
	    , refVal = [ undefined ]
	    , refs = {}
	    , patterns = []
	    , patternsHash = {}
	    , defaults = []
	    , defaultsHash = {}
	    , customRules = [];

	  root = root || { schema: schema, refVal: refVal, refs: refs };

	  var c = checkCompiling.call(this, schema, root, baseId);
	  var compilation = this._compilations[c.index];
	  if (c.compiling) return (compilation.callValidate = callValidate);

	  var formats = this._formats;
	  var RULES = this.RULES;

	  try {
	    var v = localCompile(schema, root, localRefs, baseId);
	    compilation.validate = v;
	    var cv = compilation.callValidate;
	    if (cv) {
	      cv.schema = v.schema;
	      cv.errors = null;
	      cv.refs = v.refs;
	      cv.refVal = v.refVal;
	      cv.root = v.root;
	      cv.$async = v.$async;
	      if (opts.sourceCode) cv.source = v.source;
	    }
	    return v;
	  } finally {
	    endCompiling.call(this, schema, root, baseId);
	  }

	  /* @this   {*} - custom context, see passContext option */
	  function callValidate() {
	    /* jshint validthis: true */
	    var validate = compilation.validate;
	    var result = validate.apply(this, arguments);
	    callValidate.errors = validate.errors;
	    return result;
	  }

	  function localCompile(_schema, _root, localRefs, baseId) {
	    var isRoot = !_root || (_root && _root.schema == _schema);
	    if (_root.schema != root.schema)
	      return compile.call(self, _schema, _root, localRefs, baseId);

	    var $async = _schema.$async === true;

	    var sourceCode = validateGenerator({
	      isTop: true,
	      schema: _schema,
	      isRoot: isRoot,
	      baseId: baseId,
	      root: _root,
	      schemaPath: '',
	      errSchemaPath: '#',
	      errorPath: '""',
	      MissingRefError: errorClasses.MissingRef,
	      RULES: RULES,
	      validate: validateGenerator,
	      util: util,
	      resolve: resolve,
	      resolveRef: resolveRef,
	      usePattern: usePattern,
	      useDefault: useDefault,
	      useCustomRule: useCustomRule,
	      opts: opts,
	      formats: formats,
	      logger: self.logger,
	      self: self
	    });

	    sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
	                   + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
	                   + sourceCode;

	    if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
	    // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
	    var validate;
	    try {
	      var makeValidate = new Function(
	        'self',
	        'RULES',
	        'formats',
	        'root',
	        'refVal',
	        'defaults',
	        'customRules',
	        'equal',
	        'ucs2length',
	        'ValidationError',
	        sourceCode
	      );

	      validate = makeValidate(
	        self,
	        RULES,
	        formats,
	        root,
	        refVal,
	        defaults,
	        customRules,
	        equal,
	        ucs2length,
	        ValidationError
	      );

	      refVal[0] = validate;
	    } catch(e) {
	      self.logger.error('Error compiling schema, function code:', sourceCode);
	      throw e;
	    }

	    validate.schema = _schema;
	    validate.errors = null;
	    validate.refs = refs;
	    validate.refVal = refVal;
	    validate.root = isRoot ? validate : _root;
	    if ($async) validate.$async = true;
	    if (opts.sourceCode === true) {
	      validate.source = {
	        code: sourceCode,
	        patterns: patterns,
	        defaults: defaults
	      };
	    }

	    return validate;
	  }

	  function resolveRef(baseId, ref, isRoot) {
	    ref = resolve.url(baseId, ref);
	    var refIndex = refs[ref];
	    var _refVal, refCode;
	    if (refIndex !== undefined) {
	      _refVal = refVal[refIndex];
	      refCode = 'refVal[' + refIndex + ']';
	      return resolvedRef(_refVal, refCode);
	    }
	    if (!isRoot && root.refs) {
	      var rootRefId = root.refs[ref];
	      if (rootRefId !== undefined) {
	        _refVal = root.refVal[rootRefId];
	        refCode = addLocalRef(ref, _refVal);
	        return resolvedRef(_refVal, refCode);
	      }
	    }

	    refCode = addLocalRef(ref);
	    var v = resolve.call(self, localCompile, root, ref);
	    if (v === undefined) {
	      var localSchema = localRefs && localRefs[ref];
	      if (localSchema) {
	        v = resolve.inlineRef(localSchema, opts.inlineRefs)
	            ? localSchema
	            : compile.call(self, localSchema, root, localRefs, baseId);
	      }
	    }

	    if (v === undefined) {
	      removeLocalRef(ref);
	    } else {
	      replaceLocalRef(ref, v);
	      return resolvedRef(v, refCode);
	    }
	  }

	  function addLocalRef(ref, v) {
	    var refId = refVal.length;
	    refVal[refId] = v;
	    refs[ref] = refId;
	    return 'refVal' + refId;
	  }

	  function removeLocalRef(ref) {
	    delete refs[ref];
	  }

	  function replaceLocalRef(ref, v) {
	    var refId = refs[ref];
	    refVal[refId] = v;
	  }

	  function resolvedRef(refVal, code) {
	    return typeof refVal == 'object' || typeof refVal == 'boolean'
	            ? { code: code, schema: refVal, inline: true }
	            : { code: code, $async: refVal && !!refVal.$async };
	  }

	  function usePattern(regexStr) {
	    var index = patternsHash[regexStr];
	    if (index === undefined) {
	      index = patternsHash[regexStr] = patterns.length;
	      patterns[index] = regexStr;
	    }
	    return 'pattern' + index;
	  }

	  function useDefault(value) {
	    switch (typeof value) {
	      case 'boolean':
	      case 'number':
	        return '' + value;
	      case 'string':
	        return util.toQuotedString(value);
	      case 'object':
	        if (value === null) return 'null';
	        var valueStr = stableStringify(value);
	        var index = defaultsHash[valueStr];
	        if (index === undefined) {
	          index = defaultsHash[valueStr] = defaults.length;
	          defaults[index] = value;
	        }
	        return 'default' + index;
	    }
	  }

	  function useCustomRule(rule, schema, parentSchema, it) {
	    if (self._opts.validateSchema !== false) {
	      var deps = rule.definition.dependencies;
	      if (deps && !deps.every(function(keyword) {
	        return Object.prototype.hasOwnProperty.call(parentSchema, keyword);
	      }))
	        throw new Error('parent schema must have all required keywords: ' + deps.join(','));

	      var validateSchema = rule.definition.validateSchema;
	      if (validateSchema) {
	        var valid = validateSchema(schema);
	        if (!valid) {
	          var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
	          if (self._opts.validateSchema == 'log') self.logger.error(message);
	          else throw new Error(message);
	        }
	      }
	    }

	    var compile = rule.definition.compile
	      , inline = rule.definition.inline
	      , macro = rule.definition.macro;

	    var validate;
	    if (compile) {
	      validate = compile.call(self, schema, parentSchema, it);
	    } else if (macro) {
	      validate = macro.call(self, schema, parentSchema, it);
	      if (opts.validateSchema !== false) self.validateSchema(validate, true);
	    } else if (inline) {
	      validate = inline.call(self, it, rule.keyword, schema, parentSchema);
	    } else {
	      validate = rule.definition.validate;
	      if (!validate) return;
	    }

	    if (validate === undefined)
	      throw new Error('custom keyword "' + rule.keyword + '"failed to compile');

	    var index = customRules.length;
	    customRules[index] = validate;

	    return {
	      code: 'customRule' + index,
	      validate: validate
	    };
	  }
	}


	/**
	 * Checks if the schema is currently compiled
	 * @this   Ajv
	 * @param  {Object} schema schema to compile
	 * @param  {Object} root root object
	 * @param  {String} baseId base schema ID
	 * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
	 */
	function checkCompiling(schema, root, baseId) {
	  /* jshint validthis: true */
	  var index = compIndex.call(this, schema, root, baseId);
	  if (index >= 0) return { index: index, compiling: true };
	  index = this._compilations.length;
	  this._compilations[index] = {
	    schema: schema,
	    root: root,
	    baseId: baseId
	  };
	  return { index: index, compiling: false };
	}


	/**
	 * Removes the schema from the currently compiled list
	 * @this   Ajv
	 * @param  {Object} schema schema to compile
	 * @param  {Object} root root object
	 * @param  {String} baseId base schema ID
	 */
	function endCompiling(schema, root, baseId) {
	  /* jshint validthis: true */
	  var i = compIndex.call(this, schema, root, baseId);
	  if (i >= 0) this._compilations.splice(i, 1);
	}


	/**
	 * Index of schema compilation in the currently compiled list
	 * @this   Ajv
	 * @param  {Object} schema schema to compile
	 * @param  {Object} root root object
	 * @param  {String} baseId base schema ID
	 * @return {Integer} compilation index
	 */
	function compIndex(schema, root, baseId) {
	  /* jshint validthis: true */
	  for (var i=0; i<this._compilations.length; i++) {
	    var c = this._compilations[i];
	    if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
	  }
	  return -1;
	}


	function patternCode(i, patterns) {
	  return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
	}


	function defaultCode(i) {
	  return 'var default' + i + ' = defaults[' + i + '];';
	}


	function refValCode(i, refVal) {
	  return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';
	}


	function customRuleCode(i) {
	  return 'var customRule' + i + ' = customRules[' + i + '];';
	}


	function vars(arr, statement) {
	  if (!arr.length) return '';
	  var code = '';
	  for (var i=0; i<arr.length; i++)
	    code += statement(i, arr);
	  return code;
	}
	return compile_1;
}

var cache = {exports: {}};

var hasRequiredCache;

function requireCache () {
	if (hasRequiredCache) return cache.exports;
	hasRequiredCache = 1;


	var Cache = cache.exports = function Cache() {
	  this._cache = {};
	};


	Cache.prototype.put = function Cache_put(key, value) {
	  this._cache[key] = value;
	};


	Cache.prototype.get = function Cache_get(key) {
	  return this._cache[key];
	};


	Cache.prototype.del = function Cache_del(key) {
	  delete this._cache[key];
	};


	Cache.prototype.clear = function Cache_clear() {
	  this._cache = {};
	};
	return cache.exports;
}

var formats_1;
var hasRequiredFormats;

function requireFormats () {
	if (hasRequiredFormats) return formats_1;
	hasRequiredFormats = 1;

	var util = requireUtil();

	var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
	var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
	var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
	var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
	var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
	var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
	// uri-template: https://tools.ietf.org/html/rfc6570
	var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
	// For the source: https://gist.github.com/dperini/729294
	// For test cases: https://mathiasbynens.be/demo/url-regex
	// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
	// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
	var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
	var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
	var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
	var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
	var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;


	formats_1 = formats;

	function formats(mode) {
	  mode = mode == 'full' ? 'full' : 'fast';
	  return util.copy(formats[mode]);
	}


	formats.fast = {
	  // date: http://tools.ietf.org/html/rfc3339#section-5.6
	  date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
	  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
	  time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
	  'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
	  // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
	  uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
	  'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
	  'uri-template': URITEMPLATE,
	  url: URL,
	  // email (sources from jsen validator):
	  // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
	  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
	  email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
	  hostname: HOSTNAME,
	  // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
	  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
	  // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
	  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
	  regex: regex,
	  // uuid: http://tools.ietf.org/html/rfc4122
	  uuid: UUID,
	  // JSON-pointer: https://tools.ietf.org/html/rfc6901
	  // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
	  'json-pointer': JSON_POINTER,
	  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
	  // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
	  'relative-json-pointer': RELATIVE_JSON_POINTER
	};


	formats.full = {
	  date: date,
	  time: time,
	  'date-time': date_time,
	  uri: uri,
	  'uri-reference': URIREF,
	  'uri-template': URITEMPLATE,
	  url: URL,
	  email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
	  hostname: HOSTNAME,
	  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
	  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
	  regex: regex,
	  uuid: UUID,
	  'json-pointer': JSON_POINTER,
	  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
	  'relative-json-pointer': RELATIVE_JSON_POINTER
	};


	function isLeapYear(year) {
	  // https://tools.ietf.org/html/rfc3339#appendix-C
	  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
	}


	function date(str) {
	  // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
	  var matches = str.match(DATE);
	  if (!matches) return false;

	  var year = +matches[1];
	  var month = +matches[2];
	  var day = +matches[3];

	  return month >= 1 && month <= 12 && day >= 1 &&
	          day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
	}


	function time(str, full) {
	  var matches = str.match(TIME);
	  if (!matches) return false;

	  var hour = matches[1];
	  var minute = matches[2];
	  var second = matches[3];
	  var timeZone = matches[5];
	  return ((hour <= 23 && minute <= 59 && second <= 59) ||
	          (hour == 23 && minute == 59 && second == 60)) &&
	         (!full || timeZone);
	}


	var DATE_TIME_SEPARATOR = /t|\s/i;
	function date_time(str) {
	  // http://tools.ietf.org/html/rfc3339#section-5.6
	  var dateTime = str.split(DATE_TIME_SEPARATOR);
	  return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
	}


	var NOT_URI_FRAGMENT = /\/|:/;
	function uri(str) {
	  // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
	  return NOT_URI_FRAGMENT.test(str) && URI.test(str);
	}


	var Z_ANCHOR = /[^\\]\\Z/;
	function regex(str) {
	  if (Z_ANCHOR.test(str)) return false;
	  try {
	    new RegExp(str);
	    return true;
	  } catch(e) {
	    return false;
	  }
	}
	return formats_1;
}

var ref;
var hasRequiredRef;

function requireRef () {
	if (hasRequiredRef) return ref;
	hasRequiredRef = 1;
	ref = function generate_ref(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $async, $refCode;
	  if ($schema == '#' || $schema == '#/') {
	    if (it.isRoot) {
	      $async = it.async;
	      $refCode = 'validate';
	    } else {
	      $async = it.root.schema.$async === true;
	      $refCode = 'root.refVal[0]';
	    }
	  } else {
	    var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
	    if ($refVal === undefined) {
	      var $message = it.MissingRefError.message(it.baseId, $schema);
	      if (it.opts.missingRefs == 'fail') {
	        it.logger.error($message);
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	        if ($breakOnError) {
	          out += ' if (false) { ';
	        }
	      } else if (it.opts.missingRefs == 'ignore') {
	        it.logger.warn($message);
	        if ($breakOnError) {
	          out += ' if (true) { ';
	        }
	      } else {
	        throw new it.MissingRefError(it.baseId, $schema, $message);
	      }
	    } else if ($refVal.inline) {
	      var $it = it.util.copy(it);
	      $it.level++;
	      var $nextValid = 'valid' + $it.level;
	      $it.schema = $refVal.schema;
	      $it.schemaPath = '';
	      $it.errSchemaPath = $schema;
	      var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
	      out += ' ' + ($code) + ' ';
	      if ($breakOnError) {
	        out += ' if (' + ($nextValid) + ') { ';
	      }
	    } else {
	      $async = $refVal.$async === true || (it.async && $refVal.$async !== false);
	      $refCode = $refVal.code;
	    }
	  }
	  if ($refCode) {
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = '';
	    if (it.opts.passContext) {
	      out += ' ' + ($refCode) + '.call(this, ';
	    } else {
	      out += ' ' + ($refCode) + '( ';
	    }
	    out += ' ' + ($data) + ', (dataPath || \'\')';
	    if (it.errorPath != '""') {
	      out += ' + ' + (it.errorPath);
	    }
	    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
	      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
	    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData)  ';
	    var __callValidate = out;
	    out = $$outStack.pop();
	    if ($async) {
	      if (!it.async) throw new Error('async schema referenced by sync schema');
	      if ($breakOnError) {
	        out += ' var ' + ($valid) + '; ';
	      }
	      out += ' try { await ' + (__callValidate) + '; ';
	      if ($breakOnError) {
	        out += ' ' + ($valid) + ' = true; ';
	      }
	      out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
	      if ($breakOnError) {
	        out += ' ' + ($valid) + ' = false; ';
	      }
	      out += ' } ';
	      if ($breakOnError) {
	        out += ' if (' + ($valid) + ') { ';
	      }
	    } else {
	      out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
	      if ($breakOnError) {
	        out += ' else { ';
	      }
	    }
	  }
	  return out;
	};
	return ref;
}

var allOf;
var hasRequiredAllOf;

function requireAllOf () {
	if (hasRequiredAllOf) return allOf;
	hasRequiredAllOf = 1;
	allOf = function generate_allOf(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $currentBaseId = $it.baseId,
	    $allSchemasEmpty = true;
	  var arr1 = $schema;
	  if (arr1) {
	    var $sch, $i = -1,
	      l1 = arr1.length - 1;
	    while ($i < l1) {
	      $sch = arr1[$i += 1];
	      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	        $allSchemasEmpty = false;
	        $it.schema = $sch;
	        $it.schemaPath = $schemaPath + '[' + $i + ']';
	        $it.errSchemaPath = $errSchemaPath + '/' + $i;
	        out += '  ' + (it.validate($it)) + ' ';
	        $it.baseId = $currentBaseId;
	        if ($breakOnError) {
	          out += ' if (' + ($nextValid) + ') { ';
	          $closingBraces += '}';
	        }
	      }
	    }
	  }
	  if ($breakOnError) {
	    if ($allSchemasEmpty) {
	      out += ' if (true) { ';
	    } else {
	      out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
	    }
	  }
	  return out;
	};
	return allOf;
}

var anyOf;
var hasRequiredAnyOf;

function requireAnyOf () {
	if (hasRequiredAnyOf) return anyOf;
	hasRequiredAnyOf = 1;
	anyOf = function generate_anyOf(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $noEmptySchema = $schema.every(function($sch) {
	    return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
	  });
	  if ($noEmptySchema) {
	    var $currentBaseId = $it.baseId;
	    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false;  ';
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    var arr1 = $schema;
	    if (arr1) {
	      var $sch, $i = -1,
	        l1 = arr1.length - 1;
	      while ($i < l1) {
	        $sch = arr1[$i += 1];
	        $it.schema = $sch;
	        $it.schemaPath = $schemaPath + '[' + $i + ']';
	        $it.errSchemaPath = $errSchemaPath + '/' + $i;
	        out += '  ' + (it.validate($it)) + ' ';
	        $it.baseId = $currentBaseId;
	        out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
	        $closingBraces += '}';
	      }
	    }
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should match some schema in anyOf\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError(vErrors); ';
	      } else {
	        out += ' validate.errors = vErrors; return false; ';
	      }
	    }
	    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
	    if (it.opts.allErrors) {
	      out += ' } ';
	    }
	  } else {
	    if ($breakOnError) {
	      out += ' if (true) { ';
	    }
	  }
	  return out;
	};
	return anyOf;
}

var comment;
var hasRequiredComment;

function requireComment () {
	if (hasRequiredComment) return comment;
	hasRequiredComment = 1;
	comment = function generate_comment(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $schema = it.schema[$keyword];
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  !it.opts.allErrors;
	  var $comment = it.util.toQuotedString($schema);
	  if (it.opts.$comment === true) {
	    out += ' console.log(' + ($comment) + ');';
	  } else if (typeof it.opts.$comment == 'function') {
	    out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
	  }
	  return out;
	};
	return comment;
}

var _const;
var hasRequired_const;

function require_const () {
	if (hasRequired_const) return _const;
	hasRequired_const = 1;
	_const = function generate_const(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $isData = it.opts.$data && $schema && $schema.$data;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	  }
	  if (!$isData) {
	    out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';
	  }
	  out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') {   ';
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should be equal to constant\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += ' }';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _const;
}

var contains;
var hasRequiredContains;

function requireContains () {
	if (hasRequiredContains) return contains;
	hasRequiredContains = 1;
	contains = function generate_contains(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $idx = 'i' + $lvl,
	    $dataNxt = $it.dataLevel = it.dataLevel + 1,
	    $nextData = 'data' + $dataNxt,
	    $currentBaseId = it.baseId,
	    $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));
	  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
	  if ($nonEmptySchema) {
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    $it.schema = $schema;
	    $it.schemaPath = $schemaPath;
	    $it.errSchemaPath = $errSchemaPath;
	    out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
	    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
	    var $passData = $data + '[' + $idx + ']';
	    $it.dataPathArr[$dataNxt] = $idx;
	    var $code = it.validate($it);
	    $it.baseId = $currentBaseId;
	    if (it.util.varOccurences($code, $nextData) < 2) {
	      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	    } else {
	      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	    }
	    out += ' if (' + ($nextValid) + ') break; }  ';
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';
	  } else {
	    out += ' if (' + ($data) + '.length == 0) {';
	  }
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should contain a valid item\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += ' } else { ';
	  if ($nonEmptySchema) {
	    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
	  }
	  if (it.opts.allErrors) {
	    out += ' } ';
	  }
	  return out;
	};
	return contains;
}

var dependencies$1;
var hasRequiredDependencies;

function requireDependencies () {
	if (hasRequiredDependencies) return dependencies$1;
	hasRequiredDependencies = 1;
	dependencies$1 = function generate_dependencies(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $schemaDeps = {},
	    $propertyDeps = {},
	    $ownProperties = it.opts.ownProperties;
	  for ($property in $schema) {
	    if ($property == '__proto__') continue;
	    var $sch = $schema[$property];
	    var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
	    $deps[$property] = $sch;
	  }
	  out += 'var ' + ($errs) + ' = errors;';
	  var $currentErrorPath = it.errorPath;
	  out += 'var missing' + ($lvl) + ';';
	  for (var $property in $propertyDeps) {
	    $deps = $propertyDeps[$property];
	    if ($deps.length) {
	      out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
	      if ($ownProperties) {
	        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
	      }
	      if ($breakOnError) {
	        out += ' && ( ';
	        var arr1 = $deps;
	        if (arr1) {
	          var $propertyKey, $i = -1,
	            l1 = arr1.length - 1;
	          while ($i < l1) {
	            $propertyKey = arr1[$i += 1];
	            if ($i) {
	              out += ' || ';
	            }
	            var $prop = it.util.getProperty($propertyKey),
	              $useData = $data + $prop;
	            out += ' ( ( ' + ($useData) + ' === undefined ';
	            if ($ownProperties) {
	              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	            }
	            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
	          }
	        }
	        out += ')) {  ';
	        var $propertyPath = 'missing' + $lvl,
	          $missingProperty = '\' + ' + $propertyPath + ' + \'';
	        if (it.opts._errorDataPathProperty) {
	          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
	        }
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'should have ';
	            if ($deps.length == 1) {
	              out += 'property ' + (it.util.escapeQuotes($deps[0]));
	            } else {
	              out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
	            }
	            out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	      } else {
	        out += ' ) { ';
	        var arr2 = $deps;
	        if (arr2) {
	          var $propertyKey, i2 = -1,
	            l2 = arr2.length - 1;
	          while (i2 < l2) {
	            $propertyKey = arr2[i2 += 1];
	            var $prop = it.util.getProperty($propertyKey),
	              $missingProperty = it.util.escapeQuotes($propertyKey),
	              $useData = $data + $prop;
	            if (it.opts._errorDataPathProperty) {
	              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
	            }
	            out += ' if ( ' + ($useData) + ' === undefined ';
	            if ($ownProperties) {
	              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	            }
	            out += ') {  var err =   '; /* istanbul ignore else */
	            if (it.createErrors !== false) {
	              out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
	              if (it.opts.messages !== false) {
	                out += ' , message: \'should have ';
	                if ($deps.length == 1) {
	                  out += 'property ' + (it.util.escapeQuotes($deps[0]));
	                } else {
	                  out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
	                }
	                out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
	              }
	              if (it.opts.verbose) {
	                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	              }
	              out += ' } ';
	            } else {
	              out += ' {} ';
	            }
	            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
	          }
	        }
	      }
	      out += ' }   ';
	      if ($breakOnError) {
	        $closingBraces += '}';
	        out += ' else { ';
	      }
	    }
	  }
	  it.errorPath = $currentErrorPath;
	  var $currentBaseId = $it.baseId;
	  for (var $property in $schemaDeps) {
	    var $sch = $schemaDeps[$property];
	    if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	      out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
	      if ($ownProperties) {
	        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
	      }
	      out += ') { ';
	      $it.schema = $sch;
	      $it.schemaPath = $schemaPath + it.util.getProperty($property);
	      $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
	      out += '  ' + (it.validate($it)) + ' ';
	      $it.baseId = $currentBaseId;
	      out += ' }  ';
	      if ($breakOnError) {
	        out += ' if (' + ($nextValid) + ') { ';
	        $closingBraces += '}';
	      }
	    }
	  }
	  if ($breakOnError) {
	    out += '   ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
	  }
	  return out;
	};
	return dependencies$1;
}

var _enum;
var hasRequired_enum;

function require_enum () {
	if (hasRequired_enum) return _enum;
	hasRequired_enum = 1;
	_enum = function generate_enum(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $isData = it.opts.$data && $schema && $schema.$data;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	  }
	  var $i = 'i' + $lvl,
	    $vSchema = 'schema' + $lvl;
	  if (!$isData) {
	    out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
	  }
	  out += 'var ' + ($valid) + ';';
	  if ($isData) {
	    out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
	  }
	  out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
	  if ($isData) {
	    out += '  }  ';
	  }
	  out += ' if (!' + ($valid) + ') {   ';
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should be equal to one of the allowed values\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += ' }';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _enum;
}

var format;
var hasRequiredFormat;

function requireFormat () {
	if (hasRequiredFormat) return format;
	hasRequiredFormat = 1;
	format = function generate_format(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  if (it.opts.format === false) {
	    if ($breakOnError) {
	      out += ' if (true) { ';
	    }
	    return out;
	  }
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  var $unknownFormats = it.opts.unknownFormats,
	    $allowUnknown = Array.isArray($unknownFormats);
	  if ($isData) {
	    var $format = 'format' + $lvl,
	      $isObject = 'isObject' + $lvl,
	      $formatType = 'formatType' + $lvl;
	    out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
	    if (it.async) {
	      out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
	    }
	    out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if (  ';
	    if ($isData) {
	      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
	    }
	    out += ' (';
	    if ($unknownFormats != 'ignore') {
	      out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
	      if ($allowUnknown) {
	        out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
	      }
	      out += ') || ';
	    }
	    out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
	    if (it.async) {
	      out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
	    } else {
	      out += ' ' + ($format) + '(' + ($data) + ') ';
	    }
	    out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
	  } else {
	    var $format = it.formats[$schema];
	    if (!$format) {
	      if ($unknownFormats == 'ignore') {
	        it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
	        if ($breakOnError) {
	          out += ' if (true) { ';
	        }
	        return out;
	      } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
	        if ($breakOnError) {
	          out += ' if (true) { ';
	        }
	        return out;
	      } else {
	        throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
	      }
	    }
	    var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
	    var $formatType = $isObject && $format.type || 'string';
	    if ($isObject) {
	      var $async = $format.async === true;
	      $format = $format.validate;
	    }
	    if ($formatType != $ruleType) {
	      if ($breakOnError) {
	        out += ' if (true) { ';
	      }
	      return out;
	    }
	    if ($async) {
	      if (!it.async) throw new Error('async format in sync schema');
	      var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
	      out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';
	    } else {
	      out += ' if (! ';
	      var $formatRef = 'formats' + it.util.getProperty($schema);
	      if ($isObject) $formatRef += '.validate';
	      if (typeof $format == 'function') {
	        out += ' ' + ($formatRef) + '(' + ($data) + ') ';
	      } else {
	        out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
	      }
	      out += ') { ';
	    }
	  }
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format:  ';
	    if ($isData) {
	      out += '' + ($schemaValue);
	    } else {
	      out += '' + (it.util.toQuotedString($schema));
	    }
	    out += '  } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should match format "';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue) + ' + \'';
	      } else {
	        out += '' + (it.util.escapeQuotes($schema));
	      }
	      out += '"\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + (it.util.toQuotedString($schema));
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += ' } ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return format;
}

var _if;
var hasRequired_if;

function require_if () {
	if (hasRequired_if) return _if;
	hasRequired_if = 1;
	_if = function generate_if(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $thenSch = it.schema['then'],
	    $elseSch = it.schema['else'],
	    $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
	    $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
	    $currentBaseId = $it.baseId;
	  if ($thenPresent || $elsePresent) {
	    var $ifClause;
	    $it.createErrors = false;
	    $it.schema = $schema;
	    $it.schemaPath = $schemaPath;
	    $it.errSchemaPath = $errSchemaPath;
	    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true;  ';
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    out += '  ' + (it.validate($it)) + ' ';
	    $it.baseId = $currentBaseId;
	    $it.createErrors = true;
	    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }  ';
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    if ($thenPresent) {
	      out += ' if (' + ($nextValid) + ') {  ';
	      $it.schema = it.schema['then'];
	      $it.schemaPath = it.schemaPath + '.then';
	      $it.errSchemaPath = it.errSchemaPath + '/then';
	      out += '  ' + (it.validate($it)) + ' ';
	      $it.baseId = $currentBaseId;
	      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
	      if ($thenPresent && $elsePresent) {
	        $ifClause = 'ifClause' + $lvl;
	        out += ' var ' + ($ifClause) + ' = \'then\'; ';
	      } else {
	        $ifClause = '\'then\'';
	      }
	      out += ' } ';
	      if ($elsePresent) {
	        out += ' else { ';
	      }
	    } else {
	      out += ' if (!' + ($nextValid) + ') { ';
	    }
	    if ($elsePresent) {
	      $it.schema = it.schema['else'];
	      $it.schemaPath = it.schemaPath + '.else';
	      $it.errSchemaPath = it.errSchemaPath + '/else';
	      out += '  ' + (it.validate($it)) + ' ';
	      $it.baseId = $currentBaseId;
	      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
	      if ($thenPresent && $elsePresent) {
	        $ifClause = 'ifClause' + $lvl;
	        out += ' var ' + ($ifClause) + ' = \'else\'; ';
	      } else {
	        $ifClause = '\'else\'';
	      }
	      out += ' } ';
	    }
	    out += ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError(vErrors); ';
	      } else {
	        out += ' validate.errors = vErrors; return false; ';
	      }
	    }
	    out += ' }   ';
	    if ($breakOnError) {
	      out += ' else { ';
	    }
	  } else {
	    if ($breakOnError) {
	      out += ' if (true) { ';
	    }
	  }
	  return out;
	};
	return _if;
}

var items;
var hasRequiredItems;

function requireItems () {
	if (hasRequiredItems) return items;
	hasRequiredItems = 1;
	items = function generate_items(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $idx = 'i' + $lvl,
	    $dataNxt = $it.dataLevel = it.dataLevel + 1,
	    $nextData = 'data' + $dataNxt,
	    $currentBaseId = it.baseId;
	  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
	  if (Array.isArray($schema)) {
	    var $additionalItems = it.schema.additionalItems;
	    if ($additionalItems === false) {
	      out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';
	      var $currErrSchemaPath = $errSchemaPath;
	      $errSchemaPath = it.errSchemaPath + '/additionalItems';
	      out += '  if (!' + ($valid) + ') {   ';
	      var $$outStack = $$outStack || [];
	      $$outStack.push(out);
	      out = ''; /* istanbul ignore else */
	      if (it.createErrors !== false) {
	        out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';
	        if (it.opts.messages !== false) {
	          out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' ';
	        }
	        if (it.opts.verbose) {
	          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	        }
	        out += ' } ';
	      } else {
	        out += ' {} ';
	      }
	      var __err = out;
	      out = $$outStack.pop();
	      if (!it.compositeRule && $breakOnError) {
	        /* istanbul ignore if */
	        if (it.async) {
	          out += ' throw new ValidationError([' + (__err) + ']); ';
	        } else {
	          out += ' validate.errors = [' + (__err) + ']; return false; ';
	        }
	      } else {
	        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	      }
	      out += ' } ';
	      $errSchemaPath = $currErrSchemaPath;
	      if ($breakOnError) {
	        $closingBraces += '}';
	        out += ' else { ';
	      }
	    }
	    var arr1 = $schema;
	    if (arr1) {
	      var $sch, $i = -1,
	        l1 = arr1.length - 1;
	      while ($i < l1) {
	        $sch = arr1[$i += 1];
	        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	          out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
	          var $passData = $data + '[' + $i + ']';
	          $it.schema = $sch;
	          $it.schemaPath = $schemaPath + '[' + $i + ']';
	          $it.errSchemaPath = $errSchemaPath + '/' + $i;
	          $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
	          $it.dataPathArr[$dataNxt] = $i;
	          var $code = it.validate($it);
	          $it.baseId = $currentBaseId;
	          if (it.util.varOccurences($code, $nextData) < 2) {
	            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	          } else {
	            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	          }
	          out += ' }  ';
	          if ($breakOnError) {
	            out += ' if (' + ($nextValid) + ') { ';
	            $closingBraces += '}';
	          }
	        }
	      }
	    }
	    if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
	      $it.schema = $additionalItems;
	      $it.schemaPath = it.schemaPath + '.additionalItems';
	      $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
	      out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') {  for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
	      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
	      var $passData = $data + '[' + $idx + ']';
	      $it.dataPathArr[$dataNxt] = $idx;
	      var $code = it.validate($it);
	      $it.baseId = $currentBaseId;
	      if (it.util.varOccurences($code, $nextData) < 2) {
	        out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	      } else {
	        out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	      }
	      if ($breakOnError) {
	        out += ' if (!' + ($nextValid) + ') break; ';
	      }
	      out += ' } }  ';
	      if ($breakOnError) {
	        out += ' if (' + ($nextValid) + ') { ';
	        $closingBraces += '}';
	      }
	    }
	  } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
	    $it.schema = $schema;
	    $it.schemaPath = $schemaPath;
	    $it.errSchemaPath = $errSchemaPath;
	    out += '  for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
	    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
	    var $passData = $data + '[' + $idx + ']';
	    $it.dataPathArr[$dataNxt] = $idx;
	    var $code = it.validate($it);
	    $it.baseId = $currentBaseId;
	    if (it.util.varOccurences($code, $nextData) < 2) {
	      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	    } else {
	      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	    }
	    if ($breakOnError) {
	      out += ' if (!' + ($nextValid) + ') break; ';
	    }
	    out += ' }';
	  }
	  if ($breakOnError) {
	    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
	  }
	  return out;
	};
	return items;
}

var _limit;
var hasRequired_limit;

function require_limit () {
	if (hasRequired_limit) return _limit;
	hasRequired_limit = 1;
	_limit = function generate__limit(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $errorKeyword;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  var $isMax = $keyword == 'maximum',
	    $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',
	    $schemaExcl = it.schema[$exclusiveKeyword],
	    $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,
	    $op = $isMax ? '<' : '>',
	    $notOp = $isMax ? '>' : '<',
	    $errorKeyword = undefined;
	  if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
	    throw new Error($keyword + ' must be number');
	  }
	  if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {
	    throw new Error($exclusiveKeyword + ' must be number or boolean');
	  }
	  if ($isDataExcl) {
	    var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
	      $exclusive = 'exclusive' + $lvl,
	      $exclType = 'exclType' + $lvl,
	      $exclIsNumber = 'exclIsNumber' + $lvl,
	      $opExpr = 'op' + $lvl,
	      $opStr = '\' + ' + $opExpr + ' + \'';
	    out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';
	    $schemaValueExcl = 'schemaExcl' + $lvl;
	    out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { ';
	    var $errorKeyword = $exclusiveKeyword;
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = ''; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    var __err = out;
	    out = $$outStack.pop();
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError([' + (__err) + ']); ';
	      } else {
	        out += ' validate.errors = [' + (__err) + ']; return false; ';
	      }
	    } else {
	      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    }
	    out += ' } else if ( ';
	    if ($isData) {
	      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	    }
	    out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; ';
	    if ($schema === undefined) {
	      $errorKeyword = $exclusiveKeyword;
	      $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
	      $schemaValue = $schemaValueExcl;
	      $isData = $isDataExcl;
	    }
	  } else {
	    var $exclIsNumber = typeof $schemaExcl == 'number',
	      $opStr = $op;
	    if ($exclIsNumber && $isData) {
	      var $opExpr = '\'' + $opStr + '\'';
	      out += ' if ( ';
	      if ($isData) {
	        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	      }
	      out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';
	    } else {
	      if ($exclIsNumber && $schema === undefined) {
	        $exclusive = true;
	        $errorKeyword = $exclusiveKeyword;
	        $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
	        $schemaValue = $schemaExcl;
	        $notOp += '=';
	      } else {
	        if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);
	        if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
	          $exclusive = true;
	          $errorKeyword = $exclusiveKeyword;
	          $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
	          $notOp += '=';
	        } else {
	          $exclusive = false;
	          $opStr += '=';
	        }
	      }
	      var $opExpr = '\'' + $opStr + '\'';
	      out += ' if ( ';
	      if ($isData) {
	        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	      }
	      out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';
	    }
	  }
	  $errorKeyword = $errorKeyword || $keyword;
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should be ' + ($opStr) + ' ';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue);
	      } else {
	        out += '' + ($schemaValue) + '\'';
	      }
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + ($schema);
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += ' } ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _limit;
}

var _limitItems;
var hasRequired_limitItems;

function require_limitItems () {
	if (hasRequired_limitItems) return _limitItems;
	hasRequired_limitItems = 1;
	_limitItems = function generate__limitItems(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $errorKeyword;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  if (!($isData || typeof $schema == 'number')) {
	    throw new Error($keyword + ' must be number');
	  }
	  var $op = $keyword == 'maxItems' ? '>' : '<';
	  out += 'if ( ';
	  if ($isData) {
	    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	  }
	  out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
	  var $errorKeyword = $keyword;
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should NOT have ';
	      if ($keyword == 'maxItems') {
	        out += 'more';
	      } else {
	        out += 'fewer';
	      }
	      out += ' than ';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue) + ' + \'';
	      } else {
	        out += '' + ($schema);
	      }
	      out += ' items\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + ($schema);
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += '} ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _limitItems;
}

var _limitLength;
var hasRequired_limitLength;

function require_limitLength () {
	if (hasRequired_limitLength) return _limitLength;
	hasRequired_limitLength = 1;
	_limitLength = function generate__limitLength(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $errorKeyword;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  if (!($isData || typeof $schema == 'number')) {
	    throw new Error($keyword + ' must be number');
	  }
	  var $op = $keyword == 'maxLength' ? '>' : '<';
	  out += 'if ( ';
	  if ($isData) {
	    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	  }
	  if (it.opts.unicode === false) {
	    out += ' ' + ($data) + '.length ';
	  } else {
	    out += ' ucs2length(' + ($data) + ') ';
	  }
	  out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';
	  var $errorKeyword = $keyword;
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should NOT be ';
	      if ($keyword == 'maxLength') {
	        out += 'longer';
	      } else {
	        out += 'shorter';
	      }
	      out += ' than ';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue) + ' + \'';
	      } else {
	        out += '' + ($schema);
	      }
	      out += ' characters\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + ($schema);
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += '} ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _limitLength;
}

var _limitProperties;
var hasRequired_limitProperties;

function require_limitProperties () {
	if (hasRequired_limitProperties) return _limitProperties;
	hasRequired_limitProperties = 1;
	_limitProperties = function generate__limitProperties(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $errorKeyword;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  if (!($isData || typeof $schema == 'number')) {
	    throw new Error($keyword + ' must be number');
	  }
	  var $op = $keyword == 'maxProperties' ? '>' : '<';
	  out += 'if ( ';
	  if ($isData) {
	    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
	  }
	  out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
	  var $errorKeyword = $keyword;
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should NOT have ';
	      if ($keyword == 'maxProperties') {
	        out += 'more';
	      } else {
	        out += 'fewer';
	      }
	      out += ' than ';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue) + ' + \'';
	      } else {
	        out += '' + ($schema);
	      }
	      out += ' properties\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + ($schema);
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += '} ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return _limitProperties;
}

var multipleOf;
var hasRequiredMultipleOf;

function requireMultipleOf () {
	if (hasRequiredMultipleOf) return multipleOf;
	hasRequiredMultipleOf = 1;
	multipleOf = function generate_multipleOf(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  if (!($isData || typeof $schema == 'number')) {
	    throw new Error($keyword + ' must be number');
	  }
	  out += 'var division' + ($lvl) + ';if (';
	  if ($isData) {
	    out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
	  }
	  out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
	  if (it.opts.multipleOfPrecision) {
	    out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
	  } else {
	    out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
	  }
	  out += ' ) ';
	  if ($isData) {
	    out += '  )  ';
	  }
	  out += ' ) {   ';
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should be multiple of ';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue);
	      } else {
	        out += '' + ($schemaValue) + '\'';
	      }
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + ($schema);
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += '} ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return multipleOf;
}

var not;
var hasRequiredNot;

function requireNot () {
	if (hasRequiredNot) return not;
	hasRequiredNot = 1;
	not = function generate_not(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
	    $it.schema = $schema;
	    $it.schemaPath = $schemaPath;
	    $it.errSchemaPath = $errSchemaPath;
	    out += ' var ' + ($errs) + ' = errors;  ';
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    $it.createErrors = false;
	    var $allErrorsOption;
	    if ($it.opts.allErrors) {
	      $allErrorsOption = $it.opts.allErrors;
	      $it.opts.allErrors = false;
	    }
	    out += ' ' + (it.validate($it)) + ' ';
	    $it.createErrors = true;
	    if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    out += ' if (' + ($nextValid) + ') {   ';
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = ''; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should NOT be valid\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    var __err = out;
	    out = $$outStack.pop();
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError([' + (__err) + ']); ';
	      } else {
	        out += ' validate.errors = [' + (__err) + ']; return false; ';
	      }
	    } else {
	      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    }
	    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
	    if (it.opts.allErrors) {
	      out += ' } ';
	    }
	  } else {
	    out += '  var err =   '; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should NOT be valid\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    if ($breakOnError) {
	      out += ' if (false) { ';
	    }
	  }
	  return out;
	};
	return not;
}

var oneOf;
var hasRequiredOneOf;

function requireOneOf () {
	if (hasRequiredOneOf) return oneOf;
	hasRequiredOneOf = 1;
	oneOf = function generate_oneOf(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $currentBaseId = $it.baseId,
	    $prevValid = 'prevValid' + $lvl,
	    $passingSchemas = 'passingSchemas' + $lvl;
	  out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';
	  var $wasComposite = it.compositeRule;
	  it.compositeRule = $it.compositeRule = true;
	  var arr1 = $schema;
	  if (arr1) {
	    var $sch, $i = -1,
	      l1 = arr1.length - 1;
	    while ($i < l1) {
	      $sch = arr1[$i += 1];
	      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	        $it.schema = $sch;
	        $it.schemaPath = $schemaPath + '[' + $i + ']';
	        $it.errSchemaPath = $errSchemaPath + '/' + $i;
	        out += '  ' + (it.validate($it)) + ' ';
	        $it.baseId = $currentBaseId;
	      } else {
	        out += ' var ' + ($nextValid) + ' = true; ';
	      }
	      if ($i) {
	        out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';
	        $closingBraces += '}';
	      }
	      out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';
	    }
	  }
	  it.compositeRule = $it.compositeRule = $wasComposite;
	  out += '' + ($closingBraces) + 'if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should match exactly one schema in oneOf\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError(vErrors); ';
	    } else {
	      out += ' validate.errors = vErrors; return false; ';
	    }
	  }
	  out += '} else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
	  if (it.opts.allErrors) {
	    out += ' } ';
	  }
	  return out;
	};
	return oneOf;
}

var pattern;
var hasRequiredPattern;

function requirePattern () {
	if (hasRequiredPattern) return pattern;
	hasRequiredPattern = 1;
	pattern = function generate_pattern(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);
	  out += 'if ( ';
	  if ($isData) {
	    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
	  }
	  out += ' !' + ($regexp) + '.test(' + ($data) + ') ) {   ';
	  var $$outStack = $$outStack || [];
	  $$outStack.push(out);
	  out = ''; /* istanbul ignore else */
	  if (it.createErrors !== false) {
	    out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern:  ';
	    if ($isData) {
	      out += '' + ($schemaValue);
	    } else {
	      out += '' + (it.util.toQuotedString($schema));
	    }
	    out += '  } ';
	    if (it.opts.messages !== false) {
	      out += ' , message: \'should match pattern "';
	      if ($isData) {
	        out += '\' + ' + ($schemaValue) + ' + \'';
	      } else {
	        out += '' + (it.util.escapeQuotes($schema));
	      }
	      out += '"\' ';
	    }
	    if (it.opts.verbose) {
	      out += ' , schema:  ';
	      if ($isData) {
	        out += 'validate.schema' + ($schemaPath);
	      } else {
	        out += '' + (it.util.toQuotedString($schema));
	      }
	      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	    }
	    out += ' } ';
	  } else {
	    out += ' {} ';
	  }
	  var __err = out;
	  out = $$outStack.pop();
	  if (!it.compositeRule && $breakOnError) {
	    /* istanbul ignore if */
	    if (it.async) {
	      out += ' throw new ValidationError([' + (__err) + ']); ';
	    } else {
	      out += ' validate.errors = [' + (__err) + ']; return false; ';
	    }
	  } else {
	    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	  }
	  out += '} ';
	  if ($breakOnError) {
	    out += ' else { ';
	  }
	  return out;
	};
	return pattern;
}

var properties$3;
var hasRequiredProperties;

function requireProperties () {
	if (hasRequiredProperties) return properties$3;
	hasRequiredProperties = 1;
	properties$3 = function generate_properties(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  var $key = 'key' + $lvl,
	    $idx = 'idx' + $lvl,
	    $dataNxt = $it.dataLevel = it.dataLevel + 1,
	    $nextData = 'data' + $dataNxt,
	    $dataProperties = 'dataProperties' + $lvl;
	  var $schemaKeys = Object.keys($schema || {}).filter(notProto),
	    $pProperties = it.schema.patternProperties || {},
	    $pPropertyKeys = Object.keys($pProperties).filter(notProto),
	    $aProperties = it.schema.additionalProperties,
	    $someProperties = $schemaKeys.length || $pPropertyKeys.length,
	    $noAdditional = $aProperties === false,
	    $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
	    $removeAdditional = it.opts.removeAdditional,
	    $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
	    $ownProperties = it.opts.ownProperties,
	    $currentBaseId = it.baseId;
	  var $required = it.schema.required;
	  if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
	    var $requiredHash = it.util.toHash($required);
	  }

	  function notProto(p) {
	    return p !== '__proto__';
	  }
	  out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
	  if ($ownProperties) {
	    out += ' var ' + ($dataProperties) + ' = undefined;';
	  }
	  if ($checkAdditional) {
	    if ($ownProperties) {
	      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
	    } else {
	      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
	    }
	    if ($someProperties) {
	      out += ' var isAdditional' + ($lvl) + ' = !(false ';
	      if ($schemaKeys.length) {
	        if ($schemaKeys.length > 8) {
	          out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';
	        } else {
	          var arr1 = $schemaKeys;
	          if (arr1) {
	            var $propertyKey, i1 = -1,
	              l1 = arr1.length - 1;
	            while (i1 < l1) {
	              $propertyKey = arr1[i1 += 1];
	              out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
	            }
	          }
	        }
	      }
	      if ($pPropertyKeys.length) {
	        var arr2 = $pPropertyKeys;
	        if (arr2) {
	          var $pProperty, $i = -1,
	            l2 = arr2.length - 1;
	          while ($i < l2) {
	            $pProperty = arr2[$i += 1];
	            out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
	          }
	        }
	      }
	      out += ' ); if (isAdditional' + ($lvl) + ') { ';
	    }
	    if ($removeAdditional == 'all') {
	      out += ' delete ' + ($data) + '[' + ($key) + ']; ';
	    } else {
	      var $currentErrorPath = it.errorPath;
	      var $additionalProperty = '\' + ' + $key + ' + \'';
	      if (it.opts._errorDataPathProperty) {
	        it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
	      }
	      if ($noAdditional) {
	        if ($removeAdditional) {
	          out += ' delete ' + ($data) + '[' + ($key) + ']; ';
	        } else {
	          out += ' ' + ($nextValid) + ' = false; ';
	          var $currErrSchemaPath = $errSchemaPath;
	          $errSchemaPath = it.errSchemaPath + '/additionalProperties';
	          var $$outStack = $$outStack || [];
	          $$outStack.push(out);
	          out = ''; /* istanbul ignore else */
	          if (it.createErrors !== false) {
	            out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
	            if (it.opts.messages !== false) {
	              out += ' , message: \'';
	              if (it.opts._errorDataPathProperty) {
	                out += 'is an invalid additional property';
	              } else {
	                out += 'should NOT have additional properties';
	              }
	              out += '\' ';
	            }
	            if (it.opts.verbose) {
	              out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	            }
	            out += ' } ';
	          } else {
	            out += ' {} ';
	          }
	          var __err = out;
	          out = $$outStack.pop();
	          if (!it.compositeRule && $breakOnError) {
	            /* istanbul ignore if */
	            if (it.async) {
	              out += ' throw new ValidationError([' + (__err) + ']); ';
	            } else {
	              out += ' validate.errors = [' + (__err) + ']; return false; ';
	            }
	          } else {
	            out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	          }
	          $errSchemaPath = $currErrSchemaPath;
	          if ($breakOnError) {
	            out += ' break; ';
	          }
	        }
	      } else if ($additionalIsSchema) {
	        if ($removeAdditional == 'failing') {
	          out += ' var ' + ($errs) + ' = errors;  ';
	          var $wasComposite = it.compositeRule;
	          it.compositeRule = $it.compositeRule = true;
	          $it.schema = $aProperties;
	          $it.schemaPath = it.schemaPath + '.additionalProperties';
	          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
	          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
	          var $passData = $data + '[' + $key + ']';
	          $it.dataPathArr[$dataNxt] = $key;
	          var $code = it.validate($it);
	          $it.baseId = $currentBaseId;
	          if (it.util.varOccurences($code, $nextData) < 2) {
	            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	          } else {
	            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	          }
	          out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; }  ';
	          it.compositeRule = $it.compositeRule = $wasComposite;
	        } else {
	          $it.schema = $aProperties;
	          $it.schemaPath = it.schemaPath + '.additionalProperties';
	          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
	          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
	          var $passData = $data + '[' + $key + ']';
	          $it.dataPathArr[$dataNxt] = $key;
	          var $code = it.validate($it);
	          $it.baseId = $currentBaseId;
	          if (it.util.varOccurences($code, $nextData) < 2) {
	            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	          } else {
	            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	          }
	          if ($breakOnError) {
	            out += ' if (!' + ($nextValid) + ') break; ';
	          }
	        }
	      }
	      it.errorPath = $currentErrorPath;
	    }
	    if ($someProperties) {
	      out += ' } ';
	    }
	    out += ' }  ';
	    if ($breakOnError) {
	      out += ' if (' + ($nextValid) + ') { ';
	      $closingBraces += '}';
	    }
	  }
	  var $useDefaults = it.opts.useDefaults && !it.compositeRule;
	  if ($schemaKeys.length) {
	    var arr3 = $schemaKeys;
	    if (arr3) {
	      var $propertyKey, i3 = -1,
	        l3 = arr3.length - 1;
	      while (i3 < l3) {
	        $propertyKey = arr3[i3 += 1];
	        var $sch = $schema[$propertyKey];
	        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	          var $prop = it.util.getProperty($propertyKey),
	            $passData = $data + $prop,
	            $hasDefault = $useDefaults && $sch.default !== undefined;
	          $it.schema = $sch;
	          $it.schemaPath = $schemaPath + $prop;
	          $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
	          $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
	          $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
	          var $code = it.validate($it);
	          $it.baseId = $currentBaseId;
	          if (it.util.varOccurences($code, $nextData) < 2) {
	            $code = it.util.varReplace($code, $nextData, $passData);
	            var $useData = $passData;
	          } else {
	            var $useData = $nextData;
	            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
	          }
	          if ($hasDefault) {
	            out += ' ' + ($code) + ' ';
	          } else {
	            if ($requiredHash && $requiredHash[$propertyKey]) {
	              out += ' if ( ' + ($useData) + ' === undefined ';
	              if ($ownProperties) {
	                out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	              }
	              out += ') { ' + ($nextValid) + ' = false; ';
	              var $currentErrorPath = it.errorPath,
	                $currErrSchemaPath = $errSchemaPath,
	                $missingProperty = it.util.escapeQuotes($propertyKey);
	              if (it.opts._errorDataPathProperty) {
	                it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
	              }
	              $errSchemaPath = it.errSchemaPath + '/required';
	              var $$outStack = $$outStack || [];
	              $$outStack.push(out);
	              out = ''; /* istanbul ignore else */
	              if (it.createErrors !== false) {
	                out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	                if (it.opts.messages !== false) {
	                  out += ' , message: \'';
	                  if (it.opts._errorDataPathProperty) {
	                    out += 'is a required property';
	                  } else {
	                    out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	                  }
	                  out += '\' ';
	                }
	                if (it.opts.verbose) {
	                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	                }
	                out += ' } ';
	              } else {
	                out += ' {} ';
	              }
	              var __err = out;
	              out = $$outStack.pop();
	              if (!it.compositeRule && $breakOnError) {
	                /* istanbul ignore if */
	                if (it.async) {
	                  out += ' throw new ValidationError([' + (__err) + ']); ';
	                } else {
	                  out += ' validate.errors = [' + (__err) + ']; return false; ';
	                }
	              } else {
	                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	              }
	              $errSchemaPath = $currErrSchemaPath;
	              it.errorPath = $currentErrorPath;
	              out += ' } else { ';
	            } else {
	              if ($breakOnError) {
	                out += ' if ( ' + ($useData) + ' === undefined ';
	                if ($ownProperties) {
	                  out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	                }
	                out += ') { ' + ($nextValid) + ' = true; } else { ';
	              } else {
	                out += ' if (' + ($useData) + ' !== undefined ';
	                if ($ownProperties) {
	                  out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	                }
	                out += ' ) { ';
	              }
	            }
	            out += ' ' + ($code) + ' } ';
	          }
	        }
	        if ($breakOnError) {
	          out += ' if (' + ($nextValid) + ') { ';
	          $closingBraces += '}';
	        }
	      }
	    }
	  }
	  if ($pPropertyKeys.length) {
	    var arr4 = $pPropertyKeys;
	    if (arr4) {
	      var $pProperty, i4 = -1,
	        l4 = arr4.length - 1;
	      while (i4 < l4) {
	        $pProperty = arr4[i4 += 1];
	        var $sch = $pProperties[$pProperty];
	        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
	          $it.schema = $sch;
	          $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
	          $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
	          if ($ownProperties) {
	            out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
	          } else {
	            out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
	          }
	          out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
	          $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
	          var $passData = $data + '[' + $key + ']';
	          $it.dataPathArr[$dataNxt] = $key;
	          var $code = it.validate($it);
	          $it.baseId = $currentBaseId;
	          if (it.util.varOccurences($code, $nextData) < 2) {
	            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	          } else {
	            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	          }
	          if ($breakOnError) {
	            out += ' if (!' + ($nextValid) + ') break; ';
	          }
	          out += ' } ';
	          if ($breakOnError) {
	            out += ' else ' + ($nextValid) + ' = true; ';
	          }
	          out += ' }  ';
	          if ($breakOnError) {
	            out += ' if (' + ($nextValid) + ') { ';
	            $closingBraces += '}';
	          }
	        }
	      }
	    }
	  }
	  if ($breakOnError) {
	    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
	  }
	  return out;
	};
	return properties$3;
}

var propertyNames;
var hasRequiredPropertyNames;

function requirePropertyNames () {
	if (hasRequiredPropertyNames) return propertyNames;
	hasRequiredPropertyNames = 1;
	propertyNames = function generate_propertyNames(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $errs = 'errs__' + $lvl;
	  var $it = it.util.copy(it);
	  var $closingBraces = '';
	  $it.level++;
	  var $nextValid = 'valid' + $it.level;
	  out += 'var ' + ($errs) + ' = errors;';
	  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
	    $it.schema = $schema;
	    $it.schemaPath = $schemaPath;
	    $it.errSchemaPath = $errSchemaPath;
	    var $key = 'key' + $lvl,
	      $idx = 'idx' + $lvl,
	      $i = 'i' + $lvl,
	      $invalidName = '\' + ' + $key + ' + \'',
	      $dataNxt = $it.dataLevel = it.dataLevel + 1,
	      $nextData = 'data' + $dataNxt,
	      $dataProperties = 'dataProperties' + $lvl,
	      $ownProperties = it.opts.ownProperties,
	      $currentBaseId = it.baseId;
	    if ($ownProperties) {
	      out += ' var ' + ($dataProperties) + ' = undefined; ';
	    }
	    if ($ownProperties) {
	      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
	    } else {
	      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
	    }
	    out += ' var startErrs' + ($lvl) + ' = errors; ';
	    var $passData = $key;
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    var $code = it.validate($it);
	    $it.baseId = $currentBaseId;
	    if (it.util.varOccurences($code, $nextData) < 2) {
	      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
	    } else {
	      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
	    }
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; }   var err =   '; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError(vErrors); ';
	      } else {
	        out += ' validate.errors = vErrors; return false; ';
	      }
	    }
	    if ($breakOnError) {
	      out += ' break; ';
	    }
	    out += ' } }';
	  }
	  if ($breakOnError) {
	    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
	  }
	  return out;
	};
	return propertyNames;
}

var required$1;
var hasRequiredRequired;

function requireRequired () {
	if (hasRequiredRequired) return required$1;
	hasRequiredRequired = 1;
	required$1 = function generate_required(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $isData = it.opts.$data && $schema && $schema.$data;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	  }
	  var $vSchema = 'schema' + $lvl;
	  if (!$isData) {
	    if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
	      var $required = [];
	      var arr1 = $schema;
	      if (arr1) {
	        var $property, i1 = -1,
	          l1 = arr1.length - 1;
	        while (i1 < l1) {
	          $property = arr1[i1 += 1];
	          var $propertySch = it.schema.properties[$property];
	          if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
	            $required[$required.length] = $property;
	          }
	        }
	      }
	    } else {
	      var $required = $schema;
	    }
	  }
	  if ($isData || $required.length) {
	    var $currentErrorPath = it.errorPath,
	      $loopRequired = $isData || $required.length >= it.opts.loopRequired,
	      $ownProperties = it.opts.ownProperties;
	    if ($breakOnError) {
	      out += ' var missing' + ($lvl) + '; ';
	      if ($loopRequired) {
	        if (!$isData) {
	          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
	        }
	        var $i = 'i' + $lvl,
	          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
	          $missingProperty = '\' + ' + $propertyPath + ' + \'';
	        if (it.opts._errorDataPathProperty) {
	          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
	        }
	        out += ' var ' + ($valid) + ' = true; ';
	        if ($isData) {
	          out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
	        }
	        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
	        if ($ownProperties) {
	          out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
	        }
	        out += '; if (!' + ($valid) + ') break; } ';
	        if ($isData) {
	          out += '  }  ';
	        }
	        out += '  if (!' + ($valid) + ') {   ';
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'';
	            if (it.opts._errorDataPathProperty) {
	              out += 'is a required property';
	            } else {
	              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	            }
	            out += '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	        out += ' } else { ';
	      } else {
	        out += ' if ( ';
	        var arr2 = $required;
	        if (arr2) {
	          var $propertyKey, $i = -1,
	            l2 = arr2.length - 1;
	          while ($i < l2) {
	            $propertyKey = arr2[$i += 1];
	            if ($i) {
	              out += ' || ';
	            }
	            var $prop = it.util.getProperty($propertyKey),
	              $useData = $data + $prop;
	            out += ' ( ( ' + ($useData) + ' === undefined ';
	            if ($ownProperties) {
	              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	            }
	            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
	          }
	        }
	        out += ') {  ';
	        var $propertyPath = 'missing' + $lvl,
	          $missingProperty = '\' + ' + $propertyPath + ' + \'';
	        if (it.opts._errorDataPathProperty) {
	          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
	        }
	        var $$outStack = $$outStack || [];
	        $$outStack.push(out);
	        out = ''; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'';
	            if (it.opts._errorDataPathProperty) {
	              out += 'is a required property';
	            } else {
	              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	            }
	            out += '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        var __err = out;
	        out = $$outStack.pop();
	        if (!it.compositeRule && $breakOnError) {
	          /* istanbul ignore if */
	          if (it.async) {
	            out += ' throw new ValidationError([' + (__err) + ']); ';
	          } else {
	            out += ' validate.errors = [' + (__err) + ']; return false; ';
	          }
	        } else {
	          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	        }
	        out += ' } else { ';
	      }
	    } else {
	      if ($loopRequired) {
	        if (!$isData) {
	          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
	        }
	        var $i = 'i' + $lvl,
	          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
	          $missingProperty = '\' + ' + $propertyPath + ' + \'';
	        if (it.opts._errorDataPathProperty) {
	          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
	        }
	        if ($isData) {
	          out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) {  var err =   '; /* istanbul ignore else */
	          if (it.createErrors !== false) {
	            out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	            if (it.opts.messages !== false) {
	              out += ' , message: \'';
	              if (it.opts._errorDataPathProperty) {
	                out += 'is a required property';
	              } else {
	                out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	              }
	              out += '\' ';
	            }
	            if (it.opts.verbose) {
	              out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	            }
	            out += ' } ';
	          } else {
	            out += ' {} ';
	          }
	          out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
	        }
	        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
	        if ($ownProperties) {
	          out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
	        }
	        out += ') {  var err =   '; /* istanbul ignore else */
	        if (it.createErrors !== false) {
	          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	          if (it.opts.messages !== false) {
	            out += ' , message: \'';
	            if (it.opts._errorDataPathProperty) {
	              out += 'is a required property';
	            } else {
	              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	            }
	            out += '\' ';
	          }
	          if (it.opts.verbose) {
	            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	          }
	          out += ' } ';
	        } else {
	          out += ' {} ';
	        }
	        out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
	        if ($isData) {
	          out += '  }  ';
	        }
	      } else {
	        var arr3 = $required;
	        if (arr3) {
	          var $propertyKey, i3 = -1,
	            l3 = arr3.length - 1;
	          while (i3 < l3) {
	            $propertyKey = arr3[i3 += 1];
	            var $prop = it.util.getProperty($propertyKey),
	              $missingProperty = it.util.escapeQuotes($propertyKey),
	              $useData = $data + $prop;
	            if (it.opts._errorDataPathProperty) {
	              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
	            }
	            out += ' if ( ' + ($useData) + ' === undefined ';
	            if ($ownProperties) {
	              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
	            }
	            out += ') {  var err =   '; /* istanbul ignore else */
	            if (it.createErrors !== false) {
	              out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
	              if (it.opts.messages !== false) {
	                out += ' , message: \'';
	                if (it.opts._errorDataPathProperty) {
	                  out += 'is a required property';
	                } else {
	                  out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
	                }
	                out += '\' ';
	              }
	              if (it.opts.verbose) {
	                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	              }
	              out += ' } ';
	            } else {
	              out += ' {} ';
	            }
	            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
	          }
	        }
	      }
	    }
	    it.errorPath = $currentErrorPath;
	  } else if ($breakOnError) {
	    out += ' if (true) {';
	  }
	  return out;
	};
	return required$1;
}

var uniqueItems;
var hasRequiredUniqueItems;

function requireUniqueItems () {
	if (hasRequiredUniqueItems) return uniqueItems;
	hasRequiredUniqueItems = 1;
	uniqueItems = function generate_uniqueItems(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  if (($schema || $isData) && it.opts.uniqueItems !== false) {
	    if ($isData) {
	      out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
	    }
	    out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';
	    var $itemType = it.schema.items && it.schema.items.type,
	      $typeIsArray = Array.isArray($itemType);
	    if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {
	      out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';
	    } else {
	      out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
	      var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
	      out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
	      if ($typeIsArray) {
	        out += ' if (typeof item == \'string\') item = \'"\' + item; ';
	      }
	      out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';
	    }
	    out += ' } ';
	    if ($isData) {
	      out += '  }  ';
	    }
	    out += ' if (!' + ($valid) + ') {   ';
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = ''; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema:  ';
	        if ($isData) {
	          out += 'validate.schema' + ($schemaPath);
	        } else {
	          out += '' + ($schema);
	        }
	        out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    var __err = out;
	    out = $$outStack.pop();
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError([' + (__err) + ']); ';
	      } else {
	        out += ' validate.errors = [' + (__err) + ']; return false; ';
	      }
	    } else {
	      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    }
	    out += ' } ';
	    if ($breakOnError) {
	      out += ' else { ';
	    }
	  } else {
	    if ($breakOnError) {
	      out += ' if (true) { ';
	    }
	  }
	  return out;
	};
	return uniqueItems;
}

var dotjs;
var hasRequiredDotjs;

function requireDotjs () {
	if (hasRequiredDotjs) return dotjs;
	hasRequiredDotjs = 1;

	//all requires must be explicit because browserify won't work with dynamic requires
	dotjs = {
	  '$ref': requireRef(),
	  allOf: requireAllOf(),
	  anyOf: requireAnyOf(),
	  '$comment': requireComment(),
	  const: require_const(),
	  contains: requireContains(),
	  dependencies: requireDependencies(),
	  'enum': require_enum(),
	  format: requireFormat(),
	  'if': require_if(),
	  items: requireItems(),
	  maximum: require_limit(),
	  minimum: require_limit(),
	  maxItems: require_limitItems(),
	  minItems: require_limitItems(),
	  maxLength: require_limitLength(),
	  minLength: require_limitLength(),
	  maxProperties: require_limitProperties(),
	  minProperties: require_limitProperties(),
	  multipleOf: requireMultipleOf(),
	  not: requireNot(),
	  oneOf: requireOneOf(),
	  pattern: requirePattern(),
	  properties: requireProperties(),
	  propertyNames: requirePropertyNames(),
	  required: requireRequired(),
	  uniqueItems: requireUniqueItems(),
	  validate: requireValidate()
	};
	return dotjs;
}

var rules$3;
var hasRequiredRules$2;

function requireRules$2 () {
	if (hasRequiredRules$2) return rules$3;
	hasRequiredRules$2 = 1;

	var ruleModules = requireDotjs()
	  , toHash = requireUtil().toHash;

	rules$3 = function rules() {
	  var RULES = [
	    { type: 'number',
	      rules: [ { 'maximum': ['exclusiveMaximum'] },
	               { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
	    { type: 'string',
	      rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
	    { type: 'array',
	      rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },
	    { type: 'object',
	      rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
	               { 'properties': ['additionalProperties', 'patternProperties'] } ] },
	    { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }
	  ];

	  var ALL = [ 'type', '$comment' ];
	  var KEYWORDS = [
	    '$schema', '$id', 'id', '$data', '$async', 'title',
	    'description', 'default', 'definitions',
	    'examples', 'readOnly', 'writeOnly',
	    'contentMediaType', 'contentEncoding',
	    'additionalItems', 'then', 'else'
	  ];
	  var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
	  RULES.all = toHash(ALL);
	  RULES.types = toHash(TYPES);

	  RULES.forEach(function (group) {
	    group.rules = group.rules.map(function (keyword) {
	      var implKeywords;
	      if (typeof keyword == 'object') {
	        var key = Object.keys(keyword)[0];
	        implKeywords = keyword[key];
	        keyword = key;
	        implKeywords.forEach(function (k) {
	          ALL.push(k);
	          RULES.all[k] = true;
	        });
	      }
	      ALL.push(keyword);
	      var rule = RULES.all[keyword] = {
	        keyword: keyword,
	        code: ruleModules[keyword],
	        implements: implKeywords
	      };
	      return rule;
	    });

	    RULES.all.$comment = {
	      keyword: '$comment',
	      code: ruleModules.$comment
	    };

	    if (group.type) RULES.types[group.type] = group;
	  });

	  RULES.keywords = toHash(ALL.concat(KEYWORDS));
	  RULES.custom = {};

	  return RULES;
	};
	return rules$3;
}

var data;
var hasRequiredData;

function requireData () {
	if (hasRequiredData) return data;
	hasRequiredData = 1;

	var KEYWORDS = [
	  'multipleOf',
	  'maximum',
	  'exclusiveMaximum',
	  'minimum',
	  'exclusiveMinimum',
	  'maxLength',
	  'minLength',
	  'pattern',
	  'additionalItems',
	  'maxItems',
	  'minItems',
	  'uniqueItems',
	  'maxProperties',
	  'minProperties',
	  'required',
	  'additionalProperties',
	  'enum',
	  'format',
	  'const'
	];

	data = function (metaSchema, keywordsJsonPointers) {
	  for (var i=0; i<keywordsJsonPointers.length; i++) {
	    metaSchema = JSON.parse(JSON.stringify(metaSchema));
	    var segments = keywordsJsonPointers[i].split('/');
	    var keywords = metaSchema;
	    var j;
	    for (j=1; j<segments.length; j++)
	      keywords = keywords[segments[j]];

	    for (j=0; j<KEYWORDS.length; j++) {
	      var key = KEYWORDS[j];
	      var schema = keywords[key];
	      if (schema) {
	        keywords[key] = {
	          anyOf: [
	            schema,
	            { $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
	          ]
	        };
	      }
	    }
	  }

	  return metaSchema;
	};
	return data;
}

var async;
var hasRequiredAsync;

function requireAsync () {
	if (hasRequiredAsync) return async;
	hasRequiredAsync = 1;

	var MissingRefError = requireError_classes().MissingRef;

	async = compileAsync;


	/**
	 * Creates validating function for passed schema with asynchronous loading of missing schemas.
	 * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
	 * @this  Ajv
	 * @param {Object}   schema schema object
	 * @param {Boolean}  meta optional true to compile meta-schema; this parameter can be skipped
	 * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
	 * @return {Promise} promise that resolves with a validating function.
	 */
	function compileAsync(schema, meta, callback) {
	  /* eslint no-shadow: 0 */
	  /* global Promise */
	  /* jshint validthis: true */
	  var self = this;
	  if (typeof this._opts.loadSchema != 'function')
	    throw new Error('options.loadSchema should be a function');

	  if (typeof meta == 'function') {
	    callback = meta;
	    meta = undefined;
	  }

	  var p = loadMetaSchemaOf(schema).then(function () {
	    var schemaObj = self._addSchema(schema, undefined, meta);
	    return schemaObj.validate || _compileAsync(schemaObj);
	  });

	  if (callback) {
	    p.then(
	      function(v) { callback(null, v); },
	      callback
	    );
	  }

	  return p;


	  function loadMetaSchemaOf(sch) {
	    var $schema = sch.$schema;
	    return $schema && !self.getSchema($schema)
	            ? compileAsync.call(self, { $ref: $schema }, true)
	            : Promise.resolve();
	  }


	  function _compileAsync(schemaObj) {
	    try { return self._compile(schemaObj); }
	    catch(e) {
	      if (e instanceof MissingRefError) return loadMissingSchema(e);
	      throw e;
	    }


	    function loadMissingSchema(e) {
	      var ref = e.missingSchema;
	      if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');

	      var schemaPromise = self._loadingSchemas[ref];
	      if (!schemaPromise) {
	        schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
	        schemaPromise.then(removePromise, removePromise);
	      }

	      return schemaPromise.then(function (sch) {
	        if (!added(ref)) {
	          return loadMetaSchemaOf(sch).then(function () {
	            if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
	          });
	        }
	      }).then(function() {
	        return _compileAsync(schemaObj);
	      });

	      function removePromise() {
	        delete self._loadingSchemas[ref];
	      }

	      function added(ref) {
	        return self._refs[ref] || self._schemas[ref];
	      }
	    }
	  }
	}
	return async;
}

var custom;
var hasRequiredCustom;

function requireCustom () {
	if (hasRequiredCustom) return custom;
	hasRequiredCustom = 1;
	custom = function generate_custom(it, $keyword, $ruleType) {
	  var out = ' ';
	  var $lvl = it.level;
	  var $dataLvl = it.dataLevel;
	  var $schema = it.schema[$keyword];
	  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
	  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
	  var $breakOnError = !it.opts.allErrors;
	  var $errorKeyword;
	  var $data = 'data' + ($dataLvl || '');
	  var $valid = 'valid' + $lvl;
	  var $errs = 'errs__' + $lvl;
	  var $isData = it.opts.$data && $schema && $schema.$data,
	    $schemaValue;
	  if ($isData) {
	    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
	    $schemaValue = 'schema' + $lvl;
	  } else {
	    $schemaValue = $schema;
	  }
	  var $rule = this,
	    $definition = 'definition' + $lvl,
	    $rDef = $rule.definition,
	    $closingBraces = '';
	  var $compile, $inline, $macro, $ruleValidate, $validateCode;
	  if ($isData && $rDef.$data) {
	    $validateCode = 'keywordValidate' + $lvl;
	    var $validateSchema = $rDef.validateSchema;
	    out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
	  } else {
	    $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
	    if (!$ruleValidate) return;
	    $schemaValue = 'validate.schema' + $schemaPath;
	    $validateCode = $ruleValidate.code;
	    $compile = $rDef.compile;
	    $inline = $rDef.inline;
	    $macro = $rDef.macro;
	  }
	  var $ruleErrs = $validateCode + '.errors',
	    $i = 'i' + $lvl,
	    $ruleErr = 'ruleErr' + $lvl,
	    $asyncKeyword = $rDef.async;
	  if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
	  if (!($inline || $macro)) {
	    out += '' + ($ruleErrs) + ' = null;';
	  }
	  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
	  if ($isData && $rDef.$data) {
	    $closingBraces += '}';
	    out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
	    if ($validateSchema) {
	      $closingBraces += '}';
	      out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
	    }
	  }
	  if ($inline) {
	    if ($rDef.statements) {
	      out += ' ' + ($ruleValidate.validate) + ' ';
	    } else {
	      out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
	    }
	  } else if ($macro) {
	    var $it = it.util.copy(it);
	    var $closingBraces = '';
	    $it.level++;
	    var $nextValid = 'valid' + $it.level;
	    $it.schema = $ruleValidate.validate;
	    $it.schemaPath = '';
	    var $wasComposite = it.compositeRule;
	    it.compositeRule = $it.compositeRule = true;
	    var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
	    it.compositeRule = $it.compositeRule = $wasComposite;
	    out += ' ' + ($code);
	  } else {
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = '';
	    out += '  ' + ($validateCode) + '.call( ';
	    if (it.opts.passContext) {
	      out += 'this';
	    } else {
	      out += 'self';
	    }
	    if ($compile || $rDef.schema === false) {
	      out += ' , ' + ($data) + ' ';
	    } else {
	      out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
	    }
	    out += ' , (dataPath || \'\')';
	    if (it.errorPath != '""') {
	      out += ' + ' + (it.errorPath);
	    }
	    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
	      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
	    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData )  ';
	    var def_callRuleValidate = out;
	    out = $$outStack.pop();
	    if ($rDef.errors === false) {
	      out += ' ' + ($valid) + ' = ';
	      if ($asyncKeyword) {
	        out += 'await ';
	      }
	      out += '' + (def_callRuleValidate) + '; ';
	    } else {
	      if ($asyncKeyword) {
	        $ruleErrs = 'customErrors' + $lvl;
	        out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
	      } else {
	        out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
	      }
	    }
	  }
	  if ($rDef.modifying) {
	    out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
	  }
	  out += '' + ($closingBraces);
	  if ($rDef.valid) {
	    if ($breakOnError) {
	      out += ' if (true) { ';
	    }
	  } else {
	    out += ' if ( ';
	    if ($rDef.valid === undefined) {
	      out += ' !';
	      if ($macro) {
	        out += '' + ($nextValid);
	      } else {
	        out += '' + ($valid);
	      }
	    } else {
	      out += ' ' + (!$rDef.valid) + ' ';
	    }
	    out += ') { ';
	    $errorKeyword = $rule.keyword;
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = '';
	    var $$outStack = $$outStack || [];
	    $$outStack.push(out);
	    out = ''; /* istanbul ignore else */
	    if (it.createErrors !== false) {
	      out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
	      if (it.opts.messages !== false) {
	        out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
	      }
	      if (it.opts.verbose) {
	        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	      }
	      out += ' } ';
	    } else {
	      out += ' {} ';
	    }
	    var __err = out;
	    out = $$outStack.pop();
	    if (!it.compositeRule && $breakOnError) {
	      /* istanbul ignore if */
	      if (it.async) {
	        out += ' throw new ValidationError([' + (__err) + ']); ';
	      } else {
	        out += ' validate.errors = [' + (__err) + ']; return false; ';
	      }
	    } else {
	      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	    }
	    var def_customError = out;
	    out = $$outStack.pop();
	    if ($inline) {
	      if ($rDef.errors) {
	        if ($rDef.errors != 'full') {
	          out += '  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
	          if (it.opts.verbose) {
	            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
	          }
	          out += ' } ';
	        }
	      } else {
	        if ($rDef.errors === false) {
	          out += ' ' + (def_customError) + ' ';
	        } else {
	          out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else {  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
	          if (it.opts.verbose) {
	            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
	          }
	          out += ' } } ';
	        }
	      }
	    } else if ($macro) {
	      out += '   var err =   '; /* istanbul ignore else */
	      if (it.createErrors !== false) {
	        out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
	        if (it.opts.messages !== false) {
	          out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
	        }
	        if (it.opts.verbose) {
	          out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
	        }
	        out += ' } ';
	      } else {
	        out += ' {} ';
	      }
	      out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
	      if (!it.compositeRule && $breakOnError) {
	        /* istanbul ignore if */
	        if (it.async) {
	          out += ' throw new ValidationError(vErrors); ';
	        } else {
	          out += ' validate.errors = vErrors; return false; ';
	        }
	      }
	    } else {
	      if ($rDef.errors === false) {
	        out += ' ' + (def_customError) + ' ';
	      } else {
	        out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length;  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + ';  ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '";  ';
	        if (it.opts.verbose) {
	          out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
	        }
	        out += ' } } else { ' + (def_customError) + ' } ';
	      }
	    }
	    out += ' } ';
	    if ($breakOnError) {
	      out += ' else { ';
	    }
	  }
	  return out;
	};
	return custom;
}

var $schema$2 = "http://json-schema.org/draft-07/schema#";
var $id$1 = "http://json-schema.org/draft-07/schema#";
var title = "Core schema meta-schema";
var definitions$1 = {
	schemaArray: {
		type: "array",
		minItems: 1,
		items: {
			$ref: "#"
		}
	},
	nonNegativeInteger: {
		type: "integer",
		minimum: 0
	},
	nonNegativeIntegerDefault0: {
		allOf: [
			{
				$ref: "#/definitions/nonNegativeInteger"
			},
			{
				"default": 0
			}
		]
	},
	simpleTypes: {
		"enum": [
			"array",
			"boolean",
			"integer",
			"null",
			"number",
			"object",
			"string"
		]
	},
	stringArray: {
		type: "array",
		items: {
			type: "string"
		},
		uniqueItems: true,
		"default": [
		]
	}
};
var type$2 = [
	"object",
	"boolean"
];
var properties$2 = {
	$id: {
		type: "string",
		format: "uri-reference"
	},
	$schema: {
		type: "string",
		format: "uri"
	},
	$ref: {
		type: "string",
		format: "uri-reference"
	},
	$comment: {
		type: "string"
	},
	title: {
		type: "string"
	},
	description: {
		type: "string"
	},
	"default": true,
	readOnly: {
		type: "boolean",
		"default": false
	},
	examples: {
		type: "array",
		items: true
	},
	multipleOf: {
		type: "number",
		exclusiveMinimum: 0
	},
	maximum: {
		type: "number"
	},
	exclusiveMaximum: {
		type: "number"
	},
	minimum: {
		type: "number"
	},
	exclusiveMinimum: {
		type: "number"
	},
	maxLength: {
		$ref: "#/definitions/nonNegativeInteger"
	},
	minLength: {
		$ref: "#/definitions/nonNegativeIntegerDefault0"
	},
	pattern: {
		type: "string",
		format: "regex"
	},
	additionalItems: {
		$ref: "#"
	},
	items: {
		anyOf: [
			{
				$ref: "#"
			},
			{
				$ref: "#/definitions/schemaArray"
			}
		],
		"default": true
	},
	maxItems: {
		$ref: "#/definitions/nonNegativeInteger"
	},
	minItems: {
		$ref: "#/definitions/nonNegativeIntegerDefault0"
	},
	uniqueItems: {
		type: "boolean",
		"default": false
	},
	contains: {
		$ref: "#"
	},
	maxProperties: {
		$ref: "#/definitions/nonNegativeInteger"
	},
	minProperties: {
		$ref: "#/definitions/nonNegativeIntegerDefault0"
	},
	required: {
		$ref: "#/definitions/stringArray"
	},
	additionalProperties: {
		$ref: "#"
	},
	definitions: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		"default": {
		}
	},
	properties: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		"default": {
		}
	},
	patternProperties: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		propertyNames: {
			format: "regex"
		},
		"default": {
		}
	},
	dependencies: {
		type: "object",
		additionalProperties: {
			anyOf: [
				{
					$ref: "#"
				},
				{
					$ref: "#/definitions/stringArray"
				}
			]
		}
	},
	propertyNames: {
		$ref: "#"
	},
	"const": true,
	"enum": {
		type: "array",
		items: true,
		minItems: 1,
		uniqueItems: true
	},
	type: {
		anyOf: [
			{
				$ref: "#/definitions/simpleTypes"
			},
			{
				type: "array",
				items: {
					$ref: "#/definitions/simpleTypes"
				},
				minItems: 1,
				uniqueItems: true
			}
		]
	},
	format: {
		type: "string"
	},
	contentMediaType: {
		type: "string"
	},
	contentEncoding: {
		type: "string"
	},
	"if": {
		$ref: "#"
	},
	then: {
		$ref: "#"
	},
	"else": {
		$ref: "#"
	},
	allOf: {
		$ref: "#/definitions/schemaArray"
	},
	anyOf: {
		$ref: "#/definitions/schemaArray"
	},
	oneOf: {
		$ref: "#/definitions/schemaArray"
	},
	not: {
		$ref: "#"
	}
};
var require$$13 = {
	$schema: $schema$2,
	$id: $id$1,
	title: title,
	definitions: definitions$1,
	type: type$2,
	properties: properties$2,
	"default": true
};

var definition_schema;
var hasRequiredDefinition_schema;

function requireDefinition_schema () {
	if (hasRequiredDefinition_schema) return definition_schema;
	hasRequiredDefinition_schema = 1;

	var metaSchema = require$$13;

	definition_schema = {
	  $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
	  definitions: {
	    simpleTypes: metaSchema.definitions.simpleTypes
	  },
	  type: 'object',
	  dependencies: {
	    schema: ['validate'],
	    $data: ['validate'],
	    statements: ['inline'],
	    valid: {not: {required: ['macro']}}
	  },
	  properties: {
	    type: metaSchema.properties.type,
	    schema: {type: 'boolean'},
	    statements: {type: 'boolean'},
	    dependencies: {
	      type: 'array',
	      items: {type: 'string'}
	    },
	    metaSchema: {type: 'object'},
	    modifying: {type: 'boolean'},
	    valid: {type: 'boolean'},
	    $data: {type: 'boolean'},
	    async: {type: 'boolean'},
	    errors: {
	      anyOf: [
	        {type: 'boolean'},
	        {const: 'full'}
	      ]
	    }
	  }
	};
	return definition_schema;
}

var keyword$1;
var hasRequiredKeyword$1;

function requireKeyword$1 () {
	if (hasRequiredKeyword$1) return keyword$1;
	hasRequiredKeyword$1 = 1;

	var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
	var customRuleCode = requireCustom();
	var definitionSchema = requireDefinition_schema();

	keyword$1 = {
	  add: addKeyword,
	  get: getKeyword,
	  remove: removeKeyword,
	  validate: validateKeyword
	};


	/**
	 * Define custom keyword
	 * @this  Ajv
	 * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).
	 * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
	 * @return {Ajv} this for method chaining
	 */
	function addKeyword(keyword, definition) {
	  /* jshint validthis: true */
	  /* eslint no-shadow: 0 */
	  var RULES = this.RULES;
	  if (RULES.keywords[keyword])
	    throw new Error('Keyword ' + keyword + ' is already defined');

	  if (!IDENTIFIER.test(keyword))
	    throw new Error('Keyword ' + keyword + ' is not a valid identifier');

	  if (definition) {
	    this.validateKeyword(definition, true);

	    var dataType = definition.type;
	    if (Array.isArray(dataType)) {
	      for (var i=0; i<dataType.length; i++)
	        _addRule(keyword, dataType[i], definition);
	    } else {
	      _addRule(keyword, dataType, definition);
	    }

	    var metaSchema = definition.metaSchema;
	    if (metaSchema) {
	      if (definition.$data && this._opts.$data) {
	        metaSchema = {
	          anyOf: [
	            metaSchema,
	            { '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
	          ]
	        };
	      }
	      definition.validateSchema = this.compile(metaSchema, true);
	    }
	  }

	  RULES.keywords[keyword] = RULES.all[keyword] = true;


	  function _addRule(keyword, dataType, definition) {
	    var ruleGroup;
	    for (var i=0; i<RULES.length; i++) {
	      var rg = RULES[i];
	      if (rg.type == dataType) {
	        ruleGroup = rg;
	        break;
	      }
	    }

	    if (!ruleGroup) {
	      ruleGroup = { type: dataType, rules: [] };
	      RULES.push(ruleGroup);
	    }

	    var rule = {
	      keyword: keyword,
	      definition: definition,
	      custom: true,
	      code: customRuleCode,
	      implements: definition.implements
	    };
	    ruleGroup.rules.push(rule);
	    RULES.custom[keyword] = rule;
	  }

	  return this;
	}


	/**
	 * Get keyword
	 * @this  Ajv
	 * @param {String} keyword pre-defined or custom keyword.
	 * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
	 */
	function getKeyword(keyword) {
	  /* jshint validthis: true */
	  var rule = this.RULES.custom[keyword];
	  return rule ? rule.definition : this.RULES.keywords[keyword] || false;
	}


	/**
	 * Remove keyword
	 * @this  Ajv
	 * @param {String} keyword pre-defined or custom keyword.
	 * @return {Ajv} this for method chaining
	 */
	function removeKeyword(keyword) {
	  /* jshint validthis: true */
	  var RULES = this.RULES;
	  delete RULES.keywords[keyword];
	  delete RULES.all[keyword];
	  delete RULES.custom[keyword];
	  for (var i=0; i<RULES.length; i++) {
	    var rules = RULES[i].rules;
	    for (var j=0; j<rules.length; j++) {
	      if (rules[j].keyword == keyword) {
	        rules.splice(j, 1);
	        break;
	      }
	    }
	  }
	  return this;
	}


	/**
	 * Validate keyword definition
	 * @this  Ajv
	 * @param {Object} definition keyword definition object.
	 * @param {Boolean} throwError true to throw exception if definition is invalid
	 * @return {boolean} validation result
	 */
	function validateKeyword(definition, throwError) {
	  validateKeyword.errors = null;
	  var v = this._validateKeyword = this._validateKeyword
	                                  || this.compile(definitionSchema, true);

	  if (v(definition)) return true;
	  validateKeyword.errors = v.errors;
	  if (throwError)
	    throw new Error('custom keyword definition is invalid: '  + this.errorsText(v.errors));
	  else
	    return false;
	}
	return keyword$1;
}

var $schema$1 = "http://json-schema.org/draft-07/schema#";
var $id = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";
var description$1 = "Meta-schema for $data reference (JSON Schema extension proposal)";
var type$1 = "object";
var required = [
	"$data"
];
var properties$1 = {
	$data: {
		type: "string",
		anyOf: [
			{
				format: "relative-json-pointer"
			},
			{
				format: "json-pointer"
			}
		]
	}
};
var additionalProperties = false;
var require$$12 = {
	$schema: $schema$1,
	$id: $id,
	description: description$1,
	type: type$1,
	required: required,
	properties: properties$1,
	additionalProperties: additionalProperties
};

var ajv$1;
var hasRequiredAjv$1;

function requireAjv$1 () {
	if (hasRequiredAjv$1) return ajv$1;
	hasRequiredAjv$1 = 1;

	var compileSchema = requireCompile()
	  , resolve = requireResolve()
	  , Cache = requireCache()
	  , SchemaObject = requireSchema_obj()
	  , stableStringify = requireFastJsonStableStringify()
	  , formats = requireFormats()
	  , rules = requireRules$2()
	  , $dataMetaSchema = requireData()
	  , util = requireUtil();

	ajv$1 = Ajv;

	Ajv.prototype.validate = validate;
	Ajv.prototype.compile = compile;
	Ajv.prototype.addSchema = addSchema;
	Ajv.prototype.addMetaSchema = addMetaSchema;
	Ajv.prototype.validateSchema = validateSchema;
	Ajv.prototype.getSchema = getSchema;
	Ajv.prototype.removeSchema = removeSchema;
	Ajv.prototype.addFormat = addFormat;
	Ajv.prototype.errorsText = errorsText;

	Ajv.prototype._addSchema = _addSchema;
	Ajv.prototype._compile = _compile;

	Ajv.prototype.compileAsync = requireAsync();
	var customKeyword = requireKeyword$1();
	Ajv.prototype.addKeyword = customKeyword.add;
	Ajv.prototype.getKeyword = customKeyword.get;
	Ajv.prototype.removeKeyword = customKeyword.remove;
	Ajv.prototype.validateKeyword = customKeyword.validate;

	var errorClasses = requireError_classes();
	Ajv.ValidationError = errorClasses.Validation;
	Ajv.MissingRefError = errorClasses.MissingRef;
	Ajv.$dataMetaSchema = $dataMetaSchema;

	var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';

	var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];
	var META_SUPPORT_DATA = ['/properties'];

	/**
	 * Creates validator instance.
	 * Usage: `Ajv(opts)`
	 * @param {Object} opts optional options
	 * @return {Object} ajv instance
	 */
	function Ajv(opts) {
	  if (!(this instanceof Ajv)) return new Ajv(opts);
	  opts = this._opts = util.copy(opts) || {};
	  setLogger(this);
	  this._schemas = {};
	  this._refs = {};
	  this._fragments = {};
	  this._formats = formats(opts.format);

	  this._cache = opts.cache || new Cache;
	  this._loadingSchemas = {};
	  this._compilations = [];
	  this.RULES = rules();
	  this._getId = chooseGetId(opts);

	  opts.loopRequired = opts.loopRequired || Infinity;
	  if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
	  if (opts.serialize === undefined) opts.serialize = stableStringify;
	  this._metaOpts = getMetaSchemaOptions(this);

	  if (opts.formats) addInitialFormats(this);
	  if (opts.keywords) addInitialKeywords(this);
	  addDefaultMetaSchema(this);
	  if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
	  if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
	  addInitialSchemas(this);
	}



	/**
	 * Validate data using schema
	 * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.
	 * @this   Ajv
	 * @param  {String|Object} schemaKeyRef key, ref or schema object
	 * @param  {Any} data to be validated
	 * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
	 */
	function validate(schemaKeyRef, data) {
	  var v;
	  if (typeof schemaKeyRef == 'string') {
	    v = this.getSchema(schemaKeyRef);
	    if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
	  } else {
	    var schemaObj = this._addSchema(schemaKeyRef);
	    v = schemaObj.validate || this._compile(schemaObj);
	  }

	  var valid = v(data);
	  if (v.$async !== true) this.errors = v.errors;
	  return valid;
	}


	/**
	 * Create validating function for passed schema.
	 * @this   Ajv
	 * @param  {Object} schema schema object
	 * @param  {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
	 * @return {Function} validating function
	 */
	function compile(schema, _meta) {
	  var schemaObj = this._addSchema(schema, undefined, _meta);
	  return schemaObj.validate || this._compile(schemaObj);
	}


	/**
	 * Adds schema to the instance.
	 * @this   Ajv
	 * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
	 * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
	 * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
	 * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
	 * @return {Ajv} this for method chaining
	 */
	function addSchema(schema, key, _skipValidation, _meta) {
	  if (Array.isArray(schema)){
	    for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);
	    return this;
	  }
	  var id = this._getId(schema);
	  if (id !== undefined && typeof id != 'string')
	    throw new Error('schema id must be string');
	  key = resolve.normalizeId(key || id);
	  checkUnique(this, key);
	  this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
	  return this;
	}


	/**
	 * Add schema that will be used to validate other schemas
	 * options in META_IGNORE_OPTIONS are alway set to false
	 * @this   Ajv
	 * @param {Object} schema schema object
	 * @param {String} key optional schema key
	 * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
	 * @return {Ajv} this for method chaining
	 */
	function addMetaSchema(schema, key, skipValidation) {
	  this.addSchema(schema, key, skipValidation, true);
	  return this;
	}


	/**
	 * Validate schema
	 * @this   Ajv
	 * @param {Object} schema schema to validate
	 * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
	 * @return {Boolean} true if schema is valid
	 */
	function validateSchema(schema, throwOrLogError) {
	  var $schema = schema.$schema;
	  if ($schema !== undefined && typeof $schema != 'string')
	    throw new Error('$schema must be a string');
	  $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
	  if (!$schema) {
	    this.logger.warn('meta-schema not available');
	    this.errors = null;
	    return true;
	  }
	  var valid = this.validate($schema, schema);
	  if (!valid && throwOrLogError) {
	    var message = 'schema is invalid: ' + this.errorsText();
	    if (this._opts.validateSchema == 'log') this.logger.error(message);
	    else throw new Error(message);
	  }
	  return valid;
	}


	function defaultMeta(self) {
	  var meta = self._opts.meta;
	  self._opts.defaultMeta = typeof meta == 'object'
	                            ? self._getId(meta) || meta
	                            : self.getSchema(META_SCHEMA_ID)
	                              ? META_SCHEMA_ID
	                              : undefined;
	  return self._opts.defaultMeta;
	}


	/**
	 * Get compiled schema from the instance by `key` or `ref`.
	 * @this   Ajv
	 * @param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
	 * @return {Function} schema validating function (with property `schema`).
	 */
	function getSchema(keyRef) {
	  var schemaObj = _getSchemaObj(this, keyRef);
	  switch (typeof schemaObj) {
	    case 'object': return schemaObj.validate || this._compile(schemaObj);
	    case 'string': return this.getSchema(schemaObj);
	    case 'undefined': return _getSchemaFragment(this, keyRef);
	  }
	}


	function _getSchemaFragment(self, ref) {
	  var res = resolve.schema.call(self, { schema: {} }, ref);
	  if (res) {
	    var schema = res.schema
	      , root = res.root
	      , baseId = res.baseId;
	    var v = compileSchema.call(self, schema, root, undefined, baseId);
	    self._fragments[ref] = new SchemaObject({
	      ref: ref,
	      fragment: true,
	      schema: schema,
	      root: root,
	      baseId: baseId,
	      validate: v
	    });
	    return v;
	  }
	}


	function _getSchemaObj(self, keyRef) {
	  keyRef = resolve.normalizeId(keyRef);
	  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
	}


	/**
	 * Remove cached schema(s).
	 * If no parameter is passed all schemas but meta-schemas are removed.
	 * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
	 * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
	 * @this   Ajv
	 * @param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
	 * @return {Ajv} this for method chaining
	 */
	function removeSchema(schemaKeyRef) {
	  if (schemaKeyRef instanceof RegExp) {
	    _removeAllSchemas(this, this._schemas, schemaKeyRef);
	    _removeAllSchemas(this, this._refs, schemaKeyRef);
	    return this;
	  }
	  switch (typeof schemaKeyRef) {
	    case 'undefined':
	      _removeAllSchemas(this, this._schemas);
	      _removeAllSchemas(this, this._refs);
	      this._cache.clear();
	      return this;
	    case 'string':
	      var schemaObj = _getSchemaObj(this, schemaKeyRef);
	      if (schemaObj) this._cache.del(schemaObj.cacheKey);
	      delete this._schemas[schemaKeyRef];
	      delete this._refs[schemaKeyRef];
	      return this;
	    case 'object':
	      var serialize = this._opts.serialize;
	      var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
	      this._cache.del(cacheKey);
	      var id = this._getId(schemaKeyRef);
	      if (id) {
	        id = resolve.normalizeId(id);
	        delete this._schemas[id];
	        delete this._refs[id];
	      }
	  }
	  return this;
	}


	function _removeAllSchemas(self, schemas, regex) {
	  for (var keyRef in schemas) {
	    var schemaObj = schemas[keyRef];
	    if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
	      self._cache.del(schemaObj.cacheKey);
	      delete schemas[keyRef];
	    }
	  }
	}


	/* @this   Ajv */
	function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
	  if (typeof schema != 'object' && typeof schema != 'boolean')
	    throw new Error('schema should be object or boolean');
	  var serialize = this._opts.serialize;
	  var cacheKey = serialize ? serialize(schema) : schema;
	  var cached = this._cache.get(cacheKey);
	  if (cached) return cached;

	  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;

	  var id = resolve.normalizeId(this._getId(schema));
	  if (id && shouldAddSchema) checkUnique(this, id);

	  var willValidate = this._opts.validateSchema !== false && !skipValidation;
	  var recursiveMeta;
	  if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
	    this.validateSchema(schema, true);

	  var localRefs = resolve.ids.call(this, schema);

	  var schemaObj = new SchemaObject({
	    id: id,
	    schema: schema,
	    localRefs: localRefs,
	    cacheKey: cacheKey,
	    meta: meta
	  });

	  if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;
	  this._cache.put(cacheKey, schemaObj);

	  if (willValidate && recursiveMeta) this.validateSchema(schema, true);

	  return schemaObj;
	}


	/* @this   Ajv */
	function _compile(schemaObj, root) {
	  if (schemaObj.compiling) {
	    schemaObj.validate = callValidate;
	    callValidate.schema = schemaObj.schema;
	    callValidate.errors = null;
	    callValidate.root = root ? root : callValidate;
	    if (schemaObj.schema.$async === true)
	      callValidate.$async = true;
	    return callValidate;
	  }
	  schemaObj.compiling = true;

	  var currentOpts;
	  if (schemaObj.meta) {
	    currentOpts = this._opts;
	    this._opts = this._metaOpts;
	  }

	  var v;
	  try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
	  catch(e) {
	    delete schemaObj.validate;
	    throw e;
	  }
	  finally {
	    schemaObj.compiling = false;
	    if (schemaObj.meta) this._opts = currentOpts;
	  }

	  schemaObj.validate = v;
	  schemaObj.refs = v.refs;
	  schemaObj.refVal = v.refVal;
	  schemaObj.root = v.root;
	  return v;


	  /* @this   {*} - custom context, see passContext option */
	  function callValidate() {
	    /* jshint validthis: true */
	    var _validate = schemaObj.validate;
	    var result = _validate.apply(this, arguments);
	    callValidate.errors = _validate.errors;
	    return result;
	  }
	}


	function chooseGetId(opts) {
	  switch (opts.schemaId) {
	    case 'auto': return _get$IdOrId;
	    case 'id': return _getId;
	    default: return _get$Id;
	  }
	}

	/* @this   Ajv */
	function _getId(schema) {
	  if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);
	  return schema.id;
	}

	/* @this   Ajv */
	function _get$Id(schema) {
	  if (schema.id) this.logger.warn('schema id ignored', schema.id);
	  return schema.$id;
	}


	function _get$IdOrId(schema) {
	  if (schema.$id && schema.id && schema.$id != schema.id)
	    throw new Error('schema $id is different from id');
	  return schema.$id || schema.id;
	}


	/**
	 * Convert array of error message objects to string
	 * @this   Ajv
	 * @param  {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
	 * @param  {Object} options optional options with properties `separator` and `dataVar`.
	 * @return {String} human readable string with all errors descriptions
	 */
	function errorsText(errors, options) {
	  errors = errors || this.errors;
	  if (!errors) return 'No errors';
	  options = options || {};
	  var separator = options.separator === undefined ? ', ' : options.separator;
	  var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;

	  var text = '';
	  for (var i=0; i<errors.length; i++) {
	    var e = errors[i];
	    if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
	  }
	  return text.slice(0, -separator.length);
	}


	/**
	 * Add custom format
	 * @this   Ajv
	 * @param {String} name format name
	 * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
	 * @return {Ajv} this for method chaining
	 */
	function addFormat(name, format) {
	  if (typeof format == 'string') format = new RegExp(format);
	  this._formats[name] = format;
	  return this;
	}


	function addDefaultMetaSchema(self) {
	  var $dataSchema;
	  if (self._opts.$data) {
	    $dataSchema = require$$12;
	    self.addMetaSchema($dataSchema, $dataSchema.$id, true);
	  }
	  if (self._opts.meta === false) return;
	  var metaSchema = require$$13;
	  if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
	  self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
	  self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
	}


	function addInitialSchemas(self) {
	  var optsSchemas = self._opts.schemas;
	  if (!optsSchemas) return;
	  if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
	  else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
	}


	function addInitialFormats(self) {
	  for (var name in self._opts.formats) {
	    var format = self._opts.formats[name];
	    self.addFormat(name, format);
	  }
	}


	function addInitialKeywords(self) {
	  for (var name in self._opts.keywords) {
	    var keyword = self._opts.keywords[name];
	    self.addKeyword(name, keyword);
	  }
	}


	function checkUnique(self, id) {
	  if (self._schemas[id] || self._refs[id])
	    throw new Error('schema with key or id "' + id + '" already exists');
	}


	function getMetaSchemaOptions(self) {
	  var metaOpts = util.copy(self._opts);
	  for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
	    delete metaOpts[META_IGNORE_OPTIONS[i]];
	  return metaOpts;
	}


	function setLogger(self) {
	  var logger = self._opts.logger;
	  if (logger === false) {
	    self.logger = {log: noop, warn: noop, error: noop};
	  } else {
	    if (logger === undefined) logger = console;
	    if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))
	      throw new Error('logger must implement log, warn and error methods');
	    self.logger = logger;
	  }
	}


	function noop() {}
	return ajv$1;
}

var builtin = {
	AggregateError: false,
	"Array": false,
	"ArrayBuffer": false,
	Atomics: false,
	BigInt: false,
	BigInt64Array: false,
	BigUint64Array: false,
	"Boolean": false,
	constructor: false,
	"DataView": false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	FinalizationRegistry: false,
	"Float32Array": false,
	"Float64Array": false,
	"Function": false,
	globalThis: false,
	hasOwnProperty: false,
	"Infinity": false,
	"Int16Array": false,
	"Int32Array": false,
	"Int8Array": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Map": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	"Promise": false,
	propertyIsEnumerable: false,
	"Proxy": false,
	"RangeError": false,
	"ReferenceError": false,
	"Reflect": false,
	"RegExp": false,
	"Set": false,
	SharedArrayBuffer: false,
	"String": false,
	"Symbol": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"Uint16Array": false,
	"Uint32Array": false,
	"Uint8Array": false,
	"Uint8ClampedArray": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false,
	"WeakMap": false,
	WeakRef: false,
	"WeakSet": false
};
var es5 = {
	"Array": false,
	"Boolean": false,
	constructor: false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	"Function": false,
	hasOwnProperty: false,
	"Infinity": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	propertyIsEnumerable: false,
	"RangeError": false,
	"ReferenceError": false,
	"RegExp": false,
	"String": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false
};
var es2015 = {
	"Array": false,
	"ArrayBuffer": false,
	"Boolean": false,
	constructor: false,
	"DataView": false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	"Float32Array": false,
	"Float64Array": false,
	"Function": false,
	hasOwnProperty: false,
	"Infinity": false,
	"Int16Array": false,
	"Int32Array": false,
	"Int8Array": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Map": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	"Promise": false,
	propertyIsEnumerable: false,
	"Proxy": false,
	"RangeError": false,
	"ReferenceError": false,
	"Reflect": false,
	"RegExp": false,
	"Set": false,
	"String": false,
	"Symbol": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"Uint16Array": false,
	"Uint32Array": false,
	"Uint8Array": false,
	"Uint8ClampedArray": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false,
	"WeakMap": false,
	"WeakSet": false
};
var es2017 = {
	"Array": false,
	"ArrayBuffer": false,
	Atomics: false,
	"Boolean": false,
	constructor: false,
	"DataView": false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	"Float32Array": false,
	"Float64Array": false,
	"Function": false,
	hasOwnProperty: false,
	"Infinity": false,
	"Int16Array": false,
	"Int32Array": false,
	"Int8Array": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Map": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	"Promise": false,
	propertyIsEnumerable: false,
	"Proxy": false,
	"RangeError": false,
	"ReferenceError": false,
	"Reflect": false,
	"RegExp": false,
	"Set": false,
	SharedArrayBuffer: false,
	"String": false,
	"Symbol": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"Uint16Array": false,
	"Uint32Array": false,
	"Uint8Array": false,
	"Uint8ClampedArray": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false,
	"WeakMap": false,
	"WeakSet": false
};
var es2020 = {
	"Array": false,
	"ArrayBuffer": false,
	Atomics: false,
	BigInt: false,
	BigInt64Array: false,
	BigUint64Array: false,
	"Boolean": false,
	constructor: false,
	"DataView": false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	"Float32Array": false,
	"Float64Array": false,
	"Function": false,
	globalThis: false,
	hasOwnProperty: false,
	"Infinity": false,
	"Int16Array": false,
	"Int32Array": false,
	"Int8Array": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Map": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	"Promise": false,
	propertyIsEnumerable: false,
	"Proxy": false,
	"RangeError": false,
	"ReferenceError": false,
	"Reflect": false,
	"RegExp": false,
	"Set": false,
	SharedArrayBuffer: false,
	"String": false,
	"Symbol": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"Uint16Array": false,
	"Uint32Array": false,
	"Uint8Array": false,
	"Uint8ClampedArray": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false,
	"WeakMap": false,
	"WeakSet": false
};
var es2021 = {
	AggregateError: false,
	"Array": false,
	"ArrayBuffer": false,
	Atomics: false,
	BigInt: false,
	BigInt64Array: false,
	BigUint64Array: false,
	"Boolean": false,
	constructor: false,
	"DataView": false,
	"Date": false,
	"decodeURI": false,
	"decodeURIComponent": false,
	"encodeURI": false,
	"encodeURIComponent": false,
	"Error": false,
	"escape": false,
	"eval": false,
	"EvalError": false,
	FinalizationRegistry: false,
	"Float32Array": false,
	"Float64Array": false,
	"Function": false,
	globalThis: false,
	hasOwnProperty: false,
	"Infinity": false,
	"Int16Array": false,
	"Int32Array": false,
	"Int8Array": false,
	"isFinite": false,
	"isNaN": false,
	isPrototypeOf: false,
	"JSON": false,
	"Map": false,
	"Math": false,
	"NaN": false,
	"Number": false,
	"Object": false,
	"parseFloat": false,
	"parseInt": false,
	"Promise": false,
	propertyIsEnumerable: false,
	"Proxy": false,
	"RangeError": false,
	"ReferenceError": false,
	"Reflect": false,
	"RegExp": false,
	"Set": false,
	SharedArrayBuffer: false,
	"String": false,
	"Symbol": false,
	"SyntaxError": false,
	toLocaleString: false,
	toString: false,
	"TypeError": false,
	"Uint16Array": false,
	"Uint32Array": false,
	"Uint8Array": false,
	"Uint8ClampedArray": false,
	"undefined": false,
	"unescape": false,
	"URIError": false,
	valueOf: false,
	"WeakMap": false,
	WeakRef: false,
	"WeakSet": false
};
var browser$1 = {
	AbortController: false,
	AbortSignal: false,
	addEventListener: false,
	alert: false,
	AnalyserNode: false,
	Animation: false,
	AnimationEffectReadOnly: false,
	AnimationEffectTiming: false,
	AnimationEffectTimingReadOnly: false,
	AnimationEvent: false,
	AnimationPlaybackEvent: false,
	AnimationTimeline: false,
	applicationCache: false,
	ApplicationCache: false,
	ApplicationCacheErrorEvent: false,
	atob: false,
	Attr: false,
	Audio: false,
	AudioBuffer: false,
	AudioBufferSourceNode: false,
	AudioContext: false,
	AudioDestinationNode: false,
	AudioListener: false,
	AudioNode: false,
	AudioParam: false,
	AudioProcessingEvent: false,
	AudioScheduledSourceNode: false,
	AudioWorkletGlobalScope: false,
	AudioWorkletNode: false,
	AudioWorkletProcessor: false,
	BarProp: false,
	BaseAudioContext: false,
	BatteryManager: false,
	BeforeUnloadEvent: false,
	BiquadFilterNode: false,
	Blob: false,
	BlobEvent: false,
	blur: false,
	BroadcastChannel: false,
	btoa: false,
	BudgetService: false,
	ByteLengthQueuingStrategy: false,
	Cache: false,
	caches: false,
	CacheStorage: false,
	cancelAnimationFrame: false,
	cancelIdleCallback: false,
	CanvasCaptureMediaStreamTrack: false,
	CanvasGradient: false,
	CanvasPattern: false,
	CanvasRenderingContext2D: false,
	ChannelMergerNode: false,
	ChannelSplitterNode: false,
	CharacterData: false,
	clearInterval: false,
	clearTimeout: false,
	clientInformation: false,
	ClipboardEvent: false,
	ClipboardItem: false,
	close: false,
	closed: false,
	CloseEvent: false,
	Comment: false,
	CompositionEvent: false,
	CompressionStream: false,
	confirm: false,
	console: false,
	ConstantSourceNode: false,
	ConvolverNode: false,
	CountQueuingStrategy: false,
	createImageBitmap: false,
	Credential: false,
	CredentialsContainer: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CSS: false,
	CSSConditionRule: false,
	CSSFontFaceRule: false,
	CSSGroupingRule: false,
	CSSImportRule: false,
	CSSKeyframeRule: false,
	CSSKeyframesRule: false,
	CSSMatrixComponent: false,
	CSSMediaRule: false,
	CSSNamespaceRule: false,
	CSSPageRule: false,
	CSSPerspective: false,
	CSSRotate: false,
	CSSRule: false,
	CSSRuleList: false,
	CSSScale: false,
	CSSSkew: false,
	CSSSkewX: false,
	CSSSkewY: false,
	CSSStyleDeclaration: false,
	CSSStyleRule: false,
	CSSStyleSheet: false,
	CSSSupportsRule: false,
	CSSTransformValue: false,
	CSSTranslate: false,
	CustomElementRegistry: false,
	customElements: false,
	CustomEvent: false,
	DataTransfer: false,
	DataTransferItem: false,
	DataTransferItemList: false,
	DecompressionStream: false,
	defaultstatus: false,
	defaultStatus: false,
	DelayNode: false,
	DeviceMotionEvent: false,
	DeviceOrientationEvent: false,
	devicePixelRatio: false,
	dispatchEvent: false,
	document: false,
	Document: false,
	DocumentFragment: false,
	DocumentType: false,
	DOMError: false,
	DOMException: false,
	DOMImplementation: false,
	DOMMatrix: false,
	DOMMatrixReadOnly: false,
	DOMParser: false,
	DOMPoint: false,
	DOMPointReadOnly: false,
	DOMQuad: false,
	DOMRect: false,
	DOMRectList: false,
	DOMRectReadOnly: false,
	DOMStringList: false,
	DOMStringMap: false,
	DOMTokenList: false,
	DragEvent: false,
	DynamicsCompressorNode: false,
	Element: false,
	ErrorEvent: false,
	event: false,
	Event: false,
	EventSource: false,
	EventTarget: false,
	external: false,
	fetch: false,
	File: false,
	FileList: false,
	FileReader: false,
	find: false,
	focus: false,
	FocusEvent: false,
	FontFace: false,
	FontFaceSetLoadEvent: false,
	FormData: false,
	FormDataEvent: false,
	frameElement: false,
	frames: false,
	GainNode: false,
	Gamepad: false,
	GamepadButton: false,
	GamepadEvent: false,
	getComputedStyle: false,
	getSelection: false,
	HashChangeEvent: false,
	Headers: false,
	history: false,
	History: false,
	HTMLAllCollection: false,
	HTMLAnchorElement: false,
	HTMLAreaElement: false,
	HTMLAudioElement: false,
	HTMLBaseElement: false,
	HTMLBodyElement: false,
	HTMLBRElement: false,
	HTMLButtonElement: false,
	HTMLCanvasElement: false,
	HTMLCollection: false,
	HTMLContentElement: false,
	HTMLDataElement: false,
	HTMLDataListElement: false,
	HTMLDetailsElement: false,
	HTMLDialogElement: false,
	HTMLDirectoryElement: false,
	HTMLDivElement: false,
	HTMLDListElement: false,
	HTMLDocument: false,
	HTMLElement: false,
	HTMLEmbedElement: false,
	HTMLFieldSetElement: false,
	HTMLFontElement: false,
	HTMLFormControlsCollection: false,
	HTMLFormElement: false,
	HTMLFrameElement: false,
	HTMLFrameSetElement: false,
	HTMLHeadElement: false,
	HTMLHeadingElement: false,
	HTMLHRElement: false,
	HTMLHtmlElement: false,
	HTMLIFrameElement: false,
	HTMLImageElement: false,
	HTMLInputElement: false,
	HTMLLabelElement: false,
	HTMLLegendElement: false,
	HTMLLIElement: false,
	HTMLLinkElement: false,
	HTMLMapElement: false,
	HTMLMarqueeElement: false,
	HTMLMediaElement: false,
	HTMLMenuElement: false,
	HTMLMetaElement: false,
	HTMLMeterElement: false,
	HTMLModElement: false,
	HTMLObjectElement: false,
	HTMLOListElement: false,
	HTMLOptGroupElement: false,
	HTMLOptionElement: false,
	HTMLOptionsCollection: false,
	HTMLOutputElement: false,
	HTMLParagraphElement: false,
	HTMLParamElement: false,
	HTMLPictureElement: false,
	HTMLPreElement: false,
	HTMLProgressElement: false,
	HTMLQuoteElement: false,
	HTMLScriptElement: false,
	HTMLSelectElement: false,
	HTMLShadowElement: false,
	HTMLSlotElement: false,
	HTMLSourceElement: false,
	HTMLSpanElement: false,
	HTMLStyleElement: false,
	HTMLTableCaptionElement: false,
	HTMLTableCellElement: false,
	HTMLTableColElement: false,
	HTMLTableElement: false,
	HTMLTableRowElement: false,
	HTMLTableSectionElement: false,
	HTMLTemplateElement: false,
	HTMLTextAreaElement: false,
	HTMLTimeElement: false,
	HTMLTitleElement: false,
	HTMLTrackElement: false,
	HTMLUListElement: false,
	HTMLUnknownElement: false,
	HTMLVideoElement: false,
	IDBCursor: false,
	IDBCursorWithValue: false,
	IDBDatabase: false,
	IDBFactory: false,
	IDBIndex: false,
	IDBKeyRange: false,
	IDBObjectStore: false,
	IDBOpenDBRequest: false,
	IDBRequest: false,
	IDBTransaction: false,
	IDBVersionChangeEvent: false,
	IdleDeadline: false,
	IIRFilterNode: false,
	Image: false,
	ImageBitmap: false,
	ImageBitmapRenderingContext: false,
	ImageCapture: false,
	ImageData: false,
	indexedDB: false,
	innerHeight: false,
	innerWidth: false,
	InputEvent: false,
	IntersectionObserver: false,
	IntersectionObserverEntry: false,
	"Intl": false,
	isSecureContext: false,
	KeyboardEvent: false,
	KeyframeEffect: false,
	KeyframeEffectReadOnly: false,
	length: false,
	localStorage: false,
	location: true,
	Location: false,
	locationbar: false,
	matchMedia: false,
	MediaDeviceInfo: false,
	MediaDevices: false,
	MediaElementAudioSourceNode: false,
	MediaEncryptedEvent: false,
	MediaError: false,
	MediaKeyMessageEvent: false,
	MediaKeySession: false,
	MediaKeyStatusMap: false,
	MediaKeySystemAccess: false,
	MediaList: false,
	MediaMetadata: false,
	MediaQueryList: false,
	MediaQueryListEvent: false,
	MediaRecorder: false,
	MediaSettingsRange: false,
	MediaSource: false,
	MediaStream: false,
	MediaStreamAudioDestinationNode: false,
	MediaStreamAudioSourceNode: false,
	MediaStreamConstraints: false,
	MediaStreamEvent: false,
	MediaStreamTrack: false,
	MediaStreamTrackEvent: false,
	menubar: false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	MIDIAccess: false,
	MIDIConnectionEvent: false,
	MIDIInput: false,
	MIDIInputMap: false,
	MIDIMessageEvent: false,
	MIDIOutput: false,
	MIDIOutputMap: false,
	MIDIPort: false,
	MimeType: false,
	MimeTypeArray: false,
	MouseEvent: false,
	moveBy: false,
	moveTo: false,
	MutationEvent: false,
	MutationObserver: false,
	MutationRecord: false,
	name: false,
	NamedNodeMap: false,
	NavigationPreloadManager: false,
	navigator: false,
	Navigator: false,
	NavigatorUAData: false,
	NetworkInformation: false,
	Node: false,
	NodeFilter: false,
	NodeIterator: false,
	NodeList: false,
	Notification: false,
	OfflineAudioCompletionEvent: false,
	OfflineAudioContext: false,
	offscreenBuffering: false,
	OffscreenCanvas: true,
	OffscreenCanvasRenderingContext2D: false,
	onabort: true,
	onafterprint: true,
	onanimationend: true,
	onanimationiteration: true,
	onanimationstart: true,
	onappinstalled: true,
	onauxclick: true,
	onbeforeinstallprompt: true,
	onbeforeprint: true,
	onbeforeunload: true,
	onblur: true,
	oncancel: true,
	oncanplay: true,
	oncanplaythrough: true,
	onchange: true,
	onclick: true,
	onclose: true,
	oncontextmenu: true,
	oncuechange: true,
	ondblclick: true,
	ondevicemotion: true,
	ondeviceorientation: true,
	ondeviceorientationabsolute: true,
	ondrag: true,
	ondragend: true,
	ondragenter: true,
	ondragleave: true,
	ondragover: true,
	ondragstart: true,
	ondrop: true,
	ondurationchange: true,
	onemptied: true,
	onended: true,
	onerror: true,
	onfocus: true,
	ongotpointercapture: true,
	onhashchange: true,
	oninput: true,
	oninvalid: true,
	onkeydown: true,
	onkeypress: true,
	onkeyup: true,
	onlanguagechange: true,
	onload: true,
	onloadeddata: true,
	onloadedmetadata: true,
	onloadstart: true,
	onlostpointercapture: true,
	onmessage: true,
	onmessageerror: true,
	onmousedown: true,
	onmouseenter: true,
	onmouseleave: true,
	onmousemove: true,
	onmouseout: true,
	onmouseover: true,
	onmouseup: true,
	onmousewheel: true,
	onoffline: true,
	ononline: true,
	onpagehide: true,
	onpageshow: true,
	onpause: true,
	onplay: true,
	onplaying: true,
	onpointercancel: true,
	onpointerdown: true,
	onpointerenter: true,
	onpointerleave: true,
	onpointermove: true,
	onpointerout: true,
	onpointerover: true,
	onpointerup: true,
	onpopstate: true,
	onprogress: true,
	onratechange: true,
	onrejectionhandled: true,
	onreset: true,
	onresize: true,
	onscroll: true,
	onsearch: true,
	onseeked: true,
	onseeking: true,
	onselect: true,
	onstalled: true,
	onstorage: true,
	onsubmit: true,
	onsuspend: true,
	ontimeupdate: true,
	ontoggle: true,
	ontransitionend: true,
	onunhandledrejection: true,
	onunload: true,
	onvolumechange: true,
	onwaiting: true,
	onwheel: true,
	open: false,
	openDatabase: false,
	opener: false,
	Option: false,
	origin: false,
	OscillatorNode: false,
	outerHeight: false,
	outerWidth: false,
	OverconstrainedError: false,
	PageTransitionEvent: false,
	pageXOffset: false,
	pageYOffset: false,
	PannerNode: false,
	parent: false,
	Path2D: false,
	PaymentAddress: false,
	PaymentRequest: false,
	PaymentRequestUpdateEvent: false,
	PaymentResponse: false,
	performance: false,
	Performance: false,
	PerformanceEntry: false,
	PerformanceLongTaskTiming: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceNavigation: false,
	PerformanceNavigationTiming: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformancePaintTiming: false,
	PerformanceResourceTiming: false,
	PerformanceTiming: false,
	PeriodicWave: false,
	Permissions: false,
	PermissionStatus: false,
	personalbar: false,
	PhotoCapabilities: false,
	Plugin: false,
	PluginArray: false,
	PointerEvent: false,
	PopStateEvent: false,
	postMessage: false,
	Presentation: false,
	PresentationAvailability: false,
	PresentationConnection: false,
	PresentationConnectionAvailableEvent: false,
	PresentationConnectionCloseEvent: false,
	PresentationConnectionList: false,
	PresentationReceiver: false,
	PresentationRequest: false,
	print: false,
	ProcessingInstruction: false,
	ProgressEvent: false,
	PromiseRejectionEvent: false,
	prompt: false,
	PushManager: false,
	PushSubscription: false,
	PushSubscriptionOptions: false,
	queueMicrotask: false,
	RadioNodeList: false,
	Range: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	registerProcessor: false,
	RemotePlayback: false,
	removeEventListener: false,
	reportError: false,
	Request: false,
	requestAnimationFrame: false,
	requestIdleCallback: false,
	resizeBy: false,
	ResizeObserver: false,
	ResizeObserverEntry: false,
	resizeTo: false,
	Response: false,
	RTCCertificate: false,
	RTCDataChannel: false,
	RTCDataChannelEvent: false,
	RTCDtlsTransport: false,
	RTCIceCandidate: false,
	RTCIceGatherer: false,
	RTCIceTransport: false,
	RTCPeerConnection: false,
	RTCPeerConnectionIceEvent: false,
	RTCRtpContributingSource: false,
	RTCRtpReceiver: false,
	RTCRtpSender: false,
	RTCSctpTransport: false,
	RTCSessionDescription: false,
	RTCStatsReport: false,
	RTCTrackEvent: false,
	screen: false,
	Screen: false,
	screenLeft: false,
	ScreenOrientation: false,
	screenTop: false,
	screenX: false,
	screenY: false,
	ScriptProcessorNode: false,
	scroll: false,
	scrollbars: false,
	scrollBy: false,
	scrollTo: false,
	scrollX: false,
	scrollY: false,
	SecurityPolicyViolationEvent: false,
	Selection: false,
	self: false,
	ServiceWorker: false,
	ServiceWorkerContainer: false,
	ServiceWorkerRegistration: false,
	sessionStorage: false,
	setInterval: false,
	setTimeout: false,
	ShadowRoot: false,
	SharedWorker: false,
	SourceBuffer: false,
	SourceBufferList: false,
	speechSynthesis: false,
	SpeechSynthesisEvent: false,
	SpeechSynthesisUtterance: false,
	StaticRange: false,
	status: false,
	statusbar: false,
	StereoPannerNode: false,
	stop: false,
	Storage: false,
	StorageEvent: false,
	StorageManager: false,
	structuredClone: false,
	styleMedia: false,
	StyleSheet: false,
	StyleSheetList: false,
	SubmitEvent: false,
	SubtleCrypto: false,
	SVGAElement: false,
	SVGAngle: false,
	SVGAnimatedAngle: false,
	SVGAnimatedBoolean: false,
	SVGAnimatedEnumeration: false,
	SVGAnimatedInteger: false,
	SVGAnimatedLength: false,
	SVGAnimatedLengthList: false,
	SVGAnimatedNumber: false,
	SVGAnimatedNumberList: false,
	SVGAnimatedPreserveAspectRatio: false,
	SVGAnimatedRect: false,
	SVGAnimatedString: false,
	SVGAnimatedTransformList: false,
	SVGAnimateElement: false,
	SVGAnimateMotionElement: false,
	SVGAnimateTransformElement: false,
	SVGAnimationElement: false,
	SVGCircleElement: false,
	SVGClipPathElement: false,
	SVGComponentTransferFunctionElement: false,
	SVGDefsElement: false,
	SVGDescElement: false,
	SVGDiscardElement: false,
	SVGElement: false,
	SVGEllipseElement: false,
	SVGFEBlendElement: false,
	SVGFEColorMatrixElement: false,
	SVGFEComponentTransferElement: false,
	SVGFECompositeElement: false,
	SVGFEConvolveMatrixElement: false,
	SVGFEDiffuseLightingElement: false,
	SVGFEDisplacementMapElement: false,
	SVGFEDistantLightElement: false,
	SVGFEDropShadowElement: false,
	SVGFEFloodElement: false,
	SVGFEFuncAElement: false,
	SVGFEFuncBElement: false,
	SVGFEFuncGElement: false,
	SVGFEFuncRElement: false,
	SVGFEGaussianBlurElement: false,
	SVGFEImageElement: false,
	SVGFEMergeElement: false,
	SVGFEMergeNodeElement: false,
	SVGFEMorphologyElement: false,
	SVGFEOffsetElement: false,
	SVGFEPointLightElement: false,
	SVGFESpecularLightingElement: false,
	SVGFESpotLightElement: false,
	SVGFETileElement: false,
	SVGFETurbulenceElement: false,
	SVGFilterElement: false,
	SVGForeignObjectElement: false,
	SVGGElement: false,
	SVGGeometryElement: false,
	SVGGradientElement: false,
	SVGGraphicsElement: false,
	SVGImageElement: false,
	SVGLength: false,
	SVGLengthList: false,
	SVGLinearGradientElement: false,
	SVGLineElement: false,
	SVGMarkerElement: false,
	SVGMaskElement: false,
	SVGMatrix: false,
	SVGMetadataElement: false,
	SVGMPathElement: false,
	SVGNumber: false,
	SVGNumberList: false,
	SVGPathElement: false,
	SVGPatternElement: false,
	SVGPoint: false,
	SVGPointList: false,
	SVGPolygonElement: false,
	SVGPolylineElement: false,
	SVGPreserveAspectRatio: false,
	SVGRadialGradientElement: false,
	SVGRect: false,
	SVGRectElement: false,
	SVGScriptElement: false,
	SVGSetElement: false,
	SVGStopElement: false,
	SVGStringList: false,
	SVGStyleElement: false,
	SVGSVGElement: false,
	SVGSwitchElement: false,
	SVGSymbolElement: false,
	SVGTextContentElement: false,
	SVGTextElement: false,
	SVGTextPathElement: false,
	SVGTextPositioningElement: false,
	SVGTitleElement: false,
	SVGTransform: false,
	SVGTransformList: false,
	SVGTSpanElement: false,
	SVGUnitTypes: false,
	SVGUseElement: false,
	SVGViewElement: false,
	TaskAttributionTiming: false,
	Text: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TextEvent: false,
	TextMetrics: false,
	TextTrack: false,
	TextTrackCue: false,
	TextTrackCueList: false,
	TextTrackList: false,
	TimeRanges: false,
	ToggleEvent: false,
	toolbar: false,
	top: false,
	Touch: false,
	TouchEvent: false,
	TouchList: false,
	TrackEvent: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	TransitionEvent: false,
	TreeWalker: false,
	UIEvent: false,
	URL: false,
	URLSearchParams: false,
	ValidityState: false,
	visualViewport: false,
	VisualViewport: false,
	VTTCue: false,
	WaveShaperNode: false,
	WebAssembly: false,
	WebGL2RenderingContext: false,
	WebGLActiveInfo: false,
	WebGLBuffer: false,
	WebGLContextEvent: false,
	WebGLFramebuffer: false,
	WebGLProgram: false,
	WebGLQuery: false,
	WebGLRenderbuffer: false,
	WebGLRenderingContext: false,
	WebGLSampler: false,
	WebGLShader: false,
	WebGLShaderPrecisionFormat: false,
	WebGLSync: false,
	WebGLTexture: false,
	WebGLTransformFeedback: false,
	WebGLUniformLocation: false,
	WebGLVertexArrayObject: false,
	WebSocket: false,
	WheelEvent: false,
	window: false,
	Window: false,
	Worker: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false,
	XMLDocument: false,
	XMLHttpRequest: false,
	XMLHttpRequestEventTarget: false,
	XMLHttpRequestUpload: false,
	XMLSerializer: false,
	XPathEvaluator: false,
	XPathExpression: false,
	XPathResult: false,
	XRAnchor: false,
	XRBoundedReferenceSpace: false,
	XRCPUDepthInformation: false,
	XRDepthInformation: false,
	XRFrame: false,
	XRInputSource: false,
	XRInputSourceArray: false,
	XRInputSourceEvent: false,
	XRInputSourcesChangeEvent: false,
	XRPose: false,
	XRReferenceSpace: false,
	XRReferenceSpaceEvent: false,
	XRRenderState: false,
	XRRigidTransform: false,
	XRSession: false,
	XRSessionEvent: false,
	XRSpace: false,
	XRSystem: false,
	XRView: false,
	XRViewerPose: false,
	XRViewport: false,
	XRWebGLBinding: false,
	XRWebGLDepthInformation: false,
	XRWebGLLayer: false,
	XSLTProcessor: false
};
var worker = {
	addEventListener: false,
	applicationCache: false,
	atob: false,
	Blob: false,
	BroadcastChannel: false,
	btoa: false,
	ByteLengthQueuingStrategy: false,
	Cache: false,
	caches: false,
	clearInterval: false,
	clearTimeout: false,
	close: true,
	CompressionStream: false,
	console: false,
	CountQueuingStrategy: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CustomEvent: false,
	DecompressionStream: false,
	ErrorEvent: false,
	Event: false,
	fetch: false,
	File: false,
	FileReaderSync: false,
	FormData: false,
	Headers: false,
	IDBCursor: false,
	IDBCursorWithValue: false,
	IDBDatabase: false,
	IDBFactory: false,
	IDBIndex: false,
	IDBKeyRange: false,
	IDBObjectStore: false,
	IDBOpenDBRequest: false,
	IDBRequest: false,
	IDBTransaction: false,
	IDBVersionChangeEvent: false,
	ImageData: false,
	importScripts: true,
	indexedDB: false,
	location: false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	name: false,
	navigator: false,
	Notification: false,
	onclose: true,
	onconnect: true,
	onerror: true,
	onlanguagechange: true,
	onmessage: true,
	onoffline: true,
	ononline: true,
	onrejectionhandled: true,
	onunhandledrejection: true,
	performance: false,
	Performance: false,
	PerformanceEntry: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceNavigation: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformanceResourceTiming: false,
	PerformanceTiming: false,
	postMessage: true,
	"Promise": false,
	queueMicrotask: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	removeEventListener: false,
	reportError: false,
	Request: false,
	Response: false,
	self: true,
	ServiceWorkerRegistration: false,
	setInterval: false,
	setTimeout: false,
	SubtleCrypto: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	URL: false,
	URLSearchParams: false,
	WebAssembly: false,
	WebSocket: false,
	Worker: false,
	WorkerGlobalScope: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false,
	XMLHttpRequest: false
};
var node = {
	__dirname: false,
	__filename: false,
	AbortController: false,
	AbortSignal: false,
	atob: false,
	Blob: false,
	BroadcastChannel: false,
	btoa: false,
	Buffer: false,
	ByteLengthQueuingStrategy: false,
	clearImmediate: false,
	clearInterval: false,
	clearTimeout: false,
	CompressionStream: false,
	console: false,
	CountQueuingStrategy: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CustomEvent: false,
	DecompressionStream: false,
	DOMException: false,
	Event: false,
	EventTarget: false,
	exports: true,
	fetch: false,
	File: false,
	FormData: false,
	global: false,
	Headers: false,
	"Intl": false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	module: false,
	performance: false,
	PerformanceEntry: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformanceResourceTiming: false,
	process: false,
	queueMicrotask: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	Request: false,
	require: false,
	Response: false,
	setImmediate: false,
	setInterval: false,
	setTimeout: false,
	structuredClone: false,
	SubtleCrypto: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	URL: false,
	URLSearchParams: false,
	WebAssembly: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false
};
var nodeBuiltin = {
	AbortController: false,
	AbortSignal: false,
	atob: false,
	Blob: false,
	BroadcastChannel: false,
	btoa: false,
	Buffer: false,
	ByteLengthQueuingStrategy: false,
	clearImmediate: false,
	clearInterval: false,
	clearTimeout: false,
	CompressionStream: false,
	console: false,
	CountQueuingStrategy: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CustomEvent: false,
	DecompressionStream: false,
	DOMException: false,
	Event: false,
	EventTarget: false,
	fetch: false,
	File: false,
	FormData: false,
	global: false,
	Headers: false,
	"Intl": false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	performance: false,
	PerformanceEntry: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformanceResourceTiming: false,
	process: false,
	queueMicrotask: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	Request: false,
	Response: false,
	setImmediate: false,
	setInterval: false,
	setTimeout: false,
	structuredClone: false,
	SubtleCrypto: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	URL: false,
	URLSearchParams: false,
	WebAssembly: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false
};
var commonjs = {
	exports: true,
	global: false,
	module: false,
	require: false
};
var amd = {
	define: false,
	require: false
};
var mocha = {
	after: false,
	afterEach: false,
	before: false,
	beforeEach: false,
	context: false,
	describe: false,
	it: false,
	mocha: false,
	run: false,
	setup: false,
	specify: false,
	suite: false,
	suiteSetup: false,
	suiteTeardown: false,
	teardown: false,
	test: false,
	xcontext: false,
	xdescribe: false,
	xit: false,
	xspecify: false
};
var jasmine = {
	afterAll: false,
	afterEach: false,
	beforeAll: false,
	beforeEach: false,
	describe: false,
	expect: false,
	expectAsync: false,
	fail: false,
	fdescribe: false,
	fit: false,
	it: false,
	jasmine: false,
	pending: false,
	runs: false,
	spyOn: false,
	spyOnAllFunctions: false,
	spyOnProperty: false,
	waits: false,
	waitsFor: false,
	xdescribe: false,
	xit: false
};
var jest = {
	afterAll: false,
	afterEach: false,
	beforeAll: false,
	beforeEach: false,
	describe: false,
	expect: false,
	fdescribe: false,
	fit: false,
	it: false,
	jest: false,
	pit: false,
	require: false,
	test: false,
	xdescribe: false,
	xit: false,
	xtest: false
};
var qunit = {
	asyncTest: false,
	deepEqual: false,
	equal: false,
	expect: false,
	module: false,
	notDeepEqual: false,
	notEqual: false,
	notOk: false,
	notPropEqual: false,
	notStrictEqual: false,
	ok: false,
	propEqual: false,
	QUnit: false,
	raises: false,
	start: false,
	stop: false,
	strictEqual: false,
	test: false,
	throws: false
};
var phantomjs = {
	console: true,
	exports: true,
	phantom: true,
	require: true,
	WebPage: true
};
var couch = {
	emit: false,
	exports: false,
	getRow: false,
	log: false,
	module: false,
	provides: false,
	require: false,
	respond: false,
	send: false,
	start: false,
	sum: false
};
var rhino = {
	defineClass: false,
	deserialize: false,
	gc: false,
	help: false,
	importClass: false,
	importPackage: false,
	java: false,
	load: false,
	loadClass: false,
	Packages: false,
	print: false,
	quit: false,
	readFile: false,
	readUrl: false,
	runCommand: false,
	seal: false,
	serialize: false,
	spawn: false,
	sync: false,
	toint32: false,
	version: false
};
var nashorn = {
	__DIR__: false,
	__FILE__: false,
	__LINE__: false,
	com: false,
	edu: false,
	exit: false,
	java: false,
	Java: false,
	javafx: false,
	JavaImporter: false,
	javax: false,
	JSAdapter: false,
	load: false,
	loadWithNewGlobal: false,
	org: false,
	Packages: false,
	print: false,
	quit: false
};
var wsh = {
	ActiveXObject: false,
	CollectGarbage: false,
	Debug: false,
	Enumerator: false,
	GetObject: false,
	RuntimeObject: false,
	ScriptEngine: false,
	ScriptEngineBuildVersion: false,
	ScriptEngineMajorVersion: false,
	ScriptEngineMinorVersion: false,
	VBArray: false,
	WScript: false,
	WSH: false
};
var jquery = {
	$: false,
	jQuery: false
};
var yui = {
	YAHOO: false,
	YAHOO_config: false,
	YUI: false,
	YUI_config: false
};
var shelljs = {
	cat: false,
	cd: false,
	chmod: false,
	config: false,
	cp: false,
	dirs: false,
	echo: false,
	env: false,
	error: false,
	exec: false,
	exit: false,
	find: false,
	grep: false,
	ln: false,
	ls: false,
	mkdir: false,
	mv: false,
	popd: false,
	pushd: false,
	pwd: false,
	rm: false,
	sed: false,
	set: false,
	target: false,
	tempdir: false,
	test: false,
	touch: false,
	which: false
};
var prototypejs = {
	$: false,
	$$: false,
	$A: false,
	$break: false,
	$continue: false,
	$F: false,
	$H: false,
	$R: false,
	$w: false,
	Abstract: false,
	Ajax: false,
	Autocompleter: false,
	Builder: false,
	Class: false,
	Control: false,
	Draggable: false,
	Draggables: false,
	Droppables: false,
	Effect: false,
	Element: false,
	Enumerable: false,
	Event: false,
	Field: false,
	Form: false,
	Hash: false,
	Insertion: false,
	ObjectRange: false,
	PeriodicalExecuter: false,
	Position: false,
	Prototype: false,
	Scriptaculous: false,
	Selector: false,
	Sortable: false,
	SortableObserver: false,
	Sound: false,
	Template: false,
	Toggle: false,
	Try: false
};
var meteor = {
	$: false,
	Accounts: false,
	AccountsClient: false,
	AccountsCommon: false,
	AccountsServer: false,
	App: false,
	Assets: false,
	Blaze: false,
	check: false,
	Cordova: false,
	DDP: false,
	DDPRateLimiter: false,
	DDPServer: false,
	Deps: false,
	EJSON: false,
	Email: false,
	HTTP: false,
	Log: false,
	Match: false,
	Meteor: false,
	Mongo: false,
	MongoInternals: false,
	Npm: false,
	Package: false,
	Plugin: false,
	process: false,
	Random: false,
	ReactiveDict: false,
	ReactiveVar: false,
	Router: false,
	ServiceConfiguration: false,
	Session: false,
	share: false,
	Spacebars: false,
	Template: false,
	Tinytest: false,
	Tracker: false,
	UI: false,
	Utils: false,
	WebApp: false,
	WebAppInternals: false
};
var mongo = {
	_isWindows: false,
	_rand: false,
	BulkWriteResult: false,
	cat: false,
	cd: false,
	connect: false,
	db: false,
	getHostName: false,
	getMemInfo: false,
	hostname: false,
	ISODate: false,
	listFiles: false,
	load: false,
	ls: false,
	md5sumFile: false,
	mkdir: false,
	Mongo: false,
	NumberInt: false,
	NumberLong: false,
	ObjectId: false,
	PlanCache: false,
	print: false,
	printjson: false,
	pwd: false,
	quit: false,
	removeFile: false,
	rs: false,
	sh: false,
	UUID: false,
	version: false,
	WriteResult: false
};
var applescript = {
	$: false,
	Application: false,
	Automation: false,
	console: false,
	delay: false,
	Library: false,
	ObjC: false,
	ObjectSpecifier: false,
	Path: false,
	Progress: false,
	Ref: false
};
var serviceworker = {
	addEventListener: false,
	applicationCache: false,
	atob: false,
	Blob: false,
	BroadcastChannel: false,
	btoa: false,
	ByteLengthQueuingStrategy: false,
	Cache: false,
	caches: false,
	CacheStorage: false,
	clearInterval: false,
	clearTimeout: false,
	Client: false,
	clients: false,
	Clients: false,
	close: true,
	CompressionStream: false,
	console: false,
	CountQueuingStrategy: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CustomEvent: false,
	DecompressionStream: false,
	ErrorEvent: false,
	Event: false,
	ExtendableEvent: false,
	ExtendableMessageEvent: false,
	fetch: false,
	FetchEvent: false,
	File: false,
	FileReaderSync: false,
	FormData: false,
	Headers: false,
	IDBCursor: false,
	IDBCursorWithValue: false,
	IDBDatabase: false,
	IDBFactory: false,
	IDBIndex: false,
	IDBKeyRange: false,
	IDBObjectStore: false,
	IDBOpenDBRequest: false,
	IDBRequest: false,
	IDBTransaction: false,
	IDBVersionChangeEvent: false,
	ImageData: false,
	importScripts: false,
	indexedDB: false,
	location: false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	name: false,
	navigator: false,
	Notification: false,
	onclose: true,
	onconnect: true,
	onerror: true,
	onfetch: true,
	oninstall: true,
	onlanguagechange: true,
	onmessage: true,
	onmessageerror: true,
	onnotificationclick: true,
	onnotificationclose: true,
	onoffline: true,
	ononline: true,
	onpush: true,
	onpushsubscriptionchange: true,
	onrejectionhandled: true,
	onsync: true,
	onunhandledrejection: true,
	performance: false,
	Performance: false,
	PerformanceEntry: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceNavigation: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformanceResourceTiming: false,
	PerformanceTiming: false,
	postMessage: true,
	"Promise": false,
	queueMicrotask: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	registration: false,
	removeEventListener: false,
	Request: false,
	Response: false,
	self: false,
	ServiceWorker: false,
	ServiceWorkerContainer: false,
	ServiceWorkerGlobalScope: false,
	ServiceWorkerMessageEvent: false,
	ServiceWorkerRegistration: false,
	setInterval: false,
	setTimeout: false,
	skipWaiting: false,
	SubtleCrypto: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	URL: false,
	URLSearchParams: false,
	WebAssembly: false,
	WebSocket: false,
	WindowClient: false,
	Worker: false,
	WorkerGlobalScope: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false,
	XMLHttpRequest: false
};
var atomtest = {
	advanceClock: false,
	atom: false,
	fakeClearInterval: false,
	fakeClearTimeout: false,
	fakeSetInterval: false,
	fakeSetTimeout: false,
	resetTimeouts: false,
	waitsForPromise: false
};
var embertest = {
	andThen: false,
	click: false,
	currentPath: false,
	currentRouteName: false,
	currentURL: false,
	fillIn: false,
	find: false,
	findAll: false,
	findWithAssert: false,
	keyEvent: false,
	pauseTest: false,
	resumeTest: false,
	triggerEvent: false,
	visit: false,
	wait: false
};
var protractor = {
	$: false,
	$$: false,
	browser: false,
	by: false,
	By: false,
	DartObject: false,
	element: false,
	protractor: false
};
var webextensions = {
	browser: false,
	chrome: false,
	opr: false
};
var greasemonkey = {
	cloneInto: false,
	createObjectIn: false,
	exportFunction: false,
	GM: false,
	GM_addElement: false,
	GM_addStyle: false,
	GM_addValueChangeListener: false,
	GM_deleteValue: false,
	GM_download: false,
	GM_getResourceText: false,
	GM_getResourceURL: false,
	GM_getTab: false,
	GM_getTabs: false,
	GM_getValue: false,
	GM_info: false,
	GM_listValues: false,
	GM_log: false,
	GM_notification: false,
	GM_openInTab: false,
	GM_registerMenuCommand: false,
	GM_removeValueChangeListener: false,
	GM_saveTab: false,
	GM_setClipboard: false,
	GM_setValue: false,
	GM_unregisterMenuCommand: false,
	GM_xmlhttpRequest: false,
	unsafeWindow: false
};
var devtools = {
	$: false,
	$_: false,
	$$: false,
	$0: false,
	$1: false,
	$2: false,
	$3: false,
	$4: false,
	$x: false,
	chrome: false,
	clear: false,
	copy: false,
	debug: false,
	dir: false,
	dirxml: false,
	getEventListeners: false,
	inspect: false,
	keys: false,
	monitor: false,
	monitorEvents: false,
	profile: false,
	profileEnd: false,
	queryObjects: false,
	table: false,
	undebug: false,
	unmonitor: false,
	unmonitorEvents: false,
	values: false
};
var require$$0 = {
	builtin: builtin,
	es5: es5,
	es2015: es2015,
	es2017: es2017,
	es2020: es2020,
	es2021: es2021,
	browser: browser$1,
	worker: worker,
	node: node,
	nodeBuiltin: nodeBuiltin,
	commonjs: commonjs,
	amd: amd,
	mocha: mocha,
	jasmine: jasmine,
	jest: jest,
	qunit: qunit,
	phantomjs: phantomjs,
	couch: couch,
	rhino: rhino,
	nashorn: nashorn,
	wsh: wsh,
	jquery: jquery,
	yui: yui,
	shelljs: shelljs,
	prototypejs: prototypejs,
	meteor: meteor,
	mongo: mongo,
	applescript: applescript,
	serviceworker: serviceworker,
	atomtest: atomtest,
	embertest: embertest,
	protractor: protractor,
	"shared-node-browser": {
	AbortController: false,
	AbortSignal: false,
	atob: false,
	Blob: false,
	BroadcastChannel: false,
	btoa: false,
	ByteLengthQueuingStrategy: false,
	clearInterval: false,
	clearTimeout: false,
	CompressionStream: false,
	console: false,
	CountQueuingStrategy: false,
	crypto: false,
	Crypto: false,
	CryptoKey: false,
	CustomEvent: false,
	DecompressionStream: false,
	DOMException: false,
	Event: false,
	EventTarget: false,
	fetch: false,
	File: false,
	FormData: false,
	Headers: false,
	"Intl": false,
	MessageChannel: false,
	MessageEvent: false,
	MessagePort: false,
	performance: false,
	PerformanceEntry: false,
	PerformanceMark: false,
	PerformanceMeasure: false,
	PerformanceObserver: false,
	PerformanceObserverEntryList: false,
	PerformanceResourceTiming: false,
	queueMicrotask: false,
	ReadableByteStreamController: false,
	ReadableStream: false,
	ReadableStreamBYOBReader: false,
	ReadableStreamBYOBRequest: false,
	ReadableStreamDefaultController: false,
	ReadableStreamDefaultReader: false,
	Request: false,
	Response: false,
	setInterval: false,
	setTimeout: false,
	structuredClone: false,
	SubtleCrypto: false,
	TextDecoder: false,
	TextDecoderStream: false,
	TextEncoder: false,
	TextEncoderStream: false,
	TransformStream: false,
	TransformStreamDefaultController: false,
	URL: false,
	URLSearchParams: false,
	WebAssembly: false,
	WritableStream: false,
	WritableStreamDefaultController: false,
	WritableStreamDefaultWriter: false
},
	webextensions: webextensions,
	greasemonkey: greasemonkey,
	devtools: devtools
};

var globals$1;
var hasRequiredGlobals$1;

function requireGlobals$1 () {
	if (hasRequiredGlobals$1) return globals$1;
	hasRequiredGlobals$1 = 1;
	globals$1 = require$$0;
	return globals$1;
}

var hasRequiredEslintrcUniversal;

function requireEslintrcUniversal () {
	if (hasRequiredEslintrcUniversal) return eslintrcUniversal;
	hasRequiredEslintrcUniversal = 1;

	Object.defineProperty(eslintrcUniversal, '__esModule', { value: true });

	var util = require$$1$1;
	var path = require$$0$1;
	var Ajv = requireAjv$1();
	var globals = /*@__PURE__*/ requireGlobals$1();

	function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

	var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
	var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
	var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);
	var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);

	/**
	 * @fileoverview Config file operations. This file must be usable in the browser,
	 * so no Node-specific code can be here.
	 * @author Nicholas C. Zakas
	 */

	//------------------------------------------------------------------------------
	// Private
	//------------------------------------------------------------------------------

	const RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
	    RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {
	        map[value] = index;
	        return map;
	    }, {}),
	    VALID_SEVERITIES = new Set([0, 1, 2, "off", "warn", "error"]);

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Normalizes the severity value of a rule's configuration to a number
	 * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
	 * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
	 * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
	 * whose first element is one of the above values. Strings are matched case-insensitively.
	 * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
	 */
	function getRuleSeverity(ruleConfig) {
	    const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;

	    if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
	        return severityValue;
	    }

	    if (typeof severityValue === "string") {
	        return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
	    }

	    return 0;
	}

	/**
	 * Converts old-style severity settings (0, 1, 2) into new-style
	 * severity settings (off, warn, error) for all rules. Assumption is that severity
	 * values have already been validated as correct.
	 * @param {Object} config The config object to normalize.
	 * @returns {void}
	 */
	function normalizeToStrings(config) {

	    if (config.rules) {
	        Object.keys(config.rules).forEach(ruleId => {
	            const ruleConfig = config.rules[ruleId];

	            if (typeof ruleConfig === "number") {
	                config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
	            } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
	                ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
	            }
	        });
	    }
	}

	/**
	 * Determines if the severity for the given rule configuration represents an error.
	 * @param {int|string|Array} ruleConfig The configuration for an individual rule.
	 * @returns {boolean} True if the rule represents an error, false if not.
	 */
	function isErrorSeverity(ruleConfig) {
	    return getRuleSeverity(ruleConfig) === 2;
	}

	/**
	 * Checks whether a given config has valid severity or not.
	 * @param {number|string|Array} ruleConfig The configuration for an individual rule.
	 * @returns {boolean} `true` if the configuration has valid severity.
	 */
	function isValidSeverity(ruleConfig) {
	    let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;

	    if (typeof severity === "string") {
	        severity = severity.toLowerCase();
	    }
	    return VALID_SEVERITIES.has(severity);
	}

	/**
	 * Checks whether every rule of a given config has valid severity or not.
	 * @param {Object} config The configuration for rules.
	 * @returns {boolean} `true` if the configuration has valid severity.
	 */
	function isEverySeverityValid(config) {
	    return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));
	}

	/**
	 * Normalizes a value for a global in a config
	 * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
	 * a global directive comment
	 * @returns {("readable"|"writeable"|"off")} The value normalized as a string
	 * @throws Error if global value is invalid
	 */
	function normalizeConfigGlobal(configuredValue) {
	    switch (configuredValue) {
	        case "off":
	            return "off";

	        case true:
	        case "true":
	        case "writeable":
	        case "writable":
	            return "writable";

	        case null:
	        case false:
	        case "false":
	        case "readable":
	        case "readonly":
	            return "readonly";

	        default:
	            throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
	    }
	}

	var ConfigOps = {
	    __proto__: null,
	    getRuleSeverity: getRuleSeverity,
	    normalizeToStrings: normalizeToStrings,
	    isErrorSeverity: isErrorSeverity,
	    isValidSeverity: isValidSeverity,
	    isEverySeverityValid: isEverySeverityValid,
	    normalizeConfigGlobal: normalizeConfigGlobal
	};

	/**
	 * @fileoverview Provide the function that emits deprecation warnings.
	 * @author Toru Nagashima <http://github.com/mysticatea>
	 */

	//------------------------------------------------------------------------------
	// Private
	//------------------------------------------------------------------------------

	// Defitions for deprecation warnings.
	const deprecationWarningMessages = {
	    ESLINT_LEGACY_ECMAFEATURES:
	        "The 'ecmaFeatures' config file property is deprecated and has no effect.",
	    ESLINT_PERSONAL_CONFIG_LOAD:
	        "'~/.eslintrc.*' config files have been deprecated. " +
	        "Please use a config file per project or the '--config' option.",
	    ESLINT_PERSONAL_CONFIG_SUPPRESS:
	        "'~/.eslintrc.*' config files have been deprecated. " +
	        "Please remove it or add 'root:true' to the config files in your " +
	        "projects in order to avoid loading '~/.eslintrc.*' accidentally."
	};

	const sourceFileErrorCache = new Set();

	/**
	 * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
	 * for each unique file path, but repeated invocations with the same file path have no effect.
	 * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.
	 * @param {string} source The name of the configuration source to report the warning for.
	 * @param {string} errorCode The warning message to show.
	 * @returns {void}
	 */
	function emitDeprecationWarning(source, errorCode) {
	    const cacheKey = JSON.stringify({ source, errorCode });

	    if (sourceFileErrorCache.has(cacheKey)) {
	        return;
	    }
	    sourceFileErrorCache.add(cacheKey);

	    const rel = path__default["default"].relative(process.cwd(), source);
	    const message = deprecationWarningMessages[errorCode];

	    process.emitWarning(
	        `${message} (found in "${rel}")`,
	        "DeprecationWarning",
	        errorCode
	    );
	}

	/**
	 * @fileoverview The instance of Ajv validator.
	 * @author Evgeny Poberezkin
	 */

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	/*
	 * Copied from ajv/lib/refs/json-schema-draft-04.json
	 * The MIT License (MIT)
	 * Copyright (c) 2015-2017 Evgeny Poberezkin
	 */
	const metaSchema = {
	    id: "http://json-schema.org/draft-04/schema#",
	    $schema: "http://json-schema.org/draft-04/schema#",
	    description: "Core schema meta-schema",
	    definitions: {
	        schemaArray: {
	            type: "array",
	            minItems: 1,
	            items: { $ref: "#" }
	        },
	        positiveInteger: {
	            type: "integer",
	            minimum: 0
	        },
	        positiveIntegerDefault0: {
	            allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
	        },
	        simpleTypes: {
	            enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
	        },
	        stringArray: {
	            type: "array",
	            items: { type: "string" },
	            minItems: 1,
	            uniqueItems: true
	        }
	    },
	    type: "object",
	    properties: {
	        id: {
	            type: "string"
	        },
	        $schema: {
	            type: "string"
	        },
	        title: {
	            type: "string"
	        },
	        description: {
	            type: "string"
	        },
	        default: { },
	        multipleOf: {
	            type: "number",
	            minimum: 0,
	            exclusiveMinimum: true
	        },
	        maximum: {
	            type: "number"
	        },
	        exclusiveMaximum: {
	            type: "boolean",
	            default: false
	        },
	        minimum: {
	            type: "number"
	        },
	        exclusiveMinimum: {
	            type: "boolean",
	            default: false
	        },
	        maxLength: { $ref: "#/definitions/positiveInteger" },
	        minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
	        pattern: {
	            type: "string",
	            format: "regex"
	        },
	        additionalItems: {
	            anyOf: [
	                { type: "boolean" },
	                { $ref: "#" }
	            ],
	            default: { }
	        },
	        items: {
	            anyOf: [
	                { $ref: "#" },
	                { $ref: "#/definitions/schemaArray" }
	            ],
	            default: { }
	        },
	        maxItems: { $ref: "#/definitions/positiveInteger" },
	        minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
	        uniqueItems: {
	            type: "boolean",
	            default: false
	        },
	        maxProperties: { $ref: "#/definitions/positiveInteger" },
	        minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
	        required: { $ref: "#/definitions/stringArray" },
	        additionalProperties: {
	            anyOf: [
	                { type: "boolean" },
	                { $ref: "#" }
	            ],
	            default: { }
	        },
	        definitions: {
	            type: "object",
	            additionalProperties: { $ref: "#" },
	            default: { }
	        },
	        properties: {
	            type: "object",
	            additionalProperties: { $ref: "#" },
	            default: { }
	        },
	        patternProperties: {
	            type: "object",
	            additionalProperties: { $ref: "#" },
	            default: { }
	        },
	        dependencies: {
	            type: "object",
	            additionalProperties: {
	                anyOf: [
	                    { $ref: "#" },
	                    { $ref: "#/definitions/stringArray" }
	                ]
	            }
	        },
	        enum: {
	            type: "array",
	            minItems: 1,
	            uniqueItems: true
	        },
	        type: {
	            anyOf: [
	                { $ref: "#/definitions/simpleTypes" },
	                {
	                    type: "array",
	                    items: { $ref: "#/definitions/simpleTypes" },
	                    minItems: 1,
	                    uniqueItems: true
	                }
	            ]
	        },
	        format: { type: "string" },
	        allOf: { $ref: "#/definitions/schemaArray" },
	        anyOf: { $ref: "#/definitions/schemaArray" },
	        oneOf: { $ref: "#/definitions/schemaArray" },
	        not: { $ref: "#" }
	    },
	    dependencies: {
	        exclusiveMaximum: ["maximum"],
	        exclusiveMinimum: ["minimum"]
	    },
	    default: { }
	};

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	var ajvOrig = (additionalOptions = {}) => {
	    const ajv = new Ajv__default["default"]({
	        meta: false,
	        useDefaults: true,
	        validateSchema: false,
	        missingRefs: "ignore",
	        verbose: true,
	        schemaId: "auto",
	        ...additionalOptions
	    });

	    ajv.addMetaSchema(metaSchema);
	    // eslint-disable-next-line no-underscore-dangle -- part of the API
	    ajv._opts.defaultMeta = metaSchema.id;

	    return ajv;
	};

	/**
	 * @fileoverview Applies default rule options
	 * @author JoshuaKGoldberg
	 */

	/**
	 * Check if the variable contains an object strictly rejecting arrays
	 * @param {unknown} value an object
	 * @returns {boolean} Whether value is an object
	 */
	function isObjectNotArray(value) {
	    return typeof value === "object" && value !== null && !Array.isArray(value);
	}

	/**
	 * Deeply merges second on top of first, creating a new {} object if needed.
	 * @param {T} first Base, default value.
	 * @param {U} second User-specified value.
	 * @returns {T | U | (T & U)} Merged equivalent of second on top of first.
	 */
	function deepMergeObjects(first, second) {
	    if (second === void 0) {
	        return first;
	    }

	    if (!isObjectNotArray(first) || !isObjectNotArray(second)) {
	        return second;
	    }

	    const result = { ...first, ...second };

	    for (const key of Object.keys(second)) {
	        if (Object.prototype.propertyIsEnumerable.call(first, key)) {
	            result[key] = deepMergeObjects(first[key], second[key]);
	        }
	    }

	    return result;
	}

	/**
	 * Deeply merges second on top of first, creating a new [] array if needed.
	 * @param {T[] | undefined} first Base, default values.
	 * @param {U[] | undefined} second User-specified values.
	 * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.
	 */
	function deepMergeArrays(first, second) {
	    if (!first || !second) {
	        return second || first || [];
	    }

	    return [
	        ...first.map((value, i) => deepMergeObjects(value, second[i])),
	        ...second.slice(first.length)
	    ];
	}

	/**
	 * @fileoverview Defines a schema for configs.
	 * @author Sylvan Mably
	 */

	const baseConfigProperties = {
	    $schema: { type: "string" },
	    env: { type: "object" },
	    extends: { $ref: "#/definitions/stringOrStrings" },
	    globals: { type: "object" },
	    overrides: {
	        type: "array",
	        items: { $ref: "#/definitions/overrideConfig" },
	        additionalItems: false
	    },
	    parser: { type: ["string", "null"] },
	    parserOptions: { type: "object" },
	    plugins: { type: "array" },
	    processor: { type: "string" },
	    rules: { type: "object" },
	    settings: { type: "object" },
	    noInlineConfig: { type: "boolean" },
	    reportUnusedDisableDirectives: { type: "boolean" },

	    ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
	};

	const configSchema = {
	    definitions: {
	        stringOrStrings: {
	            oneOf: [
	                { type: "string" },
	                {
	                    type: "array",
	                    items: { type: "string" },
	                    additionalItems: false
	                }
	            ]
	        },
	        stringOrStringsRequired: {
	            oneOf: [
	                { type: "string" },
	                {
	                    type: "array",
	                    items: { type: "string" },
	                    additionalItems: false,
	                    minItems: 1
	                }
	            ]
	        },

	        // Config at top-level.
	        objectConfig: {
	            type: "object",
	            properties: {
	                root: { type: "boolean" },
	                ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
	                ...baseConfigProperties
	            },
	            additionalProperties: false
	        },

	        // Config in `overrides`.
	        overrideConfig: {
	            type: "object",
	            properties: {
	                excludedFiles: { $ref: "#/definitions/stringOrStrings" },
	                files: { $ref: "#/definitions/stringOrStringsRequired" },
	                ...baseConfigProperties
	            },
	            required: ["files"],
	            additionalProperties: false
	        }
	    },

	    $ref: "#/definitions/objectConfig"
	};

	/**
	 * @fileoverview Defines environment settings and globals.
	 * @author Elan Shanker
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Get the object that has difference.
	 * @param {Record<string,boolean>} current The newer object.
	 * @param {Record<string,boolean>} prev The older object.
	 * @returns {Record<string,boolean>} The difference object.
	 */
	function getDiff(current, prev) {
	    const retv = {};

	    for (const [key, value] of Object.entries(current)) {
	        if (!Object.hasOwn(prev, key)) {
	            retv[key] = value;
	        }
	    }

	    return retv;
	}

	const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ...
	const newGlobals2017 = {
	    Atomics: false,
	    SharedArrayBuffer: false
	};
	const newGlobals2020 = {
	    BigInt: false,
	    BigInt64Array: false,
	    BigUint64Array: false,
	    globalThis: false
	};

	const newGlobals2021 = {
	    AggregateError: false,
	    FinalizationRegistry: false,
	    WeakRef: false
	};

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/** @type {Map<string, import("../lib/shared/types").Environment>} */
	var environments = new Map(Object.entries({

	    // Language
	    builtin: {
	        globals: globals__default["default"].es5
	    },
	    es6: {
	        globals: newGlobals2015,
	        parserOptions: {
	            ecmaVersion: 6
	        }
	    },
	    es2015: {
	        globals: newGlobals2015,
	        parserOptions: {
	            ecmaVersion: 6
	        }
	    },
	    es2016: {
	        globals: newGlobals2015,
	        parserOptions: {
	            ecmaVersion: 7
	        }
	    },
	    es2017: {
	        globals: { ...newGlobals2015, ...newGlobals2017 },
	        parserOptions: {
	            ecmaVersion: 8
	        }
	    },
	    es2018: {
	        globals: { ...newGlobals2015, ...newGlobals2017 },
	        parserOptions: {
	            ecmaVersion: 9
	        }
	    },
	    es2019: {
	        globals: { ...newGlobals2015, ...newGlobals2017 },
	        parserOptions: {
	            ecmaVersion: 10
	        }
	    },
	    es2020: {
	        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
	        parserOptions: {
	            ecmaVersion: 11
	        }
	    },
	    es2021: {
	        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
	        parserOptions: {
	            ecmaVersion: 12
	        }
	    },
	    es2022: {
	        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
	        parserOptions: {
	            ecmaVersion: 13
	        }
	    },
	    es2023: {
	        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
	        parserOptions: {
	            ecmaVersion: 14
	        }
	    },
	    es2024: {
	        globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
	        parserOptions: {
	            ecmaVersion: 15
	        }
	    },

	    // Platforms
	    browser: {
	        globals: globals__default["default"].browser
	    },
	    node: {
	        globals: globals__default["default"].node,
	        parserOptions: {
	            ecmaFeatures: {
	                globalReturn: true
	            }
	        }
	    },
	    "shared-node-browser": {
	        globals: globals__default["default"]["shared-node-browser"]
	    },
	    worker: {
	        globals: globals__default["default"].worker
	    },
	    serviceworker: {
	        globals: globals__default["default"].serviceworker
	    },

	    // Frameworks
	    commonjs: {
	        globals: globals__default["default"].commonjs,
	        parserOptions: {
	            ecmaFeatures: {
	                globalReturn: true
	            }
	        }
	    },
	    amd: {
	        globals: globals__default["default"].amd
	    },
	    mocha: {
	        globals: globals__default["default"].mocha
	    },
	    jasmine: {
	        globals: globals__default["default"].jasmine
	    },
	    jest: {
	        globals: globals__default["default"].jest
	    },
	    phantomjs: {
	        globals: globals__default["default"].phantomjs
	    },
	    jquery: {
	        globals: globals__default["default"].jquery
	    },
	    qunit: {
	        globals: globals__default["default"].qunit
	    },
	    prototypejs: {
	        globals: globals__default["default"].prototypejs
	    },
	    shelljs: {
	        globals: globals__default["default"].shelljs
	    },
	    meteor: {
	        globals: globals__default["default"].meteor
	    },
	    mongo: {
	        globals: globals__default["default"].mongo
	    },
	    protractor: {
	        globals: globals__default["default"].protractor
	    },
	    applescript: {
	        globals: globals__default["default"].applescript
	    },
	    nashorn: {
	        globals: globals__default["default"].nashorn
	    },
	    atomtest: {
	        globals: globals__default["default"].atomtest
	    },
	    embertest: {
	        globals: globals__default["default"].embertest
	    },
	    webextensions: {
	        globals: globals__default["default"].webextensions
	    },
	    greasemonkey: {
	        globals: globals__default["default"].greasemonkey
	    }
	}));

	/**
	 * @fileoverview Validates configs.
	 * @author Brandon Mills
	 */

	const ajv = ajvOrig();

	const ruleValidators = new WeakMap();
	const noop = Function.prototype;

	//------------------------------------------------------------------------------
	// Private
	//------------------------------------------------------------------------------
	let validateSchema;
	const severityMap = {
	    error: 2,
	    warn: 1,
	    off: 0
	};

	const validated = new WeakSet();

	// JSON schema that disallows passing any options
	const noOptionsSchema = Object.freeze({
	    type: "array",
	    minItems: 0,
	    maxItems: 0
	});

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * Validator for configuration objects.
	 */
	class ConfigValidator {
	    constructor({ builtInRules = new Map() } = {}) {
	        this.builtInRules = builtInRules;
	    }

	    /**
	     * Gets a complete options schema for a rule.
	     * @param {Rule} rule A rule object
	     * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
	     * @returns {Object|null} JSON Schema for the rule's options.
	     *      `null` if rule wasn't passed or its `meta.schema` is `false`.
	     */
	    getRuleOptionsSchema(rule) {
	        if (!rule) {
	            return null;
	        }

	        if (!rule.meta) {
	            return { ...noOptionsSchema }; // default if `meta.schema` is not specified
	        }

	        const schema = rule.meta.schema;

	        if (typeof schema === "undefined") {
	            return { ...noOptionsSchema }; // default if `meta.schema` is not specified
	        }

	        // `schema:false` is an allowed explicit opt-out of options validation for the rule
	        if (schema === false) {
	            return null;
	        }

	        if (typeof schema !== "object" || schema === null) {
	            throw new TypeError("Rule's `meta.schema` must be an array or object");
	        }

	        // ESLint-specific array form needs to be converted into a valid JSON Schema definition
	        if (Array.isArray(schema)) {
	            if (schema.length) {
	                return {
	                    type: "array",
	                    items: schema,
	                    minItems: 0,
	                    maxItems: schema.length
	                };
	            }

	            // `schema:[]` is an explicit way to specify that the rule does not accept any options
	            return { ...noOptionsSchema };
	        }

	        // `schema:<object>` is assumed to be a valid JSON Schema definition
	        return schema;
	    }

	    /**
	     * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.
	     * @param {options} options The given options for the rule.
	     * @returns {number|string} The rule's severity value
	     * @throws {Error} If the severity is invalid.
	     */
	    validateRuleSeverity(options) {
	        const severity = Array.isArray(options) ? options[0] : options;
	        const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;

	        if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
	            return normSeverity;
	        }

	        throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`);

	    }

	    /**
	     * Validates the non-severity options passed to a rule, based on its schema.
	     * @param {{create: Function}} rule The rule to validate
	     * @param {Array} localOptions The options for the rule, excluding severity
	     * @returns {void}
	     * @throws {Error} If the options are invalid.
	     */
	    validateRuleSchema(rule, localOptions) {
	        if (!ruleValidators.has(rule)) {
	            try {
	                const schema = this.getRuleOptionsSchema(rule);

	                if (schema) {
	                    ruleValidators.set(rule, ajv.compile(schema));
	                }
	            } catch (err) {
	                const errorWithCode = new Error(err.message, { cause: err });

	                errorWithCode.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA";

	                throw errorWithCode;
	            }
	        }

	        const validateRule = ruleValidators.get(rule);

	        if (validateRule) {
	            const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions);

	            validateRule(mergedOptions);

	            if (validateRule.errors) {
	                throw new Error(validateRule.errors.map(
	                    error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`
	                ).join(""));
	            }
	        }
	    }

	    /**
	     * Validates a rule's options against its schema.
	     * @param {{create: Function}|null} rule The rule that the config is being validated for
	     * @param {string} ruleId The rule's unique name.
	     * @param {Array|number} options The given options for the rule.
	     * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,
	     * no source is prepended to the message.
	     * @returns {void}
	     * @throws {Error} If the options are invalid.
	     */
	    validateRuleOptions(rule, ruleId, options, source = null) {
	        try {
	            const severity = this.validateRuleSeverity(options);

	            if (severity !== 0) {
	                this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);
	            }
	        } catch (err) {
	            let enhancedMessage = err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
	                ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}`
	                : `Configuration for rule "${ruleId}" is invalid:\n${err.message}`;

	            if (typeof source === "string") {
	                enhancedMessage = `${source}:\n\t${enhancedMessage}`;
	            }

	            const enhancedError = new Error(enhancedMessage, { cause: err });

	            if (err.code) {
	                enhancedError.code = err.code;
	            }

	            throw enhancedError;
	        }
	    }

	    /**
	     * Validates an environment object
	     * @param {Object} environment The environment config object to validate.
	     * @param {string} source The name of the configuration source to report in any errors.
	     * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments.
	     * @returns {void}
	     * @throws {Error} If the environment is invalid.
	     */
	    validateEnvironment(
	        environment,
	        source,
	        getAdditionalEnv = noop
	    ) {

	        // not having an environment is ok
	        if (!environment) {
	            return;
	        }

	        Object.keys(environment).forEach(id => {
	            const env = getAdditionalEnv(id) || environments.get(id) || null;

	            if (!env) {
	                const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`;

	                throw new Error(message);
	            }
	        });
	    }

	    /**
	     * Validates a rules config object
	     * @param {Object} rulesConfig The rules config object to validate.
	     * @param {string} source The name of the configuration source to report in any errors.
	     * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules
	     * @returns {void}
	     */
	    validateRules(
	        rulesConfig,
	        source,
	        getAdditionalRule = noop
	    ) {
	        if (!rulesConfig) {
	            return;
	        }

	        Object.keys(rulesConfig).forEach(id => {
	            const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;

	            this.validateRuleOptions(rule, id, rulesConfig[id], source);
	        });
	    }

	    /**
	     * Validates a `globals` section of a config file
	     * @param {Object} globalsConfig The `globals` section
	     * @param {string|null} source The name of the configuration source to report in the event of an error.
	     * @returns {void}
	     */
	    validateGlobals(globalsConfig, source = null) {
	        if (!globalsConfig) {
	            return;
	        }

	        Object.entries(globalsConfig)
	            .forEach(([configuredGlobal, configuredValue]) => {
	                try {
	                    normalizeConfigGlobal(configuredValue);
	                } catch (err) {
	                    throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`);
	                }
	            });
	    }

	    /**
	     * Validate `processor` configuration.
	     * @param {string|undefined} processorName The processor name.
	     * @param {string} source The name of config file.
	     * @param {(id:string) => Processor} getProcessor The getter of defined processors.
	     * @returns {void}
	     * @throws {Error} If the processor is invalid.
	     */
	    validateProcessor(processorName, source, getProcessor) {
	        if (processorName && !getProcessor(processorName)) {
	            throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);
	        }
	    }

	    /**
	     * Formats an array of schema validation errors.
	     * @param {Array} errors An array of error messages to format.
	     * @returns {string} Formatted error message
	     */
	    formatErrors(errors) {
	        return errors.map(error => {
	            if (error.keyword === "additionalProperties") {
	                const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;

	                return `Unexpected top-level property "${formattedPropertyPath}"`;
	            }
	            if (error.keyword === "type") {
	                const formattedField = error.dataPath.slice(1);
	                const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema;
	                const formattedValue = JSON.stringify(error.data);

	                return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`;
	            }

	            const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;

	            return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
	        }).map(message => `\t- ${message}.\n`).join("");
	    }

	    /**
	     * Validates the top level properties of the config object.
	     * @param {Object} config The config object to validate.
	     * @param {string} source The name of the configuration source to report in any errors.
	     * @returns {void}
	     * @throws {Error} If the config is invalid.
	     */
	    validateConfigSchema(config, source = null) {
	        validateSchema = validateSchema || ajv.compile(configSchema);

	        if (!validateSchema(config)) {
	            throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`);
	        }

	        if (Object.hasOwn(config, "ecmaFeatures")) {
	            emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
	        }
	    }

	    /**
	     * Validates an entire config object.
	     * @param {Object} config The config object to validate.
	     * @param {string} source The name of the configuration source to report in any errors.
	     * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules.
	     * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs.
	     * @returns {void}
	     */
	    validate(config, source, getAdditionalRule, getAdditionalEnv) {
	        this.validateConfigSchema(config, source);
	        this.validateRules(config.rules, source, getAdditionalRule);
	        this.validateEnvironment(config.env, source, getAdditionalEnv);
	        this.validateGlobals(config.globals, source);

	        for (const override of config.overrides || []) {
	            this.validateRules(override.rules, source, getAdditionalRule);
	            this.validateEnvironment(override.env, source, getAdditionalEnv);
	            this.validateGlobals(config.globals, source);
	        }
	    }

	    /**
	     * Validate config array object.
	     * @param {ConfigArray} configArray The config array to validate.
	     * @returns {void}
	     */
	    validateConfigArray(configArray) {
	        const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);
	        const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);
	        const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);

	        // Validate.
	        for (const element of configArray) {
	            if (validated.has(element)) {
	                continue;
	            }
	            validated.add(element);

	            this.validateEnvironment(element.env, element.name, getPluginEnv);
	            this.validateGlobals(element.globals, element.name);
	            this.validateProcessor(element.processor, element.name, getPluginProcessor);
	            this.validateRules(element.rules, element.name, getPluginRule);
	        }
	    }

	}

	/**
	 * @fileoverview Common helpers for naming of plugins, formatters and configs
	 */

	const NAMESPACE_REGEX = /^@.*\//iu;

	/**
	 * Brings package name to correct format based on prefix
	 * @param {string} name The name of the package.
	 * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"
	 * @returns {string} Normalized name of the package
	 * @private
	 */
	function normalizePackageName(name, prefix) {
	    let normalizedName = name;

	    /**
	     * On Windows, name can come in with Windows slashes instead of Unix slashes.
	     * Normalize to Unix first to avoid errors later on.
	     * https://github.com/eslint/eslint/issues/5644
	     */
	    if (normalizedName.includes("\\")) {
	        normalizedName = normalizedName.replace(/\\/gu, "/");
	    }

	    if (normalizedName.charAt(0) === "@") {

	        /**
	         * it's a scoped package
	         * package name is the prefix, or just a username
	         */
	        const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"),
	            scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");

	        if (scopedPackageShortcutRegex.test(normalizedName)) {
	            normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);
	        } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {

	            /**
	             * for scoped packages, insert the prefix after the first / unless
	             * the path is already @scope/eslint or @scope/eslint-xxx-yyy
	             */
	            normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`);
	        }
	    } else if (!normalizedName.startsWith(`${prefix}-`)) {
	        normalizedName = `${prefix}-${normalizedName}`;
	    }

	    return normalizedName;
	}

	/**
	 * Removes the prefix from a fullname.
	 * @param {string} fullname The term which may have the prefix.
	 * @param {string} prefix The prefix to remove.
	 * @returns {string} The term without prefix.
	 */
	function getShorthandName(fullname, prefix) {
	    if (fullname[0] === "@") {
	        let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname);

	        if (matchResult) {
	            return matchResult[1];
	        }

	        matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname);
	        if (matchResult) {
	            return `${matchResult[1]}/${matchResult[2]}`;
	        }
	    } else if (fullname.startsWith(`${prefix}-`)) {
	        return fullname.slice(prefix.length + 1);
	    }

	    return fullname;
	}

	/**
	 * Gets the scope (namespace) of a term.
	 * @param {string} term The term which may have the namespace.
	 * @returns {string} The namespace of the term if it has one.
	 */
	function getNamespaceFromTerm(term) {
	    const match = term.match(NAMESPACE_REGEX);

	    return match ? match[0] : "";
	}

	var naming = {
	    __proto__: null,
	    normalizePackageName: normalizePackageName,
	    getShorthandName: getShorthandName,
	    getNamespaceFromTerm: getNamespaceFromTerm
	};

	/**
	 * @fileoverview Package exports for @eslint/eslintrc
	 * @author Nicholas C. Zakas
	 */

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	const Legacy = {
	    environments,

	    // shared
	    ConfigOps,
	    ConfigValidator,
	    naming
	};

	eslintrcUniversal.Legacy = Legacy;
	
	return eslintrcUniversal;
}

var src = {exports: {}};

var browser = {exports: {}};

/**
 * Helpers.
 */

var ms;
var hasRequiredMs;

function requireMs () {
	if (hasRequiredMs) return ms;
	hasRequiredMs = 1;
	var s = 1000;
	var m = s * 60;
	var h = m * 60;
	var d = h * 24;
	var w = d * 7;
	var y = d * 365.25;

	/**
	 * Parse or format the given `val`.
	 *
	 * Options:
	 *
	 *  - `long` verbose formatting [false]
	 *
	 * @param {String|Number} val
	 * @param {Object} [options]
	 * @throws {Error} throw an error if val is not a non-empty string or a number
	 * @return {String|Number}
	 * @api public
	 */

	ms = function (val, options) {
	  options = options || {};
	  var type = typeof val;
	  if (type === 'string' && val.length > 0) {
	    return parse(val);
	  } else if (type === 'number' && isFinite(val)) {
	    return options.long ? fmtLong(val) : fmtShort(val);
	  }
	  throw new Error(
	    'val is not a non-empty string or a valid number. val=' +
	      JSON.stringify(val)
	  );
	};

	/**
	 * Parse the given `str` and return milliseconds.
	 *
	 * @param {String} str
	 * @return {Number}
	 * @api private
	 */

	function parse(str) {
	  str = String(str);
	  if (str.length > 100) {
	    return;
	  }
	  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
	    str
	  );
	  if (!match) {
	    return;
	  }
	  var n = parseFloat(match[1]);
	  var type = (match[2] || 'ms').toLowerCase();
	  switch (type) {
	    case 'years':
	    case 'year':
	    case 'yrs':
	    case 'yr':
	    case 'y':
	      return n * y;
	    case 'weeks':
	    case 'week':
	    case 'w':
	      return n * w;
	    case 'days':
	    case 'day':
	    case 'd':
	      return n * d;
	    case 'hours':
	    case 'hour':
	    case 'hrs':
	    case 'hr':
	    case 'h':
	      return n * h;
	    case 'minutes':
	    case 'minute':
	    case 'mins':
	    case 'min':
	    case 'm':
	      return n * m;
	    case 'seconds':
	    case 'second':
	    case 'secs':
	    case 'sec':
	    case 's':
	      return n * s;
	    case 'milliseconds':
	    case 'millisecond':
	    case 'msecs':
	    case 'msec':
	    case 'ms':
	      return n;
	    default:
	      return undefined;
	  }
	}

	/**
	 * Short format for `ms`.
	 *
	 * @param {Number} ms
	 * @return {String}
	 * @api private
	 */

	function fmtShort(ms) {
	  var msAbs = Math.abs(ms);
	  if (msAbs >= d) {
	    return Math.round(ms / d) + 'd';
	  }
	  if (msAbs >= h) {
	    return Math.round(ms / h) + 'h';
	  }
	  if (msAbs >= m) {
	    return Math.round(ms / m) + 'm';
	  }
	  if (msAbs >= s) {
	    return Math.round(ms / s) + 's';
	  }
	  return ms + 'ms';
	}

	/**
	 * Long format for `ms`.
	 *
	 * @param {Number} ms
	 * @return {String}
	 * @api private
	 */

	function fmtLong(ms) {
	  var msAbs = Math.abs(ms);
	  if (msAbs >= d) {
	    return plural(ms, msAbs, d, 'day');
	  }
	  if (msAbs >= h) {
	    return plural(ms, msAbs, h, 'hour');
	  }
	  if (msAbs >= m) {
	    return plural(ms, msAbs, m, 'minute');
	  }
	  if (msAbs >= s) {
	    return plural(ms, msAbs, s, 'second');
	  }
	  return ms + ' ms';
	}

	/**
	 * Pluralization helper.
	 */

	function plural(ms, msAbs, n, name) {
	  var isPlural = msAbs >= n * 1.5;
	  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
	}
	return ms;
}

var common;
var hasRequiredCommon;

function requireCommon () {
	if (hasRequiredCommon) return common;
	hasRequiredCommon = 1;
	/**
	 * This is the common logic for both the Node.js and web browser
	 * implementations of `debug()`.
	 */

	function setup(env) {
		createDebug.debug = createDebug;
		createDebug.default = createDebug;
		createDebug.coerce = coerce;
		createDebug.disable = disable;
		createDebug.enable = enable;
		createDebug.enabled = enabled;
		createDebug.humanize = requireMs();
		createDebug.destroy = destroy;

		Object.keys(env).forEach(key => {
			createDebug[key] = env[key];
		});

		/**
		* The currently active debug mode names, and names to skip.
		*/

		createDebug.names = [];
		createDebug.skips = [];

		/**
		* Map of special "%n" handling functions, for the debug "format" argument.
		*
		* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
		*/
		createDebug.formatters = {};

		/**
		* Selects a color for a debug namespace
		* @param {String} namespace The namespace string for the debug instance to be colored
		* @return {Number|String} An ANSI color code for the given namespace
		* @api private
		*/
		function selectColor(namespace) {
			let hash = 0;

			for (let i = 0; i < namespace.length; i++) {
				hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
				hash |= 0; // Convert to 32bit integer
			}

			return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
		}
		createDebug.selectColor = selectColor;

		/**
		* Create a debugger with the given `namespace`.
		*
		* @param {String} namespace
		* @return {Function}
		* @api public
		*/
		function createDebug(namespace) {
			let prevTime;
			let enableOverride = null;
			let namespacesCache;
			let enabledCache;

			function debug(...args) {
				// Disabled?
				if (!debug.enabled) {
					return;
				}

				const self = debug;

				// Set `diff` timestamp
				const curr = Number(new Date());
				const ms = curr - (prevTime || curr);
				self.diff = ms;
				self.prev = prevTime;
				self.curr = curr;
				prevTime = curr;

				args[0] = createDebug.coerce(args[0]);

				if (typeof args[0] !== 'string') {
					// Anything else let's inspect with %O
					args.unshift('%O');
				}

				// Apply any `formatters` transformations
				let index = 0;
				args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
					// If we encounter an escaped % then don't increase the array index
					if (match === '%%') {
						return '%';
					}
					index++;
					const formatter = createDebug.formatters[format];
					if (typeof formatter === 'function') {
						const val = args[index];
						match = formatter.call(self, val);

						// Now we need to remove `args[index]` since it's inlined in the `format`
						args.splice(index, 1);
						index--;
					}
					return match;
				});

				// Apply env-specific formatting (colors, etc.)
				createDebug.formatArgs.call(self, args);

				const logFn = self.log || createDebug.log;
				logFn.apply(self, args);
			}

			debug.namespace = namespace;
			debug.useColors = createDebug.useColors();
			debug.color = createDebug.selectColor(namespace);
			debug.extend = extend;
			debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.

			Object.defineProperty(debug, 'enabled', {
				enumerable: true,
				configurable: false,
				get: () => {
					if (enableOverride !== null) {
						return enableOverride;
					}
					if (namespacesCache !== createDebug.namespaces) {
						namespacesCache = createDebug.namespaces;
						enabledCache = createDebug.enabled(namespace);
					}

					return enabledCache;
				},
				set: v => {
					enableOverride = v;
				}
			});

			// Env-specific initialization logic for debug instances
			if (typeof createDebug.init === 'function') {
				createDebug.init(debug);
			}

			return debug;
		}

		function extend(namespace, delimiter) {
			const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
			newDebug.log = this.log;
			return newDebug;
		}

		/**
		* Enables a debug mode by namespaces. This can include modes
		* separated by a colon and wildcards.
		*
		* @param {String} namespaces
		* @api public
		*/
		function enable(namespaces) {
			createDebug.save(namespaces);
			createDebug.namespaces = namespaces;

			createDebug.names = [];
			createDebug.skips = [];

			const split = (typeof namespaces === 'string' ? namespaces : '')
				.trim()
				.replace(' ', ',')
				.split(',')
				.filter(Boolean);

			for (const ns of split) {
				if (ns[0] === '-') {
					createDebug.skips.push(ns.slice(1));
				} else {
					createDebug.names.push(ns);
				}
			}
		}

		/**
		 * Checks if the given string matches a namespace template, honoring
		 * asterisks as wildcards.
		 *
		 * @param {String} search
		 * @param {String} template
		 * @return {Boolean}
		 */
		function matchesTemplate(search, template) {
			let searchIndex = 0;
			let templateIndex = 0;
			let starIndex = -1;
			let matchIndex = 0;

			while (searchIndex < search.length) {
				if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
					// Match character or proceed with wildcard
					if (template[templateIndex] === '*') {
						starIndex = templateIndex;
						matchIndex = searchIndex;
						templateIndex++; // Skip the '*'
					} else {
						searchIndex++;
						templateIndex++;
					}
				} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
					// Backtrack to the last '*' and try to match more characters
					templateIndex = starIndex + 1;
					matchIndex++;
					searchIndex = matchIndex;
				} else {
					return false; // No match
				}
			}

			// Handle trailing '*' in template
			while (templateIndex < template.length && template[templateIndex] === '*') {
				templateIndex++;
			}

			return templateIndex === template.length;
		}

		/**
		* Disable debug output.
		*
		* @return {String} namespaces
		* @api public
		*/
		function disable() {
			const namespaces = [
				...createDebug.names,
				...createDebug.skips.map(namespace => '-' + namespace)
			].join(',');
			createDebug.enable('');
			return namespaces;
		}

		/**
		* Returns true if the given mode name is enabled, false otherwise.
		*
		* @param {String} name
		* @return {Boolean}
		* @api public
		*/
		function enabled(name) {
			for (const skip of createDebug.skips) {
				if (matchesTemplate(name, skip)) {
					return false;
				}
			}

			for (const ns of createDebug.names) {
				if (matchesTemplate(name, ns)) {
					return true;
				}
			}

			return false;
		}

		/**
		* Coerce `val`.
		*
		* @param {Mixed} val
		* @return {Mixed}
		* @api private
		*/
		function coerce(val) {
			if (val instanceof Error) {
				return val.stack || val.message;
			}
			return val;
		}

		/**
		* XXX DO NOT USE. This is a temporary stub function.
		* XXX It WILL be removed in the next major release.
		*/
		function destroy() {
			console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
		}

		createDebug.enable(createDebug.load());

		return createDebug;
	}

	common = setup;
	return common;
}

var hasRequiredBrowser;

function requireBrowser () {
	if (hasRequiredBrowser) return browser.exports;
	hasRequiredBrowser = 1;
	(function (module, exports) {
		/**
		 * This is the web browser implementation of `debug()`.
		 */

		exports.formatArgs = formatArgs;
		exports.save = save;
		exports.load = load;
		exports.useColors = useColors;
		exports.storage = localstorage();
		exports.destroy = (() => {
			let warned = false;

			return () => {
				if (!warned) {
					warned = true;
					console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
				}
			};
		})();

		/**
		 * Colors.
		 */

		exports.colors = [
			'#0000CC',
			'#0000FF',
			'#0033CC',
			'#0033FF',
			'#0066CC',
			'#0066FF',
			'#0099CC',
			'#0099FF',
			'#00CC00',
			'#00CC33',
			'#00CC66',
			'#00CC99',
			'#00CCCC',
			'#00CCFF',
			'#3300CC',
			'#3300FF',
			'#3333CC',
			'#3333FF',
			'#3366CC',
			'#3366FF',
			'#3399CC',
			'#3399FF',
			'#33CC00',
			'#33CC33',
			'#33CC66',
			'#33CC99',
			'#33CCCC',
			'#33CCFF',
			'#6600CC',
			'#6600FF',
			'#6633CC',
			'#6633FF',
			'#66CC00',
			'#66CC33',
			'#9900CC',
			'#9900FF',
			'#9933CC',
			'#9933FF',
			'#99CC00',
			'#99CC33',
			'#CC0000',
			'#CC0033',
			'#CC0066',
			'#CC0099',
			'#CC00CC',
			'#CC00FF',
			'#CC3300',
			'#CC3333',
			'#CC3366',
			'#CC3399',
			'#CC33CC',
			'#CC33FF',
			'#CC6600',
			'#CC6633',
			'#CC9900',
			'#CC9933',
			'#CCCC00',
			'#CCCC33',
			'#FF0000',
			'#FF0033',
			'#FF0066',
			'#FF0099',
			'#FF00CC',
			'#FF00FF',
			'#FF3300',
			'#FF3333',
			'#FF3366',
			'#FF3399',
			'#FF33CC',
			'#FF33FF',
			'#FF6600',
			'#FF6633',
			'#FF9900',
			'#FF9933',
			'#FFCC00',
			'#FFCC33'
		];

		/**
		 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
		 * and the Firebug extension (any Firefox version) are known
		 * to support "%c" CSS customizations.
		 *
		 * TODO: add a `localStorage` variable to explicitly enable/disable colors
		 */

		// eslint-disable-next-line complexity
		function useColors() {
			// NB: In an Electron preload script, document will be defined but not fully
			// initialized. Since we know we're in Chrome, we'll just detect this case
			// explicitly
			if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
				return true;
			}

			// Internet Explorer and Edge do not support colors.
			if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
				return false;
			}

			let m;

			// Is webkit? http://stackoverflow.com/a/16459606/376773
			// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
			// eslint-disable-next-line no-return-assign
			return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
				// Is firebug? http://stackoverflow.com/a/398120/376773
				(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
				// Is firefox >= v31?
				// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
				(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
				// Double check webkit in userAgent just in case we are in a worker
				(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
		}

		/**
		 * Colorize log arguments if enabled.
		 *
		 * @api public
		 */

		function formatArgs(args) {
			args[0] = (this.useColors ? '%c' : '') +
				this.namespace +
				(this.useColors ? ' %c' : ' ') +
				args[0] +
				(this.useColors ? '%c ' : ' ') +
				'+' + module.exports.humanize(this.diff);

			if (!this.useColors) {
				return;
			}

			const c = 'color: ' + this.color;
			args.splice(1, 0, c, 'color: inherit');

			// The final "%c" is somewhat tricky, because there could be other
			// arguments passed either before or after the %c, so we need to
			// figure out the correct index to insert the CSS into
			let index = 0;
			let lastC = 0;
			args[0].replace(/%[a-zA-Z%]/g, match => {
				if (match === '%%') {
					return;
				}
				index++;
				if (match === '%c') {
					// We only are interested in the *last* %c
					// (the user may have provided their own)
					lastC = index;
				}
			});

			args.splice(lastC, 0, c);
		}

		/**
		 * Invokes `console.debug()` when available.
		 * No-op when `console.debug` is not a "function".
		 * If `console.debug` is not available, falls back
		 * to `console.log`.
		 *
		 * @api public
		 */
		exports.log = console.debug || console.log || (() => {});

		/**
		 * Save `namespaces`.
		 *
		 * @param {String} namespaces
		 * @api private
		 */
		function save(namespaces) {
			try {
				if (namespaces) {
					exports.storage.setItem('debug', namespaces);
				} else {
					exports.storage.removeItem('debug');
				}
			} catch (error) {
				// Swallow
				// XXX (@Qix-) should we be logging these?
			}
		}

		/**
		 * Load `namespaces`.
		 *
		 * @return {String} returns the previously persisted debug modes
		 * @api private
		 */
		function load() {
			let r;
			try {
				r = exports.storage.getItem('debug');
			} catch (error) {
				// Swallow
				// XXX (@Qix-) should we be logging these?
			}

			// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
			if (!r && typeof browser$1$1 !== 'undefined' && 'env' in browser$1$1) {
				r = browser$1$1.env.DEBUG;
			}

			return r;
		}

		/**
		 * Localstorage attempts to return the localstorage.
		 *
		 * This is necessary because safari throws
		 * when a user disables cookies/localstorage
		 * and you attempt to access it.
		 *
		 * @return {LocalStorage}
		 * @api private
		 */

		function localstorage() {
			try {
				// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
				// The Browser also has localStorage in the global context.
				return localStorage;
			} catch (error) {
				// Swallow
				// XXX (@Qix-) should we be logging these?
			}
		}

		module.exports = requireCommon()(exports);

		const {formatters} = module.exports;

		/**
		 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
		 */

		formatters.j = function (v) {
			try {
				return JSON.stringify(v);
			} catch (error) {
				return '[UnexpectedJSONParseError]: ' + error.message;
			}
		}; 
	} (browser, browser.exports));
	return browser.exports;
}

var hasRequiredSrc;

function requireSrc () {
	if (hasRequiredSrc) return src.exports;
	hasRequiredSrc = 1;
	{
		src.exports = requireBrowser();
	}
	return src.exports;
}

/**
 * @fileoverview Traverser to traverse AST trees.
 * @author Nicholas C. Zakas
 * @author Toru Nagashima
 */

var traverser;
var hasRequiredTraverser;

function requireTraverser () {
	if (hasRequiredTraverser) return traverser;
	hasRequiredTraverser = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const vk = requireEslintVisitorKeys$2();
	const debug = requireSrc()("eslint:traverser");

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Do nothing.
	 * @returns {void}
	 */
	function noop() {
		// do nothing.
	}

	/**
	 * Check whether the given value is an ASTNode or not.
	 * @param {any} x The value to check.
	 * @returns {boolean} `true` if the value is an ASTNode.
	 */
	function isNode(x) {
		return x !== null && typeof x === "object" && typeof x.type === "string";
	}

	/**
	 * Get the visitor keys of a given node.
	 * @param {Object} visitorKeys The map of visitor keys.
	 * @param {ASTNode} node The node to get their visitor keys.
	 * @returns {string[]} The visitor keys of the node.
	 */
	function getVisitorKeys(visitorKeys, node) {
		let keys = visitorKeys[node.type];

		if (!keys) {
			keys = vk.getKeys(node);
			debug(
				'Unknown node type "%s": Estimated visitor keys %j',
				node.type,
				keys,
			);
		}

		return keys;
	}

	/**
	 * The traverser class to traverse AST trees.
	 */
	class Traverser {
		constructor() {
			this._current = null;
			this._parents = [];
			this._skipped = false;
			this._broken = false;
			this._visitorKeys = null;
			this._enter = null;
			this._leave = null;
		}

		/**
		 * Gives current node.
		 * @returns {ASTNode} The current node.
		 */
		current() {
			return this._current;
		}

		/**
		 * Gives a copy of the ancestor nodes.
		 * @returns {ASTNode[]} The ancestor nodes.
		 */
		parents() {
			return this._parents.slice(0);
		}

		/**
		 * Break the current traversal.
		 * @returns {void}
		 */
		break() {
			this._broken = true;
		}

		/**
		 * Skip child nodes for the current traversal.
		 * @returns {void}
		 */
		skip() {
			this._skipped = true;
		}

		/**
		 * Traverse the given AST tree.
		 * @param {ASTNode} node The root node to traverse.
		 * @param {Object} options The option object.
		 * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
		 * @param {Function} [options.enter=noop] The callback function which is called on entering each node.
		 * @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
		 * @returns {void}
		 */
		traverse(node, options) {
			this._current = null;
			this._parents = [];
			this._skipped = false;
			this._broken = false;
			this._visitorKeys = options.visitorKeys || vk.KEYS;
			this._enter = options.enter || noop;
			this._leave = options.leave || noop;
			this._traverse(node, null);
		}

		/**
		 * Traverse the given AST tree recursively.
		 * @param {ASTNode} node The current node.
		 * @param {ASTNode|null} parent The parent node.
		 * @returns {void}
		 * @private
		 */
		_traverse(node, parent) {
			if (!isNode(node)) {
				return;
			}

			this._current = node;
			this._skipped = false;
			this._enter(node, parent);

			if (!this._skipped && !this._broken) {
				const keys = getVisitorKeys(this._visitorKeys, node);

				if (keys.length >= 1) {
					this._parents.push(node);
					for (let i = 0; i < keys.length && !this._broken; ++i) {
						const child = node[keys[i]];

						if (Array.isArray(child)) {
							for (
								let j = 0;
								j < child.length && !this._broken;
								++j
							) {
								this._traverse(child[j], node);
							}
						} else {
							this._traverse(child, node);
						}
					}
					this._parents.pop();
				}
			}

			if (!this._broken) {
				this._leave(node, parent);
			}

			this._current = parent;
		}

		/**
		 * Calculates the keys to use for traversal.
		 * @param {ASTNode} node The node to read keys from.
		 * @returns {string[]} An array of keys to visit on the node.
		 * @private
		 */
		static getKeys(node) {
			return vk.getKeys(node);
		}

		/**
		 * Traverse the given AST tree.
		 * @param {ASTNode} node The root node to traverse.
		 * @param {Object} options The option object.
		 * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
		 * @param {Function} [options.enter=noop] The callback function which is called on entering each node.
		 * @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
		 * @returns {void}
		 */
		static traverse(node, options) {
			new Traverser().traverse(node, options);
		}

		/**
		 * The default visitor keys.
		 * @type {Object}
		 */
		static get DEFAULT_VISITOR_KEYS() {
			return vk.KEYS;
		}
	}

	traverser = Traverser;
	return traverser;
}

var eslintUtils = {};

var eslintVisitorKeys = {};

var hasRequiredEslintVisitorKeys;

function requireEslintVisitorKeys () {
	if (hasRequiredEslintVisitorKeys) return eslintVisitorKeys;
	hasRequiredEslintVisitorKeys = 1;

	Object.defineProperty(eslintVisitorKeys, '__esModule', { value: true });

	/**
	 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
	 */

	/**
	 * @type {VisitorKeys}
	 */
	const KEYS = {
	    ArrayExpression: [
	        "elements"
	    ],
	    ArrayPattern: [
	        "elements"
	    ],
	    ArrowFunctionExpression: [
	        "params",
	        "body"
	    ],
	    AssignmentExpression: [
	        "left",
	        "right"
	    ],
	    AssignmentPattern: [
	        "left",
	        "right"
	    ],
	    AwaitExpression: [
	        "argument"
	    ],
	    BinaryExpression: [
	        "left",
	        "right"
	    ],
	    BlockStatement: [
	        "body"
	    ],
	    BreakStatement: [
	        "label"
	    ],
	    CallExpression: [
	        "callee",
	        "arguments"
	    ],
	    CatchClause: [
	        "param",
	        "body"
	    ],
	    ChainExpression: [
	        "expression"
	    ],
	    ClassBody: [
	        "body"
	    ],
	    ClassDeclaration: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ClassExpression: [
	        "id",
	        "superClass",
	        "body"
	    ],
	    ConditionalExpression: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ContinueStatement: [
	        "label"
	    ],
	    DebuggerStatement: [],
	    DoWhileStatement: [
	        "body",
	        "test"
	    ],
	    EmptyStatement: [],
	    ExperimentalRestProperty: [
	        "argument"
	    ],
	    ExperimentalSpreadProperty: [
	        "argument"
	    ],
	    ExportAllDeclaration: [
	        "exported",
	        "source"
	    ],
	    ExportDefaultDeclaration: [
	        "declaration"
	    ],
	    ExportNamedDeclaration: [
	        "declaration",
	        "specifiers",
	        "source"
	    ],
	    ExportSpecifier: [
	        "exported",
	        "local"
	    ],
	    ExpressionStatement: [
	        "expression"
	    ],
	    ForInStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForOfStatement: [
	        "left",
	        "right",
	        "body"
	    ],
	    ForStatement: [
	        "init",
	        "test",
	        "update",
	        "body"
	    ],
	    FunctionDeclaration: [
	        "id",
	        "params",
	        "body"
	    ],
	    FunctionExpression: [
	        "id",
	        "params",
	        "body"
	    ],
	    Identifier: [],
	    IfStatement: [
	        "test",
	        "consequent",
	        "alternate"
	    ],
	    ImportDeclaration: [
	        "specifiers",
	        "source"
	    ],
	    ImportDefaultSpecifier: [
	        "local"
	    ],
	    ImportExpression: [
	        "source"
	    ],
	    ImportNamespaceSpecifier: [
	        "local"
	    ],
	    ImportSpecifier: [
	        "imported",
	        "local"
	    ],
	    JSXAttribute: [
	        "name",
	        "value"
	    ],
	    JSXClosingElement: [
	        "name"
	    ],
	    JSXClosingFragment: [],
	    JSXElement: [
	        "openingElement",
	        "children",
	        "closingElement"
	    ],
	    JSXEmptyExpression: [],
	    JSXExpressionContainer: [
	        "expression"
	    ],
	    JSXFragment: [
	        "openingFragment",
	        "children",
	        "closingFragment"
	    ],
	    JSXIdentifier: [],
	    JSXMemberExpression: [
	        "object",
	        "property"
	    ],
	    JSXNamespacedName: [
	        "namespace",
	        "name"
	    ],
	    JSXOpeningElement: [
	        "name",
	        "attributes"
	    ],
	    JSXOpeningFragment: [],
	    JSXSpreadAttribute: [
	        "argument"
	    ],
	    JSXSpreadChild: [
	        "expression"
	    ],
	    JSXText: [],
	    LabeledStatement: [
	        "label",
	        "body"
	    ],
	    Literal: [],
	    LogicalExpression: [
	        "left",
	        "right"
	    ],
	    MemberExpression: [
	        "object",
	        "property"
	    ],
	    MetaProperty: [
	        "meta",
	        "property"
	    ],
	    MethodDefinition: [
	        "key",
	        "value"
	    ],
	    NewExpression: [
	        "callee",
	        "arguments"
	    ],
	    ObjectExpression: [
	        "properties"
	    ],
	    ObjectPattern: [
	        "properties"
	    ],
	    PrivateIdentifier: [],
	    Program: [
	        "body"
	    ],
	    Property: [
	        "key",
	        "value"
	    ],
	    PropertyDefinition: [
	        "key",
	        "value"
	    ],
	    RestElement: [
	        "argument"
	    ],
	    ReturnStatement: [
	        "argument"
	    ],
	    SequenceExpression: [
	        "expressions"
	    ],
	    SpreadElement: [
	        "argument"
	    ],
	    StaticBlock: [
	        "body"
	    ],
	    Super: [],
	    SwitchCase: [
	        "test",
	        "consequent"
	    ],
	    SwitchStatement: [
	        "discriminant",
	        "cases"
	    ],
	    TaggedTemplateExpression: [
	        "tag",
	        "quasi"
	    ],
	    TemplateElement: [],
	    TemplateLiteral: [
	        "quasis",
	        "expressions"
	    ],
	    ThisExpression: [],
	    ThrowStatement: [
	        "argument"
	    ],
	    TryStatement: [
	        "block",
	        "handler",
	        "finalizer"
	    ],
	    UnaryExpression: [
	        "argument"
	    ],
	    UpdateExpression: [
	        "argument"
	    ],
	    VariableDeclaration: [
	        "declarations"
	    ],
	    VariableDeclarator: [
	        "id",
	        "init"
	    ],
	    WhileStatement: [
	        "test",
	        "body"
	    ],
	    WithStatement: [
	        "object",
	        "body"
	    ],
	    YieldExpression: [
	        "argument"
	    ]
	};

	// Types.
	const NODE_TYPES = Object.keys(KEYS);

	// Freeze the keys.
	for (const type of NODE_TYPES) {
	    Object.freeze(KEYS[type]);
	}
	Object.freeze(KEYS);

	/**
	 * @author Toru Nagashima <https://github.com/mysticatea>
	 * See LICENSE file in root directory for full license.
	 */

	/**
	 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
	 */

	// List to ignore keys.
	const KEY_BLACKLIST = new Set([
	    "parent",
	    "leadingComments",
	    "trailingComments"
	]);

	/**
	 * Check whether a given key should be used or not.
	 * @param {string} key The key to check.
	 * @returns {boolean} `true` if the key should be used.
	 */
	function filterKey(key) {
	    return !KEY_BLACKLIST.has(key) && key[0] !== "_";
	}

	/**
	 * Get visitor keys of a given node.
	 * @param {object} node The AST node to get keys.
	 * @returns {readonly string[]} Visitor keys of the node.
	 */
	function getKeys(node) {
	    return Object.keys(node).filter(filterKey);
	}

	// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
	// eslint-disable-next-line valid-jsdoc
	/**
	 * Make the union set with `KEYS` and given keys.
	 * @param {VisitorKeys} additionalKeys The additional keys.
	 * @returns {VisitorKeys} The union set.
	 */
	function unionWith(additionalKeys) {
	    const retv = /** @type {{
	        [type: string]: ReadonlyArray<string>
	    }} */ (Object.assign({}, KEYS));

	    for (const type of Object.keys(additionalKeys)) {
	        if (Object.prototype.hasOwnProperty.call(retv, type)) {
	            const keys = new Set(additionalKeys[type]);

	            for (const key of retv[type]) {
	                keys.add(key);
	            }

	            retv[type] = Object.freeze(Array.from(keys));
	        } else {
	            retv[type] = Object.freeze(Array.from(additionalKeys[type]));
	        }
	    }

	    return Object.freeze(retv);
	}

	eslintVisitorKeys.KEYS = KEYS;
	eslintVisitorKeys.getKeys = getKeys;
	eslintVisitorKeys.unionWith = unionWith;
	return eslintVisitorKeys;
}

var hasRequiredEslintUtils;

function requireEslintUtils () {
	if (hasRequiredEslintUtils) return eslintUtils;
	hasRequiredEslintUtils = 1;
	(function (exports) {

		Object.defineProperty(exports, '__esModule', { value: true });

		var eslintVisitorKeys = requireEslintVisitorKeys();

		/**
		 * Get the innermost scope which contains a given location.
		 * @param {Scope} initialScope The initial scope to search.
		 * @param {Node} node The location to search.
		 * @returns {Scope} The innermost scope.
		 */
		function getInnermostScope(initialScope, node) {
		    const location = node.range[0];

		    let scope = initialScope;
		    let found = false;
		    do {
		        found = false;
		        for (const childScope of scope.childScopes) {
		            const range = childScope.block.range;

		            if (range[0] <= location && location < range[1]) {
		                scope = childScope;
		                found = true;
		                break
		            }
		        }
		    } while (found)

		    return scope
		}

		/**
		 * Find the variable of a given name.
		 * @param {Scope} initialScope The scope to start finding.
		 * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.
		 * @returns {Variable|null} The found variable or null.
		 */
		function findVariable(initialScope, nameOrNode) {
		    let name = "";
		    let scope = initialScope;

		    if (typeof nameOrNode === "string") {
		        name = nameOrNode;
		    } else {
		        name = nameOrNode.name;
		        scope = getInnermostScope(scope, nameOrNode);
		    }

		    while (scope != null) {
		        const variable = scope.set.get(name);
		        if (variable != null) {
		            return variable
		        }
		        scope = scope.upper;
		    }

		    return null
		}

		/**
		 * Negate the result of `this` calling.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the result of `this(token)` is `false`.
		 */
		function negate0(token) {
		    return !this(token) //eslint-disable-line no-invalid-this
		}

		/**
		 * Creates the negate function of the given function.
		 * @param {function(Token):boolean} f - The function to negate.
		 * @returns {function(Token):boolean} Negated function.
		 */
		function negate(f) {
		    return negate0.bind(f)
		}

		/**
		 * Checks if the given token is a PunctuatorToken with the given value
		 * @param {Token} token - The token to check.
		 * @param {string} value - The value to check.
		 * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.
		 */
		function isPunctuatorTokenWithValue(token, value) {
		    return token.type === "Punctuator" && token.value === value
		}

		/**
		 * Checks if the given token is an arrow token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is an arrow token.
		 */
		function isArrowToken(token) {
		    return isPunctuatorTokenWithValue(token, "=>")
		}

		/**
		 * Checks if the given token is a comma token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a comma token.
		 */
		function isCommaToken(token) {
		    return isPunctuatorTokenWithValue(token, ",")
		}

		/**
		 * Checks if the given token is a semicolon token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a semicolon token.
		 */
		function isSemicolonToken(token) {
		    return isPunctuatorTokenWithValue(token, ";")
		}

		/**
		 * Checks if the given token is a colon token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a colon token.
		 */
		function isColonToken(token) {
		    return isPunctuatorTokenWithValue(token, ":")
		}

		/**
		 * Checks if the given token is an opening parenthesis token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is an opening parenthesis token.
		 */
		function isOpeningParenToken(token) {
		    return isPunctuatorTokenWithValue(token, "(")
		}

		/**
		 * Checks if the given token is a closing parenthesis token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a closing parenthesis token.
		 */
		function isClosingParenToken(token) {
		    return isPunctuatorTokenWithValue(token, ")")
		}

		/**
		 * Checks if the given token is an opening square bracket token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is an opening square bracket token.
		 */
		function isOpeningBracketToken(token) {
		    return isPunctuatorTokenWithValue(token, "[")
		}

		/**
		 * Checks if the given token is a closing square bracket token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a closing square bracket token.
		 */
		function isClosingBracketToken(token) {
		    return isPunctuatorTokenWithValue(token, "]")
		}

		/**
		 * Checks if the given token is an opening brace token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is an opening brace token.
		 */
		function isOpeningBraceToken(token) {
		    return isPunctuatorTokenWithValue(token, "{")
		}

		/**
		 * Checks if the given token is a closing brace token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a closing brace token.
		 */
		function isClosingBraceToken(token) {
		    return isPunctuatorTokenWithValue(token, "}")
		}

		/**
		 * Checks if the given token is a comment token or not.
		 * @param {Token} token - The token to check.
		 * @returns {boolean} `true` if the token is a comment token.
		 */
		function isCommentToken(token) {
		    return ["Block", "Line", "Shebang"].includes(token.type)
		}

		const isNotArrowToken = negate(isArrowToken);
		const isNotCommaToken = negate(isCommaToken);
		const isNotSemicolonToken = negate(isSemicolonToken);
		const isNotColonToken = negate(isColonToken);
		const isNotOpeningParenToken = negate(isOpeningParenToken);
		const isNotClosingParenToken = negate(isClosingParenToken);
		const isNotOpeningBracketToken = negate(isOpeningBracketToken);
		const isNotClosingBracketToken = negate(isClosingBracketToken);
		const isNotOpeningBraceToken = negate(isOpeningBraceToken);
		const isNotClosingBraceToken = negate(isClosingBraceToken);
		const isNotCommentToken = negate(isCommentToken);

		/**
		 * Get the `(` token of the given function node.
		 * @param {Node} node - The function node to get.
		 * @param {SourceCode} sourceCode - The source code object to get tokens.
		 * @returns {Token} `(` token.
		 */
		function getOpeningParenOfParams(node, sourceCode) {
		    return node.id
		        ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)
		        : sourceCode.getFirstToken(node, isOpeningParenToken)
		}

		/**
		 * Get the location of the given function node for reporting.
		 * @param {Node} node - The function node to get.
		 * @param {SourceCode} sourceCode - The source code object to get tokens.
		 * @returns {string} The location of the function node for reporting.
		 */
		function getFunctionHeadLocation(node, sourceCode) {
		    const parent = node.parent;
		    let start = null;
		    let end = null;

		    if (node.type === "ArrowFunctionExpression") {
		        const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken);

		        start = arrowToken.loc.start;
		        end = arrowToken.loc.end;
		    } else if (
		        parent.type === "Property" ||
		        parent.type === "MethodDefinition" ||
		        parent.type === "PropertyDefinition"
		    ) {
		        start = parent.loc.start;
		        end = getOpeningParenOfParams(node, sourceCode).loc.start;
		    } else {
		        start = node.loc.start;
		        end = getOpeningParenOfParams(node, sourceCode).loc.start;
		    }

		    return {
		        start: { ...start },
		        end: { ...end },
		    }
		}

		/* globals globalThis, global, self, window */

		const globalObject =
		    typeof globalThis !== "undefined"
		        ? globalThis
		        : typeof self !== "undefined"
		        ? self
		        : typeof window !== "undefined"
		        ? window
		        : typeof global$1 !== "undefined"
		        ? global$1
		        : {};

		const builtinNames = Object.freeze(
		    new Set([
		        "Array",
		        "ArrayBuffer",
		        "BigInt",
		        "BigInt64Array",
		        "BigUint64Array",
		        "Boolean",
		        "DataView",
		        "Date",
		        "decodeURI",
		        "decodeURIComponent",
		        "encodeURI",
		        "encodeURIComponent",
		        "escape",
		        "Float32Array",
		        "Float64Array",
		        "Function",
		        "Infinity",
		        "Int16Array",
		        "Int32Array",
		        "Int8Array",
		        "isFinite",
		        "isNaN",
		        "isPrototypeOf",
		        "JSON",
		        "Map",
		        "Math",
		        "NaN",
		        "Number",
		        "Object",
		        "parseFloat",
		        "parseInt",
		        "Promise",
		        "Proxy",
		        "Reflect",
		        "RegExp",
		        "Set",
		        "String",
		        "Symbol",
		        "Uint16Array",
		        "Uint32Array",
		        "Uint8Array",
		        "Uint8ClampedArray",
		        "undefined",
		        "unescape",
		        "WeakMap",
		        "WeakSet",
		    ]),
		);
		const callAllowed = new Set(
		    [
		        Array.isArray,
		        typeof BigInt === "function" ? BigInt : undefined,
		        Boolean,
		        Date,
		        Date.parse,
		        decodeURI,
		        decodeURIComponent,
		        encodeURI,
		        encodeURIComponent,
		        escape,
		        isFinite,
		        isNaN,
		        isPrototypeOf,
		        ...Object.getOwnPropertyNames(Math)
		            .map((k) => Math[k])
		            .filter((f) => typeof f === "function"),
		        Number,
		        Number.isFinite,
		        Number.isNaN,
		        Number.parseFloat,
		        Number.parseInt,
		        Object,
		        Object.entries,
		        Object.is,
		        Object.isExtensible,
		        Object.isFrozen,
		        Object.isSealed,
		        Object.keys,
		        Object.values,
		        parseFloat,
		        parseInt,
		        RegExp,
		        String,
		        String.fromCharCode,
		        String.fromCodePoint,
		        String.raw,
		        Symbol.for,
		        Symbol.keyFor,
		        unescape,
		    ].filter((f) => typeof f === "function"),
		);
		const callPassThrough = new Set([
		    Object.freeze,
		    Object.preventExtensions,
		    Object.seal,
		]);

		/**
		 * Get the property descriptor.
		 * @param {object} object The object to get.
		 * @param {string|number|symbol} name The property name to get.
		 */
		function getPropertyDescriptor(object, name) {
		    let x = object;
		    while ((typeof x === "object" || typeof x === "function") && x !== null) {
		        const d = Object.getOwnPropertyDescriptor(x, name);
		        if (d) {
		            return d
		        }
		        x = Object.getPrototypeOf(x);
		    }
		    return null
		}

		/**
		 * Check if a property is getter or not.
		 * @param {object} object The object to check.
		 * @param {string|number|symbol} name The property name to check.
		 */
		function isGetter(object, name) {
		    const d = getPropertyDescriptor(object, name);
		    return d != null && d.get != null
		}

		/**
		 * Get the element values of a given node list.
		 * @param {Node[]} nodeList The node list to get values.
		 * @param {Scope|undefined} initialScope The initial scope to find variables.
		 * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.
		 */
		function getElementValues(nodeList, initialScope) {
		    const valueList = [];

		    for (let i = 0; i < nodeList.length; ++i) {
		        const elementNode = nodeList[i];

		        if (elementNode == null) {
		            valueList.length = i + 1;
		        } else if (elementNode.type === "SpreadElement") {
		            const argument = getStaticValueR(elementNode.argument, initialScope);
		            if (argument == null) {
		                return null
		            }
		            valueList.push(...argument.value);
		        } else {
		            const element = getStaticValueR(elementNode, initialScope);
		            if (element == null) {
		                return null
		            }
		            valueList.push(element.value);
		        }
		    }

		    return valueList
		}

		const operations = Object.freeze({
		    ArrayExpression(node, initialScope) {
		        const elements = getElementValues(node.elements, initialScope);
		        return elements != null ? { value: elements } : null
		    },

		    AssignmentExpression(node, initialScope) {
		        if (node.operator === "=") {
		            return getStaticValueR(node.right, initialScope)
		        }
		        return null
		    },

		    //eslint-disable-next-line complexity
		    BinaryExpression(node, initialScope) {
		        if (node.operator === "in" || node.operator === "instanceof") {
		            // Not supported.
		            return null
		        }

		        const left = getStaticValueR(node.left, initialScope);
		        const right = getStaticValueR(node.right, initialScope);
		        if (left != null && right != null) {
		            switch (node.operator) {
		                case "==":
		                    return { value: left.value == right.value } //eslint-disable-line eqeqeq
		                case "!=":
		                    return { value: left.value != right.value } //eslint-disable-line eqeqeq
		                case "===":
		                    return { value: left.value === right.value }
		                case "!==":
		                    return { value: left.value !== right.value }
		                case "<":
		                    return { value: left.value < right.value }
		                case "<=":
		                    return { value: left.value <= right.value }
		                case ">":
		                    return { value: left.value > right.value }
		                case ">=":
		                    return { value: left.value >= right.value }
		                case "<<":
		                    return { value: left.value << right.value }
		                case ">>":
		                    return { value: left.value >> right.value }
		                case ">>>":
		                    return { value: left.value >>> right.value }
		                case "+":
		                    return { value: left.value + right.value }
		                case "-":
		                    return { value: left.value - right.value }
		                case "*":
		                    return { value: left.value * right.value }
		                case "/":
		                    return { value: left.value / right.value }
		                case "%":
		                    return { value: left.value % right.value }
		                case "**":
		                    return { value: left.value ** right.value }
		                case "|":
		                    return { value: left.value | right.value }
		                case "^":
		                    return { value: left.value ^ right.value }
		                case "&":
		                    return { value: left.value & right.value }

		                // no default
		            }
		        }

		        return null
		    },

		    CallExpression(node, initialScope) {
		        const calleeNode = node.callee;
		        const args = getElementValues(node.arguments, initialScope);

		        if (args != null) {
		            if (calleeNode.type === "MemberExpression") {
		                if (calleeNode.property.type === "PrivateIdentifier") {
		                    return null
		                }
		                const object = getStaticValueR(calleeNode.object, initialScope);
		                if (object != null) {
		                    if (
		                        object.value == null &&
		                        (object.optional || node.optional)
		                    ) {
		                        return { value: undefined, optional: true }
		                    }
		                    const property = getStaticPropertyNameValue(
		                        calleeNode,
		                        initialScope,
		                    );

		                    if (property != null) {
		                        const receiver = object.value;
		                        const methodName = property.value;
		                        if (callAllowed.has(receiver[methodName])) {
		                            return { value: receiver[methodName](...args) }
		                        }
		                        if (callPassThrough.has(receiver[methodName])) {
		                            return { value: args[0] }
		                        }
		                    }
		                }
		            } else {
		                const callee = getStaticValueR(calleeNode, initialScope);
		                if (callee != null) {
		                    if (callee.value == null && node.optional) {
		                        return { value: undefined, optional: true }
		                    }
		                    const func = callee.value;
		                    if (callAllowed.has(func)) {
		                        return { value: func(...args) }
		                    }
		                    if (callPassThrough.has(func)) {
		                        return { value: args[0] }
		                    }
		                }
		            }
		        }

		        return null
		    },

		    ConditionalExpression(node, initialScope) {
		        const test = getStaticValueR(node.test, initialScope);
		        if (test != null) {
		            return test.value
		                ? getStaticValueR(node.consequent, initialScope)
		                : getStaticValueR(node.alternate, initialScope)
		        }
		        return null
		    },

		    ExpressionStatement(node, initialScope) {
		        return getStaticValueR(node.expression, initialScope)
		    },

		    Identifier(node, initialScope) {
		        if (initialScope != null) {
		            const variable = findVariable(initialScope, node);

		            // Built-in globals.
		            if (
		                variable != null &&
		                variable.defs.length === 0 &&
		                builtinNames.has(variable.name) &&
		                variable.name in globalObject
		            ) {
		                return { value: globalObject[variable.name] }
		            }

		            // Constants.
		            if (variable != null && variable.defs.length === 1) {
		                const def = variable.defs[0];
		                if (
		                    def.parent &&
		                    def.parent.kind === "const" &&
		                    // TODO(mysticatea): don't support destructuring here.
		                    def.node.id.type === "Identifier"
		                ) {
		                    return getStaticValueR(def.node.init, initialScope)
		                }
		            }
		        }
		        return null
		    },

		    Literal(node) {
		        //istanbul ignore if : this is implementation-specific behavior.
		        if ((node.regex != null || node.bigint != null) && node.value == null) {
		            // It was a RegExp/BigInt literal, but Node.js didn't support it.
		            return null
		        }
		        return { value: node.value }
		    },

		    LogicalExpression(node, initialScope) {
		        const left = getStaticValueR(node.left, initialScope);
		        if (left != null) {
		            if (
		                (node.operator === "||" && Boolean(left.value) === true) ||
		                (node.operator === "&&" && Boolean(left.value) === false) ||
		                (node.operator === "??" && left.value != null)
		            ) {
		                return left
		            }

		            const right = getStaticValueR(node.right, initialScope);
		            if (right != null) {
		                return right
		            }
		        }

		        return null
		    },

		    MemberExpression(node, initialScope) {
		        if (node.property.type === "PrivateIdentifier") {
		            return null
		        }
		        const object = getStaticValueR(node.object, initialScope);
		        if (object != null) {
		            if (object.value == null && (object.optional || node.optional)) {
		                return { value: undefined, optional: true }
		            }
		            const property = getStaticPropertyNameValue(node, initialScope);

		            if (property != null && !isGetter(object.value, property.value)) {
		                return { value: object.value[property.value] }
		            }
		        }
		        return null
		    },

		    ChainExpression(node, initialScope) {
		        const expression = getStaticValueR(node.expression, initialScope);
		        if (expression != null) {
		            return { value: expression.value }
		        }
		        return null
		    },

		    NewExpression(node, initialScope) {
		        const callee = getStaticValueR(node.callee, initialScope);
		        const args = getElementValues(node.arguments, initialScope);

		        if (callee != null && args != null) {
		            const Func = callee.value;
		            if (callAllowed.has(Func)) {
		                return { value: new Func(...args) }
		            }
		        }

		        return null
		    },

		    ObjectExpression(node, initialScope) {
		        const object = {};

		        for (const propertyNode of node.properties) {
		            if (propertyNode.type === "Property") {
		                if (propertyNode.kind !== "init") {
		                    return null
		                }
		                const key = getStaticPropertyNameValue(
		                    propertyNode,
		                    initialScope,
		                );
		                const value = getStaticValueR(propertyNode.value, initialScope);
		                if (key == null || value == null) {
		                    return null
		                }
		                object[key.value] = value.value;
		            } else if (
		                propertyNode.type === "SpreadElement" ||
		                propertyNode.type === "ExperimentalSpreadProperty"
		            ) {
		                const argument = getStaticValueR(
		                    propertyNode.argument,
		                    initialScope,
		                );
		                if (argument == null) {
		                    return null
		                }
		                Object.assign(object, argument.value);
		            } else {
		                return null
		            }
		        }

		        return { value: object }
		    },

		    SequenceExpression(node, initialScope) {
		        const last = node.expressions[node.expressions.length - 1];
		        return getStaticValueR(last, initialScope)
		    },

		    TaggedTemplateExpression(node, initialScope) {
		        const tag = getStaticValueR(node.tag, initialScope);
		        const expressions = getElementValues(
		            node.quasi.expressions,
		            initialScope,
		        );

		        if (tag != null && expressions != null) {
		            const func = tag.value;
		            const strings = node.quasi.quasis.map((q) => q.value.cooked);
		            strings.raw = node.quasi.quasis.map((q) => q.value.raw);

		            if (func === String.raw) {
		                return { value: func(strings, ...expressions) }
		            }
		        }

		        return null
		    },

		    TemplateLiteral(node, initialScope) {
		        const expressions = getElementValues(node.expressions, initialScope);
		        if (expressions != null) {
		            let value = node.quasis[0].value.cooked;
		            for (let i = 0; i < expressions.length; ++i) {
		                value += expressions[i];
		                value += node.quasis[i + 1].value.cooked;
		            }
		            return { value }
		        }
		        return null
		    },

		    UnaryExpression(node, initialScope) {
		        if (node.operator === "delete") {
		            // Not supported.
		            return null
		        }
		        if (node.operator === "void") {
		            return { value: undefined }
		        }

		        const arg = getStaticValueR(node.argument, initialScope);
		        if (arg != null) {
		            switch (node.operator) {
		                case "-":
		                    return { value: -arg.value }
		                case "+":
		                    return { value: +arg.value } //eslint-disable-line no-implicit-coercion
		                case "!":
		                    return { value: !arg.value }
		                case "~":
		                    return { value: ~arg.value }
		                case "typeof":
		                    return { value: typeof arg.value }

		                // no default
		            }
		        }

		        return null
		    },
		});

		/**
		 * Get the value of a given node if it's a static value.
		 * @param {Node} node The node to get.
		 * @param {Scope|undefined} initialScope The scope to start finding variable.
		 * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.
		 */
		function getStaticValueR(node, initialScope) {
		    if (node != null && Object.hasOwnProperty.call(operations, node.type)) {
		        return operations[node.type](node, initialScope)
		    }
		    return null
		}

		/**
		 * Get the static value of property name from a MemberExpression node or a Property node.
		 * @param {Node} node The node to get.
		 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
		 * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.
		 */
		function getStaticPropertyNameValue(node, initialScope) {
		    const nameNode = node.type === "Property" ? node.key : node.property;

		    if (node.computed) {
		        return getStaticValueR(nameNode, initialScope)
		    }

		    if (nameNode.type === "Identifier") {
		        return { value: nameNode.name }
		    }

		    if (nameNode.type === "Literal") {
		        if (nameNode.bigint) {
		            return { value: nameNode.bigint }
		        }
		        return { value: String(nameNode.value) }
		    }

		    return null
		}

		/**
		 * Get the value of a given node if it's a static value.
		 * @param {Node} node The node to get.
		 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.
		 * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.
		 */
		function getStaticValue(node, initialScope = null) {
		    try {
		        return getStaticValueR(node, initialScope)
		    } catch (_error) {
		        return null
		    }
		}

		/**
		 * Get the value of a given node if it's a literal or a template literal.
		 * @param {Node} node The node to get.
		 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.
		 * @returns {string|null} The value of the node, or `null`.
		 */
		function getStringIfConstant(node, initialScope = null) {
		    // Handle the literals that the platform doesn't support natively.
		    if (node && node.type === "Literal" && node.value === null) {
		        if (node.regex) {
		            return `/${node.regex.pattern}/${node.regex.flags}`
		        }
		        if (node.bigint) {
		            return node.bigint
		        }
		    }

		    const evaluated = getStaticValue(node, initialScope);
		    return evaluated && String(evaluated.value)
		}

		/**
		 * Get the property name from a MemberExpression node or a Property node.
		 * @param {Node} node The node to get.
		 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
		 * @returns {string|null} The property name of the node.
		 */
		function getPropertyName(node, initialScope) {
		    switch (node.type) {
		        case "MemberExpression":
		            if (node.computed) {
		                return getStringIfConstant(node.property, initialScope)
		            }
		            if (node.property.type === "PrivateIdentifier") {
		                return null
		            }
		            return node.property.name

		        case "Property":
		        case "MethodDefinition":
		        case "PropertyDefinition":
		            if (node.computed) {
		                return getStringIfConstant(node.key, initialScope)
		            }
		            if (node.key.type === "Literal") {
		                return String(node.key.value)
		            }
		            if (node.key.type === "PrivateIdentifier") {
		                return null
		            }
		            return node.key.name

		        // no default
		    }

		    return null
		}

		/**
		 * Get the name and kind of the given function node.
		 * @param {ASTNode} node - The function node to get.
		 * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
		 * @returns {string} The name and kind of the function node.
		 */
		// eslint-disable-next-line complexity
		function getFunctionNameWithKind(node, sourceCode) {
		    const parent = node.parent;
		    const tokens = [];
		    const isObjectMethod = parent.type === "Property" && parent.value === node;
		    const isClassMethod =
		        parent.type === "MethodDefinition" && parent.value === node;
		    const isClassFieldMethod =
		        parent.type === "PropertyDefinition" && parent.value === node;

		    // Modifiers.
		    if (isClassMethod || isClassFieldMethod) {
		        if (parent.static) {
		            tokens.push("static");
		        }
		        if (parent.key.type === "PrivateIdentifier") {
		            tokens.push("private");
		        }
		    }
		    if (node.async) {
		        tokens.push("async");
		    }
		    if (node.generator) {
		        tokens.push("generator");
		    }

		    // Kinds.
		    if (isObjectMethod || isClassMethod) {
		        if (parent.kind === "constructor") {
		            return "constructor"
		        }
		        if (parent.kind === "get") {
		            tokens.push("getter");
		        } else if (parent.kind === "set") {
		            tokens.push("setter");
		        } else {
		            tokens.push("method");
		        }
		    } else if (isClassFieldMethod) {
		        tokens.push("method");
		    } else {
		        if (node.type === "ArrowFunctionExpression") {
		            tokens.push("arrow");
		        }
		        tokens.push("function");
		    }

		    // Names.
		    if (isObjectMethod || isClassMethod || isClassFieldMethod) {
		        if (parent.key.type === "PrivateIdentifier") {
		            tokens.push(`#${parent.key.name}`);
		        } else {
		            const name = getPropertyName(parent);
		            if (name) {
		                tokens.push(`'${name}'`);
		            } else if (sourceCode) {
		                const keyText = sourceCode.getText(parent.key);
		                if (!keyText.includes("\n")) {
		                    tokens.push(`[${keyText}]`);
		                }
		            }
		        }
		    } else if (node.id) {
		        tokens.push(`'${node.id.name}'`);
		    } else if (
		        parent.type === "VariableDeclarator" &&
		        parent.id &&
		        parent.id.type === "Identifier"
		    ) {
		        tokens.push(`'${parent.id.name}'`);
		    } else if (
		        (parent.type === "AssignmentExpression" ||
		            parent.type === "AssignmentPattern") &&
		        parent.left &&
		        parent.left.type === "Identifier"
		    ) {
		        tokens.push(`'${parent.left.name}'`);
		    } else if (
		        parent.type === "ExportDefaultDeclaration" &&
		        parent.declaration === node
		    ) {
		        tokens.push("'default'");
		    }

		    return tokens.join(" ")
		}

		const typeConversionBinaryOps = Object.freeze(
		    new Set([
		        "==",
		        "!=",
		        "<",
		        "<=",
		        ">",
		        ">=",
		        "<<",
		        ">>",
		        ">>>",
		        "+",
		        "-",
		        "*",
		        "/",
		        "%",
		        "|",
		        "^",
		        "&",
		        "in",
		    ]),
		);
		const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));

		/**
		 * Check whether the given value is an ASTNode or not.
		 * @param {any} x The value to check.
		 * @returns {boolean} `true` if the value is an ASTNode.
		 */
		function isNode(x) {
		    return x !== null && typeof x === "object" && typeof x.type === "string"
		}

		const visitor = Object.freeze(
		    Object.assign(Object.create(null), {
		        $visit(node, options, visitorKeys) {
		            const { type } = node;

		            if (typeof this[type] === "function") {
		                return this[type](node, options, visitorKeys)
		            }

		            return this.$visitChildren(node, options, visitorKeys)
		        },

		        $visitChildren(node, options, visitorKeys) {
		            const { type } = node;

		            for (const key of visitorKeys[type] || eslintVisitorKeys.getKeys(node)) {
		                const value = node[key];

		                if (Array.isArray(value)) {
		                    for (const element of value) {
		                        if (
		                            isNode(element) &&
		                            this.$visit(element, options, visitorKeys)
		                        ) {
		                            return true
		                        }
		                    }
		                } else if (
		                    isNode(value) &&
		                    this.$visit(value, options, visitorKeys)
		                ) {
		                    return true
		                }
		            }

		            return false
		        },

		        ArrowFunctionExpression() {
		            return false
		        },
		        AssignmentExpression() {
		            return true
		        },
		        AwaitExpression() {
		            return true
		        },
		        BinaryExpression(node, options, visitorKeys) {
		            if (
		                options.considerImplicitTypeConversion &&
		                typeConversionBinaryOps.has(node.operator) &&
		                (node.left.type !== "Literal" || node.right.type !== "Literal")
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        CallExpression() {
		            return true
		        },
		        FunctionExpression() {
		            return false
		        },
		        ImportExpression() {
		            return true
		        },
		        MemberExpression(node, options, visitorKeys) {
		            if (options.considerGetters) {
		                return true
		            }
		            if (
		                options.considerImplicitTypeConversion &&
		                node.computed &&
		                node.property.type !== "Literal"
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        MethodDefinition(node, options, visitorKeys) {
		            if (
		                options.considerImplicitTypeConversion &&
		                node.computed &&
		                node.key.type !== "Literal"
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        NewExpression() {
		            return true
		        },
		        Property(node, options, visitorKeys) {
		            if (
		                options.considerImplicitTypeConversion &&
		                node.computed &&
		                node.key.type !== "Literal"
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        PropertyDefinition(node, options, visitorKeys) {
		            if (
		                options.considerImplicitTypeConversion &&
		                node.computed &&
		                node.key.type !== "Literal"
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        UnaryExpression(node, options, visitorKeys) {
		            if (node.operator === "delete") {
		                return true
		            }
		            if (
		                options.considerImplicitTypeConversion &&
		                typeConversionUnaryOps.has(node.operator) &&
		                node.argument.type !== "Literal"
		            ) {
		                return true
		            }
		            return this.$visitChildren(node, options, visitorKeys)
		        },
		        UpdateExpression() {
		            return true
		        },
		        YieldExpression() {
		            return true
		        },
		    }),
		);

		/**
		 * Check whether a given node has any side effect or not.
		 * @param {Node} node The node to get.
		 * @param {SourceCode} sourceCode The source code object.
		 * @param {object} [options] The option object.
		 * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.
		 * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.
		 * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.
		 * @returns {boolean} `true` if the node has a certain side effect.
		 */
		function hasSideEffect(
		    node,
		    sourceCode,
		    { considerGetters = false, considerImplicitTypeConversion = false } = {},
		) {
		    return visitor.$visit(
		        node,
		        { considerGetters, considerImplicitTypeConversion },
		        sourceCode.visitorKeys || eslintVisitorKeys.KEYS,
		    )
		}

		/**
		 * Get the left parenthesis of the parent node syntax if it exists.
		 * E.g., `if (a) {}` then the `(`.
		 * @param {Node} node The AST node to check.
		 * @param {SourceCode} sourceCode The source code object to get tokens.
		 * @returns {Token|null} The left parenthesis of the parent node syntax
		 */
		function getParentSyntaxParen(node, sourceCode) {
		    const parent = node.parent;

		    switch (parent.type) {
		        case "CallExpression":
		        case "NewExpression":
		            if (parent.arguments.length === 1 && parent.arguments[0] === node) {
		                return sourceCode.getTokenAfter(
		                    parent.callee,
		                    isOpeningParenToken,
		                )
		            }
		            return null

		        case "DoWhileStatement":
		            if (parent.test === node) {
		                return sourceCode.getTokenAfter(
		                    parent.body,
		                    isOpeningParenToken,
		                )
		            }
		            return null

		        case "IfStatement":
		        case "WhileStatement":
		            if (parent.test === node) {
		                return sourceCode.getFirstToken(parent, 1)
		            }
		            return null

		        case "ImportExpression":
		            if (parent.source === node) {
		                return sourceCode.getFirstToken(parent, 1)
		            }
		            return null

		        case "SwitchStatement":
		            if (parent.discriminant === node) {
		                return sourceCode.getFirstToken(parent, 1)
		            }
		            return null

		        case "WithStatement":
		            if (parent.object === node) {
		                return sourceCode.getFirstToken(parent, 1)
		            }
		            return null

		        default:
		            return null
		    }
		}

		/**
		 * Check whether a given node is parenthesized or not.
		 * @param {number} times The number of parantheses.
		 * @param {Node} node The AST node to check.
		 * @param {SourceCode} sourceCode The source code object to get tokens.
		 * @returns {boolean} `true` if the node is parenthesized the given times.
		 */
		/**
		 * Check whether a given node is parenthesized or not.
		 * @param {Node} node The AST node to check.
		 * @param {SourceCode} sourceCode The source code object to get tokens.
		 * @returns {boolean} `true` if the node is parenthesized.
		 */
		function isParenthesized(
		    timesOrNode,
		    nodeOrSourceCode,
		    optionalSourceCode,
		) {
		    let times, node, sourceCode, maybeLeftParen, maybeRightParen;
		    if (typeof timesOrNode === "number") {
		        times = timesOrNode | 0;
		        node = nodeOrSourceCode;
		        sourceCode = optionalSourceCode;
		        if (!(times >= 1)) {
		            throw new TypeError("'times' should be a positive integer.")
		        }
		    } else {
		        times = 1;
		        node = timesOrNode;
		        sourceCode = nodeOrSourceCode;
		    }

		    if (
		        node == null ||
		        // `Program` can't be parenthesized
		        node.parent == null ||
		        // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
		        (node.parent.type === "CatchClause" && node.parent.param === node)
		    ) {
		        return false
		    }

		    maybeLeftParen = maybeRightParen = node;
		    do {
		        maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen);
		        maybeRightParen = sourceCode.getTokenAfter(maybeRightParen);
		    } while (
		        maybeLeftParen != null &&
		        maybeRightParen != null &&
		        isOpeningParenToken(maybeLeftParen) &&
		        isClosingParenToken(maybeRightParen) &&
		        // Avoid false positive such as `if (a) {}`
		        maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&
		        --times > 0
		    )

		    return times === 0
		}

		/**
		 * @author Toru Nagashima <https://github.com/mysticatea>
		 * See LICENSE file in root directory for full license.
		 */

		const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu;

		/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */
		const internal = new WeakMap();

		/**
		 * Check whether a given character is escaped or not.
		 * @param {string} str The string to check.
		 * @param {number} index The location of the character to check.
		 * @returns {boolean} `true` if the character is escaped.
		 */
		function isEscaped(str, index) {
		    let escaped = false;
		    for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {
		        escaped = !escaped;
		    }
		    return escaped
		}

		/**
		 * Replace a given string by a given matcher.
		 * @param {PatternMatcher} matcher The pattern matcher.
		 * @param {string} str The string to be replaced.
		 * @param {string} replacement The new substring to replace each matched part.
		 * @returns {string} The replaced string.
		 */
		function replaceS(matcher, str, replacement) {
		    const chunks = [];
		    let index = 0;

		    /** @type {RegExpExecArray} */
		    let match = null;

		    /**
		     * @param {string} key The placeholder.
		     * @returns {string} The replaced string.
		     */
		    function replacer(key) {
		        switch (key) {
		            case "$$":
		                return "$"
		            case "$&":
		                return match[0]
		            case "$`":
		                return str.slice(0, match.index)
		            case "$'":
		                return str.slice(match.index + match[0].length)
		            default: {
		                const i = key.slice(1);
		                if (i in match) {
		                    return match[i]
		                }
		                return key
		            }
		        }
		    }

		    for (match of matcher.execAll(str)) {
		        chunks.push(str.slice(index, match.index));
		        chunks.push(replacement.replace(placeholder, replacer));
		        index = match.index + match[0].length;
		    }
		    chunks.push(str.slice(index));

		    return chunks.join("")
		}

		/**
		 * Replace a given string by a given matcher.
		 * @param {PatternMatcher} matcher The pattern matcher.
		 * @param {string} str The string to be replaced.
		 * @param {(...strs[])=>string} replace The function to replace each matched part.
		 * @returns {string} The replaced string.
		 */
		function replaceF(matcher, str, replace) {
		    const chunks = [];
		    let index = 0;

		    for (const match of matcher.execAll(str)) {
		        chunks.push(str.slice(index, match.index));
		        chunks.push(String(replace(...match, match.index, match.input)));
		        index = match.index + match[0].length;
		    }
		    chunks.push(str.slice(index));

		    return chunks.join("")
		}

		/**
		 * The class to find patterns as considering escape sequences.
		 */
		class PatternMatcher {
		    /**
		     * Initialize this matcher.
		     * @param {RegExp} pattern The pattern to match.
		     * @param {{escaped:boolean}} options The options.
		     */
		    constructor(pattern, { escaped = false } = {}) {
		        if (!(pattern instanceof RegExp)) {
		            throw new TypeError("'pattern' should be a RegExp instance.")
		        }
		        if (!pattern.flags.includes("g")) {
		            throw new Error("'pattern' should contains 'g' flag.")
		        }

		        internal.set(this, {
		            pattern: new RegExp(pattern.source, pattern.flags),
		            escaped: Boolean(escaped),
		        });
		    }

		    /**
		     * Find the pattern in a given string.
		     * @param {string} str The string to find.
		     * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.
		     */
		    *execAll(str) {
		        const { pattern, escaped } = internal.get(this);
		        let match = null;
		        let lastIndex = 0;

		        pattern.lastIndex = 0;
		        while ((match = pattern.exec(str)) != null) {
		            if (escaped || !isEscaped(str, match.index)) {
		                lastIndex = pattern.lastIndex;
		                yield match;
		                pattern.lastIndex = lastIndex;
		            }
		        }
		    }

		    /**
		     * Check whether the pattern is found in a given string.
		     * @param {string} str The string to check.
		     * @returns {boolean} `true` if the pattern was found in the string.
		     */
		    test(str) {
		        const it = this.execAll(str);
		        const ret = it.next();
		        return !ret.done
		    }

		    /**
		     * Replace a given string.
		     * @param {string} str The string to be replaced.
		     * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.
		     * @returns {string} The replaced string.
		     */
		    [Symbol.replace](str, replacer) {
		        return typeof replacer === "function"
		            ? replaceF(this, String(str), replacer)
		            : replaceS(this, String(str), String(replacer))
		    }
		}

		const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u;
		const has = Function.call.bind(Object.hasOwnProperty);

		const READ = Symbol("read");
		const CALL = Symbol("call");
		const CONSTRUCT = Symbol("construct");
		const ESM = Symbol("esm");

		const requireCall = { require: { [CALL]: true } };

		/**
		 * Check whether a given variable is modified or not.
		 * @param {Variable} variable The variable to check.
		 * @returns {boolean} `true` if the variable is modified.
		 */
		function isModifiedGlobal(variable) {
		    return (
		        variable == null ||
		        variable.defs.length !== 0 ||
		        variable.references.some((r) => r.isWrite())
		    )
		}

		/**
		 * Check if the value of a given node is passed through to the parent syntax as-is.
		 * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.
		 * @param {Node} node A node to check.
		 * @returns {boolean} `true` if the node is passed through.
		 */
		function isPassThrough(node) {
		    const parent = node.parent;

		    switch (parent && parent.type) {
		        case "ConditionalExpression":
		            return parent.consequent === node || parent.alternate === node
		        case "LogicalExpression":
		            return true
		        case "SequenceExpression":
		            return parent.expressions[parent.expressions.length - 1] === node
		        case "ChainExpression":
		            return true

		        default:
		            return false
		    }
		}

		/**
		 * The reference tracker.
		 */
		class ReferenceTracker {
		    /**
		     * Initialize this tracker.
		     * @param {Scope} globalScope The global scope.
		     * @param {object} [options] The options.
		     * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules.
		     * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object.
		     */
		    constructor(
		        globalScope,
		        {
		            mode = "strict",
		            globalObjectNames = ["global", "globalThis", "self", "window"],
		        } = {},
		    ) {
		        this.variableStack = [];
		        this.globalScope = globalScope;
		        this.mode = mode;
		        this.globalObjectNames = globalObjectNames.slice(0);
		    }

		    /**
		     * Iterate the references of global variables.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *iterateGlobalReferences(traceMap) {
		        for (const key of Object.keys(traceMap)) {
		            const nextTraceMap = traceMap[key];
		            const path = [key];
		            const variable = this.globalScope.set.get(key);

		            if (isModifiedGlobal(variable)) {
		                continue
		            }

		            yield* this._iterateVariableReferences(
		                variable,
		                path,
		                nextTraceMap,
		                true,
		            );
		        }

		        for (const key of this.globalObjectNames) {
		            const path = [];
		            const variable = this.globalScope.set.get(key);

		            if (isModifiedGlobal(variable)) {
		                continue
		            }

		            yield* this._iterateVariableReferences(
		                variable,
		                path,
		                traceMap,
		                false,
		            );
		        }
		    }

		    /**
		     * Iterate the references of CommonJS modules.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *iterateCjsReferences(traceMap) {
		        for (const { node } of this.iterateGlobalReferences(requireCall)) {
		            const key = getStringIfConstant(node.arguments[0]);
		            if (key == null || !has(traceMap, key)) {
		                continue
		            }

		            const nextTraceMap = traceMap[key];
		            const path = [key];

		            if (nextTraceMap[READ]) {
		                yield {
		                    node,
		                    path,
		                    type: READ,
		                    info: nextTraceMap[READ],
		                };
		            }
		            yield* this._iteratePropertyReferences(node, path, nextTraceMap);
		        }
		    }

		    /**
		     * Iterate the references of ES modules.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *iterateEsmReferences(traceMap) {
		        const programNode = this.globalScope.block;

		        for (const node of programNode.body) {
		            if (!IMPORT_TYPE.test(node.type) || node.source == null) {
		                continue
		            }
		            const moduleId = node.source.value;

		            if (!has(traceMap, moduleId)) {
		                continue
		            }
		            const nextTraceMap = traceMap[moduleId];
		            const path = [moduleId];

		            if (nextTraceMap[READ]) {
		                yield { node, path, type: READ, info: nextTraceMap[READ] };
		            }

		            if (node.type === "ExportAllDeclaration") {
		                for (const key of Object.keys(nextTraceMap)) {
		                    const exportTraceMap = nextTraceMap[key];
		                    if (exportTraceMap[READ]) {
		                        yield {
		                            node,
		                            path: path.concat(key),
		                            type: READ,
		                            info: exportTraceMap[READ],
		                        };
		                    }
		                }
		            } else {
		                for (const specifier of node.specifiers) {
		                    const esm = has(nextTraceMap, ESM);
		                    const it = this._iterateImportReferences(
		                        specifier,
		                        path,
		                        esm
		                            ? nextTraceMap
		                            : this.mode === "legacy"
		                            ? { default: nextTraceMap, ...nextTraceMap }
		                            : { default: nextTraceMap },
		                    );

		                    if (esm) {
		                        yield* it;
		                    } else {
		                        for (const report of it) {
		                            report.path = report.path.filter(exceptDefault);
		                            if (
		                                report.path.length >= 2 ||
		                                report.type !== READ
		                            ) {
		                                yield report;
		                            }
		                        }
		                    }
		                }
		            }
		        }
		    }

		    /**
		     * Iterate the references for a given variable.
		     * @param {Variable} variable The variable to iterate that references.
		     * @param {string[]} path The current path.
		     * @param {object} traceMap The trace map.
		     * @param {boolean} shouldReport = The flag to report those references.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *_iterateVariableReferences(variable, path, traceMap, shouldReport) {
		        if (this.variableStack.includes(variable)) {
		            return
		        }
		        this.variableStack.push(variable);
		        try {
		            for (const reference of variable.references) {
		                if (!reference.isRead()) {
		                    continue
		                }
		                const node = reference.identifier;

		                if (shouldReport && traceMap[READ]) {
		                    yield { node, path, type: READ, info: traceMap[READ] };
		                }
		                yield* this._iteratePropertyReferences(node, path, traceMap);
		            }
		        } finally {
		            this.variableStack.pop();
		        }
		    }

		    /**
		     * Iterate the references for a given AST node.
		     * @param rootNode The AST node to iterate references.
		     * @param {string[]} path The current path.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    //eslint-disable-next-line complexity
		    *_iteratePropertyReferences(rootNode, path, traceMap) {
		        let node = rootNode;
		        while (isPassThrough(node)) {
		            node = node.parent;
		        }

		        const parent = node.parent;
		        if (parent.type === "MemberExpression") {
		            if (parent.object === node) {
		                const key = getPropertyName(parent);
		                if (key == null || !has(traceMap, key)) {
		                    return
		                }

		                path = path.concat(key); //eslint-disable-line no-param-reassign
		                const nextTraceMap = traceMap[key];
		                if (nextTraceMap[READ]) {
		                    yield {
		                        node: parent,
		                        path,
		                        type: READ,
		                        info: nextTraceMap[READ],
		                    };
		                }
		                yield* this._iteratePropertyReferences(
		                    parent,
		                    path,
		                    nextTraceMap,
		                );
		            }
		            return
		        }
		        if (parent.type === "CallExpression") {
		            if (parent.callee === node && traceMap[CALL]) {
		                yield { node: parent, path, type: CALL, info: traceMap[CALL] };
		            }
		            return
		        }
		        if (parent.type === "NewExpression") {
		            if (parent.callee === node && traceMap[CONSTRUCT]) {
		                yield {
		                    node: parent,
		                    path,
		                    type: CONSTRUCT,
		                    info: traceMap[CONSTRUCT],
		                };
		            }
		            return
		        }
		        if (parent.type === "AssignmentExpression") {
		            if (parent.right === node) {
		                yield* this._iterateLhsReferences(parent.left, path, traceMap);
		                yield* this._iteratePropertyReferences(parent, path, traceMap);
		            }
		            return
		        }
		        if (parent.type === "AssignmentPattern") {
		            if (parent.right === node) {
		                yield* this._iterateLhsReferences(parent.left, path, traceMap);
		            }
		            return
		        }
		        if (parent.type === "VariableDeclarator") {
		            if (parent.init === node) {
		                yield* this._iterateLhsReferences(parent.id, path, traceMap);
		            }
		        }
		    }

		    /**
		     * Iterate the references for a given Pattern node.
		     * @param {Node} patternNode The Pattern node to iterate references.
		     * @param {string[]} path The current path.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *_iterateLhsReferences(patternNode, path, traceMap) {
		        if (patternNode.type === "Identifier") {
		            const variable = findVariable(this.globalScope, patternNode);
		            if (variable != null) {
		                yield* this._iterateVariableReferences(
		                    variable,
		                    path,
		                    traceMap,
		                    false,
		                );
		            }
		            return
		        }
		        if (patternNode.type === "ObjectPattern") {
		            for (const property of patternNode.properties) {
		                const key = getPropertyName(property);

		                if (key == null || !has(traceMap, key)) {
		                    continue
		                }

		                const nextPath = path.concat(key);
		                const nextTraceMap = traceMap[key];
		                if (nextTraceMap[READ]) {
		                    yield {
		                        node: property,
		                        path: nextPath,
		                        type: READ,
		                        info: nextTraceMap[READ],
		                    };
		                }
		                yield* this._iterateLhsReferences(
		                    property.value,
		                    nextPath,
		                    nextTraceMap,
		                );
		            }
		            return
		        }
		        if (patternNode.type === "AssignmentPattern") {
		            yield* this._iterateLhsReferences(patternNode.left, path, traceMap);
		        }
		    }

		    /**
		     * Iterate the references for a given ModuleSpecifier node.
		     * @param {Node} specifierNode The ModuleSpecifier node to iterate references.
		     * @param {string[]} path The current path.
		     * @param {object} traceMap The trace map.
		     * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.
		     */
		    *_iterateImportReferences(specifierNode, path, traceMap) {
		        const type = specifierNode.type;

		        if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") {
		            const key =
		                type === "ImportDefaultSpecifier"
		                    ? "default"
		                    : specifierNode.imported.name;
		            if (!has(traceMap, key)) {
		                return
		            }

		            path = path.concat(key); //eslint-disable-line no-param-reassign
		            const nextTraceMap = traceMap[key];
		            if (nextTraceMap[READ]) {
		                yield {
		                    node: specifierNode,
		                    path,
		                    type: READ,
		                    info: nextTraceMap[READ],
		                };
		            }
		            yield* this._iterateVariableReferences(
		                findVariable(this.globalScope, specifierNode.local),
		                path,
		                nextTraceMap,
		                false,
		            );

		            return
		        }

		        if (type === "ImportNamespaceSpecifier") {
		            yield* this._iterateVariableReferences(
		                findVariable(this.globalScope, specifierNode.local),
		                path,
		                traceMap,
		                false,
		            );
		            return
		        }

		        if (type === "ExportSpecifier") {
		            const key = specifierNode.local.name;
		            if (!has(traceMap, key)) {
		                return
		            }

		            path = path.concat(key); //eslint-disable-line no-param-reassign
		            const nextTraceMap = traceMap[key];
		            if (nextTraceMap[READ]) {
		                yield {
		                    node: specifierNode,
		                    path,
		                    type: READ,
		                    info: nextTraceMap[READ],
		                };
		            }
		        }
		    }
		}

		ReferenceTracker.READ = READ;
		ReferenceTracker.CALL = CALL;
		ReferenceTracker.CONSTRUCT = CONSTRUCT;
		ReferenceTracker.ESM = ESM;

		/**
		 * This is a predicate function for Array#filter.
		 * @param {string} name A name part.
		 * @param {number} index The index of the name.
		 * @returns {boolean} `false` if it's default.
		 */
		function exceptDefault(name, index) {
		    return !(index === 1 && name === "default")
		}

		var index = {
		    CALL,
		    CONSTRUCT,
		    ESM,
		    findVariable,
		    getFunctionHeadLocation,
		    getFunctionNameWithKind,
		    getInnermostScope,
		    getPropertyName,
		    getStaticValue,
		    getStringIfConstant,
		    hasSideEffect,
		    isArrowToken,
		    isClosingBraceToken,
		    isClosingBracketToken,
		    isClosingParenToken,
		    isColonToken,
		    isCommaToken,
		    isCommentToken,
		    isNotArrowToken,
		    isNotClosingBraceToken,
		    isNotClosingBracketToken,
		    isNotClosingParenToken,
		    isNotColonToken,
		    isNotCommaToken,
		    isNotCommentToken,
		    isNotOpeningBraceToken,
		    isNotOpeningBracketToken,
		    isNotOpeningParenToken,
		    isNotSemicolonToken,
		    isOpeningBraceToken,
		    isOpeningBracketToken,
		    isOpeningParenToken,
		    isParenthesized,
		    isSemicolonToken,
		    PatternMatcher,
		    READ,
		    ReferenceTracker,
		};

		exports.CALL = CALL;
		exports.CONSTRUCT = CONSTRUCT;
		exports.ESM = ESM;
		exports.PatternMatcher = PatternMatcher;
		exports.READ = READ;
		exports.ReferenceTracker = ReferenceTracker;
		exports["default"] = index;
		exports.findVariable = findVariable;
		exports.getFunctionHeadLocation = getFunctionHeadLocation;
		exports.getFunctionNameWithKind = getFunctionNameWithKind;
		exports.getInnermostScope = getInnermostScope;
		exports.getPropertyName = getPropertyName;
		exports.getStaticValue = getStaticValue;
		exports.getStringIfConstant = getStringIfConstant;
		exports.hasSideEffect = hasSideEffect;
		exports.isArrowToken = isArrowToken;
		exports.isClosingBraceToken = isClosingBraceToken;
		exports.isClosingBracketToken = isClosingBracketToken;
		exports.isClosingParenToken = isClosingParenToken;
		exports.isColonToken = isColonToken;
		exports.isCommaToken = isCommaToken;
		exports.isCommentToken = isCommentToken;
		exports.isNotArrowToken = isNotArrowToken;
		exports.isNotClosingBraceToken = isNotClosingBraceToken;
		exports.isNotClosingBracketToken = isNotClosingBracketToken;
		exports.isNotClosingParenToken = isNotClosingParenToken;
		exports.isNotColonToken = isNotColonToken;
		exports.isNotCommaToken = isNotCommaToken;
		exports.isNotCommentToken = isNotCommentToken;
		exports.isNotOpeningBraceToken = isNotOpeningBraceToken;
		exports.isNotOpeningBracketToken = isNotOpeningBracketToken;
		exports.isNotOpeningParenToken = isNotOpeningParenToken;
		exports.isNotSemicolonToken = isNotSemicolonToken;
		exports.isOpeningBraceToken = isOpeningBraceToken;
		exports.isOpeningBracketToken = isOpeningBracketToken;
		exports.isOpeningParenToken = isOpeningParenToken;
		exports.isParenthesized = isParenthesized;
		exports.isSemicolonToken = isSemicolonToken;
		
	} (eslintUtils));
	return eslintUtils;
}

/**
 * @fileoverview Assertion utilities equivalent to the Node.js node:asserts module.
 * @author Josh Goldberg
 */

var assert;
var hasRequiredAssert;

function requireAssert () {
	if (hasRequiredAssert) return assert;
	hasRequiredAssert = 1;

	/**
	 * Throws an error if the input is not truthy.
	 * @param {unknown} value The input that is checked for being truthy.
	 * @param {string} message Message to throw if the input is not truthy.
	 * @returns {void}
	 * @throws {Error} When the condition is not truthy.
	 */
	function ok(value, message = "Assertion failed.") {
		if (!value) {
			throw new Error(message);
		}
	}

	assert = ok;
	return assert;
}

/**
 * @fileoverview Define the abstract class about cursors which iterate tokens.
 * @author Toru Nagashima
 */

var cursor;
var hasRequiredCursor;

function requireCursor () {
	if (hasRequiredCursor) return cursor;
	hasRequiredCursor = 1;

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The abstract class about cursors which iterate tokens.
	 *
	 * This class has 2 abstract methods.
	 *
	 * - `current: Token | Comment | null` ... The current token.
	 * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`.
	 *
	 * This is similar to ES2015 Iterators.
	 * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable.
	 *
	 * There are the following known sub classes.
	 *
	 * - ForwardTokenCursor .......... The cursor which iterates tokens only.
	 * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse.
	 * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments.
	 * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse.
	 * - DecorativeCursor
	 *     - FilterCursor ............ The cursor which ignores the specified tokens.
	 *     - SkipCursor .............. The cursor which ignores the first few tokens.
	 *     - LimitCursor ............. The cursor which limits the count of tokens.
	 *
	 */
	cursor = class Cursor {
		/**
		 * Initializes this cursor.
		 */
		constructor() {
			this.current = null;
		}

		/**
		 * Gets the first token.
		 * This consumes this cursor.
		 * @returns {Token|Comment} The first token or null.
		 */
		getOneToken() {
			return this.moveNext() ? this.current : null;
		}

		/**
		 * Gets the first tokens.
		 * This consumes this cursor.
		 * @returns {(Token|Comment)[]} All tokens.
		 */
		getAllTokens() {
			const tokens = [];

			while (this.moveNext()) {
				tokens.push(this.current);
			}

			return tokens;
		}

		/**
		 * Moves this cursor to the next token.
		 * @returns {boolean} `true` if the next token exists.
		 * @abstract
		 */
		/* c8 ignore next */
		// eslint-disable-next-line class-methods-use-this -- Unused
		moveNext() {
			throw new Error("Not implemented.");
		}
	};
	return cursor;
}

var utils$1 = {};

/**
 * @fileoverview Define utility functions for token store.
 * @author Toru Nagashima
 */

var hasRequiredUtils$1;

function requireUtils$1 () {
	if (hasRequiredUtils$1) return utils$1;
	hasRequiredUtils$1 = 1;

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * Finds the index of the first token which is after the given location.
	 * If it was not found, this returns `tokens.length`.
	 * @param {(Token|Comment)[]} tokens It searches the token in this list.
	 * @param {number} location The location to search.
	 * @returns {number} The found index or `tokens.length`.
	 */
	utils$1.search = function search(tokens, location) {
		for (
			let minIndex = 0, maxIndex = tokens.length - 1;
			minIndex <= maxIndex;

		) {
			/*
			 * Calculate the index in the middle between minIndex and maxIndex.
			 * `| 0` is used to round a fractional value down to the nearest integer: this is similar to
			 * using `Math.trunc()` or `Math.floor()`, but performance tests have shown this method to
			 * be faster.
			 */
			const index = ((minIndex + maxIndex) / 2) | 0;
			const token = tokens[index];
			const tokenStartLocation = token.range[0];

			if (location <= tokenStartLocation) {
				if (index === minIndex) {
					return index;
				}
				maxIndex = index;
			} else {
				minIndex = index + 1;
			}
		}
		return tokens.length;
	};

	/**
	 * Gets the index of the `startLoc` in `tokens`.
	 * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well.
	 * @param {(Token|Comment)[]} tokens The tokens to find an index.
	 * @param {Object} indexMap The map from locations to indices.
	 * @param {number} startLoc The location to get an index.
	 * @returns {number} The index.
	 */
	utils$1.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) {
		if (startLoc in indexMap) {
			return indexMap[startLoc];
		}
		if (startLoc - 1 in indexMap) {
			const index = indexMap[startLoc - 1];
			const token = tokens[index];

			// If the mapped index is out of bounds, the returned cursor index will point after the end of the tokens array.
			if (!token) {
				return tokens.length;
			}

			/*
			 * For the map of "comment's location -> token's index", it points the next token of a comment.
			 * In that case, +1 is unnecessary.
			 */
			if (token.range[0] >= startLoc) {
				return index;
			}
			return index + 1;
		}
		return 0;
	};

	/**
	 * Gets the index of the `endLoc` in `tokens`.
	 * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well.
	 * @param {(Token|Comment)[]} tokens The tokens to find an index.
	 * @param {Object} indexMap The map from locations to indices.
	 * @param {number} endLoc The location to get an index.
	 * @returns {number} The index.
	 */
	utils$1.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) {
		if (endLoc in indexMap) {
			return indexMap[endLoc] - 1;
		}
		if (endLoc - 1 in indexMap) {
			const index = indexMap[endLoc - 1];
			const token = tokens[index];

			// If the mapped index is out of bounds, the returned cursor index will point before the end of the tokens array.
			if (!token) {
				return tokens.length - 1;
			}

			/*
			 * For the map of "comment's location -> token's index", it points the next token of a comment.
			 * In that case, -1 is necessary.
			 */
			if (token.range[1] > endLoc) {
				return index - 1;
			}
			return index;
		}
		return tokens.length - 1;
	};
	return utils$1;
}

/**
 * @fileoverview Define the cursor which iterates tokens and comments in reverse.
 * @author Toru Nagashima
 */

var backwardTokenCommentCursor;
var hasRequiredBackwardTokenCommentCursor;

function requireBackwardTokenCommentCursor () {
	if (hasRequiredBackwardTokenCommentCursor) return backwardTokenCommentCursor;
	hasRequiredBackwardTokenCommentCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Cursor = requireCursor();
	const utils = requireUtils$1();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The cursor which iterates tokens and comments in reverse.
	 */
	backwardTokenCommentCursor = class BackwardTokenCommentCursor extends Cursor {
		/**
		 * Initializes this cursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 */
		constructor(tokens, comments, indexMap, startLoc, endLoc) {
			super();
			this.tokens = tokens;
			this.comments = comments;
			this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc);
			this.commentIndex = utils.search(comments, endLoc) - 1;
			this.border = startLoc;
		}

		/** @inheritdoc */
		moveNext() {
			const token =
				this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null;
			const comment =
				this.commentIndex >= 0 ? this.comments[this.commentIndex] : null;

			if (token && (!comment || token.range[1] > comment.range[1])) {
				this.current = token;
				this.tokenIndex -= 1;
			} else if (comment) {
				this.current = comment;
				this.commentIndex -= 1;
			} else {
				this.current = null;
			}

			return (
				Boolean(this.current) &&
				(this.border === -1 || this.current.range[0] >= this.border)
			);
		}
	};
	return backwardTokenCommentCursor;
}

/**
 * @fileoverview Define the cursor which iterates tokens only in reverse.
 * @author Toru Nagashima
 */

var backwardTokenCursor;
var hasRequiredBackwardTokenCursor;

function requireBackwardTokenCursor () {
	if (hasRequiredBackwardTokenCursor) return backwardTokenCursor;
	hasRequiredBackwardTokenCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Cursor = requireCursor();
	const { getLastIndex, getFirstIndex } = requireUtils$1();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The cursor which iterates tokens only in reverse.
	 */
	backwardTokenCursor = class BackwardTokenCursor extends Cursor {
		/**
		 * Initializes this cursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 */
		constructor(tokens, comments, indexMap, startLoc, endLoc) {
			super();
			this.tokens = tokens;
			this.index = getLastIndex(tokens, indexMap, endLoc);
			this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
		}

		/** @inheritdoc */
		moveNext() {
			if (this.index >= this.indexEnd) {
				this.current = this.tokens[this.index];
				this.index -= 1;
				return true;
			}
			return false;
		}

		/*
		 *
		 * Shorthand for performance.
		 *
		 */

		/** @inheritdoc */
		getOneToken() {
			return this.index >= this.indexEnd ? this.tokens[this.index] : null;
		}
	};
	return backwardTokenCursor;
}

/**
 * @fileoverview Define the abstract class about cursors which manipulate another cursor.
 * @author Toru Nagashima
 */

var decorativeCursor;
var hasRequiredDecorativeCursor;

function requireDecorativeCursor () {
	if (hasRequiredDecorativeCursor) return decorativeCursor;
	hasRequiredDecorativeCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Cursor = requireCursor();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The abstract class about cursors which manipulate another cursor.
	 */
	decorativeCursor = class DecorativeCursor extends Cursor {
		/**
		 * Initializes this cursor.
		 * @param {Cursor} cursor The cursor to be decorated.
		 */
		constructor(cursor) {
			super();
			this.cursor = cursor;
		}

		/** @inheritdoc */
		moveNext() {
			const retv = this.cursor.moveNext();

			this.current = this.cursor.current;

			return retv;
		}
	};
	return decorativeCursor;
}

/**
 * @fileoverview Define the cursor which ignores specified tokens.
 * @author Toru Nagashima
 */

var filterCursor;
var hasRequiredFilterCursor;

function requireFilterCursor () {
	if (hasRequiredFilterCursor) return filterCursor;
	hasRequiredFilterCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const DecorativeCursor = requireDecorativeCursor();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The decorative cursor which ignores specified tokens.
	 */
	filterCursor = class FilterCursor extends DecorativeCursor {
		/**
		 * Initializes this cursor.
		 * @param {Cursor} cursor The cursor to be decorated.
		 * @param {Function} predicate The predicate function to decide tokens this cursor iterates.
		 */
		constructor(cursor, predicate) {
			super(cursor);
			this.predicate = predicate;
		}

		/** @inheritdoc */
		moveNext() {
			const predicate = this.predicate;

			while (super.moveNext()) {
				if (predicate(this.current)) {
					return true;
				}
			}
			return false;
		}
	};
	return filterCursor;
}

/**
 * @fileoverview Define the cursor which iterates tokens and comments.
 * @author Toru Nagashima
 */

var forwardTokenCommentCursor;
var hasRequiredForwardTokenCommentCursor;

function requireForwardTokenCommentCursor () {
	if (hasRequiredForwardTokenCommentCursor) return forwardTokenCommentCursor;
	hasRequiredForwardTokenCommentCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Cursor = requireCursor();
	const { getFirstIndex, search } = requireUtils$1();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The cursor which iterates tokens and comments.
	 */
	forwardTokenCommentCursor = class ForwardTokenCommentCursor extends Cursor {
		/**
		 * Initializes this cursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 */
		constructor(tokens, comments, indexMap, startLoc, endLoc) {
			super();
			this.tokens = tokens;
			this.comments = comments;
			this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
			this.commentIndex = search(comments, startLoc);
			this.border = endLoc;
		}

		/** @inheritdoc */
		moveNext() {
			const token =
				this.tokenIndex < this.tokens.length
					? this.tokens[this.tokenIndex]
					: null;
			const comment =
				this.commentIndex < this.comments.length
					? this.comments[this.commentIndex]
					: null;

			if (token && (!comment || token.range[0] < comment.range[0])) {
				this.current = token;
				this.tokenIndex += 1;
			} else if (comment) {
				this.current = comment;
				this.commentIndex += 1;
			} else {
				this.current = null;
			}

			return (
				Boolean(this.current) &&
				(this.border === -1 || this.current.range[1] <= this.border)
			);
		}
	};
	return forwardTokenCommentCursor;
}

/**
 * @fileoverview Define the cursor which iterates tokens only.
 * @author Toru Nagashima
 */

var forwardTokenCursor;
var hasRequiredForwardTokenCursor;

function requireForwardTokenCursor () {
	if (hasRequiredForwardTokenCursor) return forwardTokenCursor;
	hasRequiredForwardTokenCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Cursor = requireCursor();
	const { getFirstIndex, getLastIndex } = requireUtils$1();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The cursor which iterates tokens only.
	 */
	forwardTokenCursor = class ForwardTokenCursor extends Cursor {
		/**
		 * Initializes this cursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 */
		constructor(tokens, comments, indexMap, startLoc, endLoc) {
			super();
			this.tokens = tokens;
			this.index = getFirstIndex(tokens, indexMap, startLoc);
			this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
		}

		/** @inheritdoc */
		moveNext() {
			if (this.index <= this.indexEnd) {
				this.current = this.tokens[this.index];
				this.index += 1;
				return true;
			}
			return false;
		}

		/*
		 *
		 * Shorthand for performance.
		 *
		 */

		/** @inheritdoc */
		getOneToken() {
			return this.index <= this.indexEnd ? this.tokens[this.index] : null;
		}

		/** @inheritdoc */
		getAllTokens() {
			return this.tokens.slice(this.index, this.indexEnd + 1);
		}
	};
	return forwardTokenCursor;
}

/**
 * @fileoverview Define the cursor which limits the number of tokens.
 * @author Toru Nagashima
 */

var limitCursor;
var hasRequiredLimitCursor;

function requireLimitCursor () {
	if (hasRequiredLimitCursor) return limitCursor;
	hasRequiredLimitCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const DecorativeCursor = requireDecorativeCursor();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The decorative cursor which limits the number of tokens.
	 */
	limitCursor = class LimitCursor extends DecorativeCursor {
		/**
		 * Initializes this cursor.
		 * @param {Cursor} cursor The cursor to be decorated.
		 * @param {number} count The count of tokens this cursor iterates.
		 */
		constructor(cursor, count) {
			super(cursor);
			this.count = count;
		}

		/** @inheritdoc */
		moveNext() {
			if (this.count > 0) {
				this.count -= 1;
				return super.moveNext();
			}
			return false;
		}
	};
	return limitCursor;
}

/**
 * @fileoverview Define the cursor which ignores the first few tokens.
 * @author Toru Nagashima
 */

var skipCursor;
var hasRequiredSkipCursor;

function requireSkipCursor () {
	if (hasRequiredSkipCursor) return skipCursor;
	hasRequiredSkipCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const DecorativeCursor = requireDecorativeCursor();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The decorative cursor which ignores the first few tokens.
	 */
	skipCursor = class SkipCursor extends DecorativeCursor {
		/**
		 * Initializes this cursor.
		 * @param {Cursor} cursor The cursor to be decorated.
		 * @param {number} count The count of tokens this cursor skips.
		 */
		constructor(cursor, count) {
			super(cursor);
			this.count = count;
		}

		/** @inheritdoc */
		moveNext() {
			while (this.count > 0) {
				this.count -= 1;
				if (!super.moveNext()) {
					return false;
				}
			}
			return super.moveNext();
		}
	};
	return skipCursor;
}

/**
 * @fileoverview Define 2 token factories; forward and backward.
 * @author Toru Nagashima
 */

var cursors;
var hasRequiredCursors;

function requireCursors () {
	if (hasRequiredCursors) return cursors;
	hasRequiredCursors = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const BackwardTokenCommentCursor = requireBackwardTokenCommentCursor();
	const BackwardTokenCursor = requireBackwardTokenCursor();
	const FilterCursor = requireFilterCursor();
	const ForwardTokenCommentCursor = requireForwardTokenCommentCursor();
	const ForwardTokenCursor = requireForwardTokenCursor();
	const LimitCursor = requireLimitCursor();
	const SkipCursor = requireSkipCursor();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * The cursor factory.
	 * @private
	 */
	class CursorFactory {
		/**
		 * Initializes this cursor.
		 * @param {Function} TokenCursor The class of the cursor which iterates tokens only.
		 * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments.
		 */
		constructor(TokenCursor, TokenCommentCursor) {
			this.TokenCursor = TokenCursor;
			this.TokenCommentCursor = TokenCommentCursor;
		}

		/**
		 * Creates a base cursor instance that can be decorated by createCursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 * @param {boolean} includeComments The flag to iterate comments as well.
		 * @returns {Cursor} The created base cursor.
		 */
		createBaseCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			includeComments,
		) {
			const Cursor = includeComments
				? this.TokenCommentCursor
				: this.TokenCursor;

			return new Cursor(tokens, comments, indexMap, startLoc, endLoc);
		}

		/**
		 * Creates a cursor that iterates tokens with normalized options.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 * @param {boolean} includeComments The flag to iterate comments as well.
		 * @param {Function|null} filter The predicate function to choose tokens.
		 * @param {number} skip The count of tokens the cursor skips.
		 * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
		 * @returns {Cursor} The created cursor.
		 */
		createCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			includeComments,
			filter,
			skip,
			count,
		) {
			let cursor = this.createBaseCursor(
				tokens,
				comments,
				indexMap,
				startLoc,
				endLoc,
				includeComments,
			);

			if (filter) {
				cursor = new FilterCursor(cursor, filter);
			}
			if (skip >= 1) {
				cursor = new SkipCursor(cursor, skip);
			}
			if (count >= 0) {
				cursor = new LimitCursor(cursor, count);
			}

			return cursor;
		}
	}

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	cursors = {
		forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
		backward: new CursorFactory(
			BackwardTokenCursor,
			BackwardTokenCommentCursor,
		),
	};
	return cursors;
}

/**
 * @fileoverview Define the cursor which iterates tokens only, with inflated range.
 * @author Toru Nagashima
 */

var paddedTokenCursor;
var hasRequiredPaddedTokenCursor;

function requirePaddedTokenCursor () {
	if (hasRequiredPaddedTokenCursor) return paddedTokenCursor;
	hasRequiredPaddedTokenCursor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const ForwardTokenCursor = requireForwardTokenCursor();

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The cursor which iterates tokens only, with inflated range.
	 * This is for the backward compatibility of padding options.
	 */
	paddedTokenCursor = class PaddedTokenCursor extends ForwardTokenCursor {
		/**
		 * Initializes this cursor.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 * @param {Object} indexMap The map from locations to indices in `tokens`.
		 * @param {number} startLoc The start location of the iteration range.
		 * @param {number} endLoc The end location of the iteration range.
		 * @param {number} beforeCount The number of tokens this cursor iterates before start.
		 * @param {number} afterCount The number of tokens this cursor iterates after end.
		 */
		constructor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			beforeCount,
			afterCount,
		) {
			super(tokens, comments, indexMap, startLoc, endLoc);
			this.index = Math.max(0, this.index - beforeCount);
			this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount);
		}
	};
	return paddedTokenCursor;
}

/**
 * @fileoverview Object to handle access and retrieval of tokens.
 * @author Brandon Mills
 */

var tokenStore;
var hasRequiredTokenStore;

function requireTokenStore () {
	if (hasRequiredTokenStore) return tokenStore;
	hasRequiredTokenStore = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { isCommentToken } = /*@__PURE__*/ requireEslintUtils();
	const assert = requireAssert();
	const cursors = requireCursors();
	const ForwardTokenCursor = requireForwardTokenCursor();
	const PaddedTokenCursor = requirePaddedTokenCursor();
	const utils = requireUtils$1();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const TOKENS = Symbol("tokens");
	const COMMENTS = Symbol("comments");
	const INDEX_MAP = Symbol("indexMap");

	/**
	 * Creates the map from locations to indices in `tokens`.
	 *
	 * The first/last location of tokens is mapped to the index of the token.
	 * The first/last location of comments is mapped to the index of the next token of each comment.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @returns {Object} The map from locations to indices in `tokens`.
	 * @private
	 */
	function createIndexMap(tokens, comments) {
		const map = Object.create(null);
		let tokenIndex = 0;
		let commentIndex = 0;
		let nextStart;
		let range;

		while (tokenIndex < tokens.length || commentIndex < comments.length) {
			nextStart =
				commentIndex < comments.length
					? comments[commentIndex].range[0]
					: Number.MAX_SAFE_INTEGER;
			while (
				tokenIndex < tokens.length &&
				(range = tokens[tokenIndex].range)[0] < nextStart
			) {
				map[range[0]] = tokenIndex;
				map[range[1] - 1] = tokenIndex;
				tokenIndex += 1;
			}

			nextStart =
				tokenIndex < tokens.length
					? tokens[tokenIndex].range[0]
					: Number.MAX_SAFE_INTEGER;
			while (
				commentIndex < comments.length &&
				(range = comments[commentIndex].range)[0] < nextStart
			) {
				map[range[0]] = tokenIndex;
				map[range[1] - 1] = tokenIndex;
				commentIndex += 1;
			}
		}

		return map;
	}

	/**
	 * Creates the cursor iterates tokens with options.
	 * @param {CursorFactory} factory The cursor factory to initialize cursor.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`.
	 * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well.
	 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
	 * @param {number} [opts.skip=0] The count of tokens the cursor skips.
	 * @returns {Cursor} The created cursor.
	 * @private
	 */
	function createCursorWithSkip(
		factory,
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		opts,
	) {
		let includeComments = false;
		let skip = 0;
		let filter = null;

		if (typeof opts === "number") {
			skip = opts | 0;
		} else if (typeof opts === "function") {
			filter = opts;
		} else if (opts) {
			includeComments = !!opts.includeComments;
			skip = opts.skip | 0;
			filter = opts.filter || null;
		}
		assert(skip >= 0, "options.skip should be zero or a positive integer.");
		assert(
			!filter || typeof filter === "function",
			"options.filter should be a function.",
		);

		return factory.createCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			includeComments,
			filter,
			skip,
			-1,
		);
	}

	/**
	 * Creates the cursor iterates tokens with options.
	 * @param {CursorFactory} factory The cursor factory to initialize cursor.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`.
	 * @param {boolean} [opts.includeComments] The flag to iterate comments as well.
	 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
	 * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
	 * @returns {Cursor} The created cursor.
	 * @private
	 */
	function createCursorWithCount(
		factory,
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		opts,
	) {
		let includeComments = false;
		let count = 0;
		let countExists = false;
		let filter = null;

		if (typeof opts === "number") {
			count = opts | 0;
			countExists = true;
		} else if (typeof opts === "function") {
			filter = opts;
		} else if (opts) {
			includeComments = !!opts.includeComments;
			count = opts.count | 0;
			countExists = typeof opts.count === "number";
			filter = opts.filter || null;
		}
		assert(count >= 0, "options.count should be zero or a positive integer.");
		assert(
			!filter || typeof filter === "function",
			"options.filter should be a function.",
		);

		return factory.createCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			includeComments,
			filter,
			0,
			countExists ? count : -1,
		);
	}

	/**
	 * Creates the cursor iterates tokens with options.
	 * This is overload function of the below.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`.
	 * @param {boolean} [opts.includeComments] The flag to iterate comments as well.
	 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
	 * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
	 * @returns {Cursor} The created cursor.
	 * @private
	 */
	/**
	 * Creates the cursor iterates tokens with options.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {number} [beforeCount=0] The number of tokens before the node to retrieve.
	 * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve.
	 * @returns {Cursor} The created cursor.
	 * @private
	 */
	function createCursorWithPadding(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		beforeCount,
		afterCount,
	) {
		if (
			typeof beforeCount === "undefined" &&
			typeof afterCount === "undefined"
		) {
			return new ForwardTokenCursor(
				tokens,
				comments,
				indexMap,
				startLoc,
				endLoc,
			);
		}
		if (typeof beforeCount === "number" || typeof beforeCount === "undefined") {
			return new PaddedTokenCursor(
				tokens,
				comments,
				indexMap,
				startLoc,
				endLoc,
				beforeCount | 0,
				afterCount | 0,
			);
		}
		return createCursorWithCount(
			cursors.forward,
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			beforeCount,
		);
	}

	/**
	 * Gets comment tokens that are adjacent to the current cursor position.
	 * @param {Cursor} cursor A cursor instance.
	 * @returns {Array} An array of comment tokens adjacent to the current cursor position.
	 * @private
	 */
	function getAdjacentCommentTokensFromCursor(cursor) {
		const tokens = [];
		let currentToken = cursor.getOneToken();

		while (currentToken && isCommentToken(currentToken)) {
			tokens.push(currentToken);
			currentToken = cursor.getOneToken();
		}

		return tokens;
	}

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * The token store.
	 *
	 * This class provides methods to get tokens by locations as fast as possible.
	 * The methods are a part of public API, so we should be careful if it changes this class.
	 *
	 * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens.
	 * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments.
	 * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost.
	 * This uses binary-searching instead for comments.
	 */
	tokenStore = class TokenStore {
		/**
		 * Initializes this token store.
		 * @param {Token[]} tokens The array of tokens.
		 * @param {Comment[]} comments The array of comments.
		 */
		constructor(tokens, comments) {
			this[TOKENS] = tokens;
			this[COMMENTS] = comments;
			this[INDEX_MAP] = createIndexMap(tokens, comments);
		}

		//--------------------------------------------------------------------------
		// Gets single token.
		//--------------------------------------------------------------------------

		/**
		 * Gets the token starting at the specified index.
		 * @param {number} offset Index of the start of the token's range.
		 * @param {Object} [options=0] The option object.
		 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
		 * @returns {Token|null} The token starting at index, or null if no such token.
		 */
		getTokenByRangeStart(offset, options) {
			const includeComments = options && options.includeComments;
			const token = cursors.forward
				.createBaseCursor(
					this[TOKENS],
					this[COMMENTS],
					this[INDEX_MAP],
					offset,
					-1,
					includeComments,
				)
				.getOneToken();

			if (token && token.range[0] === offset) {
				return token;
			}
			return null;
		}

		/**
		 * Gets the first token of the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
		 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
		 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
		 * @param {number} [options.skip=0] The count of tokens the cursor skips.
		 * @returns {Token|null} An object representing the token.
		 */
		getFirstToken(node, options) {
			return createCursorWithSkip(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[0],
				node.range[1],
				options,
			).getOneToken();
		}

		/**
		 * Gets the last token of the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
		 * @returns {Token|null} An object representing the token.
		 */
		getLastToken(node, options) {
			return createCursorWithSkip(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[0],
				node.range[1],
				options,
			).getOneToken();
		}

		/**
		 * Gets the token that precedes a given node or token.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
		 * @returns {Token|null} An object representing the token.
		 */
		getTokenBefore(node, options) {
			return createCursorWithSkip(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				-1,
				node.range[0],
				options,
			).getOneToken();
		}

		/**
		 * Gets the token that follows a given node or token.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
		 * @returns {Token|null} An object representing the token.
		 */
		getTokenAfter(node, options) {
			return createCursorWithSkip(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[1],
				-1,
				options,
			).getOneToken();
		}

		/**
		 * Gets the first token between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
		 * @returns {Token|null} An object representing the token.
		 */
		getFirstTokenBetween(left, right, options) {
			return createCursorWithSkip(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				left.range[1],
				right.range[0],
				options,
			).getOneToken();
		}

		/**
		 * Gets the last token between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
		 * @returns {Token|null} An object representing the token.
		 */
		getLastTokenBetween(left, right, options) {
			return createCursorWithSkip(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				left.range[1],
				right.range[0],
				options,
			).getOneToken();
		}

		/**
		 * Gets the token that precedes a given node or token in the token stream.
		 * This is defined for backward compatibility. Use `includeComments` option instead.
		 * TODO: We have a plan to remove this in a future major version.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number} [skip=0] A number of tokens to skip.
		 * @returns {Token|null} An object representing the token.
		 * @deprecated
		 */
		getTokenOrCommentBefore(node, skip) {
			return this.getTokenBefore(node, { includeComments: true, skip });
		}

		/**
		 * Gets the token that follows a given node or token in the token stream.
		 * This is defined for backward compatibility. Use `includeComments` option instead.
		 * TODO: We have a plan to remove this in a future major version.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number} [skip=0] A number of tokens to skip.
		 * @returns {Token|null} An object representing the token.
		 * @deprecated
		 */
		getTokenOrCommentAfter(node, skip) {
			return this.getTokenAfter(node, { includeComments: true, skip });
		}

		//--------------------------------------------------------------------------
		// Gets multiple tokens.
		//--------------------------------------------------------------------------

		/**
		 * Gets the first `count` tokens of the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
		 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
		 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
		 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
		 * @returns {Token[]} Tokens.
		 */
		getFirstTokens(node, options) {
			return createCursorWithCount(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[0],
				node.range[1],
				options,
			).getAllTokens();
		}

		/**
		 * Gets the last `count` tokens of the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
		 * @returns {Token[]} Tokens.
		 */
		getLastTokens(node, options) {
			return createCursorWithCount(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[0],
				node.range[1],
				options,
			)
				.getAllTokens()
				.reverse();
		}

		/**
		 * Gets the `count` tokens that precedes a given node or token.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
		 * @returns {Token[]} Tokens.
		 */
		getTokensBefore(node, options) {
			return createCursorWithCount(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				-1,
				node.range[0],
				options,
			)
				.getAllTokens()
				.reverse();
		}

		/**
		 * Gets the `count` tokens that follows a given node or token.
		 * @param {ASTNode|Token|Comment} node The AST node or token.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
		 * @returns {Token[]} Tokens.
		 */
		getTokensAfter(node, options) {
			return createCursorWithCount(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[1],
				-1,
				options,
			).getAllTokens();
		}

		/**
		 * Gets the first `count` tokens between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
		 * @returns {Token[]} Tokens between left and right.
		 */
		getFirstTokensBetween(left, right, options) {
			return createCursorWithCount(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				left.range[1],
				right.range[0],
				options,
			).getAllTokens();
		}

		/**
		 * Gets the last `count` tokens between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
		 * @returns {Token[]} Tokens between left and right.
		 */
		getLastTokensBetween(left, right, options) {
			return createCursorWithCount(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				left.range[1],
				right.range[0],
				options,
			)
				.getAllTokens()
				.reverse();
		}

		/**
		 * Gets all tokens that are related to the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {Function|Object} options The option object. If this is a function then it's `options.filter`.
		 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
		 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
		 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
		 * @returns {Token[]} Array of objects representing tokens.
		 */
		/**
		 * Gets all tokens that are related to the given node.
		 * @param {ASTNode} node The AST node.
		 * @param {int} [beforeCount=0] The number of tokens before the node to retrieve.
		 * @param {int} [afterCount=0] The number of tokens after the node to retrieve.
		 * @returns {Token[]} Array of objects representing tokens.
		 */
		getTokens(node, beforeCount, afterCount) {
			return createCursorWithPadding(
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				node.range[0],
				node.range[1],
				beforeCount,
				afterCount,
			).getAllTokens();
		}

		/**
		 * Gets all of the tokens between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {Function|Object} options The option object. If this is a function then it's `options.filter`.
		 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
		 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
		 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
		 * @returns {Token[]} Tokens between left and right.
		 */
		/**
		 * Gets all of the tokens between two non-overlapping nodes.
		 * @param {ASTNode|Token|Comment} left Node before the desired token range.
		 * @param {ASTNode|Token|Comment} right Node after the desired token range.
		 * @param {int} [padding=0] Number of extra tokens on either side of center.
		 * @returns {Token[]} Tokens between left and right.
		 */
		getTokensBetween(left, right, padding) {
			return createCursorWithPadding(
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				left.range[1],
				right.range[0],
				padding,
				padding,
			).getAllTokens();
		}

		//--------------------------------------------------------------------------
		// Others.
		//--------------------------------------------------------------------------

		/**
		 * Checks whether any comments exist or not between the given 2 nodes.
		 * @param {ASTNode} left The node to check.
		 * @param {ASTNode} right The node to check.
		 * @returns {boolean} `true` if one or more comments exist.
		 */
		commentsExistBetween(left, right) {
			const index = utils.search(this[COMMENTS], left.range[1]);

			return (
				index < this[COMMENTS].length &&
				this[COMMENTS][index].range[1] <= right.range[0]
			);
		}

		/**
		 * Gets all comment tokens directly before the given node or token.
		 * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens.
		 * @returns {Array} An array of comments in occurrence order.
		 */
		getCommentsBefore(nodeOrToken) {
			const cursor = createCursorWithCount(
				cursors.backward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				-1,
				nodeOrToken.range[0],
				{ includeComments: true },
			);

			return getAdjacentCommentTokensFromCursor(cursor).reverse();
		}

		/**
		 * Gets all comment tokens directly after the given node or token.
		 * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens.
		 * @returns {Array} An array of comments in occurrence order.
		 */
		getCommentsAfter(nodeOrToken) {
			const cursor = createCursorWithCount(
				cursors.forward,
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				nodeOrToken.range[1],
				-1,
				{ includeComments: true },
			);

			return getAdjacentCommentTokensFromCursor(cursor);
		}

		/**
		 * Gets all comment tokens inside the given node.
		 * @param {ASTNode} node The AST node to get the comments for.
		 * @returns {Array} An array of comments in occurrence order.
		 */
		getCommentsInside(node) {
			return this.getTokens(node, {
				includeComments: true,
				filter: isCommentToken,
			});
		}
	};
	return tokenStore;
}

/**
 * @fileoverview Common utils for AST.
 *
 * This file contains only shared items for core and rules.
 * If you make a utility for rules, please see `../rules/utils/ast-utils.js`.
 *
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var astUtils$1;
var hasRequiredAstUtils$1;

function requireAstUtils$1 () {
	if (hasRequiredAstUtils$1) return astUtils$1;
	hasRequiredAstUtils$1 = 1;

	const breakableTypePattern =
		/^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u;
	const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u;
	const shebangPattern = /^#!([^\r\n]+)/u;

	/**
	 * Creates a version of the `lineBreakPattern` regex with the global flag.
	 * Global regexes are mutable, so this needs to be a function instead of a constant.
	 * @returns {RegExp} A global regular expression that matches line terminators
	 */
	function createGlobalLinebreakMatcher() {
		return new RegExp(lineBreakPattern.source, "gu");
	}

	astUtils$1 = {
		breakableTypePattern,
		lineBreakPattern,
		createGlobalLinebreakMatcher,
		shebangPattern,
	};
	return astUtils$1;
}

/**
 * @fileoverview Globals for ecmaVersion/sourceType
 * @author Nicholas C. Zakas
 */

var globals;
var hasRequiredGlobals;

function requireGlobals () {
	if (hasRequiredGlobals) return globals;
	hasRequiredGlobals = 1;

	//-----------------------------------------------------------------------------
	// Globals
	//-----------------------------------------------------------------------------

	const commonjs = {
		exports: true,
		global: false,
		module: false,
		require: false,
	};

	const es3 = {
		Array: false,
		Boolean: false,
		constructor: false,
		Date: false,
		decodeURI: false,
		decodeURIComponent: false,
		encodeURI: false,
		encodeURIComponent: false,
		Error: false,
		escape: false,
		eval: false,
		EvalError: false,
		Function: false,
		hasOwnProperty: false,
		Infinity: false,
		isFinite: false,
		isNaN: false,
		isPrototypeOf: false,
		Math: false,
		NaN: false,
		Number: false,
		Object: false,
		parseFloat: false,
		parseInt: false,
		propertyIsEnumerable: false,
		RangeError: false,
		ReferenceError: false,
		RegExp: false,
		String: false,
		SyntaxError: false,
		toLocaleString: false,
		toString: false,
		TypeError: false,
		undefined: false,
		unescape: false,
		URIError: false,
		valueOf: false,
	};

	const es5 = {
		...es3,
		JSON: false,
	};

	const es2015 = {
		...es5,
		ArrayBuffer: false,
		DataView: false,
		Float32Array: false,
		Float64Array: false,
		Int16Array: false,
		Int32Array: false,
		Int8Array: false,
		Intl: false,
		Map: false,
		Promise: false,
		Proxy: false,
		Reflect: false,
		Set: false,
		Symbol: false,
		Uint16Array: false,
		Uint32Array: false,
		Uint8Array: false,
		Uint8ClampedArray: false,
		WeakMap: false,
		WeakSet: false,
	};

	// no new globals in ES2016
	const es2016 = {
		...es2015,
	};

	const es2017 = {
		...es2016,
		Atomics: false,
		SharedArrayBuffer: false,
	};

	// no new globals in ES2018
	const es2018 = {
		...es2017,
	};

	// no new globals in ES2019
	const es2019 = {
		...es2018,
	};

	const es2020 = {
		...es2019,
		BigInt: false,
		BigInt64Array: false,
		BigUint64Array: false,
		globalThis: false,
	};

	const es2021 = {
		...es2020,
		AggregateError: false,
		FinalizationRegistry: false,
		WeakRef: false,
	};

	const es2022 = {
		...es2021,
	};

	const es2023 = {
		...es2022,
	};

	const es2024 = {
		...es2023,
	};

	const es2025 = {
		...es2024,
	};

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	globals = {
		commonjs,
		es3,
		es5,
		es2015,
		es2016,
		es2017,
		es2018,
		es2019,
		es2020,
		es2021,
		es2022,
		es2023,
		es2024,
		es2025,
	};
	return globals;
}

/**
 * @fileoverview Common utils for directives.
 *
 * This file contains only shared items for directives.
 * If you make a utility for rules, please see `../rules/utils/ast-utils.js`.
 *
 * @author gfyoung <https://github.com/gfyoung>
 */

var directives;
var hasRequiredDirectives;

function requireDirectives () {
	if (hasRequiredDirectives) return directives;
	hasRequiredDirectives = 1;

	const directivesPattern =
		/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u;

	directives = {
		directivesPattern,
	};
	return directives;
}

/**
 * @fileoverview Helpers to debug for code path analysis.
 * @author Toru Nagashima
 */

var debugHelpers;
var hasRequiredDebugHelpers;

function requireDebugHelpers () {
	if (hasRequiredDebugHelpers) return debugHelpers;
	hasRequiredDebugHelpers = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const debug = requireSrc()("eslint:code-path");

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Gets id of a given segment.
	 * @param {CodePathSegment} segment A segment to get.
	 * @returns {string} Id of the segment.
	 */
	/* c8 ignore next */
	// eslint-disable-next-line jsdoc/require-jsdoc -- Ignoring
	function getId(segment) {
		return segment.id + (segment.reachable ? "" : "!");
	}

	/**
	 * Get string for the given node and operation.
	 * @param {ASTNode} node The node to convert.
	 * @param {"enter" | "exit" | undefined} label The operation label.
	 * @returns {string} The string representation.
	 */
	function nodeToString(node, label) {
		const suffix = label ? `:${label}` : "";

		switch (node.type) {
			case "Identifier":
				return `${node.type}${suffix} (${node.name})`;
			case "Literal":
				return `${node.type}${suffix} (${node.value})`;
			default:
				return `${node.type}${suffix}`;
		}
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	debugHelpers = {
		/**
		 * A flag that debug dumping is enabled or not.
		 * @type {boolean}
		 */
		enabled: debug.enabled,

		/**
		 * Dumps given objects.
		 * @param {...any} args objects to dump.
		 * @returns {void}
		 */
		dump: debug,

		/**
		 * Dumps the current analyzing state.
		 * @param {ASTNode} node A node to dump.
		 * @param {CodePathState} state A state to dump.
		 * @param {boolean} leaving A flag whether or not it's leaving
		 * @returns {void}
		 */
		dumpState: !debug.enabled
			? debug
			: /* c8 ignore next */ function (node, state, leaving) {
					for (let i = 0; i < state.currentSegments.length; ++i) {
						const segInternal = state.currentSegments[i].internal;

						if (leaving) {
							const last = segInternal.nodes.length - 1;

							if (
								last >= 0 &&
								segInternal.nodes[last] ===
									nodeToString(node, "enter")
							) {
								segInternal.nodes[last] = nodeToString(
									node,
									void 0,
								);
							} else {
								segInternal.nodes.push(nodeToString(node, "exit"));
							}
						} else {
							segInternal.nodes.push(nodeToString(node, "enter"));
						}
					}

					debug(
						[
							`${state.currentSegments.map(getId).join(",")})`,
							`${node.type}${leaving ? ":exit" : ""}`,
						].join(" "),
					);
				},

		/**
		 * Dumps a DOT code of a given code path.
		 * The DOT code can be visualized with Graphvis.
		 * @param {CodePath} codePath A code path to dump.
		 * @returns {void}
		 * @see http://www.graphviz.org
		 * @see http://www.webgraphviz.com
		 */
		dumpDot: !debug.enabled
			? debug
			: /* c8 ignore next */ function (codePath) {
					let text =
						"\n" +
						"digraph {\n" +
						'node[shape=box,style="rounded,filled",fillcolor=white];\n' +
						'initial[label="",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n';

					if (codePath.returnedSegments.length > 0) {
						text +=
							'final[label="",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n';
					}
					if (codePath.thrownSegments.length > 0) {
						text +=
							'thrown[label="✘",shape=circle,width=0.3,height=0.3,fixedsize=true];\n';
					}

					const traceMap = Object.create(null);
					const arrows = this.makeDotArrows(codePath, traceMap);

					// eslint-disable-next-line guard-for-in -- Want ability to traverse prototype
					for (const id in traceMap) {
						const segment = traceMap[id];

						text += `${id}[`;

						if (segment.reachable) {
							text += 'label="';
						} else {
							text +=
								'style="rounded,dashed,filled",fillcolor="#FF9800",label="<<unreachable>>\\n';
						}

						if (segment.internal.nodes.length > 0) {
							text += segment.internal.nodes.join("\\n");
						} else {
							text += "????";
						}

						text += '"];\n';
					}

					text += `${arrows}\n`;
					text += "}";
					debug("DOT", text);
				},

		/**
		 * Makes a DOT code of a given code path.
		 * The DOT code can be visualized with Graphvis.
		 * @param {CodePath} codePath A code path to make DOT.
		 * @param {Object} traceMap Optional. A map to check whether or not segments had been done.
		 * @returns {string} A DOT code of the code path.
		 */
		makeDotArrows(codePath, traceMap) {
			const stack = [[codePath.initialSegment, 0]];
			const done = traceMap || Object.create(null);
			let lastId = codePath.initialSegment.id;
			let text = `initial->${codePath.initialSegment.id}`;

			while (stack.length > 0) {
				const item = stack.pop();
				const segment = item[0];
				const index = item[1];

				if (done[segment.id] && index === 0) {
					continue;
				}
				done[segment.id] = segment;

				const nextSegment = segment.allNextSegments[index];

				if (!nextSegment) {
					continue;
				}

				if (lastId === segment.id) {
					text += `->${nextSegment.id}`;
				} else {
					text += `;\n${segment.id}->${nextSegment.id}`;
				}
				lastId = nextSegment.id;

				stack.unshift([segment, 1 + index]);
				stack.push([nextSegment, 0]);
			}

			codePath.returnedSegments.forEach(finalSegment => {
				if (lastId === finalSegment.id) {
					text += "->final";
				} else {
					text += `;\n${finalSegment.id}->final`;
				}
				lastId = null;
			});

			codePath.thrownSegments.forEach(finalSegment => {
				if (lastId === finalSegment.id) {
					text += "->thrown";
				} else {
					text += `;\n${finalSegment.id}->thrown`;
				}
				lastId = null;
			});

			return `${text};`;
		},
	};
	return debugHelpers;
}

/**
 * @fileoverview The CodePathSegment class.
 * @author Toru Nagashima
 */

var codePathSegment;
var hasRequiredCodePathSegment;

function requireCodePathSegment () {
	if (hasRequiredCodePathSegment) return codePathSegment;
	hasRequiredCodePathSegment = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const debug = requireDebugHelpers();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given segment is reachable.
	 * @param {CodePathSegment} segment A segment to check.
	 * @returns {boolean} `true` if the segment is reachable.
	 */
	function isReachable(segment) {
		return segment.reachable;
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A code path segment.
	 *
	 * Each segment is arranged in a series of linked lists (implemented by arrays)
	 * that keep track of the previous and next segments in a code path. In this way,
	 * you can navigate between all segments in any code path so long as you have a
	 * reference to any segment in that code path.
	 *
	 * When first created, the segment is in a detached state, meaning that it knows the
	 * segments that came before it but those segments don't know that this new segment
	 * follows it. Only when `CodePathSegment#markUsed()` is called on a segment does it
	 * officially become part of the code path by updating the previous segments to know
	 * that this new segment follows.
	 */
	class CodePathSegment {
		/**
		 * Creates a new instance.
		 * @param {string} id An identifier.
		 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
		 *   This array includes unreachable segments.
		 * @param {boolean} reachable A flag which shows this is reachable.
		 */
		constructor(id, allPrevSegments, reachable) {
			/**
			 * The identifier of this code path.
			 * Rules use it to store additional information of each rule.
			 * @type {string}
			 */
			this.id = id;

			/**
			 * An array of the next reachable segments.
			 * @type {CodePathSegment[]}
			 */
			this.nextSegments = [];

			/**
			 * An array of the previous reachable segments.
			 * @type {CodePathSegment[]}
			 */
			this.prevSegments = allPrevSegments.filter(isReachable);

			/**
			 * An array of all next segments including reachable and unreachable.
			 * @type {CodePathSegment[]}
			 */
			this.allNextSegments = [];

			/**
			 * An array of all previous segments including reachable and unreachable.
			 * @type {CodePathSegment[]}
			 */
			this.allPrevSegments = allPrevSegments;

			/**
			 * A flag which shows this is reachable.
			 * @type {boolean}
			 */
			this.reachable = reachable;

			// Internal data.
			Object.defineProperty(this, "internal", {
				value: {
					// determines if the segment has been attached to the code path
					used: false,

					// array of previous segments coming from the end of a loop
					loopedPrevSegments: [],
				},
			});

			/* c8 ignore start */
			if (debug.enabled) {
				this.internal.nodes = [];
			} /* c8 ignore stop */
		}

		/**
		 * Checks a given previous segment is coming from the end of a loop.
		 * @param {CodePathSegment} segment A previous segment to check.
		 * @returns {boolean} `true` if the segment is coming from the end of a loop.
		 */
		isLoopedPrevSegment(segment) {
			return this.internal.loopedPrevSegments.includes(segment);
		}

		/**
		 * Creates the root segment.
		 * @param {string} id An identifier.
		 * @returns {CodePathSegment} The created segment.
		 */
		static newRoot(id) {
			return new CodePathSegment(id, [], true);
		}

		/**
		 * Creates a new segment and appends it after the given segments.
		 * @param {string} id An identifier.
		 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments
		 *      to append to.
		 * @returns {CodePathSegment} The created segment.
		 */
		static newNext(id, allPrevSegments) {
			return new CodePathSegment(
				id,
				CodePathSegment.flattenUnusedSegments(allPrevSegments),
				allPrevSegments.some(isReachable),
			);
		}

		/**
		 * Creates an unreachable segment and appends it after the given segments.
		 * @param {string} id An identifier.
		 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
		 * @returns {CodePathSegment} The created segment.
		 */
		static newUnreachable(id, allPrevSegments) {
			const segment = new CodePathSegment(
				id,
				CodePathSegment.flattenUnusedSegments(allPrevSegments),
				false,
			);

			/*
			 * In `if (a) return a; foo();` case, the unreachable segment preceded by
			 * the return statement is not used but must not be removed.
			 */
			CodePathSegment.markUsed(segment);

			return segment;
		}

		/**
		 * Creates a segment that follows given segments.
		 * This factory method does not connect with `allPrevSegments`.
		 * But this inherits `reachable` flag.
		 * @param {string} id An identifier.
		 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
		 * @returns {CodePathSegment} The created segment.
		 */
		static newDisconnected(id, allPrevSegments) {
			return new CodePathSegment(id, [], allPrevSegments.some(isReachable));
		}

		/**
		 * Marks a given segment as used.
		 *
		 * And this function registers the segment into the previous segments as a next.
		 * @param {CodePathSegment} segment A segment to mark.
		 * @returns {void}
		 */
		static markUsed(segment) {
			if (segment.internal.used) {
				return;
			}
			segment.internal.used = true;

			let i;

			if (segment.reachable) {
				/*
				 * If the segment is reachable, then it's officially part of the
				 * code path. This loops through all previous segments to update
				 * their list of next segments. Because the segment is reachable,
				 * it's added to both `nextSegments` and `allNextSegments`.
				 */
				for (i = 0; i < segment.allPrevSegments.length; ++i) {
					const prevSegment = segment.allPrevSegments[i];

					prevSegment.allNextSegments.push(segment);
					prevSegment.nextSegments.push(segment);
				}
			} else {
				/*
				 * If the segment is not reachable, then it's not officially part of the
				 * code path. This loops through all previous segments to update
				 * their list of next segments. Because the segment is not reachable,
				 * it's added only to `allNextSegments`.
				 */
				for (i = 0; i < segment.allPrevSegments.length; ++i) {
					segment.allPrevSegments[i].allNextSegments.push(segment);
				}
			}
		}

		/**
		 * Marks a previous segment as looped.
		 * @param {CodePathSegment} segment A segment.
		 * @param {CodePathSegment} prevSegment A previous segment to mark.
		 * @returns {void}
		 */
		static markPrevSegmentAsLooped(segment, prevSegment) {
			segment.internal.loopedPrevSegments.push(prevSegment);
		}

		/**
		 * Creates a new array based on an array of segments. If any segment in the
		 * array is unused, then it is replaced by all of its previous segments.
		 * All used segments are returned as-is without replacement.
		 * @param {CodePathSegment[]} segments The array of segments to flatten.
		 * @returns {CodePathSegment[]} The flattened array.
		 */
		static flattenUnusedSegments(segments) {
			const done = new Set();

			for (let i = 0; i < segments.length; ++i) {
				const segment = segments[i];

				// Ignores duplicated.
				if (done.has(segment)) {
					continue;
				}

				// Use previous segments if unused.
				if (!segment.internal.used) {
					for (let j = 0; j < segment.allPrevSegments.length; ++j) {
						const prevSegment = segment.allPrevSegments[j];

						if (!done.has(prevSegment)) {
							done.add(prevSegment);
						}
					}
				} else {
					done.add(segment);
				}
			}

			return [...done];
		}
	}

	codePathSegment = CodePathSegment;
	return codePathSegment;
}

/**
 * @fileoverview A class to operate forking.
 *
 * This is state of forking.
 * This has a fork list and manages it.
 *
 * @author Toru Nagashima
 */

var forkContext;
var hasRequiredForkContext;

function requireForkContext () {
	if (hasRequiredForkContext) return forkContext;
	hasRequiredForkContext = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const assert = requireAssert(),
		CodePathSegment = requireCodePathSegment();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether or not a given segment is reachable.
	 * @param {CodePathSegment} segment The segment to check.
	 * @returns {boolean} `true` if the segment is reachable.
	 */
	function isReachable(segment) {
		return segment.reachable;
	}

	/**
	 * Creates a new segment for each fork in the given context and appends it
	 * to the end of the specified range of segments. Ultimately, this ends up calling
	 * `new CodePathSegment()` for each of the forks using the `create` argument
	 * as a wrapper around special behavior.
	 *
	 * The `startIndex` and `endIndex` arguments specify a range of segments in
	 * `context` that should become `allPrevSegments` for the newly created
	 * `CodePathSegment` objects.
	 *
	 * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and
	 * `end` is `-1`, this creates two new segments, `[g, h]`. This `g` is appended to
	 * the end of the path from `a`, `c`, and `e`. This `h` is appended to the end of
	 * `b`, `d`, and `f`.
	 * @param {ForkContext} context An instance from which the previous segments
	 *      will be obtained.
	 * @param {number} startIndex The index of the first segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @param {number} endIndex The index of the last segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @param {Function} create A function that creates new `CodePathSegment`
	 *      instances in a particular way. See the `CodePathSegment.new*` methods.
	 * @returns {Array<CodePathSegment>} An array of the newly-created segments.
	 */
	function createSegments(context, startIndex, endIndex, create) {
		/** @type {Array<Array<CodePathSegment>>} */
		const list = context.segmentsList;

		/*
		 * Both `startIndex` and `endIndex` work the same way: if the number is zero
		 * or more, then the number is used as-is. If the number is negative,
		 * then that number is added to the length of the segments list to
		 * determine the index to use. That means -1 for either argument
		 * is the last element, -2 is the second to last, and so on.
		 *
		 * So if `startIndex` is 0, `endIndex` is -1, and `list.length` is 3, the
		 * effective `startIndex` is 0 and the effective `endIndex` is 2, so this function
		 * will include items at indices 0, 1, and 2.
		 *
		 * Therefore, if `startIndex` is -1 and `endIndex` is -1, that means we'll only
		 * be using the last segment in `list`.
		 */
		const normalizedBegin =
			startIndex >= 0 ? startIndex : list.length + startIndex;
		const normalizedEnd = endIndex >= 0 ? endIndex : list.length + endIndex;

		/** @type {Array<CodePathSegment>} */
		const segments = [];

		for (let i = 0; i < context.count; ++i) {
			// this is passed into `new CodePathSegment` to add to code path.
			const allPrevSegments = [];

			for (let j = normalizedBegin; j <= normalizedEnd; ++j) {
				allPrevSegments.push(list[j][i]);
			}

			// note: `create` is just a wrapper that augments `new CodePathSegment`.
			segments.push(create(context.idGenerator.next(), allPrevSegments));
		}

		return segments;
	}

	/**
	 * Inside of a `finally` block we end up with two parallel paths. If the code path
	 * exits by a control statement (such as `break` or `continue`) from the `finally`
	 * block, then we need to merge the remaining parallel paths back into one.
	 * @param {ForkContext} context The fork context to work on.
	 * @param {Array<CodePathSegment>} segments Segments to merge.
	 * @returns {Array<CodePathSegment>} The merged segments.
	 */
	function mergeExtraSegments(context, segments) {
		let currentSegments = segments;

		/*
		 * We need to ensure that the array returned from this function contains no more
		 * than the number of segments that the context allows. `context.count` indicates
		 * how many items should be in the returned array to ensure that the new segment
		 * entries will line up with the already existing segment entries.
		 */
		while (currentSegments.length > context.count) {
			const merged = [];

			/*
			 * Because `context.count` is a factor of 2 inside of a `finally` block,
			 * we can divide the segment count by 2 to merge the paths together.
			 * This loops through each segment in the list and creates a new `CodePathSegment`
			 * that has the segment and the segment two slots away as previous segments.
			 *
			 * If `currentSegments` is [a,b,c,d], this will create new segments e and f, such
			 * that:
			 *
			 * When `i` is 0:
			 * a->e
			 * c->e
			 *
			 * When `i` is 1:
			 * b->f
			 * d->f
			 */
			for (
				let i = 0, length = Math.floor(currentSegments.length / 2);
				i < length;
				++i
			) {
				merged.push(
					CodePathSegment.newNext(context.idGenerator.next(), [
						currentSegments[i],
						currentSegments[i + length],
					]),
				);
			}

			/*
			 * Go through the loop condition one more time to see if we have the
			 * number of segments for the context. If not, we'll keep merging paths
			 * of the merged segments until we get there.
			 */
			currentSegments = merged;
		}

		return currentSegments;
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Manages the forking of code paths.
	 */
	class ForkContext {
		/**
		 * Creates a new instance.
		 * @param {IdGenerator} idGenerator An identifier generator for segments.
		 * @param {ForkContext|null} upper The preceding fork context.
		 * @param {number} count The number of parallel segments in each element
		 *      of `segmentsList`.
		 */
		constructor(idGenerator, upper, count) {
			/**
			 * The ID generator that will generate segment IDs for any new
			 * segments that are created.
			 * @type {IdGenerator}
			 */
			this.idGenerator = idGenerator;

			/**
			 * The preceding fork context.
			 * @type {ForkContext|null}
			 */
			this.upper = upper;

			/**
			 * The number of elements in each element of `segmentsList`. In most
			 * cases, this is 1 but can be 2 when there is a `finally` present,
			 * which forks the code path outside of normal flow. In the case of nested
			 * `finally` blocks, this can be a multiple of 2.
			 * @type {number}
			 */
			this.count = count;

			/**
			 * The segments within this context. Each element in this array has
			 * `count` elements that represent one step in each fork. For example,
			 * when `segmentsList` is `[[a, b], [c, d], [e, f]]`, there is one path
			 * a->c->e and one path b->d->f, and `count` is 2 because each element
			 * is an array with two elements.
			 * @type {Array<Array<CodePathSegment>>}
			 */
			this.segmentsList = [];
		}

		/**
		 * The segments that begin this fork context.
		 * @type {Array<CodePathSegment>}
		 */
		get head() {
			const list = this.segmentsList;

			return list.length === 0 ? [] : list.at(-1);
		}

		/**
		 * Indicates if the context contains no segments.
		 * @type {boolean}
		 */
		get empty() {
			return this.segmentsList.length === 0;
		}

		/**
		 * Indicates if there are any segments that are reachable.
		 * @type {boolean}
		 */
		get reachable() {
			const segments = this.head;

			return segments.length > 0 && segments.some(isReachable);
		}

		/**
		 * Creates new segments in this context and appends them to the end of the
		 * already existing `CodePathSegment`s specified by `startIndex` and
		 * `endIndex`.
		 * @param {number} startIndex The index of the first segment in the context
		 *      that should be specified as previous segments for the newly created segments.
		 * @param {number} endIndex The index of the last segment in the context
		 *      that should be specified as previous segments for the newly created segments.
		 * @returns {Array<CodePathSegment>} An array of the newly created segments.
		 */
		makeNext(startIndex, endIndex) {
			return createSegments(
				this,
				startIndex,
				endIndex,
				CodePathSegment.newNext,
			);
		}

		/**
		 * Creates new unreachable segments in this context and appends them to the end of the
		 * already existing `CodePathSegment`s specified by `startIndex` and
		 * `endIndex`.
		 * @param {number} startIndex The index of the first segment in the context
		 *      that should be specified as previous segments for the newly created segments.
		 * @param {number} endIndex The index of the last segment in the context
		 *      that should be specified as previous segments for the newly created segments.
		 * @returns {Array<CodePathSegment>} An array of the newly created segments.
		 */
		makeUnreachable(startIndex, endIndex) {
			return createSegments(
				this,
				startIndex,
				endIndex,
				CodePathSegment.newUnreachable,
			);
		}

		/**
		 * Creates new segments in this context and does not append them to the end
		 *  of the already existing `CodePathSegment`s specified by `startIndex` and
		 * `endIndex`. The `startIndex` and `endIndex` are only used to determine if
		 * the new segments should be reachable. If any of the segments in this range
		 * are reachable then the new segments are also reachable; otherwise, the new
		 * segments are unreachable.
		 * @param {number} startIndex The index of the first segment in the context
		 *      that should be considered for reachability.
		 * @param {number} endIndex The index of the last segment in the context
		 *      that should be considered for reachability.
		 * @returns {Array<CodePathSegment>} An array of the newly created segments.
		 */
		makeDisconnected(startIndex, endIndex) {
			return createSegments(
				this,
				startIndex,
				endIndex,
				CodePathSegment.newDisconnected,
			);
		}

		/**
		 * Adds segments to the head of this context.
		 * @param {Array<CodePathSegment>} segments The segments to add.
		 * @returns {void}
		 */
		add(segments) {
			assert(
				segments.length >= this.count,
				`${segments.length} >= ${this.count}`,
			);
			this.segmentsList.push(mergeExtraSegments(this, segments));
		}

		/**
		 * Replaces the head segments with the given segments.
		 * The current head segments are removed.
		 * @param {Array<CodePathSegment>} replacementHeadSegments The new head segments.
		 * @returns {void}
		 */
		replaceHead(replacementHeadSegments) {
			assert(
				replacementHeadSegments.length >= this.count,
				`${replacementHeadSegments.length} >= ${this.count}`,
			);
			this.segmentsList.splice(
				-1,
				1,
				mergeExtraSegments(this, replacementHeadSegments),
			);
		}

		/**
		 * Adds all segments of a given fork context into this context.
		 * @param {ForkContext} otherForkContext The fork context to add from.
		 * @returns {void}
		 */
		addAll(otherForkContext) {
			assert(otherForkContext.count === this.count);
			this.segmentsList.push(...otherForkContext.segmentsList);
		}

		/**
		 * Clears all segments in this context.
		 * @returns {void}
		 */
		clear() {
			this.segmentsList = [];
		}

		/**
		 * Creates a new root context, meaning that there are no parent
		 * fork contexts.
		 * @param {IdGenerator} idGenerator An identifier generator for segments.
		 * @returns {ForkContext} New fork context.
		 */
		static newRoot(idGenerator) {
			const context = new ForkContext(idGenerator, null, 1);

			context.add([CodePathSegment.newRoot(idGenerator.next())]);

			return context;
		}

		/**
		 * Creates an empty fork context preceded by a given context.
		 * @param {ForkContext} parentContext The parent fork context.
		 * @param {boolean} shouldForkLeavingPath Indicates that we are inside of
		 *      a `finally` block and should therefore fork the path that leaves
		 *      `finally`.
		 * @returns {ForkContext} New fork context.
		 */
		static newEmpty(parentContext, shouldForkLeavingPath) {
			return new ForkContext(
				parentContext.idGenerator,
				parentContext,
				(shouldForkLeavingPath ? 2 : 1) * parentContext.count,
			);
		}
	}

	forkContext = ForkContext;
	return forkContext;
}

/**
 * @fileoverview A class to manage state of generating a code path.
 * @author Toru Nagashima
 */

var codePathState;
var hasRequiredCodePathState;

function requireCodePathState () {
	if (hasRequiredCodePathState) return codePathState;
	hasRequiredCodePathState = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const CodePathSegment = requireCodePathSegment(),
		ForkContext = requireForkContext();

	//-----------------------------------------------------------------------------
	// Contexts
	//-----------------------------------------------------------------------------

	/**
	 * Represents the context in which a `break` statement can be used.
	 *
	 * A `break` statement without a label is only valid in a few places in
	 * JavaScript: any type of loop or a `switch` statement. Otherwise, `break`
	 * without a label causes a syntax error. For these contexts, `breakable` is
	 * set to `true` to indicate that a `break` without a label is valid.
	 *
	 * However, a `break` statement with a label is also valid inside of a labeled
	 * statement. For example, this is valid:
	 *
	 *     a : {
	 *         break a;
	 *     }
	 *
	 * The `breakable` property is set false for labeled statements to indicate
	 * that `break` without a label is invalid.
	 */
	class BreakContext {
		/**
		 * Creates a new instance.
		 * @param {BreakContext} upperContext The previous `BreakContext`.
		 * @param {boolean} breakable Indicates if we are inside a statement where
		 *      `break` without a label will exit the statement.
		 * @param {string|null} label The label for the statement.
		 * @param {ForkContext} forkContext The current fork context.
		 */
		constructor(upperContext, breakable, label, forkContext) {
			/**
			 * The previous `BreakContext`
			 * @type {BreakContext}
			 */
			this.upper = upperContext;

			/**
			 * Indicates if we are inside a statement where `break` without a label
			 * will exit the statement.
			 * @type {boolean}
			 */
			this.breakable = breakable;

			/**
			 * The label associated with the statement.
			 * @type {string|null}
			 */
			this.label = label;

			/**
			 * The fork context for the `break`.
			 * @type {ForkContext}
			 */
			this.brokenForkContext = ForkContext.newEmpty(forkContext);
		}
	}

	/**
	 * Represents the context for `ChainExpression` nodes.
	 */
	class ChainContext {
		/**
		 * Creates a new instance.
		 * @param {ChainContext} upperContext The previous `ChainContext`.
		 */
		constructor(upperContext) {
			/**
			 * The previous `ChainContext`
			 * @type {ChainContext}
			 */
			this.upper = upperContext;

			/**
			 * The number of choice contexts inside of the `ChainContext`.
			 * @type {number}
			 */
			this.choiceContextCount = 0;
		}
	}

	/**
	 * Represents a choice in the code path.
	 *
	 * Choices are created by logical operators such as `&&`, loops, conditionals,
	 * and `if` statements. This is the point at which the code path has a choice of
	 * which direction to go.
	 *
	 * The result of a choice might be in the left (test) expression of another choice,
	 * and in that case, may create a new fork. For example, `a || b` is a choice
	 * but does not create a new fork because the result of the expression is
	 * not used as the test expression in another expression. In this case,
	 * `isForkingAsResult` is false. In the expression `a || b || c`, the `a || b`
	 * expression appears as the test expression for `|| c`, so the
	 * result of `a || b` creates a fork because execution may or may not
	 * continue to `|| c`. `isForkingAsResult` for `a || b` in this case is true
	 * while `isForkingAsResult` for `|| c` is false. (`isForkingAsResult` is always
	 * false for `if` statements, conditional expressions, and loops.)
	 *
	 * All of the choices except one (`??`) operate on a true/false fork, meaning if
	 * true go one way and if false go the other (tracked by `trueForkContext` and
	 * `falseForkContext`). The `??` operator doesn't operate on true/false because
	 * the left expression is evaluated to be nullish or not, so only if nullish do
	 * we fork to the right expression (tracked by `nullishForkContext`).
	 */
	class ChoiceContext {
		/**
		 * Creates a new instance.
		 * @param {ChoiceContext} upperContext The previous `ChoiceContext`.
		 * @param {string} kind The kind of choice. If it's a logical or assignment expression, this
		 *      is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or
		 *      conditional expression, this is `"test"`; otherwise, this is `"loop"`.
		 * @param {boolean} isForkingAsResult Indicates if the result of the choice
		 *      creates a fork.
		 * @param {ForkContext} forkContext The containing `ForkContext`.
		 */
		constructor(upperContext, kind, isForkingAsResult, forkContext) {
			/**
			 * The previous `ChoiceContext`
			 * @type {ChoiceContext}
			 */
			this.upper = upperContext;

			/**
			 * The kind of choice. If it's a logical or assignment expression, this
			 * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or
			 * conditional expression, this is `"test"`; otherwise, this is `"loop"`.
			 * @type {string}
			 */
			this.kind = kind;

			/**
			 * Indicates if the result of the choice forks the code path.
			 * @type {boolean}
			 */
			this.isForkingAsResult = isForkingAsResult;

			/**
			 * The fork context for the `true` path of the choice.
			 * @type {ForkContext}
			 */
			this.trueForkContext = ForkContext.newEmpty(forkContext);

			/**
			 * The fork context for the `false` path of the choice.
			 * @type {ForkContext}
			 */
			this.falseForkContext = ForkContext.newEmpty(forkContext);

			/**
			 * The fork context for when the choice result is `null` or `undefined`.
			 * @type {ForkContext}
			 */
			this.nullishForkContext = ForkContext.newEmpty(forkContext);

			/**
			 * Indicates if any of `trueForkContext`, `falseForkContext`, or
			 * `nullishForkContext` have been updated with segments from a child context.
			 * @type {boolean}
			 */
			this.processed = false;
		}
	}

	/**
	 * Base class for all loop contexts.
	 */
	class LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string} type The AST node's `type` for the loop.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 */
		constructor(upperContext, type, label, breakContext) {
			/**
			 * The previous `LoopContext`.
			 * @type {LoopContext}
			 */
			this.upper = upperContext;

			/**
			 * The AST node's `type` for the loop.
			 * @type {string}
			 */
			this.type = type;

			/**
			 * The label for the loop from an enclosing `LabeledStatement`.
			 * @type {string|null}
			 */
			this.label = label;

			/**
			 * The fork context for when `break` is encountered.
			 * @type {ForkContext}
			 */
			this.brokenForkContext = breakContext.brokenForkContext;
		}
	}

	/**
	 * Represents the context for a `while` loop.
	 */
	class WhileLoopContext extends LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 */
		constructor(upperContext, label, breakContext) {
			super(upperContext, "WhileStatement", label, breakContext);

			/**
			 * The hardcoded literal boolean test condition for
			 * the loop. Used to catch infinite or skipped loops.
			 * @type {boolean|undefined}
			 */
			this.test = void 0;

			/**
			 * The segments representing the test condition where `continue` will
			 * jump to. The test condition will typically have just one segment but
			 * it's possible for there to be more than one.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.continueDestSegments = null;
		}
	}

	/**
	 * Represents the context for a `do-while` loop.
	 */
	class DoWhileLoopContext extends LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 * @param {ForkContext} forkContext The enclosing fork context.
		 */
		constructor(upperContext, label, breakContext, forkContext) {
			super(upperContext, "DoWhileStatement", label, breakContext);

			/**
			 * The hardcoded literal boolean test condition for
			 * the loop. Used to catch infinite or skipped loops.
			 * @type {boolean|undefined}
			 */
			this.test = void 0;

			/**
			 * The segments at the start of the loop body. This is the only loop
			 * where the test comes at the end, so the first iteration always
			 * happens and we need a reference to the first statements.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.entrySegments = null;

			/**
			 * The fork context to follow when a `continue` is found.
			 * @type {ForkContext}
			 */
			this.continueForkContext = ForkContext.newEmpty(forkContext);
		}
	}

	/**
	 * Represents the context for a `for` loop.
	 */
	class ForLoopContext extends LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 */
		constructor(upperContext, label, breakContext) {
			super(upperContext, "ForStatement", label, breakContext);

			/**
			 * The hardcoded literal boolean test condition for
			 * the loop. Used to catch infinite or skipped loops.
			 * @type {boolean|undefined}
			 */
			this.test = void 0;

			/**
			 * The end of the init expression. This may change during the lifetime
			 * of the instance as we traverse the loop because some loops don't have
			 * an init expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.endOfInitSegments = null;

			/**
			 * The start of the test expression. This may change during the lifetime
			 * of the instance as we traverse the loop because some loops don't have
			 * a test expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.testSegments = null;

			/**
			 * The end of the test expression. This may change during the lifetime
			 * of the instance as we traverse the loop because some loops don't have
			 * a test expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.endOfTestSegments = null;

			/**
			 * The start of the update expression. This may change during the lifetime
			 * of the instance as we traverse the loop because some loops don't have
			 * an update expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.updateSegments = null;

			/**
			 * The end of the update expresion. This may change during the lifetime
			 * of the instance as we traverse the loop because some loops don't have
			 * an update expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.endOfUpdateSegments = null;

			/**
			 * The segments representing the test condition where `continue` will
			 * jump to. The test condition will typically have just one segment but
			 * it's possible for there to be more than one. This may change during the
			 * lifetime of the instance as we traverse the loop because some loops
			 * don't have an update expression. When there is an update expression, this
			 * will end up pointing to that expression; otherwise it will end up pointing
			 * to the test expression.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.continueDestSegments = null;
		}
	}

	/**
	 * Represents the context for a `for-in` loop.
	 *
	 * Terminology:
	 * - "left" means the part of the loop to the left of the `in` keyword. For
	 *   example, in `for (var x in y)`, the left is `var x`.
	 * - "right" means the part of the loop to the right of the `in` keyword. For
	 *   example, in `for (var x in y)`, the right is `y`.
	 */
	class ForInLoopContext extends LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 */
		constructor(upperContext, label, breakContext) {
			super(upperContext, "ForInStatement", label, breakContext);

			/**
			 * The segments that came immediately before the start of the loop.
			 * This allows you to traverse backwards out of the loop into the
			 * surrounding code. This is necessary to evaluate the right expression
			 * correctly, as it must be evaluated in the same way as the left
			 * expression, but the pointer to these segments would otherwise be
			 * lost if not stored on the instance. Once the right expression has
			 * been evaluated, this property is no longer used.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.prevSegments = null;

			/**
			 * Segments representing the start of everything to the left of the
			 * `in` keyword. This can be used to move forward towards
			 * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are
			 * effectively the head and tail of a doubly-linked list.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.leftSegments = null;

			/**
			 * Segments representing the end of everything to the left of the
			 * `in` keyword. This can be used to move backward towards `leftSegments`.
			 * `leftSegments` and `endOfLeftSegments` are effectively the head
			 * and tail of a doubly-linked list.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.endOfLeftSegments = null;

			/**
			 * The segments representing the left expression where `continue` will
			 * jump to. In `for-in` loops, `continue` must always re-execute the
			 * left expression each time through the loop. This contains the same
			 * segments as `leftSegments`, but is duplicated here so each loop
			 * context has the same property pointing to where `continue` should
			 * end up.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.continueDestSegments = null;
		}
	}

	/**
	 * Represents the context for a `for-of` loop.
	 */
	class ForOfLoopContext extends LoopContextBase {
		/**
		 * Creates a new instance.
		 * @param {LoopContext|null} upperContext The previous `LoopContext`.
		 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
		 * @param {BreakContext} breakContext The context for breaking the loop.
		 */
		constructor(upperContext, label, breakContext) {
			super(upperContext, "ForOfStatement", label, breakContext);

			/**
			 * The segments that came immediately before the start of the loop.
			 * This allows you to traverse backwards out of the loop into the
			 * surrounding code. This is necessary to evaluate the right expression
			 * correctly, as it must be evaluated in the same way as the left
			 * expression, but the pointer to these segments would otherwise be
			 * lost if not stored on the instance. Once the right expression has
			 * been evaluated, this property is no longer used.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.prevSegments = null;

			/**
			 * Segments representing the start of everything to the left of the
			 * `of` keyword. This can be used to move forward towards
			 * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are
			 * effectively the head and tail of a doubly-linked list.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.leftSegments = null;

			/**
			 * Segments representing the end of everything to the left of the
			 * `of` keyword. This can be used to move backward towards `leftSegments`.
			 * `leftSegments` and `endOfLeftSegments` are effectively the head
			 * and tail of a doubly-linked list.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.endOfLeftSegments = null;

			/**
			 * The segments representing the left expression where `continue` will
			 * jump to. In `for-in` loops, `continue` must always re-execute the
			 * left expression each time through the loop. This contains the same
			 * segments as `leftSegments`, but is duplicated here so each loop
			 * context has the same property pointing to where `continue` should
			 * end up.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.continueDestSegments = null;
		}
	}

	/**
	 * Represents the context for any loop.
	 * @typedef {WhileLoopContext|DoWhileLoopContext|ForLoopContext|ForInLoopContext|ForOfLoopContext} LoopContext
	 */

	/**
	 * Represents the context for a `switch` statement.
	 */
	class SwitchContext {
		/**
		 * Creates a new instance.
		 * @param {SwitchContext} upperContext The previous context.
		 * @param {boolean} hasCase Indicates if there is at least one `case` statement.
		 *      `default` doesn't count.
		 */
		constructor(upperContext, hasCase) {
			/**
			 * The previous context.
			 * @type {SwitchContext}
			 */
			this.upper = upperContext;

			/**
			 * Indicates if there is at least one `case` statement. `default` doesn't count.
			 * @type {boolean}
			 */
			this.hasCase = hasCase;

			/**
			 * The `default` keyword.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.defaultSegments = null;

			/**
			 * The default case body starting segments.
			 * @type {Array<CodePathSegment>|null}
			 */
			this.defaultBodySegments = null;

			/**
			 * Indicates if a `default` case and is empty exists.
			 * @type {boolean}
			 */
			this.foundEmptyDefault = false;

			/**
			 * Indicates that a `default` exists and is the last case.
			 * @type {boolean}
			 */
			this.lastIsDefault = false;

			/**
			 * The number of fork contexts created. This is equivalent to the
			 * number of `case` statements plus a `default` statement (if present).
			 * @type {number}
			 */
			this.forkCount = 0;
		}
	}

	/**
	 * Represents the context for a `try` statement.
	 */
	class TryContext {
		/**
		 * Creates a new instance.
		 * @param {TryContext} upperContext The previous context.
		 * @param {boolean} hasFinalizer Indicates if the `try` statement has a
		 *      `finally` block.
		 * @param {ForkContext} forkContext The enclosing fork context.
		 */
		constructor(upperContext, hasFinalizer, forkContext) {
			/**
			 * The previous context.
			 * @type {TryContext}
			 */
			this.upper = upperContext;

			/**
			 * Indicates if the `try` statement has a `finally` block.
			 * @type {boolean}
			 */
			this.hasFinalizer = hasFinalizer;

			/**
			 * Tracks the traversal position inside of the `try` statement. This is
			 * used to help determine the context necessary to create paths because
			 * a `try` statement may or may not have `catch` or `finally` blocks,
			 * and code paths behave differently in those blocks.
			 * @type {"try"|"catch"|"finally"}
			 */
			this.position = "try";

			/**
			 * If the `try` statement has a `finally` block, this affects how a
			 * `return` statement behaves in the `try` block. Without `finally`,
			 * `return` behaves as usual and doesn't require a fork; with `finally`,
			 * `return` forks into the `finally` block, so we need a fork context
			 * to track it.
			 * @type {ForkContext|null}
			 */
			this.returnedForkContext = hasFinalizer
				? ForkContext.newEmpty(forkContext)
				: null;

			/**
			 * When a `throw` occurs inside of a `try` block, the code path forks
			 * into the `catch` or `finally` blocks, and this fork context tracks
			 * that path.
			 * @type {ForkContext}
			 */
			this.thrownForkContext = ForkContext.newEmpty(forkContext);

			/**
			 * Indicates if the last segment in the `try` block is reachable.
			 * @type {boolean}
			 */
			this.lastOfTryIsReachable = false;

			/**
			 * Indicates if the last segment in the `catch` block is reachable.
			 * @type {boolean}
			 */
			this.lastOfCatchIsReachable = false;
		}
	}

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Adds given segments into the `dest` array.
	 * If the `others` array does not include the given segments, adds to the `all`
	 * array as well.
	 *
	 * This adds only reachable and used segments.
	 * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`).
	 * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`).
	 * @param {CodePathSegment[]} all The unified destination array (`finalSegments`).
	 * @param {CodePathSegment[]} segments Segments to add.
	 * @returns {void}
	 */
	function addToReturnedOrThrown(dest, others, all, segments) {
		for (let i = 0; i < segments.length; ++i) {
			const segment = segments[i];

			dest.push(segment);
			if (!others.includes(segment)) {
				all.push(segment);
			}
		}
	}

	/**
	 * Gets a loop context for a `continue` statement based on a given label.
	 * @param {CodePathState} state The state to search within.
	 * @param {string|null} label The label of a `continue` statement.
	 * @returns {LoopContext} A loop-context for a `continue` statement.
	 */
	function getContinueContext(state, label) {
		if (!label) {
			return state.loopContext;
		}

		let context = state.loopContext;

		while (context) {
			if (context.label === label) {
				return context;
			}
			context = context.upper;
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Gets a context for a `break` statement.
	 * @param {CodePathState} state The state to search within.
	 * @param {string|null} label The label of a `break` statement.
	 * @returns {BreakContext} A context for a `break` statement.
	 */
	function getBreakContext(state, label) {
		let context = state.breakContext;

		while (context) {
			if (label ? context.label === label : context.breakable) {
				return context;
			}
			context = context.upper;
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Gets a context for a `return` statement. There is just one special case:
	 * if there is a `try` statement with a `finally` block, because that alters
	 * how `return` behaves; otherwise, this just passes through the given state.
	 * @param {CodePathState} state The state to search within
	 * @returns {TryContext|CodePathState} A context for a `return` statement.
	 */
	function getReturnContext(state) {
		let context = state.tryContext;

		while (context) {
			if (context.hasFinalizer && context.position !== "finally") {
				return context;
			}
			context = context.upper;
		}

		return state;
	}

	/**
	 * Gets a context for a `throw` statement. There is just one special case:
	 * if there is a `try` statement with a `finally` block and we are inside of
	 * a `catch` because that changes how `throw` behaves; otherwise, this just
	 * passes through the given state.
	 * @param {CodePathState} state The state to search within.
	 * @returns {TryContext|CodePathState} A context for a `throw` statement.
	 */
	function getThrowContext(state) {
		let context = state.tryContext;

		while (context) {
			if (
				context.position === "try" ||
				(context.hasFinalizer && context.position === "catch")
			) {
				return context;
			}
			context = context.upper;
		}

		return state;
	}

	/**
	 * Removes a given value from a given array.
	 * @param {any[]} elements An array to remove the specific element.
	 * @param {any} value The value to be removed.
	 * @returns {void}
	 */
	function removeFromArray(elements, value) {
		elements.splice(elements.indexOf(value), 1);
	}

	/**
	 * Disconnect given segments.
	 *
	 * This is used in a process for switch statements.
	 * If there is the "default" chunk before other cases, the order is different
	 * between node's and running's.
	 * @param {CodePathSegment[]} prevSegments Forward segments to disconnect.
	 * @param {CodePathSegment[]} nextSegments Backward segments to disconnect.
	 * @returns {void}
	 */
	function disconnectSegments(prevSegments, nextSegments) {
		for (let i = 0; i < prevSegments.length; ++i) {
			const prevSegment = prevSegments[i];
			const nextSegment = nextSegments[i];

			removeFromArray(prevSegment.nextSegments, nextSegment);
			removeFromArray(prevSegment.allNextSegments, nextSegment);
			removeFromArray(nextSegment.prevSegments, prevSegment);
			removeFromArray(nextSegment.allPrevSegments, prevSegment);
		}
	}

	/**
	 * Creates looping path between two arrays of segments, ensuring that there are
	 * paths going between matching segments in the arrays.
	 * @param {CodePathState} state The state to operate on.
	 * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source.
	 * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination.
	 * @returns {void}
	 */
	function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) {
		const fromSegments = CodePathSegment.flattenUnusedSegments(
			unflattenedFromSegments,
		);
		const toSegments = CodePathSegment.flattenUnusedSegments(
			unflattenedToSegments,
		);
		const end = Math.min(fromSegments.length, toSegments.length);

		/*
		 * This loop effectively updates a doubly-linked list between two collections
		 * of segments making sure that segments in the same array indices are
		 * combined to create a path.
		 */
		for (let i = 0; i < end; ++i) {
			// get the segments in matching array indices
			const fromSegment = fromSegments[i];
			const toSegment = toSegments[i];

			/*
			 * If the destination segment is reachable, then create a path from the
			 * source segment to the destination segment.
			 */
			if (toSegment.reachable) {
				fromSegment.nextSegments.push(toSegment);
			}

			/*
			 * If the source segment is reachable, then create a path from the
			 * destination segment back to the source segment.
			 */
			if (fromSegment.reachable) {
				toSegment.prevSegments.push(fromSegment);
			}

			/*
			 * Also update the arrays that don't care if the segments are reachable
			 * or not. This should always happen regardless of anything else.
			 */
			fromSegment.allNextSegments.push(toSegment);
			toSegment.allPrevSegments.push(fromSegment);

			/*
			 * If the destination segment has at least two previous segments in its
			 * path then that means there was one previous segment before this iteration
			 * of the loop was executed. So, we need to mark the source segment as
			 * looped.
			 */
			if (toSegment.allPrevSegments.length >= 2) {
				CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
			}

			// let the code path analyzer know that there's been a loop created
			state.notifyLooped(fromSegment, toSegment);
		}
	}

	/**
	 * Finalizes segments of `test` chunk of a ForStatement.
	 *
	 * - Adds `false` paths to paths which are leaving from the loop.
	 * - Sets `true` paths to paths which go to the body.
	 * @param {LoopContext} context A loop context to modify.
	 * @param {ChoiceContext} choiceContext A choice context of this loop.
	 * @param {CodePathSegment[]} head The current head paths.
	 * @returns {void}
	 */
	function finalizeTestSegmentsOfFor(context, choiceContext, head) {
		/*
		 * If this choice context doesn't already contain paths from a
		 * child context, then add the current head to each potential path.
		 */
		if (!choiceContext.processed) {
			choiceContext.trueForkContext.add(head);
			choiceContext.falseForkContext.add(head);
			choiceContext.nullishForkContext.add(head);
		}

		/*
		 * If the test condition isn't a hardcoded truthy value, then `break`
		 * must follow the same path as if the test condition is false. To represent
		 * that, we append the path for when the loop test is false (represented by
		 * `falseForkContext`) to the `brokenForkContext`.
		 */
		if (context.test !== true) {
			context.brokenForkContext.addAll(choiceContext.falseForkContext);
		}

		context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1);
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A class which manages state to analyze code paths.
	 */
	class CodePathState {
		/**
		 * Creates a new instance.
		 * @param {IdGenerator} idGenerator An id generator to generate id for code
		 *   path segments.
		 * @param {Function} onLooped A callback function to notify looping.
		 */
		constructor(idGenerator, onLooped) {
			/**
			 * The ID generator to use when creating new segments.
			 * @type {IdGenerator}
			 */
			this.idGenerator = idGenerator;

			/**
			 * A callback function to call when there is a loop.
			 * @type {Function}
			 */
			this.notifyLooped = onLooped;

			/**
			 * The root fork context for this state.
			 * @type {ForkContext}
			 */
			this.forkContext = ForkContext.newRoot(idGenerator);

			/**
			 * Context for logical expressions, conditional expressions, `if` statements,
			 * and loops.
			 * @type {ChoiceContext}
			 */
			this.choiceContext = null;

			/**
			 * Context for `switch` statements.
			 * @type {SwitchContext}
			 */
			this.switchContext = null;

			/**
			 * Context for `try` statements.
			 * @type {TryContext}
			 */
			this.tryContext = null;

			/**
			 * Context for loop statements.
			 * @type {LoopContext}
			 */
			this.loopContext = null;

			/**
			 * Context for `break` statements.
			 * @type {BreakContext}
			 */
			this.breakContext = null;

			/**
			 * Context for `ChainExpression` nodes.
			 * @type {ChainContext}
			 */
			this.chainContext = null;

			/**
			 * An array that tracks the current segments in the state. The array
			 * starts empty and segments are added with each `onCodePathSegmentStart`
			 * event and removed with each `onCodePathSegmentEnd` event. Effectively,
			 * this is tracking the code path segment traversal as the state is
			 * modified.
			 * @type {Array<CodePathSegment>}
			 */
			this.currentSegments = [];

			/**
			 * Tracks the starting segment for this path. This value never changes.
			 * @type {CodePathSegment}
			 */
			this.initialSegment = this.forkContext.head[0];

			/**
			 * The final segments of the code path which are either `return` or `throw`.
			 * This is a union of the segments in `returnedForkContext` and `thrownForkContext`.
			 * @type {Array<CodePathSegment>}
			 */
			this.finalSegments = [];

			/**
			 * The final segments of the code path which are `return`. These
			 * segments are also contained in `finalSegments`.
			 * @type {Array<CodePathSegment>}
			 */
			this.returnedForkContext = [];

			/**
			 * The final segments of the code path which are `throw`. These
			 * segments are also contained in `finalSegments`.
			 * @type {Array<CodePathSegment>}
			 */
			this.thrownForkContext = [];

			/*
			 * We add an `add` method so that these look more like fork contexts and
			 * can be used interchangeably when a fork context is needed to add more
			 * segments to a path.
			 *
			 * Ultimately, we want anything added to `returned` or `thrown` to also
			 * be added to `final`. We only add reachable and used segments to these
			 * arrays.
			 */
			const final = this.finalSegments;
			const returned = this.returnedForkContext;
			const thrown = this.thrownForkContext;

			returned.add = addToReturnedOrThrown.bind(
				null,
				returned,
				thrown,
				final,
			);
			thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final);
		}

		/**
		 * A passthrough property exposing the current pointer as part of the API.
		 * @type {CodePathSegment[]}
		 */
		get headSegments() {
			return this.forkContext.head;
		}

		/**
		 * The parent forking context.
		 * This is used for the root of new forks.
		 * @type {ForkContext}
		 */
		get parentForkContext() {
			const current = this.forkContext;

			return current && current.upper;
		}

		/**
		 * Creates and stacks new forking context.
		 * @param {boolean} forkLeavingPath A flag which shows being in a
		 *   "finally" block.
		 * @returns {ForkContext} The created context.
		 */
		pushForkContext(forkLeavingPath) {
			this.forkContext = ForkContext.newEmpty(
				this.forkContext,
				forkLeavingPath,
			);

			return this.forkContext;
		}

		/**
		 * Pops and merges the last forking context.
		 * @returns {ForkContext} The last context.
		 */
		popForkContext() {
			const lastContext = this.forkContext;

			this.forkContext = lastContext.upper;
			this.forkContext.replaceHead(lastContext.makeNext(0, -1));

			return lastContext;
		}

		/**
		 * Creates a new path.
		 * @returns {void}
		 */
		forkPath() {
			this.forkContext.add(this.parentForkContext.makeNext(-1, -1));
		}

		/**
		 * Creates a bypass path.
		 * This is used for such as IfStatement which does not have "else" chunk.
		 * @returns {void}
		 */
		forkBypassPath() {
			this.forkContext.add(this.parentForkContext.head);
		}

		//--------------------------------------------------------------------------
		// ConditionalExpression, LogicalExpression, IfStatement
		//--------------------------------------------------------------------------

		/**
		 * Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only),
		 * IfStatement, WhileStatement, DoWhileStatement, or ForStatement.
		 *
		 * LogicalExpressions have cases that it goes different paths between the
		 * `true` case and the `false` case.
		 *
		 * For Example:
		 *
		 *     if (a || b) {
		 *         foo();
		 *     } else {
		 *         bar();
		 *     }
		 *
		 * In this case, `b` is evaluated always in the code path of the `else`
		 * block, but it's not so in the code path of the `if` block.
		 * So there are 3 paths.
		 *
		 *     a -> foo();
		 *     a -> b -> foo();
		 *     a -> b -> bar();
		 * @param {string} kind A kind string.
		 *   If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`.
		 *   If it's IfStatement's or ConditionalExpression's, this is `"test"`.
		 *   Otherwise, this is `"loop"`.
		 * @param {boolean} isForkingAsResult Indicates if the result of the choice
		 *      creates a fork.
		 * @returns {void}
		 */
		pushChoiceContext(kind, isForkingAsResult) {
			this.choiceContext = new ChoiceContext(
				this.choiceContext,
				kind,
				isForkingAsResult,
				this.forkContext,
			);
		}

		/**
		 * Pops the last choice context and finalizes it.
		 * This is called upon leaving a node that represents a choice.
		 * @throws {Error} (Unreachable.)
		 * @returns {ChoiceContext} The popped context.
		 */
		popChoiceContext() {
			const poppedChoiceContext = this.choiceContext;
			const forkContext = this.forkContext;
			const head = forkContext.head;

			this.choiceContext = poppedChoiceContext.upper;

			switch (poppedChoiceContext.kind) {
				case "&&":
				case "||":
				case "??":
					/*
					 * The `head` are the path of the right-hand operand.
					 * If we haven't previously added segments from child contexts,
					 * then we add these segments to all possible forks.
					 */
					if (!poppedChoiceContext.processed) {
						poppedChoiceContext.trueForkContext.add(head);
						poppedChoiceContext.falseForkContext.add(head);
						poppedChoiceContext.nullishForkContext.add(head);
					}

					/*
					 * If this context is the left (test) expression for another choice
					 * context, such as `a || b` in the expression `a || b || c`,
					 * then we take the segments for this context and move them up
					 * to the parent context.
					 */
					if (poppedChoiceContext.isForkingAsResult) {
						const parentContext = this.choiceContext;

						parentContext.trueForkContext.addAll(
							poppedChoiceContext.trueForkContext,
						);
						parentContext.falseForkContext.addAll(
							poppedChoiceContext.falseForkContext,
						);
						parentContext.nullishForkContext.addAll(
							poppedChoiceContext.nullishForkContext,
						);
						parentContext.processed = true;

						// Exit early so we don't collapse all paths into one.
						return poppedChoiceContext;
					}

					break;

				case "test":
					if (!poppedChoiceContext.processed) {
						/*
						 * The head segments are the path of the `if` block here.
						 * Updates the `true` path with the end of the `if` block.
						 */
						poppedChoiceContext.trueForkContext.clear();
						poppedChoiceContext.trueForkContext.add(head);
					} else {
						/*
						 * The head segments are the path of the `else` block here.
						 * Updates the `false` path with the end of the `else`
						 * block.
						 */
						poppedChoiceContext.falseForkContext.clear();
						poppedChoiceContext.falseForkContext.add(head);
					}

					break;

				case "loop":
					/*
					 * Loops are addressed in `popLoopContext()` so just return
					 * the context without modification.
					 */
					return poppedChoiceContext;

				/* c8 ignore next */
				default:
					throw new Error("unreachable");
			}

			/*
			 * Merge the true path with the false path to create a single path.
			 */
			const combinedForkContext = poppedChoiceContext.trueForkContext;

			combinedForkContext.addAll(poppedChoiceContext.falseForkContext);
			forkContext.replaceHead(combinedForkContext.makeNext(0, -1));

			return poppedChoiceContext;
		}

		/**
		 * Creates a code path segment to represent right-hand operand of a logical
		 * expression.
		 * This is called in the preprocessing phase when entering a node.
		 * @throws {Error} (Unreachable.)
		 * @returns {void}
		 */
		makeLogicalRight() {
			const currentChoiceContext = this.choiceContext;
			const forkContext = this.forkContext;

			if (currentChoiceContext.processed) {
				/*
				 * This context was already assigned segments from a child
				 * choice context. In this case, we are concerned only about
				 * the path that does not short-circuit and so ends up on the
				 * right-hand operand of the logical expression.
				 */
				let prevForkContext;

				switch (currentChoiceContext.kind) {
					case "&&": // if true then go to the right-hand side.
						prevForkContext = currentChoiceContext.trueForkContext;
						break;
					case "||": // if false then go to the right-hand side.
						prevForkContext = currentChoiceContext.falseForkContext;
						break;
					case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's nullishForkContext.
						prevForkContext = currentChoiceContext.nullishForkContext;
						break;
					default:
						throw new Error("unreachable");
				}

				/*
				 * Create the segment for the right-hand operand of the logical expression
				 * and adjust the fork context pointer to point there. The right-hand segment
				 * is added at the end of all segments in `prevForkContext`.
				 */
				forkContext.replaceHead(prevForkContext.makeNext(0, -1));

				/*
				 * We no longer need this list of segments.
				 *
				 * Reset `processed` because we've removed the segments from the child
				 * choice context. This allows `popChoiceContext()` to continue adding
				 * segments later.
				 */
				prevForkContext.clear();
				currentChoiceContext.processed = false;
			} else {
				/*
				 * This choice context was not assigned segments from a child
				 * choice context, which means that it's a terminal logical
				 * expression.
				 *
				 * `head` is the segments for the left-hand operand of the
				 * logical expression.
				 *
				 * Each of the fork contexts below are empty at this point. We choose
				 * the path(s) that will short-circuit and add the segment for the
				 * left-hand operand to it. Ultimately, this will be the only segment
				 * in that path due to the short-circuting, so we are just seeding
				 * these paths to start.
				 */
				switch (currentChoiceContext.kind) {
					case "&&":
						/*
						 * In most contexts, when a && expression evaluates to false,
						 * it short circuits, so we need to account for that by setting
						 * the `falseForkContext` to the left operand.
						 *
						 * When a && expression is the left-hand operand for a ??
						 * expression, such as `(a && b) ?? c`, a nullish value will
						 * also short-circuit in a different way than a false value,
						 * so we also set the `nullishForkContext` to the left operand.
						 * This path is only used with a ?? expression and is thrown
						 * away for any other type of logical expression, so it's safe
						 * to always add.
						 */
						currentChoiceContext.falseForkContext.add(forkContext.head);
						currentChoiceContext.nullishForkContext.add(
							forkContext.head,
						);
						break;
					case "||": // the true path can short-circuit.
						currentChoiceContext.trueForkContext.add(forkContext.head);
						break;
					case "??": // both can short-circuit.
						currentChoiceContext.trueForkContext.add(forkContext.head);
						currentChoiceContext.falseForkContext.add(forkContext.head);
						break;
					default:
						throw new Error("unreachable");
				}

				/*
				 * Create the segment for the right-hand operand of the logical expression
				 * and adjust the fork context pointer to point there.
				 */
				forkContext.replaceHead(forkContext.makeNext(-1, -1));
			}
		}

		/**
		 * Makes a code path segment of the `if` block.
		 * @returns {void}
		 */
		makeIfConsequent() {
			const context = this.choiceContext;
			const forkContext = this.forkContext;

			/*
			 * If any result were not transferred from child contexts,
			 * this sets the head segments to both cases.
			 * The head segments are the path of the test expression.
			 */
			if (!context.processed) {
				context.trueForkContext.add(forkContext.head);
				context.falseForkContext.add(forkContext.head);
				context.nullishForkContext.add(forkContext.head);
			}

			context.processed = false;

			// Creates new path from the `true` case.
			forkContext.replaceHead(context.trueForkContext.makeNext(0, -1));
		}

		/**
		 * Makes a code path segment of the `else` block.
		 * @returns {void}
		 */
		makeIfAlternate() {
			const context = this.choiceContext;
			const forkContext = this.forkContext;

			/*
			 * The head segments are the path of the `if` block.
			 * Updates the `true` path with the end of the `if` block.
			 */
			context.trueForkContext.clear();
			context.trueForkContext.add(forkContext.head);
			context.processed = true;

			// Creates new path from the `false` case.
			forkContext.replaceHead(context.falseForkContext.makeNext(0, -1));
		}

		//--------------------------------------------------------------------------
		// ChainExpression
		//--------------------------------------------------------------------------

		/**
		 * Pushes a new `ChainExpression` context to the stack. This method is
		 * called when entering a `ChainExpression` node. A chain context is used to
		 * count forking in the optional chain then merge them on the exiting from the
		 * `ChainExpression` node.
		 * @returns {void}
		 */
		pushChainContext() {
			this.chainContext = new ChainContext(this.chainContext);
		}

		/**
		 * Pop a `ChainExpression` context from the stack. This method is called on
		 * exiting from each `ChainExpression` node. This merges all forks of the
		 * last optional chaining.
		 * @returns {void}
		 */
		popChainContext() {
			const context = this.chainContext;

			this.chainContext = context.upper;

			// pop all choice contexts of this.
			for (let i = context.choiceContextCount; i > 0; --i) {
				this.popChoiceContext();
			}
		}

		/**
		 * Create a choice context for optional access.
		 * This method is called on entering to each `(Call|Member)Expression[optional=true]` node.
		 * This creates a choice context as similar to `LogicalExpression[operator="??"]` node.
		 * @returns {void}
		 */
		makeOptionalNode() {
			if (this.chainContext) {
				this.chainContext.choiceContextCount += 1;
				this.pushChoiceContext("??", false);
			}
		}

		/**
		 * Create a fork.
		 * This method is called on entering to the `arguments|property` property of each `(Call|Member)Expression` node.
		 * @returns {void}
		 */
		makeOptionalRight() {
			if (this.chainContext) {
				this.makeLogicalRight();
			}
		}

		//--------------------------------------------------------------------------
		// SwitchStatement
		//--------------------------------------------------------------------------

		/**
		 * Creates a context object of SwitchStatement and stacks it.
		 * @param {boolean} hasCase `true` if the switch statement has one or more
		 *   case parts.
		 * @param {string|null} label The label text.
		 * @returns {void}
		 */
		pushSwitchContext(hasCase, label) {
			this.switchContext = new SwitchContext(this.switchContext, hasCase);
			this.pushBreakContext(true, label);
		}

		/**
		 * Pops the last context of SwitchStatement and finalizes it.
		 *
		 * - Disposes all forking stack for `case` and `default`.
		 * - Creates the next code path segment from `context.brokenForkContext`.
		 * - If the last `SwitchCase` node is not a `default` part, creates a path
		 *   to the `default` body.
		 * @returns {void}
		 */
		popSwitchContext() {
			const context = this.switchContext;

			this.switchContext = context.upper;

			const forkContext = this.forkContext;
			const brokenForkContext = this.popBreakContext().brokenForkContext;

			if (context.forkCount === 0) {
				/*
				 * When there is only one `default` chunk and there is one or more
				 * `break` statements, even if forks are nothing, it needs to merge
				 * those.
				 */
				if (!brokenForkContext.empty) {
					brokenForkContext.add(forkContext.makeNext(-1, -1));
					forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
				}

				return;
			}

			const lastSegments = forkContext.head;

			this.forkBypassPath();
			const lastCaseSegments = forkContext.head;

			/*
			 * `brokenForkContext` is used to make the next segment.
			 * It must add the last segment into `brokenForkContext`.
			 */
			brokenForkContext.add(lastSegments);

			/*
			 * Any value that doesn't match a `case` test should flow to the default
			 * case. That happens normally when the default case is last in the `switch`,
			 * but if it's not, we need to rewire some of the paths to be correct.
			 */
			if (!context.lastIsDefault) {
				if (context.defaultBodySegments) {
					/*
					 * There is a non-empty default case, so remove the path from the `default`
					 * label to its body for an accurate representation.
					 */
					disconnectSegments(
						context.defaultSegments,
						context.defaultBodySegments,
					);

					/*
					 * Connect the path from the last non-default case to the body of the
					 * default case.
					 */
					makeLooped(this, lastCaseSegments, context.defaultBodySegments);
				} else {
					/*
					 * There is no default case, so we treat this as if the last case
					 * had a `break` in it.
					 */
					brokenForkContext.add(lastCaseSegments);
				}
			}

			// Traverse up to the original fork context for the `switch` statement
			for (let i = 0; i < context.forkCount; ++i) {
				this.forkContext = this.forkContext.upper;
			}

			/*
			 * Creates a path from all `brokenForkContext` paths.
			 * This is a path after `switch` statement.
			 */
			this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
		}

		/**
		 * Makes a code path segment for a `SwitchCase` node.
		 * @param {boolean} isCaseBodyEmpty `true` if the body is empty.
		 * @param {boolean} isDefaultCase `true` if the body is the default case.
		 * @returns {void}
		 */
		makeSwitchCaseBody(isCaseBodyEmpty, isDefaultCase) {
			const context = this.switchContext;

			if (!context.hasCase) {
				return;
			}

			/*
			 * Merge forks.
			 * The parent fork context has two segments.
			 * Those are from the current `case` and the body of the previous case.
			 */
			const parentForkContext = this.forkContext;
			const forkContext = this.pushForkContext();

			forkContext.add(parentForkContext.makeNext(0, -1));

			/*
			 * Add information about the default case.
			 *
			 * The purpose of this is to identify the starting segments for the
			 * default case to make sure there is a path there.
			 */
			if (isDefaultCase) {
				/*
				 * This is the default case in the `switch`.
				 *
				 * We first save the current pointer as `defaultSegments` to point
				 * to the `default` keyword.
				 */
				context.defaultSegments = parentForkContext.head;

				/*
				 * If the body of the case is empty then we just set
				 * `foundEmptyDefault` to true; otherwise, we save a reference
				 * to the current pointer as `defaultBodySegments`.
				 */
				if (isCaseBodyEmpty) {
					context.foundEmptyDefault = true;
				} else {
					context.defaultBodySegments = forkContext.head;
				}
			} else {
				/*
				 * This is not the default case in the `switch`.
				 *
				 * If it's not empty and there is already an empty default case found,
				 * that means the default case actually comes before this case,
				 * and that it will fall through to this case. So, we can now
				 * ignore the previous default case (reset `foundEmptyDefault` to false)
				 * and set `defaultBodySegments` to the current segments because this is
				 * effectively the new default case.
				 */
				if (!isCaseBodyEmpty && context.foundEmptyDefault) {
					context.foundEmptyDefault = false;
					context.defaultBodySegments = forkContext.head;
				}
			}

			// keep track if the default case ends up last
			context.lastIsDefault = isDefaultCase;
			context.forkCount += 1;
		}

		//--------------------------------------------------------------------------
		// TryStatement
		//--------------------------------------------------------------------------

		/**
		 * Creates a context object of TryStatement and stacks it.
		 * @param {boolean} hasFinalizer `true` if the try statement has a
		 *   `finally` block.
		 * @returns {void}
		 */
		pushTryContext(hasFinalizer) {
			this.tryContext = new TryContext(
				this.tryContext,
				hasFinalizer,
				this.forkContext,
			);
		}

		/**
		 * Pops the last context of TryStatement and finalizes it.
		 * @returns {void}
		 */
		popTryContext() {
			const context = this.tryContext;

			this.tryContext = context.upper;

			/*
			 * If we're inside the `catch` block, that means there is no `finally`,
			 * so we can process the `try` and `catch` blocks the simple way and
			 * merge their two paths.
			 */
			if (context.position === "catch") {
				this.popForkContext();
				return;
			}

			/*
			 * The following process is executed only when there is a `finally`
			 * block.
			 */

			const originalReturnedForkContext = context.returnedForkContext;
			const originalThrownForkContext = context.thrownForkContext;

			// no `return` or `throw` in `try` or `catch` so there's nothing left to do
			if (
				originalReturnedForkContext.empty &&
				originalThrownForkContext.empty
			) {
				return;
			}

			/*
			 * The following process is executed only when there is a `finally`
			 * block and there was a `return` or `throw` in the `try` or `catch`
			 * blocks.
			 */

			// Separate head to normal paths and leaving paths.
			const headSegments = this.forkContext.head;

			this.forkContext = this.forkContext.upper;
			const normalSegments = headSegments.slice(
				0,
				(headSegments.length / 2) | 0,
			);
			const leavingSegments = headSegments.slice(
				(headSegments.length / 2) | 0,
			);

			// Forwards the leaving path to upper contexts.
			if (!originalReturnedForkContext.empty) {
				getReturnContext(this).returnedForkContext.add(leavingSegments);
			}
			if (!originalThrownForkContext.empty) {
				getThrowContext(this).thrownForkContext.add(leavingSegments);
			}

			// Sets the normal path as the next.
			this.forkContext.replaceHead(normalSegments);

			/*
			 * If both paths of the `try` block and the `catch` block are
			 * unreachable, the next path becomes unreachable as well.
			 */
			if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) {
				this.forkContext.makeUnreachable();
			}
		}

		/**
		 * Makes a code path segment for a `catch` block.
		 * @returns {void}
		 */
		makeCatchBlock() {
			const context = this.tryContext;
			const forkContext = this.forkContext;
			const originalThrownForkContext = context.thrownForkContext;

			/*
			 * We are now in a catch block so we need to update the context
			 * with that information. This includes creating a new fork
			 * context in case we encounter any `throw` statements here.
			 */
			context.position = "catch";
			context.thrownForkContext = ForkContext.newEmpty(forkContext);
			context.lastOfTryIsReachable = forkContext.reachable;

			// Merge the thrown paths from the `try` and `catch` blocks
			originalThrownForkContext.add(forkContext.head);
			const thrownSegments = originalThrownForkContext.makeNext(0, -1);

			// Fork to a bypass and the merged thrown path.
			this.pushForkContext();
			this.forkBypassPath();
			this.forkContext.add(thrownSegments);
		}

		/**
		 * Makes a code path segment for a `finally` block.
		 *
		 * In the `finally` block, parallel paths are created. The parallel paths
		 * are used as leaving-paths. The leaving-paths are paths from `return`
		 * statements and `throw` statements in a `try` block or a `catch` block.
		 * @returns {void}
		 */
		makeFinallyBlock() {
			const context = this.tryContext;
			let forkContext = this.forkContext;
			const originalReturnedForkContext = context.returnedForkContext;
			const originalThrownForContext = context.thrownForkContext;
			const headOfLeavingSegments = forkContext.head;

			// Update state.
			if (context.position === "catch") {
				// Merges two paths from the `try` block and `catch` block.
				this.popForkContext();
				forkContext = this.forkContext;

				context.lastOfCatchIsReachable = forkContext.reachable;
			} else {
				context.lastOfTryIsReachable = forkContext.reachable;
			}

			context.position = "finally";

			/*
			 * If there was no `return` or `throw` in either the `try` or `catch`
			 * blocks, then there's no further code paths to create for `finally`.
			 */
			if (
				originalReturnedForkContext.empty &&
				originalThrownForContext.empty
			) {
				// This path does not leave.
				return;
			}

			/*
			 * Create a parallel segment from merging returned and thrown.
			 * This segment will leave at the end of this `finally` block.
			 */
			const segments = forkContext.makeNext(-1, -1);

			for (let i = 0; i < forkContext.count; ++i) {
				const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]];

				for (
					let j = 0;
					j < originalReturnedForkContext.segmentsList.length;
					++j
				) {
					prevSegsOfLeavingSegment.push(
						originalReturnedForkContext.segmentsList[j][i],
					);
				}
				for (
					let j = 0;
					j < originalThrownForContext.segmentsList.length;
					++j
				) {
					prevSegsOfLeavingSegment.push(
						originalThrownForContext.segmentsList[j][i],
					);
				}

				segments.push(
					CodePathSegment.newNext(
						this.idGenerator.next(),
						prevSegsOfLeavingSegment,
					),
				);
			}

			this.pushForkContext(true);
			this.forkContext.add(segments);
		}

		/**
		 * Makes a code path segment from the first throwable node to the `catch`
		 * block or the `finally` block.
		 * @returns {void}
		 */
		makeFirstThrowablePathInTryBlock() {
			const forkContext = this.forkContext;

			if (!forkContext.reachable) {
				return;
			}

			const context = getThrowContext(this);

			if (
				context === this ||
				context.position !== "try" ||
				!context.thrownForkContext.empty
			) {
				return;
			}

			context.thrownForkContext.add(forkContext.head);
			forkContext.replaceHead(forkContext.makeNext(-1, -1));
		}

		//--------------------------------------------------------------------------
		// Loop Statements
		//--------------------------------------------------------------------------

		/**
		 * Creates a context object of a loop statement and stacks it.
		 * @param {string} type The type of the node which was triggered. One of
		 *   `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`,
		 *   and `ForStatement`.
		 * @param {string|null} label A label of the node which was triggered.
		 * @throws {Error} (Unreachable - unknown type.)
		 * @returns {void}
		 */
		pushLoopContext(type, label) {
			const forkContext = this.forkContext;

			// All loops need a path to account for `break` statements
			const breakContext = this.pushBreakContext(true, label);

			switch (type) {
				case "WhileStatement":
					this.pushChoiceContext("loop", false);
					this.loopContext = new WhileLoopContext(
						this.loopContext,
						label,
						breakContext,
					);
					break;

				case "DoWhileStatement":
					this.pushChoiceContext("loop", false);
					this.loopContext = new DoWhileLoopContext(
						this.loopContext,
						label,
						breakContext,
						forkContext,
					);
					break;

				case "ForStatement":
					this.pushChoiceContext("loop", false);
					this.loopContext = new ForLoopContext(
						this.loopContext,
						label,
						breakContext,
					);
					break;

				case "ForInStatement":
					this.loopContext = new ForInLoopContext(
						this.loopContext,
						label,
						breakContext,
					);
					break;

				case "ForOfStatement":
					this.loopContext = new ForOfLoopContext(
						this.loopContext,
						label,
						breakContext,
					);
					break;

				/* c8 ignore next */
				default:
					throw new Error(`unknown type: "${type}"`);
			}
		}

		/**
		 * Pops the last context of a loop statement and finalizes it.
		 * @throws {Error} (Unreachable - unknown type.)
		 * @returns {void}
		 */
		popLoopContext() {
			const context = this.loopContext;

			this.loopContext = context.upper;

			const forkContext = this.forkContext;
			const brokenForkContext = this.popBreakContext().brokenForkContext;

			// Creates a looped path.
			switch (context.type) {
				case "WhileStatement":
				case "ForStatement":
					this.popChoiceContext();

					/*
					 * Creates the path from the end of the loop body up to the
					 * location where `continue` would jump to.
					 */
					makeLooped(
						this,
						forkContext.head,
						context.continueDestSegments,
					);
					break;

				case "DoWhileStatement": {
					const choiceContext = this.popChoiceContext();

					if (!choiceContext.processed) {
						choiceContext.trueForkContext.add(forkContext.head);
						choiceContext.falseForkContext.add(forkContext.head);
					}

					/*
					 * If this isn't a hardcoded `true` condition, then `break`
					 * should continue down the path as if the condition evaluated
					 * to false.
					 */
					if (context.test !== true) {
						brokenForkContext.addAll(choiceContext.falseForkContext);
					}

					/*
					 * When the condition is true, the loop continues back to the top,
					 * so create a path from each possible true condition back to the
					 * top of the loop.
					 */
					const segmentsList = choiceContext.trueForkContext.segmentsList;

					for (let i = 0; i < segmentsList.length; ++i) {
						makeLooped(this, segmentsList[i], context.entrySegments);
					}
					break;
				}

				case "ForInStatement":
				case "ForOfStatement":
					brokenForkContext.add(forkContext.head);

					/*
					 * Creates the path from the end of the loop body up to the
					 * left expression (left of `in` or `of`) of the loop.
					 */
					makeLooped(this, forkContext.head, context.leftSegments);
					break;

				/* c8 ignore next */
				default:
					throw new Error("unreachable");
			}

			/*
			 * If there wasn't a `break` statement in the loop, then we're at
			 * the end of the loop's path, so we make an unreachable segment
			 * to mark that.
			 *
			 * If there was a `break` statement, then we continue on into the
			 * `brokenForkContext`.
			 */
			if (brokenForkContext.empty) {
				forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
			} else {
				forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
			}
		}

		/**
		 * Makes a code path segment for the test part of a WhileStatement.
		 * @param {boolean|undefined} test The test value (only when constant).
		 * @returns {void}
		 */
		makeWhileTest(test) {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const testSegments = forkContext.makeNext(0, -1);

			// Update state.
			context.test = test;
			context.continueDestSegments = testSegments;
			forkContext.replaceHead(testSegments);
		}

		/**
		 * Makes a code path segment for the body part of a WhileStatement.
		 * @returns {void}
		 */
		makeWhileBody() {
			const context = this.loopContext;
			const choiceContext = this.choiceContext;
			const forkContext = this.forkContext;

			if (!choiceContext.processed) {
				choiceContext.trueForkContext.add(forkContext.head);
				choiceContext.falseForkContext.add(forkContext.head);
			}

			/*
			 * If this isn't a hardcoded `true` condition, then `break`
			 * should continue down the path as if the condition evaluated
			 * to false.
			 */
			if (context.test !== true) {
				context.brokenForkContext.addAll(choiceContext.falseForkContext);
			}
			forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1));
		}

		/**
		 * Makes a code path segment for the body part of a DoWhileStatement.
		 * @returns {void}
		 */
		makeDoWhileBody() {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const bodySegments = forkContext.makeNext(-1, -1);

			// Update state.
			context.entrySegments = bodySegments;
			forkContext.replaceHead(bodySegments);
		}

		/**
		 * Makes a code path segment for the test part of a DoWhileStatement.
		 * @param {boolean|undefined} test The test value (only when constant).
		 * @returns {void}
		 */
		makeDoWhileTest(test) {
			const context = this.loopContext;
			const forkContext = this.forkContext;

			context.test = test;

			/*
			 * If there is a `continue` statement in the loop then `continueForkContext`
			 * won't be empty. We wire up the path from `continue` to the loop
			 * test condition and then continue the traversal in the root fork context.
			 */
			if (!context.continueForkContext.empty) {
				context.continueForkContext.add(forkContext.head);
				const testSegments = context.continueForkContext.makeNext(0, -1);

				forkContext.replaceHead(testSegments);
			}
		}

		/**
		 * Makes a code path segment for the test part of a ForStatement.
		 * @param {boolean|undefined} test The test value (only when constant).
		 * @returns {void}
		 */
		makeForTest(test) {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const endOfInitSegments = forkContext.head;
			const testSegments = forkContext.makeNext(-1, -1);

			/*
			 * Update the state.
			 *
			 * The `continueDestSegments` are set to `testSegments` because we
			 * don't yet know if there is an update expression in this loop. So,
			 * from what we already know at this point, a `continue` statement
			 * will jump back to the test expression.
			 */
			context.test = test;
			context.endOfInitSegments = endOfInitSegments;
			context.continueDestSegments = context.testSegments = testSegments;
			forkContext.replaceHead(testSegments);
		}

		/**
		 * Makes a code path segment for the update part of a ForStatement.
		 * @returns {void}
		 */
		makeForUpdate() {
			const context = this.loopContext;
			const choiceContext = this.choiceContext;
			const forkContext = this.forkContext;

			// Make the next paths of the test.
			if (context.testSegments) {
				finalizeTestSegmentsOfFor(context, choiceContext, forkContext.head);
			} else {
				context.endOfInitSegments = forkContext.head;
			}

			/*
			 * Update the state.
			 *
			 * The `continueDestSegments` are now set to `updateSegments` because we
			 * know there is an update expression in this loop. So, a `continue` statement
			 * in the loop will jump to the update expression first, and then to any
			 * test expression the loop might have.
			 */
			const updateSegments = forkContext.makeDisconnected(-1, -1);

			context.continueDestSegments = context.updateSegments = updateSegments;
			forkContext.replaceHead(updateSegments);
		}

		/**
		 * Makes a code path segment for the body part of a ForStatement.
		 * @returns {void}
		 */
		makeForBody() {
			const context = this.loopContext;
			const choiceContext = this.choiceContext;
			const forkContext = this.forkContext;

			/*
			 * Determine what to do based on which part of the `for` loop are present.
			 * 1. If there is an update expression, then `updateSegments` is not null and
			 *    we need to assign `endOfUpdateSegments`, and if there is a test
			 *    expression, we then need to create the looped path to get back to
			 *    the test condition.
			 * 2. If there is no update expression but there is a test expression,
			 *    then we only need to update the test segment information.
			 * 3. If there is no update expression and no test expression, then we
			 *    just save `endOfInitSegments`.
			 */
			if (context.updateSegments) {
				context.endOfUpdateSegments = forkContext.head;

				/*
				 * In a `for` loop that has both an update expression and a test
				 * condition, execution flows from the test expression into the
				 * loop body, to the update expression, and then back to the test
				 * expression to determine if the loop should continue.
				 *
				 * To account for that, we need to make a path from the end of the
				 * update expression to the start of the test expression. This is
				 * effectively what creates the loop in the code path.
				 */
				if (context.testSegments) {
					makeLooped(
						this,
						context.endOfUpdateSegments,
						context.testSegments,
					);
				}
			} else if (context.testSegments) {
				finalizeTestSegmentsOfFor(context, choiceContext, forkContext.head);
			} else {
				context.endOfInitSegments = forkContext.head;
			}

			let bodySegments = context.endOfTestSegments;

			/*
			 * If there is a test condition, then there `endOfTestSegments` is also
			 * the start of the loop body. If there isn't a test condition then
			 * `bodySegments` will be null and we need to look elsewhere to find
			 * the start of the body.
			 *
			 * The body starts at the end of the init expression and ends at the end
			 * of the update expression, so we use those locations to determine the
			 * body segments.
			 */
			if (!bodySegments) {
				const prevForkContext = ForkContext.newEmpty(forkContext);

				prevForkContext.add(context.endOfInitSegments);
				if (context.endOfUpdateSegments) {
					prevForkContext.add(context.endOfUpdateSegments);
				}

				bodySegments = prevForkContext.makeNext(0, -1);
			}

			/*
			 * If there was no test condition and no update expression, then
			 * `continueDestSegments` will be null. In that case, a
			 * `continue` should skip directly to the body of the loop.
			 * Otherwise, we want to keep the current `continueDestSegments`.
			 */
			context.continueDestSegments =
				context.continueDestSegments || bodySegments;

			// move pointer to the body
			forkContext.replaceHead(bodySegments);
		}

		/**
		 * Makes a code path segment for the left part of a ForInStatement and a
		 * ForOfStatement.
		 * @returns {void}
		 */
		makeForInOfLeft() {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const leftSegments = forkContext.makeDisconnected(-1, -1);

			// Update state.
			context.prevSegments = forkContext.head;
			context.leftSegments = context.continueDestSegments = leftSegments;
			forkContext.replaceHead(leftSegments);
		}

		/**
		 * Makes a code path segment for the right part of a ForInStatement and a
		 * ForOfStatement.
		 * @returns {void}
		 */
		makeForInOfRight() {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const temp = ForkContext.newEmpty(forkContext);

			temp.add(context.prevSegments);
			const rightSegments = temp.makeNext(-1, -1);

			// Update state.
			context.endOfLeftSegments = forkContext.head;
			forkContext.replaceHead(rightSegments);
		}

		/**
		 * Makes a code path segment for the body part of a ForInStatement and a
		 * ForOfStatement.
		 * @returns {void}
		 */
		makeForInOfBody() {
			const context = this.loopContext;
			const forkContext = this.forkContext;
			const temp = ForkContext.newEmpty(forkContext);

			temp.add(context.endOfLeftSegments);
			const bodySegments = temp.makeNext(-1, -1);

			// Make a path: `right` -> `left`.
			makeLooped(this, forkContext.head, context.leftSegments);

			// Update state.
			context.brokenForkContext.add(forkContext.head);
			forkContext.replaceHead(bodySegments);
		}

		//--------------------------------------------------------------------------
		// Control Statements
		//--------------------------------------------------------------------------

		/**
		 * Creates new context in which a `break` statement can be used. This occurs inside of a loop,
		 * labeled statement, or switch statement.
		 * @param {boolean} breakable Indicates if we are inside a statement where
		 *      `break` without a label will exit the statement.
		 * @param {string|null} label The label associated with the statement.
		 * @returns {BreakContext} The new context.
		 */
		pushBreakContext(breakable, label) {
			this.breakContext = new BreakContext(
				this.breakContext,
				breakable,
				label,
				this.forkContext,
			);
			return this.breakContext;
		}

		/**
		 * Removes the top item of the break context stack.
		 * @returns {Object} The removed context.
		 */
		popBreakContext() {
			const context = this.breakContext;
			const forkContext = this.forkContext;

			this.breakContext = context.upper;

			// Process this context here for other than switches and loops.
			if (!context.breakable) {
				const brokenForkContext = context.brokenForkContext;

				if (!brokenForkContext.empty) {
					brokenForkContext.add(forkContext.head);
					forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
				}
			}

			return context;
		}

		/**
		 * Makes a path for a `break` statement.
		 *
		 * It registers the head segment to a context of `break`.
		 * It makes new unreachable segment, then it set the head with the segment.
		 * @param {string|null} label A label of the break statement.
		 * @returns {void}
		 */
		makeBreak(label) {
			const forkContext = this.forkContext;

			if (!forkContext.reachable) {
				return;
			}

			const context = getBreakContext(this, label);

			if (context) {
				context.brokenForkContext.add(forkContext.head);
			}

			/* c8 ignore next */
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		}

		/**
		 * Makes a path for a `continue` statement.
		 *
		 * It makes a looping path.
		 * It makes new unreachable segment, then it set the head with the segment.
		 * @param {string|null} label A label of the continue statement.
		 * @returns {void}
		 */
		makeContinue(label) {
			const forkContext = this.forkContext;

			if (!forkContext.reachable) {
				return;
			}

			const context = getContinueContext(this, label);

			if (context) {
				if (context.continueDestSegments) {
					makeLooped(
						this,
						forkContext.head,
						context.continueDestSegments,
					);

					// If the context is a for-in/of loop, this affects a break also.
					if (
						context.type === "ForInStatement" ||
						context.type === "ForOfStatement"
					) {
						context.brokenForkContext.add(forkContext.head);
					}
				} else {
					context.continueForkContext.add(forkContext.head);
				}
			}
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		}

		/**
		 * Makes a path for a `return` statement.
		 *
		 * It registers the head segment to a context of `return`.
		 * It makes new unreachable segment, then it set the head with the segment.
		 * @returns {void}
		 */
		makeReturn() {
			const forkContext = this.forkContext;

			if (forkContext.reachable) {
				getReturnContext(this).returnedForkContext.add(forkContext.head);
				forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
			}
		}

		/**
		 * Makes a path for a `throw` statement.
		 *
		 * It registers the head segment to a context of `throw`.
		 * It makes new unreachable segment, then it set the head with the segment.
		 * @returns {void}
		 */
		makeThrow() {
			const forkContext = this.forkContext;

			if (forkContext.reachable) {
				getThrowContext(this).thrownForkContext.add(forkContext.head);
				forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
			}
		}

		/**
		 * Makes the final path.
		 * @returns {void}
		 */
		makeFinal() {
			const segments = this.currentSegments;

			if (segments.length > 0 && segments[0].reachable) {
				this.returnedForkContext.add(segments);
			}
		}
	}

	codePathState = CodePathState;
	return codePathState;
}

/**
 * @fileoverview A class of identifiers generator for code path segments.
 *
 * Each rule uses the identifier of code path segments to store additional
 * information of the code path.
 *
 * @author Toru Nagashima
 */

var idGenerator;
var hasRequiredIdGenerator;

function requireIdGenerator () {
	if (hasRequiredIdGenerator) return idGenerator;
	hasRequiredIdGenerator = 1;

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A generator for unique ids.
	 */
	class IdGenerator {
		/**
		 * @param {string} prefix Optional. A prefix of generated ids.
		 */
		constructor(prefix) {
			this.prefix = String(prefix);
			this.n = 0;
		}

		/**
		 * Generates id.
		 * @returns {string} A generated id.
		 */
		next() {
			this.n = (1 + this.n) | 0;

			/* c8 ignore start */
			if (this.n < 0) {
				this.n = 1;
			} /* c8 ignore stop */

			return this.prefix + this.n;
		}
	}

	idGenerator = IdGenerator;
	return idGenerator;
}

/**
 * @fileoverview A class of the code path.
 * @author Toru Nagashima
 */

var codePath;
var hasRequiredCodePath;

function requireCodePath () {
	if (hasRequiredCodePath) return codePath;
	hasRequiredCodePath = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const CodePathState = requireCodePathState();
	const IdGenerator = requireIdGenerator();

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A code path.
	 */
	class CodePath {
		/**
		 * Creates a new instance.
		 * @param {Object} options Options for the function (see below).
		 * @param {string} options.id An identifier.
		 * @param {string} options.origin The type of code path origin.
		 * @param {CodePath|null} options.upper The code path of the upper function scope.
		 * @param {Function} options.onLooped A callback function to notify looping.
		 */
		constructor({ id, origin, upper, onLooped }) {
			/**
			 * The identifier of this code path.
			 * Rules use it to store additional information of each rule.
			 * @type {string}
			 */
			this.id = id;

			/**
			 * The reason that this code path was started. May be "program",
			 * "function", "class-field-initializer", or "class-static-block".
			 * @type {string}
			 */
			this.origin = origin;

			/**
			 * The code path of the upper function scope.
			 * @type {CodePath|null}
			 */
			this.upper = upper;

			/**
			 * The code paths of nested function scopes.
			 * @type {CodePath[]}
			 */
			this.childCodePaths = [];

			// Initializes internal state.
			Object.defineProperty(this, "internal", {
				value: new CodePathState(new IdGenerator(`${id}_`), onLooped),
			});

			// Adds this into `childCodePaths` of `upper`.
			if (upper) {
				upper.childCodePaths.push(this);
			}
		}

		/**
		 * Gets the state of a given code path.
		 * @param {CodePath} codePath A code path to get.
		 * @returns {CodePathState} The state of the code path.
		 */
		static getState(codePath) {
			return codePath.internal;
		}

		/**
		 * The initial code path segment. This is the segment that is at the head
		 * of the code path.
		 * This is a passthrough to the underlying `CodePathState`.
		 * @type {CodePathSegment}
		 */
		get initialSegment() {
			return this.internal.initialSegment;
		}

		/**
		 * Final code path segments. These are the terminal (tail) segments in the
		 * code path, which is the combination of `returnedSegments` and `thrownSegments`.
		 * All segments in this array are reachable.
		 * This is a passthrough to the underlying `CodePathState`.
		 * @type {CodePathSegment[]}
		 */
		get finalSegments() {
			return this.internal.finalSegments;
		}

		/**
		 * Final code path segments that represent normal completion of the code path.
		 * For functions, this means both explicit `return` statements and implicit returns,
		 * such as the last reachable segment in a function that does not have an
		 * explicit `return` as this implicitly returns `undefined`. For scripts,
		 * modules, class field initializers, and class static blocks, this means
		 * all lines of code have been executed.
		 * These segments are also present in `finalSegments`.
		 * This is a passthrough to the underlying `CodePathState`.
		 * @type {CodePathSegment[]}
		 */
		get returnedSegments() {
			return this.internal.returnedForkContext;
		}

		/**
		 * Final code path segments that represent `throw` statements.
		 * This is a passthrough to the underlying `CodePathState`.
		 * These segments are also present in `finalSegments`.
		 * @type {CodePathSegment[]}
		 */
		get thrownSegments() {
			return this.internal.thrownForkContext;
		}

		/**
		 * Traverses all segments in this code path.
		 *
		 *     codePath.traverseSegments((segment, controller) => {
		 *         // do something.
		 *     });
		 *
		 * This method enumerates segments in order from the head.
		 *
		 * The `controller` argument has two methods:
		 *
		 * - `skip()` - skips the following segments in this branch
		 * - `break()` - skips all following segments in the traversal
		 *
		 * A note on the parameters: the `options` argument is optional. This means
		 * the first argument might be an options object or the callback function.
		 * @param {Object} [optionsOrCallback] Optional first and last segments to traverse.
		 * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse.
		 * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse.
		 * @param {Function} callback A callback function.
		 * @returns {void}
		 */
		traverseSegments(optionsOrCallback, callback) {
			// normalize the arguments into a callback and options
			let resolvedOptions;
			let resolvedCallback;

			if (typeof optionsOrCallback === "function") {
				resolvedCallback = optionsOrCallback;
				resolvedOptions = {};
			} else {
				resolvedOptions = optionsOrCallback || {};
				resolvedCallback = callback;
			}

			// determine where to start traversing from based on the options
			const startSegment =
				resolvedOptions.first || this.internal.initialSegment;
			const lastSegment = resolvedOptions.last;

			// set up initial location information
			let record;
			let index;
			let end;
			let segment = null;

			// segments that have already been visited during traversal
			const visited = new Set();

			// tracks the traversal steps
			const stack = [[startSegment, 0]];

			// segments that have been skipped during traversal
			const skipped = new Set();

			// indicates if we exited early from the traversal
			let broken = false;

			/**
			 * Maintains traversal state.
			 */
			const controller = {
				/**
				 * Skip the following segments in this branch.
				 * @returns {void}
				 */
				skip() {
					skipped.add(segment);
				},

				/**
				 * Stop traversal completely - do not traverse to any
				 * other segments.
				 * @returns {void}
				 */
				break() {
					broken = true;
				},
			};

			/**
			 * Checks if a given previous segment has been visited.
			 * @param {CodePathSegment} prevSegment A previous segment to check.
			 * @returns {boolean} `true` if the segment has been visited.
			 */
			function isVisited(prevSegment) {
				return (
					visited.has(prevSegment) ||
					segment.isLoopedPrevSegment(prevSegment)
				);
			}

			/**
			 * Checks if a given previous segment has been skipped.
			 * @param {CodePathSegment} prevSegment A previous segment to check.
			 * @returns {boolean} `true` if the segment has been skipped.
			 */
			function isSkipped(prevSegment) {
				return (
					skipped.has(prevSegment) ||
					segment.isLoopedPrevSegment(prevSegment)
				);
			}

			// the traversal
			while (stack.length > 0) {
				/*
				 * This isn't a pure stack. We use the top record all the time
				 * but don't always pop it off. The record is popped only if
				 * one of the following is true:
				 *
				 * 1) We have already visited the segment.
				 * 2) We have not visited *all* of the previous segments.
				 * 3) We have traversed past the available next segments.
				 *
				 * Otherwise, we just read the value and sometimes modify the
				 * record as we traverse.
				 */
				record = stack.at(-1);
				segment = record[0];
				index = record[1];

				if (index === 0) {
					// Skip if this segment has been visited already.
					if (visited.has(segment)) {
						stack.pop();
						continue;
					}

					// Skip if all previous segments have not been visited.
					if (
						segment !== startSegment &&
						segment.prevSegments.length > 0 &&
						!segment.prevSegments.every(isVisited)
					) {
						stack.pop();
						continue;
					}

					visited.add(segment);

					// Skips the segment if all previous segments have been skipped.
					const shouldSkip =
						skipped.size > 0 &&
						segment.prevSegments.length > 0 &&
						segment.prevSegments.every(isSkipped);

					/*
					 * If the most recent segment hasn't been skipped, then we call
					 * the callback, passing in the segment and the controller.
					 */
					if (!shouldSkip) {
						resolvedCallback.call(this, segment, controller);

						// exit if we're at the last segment
						if (segment === lastSegment) {
							controller.skip();
						}

						/*
						 * If the previous statement was executed, or if the callback
						 * called a method on the controller, we might need to exit the
						 * loop, so check for that and break accordingly.
						 */
						if (broken) {
							break;
						}
					} else {
						// If the most recent segment has been skipped, then mark it as skipped.
						skipped.add(segment);
					}
				}

				// Update the stack.
				end = segment.nextSegments.length - 1;
				if (index < end) {
					/*
					 * If we haven't yet visited all of the next segments, update
					 * the current top record on the stack to the next index to visit
					 * and then push a record for the current segment on top.
					 *
					 * Setting the current top record's index lets us know how many
					 * times we've been here and ensures that the segment won't be
					 * reprocessed (because we only process segments with an index
					 * of 0).
					 */
					record[1] += 1;
					stack.push([segment.nextSegments[index], 0]);
				} else if (index === end) {
					/*
					 * If we are at the last next segment, then reset the top record
					 * in the stack to next segment and set its index to 0 so it will
					 * be processed next.
					 */
					record[0] = segment.nextSegments[index];
					record[1] = 0;
				} else {
					/*
					 * If index > end, that means we have no more segments that need
					 * processing. So, we pop that record off of the stack in order to
					 * continue traversing at the next level up.
					 */
					stack.pop();
				}
			}
		}
	}

	codePath = CodePath;
	return codePath;
}

/**
 * @fileoverview A class of the code path analyzer.
 * @author Toru Nagashima
 */

var codePathAnalyzer;
var hasRequiredCodePathAnalyzer;

function requireCodePathAnalyzer () {
	if (hasRequiredCodePathAnalyzer) return codePathAnalyzer;
	hasRequiredCodePathAnalyzer = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const assert = requireAssert(),
		{ breakableTypePattern } = requireAstUtils$1(),
		CodePath = requireCodePath(),
		CodePathSegment = requireCodePathSegment(),
		IdGenerator = requireIdGenerator(),
		debug = requireDebugHelpers();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a `case` node (not `default` node).
	 * @param {ASTNode} node A `SwitchCase` node to check.
	 * @returns {boolean} `true` if the node is a `case` node (not `default` node).
	 */
	function isCaseNode(node) {
		return Boolean(node.test);
	}

	/**
	 * Checks if a given node appears as the value of a PropertyDefinition node.
	 * @param {ASTNode} node THe node to check.
	 * @returns {boolean} `true` if the node is a PropertyDefinition value,
	 *      false if not.
	 */
	function isPropertyDefinitionValue(node) {
		const parent = node.parent;

		return (
			parent && parent.type === "PropertyDefinition" && parent.value === node
		);
	}

	/**
	 * Checks whether the given logical operator is taken into account for the code
	 * path analysis.
	 * @param {string} operator The operator found in the LogicalExpression node
	 * @returns {boolean} `true` if the operator is "&&" or "||" or "??"
	 */
	function isHandledLogicalOperator(operator) {
		return operator === "&&" || operator === "||" || operator === "??";
	}

	/**
	 * Checks whether the given assignment operator is a logical assignment operator.
	 * Logical assignments are taken into account for the code path analysis
	 * because of their short-circuiting semantics.
	 * @param {string} operator The operator found in the AssignmentExpression node
	 * @returns {boolean} `true` if the operator is "&&=" or "||=" or "??="
	 */
	function isLogicalAssignmentOperator(operator) {
		return operator === "&&=" || operator === "||=" || operator === "??=";
	}

	/**
	 * Gets the label if the parent node of a given node is a LabeledStatement.
	 * @param {ASTNode} node A node to get.
	 * @returns {string|null} The label or `null`.
	 */
	function getLabel(node) {
		if (node.parent.type === "LabeledStatement") {
			return node.parent.label.name;
		}
		return null;
	}

	/**
	 * Checks whether or not a given logical expression node goes different path
	 * between the `true` case and the `false` case.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a test of a choice statement.
	 */
	function isForkingByTrueOrFalse(node) {
		const parent = node.parent;

		switch (parent.type) {
			case "ConditionalExpression":
			case "IfStatement":
			case "WhileStatement":
			case "DoWhileStatement":
			case "ForStatement":
				return parent.test === node;

			case "LogicalExpression":
				return isHandledLogicalOperator(parent.operator);

			case "AssignmentExpression":
				return isLogicalAssignmentOperator(parent.operator);

			default:
				return false;
		}
	}

	/**
	 * Gets the boolean value of a given literal node.
	 *
	 * This is used to detect infinity loops (e.g. `while (true) {}`).
	 * Statements preceded by an infinity loop are unreachable if the loop didn't
	 * have any `break` statement.
	 * @param {ASTNode} node A node to get.
	 * @returns {boolean|undefined} a boolean value if the node is a Literal node,
	 *   otherwise `undefined`.
	 */
	function getBooleanValueIfSimpleConstant(node) {
		if (node.type === "Literal") {
			return Boolean(node.value);
		}
		return void 0;
	}

	/**
	 * Checks that a given identifier node is a reference or not.
	 *
	 * This is used to detect the first throwable node in a `try` block.
	 * @param {ASTNode} node An Identifier node to check.
	 * @returns {boolean} `true` if the node is a reference.
	 */
	function isIdentifierReference(node) {
		const parent = node.parent;

		switch (parent.type) {
			case "LabeledStatement":
			case "BreakStatement":
			case "ContinueStatement":
			case "ArrayPattern":
			case "RestElement":
			case "ImportSpecifier":
			case "ImportDefaultSpecifier":
			case "ImportNamespaceSpecifier":
			case "CatchClause":
				return false;

			case "FunctionDeclaration":
			case "FunctionExpression":
			case "ArrowFunctionExpression":
			case "ClassDeclaration":
			case "ClassExpression":
			case "VariableDeclarator":
				return parent.id !== node;

			case "Property":
			case "PropertyDefinition":
			case "MethodDefinition":
				return parent.key !== node || parent.computed || parent.shorthand;

			case "AssignmentPattern":
				return parent.key !== node;

			default:
				return true;
		}
	}

	/**
	 * Updates the current segment with the head segment.
	 * This is similar to local branches and tracking branches of git.
	 *
	 * To separate the current and the head is in order to not make useless segments.
	 *
	 * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd"
	 * events are fired.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function forwardCurrentToHead(analyzer, node) {
		const codePath = analyzer.codePath;
		const state = CodePath.getState(codePath);
		const currentSegments = state.currentSegments;
		const headSegments = state.headSegments;
		const end = Math.max(currentSegments.length, headSegments.length);
		let i, currentSegment, headSegment;

		// Fires leaving events.
		for (i = 0; i < end; ++i) {
			currentSegment = currentSegments[i];
			headSegment = headSegments[i];

			if (currentSegment !== headSegment && currentSegment) {
				const eventName = currentSegment.reachable
					? "onCodePathSegmentEnd"
					: "onUnreachableCodePathSegmentEnd";

				debug.dump(`${eventName} ${currentSegment.id}`);

				analyzer.emitter.emit(eventName, currentSegment, node);
			}
		}

		// Update state.
		state.currentSegments = headSegments;

		// Fires entering events.
		for (i = 0; i < end; ++i) {
			currentSegment = currentSegments[i];
			headSegment = headSegments[i];

			if (currentSegment !== headSegment && headSegment) {
				const eventName = headSegment.reachable
					? "onCodePathSegmentStart"
					: "onUnreachableCodePathSegmentStart";

				debug.dump(`${eventName} ${headSegment.id}`);
				CodePathSegment.markUsed(headSegment);
				analyzer.emitter.emit(eventName, headSegment, node);
			}
		}
	}

	/**
	 * Updates the current segment with empty.
	 * This is called at the last of functions or the program.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function leaveFromCurrentSegment(analyzer, node) {
		const state = CodePath.getState(analyzer.codePath);
		const currentSegments = state.currentSegments;

		for (let i = 0; i < currentSegments.length; ++i) {
			const currentSegment = currentSegments[i];
			const eventName = currentSegment.reachable
				? "onCodePathSegmentEnd"
				: "onUnreachableCodePathSegmentEnd";

			debug.dump(`${eventName} ${currentSegment.id}`);

			analyzer.emitter.emit(eventName, currentSegment, node);
		}

		state.currentSegments = [];
	}

	/**
	 * Updates the code path due to the position of a given node in the parent node
	 * thereof.
	 *
	 * For example, if the node is `parent.consequent`, this creates a fork from the
	 * current path.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function preprocess(analyzer, node) {
		const codePath = analyzer.codePath;
		const state = CodePath.getState(codePath);
		const parent = node.parent;

		switch (parent.type) {
			// The `arguments.length == 0` case is in `postprocess` function.
			case "CallExpression":
				if (
					parent.optional === true &&
					parent.arguments.length >= 1 &&
					parent.arguments[0] === node
				) {
					state.makeOptionalRight();
				}
				break;
			case "MemberExpression":
				if (parent.optional === true && parent.property === node) {
					state.makeOptionalRight();
				}
				break;

			case "LogicalExpression":
				if (
					parent.right === node &&
					isHandledLogicalOperator(parent.operator)
				) {
					state.makeLogicalRight();
				}
				break;

			case "AssignmentExpression":
				if (
					parent.right === node &&
					isLogicalAssignmentOperator(parent.operator)
				) {
					state.makeLogicalRight();
				}
				break;

			case "ConditionalExpression":
			case "IfStatement":
				/*
				 * Fork if this node is at `consequent`/`alternate`.
				 * `popForkContext()` exists at `IfStatement:exit` and
				 * `ConditionalExpression:exit`.
				 */
				if (parent.consequent === node) {
					state.makeIfConsequent();
				} else if (parent.alternate === node) {
					state.makeIfAlternate();
				}
				break;

			case "SwitchCase":
				if (parent.consequent[0] === node) {
					state.makeSwitchCaseBody(false, !parent.test);
				}
				break;

			case "TryStatement":
				if (parent.handler === node) {
					state.makeCatchBlock();
				} else if (parent.finalizer === node) {
					state.makeFinallyBlock();
				}
				break;

			case "WhileStatement":
				if (parent.test === node) {
					state.makeWhileTest(getBooleanValueIfSimpleConstant(node));
				} else {
					assert(parent.body === node);
					state.makeWhileBody();
				}
				break;

			case "DoWhileStatement":
				if (parent.body === node) {
					state.makeDoWhileBody();
				} else {
					assert(parent.test === node);
					state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node));
				}
				break;

			case "ForStatement":
				if (parent.test === node) {
					state.makeForTest(getBooleanValueIfSimpleConstant(node));
				} else if (parent.update === node) {
					state.makeForUpdate();
				} else if (parent.body === node) {
					state.makeForBody();
				}
				break;

			case "ForInStatement":
			case "ForOfStatement":
				if (parent.left === node) {
					state.makeForInOfLeft();
				} else if (parent.right === node) {
					state.makeForInOfRight();
				} else {
					assert(parent.body === node);
					state.makeForInOfBody();
				}
				break;

			case "AssignmentPattern":
				/*
				 * Fork if this node is at `right`.
				 * `left` is executed always, so it uses the current path.
				 * `popForkContext()` exists at `AssignmentPattern:exit`.
				 */
				if (parent.right === node) {
					state.pushForkContext();
					state.forkBypassPath();
					state.forkPath();
				}
				break;
		}
	}

	/**
	 * Updates the code path due to the type of a given node in entering.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function processCodePathToEnter(analyzer, node) {
		let codePath = analyzer.codePath;
		let state = codePath && CodePath.getState(codePath);
		const parent = node.parent;

		/**
		 * Creates a new code path and trigger the onCodePathStart event
		 * based on the currently selected node.
		 * @param {string} origin The reason the code path was started.
		 * @returns {void}
		 */
		function startCodePath(origin) {
			if (codePath) {
				// Emits onCodePathSegmentStart events if updated.
				forwardCurrentToHead(analyzer, node);
				debug.dumpState(node, state, false);
			}

			// Create the code path of this scope.
			codePath = analyzer.codePath = new CodePath({
				id: analyzer.idGenerator.next(),
				origin,
				upper: codePath,
				onLooped: analyzer.onLooped,
			});
			state = CodePath.getState(codePath);

			// Emits onCodePathStart events.
			debug.dump(`onCodePathStart ${codePath.id}`);
			analyzer.emitter.emit("onCodePathStart", codePath, node);
		}

		/*
		 * Special case: The right side of class field initializer is considered
		 * to be its own function, so we need to start a new code path in this
		 * case.
		 */
		if (isPropertyDefinitionValue(node)) {
			startCodePath("class-field-initializer");

			/*
			 * Intentional fall through because `node` needs to also be
			 * processed by the code below. For example, if we have:
			 *
			 * class Foo {
			 *     a = () => {}
			 * }
			 *
			 * In this case, we also need start a second code path.
			 */
		}

		switch (node.type) {
			case "Program":
				startCodePath("program");
				break;

			case "FunctionDeclaration":
			case "FunctionExpression":
			case "ArrowFunctionExpression":
				startCodePath("function");
				break;

			case "StaticBlock":
				startCodePath("class-static-block");
				break;

			case "ChainExpression":
				state.pushChainContext();
				break;
			case "CallExpression":
				if (node.optional === true) {
					state.makeOptionalNode();
				}
				break;
			case "MemberExpression":
				if (node.optional === true) {
					state.makeOptionalNode();
				}
				break;

			case "LogicalExpression":
				if (isHandledLogicalOperator(node.operator)) {
					state.pushChoiceContext(
						node.operator,
						isForkingByTrueOrFalse(node),
					);
				}
				break;

			case "AssignmentExpression":
				if (isLogicalAssignmentOperator(node.operator)) {
					state.pushChoiceContext(
						node.operator.slice(0, -1), // removes `=` from the end
						isForkingByTrueOrFalse(node),
					);
				}
				break;

			case "ConditionalExpression":
			case "IfStatement":
				state.pushChoiceContext("test", false);
				break;

			case "SwitchStatement":
				state.pushSwitchContext(
					node.cases.some(isCaseNode),
					getLabel(node),
				);
				break;

			case "TryStatement":
				state.pushTryContext(Boolean(node.finalizer));
				break;

			case "SwitchCase":
				/*
				 * Fork if this node is after the 2st node in `cases`.
				 * It's similar to `else` blocks.
				 * The next `test` node is processed in this path.
				 */
				if (parent.discriminant !== node && parent.cases[0] !== node) {
					state.forkPath();
				}
				break;

			case "WhileStatement":
			case "DoWhileStatement":
			case "ForStatement":
			case "ForInStatement":
			case "ForOfStatement":
				state.pushLoopContext(node.type, getLabel(node));
				break;

			case "LabeledStatement":
				if (!breakableTypePattern.test(node.body.type)) {
					state.pushBreakContext(false, node.label.name);
				}
				break;
		}

		// Emits onCodePathSegmentStart events if updated.
		forwardCurrentToHead(analyzer, node);
		debug.dumpState(node, state, false);
	}

	/**
	 * Updates the code path due to the type of a given node in leaving.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function processCodePathToExit(analyzer, node) {
		const codePath = analyzer.codePath;
		const state = CodePath.getState(codePath);
		let dontForward = false;

		switch (node.type) {
			case "ChainExpression":
				state.popChainContext();
				break;

			case "IfStatement":
			case "ConditionalExpression":
				state.popChoiceContext();
				break;

			case "LogicalExpression":
				if (isHandledLogicalOperator(node.operator)) {
					state.popChoiceContext();
				}
				break;

			case "AssignmentExpression":
				if (isLogicalAssignmentOperator(node.operator)) {
					state.popChoiceContext();
				}
				break;

			case "SwitchStatement":
				state.popSwitchContext();
				break;

			case "SwitchCase":
				/*
				 * This is the same as the process at the 1st `consequent` node in
				 * `preprocess` function.
				 * Must do if this `consequent` is empty.
				 */
				if (node.consequent.length === 0) {
					state.makeSwitchCaseBody(true, !node.test);
				}
				if (state.forkContext.reachable) {
					dontForward = true;
				}
				break;

			case "TryStatement":
				state.popTryContext();
				break;

			case "BreakStatement":
				forwardCurrentToHead(analyzer, node);
				state.makeBreak(node.label && node.label.name);
				dontForward = true;
				break;

			case "ContinueStatement":
				forwardCurrentToHead(analyzer, node);
				state.makeContinue(node.label && node.label.name);
				dontForward = true;
				break;

			case "ReturnStatement":
				forwardCurrentToHead(analyzer, node);
				state.makeReturn();
				dontForward = true;
				break;

			case "ThrowStatement":
				forwardCurrentToHead(analyzer, node);
				state.makeThrow();
				dontForward = true;
				break;

			case "Identifier":
				if (isIdentifierReference(node)) {
					state.makeFirstThrowablePathInTryBlock();
					dontForward = true;
				}
				break;

			case "CallExpression":
			case "ImportExpression":
			case "MemberExpression":
			case "NewExpression":
			case "YieldExpression":
				state.makeFirstThrowablePathInTryBlock();
				break;

			case "WhileStatement":
			case "DoWhileStatement":
			case "ForStatement":
			case "ForInStatement":
			case "ForOfStatement":
				state.popLoopContext();
				break;

			case "AssignmentPattern":
				state.popForkContext();
				break;

			case "LabeledStatement":
				if (!breakableTypePattern.test(node.body.type)) {
					state.popBreakContext();
				}
				break;
		}

		// Emits onCodePathSegmentStart events if updated.
		if (!dontForward) {
			forwardCurrentToHead(analyzer, node);
		}
		debug.dumpState(node, state, true);
	}

	/**
	 * Updates the code path to finalize the current code path.
	 * @param {CodePathAnalyzer} analyzer The instance.
	 * @param {ASTNode} node The current AST node.
	 * @returns {void}
	 */
	function postprocess(analyzer, node) {
		/**
		 * Ends the code path for the current node.
		 * @returns {void}
		 */
		function endCodePath() {
			let codePath = analyzer.codePath;

			// Mark the current path as the final node.
			CodePath.getState(codePath).makeFinal();

			// Emits onCodePathSegmentEnd event of the current segments.
			leaveFromCurrentSegment(analyzer, node);

			// Emits onCodePathEnd event of this code path.
			debug.dump(`onCodePathEnd ${codePath.id}`);
			analyzer.emitter.emit("onCodePathEnd", codePath, node);
			debug.dumpDot(codePath);

			codePath = analyzer.codePath = analyzer.codePath.upper;
			if (codePath) {
				debug.dumpState(node, CodePath.getState(codePath), true);
			}
		}

		switch (node.type) {
			case "Program":
			case "FunctionDeclaration":
			case "FunctionExpression":
			case "ArrowFunctionExpression":
			case "StaticBlock": {
				endCodePath();
				break;
			}

			// The `arguments.length >= 1` case is in `preprocess` function.
			case "CallExpression":
				if (node.optional === true && node.arguments.length === 0) {
					CodePath.getState(analyzer.codePath).makeOptionalRight();
				}
				break;
		}

		/*
		 * Special case: The right side of class field initializer is considered
		 * to be its own function, so we need to end a code path in this
		 * case.
		 *
		 * We need to check after the other checks in order to close the
		 * code paths in the correct order for code like this:
		 *
		 *
		 * class Foo {
		 *     a = () => {}
		 * }
		 *
		 * In this case, The ArrowFunctionExpression code path is closed first
		 * and then we need to close the code path for the PropertyDefinition
		 * value.
		 */
		if (isPropertyDefinitionValue(node)) {
			endCodePath();
		}
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * The class to analyze code paths.
	 * This class implements the EventGenerator interface.
	 */
	class CodePathAnalyzer {
		/**
		 * @param {EventGenerator} eventGenerator An event generator to wrap.
		 */
		constructor(eventGenerator) {
			this.original = eventGenerator;
			this.emitter = eventGenerator.emitter;
			this.codePath = null;
			this.idGenerator = new IdGenerator("s");
			this.currentNode = null;
			this.onLooped = this.onLooped.bind(this);
		}

		/**
		 * Does the process to enter a given AST node.
		 * This updates state of analysis and calls `enterNode` of the wrapped.
		 * @param {ASTNode} node A node which is entering.
		 * @returns {void}
		 */
		enterNode(node) {
			this.currentNode = node;

			// Updates the code path due to node's position in its parent node.
			if (node.parent) {
				preprocess(this, node);
			}

			/*
			 * Updates the code path.
			 * And emits onCodePathStart/onCodePathSegmentStart events.
			 */
			processCodePathToEnter(this, node);

			// Emits node events.
			this.original.enterNode(node);

			this.currentNode = null;
		}

		/**
		 * Does the process to leave a given AST node.
		 * This updates state of analysis and calls `leaveNode` of the wrapped.
		 * @param {ASTNode} node A node which is leaving.
		 * @returns {void}
		 */
		leaveNode(node) {
			this.currentNode = node;

			/*
			 * Updates the code path.
			 * And emits onCodePathStart/onCodePathSegmentStart events.
			 */
			processCodePathToExit(this, node);

			// Emits node events.
			this.original.leaveNode(node);

			// Emits the last onCodePathStart/onCodePathSegmentStart events.
			postprocess(this, node);

			this.currentNode = null;
		}

		/**
		 * This is called on a code path looped.
		 * Then this raises a looped event.
		 * @param {CodePathSegment} fromSegment A segment of prev.
		 * @param {CodePathSegment} toSegment A segment of next.
		 * @returns {void}
		 */
		onLooped(fromSegment, toSegment) {
			if (fromSegment.reachable && toSegment.reachable) {
				debug.dump(
					`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`,
				);
				this.emitter.emit(
					"onCodePathSegmentLoop",
					fromSegment,
					toSegment,
					this.currentNode,
				);
			}
		}
	}

	codePathAnalyzer = CodePathAnalyzer;
	return codePathAnalyzer;
}

/**
 * @fileoverview A variant of EventEmitter which does not give listeners information about each other
 * @author Teddy Katz
 */

var safeEmitter;
var hasRequiredSafeEmitter;

function requireSafeEmitter () {
	if (hasRequiredSafeEmitter) return safeEmitter;
	hasRequiredSafeEmitter = 1;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * An event emitter
	 * @typedef {Object} SafeEmitter
	 * @property {(eventName: string, listenerFunc: Function) => void} on Adds a listener for a given event name
	 * @property {(eventName: string, arg1?: any, arg2?: any, arg3?: any) => void} emit Emits an event with a given name.
	 * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments.
	 * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners.
	 */

	/**
	 * Creates an object which can listen for and emit events.
	 * This is similar to the EventEmitter API in Node's standard library, but it has a few differences.
	 * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without
	 * letting the modules know about each other at all.
	 * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when
	 * another module throws an error or registers a listener.
	 * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a
	 * `this` value of the emitter instance, which would give listeners access to other listeners.)
	 * @returns {SafeEmitter} An emitter
	 */
	safeEmitter = () => {
		const listeners = Object.create(null);

		return Object.freeze({
			on(eventName, listener) {
				if (eventName in listeners) {
					listeners[eventName].push(listener);
				} else {
					listeners[eventName] = [listener];
				}
			},
			emit(eventName, ...args) {
				if (eventName in listeners) {
					listeners[eventName].forEach(listener => listener(...args));
				}
			},
			eventNames() {
				return Object.keys(listeners);
			},
		});
	};
	return safeEmitter;
}

var cjs$2 = {};

var lib$2 = {exports: {}};

var parseString = {exports: {}};

var Func;
var hasRequiredFunc;

function requireFunc () {
	if (hasRequiredFunc) return Func;
	hasRequiredFunc = 1;
	// Generated by LiveScript 1.6.0
	var apply, curry, flip, fix, over, memoize, toString$ = {}.toString;
	apply = curry$(function(f, list){
	  return f.apply(null, list);
	});
	curry = function(f){
	  return curry$(f);
	};
	flip = curry$(function(f, x, y){
	  return f(y, x);
	});
	fix = function(f){
	  return function(g){
	    return function(){
	      return f(g(g)).apply(null, arguments);
	    };
	  }(function(g){
	    return function(){
	      return f(g(g)).apply(null, arguments);
	    };
	  });
	};
	over = curry$(function(f, g, x, y){
	  return f(g(x), g(y));
	});
	memoize = function(f){
	  var memo;
	  memo = {};
	  return function(){
	    var args, res$, i$, to$, key, arg;
	    res$ = [];
	    for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
	      res$.push(arguments[i$]);
	    }
	    args = res$;
	    key = (function(){
	      var i$, ref$, len$, results$ = [];
	      for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
	        arg = ref$[i$];
	        results$.push(arg + toString$.call(arg).slice(8, -1));
	      }
	      return results$;
	    }()).join('');
	    return memo[key] = key in memo
	      ? memo[key]
	      : f.apply(null, args);
	  };
	};
	Func = {
	  curry: curry,
	  flip: flip,
	  fix: fix,
	  apply: apply,
	  over: over,
	  memoize: memoize
	};
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	return Func;
}

var List;
var hasRequiredList;

function requireList () {
	if (hasRequiredList) return List;
	hasRequiredList = 1;
	// Generated by LiveScript 1.6.0
	var each, map, compact, filter, reject, remove, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString;
	each = curry$(function(f, xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    f(x);
	  }
	  return xs;
	});
	map = curry$(function(f, xs){
	  var i$, len$, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    results$.push(f(x));
	  }
	  return results$;
	});
	compact = function(xs){
	  var i$, len$, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (x) {
	      results$.push(x);
	    }
	  }
	  return results$;
	};
	filter = curry$(function(f, xs){
	  var i$, len$, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (f(x)) {
	      results$.push(x);
	    }
	  }
	  return results$;
	});
	reject = curry$(function(f, xs){
	  var i$, len$, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (!f(x)) {
	      results$.push(x);
	    }
	  }
	  return results$;
	});
	remove = curry$(function(el, xs){
	  var i, x$;
	  i = elemIndex(el, xs);
	  x$ = xs.slice();
	  if (i != null) {
	    x$.splice(i, 1);
	  }
	  return x$;
	});
	partition = curry$(function(f, xs){
	  var passed, failed, i$, len$, x;
	  passed = [];
	  failed = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    (f(x) ? passed : failed).push(x);
	  }
	  return [passed, failed];
	});
	find = curry$(function(f, xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (f(x)) {
	      return x;
	    }
	  }
	});
	head = first = function(xs){
	  return xs[0];
	};
	tail = function(xs){
	  if (!xs.length) {
	    return;
	  }
	  return xs.slice(1);
	};
	last = function(xs){
	  return xs[xs.length - 1];
	};
	initial = function(xs){
	  if (!xs.length) {
	    return;
	  }
	  return xs.slice(0, -1);
	};
	empty = function(xs){
	  return !xs.length;
	};
	reverse = function(xs){
	  return xs.concat().reverse();
	};
	unique = function(xs){
	  var result, i$, len$, x;
	  result = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (!in$(x, result)) {
	      result.push(x);
	    }
	  }
	  return result;
	};
	uniqueBy = curry$(function(f, xs){
	  var seen, i$, len$, x, val, results$ = [];
	  seen = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    val = f(x);
	    if (in$(val, seen)) {
	      continue;
	    }
	    seen.push(val);
	    results$.push(x);
	  }
	  return results$;
	});
	fold = foldl = curry$(function(f, memo, xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    memo = f(memo, x);
	  }
	  return memo;
	});
	fold1 = foldl1 = curry$(function(f, xs){
	  return fold(f, xs[0], xs.slice(1));
	});
	foldr = curry$(function(f, memo, xs){
	  var i$, x;
	  for (i$ = xs.length - 1; i$ >= 0; --i$) {
	    x = xs[i$];
	    memo = f(x, memo);
	  }
	  return memo;
	});
	foldr1 = curry$(function(f, xs){
	  return foldr(f, xs[xs.length - 1], xs.slice(0, -1));
	});
	unfoldr = curry$(function(f, b){
	  var result, x, that;
	  result = [];
	  x = b;
	  while ((that = f(x)) != null) {
	    result.push(that[0]);
	    x = that[1];
	  }
	  return result;
	});
	concat = function(xss){
	  return [].concat.apply([], xss);
	};
	concatMap = curry$(function(f, xs){
	  var x;
	  return [].concat.apply([], (function(){
	    var i$, ref$, len$, results$ = [];
	    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
	      x = ref$[i$];
	      results$.push(f(x));
	    }
	    return results$;
	  }()));
	});
	flatten = function(xs){
	  var x;
	  return [].concat.apply([], (function(){
	    var i$, ref$, len$, results$ = [];
	    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
	      x = ref$[i$];
	      if (toString$.call(x).slice(8, -1) === 'Array') {
	        results$.push(flatten(x));
	      } else {
	        results$.push(x);
	      }
	    }
	    return results$;
	  }()));
	};
	difference = function(xs){
	  var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
	  res$ = [];
	  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
	    res$.push(arguments[i$]);
	  }
	  yss = res$;
	  results = [];
	  outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) {
	      ys = yss[j$];
	      if (in$(x, ys)) {
	        continue outer;
	      }
	    }
	    results.push(x);
	  }
	  return results;
	};
	intersection = function(xs){
	  var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
	  res$ = [];
	  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
	    res$.push(arguments[i$]);
	  }
	  yss = res$;
	  results = [];
	  outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) {
	      ys = yss[j$];
	      if (!in$(x, ys)) {
	        continue outer;
	      }
	    }
	    results.push(x);
	  }
	  return results;
	};
	union = function(){
	  var xss, res$, i$, to$, results, len$, xs, j$, len1$, x;
	  res$ = [];
	  for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
	    res$.push(arguments[i$]);
	  }
	  xss = res$;
	  results = [];
	  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
	    xs = xss[i$];
	    for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) {
	      x = xs[j$];
	      if (!in$(x, results)) {
	        results.push(x);
	      }
	    }
	  }
	  return results;
	};
	countBy = curry$(function(f, xs){
	  var results, i$, len$, x, key;
	  results = {};
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    key = f(x);
	    if (key in results) {
	      results[key] += 1;
	    } else {
	      results[key] = 1;
	    }
	  }
	  return results;
	});
	groupBy = curry$(function(f, xs){
	  var results, i$, len$, x, key;
	  results = {};
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    key = f(x);
	    if (key in results) {
	      results[key].push(x);
	    } else {
	      results[key] = [x];
	    }
	  }
	  return results;
	});
	andList = function(xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (!x) {
	      return false;
	    }
	  }
	  return true;
	};
	orList = function(xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (x) {
	      return true;
	    }
	  }
	  return false;
	};
	any = curry$(function(f, xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (f(x)) {
	      return true;
	    }
	  }
	  return false;
	});
	all = curry$(function(f, xs){
	  var i$, len$, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    if (!f(x)) {
	      return false;
	    }
	  }
	  return true;
	});
	sort = function(xs){
	  return xs.concat().sort(function(x, y){
	    if (x > y) {
	      return 1;
	    } else if (x < y) {
	      return -1;
	    } else {
	      return 0;
	    }
	  });
	};
	sortWith = curry$(function(f, xs){
	  return xs.concat().sort(f);
	});
	sortBy = curry$(function(f, xs){
	  return xs.concat().sort(function(x, y){
	    if (f(x) > f(y)) {
	      return 1;
	    } else if (f(x) < f(y)) {
	      return -1;
	    } else {
	      return 0;
	    }
	  });
	});
	sum = function(xs){
	  var result, i$, len$, x;
	  result = 0;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    result += x;
	  }
	  return result;
	};
	product = function(xs){
	  var result, i$, len$, x;
	  result = 1;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    result *= x;
	  }
	  return result;
	};
	mean = average = function(xs){
	  var sum, i$, len$, x;
	  sum = 0;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    x = xs[i$];
	    sum += x;
	  }
	  return sum / xs.length;
	};
	maximum = function(xs){
	  var max, i$, ref$, len$, x;
	  max = xs[0];
	  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
	    x = ref$[i$];
	    if (x > max) {
	      max = x;
	    }
	  }
	  return max;
	};
	minimum = function(xs){
	  var min, i$, ref$, len$, x;
	  min = xs[0];
	  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
	    x = ref$[i$];
	    if (x < min) {
	      min = x;
	    }
	  }
	  return min;
	};
	maximumBy = curry$(function(f, xs){
	  var max, i$, ref$, len$, x;
	  max = xs[0];
	  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
	    x = ref$[i$];
	    if (f(x) > f(max)) {
	      max = x;
	    }
	  }
	  return max;
	});
	minimumBy = curry$(function(f, xs){
	  var min, i$, ref$, len$, x;
	  min = xs[0];
	  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
	    x = ref$[i$];
	    if (f(x) < f(min)) {
	      min = x;
	    }
	  }
	  return min;
	});
	scan = scanl = curry$(function(f, memo, xs){
	  var last, x;
	  last = memo;
	  return [memo].concat((function(){
	    var i$, ref$, len$, results$ = [];
	    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
	      x = ref$[i$];
	      results$.push(last = f(last, x));
	    }
	    return results$;
	  }()));
	});
	scan1 = scanl1 = curry$(function(f, xs){
	  if (!xs.length) {
	    return;
	  }
	  return scan(f, xs[0], xs.slice(1));
	});
	scanr = curry$(function(f, memo, xs){
	  xs = xs.concat().reverse();
	  return scan(f, memo, xs).reverse();
	});
	scanr1 = curry$(function(f, xs){
	  if (!xs.length) {
	    return;
	  }
	  xs = xs.concat().reverse();
	  return scan(f, xs[0], xs.slice(1)).reverse();
	});
	slice = curry$(function(x, y, xs){
	  return xs.slice(x, y);
	});
	take = curry$(function(n, xs){
	  if (n <= 0) {
	    return xs.slice(0, 0);
	  } else {
	    return xs.slice(0, n);
	  }
	});
	drop = curry$(function(n, xs){
	  if (n <= 0) {
	    return xs;
	  } else {
	    return xs.slice(n);
	  }
	});
	splitAt = curry$(function(n, xs){
	  return [take(n, xs), drop(n, xs)];
	});
	takeWhile = curry$(function(p, xs){
	  var len, i;
	  len = xs.length;
	  if (!len) {
	    return xs;
	  }
	  i = 0;
	  while (i < len && p(xs[i])) {
	    i += 1;
	  }
	  return xs.slice(0, i);
	});
	dropWhile = curry$(function(p, xs){
	  var len, i;
	  len = xs.length;
	  if (!len) {
	    return xs;
	  }
	  i = 0;
	  while (i < len && p(xs[i])) {
	    i += 1;
	  }
	  return xs.slice(i);
	});
	span = curry$(function(p, xs){
	  return [takeWhile(p, xs), dropWhile(p, xs)];
	});
	breakList = curry$(function(p, xs){
	  return span(compose$(p, not$), xs);
	});
	zip = curry$(function(xs, ys){
	  var result, len, i$, len$, i, x;
	  result = [];
	  len = ys.length;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (i === len) {
	      break;
	    }
	    result.push([x, ys[i]]);
	  }
	  return result;
	});
	zipWith = curry$(function(f, xs, ys){
	  var result, len, i$, len$, i, x;
	  result = [];
	  len = ys.length;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (i === len) {
	      break;
	    }
	    result.push(f(x, ys[i]));
	  }
	  return result;
	});
	zipAll = function(){
	  var xss, res$, i$, to$, minLength, len$, xs, ref$, i, lresult$, j$, results$ = [];
	  res$ = [];
	  for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
	    res$.push(arguments[i$]);
	  }
	  xss = res$;
	  minLength = undefined;
	  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
	    xs = xss[i$];
	    minLength <= (ref$ = xs.length) || (minLength = ref$);
	  }
	  for (i$ = 0; i$ < minLength; ++i$) {
	    i = i$;
	    lresult$ = [];
	    for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) {
	      xs = xss[j$];
	      lresult$.push(xs[i]);
	    }
	    results$.push(lresult$);
	  }
	  return results$;
	};
	zipAllWith = function(f){
	  var xss, res$, i$, to$, minLength, len$, xs, ref$, i, results$ = [];
	  res$ = [];
	  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
	    res$.push(arguments[i$]);
	  }
	  xss = res$;
	  minLength = undefined;
	  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
	    xs = xss[i$];
	    minLength <= (ref$ = xs.length) || (minLength = ref$);
	  }
	  for (i$ = 0; i$ < minLength; ++i$) {
	    i = i$;
	    results$.push(f.apply(null, (fn$())));
	  }
	  return results$;
	  function fn$(){
	    var i$, ref$, len$, results$ = [];
	    for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) {
	      xs = ref$[i$];
	      results$.push(xs[i]);
	    }
	    return results$;
	  }
	};
	at = curry$(function(n, xs){
	  if (n < 0) {
	    return xs[xs.length + n];
	  } else {
	    return xs[n];
	  }
	});
	elemIndex = curry$(function(el, xs){
	  var i$, len$, i, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (x === el) {
	      return i;
	    }
	  }
	});
	elemIndices = curry$(function(el, xs){
	  var i$, len$, i, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (x === el) {
	      results$.push(i);
	    }
	  }
	  return results$;
	});
	findIndex = curry$(function(f, xs){
	  var i$, len$, i, x;
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (f(x)) {
	      return i;
	    }
	  }
	});
	findIndices = curry$(function(f, xs){
	  var i$, len$, i, x, results$ = [];
	  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
	    i = i$;
	    x = xs[i$];
	    if (f(x)) {
	      results$.push(i);
	    }
	  }
	  return results$;
	});
	List = {
	  each: each,
	  map: map,
	  filter: filter,
	  compact: compact,
	  reject: reject,
	  remove: remove,
	  partition: partition,
	  find: find,
	  head: head,
	  first: first,
	  tail: tail,
	  last: last,
	  initial: initial,
	  empty: empty,
	  reverse: reverse,
	  difference: difference,
	  intersection: intersection,
	  union: union,
	  countBy: countBy,
	  groupBy: groupBy,
	  fold: fold,
	  fold1: fold1,
	  foldl: foldl,
	  foldl1: foldl1,
	  foldr: foldr,
	  foldr1: foldr1,
	  unfoldr: unfoldr,
	  andList: andList,
	  orList: orList,
	  any: any,
	  all: all,
	  unique: unique,
	  uniqueBy: uniqueBy,
	  sort: sort,
	  sortWith: sortWith,
	  sortBy: sortBy,
	  sum: sum,
	  product: product,
	  mean: mean,
	  average: average,
	  concat: concat,
	  concatMap: concatMap,
	  flatten: flatten,
	  maximum: maximum,
	  minimum: minimum,
	  maximumBy: maximumBy,
	  minimumBy: minimumBy,
	  scan: scan,
	  scan1: scan1,
	  scanl: scanl,
	  scanl1: scanl1,
	  scanr: scanr,
	  scanr1: scanr1,
	  slice: slice,
	  take: take,
	  drop: drop,
	  splitAt: splitAt,
	  takeWhile: takeWhile,
	  dropWhile: dropWhile,
	  span: span,
	  breakList: breakList,
	  zip: zip,
	  zipWith: zipWith,
	  zipAll: zipAll,
	  zipAllWith: zipAllWith,
	  at: at,
	  elemIndex: elemIndex,
	  elemIndices: elemIndices,
	  findIndex: findIndex,
	  findIndices: findIndices
	};
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	function in$(x, xs){
	  var i = -1, l = xs.length >>> 0;
	  while (++i < l) if (x === xs[i]) return true;
	  return false;
	}
	function compose$() {
	  var functions = arguments;
	  return function() {
	    var i, result;
	    result = functions[0].apply(this, arguments);
	    for (i = 1; i < functions.length; ++i) {
	      result = functions[i](result);
	    }
	    return result;
	  };
	}
	function not$(x){ return !x; }
	return List;
}

var Obj;
var hasRequiredObj;

function requireObj () {
	if (hasRequiredObj) return Obj;
	hasRequiredObj = 1;
	// Generated by LiveScript 1.6.0
	var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
	values = function(object){
	  var i$, x, results$ = [];
	  for (i$ in object) {
	    x = object[i$];
	    results$.push(x);
	  }
	  return results$;
	};
	keys = function(object){
	  var x, results$ = [];
	  for (x in object) {
	    results$.push(x);
	  }
	  return results$;
	};
	pairsToObj = function(object){
	  var i$, len$, x, resultObj$ = {};
	  for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
	    x = object[i$];
	    resultObj$[x[0]] = x[1];
	  }
	  return resultObj$;
	};
	objToPairs = function(object){
	  var key, value, results$ = [];
	  for (key in object) {
	    value = object[key];
	    results$.push([key, value]);
	  }
	  return results$;
	};
	listsToObj = curry$(function(keys, values){
	  var i$, len$, i, key, resultObj$ = {};
	  for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
	    i = i$;
	    key = keys[i$];
	    resultObj$[key] = values[i];
	  }
	  return resultObj$;
	});
	objToLists = function(object){
	  var keys, values, key, value;
	  keys = [];
	  values = [];
	  for (key in object) {
	    value = object[key];
	    keys.push(key);
	    values.push(value);
	  }
	  return [keys, values];
	};
	empty = function(object){
	  var x;
	  for (x in object) {
	    return false;
	  }
	  return true;
	};
	each = curry$(function(f, object){
	  var i$, x;
	  for (i$ in object) {
	    x = object[i$];
	    f(x);
	  }
	  return object;
	});
	map = curry$(function(f, object){
	  var k, x, resultObj$ = {};
	  for (k in object) {
	    x = object[k];
	    resultObj$[k] = f(x);
	  }
	  return resultObj$;
	});
	compact = function(object){
	  var k, x, resultObj$ = {};
	  for (k in object) {
	    x = object[k];
	    if (x) {
	      resultObj$[k] = x;
	    }
	  }
	  return resultObj$;
	};
	filter = curry$(function(f, object){
	  var k, x, resultObj$ = {};
	  for (k in object) {
	    x = object[k];
	    if (f(x)) {
	      resultObj$[k] = x;
	    }
	  }
	  return resultObj$;
	});
	reject = curry$(function(f, object){
	  var k, x, resultObj$ = {};
	  for (k in object) {
	    x = object[k];
	    if (!f(x)) {
	      resultObj$[k] = x;
	    }
	  }
	  return resultObj$;
	});
	partition = curry$(function(f, object){
	  var passed, failed, k, x;
	  passed = {};
	  failed = {};
	  for (k in object) {
	    x = object[k];
	    (f(x) ? passed : failed)[k] = x;
	  }
	  return [passed, failed];
	});
	find = curry$(function(f, object){
	  var i$, x;
	  for (i$ in object) {
	    x = object[i$];
	    if (f(x)) {
	      return x;
	    }
	  }
	});
	Obj = {
	  values: values,
	  keys: keys,
	  pairsToObj: pairsToObj,
	  objToPairs: objToPairs,
	  listsToObj: listsToObj,
	  objToLists: objToLists,
	  empty: empty,
	  each: each,
	  map: map,
	  filter: filter,
	  compact: compact,
	  reject: reject,
	  partition: partition,
	  find: find
	};
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	return Obj;
}

var Str;
var hasRequiredStr;

function requireStr () {
	if (hasRequiredStr) return Str;
	hasRequiredStr = 1;
	// Generated by LiveScript 1.6.0
	var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
	split = curry$(function(sep, str){
	  return str.split(sep);
	});
	join = curry$(function(sep, xs){
	  return xs.join(sep);
	});
	lines = function(str){
	  if (!str.length) {
	    return [];
	  }
	  return str.split('\n');
	};
	unlines = function(it){
	  return it.join('\n');
	};
	words = function(str){
	  if (!str.length) {
	    return [];
	  }
	  return str.split(/[ ]+/);
	};
	unwords = function(it){
	  return it.join(' ');
	};
	chars = function(it){
	  return it.split('');
	};
	unchars = function(it){
	  return it.join('');
	};
	reverse = function(str){
	  return str.split('').reverse().join('');
	};
	repeat = curry$(function(n, str){
	  var result, i$;
	  result = '';
	  for (i$ = 0; i$ < n; ++i$) {
	    result += str;
	  }
	  return result;
	});
	capitalize = function(str){
	  return str.charAt(0).toUpperCase() + str.slice(1);
	};
	camelize = function(it){
	  return it.replace(/[-_]+(.)?/g, function(arg$, c){
	    return (c != null ? c : '').toUpperCase();
	  });
	};
	dasherize = function(str){
	  return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
	    return lower + "-" + (upper.length > 1
	      ? upper
	      : upper.toLowerCase());
	  }).replace(/^([A-Z]+)/, function(arg$, upper){
	    if (upper.length > 1) {
	      return upper + "-";
	    } else {
	      return upper.toLowerCase();
	    }
	  });
	};
	Str = {
	  split: split,
	  join: join,
	  lines: lines,
	  unlines: unlines,
	  words: words,
	  unwords: unwords,
	  chars: chars,
	  unchars: unchars,
	  reverse: reverse,
	  repeat: repeat,
	  capitalize: capitalize,
	  camelize: camelize,
	  dasherize: dasherize
	};
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	return Str;
}

var Num;
var hasRequiredNum;

function requireNum () {
	if (hasRequiredNum) return Num;
	hasRequiredNum = 1;
	// Generated by LiveScript 1.6.0
	var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
	max = curry$(function(x$, y$){
	  return x$ > y$ ? x$ : y$;
	});
	min = curry$(function(x$, y$){
	  return x$ < y$ ? x$ : y$;
	});
	negate = function(x){
	  return -x;
	};
	abs = Math.abs;
	signum = function(x){
	  if (x < 0) {
	    return -1;
	  } else if (x > 0) {
	    return 1;
	  } else {
	    return 0;
	  }
	};
	quot = curry$(function(x, y){
	  return ~~(x / y);
	});
	rem = curry$(function(x$, y$){
	  return x$ % y$;
	});
	div = curry$(function(x, y){
	  return Math.floor(x / y);
	});
	mod = curry$(function(x$, y$){
	  var ref$;
	  return ((x$) % (ref$ = y$) + ref$) % ref$;
	});
	recip = (function(it){
	  return 1 / it;
	});
	pi = Math.PI;
	tau = pi * 2;
	exp = Math.exp;
	sqrt = Math.sqrt;
	ln = Math.log;
	pow = curry$(function(x$, y$){
	  return Math.pow(x$, y$);
	});
	sin = Math.sin;
	tan = Math.tan;
	cos = Math.cos;
	asin = Math.asin;
	acos = Math.acos;
	atan = Math.atan;
	atan2 = curry$(function(x, y){
	  return Math.atan2(x, y);
	});
	truncate = function(x){
	  return ~~x;
	};
	round = Math.round;
	ceiling = Math.ceil;
	floor = Math.floor;
	isItNaN = function(x){
	  return x !== x;
	};
	even = function(x){
	  return x % 2 === 0;
	};
	odd = function(x){
	  return x % 2 !== 0;
	};
	gcd = curry$(function(x, y){
	  var z;
	  x = Math.abs(x);
	  y = Math.abs(y);
	  while (y !== 0) {
	    z = x % y;
	    x = y;
	    y = z;
	  }
	  return x;
	});
	lcm = curry$(function(x, y){
	  return Math.abs(Math.floor(x / gcd(x, y) * y));
	});
	Num = {
	  max: max,
	  min: min,
	  negate: negate,
	  abs: abs,
	  signum: signum,
	  quot: quot,
	  rem: rem,
	  div: div,
	  mod: mod,
	  recip: recip,
	  pi: pi,
	  tau: tau,
	  exp: exp,
	  sqrt: sqrt,
	  ln: ln,
	  pow: pow,
	  sin: sin,
	  tan: tan,
	  cos: cos,
	  acos: acos,
	  asin: asin,
	  atan: atan,
	  atan2: atan2,
	  truncate: truncate,
	  round: round,
	  ceiling: ceiling,
	  floor: floor,
	  isItNaN: isItNaN,
	  even: even,
	  odd: odd,
	  gcd: gcd,
	  lcm: lcm
	};
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	return Num;
}

var lib$1;
var hasRequiredLib$2;

function requireLib$2 () {
	if (hasRequiredLib$2) return lib$1;
	hasRequiredLib$2 = 1;
	// Generated by LiveScript 1.6.0
	var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
	Func = requireFunc();
	List = requireList();
	Obj = requireObj();
	Str = requireStr();
	Num = requireNum();
	id = function(x){
	  return x;
	};
	isType = curry$(function(type, x){
	  return toString$.call(x).slice(8, -1) === type;
	});
	replicate = curry$(function(n, x){
	  var i$, results$ = [];
	  for (i$ = 0; i$ < n; ++i$) {
	    results$.push(x);
	  }
	  return results$;
	});
	Str.empty = List.empty;
	Str.slice = List.slice;
	Str.take = List.take;
	Str.drop = List.drop;
	Str.splitAt = List.splitAt;
	Str.takeWhile = List.takeWhile;
	Str.dropWhile = List.dropWhile;
	Str.span = List.span;
	Str.breakStr = List.breakList;
	prelude = {
	  Func: Func,
	  List: List,
	  Obj: Obj,
	  Str: Str,
	  Num: Num,
	  id: id,
	  isType: isType,
	  replicate: replicate
	};
	prelude.each = List.each;
	prelude.map = List.map;
	prelude.filter = List.filter;
	prelude.compact = List.compact;
	prelude.reject = List.reject;
	prelude.partition = List.partition;
	prelude.find = List.find;
	prelude.head = List.head;
	prelude.first = List.first;
	prelude.tail = List.tail;
	prelude.last = List.last;
	prelude.initial = List.initial;
	prelude.empty = List.empty;
	prelude.reverse = List.reverse;
	prelude.difference = List.difference;
	prelude.intersection = List.intersection;
	prelude.union = List.union;
	prelude.countBy = List.countBy;
	prelude.groupBy = List.groupBy;
	prelude.fold = List.fold;
	prelude.foldl = List.foldl;
	prelude.fold1 = List.fold1;
	prelude.foldl1 = List.foldl1;
	prelude.foldr = List.foldr;
	prelude.foldr1 = List.foldr1;
	prelude.unfoldr = List.unfoldr;
	prelude.andList = List.andList;
	prelude.orList = List.orList;
	prelude.any = List.any;
	prelude.all = List.all;
	prelude.unique = List.unique;
	prelude.uniqueBy = List.uniqueBy;
	prelude.sort = List.sort;
	prelude.sortWith = List.sortWith;
	prelude.sortBy = List.sortBy;
	prelude.sum = List.sum;
	prelude.product = List.product;
	prelude.mean = List.mean;
	prelude.average = List.average;
	prelude.concat = List.concat;
	prelude.concatMap = List.concatMap;
	prelude.flatten = List.flatten;
	prelude.maximum = List.maximum;
	prelude.minimum = List.minimum;
	prelude.maximumBy = List.maximumBy;
	prelude.minimumBy = List.minimumBy;
	prelude.scan = List.scan;
	prelude.scanl = List.scanl;
	prelude.scan1 = List.scan1;
	prelude.scanl1 = List.scanl1;
	prelude.scanr = List.scanr;
	prelude.scanr1 = List.scanr1;
	prelude.slice = List.slice;
	prelude.take = List.take;
	prelude.drop = List.drop;
	prelude.splitAt = List.splitAt;
	prelude.takeWhile = List.takeWhile;
	prelude.dropWhile = List.dropWhile;
	prelude.span = List.span;
	prelude.breakList = List.breakList;
	prelude.zip = List.zip;
	prelude.zipWith = List.zipWith;
	prelude.zipAll = List.zipAll;
	prelude.zipAllWith = List.zipAllWith;
	prelude.at = List.at;
	prelude.elemIndex = List.elemIndex;
	prelude.elemIndices = List.elemIndices;
	prelude.findIndex = List.findIndex;
	prelude.findIndices = List.findIndices;
	prelude.apply = Func.apply;
	prelude.curry = Func.curry;
	prelude.flip = Func.flip;
	prelude.fix = Func.fix;
	prelude.over = Func.over;
	prelude.split = Str.split;
	prelude.join = Str.join;
	prelude.lines = Str.lines;
	prelude.unlines = Str.unlines;
	prelude.words = Str.words;
	prelude.unwords = Str.unwords;
	prelude.chars = Str.chars;
	prelude.unchars = Str.unchars;
	prelude.repeat = Str.repeat;
	prelude.capitalize = Str.capitalize;
	prelude.camelize = Str.camelize;
	prelude.dasherize = Str.dasherize;
	prelude.values = Obj.values;
	prelude.keys = Obj.keys;
	prelude.pairsToObj = Obj.pairsToObj;
	prelude.objToPairs = Obj.objToPairs;
	prelude.listsToObj = Obj.listsToObj;
	prelude.objToLists = Obj.objToLists;
	prelude.max = Num.max;
	prelude.min = Num.min;
	prelude.negate = Num.negate;
	prelude.abs = Num.abs;
	prelude.signum = Num.signum;
	prelude.quot = Num.quot;
	prelude.rem = Num.rem;
	prelude.div = Num.div;
	prelude.mod = Num.mod;
	prelude.recip = Num.recip;
	prelude.pi = Num.pi;
	prelude.tau = Num.tau;
	prelude.exp = Num.exp;
	prelude.sqrt = Num.sqrt;
	prelude.ln = Num.ln;
	prelude.pow = Num.pow;
	prelude.sin = Num.sin;
	prelude.tan = Num.tan;
	prelude.cos = Num.cos;
	prelude.acos = Num.acos;
	prelude.asin = Num.asin;
	prelude.atan = Num.atan;
	prelude.atan2 = Num.atan2;
	prelude.truncate = Num.truncate;
	prelude.round = Num.round;
	prelude.ceiling = Num.ceiling;
	prelude.floor = Num.floor;
	prelude.isItNaN = Num.isItNaN;
	prelude.even = Num.even;
	prelude.odd = Num.odd;
	prelude.gcd = Num.gcd;
	prelude.lcm = Num.lcm;
	prelude.VERSION = '1.2.1';
	lib$1 = prelude;
	function curry$(f, bound){
	  var context,
	  _curry = function(args) {
	    return f.length > 1 ? function(){
	      var params = args ? args.concat() : [];
	      context = this;
	      return params.push.apply(params, arguments) <
	          f.length && arguments.length ?
	        _curry.call(context, params) : f.apply(context, params);
	    } : f;
	  };
	  return _curry();
	}
	return lib$1;
}

var hasRequiredParseString;

function requireParseString () {
	if (hasRequiredParseString) return parseString.exports;
	hasRequiredParseString = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var reject, special, tokenRegex;
	  reject = requireLib$2().reject;
	  function consumeOp(tokens, op){
	    if (tokens[0] === op) {
	      return tokens.shift();
	    } else {
	      throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
	    }
	  }
	  function maybeConsumeOp(tokens, op){
	    if (tokens[0] === op) {
	      return tokens.shift();
	    }
	  }
	  function consumeList(tokens, arg$, hasDelimiters){
	    var open, close, result, untilTest;
	    open = arg$[0], close = arg$[1];
	    if (hasDelimiters) {
	      consumeOp(tokens, open);
	    }
	    result = [];
	    untilTest = "," + (hasDelimiters ? close : '');
	    while (tokens.length && (hasDelimiters && tokens[0] !== close)) {
	      result.push(consumeElement(tokens, untilTest));
	      maybeConsumeOp(tokens, ',');
	    }
	    if (hasDelimiters) {
	      consumeOp(tokens, close);
	    }
	    return result;
	  }
	  function consumeArray(tokens, hasDelimiters){
	    return consumeList(tokens, ['[', ']'], hasDelimiters);
	  }
	  function consumeTuple(tokens, hasDelimiters){
	    return consumeList(tokens, ['(', ')'], hasDelimiters);
	  }
	  function consumeFields(tokens, hasDelimiters){
	    var result, untilTest, key;
	    if (hasDelimiters) {
	      consumeOp(tokens, '{');
	    }
	    result = {};
	    untilTest = "," + (hasDelimiters ? '}' : '');
	    while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) {
	      key = consumeValue(tokens, ':');
	      consumeOp(tokens, ':');
	      result[key] = consumeElement(tokens, untilTest);
	      maybeConsumeOp(tokens, ',');
	    }
	    if (hasDelimiters) {
	      consumeOp(tokens, '}');
	    }
	    return result;
	  }
	  function consumeValue(tokens, untilTest){
	    var out;
	    untilTest == null && (untilTest = '');
	    out = '';
	    while (tokens.length && -1 === untilTest.indexOf(tokens[0])) {
	      out += tokens.shift();
	    }
	    return out;
	  }
	  function consumeElement(tokens, untilTest){
	    switch (tokens[0]) {
	    case '[':
	      return consumeArray(tokens, true);
	    case '(':
	      return consumeTuple(tokens, true);
	    case '{':
	      return consumeFields(tokens, true);
	    default:
	      return consumeValue(tokens, untilTest);
	    }
	  }
	  function consumeTopLevel(tokens, types, options){
	    var ref$, type, structure, origTokens, result, finalResult, x$, y$;
	    ref$ = types[0], type = ref$.type, structure = ref$.structure;
	    origTokens = tokens.concat();
	    if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) {
	      result = structure === 'array' || type === 'Array'
	        ? consumeArray(tokens, tokens[0] === '[')
	        : structure === 'tuple'
	          ? consumeTuple(tokens, tokens[0] === '(')
	          : consumeFields(tokens, tokens[0] === '{');
	      finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array'
	        ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$)
	        : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result;
	    } else {
	      finalResult = consumeElement(tokens);
	    }
	    return finalResult;
	  }
	  special = /\[\]\(\)}{:,/.source;
	  tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*');
	  parseString.exports = function(types, string, options){
	    var tokens, node;
	    options == null && (options = {});
	    if (!options.explicit && types.length === 1 && types[0].type === 'String') {
	      return string;
	    }
	    tokens = reject(not$, string.split(tokenRegex));
	    node = consumeTopLevel(tokens, types, options);
	    if (!node) {
	      throw new Error("Error parsing '" + string + "'.");
	    }
	    return node;
	  };
	  function not$(x){ return !x; }
	}).call(this);
	return parseString.exports;
}

var cast = {exports: {}};

var lib = {exports: {}};

var parseType = {exports: {}};

var hasRequiredParseType;

function requireParseType () {
	if (hasRequiredParseType) return parseType.exports;
	hasRequiredParseType = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var identifierRegex, tokenRegex;
	  identifierRegex = /[\$\w]+/;
	  function peek(tokens){
	    var token;
	    token = tokens[0];
	    if (token == null) {
	      throw new Error('Unexpected end of input.');
	    }
	    return token;
	  }
	  function consumeIdent(tokens){
	    var token;
	    token = peek(tokens);
	    if (!identifierRegex.test(token)) {
	      throw new Error("Expected text, got '" + token + "' instead.");
	    }
	    return tokens.shift();
	  }
	  function consumeOp(tokens, op){
	    var token;
	    token = peek(tokens);
	    if (token !== op) {
	      throw new Error("Expected '" + op + "', got '" + token + "' instead.");
	    }
	    return tokens.shift();
	  }
	  function maybeConsumeOp(tokens, op){
	    var token;
	    token = tokens[0];
	    if (token === op) {
	      return tokens.shift();
	    } else {
	      return null;
	    }
	  }
	  function consumeArray(tokens){
	    var types;
	    consumeOp(tokens, '[');
	    if (peek(tokens) === ']') {
	      throw new Error("Must specify type of Array - eg. [Type], got [] instead.");
	    }
	    types = consumeTypes(tokens);
	    consumeOp(tokens, ']');
	    return {
	      structure: 'array',
	      of: types
	    };
	  }
	  function consumeTuple(tokens){
	    var components;
	    components = [];
	    consumeOp(tokens, '(');
	    if (peek(tokens) === ')') {
	      throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead.");
	    }
	    for (;;) {
	      components.push(consumeTypes(tokens));
	      maybeConsumeOp(tokens, ',');
	      if (')' === peek(tokens)) {
	        break;
	      }
	    }
	    consumeOp(tokens, ')');
	    return {
	      structure: 'tuple',
	      of: components
	    };
	  }
	  function consumeFields(tokens){
	    var fields, subset, ref$, key, types;
	    fields = {};
	    consumeOp(tokens, '{');
	    subset = false;
	    for (;;) {
	      if (maybeConsumeOp(tokens, '...')) {
	        subset = true;
	        break;
	      }
	      ref$ = consumeField(tokens), key = ref$[0], types = ref$[1];
	      fields[key] = types;
	      maybeConsumeOp(tokens, ',');
	      if ('}' === peek(tokens)) {
	        break;
	      }
	    }
	    consumeOp(tokens, '}');
	    return {
	      structure: 'fields',
	      of: fields,
	      subset: subset
	    };
	  }
	  function consumeField(tokens){
	    var key, types;
	    key = consumeIdent(tokens);
	    consumeOp(tokens, ':');
	    types = consumeTypes(tokens);
	    return [key, types];
	  }
	  function maybeConsumeStructure(tokens){
	    switch (tokens[0]) {
	    case '[':
	      return consumeArray(tokens);
	    case '(':
	      return consumeTuple(tokens);
	    case '{':
	      return consumeFields(tokens);
	    }
	  }
	  function consumeType(tokens){
	    var token, wildcard, type, structure;
	    token = peek(tokens);
	    wildcard = token === '*';
	    if (wildcard || identifierRegex.test(token)) {
	      type = wildcard
	        ? consumeOp(tokens, '*')
	        : consumeIdent(tokens);
	      structure = maybeConsumeStructure(tokens);
	      if (structure) {
	        return structure.type = type, structure;
	      } else {
	        return {
	          type: type
	        };
	      }
	    } else {
	      structure = maybeConsumeStructure(tokens);
	      if (!structure) {
	        throw new Error("Unexpected character: " + token);
	      }
	      return structure;
	    }
	  }
	  function consumeTypes(tokens){
	    var lookahead, types, typesSoFar, typeObj, type, structure;
	    if ('::' === peek(tokens)) {
	      throw new Error("No comment before comment separator '::' found.");
	    }
	    lookahead = tokens[1];
	    if (lookahead != null && lookahead === '::') {
	      tokens.shift();
	      tokens.shift();
	    }
	    types = [];
	    typesSoFar = {};
	    if ('Maybe' === peek(tokens)) {
	      tokens.shift();
	      types = [
	        {
	          type: 'Undefined'
	        }, {
	          type: 'Null'
	        }
	      ];
	      typesSoFar = {
	        Undefined: true,
	        Null: true
	      };
	    }
	    for (;;) {
	      typeObj = consumeType(tokens), type = typeObj.type, structure = typeObj.structure;
	      if (!typesSoFar[type]) {
	        types.push(typeObj);
	      }
	      if (structure == null) {
	        typesSoFar[type] = true;
	      }
	      if (!maybeConsumeOp(tokens, '|')) {
	        break;
	      }
	    }
	    return types;
	  }
	  tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g');
	  parseType.exports = function(input){
	    var tokens, e;
	    if (!input.length) {
	      throw new Error('No type specified.');
	    }
	    tokens = input.match(tokenRegex) || [];
	    if (in$('->', tokens)) {
	      throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'.");
	    }
	    try {
	      return consumeTypes(tokens);
	    } catch (e$) {
	      e = e$;
	      throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'");
	    }
	  };
	  function in$(x, xs){
	    var i = -1, l = xs.length >>> 0;
	    while (++i < l) if (x === xs[i]) return true;
	    return false;
	  }
	}).call(this);
	return parseType.exports;
}

var check = {exports: {}};

var hasRequiredCheck;

function requireCheck () {
	if (hasRequiredCheck) return check.exports;
	hasRequiredCheck = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString;
	  ref$ = requireLib$2(), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN;
	  types = {
	    Number: {
	      typeOf: 'Number',
	      validate: function(it){
	        return !isItNaN(it);
	      }
	    },
	    NaN: {
	      typeOf: 'Number',
	      validate: isItNaN
	    },
	    Int: {
	      typeOf: 'Number',
	      validate: function(it){
	        return !isItNaN(it) && it % 1 === 0;
	      }
	    },
	    Float: {
	      typeOf: 'Number',
	      validate: function(it){
	        return !isItNaN(it);
	      }
	    },
	    Date: {
	      typeOf: 'Date',
	      validate: function(it){
	        return !isItNaN(it.getTime());
	      }
	    }
	  };
	  defaultType = {
	    array: 'Array',
	    tuple: 'Array'
	  };
	  function checkArray(input, type, options){
	    return all(function(it){
	      return checkMultiple(it, type.of, options);
	    }, input);
	  }
	  function checkTuple(input, type, options){
	    var i, i$, ref$, len$, types;
	    i = 0;
	    for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
	      types = ref$[i$];
	      if (!checkMultiple(input[i], types, options)) {
	        return false;
	      }
	      i++;
	    }
	    return input.length <= i;
	  }
	  function checkFields(input, type, options){
	    var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types;
	    inputKeys = {};
	    numInputKeys = 0;
	    for (k in input) {
	      inputKeys[k] = true;
	      numInputKeys++;
	    }
	    numOfKeys = 0;
	    for (key in ref$ = type.of) {
	      types = ref$[key];
	      if (!checkMultiple(input[key], types, options)) {
	        return false;
	      }
	      if (inputKeys[key]) {
	        numOfKeys++;
	      }
	    }
	    return type.subset || numInputKeys === numOfKeys;
	  }
	  function checkStructure(input, type, options){
	    if (!(input instanceof Object)) {
	      return false;
	    }
	    switch (type.structure) {
	    case 'fields':
	      return checkFields(input, type, options);
	    case 'array':
	      return checkArray(input, type, options);
	    case 'tuple':
	      return checkTuple(input, type, options);
	    }
	  }
	  function check$1(input, typeObj, options){
	    var type, structure, setting, that;
	    type = typeObj.type, structure = typeObj.structure;
	    if (type) {
	      if (type === '*') {
	        return true;
	      }
	      setting = options.customTypes[type] || types[type];
	      if (setting) {
	        return (setting.typeOf === void 0 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input);
	      } else {
	        return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options));
	      }
	    } else if (structure) {
	      if (that = defaultType[structure]) {
	        if (that !== toString$.call(input).slice(8, -1)) {
	          return false;
	        }
	      }
	      return checkStructure(input, typeObj, options);
	    } else {
	      throw new Error("No type defined. Input: " + input + ".");
	    }
	  }
	  function checkMultiple(input, types, options){
	    if (toString$.call(types).slice(8, -1) !== 'Array') {
	      throw new Error("Types must be in an array. Input: " + input + ".");
	    }
	    return any(function(it){
	      return check$1(input, it, options);
	    }, types);
	  }
	  check.exports = function(parsedType, input, options){
	    options == null && (options = {});
	    if (options.customTypes == null) {
	      options.customTypes = {};
	    }
	    return checkMultiple(input, parsedType, options);
	  };
	}).call(this);
	return check.exports;
}

var hasRequiredLib$1;

function requireLib$1 () {
	if (hasRequiredLib$1) return lib.exports;
	hasRequiredLib$1 = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var VERSION, parseType, parsedTypeCheck, typeCheck;
	  VERSION = '0.4.0';
	  parseType = requireParseType();
	  parsedTypeCheck = requireCheck();
	  typeCheck = function(type, input, options){
	    return parsedTypeCheck(parseType(type), input, options);
	  };
	  lib.exports = {
	    VERSION: VERSION,
	    typeCheck: typeCheck,
	    parsedTypeCheck: parsedTypeCheck,
	    parseType: parseType
	  };
	}).call(this);
	return lib.exports;
}

var hasRequiredCast;

function requireCast () {
	if (hasRequiredCast) return cast.exports;
	hasRequiredCast = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var parsedTypeCheck, types, toString$ = {}.toString;
	  parsedTypeCheck = requireLib$1().parsedTypeCheck;
	  types = {
	    '*': function(value, options){
	      switch (toString$.call(value).slice(8, -1)) {
	      case 'Array':
	        return typeCast(value, {
	          type: 'Array'
	        }, options);
	      case 'Object':
	        return typeCast(value, {
	          type: 'Object'
	        }, options);
	      default:
	        return {
	          type: 'Just',
	          value: typesCast(value, [
	            {
	              type: 'Undefined'
	            }, {
	              type: 'Null'
	            }, {
	              type: 'NaN'
	            }, {
	              type: 'Boolean'
	            }, {
	              type: 'Number'
	            }, {
	              type: 'Date'
	            }, {
	              type: 'RegExp'
	            }, {
	              type: 'Array'
	            }, {
	              type: 'Object'
	            }, {
	              type: 'String'
	            }
	          ], (options.explicit = true, options))
	        };
	      }
	    },
	    Undefined: function(it){
	      if (it === 'undefined' || it === void 0) {
	        return {
	          type: 'Just',
	          value: void 0
	        };
	      } else {
	        return {
	          type: 'Nothing'
	        };
	      }
	    },
	    Null: function(it){
	      if (it === 'null') {
	        return {
	          type: 'Just',
	          value: null
	        };
	      } else {
	        return {
	          type: 'Nothing'
	        };
	      }
	    },
	    NaN: function(it){
	      if (it === 'NaN') {
	        return {
	          type: 'Just',
	          value: NaN
	        };
	      } else {
	        return {
	          type: 'Nothing'
	        };
	      }
	    },
	    Boolean: function(it){
	      if (it === 'true') {
	        return {
	          type: 'Just',
	          value: true
	        };
	      } else if (it === 'false') {
	        return {
	          type: 'Just',
	          value: false
	        };
	      } else {
	        return {
	          type: 'Nothing'
	        };
	      }
	    },
	    Number: function(it){
	      return {
	        type: 'Just',
	        value: +it
	      };
	    },
	    Int: function(it){
	      return {
	        type: 'Just',
	        value: +it
	      };
	    },
	    Float: function(it){
	      return {
	        type: 'Just',
	        value: +it
	      };
	    },
	    Date: function(value, options){
	      var that;
	      if (that = /^\#([\s\S]*)\#$/.exec(value)) {
	        return {
	          type: 'Just',
	          value: new Date(+that[1] || that[1])
	        };
	      } else if (options.explicit) {
	        return {
	          type: 'Nothing'
	        };
	      } else {
	        return {
	          type: 'Just',
	          value: new Date(+value || value)
	        };
	      }
	    },
	    RegExp: function(value, options){
	      var that;
	      if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) {
	        return {
	          type: 'Just',
	          value: new RegExp(that[1], that[2])
	        };
	      } else if (options.explicit) {
	        return {
	          type: 'Nothing'
	        };
	      } else {
	        return {
	          type: 'Just',
	          value: new RegExp(value)
	        };
	      }
	    },
	    Array: function(value, options){
	      return castArray(value, {
	        of: [{
	          type: '*'
	        }]
	      }, options);
	    },
	    Object: function(value, options){
	      return castFields(value, {
	        of: {}
	      }, options);
	    },
	    String: function(it){
	      var replace, that;
	      if (toString$.call(it).slice(8, -1) !== 'String') {
	        return {
	          type: 'Nothing'
	        };
	      }
	      replace = function(value, quote){
	        return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){
	          switch (escaped[0]) {
	          case quote:
	            return quote;
	          case '\\':
	            return '\\';
	          case 'b':
	            return '\b';
	          case 'f':
	            return '\f';
	          case 'n':
	            return '\n';
	          case 'r':
	            return '\r';
	          case 't':
	            return '\t';
	          case 'u':
	            return JSON.parse("\"" + all + "\"");
	          default:
	            return escaped;
	          }
	        });
	      };
	      if (that = it.match(/^'([\s\S]*)'$/)) {
	        return {
	          type: 'Just',
	          value: replace(that[1], "'")
	        };
	      } else if (that = it.match(/^"([\s\S]*)"$/)) {
	        return {
	          type: 'Just',
	          value: replace(that[1], '"')
	        };
	      } else {
	        return {
	          type: 'Just',
	          value: it
	        };
	      }
	    }
	  };
	  function castArray(node, type, options){
	    var typeOf, element;
	    if (toString$.call(node).slice(8, -1) !== 'Array') {
	      return {
	        type: 'Nothing'
	      };
	    }
	    typeOf = type.of;
	    return {
	      type: 'Just',
	      value: (function(){
	        var i$, ref$, len$, results$ = [];
	        for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) {
	          element = ref$[i$];
	          results$.push(typesCast(element, typeOf, options));
	        }
	        return results$;
	      }())
	    };
	  }
	  function castTuple(node, type, options){
	    var result, i, i$, ref$, len$, types, cast;
	    if (toString$.call(node).slice(8, -1) !== 'Array') {
	      return {
	        type: 'Nothing'
	      };
	    }
	    result = [];
	    i = 0;
	    for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
	      types = ref$[i$];
	      cast = typesCast(node[i], types, options);
	      if (toString$.call(cast).slice(8, -1) !== 'Undefined') {
	        result.push(cast);
	      }
	      i++;
	    }
	    if (node.length <= i) {
	      return {
	        type: 'Just',
	        value: result
	      };
	    } else {
	      return {
	        type: 'Nothing'
	      };
	    }
	  }
	  function castFields(node, type, options){
	    var typeOf, key, value;
	    if (toString$.call(node).slice(8, -1) !== 'Object') {
	      return {
	        type: 'Nothing'
	      };
	    }
	    typeOf = type.of;
	    return {
	      type: 'Just',
	      value: (function(){
	        var ref$, resultObj$ = {};
	        for (key in ref$ = node) {
	          value = ref$[key];
	          resultObj$[typesCast(key, [{
	            type: 'String'
	          }], options)] = typesCast(value, typeOf[key] || [{
	            type: '*'
	          }], options);
	        }
	        return resultObj$;
	      }())
	    };
	  }
	  function typeCast(node, typeObj, options){
	    var type, structure, castFunc, ref$;
	    type = typeObj.type, structure = typeObj.structure;
	    if (type) {
	      castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 0) || types[type];
	      if (!castFunc) {
	        throw new Error("Type not defined: " + type + ".");
	      }
	      return castFunc(node, options, typesCast);
	    } else {
	      switch (structure) {
	      case 'array':
	        return castArray(node, typeObj, options);
	      case 'tuple':
	        return castTuple(node, typeObj, options);
	      case 'fields':
	        return castFields(node, typeObj, options);
	      }
	    }
	  }
	  function typesCast(node, types, options){
	    var i$, len$, type, ref$, valueType, value;
	    for (i$ = 0, len$ = types.length; i$ < len$; ++i$) {
	      type = types[i$];
	      ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value;
	      if (valueType === 'Nothing') {
	        continue;
	      }
	      if (parsedTypeCheck([type], value, {
	        customTypes: options.customTypes
	      })) {
	        return value;
	      }
	    }
	    throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + ".");
	  }
	  cast.exports = function(node, types, options){
	    if (!options.explicit && types.length === 1 && types[0].type === 'String') {
	      return node;
	    }
	    return typesCast(node, types, options);
	  };
	}).call(this);
	return cast.exports;
}

var hasRequiredLib;

function requireLib () {
	if (hasRequiredLib) return lib$2.exports;
	hasRequiredLib = 1;
	// Generated by LiveScript 1.6.0
	(function(){
	  var parseString, cast, parseType, VERSION, parsedTypeParse, parse;
	  parseString = requireParseString();
	  cast = requireCast();
	  parseType = requireLib$1().parseType;
	  VERSION = '0.4.1';
	  parsedTypeParse = function(parsedType, string, options){
	    options == null && (options = {});
	    options.explicit == null && (options.explicit = false);
	    options.customTypes == null && (options.customTypes = {});
	    return cast(parseString(parsedType, string, options), parsedType, options);
	  };
	  parse = function(type, string, options){
	    return parsedTypeParse(parseType(type), string, options);
	  };
	  lib$2.exports = {
	    VERSION: VERSION,
	    parse: parse,
	    parsedTypeParse: parsedTypeParse
	  };
	}).call(this);
	return lib$2.exports;
}

var hasRequiredCjs$2;

function requireCjs$2 () {
	if (hasRequiredCjs$2) return cjs$2;
	hasRequiredCjs$2 = 1;

	var levn = requireLib();

	/**
	 * @fileoverview Config Comment Parser
	 * @author Nicholas C. Zakas
	 */


	//-----------------------------------------------------------------------------
	// Type Definitions
	//-----------------------------------------------------------------------------

	/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */
	/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */
	/** @typedef {import("./types.ts").StringConfig} StringConfig */
	/** @typedef {import("./types.ts").BooleanConfig} BooleanConfig */

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u;
	const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]);

	/**
	 * Determines if the severity in the rule configuration is valid.
	 * @param {RuleConfig} ruleConfig A rule's configuration.
	 */
	function isSeverityValid(ruleConfig) {
		const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
		return validSeverities.has(severity);
	}

	/**
	 * Determines if all severities in the rules configuration are valid.
	 * @param {RulesConfig} rulesConfig The rules configuration to check.
	 * @returns {boolean} `true` if all severities are valid, otherwise `false`.
	 */
	function isEverySeverityValid(rulesConfig) {
		return Object.values(rulesConfig).every(isSeverityValid);
	}

	/**
	 * Represents a directive comment.
	 */
	class DirectiveComment {
		/**
		 * The label of the directive, such as "eslint", "eslint-disable", etc.
		 * @type {string}
		 */
		label = "";

		/**
		 * The value of the directive (the string after the label).
		 * @type {string}
		 */
		value = "";

		/**
		 * The justification of the directive (the string after the --).
		 * @type {string}
		 */
		justification = "";

		/**
		 * Creates a new directive comment.
		 * @param {string} label The label of the directive.
		 * @param {string} value The value of the directive.
		 * @param {string} justification The justification of the directive.
		 */
		constructor(label, value, justification) {
			this.label = label;
			this.value = value;
			this.justification = justification;
		}
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Object to parse ESLint configuration comments.
	 */
	class ConfigCommentParser {
		/**
		 * Parses a list of "name:string_value" or/and "name" options divided by comma or
		 * whitespace. Used for "global" comments.
		 * @param {string} string The string to parse.
		 * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
		 */
		parseStringConfig(string) {
			const items = /** @type {StringConfig} */ ({});

			// Collapse whitespace around `:` and `,` to make parsing easier
			const trimmedString = string
				.trim()
				.replace(/(?<!\s)\s*([:,])\s*/gu, "$1");

			trimmedString.split(/\s|,+/u).forEach(name => {
				if (!name) {
					return;
				}

				// value defaults to null (if not provided), e.g: "foo" => ["foo", null]
				const [key, value = null] = name.split(":");

				items[key] = value;
			});

			return items;
		}

		/**
		 * Parses a JSON-like config.
		 * @param {string} string The string to parse.
		 * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
		 */
		parseJSONLikeConfig(string) {
			// Parses a JSON-like comment by the same way as parsing CLI option.
			try {
				const items =
					/** @type {RulesConfig} */ (levn.parse("Object", string)) || {};

				/*
				 * When the configuration has any invalid severities, it should be completely
				 * ignored. This is because the configuration is not valid and should not be
				 * applied.
				 *
				 * For example, the following configuration is invalid:
				 *
				 *    "no-alert: 2 no-console: 2"
				 *
				 * This results in a configuration of { "no-alert": "2 no-console: 2" }, which is
				 * not valid. In this case, the configuration should be ignored.
				 */
				if (isEverySeverityValid(items)) {
					return {
						ok: true,
						config: items,
					};
				}
			} catch {
				// levn parsing error: ignore to parse the string by a fallback.
			}

			/*
			 * Optionator cannot parse commaless notations.
			 * But we are supporting that. So this is a fallback for that.
			 */
			const normalizedString = string
				.replace(/([-a-zA-Z0-9/]+):/gu, '"$1":')
				.replace(/(\]|[0-9])\s+(?=")/u, "$1,");

			try {
				const items = JSON.parse(`{${normalizedString}}`);

				return {
					ok: true,
					config: items,
				};
			} catch (ex) {
				const errorMessage = ex instanceof Error ? ex.message : String(ex);

				return {
					ok: false,
					error: {
						message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`,
					},
				};
			}
		}

		/**
		 * Parses a config of values separated by comma.
		 * @param {string} string The string to parse.
		 * @returns {BooleanConfig} Result map of values and true values
		 */
		parseListConfig(string) {
			const items = /** @type {BooleanConfig} */ ({});

			string.split(",").forEach(name => {
				const trimmedName = name
					.trim()
					.replace(
						/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,
						"$<ruleId>",
					);

				if (trimmedName) {
					items[trimmedName] = true;
				}
			});

			return items;
		}

		/**
		 * Extract the directive and the justification from a given directive comment and trim them.
		 * @param {string} value The comment text to extract.
		 * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification.
		 */
		#extractDirectiveComment(value) {
			const match = /\s-{2,}\s/u.exec(value);

			if (!match) {
				return { directivePart: value.trim(), justificationPart: "" };
			}

			const directive = value.slice(0, match.index).trim();
			const justification = value.slice(match.index + match[0].length).trim();

			return { directivePart: directive, justificationPart: justification };
		}

		/**
		 * Parses a directive comment into directive text and value.
		 * @param {string} string The string with the directive to be parsed.
		 * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
		 */
		parseDirective(string) {
			const { directivePart, justificationPart } =
				this.#extractDirectiveComment(string);
			const match = directivesPattern.exec(directivePart);

			if (!match) {
				return undefined;
			}

			const directiveText = match[1];
			const directiveValue = directivePart.slice(
				match.index + directiveText.length,
			);

			return new DirectiveComment(
				directiveText,
				directiveValue.trim(),
				justificationPart,
			);
		}
	}

	/**
	 * @fileoverview A collection of helper classes for implementing `SourceCode`.
	 * @author Nicholas C. Zakas
	 */

	/* eslint class-methods-use-this: off -- Required to complete interface. */

	//-----------------------------------------------------------------------------
	// Type Definitions
	//-----------------------------------------------------------------------------

	/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */
	/** @typedef {import("@eslint/core").CallTraversalStep} CallTraversalStep */
	/** @typedef {import("@eslint/core").TextSourceCode} TextSourceCode */
	/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */
	/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */
	/** @typedef {import("@eslint/core").SourceLocationWithOffset} SourceLocationWithOffset */
	/** @typedef {import("@eslint/core").SourceRange} SourceRange */
	/** @typedef {import("@eslint/core").Directive} IDirective */
	/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	/**
	 * Determines if a node has ESTree-style loc information.
	 * @param {object} node The node to check.
	 * @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not.
	 */
	function hasESTreeStyleLoc(node) {
		return "loc" in node;
	}

	/**
	 * Determines if a node has position-style loc information.
	 * @param {object} node The node to check.
	 * @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not.
	 */
	function hasPosStyleLoc(node) {
		return "position" in node;
	}

	/**
	 * Determines if a node has ESTree-style range information.
	 * @param {object} node The node to check.
	 * @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not.
	 */
	function hasESTreeStyleRange(node) {
		return "range" in node;
	}

	/**
	 * Determines if a node has position-style range information.
	 * @param {object} node The node to check.
	 * @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not.
	 */
	function hasPosStyleRange(node) {
		return "position" in node;
	}

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * A class to represent a step in the traversal process where a node is visited.
	 * @implements {VisitTraversalStep}
	 */
	class VisitNodeStep {
		/**
		 * The type of the step.
		 * @type {"visit"}
		 * @readonly
		 */
		type = "visit";

		/**
		 * The kind of the step. Represents the same data as the `type` property
		 * but it's a number for performance.
		 * @type {1}
		 * @readonly
		 */
		kind = 1;

		/**
		 * The target of the step.
		 * @type {object}
		 */
		target;

		/**
		 * The phase of the step.
		 * @type {1|2}
		 */
		phase;

		/**
		 * The arguments of the step.
		 * @type {Array<any>}
		 */
		args;

		/**
		 * Creates a new instance.
		 * @param {Object} options The options for the step.
		 * @param {object} options.target The target of the step.
		 * @param {1|2} options.phase The phase of the step.
		 * @param {Array<any>} options.args The arguments of the step.
		 */
		constructor({ target, phase, args }) {
			this.target = target;
			this.phase = phase;
			this.args = args;
		}
	}

	/**
	 * A class to represent a step in the traversal process where a
	 * method is called.
	 * @implements {CallTraversalStep}
	 */
	class CallMethodStep {
		/**
		 * The type of the step.
		 * @type {"call"}
		 * @readonly
		 */
		type = "call";

		/**
		 * The kind of the step. Represents the same data as the `type` property
		 * but it's a number for performance.
		 * @type {2}
		 * @readonly
		 */
		kind = 2;

		/**
		 * The name of the method to call.
		 * @type {string}
		 */
		target;

		/**
		 * The arguments to pass to the method.
		 * @type {Array<any>}
		 */
		args;

		/**
		 * Creates a new instance.
		 * @param {Object} options The options for the step.
		 * @param {string} options.target The target of the step.
		 * @param {Array<any>} options.args The arguments of the step.
		 */
		constructor({ target, args }) {
			this.target = target;
			this.args = args;
		}
	}

	/**
	 * A class to represent a directive comment.
	 * @implements {IDirective}
	 */
	class Directive {
		/**
		 * The type of directive.
		 * @type {DirectiveType}
		 * @readonly
		 */
		type;

		/**
		 * The node representing the directive.
		 * @type {unknown}
		 * @readonly
		 */
		node;

		/**
		 * Everything after the "eslint-disable" portion of the directive,
		 * but before the "--" that indicates the justification.
		 * @type {string}
		 * @readonly
		 */
		value;

		/**
		 * The justification for the directive.
		 * @type {string}
		 * @readonly
		 */
		justification;

		/**
		 * Creates a new instance.
		 * @param {Object} options The options for the directive.
		 * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
		 * @param {unknown} options.node The node representing the directive.
		 * @param {string} options.value The value of the directive.
		 * @param {string} options.justification The justification for the directive.
		 */
		constructor({ type, node, value, justification }) {
			this.type = type;
			this.node = node;
			this.value = value;
			this.justification = justification;
		}
	}

	/**
	 * Source Code Base Object
	 * @implements {TextSourceCode}
	 */
	class TextSourceCodeBase {
		/**
		 * The lines of text in the source code.
		 * @type {Array<string>}
		 */
		#lines;

		/**
		 * The AST of the source code.
		 * @type {object}
		 */
		ast;

		/**
		 * The text of the source code.
		 * @type {string}
		 */
		text;

		/**
		 * Creates a new instance.
		 * @param {Object} options The options for the instance.
		 * @param {string} options.text The source code text.
		 * @param {object} options.ast The root AST node.
		 * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code.
		 */
		constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
			this.ast = ast;
			this.text = text;
			this.#lines = text.split(lineEndingPattern);
		}

		/**
		 * Returns the loc information for the given node or token.
		 * @param {object} nodeOrToken The node or token to get the loc information for.
		 * @returns {SourceLocation} The loc information for the node or token.
		 */
		getLoc(nodeOrToken) {
			if (hasESTreeStyleLoc(nodeOrToken)) {
				return nodeOrToken.loc;
			}

			if (hasPosStyleLoc(nodeOrToken)) {
				return nodeOrToken.position;
			}

			throw new Error(
				"Custom getLoc() method must be implemented in the subclass.",
			);
		}

		/**
		 * Returns the range information for the given node or token.
		 * @param {object} nodeOrToken The node or token to get the range information for.
		 * @returns {SourceRange} The range information for the node or token.
		 */
		getRange(nodeOrToken) {
			if (hasESTreeStyleRange(nodeOrToken)) {
				return nodeOrToken.range;
			}

			if (hasPosStyleRange(nodeOrToken)) {
				return [
					nodeOrToken.position.start.offset,
					nodeOrToken.position.end.offset,
				];
			}

			throw new Error(
				"Custom getRange() method must be implemented in the subclass.",
			);
		}

		/* eslint-disable no-unused-vars -- Required to complete interface. */
		/**
		 * Returns the parent of the given node.
		 * @param {object} node The node to get the parent of.
		 * @returns {object|undefined} The parent of the node.
		 */
		getParent(node) {
			throw new Error("Not implemented.");
		}
		/* eslint-enable no-unused-vars -- Required to complete interface. */

		/**
		 * Gets all the ancestors of a given node
		 * @param {object} node The node
		 * @returns {Array<object>} All the ancestor nodes in the AST, not including the provided node, starting
		 * from the root node at index 0 and going inwards to the parent node.
		 * @throws {TypeError} When `node` is missing.
		 */
		getAncestors(node) {
			if (!node) {
				throw new TypeError("Missing required argument: node.");
			}

			const ancestorsStartingAtParent = [];

			for (
				let ancestor = this.getParent(node);
				ancestor;
				ancestor = this.getParent(ancestor)
			) {
				ancestorsStartingAtParent.push(ancestor);
			}

			return ancestorsStartingAtParent.reverse();
		}

		/**
		 * Gets the source code for the given node.
		 * @param {object} [node] The AST node to get the text for.
		 * @param {number} [beforeCount] The number of characters before the node to retrieve.
		 * @param {number} [afterCount] The number of characters after the node to retrieve.
		 * @returns {string} The text representing the AST node.
		 * @public
		 */
		getText(node, beforeCount, afterCount) {
			if (node) {
				const range = this.getRange(node);
				return this.text.slice(
					Math.max(range[0] - (beforeCount || 0), 0),
					range[1] + (afterCount || 0),
				);
			}
			return this.text;
		}

		/**
		 * Gets the entire source text split into an array of lines.
		 * @returns {Array<string>} The source text as an array of lines.
		 * @public
		 */
		get lines() {
			return this.#lines;
		}

		/**
		 * Traverse the source code and return the steps that were taken.
		 * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
		 */
		traverse() {
			throw new Error("Not implemented.");
		}
	}

	cjs$2.CallMethodStep = CallMethodStep;
	cjs$2.ConfigCommentParser = ConfigCommentParser;
	cjs$2.Directive = Directive;
	cjs$2.TextSourceCodeBase = TextSourceCodeBase;
	cjs$2.VisitNodeStep = VisitNodeStep;
	return cjs$2;
}

/**
 * @fileoverview Abstraction of JavaScript source code.
 * @author Nicholas C. Zakas
 */

var sourceCode$1;
var hasRequiredSourceCode$1;

function requireSourceCode$1 () {
	if (hasRequiredSourceCode$1) return sourceCode$1;
	hasRequiredSourceCode$1 = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { isCommentToken } = /*@__PURE__*/ requireEslintUtils(),
		TokenStore = requireTokenStore(),
		astUtils = requireAstUtils$1(),
		Traverser = requireTraverser(),
		globals = requireGlobals(),
		{ directivesPattern } = requireDirectives(),
		CodePathAnalyzer = requireCodePathAnalyzer(),
		createEmitter = requireSafeEmitter(),
		{
			ConfigCommentParser,
			VisitNodeStep,
			CallMethodStep,
			Directive,
		} = requireCjs$2(),
		eslintScope = requireEslintScope();

	//------------------------------------------------------------------------------
	// Type Definitions
	//------------------------------------------------------------------------------

	/** @typedef {import("eslint-scope").Variable} Variable */
	/** @typedef {import("eslint-scope").Scope} Scope */
	/** @typedef {import("@eslint/core").SourceCode} ISourceCode */
	/** @typedef {import("@eslint/core").Directive} IDirective */
	/** @typedef {import("@eslint/core").TraversalStep} ITraversalStep */

	//------------------------------------------------------------------------------
	// Private
	//------------------------------------------------------------------------------

	const commentParser = new ConfigCommentParser();

	const CODE_PATH_EVENTS = [
		"onCodePathStart",
		"onCodePathEnd",
		"onCodePathSegmentStart",
		"onCodePathSegmentEnd",
		"onCodePathSegmentLoop",
		"onUnreachableCodePathSegmentStart",
		"onUnreachableCodePathSegmentEnd",
	];

	/**
	 * Validates that the given AST has the required information.
	 * @param {ASTNode} ast The Program node of the AST to check.
	 * @throws {Error} If the AST doesn't contain the correct information.
	 * @returns {void}
	 * @private
	 */
	function validate(ast) {
		if (!ast) {
			throw new TypeError(`Unexpected empty AST. (${ast})`);
		}

		if (!ast.tokens) {
			throw new TypeError("AST is missing the tokens array.");
		}

		if (!ast.comments) {
			throw new TypeError("AST is missing the comments array.");
		}

		if (!ast.loc) {
			throw new TypeError("AST is missing location information.");
		}

		if (!ast.range) {
			throw new TypeError("AST is missing range information");
		}
	}

	/**
	 * Retrieves globals for the given ecmaVersion.
	 * @param {number} ecmaVersion The version to retrieve globals for.
	 * @returns {Object} The globals for the given ecmaVersion.
	 */
	function getGlobalsForEcmaVersion(ecmaVersion) {
		switch (ecmaVersion) {
			case 3:
				return globals.es3;

			case 5:
				return globals.es5;

			default:
				if (ecmaVersion < 2015) {
					return globals[`es${ecmaVersion + 2009}`];
				}

				return globals[`es${ecmaVersion}`];
		}
	}

	/**
	 * Check to see if its a ES6 export declaration.
	 * @param {ASTNode} astNode An AST node.
	 * @returns {boolean} whether the given node represents an export declaration.
	 * @private
	 */
	function looksLikeExport(astNode) {
		return (
			astNode.type === "ExportDefaultDeclaration" ||
			astNode.type === "ExportNamedDeclaration" ||
			astNode.type === "ExportAllDeclaration" ||
			astNode.type === "ExportSpecifier"
		);
	}

	/**
	 * Merges two sorted lists into a larger sorted list in O(n) time.
	 * @param {Token[]} tokens The list of tokens.
	 * @param {Token[]} comments The list of comments.
	 * @returns {Token[]} A sorted list of tokens and comments.
	 * @private
	 */
	function sortedMerge(tokens, comments) {
		const result = [];
		let tokenIndex = 0;
		let commentIndex = 0;

		while (tokenIndex < tokens.length || commentIndex < comments.length) {
			if (
				commentIndex >= comments.length ||
				(tokenIndex < tokens.length &&
					tokens[tokenIndex].range[0] < comments[commentIndex].range[0])
			) {
				result.push(tokens[tokenIndex++]);
			} else {
				result.push(comments[commentIndex++]);
			}
		}

		return result;
	}

	/**
	 * Normalizes a value for a global in a config
	 * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
	 * a global directive comment
	 * @returns {("readable"|"writeable"|"off")} The value normalized as a string
	 * @throws Error if global value is invalid
	 */
	function normalizeConfigGlobal(configuredValue) {
		switch (configuredValue) {
			case "off":
				return "off";

			case true:
			case "true":
			case "writeable":
			case "writable":
				return "writable";

			case null:
			case false:
			case "false":
			case "readable":
			case "readonly":
				return "readonly";

			default:
				throw new Error(
					`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`,
				);
		}
	}

	/**
	 * Determines if two nodes or tokens overlap.
	 * @param {ASTNode|Token} first The first node or token to check.
	 * @param {ASTNode|Token} second The second node or token to check.
	 * @returns {boolean} True if the two nodes or tokens overlap.
	 * @private
	 */
	function nodesOrTokensOverlap(first, second) {
		return (
			(first.range[0] <= second.range[0] &&
				first.range[1] >= second.range[0]) ||
			(second.range[0] <= first.range[0] && second.range[1] >= first.range[0])
		);
	}

	/**
	 * Determines if two nodes or tokens have at least one whitespace character
	 * between them. Order does not matter. Returns false if the given nodes or
	 * tokens overlap.
	 * @param {SourceCode} sourceCode The source code object.
	 * @param {ASTNode|Token} first The first node or token to check between.
	 * @param {ASTNode|Token} second The second node or token to check between.
	 * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility.
	 * @returns {boolean} True if there is a whitespace character between
	 * any of the tokens found between the two given nodes or tokens.
	 * @public
	 */
	function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) {
		if (nodesOrTokensOverlap(first, second)) {
			return false;
		}

		const [startingNodeOrToken, endingNodeOrToken] =
			first.range[1] <= second.range[0] ? [first, second] : [second, first];
		const firstToken =
			sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken;
		const finalToken =
			sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
		let currentToken = firstToken;

		while (currentToken !== finalToken) {
			const nextToken = sourceCode.getTokenAfter(currentToken, {
				includeComments: true,
			});

			if (
				currentToken.range[1] !== nextToken.range[0] ||
				/*
				 * For backward compatibility, check spaces in JSXText.
				 * https://github.com/eslint/eslint/issues/12614
				 */
				(checkInsideOfJSXText &&
					nextToken !== finalToken &&
					nextToken.type === "JSXText" &&
					/\s/u.test(nextToken.value))
			) {
				return true;
			}

			currentToken = nextToken;
		}

		return false;
	}

	//-----------------------------------------------------------------------------
	// Directive Comments
	//-----------------------------------------------------------------------------

	/**
	 * Ensures that variables representing built-in properties of the Global Object,
	 * and any globals declared by special block comments, are present in the global
	 * scope.
	 * @param {Scope} globalScope The global scope.
	 * @param {Object|undefined} configGlobals The globals declared in configuration
	 * @param {Object|undefined} inlineGlobals The globals declared in the source code
	 * @returns {void}
	 */
	function addDeclaredGlobals(
		globalScope,
		configGlobals = {},
		inlineGlobals = {},
	) {
		// Define configured global variables.
		for (const id of new Set([
			...Object.keys(configGlobals),
			...Object.keys(inlineGlobals),
		])) {
			/*
			 * `normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would
			 * typically be caught when validating a config anyway (validity for inline global comments is checked separately).
			 */
			const configValue =
				configGlobals[id] === void 0
					? void 0
					: normalizeConfigGlobal(configGlobals[id]);
			const commentValue = inlineGlobals[id] && inlineGlobals[id].value;
			const value = commentValue || configValue;
			const sourceComments = inlineGlobals[id] && inlineGlobals[id].comments;

			if (value === "off") {
				continue;
			}

			let variable = globalScope.set.get(id);

			if (!variable) {
				variable = new eslintScope.Variable(id, globalScope);

				globalScope.variables.push(variable);
				globalScope.set.set(id, variable);
			}

			variable.eslintImplicitGlobalSetting = configValue;
			variable.eslintExplicitGlobal = sourceComments !== void 0;
			variable.eslintExplicitGlobalComments = sourceComments;
			variable.writeable = value === "writable";
		}

		/*
		 * "through" contains all references which definitions cannot be found.
		 * Since we augment the global scope using configuration, we need to update
		 * references and remove the ones that were added by configuration.
		 */
		globalScope.through = globalScope.through.filter(reference => {
			const name = reference.identifier.name;
			const variable = globalScope.set.get(name);

			if (variable) {
				/*
				 * Links the variable and the reference.
				 * And this reference is removed from `Scope#through`.
				 */
				reference.resolved = variable;
				variable.references.push(reference);

				return false;
			}

			return true;
		});
	}

	/**
	 * Sets the given variable names as exported so they won't be triggered by
	 * the `no-unused-vars` rule.
	 * @param {eslint.Scope} globalScope The global scope to define exports in.
	 * @param {Record<string,string>} variables An object whose keys are the variable
	 *      names to export.
	 * @returns {void}
	 */
	function markExportedVariables(globalScope, variables) {
		Object.keys(variables).forEach(name => {
			const variable = globalScope.set.get(name);

			if (variable) {
				variable.eslintUsed = true;
				variable.eslintExported = true;
			}
		});
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	const caches = Symbol("caches");

	/**
	 * Represents parsed source code.
	 * @implements {ISourceCode}
	 */
	class SourceCode extends TokenStore {
		/**
		 * The cache of steps that were taken while traversing the source code.
		 * @type {Array<ITraversalStep>}
		 */
		#steps;

		/**
		 * Creates a new instance.
		 * @param {string|Object} textOrConfig The source code text or config object.
		 * @param {string} textOrConfig.text The source code text.
		 * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
		 * @param {boolean} textOrConfig.hasBOM Indicates if the text has a Unicode BOM.
		 * @param {Object|null} textOrConfig.parserServices The parser services.
		 * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code.
		 * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST.
		 * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
		 */
		constructor(textOrConfig, astIfNoConfig) {
			let text, hasBOM, ast, parserServices, scopeManager, visitorKeys;

			// Process overloading of arguments
			if (typeof textOrConfig === "string") {
				text = textOrConfig;
				ast = astIfNoConfig;
				hasBOM = false;
			} else if (typeof textOrConfig === "object" && textOrConfig !== null) {
				text = textOrConfig.text;
				ast = textOrConfig.ast;
				hasBOM = textOrConfig.hasBOM;
				parserServices = textOrConfig.parserServices;
				scopeManager = textOrConfig.scopeManager;
				visitorKeys = textOrConfig.visitorKeys;
			}

			validate(ast);
			super(ast.tokens, ast.comments);

			/**
			 * General purpose caching for the class.
			 */
			this[caches] = new Map([
				["scopes", new WeakMap()],
				["vars", new Map()],
				["configNodes", void 0],
			]);

			/**
			 * Indicates if the AST is ESTree compatible.
			 * @type {boolean}
			 */
			this.isESTree = ast.type === "Program";

			/*
			 * Backwards compatibility for BOM handling.
			 *
			 * The `hasBOM` property has been available on the `SourceCode` object
			 * for a long time and is used to indicate if the source contains a BOM.
			 * The linter strips the BOM and just passes the `hasBOM` property to the
			 * `SourceCode` constructor to make it easier for languages to not deal with
			 * the BOM.
			 *
			 * However, the text passed in to the `SourceCode` constructor might still
			 * have a BOM if the constructor is called outside of the linter, so we still
			 * need to check for the BOM in the text.
			 */
			const textHasBOM = text.charCodeAt(0) === 0xfeff;

			/**
			 * The flag to indicate that the source code has Unicode BOM.
			 * @type {boolean}
			 */
			this.hasBOM = textHasBOM || !!hasBOM;

			/**
			 * The original text source code.
			 * BOM was stripped from this text.
			 * @type {string}
			 */
			this.text = textHasBOM ? text.slice(1) : text;

			/**
			 * The parsed AST for the source code.
			 * @type {ASTNode}
			 */
			this.ast = ast;

			/**
			 * The parser services of this source code.
			 * @type {Object}
			 */
			this.parserServices = parserServices || {};

			/**
			 * The scope of this source code.
			 * @type {ScopeManager|null}
			 */
			this.scopeManager = scopeManager || null;

			/**
			 * The visitor keys to traverse AST.
			 * @type {Object}
			 */
			this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS;

			// Check the source text for the presence of a shebang since it is parsed as a standard line comment.
			const shebangMatched = this.text.match(astUtils.shebangPattern);
			const hasShebang =
				shebangMatched &&
				ast.comments.length &&
				ast.comments[0].value === shebangMatched[1];

			if (hasShebang) {
				ast.comments[0].type = "Shebang";
			}

			this.tokensAndComments = sortedMerge(ast.tokens, ast.comments);

			/**
			 * The source code split into lines according to ECMA-262 specification.
			 * This is done to avoid each rule needing to do so separately.
			 * @type {string[]}
			 */
			this.lines = [];
			this.lineStartIndices = [0];

			const lineEndingPattern = astUtils.createGlobalLinebreakMatcher();
			let match;

			/*
			 * Previously, this was implemented using a regex that
			 * matched a sequence of non-linebreak characters followed by a
			 * linebreak, then adding the lengths of the matches. However,
			 * this caused a catastrophic backtracking issue when the end
			 * of a file contained a large number of non-newline characters.
			 * To avoid this, the current implementation just matches newlines
			 * and uses match.index to get the correct line start indices.
			 */
			while ((match = lineEndingPattern.exec(this.text))) {
				this.lines.push(
					this.text.slice(this.lineStartIndices.at(-1), match.index),
				);
				this.lineStartIndices.push(match.index + match[0].length);
			}
			this.lines.push(this.text.slice(this.lineStartIndices.at(-1)));

			// don't allow further modification of this object
			Object.freeze(this);
			Object.freeze(this.lines);
		}

		/**
		 * Split the source code into multiple lines based on the line delimiters.
		 * @param {string} text Source code as a string.
		 * @returns {string[]} Array of source code lines.
		 * @public
		 */
		static splitLines(text) {
			return text.split(astUtils.createGlobalLinebreakMatcher());
		}

		/**
		 * Gets the source code for the given node.
		 * @param {ASTNode} [node] The AST node to get the text for.
		 * @param {int} [beforeCount] The number of characters before the node to retrieve.
		 * @param {int} [afterCount] The number of characters after the node to retrieve.
		 * @returns {string} The text representing the AST node.
		 * @public
		 */
		getText(node, beforeCount, afterCount) {
			if (node) {
				return this.text.slice(
					Math.max(node.range[0] - (beforeCount || 0), 0),
					node.range[1] + (afterCount || 0),
				);
			}
			return this.text;
		}

		/**
		 * Gets the entire source text split into an array of lines.
		 * @returns {Array} The source text as an array of lines.
		 * @public
		 */
		getLines() {
			return this.lines;
		}

		/**
		 * Retrieves an array containing all comments in the source code.
		 * @returns {ASTNode[]} An array of comment nodes.
		 * @public
		 */
		getAllComments() {
			return this.ast.comments;
		}

		/**
		 * Retrieves the JSDoc comment for a given node.
		 * @param {ASTNode} node The AST node to get the comment for.
		 * @returns {Token|null} The Block comment token containing the JSDoc comment
		 *      for the given node or null if not found.
		 * @public
		 * @deprecated
		 */
		getJSDocComment(node) {
			/**
			 * Checks for the presence of a JSDoc comment for the given node and returns it.
			 * @param {ASTNode} astNode The AST node to get the comment for.
			 * @returns {Token|null} The Block comment token containing the JSDoc comment
			 *      for the given node or null if not found.
			 * @private
			 */
			const findJSDocComment = astNode => {
				const tokenBefore = this.getTokenBefore(astNode, {
					includeComments: true,
				});

				if (
					tokenBefore &&
					isCommentToken(tokenBefore) &&
					tokenBefore.type === "Block" &&
					tokenBefore.value.charAt(0) === "*" &&
					astNode.loc.start.line - tokenBefore.loc.end.line <= 1
				) {
					return tokenBefore;
				}

				return null;
			};
			let parent = node.parent;

			switch (node.type) {
				case "ClassDeclaration":
				case "FunctionDeclaration":
					return findJSDocComment(
						looksLikeExport(parent) ? parent : node,
					);

				case "ClassExpression":
					return findJSDocComment(parent.parent);

				case "ArrowFunctionExpression":
				case "FunctionExpression":
					if (
						parent.type !== "CallExpression" &&
						parent.type !== "NewExpression"
					) {
						while (
							!this.getCommentsBefore(parent).length &&
							!/Function/u.test(parent.type) &&
							parent.type !== "MethodDefinition" &&
							parent.type !== "Property"
						) {
							parent = parent.parent;

							if (!parent) {
								break;
							}
						}

						if (
							parent &&
							parent.type !== "FunctionDeclaration" &&
							parent.type !== "Program"
						) {
							return findJSDocComment(parent);
						}
					}

					return findJSDocComment(node);

				// falls through
				default:
					return null;
			}
		}

		/**
		 * Gets the deepest node containing a range index.
		 * @param {int} index Range index of the desired node.
		 * @returns {ASTNode} The node if found or null if not found.
		 * @public
		 */
		getNodeByRangeIndex(index) {
			let result = null;

			Traverser.traverse(this.ast, {
				visitorKeys: this.visitorKeys,
				enter(node) {
					if (node.range[0] <= index && index < node.range[1]) {
						result = node;
					} else {
						this.skip();
					}
				},
				leave(node) {
					if (node === result) {
						this.break();
					}
				},
			});

			return result;
		}

		/**
		 * Determines if two nodes or tokens have at least one whitespace character
		 * between them. Order does not matter. Returns false if the given nodes or
		 * tokens overlap.
		 * @param {ASTNode|Token} first The first node or token to check between.
		 * @param {ASTNode|Token} second The second node or token to check between.
		 * @returns {boolean} True if there is a whitespace character between
		 * any of the tokens found between the two given nodes or tokens.
		 * @public
		 */
		isSpaceBetween(first, second) {
			return isSpaceBetween(this, first, second, false);
		}

		/**
		 * Determines if two nodes or tokens have at least one whitespace character
		 * between them. Order does not matter. Returns false if the given nodes or
		 * tokens overlap.
		 * For backward compatibility, this method returns true if there are
		 * `JSXText` tokens that contain whitespaces between the two.
		 * @param {ASTNode|Token} first The first node or token to check between.
		 * @param {ASTNode|Token} second The second node or token to check between.
		 * @returns {boolean} True if there is a whitespace character between
		 * any of the tokens found between the two given nodes or tokens.
		 * @deprecated in favor of isSpaceBetween().
		 * @public
		 */
		isSpaceBetweenTokens(first, second) {
			return isSpaceBetween(this, first, second, true);
		}

		/**
		 * Converts a source text index into a (line, column) pair.
		 * @param {number} index The index of a character in a file
		 * @throws {TypeError} If non-numeric index or index out of range.
		 * @returns {Object} A {line, column} location object with a 0-indexed column
		 * @public
		 */
		getLocFromIndex(index) {
			if (typeof index !== "number") {
				throw new TypeError("Expected `index` to be a number.");
			}

			if (index < 0 || index > this.text.length) {
				throw new RangeError(
					`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
				);
			}

			/*
			 * For an argument of this.text.length, return the location one "spot" past the last character
			 * of the file. If the last character is a linebreak, the location will be column 0 of the next
			 * line; otherwise, the location will be in the next column on the same line.
			 *
			 * See getIndexFromLoc for the motivation for this special case.
			 */
			if (index === this.text.length) {
				return {
					line: this.lines.length,
					column: this.lines.at(-1).length,
				};
			}

			/*
			 * To figure out which line index is on, determine the last place at which index could
			 * be inserted into lineStartIndices to keep the list sorted.
			 */
			const lineNumber =
				index >= this.lineStartIndices.at(-1)
					? this.lineStartIndices.length
					: this.lineStartIndices.findIndex(el => index < el);

			return {
				line: lineNumber,
				column: index - this.lineStartIndices[lineNumber - 1],
			};
		}

		/**
		 * Converts a (line, column) pair into a range index.
		 * @param {Object} loc A line/column location
		 * @param {number} loc.line The line number of the location (1-indexed)
		 * @param {number} loc.column The column number of the location (0-indexed)
		 * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
		 *   `line` and `column`, if the `line` is less than or equal to zero or
		 *   the line or column is out of the expected range.
		 * @returns {number} The range index of the location in the file.
		 * @public
		 */
		getIndexFromLoc(loc) {
			if (
				typeof loc !== "object" ||
				typeof loc.line !== "number" ||
				typeof loc.column !== "number"
			) {
				throw new TypeError(
					"Expected `loc` to be an object with numeric `line` and `column` properties.",
				);
			}

			if (loc.line <= 0) {
				throw new RangeError(
					`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`,
				);
			}

			if (loc.line > this.lineStartIndices.length) {
				throw new RangeError(
					`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`,
				);
			}

			const lineStartIndex = this.lineStartIndices[loc.line - 1];
			const lineEndIndex =
				loc.line === this.lineStartIndices.length
					? this.text.length
					: this.lineStartIndices[loc.line];
			const positionIndex = lineStartIndex + loc.column;

			/*
			 * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of
			 * the given line, provided that the line number is valid element of this.lines. Since the
			 * last element of this.lines is an empty string for files with trailing newlines, add a
			 * special case where getting the index for the first location after the end of the file
			 * will return the length of the file, rather than throwing an error. This allows rules to
			 * use getIndexFromLoc consistently without worrying about edge cases at the end of a file.
			 */
			if (
				(loc.line === this.lineStartIndices.length &&
					positionIndex > lineEndIndex) ||
				(loc.line < this.lineStartIndices.length &&
					positionIndex >= lineEndIndex)
			) {
				throw new RangeError(
					`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`,
				);
			}

			return positionIndex;
		}

		/**
		 * Gets the scope for the given node
		 * @param {ASTNode} currentNode The node to get the scope of
		 * @returns {Scope} The scope information for this node
		 * @throws {TypeError} If the `currentNode` argument is missing.
		 */
		getScope(currentNode) {
			if (!currentNode) {
				throw new TypeError("Missing required argument: node.");
			}

			// check cache first
			const cache = this[caches].get("scopes");
			const cachedScope = cache.get(currentNode);

			if (cachedScope) {
				return cachedScope;
			}

			// On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.
			const inner = currentNode.type !== "Program";

			for (let node = currentNode; node; node = node.parent) {
				const scope = this.scopeManager.acquire(node, inner);

				if (scope) {
					if (scope.type === "function-expression-name") {
						cache.set(currentNode, scope.childScopes[0]);
						return scope.childScopes[0];
					}

					cache.set(currentNode, scope);
					return scope;
				}
			}

			cache.set(currentNode, this.scopeManager.scopes[0]);
			return this.scopeManager.scopes[0];
		}

		/**
		 * Get the variables that `node` defines.
		 * This is a convenience method that passes through
		 * to the same method on the `scopeManager`.
		 * @param {ASTNode} node The node for which the variables are obtained.
		 * @returns {Array<Variable>} An array of variable nodes representing
		 *      the variables that `node` defines.
		 */
		getDeclaredVariables(node) {
			return this.scopeManager.getDeclaredVariables(node);
		}

		/* eslint-disable class-methods-use-this -- node is owned by SourceCode */
		/**
		 * Gets all the ancestors of a given node
		 * @param {ASTNode} node The node
		 * @returns {Array<ASTNode>} All the ancestor nodes in the AST, not including the provided node, starting
		 * from the root node at index 0 and going inwards to the parent node.
		 * @throws {TypeError} When `node` is missing.
		 */
		getAncestors(node) {
			if (!node) {
				throw new TypeError("Missing required argument: node.");
			}

			const ancestorsStartingAtParent = [];

			for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
				ancestorsStartingAtParent.push(ancestor);
			}

			return ancestorsStartingAtParent.reverse();
		}

		/**
		 * Returns the location of the given node or token.
		 * @param {ASTNode|Token} nodeOrToken The node or token to get the location of.
		 * @returns {SourceLocation} The location of the node or token.
		 */
		getLoc(nodeOrToken) {
			return nodeOrToken.loc;
		}

		/**
		 * Returns the range of the given node or token.
		 * @param {ASTNode|Token} nodeOrToken The node or token to get the range of.
		 * @returns {[number, number]} The range of the node or token.
		 */
		getRange(nodeOrToken) {
			return nodeOrToken.range;
		}

		/* eslint-enable class-methods-use-this -- node is owned by SourceCode */

		/**
		 * Marks a variable as used in the current scope
		 * @param {string} name The name of the variable to mark as used.
		 * @param {ASTNode} [refNode] The closest node to the variable reference.
		 * @returns {boolean} True if the variable was found and marked as used, false if not.
		 */
		markVariableAsUsed(name, refNode = this.ast) {
			const currentScope = this.getScope(refNode);
			let initialScope = currentScope;

			/*
			 * When we are in an ESM or CommonJS module, we need to start searching
			 * from the top-level scope, not the global scope. For ESM the top-level
			 * scope is the module scope; for CommonJS the top-level scope is the
			 * outer function scope.
			 *
			 * Without this check, we might miss a variable declared with `var` at
			 * the top-level because it won't exist in the global scope.
			 */
			if (
				currentScope.type === "global" &&
				currentScope.childScopes.length > 0 &&
				// top-level scopes refer to a `Program` node
				currentScope.childScopes[0].block === this.ast
			) {
				initialScope = currentScope.childScopes[0];
			}

			for (let scope = initialScope; scope; scope = scope.upper) {
				const variable = scope.variables.find(
					scopeVar => scopeVar.name === name,
				);

				if (variable) {
					variable.eslintUsed = true;
					return true;
				}
			}

			return false;
		}

		/**
		 * Returns an array of all inline configuration nodes found in the
		 * source code.
		 * @returns {Array<Token>} An array of all inline configuration nodes.
		 */
		getInlineConfigNodes() {
			// check the cache first
			let configNodes = this[caches].get("configNodes");

			if (configNodes) {
				return configNodes;
			}

			// calculate fresh config nodes
			configNodes = this.ast.comments.filter(comment => {
				// shebang comments are never directives
				if (comment.type === "Shebang") {
					return false;
				}

				const directive = commentParser.parseDirective(comment.value);

				if (!directive) {
					return false;
				}

				if (!directivesPattern.test(directive.label)) {
					return false;
				}

				// only certain comment types are supported as line comments
				return (
					comment.type !== "Line" ||
					!!/^eslint-disable-(next-)?line$/u.test(directive.label)
				);
			});

			this[caches].set("configNodes", configNodes);

			return configNodes;
		}

		/**
		 * Returns an all directive nodes that enable or disable rules along with any problems
		 * encountered while parsing the directives.
		 * @returns {{problems:Array<Problem>,directives:Array<Directive>}} Information
		 *      that ESLint needs to further process the directives.
		 */
		getDisableDirectives() {
			// check the cache first
			const cachedDirectives = this[caches].get("disableDirectives");

			if (cachedDirectives) {
				return cachedDirectives;
			}

			const problems = [];
			const directives = [];

			this.getInlineConfigNodes().forEach(comment => {
				// Step 1: Parse the directive
				const {
					label,
					value,
					justification: justificationPart,
				} = commentParser.parseDirective(comment.value);

				// Step 2: Extract the directive value
				const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(
					label,
				);

				if (comment.type === "Line" && !lineCommentSupported) {
					return;
				}

				// Step 3: Validate the directive does not span multiple lines
				if (
					label === "eslint-disable-line" &&
					comment.loc.start.line !== comment.loc.end.line
				) {
					const message = `${label} comment should not span multiple lines.`;

					problems.push({
						ruleId: null,
						message,
						loc: comment.loc,
					});
					return;
				}

				// Step 4: Extract the directive value and create the Directive object
				switch (label) {
					case "eslint-disable":
					case "eslint-enable":
					case "eslint-disable-next-line":
					case "eslint-disable-line": {
						const directiveType = label.slice("eslint-".length);

						directives.push(
							new Directive({
								type: directiveType,
								node: comment,
								value,
								justification: justificationPart,
							}),
						);
					}

					// no default
				}
			});

			const result = { problems, directives };

			this[caches].set("disableDirectives", result);

			return result;
		}

		/**
		 * Applies language options sent in from the core.
		 * @param {Object} languageOptions The language options for this run.
		 * @returns {void}
		 */
		applyLanguageOptions(languageOptions) {
			/*
			 * Add configured globals and language globals
			 *
			 * Using Object.assign instead of object spread for performance reasons
			 * https://github.com/eslint/eslint/issues/16302
			 */
			const configGlobals = Object.assign(
				Object.create(null), // https://github.com/eslint/eslint/issues/18363
				getGlobalsForEcmaVersion(languageOptions.ecmaVersion),
				languageOptions.sourceType === "commonjs"
					? globals.commonjs
					: void 0,
				languageOptions.globals,
			);
			const varsCache = this[caches].get("vars");

			varsCache.set("configGlobals", configGlobals);
		}

		/**
		 * Applies configuration found inside of the source code. This method is only
		 * called when ESLint is running with inline configuration allowed.
		 * @returns {{problems:Array<Problem>,configs:{config:FlatConfigArray,loc:Location}}} Information
		 *      that ESLint needs to further process the inline configuration.
		 */
		applyInlineConfig() {
			const problems = [];
			const configs = [];
			const exportedVariables = {};
			const inlineGlobals = Object.create(null);

			this.getInlineConfigNodes().forEach(comment => {
				const { label, value } = commentParser.parseDirective(
					comment.value,
				);

				switch (label) {
					case "exported":
						Object.assign(
							exportedVariables,
							commentParser.parseListConfig(value),
						);
						break;

					case "globals":
					case "global":
						for (const [id, idSetting] of Object.entries(
							commentParser.parseStringConfig(value),
						)) {
							let normalizedValue;

							try {
								normalizedValue = normalizeConfigGlobal(idSetting);
							} catch (err) {
								problems.push({
									ruleId: null,
									loc: comment.loc,
									message: err.message,
								});
								continue;
							}

							if (inlineGlobals[id]) {
								inlineGlobals[id].comments.push(comment);
								inlineGlobals[id].value = normalizedValue;
							} else {
								inlineGlobals[id] = {
									comments: [comment],
									value: normalizedValue,
								};
							}
						}
						break;

					case "eslint": {
						const parseResult =
							commentParser.parseJSONLikeConfig(value);

						if (parseResult.ok) {
							configs.push({
								config: {
									rules: parseResult.config,
								},
								loc: comment.loc,
							});
						} else {
							problems.push({
								ruleId: null,
								loc: comment.loc,
								message: parseResult.error.message,
							});
						}

						break;
					}

					// no default
				}
			});

			// save all the new variables for later
			const varsCache = this[caches].get("vars");

			varsCache.set("inlineGlobals", inlineGlobals);
			varsCache.set("exportedVariables", exportedVariables);

			return {
				configs,
				problems,
			};
		}

		/**
		 * Called by ESLint core to indicate that it has finished providing
		 * information. We now add in all the missing variables and ensure that
		 * state-changing methods cannot be called by rules.
		 * @returns {void}
		 */
		finalize() {
			const varsCache = this[caches].get("vars");
			const configGlobals = varsCache.get("configGlobals");
			const inlineGlobals = varsCache.get("inlineGlobals");
			const exportedVariables = varsCache.get("exportedVariables");
			const globalScope = this.scopeManager.scopes[0];

			addDeclaredGlobals(globalScope, configGlobals, inlineGlobals);

			if (exportedVariables) {
				markExportedVariables(globalScope, exportedVariables);
			}
		}

		/**
		 * Traverse the source code and return the steps that were taken.
		 * @returns {Array<TraversalStep>} The steps that were taken while traversing the source code.
		 */
		traverse() {
			// Because the AST doesn't mutate, we can cache the steps
			if (this.#steps) {
				return this.#steps;
			}

			const steps = (this.#steps = []);

			/*
			 * This logic works for any AST, not just ESTree. Because ESLint has allowed
			 * custom parsers to return any AST, we need to ensure that the traversal
			 * logic works for any AST.
			 */
			const emitter = createEmitter();
			let analyzer = {
				enterNode(node) {
					steps.push(
						new VisitNodeStep({
							target: node,
							phase: 1,
							args: [node, node.parent],
						}),
					);
				},
				leaveNode(node) {
					steps.push(
						new VisitNodeStep({
							target: node,
							phase: 2,
							args: [node, node.parent],
						}),
					);
				},
				emitter,
			};

			/*
			 * We do code path analysis for ESTree only. Code path analysis is not
			 * necessary for other ASTs, and it's also not possible to do for other
			 * ASTs because the necessary information is not available.
			 *
			 * Generally speaking, we can tell that the AST is an ESTree if it has a
			 * Program node at the top level. This is not a perfect heuristic, but it
			 * is good enough for now.
			 */
			if (this.isESTree) {
				analyzer = new CodePathAnalyzer(analyzer);

				CODE_PATH_EVENTS.forEach(eventName => {
					emitter.on(eventName, (...args) => {
						steps.push(
							new CallMethodStep({
								target: eventName,
								args,
							}),
						);
					});
				});
			}

			/*
			 * The actual AST traversal is done by the `Traverser` class. This class
			 * is responsible for walking the AST and calling the appropriate methods
			 * on the `analyzer` object, which is appropriate for the given AST.
			 */
			Traverser.traverse(this.ast, {
				enter(node, parent) {
					// save the parent node on a property for backwards compatibility
					node.parent = parent;

					analyzer.enterNode(node);
				},
				leave(node) {
					analyzer.leaveNode(node);
				},
				visitorKeys: this.visitorKeys,
			});

			return steps;
		}
	}

	sourceCode$1 = SourceCode;
	return sourceCode$1;
}

var sourceCode;
var hasRequiredSourceCode;

function requireSourceCode () {
	if (hasRequiredSourceCode) return sourceCode;
	hasRequiredSourceCode = 1;

	const SourceCode = requireSourceCode$1();

	sourceCode = {
		SourceCode,
	};
	return sourceCode;
}

var escapeStringRegexp;
var hasRequiredEscapeStringRegexp;

function requireEscapeStringRegexp () {
	if (hasRequiredEscapeStringRegexp) return escapeStringRegexp;
	hasRequiredEscapeStringRegexp = 1;

	escapeStringRegexp = string => {
		if (typeof string !== 'string') {
			throw new TypeError('Expected a string');
		}

		// Escape characters with special meaning either inside or outside character sets.
		// Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
		return string
			.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
			.replace(/-/g, '\\x2d');
	};
	return escapeStringRegexp;
}

/**
 * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments
 * @author Teddy Katz
 */

var applyDisableDirectives;
var hasRequiredApplyDisableDirectives;

function requireApplyDisableDirectives () {
	if (hasRequiredApplyDisableDirectives) return applyDisableDirectives;
	hasRequiredApplyDisableDirectives = 1;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/** @typedef {import("../shared/types").LintMessage} LintMessage */
	/** @typedef {import("@eslint/core").Language} Language */
	/** @typedef {import("@eslint/core").Position} Position */
	/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */

	//------------------------------------------------------------------------------
	// Module Definition
	//------------------------------------------------------------------------------

	const escapeRegExp = requireEscapeStringRegexp();
	const {
		Legacy: { ConfigOps },
	} = requireEslintrcUniversal();

	/**
	 * Compares the locations of two objects in a source file
	 * @param {Position} itemA The first object
	 * @param {Position} itemB The second object
	 * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
	 * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
	 */
	function compareLocations(itemA, itemB) {
		return itemA.line - itemB.line || itemA.column - itemB.column;
	}

	/**
	 * Groups a set of directives into sub-arrays by their parent comment.
	 * @param {Iterable<Directive>} directives Unused directives to be removed.
	 * @returns {Directive[][]} Directives grouped by their parent comment.
	 */
	function groupByParentDirective(directives) {
		const groups = new Map();

		for (const directive of directives) {
			const {
				unprocessedDirective: { parentDirective },
			} = directive;

			if (groups.has(parentDirective)) {
				groups.get(parentDirective).push(directive);
			} else {
				groups.set(parentDirective, [directive]);
			}
		}

		return [...groups.values()];
	}

	/**
	 * Creates removal details for a set of directives within the same comment.
	 * @param {Directive[]} directives Unused directives to be removed.
	 * @param {{node: Token, value: string}} parentDirective Data about the backing directive.
	 * @param {SourceCode} sourceCode The source code object for the file being linted.
	 * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
	 */
	function createIndividualDirectivesRemoval(
		directives,
		parentDirective,
		sourceCode,
	) {
		/*
		 * Get the list of the rules text without any surrounding whitespace. In order to preserve the original
		 * formatting, we don't want to change that whitespace.
		 *
		 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
		 *                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		 */
		const listText = parentDirective.value.trim();

		// Calculate where it starts in the source code text
		const listStart = sourceCode.text.indexOf(
			listText,
			sourceCode.getRange(parentDirective.node)[0],
		);

		/*
		 * We can assume that `listText` contains multiple elements.
		 * Otherwise, this function wouldn't be called - if there is
		 * only one rule in the list, then the whole comment must be removed.
		 */

		return directives.map(directive => {
			const { ruleId } = directive;

			const regex = new RegExp(
				String.raw`(?:^|\s*,\s*)(?<quote>['"]?)${escapeRegExp(ruleId)}\k<quote>(?:\s*,\s*|$)`,
				"u",
			);
			const match = regex.exec(listText);
			const matchedText = match[0];
			const matchStart = listStart + match.index;
			const matchEnd = matchStart + matchedText.length;

			const firstIndexOfComma = matchedText.indexOf(",");
			const lastIndexOfComma = matchedText.lastIndexOf(",");

			let removalStart, removalEnd;

			if (firstIndexOfComma !== lastIndexOfComma) {
				/*
				 * Since there are two commas, this must one of the elements in the middle of the list.
				 * Matched range starts where the previous rule name ends, and ends where the next rule name starts.
				 *
				 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
				 *                                    ^^^^^^^^^^^^^^
				 *
				 * We want to remove only the content between the two commas, and also one of the commas.
				 *
				 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
				 *                                     ^^^^^^^^^^^
				 */
				removalStart = matchStart + firstIndexOfComma;
				removalEnd = matchStart + lastIndexOfComma;
			} else {
				/*
				 * This is either the first element or the last element.
				 *
				 * If this is the first element, matched range starts where the first rule name starts
				 * and ends where the second rule name starts. This is exactly the range we want
				 * to remove so that the second rule name will start where the first one was starting
				 * and thus preserve the original formatting.
				 *
				 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
				 *                            ^^^^^^^^^^^
				 *
				 * Similarly, if this is the last element, we've already matched the range we want to
				 * remove. The previous rule name will end where the last one was ending, relative
				 * to the content on the right side.
				 *
				 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
				 *                                               ^^^^^^^^^^^^^
				 */
				removalStart = matchStart;
				removalEnd = matchEnd;
			}

			return {
				description: `'${ruleId}'`,
				fix: {
					range: [removalStart, removalEnd],
					text: "",
				},
				unprocessedDirective: directive.unprocessedDirective,
			};
		});
	}

	/**
	 * Creates a description of deleting an entire unused disable directive.
	 * @param {Directive[]} directives Unused directives to be removed.
	 * @param {Token} node The backing Comment token.
	 * @param {SourceCode} sourceCode The source code object for the file being linted.
	 * @returns {{ description, fix, unprocessedDirective }} Details for later creation of an output problem.
	 */
	function createDirectiveRemoval(directives, node, sourceCode) {
		const range = sourceCode.getRange(node);
		const ruleIds = directives
			.filter(directive => directive.ruleId)
			.map(directive => `'${directive.ruleId}'`);

		return {
			description:
				ruleIds.length <= 2
					? ruleIds.join(" or ")
					: `${ruleIds.slice(0, ruleIds.length - 1).join(", ")}, or ${ruleIds.at(-1)}`,
			fix: {
				range,
				text: " ",
			},
			unprocessedDirective: directives[0].unprocessedDirective,
		};
	}

	/**
	 * Parses details from directives to create output Problems.
	 * @param {Iterable<Directive>} allDirectives Unused directives to be removed.
	 * @param {SourceCode} sourceCode The source code object for the file being linted.
	 * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
	 */
	function processUnusedDirectives(allDirectives, sourceCode) {
		const directiveGroups = groupByParentDirective(allDirectives);

		return directiveGroups.flatMap(directives => {
			const { parentDirective } = directives[0].unprocessedDirective;
			const remainingRuleIds = new Set(parentDirective.ruleIds);

			for (const directive of directives) {
				remainingRuleIds.delete(directive.ruleId);
			}

			return remainingRuleIds.size
				? createIndividualDirectivesRemoval(
						directives,
						parentDirective,
						sourceCode,
					)
				: [
						createDirectiveRemoval(
							directives,
							parentDirective.node,
							sourceCode,
						),
					];
		});
	}

	/**
	 * Collect eslint-enable comments that are removing suppressions by eslint-disable comments.
	 * @param {Directive[]} directives The directives to check.
	 * @returns {Set<Directive>} The used eslint-enable comments
	 */
	function collectUsedEnableDirectives(directives) {
		/**
		 * A Map of `eslint-enable` keyed by ruleIds that may be marked as used.
		 * If `eslint-enable` does not have a ruleId, the key will be `null`.
		 * @type {Map<string|null, Directive>}
		 */
		const enabledRules = new Map();

		/**
		 * A Set of `eslint-enable` marked as used.
		 * It is also the return value of `collectUsedEnableDirectives` function.
		 * @type {Set<Directive>}
		 */
		const usedEnableDirectives = new Set();

		/*
		 * Checks the directives backwards to see if the encountered `eslint-enable` is used by the previous `eslint-disable`,
		 * and if so, stores the `eslint-enable` in `usedEnableDirectives`.
		 */
		for (let index = directives.length - 1; index >= 0; index--) {
			const directive = directives[index];

			if (directive.type === "disable") {
				if (enabledRules.size === 0) {
					continue;
				}
				if (directive.ruleId === null) {
					// If encounter `eslint-disable` without ruleId,
					// mark all `eslint-enable` currently held in enabledRules as used.
					// e.g.
					//    /* eslint-disable */ <- current directive
					//    /* eslint-enable rule-id1 */ <- used
					//    /* eslint-enable rule-id2 */ <- used
					//    /* eslint-enable */ <- used
					for (const enableDirective of enabledRules.values()) {
						usedEnableDirectives.add(enableDirective);
					}
					enabledRules.clear();
				} else {
					const enableDirective = enabledRules.get(directive.ruleId);

					if (enableDirective) {
						// If encounter `eslint-disable` with ruleId, and there is an `eslint-enable` with the same ruleId in enabledRules,
						// mark `eslint-enable` with ruleId as used.
						// e.g.
						//    /* eslint-disable rule-id */ <- current directive
						//    /* eslint-enable rule-id */ <- used
						usedEnableDirectives.add(enableDirective);
					} else {
						const enabledDirectiveWithoutRuleId =
							enabledRules.get(null);

						if (enabledDirectiveWithoutRuleId) {
							// If encounter `eslint-disable` with ruleId, and there is no `eslint-enable` with the same ruleId in enabledRules,
							// mark `eslint-enable` without ruleId as used.
							// e.g.
							//    /* eslint-disable rule-id */ <- current directive
							//    /* eslint-enable */ <- used
							usedEnableDirectives.add(enabledDirectiveWithoutRuleId);
						}
					}
				}
			} else if (directive.type === "enable") {
				if (directive.ruleId === null) {
					// If encounter `eslint-enable` without ruleId, the `eslint-enable` that follows it are unused.
					// So clear enabledRules.
					// e.g.
					//    /* eslint-enable */ <- current directive
					//    /* eslint-enable rule-id *// <- unused
					//    /* eslint-enable */ <- unused
					enabledRules.clear();
					enabledRules.set(null, directive);
				} else {
					enabledRules.set(directive.ruleId, directive);
				}
			}
		}
		return usedEnableDirectives;
	}

	/**
	 * This is the same as the exported function, except that it
	 * doesn't handle disable-line and disable-next-line directives, and it always reports unused
	 * disable directives.
	 * @param {Object} options options for applying directives. This is the same as the options
	 * for the exported function, except that `reportUnusedDisableDirectives` is not supported
	 * (this function always reports unused disable directives).
	 * @returns {{problems: LintMessage[], unusedDirectives: LintMessage[]}} An object with a list
	 * of problems (including suppressed ones) and unused eslint-disable directives
	 */
	function applyDirectives(options) {
		const problems = [];
		const usedDisableDirectives = new Set();
		const { sourceCode } = options;

		for (const problem of options.problems) {
			let disableDirectivesForProblem = [];
			let nextDirectiveIndex = 0;

			while (
				nextDirectiveIndex < options.directives.length &&
				compareLocations(options.directives[nextDirectiveIndex], problem) <=
					0
			) {
				const directive = options.directives[nextDirectiveIndex++];

				if (
					directive.ruleId === null ||
					directive.ruleId === problem.ruleId
				) {
					switch (directive.type) {
						case "disable":
							disableDirectivesForProblem.push(directive);
							break;

						case "enable":
							disableDirectivesForProblem = [];
							break;

						// no default
					}
				}
			}

			if (disableDirectivesForProblem.length > 0) {
				const suppressions = disableDirectivesForProblem.map(directive => ({
					kind: "directive",
					justification: directive.unprocessedDirective.justification,
				}));

				if (problem.suppressions) {
					problem.suppressions =
						problem.suppressions.concat(suppressions);
				} else {
					problem.suppressions = suppressions;
					usedDisableDirectives.add(disableDirectivesForProblem.at(-1));
				}
			}

			problems.push(problem);
		}

		const unusedDisableDirectivesToReport = options.directives.filter(
			directive =>
				directive.type === "disable" &&
				!usedDisableDirectives.has(directive) &&
				!options.rulesToIgnore.has(directive.ruleId),
		);

		const unusedEnableDirectivesToReport = new Set(
			options.directives.filter(
				directive =>
					directive.unprocessedDirective.type === "enable" &&
					!options.rulesToIgnore.has(directive.ruleId),
			),
		);

		/*
		 * If directives has the eslint-enable directive,
		 * check whether the eslint-enable comment is used.
		 */
		if (unusedEnableDirectivesToReport.size > 0) {
			for (const directive of collectUsedEnableDirectives(
				options.directives,
			)) {
				unusedEnableDirectivesToReport.delete(directive);
			}
		}

		const processed = processUnusedDirectives(
			unusedDisableDirectivesToReport,
			sourceCode,
		).concat(
			processUnusedDirectives(unusedEnableDirectivesToReport, sourceCode),
		);
		const columnOffset = options.language.columnStart === 1 ? 0 : 1;
		const lineOffset = options.language.lineStart === 1 ? 0 : 1;

		const unusedDirectives = processed.map(
			({ description, fix, unprocessedDirective }) => {
				const { parentDirective, type, line, column } =
					unprocessedDirective;

				let message;

				if (type === "enable") {
					message = description
						? `Unused eslint-enable directive (no matching eslint-disable directives were found for ${description}).`
						: "Unused eslint-enable directive (no matching eslint-disable directives were found).";
				} else {
					message = description
						? `Unused eslint-disable directive (no problems were reported from ${description}).`
						: "Unused eslint-disable directive (no problems were reported).";
				}

				const loc = sourceCode.getLoc(parentDirective.node);

				return {
					ruleId: null,
					message,
					line:
						type === "disable-next-line"
							? loc.start.line + lineOffset
							: line,
					column:
						type === "disable-next-line"
							? loc.start.column + columnOffset
							: column,
					severity:
						options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
					nodeType: null,
					...(options.disableFixes ? {} : { fix }),
				};
			},
		);

		return { problems, unusedDirectives };
	}

	/**
	 * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list
	 * of reported problems, adds the suppression information to the problems.
	 * @param {Object} options Information about directives and problems
	 * @param {Language} options.language The language being linted.
	 * @param {SourceCode} options.sourceCode The source code object for the file being linted.
	 * @param {{
	 *      type: ("disable"|"enable"|"disable-line"|"disable-next-line"),
	 *      ruleId: (string|null),
	 *      line: number,
	 *      column: number,
	 *      justification: string
	 * }} options.directives Directive comments found in the file, with one-based columns.
	 * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable
	 * comment for two different rules is represented as two directives).
	 * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems
	 * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns.
	 * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives
	 * @param {RulesConfig} options.configuredRules The rules configuration.
	 * @param {Function} options.ruleFilter A predicate function to filter which rules should be executed.
	 * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties.
	 * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]}
	 * An object with a list of reported problems, the suppressed of which contain the suppression information.
	 */
	applyDisableDirectives = ({
		language,
		sourceCode,
		directives,
		disableFixes,
		problems,
		configuredRules,
		ruleFilter,
		reportUnusedDisableDirectives = "off",
	}) => {
		const blockDirectives = directives
			.filter(
				directive =>
					directive.type === "disable" || directive.type === "enable",
			)
			.map(directive =>
				Object.assign({}, directive, { unprocessedDirective: directive }),
			)
			.sort(compareLocations);

		const lineDirectives = directives
			.flatMap(directive => {
				switch (directive.type) {
					case "disable":
					case "enable":
						return [];

					case "disable-line":
						return [
							{
								type: "disable",
								line: directive.line,
								column: 1,
								ruleId: directive.ruleId,
								unprocessedDirective: directive,
							},
							{
								type: "enable",
								line: directive.line + 1,
								column: 0,
								ruleId: directive.ruleId,
								unprocessedDirective: directive,
							},
						];

					case "disable-next-line":
						return [
							{
								type: "disable",
								line: directive.line + 1,
								column: 1,
								ruleId: directive.ruleId,
								unprocessedDirective: directive,
							},
							{
								type: "enable",
								line: directive.line + 2,
								column: 0,
								ruleId: directive.ruleId,
								unprocessedDirective: directive,
							},
						];

					default:
						throw new TypeError(
							`Unrecognized directive type '${directive.type}'`,
						);
				}
			})
			.sort(compareLocations);

		// This determines a list of rules that are not being run by the given ruleFilter, if present.
		const rulesToIgnore =
			configuredRules && ruleFilter
				? new Set(
						Object.keys(configuredRules).filter(ruleId => {
							const severity = ConfigOps.getRuleSeverity(
								configuredRules[ruleId],
							);

							// Ignore for disabled rules.
							if (severity === 0) {
								return false;
							}

							return !ruleFilter({ severity, ruleId });
						}),
					)
				: new Set();

		// If no ruleId is supplied that means this directive is applied to all rules, so we can't determine if it's unused if any rules are filtered out.
		if (rulesToIgnore.size > 0) {
			rulesToIgnore.add(null);
		}

		const blockDirectivesResult = applyDirectives({
			language,
			sourceCode,
			problems,
			directives: blockDirectives,
			disableFixes,
			reportUnusedDisableDirectives,
			rulesToIgnore,
		});
		const lineDirectivesResult = applyDirectives({
			language,
			sourceCode,
			problems: blockDirectivesResult.problems,
			directives: lineDirectives,
			disableFixes,
			reportUnusedDisableDirectives,
			rulesToIgnore,
		});

		return reportUnusedDisableDirectives !== "off"
			? lineDirectivesResult.problems
					.concat(blockDirectivesResult.unusedDirectives)
					.concat(lineDirectivesResult.unusedDirectives)
					.sort(compareLocations)
			: lineDirectivesResult.problems;
	};
	return applyDisableDirectives;
}

function e(t){return (e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],u=true,l=false;try{if(o=(r=r.call(e)).next,0===t);else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=true,a=e;}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return s}}(e,t)||n(e,t)||function(){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 r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){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 n(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return "Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i=o((function(e,t){!function e(t){var r,n,a,o,i,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t;}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n;}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return (e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return  true;return  false}function d(e,t){return (new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,a,o;for(n=e.length,a=0;n;)t(e[o=a+(r=n>>>1)])?n=r:(a=o+1,n-=r+1);return a}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},a={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:o={},Skip:i={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e;},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),true):(this.replace(null),false)},f.prototype.path=function(){var e,t,r,n,a;function o(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t);}if(!this.__current.path)return null;for(a=[],e=2,t=this.__leavelist.length;e<t;++e)o(a,this.__leavelist[e].path);return o(a,this.__current.path),a},f.prototype.type=function(){return this.current().type||this.__current.wrap},f.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},f.prototype.current=function(){return this.__current.node},f.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},f.prototype.notify=function(e){this.__state=e;},f.prototype.skip=function(){this.notify(i);},f.prototype.break=function(){this.notify(o);},f.prototype.remove=function(){this.notify(s);},f.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=a,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys));},f.prototype.traverse=function(e,t){var r,n,a,s,u,l,f,d,m,x,v,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((a=r.pop())!==g){if(a.node){if(l=this.__execute(t.enter,a),this.__state===o||l===o)return;if(r.push(g),n.push(a),this.__state===i||l===i)continue;if(u=(s=a.node).type||a.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(s);}for(d=x.length;(d-=1)>=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(u,x[d]))a=new c(v[m],[f,m],"Property",null);else {if(!p(v[m]))continue;a=new c(v[m],[f,m],null,null);}r.push(a);}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null));}}}else if(a=n.pop(),l=this.__execute(t.leave,a),this.__state===o||l===o)return},f.prototype.replace=function(e,t){var r,n,a,u,f,y,d,m,x,v,g,A,E;function b(e){var t,n,a,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if((a=r[t]).ref&&a.ref.parent===o){if(a.ref.key<n)break;--a.ref.key;}}for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,y=new c(e,null,null,new l(A={root:e},"root")),r.push(y),n.push(y);r.length;)if((y=r.pop())!==g){if(void 0!==(f=this.__execute(t.enter,y))&&f!==o&&f!==i&&f!==s&&(y.ref.replace(f),y.node=f),this.__state!==s&&f!==s||(b(y),y.node=null),this.__state===o||f===o)return A.root;if((a=y.node)&&(r.push(g),n.push(y),this.__state!==i&&f!==i)){if(u=a.type||y.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(a);}for(d=x.length;(d-=1)>=0;)if(v=a[E=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(u,x[d]))y=new c(v[m],[E,m],"Property",new l(v,m));else {if(!p(v[m]))continue;y=new c(v[m],[E,m],null,new l(v,m));}r.push(y);}}else p(v)&&r.push(new c(v,E,null,new l(a,E)));}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==o&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||b(y),this.__state===o||f===o)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return (new f).replace(e,t)},t.attachComments=function(e,t,r){var a,o,i,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,o=t.length;i<o;i+=1)(a=u(t[i])).extendedRange=[0,e.range[0]],l.push(a);e.leadingComments=l;}return e}for(i=0,o=t.length;i<o;i+=1)l.push(m(u(t[i]),r));return s=0,d(e,{enter:function(e){for(var t;s<l.length&&!((t=l[s]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;s<l.length&&(t=l[s],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=a,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t);})),s=o((function(e){e.exports&&(e.exports=function(){function e(t,r,n,a){this.message=t,this.expected=r,this.found=n,this.location=a,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e);}return function(e,t){function r(){this.constructor=e;}r.prototype=t.prototype,e.prototype=new r;}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return '"'+a(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return "["+(e.inverted?"^":"")+r+"]"},any:function(e){return "any character"},end:function(e){return "end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return "\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return "\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return "\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return "\\x"+n(e)}))}return "Expected "+function(e){var t,n,a,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(a=e[t],r[a.type](a));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n;}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,a,o,i,s={},u={start:de},l=de,c=ce(" ",false),f=/^[^ [\],():#!=><~+.]/,p=fe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],true,false),h=ce(">",false),y=ce("~",false),d=ce("+",false),m=ce(",",false),x=ce("!",false),v=ce("*",false),g=ce("#",false),A=ce("[",false),E=ce("]",false),b=/^[><!]/,S=fe([">","<","!"],false,false),_=ce("=",false),C=function(e){return (e||"")+"="},w=/^[><]/,P=fe([">","<"],false,false),k=ce(".",false),D=function(e,t,r){return {type:"attribute",name:e,operator:t,value:r}},I=ce('"',false),j=/^[^\\"]/,T=fe(["\\",'"'],true,false),F=ce("\\",false),R={type:"any"},O=function(e,t){return e+t},L=function(e){return {type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case "b":return "\b";case "f":return "\f";case "n":return "\n";case "r":return "\r";case "t":return "\t";case "v":return "\v";default:return t}})))};var t;},M=ce("'",false),B=/^[^\\']/,U=fe(["\\","'"],true,false),K=/^[0-9]/,W=fe([["0","9"]],false,false),V=ce("type(",false),q=/^[^ )]/,N=fe([" ",")"],true,false),G=ce(")",false),z=/^[imsu]/,H=fe(["i","m","s","u"],false,false),Y=ce("/",false),$=/^[^\/]/,J=fe(["/"],true,false),Q=ce(":not(",false),X=ce(":matches(",false),Z=ce(":has(",false),ee=ce(":first-child",false),te=ce(":last-child",false),re=ce(":nth-child(",false),ne=ce(":nth-last-child(",false),ae=ce(":",false),oe=0,ie=[{line:1,column:1}],se=0,ue=[],le={};if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=u[r.startRule];}function ce(e,t){return {type:"literal",text:e,ignoreCase:t}}function fe(e,t,r){return {type:"class",parts:e,inverted:t,ignoreCase:r}}function pe(e){var r,n=ie[e];if(n)return n;for(r=e-1;!ie[r];)r--;for(n={line:(n=ie[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ie[e]=n,n}function he(e,t){var r=pe(e),n=pe(t);return {start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function ye(e){oe<se||(oe>se&&(se=oe,ue=[]),ue.push(e));}function de(){var e,t,r,n,a=30*oe+0,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,(t=me())!==s&&(r=ge())!==s&&me()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(oe=e,e=s),e===s&&(e=oe,(t=me())!==s&&(t=void 0),e=t),le[a]={nextPos:oe,result:e},e)}function me(){var e,r,n=30*oe+1,a=le[n];if(a)return oe=a.nextPos,a.result;for(e=[],32===t.charCodeAt(oe)?(r=" ",oe++):(r=s,ye(c));r!==s;)e.push(r),32===t.charCodeAt(oe)?(r=" ",oe++):(r=s,ye(c));return le[n]={nextPos:oe,result:e},e}function xe(){var e,r,n,a=30*oe+2,o=le[a];if(o)return oe=o.nextPos,o.result;if(r=[],f.test(t.charAt(oe))?(n=t.charAt(oe),oe++):(n=s,ye(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(oe))?(n=t.charAt(oe),oe++):(n=s,ye(p));else r=s;return r!==s&&(r=r.join("")),e=r,le[a]={nextPos:oe,result:e},e}function ve(){var e,r,n,a=30*oe+3,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,(r=me())!==s?(62===t.charCodeAt(oe)?(n=">",oe++):(n=s,ye(h)),n!==s&&me()!==s?e=r="child":(oe=e,e=s)):(oe=e,e=s),e===s&&(e=oe,(r=me())!==s?(126===t.charCodeAt(oe)?(n="~",oe++):(n=s,ye(y)),n!==s&&me()!==s?e=r="sibling":(oe=e,e=s)):(oe=e,e=s),e===s&&(e=oe,(r=me())!==s?(43===t.charCodeAt(oe)?(n="+",oe++):(n=s,ye(d)),n!==s&&me()!==s?e=r="adjacent":(oe=e,e=s)):(oe=e,e=s),e===s&&(e=oe,32===t.charCodeAt(oe)?(r=" ",oe++):(r=s,ye(c)),r!==s&&(n=me())!==s?e=r="descendant":(oe=e,e=s)))),le[a]={nextPos:oe,result:e},e)}function ge(){var e,r,n,a,o,i,u,l,c=30*oe+4,f=le[c];if(f)return oe=f.nextPos,f.result;if(e=oe,(r=Ae())!==s){for(n=[],a=oe,(o=me())!==s?(44===t.charCodeAt(oe)?(i=",",oe++):(i=s,ye(m)),i!==s&&(u=me())!==s&&(l=Ae())!==s?a=o=[o,i,u,l]:(oe=a,a=s)):(oe=a,a=s);a!==s;)n.push(a),a=oe,(o=me())!==s?(44===t.charCodeAt(oe)?(i=",",oe++):(i=s,ye(m)),i!==s&&(u=me())!==s&&(l=Ae())!==s?a=o=[o,i,u,l]:(oe=a,a=s)):(oe=a,a=s);n!==s?e=r=[r].concat(n.map((function(e){return e[3]}))):(oe=e,e=s);}else oe=e,e=s;return le[c]={nextPos:oe,result:e},e}function Ae(){var e,t,r,n,a,o,i,u=30*oe+5,l=le[u];if(l)return oe=l.nextPos,l.result;if(e=oe,(t=Ee())!==s){for(r=[],n=oe,(a=ve())!==s&&(o=Ee())!==s?n=a=[a,o]:(oe=n,n=s);n!==s;)r.push(n),n=oe,(a=ve())!==s&&(o=Ee())!==s?n=a=[a,o]:(oe=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return {type:t[0],left:e,right:t[1]}}),i)):(oe=e,e=s);}else oe=e,e=s;return le[u]={nextPos:oe,result:e},e}function Ee(){var e,r,n,a,o,i,u,l=30*oe+6,c=le[l];if(c)return oe=c.nextPos,c.result;if(e=oe,33===t.charCodeAt(oe)?(r="!",oe++):(r=s,ye(x)),r===s&&(r=null),r!==s){if(n=[],(a=be())!==s)for(;a!==s;)n.push(a),a=be();else n=s;n!==s?(o=r,u=1===(i=n).length?i[0]:{type:"compound",selectors:i},o&&(u.subject=true),e=r=u):(oe=e,e=s);}else oe=e,e=s;return le[l]={nextPos:oe,result:e},e}function be(){var e,r=30*oe+7,n=le[r];return n?(oe=n.nextPos,n.result):((e=function(){var e,r,n=30*oe+8,a=le[n];return a?(oe=a.nextPos,a.result):(42===t.charCodeAt(oe)?(r="*",oe++):(r=s,ye(v)),r!==s&&(r={type:"wildcard",value:r}),e=r,le[n]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a=30*oe+9,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,35===t.charCodeAt(oe)?(r="#",oe++):(r=s,ye(g)),r===s&&(r=null),r!==s&&(n=xe())!==s?e=r={type:"identifier",value:n}:(oe=e,e=s),le[a]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*oe+10,i=le[o];return i?(oe=i.nextPos,i.result):(e=oe,91===t.charCodeAt(oe)?(r="[",oe++):(r=s,ye(A)),r!==s&&me()!==s&&(n=function(){var e,r,n,a,o=30*oe+14,i=le[o];return i?(oe=i.nextPos,i.result):(e=oe,(r=Se())!==s&&me()!==s&&(n=function(){var e,r,n,a=30*oe+12,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,33===t.charCodeAt(oe)?(r="!",oe++):(r=s,ye(x)),r===s&&(r=null),r!==s?(61===t.charCodeAt(oe)?(n="=",oe++):(n=s,ye(_)),n!==s?(r=C(r),e=r):(oe=e,e=s)):(oe=e,e=s),le[a]={nextPos:oe,result:e},e)}())!==s&&me()!==s?((a=function(){var e,r,n,a,o,i=30*oe+18,u=le[i];if(u)return oe=u.nextPos,u.result;if(e=oe,"type("===t.substr(oe,5)?(r="type(",oe+=5):(r=s,ye(V)),r!==s)if(me()!==s){if(n=[],q.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(N)),a!==s)for(;a!==s;)n.push(a),q.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(N));else n=s;n!==s&&(a=me())!==s?(41===t.charCodeAt(oe)?(o=")",oe++):(o=s,ye(G)),o!==s?(r={type:"type",value:n.join("")},e=r):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;else oe=e,e=s;return le[i]={nextPos:oe,result:e},e}())===s&&(a=function(){var e,r,n,a,o,i,u=30*oe+20,l=le[u];if(l)return oe=l.nextPos,l.result;if(e=oe,47===t.charCodeAt(oe)?(r="/",oe++):(r=s,ye(Y)),r!==s){if(n=[],$.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(J)),a!==s)for(;a!==s;)n.push(a),$.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(J));else n=s;n!==s?(47===t.charCodeAt(oe)?(a="/",oe++):(a=s,ye(Y)),a!==s?((o=function(){var e,r,n=30*oe+19,a=le[n];if(a)return oe=a.nextPos,a.result;if(e=[],z.test(t.charAt(oe))?(r=t.charAt(oe),oe++):(r=s,ye(H)),r!==s)for(;r!==s;)e.push(r),z.test(t.charAt(oe))?(r=t.charAt(oe),oe++):(r=s,ye(H));else e=s;return le[n]={nextPos:oe,result:e},e}())===s&&(o=null),o!==s?(i=o,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(oe=e,e=s)):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;return le[u]={nextPos:oe,result:e},e}()),a!==s?(r=D(r,n,a),e=r):(oe=e,e=s)):(oe=e,e=s),e===s&&(e=oe,(r=Se())!==s&&me()!==s&&(n=function(){var e,r,n,a=30*oe+11,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,b.test(t.charAt(oe))?(r=t.charAt(oe),oe++):(r=s,ye(S)),r===s&&(r=null),r!==s?(61===t.charCodeAt(oe)?(n="=",oe++):(n=s,ye(_)),n!==s?(r=C(r),e=r):(oe=e,e=s)):(oe=e,e=s),e===s&&(w.test(t.charAt(oe))?(e=t.charAt(oe),oe++):(e=s,ye(P))),le[a]={nextPos:oe,result:e},e)}())!==s&&me()!==s?((a=function(){var e,r,n,a,o,i,u=30*oe+15,l=le[u];if(l)return oe=l.nextPos,l.result;if(e=oe,34===t.charCodeAt(oe)?(r='"',oe++):(r=s,ye(I)),r!==s){for(n=[],j.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(T)),a===s&&(a=oe,92===t.charCodeAt(oe)?(o="\\",oe++):(o=s,ye(F)),o!==s?(t.length>oe?(i=t.charAt(oe),oe++):(i=s,ye(R)),i!==s?(o=O(o,i),a=o):(oe=a,a=s)):(oe=a,a=s));a!==s;)n.push(a),j.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(T)),a===s&&(a=oe,92===t.charCodeAt(oe)?(o="\\",oe++):(o=s,ye(F)),o!==s?(t.length>oe?(i=t.charAt(oe),oe++):(i=s,ye(R)),i!==s?(o=O(o,i),a=o):(oe=a,a=s)):(oe=a,a=s));n!==s?(34===t.charCodeAt(oe)?(a='"',oe++):(a=s,ye(I)),a!==s?(r=L(n),e=r):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;if(e===s)if(e=oe,39===t.charCodeAt(oe)?(r="'",oe++):(r=s,ye(M)),r!==s){for(n=[],B.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(U)),a===s&&(a=oe,92===t.charCodeAt(oe)?(o="\\",oe++):(o=s,ye(F)),o!==s?(t.length>oe?(i=t.charAt(oe),oe++):(i=s,ye(R)),i!==s?(o=O(o,i),a=o):(oe=a,a=s)):(oe=a,a=s));a!==s;)n.push(a),B.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(U)),a===s&&(a=oe,92===t.charCodeAt(oe)?(o="\\",oe++):(o=s,ye(F)),o!==s?(t.length>oe?(i=t.charAt(oe),oe++):(i=s,ye(R)),i!==s?(o=O(o,i),a=o):(oe=a,a=s)):(oe=a,a=s));n!==s?(39===t.charCodeAt(oe)?(a="'",oe++):(a=s,ye(M)),a!==s?(r=L(n),e=r):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;return le[u]={nextPos:oe,result:e},e}())===s&&(a=function(){var e,r,n,a,o,i,u,l=30*oe+16,c=le[l];if(c)return oe=c.nextPos,c.result;for(e=oe,r=oe,n=[],K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W));a!==s;)n.push(a),K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W));if(n!==s?(46===t.charCodeAt(oe)?(a=".",oe++):(a=s,ye(k)),a!==s?r=n=[n,a]:(oe=r,r=s)):(oe=r,r=s),r===s&&(r=null),r!==s){if(n=[],K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W)),a!==s)for(;a!==s;)n.push(a),K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W));else n=s;n!==s?(i=n,u=(o=r)?[].concat.apply([],o).join(""):"",r={type:"literal",value:parseFloat(u+i.join(""))},e=r):(oe=e,e=s);}else oe=e,e=s;return le[l]={nextPos:oe,result:e},e}())===s&&(a=function(){var e,t,r=30*oe+17,n=le[r];return n?(oe=n.nextPos,n.result):((t=xe())!==s&&(t={type:"literal",value:t}),e=t,le[r]={nextPos:oe,result:e},e)}()),a!==s?(r=D(r,n,a),e=r):(oe=e,e=s)):(oe=e,e=s),e===s&&(e=oe,(r=Se())!==s&&(r={type:"attribute",name:r}),e=r)),le[o]={nextPos:oe,result:e},e)}())!==s&&me()!==s?(93===t.charCodeAt(oe)?(a="]",oe++):(a=s,ye(E)),a!==s?e=r=n:(oe=e,e=s)):(oe=e,e=s),le[o]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a,o,i,u,l,c=30*oe+21,f=le[c];if(f)return oe=f.nextPos,f.result;if(e=oe,46===t.charCodeAt(oe)?(r=".",oe++):(r=s,ye(k)),r!==s)if((n=xe())!==s){for(a=[],o=oe,46===t.charCodeAt(oe)?(i=".",oe++):(i=s,ye(k)),i!==s&&(u=xe())!==s?o=i=[i,u]:(oe=o,o=s);o!==s;)a.push(o),o=oe,46===t.charCodeAt(oe)?(i=".",oe++):(i=s,ye(k)),i!==s&&(u=xe())!==s?o=i=[i,u]:(oe=o,o=s);a!==s?(l=n,r={type:"field",name:a.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=r):(oe=e,e=s);}else oe=e,e=s;else oe=e,e=s;return le[c]={nextPos:oe,result:e},e}())===s&&(e=function(){var e,r,n,a,o=30*oe+22,i=le[o];return i?(oe=i.nextPos,i.result):(e=oe,":not("===t.substr(oe,5)?(r=":not(",oe+=5):(r=s,ye(Q)),r!==s&&me()!==s&&(n=ge())!==s&&me()!==s?(41===t.charCodeAt(oe)?(a=")",oe++):(a=s,ye(G)),a!==s?e=r={type:"not",selectors:n}:(oe=e,e=s)):(oe=e,e=s),le[o]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*oe+23,i=le[o];return i?(oe=i.nextPos,i.result):(e=oe,":matches("===t.substr(oe,9)?(r=":matches(",oe+=9):(r=s,ye(X)),r!==s&&me()!==s&&(n=ge())!==s&&me()!==s?(41===t.charCodeAt(oe)?(a=")",oe++):(a=s,ye(G)),a!==s?e=r={type:"matches",selectors:n}:(oe=e,e=s)):(oe=e,e=s),le[o]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*oe+24,i=le[o];return i?(oe=i.nextPos,i.result):(e=oe,":has("===t.substr(oe,5)?(r=":has(",oe+=5):(r=s,ye(Z)),r!==s&&me()!==s&&(n=ge())!==s&&me()!==s?(41===t.charCodeAt(oe)?(a=")",oe++):(a=s,ye(G)),a!==s?e=r={type:"has",selectors:n}:(oe=e,e=s)):(oe=e,e=s),le[o]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n=30*oe+25,a=le[n];return a?(oe=a.nextPos,a.result):(":first-child"===t.substr(oe,12)?(r=":first-child",oe+=12):(r=s,ye(ee)),r!==s&&(r=_e(1)),e=r,le[n]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n=30*oe+26,a=le[n];return a?(oe=a.nextPos,a.result):(":last-child"===t.substr(oe,11)?(r=":last-child",oe+=11):(r=s,ye(te)),r!==s&&(r=Ce(1)),e=r,le[n]={nextPos:oe,result:e},e)}())===s&&(e=function(){var e,r,n,a,o,i=30*oe+27,u=le[i];if(u)return oe=u.nextPos,u.result;if(e=oe,":nth-child("===t.substr(oe,11)?(r=":nth-child(",oe+=11):(r=s,ye(re)),r!==s)if(me()!==s){if(n=[],K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W)),a!==s)for(;a!==s;)n.push(a),K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W));else n=s;n!==s&&(a=me())!==s?(41===t.charCodeAt(oe)?(o=")",oe++):(o=s,ye(G)),o!==s?(r=_e(parseInt(n.join(""),10)),e=r):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;else oe=e,e=s;return le[i]={nextPos:oe,result:e},e}())===s&&(e=function(){var e,r,n,a,o,i=30*oe+28,u=le[i];if(u)return oe=u.nextPos,u.result;if(e=oe,":nth-last-child("===t.substr(oe,16)?(r=":nth-last-child(",oe+=16):(r=s,ye(ne)),r!==s)if(me()!==s){if(n=[],K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W)),a!==s)for(;a!==s;)n.push(a),K.test(t.charAt(oe))?(a=t.charAt(oe),oe++):(a=s,ye(W));else n=s;n!==s&&(a=me())!==s?(41===t.charCodeAt(oe)?(o=")",oe++):(o=s,ye(G)),o!==s?(r=Ce(parseInt(n.join(""),10)),e=r):(oe=e,e=s)):(oe=e,e=s);}else oe=e,e=s;else oe=e,e=s;return le[i]={nextPos:oe,result:e},e}())===s&&(e=function(){var e,r,n,a=30*oe+29,o=le[a];return o?(oe=o.nextPos,o.result):(e=oe,58===t.charCodeAt(oe)?(r=":",oe++):(r=s,ye(ae)),r!==s&&(n=xe())!==s?e=r={type:"class",name:n}:(oe=e,e=s),le[a]={nextPos:oe,result:e},e)}()),le[r]={nextPos:oe,result:e},e)}function Se(){var e,r,n,a,o,i,u,l,c=30*oe+13,f=le[c];if(f)return oe=f.nextPos,f.result;if(e=oe,(r=xe())!==s){for(n=[],a=oe,46===t.charCodeAt(oe)?(o=".",oe++):(o=s,ye(k)),o!==s&&(i=xe())!==s?a=o=[o,i]:(oe=a,a=s);a!==s;)n.push(a),a=oe,46===t.charCodeAt(oe)?(o=".",oe++):(o=s,ye(k)),o!==s&&(i=xe())!==s?a=o=[o,i]:(oe=a,a=s);n!==s?(u=r,l=n,e=r=[].concat.apply([u],l).join("")):(oe=e,e=s);}else oe=e,e=s;return le[c]={nextPos:oe,result:e},e}function _e(e){return {type:"nth-child",index:{type:"literal",value:e}}}function Ce(e){return {type:"nth-last-child",index:{type:"literal",value:e}}}if((n=l())!==s&&oe===t.length)return n;throw n!==s&&oe<t.length&&ye({type:"end"}),a=ue,o=se<t.length?t.charAt(se):null,i=se<t.length?he(se,se+1):he(se,se),new e(e.buildMessage(a,o),a,o,i)}}}());}));function u(e,t){for(var r=0;r<t.length;++r){if(null==e)return e;e=e[t[r]];}return e}var l="function"==typeof WeakMap?new WeakMap:null;function c(e){if(null==e)return function(){return  true};if(null!=l){var t=l.get(e);return null!=t||(t=f(e),l.set(e,t)),t}return f(e)}function f(t){switch(t.type){case "wildcard":return function(){return  true};case "identifier":var r=t.value.toLowerCase();return function(e,t,n){var a=n&&n.nodeTypeKey||"type";return r===e[a].toLowerCase()};case "field":var n=t.name.split(".");return function(e,t){return function e(t,r,n,a){for(var o=r,i=a;i<n.length;++i){if(null==o)return  false;var s=o[n[i]];if(Array.isArray(s)){for(var u=0;u<s.length;++u)if(e(t,s[u],n,i+1))return  true;return  false}o=s;}return t===o}(e,t[n.length-1],n,0)};case "matches":var a=t.selectors.map(c);return function(e,t,r){for(var n=0;n<a.length;++n)if(a[n](e,t,r))return  true;return  false};case "compound":var o=t.selectors.map(c);return function(e,t,r){for(var n=0;n<o.length;++n)if(!o[n](e,t,r))return  false;return  true};case "not":var s=t.selectors.map(c);return function(e,t,r){for(var n=0;n<s.length;++n)if(s[n](e,t,r))return  false;return  true};case "has":var l=t.selectors.map(c);return function(e,t,r){var n=false,a=[];return i.traverse(e,{enter:function(e,t){null!=t&&a.unshift(t);for(var o=0;o<l.length;++o)if(l[o](e,a,r))return n=true,void this.break()},leave:function(){a.shift();},keys:r&&r.visitorKeys,fallback:r&&r.fallback||"iteration"}),n};case "child":var f=c(t.left),p=c(t.right);return function(e,t,r){return !!(t.length>0&&p(e,t,r))&&f(t[0],t.slice(1),r)};case "descendant":var h=c(t.left),x=c(t.right);return function(e,t,r){if(x(e,t,r))for(var n=0,a=t.length;n<a;++n)if(h(t[n],t.slice(n+1),r))return  true;return  false};case "attribute":var v=t.name.split(".");switch(t.operator){case void 0:return function(e){return null!=u(e,v)};case "=":switch(t.value.type){case "regexp":return function(e){var r=u(e,v);return "string"==typeof r&&t.value.value.test(r)};case "literal":var g="".concat(t.value.value);return function(e){return g==="".concat(u(e,v))};case "type":return function(r){return t.value.value===e(u(r,v))}}throw new Error("Unknown selector value type: ".concat(t.value.type));case "!=":switch(t.value.type){case "regexp":return function(e){return !t.value.value.test(u(e,v))};case "literal":var A="".concat(t.value.value);return function(e){return A!=="".concat(u(e,v))};case "type":return function(r){return t.value.value!==e(u(r,v))}}throw new Error("Unknown selector value type: ".concat(t.value.type));case "<=":return function(e){return u(e,v)<=t.value.value};case "<":return function(e){return u(e,v)<t.value.value};case ">":return function(e){return u(e,v)>t.value.value};case ">=":return function(e){return u(e,v)>=t.value.value}}throw new Error("Unknown operator: ".concat(t.operator));case "sibling":var E=c(t.left),b=c(t.right);return function(e,r,n){return b(e,r,n)&&y(e,E,r,"LEFT_SIDE",n)||t.left.subject&&E(e,r,n)&&y(e,b,r,"RIGHT_SIDE",n)};case "adjacent":var S=c(t.left),_=c(t.right);return function(e,r,n){return _(e,r,n)&&d(e,S,r,"LEFT_SIDE",n)||t.right.subject&&S(e,r,n)&&d(e,_,r,"RIGHT_SIDE",n)};case "nth-child":var C=t.index.value,w=c(t.right);return function(e,t,r){return w(e,t,r)&&m(e,t,C,r)};case "nth-last-child":var P=-t.index.value,k=c(t.right);return function(e,t,r){return k(e,t,r)&&m(e,t,P,r)};case "class":return function(e,r,n){if(n&&n.matchClass)return n.matchClass(t.name,e,r);if(n&&n.nodeTypeKey)return  false;switch(t.name.toLowerCase()){case "statement":if("Statement"===e.type.slice(-9))return  true;case "declaration":return "Declaration"===e.type.slice(-11);case "pattern":if("Pattern"===e.type.slice(-7))return  true;case "expression":return "Expression"===e.type.slice(-10)||"Literal"===e.type.slice(-7)||"Identifier"===e.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===e.type;case "function":return "FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}throw new Error("Unknown class name: ".concat(t.name))}}throw new Error("Unknown selector type: ".concat(t.type))}function p(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:i.VisitorKeys[n]?i.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return e!==r}))}function h(t,r){var n=r&&r.nodeTypeKey||"type";return null!==t&&"object"===e(t)&&"string"==typeof t[n]}function y(e,r,n,a,o){var i=t(n,1)[0];if(!i)return  false;for(var s=p(i,o),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;var f=void 0,y=void 0;"LEFT_SIDE"===a?(f=0,y=c):(f=c+1,y=l.length);for(var d=f;d<y;++d)if(h(l[d],o)&&r(l[d],n,o))return  true}}return  false}function d(e,r,n,a,o){var i=t(n,1)[0];if(!i)return  false;for(var s=p(i,o),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;if("LEFT_SIDE"===a&&c>0&&h(l[c-1],o)&&r(l[c-1],n,o))return  true;if("RIGHT_SIDE"===a&&c<l.length-1&&h(l[c+1],o)&&r(l[c+1],n,o))return  true}}return  false}function m(e,r,n,a){if(0===n)return  false;var o=t(r,1)[0];if(!o)return  false;for(var i=p(o,a),s=0;s<i.length;++s){var u=o[i[s]];if(Array.isArray(u)){var l=n<0?u.length+n:n-1;if(l>=0&&l<u.length&&u[l]===e)return  true}}return  false}function x(t,n,a,o){if(n){var s=[],u=c(n),l=function t(n,a){if(null==n||"object"!=e(n))return [];null==a&&(a=n);for(var o=n.subject?[a]:[],i=Object.keys(n),s=0;s<i.length;++s){var u=i[s],l=n[u];o.push.apply(o,r(t(l,"left"===u?l:a)));}return o}(n).map(c);i.traverse(t,{enter:function(e,t){if(null!=t&&s.unshift(t),u(e,s,o))if(l.length)for(var r=0,n=l.length;r<n;++r){l[r](e,s,o)&&a(e,t,s);for(var i=0,c=s.length;i<c;++i){var f=s.slice(i+1);l[r](s[i],f,o)&&a(s[i],t,f);}}else a(e,t,s);},leave:function(){s.shift();},keys:o&&o.visitorKeys,fallback:o&&o.fallback||"iteration"});}}function v(e,t,r){var n=[];return x(e,t,(function(e){n.push(e);}),r),n}function g(e){return s.parse(e)}function A(e,t,r){return v(e,g(t),r)}A.parse=g,A.match=v,A.traverse=x,A.matches=function(e,t,r,n){return !t||!!e&&(r||(r=[]),c(t)(e,r,n))},A.query=A;

/**
 * @fileoverview The event generator for AST nodes.
 * @author Toru Nagashima
 */

var nodeEventGenerator;
var hasRequiredNodeEventGenerator;

function requireNodeEventGenerator () {
	if (hasRequiredNodeEventGenerator) return nodeEventGenerator;
	hasRequiredNodeEventGenerator = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const esquery = A;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * An object describing an AST selector
	 * @typedef {Object} ASTSelector
	 * @property {string} rawSelector The string that was parsed into this selector
	 * @property {boolean} isExit `true` if this should be emitted when exiting the node rather than when entering
	 * @property {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector
	 * @property {string[]|null} listenerTypes A list of node types that could possibly cause the selector to match,
	 * or `null` if all node types could cause a match
	 * @property {number} attributeCount The total number of classes, pseudo-classes, and attribute queries in this selector
	 * @property {number} identifierCount The total number of identifier queries in this selector
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Computes the union of one or more arrays
	 * @param {...any[]} arrays One or more arrays to union
	 * @returns {any[]} The union of the input arrays
	 */
	function union(...arrays) {
		return [...new Set(arrays.flat())];
	}

	/**
	 * Computes the intersection of one or more arrays
	 * @param {...any[]} arrays One or more arrays to intersect
	 * @returns {any[]} The intersection of the input arrays
	 */
	function intersection(...arrays) {
		if (arrays.length === 0) {
			return [];
		}

		let result = [...new Set(arrays[0])];

		for (const array of arrays.slice(1)) {
			result = result.filter(x => array.includes(x));
		}
		return result;
	}

	/**
	 * Gets the possible types of a selector
	 * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector
	 * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it
	 */
	function getPossibleTypes(parsedSelector) {
		switch (parsedSelector.type) {
			case "identifier":
				return [parsedSelector.value];

			case "matches": {
				const typesForComponents =
					parsedSelector.selectors.map(getPossibleTypes);

				if (typesForComponents.every(Boolean)) {
					return union(...typesForComponents);
				}
				return null;
			}

			case "compound": {
				const typesForComponents = parsedSelector.selectors
					.map(getPossibleTypes)
					.filter(typesForComponent => typesForComponent);

				// If all of the components could match any type, then the compound could also match any type.
				if (!typesForComponents.length) {
					return null;
				}

				/*
				 * If at least one of the components could only match a particular type, the compound could only match
				 * the intersection of those types.
				 */
				return intersection(...typesForComponents);
			}

			case "child":
			case "descendant":
			case "sibling":
			case "adjacent":
				return getPossibleTypes(parsedSelector.right);

			case "class":
				if (parsedSelector.name === "function") {
					return [
						"FunctionDeclaration",
						"FunctionExpression",
						"ArrowFunctionExpression",
					];
				}

				return null;

			default:
				return null;
		}
	}

	/**
	 * Counts the number of class, pseudo-class, and attribute queries in this selector
	 * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior
	 * @returns {number} The number of class, pseudo-class, and attribute queries in this selector
	 */
	function countClassAttributes(parsedSelector) {
		switch (parsedSelector.type) {
			case "child":
			case "descendant":
			case "sibling":
			case "adjacent":
				return (
					countClassAttributes(parsedSelector.left) +
					countClassAttributes(parsedSelector.right)
				);

			case "compound":
			case "not":
			case "matches":
				return parsedSelector.selectors.reduce(
					(sum, childSelector) =>
						sum + countClassAttributes(childSelector),
					0,
				);

			case "attribute":
			case "field":
			case "nth-child":
			case "nth-last-child":
				return 1;

			default:
				return 0;
		}
	}

	/**
	 * Counts the number of identifier queries in this selector
	 * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior
	 * @returns {number} The number of identifier queries
	 */
	function countIdentifiers(parsedSelector) {
		switch (parsedSelector.type) {
			case "child":
			case "descendant":
			case "sibling":
			case "adjacent":
				return (
					countIdentifiers(parsedSelector.left) +
					countIdentifiers(parsedSelector.right)
				);

			case "compound":
			case "not":
			case "matches":
				return parsedSelector.selectors.reduce(
					(sum, childSelector) => sum + countIdentifiers(childSelector),
					0,
				);

			case "identifier":
				return 1;

			default:
				return 0;
		}
	}

	/**
	 * Compares the specificity of two selector objects, with CSS-like rules.
	 * @param {ASTSelector} selectorA An AST selector descriptor
	 * @param {ASTSelector} selectorB Another AST selector descriptor
	 * @returns {number}
	 * a value less than 0 if selectorA is less specific than selectorB
	 * a value greater than 0 if selectorA is more specific than selectorB
	 * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically
	 * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically
	 */
	function compareSpecificity(selectorA, selectorB) {
		return (
			selectorA.attributeCount - selectorB.attributeCount ||
			selectorA.identifierCount - selectorB.identifierCount ||
			(selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1)
		);
	}

	/**
	 * Parses a raw selector string, and throws a useful error if parsing fails.
	 * @param {string} rawSelector A raw AST selector
	 * @returns {Object} An object (from esquery) describing the matching behavior of this selector
	 * @throws {Error} An error if the selector is invalid
	 */
	function tryParseSelector(rawSelector) {
		try {
			return esquery.parse(rawSelector.replace(/:exit$/u, ""));
		} catch (err) {
			if (
				err.location &&
				err.location.start &&
				typeof err.location.start.offset === "number"
			) {
				throw new SyntaxError(
					`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`,
				);
			}
			throw err;
		}
	}

	const selectorCache = new Map();

	/**
	 * Parses a raw selector string, and returns the parsed selector along with specificity and type information.
	 * @param {string} rawSelector A raw AST selector
	 * @returns {ASTSelector} A selector descriptor
	 */
	function parseSelector(rawSelector) {
		if (selectorCache.has(rawSelector)) {
			return selectorCache.get(rawSelector);
		}

		const parsedSelector = tryParseSelector(rawSelector);

		const result = {
			rawSelector,
			isExit: rawSelector.endsWith(":exit"),
			parsedSelector,
			listenerTypes: getPossibleTypes(parsedSelector),
			attributeCount: countClassAttributes(parsedSelector),
			identifierCount: countIdentifiers(parsedSelector),
		};

		selectorCache.set(rawSelector, result);
		return result;
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * The event generator for AST nodes.
	 * This implements below interface.
	 *
	 * ```ts
	 * interface EventGenerator {
	 *     emitter: SafeEmitter;
	 *     enterNode(node: ASTNode): void;
	 *     leaveNode(node: ASTNode): void;
	 * }
	 * ```
	 */
	class NodeEventGenerator {
		/**
		 * @param {SafeEmitter} emitter
		 * An SafeEmitter which is the destination of events. This emitter must already
		 * have registered listeners for all of the events that it needs to listen for.
		 * (See lib/linter/safe-emitter.js for more details on `SafeEmitter`.)
		 * @param {ESQueryOptions} esqueryOptions `esquery` options for traversing custom nodes.
		 * @returns {NodeEventGenerator} new instance
		 */
		constructor(emitter, esqueryOptions) {
			this.emitter = emitter;
			this.esqueryOptions = esqueryOptions;
			this.currentAncestry = [];
			this.enterSelectorsByNodeType = new Map();
			this.exitSelectorsByNodeType = new Map();
			this.anyTypeEnterSelectors = [];
			this.anyTypeExitSelectors = [];

			emitter.eventNames().forEach(rawSelector => {
				const selector = parseSelector(rawSelector);

				if (selector.listenerTypes) {
					const typeMap = selector.isExit
						? this.exitSelectorsByNodeType
						: this.enterSelectorsByNodeType;

					selector.listenerTypes.forEach(nodeType => {
						if (!typeMap.has(nodeType)) {
							typeMap.set(nodeType, []);
						}
						typeMap.get(nodeType).push(selector);
					});
					return;
				}
				const selectors = selector.isExit
					? this.anyTypeExitSelectors
					: this.anyTypeEnterSelectors;

				selectors.push(selector);
			});

			this.anyTypeEnterSelectors.sort(compareSpecificity);
			this.anyTypeExitSelectors.sort(compareSpecificity);
			this.enterSelectorsByNodeType.forEach(selectorList =>
				selectorList.sort(compareSpecificity),
			);
			this.exitSelectorsByNodeType.forEach(selectorList =>
				selectorList.sort(compareSpecificity),
			);
		}

		/**
		 * Checks a selector against a node, and emits it if it matches
		 * @param {ASTNode} node The node to check
		 * @param {ASTSelector} selector An AST selector descriptor
		 * @returns {void}
		 */
		applySelector(node, selector) {
			if (
				esquery.matches(
					node,
					selector.parsedSelector,
					this.currentAncestry,
					this.esqueryOptions,
				)
			) {
				this.emitter.emit(selector.rawSelector, node);
			}
		}

		/**
		 * Applies all appropriate selectors to a node, in specificity order
		 * @param {ASTNode} node The node to check
		 * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited
		 * @returns {void}
		 */
		applySelectors(node, isExit) {
			const selectorsByNodeType =
				(isExit
					? this.exitSelectorsByNodeType
					: this.enterSelectorsByNodeType
				).get(node.type) || [];
			const anyTypeSelectors = isExit
				? this.anyTypeExitSelectors
				: this.anyTypeEnterSelectors;

			/*
			 * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor.
			 * Iterate through each of them, applying selectors in the right order.
			 */
			let selectorsByTypeIndex = 0;
			let anyTypeSelectorsIndex = 0;

			while (
				selectorsByTypeIndex < selectorsByNodeType.length ||
				anyTypeSelectorsIndex < anyTypeSelectors.length
			) {
				if (
					selectorsByTypeIndex >= selectorsByNodeType.length ||
					(anyTypeSelectorsIndex < anyTypeSelectors.length &&
						compareSpecificity(
							anyTypeSelectors[anyTypeSelectorsIndex],
							selectorsByNodeType[selectorsByTypeIndex],
						) < 0)
				) {
					this.applySelector(
						node,
						anyTypeSelectors[anyTypeSelectorsIndex++],
					);
				} else {
					this.applySelector(
						node,
						selectorsByNodeType[selectorsByTypeIndex++],
					);
				}
			}
		}

		/**
		 * Emits an event of entering AST node.
		 * @param {ASTNode} node A node which was entered.
		 * @returns {void}
		 */
		enterNode(node) {
			this.applySelectors(node, false);
			this.currentAncestry.unshift(node);
		}

		/**
		 * Emits an event of leaving AST node.
		 * @param {ASTNode} node A node which was left.
		 * @returns {void}
		 */
		leaveNode(node) {
			this.currentAncestry.shift();
			this.applySelectors(node, true);
		}
	}

	nodeEventGenerator = NodeEventGenerator;
	return nodeEventGenerator;
}

/**
 * @fileoverview An object that creates fix commands for rules.
 * @author Nicholas C. Zakas
 */

var ruleFixer;
var hasRequiredRuleFixer;

function requireRuleFixer () {
	if (hasRequiredRuleFixer) return ruleFixer;
	hasRequiredRuleFixer = 1;

	/* eslint class-methods-use-this: off -- Methods desired on instance */

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	// none!

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Creates a fix command that inserts text at the specified index in the source text.
	 * @param {int} index The 0-based index at which to insert the new text.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @private
	 */
	function insertTextAt(index, text) {
		return {
			range: [index, index],
			text,
		};
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Creates code fixing commands for rules.
	 */
	class RuleFixer {
		/**
		 * The source code object representing the text to be fixed.
		 * @type {SourceCode}
		 */
		#sourceCode;

		/**
		 * Creates a new instance.
		 * @param {Object} options The options for the fixer.
		 * @param {SourceCode} options.sourceCode The source code object representing the text to be fixed.
		 */
		constructor({ sourceCode }) {
			this.#sourceCode = sourceCode;
		}

		/**
		 * Creates a fix command that inserts text after the given node or token.
		 * The fix is not applied until applyFixes() is called.
		 * @param {ASTNode|Token} nodeOrToken The node or token to insert after.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		insertTextAfter(nodeOrToken, text) {
			const range = this.#sourceCode.getRange(nodeOrToken);

			return this.insertTextAfterRange(range, text);
		}

		/**
		 * Creates a fix command that inserts text after the specified range in the source text.
		 * The fix is not applied until applyFixes() is called.
		 * @param {int[]} range The range to replace, first item is start of range, second
		 *      is end of range.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		insertTextAfterRange(range, text) {
			return insertTextAt(range[1], text);
		}

		/**
		 * Creates a fix command that inserts text before the given node or token.
		 * The fix is not applied until applyFixes() is called.
		 * @param {ASTNode|Token} nodeOrToken The node or token to insert before.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		insertTextBefore(nodeOrToken, text) {
			const range = this.#sourceCode.getRange(nodeOrToken);

			return this.insertTextBeforeRange(range, text);
		}

		/**
		 * Creates a fix command that inserts text before the specified range in the source text.
		 * The fix is not applied until applyFixes() is called.
		 * @param {int[]} range The range to replace, first item is start of range, second
		 *      is end of range.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		insertTextBeforeRange(range, text) {
			return insertTextAt(range[0], text);
		}

		/**
		 * Creates a fix command that replaces text at the node or token.
		 * The fix is not applied until applyFixes() is called.
		 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		replaceText(nodeOrToken, text) {
			const range = this.#sourceCode.getRange(nodeOrToken);

			return this.replaceTextRange(range, text);
		}

		/**
		 * Creates a fix command that replaces text at the specified range in the source text.
		 * The fix is not applied until applyFixes() is called.
		 * @param {int[]} range The range to replace, first item is start of range, second
		 *      is end of range.
		 * @param {string} text The text to insert.
		 * @returns {Object} The fix command.
		 */
		replaceTextRange(range, text) {
			return {
				range,
				text,
			};
		}

		/**
		 * Creates a fix command that removes the node or token from the source.
		 * The fix is not applied until applyFixes() is called.
		 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
		 * @returns {Object} The fix command.
		 */
		remove(nodeOrToken) {
			const range = this.#sourceCode.getRange(nodeOrToken);

			return this.removeRange(range);
		}

		/**
		 * Creates a fix command that removes the specified range of text from the source.
		 * The fix is not applied until applyFixes() is called.
		 * @param {int[]} range The range to remove, first item is start of range, second
		 *      is end of range.
		 * @returns {Object} The fix command.
		 */
		removeRange(range) {
			return {
				range,
				text: "",
			};
		}
	}

	ruleFixer = { RuleFixer };
	return ruleFixer;
}

/**
 * @fileoverview Interpolate keys from an object into a string with {{ }} markers.
 * @author Jed Fox
 */

var interpolate_1;
var hasRequiredInterpolate;

function requireInterpolate () {
	if (hasRequiredInterpolate) return interpolate_1;
	hasRequiredInterpolate = 1;

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Returns a global expression matching placeholders in messages.
	 * @returns {RegExp} Global regular expression matching placeholders
	 */
	function getPlaceholderMatcher() {
		return /\{\{([^{}]+?)\}\}/gu;
	}

	/**
	 * Replaces {{ placeholders }} in the message with the provided data.
	 * Does not replace placeholders not available in the data.
	 * @param {string} text Original message with potential placeholders
	 * @param {Record<string, string>} data Map of placeholder name to its value
	 * @returns {string} Message with replaced placeholders
	 */
	function interpolate(text, data) {
		if (!data) {
			return text;
		}

		const matcher = getPlaceholderMatcher();

		// Substitution content for any {{ }} markers.
		return text.replace(matcher, (fullMatch, termWithWhitespace) => {
			const term = termWithWhitespace.trim();

			if (term in data) {
				return data[term];
			}

			// Preserve old behavior: If parameter name not provided, don't replace it.
			return fullMatch;
		});
	}

	interpolate_1 = {
		getPlaceholderMatcher,
		interpolate,
	};
	return interpolate_1;
}

/**
 * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects
 * @author Teddy Katz
 */

var reportTranslator;
var hasRequiredReportTranslator;

function requireReportTranslator () {
	if (hasRequiredReportTranslator) return reportTranslator;
	hasRequiredReportTranslator = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const assert = requireAssert();
	const { RuleFixer } = requireRuleFixer();
	const { interpolate } = requireInterpolate();

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/** @typedef {import("../shared/types").LintMessage} LintMessage */

	/**
	 * An error message description
	 * @typedef {Object} MessageDescriptor
	 * @property {ASTNode} [node] The reported node
	 * @property {Location} loc The location of the problem.
	 * @property {string} message The problem message.
	 * @property {Object} [data] Optional data to use to fill in placeholders in the
	 *      message.
	 * @property {Function} [fix] The function to call that creates a fix command.
	 * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes.
	 */

	//------------------------------------------------------------------------------
	// Module Definition
	//------------------------------------------------------------------------------

	/**
	 * Translates a multi-argument context.report() call into a single object argument call
	 * @param {...*} args A list of arguments passed to `context.report`
	 * @returns {MessageDescriptor} A normalized object containing report information
	 */
	function normalizeMultiArgReportCall(...args) {
		// If there is one argument, it is considered to be a new-style call already.
		if (args.length === 1) {
			// Shallow clone the object to avoid surprises if reusing the descriptor
			return Object.assign({}, args[0]);
		}

		// If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
		if (typeof args[1] === "string") {
			return {
				node: args[0],
				message: args[1],
				data: args[2],
				fix: args[3],
			};
		}

		// Otherwise, the arguments are interpreted as [node, loc, message, data, fix].
		return {
			node: args[0],
			loc: args[1],
			message: args[2],
			data: args[3],
			fix: args[4],
		};
	}

	/**
	 * Asserts that either a loc or a node was provided, and the node is valid if it was provided.
	 * @param {MessageDescriptor} descriptor A descriptor to validate
	 * @returns {void}
	 * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object
	 */
	function assertValidNodeInfo(descriptor) {
		if (descriptor.node) {
			assert(typeof descriptor.node === "object", "Node must be an object");
		} else {
			assert(
				descriptor.loc,
				"Node must be provided when reporting error if location is not provided",
			);
		}
	}

	/**
	 * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties
	 * @param {MessageDescriptor} descriptor A descriptor for the report from a rule.
	 * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties
	 * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor.
	 */
	function normalizeReportLoc(descriptor) {
		if (descriptor.loc.start) {
			return descriptor.loc;
		}
		return { start: descriptor.loc, end: null };
	}

	/**
	 * Clones the given fix object.
	 * @param {Fix|null} fix The fix to clone.
	 * @returns {Fix|null} Deep cloned fix object or `null` if `null` or `undefined` was passed in.
	 */
	function cloneFix(fix) {
		if (!fix) {
			return null;
		}

		return {
			range: [fix.range[0], fix.range[1]],
			text: fix.text,
		};
	}

	/**
	 * Check that a fix has a valid range.
	 * @param {Fix|null} fix The fix to validate.
	 * @returns {void}
	 */
	function assertValidFix(fix) {
		if (fix) {
			assert(
				fix.range &&
					typeof fix.range[0] === "number" &&
					typeof fix.range[1] === "number",
				`Fix has invalid range: ${JSON.stringify(fix, null, 2)}`,
			);
		}
	}

	/**
	 * Compares items in a fixes array by range.
	 * @param {Fix} a The first message.
	 * @param {Fix} b The second message.
	 * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
	 * @private
	 */
	function compareFixesByRange(a, b) {
		return a.range[0] - b.range[0] || a.range[1] - b.range[1];
	}

	/**
	 * Merges the given fixes array into one.
	 * @param {Fix[]} fixes The fixes to merge.
	 * @param {SourceCode} sourceCode The source code object to get the text between fixes.
	 * @returns {{text: string, range: number[]}} The merged fixes
	 */
	function mergeFixes(fixes, sourceCode) {
		for (const fix of fixes) {
			assertValidFix(fix);
		}

		if (fixes.length === 0) {
			return null;
		}
		if (fixes.length === 1) {
			return cloneFix(fixes[0]);
		}

		fixes.sort(compareFixesByRange);

		const originalText = sourceCode.text;
		const start = fixes[0].range[0];
		const end = fixes.at(-1).range[1];
		let text = "";
		let lastPos = Number.MIN_SAFE_INTEGER;

		for (const fix of fixes) {
			assert(
				fix.range[0] >= lastPos,
				"Fix objects must not be overlapped in a report.",
			);

			if (fix.range[0] >= 0) {
				text += originalText.slice(
					Math.max(0, start, lastPos),
					fix.range[0],
				);
			}
			text += fix.text;
			lastPos = fix.range[1];
		}
		text += originalText.slice(Math.max(0, start, lastPos), end);

		return { range: [start, end], text };
	}

	/**
	 * Gets one fix object from the given descriptor.
	 * If the descriptor retrieves multiple fixes, this merges those to one.
	 * @param {MessageDescriptor} descriptor The report descriptor.
	 * @param {SourceCode} sourceCode The source code object to get text between fixes.
	 * @returns {({text: string, range: number[]}|null)} The fix for the descriptor
	 */
	function normalizeFixes(descriptor, sourceCode) {
		if (typeof descriptor.fix !== "function") {
			return null;
		}

		const ruleFixer = new RuleFixer({ sourceCode });

		// @type {null | Fix | Fix[] | IterableIterator<Fix>}
		const fix = descriptor.fix(ruleFixer);

		// Merge to one.
		if (fix && Symbol.iterator in fix) {
			return mergeFixes(Array.from(fix), sourceCode);
		}

		assertValidFix(fix);
		return cloneFix(fix);
	}

	/**
	 * Gets an array of suggestion objects from the given descriptor.
	 * @param {MessageDescriptor} descriptor The report descriptor.
	 * @param {SourceCode} sourceCode The source code object to get text between fixes.
	 * @param {Object} messages Object of meta messages for the rule.
	 * @returns {Array<SuggestionResult>} The suggestions for the descriptor
	 */
	function mapSuggestions(descriptor, sourceCode, messages) {
		if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) {
			return [];
		}

		return (
			descriptor.suggest
				.map(suggestInfo => {
					const computedDesc =
						suggestInfo.desc || messages[suggestInfo.messageId];

					return {
						...suggestInfo,
						desc: interpolate(computedDesc, suggestInfo.data),
						fix: normalizeFixes(suggestInfo, sourceCode),
					};
				})

				// Remove suggestions that didn't provide a fix
				.filter(({ fix }) => fix)
		);
	}

	/**
	 * Creates information about the report from a descriptor
	 * @param {Object} options Information about the problem
	 * @param {string} options.ruleId Rule ID
	 * @param {(0|1|2)} options.severity Rule severity
	 * @param {(ASTNode|null)} options.node Node
	 * @param {string} options.message Error message
	 * @param {string} [options.messageId] The error message ID.
	 * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location
	 * @param {{text: string, range: (number[]|null)}} options.fix The fix object
	 * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects
	 * @param {Language} [options.language] The language to use to adjust line and column offsets.
	 * @returns {LintMessage} Information about the report
	 */
	function createProblem(options) {
		const { language } = options;

		// calculate offsets based on the language in use
		const columnOffset = language.columnStart === 1 ? 0 : 1;
		const lineOffset = language.lineStart === 1 ? 0 : 1;

		const problem = {
			ruleId: options.ruleId,
			severity: options.severity,
			message: options.message,
			line: options.loc.start.line + lineOffset,
			column: options.loc.start.column + columnOffset,
			nodeType: (options.node && options.node.type) || null,
		};

		/*
		 * If this isn’t in the conditional, some of the tests fail
		 * because `messageId` is present in the problem object
		 */
		if (options.messageId) {
			problem.messageId = options.messageId;
		}

		if (options.loc.end) {
			problem.endLine = options.loc.end.line + lineOffset;
			problem.endColumn = options.loc.end.column + columnOffset;
		}

		if (options.fix) {
			problem.fix = options.fix;
		}

		if (options.suggestions && options.suggestions.length > 0) {
			problem.suggestions = options.suggestions;
		}

		return problem;
	}

	/**
	 * Validates that suggestions are properly defined. Throws if an error is detected.
	 * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data.
	 * @param {Object} messages Object of meta messages for the rule.
	 * @returns {void}
	 */
	function validateSuggestions(suggest, messages) {
		if (suggest && Array.isArray(suggest)) {
			suggest.forEach(suggestion => {
				if (suggestion.messageId) {
					const { messageId } = suggestion;

					if (!messages) {
						throw new TypeError(
							`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`,
						);
					}

					if (!messages[messageId]) {
						throw new TypeError(
							`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
						);
					}

					if (suggestion.desc) {
						throw new TypeError(
							"context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one.",
						);
					}
				} else if (!suggestion.desc) {
					throw new TypeError(
						"context.report() called with a suggest option that doesn't have either a `desc` or `messageId`",
					);
				}

				if (typeof suggestion.fix !== "function") {
					throw new TypeError(
						`context.report() called with a suggest option without a fix function. See: ${suggestion}`,
					);
				}
			});
		}
	}

	/**
	 * Returns a function that converts the arguments of a `context.report` call from a rule into a reported
	 * problem for the Node.js API.
	 * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean, language:Language}} metadata Metadata for the reported problem
	 * @returns {function(...args): LintMessage} Function that returns information about the report
	 */

	reportTranslator = function createReportTranslator(metadata) {
		/*
		 * `createReportTranslator` gets called once per enabled rule per file. It needs to be very performant.
		 * The report translator itself (i.e. the function that `createReportTranslator` returns) gets
		 * called every time a rule reports a problem, which happens much less frequently (usually, the vast
		 * majority of rules don't report any problems for a given file).
		 */
		return (...args) => {
			const descriptor = normalizeMultiArgReportCall(...args);
			const messages = metadata.messageIds;
			const { sourceCode } = metadata;

			assertValidNodeInfo(descriptor);

			let computedMessage;

			if (descriptor.messageId) {
				if (!messages) {
					throw new TypeError(
						"context.report() called with a messageId, but no messages were present in the rule metadata.",
					);
				}
				const id = descriptor.messageId;

				if (descriptor.message) {
					throw new TypeError(
						"context.report() called with a message and a messageId. Please only pass one.",
					);
				}
				if (!messages || !Object.hasOwn(messages, id)) {
					throw new TypeError(
						`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
					);
				}
				computedMessage = messages[id];
			} else if (descriptor.message) {
				computedMessage = descriptor.message;
			} else {
				throw new TypeError(
					"Missing `message` property in report() call; add a message that describes the linting problem.",
				);
			}

			validateSuggestions(descriptor.suggest, messages);

			return createProblem({
				ruleId: metadata.ruleId,
				severity: metadata.severity,
				node: descriptor.node,
				message: interpolate(computedMessage, descriptor.data),
				messageId: descriptor.messageId,
				loc: descriptor.loc
					? normalizeReportLoc(descriptor)
					: sourceCode.getLoc(descriptor.node),
				fix: metadata.disableFixes
					? null
					: normalizeFixes(descriptor, sourceCode),
				suggestions: metadata.disableFixes
					? []
					: mapSuggestions(descriptor, sourceCode, messages),
				language: metadata.language,
			});
		};
	};
	return reportTranslator;
}

function commonjsRequire(path) {
	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}

/**
 * @fileoverview `Map` to load rules lazily.
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var lazyLoadingRuleMap;
var hasRequiredLazyLoadingRuleMap;

function requireLazyLoadingRuleMap () {
	if (hasRequiredLazyLoadingRuleMap) return lazyLoadingRuleMap;
	hasRequiredLazyLoadingRuleMap = 1;

	const debug = requireSrc()("eslint:rules");

	/** @typedef {import("../../shared/types").Rule} Rule */

	/**
	 * The `Map` object that loads each rule when it's accessed.
	 * @example
	 * const rules = new LazyLoadingRuleMap([
	 *     ["eqeqeq", () => require("eqeqeq")],
	 *     ["semi", () => require("semi")],
	 *     ["no-unused-vars", () => require("no-unused-vars")]
	 * ]);
	 *
	 * rules.get("semi"); // call `() => require("semi")` here.
	 *
	 * @extends {Map<string, () => Rule>}
	 */
	class LazyLoadingRuleMap extends Map {
		/**
		 * Initialize this map.
		 * @param {Array<[string, function(): Rule]>} loaders The rule loaders.
		 */
		constructor(loaders) {
			let remaining = loaders.length;

			super(
				debug.enabled
					? loaders.map(([ruleId, load]) => {
							let cache = null;

							return [
								ruleId,
								() => {
									if (!cache) {
										debug(
											"Loading rule %o (remaining=%d)",
											ruleId,
											--remaining,
										);
										cache = load();
									}
									return cache;
								},
							];
						})
					: loaders,
			);

			// `super(...iterable)` uses `this.set()`, so disable it here.
			Object.defineProperty(LazyLoadingRuleMap.prototype, "set", {
				configurable: true,
				value: void 0,
			});
		}

		/**
		 * Get a rule.
		 * Each rule will be loaded on the first access.
		 * @param {string} ruleId The rule ID to get.
		 * @returns {Rule|undefined} The rule.
		 */
		get(ruleId) {
			const load = super.get(ruleId);

			return load && load();
		}

		/**
		 * Iterate rules.
		 * @returns {IterableIterator<Rule>} Rules.
		 */
		*values() {
			for (const load of super.values()) {
				yield load();
			}
		}

		/**
		 * Iterate rules.
		 * @returns {IterableIterator<[string, Rule]>} Rules.
		 */
		*entries() {
			for (const [ruleId, load] of super.entries()) {
				yield [ruleId, load()];
			}
		}

		/**
		 * Call a function with each rule.
		 * @param {Function} callbackFn The callback function.
		 * @param {any} [thisArg] The object to pass to `this` of the callback function.
		 * @returns {void}
		 */
		forEach(callbackFn, thisArg) {
			for (const [ruleId, load] of super.entries()) {
				callbackFn.call(thisArg, load(), ruleId, this);
			}
		}
	}

	// Forbid mutation.
	Object.defineProperties(LazyLoadingRuleMap.prototype, {
		clear: { configurable: true, value: void 0 },
		delete: { configurable: true, value: void 0 },
		[Symbol.iterator]: {
			configurable: true,
			writable: true,
			value: LazyLoadingRuleMap.prototype.entries,
		},
	});

	lazyLoadingRuleMap = { LazyLoadingRuleMap };
	return lazyLoadingRuleMap;
}

var astUtils = {exports: {}};

var utils = {};

var ast = {exports: {}};

/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredAst;

function requireAst () {
	if (hasRequiredAst) return ast.exports;
	hasRequiredAst = 1;
	(function () {

	    function isExpression(node) {
	        if (node == null) { return false; }
	        switch (node.type) {
	            case 'ArrayExpression':
	            case 'AssignmentExpression':
	            case 'BinaryExpression':
	            case 'CallExpression':
	            case 'ConditionalExpression':
	            case 'FunctionExpression':
	            case 'Identifier':
	            case 'Literal':
	            case 'LogicalExpression':
	            case 'MemberExpression':
	            case 'NewExpression':
	            case 'ObjectExpression':
	            case 'SequenceExpression':
	            case 'ThisExpression':
	            case 'UnaryExpression':
	            case 'UpdateExpression':
	                return true;
	        }
	        return false;
	    }

	    function isIterationStatement(node) {
	        if (node == null) { return false; }
	        switch (node.type) {
	            case 'DoWhileStatement':
	            case 'ForInStatement':
	            case 'ForStatement':
	            case 'WhileStatement':
	                return true;
	        }
	        return false;
	    }

	    function isStatement(node) {
	        if (node == null) { return false; }
	        switch (node.type) {
	            case 'BlockStatement':
	            case 'BreakStatement':
	            case 'ContinueStatement':
	            case 'DebuggerStatement':
	            case 'DoWhileStatement':
	            case 'EmptyStatement':
	            case 'ExpressionStatement':
	            case 'ForInStatement':
	            case 'ForStatement':
	            case 'IfStatement':
	            case 'LabeledStatement':
	            case 'ReturnStatement':
	            case 'SwitchStatement':
	            case 'ThrowStatement':
	            case 'TryStatement':
	            case 'VariableDeclaration':
	            case 'WhileStatement':
	            case 'WithStatement':
	                return true;
	        }
	        return false;
	    }

	    function isSourceElement(node) {
	      return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
	    }

	    function trailingStatement(node) {
	        switch (node.type) {
	        case 'IfStatement':
	            if (node.alternate != null) {
	                return node.alternate;
	            }
	            return node.consequent;

	        case 'LabeledStatement':
	        case 'ForStatement':
	        case 'ForInStatement':
	        case 'WhileStatement':
	        case 'WithStatement':
	            return node.body;
	        }
	        return null;
	    }

	    function isProblematicIfStatement(node) {
	        var current;

	        if (node.type !== 'IfStatement') {
	            return false;
	        }
	        if (node.alternate == null) {
	            return false;
	        }
	        current = node.consequent;
	        do {
	            if (current.type === 'IfStatement') {
	                if (current.alternate == null)  {
	                    return true;
	                }
	            }
	            current = trailingStatement(current);
	        } while (current);

	        return false;
	    }

	    ast.exports = {
	        isExpression: isExpression,
	        isStatement: isStatement,
	        isIterationStatement: isIterationStatement,
	        isSourceElement: isSourceElement,
	        isProblematicIfStatement: isProblematicIfStatement,

	        trailingStatement: trailingStatement
	    };
	}());
	/* vim: set sw=4 ts=4 et tw=80 : */
	return ast.exports;
}

var code = {exports: {}};

/*
  Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredCode;

function requireCode () {
	if (hasRequiredCode) return code.exports;
	hasRequiredCode = 1;
	(function () {

	    var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;

	    // See `tools/generate-identifier-regex.js`.
	    ES5Regex = {
	        // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:
	        NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
	        // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:
	        NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
	    };

	    ES6Regex = {
	        // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:
	        NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
	        // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:
	        NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
	    };

	    function isDecimalDigit(ch) {
	        return 0x30 <= ch && ch <= 0x39;  // 0..9
	    }

	    function isHexDigit(ch) {
	        return 0x30 <= ch && ch <= 0x39 ||  // 0..9
	            0x61 <= ch && ch <= 0x66 ||     // a..f
	            0x41 <= ch && ch <= 0x46;       // A..F
	    }

	    function isOctalDigit(ch) {
	        return ch >= 0x30 && ch <= 0x37;  // 0..7
	    }

	    // 7.2 White Space

	    NON_ASCII_WHITESPACES = [
	        0x1680,
	        0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,
	        0x202F, 0x205F,
	        0x3000,
	        0xFEFF
	    ];

	    function isWhiteSpace(ch) {
	        return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||
	            ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
	    }

	    // 7.3 Line Terminators

	    function isLineTerminator(ch) {
	        return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
	    }

	    // 7.6 Identifier Names and Identifiers

	    function fromCodePoint(cp) {
	        if (cp <= 0xFFFF) { return String.fromCharCode(cp); }
	        var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
	        var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);
	        return cu1 + cu2;
	    }

	    IDENTIFIER_START = new Array(0x80);
	    for(ch = 0; ch < 0x80; ++ch) {
	        IDENTIFIER_START[ch] =
	            ch >= 0x61 && ch <= 0x7A ||  // a..z
	            ch >= 0x41 && ch <= 0x5A ||  // A..Z
	            ch === 0x24 || ch === 0x5F;  // $ (dollar) and _ (underscore)
	    }

	    IDENTIFIER_PART = new Array(0x80);
	    for(ch = 0; ch < 0x80; ++ch) {
	        IDENTIFIER_PART[ch] =
	            ch >= 0x61 && ch <= 0x7A ||  // a..z
	            ch >= 0x41 && ch <= 0x5A ||  // A..Z
	            ch >= 0x30 && ch <= 0x39 ||  // 0..9
	            ch === 0x24 || ch === 0x5F;  // $ (dollar) and _ (underscore)
	    }

	    function isIdentifierStartES5(ch) {
	        return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
	    }

	    function isIdentifierPartES5(ch) {
	        return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
	    }

	    function isIdentifierStartES6(ch) {
	        return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
	    }

	    function isIdentifierPartES6(ch) {
	        return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
	    }

	    code.exports = {
	        isDecimalDigit: isDecimalDigit,
	        isHexDigit: isHexDigit,
	        isOctalDigit: isOctalDigit,
	        isWhiteSpace: isWhiteSpace,
	        isLineTerminator: isLineTerminator,
	        isIdentifierStartES5: isIdentifierStartES5,
	        isIdentifierPartES5: isIdentifierPartES5,
	        isIdentifierStartES6: isIdentifierStartES6,
	        isIdentifierPartES6: isIdentifierPartES6
	    };
	}());
	/* vim: set sw=4 ts=4 et tw=80 : */
	return code.exports;
}

var keyword = {exports: {}};

/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredKeyword;

function requireKeyword () {
	if (hasRequiredKeyword) return keyword.exports;
	hasRequiredKeyword = 1;
	(function () {

	    var code = requireCode();

	    function isStrictModeReservedWordES6(id) {
	        switch (id) {
	        case 'implements':
	        case 'interface':
	        case 'package':
	        case 'private':
	        case 'protected':
	        case 'public':
	        case 'static':
	        case 'let':
	            return true;
	        default:
	            return false;
	        }
	    }

	    function isKeywordES5(id, strict) {
	        // yield should not be treated as keyword under non-strict mode.
	        if (!strict && id === 'yield') {
	            return false;
	        }
	        return isKeywordES6(id, strict);
	    }

	    function isKeywordES6(id, strict) {
	        if (strict && isStrictModeReservedWordES6(id)) {
	            return true;
	        }

	        switch (id.length) {
	        case 2:
	            return (id === 'if') || (id === 'in') || (id === 'do');
	        case 3:
	            return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
	        case 4:
	            return (id === 'this') || (id === 'else') || (id === 'case') ||
	                (id === 'void') || (id === 'with') || (id === 'enum');
	        case 5:
	            return (id === 'while') || (id === 'break') || (id === 'catch') ||
	                (id === 'throw') || (id === 'const') || (id === 'yield') ||
	                (id === 'class') || (id === 'super');
	        case 6:
	            return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
	                (id === 'switch') || (id === 'export') || (id === 'import');
	        case 7:
	            return (id === 'default') || (id === 'finally') || (id === 'extends');
	        case 8:
	            return (id === 'function') || (id === 'continue') || (id === 'debugger');
	        case 10:
	            return (id === 'instanceof');
	        default:
	            return false;
	        }
	    }

	    function isReservedWordES5(id, strict) {
	        return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
	    }

	    function isReservedWordES6(id, strict) {
	        return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
	    }

	    function isRestrictedWord(id) {
	        return id === 'eval' || id === 'arguments';
	    }

	    function isIdentifierNameES5(id) {
	        var i, iz, ch;

	        if (id.length === 0) { return false; }

	        ch = id.charCodeAt(0);
	        if (!code.isIdentifierStartES5(ch)) {
	            return false;
	        }

	        for (i = 1, iz = id.length; i < iz; ++i) {
	            ch = id.charCodeAt(i);
	            if (!code.isIdentifierPartES5(ch)) {
	                return false;
	            }
	        }
	        return true;
	    }

	    function decodeUtf16(lead, trail) {
	        return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
	    }

	    function isIdentifierNameES6(id) {
	        var i, iz, ch, lowCh, check;

	        if (id.length === 0) { return false; }

	        check = code.isIdentifierStartES6;
	        for (i = 0, iz = id.length; i < iz; ++i) {
	            ch = id.charCodeAt(i);
	            if (0xD800 <= ch && ch <= 0xDBFF) {
	                ++i;
	                if (i >= iz) { return false; }
	                lowCh = id.charCodeAt(i);
	                if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
	                    return false;
	                }
	                ch = decodeUtf16(ch, lowCh);
	            }
	            if (!check(ch)) {
	                return false;
	            }
	            check = code.isIdentifierPartES6;
	        }
	        return true;
	    }

	    function isIdentifierES5(id, strict) {
	        return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
	    }

	    function isIdentifierES6(id, strict) {
	        return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
	    }

	    keyword.exports = {
	        isKeywordES5: isKeywordES5,
	        isKeywordES6: isKeywordES6,
	        isReservedWordES5: isReservedWordES5,
	        isReservedWordES6: isReservedWordES6,
	        isRestrictedWord: isRestrictedWord,
	        isIdentifierNameES5: isIdentifierNameES5,
	        isIdentifierNameES6: isIdentifierNameES6,
	        isIdentifierES5: isIdentifierES5,
	        isIdentifierES6: isIdentifierES6
	    };
	}());
	/* vim: set sw=4 ts=4 et tw=80 : */
	return keyword.exports;
}

/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var hasRequiredUtils;

function requireUtils () {
	if (hasRequiredUtils) return utils;
	hasRequiredUtils = 1;
	(function () {

	    utils.ast = requireAst();
	    utils.code = requireCode();
	    utils.keyword = requireKeyword();
	}());
	/* vim: set sw=4 ts=4 et tw=80 : */
	return utils;
}

/**
 * @fileoverview Configuration related to ECMAScript versions
 * @author Milos Djermanovic
 */

var ecmaVersion;
var hasRequiredEcmaVersion;

function requireEcmaVersion () {
	if (hasRequiredEcmaVersion) return ecmaVersion;
	hasRequiredEcmaVersion = 1;

	/**
	 * The latest ECMAScript version supported by ESLint.
	 * @type {number} year-based ECMAScript version
	 */
	const LATEST_ECMA_VERSION = 2025;

	ecmaVersion = {
		LATEST_ECMA_VERSION,
	};
	return ecmaVersion;
}

/**
 * @fileoverview Common utils for AST.
 * @author Gyandeep Singh
 */

var hasRequiredAstUtils;

function requireAstUtils () {
	if (hasRequiredAstUtils) return astUtils.exports;
	hasRequiredAstUtils = 1;
	(function (module) {

		//------------------------------------------------------------------------------
		// Requirements
		//------------------------------------------------------------------------------

		const { KEYS: eslintVisitorKeys } = requireEslintVisitorKeys$2();
		const esutils = requireUtils();
		const espree = requireEspree();
		const escapeRegExp = requireEscapeStringRegexp();
		const {
			breakableTypePattern,
			createGlobalLinebreakMatcher,
			lineBreakPattern,
			shebangPattern,
		} = requireAstUtils$1();
		const globals = requireGlobals();
		const { LATEST_ECMA_VERSION } = requireEcmaVersion();

		//------------------------------------------------------------------------------
		// Helpers
		//------------------------------------------------------------------------------

		const anyFunctionPattern =
			/^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u;
		const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u;
		const arrayMethodWithThisArgPattern =
			/^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|some)$/u;
		const arrayOrTypedArrayPattern = /Array$/u;
		const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u;
		const thisTagPattern = /^[\s*]*@this/mu;

		const COMMENTS_IGNORE_PATTERN =
			/^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u;
		const ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u;
		const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]);

		// A set of node types that can contain a list of statements
		const STATEMENT_LIST_PARENTS = new Set([
			"Program",
			"BlockStatement",
			"StaticBlock",
			"SwitchCase",
		]);

		const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;

		// Tests the presence of at least one LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence in a raw string
		const OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN =
			/^(?:[^\\]|\\.)*\\(?:[1-9]|0[0-9])/su;

		const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]);

		/**
		 * All builtin global variables defined in the latest ECMAScript specification.
		 * @type {Record<string,boolean>} Key is the name of the variable. Value is `true` if the variable is considered writable, `false` otherwise.
		 */
		const ECMASCRIPT_GLOBALS = globals[`es${LATEST_ECMA_VERSION}`];

		/**
		 * Checks reference if is non initializer and writable.
		 * @param {Reference} reference A reference to check.
		 * @param {int} index The index of the reference in the references.
		 * @param {Reference[]} references The array that the reference belongs to.
		 * @returns {boolean} Success/Failure
		 * @private
		 */
		function isModifyingReference(reference, index, references) {
			const identifier = reference.identifier;

			/*
			 * Destructuring assignments can have multiple default value, so
			 * possibly there are multiple writeable references for the same
			 * identifier.
			 */
			const modifyingDifferentIdentifier =
				index === 0 || references[index - 1].identifier !== identifier;

			return (
				identifier &&
				reference.init === false &&
				reference.isWrite() &&
				modifyingDifferentIdentifier
			);
		}

		/**
		 * Checks whether the given string starts with uppercase or not.
		 * @param {string} s The string to check.
		 * @returns {boolean} `true` if the string starts with uppercase.
		 */
		function startsWithUpperCase(s) {
			return s[0] !== s[0].toLocaleLowerCase();
		}

		/**
		 * Checks whether or not a node is a constructor.
		 * @param {ASTNode} node A function node to check.
		 * @returns {boolean} Whether or not a node is a constructor.
		 */
		function isES5Constructor(node) {
			return node.id && startsWithUpperCase(node.id.name);
		}

		/**
		 * Finds a function node from ancestors of a node.
		 * @param {ASTNode} node A start node to find.
		 * @returns {Node|null} A found function node.
		 */
		function getUpperFunction(node) {
			for (
				let currentNode = node;
				currentNode;
				currentNode = currentNode.parent
			) {
				if (anyFunctionPattern.test(currentNode.type)) {
					return currentNode;
				}
			}
			return null;
		}

		/**
		 * Checks whether a given node is a function node or not.
		 * The following types are function nodes:
		 *
		 * - ArrowFunctionExpression
		 * - FunctionDeclaration
		 * - FunctionExpression
		 * @param {ASTNode|null} node A node to check.
		 * @returns {boolean} `true` if the node is a function node.
		 */
		function isFunction(node) {
			return Boolean(node && anyFunctionPattern.test(node.type));
		}

		/**
		 * Checks whether a given node is a loop node or not.
		 * The following types are loop nodes:
		 *
		 * - DoWhileStatement
		 * - ForInStatement
		 * - ForOfStatement
		 * - ForStatement
		 * - WhileStatement
		 * @param {ASTNode|null} node A node to check.
		 * @returns {boolean} `true` if the node is a loop node.
		 */
		function isLoop(node) {
			return Boolean(node && anyLoopPattern.test(node.type));
		}

		/**
		 * Checks whether the given node is in a loop or not.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is in a loop.
		 */
		function isInLoop(node) {
			for (
				let currentNode = node;
				currentNode && !isFunction(currentNode);
				currentNode = currentNode.parent
			) {
				if (isLoop(currentNode)) {
					return true;
				}
			}

			return false;
		}

		/**
		 * Determines whether the given node is a `null` literal.
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} `true` if the node is a `null` literal
		 */
		function isNullLiteral(node) {
			/*
			 * Checking `node.value === null` does not guarantee that a literal is a null literal.
			 * When parsing values that cannot be represented in the current environment (e.g. unicode
			 * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to
			 * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check
			 * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020
			 */
			return (
				node.type === "Literal" &&
				node.value === null &&
				!node.regex &&
				!node.bigint
			);
		}

		/**
		 * Checks whether or not a node is `null` or `undefined`.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is a `null` or `undefined`.
		 * @public
		 */
		function isNullOrUndefined(node) {
			return (
				isNullLiteral(node) ||
				(node.type === "Identifier" && node.name === "undefined") ||
				(node.type === "UnaryExpression" && node.operator === "void")
			);
		}

		/**
		 * Checks whether or not a node is callee.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is callee.
		 */
		function isCallee(node) {
			return node.parent.type === "CallExpression" && node.parent.callee === node;
		}

		/**
		 * Returns the result of the string conversion applied to the evaluated value of the given expression node,
		 * if it can be determined statically.
		 *
		 * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only.
		 * In all other cases, this function returns `null`.
		 * @param {ASTNode} node Expression node.
		 * @returns {string|null} String value if it can be determined. Otherwise, `null`.
		 */
		function getStaticStringValue(node) {
			switch (node.type) {
				case "Literal":
					if (node.value === null) {
						if (isNullLiteral(node)) {
							return String(node.value); // "null"
						}
						if (node.regex) {
							return `/${node.regex.pattern}/${node.regex.flags}`;
						}
						if (node.bigint) {
							return node.bigint;
						}

						// Otherwise, this is an unknown literal. The function will return null.
					} else {
						return String(node.value);
					}
					break;
				case "TemplateLiteral":
					if (node.expressions.length === 0 && node.quasis.length === 1) {
						return node.quasis[0].value.cooked;
					}
					break;

				// no default
			}

			return null;
		}

		/**
		 * Gets the property name of a given node.
		 * The node can be a MemberExpression, a Property, or a MethodDefinition.
		 *
		 * If the name is dynamic, this returns `null`.
		 *
		 * For examples:
		 *
		 *     a.b           // => "b"
		 *     a["b"]        // => "b"
		 *     a['b']        // => "b"
		 *     a[`b`]        // => "b"
		 *     a[100]        // => "100"
		 *     a[b]          // => null
		 *     a["a" + "b"]  // => null
		 *     a[tag`b`]     // => null
		 *     a[`${b}`]     // => null
		 *
		 *     let a = {b: 1}            // => "b"
		 *     let a = {["b"]: 1}        // => "b"
		 *     let a = {['b']: 1}        // => "b"
		 *     let a = {[`b`]: 1}        // => "b"
		 *     let a = {[100]: 1}        // => "100"
		 *     let a = {[b]: 1}          // => null
		 *     let a = {["a" + "b"]: 1}  // => null
		 *     let a = {[tag`b`]: 1}     // => null
		 *     let a = {[`${b}`]: 1}     // => null
		 * @param {ASTNode} node The node to get.
		 * @returns {string|null} The property name if static. Otherwise, null.
		 */
		function getStaticPropertyName(node) {
			let prop;

			switch (node && node.type) {
				case "ChainExpression":
					return getStaticPropertyName(node.expression);

				case "Property":
				case "PropertyDefinition":
				case "MethodDefinition":
					prop = node.key;
					break;

				case "MemberExpression":
					prop = node.property;
					break;

				// no default
			}

			if (prop) {
				if (prop.type === "Identifier" && !node.computed) {
					return prop.name;
				}

				return getStaticStringValue(prop);
			}

			return null;
		}

		/**
		 * Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it.
		 * @param {ASTNode} node The node to address.
		 * @returns {ASTNode} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node.
		 */
		function skipChainExpression(node) {
			return node && node.type === "ChainExpression" ? node.expression : node;
		}

		/**
		 * Check if the `actual` is an expected value.
		 * @param {string} actual The string value to check.
		 * @param {string | RegExp} expected The expected string value or pattern.
		 * @returns {boolean} `true` if the `actual` is an expected value.
		 */
		function checkText(actual, expected) {
			return typeof expected === "string"
				? actual === expected
				: expected.test(actual);
		}

		/**
		 * Check if a given node is an Identifier node with a given name.
		 * @param {ASTNode} node The node to check.
		 * @param {string | RegExp} name The expected name or the expected pattern of the object name.
		 * @returns {boolean} `true` if the node is an Identifier node with the name.
		 */
		function isSpecificId(node, name) {
			return node.type === "Identifier" && checkText(node.name, name);
		}

		/**
		 * Check if a given node is member access with a given object name and property name pair.
		 * This is regardless of optional or not.
		 * @param {ASTNode} node The node to check.
		 * @param {string | RegExp | null} objectName The expected name or the expected pattern of the object name. If this is nullish, this method doesn't check object.
		 * @param {string | RegExp | null} propertyName The expected name or the expected pattern of the property name. If this is nullish, this method doesn't check property.
		 * @returns {boolean} `true` if the node is member access with the object name and property name pair.
		 * The node is a `MemberExpression` or `ChainExpression`.
		 */
		function isSpecificMemberAccess(node, objectName, propertyName) {
			const checkNode = skipChainExpression(node);

			if (checkNode.type !== "MemberExpression") {
				return false;
			}

			if (objectName && !isSpecificId(checkNode.object, objectName)) {
				return false;
			}

			if (propertyName) {
				const actualPropertyName = getStaticPropertyName(checkNode);

				if (
					typeof actualPropertyName !== "string" ||
					!checkText(actualPropertyName, propertyName)
				) {
					return false;
				}
			}

			return true;
		}

		/**
		 * Check if two literal nodes are the same value.
		 * @param {ASTNode} left The Literal node to compare.
		 * @param {ASTNode} right The other Literal node to compare.
		 * @returns {boolean} `true` if the two literal nodes are the same value.
		 */
		function equalLiteralValue(left, right) {
			// RegExp literal.
			if (left.regex || right.regex) {
				return Boolean(
					left.regex &&
						right.regex &&
						left.regex.pattern === right.regex.pattern &&
						left.regex.flags === right.regex.flags,
				);
			}

			// BigInt literal.
			if (left.bigint || right.bigint) {
				return left.bigint === right.bigint;
			}

			return left.value === right.value;
		}

		/**
		 * Check if two expressions reference the same value. For example:
		 *     a = a
		 *     a.b = a.b
		 *     a[0] = a[0]
		 *     a['b'] = a['b']
		 * @param {ASTNode} left The left side of the comparison.
		 * @param {ASTNode} right The right side of the comparison.
		 * @param {boolean} [disableStaticComputedKey] Don't address `a.b` and `a["b"]` are the same if `true`. For backward compatibility.
		 * @returns {boolean} `true` if both sides match and reference the same value.
		 */
		function isSameReference(left, right, disableStaticComputedKey = false) {
			if (left.type !== right.type) {
				// Handle `a.b` and `a?.b` are samely.
				if (left.type === "ChainExpression") {
					return isSameReference(
						left.expression,
						right,
						disableStaticComputedKey,
					);
				}
				if (right.type === "ChainExpression") {
					return isSameReference(
						left,
						right.expression,
						disableStaticComputedKey,
					);
				}

				return false;
			}

			switch (left.type) {
				case "Super":
				case "ThisExpression":
					return true;

				case "Identifier":
				case "PrivateIdentifier":
					return left.name === right.name;
				case "Literal":
					return equalLiteralValue(left, right);

				case "ChainExpression":
					return isSameReference(
						left.expression,
						right.expression,
						disableStaticComputedKey,
					);

				case "MemberExpression": {
					if (!disableStaticComputedKey) {
						const nameA = getStaticPropertyName(left);

						// x.y = x["y"]
						if (nameA !== null) {
							return (
								isSameReference(
									left.object,
									right.object,
									disableStaticComputedKey,
								) && nameA === getStaticPropertyName(right)
							);
						}
					}

					/*
					 * x[0] = x[0]
					 * x[y] = x[y]
					 * x.y = x.y
					 */
					return (
						left.computed === right.computed &&
						isSameReference(
							left.object,
							right.object,
							disableStaticComputedKey,
						) &&
						isSameReference(
							left.property,
							right.property,
							disableStaticComputedKey,
						)
					);
				}

				default:
					return false;
			}
		}

		/**
		 * Checks whether or not a node is `Reflect.apply`.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is a `Reflect.apply`.
		 */
		function isReflectApply(node) {
			return isSpecificMemberAccess(node, "Reflect", "apply");
		}

		/**
		 * Checks whether or not a node is `Array.from`.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is a `Array.from`.
		 */
		function isArrayFromMethod(node) {
			return isSpecificMemberAccess(node, arrayOrTypedArrayPattern, "from");
		}

		/**
		 * Checks whether or not a node is a method which expects a function as a first argument, and `thisArg` as a second argument.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is a method which expects a function as a first argument, and `thisArg` as a second argument.
		 */
		function isMethodWhichHasThisArg(node) {
			return isSpecificMemberAccess(node, null, arrayMethodWithThisArgPattern);
		}

		/**
		 * Creates the negate function of the given function.
		 * @param {Function} f The function to negate.
		 * @returns {Function} Negated function.
		 */
		function negate(f) {
			return token => !f(token);
		}

		/**
		 * Checks whether or not a node has a `@this` tag in its comments.
		 * @param {ASTNode} node A node to check.
		 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
		 * @returns {boolean} Whether or not the node has a `@this` tag in its comments.
		 */
		function hasJSDocThisTag(node, sourceCode) {
			const jsdocComment = sourceCode.getJSDocComment(node);

			if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
				return true;
			}

			// Checks `@this` in its leading comments for callbacks,
			// because callbacks don't have its JSDoc comment.
			// e.g.
			//     sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
			return sourceCode
				.getCommentsBefore(node)
				.some(comment => thisTagPattern.test(comment.value));
		}

		/**
		 * Determines if a node is surrounded by parentheses.
		 * @param {SourceCode} sourceCode The ESLint source code object
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is parenthesised.
		 * @private
		 */
		function isParenthesised(sourceCode, node) {
			const previousToken = sourceCode.getTokenBefore(node),
				nextToken = sourceCode.getTokenAfter(node);

			return (
				Boolean(previousToken && nextToken) &&
				previousToken.value === "(" &&
				previousToken.range[1] <= node.range[0] &&
				nextToken.value === ")" &&
				nextToken.range[0] >= node.range[1]
			);
		}

		/**
		 * Checks if the given token is a `=` token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a `=` token.
		 */
		function isEqToken(token) {
			return token.value === "=" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is an arrow token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is an arrow token.
		 */
		function isArrowToken(token) {
			return token.value === "=>" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a comma token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a comma token.
		 */
		function isCommaToken(token) {
			return token.value === "," && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a dot token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a dot token.
		 */
		function isDotToken(token) {
			return token.value === "." && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a `?.` token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a `?.` token.
		 */
		function isQuestionDotToken(token) {
			return token.value === "?." && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a semicolon token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a semicolon token.
		 */
		function isSemicolonToken(token) {
			return token.value === ";" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a colon token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a colon token.
		 */
		function isColonToken(token) {
			return token.value === ":" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is an opening parenthesis token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is an opening parenthesis token.
		 */
		function isOpeningParenToken(token) {
			return token.value === "(" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a closing parenthesis token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a closing parenthesis token.
		 */
		function isClosingParenToken(token) {
			return token.value === ")" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is an opening square bracket token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is an opening square bracket token.
		 */
		function isOpeningBracketToken(token) {
			return token.value === "[" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a closing square bracket token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a closing square bracket token.
		 */
		function isClosingBracketToken(token) {
			return token.value === "]" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is an opening brace token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is an opening brace token.
		 */
		function isOpeningBraceToken(token) {
			return token.value === "{" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a closing brace token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a closing brace token.
		 */
		function isClosingBraceToken(token) {
			return token.value === "}" && token.type === "Punctuator";
		}

		/**
		 * Checks if the given token is a comment token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a comment token.
		 */
		function isCommentToken(token) {
			return (
				token.type === "Line" ||
				token.type === "Block" ||
				token.type === "Shebang"
			);
		}

		/**
		 * Checks if the given token is a keyword token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a keyword token.
		 */
		function isKeywordToken(token) {
			return token.type === "Keyword";
		}

		/**
		 * Gets the `(` token of the given function node.
		 * @param {ASTNode} node The function node to get.
		 * @param {SourceCode} sourceCode The source code object to get tokens.
		 * @returns {Token} `(` token.
		 */
		function getOpeningParenOfParams(node, sourceCode) {
			// If the node is an arrow function and doesn't have parens, this returns the identifier of the first param.
			if (node.type === "ArrowFunctionExpression" && node.params.length === 1) {
				const argToken = sourceCode.getFirstToken(node.params[0]);
				const maybeParenToken = sourceCode.getTokenBefore(argToken);

				return isOpeningParenToken(maybeParenToken)
					? maybeParenToken
					: argToken;
			}

			// Otherwise, returns paren.
			return node.id
				? sourceCode.getTokenAfter(node.id, isOpeningParenToken)
				: sourceCode.getFirstToken(node, isOpeningParenToken);
		}

		/**
		 * Checks whether or not the tokens of two given nodes are same.
		 * @param {ASTNode} left A node 1 to compare.
		 * @param {ASTNode} right A node 2 to compare.
		 * @param {SourceCode} sourceCode The ESLint source code object.
		 * @returns {boolean} the source code for the given node.
		 */
		function equalTokens(left, right, sourceCode) {
			const tokensL = sourceCode.getTokens(left);
			const tokensR = sourceCode.getTokens(right);

			if (tokensL.length !== tokensR.length) {
				return false;
			}
			for (let i = 0; i < tokensL.length; ++i) {
				if (
					tokensL[i].type !== tokensR[i].type ||
					tokensL[i].value !== tokensR[i].value
				) {
					return false;
				}
			}

			return true;
		}

		/**
		 * Check if the given node is a true logical expression or not.
		 *
		 * The three binary expressions logical-or (`||`), logical-and (`&&`), and
		 * coalesce (`??`) are known as `ShortCircuitExpression`.
		 * But ESTree represents those by `LogicalExpression` node.
		 *
		 * This function rejects coalesce expressions of `LogicalExpression` node.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is `&&` or `||`.
		 * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression
		 */
		function isLogicalExpression(node) {
			return (
				node.type === "LogicalExpression" &&
				(node.operator === "&&" || node.operator === "||")
			);
		}

		/**
		 * Check if the given node is a nullish coalescing expression or not.
		 *
		 * The three binary expressions logical-or (`||`), logical-and (`&&`), and
		 * coalesce (`??`) are known as `ShortCircuitExpression`.
		 * But ESTree represents those by `LogicalExpression` node.
		 *
		 * This function finds only coalesce expressions of `LogicalExpression` node.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is `??`.
		 */
		function isCoalesceExpression(node) {
			return node.type === "LogicalExpression" && node.operator === "??";
		}

		/**
		 * Check if given two nodes are the pair of a logical expression and a coalesce expression.
		 * @param {ASTNode} left A node to check.
		 * @param {ASTNode} right Another node to check.
		 * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression.
		 */
		function isMixedLogicalAndCoalesceExpressions(left, right) {
			return (
				(isLogicalExpression(left) && isCoalesceExpression(right)) ||
				(isCoalesceExpression(left) && isLogicalExpression(right))
			);
		}

		/**
		 * Checks if the given operator is a logical assignment operator.
		 * @param {string} operator The operator to check.
		 * @returns {boolean} `true` if the operator is a logical assignment operator.
		 */
		function isLogicalAssignmentOperator(operator) {
			return LOGICAL_ASSIGNMENT_OPERATORS.has(operator);
		}

		/**
		 * Get the colon token of the given SwitchCase node.
		 * @param {ASTNode} node The SwitchCase node to get.
		 * @param {SourceCode} sourceCode The source code object to get tokens.
		 * @returns {Token} The colon token of the node.
		 */
		function getSwitchCaseColonToken(node, sourceCode) {
			if (node.test) {
				return sourceCode.getTokenAfter(node.test, isColonToken);
			}
			return sourceCode.getFirstToken(node, 1);
		}

		/**
		 * Gets ESM module export name represented by the given node.
		 * @param {ASTNode} node `Identifier` or string `Literal` node in a position
		 * that represents a module export name:
		 *   - `ImportSpecifier#imported`
		 *   - `ExportSpecifier#local` (if it is a re-export from another module)
		 *   - `ExportSpecifier#exported`
		 *   - `ExportAllDeclaration#exported`
		 * @returns {string} The module export name.
		 */
		function getModuleExportName(node) {
			if (node.type === "Identifier") {
				return node.name;
			}

			// string literal
			return node.value;
		}

		/**
		 * Returns literal's value converted to the Boolean type
		 * @param {ASTNode} node any `Literal` node
		 * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy,
		 *  `null` when it cannot be determined.
		 */
		function getBooleanValue(node) {
			if (node.value === null) {
				/*
				 * it might be a null literal or bigint/regex literal in unsupported environments .
				 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral
				 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral
				 */

				if (node.raw === "null") {
					return false;
				}

				// regex is always truthy
				if (typeof node.regex === "object") {
					return true;
				}

				return null;
			}

			return !!node.value;
		}

		/**
		 * Checks if a branch node of LogicalExpression short circuits the whole condition
		 * @param {ASTNode} node The branch of main condition which needs to be checked
		 * @param {string} operator The operator of the main LogicalExpression.
		 * @returns {boolean} true when condition short circuits whole condition
		 */
		function isLogicalIdentity(node, operator) {
			switch (node.type) {
				case "Literal":
					return (
						(operator === "||" && getBooleanValue(node) === true) ||
						(operator === "&&" && getBooleanValue(node) === false)
					);

				case "UnaryExpression":
					return operator === "&&" && node.operator === "void";

				case "LogicalExpression":
					/*
					 * handles `a && false || b`
					 * `false` is an identity element of `&&` but not `||`
					 */
					return (
						operator === node.operator &&
						(isLogicalIdentity(node.left, operator) ||
							isLogicalIdentity(node.right, operator))
					);

				case "AssignmentExpression":
					return (
						["||=", "&&="].includes(node.operator) &&
						operator === node.operator.slice(0, -1) &&
						isLogicalIdentity(node.right, operator)
					);

				// no default
			}
			return false;
		}

		/**
		 * Checks if an identifier is a reference to a global variable.
		 * @param {Scope} scope The scope in which the identifier is referenced.
		 * @param {ASTNode} node An identifier node to check.
		 * @returns {boolean} `true` if the identifier is a reference to a global variable.
		 */
		function isReferenceToGlobalVariable(scope, node) {
			const reference = scope.references.find(ref => ref.identifier === node);

			return Boolean(
				reference &&
					reference.resolved &&
					reference.resolved.scope.type === "global" &&
					reference.resolved.defs.length === 0,
			);
		}

		/**
		 * Checks if a  node has a constant truthiness value.
		 * @param {Scope} scope Scope in which the node appears.
		 * @param {ASTNode} node The AST node to check.
		 * @param {boolean} inBooleanPosition `true` if checking the test of a
		 * condition. `false` in all other cases. When `false`, checks if -- for
		 * both string and number -- if coerced to that type, the value will
		 * be constant.
		 * @returns {boolean} true when node's truthiness is constant
		 * @private
		 */
		function isConstant(scope, node, inBooleanPosition) {
			// node.elements can return null values in the case of sparse arrays ex. [,]
			if (!node) {
				return true;
			}
			switch (node.type) {
				case "Literal":
				case "ArrowFunctionExpression":
				case "FunctionExpression":
					return true;
				case "ClassExpression":
				case "ObjectExpression":
					/**
					 * In theory objects like:
					 *
					 * `{toString: () => a}`
					 * `{valueOf: () => a}`
					 *
					 * Or a classes like:
					 *
					 * `class { static toString() { return a } }`
					 * `class { static valueOf() { return a } }`
					 *
					 * Are not constant verifiably when `inBooleanPosition` is
					 * false, but it's an edge case we've opted not to handle.
					 */
					return true;
				case "TemplateLiteral":
					return (
						(inBooleanPosition &&
							node.quasis.some(quasi => quasi.value.cooked.length)) ||
						node.expressions.every(exp => isConstant(scope, exp, false))
					);

				case "ArrayExpression": {
					if (!inBooleanPosition) {
						return node.elements.every(element =>
							isConstant(scope, element, false),
						);
					}
					return true;
				}

				case "UnaryExpression":
					if (
						node.operator === "void" ||
						(node.operator === "typeof" && inBooleanPosition)
					) {
						return true;
					}

					if (node.operator === "!") {
						return isConstant(scope, node.argument, true);
					}

					return isConstant(scope, node.argument, false);

				case "BinaryExpression":
					return (
						isConstant(scope, node.left, false) &&
						isConstant(scope, node.right, false) &&
						node.operator !== "in"
					);

				case "LogicalExpression": {
					const isLeftConstant = isConstant(
						scope,
						node.left,
						inBooleanPosition,
					);
					const isRightConstant = isConstant(
						scope,
						node.right,
						inBooleanPosition,
					);
					const isLeftShortCircuit =
						isLeftConstant && isLogicalIdentity(node.left, node.operator);
					const isRightShortCircuit =
						inBooleanPosition &&
						isRightConstant &&
						isLogicalIdentity(node.right, node.operator);

					return (
						(isLeftConstant && isRightConstant) ||
						isLeftShortCircuit ||
						isRightShortCircuit
					);
				}
				case "NewExpression":
					return inBooleanPosition;
				case "AssignmentExpression":
					if (node.operator === "=") {
						return isConstant(scope, node.right, inBooleanPosition);
					}

					if (["||=", "&&="].includes(node.operator) && inBooleanPosition) {
						return isLogicalIdentity(
							node.right,
							node.operator.slice(0, -1),
						);
					}

					return false;

				case "SequenceExpression":
					return isConstant(
						scope,
						node.expressions.at(-1),
						inBooleanPosition,
					);
				case "SpreadElement":
					return isConstant(scope, node.argument, inBooleanPosition);
				case "CallExpression":
					if (
						node.callee.type === "Identifier" &&
						node.callee.name === "Boolean"
					) {
						if (
							node.arguments.length === 0 ||
							isConstant(scope, node.arguments[0], true)
						) {
							return isReferenceToGlobalVariable(scope, node.callee);
						}
					}
					return false;
				case "Identifier":
					return (
						node.name === "undefined" &&
						isReferenceToGlobalVariable(scope, node)
					);

				// no default
			}
			return false;
		}

		/**
		 * Checks whether a node is an ExpressionStatement at the top level of a file or function body.
		 * A top-level ExpressionStatement node is a directive if it contains a single unparenthesized
		 * string literal and if it occurs either as the first sibling or immediately after another
		 * directive.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether or not the node is an ExpressionStatement at the top level of a
		 * file or function body.
		 */
		function isTopLevelExpressionStatement(node) {
			if (node.type !== "ExpressionStatement") {
				return false;
			}
			const parent = node.parent;

			return (
				parent.type === "Program" ||
				(parent.type === "BlockStatement" && isFunction(parent.parent))
			);
		}

		/**
		 * Check whether the given node is a part of a directive prologue or not.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is a part of directive prologue.
		 */
		function isDirective(node) {
			return (
				node.type === "ExpressionStatement" &&
				typeof node.directive === "string"
			);
		}

		/**
		 * Tests if a node appears at the beginning of an ancestor ExpressionStatement node.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether the node appears at the beginning of an ancestor ExpressionStatement node.
		 */
		function isStartOfExpressionStatement(node) {
			const start = node.range[0];
			let ancestor = node;

			while ((ancestor = ancestor.parent) && ancestor.range[0] === start) {
				if (ancestor.type === "ExpressionStatement") {
					return true;
				}
			}
			return false;
		}

		/**
		 * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon.
		 * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition` or at
		 * the start of the body of an `ArrowFunctionExpression`.
		 * @type {(sourceCode: SourceCode, node: ASTNode) => boolean}
		 * @param {SourceCode} sourceCode The source code object.
		 * @param {ASTNode} node A node at the position where an opening parenthesis or bracket will be inserted.
		 * @returns {boolean} Whether a semicolon is required before the opening parenthesis or bracket.
		 */
		let needsPrecedingSemicolon;

		{
			const BREAK_OR_CONTINUE = new Set(["BreakStatement", "ContinueStatement"]);

			// Declaration types that cannot be continued by a punctuator when ending with a string Literal that is a direct child.
			const DECLARATIONS = new Set([
				"ExportAllDeclaration",
				"ExportNamedDeclaration",
				"ImportDeclaration",
			]);

			const IDENTIFIER_OR_KEYWORD = new Set(["Identifier", "Keyword"]);

			// Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types.
			const NODE_TYPES_BY_KEYWORD = {
				__proto__: null,
				break: "BreakStatement",
				continue: "ContinueStatement",
				debugger: "DebuggerStatement",
				do: "DoWhileStatement",
				else: "IfStatement",
				return: "ReturnStatement",
				yield: "YieldExpression",
			};

			/*
			 * Before an opening parenthesis, postfix `++` and `--` always trigger ASI;
			 * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement.
			 */
			const PUNCTUATORS = new Set([":", ";", "{", "=>", "++", "--"]);

			/*
			 * Statements that can contain an `ExpressionStatement` after a closing parenthesis.
			 * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis.
			 */
			const STATEMENTS = new Set([
				"DoWhileStatement",
				"ForInStatement",
				"ForOfStatement",
				"ForStatement",
				"IfStatement",
				"WhileStatement",
				"WithStatement",
			]);

			needsPrecedingSemicolon = function (sourceCode, node) {
				const prevToken = sourceCode.getTokenBefore(node);

				if (
					!prevToken ||
					(prevToken.type === "Punctuator" &&
						PUNCTUATORS.has(prevToken.value))
				) {
					return false;
				}

				const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]);

				if (isClosingParenToken(prevToken)) {
					return !STATEMENTS.has(prevNode.type);
				}

				if (isClosingBraceToken(prevToken)) {
					return (
						(prevNode.type === "BlockStatement" &&
							prevNode.parent.type === "FunctionExpression" &&
							prevNode.parent.parent.type !== "MethodDefinition") ||
						(prevNode.type === "ClassBody" &&
							prevNode.parent.type === "ClassExpression") ||
						prevNode.type === "ObjectExpression"
					);
				}

				if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) {
					if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) {
						return false;
					}

					const keyword = prevToken.value;
					const nodeType = NODE_TYPES_BY_KEYWORD[keyword];

					return prevNode.type !== nodeType;
				}

				if (prevToken.type === "String") {
					return !DECLARATIONS.has(prevNode.parent.type);
				}

				return true;
			};
		}

		/**
		 * Checks if a node is used as an import attribute key, either in a static or dynamic import.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether the node is used as an import attribute key.
		 */
		function isImportAttributeKey(node) {
			const { parent } = node;

			// static import/re-export
			if (parent.type === "ImportAttribute" && parent.key === node) {
				return true;
			}

			// dynamic import
			if (
				parent.type === "Property" &&
				!parent.computed &&
				(parent.key === node ||
					(parent.value === node && parent.shorthand && !parent.method)) &&
				parent.parent.type === "ObjectExpression"
			) {
				const objectExpression = parent.parent;
				const objectExpressionParent = objectExpression.parent;

				if (
					objectExpressionParent.type === "ImportExpression" &&
					objectExpressionParent.options === objectExpression
				) {
					return true;
				}

				// nested key
				if (
					objectExpressionParent.type === "Property" &&
					objectExpressionParent.value === objectExpression
				) {
					return isImportAttributeKey(objectExpressionParent.key);
				}
			}

			return false;
		}

		//------------------------------------------------------------------------------
		// Public Interface
		//------------------------------------------------------------------------------

		module.exports = {
			COMMENTS_IGNORE_PATTERN,
			LINEBREAKS,
			LINEBREAK_MATCHER: lineBreakPattern,
			SHEBANG_MATCHER: shebangPattern,
			STATEMENT_LIST_PARENTS,
			ECMASCRIPT_GLOBALS,

			/**
			 * Determines whether two adjacent tokens are on the same line.
			 * @param {Object} left The left token object.
			 * @param {Object} right The right token object.
			 * @returns {boolean} Whether or not the tokens are on the same line.
			 * @public
			 */
			isTokenOnSameLine(left, right) {
				return left.loc.end.line === right.loc.start.line;
			},

			isNullOrUndefined,
			isCallee,
			isES5Constructor,
			getUpperFunction,
			isFunction,
			isLoop,
			isInLoop,
			isArrayFromMethod,
			isParenthesised,
			createGlobalLinebreakMatcher,
			equalTokens,

			isArrowToken,
			isClosingBraceToken,
			isClosingBracketToken,
			isClosingParenToken,
			isColonToken,
			isCommaToken,
			isCommentToken,
			isDotToken,
			isQuestionDotToken,
			isKeywordToken,
			isNotClosingBraceToken: negate(isClosingBraceToken),
			isNotClosingBracketToken: negate(isClosingBracketToken),
			isNotClosingParenToken: negate(isClosingParenToken),
			isNotColonToken: negate(isColonToken),
			isNotCommaToken: negate(isCommaToken),
			isNotDotToken: negate(isDotToken),
			isNotQuestionDotToken: negate(isQuestionDotToken),
			isNotOpeningBraceToken: negate(isOpeningBraceToken),
			isNotOpeningBracketToken: negate(isOpeningBracketToken),
			isNotOpeningParenToken: negate(isOpeningParenToken),
			isNotSemicolonToken: negate(isSemicolonToken),
			isOpeningBraceToken,
			isOpeningBracketToken,
			isOpeningParenToken,
			isSemicolonToken,
			isEqToken,

			/**
			 * Checks whether or not a given node is a string literal.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} `true` if the node is a string literal.
			 */
			isStringLiteral(node) {
				return (
					(node.type === "Literal" && typeof node.value === "string") ||
					node.type === "TemplateLiteral"
				);
			},

			/**
			 * Checks whether a given node is a breakable statement or not.
			 * The node is breakable if the node is one of the following type:
			 *
			 * - DoWhileStatement
			 * - ForInStatement
			 * - ForOfStatement
			 * - ForStatement
			 * - SwitchStatement
			 * - WhileStatement
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} `true` if the node is breakable.
			 */
			isBreakableStatement(node) {
				return breakableTypePattern.test(node.type);
			},

			/**
			 * Gets references which are non initializer and writable.
			 * @param {Reference[]} references An array of references.
			 * @returns {Reference[]} An array of only references which are non initializer and writable.
			 * @public
			 */
			getModifyingReferences(references) {
				return references.filter(isModifyingReference);
			},

			/**
			 * Validate that a string passed in is surrounded by the specified character
			 * @param {string} val The text to check.
			 * @param {string} character The character to see if it's surrounded by.
			 * @returns {boolean} True if the text is surrounded by the character, false if not.
			 * @private
			 */
			isSurroundedBy(val, character) {
				return val[0] === character && val.at(-1) === character;
			},

			/**
			 * Returns whether the provided node is an ESLint directive comment or not
			 * @param {Line|Block} node The comment token to be checked
			 * @returns {boolean} `true` if the node is an ESLint directive comment
			 */
			isDirectiveComment(node) {
				const comment = node.value.trim();

				return (
					(node.type === "Line" && comment.startsWith("eslint-")) ||
					(node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment))
				);
			},

			/**
			 * Gets the trailing statement of a given node.
			 *
			 *     if (code)
			 *         consequent;
			 *
			 * When taking this `IfStatement`, returns `consequent;` statement.
			 * @param {ASTNode} A node to get.
			 * @returns {ASTNode|null} The trailing statement's node.
			 */
			getTrailingStatement: esutils.ast.trailingStatement,

			/**
			 * Finds the variable by a given name in a given scope and its upper scopes.
			 * @param {eslint-scope.Scope} initScope A scope to start find.
			 * @param {string} name A variable name to find.
			 * @returns {eslint-scope.Variable|null} A found variable or `null`.
			 */
			getVariableByName(initScope, name) {
				let scope = initScope;

				while (scope) {
					const variable = scope.set.get(name);

					if (variable) {
						return variable;
					}

					scope = scope.upper;
				}

				return null;
			},

			/**
			 * Checks whether or not a given function node is the default `this` binding.
			 *
			 * First, this checks the node:
			 *
			 * - The given node is not in `PropertyDefinition#value` position.
			 * - The given node is not `StaticBlock`.
			 * - The function name does not start with uppercase. It's a convention to capitalize the names
			 *   of constructor functions. This check is not performed if `capIsConstructor` is set to `false`.
			 * - The function does not have a JSDoc comment that has a @this tag.
			 *
			 * Next, this checks the location of the node.
			 * If the location is below, this judges `this` is valid.
			 *
			 * - The location is not on an object literal.
			 * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous
			 *   functions only, as the name of the variable is considered to be the name of the function in this case.
			 *   This check is not performed if `capIsConstructor` is set to `false`.
			 * - The location is not on an ES2015 class.
			 * - Its `bind`/`call`/`apply` method is not called directly.
			 * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given.
			 * @param {ASTNode} node A function node to check. It also can be an implicit function, like `StaticBlock`
			 * or any expression that is `PropertyDefinition#value` node.
			 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
			 * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts
			 * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors.
			 * @returns {boolean} The function node is the default `this` binding.
			 */
			isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) {
				/*
				 * Class field initializers are implicit functions, but ESTree doesn't have the AST node of field initializers.
				 * Therefore, A expression node at `PropertyDefinition#value` is a function.
				 * In this case, `this` is always not default binding.
				 */
				if (
					node.parent.type === "PropertyDefinition" &&
					node.parent.value === node
				) {
					return false;
				}

				// Class static blocks are implicit functions. In this case, `this` is always not default binding.
				if (node.type === "StaticBlock") {
					return false;
				}

				if (
					(capIsConstructor && isES5Constructor(node)) ||
					hasJSDocThisTag(node, sourceCode)
				) {
					return false;
				}
				const isAnonymous = node.id === null;
				let currentNode = node;

				while (currentNode) {
					const parent = currentNode.parent;

					switch (parent.type) {
						/*
						 * Looks up the destination.
						 * e.g., obj.foo = nativeFoo || function foo() { ... };
						 */
						case "LogicalExpression":
						case "ConditionalExpression":
						case "ChainExpression":
							currentNode = parent;
							break;

						/*
						 * If the upper function is IIFE, checks the destination of the return value.
						 * e.g.
						 *   obj.foo = (function() {
						 *     // setup...
						 *     return function foo() { ... };
						 *   })();
						 *   obj.foo = (() =>
						 *     function foo() { ... }
						 *   )();
						 */
						case "ReturnStatement": {
							const func = getUpperFunction(parent);

							if (func === null || !isCallee(func)) {
								return true;
							}
							currentNode = func.parent;
							break;
						}
						case "ArrowFunctionExpression":
							if (currentNode !== parent.body || !isCallee(parent)) {
								return true;
							}
							currentNode = parent.parent;
							break;

						/*
						 * e.g.
						 *   var obj = { foo() { ... } };
						 *   var obj = { foo: function() { ... } };
						 *   class A { constructor() { ... } }
						 *   class A { foo() { ... } }
						 *   class A { get foo() { ... } }
						 *   class A { set foo() { ... } }
						 *   class A { static foo() { ... } }
						 *   class A { foo = function() { ... } }
						 */
						case "Property":
						case "PropertyDefinition":
						case "MethodDefinition":
							return parent.value !== currentNode;

						/*
						 * e.g.
						 *   obj.foo = function foo() { ... };
						 *   Foo = function() { ... };
						 *   [obj.foo = function foo() { ... }] = a;
						 *   [Foo = function() { ... }] = a;
						 */
						case "AssignmentExpression":
						case "AssignmentPattern":
							if (parent.left.type === "MemberExpression") {
								return false;
							}
							if (
								capIsConstructor &&
								isAnonymous &&
								parent.left.type === "Identifier" &&
								startsWithUpperCase(parent.left.name)
							) {
								return false;
							}
							return true;

						/*
						 * e.g.
						 *   var Foo = function() { ... };
						 */
						case "VariableDeclarator":
							return !(
								capIsConstructor &&
								isAnonymous &&
								parent.init === currentNode &&
								parent.id.type === "Identifier" &&
								startsWithUpperCase(parent.id.name)
							);

						/*
						 * e.g.
						 *   var foo = function foo() { ... }.bind(obj);
						 *   (function foo() { ... }).call(obj);
						 *   (function foo() { ... }).apply(obj, []);
						 */
						case "MemberExpression":
							if (
								parent.object === currentNode &&
								isSpecificMemberAccess(
									parent,
									null,
									bindOrCallOrApplyPattern,
								)
							) {
								const maybeCalleeNode =
									parent.parent.type === "ChainExpression"
										? parent.parent
										: parent;

								return !(
									isCallee(maybeCalleeNode) &&
									maybeCalleeNode.parent.arguments.length >= 1 &&
									!isNullOrUndefined(
										maybeCalleeNode.parent.arguments[0],
									)
								);
							}
							return true;

						/*
						 * e.g.
						 *   Reflect.apply(function() {}, obj, []);
						 *   Array.from([], function() {}, obj);
						 *   list.forEach(function() {}, obj);
						 */
						case "CallExpression":
							if (isReflectApply(parent.callee)) {
								return (
									parent.arguments.length !== 3 ||
									parent.arguments[0] !== currentNode ||
									isNullOrUndefined(parent.arguments[1])
								);
							}
							if (isArrayFromMethod(parent.callee)) {
								return (
									parent.arguments.length !== 3 ||
									parent.arguments[1] !== currentNode ||
									isNullOrUndefined(parent.arguments[2])
								);
							}
							if (isMethodWhichHasThisArg(parent.callee)) {
								return (
									parent.arguments.length !== 2 ||
									parent.arguments[0] !== currentNode ||
									isNullOrUndefined(parent.arguments[1])
								);
							}
							return true;

						// Otherwise `this` is default.
						default:
							return true;
					}
				}

				/* c8 ignore next */
				return true;
			},

			/**
			 * Get the precedence level based on the node type
			 * @param {ASTNode} node node to evaluate
			 * @returns {int} precedence level
			 * @private
			 */
			getPrecedence(node) {
				switch (node.type) {
					case "SequenceExpression":
						return 0;

					case "AssignmentExpression":
					case "ArrowFunctionExpression":
					case "YieldExpression":
						return 1;

					case "ConditionalExpression":
						return 3;

					case "LogicalExpression":
						switch (node.operator) {
							case "||":
							case "??":
								return 4;
							case "&&":
								return 5;

							// no default
						}

					/* falls through */

					case "BinaryExpression":
						switch (node.operator) {
							case "|":
								return 6;
							case "^":
								return 7;
							case "&":
								return 8;
							case "==":
							case "!=":
							case "===":
							case "!==":
								return 9;
							case "<":
							case "<=":
							case ">":
							case ">=":
							case "in":
							case "instanceof":
								return 10;
							case "<<":
							case ">>":
							case ">>>":
								return 11;
							case "+":
							case "-":
								return 12;
							case "*":
							case "/":
							case "%":
								return 13;
							case "**":
								return 15;

							// no default
						}

					/* falls through */

					case "UnaryExpression":
					case "AwaitExpression":
						return 16;

					case "UpdateExpression":
						return 17;

					case "CallExpression":
					case "ChainExpression":
					case "ImportExpression":
						return 18;

					case "NewExpression":
						return 19;

					default:
						if (node.type in eslintVisitorKeys) {
							return 20;
						}

						/*
						 * if the node is not a standard node that we know about, then assume it has the lowest precedence
						 * this will mean that rules will wrap unknown nodes in parentheses where applicable instead of
						 * unwrapping them and potentially changing the meaning of the code or introducing a syntax error.
						 */
						return -1;
				}
			},

			/**
			 * Checks whether the given node is an empty block node or not.
			 * @param {ASTNode|null} node The node to check.
			 * @returns {boolean} `true` if the node is an empty block.
			 */
			isEmptyBlock(node) {
				return Boolean(
					node && node.type === "BlockStatement" && node.body.length === 0,
				);
			},

			/**
			 * Checks whether the given node is an empty function node or not.
			 * @param {ASTNode|null} node The node to check.
			 * @returns {boolean} `true` if the node is an empty function.
			 */
			isEmptyFunction(node) {
				return isFunction(node) && module.exports.isEmptyBlock(node.body);
			},

			/**
			 * Get directives from directive prologue of a Program or Function node.
			 * @param {ASTNode} node The node to check.
			 * @returns {ASTNode[]} The directives found in the directive prologue.
			 */
			getDirectivePrologue(node) {
				const directives = [];

				// Directive prologues only occur at the top of files or functions.
				if (
					node.type === "Program" ||
					node.type === "FunctionDeclaration" ||
					node.type === "FunctionExpression" ||
					/*
					 * Do not check arrow functions with implicit return.
					 * `() => "use strict";` returns the string `"use strict"`.
					 */
					(node.type === "ArrowFunctionExpression" &&
						node.body.type === "BlockStatement")
				) {
					const statements =
						node.type === "Program" ? node.body : node.body.body;

					for (const statement of statements) {
						if (
							statement.type === "ExpressionStatement" &&
							statement.expression.type === "Literal"
						) {
							directives.push(statement);
						} else {
							break;
						}
					}
				}

				return directives;
			},

			/**
			 * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added
			 * after the node will be parsed as a decimal point, rather than a property-access dot.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if this node is a decimal integer.
			 * @example
			 *
			 * 0         // true
			 * 5         // true
			 * 50        // true
			 * 5_000     // true
			 * 1_234_56  // true
			 * 08        // true
			 * 0192      // true
			 * 5.        // false
			 * .5        // false
			 * 5.0       // false
			 * 5.00_00   // false
			 * 05        // false
			 * 0x5       // false
			 * 0b101     // false
			 * 0b11_01   // false
			 * 0o5       // false
			 * 5e0       // false
			 * 5e1_000   // false
			 * 5n        // false
			 * 1_000n    // false
			 * "5"       // false
			 *
			 */
			isDecimalInteger(node) {
				return (
					node.type === "Literal" &&
					typeof node.value === "number" &&
					DECIMAL_INTEGER_PATTERN.test(node.raw)
				);
			},

			/**
			 * Determines whether this token is a decimal integer numeric token.
			 * This is similar to isDecimalInteger(), but for tokens.
			 * @param {Token} token The token to check.
			 * @returns {boolean} `true` if this token is a decimal integer.
			 */
			isDecimalIntegerNumericToken(token) {
				return (
					token.type === "Numeric" &&
					DECIMAL_INTEGER_PATTERN.test(token.value)
				);
			},

			/**
			 * Gets the name and kind of the given function node.
			 *
			 * - `function foo() {}`  .................... `function 'foo'`
			 * - `(function foo() {})`  .................. `function 'foo'`
			 * - `(function() {})`  ...................... `function`
			 * - `function* foo() {}`  ................... `generator function 'foo'`
			 * - `(function* foo() {})`  ................. `generator function 'foo'`
			 * - `(function*() {})`  ..................... `generator function`
			 * - `() => {}`  ............................. `arrow function`
			 * - `async () => {}`  ....................... `async arrow function`
			 * - `({ foo: function foo() {} })`  ......... `method 'foo'`
			 * - `({ foo: function() {} })`  ............. `method 'foo'`
			 * - `({ ['foo']: function() {} })`  ......... `method 'foo'`
			 * - `({ [foo]: function() {} })`  ........... `method`
			 * - `({ foo() {} })`  ....................... `method 'foo'`
			 * - `({ foo: function* foo() {} })`  ........ `generator method 'foo'`
			 * - `({ foo: function*() {} })`  ............ `generator method 'foo'`
			 * - `({ ['foo']: function*() {} })`  ........ `generator method 'foo'`
			 * - `({ [foo]: function*() {} })`  .......... `generator method`
			 * - `({ *foo() {} })`  ...................... `generator method 'foo'`
			 * - `({ foo: async function foo() {} })`  ... `async method 'foo'`
			 * - `({ foo: async function() {} })`  ....... `async method 'foo'`
			 * - `({ ['foo']: async function() {} })`  ... `async method 'foo'`
			 * - `({ [foo]: async function() {} })`  ..... `async method`
			 * - `({ async foo() {} })`  ................. `async method 'foo'`
			 * - `({ get foo() {} })`  ................... `getter 'foo'`
			 * - `({ set foo(a) {} })`  .................. `setter 'foo'`
			 * - `class A { constructor() {} }`  ......... `constructor`
			 * - `class A { foo() {} }`  ................. `method 'foo'`
			 * - `class A { *foo() {} }`  ................ `generator method 'foo'`
			 * - `class A { async foo() {} }`  ........... `async method 'foo'`
			 * - `class A { ['foo']() {} }`  ............. `method 'foo'`
			 * - `class A { *['foo']() {} }`  ............ `generator method 'foo'`
			 * - `class A { async ['foo']() {} }`  ....... `async method 'foo'`
			 * - `class A { [foo]() {} }`  ............... `method`
			 * - `class A { *[foo]() {} }`  .............. `generator method`
			 * - `class A { async [foo]() {} }`  ......... `async method`
			 * - `class A { get foo() {} }`  ............. `getter 'foo'`
			 * - `class A { set foo(a) {} }`  ............ `setter 'foo'`
			 * - `class A { static foo() {} }`  .......... `static method 'foo'`
			 * - `class A { static *foo() {} }`  ......... `static generator method 'foo'`
			 * - `class A { static async foo() {} }`  .... `static async method 'foo'`
			 * - `class A { static get foo() {} }`  ...... `static getter 'foo'`
			 * - `class A { static set foo(a) {} }`  ..... `static setter 'foo'`
			 * - `class A { foo = () => {}; }`  .......... `method 'foo'`
			 * - `class A { foo = function() {}; }`  ..... `method 'foo'`
			 * - `class A { foo = function bar() {}; }`  . `method 'foo'`
			 * - `class A { static foo = () => {}; }`  ... `static method 'foo'`
			 * - `class A { '#foo' = () => {}; }`  ....... `method '#foo'`
			 * - `class A { #foo = () => {}; }`  ......... `private method #foo`
			 * - `class A { static #foo = () => {}; }`  .. `static private method #foo`
			 * - `class A { '#foo'() {} }`  .............. `method '#foo'`
			 * - `class A { #foo() {} }`  ................ `private method #foo`
			 * - `class A { static #foo() {} }`  ......... `static private method #foo`
			 * @param {ASTNode} node The function node to get.
			 * @returns {string} The name and kind of the function node.
			 */
			getFunctionNameWithKind(node) {
				const parent = node.parent;
				const tokens = [];

				if (
					parent.type === "MethodDefinition" ||
					parent.type === "PropertyDefinition"
				) {
					// The proposal uses `static` word consistently before visibility words: https://github.com/tc39/proposal-static-class-features
					if (parent.static) {
						tokens.push("static");
					}
					if (!parent.computed && parent.key.type === "PrivateIdentifier") {
						tokens.push("private");
					}
				}
				if (node.async) {
					tokens.push("async");
				}
				if (node.generator) {
					tokens.push("generator");
				}

				if (parent.type === "Property" || parent.type === "MethodDefinition") {
					if (parent.kind === "constructor") {
						return "constructor";
					}
					if (parent.kind === "get") {
						tokens.push("getter");
					} else if (parent.kind === "set") {
						tokens.push("setter");
					} else {
						tokens.push("method");
					}
				} else if (parent.type === "PropertyDefinition") {
					tokens.push("method");
				} else {
					if (node.type === "ArrowFunctionExpression") {
						tokens.push("arrow");
					}
					tokens.push("function");
				}

				if (
					parent.type === "Property" ||
					parent.type === "MethodDefinition" ||
					parent.type === "PropertyDefinition"
				) {
					if (!parent.computed && parent.key.type === "PrivateIdentifier") {
						tokens.push(`#${parent.key.name}`);
					} else {
						const name = getStaticPropertyName(parent);

						if (name !== null) {
							tokens.push(`'${name}'`);
						} else if (node.id) {
							tokens.push(`'${node.id.name}'`);
						}
					}
				} else if (node.id) {
					tokens.push(`'${node.id.name}'`);
				}

				return tokens.join(" ");
			},

			/**
			 * Gets the location of the given function node for reporting.
			 *
			 * - `function foo() {}`
			 *    ^^^^^^^^^^^^
			 * - `(function foo() {})`
			 *     ^^^^^^^^^^^^
			 * - `(function() {})`
			 *     ^^^^^^^^
			 * - `function* foo() {}`
			 *    ^^^^^^^^^^^^^
			 * - `(function* foo() {})`
			 *     ^^^^^^^^^^^^^
			 * - `(function*() {})`
			 *     ^^^^^^^^^
			 * - `() => {}`
			 *       ^^
			 * - `async () => {}`
			 *             ^^
			 * - `({ foo: function foo() {} })`
			 *       ^^^^^^^^^^^^^^^^^
			 * - `({ foo: function() {} })`
			 *       ^^^^^^^^^^^^^
			 * - `({ ['foo']: function() {} })`
			 *       ^^^^^^^^^^^^^^^^^
			 * - `({ [foo]: function() {} })`
			 *       ^^^^^^^^^^^^^^^
			 * - `({ foo() {} })`
			 *       ^^^
			 * - `({ foo: function* foo() {} })`
			 *       ^^^^^^^^^^^^^^^^^^
			 * - `({ foo: function*() {} })`
			 *       ^^^^^^^^^^^^^^
			 * - `({ ['foo']: function*() {} })`
			 *       ^^^^^^^^^^^^^^^^^^
			 * - `({ [foo]: function*() {} })`
			 *       ^^^^^^^^^^^^^^^^
			 * - `({ *foo() {} })`
			 *       ^^^^
			 * - `({ foo: async function foo() {} })`
			 *       ^^^^^^^^^^^^^^^^^^^^^^^
			 * - `({ foo: async function() {} })`
			 *       ^^^^^^^^^^^^^^^^^^^
			 * - `({ ['foo']: async function() {} })`
			 *       ^^^^^^^^^^^^^^^^^^^^^^^
			 * - `({ [foo]: async function() {} })`
			 *       ^^^^^^^^^^^^^^^^^^^^^
			 * - `({ async foo() {} })`
			 *       ^^^^^^^^^
			 * - `({ get foo() {} })`
			 *       ^^^^^^^
			 * - `({ set foo(a) {} })`
			 *       ^^^^^^^
			 * - `class A { constructor() {} }`
			 *              ^^^^^^^^^^^
			 * - `class A { foo() {} }`
			 *              ^^^
			 * - `class A { *foo() {} }`
			 *              ^^^^
			 * - `class A { async foo() {} }`
			 *              ^^^^^^^^^
			 * - `class A { ['foo']() {} }`
			 *              ^^^^^^^
			 * - `class A { *['foo']() {} }`
			 *              ^^^^^^^^
			 * - `class A { async ['foo']() {} }`
			 *              ^^^^^^^^^^^^^
			 * - `class A { [foo]() {} }`
			 *              ^^^^^
			 * - `class A { *[foo]() {} }`
			 *              ^^^^^^
			 * - `class A { async [foo]() {} }`
			 *              ^^^^^^^^^^^
			 * - `class A { get foo() {} }`
			 *              ^^^^^^^
			 * - `class A { set foo(a) {} }`
			 *              ^^^^^^^
			 * - `class A { static foo() {} }`
			 *              ^^^^^^^^^^
			 * - `class A { static *foo() {} }`
			 *              ^^^^^^^^^^^
			 * - `class A { static async foo() {} }`
			 *              ^^^^^^^^^^^^^^^^
			 * - `class A { static get foo() {} }`
			 *              ^^^^^^^^^^^^^^
			 * - `class A { static set foo(a) {} }`
			 *              ^^^^^^^^^^^^^^
			 * - `class A { foo = function() {} }`
			 *              ^^^^^^^^^^^^^^
			 * - `class A { static foo = function() {} }`
			 *              ^^^^^^^^^^^^^^^^^^^^^
			 * - `class A { foo = (a, b) => {} }`
			 *              ^^^^^^
			 * @param {ASTNode} node The function node to get.
			 * @param {SourceCode} sourceCode The source code object to get tokens.
			 * @returns {string} The location of the function node for reporting.
			 */
			getFunctionHeadLoc(node, sourceCode) {
				const parent = node.parent;
				let start;
				let end;

				if (
					parent.type === "Property" ||
					parent.type === "MethodDefinition" ||
					parent.type === "PropertyDefinition"
				) {
					start = parent.loc.start;
					end = getOpeningParenOfParams(node, sourceCode).loc.start;
				} else if (node.type === "ArrowFunctionExpression") {
					const arrowToken = sourceCode.getTokenBefore(
						node.body,
						isArrowToken,
					);

					start = arrowToken.loc.start;
					end = arrowToken.loc.end;
				} else {
					start = node.loc.start;
					end = getOpeningParenOfParams(node, sourceCode).loc.start;
				}

				return {
					start: Object.assign({}, start),
					end: Object.assign({}, end),
				};
			},

			/**
			 * Gets next location when the result is not out of bound, otherwise returns null.
			 *
			 * Assumptions:
			 *
			 * - The given location represents a valid location in the given source code.
			 * - Columns are 0-based.
			 * - Lines are 1-based.
			 * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location.
			 * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end.
			 *   The start (column 0) of that extra line is considered to be a valid location.
			 *
			 * Examples of successive locations (line, column):
			 *
			 * code: foo
			 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null
			 *
			 * code: foo<LF>
			 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null
			 *
			 * code: foo<CR><LF>
			 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null
			 *
			 * code: a<LF>b
			 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null
			 *
			 * code: a<LF>b<LF>
			 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null
			 *
			 * code: a<CR><LF>b<CR><LF>
			 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null
			 *
			 * code: a<LF><LF>
			 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null
			 *
			 * code: <LF>
			 * locations: (1, 0) -> (2, 0) -> null
			 *
			 * code:
			 * locations: (1, 0) -> null
			 * @param {SourceCode} sourceCode The sourceCode
			 * @param {{line: number, column: number}} location The location
			 * @returns {{line: number, column: number} | null} Next location
			 */
			getNextLocation(sourceCode, { line, column }) {
				if (column < sourceCode.lines[line - 1].length) {
					return {
						line,
						column: column + 1,
					};
				}

				if (line < sourceCode.lines.length) {
					return {
						line: line + 1,
						column: 0,
					};
				}

				return null;
			},

			/**
			 * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses
			 * surrounding the node.
			 * @param {SourceCode} sourceCode The source code object
			 * @param {ASTNode} node An expression node
			 * @returns {string} The text representing the node, with all surrounding parentheses included
			 */
			getParenthesisedText(sourceCode, node) {
				let leftToken = sourceCode.getFirstToken(node);
				let rightToken = sourceCode.getLastToken(node);

				while (
					sourceCode.getTokenBefore(leftToken) &&
					sourceCode.getTokenBefore(leftToken).type === "Punctuator" &&
					sourceCode.getTokenBefore(leftToken).value === "(" &&
					sourceCode.getTokenAfter(rightToken) &&
					sourceCode.getTokenAfter(rightToken).type === "Punctuator" &&
					sourceCode.getTokenAfter(rightToken).value === ")"
				) {
					leftToken = sourceCode.getTokenBefore(leftToken);
					rightToken = sourceCode.getTokenAfter(rightToken);
				}

				return sourceCode
					.getText()
					.slice(leftToken.range[0], rightToken.range[1]);
			},

			/**
			 * Determine if a node has a possibility to be an Error object
			 * @param {ASTNode} node ASTNode to check
			 * @returns {boolean} True if there is a chance it contains an Error obj
			 */
			couldBeError(node) {
				switch (node.type) {
					case "Identifier":
					case "CallExpression":
					case "NewExpression":
					case "MemberExpression":
					case "TaggedTemplateExpression":
					case "YieldExpression":
					case "AwaitExpression":
					case "ChainExpression":
						return true; // possibly an error object.

					case "AssignmentExpression":
						if (["=", "&&="].includes(node.operator)) {
							return module.exports.couldBeError(node.right);
						}

						if (["||=", "??="].includes(node.operator)) {
							return (
								module.exports.couldBeError(node.left) ||
								module.exports.couldBeError(node.right)
							);
						}

						/**
						 * All other assignment operators are mathematical assignment operators (arithmetic or bitwise).
						 * An assignment expression with a mathematical operator can either evaluate to a primitive value,
						 * or throw, depending on the operands. Thus, it cannot evaluate to an `Error` object.
						 */
						return false;

					case "SequenceExpression": {
						const exprs = node.expressions;

						return (
							exprs.length !== 0 &&
							module.exports.couldBeError(exprs.at(-1))
						);
					}

					case "LogicalExpression":
						/*
						 * If the && operator short-circuits, the left side was falsy and therefore not an error, and if it
						 * doesn't short-circuit, it takes the value from the right side, so the right side must always be
						 * a plausible error. A future improvement could verify that the left side could be truthy by
						 * excluding falsy literals.
						 */
						if (node.operator === "&&") {
							return module.exports.couldBeError(node.right);
						}

						return (
							module.exports.couldBeError(node.left) ||
							module.exports.couldBeError(node.right)
						);

					case "ConditionalExpression":
						return (
							module.exports.couldBeError(node.consequent) ||
							module.exports.couldBeError(node.alternate)
						);

					default:
						return false;
				}
			},

			/**
			 * Check if a given node is a numeric literal or not.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if the node is a number or bigint literal.
			 */
			isNumericLiteral(node) {
				return (
					node.type === "Literal" &&
					(typeof node.value === "number" || Boolean(node.bigint))
				);
			},

			/**
			 * Determines whether two tokens can safely be placed next to each other without merging into a single token
			 * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used.
			 * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used.
			 * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed
			 * next to each other, behavior is undefined (although it should return `true` in most cases).
			 */
			canTokensBeAdjacent(leftValue, rightValue) {
				const espreeOptions = {
					ecmaVersion: espree.latestEcmaVersion,
					comment: true,
					range: true,
				};

				let leftToken;

				if (typeof leftValue === "string") {
					let tokens;

					try {
						tokens = espree.tokenize(leftValue, espreeOptions);
					} catch {
						return false;
					}

					const comments = tokens.comments;

					leftToken = tokens.at(-1);
					if (comments.length) {
						const lastComment = comments.at(-1);

						if (!leftToken || lastComment.range[0] > leftToken.range[0]) {
							leftToken = lastComment;
						}
					}
				} else {
					leftToken = leftValue;
				}

				/*
				 * If a hashbang comment was passed as a token object from SourceCode,
				 * its type will be "Shebang" because of the way ESLint itself handles hashbangs.
				 * If a hashbang comment was passed in a string and then tokenized in this function,
				 * its type will be "Hashbang" because of the way Espree tokenizes hashbangs.
				 */
				if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") {
					return false;
				}

				let rightToken;

				if (typeof rightValue === "string") {
					let tokens;

					try {
						tokens = espree.tokenize(rightValue, espreeOptions);
					} catch {
						return false;
					}

					const comments = tokens.comments;

					rightToken = tokens[0];
					if (comments.length) {
						const firstComment = comments[0];

						if (
							!rightToken ||
							firstComment.range[0] < rightToken.range[0]
						) {
							rightToken = firstComment;
						}
					}
				} else {
					rightToken = rightValue;
				}

				if (
					leftToken.type === "Punctuator" ||
					rightToken.type === "Punctuator"
				) {
					if (
						leftToken.type === "Punctuator" &&
						rightToken.type === "Punctuator"
					) {
						const PLUS_TOKENS = new Set(["+", "++"]);
						const MINUS_TOKENS = new Set(["-", "--"]);

						return !(
							(PLUS_TOKENS.has(leftToken.value) &&
								PLUS_TOKENS.has(rightToken.value)) ||
							(MINUS_TOKENS.has(leftToken.value) &&
								MINUS_TOKENS.has(rightToken.value))
						);
					}
					if (leftToken.type === "Punctuator" && leftToken.value === "/") {
						return !["Block", "Line", "RegularExpression"].includes(
							rightToken.type,
						);
					}
					return true;
				}

				if (
					leftToken.type === "String" ||
					rightToken.type === "String" ||
					leftToken.type === "Template" ||
					rightToken.type === "Template"
				) {
					return true;
				}

				if (
					leftToken.type !== "Numeric" &&
					rightToken.type === "Numeric" &&
					rightToken.value.startsWith(".")
				) {
					return true;
				}

				if (
					leftToken.type === "Block" ||
					rightToken.type === "Block" ||
					rightToken.type === "Line"
				) {
					return true;
				}

				if (rightToken.type === "PrivateIdentifier") {
					return true;
				}

				return false;
			},

			/**
			 * Get the `loc` object of a given name in a `/*globals` directive comment.
			 * @param {SourceCode} sourceCode The source code to convert index to loc.
			 * @param {Comment} comment The `/*globals` directive comment which include the name.
			 * @param {string} name The name to find.
			 * @returns {SourceLocation} The `loc` object.
			 */
			getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) {
				const namePattern = new RegExp(
					`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`,
					"gu",
				);

				// To ignore the first text "global".
				namePattern.lastIndex = comment.value.indexOf("global") + 6;

				// Search a given variable name.
				const match = namePattern.exec(comment.value);

				// Convert the index to loc.
				const start = sourceCode.getLocFromIndex(
					comment.range[0] + "/*".length + (match ? match.index + 1 : 0),
				);
				const end = {
					line: start.line,
					column: start.column + (match ? name.length : 1),
				};

				return { start, end };
			},

			/**
			 * Determines whether the given raw string contains an octal escape sequence
			 * or a non-octal decimal escape sequence ("\8", "\9").
			 *
			 * "\1", "\2" ... "\7", "\8", "\9"
			 * "\00", "\01" ... "\07", "\08", "\09"
			 *
			 * "\0", when not followed by a digit, is not an octal escape sequence.
			 * @param {string} rawString A string in its raw representation.
			 * @returns {boolean} `true` if the string contains at least one octal escape sequence
			 * or at least one non-octal decimal escape sequence.
			 */
			hasOctalOrNonOctalDecimalEscapeSequence(rawString) {
				return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString);
			},

			/**
			 * Determines whether the given node is a template literal without expressions.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if the node is a template literal without expressions.
			 */
			isStaticTemplateLiteral(node) {
				return node.type === "TemplateLiteral" && node.expressions.length === 0;
			},

			/**
			 * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code.
			 * The braces, which make the given block body, are necessary in either of the following situations:
			 *
			 * 1. The statement is a lexical declaration.
			 * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace:
			 *
			 *     if (a) {
			 *         if (b)
			 *             foo();
			 *     }
			 *     else
			 *         bar();
			 *
			 *     if (a)
			 *         while (b)
			 *             while (c) {
			 *                 while (d)
			 *                     if (e)
			 *                         while(f)
			 *                             foo();
			 *            }
			 *     else
			 *         bar();
			 * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements.
			 * @param {SourceCode} sourceCode The source code
			 * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content)
			 * would change the semantics of the code or produce a syntax error.
			 */
			areBracesNecessary(node, sourceCode) {
				/**
				 * Determines if the given node is a lexical declaration (let, const, function, or class)
				 * @param {ASTNode} nodeToCheck The node to check
				 * @returns {boolean} True if the node is a lexical declaration
				 * @private
				 */
				function isLexicalDeclaration(nodeToCheck) {
					if (nodeToCheck.type === "VariableDeclaration") {
						return (
							nodeToCheck.kind === "const" || nodeToCheck.kind === "let"
						);
					}

					return (
						nodeToCheck.type === "FunctionDeclaration" ||
						nodeToCheck.type === "ClassDeclaration"
					);
				}

				/**
				 * Checks if the given token is an `else` token or not.
				 * @param {Token} token The token to check.
				 * @returns {boolean} `true` if the token is an `else` token.
				 */
				function isElseKeywordToken(token) {
					return token.value === "else" && token.type === "Keyword";
				}

				/**
				 * Determines whether the given node has an `else` keyword token as the first token after.
				 * @param {ASTNode} nodeToCheck The node to check.
				 * @returns {boolean} `true` if the node is followed by an `else` keyword token.
				 */
				function isFollowedByElseKeyword(nodeToCheck) {
					const nextToken = sourceCode.getTokenAfter(nodeToCheck);

					return Boolean(nextToken) && isElseKeywordToken(nextToken);
				}

				/**
				 * Determines whether the code represented by the given node contains an `if` statement
				 * that would become associated with an `else` keyword directly appended to that code.
				 *
				 * Examples where it returns `true`:
				 *
				 *    if (a)
				 *        foo();
				 *
				 *    if (a) {
				 *        foo();
				 *    }
				 *
				 *    if (a)
				 *        foo();
				 *    else if (b)
				 *        bar();
				 *
				 *    while (a)
				 *        if (b)
				 *            if(c)
				 *                foo();
				 *            else
				 *                bar();
				 *
				 * Examples where it returns `false`:
				 *
				 *    if (a)
				 *        foo();
				 *    else
				 *        bar();
				 *
				 *    while (a) {
				 *        if (b)
				 *            if(c)
				 *                foo();
				 *            else
				 *                bar();
				 *    }
				 *
				 *    while (a)
				 *        if (b) {
				 *            if(c)
				 *                foo();
				 *        }
				 *        else
				 *            bar();
				 * @param {ASTNode} nodeToCheck Node representing the code to check.
				 * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code.
				 */
				function hasUnsafeIf(nodeToCheck) {
					switch (nodeToCheck.type) {
						case "IfStatement":
							if (!nodeToCheck.alternate) {
								return true;
							}
							return hasUnsafeIf(nodeToCheck.alternate);
						case "ForStatement":
						case "ForInStatement":
						case "ForOfStatement":
						case "LabeledStatement":
						case "WithStatement":
						case "WhileStatement":
							return hasUnsafeIf(nodeToCheck.body);
						default:
							return false;
					}
				}

				const statement = node.body[0];

				return (
					isLexicalDeclaration(statement) ||
					(hasUnsafeIf(statement) && isFollowedByElseKeyword(node))
				);
			},

			isReferenceToGlobalVariable,
			isLogicalExpression,
			isCoalesceExpression,
			isMixedLogicalAndCoalesceExpressions,
			isNullLiteral,
			getStaticStringValue,
			getStaticPropertyName,
			skipChainExpression,
			isSpecificId,
			isSpecificMemberAccess,
			equalLiteralValue,
			isSameReference,
			isLogicalAssignmentOperator,
			getSwitchCaseColonToken,
			getModuleExportName,
			isConstant,
			isTopLevelExpressionStatement,
			isDirective,
			isStartOfExpressionStatement,
			needsPrecedingSemicolon,
			isImportAttributeKey,
		}; 
	} (astUtils));
	return astUtils.exports;
}

/**
 * @fileoverview Rule to enforce getter and setter pairs in objects and classes.
 * @author Gyandeep Singh
 */

var accessorPairs;
var hasRequiredAccessorPairs;

function requireAccessorPairs () {
	if (hasRequiredAccessorPairs) return accessorPairs;
	hasRequiredAccessorPairs = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * Property name if it can be computed statically, otherwise the list of the tokens of the key node.
	 * @typedef {string|Token[]} Key
	 */

	/**
	 * Accessor nodes with the same key.
	 * @typedef {Object} AccessorData
	 * @property {Key} key Accessor's key
	 * @property {ASTNode[]} getters List of getter nodes.
	 * @property {ASTNode[]} setters List of setter nodes.
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not the given lists represent the equal tokens in the same order.
	 * Tokens are compared by their properties, not by instance.
	 * @param {Token[]} left First list of tokens.
	 * @param {Token[]} right Second list of tokens.
	 * @returns {boolean} `true` if the lists have same tokens.
	 */
	function areEqualTokenLists(left, right) {
		if (left.length !== right.length) {
			return false;
		}

		for (let i = 0; i < left.length; i++) {
			const leftToken = left[i],
				rightToken = right[i];

			if (
				leftToken.type !== rightToken.type ||
				leftToken.value !== rightToken.value
			) {
				return false;
			}
		}

		return true;
	}

	/**
	 * Checks whether or not the given keys are equal.
	 * @param {Key} left First key.
	 * @param {Key} right Second key.
	 * @returns {boolean} `true` if the keys are equal.
	 */
	function areEqualKeys(left, right) {
		if (typeof left === "string" && typeof right === "string") {
			// Statically computed names.
			return left === right;
		}
		if (Array.isArray(left) && Array.isArray(right)) {
			// Token lists.
			return areEqualTokenLists(left, right);
		}

		return false;
	}

	/**
	 * Checks whether or not a given node is of an accessor kind ('get' or 'set').
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is of an accessor kind.
	 */
	function isAccessorKind(node) {
		return node.kind === "get" || node.kind === "set";
	}

	/**
	 * Checks whether or not a given node is an argument of a specified method call.
	 * @param {ASTNode} node A node to check.
	 * @param {number} index An expected index of the node in arguments.
	 * @param {string} object An expected name of the object of the method.
	 * @param {string} property An expected name of the method.
	 * @returns {boolean} `true` if the node is an argument of the specified method call.
	 */
	function isArgumentOfMethodCall(node, index, object, property) {
		const parent = node.parent;

		return (
			parent.type === "CallExpression" &&
			astUtils.isSpecificMemberAccess(parent.callee, object, property) &&
			parent.arguments[index] === node
		);
	}

	/**
	 * Checks whether or not a given node is a property descriptor.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a property descriptor.
	 */
	function isPropertyDescriptor(node) {
		// Object.defineProperty(obj, "foo", {set: ...})
		if (
			isArgumentOfMethodCall(node, 2, "Object", "defineProperty") ||
			isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty")
		) {
			return true;
		}

		/*
		 * Object.defineProperties(obj, {foo: {set: ...}})
		 * Object.create(proto, {foo: {set: ...}})
		 */
		const grandparent = node.parent.parent;

		return (
			grandparent.type === "ObjectExpression" &&
			(isArgumentOfMethodCall(grandparent, 1, "Object", "create") ||
				isArgumentOfMethodCall(
					grandparent,
					1,
					"Object",
					"defineProperties",
				))
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	accessorPairs = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					enforceForClassMembers: true,
					getWithoutSet: false,
					setWithoutGet: true,
				},
			],

			docs: {
				description:
					"Enforce getter and setter pairs in objects and classes",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/accessor-pairs",
			},

			schema: [
				{
					type: "object",
					properties: {
						getWithoutSet: {
							type: "boolean",
						},
						setWithoutGet: {
							type: "boolean",
						},
						enforceForClassMembers: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missingGetterInPropertyDescriptor:
					"Getter is not present in property descriptor.",
				missingSetterInPropertyDescriptor:
					"Setter is not present in property descriptor.",
				missingGetterInObjectLiteral:
					"Getter is not present for {{ name }}.",
				missingSetterInObjectLiteral:
					"Setter is not present for {{ name }}.",
				missingGetterInClass: "Getter is not present for class {{ name }}.",
				missingSetterInClass: "Setter is not present for class {{ name }}.",
			},
		},
		create(context) {
			const [
				{
					getWithoutSet: checkGetWithoutSet,
					setWithoutGet: checkSetWithoutGet,
					enforceForClassMembers,
				},
			] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports the given node.
			 * @param {ASTNode} node The node to report.
			 * @param {string} messageKind "missingGetter" or "missingSetter".
			 * @returns {void}
			 * @private
			 */
			function report(node, messageKind) {
				if (node.type === "Property") {
					context.report({
						node,
						messageId: `${messageKind}InObjectLiteral`,
						loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
						data: {
							name: astUtils.getFunctionNameWithKind(node.value),
						},
					});
				} else if (node.type === "MethodDefinition") {
					context.report({
						node,
						messageId: `${messageKind}InClass`,
						loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
						data: {
							name: astUtils.getFunctionNameWithKind(node.value),
						},
					});
				} else {
					context.report({
						node,
						messageId: `${messageKind}InPropertyDescriptor`,
					});
				}
			}

			/**
			 * Reports each of the nodes in the given list using the same messageId.
			 * @param {ASTNode[]} nodes Nodes to report.
			 * @param {string} messageKind "missingGetter" or "missingSetter".
			 * @returns {void}
			 * @private
			 */
			function reportList(nodes, messageKind) {
				for (const node of nodes) {
					report(node, messageKind);
				}
			}

			/**
			 * Checks accessor pairs in the given list of nodes.
			 * @param {ASTNode[]} nodes The list to check.
			 * @returns {void}
			 * @private
			 */
			function checkList(nodes) {
				const accessors = [];
				let found = false;

				for (let i = 0; i < nodes.length; i++) {
					const node = nodes[i];

					if (isAccessorKind(node)) {
						// Creates a new `AccessorData` object for the given getter or setter node.
						const name = astUtils.getStaticPropertyName(node);
						const key =
							name !== null ? name : sourceCode.getTokens(node.key);

						// Merges the given `AccessorData` object into the given accessors list.
						for (let j = 0; j < accessors.length; j++) {
							const accessor = accessors[j];

							if (areEqualKeys(accessor.key, key)) {
								accessor.getters.push(
									...(node.kind === "get" ? [node] : []),
								);
								accessor.setters.push(
									...(node.kind === "set" ? [node] : []),
								);
								found = true;
								break;
							}
						}
						if (!found) {
							accessors.push({
								key,
								getters: node.kind === "get" ? [node] : [],
								setters: node.kind === "set" ? [node] : [],
							});
						}
						found = false;
					}
				}

				for (const { getters, setters } of accessors) {
					if (checkSetWithoutGet && setters.length && !getters.length) {
						reportList(setters, "missingGetter");
					}
					if (checkGetWithoutSet && getters.length && !setters.length) {
						reportList(getters, "missingSetter");
					}
				}
			}

			/**
			 * Checks accessor pairs in an object literal.
			 * @param {ASTNode} node `ObjectExpression` node to check.
			 * @returns {void}
			 * @private
			 */
			function checkObjectLiteral(node) {
				checkList(node.properties.filter(p => p.type === "Property"));
			}

			/**
			 * Checks accessor pairs in a property descriptor.
			 * @param {ASTNode} node Property descriptor `ObjectExpression` node to check.
			 * @returns {void}
			 * @private
			 */
			function checkPropertyDescriptor(node) {
				const namesToCheck = new Set(
					node.properties
						.filter(
							p =>
								p.type === "Property" &&
								p.kind === "init" &&
								!p.computed,
						)
						.map(({ key }) => key.name),
				);

				const hasGetter = namesToCheck.has("get");
				const hasSetter = namesToCheck.has("set");

				if (checkSetWithoutGet && hasSetter && !hasGetter) {
					report(node, "missingGetter");
				}
				if (checkGetWithoutSet && hasGetter && !hasSetter) {
					report(node, "missingSetter");
				}
			}

			/**
			 * Checks the given object expression as an object literal and as a possible property descriptor.
			 * @param {ASTNode} node `ObjectExpression` node to check.
			 * @returns {void}
			 * @private
			 */
			function checkObjectExpression(node) {
				checkObjectLiteral(node);
				if (isPropertyDescriptor(node)) {
					checkPropertyDescriptor(node);
				}
			}

			/**
			 * Checks the given class body.
			 * @param {ASTNode} node `ClassBody` node to check.
			 * @returns {void}
			 * @private
			 */
			function checkClassBody(node) {
				const methodDefinitions = node.body.filter(
					m => m.type === "MethodDefinition",
				);

				checkList(methodDefinitions.filter(m => m.static));
				checkList(methodDefinitions.filter(m => !m.static));
			}

			const listeners = {};

			if (checkSetWithoutGet || checkGetWithoutSet) {
				listeners.ObjectExpression = checkObjectExpression;
				if (enforceForClassMembers) {
					listeners.ClassBody = checkClassBody;
				}
			}

			return listeners;
		},
	};
	return accessorPairs;
}

/**
 * @fileoverview Rule to enforce linebreaks after open and before close array brackets
 * @author Jan Peer Stöcklmair <https://github.com/JPeer264>
 * @deprecated in ESLint v8.53.0
 */

var arrayBracketNewline;
var hasRequiredArrayBracketNewline;

function requireArrayBracketNewline () {
	if (hasRequiredArrayBracketNewline) return arrayBracketNewline;
	hasRequiredArrayBracketNewline = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrayBracketNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "array-bracket-newline",
							url: "https://eslint.style/rules/js/array-bracket-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce linebreaks after opening and before closing array brackets",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/array-bracket-newline",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never", "consistent"],
						},
						{
							type: "object",
							properties: {
								multiline: {
									type: "boolean",
								},
								minItems: {
									type: ["integer", "null"],
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				unexpectedOpeningLinebreak:
					"There should be no linebreak after '['.",
				unexpectedClosingLinebreak:
					"There should be no linebreak before ']'.",
				missingOpeningLinebreak: "A linebreak is required after '['.",
				missingClosingLinebreak: "A linebreak is required before ']'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Normalizes a given option value.
			 * @param {string|Object|undefined} option An option value to parse.
			 * @returns {{multiline: boolean, minItems: number}} Normalized option object.
			 */
			function normalizeOptionValue(option) {
				let consistent = false;
				let multiline = false;
				let minItems;

				if (option) {
					if (option === "consistent") {
						consistent = true;
						minItems = Number.POSITIVE_INFINITY;
					} else if (option === "always" || option.minItems === 0) {
						minItems = 0;
					} else if (option === "never") {
						minItems = Number.POSITIVE_INFINITY;
					} else {
						multiline = Boolean(option.multiline);
						minItems = option.minItems || Number.POSITIVE_INFINITY;
					}
				} else {
					consistent = false;
					multiline = true;
					minItems = Number.POSITIVE_INFINITY;
				}

				return { consistent, multiline, minItems };
			}

			/**
			 * Normalizes a given option value.
			 * @param {string|Object|undefined} options An option value to parse.
			 * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object.
			 */
			function normalizeOptions(options) {
				const value = normalizeOptionValue(options);

				return { ArrayExpression: value, ArrayPattern: value };
			}

			/**
			 * Reports that there shouldn't be a linebreak after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoBeginningLinebreak(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "unexpectedOpeningLinebreak",
					fix(fixer) {
						const nextToken = sourceCode.getTokenAfter(token, {
							includeComments: true,
						});

						if (astUtils.isCommentToken(nextToken)) {
							return null;
						}

						return fixer.removeRange([
							token.range[1],
							nextToken.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there shouldn't be a linebreak before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoEndingLinebreak(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "unexpectedClosingLinebreak",
					fix(fixer) {
						const previousToken = sourceCode.getTokenBefore(token, {
							includeComments: true,
						});

						if (astUtils.isCommentToken(previousToken)) {
							return null;
						}

						return fixer.removeRange([
							previousToken.range[1],
							token.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there should be a linebreak after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredBeginningLinebreak(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingOpeningLinebreak",
					fix(fixer) {
						return fixer.insertTextAfter(token, "\n");
					},
				});
			}

			/**
			 * Reports that there should be a linebreak before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredEndingLinebreak(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingClosingLinebreak",
					fix(fixer) {
						return fixer.insertTextBefore(token, "\n");
					},
				});
			}

			/**
			 * Reports a given node if it violated this rule.
			 * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node.
			 * @returns {void}
			 */
			function check(node) {
				const elements = node.elements;
				const normalizedOptions = normalizeOptions(context.options[0]);
				const options = normalizedOptions[node.type];
				const openBracket = sourceCode.getFirstToken(node);
				const closeBracket = sourceCode.getLastToken(node);
				const firstIncComment = sourceCode.getTokenAfter(openBracket, {
					includeComments: true,
				});
				const lastIncComment = sourceCode.getTokenBefore(closeBracket, {
					includeComments: true,
				});
				const first = sourceCode.getTokenAfter(openBracket);
				const last = sourceCode.getTokenBefore(closeBracket);

				const needsLinebreaks =
					elements.length >= options.minItems ||
					(options.multiline &&
						elements.length > 0 &&
						firstIncComment.loc.start.line !==
							lastIncComment.loc.end.line) ||
					(elements.length === 0 &&
						firstIncComment.type === "Block" &&
						firstIncComment.loc.start.line !==
							lastIncComment.loc.end.line &&
						firstIncComment === lastIncComment) ||
					(options.consistent &&
						openBracket.loc.end.line !== first.loc.start.line);

				/*
				 * Use tokens or comments to check multiline or not.
				 * But use only tokens to check whether linebreaks are needed.
				 * This allows:
				 *     var arr = [ // eslint-disable-line foo
				 *         'a'
				 *     ]
				 */

				if (needsLinebreaks) {
					if (astUtils.isTokenOnSameLine(openBracket, first)) {
						reportRequiredBeginningLinebreak(node, openBracket);
					}
					if (astUtils.isTokenOnSameLine(last, closeBracket)) {
						reportRequiredEndingLinebreak(node, closeBracket);
					}
				} else {
					if (!astUtils.isTokenOnSameLine(openBracket, first)) {
						reportNoBeginningLinebreak(node, openBracket);
					}
					if (!astUtils.isTokenOnSameLine(last, closeBracket)) {
						reportNoEndingLinebreak(node, closeBracket);
					}
				}
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				ArrayPattern: check,
				ArrayExpression: check,
			};
		},
	};
	return arrayBracketNewline;
}

/**
 * @fileoverview Disallows or enforces spaces inside of array brackets.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

var arrayBracketSpacing;
var hasRequiredArrayBracketSpacing;

function requireArrayBracketSpacing () {
	if (hasRequiredArrayBracketSpacing) return arrayBracketSpacing;
	hasRequiredArrayBracketSpacing = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrayBracketSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "array-bracket-spacing",
							url: "https://eslint.style/rules/js/array-bracket-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing inside array brackets",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/array-bracket-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						singleValue: {
							type: "boolean",
						},
						objectsInArrays: {
							type: "boolean",
						},
						arraysInArrays: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedSpaceAfter:
					"There should be no space after '{{tokenValue}}'.",
				unexpectedSpaceBefore:
					"There should be no space before '{{tokenValue}}'.",
				missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
				missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
			},
		},
		create(context) {
			const spaced = context.options[0] === "always",
				sourceCode = context.sourceCode;

			/**
			 * Determines whether an option is set, relative to the spacing option.
			 * If spaced is "always", then check whether option is set to false.
			 * If spaced is "never", then check whether option is set to true.
			 * @param {Object} option The option to exclude.
			 * @returns {boolean} Whether or not the property is excluded.
			 */
			function isOptionSet(option) {
				return context.options[1]
					? context.options[1][option] === !spaced
					: false;
			}

			const options = {
				spaced,
				singleElementException: isOptionSet("singleValue"),
				objectsInArraysException: isOptionSet("objectsInArrays"),
				arraysInArraysException: isOptionSet("arraysInArrays"),
			};

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports that there shouldn't be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoBeginningSpace(node, token) {
				const nextToken = sourceCode.getTokenAfter(token);

				context.report({
					node,
					loc: { start: token.loc.end, end: nextToken.loc.start },
					messageId: "unexpectedSpaceAfter",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							token.range[1],
							nextToken.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there shouldn't be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoEndingSpace(node, token) {
				const previousToken = sourceCode.getTokenBefore(token);

				context.report({
					node,
					loc: { start: previousToken.loc.end, end: token.loc.start },
					messageId: "unexpectedSpaceBefore",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							previousToken.range[1],
							token.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there should be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredBeginningSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingSpaceAfter",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.insertTextAfter(token, " ");
					},
				});
			}

			/**
			 * Reports that there should be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredEndingSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingSpaceBefore",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.insertTextBefore(token, " ");
					},
				});
			}

			/**
			 * Determines if a node is an object type
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} Whether or not the node is an object type.
			 */
			function isObjectType(node) {
				return (
					node &&
					(node.type === "ObjectExpression" ||
						node.type === "ObjectPattern")
				);
			}

			/**
			 * Determines if a node is an array type
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} Whether or not the node is an array type.
			 */
			function isArrayType(node) {
				return (
					node &&
					(node.type === "ArrayExpression" ||
						node.type === "ArrayPattern")
				);
			}

			/**
			 * Validates the spacing around array brackets
			 * @param {ASTNode} node The node we're checking for spacing
			 * @returns {void}
			 */
			function validateArraySpacing(node) {
				if (options.spaced && node.elements.length === 0) {
					return;
				}

				const first = sourceCode.getFirstToken(node),
					second = sourceCode.getFirstToken(node, 1),
					last = node.typeAnnotation
						? sourceCode.getTokenBefore(node.typeAnnotation)
						: sourceCode.getLastToken(node),
					penultimate = sourceCode.getTokenBefore(last),
					firstElement = node.elements[0],
					lastElement = node.elements.at(-1);

				const openingBracketMustBeSpaced =
					(options.objectsInArraysException &&
						isObjectType(firstElement)) ||
					(options.arraysInArraysException &&
						isArrayType(firstElement)) ||
					(options.singleElementException && node.elements.length === 1)
						? !options.spaced
						: options.spaced;

				const closingBracketMustBeSpaced =
					(options.objectsInArraysException &&
						isObjectType(lastElement)) ||
					(options.arraysInArraysException && isArrayType(lastElement)) ||
					(options.singleElementException && node.elements.length === 1)
						? !options.spaced
						: options.spaced;

				if (astUtils.isTokenOnSameLine(first, second)) {
					if (
						openingBracketMustBeSpaced &&
						!sourceCode.isSpaceBetweenTokens(first, second)
					) {
						reportRequiredBeginningSpace(node, first);
					}
					if (
						!openingBracketMustBeSpaced &&
						sourceCode.isSpaceBetweenTokens(first, second)
					) {
						reportNoBeginningSpace(node, first);
					}
				}

				if (
					first !== penultimate &&
					astUtils.isTokenOnSameLine(penultimate, last)
				) {
					if (
						closingBracketMustBeSpaced &&
						!sourceCode.isSpaceBetweenTokens(penultimate, last)
					) {
						reportRequiredEndingSpace(node, last);
					}
					if (
						!closingBracketMustBeSpaced &&
						sourceCode.isSpaceBetweenTokens(penultimate, last)
					) {
						reportNoEndingSpace(node, last);
					}
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ArrayPattern: validateArraySpacing,
				ArrayExpression: validateArraySpacing,
			};
		},
	};
	return arrayBracketSpacing;
}

/**
 * @fileoverview Rule to enforce return statements in callbacks of array's methods
 * @author Toru Nagashima
 */

var arrayCallbackReturn;
var hasRequiredArrayCallbackReturn;

function requireArrayCallbackReturn () {
	if (hasRequiredArrayCallbackReturn) return arrayCallbackReturn;
	hasRequiredArrayCallbackReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;
	const TARGET_METHODS =
		/^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u;

	/**
	 * Checks a given node is a member access which has the specified name's
	 * property.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a member access which has
	 *      the specified name's property. The node may be a `(Chain|Member)Expression` node.
	 */
	function isTargetMethod(node) {
		return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS);
	}

	/**
	 * Checks all segments in a set and returns true if any are reachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if any segment is reachable; false otherwise.
	 */
	function isAnySegmentReachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Returns a human-legible description of an array method
	 * @param {string} arrayMethodName A method name to fully qualify
	 * @returns {string} the method name prefixed with `Array.` if it is a class method,
	 *      or else `Array.prototype.` if it is an instance method.
	 */
	function fullMethodName(arrayMethodName) {
		if (["from", "of", "isArray"].includes(arrayMethodName)) {
			return "Array.".concat(arrayMethodName);
		}
		return "Array.prototype.".concat(arrayMethodName);
	}

	/**
	 * Checks whether or not a given node is a function expression which is the
	 * callback of an array method, returning the method name.
	 * @param {ASTNode} node A node to check. This is one of
	 *      FunctionExpression or ArrowFunctionExpression.
	 * @returns {string} The method name if the node is a callback method,
	 *      null otherwise.
	 */
	function getArrayMethodName(node) {
		let currentNode = node;

		while (currentNode) {
			const parent = currentNode.parent;

			switch (parent.type) {
				/*
				 * Looks up the destination. e.g.,
				 * foo.every(nativeFoo || function foo() { ... });
				 */
				case "LogicalExpression":
				case "ConditionalExpression":
				case "ChainExpression":
					currentNode = parent;
					break;

				/*
				 * If the upper function is IIFE, checks the destination of the return value.
				 * e.g.
				 *   foo.every((function() {
				 *     // setup...
				 *     return function callback() { ... };
				 *   })());
				 */
				case "ReturnStatement": {
					const func = astUtils.getUpperFunction(parent);

					if (func === null || !astUtils.isCallee(func)) {
						return null;
					}
					currentNode = func.parent;
					break;
				}

				/*
				 * e.g.
				 *   Array.from([], function() {});
				 *   list.every(function() {});
				 */
				case "CallExpression":
					if (astUtils.isArrayFromMethod(parent.callee)) {
						if (
							parent.arguments.length >= 2 &&
							parent.arguments[1] === currentNode
						) {
							return "from";
						}
					}
					if (isTargetMethod(parent.callee)) {
						if (
							parent.arguments.length >= 1 &&
							parent.arguments[0] === currentNode
						) {
							return astUtils.getStaticPropertyName(parent.callee);
						}
					}
					return null;

				// Otherwise this node is not target.
				default:
					return null;
			}
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Checks if the given node is a void expression.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} - `true` if the node is a void expression
	 */
	function isExpressionVoid(node) {
		return node.type === "UnaryExpression" && node.operator === "void";
	}

	/**
	 * Fixes the linting error by prepending "void " to the given node
	 * @param {Object} sourceCode context given by context.sourceCode
	 * @param {ASTNode} node The node to fix.
	 * @param {Object} fixer The fixer object provided by ESLint.
	 * @returns {Array<Object>} - An array of fix objects to apply to the node.
	 */
	function voidPrependFixer(sourceCode, node, fixer) {
		const requiresParens =
			// prepending `void ` will fail if the node has a lower precedence than void
			astUtils.getPrecedence(node) <
				astUtils.getPrecedence({
					type: "UnaryExpression",
					operator: "void",
				}) &&
			// check if there are parentheses around the node to avoid redundant parentheses
			!astUtils.isParenthesised(sourceCode, node);

		// avoid parentheses issues
		const returnOrArrowToken = sourceCode.getTokenBefore(
			node,
			node.parent.type === "ArrowFunctionExpression"
				? astUtils.isArrowToken
				: // isReturnToken
					token => token.type === "Keyword" && token.value === "return",
		);

		const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);

		const prependSpace =
			// is return token, as => allows void to be adjacent
			returnOrArrowToken.value === "return" &&
			// If two tokens (return and "(") are adjacent
			returnOrArrowToken.range[1] === firstToken.range[0];

		return [
			fixer.insertTextBefore(
				firstToken,
				`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
			),
			fixer.insertTextAfter(node, requiresParens ? ")" : ""),
		];
	}

	/**
	 * Fixes the linting error by `wrapping {}` around the given node's body.
	 * @param {Object} sourceCode context given by context.sourceCode
	 * @param {ASTNode} node The node to fix.
	 * @param {Object} fixer The fixer object provided by ESLint.
	 * @returns {Array<Object>} - An array of fix objects to apply to the node.
	 */
	function curlyWrapFixer(sourceCode, node, fixer) {
		const arrowToken = sourceCode.getTokenBefore(
			node.body,
			astUtils.isArrowToken,
		);
		const firstToken = sourceCode.getTokenAfter(arrowToken);
		const lastToken = sourceCode.getLastToken(node);

		return [
			fixer.insertTextBefore(firstToken, "{"),
			fixer.insertTextAfter(lastToken, "}"),
		];
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrayCallbackReturn = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowImplicit: false,
					checkForEach: false,
					allowVoid: false,
				},
			],

			docs: {
				description:
					"Enforce `return` statements in callbacks of array methods",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/array-callback-return",
			},

			// eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- false positive
			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						allowImplicit: {
							type: "boolean",
						},
						checkForEach: {
							type: "boolean",
						},
						allowVoid: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				expectedAtEnd:
					"{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.",
				expectedInside:
					"{{arrayMethodName}}() expects a return value from {{name}}.",
				expectedReturnValue:
					"{{arrayMethodName}}() expects a return value from {{name}}.",
				expectedNoReturnValue:
					"{{arrayMethodName}}() expects no useless return value from {{name}}.",
				wrapBraces: "Wrap the expression in `{}`.",
				prependVoid: "Prepend `void` to the expression.",
			},
		},

		create(context) {
			const [options] = context.options;
			const sourceCode = context.sourceCode;

			let funcInfo = {
				arrayMethodName: null,
				upper: null,
				codePath: null,
				hasReturn: false,
				shouldCheck: false,
				node: null,
			};

			/**
			 * Checks whether or not the last code path segment is reachable.
			 * Then reports this function if the segment is reachable.
			 *
			 * If the last code path segment is reachable, there are paths which are not
			 * returned or thrown.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function checkLastSegment(node) {
				if (!funcInfo.shouldCheck) {
					return;
				}

				const messageAndSuggestions = { messageId: "", suggest: [] };

				if (funcInfo.arrayMethodName === "forEach") {
					if (
						options.checkForEach &&
						node.type === "ArrowFunctionExpression" &&
						node.expression
					) {
						if (options.allowVoid) {
							if (isExpressionVoid(node.body)) {
								return;
							}

							messageAndSuggestions.messageId =
								"expectedNoReturnValue";
							messageAndSuggestions.suggest = [
								{
									messageId: "wrapBraces",
									fix(fixer) {
										return curlyWrapFixer(
											sourceCode,
											node,
											fixer,
										);
									},
								},
								{
									messageId: "prependVoid",
									fix(fixer) {
										return voidPrependFixer(
											sourceCode,
											node.body,
											fixer,
										);
									},
								},
							];
						} else {
							messageAndSuggestions.messageId =
								"expectedNoReturnValue";
							messageAndSuggestions.suggest = [
								{
									messageId: "wrapBraces",
									fix(fixer) {
										return curlyWrapFixer(
											sourceCode,
											node,
											fixer,
										);
									},
								},
							];
						}
					}
				} else {
					if (
						node.body.type === "BlockStatement" &&
						isAnySegmentReachable(funcInfo.currentSegments)
					) {
						messageAndSuggestions.messageId = funcInfo.hasReturn
							? "expectedAtEnd"
							: "expectedInside";
					}
				}

				if (messageAndSuggestions.messageId) {
					const name = astUtils.getFunctionNameWithKind(node);

					context.report({
						node,
						loc: astUtils.getFunctionHeadLoc(node, sourceCode),
						messageId: messageAndSuggestions.messageId,
						data: {
							name,
							arrayMethodName: fullMethodName(
								funcInfo.arrayMethodName,
							),
						},
						suggest:
							messageAndSuggestions.suggest.length !== 0
								? messageAndSuggestions.suggest
								: null,
					});
				}
			}

			return {
				// Stacks this function's information.
				onCodePathStart(codePath, node) {
					let methodName = null;

					if (TARGET_NODE_TYPE.test(node.type)) {
						methodName = getArrayMethodName(node);
					}

					funcInfo = {
						arrayMethodName: methodName,
						upper: funcInfo,
						codePath,
						hasReturn: false,
						shouldCheck: methodName && !node.async && !node.generator,
						node,
						currentSegments: new Set(),
					};
				},

				// Pops this function's information.
				onCodePathEnd() {
					funcInfo = funcInfo.upper;
				},

				onUnreachableCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				// Checks the return statement is valid.
				ReturnStatement(node) {
					if (!funcInfo.shouldCheck) {
						return;
					}

					funcInfo.hasReturn = true;

					const messageAndSuggestions = { messageId: "", suggest: [] };

					if (funcInfo.arrayMethodName === "forEach") {
						// if checkForEach: true, returning a value at any path inside a forEach is not allowed
						if (options.checkForEach && node.argument) {
							if (options.allowVoid) {
								if (isExpressionVoid(node.argument)) {
									return;
								}

								messageAndSuggestions.messageId =
									"expectedNoReturnValue";
								messageAndSuggestions.suggest = [
									{
										messageId: "prependVoid",
										fix(fixer) {
											return voidPrependFixer(
												sourceCode,
												node.argument,
												fixer,
											);
										},
									},
								];
							} else {
								messageAndSuggestions.messageId =
									"expectedNoReturnValue";
							}
						}
					} else {
						// if allowImplicit: false, should also check node.argument
						if (!options.allowImplicit && !node.argument) {
							messageAndSuggestions.messageId = "expectedReturnValue";
						}
					}

					if (messageAndSuggestions.messageId) {
						context.report({
							node,
							messageId: messageAndSuggestions.messageId,
							data: {
								name: astUtils.getFunctionNameWithKind(
									funcInfo.node,
								),
								arrayMethodName: fullMethodName(
									funcInfo.arrayMethodName,
								),
							},
							suggest:
								messageAndSuggestions.suggest.length !== 0
									? messageAndSuggestions.suggest
									: null,
						});
					}
				},

				// Reports a given function if the last path is reachable.
				"FunctionExpression:exit": checkLastSegment,
				"ArrowFunctionExpression:exit": checkLastSegment,
			};
		},
	};
	return arrayCallbackReturn;
}

/**
 * @fileoverview Rule to enforce line breaks after each array element
 * @author Jan Peer Stöcklmair <https://github.com/JPeer264>
 * @deprecated in ESLint v8.53.0
 */

var arrayElementNewline;
var hasRequiredArrayElementNewline;

function requireArrayElementNewline () {
	if (hasRequiredArrayElementNewline) return arrayElementNewline;
	hasRequiredArrayElementNewline = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrayElementNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "array-element-newline",
							url: "https://eslint.style/rules/js/array-element-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce line breaks after each array element",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/array-element-newline",
			},

			fixable: "whitespace",

			schema: {
				definitions: {
					basicConfig: {
						oneOf: [
							{
								enum: ["always", "never", "consistent"],
							},
							{
								type: "object",
								properties: {
									multiline: {
										type: "boolean",
									},
									minItems: {
										type: ["integer", "null"],
										minimum: 0,
									},
								},
								additionalProperties: false,
							},
						],
					},
				},
				type: "array",
				items: [
					{
						oneOf: [
							{
								$ref: "#/definitions/basicConfig",
							},
							{
								type: "object",
								properties: {
									ArrayExpression: {
										$ref: "#/definitions/basicConfig",
									},
									ArrayPattern: {
										$ref: "#/definitions/basicConfig",
									},
								},
								additionalProperties: false,
								minProperties: 1,
							},
						],
					},
				],
			},

			messages: {
				unexpectedLineBreak: "There should be no linebreak here.",
				missingLineBreak: "There should be a linebreak after this element.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Normalizes a given option value.
			 * @param {string|Object|undefined} providedOption An option value to parse.
			 * @returns {{multiline: boolean, minItems: number}} Normalized option object.
			 */
			function normalizeOptionValue(providedOption) {
				let consistent = false;
				let multiline = false;
				let minItems;

				const option = providedOption || "always";

				if (option === "always" || option.minItems === 0) {
					minItems = 0;
				} else if (option === "never") {
					minItems = Number.POSITIVE_INFINITY;
				} else if (option === "consistent") {
					consistent = true;
					minItems = Number.POSITIVE_INFINITY;
				} else {
					multiline = Boolean(option.multiline);
					minItems = option.minItems || Number.POSITIVE_INFINITY;
				}

				return { consistent, multiline, minItems };
			}

			/**
			 * Normalizes a given option value.
			 * @param {string|Object|undefined} options An option value to parse.
			 * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object.
			 */
			function normalizeOptions(options) {
				if (options && (options.ArrayExpression || options.ArrayPattern)) {
					let expressionOptions, patternOptions;

					if (options.ArrayExpression) {
						expressionOptions = normalizeOptionValue(
							options.ArrayExpression,
						);
					}

					if (options.ArrayPattern) {
						patternOptions = normalizeOptionValue(options.ArrayPattern);
					}

					return {
						ArrayExpression: expressionOptions,
						ArrayPattern: patternOptions,
					};
				}

				const value = normalizeOptionValue(options);

				return { ArrayExpression: value, ArrayPattern: value };
			}

			/**
			 * Reports that there shouldn't be a line break after the first token
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoLineBreak(token) {
				const tokenBefore = sourceCode.getTokenBefore(token, {
					includeComments: true,
				});

				context.report({
					loc: {
						start: tokenBefore.loc.end,
						end: token.loc.start,
					},
					messageId: "unexpectedLineBreak",
					fix(fixer) {
						if (astUtils.isCommentToken(tokenBefore)) {
							return null;
						}

						if (!astUtils.isTokenOnSameLine(tokenBefore, token)) {
							return fixer.replaceTextRange(
								[tokenBefore.range[1], token.range[0]],
								" ",
							);
						}

						/*
						 * This will check if the comma is on the same line as the next element
						 * Following array:
						 * [
						 *     1
						 *     , 2
						 *     , 3
						 * ]
						 *
						 * will be fixed to:
						 * [
						 *     1, 2, 3
						 * ]
						 */
						const twoTokensBefore = sourceCode.getTokenBefore(
							tokenBefore,
							{ includeComments: true },
						);

						if (astUtils.isCommentToken(twoTokensBefore)) {
							return null;
						}

						return fixer.replaceTextRange(
							[twoTokensBefore.range[1], tokenBefore.range[0]],
							"",
						);
					},
				});
			}

			/**
			 * Reports that there should be a line break after the first token
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredLineBreak(token) {
				const tokenBefore = sourceCode.getTokenBefore(token, {
					includeComments: true,
				});

				context.report({
					loc: {
						start: tokenBefore.loc.end,
						end: token.loc.start,
					},
					messageId: "missingLineBreak",
					fix(fixer) {
						return fixer.replaceTextRange(
							[tokenBefore.range[1], token.range[0]],
							"\n",
						);
					},
				});
			}

			/**
			 * Reports a given node if it violated this rule.
			 * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node.
			 * @returns {void}
			 */
			function check(node) {
				const elements = node.elements;
				const normalizedOptions = normalizeOptions(context.options[0]);
				const options = normalizedOptions[node.type];

				if (!options) {
					return;
				}

				let elementBreak = false;

				/*
				 * MULTILINE: true
				 * loop through every element and check
				 * if at least one element has linebreaks inside
				 * this ensures that following is not valid (due to elements are on the same line):
				 *
				 * [
				 *      1,
				 *      2,
				 *      3
				 * ]
				 */
				if (options.multiline) {
					elementBreak = elements
						.filter(element => element !== null)
						.some(
							element =>
								element.loc.start.line !== element.loc.end.line,
						);
				}

				let linebreaksCount = 0;

				for (let i = 0; i < node.elements.length; i++) {
					const element = node.elements[i];

					const previousElement = elements[i - 1];

					if (i === 0 || element === null || previousElement === null) {
						continue;
					}

					const commaToken = sourceCode.getFirstTokenBetween(
						previousElement,
						element,
						astUtils.isCommaToken,
					);
					const lastTokenOfPreviousElement =
						sourceCode.getTokenBefore(commaToken);
					const firstTokenOfCurrentElement =
						sourceCode.getTokenAfter(commaToken);

					if (
						!astUtils.isTokenOnSameLine(
							lastTokenOfPreviousElement,
							firstTokenOfCurrentElement,
						)
					) {
						linebreaksCount++;
					}
				}

				const needsLinebreaks =
					elements.length >= options.minItems ||
					(options.multiline && elementBreak) ||
					(options.consistent &&
						linebreaksCount > 0 &&
						linebreaksCount < node.elements.length);

				elements.forEach((element, i) => {
					const previousElement = elements[i - 1];

					if (i === 0 || element === null || previousElement === null) {
						return;
					}

					const commaToken = sourceCode.getFirstTokenBetween(
						previousElement,
						element,
						astUtils.isCommaToken,
					);
					const lastTokenOfPreviousElement =
						sourceCode.getTokenBefore(commaToken);
					const firstTokenOfCurrentElement =
						sourceCode.getTokenAfter(commaToken);

					if (needsLinebreaks) {
						if (
							astUtils.isTokenOnSameLine(
								lastTokenOfPreviousElement,
								firstTokenOfCurrentElement,
							)
						) {
							reportRequiredLineBreak(firstTokenOfCurrentElement);
						}
					} else {
						if (
							!astUtils.isTokenOnSameLine(
								lastTokenOfPreviousElement,
								firstTokenOfCurrentElement,
							)
						) {
							reportNoLineBreak(firstTokenOfCurrentElement);
						}
					}
				});
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				ArrayPattern: check,
				ArrayExpression: check,
			};
		},
	};
	return arrayElementNewline;
}

/**
 * @fileoverview Rule to require braces in arrow function body.
 * @author Alberto Rodríguez
 */

var arrowBodyStyle;
var hasRequiredArrowBodyStyle;

function requireArrowBodyStyle () {
	if (hasRequiredArrowBodyStyle) return arrowBodyStyle;
	hasRequiredArrowBodyStyle = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrowBodyStyle = {
		meta: {
			type: "suggestion",

			defaultOptions: ["as-needed"],

			docs: {
				description: "Require braces around arrow function bodies",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/arrow-body-style",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["always", "never"],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["as-needed"],
							},
							{
								type: "object",
								properties: {
									requireReturnForObjectLiteral: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			fixable: "code",

			messages: {
				unexpectedOtherBlock:
					"Unexpected block statement surrounding arrow body.",
				unexpectedEmptyBlock:
					"Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.",
				unexpectedObjectBlock:
					"Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.",
				unexpectedSingleBlock:
					"Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.",
				expectedBlock: "Expected block statement surrounding arrow body.",
			},
		},

		create(context) {
			const options = context.options;
			const always = options[0] === "always";
			const asNeeded = options[0] === "as-needed";
			const never = options[0] === "never";
			const requireReturnForObjectLiteral =
				options[1] && options[1].requireReturnForObjectLiteral;
			const sourceCode = context.sourceCode;
			let funcInfo = null;

			/**
			 * Checks whether the given node has ASI problem or not.
			 * @param {Token} token The token to check.
			 * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed.
			 */
			function hasASIProblem(token) {
				return (
					token &&
					token.type === "Punctuator" &&
					/^[([/`+-]/u.test(token.value)
				);
			}

			/**
			 * Gets the closing parenthesis by the given node.
			 * @param {ASTNode} node first node after an opening parenthesis.
			 * @returns {Token} The found closing parenthesis token.
			 */
			function findClosingParen(node) {
				let nodeToCheck = node;

				while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) {
					nodeToCheck = nodeToCheck.parent;
				}
				return sourceCode.getTokenAfter(nodeToCheck);
			}

			/**
			 * Check whether the node is inside of a for loop's init
			 * @param {ASTNode} node node is inside for loop
			 * @returns {boolean} `true` if the node is inside of a for loop, else `false`
			 */
			function isInsideForLoopInitializer(node) {
				if (node && node.parent) {
					if (
						node.parent.type === "ForStatement" &&
						node.parent.init === node
					) {
						return true;
					}
					return isInsideForLoopInitializer(node.parent);
				}
				return false;
			}

			/**
			 * Determines whether a arrow function body needs braces
			 * @param {ASTNode} node The arrow function node.
			 * @returns {void}
			 */
			function validate(node) {
				const arrowBody = node.body;

				if (arrowBody.type === "BlockStatement") {
					const blockBody = arrowBody.body;

					if (blockBody.length !== 1 && !never) {
						return;
					}

					if (
						asNeeded &&
						requireReturnForObjectLiteral &&
						blockBody[0].type === "ReturnStatement" &&
						blockBody[0].argument &&
						blockBody[0].argument.type === "ObjectExpression"
					) {
						return;
					}

					if (
						never ||
						(asNeeded && blockBody[0].type === "ReturnStatement")
					) {
						let messageId;

						if (blockBody.length === 0) {
							messageId = "unexpectedEmptyBlock";
						} else if (
							blockBody.length > 1 ||
							blockBody[0].type !== "ReturnStatement"
						) {
							messageId = "unexpectedOtherBlock";
						} else if (blockBody[0].argument === null) {
							messageId = "unexpectedSingleBlock";
						} else if (
							astUtils.isOpeningBraceToken(
								sourceCode.getFirstToken(blockBody[0], { skip: 1 }),
							)
						) {
							messageId = "unexpectedObjectBlock";
						} else {
							messageId = "unexpectedSingleBlock";
						}

						context.report({
							node,
							loc: arrowBody.loc,
							messageId,
							fix(fixer) {
								const fixes = [];

								if (
									blockBody.length !== 1 ||
									blockBody[0].type !== "ReturnStatement" ||
									!blockBody[0].argument ||
									hasASIProblem(
										sourceCode.getTokenAfter(arrowBody),
									)
								) {
									return fixes;
								}

								const openingBrace =
									sourceCode.getFirstToken(arrowBody);
								const closingBrace =
									sourceCode.getLastToken(arrowBody);
								const firstValueToken = sourceCode.getFirstToken(
									blockBody[0],
									1,
								);
								const lastValueToken = sourceCode.getLastToken(
									blockBody[0],
								);
								const commentsExist =
									sourceCode.commentsExistBetween(
										openingBrace,
										firstValueToken,
									) ||
									sourceCode.commentsExistBetween(
										lastValueToken,
										closingBrace,
									);

								/*
								 * Remove tokens around the return value.
								 * If comments don't exist, remove extra spaces as well.
								 */
								if (commentsExist) {
									fixes.push(
										fixer.remove(openingBrace),
										fixer.remove(closingBrace),
										fixer.remove(
											sourceCode.getTokenAfter(openingBrace),
										), // return keyword
									);
								} else {
									fixes.push(
										fixer.removeRange([
											openingBrace.range[0],
											firstValueToken.range[0],
										]),
										fixer.removeRange([
											lastValueToken.range[1],
											closingBrace.range[1],
										]),
									);
								}

								/*
								 * If the first token of the return value is `{` or the return value is a sequence expression,
								 * enclose the return value by parentheses to avoid syntax error.
								 */
								if (
									astUtils.isOpeningBraceToken(firstValueToken) ||
									blockBody[0].argument.type ===
										"SequenceExpression" ||
									(funcInfo.hasInOperator &&
										isInsideForLoopInitializer(node))
								) {
									if (
										!astUtils.isParenthesised(
											sourceCode,
											blockBody[0].argument,
										)
									) {
										fixes.push(
											fixer.insertTextBefore(
												firstValueToken,
												"(",
											),
											fixer.insertTextAfter(
												lastValueToken,
												")",
											),
										);
									}
								}

								/*
								 * If the last token of the return statement is semicolon, remove it.
								 * Non-block arrow body is an expression, not a statement.
								 */
								if (astUtils.isSemicolonToken(lastValueToken)) {
									fixes.push(fixer.remove(lastValueToken));
								}

								return fixes;
							},
						});
					}
				} else {
					if (
						always ||
						(asNeeded &&
							requireReturnForObjectLiteral &&
							arrowBody.type === "ObjectExpression")
					) {
						context.report({
							node,
							loc: arrowBody.loc,
							messageId: "expectedBlock",
							fix(fixer) {
								const fixes = [];
								const arrowToken = sourceCode.getTokenBefore(
									arrowBody,
									astUtils.isArrowToken,
								);
								const [
									firstTokenAfterArrow,
									secondTokenAfterArrow,
								] = sourceCode.getTokensAfter(arrowToken, {
									count: 2,
								});
								const lastToken = sourceCode.getLastToken(node);

								let parenthesisedObjectLiteral = null;

								if (
									astUtils.isOpeningParenToken(
										firstTokenAfterArrow,
									) &&
									astUtils.isOpeningBraceToken(
										secondTokenAfterArrow,
									)
								) {
									const braceNode =
										sourceCode.getNodeByRangeIndex(
											secondTokenAfterArrow.range[0],
										);

									if (braceNode.type === "ObjectExpression") {
										parenthesisedObjectLiteral = braceNode;
									}
								}

								// If the value is object literal, remove parentheses which were forced by syntax.
								if (parenthesisedObjectLiteral) {
									const openingParenToken = firstTokenAfterArrow;
									const openingBraceToken = secondTokenAfterArrow;

									if (
										astUtils.isTokenOnSameLine(
											openingParenToken,
											openingBraceToken,
										)
									) {
										fixes.push(
											fixer.replaceText(
												openingParenToken,
												"{return ",
											),
										);
									} else {
										// Avoid ASI
										fixes.push(
											fixer.replaceText(
												openingParenToken,
												"{",
											),
											fixer.insertTextBefore(
												openingBraceToken,
												"return ",
											),
										);
									}

									// Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo()
									fixes.push(
										fixer.remove(
											findClosingParen(
												parenthesisedObjectLiteral,
											),
										),
									);
									fixes.push(
										fixer.insertTextAfter(lastToken, "}"),
									);
								} else {
									fixes.push(
										fixer.insertTextBefore(
											firstTokenAfterArrow,
											"{return ",
										),
									);
									fixes.push(
										fixer.insertTextAfter(lastToken, "}"),
									);
								}

								return fixes;
							},
						});
					}
				}
			}

			return {
				"BinaryExpression[operator='in']"() {
					let info = funcInfo;

					while (info) {
						info.hasInOperator = true;
						info = info.upper;
					}
				},
				ArrowFunctionExpression() {
					funcInfo = {
						upper: funcInfo,
						hasInOperator: false,
					};
				},
				"ArrowFunctionExpression:exit"(node) {
					validate(node);
					funcInfo = funcInfo.upper;
				},
			};
		},
	};
	return arrowBodyStyle;
}

/**
 * @fileoverview Rule to require parens in arrow function arguments.
 * @author Jxck
 * @deprecated in ESLint v8.53.0
 */

var arrowParens;
var hasRequiredArrowParens;

function requireArrowParens () {
	if (hasRequiredArrowParens) return arrowParens;
	hasRequiredArrowParens = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines if the given arrow function has block body.
	 * @param {ASTNode} node `ArrowFunctionExpression` node.
	 * @returns {boolean} `true` if the function has block body.
	 */
	function hasBlockBody(node) {
		return node.body.type === "BlockStatement";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrowParens = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "arrow-parens",
							url: "https://eslint.style/rules/js/arrow-parens",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require parentheses around arrow function arguments",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/arrow-parens",
			},

			fixable: "code",

			schema: [
				{
					enum: ["always", "as-needed"],
				},
				{
					type: "object",
					properties: {
						requireForBlockBody: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedParens:
					"Unexpected parentheses around single function argument.",
				expectedParens:
					"Expected parentheses around arrow function argument.",

				unexpectedParensInline:
					"Unexpected parentheses around single function argument having a body with no curly braces.",
				expectedParensBlock:
					"Expected parentheses around arrow function argument having a body with curly braces.",
			},
		},

		create(context) {
			const asNeeded = context.options[0] === "as-needed";
			const requireForBlockBody =
				asNeeded &&
				context.options[1] &&
				context.options[1].requireForBlockBody === true;

			const sourceCode = context.sourceCode;

			/**
			 * Finds opening paren of parameters for the given arrow function, if it exists.
			 * It is assumed that the given arrow function has exactly one parameter.
			 * @param {ASTNode} node `ArrowFunctionExpression` node.
			 * @returns {Token|null} the opening paren, or `null` if the given arrow function doesn't have parens of parameters.
			 */
			function findOpeningParenOfParams(node) {
				const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]);

				if (
					tokenBeforeParams &&
					astUtils.isOpeningParenToken(tokenBeforeParams) &&
					node.range[0] <= tokenBeforeParams.range[0]
				) {
					return tokenBeforeParams;
				}

				return null;
			}

			/**
			 * Finds closing paren of parameters for the given arrow function.
			 * It is assumed that the given arrow function has parens of parameters and that it has exactly one parameter.
			 * @param {ASTNode} node `ArrowFunctionExpression` node.
			 * @returns {Token} the closing paren of parameters.
			 */
			function getClosingParenOfParams(node) {
				return sourceCode.getTokenAfter(
					node.params[0],
					astUtils.isClosingParenToken,
				);
			}

			/**
			 * Determines whether the given arrow function has comments inside parens of parameters.
			 * It is assumed that the given arrow function has parens of parameters.
			 * @param {ASTNode} node `ArrowFunctionExpression` node.
			 * @param {Token} openingParen Opening paren of parameters.
			 * @returns {boolean} `true` if the function has at least one comment inside of parens of parameters.
			 */
			function hasCommentsInParensOfParams(node, openingParen) {
				return sourceCode.commentsExistBetween(
					openingParen,
					getClosingParenOfParams(node),
				);
			}

			/**
			 * Determines whether the given arrow function has unexpected tokens before opening paren of parameters,
			 * in which case it will be assumed that the existing parens of parameters are necessary.
			 * Only tokens within the range of the arrow function (tokens that are part of the arrow function) are taken into account.
			 * Example: <T>(a) => b
			 * @param {ASTNode} node `ArrowFunctionExpression` node.
			 * @param {Token} openingParen Opening paren of parameters.
			 * @returns {boolean} `true` if the function has at least one unexpected token.
			 */
			function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) {
				const expectedCount = node.async ? 1 : 0;

				return (
					sourceCode.getFirstToken(node, { skip: expectedCount }) !==
					openingParen
				);
			}

			return {
				"ArrowFunctionExpression[params.length=1]"(node) {
					const shouldHaveParens =
						!asNeeded || (requireForBlockBody && hasBlockBody(node));
					const openingParen = findOpeningParenOfParams(node);
					const hasParens = openingParen !== null;
					const [param] = node.params;

					if (shouldHaveParens && !hasParens) {
						context.report({
							node,
							messageId: requireForBlockBody
								? "expectedParensBlock"
								: "expectedParens",
							loc: param.loc,
							*fix(fixer) {
								yield fixer.insertTextBefore(param, "(");
								yield fixer.insertTextAfter(param, ")");
							},
						});
					}

					if (
						!shouldHaveParens &&
						hasParens &&
						param.type === "Identifier" &&
						!param.typeAnnotation &&
						!node.returnType &&
						!hasCommentsInParensOfParams(node, openingParen) &&
						!hasUnexpectedTokensBeforeOpeningParen(node, openingParen)
					) {
						context.report({
							node,
							messageId: requireForBlockBody
								? "unexpectedParensInline"
								: "unexpectedParens",
							loc: param.loc,
							*fix(fixer) {
								const tokenBeforeOpeningParen =
									sourceCode.getTokenBefore(openingParen);
								const closingParen = getClosingParenOfParams(node);

								if (
									tokenBeforeOpeningParen &&
									tokenBeforeOpeningParen.range[1] ===
										openingParen.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenBeforeOpeningParen,
										sourceCode.getFirstToken(param),
									)
								) {
									yield fixer.insertTextBefore(openingParen, " ");
								}

								// remove parens, whitespace inside parens, and possible trailing comma
								yield fixer.removeRange([
									openingParen.range[0],
									param.range[0],
								]);
								yield fixer.removeRange([
									param.range[1],
									closingParen.range[1],
								]);
							},
						});
					}
				},
			};
		},
	};
	return arrowParens;
}

/**
 * @fileoverview Rule to define spacing before/after arrow function's arrow.
 * @author Jxck
 * @deprecated in ESLint v8.53.0
 */

var arrowSpacing;
var hasRequiredArrowSpacing;

function requireArrowSpacing () {
	if (hasRequiredArrowSpacing) return arrowSpacing;
	hasRequiredArrowSpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	arrowSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "arrow-spacing",
							url: "https://eslint.style/rules/js/arrow-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing before and after the arrow in arrow functions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/arrow-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						before: {
							type: "boolean",
							default: true,
						},
						after: {
							type: "boolean",
							default: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				expectedBefore: "Missing space before =>.",
				unexpectedBefore: "Unexpected space before =>.",

				expectedAfter: "Missing space after =>.",
				unexpectedAfter: "Unexpected space after =>.",
			},
		},

		create(context) {
			// merge rules with default
			const rule = Object.assign({}, context.options[0]);

			rule.before = rule.before !== false;
			rule.after = rule.after !== false;

			const sourceCode = context.sourceCode;

			/**
			 * Get tokens of arrow(`=>`) and before/after arrow.
			 * @param {ASTNode} node The arrow function node.
			 * @returns {Object} Tokens of arrow and before/after arrow.
			 */
			function getTokens(node) {
				const arrow = sourceCode.getTokenBefore(
					node.body,
					astUtils.isArrowToken,
				);

				return {
					before: sourceCode.getTokenBefore(arrow),
					arrow,
					after: sourceCode.getTokenAfter(arrow),
				};
			}

			/**
			 * Count spaces before/after arrow(`=>`) token.
			 * @param {Object} tokens Tokens before/after arrow.
			 * @returns {Object} count of space before/after arrow.
			 */
			function countSpaces(tokens) {
				const before = tokens.arrow.range[0] - tokens.before.range[1];
				const after = tokens.after.range[0] - tokens.arrow.range[1];

				return { before, after };
			}

			/**
			 * Determines whether space(s) before after arrow(`=>`) is satisfy rule.
			 * if before/after value is `true`, there should be space(s).
			 * if before/after value is `false`, there should be no space.
			 * @param {ASTNode} node The arrow function node.
			 * @returns {void}
			 */
			function spaces(node) {
				const tokens = getTokens(node);
				const countSpace = countSpaces(tokens);

				if (rule.before) {
					// should be space(s) before arrow
					if (countSpace.before === 0) {
						context.report({
							node: tokens.before,
							messageId: "expectedBefore",
							fix(fixer) {
								return fixer.insertTextBefore(tokens.arrow, " ");
							},
						});
					}
				} else {
					// should be no space before arrow
					if (countSpace.before > 0) {
						context.report({
							node: tokens.before,
							messageId: "unexpectedBefore",
							fix(fixer) {
								return fixer.removeRange([
									tokens.before.range[1],
									tokens.arrow.range[0],
								]);
							},
						});
					}
				}

				if (rule.after) {
					// should be space(s) after arrow
					if (countSpace.after === 0) {
						context.report({
							node: tokens.after,
							messageId: "expectedAfter",
							fix(fixer) {
								return fixer.insertTextAfter(tokens.arrow, " ");
							},
						});
					}
				} else {
					// should be no space after arrow
					if (countSpace.after > 0) {
						context.report({
							node: tokens.after,
							messageId: "unexpectedAfter",
							fix(fixer) {
								return fixer.removeRange([
									tokens.arrow.range[1],
									tokens.after.range[0],
								]);
							},
						});
					}
				}
			}

			return {
				ArrowFunctionExpression: spaces,
			};
		},
	};
	return arrowSpacing;
}

/**
 * @fileoverview Rule to check for "block scoped" variables by binding context
 * @author Matt DuVall <http://www.mattduvall.com>
 */

var blockScopedVar;
var hasRequiredBlockScopedVar;

function requireBlockScopedVar () {
	if (hasRequiredBlockScopedVar) return blockScopedVar;
	hasRequiredBlockScopedVar = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	blockScopedVar = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce the use of variables within the scope they are defined",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/block-scoped-var",
			},

			schema: [],

			messages: {
				outOfScope:
					"'{{name}}' declared on line {{definitionLine}} column {{definitionColumn}} is used outside of binding context.",
			},
		},

		create(context) {
			let stack = [];
			const sourceCode = context.sourceCode;

			/**
			 * Makes a block scope.
			 * @param {ASTNode} node A node of a scope.
			 * @returns {void}
			 */
			function enterScope(node) {
				stack.push(node.range);
			}

			/**
			 * Pops the last block scope.
			 * @returns {void}
			 */
			function exitScope() {
				stack.pop();
			}

			/**
			 * Reports a given reference.
			 * @param {eslint-scope.Reference} reference A reference to report.
			 * @param {eslint-scope.Definition} definition A definition for which to report reference.
			 * @returns {void}
			 */
			function report(reference, definition) {
				const identifier = reference.identifier;
				const definitionPosition = definition.name.loc.start;

				context.report({
					node: identifier,
					messageId: "outOfScope",
					data: {
						name: identifier.name,
						definitionLine: definitionPosition.line,
						definitionColumn: definitionPosition.column + 1,
					},
				});
			}

			/**
			 * Finds and reports references which are outside of valid scopes.
			 * @param {ASTNode} node A node to get variables.
			 * @returns {void}
			 */
			function checkForVariables(node) {
				if (node.kind !== "var") {
					return;
				}

				// Defines a predicate to check whether or not a given reference is outside of valid scope.
				const scopeRange = stack.at(-1);

				/**
				 * Check if a reference is out of scope
				 * @param {ASTNode} reference node to examine
				 * @returns {boolean} True is its outside the scope
				 * @private
				 */
				function isOutsideOfScope(reference) {
					const idRange = reference.identifier.range;

					return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1];
				}

				// Gets declared variables, and checks its references.
				const variables = sourceCode.getDeclaredVariables(node);

				for (let i = 0; i < variables.length; ++i) {
					// Reports.
					variables[i].references.filter(isOutsideOfScope).forEach(ref =>
						report(
							ref,
							variables[i].defs.find(def => def.parent === node),
						),
					);
				}
			}

			return {
				Program(node) {
					stack = [node.range];
				},

				// Manages scopes.
				BlockStatement: enterScope,
				"BlockStatement:exit": exitScope,
				ForStatement: enterScope,
				"ForStatement:exit": exitScope,
				ForInStatement: enterScope,
				"ForInStatement:exit": exitScope,
				ForOfStatement: enterScope,
				"ForOfStatement:exit": exitScope,
				SwitchStatement: enterScope,
				"SwitchStatement:exit": exitScope,
				CatchClause: enterScope,
				"CatchClause:exit": exitScope,
				StaticBlock: enterScope,
				"StaticBlock:exit": exitScope,

				// Finds and reports references which are outside of valid scope.
				VariableDeclaration: checkForVariables,
			};
		},
	};
	return blockScopedVar;
}

/**
 * @fileoverview A rule to disallow or enforce spaces inside of single line blocks.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var blockSpacing;
var hasRequiredBlockSpacing;

function requireBlockSpacing () {
	if (hasRequiredBlockSpacing) return blockSpacing;
	hasRequiredBlockSpacing = 1;

	const util = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	blockSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "block-spacing",
							url: "https://eslint.style/rules/js/block-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Disallow or enforce spaces inside of blocks after opening block and before closing block",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/block-spacing",
			},

			fixable: "whitespace",

			schema: [{ enum: ["always", "never"] }],

			messages: {
				missing: "Requires a space {{location}} '{{token}}'.",
				extra: "Unexpected space(s) {{location}} '{{token}}'.",
			},
		},

		create(context) {
			const always = context.options[0] !== "never",
				messageId = always ? "missing" : "extra",
				sourceCode = context.sourceCode;

			/**
			 * Gets the open brace token from a given node.
			 * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to get.
			 * @returns {Token} The token of the open brace.
			 */
			function getOpenBrace(node) {
				if (node.type === "SwitchStatement") {
					if (node.cases.length > 0) {
						return sourceCode.getTokenBefore(node.cases[0]);
					}
					return sourceCode.getLastToken(node, 1);
				}

				if (node.type === "StaticBlock") {
					return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token
				}

				// "BlockStatement"
				return sourceCode.getFirstToken(node);
			}

			/**
			 * Checks whether or not:
			 *   - given tokens are on same line.
			 *   - there is/isn't a space between given tokens.
			 * @param {Token} left A token to check.
			 * @param {Token} right The token which is next to `left`.
			 * @returns {boolean}
			 *    When the option is `"always"`, `true` if there are one or more spaces between given tokens.
			 *    When the option is `"never"`, `true` if there are not any spaces between given tokens.
			 *    If given tokens are not on same line, it's always `true`.
			 */
			function isValid(left, right) {
				return (
					!util.isTokenOnSameLine(left, right) ||
					sourceCode.isSpaceBetweenTokens(left, right) === always
				);
			}

			/**
			 * Checks and reports invalid spacing style inside braces.
			 * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check.
			 * @returns {void}
			 */
			function checkSpacingInsideBraces(node) {
				// Gets braces and the first/last token of content.
				const openBrace = getOpenBrace(node);
				const closeBrace = sourceCode.getLastToken(node);
				const firstToken = sourceCode.getTokenAfter(openBrace, {
					includeComments: true,
				});
				const lastToken = sourceCode.getTokenBefore(closeBrace, {
					includeComments: true,
				});

				// Skip if the node is invalid or empty.
				if (
					openBrace.type !== "Punctuator" ||
					openBrace.value !== "{" ||
					closeBrace.type !== "Punctuator" ||
					closeBrace.value !== "}" ||
					firstToken === closeBrace
				) {
					return;
				}

				// Skip line comments for option never
				if (!always && firstToken.type === "Line") {
					return;
				}

				// Check.
				if (!isValid(openBrace, firstToken)) {
					let loc = openBrace.loc;

					if (messageId === "extra") {
						loc = {
							start: openBrace.loc.end,
							end: firstToken.loc.start,
						};
					}

					context.report({
						node,
						loc,
						messageId,
						data: {
							location: "after",
							token: openBrace.value,
						},
						fix(fixer) {
							if (always) {
								return fixer.insertTextBefore(firstToken, " ");
							}

							return fixer.removeRange([
								openBrace.range[1],
								firstToken.range[0],
							]);
						},
					});
				}
				if (!isValid(lastToken, closeBrace)) {
					let loc = closeBrace.loc;

					if (messageId === "extra") {
						loc = {
							start: lastToken.loc.end,
							end: closeBrace.loc.start,
						};
					}
					context.report({
						node,
						loc,
						messageId,
						data: {
							location: "before",
							token: closeBrace.value,
						},
						fix(fixer) {
							if (always) {
								return fixer.insertTextAfter(lastToken, " ");
							}

							return fixer.removeRange([
								lastToken.range[1],
								closeBrace.range[0],
							]);
						},
					});
				}
			}

			return {
				BlockStatement: checkSpacingInsideBraces,
				StaticBlock: checkSpacingInsideBraces,
				SwitchStatement: checkSpacingInsideBraces,
			};
		},
	};
	return blockSpacing;
}

/**
 * @fileoverview Rule to flag block statements that do not use the one true brace style
 * @author Ian Christian Myers
 * @deprecated in ESLint v8.53.0
 */

var braceStyle;
var hasRequiredBraceStyle;

function requireBraceStyle () {
	if (hasRequiredBraceStyle) return braceStyle;
	hasRequiredBraceStyle = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	braceStyle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "brace-style",
							url: "https://eslint.style/rules/js/brace-style",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent brace style for blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/brace-style",
			},

			schema: [
				{
					enum: ["1tbs", "stroustrup", "allman"],
				},
				{
					type: "object",
					properties: {
						allowSingleLine: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "whitespace",

			messages: {
				nextLineOpen:
					"Opening curly brace does not appear on the same line as controlling statement.",
				sameLineOpen:
					"Opening curly brace appears on the same line as controlling statement.",
				blockSameLine:
					"Statement inside of curly braces should be on next line.",
				nextLineClose:
					"Closing curly brace does not appear on the same line as the subsequent block.",
				singleLineClose:
					"Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.",
				sameLineClose:
					"Closing curly brace appears on the same line as the subsequent block.",
			},
		},

		create(context) {
			const style = context.options[0] || "1tbs",
				params = context.options[1] || {},
				sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Fixes a place where a newline unexpectedly appears
			 * @param {Token} firstToken The token before the unexpected newline
			 * @param {Token} secondToken The token after the unexpected newline
			 * @returns {Function} A fixer function to remove the newlines between the tokens
			 */
			function removeNewlineBetween(firstToken, secondToken) {
				const textRange = [firstToken.range[1], secondToken.range[0]];
				const textBetween = sourceCode.text.slice(
					textRange[0],
					textRange[1],
				);

				// Don't do a fix if there is a comment between the tokens
				if (textBetween.trim()) {
					return null;
				}
				return fixer => fixer.replaceTextRange(textRange, " ");
			}

			/**
			 * Validates a pair of curly brackets based on the user's config
			 * @param {Token} openingCurly The opening curly bracket
			 * @param {Token} closingCurly The closing curly bracket
			 * @returns {void}
			 */
			function validateCurlyPair(openingCurly, closingCurly) {
				const tokenBeforeOpeningCurly =
					sourceCode.getTokenBefore(openingCurly);
				const tokenAfterOpeningCurly =
					sourceCode.getTokenAfter(openingCurly);
				const tokenBeforeClosingCurly =
					sourceCode.getTokenBefore(closingCurly);
				const singleLineException =
					params.allowSingleLine &&
					astUtils.isTokenOnSameLine(openingCurly, closingCurly);

				if (
					style !== "allman" &&
					!astUtils.isTokenOnSameLine(
						tokenBeforeOpeningCurly,
						openingCurly,
					)
				) {
					context.report({
						node: openingCurly,
						messageId: "nextLineOpen",
						fix: removeNewlineBetween(
							tokenBeforeOpeningCurly,
							openingCurly,
						),
					});
				}

				if (
					style === "allman" &&
					astUtils.isTokenOnSameLine(
						tokenBeforeOpeningCurly,
						openingCurly,
					) &&
					!singleLineException
				) {
					context.report({
						node: openingCurly,
						messageId: "sameLineOpen",
						fix: fixer => fixer.insertTextBefore(openingCurly, "\n"),
					});
				}

				if (
					astUtils.isTokenOnSameLine(
						openingCurly,
						tokenAfterOpeningCurly,
					) &&
					tokenAfterOpeningCurly !== closingCurly &&
					!singleLineException
				) {
					context.report({
						node: openingCurly,
						messageId: "blockSameLine",
						fix: fixer => fixer.insertTextAfter(openingCurly, "\n"),
					});
				}

				if (
					tokenBeforeClosingCurly !== openingCurly &&
					!singleLineException &&
					astUtils.isTokenOnSameLine(
						tokenBeforeClosingCurly,
						closingCurly,
					)
				) {
					context.report({
						node: closingCurly,
						messageId: "singleLineClose",
						fix: fixer => fixer.insertTextBefore(closingCurly, "\n"),
					});
				}
			}

			/**
			 * Validates the location of a token that appears before a keyword (e.g. a newline before `else`)
			 * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`).
			 * @returns {void}
			 */
			function validateCurlyBeforeKeyword(curlyToken) {
				const keywordToken = sourceCode.getTokenAfter(curlyToken);

				if (
					style === "1tbs" &&
					!astUtils.isTokenOnSameLine(curlyToken, keywordToken)
				) {
					context.report({
						node: curlyToken,
						messageId: "nextLineClose",
						fix: removeNewlineBetween(curlyToken, keywordToken),
					});
				}

				if (
					style !== "1tbs" &&
					astUtils.isTokenOnSameLine(curlyToken, keywordToken)
				) {
					context.report({
						node: curlyToken,
						messageId: "sameLineClose",
						fix: fixer => fixer.insertTextAfter(curlyToken, "\n"),
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				BlockStatement(node) {
					if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) {
						validateCurlyPair(
							sourceCode.getFirstToken(node),
							sourceCode.getLastToken(node),
						);
					}
				},
				StaticBlock(node) {
					validateCurlyPair(
						sourceCode.getFirstToken(node, { skip: 1 }), // skip the `static` token
						sourceCode.getLastToken(node),
					);
				},
				ClassBody(node) {
					validateCurlyPair(
						sourceCode.getFirstToken(node),
						sourceCode.getLastToken(node),
					);
				},
				SwitchStatement(node) {
					const closingCurly = sourceCode.getLastToken(node);
					const openingCurly = sourceCode.getTokenBefore(
						node.cases.length ? node.cases[0] : closingCurly,
					);

					validateCurlyPair(openingCurly, closingCurly);
				},
				IfStatement(node) {
					if (
						node.consequent.type === "BlockStatement" &&
						node.alternate
					) {
						// Handle the keyword after the `if` block (before `else`)
						validateCurlyBeforeKeyword(
							sourceCode.getLastToken(node.consequent),
						);
					}
				},
				TryStatement(node) {
					// Handle the keyword after the `try` block (before `catch` or `finally`)
					validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block));

					if (node.handler && node.finalizer) {
						// Handle the keyword after the `catch` block (before `finally`)
						validateCurlyBeforeKeyword(
							sourceCode.getLastToken(node.handler.body),
						);
					}
				},
			};
		},
	};
	return braceStyle;
}

/**
 * @fileoverview Enforce return after a callback.
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */

var callbackReturn;
var hasRequiredCallbackReturn;

function requireCallbackReturn () {
	if (hasRequiredCallbackReturn) return callbackReturn;
	hasRequiredCallbackReturn = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	callbackReturn = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "callback-return",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/callback-return.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Require `return` statements after callbacks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/callback-return",
			},

			schema: [
				{
					type: "array",
					items: { type: "string" },
				},
			],

			messages: {
				missingReturn: "Expected return with your callback function.",
			},
		},

		create(context) {
			const callbacks = context.options[0] || ["callback", "cb", "next"],
				sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Find the closest parent matching a list of types.
			 * @param {ASTNode} node The node whose parents we are searching
			 * @param {Array} types The node types to match
			 * @returns {ASTNode} The matched node or undefined.
			 */
			function findClosestParentOfType(node, types) {
				if (!node.parent) {
					return null;
				}
				if (!types.includes(node.parent.type)) {
					return findClosestParentOfType(node.parent, types);
				}
				return node.parent;
			}

			/**
			 * Check to see if a node contains only identifiers
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} Whether or not the node contains only identifiers
			 */
			function containsOnlyIdentifiers(node) {
				if (node.type === "Identifier") {
					return true;
				}

				if (node.type === "MemberExpression") {
					if (node.object.type === "Identifier") {
						return true;
					}
					if (node.object.type === "MemberExpression") {
						return containsOnlyIdentifiers(node.object);
					}
				}

				return false;
			}

			/**
			 * Check to see if a CallExpression is in our callback list.
			 * @param {ASTNode} node The node to check against our callback names list.
			 * @returns {boolean} Whether or not this function matches our callback name.
			 */
			function isCallback(node) {
				return (
					containsOnlyIdentifiers(node.callee) &&
					callbacks.includes(sourceCode.getText(node.callee))
				);
			}

			/**
			 * Determines whether or not the callback is part of a callback expression.
			 * @param {ASTNode} node The callback node
			 * @param {ASTNode} parentNode The expression node
			 * @returns {boolean} Whether or not this is part of a callback expression
			 */
			function isCallbackExpression(node, parentNode) {
				// ensure the parent node exists and is an expression
				if (!parentNode || parentNode.type !== "ExpressionStatement") {
					return false;
				}

				// cb()
				if (parentNode.expression === node) {
					return true;
				}

				// special case for cb && cb() and similar
				if (
					parentNode.expression.type === "BinaryExpression" ||
					parentNode.expression.type === "LogicalExpression"
				) {
					if (parentNode.expression.right === node) {
						return true;
					}
				}

				return false;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				CallExpression(node) {
					// if we're not a callback we can return
					if (!isCallback(node)) {
						return;
					}

					// find the closest block, return or loop
					const closestBlock =
						findClosestParentOfType(node, [
							"BlockStatement",
							"ReturnStatement",
							"ArrowFunctionExpression",
						]) || {};

					// if our parent is a return we know we're ok
					if (closestBlock.type === "ReturnStatement") {
						return;
					}

					// arrow functions don't always have blocks and implicitly return
					if (closestBlock.type === "ArrowFunctionExpression") {
						return;
					}

					// block statements are part of functions and most if statements
					if (closestBlock.type === "BlockStatement") {
						// find the last item in the block
						const lastItem = closestBlock.body.at(-1);

						// if the callback is the last thing in a block that might be ok
						if (isCallbackExpression(node, lastItem)) {
							const parentType = closestBlock.parent.type;

							// but only if the block is part of a function
							if (
								parentType === "FunctionExpression" ||
								parentType === "FunctionDeclaration" ||
								parentType === "ArrowFunctionExpression"
							) {
								return;
							}
						}

						// ending a block with a return is also ok
						if (lastItem.type === "ReturnStatement") {
							// but only if the callback is immediately before
							if (
								isCallbackExpression(node, closestBlock.body.at(-2))
							) {
								return;
							}
						}
					}

					// as long as you're the child of a function at this point you should be asked to return
					if (
						findClosestParentOfType(node, [
							"FunctionDeclaration",
							"FunctionExpression",
							"ArrowFunctionExpression",
						])
					) {
						context.report({ node, messageId: "missingReturn" });
					}
				},
			};
		},
	};
	return callbackReturn;
}

/**
 * @fileoverview Rule to flag non-camelcased identifiers
 * @author Nicholas C. Zakas
 */

var camelcase;
var hasRequiredCamelcase;

function requireCamelcase () {
	if (hasRequiredCamelcase) return camelcase;
	hasRequiredCamelcase = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	camelcase = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allow: [],
					ignoreDestructuring: false,
					ignoreGlobals: false,
					ignoreImports: false,
					properties: "always",
				},
			],

			docs: {
				description: "Enforce camelcase naming convention",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/camelcase",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignoreDestructuring: {
							type: "boolean",
						},
						ignoreImports: {
							type: "boolean",
						},
						ignoreGlobals: {
							type: "boolean",
						},
						properties: {
							enum: ["always", "never"],
						},
						allow: {
							type: "array",
							items: {
								type: "string",
							},
							minItems: 0,
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				notCamelCase: "Identifier '{{name}}' is not in camel case.",
				notCamelCasePrivate: "#{{name}} is not in camel case.",
			},
		},

		create(context) {
			const [
				{
					allow,
					ignoreDestructuring,
					ignoreGlobals,
					ignoreImports,
					properties,
				},
			] = context.options;
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			// contains reported nodes to avoid reporting twice on destructuring with shorthand notation
			const reported = new Set();

			/**
			 * Checks if a string contains an underscore and isn't all upper-case
			 * @param {string} name The string to check.
			 * @returns {boolean} if the string is underscored
			 * @private
			 */
			function isUnderscored(name) {
				const nameBody = name.replace(/^_+|_+$/gu, "");

				// if there's an underscore, it might be A_CONSTANT, which is okay
				return (
					nameBody.includes("_") && nameBody !== nameBody.toUpperCase()
				);
			}

			/**
			 * Checks if a string match the ignore list
			 * @param {string} name The string to check.
			 * @returns {boolean} if the string is ignored
			 * @private
			 */
			function isAllowed(name) {
				return allow.some(
					entry => name === entry || name.match(new RegExp(entry, "u")),
				);
			}

			/**
			 * Checks if a given name is good or not.
			 * @param {string} name The name to check.
			 * @returns {boolean} `true` if the name is good.
			 * @private
			 */
			function isGoodName(name) {
				return !isUnderscored(name) || isAllowed(name);
			}

			/**
			 * Checks if a given identifier reference or member expression is an assignment
			 * target.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if the node is an assignment target.
			 */
			function isAssignmentTarget(node) {
				const parent = node.parent;

				switch (parent.type) {
					case "AssignmentExpression":
					case "AssignmentPattern":
						return parent.left === node;

					case "Property":
						return (
							parent.parent.type === "ObjectPattern" &&
							parent.value === node
						);
					case "ArrayPattern":
					case "RestElement":
						return true;

					default:
						return false;
				}
			}

			/**
			 * Checks if a given binding identifier uses the original name as-is.
			 * - If it's in object destructuring or object expression, the original name is its property name.
			 * - If it's in import declaration, the original name is its exported name.
			 * @param {ASTNode} node The `Identifier` node to check.
			 * @returns {boolean} `true` if the identifier uses the original name as-is.
			 */
			function equalsToOriginalName(node) {
				const localName = node.name;
				const valueNode =
					node.parent.type === "AssignmentPattern" ? node.parent : node;
				const parent = valueNode.parent;

				switch (parent.type) {
					case "Property":
						return (
							(parent.parent.type === "ObjectPattern" ||
								parent.parent.type === "ObjectExpression") &&
							parent.value === valueNode &&
							!parent.computed &&
							parent.key.type === "Identifier" &&
							parent.key.name === localName
						);

					case "ImportSpecifier":
						return (
							parent.local === node &&
							astUtils.getModuleExportName(parent.imported) ===
								localName
						);

					default:
						return false;
				}
			}

			/**
			 * Reports an AST node as a rule violation.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 * @private
			 */
			function report(node) {
				if (reported.has(node.range[0])) {
					return;
				}
				reported.add(node.range[0]);

				// Report it.
				context.report({
					node,
					messageId:
						node.type === "PrivateIdentifier"
							? "notCamelCasePrivate"
							: "notCamelCase",
					data: { name: node.name },
				});
			}

			/**
			 * Reports an identifier reference or a binding identifier.
			 * @param {ASTNode} node The `Identifier` node to report.
			 * @returns {void}
			 */
			function reportReferenceId(node) {
				/*
				 * For backward compatibility, if it's in callings then ignore it.
				 * Not sure why it is.
				 */
				if (
					node.parent.type === "CallExpression" ||
					node.parent.type === "NewExpression"
				) {
					return;
				}

				/*
				 * For backward compatibility, if it's a default value of
				 * destructuring/parameters then ignore it.
				 * Not sure why it is.
				 */
				if (
					node.parent.type === "AssignmentPattern" &&
					node.parent.right === node
				) {
					return;
				}

				/*
				 * The `ignoreDestructuring` flag skips the identifiers that uses
				 * the property name as-is.
				 */
				if (ignoreDestructuring && equalsToOriginalName(node)) {
					return;
				}

				/*
				 * Import attribute keys are always ignored
				 */
				if (astUtils.isImportAttributeKey(node)) {
					return;
				}

				report(node);
			}

			return {
				// Report camelcase of global variable references ------------------
				Program(node) {
					const scope = sourceCode.getScope(node);

					if (!ignoreGlobals) {
						// Defined globals in config files or directive comments.
						for (const variable of scope.variables) {
							if (
								variable.identifiers.length > 0 ||
								isGoodName(variable.name)
							) {
								continue;
							}
							for (const reference of variable.references) {
								/*
								 * For backward compatibility, this rule reports read-only
								 * references as well.
								 */
								reportReferenceId(reference.identifier);
							}
						}
					}

					// Undefined globals.
					for (const reference of scope.through) {
						const id = reference.identifier;

						if (
							isGoodName(id.name) ||
							astUtils.isImportAttributeKey(id)
						) {
							continue;
						}

						/*
						 * For backward compatibility, this rule reports read-only
						 * references as well.
						 */
						reportReferenceId(id);
					}
				},

				// Report camelcase of declared variables --------------------------
				[[
					"VariableDeclaration",
					"FunctionDeclaration",
					"FunctionExpression",
					"ArrowFunctionExpression",
					"ClassDeclaration",
					"ClassExpression",
					"CatchClause",
				]](node) {
					for (const variable of sourceCode.getDeclaredVariables(node)) {
						if (isGoodName(variable.name)) {
							continue;
						}
						const id = variable.identifiers[0];

						// Report declaration.
						if (!(ignoreDestructuring && equalsToOriginalName(id))) {
							report(id);
						}

						/*
						 * For backward compatibility, report references as well.
						 * It looks unnecessary because declarations are reported.
						 */
						for (const reference of variable.references) {
							if (reference.init) {
								continue; // Skip the write references of initializers.
							}
							reportReferenceId(reference.identifier);
						}
					}
				},

				// Report camelcase in properties ----------------------------------
				[[
					"ObjectExpression > Property[computed!=true] > Identifier.key",
					"MethodDefinition[computed!=true] > Identifier.key",
					"PropertyDefinition[computed!=true] > Identifier.key",
					"MethodDefinition > PrivateIdentifier.key",
					"PropertyDefinition > PrivateIdentifier.key",
				]](node) {
					if (
						properties === "never" ||
						astUtils.isImportAttributeKey(node) ||
						isGoodName(node.name)
					) {
						return;
					}
					report(node);
				},
				"MemberExpression[computed!=true] > Identifier.property"(node) {
					if (
						properties === "never" ||
						!isAssignmentTarget(node.parent) || // ← ignore read-only references.
						isGoodName(node.name)
					) {
						return;
					}
					report(node);
				},

				// Report camelcase in import --------------------------------------
				ImportDeclaration(node) {
					for (const variable of sourceCode.getDeclaredVariables(node)) {
						if (isGoodName(variable.name)) {
							continue;
						}
						const id = variable.identifiers[0];

						// Report declaration.
						if (!(ignoreImports && equalsToOriginalName(id))) {
							report(id);
						}

						/*
						 * For backward compatibility, report references as well.
						 * It looks unnecessary because declarations are reported.
						 */
						for (const reference of variable.references) {
							reportReferenceId(reference.identifier);
						}
					}
				},

				// Report camelcase in re-export -----------------------------------
				[[
					"ExportAllDeclaration > Identifier.exported",
					"ExportSpecifier > Identifier.exported",
				]](node) {
					if (isGoodName(node.name)) {
						return;
					}
					report(node);
				},

				// Report camelcase in labels --------------------------------------
				[[
					"LabeledStatement > Identifier.label",

					/*
					 * For backward compatibility, report references as well.
					 * It looks unnecessary because declarations are reported.
					 */
					"BreakStatement > Identifier.label",
					"ContinueStatement > Identifier.label",
				]](node) {
					if (isGoodName(node.name)) {
						return;
					}
					report(node);
				},
			};
		},
	};
	return camelcase;
}

/**
 * @fileoverview enforce or disallow capitalization of the first letter of a comment
 * @author Kevin Partington
 */

var capitalizedComments;
var hasRequiredCapitalizedComments;

function requireCapitalizedComments () {
	if (hasRequiredCapitalizedComments) return capitalizedComments;
	hasRequiredCapitalizedComments = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN,
		WHITESPACE = /\s/gu,
		MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u, // TODO: Combine w/ max-len pattern?
		LETTER_PATTERN = /\p{L}/u;

	/*
	 * Base schema body for defining the basic capitalization rule, ignorePattern,
	 * and ignoreInlineComments values.
	 * This can be used in a few different ways in the actual schema.
	 */
	const SCHEMA_BODY = {
		type: "object",
		properties: {
			ignorePattern: {
				type: "string",
			},
			ignoreInlineComments: {
				type: "boolean",
			},
			ignoreConsecutiveComments: {
				type: "boolean",
			},
		},
		additionalProperties: false,
	};
	const DEFAULTS = {
		ignorePattern: "",
		ignoreInlineComments: false,
		ignoreConsecutiveComments: false,
	};

	/**
	 * Get normalized options for either block or line comments from the given
	 * user-provided options.
	 * - If the user-provided options is just a string, returns a normalized
	 *   set of options using default values for all other options.
	 * - If the user-provided options is an object, then a normalized option
	 *   set is returned. Options specified in overrides will take priority
	 *   over options specified in the main options object, which will in
	 *   turn take priority over the rule's defaults.
	 * @param {Object|string} rawOptions The user-provided options.
	 * @param {string} which Either "line" or "block".
	 * @returns {Object} The normalized options.
	 */
	function getNormalizedOptions(rawOptions, which) {
		return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions);
	}

	/**
	 * Get normalized options for block and line comments.
	 * @param {Object|string} rawOptions The user-provided options.
	 * @returns {Object} An object with "Line" and "Block" keys and corresponding
	 * normalized options objects.
	 */
	function getAllNormalizedOptions(rawOptions = {}) {
		return {
			Line: getNormalizedOptions(rawOptions, "line"),
			Block: getNormalizedOptions(rawOptions, "block"),
		};
	}

	/**
	 * Creates a regular expression for each ignorePattern defined in the rule
	 * options.
	 *
	 * This is done in order to avoid invoking the RegExp constructor repeatedly.
	 * @param {Object} normalizedOptions The normalized rule options.
	 * @returns {void}
	 */
	function createRegExpForIgnorePatterns(normalizedOptions) {
		Object.keys(normalizedOptions).forEach(key => {
			const ignorePatternStr = normalizedOptions[key].ignorePattern;

			if (ignorePatternStr) {
				const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u");

				normalizedOptions[key].ignorePatternRegExp = regExp;
			}
		});
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	capitalizedComments = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce or disallow capitalization of the first letter of a comment",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/capitalized-comments",
			},

			fixable: "code",

			schema: [
				{ enum: ["always", "never"] },
				{
					oneOf: [
						SCHEMA_BODY,
						{
							type: "object",
							properties: {
								line: SCHEMA_BODY,
								block: SCHEMA_BODY,
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				unexpectedLowercaseComment:
					"Comments should not begin with a lowercase character.",
				unexpectedUppercaseComment:
					"Comments should not begin with an uppercase character.",
			},
		},

		create(context) {
			const capitalize = context.options[0] || "always",
				normalizedOptions = getAllNormalizedOptions(context.options[1]),
				sourceCode = context.sourceCode;

			createRegExpForIgnorePatterns(normalizedOptions);

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Checks whether a comment is an inline comment.
			 *
			 * For the purpose of this rule, a comment is inline if:
			 * 1. The comment is preceded by a token on the same line; and
			 * 2. The command is followed by a token on the same line.
			 *
			 * Note that the comment itself need not be single-line!
			 *
			 * Also, it follows from this definition that only block comments can
			 * be considered as possibly inline. This is because line comments
			 * would consume any following tokens on the same line as the comment.
			 * @param {ASTNode} comment The comment node to check.
			 * @returns {boolean} True if the comment is an inline comment, false
			 * otherwise.
			 */
			function isInlineComment(comment) {
				const previousToken = sourceCode.getTokenBefore(comment, {
						includeComments: true,
					}),
					nextToken = sourceCode.getTokenAfter(comment, {
						includeComments: true,
					});

				return Boolean(
					previousToken &&
						nextToken &&
						comment.loc.start.line === previousToken.loc.end.line &&
						comment.loc.end.line === nextToken.loc.start.line,
				);
			}

			/**
			 * Determine if a comment follows another comment.
			 * @param {ASTNode} comment The comment to check.
			 * @returns {boolean} True if the comment follows a valid comment.
			 */
			function isConsecutiveComment(comment) {
				const previousTokenOrComment = sourceCode.getTokenBefore(comment, {
					includeComments: true,
				});

				return Boolean(
					previousTokenOrComment &&
						["Block", "Line"].includes(previousTokenOrComment.type),
				);
			}

			/**
			 * Check a comment to determine if it is valid for this rule.
			 * @param {ASTNode} comment The comment node to process.
			 * @param {Object} options The options for checking this comment.
			 * @returns {boolean} True if the comment is valid, false otherwise.
			 */
			function isCommentValid(comment, options) {
				// 1. Check for default ignore pattern.
				if (DEFAULT_IGNORE_PATTERN.test(comment.value)) {
					return true;
				}

				// 2. Check for custom ignore pattern.
				const commentWithoutAsterisks = comment.value.replace(/\*/gu, "");

				if (
					options.ignorePatternRegExp &&
					options.ignorePatternRegExp.test(commentWithoutAsterisks)
				) {
					return true;
				}

				// 3. Check for inline comments.
				if (options.ignoreInlineComments && isInlineComment(comment)) {
					return true;
				}

				// 4. Is this a consecutive comment (and are we tolerating those)?
				if (
					options.ignoreConsecutiveComments &&
					isConsecutiveComment(comment)
				) {
					return true;
				}

				// 5. Does the comment start with a possible URL?
				if (MAYBE_URL.test(commentWithoutAsterisks)) {
					return true;
				}

				// 6. Is the initial word character a letter?
				const commentWordCharsOnly = commentWithoutAsterisks.replace(
					WHITESPACE,
					"",
				);

				if (commentWordCharsOnly.length === 0) {
					return true;
				}

				// Get the first Unicode character (1 or 2 code units).
				const [firstWordChar] = commentWordCharsOnly;

				if (!LETTER_PATTERN.test(firstWordChar)) {
					return true;
				}

				// 7. Check the case of the initial word character.
				const isUppercase =
						firstWordChar !== firstWordChar.toLocaleLowerCase(),
					isLowercase =
						firstWordChar !== firstWordChar.toLocaleUpperCase();

				if (capitalize === "always" && isLowercase) {
					return false;
				}
				if (capitalize === "never" && isUppercase) {
					return false;
				}

				return true;
			}

			/**
			 * Process a comment to determine if it needs to be reported.
			 * @param {ASTNode} comment The comment node to process.
			 * @returns {void}
			 */
			function processComment(comment) {
				const options = normalizedOptions[comment.type],
					commentValid = isCommentValid(comment, options);

				if (!commentValid) {
					const messageId =
						capitalize === "always"
							? "unexpectedLowercaseComment"
							: "unexpectedUppercaseComment";

					context.report({
						node: null, // Intentionally using loc instead
						loc: comment.loc,
						messageId,
						fix(fixer) {
							const match = comment.value.match(LETTER_PATTERN);
							const char = match[0];

							// Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*)
							const charIndex = comment.range[0] + match.index + 2;

							return fixer.replaceTextRange(
								[charIndex, charIndex + char.length],
								capitalize === "always"
									? char.toLocaleUpperCase()
									: char.toLocaleLowerCase(),
							);
						},
					});
				}
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				Program() {
					const comments = sourceCode.getAllComments();

					comments
						.filter(token => token.type !== "Shebang")
						.forEach(processComment);
				},
			};
		},
	};
	return capitalizedComments;
}

/**
 * @fileoverview Rule to enforce that all class methods use 'this'.
 * @author Patrick Williams
 */

var classMethodsUseThis;
var hasRequiredClassMethodsUseThis;

function requireClassMethodsUseThis () {
	if (hasRequiredClassMethodsUseThis) return classMethodsUseThis;
	hasRequiredClassMethodsUseThis = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	classMethodsUseThis = {
		meta: {
			dialects: ["javascript", "typescript"],
			language: "javascript",
			type: "suggestion",

			defaultOptions: [
				{
					enforceForClassFields: true,
					exceptMethods: [],
				},
			],

			docs: {
				description: "Enforce that class methods utilize `this`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/class-methods-use-this",
			},

			schema: [
				{
					type: "object",
					properties: {
						exceptMethods: {
							type: "array",
							items: {
								type: "string",
							},
						},
						enforceForClassFields: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missingThis: "Expected 'this' to be used by class {{name}}.",
			},
		},
		create(context) {
			const [options] = context.options;
			const { enforceForClassFields } = options;
			const exceptMethods = new Set(options.exceptMethods);

			const stack = [];

			/**
			 * Push `this` used flag initialized with `false` onto the stack.
			 * @returns {void}
			 */
			function pushContext() {
				stack.push(false);
			}

			/**
			 * Pop `this` used flag from the stack.
			 * @returns {boolean | undefined} `this` used flag
			 */
			function popContext() {
				return stack.pop();
			}

			/**
			 * Initializes the current context to false and pushes it onto the stack.
			 * These booleans represent whether 'this' has been used in the context.
			 * @returns {void}
			 * @private
			 */
			function enterFunction() {
				pushContext();
			}

			/**
			 * Check if the node is an instance method
			 * @param {ASTNode} node node to check
			 * @returns {boolean} True if its an instance method
			 * @private
			 */
			function isInstanceMethod(node) {
				switch (node.type) {
					case "MethodDefinition":
						return !node.static && node.kind !== "constructor";
					case "PropertyDefinition":
						return !node.static && enforceForClassFields;
					default:
						return false;
				}
			}

			/**
			 * Check if the node is an instance method not excluded by config
			 * @param {ASTNode} node node to check
			 * @returns {boolean} True if it is an instance method, and not excluded by config
			 * @private
			 */
			function isIncludedInstanceMethod(node) {
				if (isInstanceMethod(node)) {
					if (node.computed) {
						return true;
					}

					const hashIfNeeded =
						node.key.type === "PrivateIdentifier" ? "#" : "";
					const name =
						node.key.type === "Literal"
							? astUtils.getStaticStringValue(node.key)
							: node.key.name || "";

					return !exceptMethods.has(hashIfNeeded + name);
				}
				return false;
			}

			/**
			 * Checks if we are leaving a function that is a method, and reports if 'this' has not been used.
			 * Static methods and the constructor are exempt.
			 * Then pops the context off the stack.
			 * @param {ASTNode} node A function node that was entered.
			 * @returns {void}
			 * @private
			 */
			function exitFunction(node) {
				const methodUsesThis = popContext();

				if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) {
					context.report({
						node,
						loc: astUtils.getFunctionHeadLoc(node, context.sourceCode),
						messageId: "missingThis",
						data: {
							name: astUtils.getFunctionNameWithKind(node),
						},
					});
				}
			}

			/**
			 * Mark the current context as having used 'this'.
			 * @returns {void}
			 * @private
			 */
			function markThisUsed() {
				if (stack.length) {
					stack[stack.length - 1] = true;
				}
			}

			return {
				FunctionDeclaration: enterFunction,
				"FunctionDeclaration:exit": exitFunction,
				FunctionExpression: enterFunction,
				"FunctionExpression:exit": exitFunction,

				/*
				 * Class field value are implicit functions.
				 */
				"PropertyDefinition > *.key:exit": pushContext,
				"PropertyDefinition:exit": popContext,

				/*
				 * Class static blocks are implicit functions. They aren't required to use `this`,
				 * but we have to push context so that it captures any use of `this` in the static block
				 * separately from enclosing contexts, because static blocks have their own `this` and it
				 * shouldn't count as used `this` in enclosing contexts.
				 */
				StaticBlock: pushContext,
				"StaticBlock:exit": popContext,

				ThisExpression: markThisUsed,
				Super: markThisUsed,
				...(enforceForClassFields && {
					"PropertyDefinition > ArrowFunctionExpression.value":
						enterFunction,
					"PropertyDefinition > ArrowFunctionExpression.value:exit":
						exitFunction,
				}),
			};
		},
	};
	return classMethodsUseThis;
}

/**
 * @fileoverview Rule to forbid or enforce dangling commas.
 * @author Ian Christian Myers
 * @deprecated in ESLint v8.53.0
 */

var commaDangle;
var hasRequiredCommaDangle;

function requireCommaDangle () {
	if (hasRequiredCommaDangle) return commaDangle;
	hasRequiredCommaDangle = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const DEFAULT_OPTIONS = Object.freeze({
		arrays: "never",
		objects: "never",
		imports: "never",
		exports: "never",
		functions: "never",
	});

	/**
	 * Checks whether or not a trailing comma is allowed in a given node.
	 * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas.
	 * @param {ASTNode} lastItem The node of the last element in the given node.
	 * @returns {boolean} `true` if a trailing comma is allowed.
	 */
	function isTrailingCommaAllowed(lastItem) {
		return !(
			lastItem.type === "RestElement" ||
			lastItem.type === "RestProperty" ||
			lastItem.type === "ExperimentalRestProperty"
		);
	}

	/**
	 * Normalize option value.
	 * @param {string|Object|undefined} optionValue The 1st option value to normalize.
	 * @param {number} ecmaVersion The normalized ECMAScript version.
	 * @returns {Object} The normalized option value.
	 */
	function normalizeOptions(optionValue, ecmaVersion) {
		if (typeof optionValue === "string") {
			return {
				arrays: optionValue,
				objects: optionValue,
				imports: optionValue,
				exports: optionValue,
				functions: ecmaVersion < 2017 ? "ignore" : optionValue,
			};
		}
		if (typeof optionValue === "object" && optionValue !== null) {
			return {
				arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays,
				objects: optionValue.objects || DEFAULT_OPTIONS.objects,
				imports: optionValue.imports || DEFAULT_OPTIONS.imports,
				exports: optionValue.exports || DEFAULT_OPTIONS.exports,
				functions: optionValue.functions || DEFAULT_OPTIONS.functions,
			};
		}

		return DEFAULT_OPTIONS;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	commaDangle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "comma-dangle",
							url: "https://eslint.style/rules/js/comma-dangle",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require or disallow trailing commas",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/comma-dangle",
			},

			fixable: "code",

			schema: {
				definitions: {
					value: {
						enum: [
							"always-multiline",
							"always",
							"never",
							"only-multiline",
						],
					},
					valueWithIgnore: {
						enum: [
							"always-multiline",
							"always",
							"ignore",
							"never",
							"only-multiline",
						],
					},
				},
				type: "array",
				items: [
					{
						oneOf: [
							{
								$ref: "#/definitions/value",
							},
							{
								type: "object",
								properties: {
									arrays: {
										$ref: "#/definitions/valueWithIgnore",
									},
									objects: {
										$ref: "#/definitions/valueWithIgnore",
									},
									imports: {
										$ref: "#/definitions/valueWithIgnore",
									},
									exports: {
										$ref: "#/definitions/valueWithIgnore",
									},
									functions: {
										$ref: "#/definitions/valueWithIgnore",
									},
								},
								additionalProperties: false,
							},
						],
					},
				],
				additionalItems: false,
			},

			messages: {
				unexpected: "Unexpected trailing comma.",
				missing: "Missing trailing comma.",
			},
		},

		create(context) {
			const options = normalizeOptions(
				context.options[0],
				context.languageOptions.ecmaVersion,
			);

			const sourceCode = context.sourceCode;

			/**
			 * Gets the last item of the given node.
			 * @param {ASTNode} node The node to get.
			 * @returns {ASTNode|null} The last node or null.
			 */
			function getLastItem(node) {
				/**
				 * Returns the last element of an array
				 * @param {any[]} array The input array
				 * @returns {any} The last element
				 */
				function last(array) {
					return array.at(-1);
				}

				switch (node.type) {
					case "ObjectExpression":
					case "ObjectPattern":
						return last(node.properties);
					case "ArrayExpression":
					case "ArrayPattern":
						return last(node.elements);
					case "ImportDeclaration":
					case "ExportNamedDeclaration":
						return last(node.specifiers);
					case "FunctionDeclaration":
					case "FunctionExpression":
					case "ArrowFunctionExpression":
						return last(node.params);
					case "CallExpression":
					case "NewExpression":
						return last(node.arguments);
					default:
						return null;
				}
			}

			/**
			 * Gets the trailing comma token of the given node.
			 * If the trailing comma does not exist, this returns the token which is
			 * the insertion point of the trailing comma token.
			 * @param {ASTNode} node The node to get.
			 * @param {ASTNode} lastItem The last item of the node.
			 * @returns {Token} The trailing comma token or the insertion point.
			 */
			function getTrailingToken(node, lastItem) {
				switch (node.type) {
					case "ObjectExpression":
					case "ArrayExpression":
					case "CallExpression":
					case "NewExpression":
						return sourceCode.getLastToken(node, 1);
					default: {
						const nextToken = sourceCode.getTokenAfter(lastItem);

						if (astUtils.isCommaToken(nextToken)) {
							return nextToken;
						}
						return sourceCode.getLastToken(lastItem);
					}
				}
			}

			/**
			 * Checks whether or not a given node is multiline.
			 * This rule handles a given node as multiline when the closing parenthesis
			 * and the last element are not on the same line.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} `true` if the node is multiline.
			 */
			function isMultiline(node) {
				const lastItem = getLastItem(node);

				if (!lastItem) {
					return false;
				}

				const penultimateToken = getTrailingToken(node, lastItem);
				const lastToken = sourceCode.getTokenAfter(penultimateToken);

				return lastToken.loc.end.line !== penultimateToken.loc.end.line;
			}

			/**
			 * Reports a trailing comma if it exists.
			 * @param {ASTNode} node A node to check. Its type is one of
			 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
			 *   ImportDeclaration, and ExportNamedDeclaration.
			 * @returns {void}
			 */
			function forbidTrailingComma(node) {
				const lastItem = getLastItem(node);

				if (
					!lastItem ||
					(node.type === "ImportDeclaration" &&
						lastItem.type !== "ImportSpecifier")
				) {
					return;
				}

				const trailingToken = getTrailingToken(node, lastItem);

				if (astUtils.isCommaToken(trailingToken)) {
					context.report({
						node: lastItem,
						loc: trailingToken.loc,
						messageId: "unexpected",
						*fix(fixer) {
							yield fixer.remove(trailingToken);

							/*
							 * Extend the range of the fix to include surrounding tokens to ensure
							 * that the element after which the comma is removed stays _last_.
							 * This intentionally makes conflicts in fix ranges with rules that may be
							 * adding or removing elements in the same autofix pass.
							 * https://github.com/eslint/eslint/issues/15660
							 */
							yield fixer.insertTextBefore(
								sourceCode.getTokenBefore(trailingToken),
								"",
							);
							yield fixer.insertTextAfter(
								sourceCode.getTokenAfter(trailingToken),
								"",
							);
						},
					});
				}
			}

			/**
			 * Reports the last element of a given node if it does not have a trailing
			 * comma.
			 *
			 * If a given node is `ArrayPattern` which has `RestElement`, the trailing
			 * comma is disallowed, so report if it exists.
			 * @param {ASTNode} node A node to check. Its type is one of
			 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
			 *   ImportDeclaration, and ExportNamedDeclaration.
			 * @returns {void}
			 */
			function forceTrailingComma(node) {
				const lastItem = getLastItem(node);

				if (
					!lastItem ||
					(node.type === "ImportDeclaration" &&
						lastItem.type !== "ImportSpecifier")
				) {
					return;
				}
				if (!isTrailingCommaAllowed(lastItem)) {
					forbidTrailingComma(node);
					return;
				}

				const trailingToken = getTrailingToken(node, lastItem);

				if (trailingToken.value !== ",") {
					context.report({
						node: lastItem,
						loc: {
							start: trailingToken.loc.end,
							end: astUtils.getNextLocation(
								sourceCode,
								trailingToken.loc.end,
							),
						},
						messageId: "missing",
						*fix(fixer) {
							yield fixer.insertTextAfter(trailingToken, ",");

							/*
							 * Extend the range of the fix to include surrounding tokens to ensure
							 * that the element after which the comma is inserted stays _last_.
							 * This intentionally makes conflicts in fix ranges with rules that may be
							 * adding or removing elements in the same autofix pass.
							 * https://github.com/eslint/eslint/issues/15660
							 */
							yield fixer.insertTextBefore(trailingToken, "");
							yield fixer.insertTextAfter(
								sourceCode.getTokenAfter(trailingToken),
								"",
							);
						},
					});
				}
			}

			/**
			 * If a given node is multiline, reports the last element of a given node
			 * when it does not have a trailing comma.
			 * Otherwise, reports a trailing comma if it exists.
			 * @param {ASTNode} node A node to check. Its type is one of
			 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
			 *   ImportDeclaration, and ExportNamedDeclaration.
			 * @returns {void}
			 */
			function forceTrailingCommaIfMultiline(node) {
				if (isMultiline(node)) {
					forceTrailingComma(node);
				} else {
					forbidTrailingComma(node);
				}
			}

			/**
			 * Only if a given node is not multiline, reports the last element of a given node
			 * when it does not have a trailing comma.
			 * Otherwise, reports a trailing comma if it exists.
			 * @param {ASTNode} node A node to check. Its type is one of
			 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
			 *   ImportDeclaration, and ExportNamedDeclaration.
			 * @returns {void}
			 */
			function allowTrailingCommaIfMultiline(node) {
				if (!isMultiline(node)) {
					forbidTrailingComma(node);
				}
			}

			const predicate = {
				always: forceTrailingComma,
				"always-multiline": forceTrailingCommaIfMultiline,
				"only-multiline": allowTrailingCommaIfMultiline,
				never: forbidTrailingComma,
				ignore() {},
			};

			return {
				ObjectExpression: predicate[options.objects],
				ObjectPattern: predicate[options.objects],

				ArrayExpression: predicate[options.arrays],
				ArrayPattern: predicate[options.arrays],

				ImportDeclaration: predicate[options.imports],

				ExportNamedDeclaration: predicate[options.exports],

				FunctionDeclaration: predicate[options.functions],
				FunctionExpression: predicate[options.functions],
				ArrowFunctionExpression: predicate[options.functions],
				CallExpression: predicate[options.functions],
				NewExpression: predicate[options.functions],
			};
		},
	};
	return commaDangle;
}

/**
 * @fileoverview Comma spacing - validates spacing before and after comma
 * @author Vignesh Anand aka vegetableman.
 * @deprecated in ESLint v8.53.0
 */

var commaSpacing;
var hasRequiredCommaSpacing;

function requireCommaSpacing () {
	if (hasRequiredCommaSpacing) return commaSpacing;
	hasRequiredCommaSpacing = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	commaSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "comma-spacing",
							url: "https://eslint.style/rules/js/comma-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing before and after commas",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/comma-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						before: {
							type: "boolean",
							default: false,
						},
						after: {
							type: "boolean",
							default: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missing: "A space is required {{loc}} ','.",
				unexpected: "There should be no space {{loc}} ','.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const tokensAndComments = sourceCode.tokensAndComments;

			const options = {
				before: context.options[0] ? context.options[0].before : false,
				after: context.options[0] ? context.options[0].after : true,
			};

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			// list of comma tokens to ignore for the check of leading whitespace
			const commaTokensToIgnore = [];

			/**
			 * Reports a spacing error with an appropriate message.
			 * @param {ASTNode} node The binary expression node to report.
			 * @param {string} loc Is the error "before" or "after" the comma?
			 * @param {ASTNode} otherNode The node at the left or right of `node`
			 * @returns {void}
			 * @private
			 */
			function report(node, loc, otherNode) {
				context.report({
					node,
					fix(fixer) {
						if (options[loc]) {
							if (loc === "before") {
								return fixer.insertTextBefore(node, " ");
							}
							return fixer.insertTextAfter(node, " ");
						}
						let start, end;
						const newText = "";

						if (loc === "before") {
							start = otherNode.range[1];
							end = node.range[0];
						} else {
							start = node.range[1];
							end = otherNode.range[0];
						}

						return fixer.replaceTextRange([start, end], newText);
					},
					messageId: options[loc] ? "missing" : "unexpected",
					data: {
						loc,
					},
				});
			}

			/**
			 * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list.
			 * @param {ASTNode} node An ArrayExpression or ArrayPattern node.
			 * @returns {void}
			 */
			function addNullElementsToIgnoreList(node) {
				let previousToken = sourceCode.getFirstToken(node);

				node.elements.forEach(element => {
					let token;

					if (element === null) {
						token = sourceCode.getTokenAfter(previousToken);

						if (astUtils.isCommaToken(token)) {
							commaTokensToIgnore.push(token);
						}
					} else {
						token = sourceCode.getTokenAfter(element);
					}

					previousToken = token;
				});
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				"Program:exit"() {
					tokensAndComments.forEach((token, i) => {
						if (!astUtils.isCommaToken(token)) {
							return;
						}

						const previousToken = tokensAndComments[i - 1];
						const nextToken = tokensAndComments[i + 1];

						if (
							previousToken &&
							!astUtils.isCommaToken(previousToken) && // ignore spacing between two commas
							/*
							 * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions).
							 * In addition to spacing between two commas, this can also ignore:
							 *
							 *   - Spacing after `[` (controlled by array-bracket-spacing)
							 *       Example: [ , ]
							 *                 ^
							 *   - Spacing after a comment (for backwards compatibility, this was possibly unintentional)
							 *       Example: [a, /* * / ,]
							 *                          ^
							 */
							!commaTokensToIgnore.includes(token) &&
							astUtils.isTokenOnSameLine(previousToken, token) &&
							options.before !==
								sourceCode.isSpaceBetweenTokens(
									previousToken,
									token,
								)
						) {
							report(token, "before", previousToken);
						}

						if (
							nextToken &&
							!astUtils.isCommaToken(nextToken) && // ignore spacing between two commas
							!astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens
							!astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing
							!astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing
							!(!options.after && nextToken.type === "Line") && // special case, allow space before line comment
							astUtils.isTokenOnSameLine(token, nextToken) &&
							options.after !==
								sourceCode.isSpaceBetweenTokens(token, nextToken)
						) {
							report(token, "after", nextToken);
						}
					});
				},
				ArrayExpression: addNullElementsToIgnoreList,
				ArrayPattern: addNullElementsToIgnoreList,
			};
		},
	};
	return commaSpacing;
}

/**
 * @fileoverview Comma style - enforces comma styles of two types: last and first
 * @author Vignesh Anand aka vegetableman
 * @deprecated in ESLint v8.53.0
 */

var commaStyle;
var hasRequiredCommaStyle;

function requireCommaStyle () {
	if (hasRequiredCommaStyle) return commaStyle;
	hasRequiredCommaStyle = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	commaStyle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "comma-style",
							url: "https://eslint.style/rules/js/comma-style",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent comma style",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/comma-style",
			},

			fixable: "code",

			schema: [
				{
					enum: ["first", "last"],
				},
				{
					type: "object",
					properties: {
						exceptions: {
							type: "object",
							additionalProperties: {
								type: "boolean",
							},
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedLineBeforeAndAfterComma:
					"Bad line breaking before and after ','.",
				expectedCommaFirst: "',' should be placed first.",
				expectedCommaLast: "',' should be placed last.",
			},
		},

		create(context) {
			const style = context.options[0] || "last",
				sourceCode = context.sourceCode;
			const exceptions = {
				ArrayPattern: true,
				ArrowFunctionExpression: true,
				CallExpression: true,
				FunctionDeclaration: true,
				FunctionExpression: true,
				ImportDeclaration: true,
				ObjectPattern: true,
				NewExpression: true,
			};

			if (
				context.options.length === 2 &&
				Object.hasOwn(context.options[1], "exceptions")
			) {
				const keys = Object.keys(context.options[1].exceptions);

				for (let i = 0; i < keys.length; i++) {
					exceptions[keys[i]] = context.options[1].exceptions[keys[i]];
				}
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Modified text based on the style
			 * @param {string} styleType Style type
			 * @param {string} text Source code text
			 * @returns {string} modified text
			 * @private
			 */
			function getReplacedText(styleType, text) {
				switch (styleType) {
					case "between":
						return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`;

					case "first":
						return `${text},`;

					case "last":
						return `,${text}`;

					default:
						return "";
				}
			}

			/**
			 * Determines the fixer function for a given style.
			 * @param {string} styleType comma style
			 * @param {ASTNode} previousItemToken The token to check.
			 * @param {ASTNode} commaToken The token to check.
			 * @param {ASTNode} currentItemToken The token to check.
			 * @returns {Function} Fixer function
			 * @private
			 */
			function getFixerFunction(
				styleType,
				previousItemToken,
				commaToken,
				currentItemToken,
			) {
				const text =
					sourceCode.text.slice(
						previousItemToken.range[1],
						commaToken.range[0],
					) +
					sourceCode.text.slice(
						commaToken.range[1],
						currentItemToken.range[0],
					);
				const range = [
					previousItemToken.range[1],
					currentItemToken.range[0],
				];

				return function (fixer) {
					return fixer.replaceTextRange(
						range,
						getReplacedText(styleType, text),
					);
				};
			}

			/**
			 * Validates the spacing around single items in lists.
			 * @param {Token} previousItemToken The last token from the previous item.
			 * @param {Token} commaToken The token representing the comma.
			 * @param {Token} currentItemToken The first token of the current item.
			 * @param {Token} reportItem The item to use when reporting an error.
			 * @returns {void}
			 * @private
			 */
			function validateCommaItemSpacing(
				previousItemToken,
				commaToken,
				currentItemToken,
				reportItem,
			) {
				// if single line
				if (
					astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
					astUtils.isTokenOnSameLine(previousItemToken, commaToken)
				) ; else if (
					!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
					!astUtils.isTokenOnSameLine(previousItemToken, commaToken)
				) {
					const comment = sourceCode.getCommentsAfter(commaToken)[0];
					const styleType =
						comment &&
						comment.type === "Block" &&
						astUtils.isTokenOnSameLine(commaToken, comment)
							? style
							: "between";

					// lone comma
					context.report({
						node: reportItem,
						loc: commaToken.loc,
						messageId: "unexpectedLineBeforeAndAfterComma",
						fix: getFixerFunction(
							styleType,
							previousItemToken,
							commaToken,
							currentItemToken,
						),
					});
				} else if (
					style === "first" &&
					!astUtils.isTokenOnSameLine(commaToken, currentItemToken)
				) {
					context.report({
						node: reportItem,
						loc: commaToken.loc,
						messageId: "expectedCommaFirst",
						fix: getFixerFunction(
							style,
							previousItemToken,
							commaToken,
							currentItemToken,
						),
					});
				} else if (
					style === "last" &&
					astUtils.isTokenOnSameLine(commaToken, currentItemToken)
				) {
					context.report({
						node: reportItem,
						loc: commaToken.loc,
						messageId: "expectedCommaLast",
						fix: getFixerFunction(
							style,
							previousItemToken,
							commaToken,
							currentItemToken,
						),
					});
				}
			}

			/**
			 * Checks the comma placement with regards to a declaration/property/element
			 * @param {ASTNode} node The binary expression node to check
			 * @param {string} property The property of the node containing child nodes.
			 * @private
			 * @returns {void}
			 */
			function validateComma(node, property) {
				const items = node[property],
					arrayLiteral =
						node.type === "ArrayExpression" ||
						node.type === "ArrayPattern";

				if (items.length > 1 || arrayLiteral) {
					// seed as opening [
					let previousItemToken = sourceCode.getFirstToken(node);

					items.forEach(item => {
						const commaToken = item
								? sourceCode.getTokenBefore(item)
								: previousItemToken,
							currentItemToken = item
								? sourceCode.getFirstToken(item)
								: sourceCode.getTokenAfter(commaToken),
							reportItem = item || currentItemToken;

						/*
						 * This works by comparing three token locations:
						 * - previousItemToken is the last token of the previous item
						 * - commaToken is the location of the comma before the current item
						 * - currentItemToken is the first token of the current item
						 *
						 * These values get switched around if item is undefined.
						 * previousItemToken will refer to the last token not belonging
						 * to the current item, which could be a comma or an opening
						 * square bracket. currentItemToken could be a comma.
						 *
						 * All comparisons are done based on these tokens directly, so
						 * they are always valid regardless of an undefined item.
						 */
						if (astUtils.isCommaToken(commaToken)) {
							validateCommaItemSpacing(
								previousItemToken,
								commaToken,
								currentItemToken,
								reportItem,
							);
						}

						if (item) {
							const tokenAfterItem = sourceCode.getTokenAfter(
								item,
								astUtils.isNotClosingParenToken,
							);

							previousItemToken = tokenAfterItem
								? sourceCode.getTokenBefore(tokenAfterItem)
								: sourceCode.ast.tokens.at(-1);
						} else {
							previousItemToken = currentItemToken;
						}
					});

					/*
					 * Special case for array literals that have empty last items, such
					 * as [ 1, 2, ]. These arrays only have two items show up in the
					 * AST, so we need to look at the token to verify that there's no
					 * dangling comma.
					 */
					if (arrayLiteral) {
						const lastToken = sourceCode.getLastToken(node),
							nextToLastToken = sourceCode.getTokenBefore(lastToken);

						if (astUtils.isCommaToken(nextToLastToken)) {
							validateCommaItemSpacing(
								sourceCode.getTokenBefore(nextToLastToken),
								nextToLastToken,
								lastToken,
								lastToken,
							);
						}
					}
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			const nodes = {};

			if (!exceptions.VariableDeclaration) {
				nodes.VariableDeclaration = function (node) {
					validateComma(node, "declarations");
				};
			}
			if (!exceptions.ObjectExpression) {
				nodes.ObjectExpression = function (node) {
					validateComma(node, "properties");
				};
			}
			if (!exceptions.ObjectPattern) {
				nodes.ObjectPattern = function (node) {
					validateComma(node, "properties");
				};
			}
			if (!exceptions.ArrayExpression) {
				nodes.ArrayExpression = function (node) {
					validateComma(node, "elements");
				};
			}
			if (!exceptions.ArrayPattern) {
				nodes.ArrayPattern = function (node) {
					validateComma(node, "elements");
				};
			}
			if (!exceptions.FunctionDeclaration) {
				nodes.FunctionDeclaration = function (node) {
					validateComma(node, "params");
				};
			}
			if (!exceptions.FunctionExpression) {
				nodes.FunctionExpression = function (node) {
					validateComma(node, "params");
				};
			}
			if (!exceptions.ArrowFunctionExpression) {
				nodes.ArrowFunctionExpression = function (node) {
					validateComma(node, "params");
				};
			}
			if (!exceptions.CallExpression) {
				nodes.CallExpression = function (node) {
					validateComma(node, "arguments");
				};
			}
			if (!exceptions.ImportDeclaration) {
				nodes.ImportDeclaration = function (node) {
					validateComma(node, "specifiers");
				};
			}
			if (!exceptions.NewExpression) {
				nodes.NewExpression = function (node) {
					validateComma(node, "arguments");
				};
			}

			return nodes;
		},
	};
	return commaStyle;
}

/**
 * @fileoverview Utilities to operate on strings.
 * @author Stephen Wade
 */

var stringUtils;
var hasRequiredStringUtils;

function requireStringUtils () {
	if (hasRequiredStringUtils) return stringUtils;
	hasRequiredStringUtils = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	// eslint-disable-next-line no-control-regex -- intentionally including control characters
	const ASCII_REGEX = /^[\u0000-\u007f]*$/u;

	/** @type {Intl.Segmenter | undefined} */
	let segmenter;

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Converts the first letter of a string to uppercase.
	 * @param {string} string The string to operate on
	 * @returns {string} The converted string
	 */
	function upperCaseFirst(string) {
		if (string.length <= 1) {
			return string.toUpperCase();
		}
		return string[0].toUpperCase() + string.slice(1);
	}

	/**
	 * Counts graphemes in a given string.
	 * @param {string} value A string to count graphemes.
	 * @returns {number} The number of graphemes in `value`.
	 */
	function getGraphemeCount(value) {
		if (ASCII_REGEX.test(value)) {
			return value.length;
		}

		segmenter ??= new Intl.Segmenter("en-US"); // en-US locale should be supported everywhere
		let graphemeCount = 0;

		// eslint-disable-next-line no-unused-vars -- for-of needs a variable
		for (const unused of segmenter.segment(value)) {
			graphemeCount++;
		}

		return graphemeCount;
	}

	stringUtils = {
		upperCaseFirst,
		getGraphemeCount,
	};
	return stringUtils;
}

/**
 * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity.
 * Counts the number of if, conditional, for, while, try, switch/case,
 * @author Patrick Brosset
 */

var complexity;
var hasRequiredComplexity;

function requireComplexity () {
	if (hasRequiredComplexity) return complexity;
	hasRequiredComplexity = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { upperCaseFirst } = requireStringUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const THRESHOLD_DEFAULT = 20;

	/** @type {import('../shared/types').Rule} */
	complexity = {
		meta: {
			type: "suggestion",

			defaultOptions: [THRESHOLD_DEFAULT],

			docs: {
				description:
					"Enforce a maximum cyclomatic complexity allowed in a program",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/complexity",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								maximum: {
									type: "integer",
									minimum: 0,
								},
								max: {
									type: "integer",
									minimum: 0,
								},
								variant: {
									enum: ["classic", "modified"],
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				complex:
					"{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}.",
			},
		},

		create(context) {
			const option = context.options[0];
			let threshold = THRESHOLD_DEFAULT;
			let VARIANT = "classic";

			if (typeof option === "object") {
				if (
					Object.hasOwn(option, "maximum") ||
					Object.hasOwn(option, "max")
				) {
					threshold = option.maximum || option.max;
				}

				if (Object.hasOwn(option, "variant")) {
					VARIANT = option.variant;
				}
			} else if (typeof option === "number") {
				threshold = option;
			}

			const IS_MODIFIED_COMPLEXITY = VARIANT === "modified";

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			// Using a stack to store complexity per code path
			const complexities = [];

			/**
			 * Increase the complexity of the code path in context
			 * @returns {void}
			 * @private
			 */
			function increaseComplexity() {
				complexities[complexities.length - 1]++;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				onCodePathStart() {
					// The initial complexity is 1, representing one execution path in the CodePath
					complexities.push(1);
				},

				// Each branching in the code adds 1 to the complexity
				CatchClause: increaseComplexity,
				ConditionalExpression: increaseComplexity,
				LogicalExpression: increaseComplexity,
				ForStatement: increaseComplexity,
				ForInStatement: increaseComplexity,
				ForOfStatement: increaseComplexity,
				IfStatement: increaseComplexity,
				WhileStatement: increaseComplexity,
				DoWhileStatement: increaseComplexity,
				AssignmentPattern: increaseComplexity,

				// Avoid `default`
				"SwitchCase[test]": () =>
					IS_MODIFIED_COMPLEXITY || increaseComplexity(),
				SwitchStatement: () =>
					IS_MODIFIED_COMPLEXITY && increaseComplexity(),

				// Logical assignment operators have short-circuiting behavior
				AssignmentExpression(node) {
					if (astUtils.isLogicalAssignmentOperator(node.operator)) {
						increaseComplexity();
					}
				},

				MemberExpression(node) {
					if (node.optional === true) {
						increaseComplexity();
					}
				},

				CallExpression(node) {
					if (node.optional === true) {
						increaseComplexity();
					}
				},

				onCodePathEnd(codePath, node) {
					const complexity = complexities.pop();

					/*
					 * This rule only evaluates complexity of functions, so "program" is excluded.
					 * Class field initializers and class static blocks are implicit functions. Therefore,
					 * they shouldn't contribute to the enclosing function's complexity, but their
					 * own complexity should be evaluated.
					 */
					if (
						codePath.origin !== "function" &&
						codePath.origin !== "class-field-initializer" &&
						codePath.origin !== "class-static-block"
					) {
						return;
					}

					if (complexity > threshold) {
						let name;

						if (codePath.origin === "class-field-initializer") {
							name = "class field initializer";
						} else if (codePath.origin === "class-static-block") {
							name = "class static block";
						} else {
							name = astUtils.getFunctionNameWithKind(node);
						}

						context.report({
							node,
							messageId: "complex",
							data: {
								name: upperCaseFirst(name),
								complexity,
								max: threshold,
							},
						});
					}
				},
			};
		},
	};
	return complexity;
}

/**
 * @fileoverview Disallows or enforces spaces inside computed properties.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

var computedPropertySpacing;
var hasRequiredComputedPropertySpacing;

function requireComputedPropertySpacing () {
	if (hasRequiredComputedPropertySpacing) return computedPropertySpacing;
	hasRequiredComputedPropertySpacing = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	computedPropertySpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "computed-property-spacing",
							url: "https://eslint.style/rules/js/computed-property-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing inside computed property brackets",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/computed-property-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						enforceForClassMembers: {
							type: "boolean",
							default: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedSpaceBefore:
					"There should be no space before '{{tokenValue}}'.",
				unexpectedSpaceAfter:
					"There should be no space after '{{tokenValue}}'.",

				missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
				missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
			const enforceForClassMembers =
				!context.options[1] || context.options[1].enforceForClassMembers;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports that there shouldn't be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @param {Token} tokenAfter The token after `token`.
			 * @returns {void}
			 */
			function reportNoBeginningSpace(node, token, tokenAfter) {
				context.report({
					node,
					loc: { start: token.loc.end, end: tokenAfter.loc.start },
					messageId: "unexpectedSpaceAfter",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							token.range[1],
							tokenAfter.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there shouldn't be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @param {Token} tokenBefore The token before `token`.
			 * @returns {void}
			 */
			function reportNoEndingSpace(node, token, tokenBefore) {
				context.report({
					node,
					loc: { start: tokenBefore.loc.end, end: token.loc.start },
					messageId: "unexpectedSpaceBefore",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							tokenBefore.range[1],
							token.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there should be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredBeginningSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingSpaceAfter",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.insertTextAfter(token, " ");
					},
				});
			}

			/**
			 * Reports that there should be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredEndingSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "missingSpaceBefore",
					data: {
						tokenValue: token.value,
					},
					fix(fixer) {
						return fixer.insertTextBefore(token, " ");
					},
				});
			}

			/**
			 * Returns a function that checks the spacing of a node on the property name
			 * that was passed in.
			 * @param {string} propertyName The property on the node to check for spacing
			 * @returns {Function} A function that will check spacing on a node
			 */
			function checkSpacing(propertyName) {
				return function (node) {
					if (!node.computed) {
						return;
					}

					const property = node[propertyName];

					const before = sourceCode.getTokenBefore(
							property,
							astUtils.isOpeningBracketToken,
						),
						first = sourceCode.getTokenAfter(before, {
							includeComments: true,
						}),
						after = sourceCode.getTokenAfter(
							property,
							astUtils.isClosingBracketToken,
						),
						last = sourceCode.getTokenBefore(after, {
							includeComments: true,
						});

					if (astUtils.isTokenOnSameLine(before, first)) {
						if (propertyNameMustBeSpaced) {
							if (
								!sourceCode.isSpaceBetweenTokens(before, first) &&
								astUtils.isTokenOnSameLine(before, first)
							) {
								reportRequiredBeginningSpace(node, before);
							}
						} else {
							if (sourceCode.isSpaceBetweenTokens(before, first)) {
								reportNoBeginningSpace(node, before, first);
							}
						}
					}

					if (astUtils.isTokenOnSameLine(last, after)) {
						if (propertyNameMustBeSpaced) {
							if (
								!sourceCode.isSpaceBetweenTokens(last, after) &&
								astUtils.isTokenOnSameLine(last, after)
							) {
								reportRequiredEndingSpace(node, after);
							}
						} else {
							if (sourceCode.isSpaceBetweenTokens(last, after)) {
								reportNoEndingSpace(node, after, last);
							}
						}
					}
				};
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			const listeners = {
				Property: checkSpacing("key"),
				MemberExpression: checkSpacing("property"),
			};

			if (enforceForClassMembers) {
				listeners.MethodDefinition = listeners.PropertyDefinition =
					listeners.Property;
			}

			return listeners;
		},
	};
	return computedPropertySpacing;
}

/**
 * @fileoverview Rule to flag consistent return values
 * @author Nicholas C. Zakas
 */

var consistentReturn;
var hasRequiredConsistentReturn;

function requireConsistentReturn () {
	if (hasRequiredConsistentReturn) return consistentReturn;
	hasRequiredConsistentReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { upperCaseFirst } = requireStringUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks all segments in a set and returns true if all are unreachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if all segments are unreachable; false otherwise.
	 */
	function areAllSegmentsUnreachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return false;
			}
		}

		return true;
	}

	/**
	 * Checks whether a given node is a `constructor` method in an ES6 class
	 * @param {ASTNode} node A node to check
	 * @returns {boolean} `true` if the node is a `constructor` method
	 */
	function isClassConstructor(node) {
		return (
			node.type === "FunctionExpression" &&
			node.parent &&
			node.parent.type === "MethodDefinition" &&
			node.parent.kind === "constructor"
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	consistentReturn = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require `return` statements to either always or never specify values",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/consistent-return",
			},

			schema: [
				{
					type: "object",
					properties: {
						treatUndefinedAsUnspecified: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [{ treatUndefinedAsUnspecified: false }],

			messages: {
				missingReturn: "Expected to return a value at the end of {{name}}.",
				missingReturnValue: "{{name}} expected a return value.",
				unexpectedReturnValue: "{{name}} expected no return value.",
			},
		},

		create(context) {
			const [{ treatUndefinedAsUnspecified }] = context.options;
			let funcInfo = null;

			/**
			 * Checks whether of not the implicit returning is consistent if the last
			 * code path segment is reachable.
			 * @param {ASTNode} node A program/function node to check.
			 * @returns {void}
			 */
			function checkLastSegment(node) {
				let loc, name;

				/*
				 * Skip if it expected no return value or unreachable.
				 * When unreachable, all paths are returned or thrown.
				 */
				if (
					!funcInfo.hasReturnValue ||
					areAllSegmentsUnreachable(funcInfo.currentSegments) ||
					astUtils.isES5Constructor(node) ||
					isClassConstructor(node)
				) {
					return;
				}

				// Adjust a location and a message.
				if (node.type === "Program") {
					// The head of program.
					loc = { line: 1, column: 0 };
					name = "program";
				} else if (node.type === "ArrowFunctionExpression") {
					// `=>` token
					loc = context.sourceCode.getTokenBefore(
						node.body,
						astUtils.isArrowToken,
					).loc;
				} else if (
					node.parent.type === "MethodDefinition" ||
					(node.parent.type === "Property" && node.parent.method)
				) {
					// Method name.
					loc = node.parent.key.loc;
				} else {
					// Function name or `function` keyword.
					loc = (node.id || context.sourceCode.getFirstToken(node)).loc;
				}

				if (!name) {
					name = astUtils.getFunctionNameWithKind(node);
				}

				// Reports.
				context.report({
					node,
					loc,
					messageId: "missingReturn",
					data: { name },
				});
			}

			return {
				// Initializes/Disposes state of each code path.
				onCodePathStart(codePath, node) {
					funcInfo = {
						upper: funcInfo,
						codePath,
						hasReturn: false,
						hasReturnValue: false,
						messageId: "",
						node,
						currentSegments: new Set(),
					};
				},
				onCodePathEnd() {
					funcInfo = funcInfo.upper;
				},

				onUnreachableCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				// Reports a given return statement if it's inconsistent.
				ReturnStatement(node) {
					const argument = node.argument;
					let hasReturnValue = Boolean(argument);

					if (treatUndefinedAsUnspecified && hasReturnValue) {
						hasReturnValue =
							!astUtils.isSpecificId(argument, "undefined") &&
							argument.operator !== "void";
					}

					if (!funcInfo.hasReturn) {
						funcInfo.hasReturn = true;
						funcInfo.hasReturnValue = hasReturnValue;
						funcInfo.messageId = hasReturnValue
							? "missingReturnValue"
							: "unexpectedReturnValue";
						funcInfo.data = {
							name:
								funcInfo.node.type === "Program"
									? "Program"
									: upperCaseFirst(
											astUtils.getFunctionNameWithKind(
												funcInfo.node,
											),
										),
						};
					} else if (funcInfo.hasReturnValue !== hasReturnValue) {
						context.report({
							node,
							messageId: funcInfo.messageId,
							data: funcInfo.data,
						});
					}
				},

				// Reports a given program/function if the implicit returning is not consistent.
				"Program:exit": checkLastSegment,
				"FunctionDeclaration:exit": checkLastSegment,
				"FunctionExpression:exit": checkLastSegment,
				"ArrowFunctionExpression:exit": checkLastSegment,
			};
		},
	};
	return consistentReturn;
}

/**
 * @fileoverview Rule to enforce consistent naming of "this" context variables
 * @author Raphael Pigulla
 */

var consistentThis;
var hasRequiredConsistentThis;

function requireConsistentThis () {
	if (hasRequiredConsistentThis) return consistentThis;
	hasRequiredConsistentThis = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	consistentThis = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce consistent naming when capturing the current execution context",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/consistent-this",
			},

			schema: {
				type: "array",
				items: {
					type: "string",
					minLength: 1,
				},
				uniqueItems: true,
			},

			defaultOptions: ["that"],

			messages: {
				aliasNotAssignedToThis:
					"Designated alias '{{name}}' is not assigned to 'this'.",
				unexpectedAlias: "Unexpected alias '{{name}}' for 'this'.",
			},
		},

		create(context) {
			const aliases = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports that a variable declarator or assignment expression is assigning
			 * a non-'this' value to the specified alias.
			 * @param {ASTNode} node The assigning node.
			 * @param {string} name the name of the alias that was incorrectly used.
			 * @returns {void}
			 */
			function reportBadAssignment(node, name) {
				context.report({
					node,
					messageId: "aliasNotAssignedToThis",
					data: { name },
				});
			}

			/**
			 * Checks that an assignment to an identifier only assigns 'this' to the
			 * appropriate alias, and the alias is only assigned to 'this'.
			 * @param {ASTNode} node The assigning node.
			 * @param {Identifier} name The name of the variable assigned to.
			 * @param {Expression} value The value of the assignment.
			 * @returns {void}
			 */
			function checkAssignment(node, name, value) {
				const isThis = value.type === "ThisExpression";

				if (aliases.includes(name)) {
					if (!isThis || (node.operator && node.operator !== "=")) {
						reportBadAssignment(node, name);
					}
				} else if (isThis) {
					context.report({
						node,
						messageId: "unexpectedAlias",
						data: { name },
					});
				}
			}

			/**
			 * Ensures that a variable declaration of the alias in a program or function
			 * is assigned to the correct value.
			 * @param {string} alias alias the check the assignment of.
			 * @param {Object} scope scope of the current code we are checking.
			 * @private
			 * @returns {void}
			 */
			function checkWasAssigned(alias, scope) {
				const variable = scope.set.get(alias);

				if (!variable) {
					return;
				}

				if (
					variable.defs.some(
						def =>
							def.node.type === "VariableDeclarator" &&
							def.node.init !== null,
					)
				) {
					return;
				}

				/*
				 * The alias has been declared and not assigned: check it was
				 * assigned later in the same scope.
				 */
				if (
					!variable.references.some(reference => {
						const write = reference.writeExpr;

						return (
							reference.from === scope &&
							write &&
							write.type === "ThisExpression" &&
							write.parent.operator === "="
						);
					})
				) {
					variable.defs
						.map(def => def.node)
						.forEach(node => {
							reportBadAssignment(node, alias);
						});
				}
			}

			/**
			 * Check each alias to ensure that is was assigned to the correct value.
			 * @param {ASTNode} node The node that represents the scope to check.
			 * @returns {void}
			 */
			function ensureWasAssigned(node) {
				const scope = sourceCode.getScope(node);

				// if this is program scope we also need to check module scope
				const extraScope =
					node.type === "Program" && node.sourceType === "module"
						? scope.childScopes[0]
						: null;

				aliases.forEach(alias => {
					checkWasAssigned(alias, scope);

					if (extraScope) {
						checkWasAssigned(alias, extraScope);
					}
				});
			}

			return {
				"Program:exit": ensureWasAssigned,
				"FunctionExpression:exit": ensureWasAssigned,
				"FunctionDeclaration:exit": ensureWasAssigned,

				VariableDeclarator(node) {
					const id = node.id;
					const isDestructuring =
						id.type === "ArrayPattern" || id.type === "ObjectPattern";

					if (node.init !== null && !isDestructuring) {
						checkAssignment(node, id.name, node.init);
					}
				},

				AssignmentExpression(node) {
					if (node.left.type === "Identifier") {
						checkAssignment(node, node.left.name, node.right);
					}
				},
			};
		},
	};
	return consistentThis;
}

/**
 * @fileoverview A rule to verify `super()` callings in constructor.
 * @author Toru Nagashima
 */

var constructorSuper;
var hasRequiredConstructorSuper;

function requireConstructorSuper () {
	if (hasRequiredConstructorSuper) return constructorSuper;
	hasRequiredConstructorSuper = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a constructor.
	 * @param {ASTNode} node A node to check. This node type is one of
	 *   `Program`, `FunctionDeclaration`, `FunctionExpression`, and
	 *   `ArrowFunctionExpression`.
	 * @returns {boolean} `true` if the node is a constructor.
	 */
	function isConstructorFunction(node) {
		return (
			node.type === "FunctionExpression" &&
			node.parent.type === "MethodDefinition" &&
			node.parent.kind === "constructor"
		);
	}

	/**
	 * Checks whether a given node can be a constructor or not.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node can be a constructor.
	 */
	function isPossibleConstructor(node) {
		if (!node) {
			return false;
		}

		switch (node.type) {
			case "ClassExpression":
			case "FunctionExpression":
			case "ThisExpression":
			case "MemberExpression":
			case "CallExpression":
			case "NewExpression":
			case "ChainExpression":
			case "YieldExpression":
			case "TaggedTemplateExpression":
			case "MetaProperty":
				return true;

			case "Identifier":
				return node.name !== "undefined";

			case "AssignmentExpression":
				if (["=", "&&="].includes(node.operator)) {
					return isPossibleConstructor(node.right);
				}

				if (["||=", "??="].includes(node.operator)) {
					return (
						isPossibleConstructor(node.left) ||
						isPossibleConstructor(node.right)
					);
				}

				/**
				 * All other assignment operators are mathematical assignment operators (arithmetic or bitwise).
				 * An assignment expression with a mathematical operator can either evaluate to a primitive value,
				 * or throw, depending on the operands. Thus, it cannot evaluate to a constructor function.
				 */
				return false;

			case "LogicalExpression":
				/*
				 * If the && operator short-circuits, the left side was falsy and therefore not a constructor, and if
				 * it doesn't short-circuit, it takes the value from the right side, so the right side must always be a
				 * possible constructor. A future improvement could verify that the left side could be truthy by
				 * excluding falsy literals.
				 */
				if (node.operator === "&&") {
					return isPossibleConstructor(node.right);
				}

				return (
					isPossibleConstructor(node.left) ||
					isPossibleConstructor(node.right)
				);

			case "ConditionalExpression":
				return (
					isPossibleConstructor(node.alternate) ||
					isPossibleConstructor(node.consequent)
				);

			case "SequenceExpression": {
				const lastExpression = node.expressions.at(-1);

				return isPossibleConstructor(lastExpression);
			}

			default:
				return false;
		}
	}

	/**
	 * A class to store information about a code path segment.
	 */
	class SegmentInfo {
		/**
		 * Indicates if super() is called in all code paths.
		 * @type {boolean}
		 */
		calledInEveryPaths = false;

		/**
		 * Indicates if super() is called in any code paths.
		 * @type {boolean}
		 */
		calledInSomePaths = false;

		/**
		 * The nodes which have been validated and don't need to be reconsidered.
		 * @type {ASTNode[]}
		 */
		validNodes = [];
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	constructorSuper = {
		meta: {
			type: "problem",

			docs: {
				description: "Require `super()` calls in constructors",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/constructor-super",
			},

			schema: [],

			messages: {
				missingSome: "Lacked a call of 'super()' in some code paths.",
				missingAll: "Expected to call 'super()'.",

				duplicate: "Unexpected duplicate 'super()'.",
				badSuper:
					"Unexpected 'super()' because 'super' is not a constructor.",
			},
		},

		create(context) {
			/*
			 * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]}
			 * Information for each constructor.
			 * - upper:      Information of the upper constructor.
			 * - hasExtends: A flag which shows whether own class has a valid `extends`
			 *               part.
			 * - scope:      The scope of own class.
			 * - codePath:   The code path object of the constructor.
			 */
			let funcInfo = null;

			/**
			 * @type {Record<string, SegmentInfo>}
			 */
			const segInfoMap = Object.create(null);

			/**
			 * Gets the flag which shows `super()` is called in some paths.
			 * @param {CodePathSegment} segment A code path segment to get.
			 * @returns {boolean} The flag which shows `super()` is called in some paths
			 */
			function isCalledInSomePath(segment) {
				return (
					segment.reachable && segInfoMap[segment.id].calledInSomePaths
				);
			}

			/**
			 * Determines if a segment has been seen in the traversal.
			 * @param {CodePathSegment} segment A code path segment to check.
			 * @returns {boolean} `true` if the segment has been seen.
			 */
			function hasSegmentBeenSeen(segment) {
				return !!segInfoMap[segment.id];
			}

			/**
			 * Gets the flag which shows `super()` is called in all paths.
			 * @param {CodePathSegment} segment A code path segment to get.
			 * @returns {boolean} The flag which shows `super()` is called in all paths.
			 */
			function isCalledInEveryPath(segment) {
				return (
					segment.reachable && segInfoMap[segment.id].calledInEveryPaths
				);
			}

			return {
				/**
				 * Stacks a constructor information.
				 * @param {CodePath} codePath A code path which was started.
				 * @param {ASTNode} node The current node.
				 * @returns {void}
				 */
				onCodePathStart(codePath, node) {
					if (isConstructorFunction(node)) {
						// Class > ClassBody > MethodDefinition > FunctionExpression
						const classNode = node.parent.parent.parent;
						const superClass = classNode.superClass;

						funcInfo = {
							upper: funcInfo,
							isConstructor: true,
							hasExtends: Boolean(superClass),
							superIsConstructor: isPossibleConstructor(superClass),
							codePath,
							currentSegments: new Set(),
						};
					} else {
						funcInfo = {
							upper: funcInfo,
							isConstructor: false,
							hasExtends: false,
							superIsConstructor: false,
							codePath,
							currentSegments: new Set(),
						};
					}
				},

				/**
				 * Pops a constructor information.
				 * And reports if `super()` lacked.
				 * @param {CodePath} codePath A code path which was ended.
				 * @param {ASTNode} node The current node.
				 * @returns {void}
				 */
				onCodePathEnd(codePath, node) {
					const hasExtends = funcInfo.hasExtends;

					// Pop.
					funcInfo = funcInfo.upper;

					if (!hasExtends) {
						return;
					}

					// Reports if `super()` lacked.
					const returnedSegments = codePath.returnedSegments;
					const calledInEveryPaths =
						returnedSegments.every(isCalledInEveryPath);
					const calledInSomePaths =
						returnedSegments.some(isCalledInSomePath);

					if (!calledInEveryPaths) {
						context.report({
							messageId: calledInSomePaths
								? "missingSome"
								: "missingAll",
							node: node.parent,
						});
					}
				},

				/**
				 * Initialize information of a given code path segment.
				 * @param {CodePathSegment} segment A code path segment to initialize.
				 * @param {CodePathSegment} node Node that starts the segment.
				 * @returns {void}
				 */
				onCodePathSegmentStart(segment, node) {
					funcInfo.currentSegments.add(segment);

					if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
						return;
					}

					// Initialize info.
					const info = (segInfoMap[segment.id] = new SegmentInfo());

					const seenPrevSegments =
						segment.prevSegments.filter(hasSegmentBeenSeen);

					// When there are previous segments, aggregates these.
					if (seenPrevSegments.length > 0) {
						info.calledInSomePaths =
							seenPrevSegments.some(isCalledInSomePath);
						info.calledInEveryPaths =
							seenPrevSegments.every(isCalledInEveryPath);
					}

					/*
					 * ForStatement > *.update segments are a special case as they are created in advance,
					 * without seen previous segments. Since they logically don't affect `calledInEveryPaths`
					 * calculations, and they can never be a lone previous segment of another one, we'll set
					 * their `calledInEveryPaths` to `true` to effectively ignore them in those calculations.
					 * .
					 */
					if (
						node.parent &&
						node.parent.type === "ForStatement" &&
						node.parent.update === node
					) {
						info.calledInEveryPaths = true;
					}
				},

				onUnreachableCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				/**
				 * Update information of the code path segment when a code path was
				 * looped.
				 * @param {CodePathSegment} fromSegment The code path segment of the
				 *      end of a loop.
				 * @param {CodePathSegment} toSegment A code path segment of the head
				 *      of a loop.
				 * @returns {void}
				 */
				onCodePathSegmentLoop(fromSegment, toSegment) {
					if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
						return;
					}

					funcInfo.codePath.traverseSegments(
						{ first: toSegment, last: fromSegment },
						(segment, controller) => {
							const info = segInfoMap[segment.id];

							// skip segments after the loop
							if (!info) {
								controller.skip();
								return;
							}

							const seenPrevSegments =
								segment.prevSegments.filter(hasSegmentBeenSeen);
							const calledInSomePreviousPaths =
								seenPrevSegments.some(isCalledInSomePath);
							const calledInEveryPreviousPaths =
								seenPrevSegments.every(isCalledInEveryPath);

							info.calledInSomePaths ||= calledInSomePreviousPaths;
							info.calledInEveryPaths ||= calledInEveryPreviousPaths;

							// If flags become true anew, reports the valid nodes.
							if (calledInSomePreviousPaths) {
								const nodes = info.validNodes;

								info.validNodes = [];

								for (let i = 0; i < nodes.length; ++i) {
									const node = nodes[i];

									context.report({
										messageId: "duplicate",
										node,
									});
								}
							}
						},
					);
				},

				/**
				 * Checks for a call of `super()`.
				 * @param {ASTNode} node A CallExpression node to check.
				 * @returns {void}
				 */
				"CallExpression:exit"(node) {
					if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
						return;
					}

					// Skips except `super()`.
					if (node.callee.type !== "Super") {
						return;
					}

					// Reports if needed.
					const segments = funcInfo.currentSegments;
					let duplicate = false;
					let info = null;

					for (const segment of segments) {
						if (segment.reachable) {
							info = segInfoMap[segment.id];

							duplicate = duplicate || info.calledInSomePaths;
							info.calledInSomePaths = info.calledInEveryPaths = true;
						}
					}

					if (info) {
						if (duplicate) {
							context.report({
								messageId: "duplicate",
								node,
							});
						} else if (!funcInfo.superIsConstructor) {
							context.report({
								messageId: "badSuper",
								node,
							});
						} else {
							info.validNodes.push(node);
						}
					}
				},

				/**
				 * Set the mark to the returned path as `super()` was called.
				 * @param {ASTNode} node A ReturnStatement node to check.
				 * @returns {void}
				 */
				ReturnStatement(node) {
					if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
						return;
					}

					// Skips if no argument.
					if (!node.argument) {
						return;
					}

					// Returning argument is a substitute of 'super()'.
					const segments = funcInfo.currentSegments;

					for (const segment of segments) {
						if (segment.reachable) {
							const info = segInfoMap[segment.id];

							info.calledInSomePaths = info.calledInEveryPaths = true;
						}
					}
				},
			};
		},
	};
	return constructorSuper;
}

/**
 * @fileoverview Rule to flag statements without curly braces
 * @author Nicholas C. Zakas
 */

var curly;
var hasRequiredCurly;

function requireCurly () {
	if (hasRequiredCurly) return curly;
	hasRequiredCurly = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	curly = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce consistent brace style for all control statements",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/curly",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["all"],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["multi", "multi-line", "multi-or-nest"],
							},
							{
								enum: ["consistent"],
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			defaultOptions: ["all"],

			fixable: "code",

			messages: {
				missingCurlyAfter: "Expected { after '{{name}}'.",
				missingCurlyAfterCondition:
					"Expected { after '{{name}}' condition.",
				unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.",
				unexpectedCurlyAfterCondition:
					"Unnecessary { after '{{name}}' condition.",
			},
		},

		create(context) {
			const multiOnly = context.options[0] === "multi";
			const multiLine = context.options[0] === "multi-line";
			const multiOrNest = context.options[0] === "multi-or-nest";
			const consistent = context.options[1] === "consistent";

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Determines if a given node is a one-liner that's on the same line as it's preceding code.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code.
			 * @private
			 */
			function isCollapsedOneLiner(node) {
				const before = sourceCode.getTokenBefore(node);
				const last = sourceCode.getLastToken(node);
				const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
					? sourceCode.getTokenBefore(last)
					: last;

				return (
					before.loc.start.line === lastExcludingSemicolon.loc.end.line
				);
			}

			/**
			 * Determines if a given node is a one-liner.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node is a one-liner.
			 * @private
			 */
			function isOneLiner(node) {
				if (node.type === "EmptyStatement") {
					return true;
				}

				const first = sourceCode.getFirstToken(node);
				const last = sourceCode.getLastToken(node);
				const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
					? sourceCode.getTokenBefore(last)
					: last;

				return first.loc.start.line === lastExcludingSemicolon.loc.end.line;
			}

			/**
			 * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError.
			 * @param {Token} closingBracket The } token
			 * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block.
			 */
			function needsSemicolon(closingBracket) {
				const tokenBefore = sourceCode.getTokenBefore(closingBracket);
				const tokenAfter = sourceCode.getTokenAfter(closingBracket);
				const lastBlockNode = sourceCode.getNodeByRangeIndex(
					tokenBefore.range[0],
				);

				if (astUtils.isSemicolonToken(tokenBefore)) {
					// If the last statement already has a semicolon, don't add another one.
					return false;
				}

				if (!tokenAfter) {
					// If there are no statements after this block, there is no need to add a semicolon.
					return false;
				}

				if (
					lastBlockNode.type === "BlockStatement" &&
					lastBlockNode.parent.type !== "FunctionExpression" &&
					lastBlockNode.parent.type !== "ArrowFunctionExpression"
				) {
					/*
					 * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression),
					 * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause
					 * a SyntaxError if it was followed by `else`.
					 */
					return false;
				}

				if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) {
					// If the next token is on the same line, insert a semicolon.
					return true;
				}

				if (/^[([/`+-]/u.test(tokenAfter.value)) {
					// If the next token starts with a character that would disrupt ASI, insert a semicolon.
					return true;
				}

				if (
					tokenBefore.type === "Punctuator" &&
					(tokenBefore.value === "++" || tokenBefore.value === "--")
				) {
					// If the last token is ++ or --, insert a semicolon to avoid disrupting ASI.
					return true;
				}

				// Otherwise, do not insert a semicolon.
				return false;
			}

			/**
			 * Prepares to check the body of a node to see if it's a block statement.
			 * @param {ASTNode} node The node to report if there's a problem.
			 * @param {ASTNode} body The body node to check for blocks.
			 * @param {string} name The name to report if there's a problem.
			 * @param {{ condition: boolean }} opts Options to pass to the report functions
			 * @returns {Object} a prepared check object, with "actual", "expected", "check" properties.
			 *   "actual" will be `true` or `false` whether the body is already a block statement.
			 *   "expected" will be `true` or `false` if the body should be a block statement or not, or
			 *   `null` if it doesn't matter, depending on the rule options. It can be modified to change
			 *   the final behavior of "check".
			 *   "check" will be a function reporting appropriate problems depending on the other
			 *   properties.
			 */
			function prepareCheck(node, body, name, opts) {
				const hasBlock = body.type === "BlockStatement";
				let expected = null;

				if (
					hasBlock &&
					(body.body.length !== 1 ||
						astUtils.areBracesNecessary(body, sourceCode))
				) {
					expected = true;
				} else if (multiOnly) {
					expected = false;
				} else if (multiLine) {
					if (!isCollapsedOneLiner(body)) {
						expected = true;
					}

					// otherwise, the body is allowed to have braces or not to have braces
				} else if (multiOrNest) {
					if (hasBlock) {
						const statement = body.body[0];
						const leadingCommentsInBlock =
							sourceCode.getCommentsBefore(statement);

						expected =
							!isOneLiner(statement) ||
							leadingCommentsInBlock.length > 0;
					} else {
						expected = !isOneLiner(body);
					}
				} else {
					// default "all"
					expected = true;
				}

				return {
					actual: hasBlock,
					expected,
					check() {
						if (
							this.expected !== null &&
							this.expected !== this.actual
						) {
							if (this.expected) {
								context.report({
									node,
									loc: body.loc,
									messageId:
										opts && opts.condition
											? "missingCurlyAfterCondition"
											: "missingCurlyAfter",
									data: {
										name,
									},
									fix: fixer =>
										fixer.replaceText(
											body,
											`{${sourceCode.getText(body)}}`,
										),
								});
							} else {
								context.report({
									node,
									loc: body.loc,
									messageId:
										opts && opts.condition
											? "unexpectedCurlyAfterCondition"
											: "unexpectedCurlyAfter",
									data: {
										name,
									},
									fix(fixer) {
										/*
										 * `do while` expressions sometimes need a space to be inserted after `do`.
										 * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)`
										 */
										const needsPrecedingSpace =
											node.type === "DoWhileStatement" &&
											sourceCode.getTokenBefore(body)
												.range[1] === body.range[0] &&
											!astUtils.canTokensBeAdjacent(
												"do",
												sourceCode.getFirstToken(body, {
													skip: 1,
												}),
											);

										const openingBracket =
											sourceCode.getFirstToken(body);
										const closingBracket =
											sourceCode.getLastToken(body);
										const lastTokenInBlock =
											sourceCode.getTokenBefore(
												closingBracket,
											);

										if (needsSemicolon(closingBracket)) {
											/*
											 * If removing braces would cause a SyntaxError due to multiple statements on the same line (or
											 * change the semantics of the code due to ASI), don't perform a fix.
											 */
											return null;
										}

										const resultingBodyText =
											sourceCode
												.getText()
												.slice(
													openingBracket.range[1],
													lastTokenInBlock.range[0],
												) +
											sourceCode.getText(lastTokenInBlock) +
											sourceCode
												.getText()
												.slice(
													lastTokenInBlock.range[1],
													closingBracket.range[0],
												);

										return fixer.replaceText(
											body,
											(needsPrecedingSpace ? " " : "") +
												resultingBodyText,
										);
									},
								});
							}
						}
					},
				};
			}

			/**
			 * Prepares to check the bodies of a "if", "else if" and "else" chain.
			 * @param {ASTNode} node The first IfStatement node of the chain.
			 * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more
			 *   information.
			 */
			function prepareIfChecks(node) {
				const preparedChecks = [];

				for (
					let currentNode = node;
					currentNode;
					currentNode = currentNode.alternate
				) {
					preparedChecks.push(
						prepareCheck(currentNode, currentNode.consequent, "if", {
							condition: true,
						}),
					);
					if (
						currentNode.alternate &&
						currentNode.alternate.type !== "IfStatement"
					) {
						preparedChecks.push(
							prepareCheck(
								currentNode,
								currentNode.alternate,
								"else",
							),
						);
						break;
					}
				}

				if (consistent) {
					/*
					 * If any node should have or already have braces, make sure they
					 * all have braces.
					 * If all nodes shouldn't have braces, make sure they don't.
					 */
					const expected = preparedChecks.some(preparedCheck => {
						if (preparedCheck.expected !== null) {
							return preparedCheck.expected;
						}
						return preparedCheck.actual;
					});

					preparedChecks.forEach(preparedCheck => {
						preparedCheck.expected = expected;
					});
				}

				return preparedChecks;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				IfStatement(node) {
					const parent = node.parent;
					const isElseIf =
						parent.type === "IfStatement" && parent.alternate === node;

					if (!isElseIf) {
						// This is a top `if`, check the whole `if-else-if` chain
						prepareIfChecks(node).forEach(preparedCheck => {
							preparedCheck.check();
						});
					}

					// Skip `else if`, it's already checked (when the top `if` was visited)
				},

				WhileStatement(node) {
					prepareCheck(node, node.body, "while", {
						condition: true,
					}).check();
				},

				DoWhileStatement(node) {
					prepareCheck(node, node.body, "do").check();
				},

				ForStatement(node) {
					prepareCheck(node, node.body, "for", {
						condition: true,
					}).check();
				},

				ForInStatement(node) {
					prepareCheck(node, node.body, "for-in").check();
				},

				ForOfStatement(node) {
					prepareCheck(node, node.body, "for-of").check();
				},
			};
		},
	};
	return curly;
}

/**
 * @fileoverview require default case in switch statements
 * @author Aliaksei Shytkin
 */

var defaultCase;
var hasRequiredDefaultCase;

function requireDefaultCase () {
	if (hasRequiredDefaultCase) return defaultCase;
	hasRequiredDefaultCase = 1;

	const DEFAULT_COMMENT_PATTERN = /^no default$/iu;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	defaultCase = {
		meta: {
			type: "suggestion",

			defaultOptions: [{}],

			docs: {
				description: "Require `default` cases in `switch` statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/default-case",
			},

			schema: [
				{
					type: "object",
					properties: {
						commentPattern: {
							type: "string",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missingDefaultCase: "Expected a default case.",
			},
		},

		create(context) {
			const [options] = context.options;
			const commentPattern = options.commentPattern
				? new RegExp(options.commentPattern, "u")
				: DEFAULT_COMMENT_PATTERN;

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Shortcut to get last element of array
			 * @param {*[]} collection Array
			 * @returns {any} Last element
			 */
			function last(collection) {
				return collection.at(-1);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				SwitchStatement(node) {
					if (!node.cases.length) {
						/*
						 * skip check of empty switch because there is no easy way
						 * to extract comments inside it now
						 */
						return;
					}

					const hasDefault = node.cases.some(v => v.test === null);

					if (!hasDefault) {
						let comment;

						const lastCase = last(node.cases);
						const comments = sourceCode.getCommentsAfter(lastCase);

						if (comments.length) {
							comment = last(comments);
						}

						if (
							!comment ||
							!commentPattern.test(comment.value.trim())
						) {
							context.report({
								node,
								messageId: "missingDefaultCase",
							});
						}
					}
				},
			};
		},
	};
	return defaultCase;
}

/**
 * @fileoverview Rule to enforce `default` clauses in `switch` statements to be last
 * @author Milos Djermanovic
 */

var defaultCaseLast;
var hasRequiredDefaultCaseLast;

function requireDefaultCaseLast () {
	if (hasRequiredDefaultCaseLast) return defaultCaseLast;
	hasRequiredDefaultCaseLast = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	defaultCaseLast = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce `default` clauses in `switch` statements to be last",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/default-case-last",
			},

			schema: [],

			messages: {
				notLast: "Default clause should be the last clause.",
			},
		},

		create(context) {
			return {
				SwitchStatement(node) {
					const cases = node.cases,
						indexOfDefault = cases.findIndex(c => c.test === null);

					if (
						indexOfDefault !== -1 &&
						indexOfDefault !== cases.length - 1
					) {
						const defaultClause = cases[indexOfDefault];

						context.report({
							node: defaultClause,
							messageId: "notLast",
						});
					}
				},
			};
		},
	};
	return defaultCaseLast;
}

/**
 * @fileoverview enforce default parameters to be last
 * @author Chiawen Chen
 */

var defaultParamLast;
var hasRequiredDefaultParamLast;

function requireDefaultParamLast () {
	if (hasRequiredDefaultParamLast) return defaultParamLast;
	hasRequiredDefaultParamLast = 1;

	/**
	 * Checks if node is required: i.e. does not have a default value or ? optional indicator.
	 * @param {ASTNode} node the node to be evaluated
	 * @returns {boolean} true if the node is required, false if not.
	 */
	function isRequiredParameter(node) {
		return !(
			node.type === "AssignmentPattern" ||
			node.type === "RestElement" ||
			node.optional
		);
	}

	/** @type {import('../shared/types').Rule} */
	defaultParamLast = {
		meta: {
			dialects: ["javascript", "typescript"],
			language: "javascript",
			type: "suggestion",

			docs: {
				description: "Enforce default parameters to be last",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/default-param-last",
			},

			schema: [],

			messages: {
				shouldBeLast: "Default parameters should be last.",
			},
		},

		create(context) {
			/**
			 * Handler for function contexts.
			 * @param {ASTNode} node function node
			 * @returns {void}
			 */
			function handleFunction(node) {
				let hasSeenRequiredParameter = false;

				for (let i = node.params.length - 1; i >= 0; i -= 1) {
					const current = node.params[i];
					const param =
						current.type === "TSParameterProperty"
							? current.parameter
							: current;

					if (isRequiredParameter(param)) {
						hasSeenRequiredParameter = true;
						continue;
					}

					if (hasSeenRequiredParameter) {
						context.report({
							node: current,
							messageId: "shouldBeLast",
						});
					}
				}
			}

			return {
				FunctionDeclaration: handleFunction,
				FunctionExpression: handleFunction,
				ArrowFunctionExpression: handleFunction,
			};
		},
	};
	return defaultParamLast;
}

/**
 * @fileoverview Validates newlines before and after dots
 * @author Greg Cochard
 * @deprecated in ESLint v8.53.0
 */

var dotLocation;
var hasRequiredDotLocation;

function requireDotLocation () {
	if (hasRequiredDotLocation) return dotLocation;
	hasRequiredDotLocation = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	dotLocation = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "dot-location",
							url: "https://eslint.style/rules/js/dot-location",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent newlines before and after dots",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/dot-location",
			},

			schema: [
				{
					enum: ["object", "property"],
				},
			],

			fixable: "code",

			messages: {
				expectedDotAfterObject:
					"Expected dot to be on same line as object.",
				expectedDotBeforeProperty:
					"Expected dot to be on same line as property.",
			},
		},

		create(context) {
			const config = context.options[0];

			// default to onObject if no preference is passed
			const onObject = config === "object" || !config;

			const sourceCode = context.sourceCode;

			/**
			 * Reports if the dot between object and property is on the correct location.
			 * @param {ASTNode} node The `MemberExpression` node.
			 * @returns {void}
			 */
			function checkDotLocation(node) {
				const property = node.property;
				const dotToken = sourceCode.getTokenBefore(property);

				if (onObject) {
					// `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node.
					const tokenBeforeDot = sourceCode.getTokenBefore(dotToken);

					if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dotToken)) {
						context.report({
							node,
							loc: dotToken.loc,
							messageId: "expectedDotAfterObject",
							*fix(fixer) {
								if (
									dotToken.value.startsWith(".") &&
									astUtils.isDecimalIntegerNumericToken(
										tokenBeforeDot,
									)
								) {
									yield fixer.insertTextAfter(
										tokenBeforeDot,
										` ${dotToken.value}`,
									);
								} else {
									yield fixer.insertTextAfter(
										tokenBeforeDot,
										dotToken.value,
									);
								}
								yield fixer.remove(dotToken);
							},
						});
					}
				} else if (!astUtils.isTokenOnSameLine(dotToken, property)) {
					context.report({
						node,
						loc: dotToken.loc,
						messageId: "expectedDotBeforeProperty",
						*fix(fixer) {
							yield fixer.remove(dotToken);
							yield fixer.insertTextBefore(property, dotToken.value);
						},
					});
				}
			}

			/**
			 * Checks the spacing of the dot within a member expression.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkNode(node) {
				if (!node.computed) {
					checkDotLocation(node);
				}
			}

			return {
				MemberExpression: checkNode,
			};
		},
	};
	return dotLocation;
}

/**
 * @fileoverview A shared list of ES3 keywords.
 * @author Josh Perez
 */

var keywords;
var hasRequiredKeywords;

function requireKeywords () {
	if (hasRequiredKeywords) return keywords;
	hasRequiredKeywords = 1;

	keywords = [
		"abstract",
		"boolean",
		"break",
		"byte",
		"case",
		"catch",
		"char",
		"class",
		"const",
		"continue",
		"debugger",
		"default",
		"delete",
		"do",
		"double",
		"else",
		"enum",
		"export",
		"extends",
		"false",
		"final",
		"finally",
		"float",
		"for",
		"function",
		"goto",
		"if",
		"implements",
		"import",
		"in",
		"instanceof",
		"int",
		"interface",
		"long",
		"native",
		"new",
		"null",
		"package",
		"private",
		"protected",
		"public",
		"return",
		"short",
		"static",
		"super",
		"switch",
		"synchronized",
		"this",
		"throw",
		"throws",
		"transient",
		"true",
		"try",
		"typeof",
		"var",
		"void",
		"volatile",
		"while",
		"with",
	];
	return keywords;
}

/**
 * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible.
 * @author Josh Perez
 */

var dotNotation;
var hasRequiredDotNotation;

function requireDotNotation () {
	if (hasRequiredDotNotation) return dotNotation;
	hasRequiredDotNotation = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const keywords = requireKeywords();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u;

	// `null` literal must be handled separately.
	const literalTypesToCheck = new Set(["string", "boolean"]);

	/** @type {import('../shared/types').Rule} */
	dotNotation = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowKeywords: true,
					allowPattern: "",
				},
			],

			docs: {
				description: "Enforce dot notation whenever possible",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/dot-notation",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowKeywords: {
							type: "boolean",
						},
						allowPattern: {
							type: "string",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				useDot: "[{{key}}] is better written in dot notation.",
				useBrackets: ".{{key}} is a syntax error.",
			},
		},

		create(context) {
			const [options] = context.options;
			const allowKeywords = options.allowKeywords;
			const sourceCode = context.sourceCode;

			let allowPattern;

			if (options.allowPattern) {
				allowPattern = new RegExp(options.allowPattern, "u");
			}

			/**
			 * Check if the property is valid dot notation
			 * @param {ASTNode} node The dot notation node
			 * @param {string} value Value which is to be checked
			 * @returns {void}
			 */
			function checkComputedProperty(node, value) {
				if (
					validIdentifier.test(value) &&
					(allowKeywords || !keywords.includes(String(value))) &&
					!(allowPattern && allowPattern.test(value))
				) {
					const formattedValue =
						node.property.type === "Literal"
							? JSON.stringify(value)
							: `\`${value}\``;

					context.report({
						node: node.property,
						messageId: "useDot",
						data: {
							key: formattedValue,
						},
						*fix(fixer) {
							const leftBracket = sourceCode.getTokenAfter(
								node.object,
								astUtils.isOpeningBracketToken,
							);
							const rightBracket = sourceCode.getLastToken(node);
							const nextToken = sourceCode.getTokenAfter(node);

							// Don't perform any fixes if there are comments inside the brackets.
							if (
								sourceCode.commentsExistBetween(
									leftBracket,
									rightBracket,
								)
							) {
								return;
							}

							// Replace the brackets by an identifier.
							if (!node.optional) {
								yield fixer.insertTextBefore(
									leftBracket,
									astUtils.isDecimalInteger(node.object)
										? " ."
										: ".",
								);
							}
							yield fixer.replaceTextRange(
								[leftBracket.range[0], rightBracket.range[1]],
								value,
							);

							// Insert a space after the property if it will be connected to the next token.
							if (
								nextToken &&
								rightBracket.range[1] === nextToken.range[0] &&
								!astUtils.canTokensBeAdjacent(
									String(value),
									nextToken,
								)
							) {
								yield fixer.insertTextAfter(node, " ");
							}
						},
					});
				}
			}

			return {
				MemberExpression(node) {
					if (
						node.computed &&
						node.property.type === "Literal" &&
						(literalTypesToCheck.has(typeof node.property.value) ||
							astUtils.isNullLiteral(node.property))
					) {
						checkComputedProperty(node, node.property.value);
					}
					if (
						node.computed &&
						astUtils.isStaticTemplateLiteral(node.property)
					) {
						checkComputedProperty(
							node,
							node.property.quasis[0].value.cooked,
						);
					}
					if (
						!allowKeywords &&
						!node.computed &&
						node.property.type === "Identifier" &&
						keywords.includes(String(node.property.name))
					) {
						context.report({
							node: node.property,
							messageId: "useBrackets",
							data: {
								key: node.property.name,
							},
							*fix(fixer) {
								const dotToken = sourceCode.getTokenBefore(
									node.property,
								);

								// A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression.
								if (
									node.object.type === "Identifier" &&
									node.object.name === "let" &&
									!node.optional
								) {
									return;
								}

								// Don't perform any fixes if there are comments between the dot and the property name.
								if (
									sourceCode.commentsExistBetween(
										dotToken,
										node.property,
									)
								) {
									return;
								}

								// Replace the identifier to brackets.
								if (!node.optional) {
									yield fixer.remove(dotToken);
								}
								yield fixer.replaceText(
									node.property,
									`["${node.property.name}"]`,
								);
							},
						});
					}
				},
			};
		},
	};
	return dotNotation;
}

/**
 * @fileoverview Require or disallow newline at the end of files
 * @author Nodeca Team <https://github.com/nodeca>
 * @deprecated in ESLint v8.53.0
 */

var eolLast;
var hasRequiredEolLast;

function requireEolLast () {
	if (hasRequiredEolLast) return eolLast;
	hasRequiredEolLast = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	eolLast = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "eol-last",
							url: "https://eslint.style/rules/js/eol-last",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require or disallow newline at the end of files",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/eol-last",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never", "unix", "windows"],
				},
			],

			messages: {
				missing: "Newline required at end of file but not found.",
				unexpected: "Newline not allowed at end of file.",
			},
		},
		create(context) {
			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: function checkBadEOF(node) {
					const sourceCode = context.sourceCode,
						src = sourceCode.getText(),
						lastLine = sourceCode.lines.at(-1),
						location = {
							column: lastLine.length,
							line: sourceCode.lines.length,
						},
						LF = "\n",
						CRLF = `\r${LF}`,
						endsWithNewline = src.endsWith(LF);

					/*
					 * Empty source is always valid: No content in file so we don't
					 * need to lint for a newline on the last line of content.
					 */
					if (!src.length) {
						return;
					}

					let mode = context.options[0] || "always",
						appendCRLF = false;

					if (mode === "unix") {
						// `"unix"` should behave exactly as `"always"`
						mode = "always";
					}
					if (mode === "windows") {
						// `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility
						mode = "always";
						appendCRLF = true;
					}
					if (mode === "always" && !endsWithNewline) {
						// File is not newline-terminated, but should be
						context.report({
							node,
							loc: location,
							messageId: "missing",
							fix(fixer) {
								return fixer.insertTextAfterRange(
									[0, src.length],
									appendCRLF ? CRLF : LF,
								);
							},
						});
					} else if (mode === "never" && endsWithNewline) {
						const secondLastLine = sourceCode.lines.at(-2);

						// File is newline-terminated, but shouldn't be
						context.report({
							node,
							loc: {
								start: {
									line: sourceCode.lines.length - 1,
									column: secondLastLine.length,
								},
								end: { line: sourceCode.lines.length, column: 0 },
							},
							messageId: "unexpected",
							fix(fixer) {
								const finalEOLs = /(?:\r?\n)+$/u,
									match = finalEOLs.exec(sourceCode.text),
									start = match.index,
									end = sourceCode.text.length;

								return fixer.replaceTextRange([start, end], "");
							},
						});
					}
				},
			};
		},
	};
	return eolLast;
}

/**
 * @fileoverview Rule to flag statements that use != and == instead of !== and ===
 * @author Nicholas C. Zakas
 */

var eqeqeq;
var hasRequiredEqeqeq;

function requireEqeqeq () {
	if (hasRequiredEqeqeq) return eqeqeq;
	hasRequiredEqeqeq = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	eqeqeq = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require the use of `===` and `!==`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/eqeqeq",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["always"],
							},
							{
								type: "object",
								properties: {
									null: {
										enum: ["always", "never", "ignore"],
									},
								},
								additionalProperties: false,
							},
						],
						additionalItems: false,
					},
					{
						type: "array",
						items: [
							{
								enum: ["smart", "allow-null"],
							},
						],
						additionalItems: false,
					},
				],
			},

			fixable: "code",

			messages: {
				unexpected:
					"Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'.",
			},
		},

		create(context) {
			const config = context.options[0] || "always";
			const options = context.options[1] || {};
			const sourceCode = context.sourceCode;

			const nullOption =
				config === "always" ? options.null || "always" : "ignore";
			const enforceRuleForNull = nullOption === "always";
			const enforceInverseRuleForNull = nullOption === "never";

			/**
			 * Checks if an expression is a typeof expression
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} if the node is a typeof expression
			 */
			function isTypeOf(node) {
				return (
					node.type === "UnaryExpression" && node.operator === "typeof"
				);
			}

			/**
			 * Checks if either operand of a binary expression is a typeof operation
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} if one of the operands is typeof
			 * @private
			 */
			function isTypeOfBinary(node) {
				return isTypeOf(node.left) || isTypeOf(node.right);
			}

			/**
			 * Checks if operands are literals of the same type (via typeof)
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} if operands are of same type
			 * @private
			 */
			function areLiteralsAndSameType(node) {
				return (
					node.left.type === "Literal" &&
					node.right.type === "Literal" &&
					typeof node.left.value === typeof node.right.value
				);
			}

			/**
			 * Checks if one of the operands is a literal null
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} if operands are null
			 * @private
			 */
			function isNullCheck(node) {
				return (
					astUtils.isNullLiteral(node.right) ||
					astUtils.isNullLiteral(node.left)
				);
			}

			/**
			 * Reports a message for this rule.
			 * @param {ASTNode} node The binary expression node that was checked
			 * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==')
			 * @returns {void}
			 * @private
			 */
			function report(node, expectedOperator) {
				const operatorToken = sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);

				context.report({
					node,
					loc: operatorToken.loc,
					messageId: "unexpected",
					data: { expectedOperator, actualOperator: node.operator },
					fix(fixer) {
						// If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix.
						if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) {
							return fixer.replaceText(
								operatorToken,
								expectedOperator,
							);
						}
						return null;
					},
				});
			}

			return {
				BinaryExpression(node) {
					const isNull = isNullCheck(node);

					if (node.operator !== "==" && node.operator !== "!=") {
						if (enforceInverseRuleForNull && isNull) {
							report(node, node.operator.slice(0, -1));
						}
						return;
					}

					if (
						config === "smart" &&
						(isTypeOfBinary(node) ||
							areLiteralsAndSameType(node) ||
							isNull)
					) {
						return;
					}

					if (!enforceRuleForNull && isNull) {
						return;
					}

					report(node, `${node.operator}=`);
				},
			};
		},
	};
	return eqeqeq;
}

/**
 * @fileoverview enforce `for` loop update clause moving the counter in the right direction.(for-direction)
 * @author Aladdin-ADD<hh_2013@foxmail.com>
 */

var forDirection;
var hasRequiredForDirection;

function requireForDirection () {
	if (hasRequiredForDirection) return forDirection;
	hasRequiredForDirection = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { getStaticValue } = /*@__PURE__*/ requireEslintUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	forDirection = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Enforce `for` loop update clause moving the counter in the right direction",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/for-direction",
			},

			fixable: null,
			schema: [],

			messages: {
				incorrectDirection:
					"The update clause in this loop moves the variable in the wrong direction.",
			},
		},

		create(context) {
			const { sourceCode } = context;

			/**
			 * report an error.
			 * @param {ASTNode} node the node to report.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "incorrectDirection",
				});
			}

			/**
			 * check the right side of the assignment
			 * @param {ASTNode} update UpdateExpression to check
			 * @param {int} dir expected direction that could either be turned around or invalidated
			 * @returns {int} return dir, the negated dir, or zero if the counter does not change or the direction is not clear
			 */
			function getRightDirection(update, dir) {
				const staticValue = getStaticValue(
					update.right,
					sourceCode.getScope(update),
				);

				if (
					staticValue &&
					["bigint", "boolean", "number"].includes(
						typeof staticValue.value,
					)
				) {
					const sign = Math.sign(Number(staticValue.value)) || 0; // convert NaN to 0

					return dir * sign;
				}
				return 0;
			}

			/**
			 * check UpdateExpression add/sub the counter
			 * @param {ASTNode} update UpdateExpression to check
			 * @param {string} counter variable name to check
			 * @returns {int} if add return 1, if sub return -1, if nochange, return 0
			 */
			function getUpdateDirection(update, counter) {
				if (
					update.argument.type === "Identifier" &&
					update.argument.name === counter
				) {
					if (update.operator === "++") {
						return 1;
					}
					if (update.operator === "--") {
						return -1;
					}
				}
				return 0;
			}

			/**
			 * check AssignmentExpression add/sub the counter
			 * @param {ASTNode} update AssignmentExpression to check
			 * @param {string} counter variable name to check
			 * @returns {int} if add return 1, if sub return -1, if nochange, return 0
			 */
			function getAssignmentDirection(update, counter) {
				if (update.left.name === counter) {
					if (update.operator === "+=") {
						return getRightDirection(update, 1);
					}
					if (update.operator === "-=") {
						return getRightDirection(update, -1);
					}
				}
				return 0;
			}

			return {
				ForStatement(node) {
					if (
						node.test &&
						node.test.type === "BinaryExpression" &&
						node.update
					) {
						for (const counterPosition of ["left", "right"]) {
							if (node.test[counterPosition].type !== "Identifier") {
								continue;
							}

							const counter = node.test[counterPosition].name;
							const operator = node.test.operator;
							const update = node.update;

							let wrongDirection;

							if (operator === "<" || operator === "<=") {
								wrongDirection =
									counterPosition === "left" ? -1 : 1;
							} else if (operator === ">" || operator === ">=") {
								wrongDirection =
									counterPosition === "left" ? 1 : -1;
							} else {
								return;
							}

							if (update.type === "UpdateExpression") {
								if (
									getUpdateDirection(update, counter) ===
									wrongDirection
								) {
									report(node);
								}
							} else if (
								update.type === "AssignmentExpression" &&
								getAssignmentDirection(update, counter) ===
									wrongDirection
							) {
								report(node);
							}
						}
					}
				},
			};
		},
	};
	return forDirection;
}

/**
 * @fileoverview Rule to control spacing within function calls
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

var funcCallSpacing;
var hasRequiredFuncCallSpacing;

function requireFuncCallSpacing () {
	if (hasRequiredFuncCallSpacing) return funcCallSpacing;
	hasRequiredFuncCallSpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	funcCallSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "function-call-spacing",
							url: "https://eslint.style/rules/js/function-call-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require or disallow spacing between function identifiers and their invocations",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/func-call-spacing",
			},

			fixable: "whitespace",

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["never"],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["always"],
							},
							{
								type: "object",
								properties: {
									allowNewlines: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			messages: {
				unexpectedWhitespace:
					"Unexpected whitespace between function name and paren.",
				unexpectedNewline:
					"Unexpected newline between function name and paren.",
				missing: "Missing space between function name and paren.",
			},
		},

		create(context) {
			const never = context.options[0] !== "always";
			const allowNewlines =
				!never && context.options[1] && context.options[1].allowNewlines;
			const sourceCode = context.sourceCode;
			const text = sourceCode.getText();

			/**
			 * Check if open space is present in a function name
			 * @param {ASTNode} node node to evaluate
			 * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee.
			 * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments.
			 * @returns {void}
			 * @private
			 */
			function checkSpacing(node, leftToken, rightToken) {
				const textBetweenTokens = text
					.slice(leftToken.range[1], rightToken.range[0])
					.replace(/\/\*.*?\*\//gu, "");
				const hasWhitespace = /\s/u.test(textBetweenTokens);
				const hasNewline =
					hasWhitespace &&
					astUtils.LINEBREAK_MATCHER.test(textBetweenTokens);

				/*
				 * never allowNewlines hasWhitespace hasNewline message
				 * F     F             F             F          Missing space between function name and paren.
				 * F     F             F             T          (Invalid `!hasWhitespace && hasNewline`)
				 * F     F             T             T          Unexpected newline between function name and paren.
				 * F     F             T             F          (OK)
				 * F     T             T             F          (OK)
				 * F     T             T             T          (OK)
				 * F     T             F             T          (Invalid `!hasWhitespace && hasNewline`)
				 * F     T             F             F          Missing space between function name and paren.
				 * T     T             F             F          (Invalid `never && allowNewlines`)
				 * T     T             F             T          (Invalid `!hasWhitespace && hasNewline`)
				 * T     T             T             T          (Invalid `never && allowNewlines`)
				 * T     T             T             F          (Invalid `never && allowNewlines`)
				 * T     F             T             F          Unexpected space between function name and paren.
				 * T     F             T             T          Unexpected space between function name and paren.
				 * T     F             F             T          (Invalid `!hasWhitespace && hasNewline`)
				 * T     F             F             F          (OK)
				 *
				 * T                   T                        Unexpected space between function name and paren.
				 * F                   F                        Missing space between function name and paren.
				 * F     F                           T          Unexpected newline between function name and paren.
				 */

				if (never && hasWhitespace) {
					context.report({
						node,
						loc: {
							start: leftToken.loc.end,
							end: {
								line: rightToken.loc.start.line,
								column: rightToken.loc.start.column - 1,
							},
						},
						messageId: "unexpectedWhitespace",
						fix(fixer) {
							// Don't remove comments.
							if (
								sourceCode.commentsExistBetween(
									leftToken,
									rightToken,
								)
							) {
								return null;
							}

							// If `?.` exists, it doesn't hide no-unexpected-multiline errors
							if (node.optional) {
								return fixer.replaceTextRange(
									[leftToken.range[1], rightToken.range[0]],
									"?.",
								);
							}

							/*
							 * Only autofix if there is no newline
							 * https://github.com/eslint/eslint/issues/7787
							 */
							if (hasNewline) {
								return null;
							}
							return fixer.removeRange([
								leftToken.range[1],
								rightToken.range[0],
							]);
						},
					});
				} else if (!never && !hasWhitespace) {
					context.report({
						node,
						loc: {
							start: {
								line: leftToken.loc.end.line,
								column: leftToken.loc.end.column - 1,
							},
							end: rightToken.loc.start,
						},
						messageId: "missing",
						fix(fixer) {
							if (node.optional) {
								return null; // Not sure if inserting a space to either before/after `?.` token.
							}
							return fixer.insertTextBefore(rightToken, " ");
						},
					});
				} else if (!never && !allowNewlines && hasNewline) {
					context.report({
						node,
						loc: {
							start: leftToken.loc.end,
							end: rightToken.loc.start,
						},
						messageId: "unexpectedNewline",
						fix(fixer) {
							/*
							 * Only autofix if there is no newline
							 * https://github.com/eslint/eslint/issues/7787
							 * But if `?.` exists, it doesn't hide no-unexpected-multiline errors
							 */
							if (!node.optional) {
								return null;
							}

							// Don't remove comments.
							if (
								sourceCode.commentsExistBetween(
									leftToken,
									rightToken,
								)
							) {
								return null;
							}

							const range = [leftToken.range[1], rightToken.range[0]];
							const qdToken = sourceCode.getTokenAfter(leftToken);

							if (qdToken.range[0] === leftToken.range[1]) {
								return fixer.replaceTextRange(range, "?. ");
							}
							if (qdToken.range[1] === rightToken.range[0]) {
								return fixer.replaceTextRange(range, " ?.");
							}
							return fixer.replaceTextRange(range, " ?. ");
						},
					});
				}
			}

			return {
				"CallExpression, NewExpression"(node) {
					const lastToken = sourceCode.getLastToken(node);
					const lastCalleeToken = sourceCode.getLastToken(node.callee);
					const parenToken = sourceCode.getFirstTokenBetween(
						lastCalleeToken,
						lastToken,
						astUtils.isOpeningParenToken,
					);
					const prevToken =
						parenToken &&
						sourceCode.getTokenBefore(
							parenToken,
							astUtils.isNotQuestionDotToken,
						);

					// Parens in NewExpression are optional
					if (!(parenToken && parenToken.range[1] < node.range[1])) {
						return;
					}

					checkSpacing(node, prevToken, parenToken);
				},

				ImportExpression(node) {
					const leftToken = sourceCode.getFirstToken(node);
					const rightToken = sourceCode.getTokenAfter(leftToken);

					checkSpacing(node, leftToken, rightToken);
				},
			};
		},
	};
	return funcCallSpacing;
}

/**
 * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned.
 * @author Annie Zhang, Pavel Strashkin
 */

var funcNameMatching;
var hasRequiredFuncNameMatching;

function requireFuncNameMatching () {
	if (hasRequiredFuncNameMatching) return funcNameMatching;
	hasRequiredFuncNameMatching = 1;

	//--------------------------------------------------------------------------
	// Requirements
	//--------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const esutils = requireUtils();

	//--------------------------------------------------------------------------
	// Helpers
	//--------------------------------------------------------------------------

	/**
	 * Determines if a pattern is `module.exports` or `module["exports"]`
	 * @param {ASTNode} pattern The left side of the AssignmentExpression
	 * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]`
	 */
	function isModuleExports(pattern) {
		if (
			pattern.type === "MemberExpression" &&
			pattern.object.type === "Identifier" &&
			pattern.object.name === "module"
		) {
			// module.exports
			if (
				pattern.property.type === "Identifier" &&
				pattern.property.name === "exports"
			) {
				return true;
			}

			// module["exports"]
			if (
				pattern.property.type === "Literal" &&
				pattern.property.value === "exports"
			) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Determines if a string name is a valid identifier
	 * @param {string} name The string to be checked
	 * @param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config
	 * @returns {boolean} True if the string is a valid identifier
	 */
	function isIdentifier(name, ecmaVersion) {
		if (ecmaVersion >= 2015) {
			return esutils.keyword.isIdentifierES6(name);
		}
		return esutils.keyword.isIdentifierES5(name);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const alwaysOrNever = { enum: ["always", "never"] };
	const optionsObject = {
		type: "object",
		properties: {
			considerPropertyDescriptor: {
				type: "boolean",
			},
			includeCommonJSModuleExports: {
				type: "boolean",
			},
		},
		additionalProperties: false,
	};

	/** @type {import('../shared/types').Rule} */
	funcNameMatching = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require function names to match the name of the variable or property to which they are assigned",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/func-name-matching",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						additionalItems: false,
						items: [alwaysOrNever, optionsObject],
					},
					{
						type: "array",
						additionalItems: false,
						items: [optionsObject],
					},
				],
			},

			messages: {
				matchProperty:
					"Function name `{{funcName}}` should match property name `{{name}}`.",
				matchVariable:
					"Function name `{{funcName}}` should match variable name `{{name}}`.",
				notMatchProperty:
					"Function name `{{funcName}}` should not match property name `{{name}}`.",
				notMatchVariable:
					"Function name `{{funcName}}` should not match variable name `{{name}}`.",
			},
		},

		create(context) {
			const options =
				(typeof context.options[0] === "object"
					? context.options[0]
					: context.options[1]) || {};
			const nameMatches =
				typeof context.options[0] === "string"
					? context.options[0]
					: "always";
			const considerPropertyDescriptor = options.considerPropertyDescriptor;
			const includeModuleExports = options.includeCommonJSModuleExports;
			const ecmaVersion = context.languageOptions.ecmaVersion;

			/**
			 * Check whether node is a certain CallExpression.
			 * @param {string} objName object name
			 * @param {string} funcName function name
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} `true` if node matches CallExpression
			 */
			function isPropertyCall(objName, funcName, node) {
				if (!node) {
					return false;
				}
				return (
					node.type === "CallExpression" &&
					astUtils.isSpecificMemberAccess(node.callee, objName, funcName)
				);
			}

			/**
			 * Compares identifiers based on the nameMatches option
			 * @param {string} x the first identifier
			 * @param {string} y the second identifier
			 * @returns {boolean} whether the two identifiers should warn.
			 */
			function shouldWarn(x, y) {
				return (
					(nameMatches === "always" && x !== y) ||
					(nameMatches === "never" && x === y)
				);
			}

			/**
			 * Reports
			 * @param {ASTNode} node The node to report
			 * @param {string} name The variable or property name
			 * @param {string} funcName The function name
			 * @param {boolean} isProp True if the reported node is a property assignment
			 * @returns {void}
			 */
			function report(node, name, funcName, isProp) {
				let messageId;

				if (nameMatches === "always" && isProp) {
					messageId = "matchProperty";
				} else if (nameMatches === "always") {
					messageId = "matchVariable";
				} else if (isProp) {
					messageId = "notMatchProperty";
				} else {
					messageId = "notMatchVariable";
				}
				context.report({
					node,
					messageId,
					data: {
						name,
						funcName,
					},
				});
			}

			/**
			 * Determines whether a given node is a string literal
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} `true` if the node is a string literal
			 */
			function isStringLiteral(node) {
				return node.type === "Literal" && typeof node.value === "string";
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				VariableDeclarator(node) {
					if (
						!node.init ||
						node.init.type !== "FunctionExpression" ||
						node.id.type !== "Identifier"
					) {
						return;
					}
					if (
						node.init.id &&
						shouldWarn(node.id.name, node.init.id.name)
					) {
						report(node, node.id.name, node.init.id.name, false);
					}
				},

				AssignmentExpression(node) {
					if (
						node.right.type !== "FunctionExpression" ||
						(node.left.computed &&
							node.left.property.type !== "Literal") ||
						(!includeModuleExports && isModuleExports(node.left)) ||
						(node.left.type !== "Identifier" &&
							node.left.type !== "MemberExpression")
					) {
						return;
					}

					const isProp = node.left.type === "MemberExpression";
					const name = isProp
						? astUtils.getStaticPropertyName(node.left)
						: node.left.name;

					if (
						node.right.id &&
						name &&
						isIdentifier(name) &&
						shouldWarn(name, node.right.id.name)
					) {
						report(node, name, node.right.id.name, isProp);
					}
				},

				"Property, PropertyDefinition[value]"(node) {
					if (
						!(node.value.type === "FunctionExpression" && node.value.id)
					) {
						return;
					}

					if (node.key.type === "Identifier" && !node.computed) {
						const functionName = node.value.id.name;
						let propertyName = node.key.name;

						if (
							considerPropertyDescriptor &&
							propertyName === "value" &&
							node.parent.type === "ObjectExpression"
						) {
							if (
								isPropertyCall(
									"Object",
									"defineProperty",
									node.parent.parent,
								) ||
								isPropertyCall(
									"Reflect",
									"defineProperty",
									node.parent.parent,
								)
							) {
								const property = node.parent.parent.arguments[1];

								if (
									isStringLiteral(property) &&
									shouldWarn(property.value, functionName)
								) {
									report(
										node,
										property.value,
										functionName,
										true,
									);
								}
							} else if (
								isPropertyCall(
									"Object",
									"defineProperties",
									node.parent.parent.parent.parent,
								)
							) {
								propertyName = node.parent.parent.key.name;
								if (
									!node.parent.parent.computed &&
									shouldWarn(propertyName, functionName)
								) {
									report(node, propertyName, functionName, true);
								}
							} else if (
								isPropertyCall(
									"Object",
									"create",
									node.parent.parent.parent.parent,
								)
							) {
								propertyName = node.parent.parent.key.name;
								if (
									!node.parent.parent.computed &&
									shouldWarn(propertyName, functionName)
								) {
									report(node, propertyName, functionName, true);
								}
							} else if (shouldWarn(propertyName, functionName)) {
								report(node, propertyName, functionName, true);
							}
						} else if (shouldWarn(propertyName, functionName)) {
							report(node, propertyName, functionName, true);
						}
						return;
					}

					if (
						isStringLiteral(node.key) &&
						isIdentifier(node.key.value, ecmaVersion) &&
						shouldWarn(node.key.value, node.value.id.name)
					) {
						report(node, node.key.value, node.value.id.name, true);
					}
				},
			};
		},
	};
	return funcNameMatching;
}

/**
 * @fileoverview Rule to warn when a function expression does not have a name.
 * @author Kyle T. Nunery
 */

var funcNames;
var hasRequiredFuncNames;

function requireFuncNames () {
	if (hasRequiredFuncNames) return funcNames;
	hasRequiredFuncNames = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	/**
	 * Checks whether or not a given variable is a function name.
	 * @param {eslint-scope.Variable} variable A variable to check.
	 * @returns {boolean} `true` if the variable is a function name.
	 */
	function isFunctionName(variable) {
		return variable && variable.defs[0].type === "FunctionName";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	funcNames = {
		meta: {
			type: "suggestion",

			defaultOptions: ["always", {}],

			docs: {
				description: "Require or disallow named `function` expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/func-names",
			},

			schema: {
				definitions: {
					value: {
						enum: ["always", "as-needed", "never"],
					},
				},
				items: [
					{
						$ref: "#/definitions/value",
					},
					{
						type: "object",
						properties: {
							generators: {
								$ref: "#/definitions/value",
							},
						},
						additionalProperties: false,
					},
				],
			},

			messages: {
				unnamed: "Unexpected unnamed {{name}}.",
				named: "Unexpected named {{name}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Returns the config option for the given node.
			 * @param {ASTNode} node A node to get the config for.
			 * @returns {string} The config option.
			 */
			function getConfigForNode(node) {
				if (node.generator && context.options[1].generators) {
					return context.options[1].generators;
				}

				return context.options[0];
			}

			/**
			 * Determines whether the current FunctionExpression node is a get, set, or
			 * shorthand method in an object literal or a class.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} True if the node is a get, set, or shorthand method.
			 */
			function isObjectOrClassMethod(node) {
				const parent = node.parent;

				return (
					parent.type === "MethodDefinition" ||
					(parent.type === "Property" &&
						(parent.method ||
							parent.kind === "get" ||
							parent.kind === "set"))
				);
			}

			/**
			 * Determines whether the current FunctionExpression node has a name that would be
			 * inferred from context in a conforming ES6 environment.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} True if the node would have a name assigned automatically.
			 */
			function hasInferredName(node) {
				const parent = node.parent;

				return (
					isObjectOrClassMethod(node) ||
					(parent.type === "VariableDeclarator" &&
						parent.id.type === "Identifier" &&
						parent.init === node) ||
					(parent.type === "Property" && parent.value === node) ||
					(parent.type === "PropertyDefinition" &&
						parent.value === node) ||
					(parent.type === "AssignmentExpression" &&
						parent.left.type === "Identifier" &&
						parent.right === node) ||
					(parent.type === "AssignmentPattern" &&
						parent.left.type === "Identifier" &&
						parent.right === node)
				);
			}

			/**
			 * Reports that an unnamed function should be named
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @returns {void}
			 */
			function reportUnexpectedUnnamedFunction(node) {
				context.report({
					node,
					messageId: "unnamed",
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					data: { name: astUtils.getFunctionNameWithKind(node) },
				});
			}

			/**
			 * Reports that a named function should be unnamed
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @returns {void}
			 */
			function reportUnexpectedNamedFunction(node) {
				context.report({
					node,
					messageId: "named",
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					data: { name: astUtils.getFunctionNameWithKind(node) },
				});
			}

			/**
			 * The listener for function nodes.
			 * @param {ASTNode} node function node
			 * @returns {void}
			 */
			function handleFunction(node) {
				// Skip recursive functions.
				const nameVar = sourceCode.getDeclaredVariables(node)[0];

				if (isFunctionName(nameVar) && nameVar.references.length > 0) {
					return;
				}

				const hasName = Boolean(node.id && node.id.name);
				const config = getConfigForNode(node);

				if (config === "never") {
					if (hasName && node.type !== "FunctionDeclaration") {
						reportUnexpectedNamedFunction(node);
					}
				} else if (config === "as-needed") {
					if (!hasName && !hasInferredName(node)) {
						reportUnexpectedUnnamedFunction(node);
					}
				} else {
					if (!hasName && !isObjectOrClassMethod(node)) {
						reportUnexpectedUnnamedFunction(node);
					}
				}
			}

			return {
				"FunctionExpression:exit": handleFunction,
				"ExportDefaultDeclaration > FunctionDeclaration": handleFunction,
			};
		},
	};
	return funcNames;
}

/**
 * @fileoverview Rule to enforce a particular function style
 * @author Nicholas C. Zakas
 */

var funcStyle;
var hasRequiredFuncStyle;

function requireFuncStyle () {
	if (hasRequiredFuncStyle) return funcStyle;
	hasRequiredFuncStyle = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	funcStyle = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				"expression",
				{
					allowArrowFunctions: false,
					overrides: {},
				},
			],

			docs: {
				description:
					"Enforce the consistent use of either `function` declarations or expressions assigned to variables",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/func-style",
			},

			schema: [
				{
					enum: ["declaration", "expression"],
				},
				{
					type: "object",
					properties: {
						allowArrowFunctions: {
							type: "boolean",
						},
						overrides: {
							type: "object",
							properties: {
								namedExports: {
									enum: ["declaration", "expression", "ignore"],
								},
							},
							additionalProperties: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				expression: "Expected a function expression.",
				declaration: "Expected a function declaration.",
			},
		},

		create(context) {
			const [style, { allowArrowFunctions, overrides }] = context.options;
			const enforceDeclarations = style === "declaration";
			const { namedExports: exportFunctionStyle } = overrides;
			const stack = [];

			const nodesToCheck = {
				FunctionDeclaration(node) {
					stack.push(false);

					if (
						!enforceDeclarations &&
						node.parent.type !== "ExportDefaultDeclaration" &&
						(typeof exportFunctionStyle === "undefined" ||
							node.parent.type !== "ExportNamedDeclaration")
					) {
						context.report({ node, messageId: "expression" });
					}

					if (
						node.parent.type === "ExportNamedDeclaration" &&
						exportFunctionStyle === "expression"
					) {
						context.report({ node, messageId: "expression" });
					}
				},
				"FunctionDeclaration:exit"() {
					stack.pop();
				},

				FunctionExpression(node) {
					stack.push(false);

					if (
						enforceDeclarations &&
						node.parent.type === "VariableDeclarator" &&
						(typeof exportFunctionStyle === "undefined" ||
							node.parent.parent.parent.type !==
								"ExportNamedDeclaration")
					) {
						context.report({
							node: node.parent,
							messageId: "declaration",
						});
					}

					if (
						node.parent.type === "VariableDeclarator" &&
						node.parent.parent.parent.type ===
							"ExportNamedDeclaration" &&
						exportFunctionStyle === "declaration"
					) {
						context.report({
							node: node.parent,
							messageId: "declaration",
						});
					}
				},
				"FunctionExpression:exit"() {
					stack.pop();
				},

				"ThisExpression, Super"() {
					if (stack.length > 0) {
						stack[stack.length - 1] = true;
					}
				},
			};

			if (!allowArrowFunctions) {
				nodesToCheck.ArrowFunctionExpression = function () {
					stack.push(false);
				};

				nodesToCheck["ArrowFunctionExpression:exit"] = function (node) {
					const hasThisOrSuperExpr = stack.pop();

					if (
						!hasThisOrSuperExpr &&
						node.parent.type === "VariableDeclarator"
					) {
						if (
							enforceDeclarations &&
							(typeof exportFunctionStyle === "undefined" ||
								node.parent.parent.parent.type !==
									"ExportNamedDeclaration")
						) {
							context.report({
								node: node.parent,
								messageId: "declaration",
							});
						}

						if (
							node.parent.parent.parent.type ===
								"ExportNamedDeclaration" &&
							exportFunctionStyle === "declaration"
						) {
							context.report({
								node: node.parent,
								messageId: "declaration",
							});
						}
					}
				};
			}

			return nodesToCheck;
		},
	};
	return funcStyle;
}

/**
 * @fileoverview Rule to enforce line breaks between arguments of a function call
 * @author Alexey Gonchar <https://github.com/finico>
 * @deprecated in ESLint v8.53.0
 */

var functionCallArgumentNewline;
var hasRequiredFunctionCallArgumentNewline;

function requireFunctionCallArgumentNewline () {
	if (hasRequiredFunctionCallArgumentNewline) return functionCallArgumentNewline;
	hasRequiredFunctionCallArgumentNewline = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	functionCallArgumentNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "function-call-argument-newline",
							url: "https://eslint.style/rules/js/function-call-argument-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce line breaks between arguments of a function call",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/function-call-argument-newline",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never", "consistent"],
				},
			],

			messages: {
				unexpectedLineBreak: "There should be no line break here.",
				missingLineBreak:
					"There should be a line break after this argument.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const checkers = {
				unexpected: {
					messageId: "unexpectedLineBreak",
					check: (prevToken, currentToken) =>
						prevToken.loc.end.line !== currentToken.loc.start.line,
					createFix: (token, tokenBefore) => fixer =>
						fixer.replaceTextRange(
							[tokenBefore.range[1], token.range[0]],
							" ",
						),
				},
				missing: {
					messageId: "missingLineBreak",
					check: (prevToken, currentToken) =>
						prevToken.loc.end.line === currentToken.loc.start.line,
					createFix: (token, tokenBefore) => fixer =>
						fixer.replaceTextRange(
							[tokenBefore.range[1], token.range[0]],
							"\n",
						),
				},
			};

			/**
			 * Check all arguments for line breaks in the CallExpression
			 * @param {CallExpression} node node to evaluate
			 * @param {{ messageId: string, check: Function }} checker selected checker
			 * @returns {void}
			 * @private
			 */
			function checkArguments(node, checker) {
				for (let i = 1; i < node.arguments.length; i++) {
					const prevArgToken = sourceCode.getLastToken(
						node.arguments[i - 1],
					);
					const currentArgToken = sourceCode.getFirstToken(
						node.arguments[i],
					);

					if (checker.check(prevArgToken, currentArgToken)) {
						const tokenBefore = sourceCode.getTokenBefore(
							currentArgToken,
							{ includeComments: true },
						);

						const hasLineCommentBefore = tokenBefore.type === "Line";

						context.report({
							node,
							loc: {
								start: tokenBefore.loc.end,
								end: currentArgToken.loc.start,
							},
							messageId: checker.messageId,
							fix: hasLineCommentBefore
								? null
								: checker.createFix(currentArgToken, tokenBefore),
						});
					}
				}
			}

			/**
			 * Check if open space is present in a function name
			 * @param {CallExpression} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function check(node) {
				if (node.arguments.length < 2) {
					return;
				}

				const option = context.options[0] || "always";

				if (option === "never") {
					checkArguments(node, checkers.unexpected);
				} else if (option === "always") {
					checkArguments(node, checkers.missing);
				} else if (option === "consistent") {
					const firstArgToken = sourceCode.getLastToken(
						node.arguments[0],
					);
					const secondArgToken = sourceCode.getFirstToken(
						node.arguments[1],
					);

					if (
						firstArgToken.loc.end.line === secondArgToken.loc.start.line
					) {
						checkArguments(node, checkers.unexpected);
					} else {
						checkArguments(node, checkers.missing);
					}
				}
			}

			return {
				CallExpression: check,
				NewExpression: check,
			};
		},
	};
	return functionCallArgumentNewline;
}

/**
 * @fileoverview enforce consistent line breaks inside function parentheses
 * @author Teddy Katz
 * @deprecated in ESLint v8.53.0
 */

var functionParenNewline;
var hasRequiredFunctionParenNewline;

function requireFunctionParenNewline () {
	if (hasRequiredFunctionParenNewline) return functionParenNewline;
	hasRequiredFunctionParenNewline = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	functionParenNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "function-paren-newline",
							url: "https://eslint.style/rules/js/function-paren-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent line breaks inside function parentheses",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/function-paren-newline",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: [
								"always",
								"never",
								"consistent",
								"multiline",
								"multiline-arguments",
							],
						},
						{
							type: "object",
							properties: {
								minItems: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				expectedBefore: "Expected newline before ')'.",
				expectedAfter: "Expected newline after '('.",
				expectedBetween: "Expected newline between arguments/params.",
				unexpectedBefore: "Unexpected newline before ')'.",
				unexpectedAfter: "Unexpected newline after '('.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const rawOption = context.options[0] || "multiline";
			const multilineOption = rawOption === "multiline";
			const multilineArgumentsOption = rawOption === "multiline-arguments";
			const consistentOption = rawOption === "consistent";
			let minItems;

			if (typeof rawOption === "object") {
				minItems = rawOption.minItems;
			} else if (rawOption === "always") {
				minItems = 0;
			} else if (rawOption === "never") {
				minItems = Infinity;
			} else {
				minItems = null;
			}

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Determines whether there should be newlines inside function parens
			 * @param {ASTNode[]} elements The arguments or parameters in the list
			 * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code.
			 * @returns {boolean} `true` if there should be newlines inside the function parens
			 */
			function shouldHaveNewlines(elements, hasLeftNewline) {
				if (multilineArgumentsOption && elements.length === 1) {
					return hasLeftNewline;
				}
				if (multilineOption || multilineArgumentsOption) {
					return elements.some(
						(element, index) =>
							index !== elements.length - 1 &&
							element.loc.end.line !==
								elements[index + 1].loc.start.line,
					);
				}
				if (consistentOption) {
					return hasLeftNewline;
				}
				return elements.length >= minItems;
			}

			/**
			 * Validates parens
			 * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
			 * @param {ASTNode[]} elements The arguments or parameters in the list
			 * @returns {void}
			 */
			function validateParens(parens, elements) {
				const leftParen = parens.leftParen;
				const rightParen = parens.rightParen;
				const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
				const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen);
				const hasLeftNewline = !astUtils.isTokenOnSameLine(
					leftParen,
					tokenAfterLeftParen,
				);
				const hasRightNewline = !astUtils.isTokenOnSameLine(
					tokenBeforeRightParen,
					rightParen,
				);
				const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

				if (hasLeftNewline && !needsNewlines) {
					context.report({
						node: leftParen,
						messageId: "unexpectedAfter",
						fix(fixer) {
							return sourceCode
								.getText()
								.slice(
									leftParen.range[1],
									tokenAfterLeftParen.range[0],
								)
								.trim()
								? // If there is a comment between the ( and the first element, don't do a fix.
									null
								: fixer.removeRange([
										leftParen.range[1],
										tokenAfterLeftParen.range[0],
									]);
						},
					});
				} else if (!hasLeftNewline && needsNewlines) {
					context.report({
						node: leftParen,
						messageId: "expectedAfter",
						fix: fixer => fixer.insertTextAfter(leftParen, "\n"),
					});
				}

				if (hasRightNewline && !needsNewlines) {
					context.report({
						node: rightParen,
						messageId: "unexpectedBefore",
						fix(fixer) {
							return sourceCode
								.getText()
								.slice(
									tokenBeforeRightParen.range[1],
									rightParen.range[0],
								)
								.trim()
								? // If there is a comment between the last element and the ), don't do a fix.
									null
								: fixer.removeRange([
										tokenBeforeRightParen.range[1],
										rightParen.range[0],
									]);
						},
					});
				} else if (!hasRightNewline && needsNewlines) {
					context.report({
						node: rightParen,
						messageId: "expectedBefore",
						fix: fixer => fixer.insertTextBefore(rightParen, "\n"),
					});
				}
			}

			/**
			 * Validates a list of arguments or parameters
			 * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
			 * @param {ASTNode[]} elements The arguments or parameters in the list
			 * @returns {void}
			 */
			function validateArguments(parens, elements) {
				const leftParen = parens.leftParen;
				const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
				const hasLeftNewline = !astUtils.isTokenOnSameLine(
					leftParen,
					tokenAfterLeftParen,
				);
				const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

				for (let i = 0; i <= elements.length - 2; i++) {
					const currentElement = elements[i];
					const nextElement = elements[i + 1];
					const hasNewLine =
						currentElement.loc.end.line !== nextElement.loc.start.line;

					if (!hasNewLine && needsNewlines) {
						context.report({
							node: currentElement,
							messageId: "expectedBetween",
							fix: fixer => fixer.insertTextBefore(nextElement, "\n"),
						});
					}
				}
			}

			/**
			 * Gets the left paren and right paren tokens of a node.
			 * @param {ASTNode} node The node with parens
			 * @throws {TypeError} Unexpected node type.
			 * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
			 * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression
			 * with a single parameter)
			 */
			function getParenTokens(node) {
				switch (node.type) {
					case "NewExpression":
						if (
							!node.arguments.length &&
							!(
								astUtils.isOpeningParenToken(
									sourceCode.getLastToken(node, { skip: 1 }),
								) &&
								astUtils.isClosingParenToken(
									sourceCode.getLastToken(node),
								) &&
								node.callee.range[1] < node.range[1]
							)
						) {
							// If the NewExpression does not have parens (e.g. `new Foo`), return null.
							return null;
						}

					// falls through

					case "CallExpression":
						return {
							leftParen: sourceCode.getTokenAfter(
								node.callee,
								astUtils.isOpeningParenToken,
							),
							rightParen: sourceCode.getLastToken(node),
						};

					case "FunctionDeclaration":
					case "FunctionExpression": {
						const leftParen = sourceCode.getFirstToken(
							node,
							astUtils.isOpeningParenToken,
						);
						const rightParen = node.params.length
							? sourceCode.getTokenAfter(
									node.params.at(-1),
									astUtils.isClosingParenToken,
								)
							: sourceCode.getTokenAfter(leftParen);

						return { leftParen, rightParen };
					}

					case "ArrowFunctionExpression": {
						const firstToken = sourceCode.getFirstToken(node, {
							skip: node.async ? 1 : 0,
						});

						if (!astUtils.isOpeningParenToken(firstToken)) {
							// If the ArrowFunctionExpression has a single param without parens, return null.
							return null;
						}

						const rightParen = node.params.length
							? sourceCode.getTokenAfter(
									node.params.at(-1),
									astUtils.isClosingParenToken,
								)
							: sourceCode.getTokenAfter(firstToken);

						return {
							leftParen: firstToken,
							rightParen,
						};
					}

					case "ImportExpression": {
						const leftParen = sourceCode.getFirstToken(node, 1);
						const rightParen = sourceCode.getLastToken(node);

						return { leftParen, rightParen };
					}

					default:
						throw new TypeError(
							`unexpected node with type ${node.type}`,
						);
				}
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				[[
					"ArrowFunctionExpression",
					"CallExpression",
					"FunctionDeclaration",
					"FunctionExpression",
					"ImportExpression",
					"NewExpression",
				]](node) {
					const parens = getParenTokens(node);
					let params;

					if (node.type === "ImportExpression") {
						params = [node.source];
					} else if (astUtils.isFunction(node)) {
						params = node.params;
					} else {
						params = node.arguments;
					}

					if (parens) {
						validateParens(parens, params);

						if (multilineArgumentsOption) {
							validateArguments(parens, params);
						}
					}
				},
			};
		},
	};
	return functionParenNewline;
}

/**
 * @fileoverview Rule to check the spacing around the * in generator functions.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

var generatorStarSpacing;
var hasRequiredGeneratorStarSpacing;

function requireGeneratorStarSpacing () {
	if (hasRequiredGeneratorStarSpacing) return generatorStarSpacing;
	hasRequiredGeneratorStarSpacing = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const OVERRIDE_SCHEMA = {
		oneOf: [
			{
				enum: ["before", "after", "both", "neither"],
			},
			{
				type: "object",
				properties: {
					before: { type: "boolean" },
					after: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],
	};

	/** @type {import('../shared/types').Rule} */
	generatorStarSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "generator-star-spacing",
							url: "https://eslint.style/rules/js/generator-star-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing around `*` operators in generator functions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/generator-star-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["before", "after", "both", "neither"],
						},
						{
							type: "object",
							properties: {
								before: { type: "boolean" },
								after: { type: "boolean" },
								named: OVERRIDE_SCHEMA,
								anonymous: OVERRIDE_SCHEMA,
								method: OVERRIDE_SCHEMA,
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				missingBefore: "Missing space before *.",
				missingAfter: "Missing space after *.",
				unexpectedBefore: "Unexpected space before *.",
				unexpectedAfter: "Unexpected space after *.",
			},
		},

		create(context) {
			const optionDefinitions = {
				before: { before: true, after: false },
				after: { before: false, after: true },
				both: { before: true, after: true },
				neither: { before: false, after: false },
			};

			/**
			 * Returns resolved option definitions based on an option and defaults
			 * @param {any} option The option object or string value
			 * @param {Object} defaults The defaults to use if options are not present
			 * @returns {Object} the resolved object definition
			 */
			function optionToDefinition(option, defaults) {
				if (!option) {
					return defaults;
				}

				return typeof option === "string"
					? optionDefinitions[option]
					: Object.assign({}, defaults, option);
			}

			const modes = (function (option) {
				const defaults = optionToDefinition(
					option,
					optionDefinitions.before,
				);

				return {
					named: optionToDefinition(option.named, defaults),
					anonymous: optionToDefinition(option.anonymous, defaults),
					method: optionToDefinition(option.method, defaults),
				};
			})(context.options[0] || {});

			const sourceCode = context.sourceCode;

			/**
			 * Checks if the given token is a star token or not.
			 * @param {Token} token The token to check.
			 * @returns {boolean} `true` if the token is a star token.
			 */
			function isStarToken(token) {
				return token.value === "*" && token.type === "Punctuator";
			}

			/**
			 * Gets the generator star token of the given function node.
			 * @param {ASTNode} node The function node to get.
			 * @returns {Token} Found star token.
			 */
			function getStarToken(node) {
				return sourceCode.getFirstToken(
					node.parent.method || node.parent.type === "MethodDefinition"
						? node.parent
						: node,
					isStarToken,
				);
			}

			/**
			 * capitalize a given string.
			 * @param {string} str the given string.
			 * @returns {string} the capitalized string.
			 */
			function capitalize(str) {
				return str[0].toUpperCase() + str.slice(1);
			}

			/**
			 * Checks the spacing between two tokens before or after the star token.
			 * @param {string} kind Either "named", "anonymous", or "method"
			 * @param {string} side Either "before" or "after".
			 * @param {Token} leftToken `function` keyword token if side is "before", or
			 *     star token if side is "after".
			 * @param {Token} rightToken Star token if side is "before", or identifier
			 *     token if side is "after".
			 * @returns {void}
			 */
			function checkSpacing(kind, side, leftToken, rightToken) {
				if (
					!!(rightToken.range[0] - leftToken.range[1]) !==
					modes[kind][side]
				) {
					const after = leftToken.value === "*";
					const spaceRequired = modes[kind][side];
					const node = after ? leftToken : rightToken;
					const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`;

					context.report({
						node,
						messageId,
						fix(fixer) {
							if (spaceRequired) {
								if (after) {
									return fixer.insertTextAfter(node, " ");
								}
								return fixer.insertTextBefore(node, " ");
							}
							return fixer.removeRange([
								leftToken.range[1],
								rightToken.range[0],
							]);
						},
					});
				}
			}

			/**
			 * Enforces the spacing around the star if node is a generator function.
			 * @param {ASTNode} node A function expression or declaration node.
			 * @returns {void}
			 */
			function checkFunction(node) {
				if (!node.generator) {
					return;
				}

				const starToken = getStarToken(node);
				const prevToken = sourceCode.getTokenBefore(starToken);
				const nextToken = sourceCode.getTokenAfter(starToken);

				let kind = "named";

				if (
					node.parent.type === "MethodDefinition" ||
					(node.parent.type === "Property" && node.parent.method)
				) {
					kind = "method";
				} else if (!node.id) {
					kind = "anonymous";
				}

				// Only check before when preceded by `function`|`static` keyword
				if (
					!(
						kind === "method" &&
						starToken === sourceCode.getFirstToken(node.parent)
					)
				) {
					checkSpacing(kind, "before", prevToken, starToken);
				}

				checkSpacing(kind, "after", starToken, nextToken);
			}

			return {
				FunctionDeclaration: checkFunction,
				FunctionExpression: checkFunction,
			};
		},
	};
	return generatorStarSpacing;
}

/**
 * @fileoverview Enforces that a return statement is present in property getters.
 * @author Aladdin-ADD(hh_2013@foxmail.com)
 */

var getterReturn;
var hasRequiredGetterReturn;

function requireGetterReturn () {
	if (hasRequiredGetterReturn) return getterReturn;
	hasRequiredGetterReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;

	/**
	 * Checks all segments in a set and returns true if any are reachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if any segment is reachable; false otherwise.
	 */
	function isAnySegmentReachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return true;
			}
		}

		return false;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	getterReturn = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowImplicit: false,
				},
			],

			docs: {
				description: "Enforce `return` statements in getters",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/getter-return",
			},

			fixable: null,

			schema: [
				{
					type: "object",
					properties: {
						allowImplicit: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				expected: "Expected to return a value in {{name}}.",
				expectedAlways: "Expected {{name}} to always return a value.",
			},
		},

		create(context) {
			const [{ allowImplicit }] = context.options;
			const sourceCode = context.sourceCode;

			let funcInfo = {
				upper: null,
				codePath: null,
				hasReturn: false,
				shouldCheck: false,
				node: null,
				currentSegments: [],
			};

			/**
			 * Checks whether or not the last code path segment is reachable.
			 * Then reports this function if the segment is reachable.
			 *
			 * If the last code path segment is reachable, there are paths which are not
			 * returned or thrown.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function checkLastSegment(node) {
				if (
					funcInfo.shouldCheck &&
					isAnySegmentReachable(funcInfo.currentSegments)
				) {
					context.report({
						node,
						loc: astUtils.getFunctionHeadLoc(node, sourceCode),
						messageId: funcInfo.hasReturn
							? "expectedAlways"
							: "expected",
						data: {
							name: astUtils.getFunctionNameWithKind(funcInfo.node),
						},
					});
				}
			}

			/**
			 * Checks whether a node means a getter function.
			 * @param {ASTNode} node a node to check.
			 * @returns {boolean} if node means a getter, return true; else return false.
			 */
			function isGetter(node) {
				const parent = node.parent;

				if (
					TARGET_NODE_TYPE.test(node.type) &&
					node.body.type === "BlockStatement"
				) {
					if (parent.kind === "get") {
						return true;
					}
					if (
						parent.type === "Property" &&
						astUtils.getStaticPropertyName(parent) === "get" &&
						parent.parent.type === "ObjectExpression"
					) {
						// Object.defineProperty() or Reflect.defineProperty()
						if (parent.parent.parent.type === "CallExpression") {
							const callNode = parent.parent.parent.callee;

							if (
								astUtils.isSpecificMemberAccess(
									callNode,
									"Object",
									"defineProperty",
								) ||
								astUtils.isSpecificMemberAccess(
									callNode,
									"Reflect",
									"defineProperty",
								)
							) {
								return true;
							}
						}

						// Object.defineProperties() or Object.create()
						if (
							parent.parent.parent.type === "Property" &&
							parent.parent.parent.parent.type ===
								"ObjectExpression" &&
							parent.parent.parent.parent.parent.type ===
								"CallExpression"
						) {
							const callNode =
								parent.parent.parent.parent.parent.callee;

							return (
								astUtils.isSpecificMemberAccess(
									callNode,
									"Object",
									"defineProperties",
								) ||
								astUtils.isSpecificMemberAccess(
									callNode,
									"Object",
									"create",
								)
							);
						}
					}
				}
				return false;
			}
			return {
				// Stacks this function's information.
				onCodePathStart(codePath, node) {
					funcInfo = {
						upper: funcInfo,
						codePath,
						hasReturn: false,
						shouldCheck: isGetter(node),
						node,
						currentSegments: new Set(),
					};
				},

				// Pops this function's information.
				onCodePathEnd() {
					funcInfo = funcInfo.upper;
				},
				onUnreachableCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				// Checks the return statement is valid.
				ReturnStatement(node) {
					if (funcInfo.shouldCheck) {
						funcInfo.hasReturn = true;

						// if allowImplicit: false, should also check node.argument
						if (!allowImplicit && !node.argument) {
							context.report({
								node,
								messageId: "expected",
								data: {
									name: astUtils.getFunctionNameWithKind(
										funcInfo.node,
									),
								},
							});
						}
					}
				},

				// Reports a given function if the last path is reachable.
				"FunctionExpression:exit": checkLastSegment,
				"ArrowFunctionExpression:exit": checkLastSegment,
			};
		},
	};
	return getterReturn;
}

/**
 * @fileoverview Rule for disallowing require() outside of the top-level module context
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */

var globalRequire;
var hasRequiredGlobalRequire;

function requireGlobalRequire () {
	if (hasRequiredGlobalRequire) return globalRequire;
	hasRequiredGlobalRequire = 1;

	const ACCEPTABLE_PARENTS = new Set([
		"AssignmentExpression",
		"VariableDeclarator",
		"MemberExpression",
		"ExpressionStatement",
		"CallExpression",
		"ConditionalExpression",
		"Program",
		"VariableDeclaration",
		"ChainExpression",
	]);

	/**
	 * Finds the eslint-scope reference in the given scope.
	 * @param {Object} scope The scope to search.
	 * @param {ASTNode} node The identifier node.
	 * @returns {Reference|null} Returns the found reference or null if none were found.
	 */
	function findReference(scope, node) {
		const references = scope.references.filter(
			reference =>
				reference.identifier.range[0] === node.range[0] &&
				reference.identifier.range[1] === node.range[1],
		);

		if (references.length === 1) {
			return references[0];
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Checks if the given identifier node is shadowed in the given scope.
	 * @param {Object} scope The current scope.
	 * @param {ASTNode} node The identifier node to check.
	 * @returns {boolean} Whether or not the name is shadowed.
	 */
	function isShadowed(scope, node) {
		const reference = findReference(scope, node);

		return (
			reference && reference.resolved && reference.resolved.defs.length > 0
		);
	}

	/** @type {import('../shared/types').Rule} */
	globalRequire = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "global-require",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description:
					"Require `require()` calls to be placed at top-level module scope",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/global-require",
			},

			schema: [],
			messages: {
				unexpected: "Unexpected require().",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				CallExpression(node) {
					const currentScope = sourceCode.getScope(node);

					if (
						node.callee.name === "require" &&
						!isShadowed(currentScope, node.callee)
					) {
						const isGoodRequire = sourceCode
							.getAncestors(node)
							.every(parent => ACCEPTABLE_PARENTS.has(parent.type));

						if (!isGoodRequire) {
							context.report({ node, messageId: "unexpected" });
						}
					}
				},
			};
		},
	};
	return globalRequire;
}

/**
 * @fileoverview Rule to require grouped accessor pairs in object literals and classes
 * @author Milos Djermanovic
 */

var groupedAccessorPairs;
var hasRequiredGroupedAccessorPairs;

function requireGroupedAccessorPairs () {
	if (hasRequiredGroupedAccessorPairs) return groupedAccessorPairs;
	hasRequiredGroupedAccessorPairs = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * Property name if it can be computed statically, otherwise the list of the tokens of the key node.
	 * @typedef {string|Token[]} Key
	 */

	/**
	 * Accessor nodes with the same key.
	 * @typedef {Object} AccessorData
	 * @property {Key} key Accessor's key
	 * @property {ASTNode[]} getters List of getter nodes.
	 * @property {ASTNode[]} setters List of setter nodes.
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not the given lists represent the equal tokens in the same order.
	 * Tokens are compared by their properties, not by instance.
	 * @param {Token[]} left First list of tokens.
	 * @param {Token[]} right Second list of tokens.
	 * @returns {boolean} `true` if the lists have same tokens.
	 */
	function areEqualTokenLists(left, right) {
		if (left.length !== right.length) {
			return false;
		}

		for (let i = 0; i < left.length; i++) {
			const leftToken = left[i],
				rightToken = right[i];

			if (
				leftToken.type !== rightToken.type ||
				leftToken.value !== rightToken.value
			) {
				return false;
			}
		}

		return true;
	}

	/**
	 * Checks whether or not the given keys are equal.
	 * @param {Key} left First key.
	 * @param {Key} right Second key.
	 * @returns {boolean} `true` if the keys are equal.
	 */
	function areEqualKeys(left, right) {
		if (typeof left === "string" && typeof right === "string") {
			// Statically computed names.
			return left === right;
		}
		if (Array.isArray(left) && Array.isArray(right)) {
			// Token lists.
			return areEqualTokenLists(left, right);
		}

		return false;
	}

	/**
	 * Checks whether or not a given node is of an accessor kind ('get' or 'set').
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is of an accessor kind.
	 */
	function isAccessorKind(node) {
		return node.kind === "get" || node.kind === "set";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	groupedAccessorPairs = {
		meta: {
			type: "suggestion",

			defaultOptions: ["anyOrder"],

			docs: {
				description:
					"Require grouped accessor pairs in object literals and classes",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/grouped-accessor-pairs",
			},

			schema: [
				{
					enum: ["anyOrder", "getBeforeSet", "setBeforeGet"],
				},
			],

			messages: {
				notGrouped:
					"Accessor pair {{ formerName }} and {{ latterName }} should be grouped.",
				invalidOrder:
					"Expected {{ latterName }} to be before {{ formerName }}.",
			},
		},

		create(context) {
			const [order] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports the given accessor pair.
			 * @param {string} messageId messageId to report.
			 * @param {ASTNode} formerNode getter/setter node that is defined before `latterNode`.
			 * @param {ASTNode} latterNode getter/setter node that is defined after `formerNode`.
			 * @returns {void}
			 * @private
			 */
			function report(messageId, formerNode, latterNode) {
				context.report({
					node: latterNode,
					messageId,
					loc: astUtils.getFunctionHeadLoc(latterNode.value, sourceCode),
					data: {
						formerName: astUtils.getFunctionNameWithKind(
							formerNode.value,
						),
						latterName: astUtils.getFunctionNameWithKind(
							latterNode.value,
						),
					},
				});
			}

			/**
			 * Checks accessor pairs in the given list of nodes.
			 * @param {ASTNode[]} nodes The list to check.
			 * @param {Function} shouldCheck – Predicate that returns `true` if the node should be checked.
			 * @returns {void}
			 * @private
			 */
			function checkList(nodes, shouldCheck) {
				const accessors = [];
				let found = false;

				for (let i = 0; i < nodes.length; i++) {
					const node = nodes[i];

					if (shouldCheck(node) && isAccessorKind(node)) {
						// Creates a new `AccessorData` object for the given getter or setter node.
						const name = astUtils.getStaticPropertyName(node);
						const key =
							name !== null ? name : sourceCode.getTokens(node.key);

						// Merges the given `AccessorData` object into the given accessors list.
						for (let j = 0; j < accessors.length; j++) {
							const accessor = accessors[j];

							if (areEqualKeys(accessor.key, key)) {
								accessor.getters.push(
									...(node.kind === "get" ? [node] : []),
								);
								accessor.setters.push(
									...(node.kind === "set" ? [node] : []),
								);
								found = true;
								break;
							}
						}
						if (!found) {
							accessors.push({
								key,
								getters: node.kind === "get" ? [node] : [],
								setters: node.kind === "set" ? [node] : [],
							});
						}
						found = false;
					}
				}

				for (const { getters, setters } of accessors) {
					// Don't report accessor properties that have duplicate getters or setters.
					if (getters.length === 1 && setters.length === 1) {
						const [getter] = getters,
							[setter] = setters,
							getterIndex = nodes.indexOf(getter),
							setterIndex = nodes.indexOf(setter),
							formerNode =
								getterIndex < setterIndex ? getter : setter,
							latterNode =
								getterIndex < setterIndex ? setter : getter;

						if (Math.abs(getterIndex - setterIndex) > 1) {
							report("notGrouped", formerNode, latterNode);
						} else if (
							(order === "getBeforeSet" &&
								getterIndex > setterIndex) ||
							(order === "setBeforeGet" && getterIndex < setterIndex)
						) {
							report("invalidOrder", formerNode, latterNode);
						}
					}
				}
			}

			return {
				ObjectExpression(node) {
					checkList(node.properties, n => n.type === "Property");
				},
				ClassBody(node) {
					checkList(
						node.body,
						n => n.type === "MethodDefinition" && !n.static,
					);
					checkList(
						node.body,
						n => n.type === "MethodDefinition" && n.static,
					);
				},
			};
		},
	};
	return groupedAccessorPairs;
}

/**
 * @fileoverview Rule to flag for-in loops without if statements inside
 * @author Nicholas C. Zakas
 */

var guardForIn;
var hasRequiredGuardForIn;

function requireGuardForIn () {
	if (hasRequiredGuardForIn) return guardForIn;
	hasRequiredGuardForIn = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	guardForIn = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require `for-in` loops to include an `if` statement",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/guard-for-in",
			},

			schema: [],
			messages: {
				wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.",
			},
		},

		create(context) {
			return {
				ForInStatement(node) {
					const body = node.body;

					// empty statement
					if (body.type === "EmptyStatement") {
						return;
					}

					// if statement
					if (body.type === "IfStatement") {
						return;
					}

					// empty block
					if (body.type === "BlockStatement" && body.body.length === 0) {
						return;
					}

					// block with just if statement
					if (
						body.type === "BlockStatement" &&
						body.body.length === 1 &&
						body.body[0].type === "IfStatement"
					) {
						return;
					}

					// block that starts with if statement
					if (
						body.type === "BlockStatement" &&
						body.body.length >= 1 &&
						body.body[0].type === "IfStatement"
					) {
						const i = body.body[0];

						// ... whose consequent is a continue
						if (i.consequent.type === "ContinueStatement") {
							return;
						}

						// ... whose consequent is a block that contains only a continue
						if (
							i.consequent.type === "BlockStatement" &&
							i.consequent.body.length === 1 &&
							i.consequent.body[0].type === "ContinueStatement"
						) {
							return;
						}
					}

					context.report({ node, messageId: "wrap" });
				},
			};
		},
	};
	return guardForIn;
}

/**
 * @fileoverview Ensure handling of errors when we know they exist.
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */

var handleCallbackErr;
var hasRequiredHandleCallbackErr;

function requireHandleCallbackErr () {
	if (hasRequiredHandleCallbackErr) return handleCallbackErr;
	hasRequiredHandleCallbackErr = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	handleCallbackErr = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "handle-callback-err",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/handle-callback-err.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Require error handling in callbacks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/handle-callback-err",
			},

			schema: [
				{
					type: "string",
				},
			],
			messages: {
				expected: "Expected error to be handled.",
			},
		},

		create(context) {
			const errorArgument = context.options[0] || "err";
			const sourceCode = context.sourceCode;

			/**
			 * Checks if the given argument should be interpreted as a regexp pattern.
			 * @param {string} stringToCheck The string which should be checked.
			 * @returns {boolean} Whether or not the string should be interpreted as a pattern.
			 */
			function isPattern(stringToCheck) {
				const firstChar = stringToCheck[0];

				return firstChar === "^";
			}

			/**
			 * Checks if the given name matches the configured error argument.
			 * @param {string} name The name which should be compared.
			 * @returns {boolean} Whether or not the given name matches the configured error variable name.
			 */
			function matchesConfiguredErrorName(name) {
				if (isPattern(errorArgument)) {
					const regexp = new RegExp(errorArgument, "u");

					return regexp.test(name);
				}
				return name === errorArgument;
			}

			/**
			 * Get the parameters of a given function scope.
			 * @param {Object} scope The function scope.
			 * @returns {Array} All parameters of the given scope.
			 */
			function getParameters(scope) {
				return scope.variables.filter(
					variable =>
						variable.defs[0] && variable.defs[0].type === "Parameter",
				);
			}

			/**
			 * Check to see if we're handling the error object properly.
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 */
			function checkForError(node) {
				const scope = sourceCode.getScope(node),
					parameters = getParameters(scope),
					firstParameter = parameters[0];

				if (
					firstParameter &&
					matchesConfiguredErrorName(firstParameter.name)
				) {
					if (firstParameter.references.length === 0) {
						context.report({ node, messageId: "expected" });
					}
				}
			}

			return {
				FunctionDeclaration: checkForError,
				FunctionExpression: checkForError,
				ArrowFunctionExpression: checkForError,
			};
		},
	};
	return handleCallbackErr;
}

/**
 * @fileoverview Rule that warns when identifier names that are
 * specified in the configuration are used.
 * @author Keith Cirkel (http://keithcirkel.co.uk)
 * @deprecated in ESLint v7.5.0
 */

var idBlacklist;
var hasRequiredIdBlacklist;

function requireIdBlacklist () {
	if (hasRequiredIdBlacklist) return idBlacklist;
	hasRequiredIdBlacklist = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether the given node represents assignment target in a normal assignment or destructuring.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is assignment target.
	 */
	function isAssignmentTarget(node) {
		const parent = node.parent;

		return (
			// normal assignment
			(parent.type === "AssignmentExpression" && parent.left === node) ||
			// destructuring
			parent.type === "ArrayPattern" ||
			parent.type === "RestElement" ||
			(parent.type === "Property" &&
				parent.value === node &&
				parent.parent.type === "ObjectPattern") ||
			(parent.type === "AssignmentPattern" && parent.left === node)
		);
	}

	/**
	 * Checks whether the given node represents an imported name that is renamed in the same import/export specifier.
	 *
	 * Examples:
	 * import { a as b } from 'mod'; // node `a` is renamed import
	 * export { a as b } from 'mod'; // node `a` is renamed import
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} `true` if the node is a renamed import.
	 */
	function isRenamedImport(node) {
		const parent = node.parent;

		return (
			(parent.type === "ImportSpecifier" &&
				parent.imported !== parent.local &&
				parent.imported === node) ||
			(parent.type === "ExportSpecifier" &&
				parent.parent.source && // re-export
				parent.local !== parent.exported &&
				parent.local === node)
		);
	}

	/**
	 * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring.
	 *
	 * Examples:
	 * const { a : b } = foo; // node `a` is renamed node.
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring.
	 */
	function isRenamedInDestructuring(node) {
		const parent = node.parent;

		return (
			!parent.computed &&
			parent.type === "Property" &&
			parent.parent.type === "ObjectPattern" &&
			parent.value !== node &&
			parent.key === node
		);
	}

	/**
	 * Checks whether the given node represents shorthand definition of a property in an object literal.
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} `true` if the node is a shorthand property definition.
	 */
	function isShorthandPropertyDefinition(node) {
		const parent = node.parent;

		return (
			parent.type === "Property" &&
			parent.parent.type === "ObjectExpression" &&
			parent.shorthand
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	idBlacklist = {
		meta: {
			deprecated: {
				message: "The rule was renamed.",
				url: "https://eslint.org/blog/2020/07/eslint-v7.5.0-released/#deprecating-id-blacklist",
				deprecatedSince: "7.5.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "id-denylist",
							url: "https://eslint.org/docs/rules/id-denylist",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow specified identifiers",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/id-blacklist",
			},

			schema: {
				type: "array",
				items: {
					type: "string",
				},
				uniqueItems: true,
			},
			messages: {
				restricted: "Identifier '{{name}}' is restricted.",
			},
		},

		create(context) {
			const denyList = new Set(context.options);
			const reportedNodes = new Set();
			const sourceCode = context.sourceCode;

			let globalScope;

			/**
			 * Checks whether the given name is restricted.
			 * @param {string} name The name to check.
			 * @returns {boolean} `true` if the name is restricted.
			 * @private
			 */
			function isRestricted(name) {
				return denyList.has(name);
			}

			/**
			 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
			 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
			 * @param {ASTNode} node `Identifier` node to check.
			 * @returns {boolean} `true` if the node is a reference to a global variable.
			 */
			function isReferenceToGlobalVariable(node) {
				const variable = globalScope.set.get(node.name);

				return (
					variable &&
					variable.defs.length === 0 &&
					variable.references.some(ref => ref.identifier === node)
				);
			}

			/**
			 * Determines whether the given node should be checked.
			 * @param {ASTNode} node `Identifier` node.
			 * @returns {boolean} `true` if the node should be checked.
			 */
			function shouldCheck(node) {
				const parent = node.parent;

				/*
				 * Member access has special rules for checking property names.
				 * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over.
				 * Write access isn't allowed, because it potentially creates a new property with a restricted name.
				 */
				if (
					parent.type === "MemberExpression" &&
					parent.property === node &&
					!parent.computed
				) {
					return isAssignmentTarget(parent);
				}

				return (
					parent.type !== "CallExpression" &&
					parent.type !== "NewExpression" &&
					!isRenamedImport(node) &&
					!isRenamedInDestructuring(node) &&
					!(
						isReferenceToGlobalVariable(node) &&
						!isShorthandPropertyDefinition(node)
					)
				);
			}

			/**
			 * Reports an AST node as a rule violation.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 * @private
			 */
			function report(node) {
				/*
				 * We used the range instead of the node because it's possible
				 * for the same identifier to be represented by two different
				 * nodes, with the most clear example being shorthand properties:
				 * { foo }
				 * In this case, "foo" is represented by one node for the name
				 * and one for the value. The only way to know they are the same
				 * is to look at the range.
				 */
				if (!reportedNodes.has(node.range.toString())) {
					context.report({
						node,
						messageId: "restricted",
						data: {
							name: node.name,
						},
					});
					reportedNodes.add(node.range.toString());
				}
			}

			return {
				Program(node) {
					globalScope = sourceCode.getScope(node);
				},

				Identifier(node) {
					if (isRestricted(node.name) && shouldCheck(node)) {
						report(node);
					}
				},
			};
		},
	};
	return idBlacklist;
}

/**
 * @fileoverview Rule that warns when identifier names that are
 * specified in the configuration are used.
 * @author Keith Cirkel (http://keithcirkel.co.uk)
 */

var idDenylist;
var hasRequiredIdDenylist;

function requireIdDenylist () {
	if (hasRequiredIdDenylist) return idDenylist;
	hasRequiredIdDenylist = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether the given node represents assignment target in a normal assignment or destructuring.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is assignment target.
	 */
	function isAssignmentTarget(node) {
		const parent = node.parent;

		return (
			// normal assignment
			(parent.type === "AssignmentExpression" && parent.left === node) ||
			// destructuring
			parent.type === "ArrayPattern" ||
			parent.type === "RestElement" ||
			(parent.type === "Property" &&
				parent.value === node &&
				parent.parent.type === "ObjectPattern") ||
			(parent.type === "AssignmentPattern" && parent.left === node)
		);
	}

	/**
	 * Checks whether the given node represents an imported name that is renamed in the same import/export specifier.
	 *
	 * Examples:
	 * import { a as b } from 'mod'; // node `a` is renamed import
	 * export { a as b } from 'mod'; // node `a` is renamed import
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} `true` if the node is a renamed import.
	 */
	function isRenamedImport(node) {
		const parent = node.parent;

		return (
			(parent.type === "ImportSpecifier" &&
				parent.imported !== parent.local &&
				parent.imported === node) ||
			(parent.type === "ExportSpecifier" &&
				parent.parent.source && // re-export
				parent.local !== parent.exported &&
				parent.local === node)
		);
	}

	/**
	 * Checks whether the given node is an ObjectPattern destructuring.
	 *
	 * Examples:
	 * const { a : b } = foo;
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} `true` if the node is in an ObjectPattern destructuring.
	 */
	function isPropertyNameInDestructuring(node) {
		const parent = node.parent;

		return (
			!parent.computed &&
			parent.type === "Property" &&
			parent.parent.type === "ObjectPattern" &&
			parent.key === node
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	idDenylist = {
		meta: {
			type: "suggestion",

			defaultOptions: [],

			docs: {
				description: "Disallow specified identifiers",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/id-denylist",
			},

			schema: {
				type: "array",
				items: {
					type: "string",
				},
				uniqueItems: true,
			},
			messages: {
				restricted: "Identifier '{{name}}' is restricted.",
				restrictedPrivate: "Identifier '#{{name}}' is restricted.",
			},
		},

		create(context) {
			const denyList = new Set(context.options);
			const reportedNodes = new Set();
			const sourceCode = context.sourceCode;

			let globalScope;

			/**
			 * Checks whether the given name is restricted.
			 * @param {string} name The name to check.
			 * @returns {boolean} `true` if the name is restricted.
			 * @private
			 */
			function isRestricted(name) {
				return denyList.has(name);
			}

			/**
			 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
			 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
			 * @param {ASTNode} node `Identifier` node to check.
			 * @returns {boolean} `true` if the node is a reference to a global variable.
			 */
			function isReferenceToGlobalVariable(node) {
				const variable = globalScope.set.get(node.name);

				return (
					variable &&
					variable.defs.length === 0 &&
					variable.references.some(ref => ref.identifier === node)
				);
			}

			/**
			 * Determines whether the given node should be checked.
			 * @param {ASTNode} node `Identifier` node.
			 * @returns {boolean} `true` if the node should be checked.
			 */
			function shouldCheck(node) {
				// Import attributes are defined by environments, so naming conventions shouldn't apply to them
				if (astUtils.isImportAttributeKey(node)) {
					return false;
				}

				const parent = node.parent;

				/*
				 * Member access has special rules for checking property names.
				 * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over.
				 * Write access isn't allowed, because it potentially creates a new property with a restricted name.
				 */
				if (
					parent.type === "MemberExpression" &&
					parent.property === node &&
					!parent.computed
				) {
					return isAssignmentTarget(parent);
				}

				return (
					parent.type !== "CallExpression" &&
					parent.type !== "NewExpression" &&
					!isRenamedImport(node) &&
					!isPropertyNameInDestructuring(node) &&
					!isReferenceToGlobalVariable(node)
				);
			}

			/**
			 * Reports an AST node as a rule violation.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 * @private
			 */
			function report(node) {
				/*
				 * We used the range instead of the node because it's possible
				 * for the same identifier to be represented by two different
				 * nodes, with the most clear example being shorthand properties:
				 * { foo }
				 * In this case, "foo" is represented by one node for the name
				 * and one for the value. The only way to know they are the same
				 * is to look at the range.
				 */
				if (!reportedNodes.has(node.range.toString())) {
					const isPrivate = node.type === "PrivateIdentifier";

					context.report({
						node,
						messageId: isPrivate ? "restrictedPrivate" : "restricted",
						data: {
							name: node.name,
						},
					});
					reportedNodes.add(node.range.toString());
				}
			}

			return {
				Program(node) {
					globalScope = sourceCode.getScope(node);
				},

				[["Identifier", "PrivateIdentifier"]](node) {
					if (isRestricted(node.name) && shouldCheck(node)) {
						report(node);
					}
				},
			};
		},
	};
	return idDenylist;
}

/**
 * @fileoverview Rule that warns when identifier names are shorter or longer
 * than the values provided in configuration.
 * @author Burak Yigit Kaya aka BYK
 */

var idLength;
var hasRequiredIdLength;

function requireIdLength () {
	if (hasRequiredIdLength) return idLength;
	hasRequiredIdLength = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { getGraphemeCount } = requireStringUtils();
	const {
		getModuleExportName,
		isImportAttributeKey,
	} = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	idLength = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					exceptionPatterns: [],
					exceptions: [],
					min: 2,
					properties: "always",
				},
			],

			docs: {
				description: "Enforce minimum and maximum identifier lengths",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/id-length",
			},

			schema: [
				{
					type: "object",
					properties: {
						min: {
							type: "integer",
						},
						max: {
							type: "integer",
						},
						exceptions: {
							type: "array",
							uniqueItems: true,
							items: {
								type: "string",
							},
						},
						exceptionPatterns: {
							type: "array",
							uniqueItems: true,
							items: {
								type: "string",
							},
						},
						properties: {
							enum: ["always", "never"],
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				tooShort: "Identifier name '{{name}}' is too short (< {{min}}).",
				tooShortPrivate:
					"Identifier name '#{{name}}' is too short (< {{min}}).",
				tooLong: "Identifier name '{{name}}' is too long (> {{max}}).",
				tooLongPrivate:
					"Identifier name #'{{name}}' is too long (> {{max}}).",
			},
		},

		create(context) {
			const [options] = context.options;
			const { max: maxLength = Infinity, min: minLength } = options;
			const properties = options.properties !== "never";
			const exceptions = new Set(options.exceptions);
			const exceptionPatterns = options.exceptionPatterns.map(
				pattern => new RegExp(pattern, "u"),
			);
			const reportedNodes = new Set();

			/**
			 * Checks if a string matches the provided exception patterns
			 * @param {string} name The string to check.
			 * @returns {boolean} if the string is a match
			 * @private
			 */
			function matchesExceptionPattern(name) {
				return exceptionPatterns.some(pattern => pattern.test(name));
			}

			const SUPPORTED_EXPRESSIONS = {
				MemberExpression:
					properties &&
					function (parent) {
						return (
							!parent.computed &&
							// regular property assignment
							((parent.parent.left === parent &&
								parent.parent.type === "AssignmentExpression") ||
								// or the last identifier in an ObjectPattern destructuring
								(parent.parent.type === "Property" &&
									parent.parent.value === parent &&
									parent.parent.parent.type === "ObjectPattern" &&
									parent.parent.parent.parent.left ===
										parent.parent.parent))
						);
					},
				AssignmentPattern(parent, node) {
					return parent.left === node;
				},
				VariableDeclarator(parent, node) {
					return parent.id === node;
				},
				Property(parent, node) {
					if (parent.parent.type === "ObjectPattern") {
						const isKeyAndValueSame =
							parent.value.name === parent.key.name;

						return (
							(!isKeyAndValueSame && parent.value === node) ||
							(isKeyAndValueSame && parent.key === node && properties)
						);
					}
					return (
						properties &&
						!isImportAttributeKey(node) &&
						!parent.computed &&
						parent.key.name === node.name
					);
				},
				ImportSpecifier(parent, node) {
					return (
						parent.local === node &&
						getModuleExportName(parent.imported) !==
							getModuleExportName(parent.local)
					);
				},
				ImportDefaultSpecifier: true,
				ImportNamespaceSpecifier: true,
				RestElement: true,
				FunctionExpression: true,
				ArrowFunctionExpression: true,
				ClassDeclaration: true,
				FunctionDeclaration: true,
				MethodDefinition: true,
				PropertyDefinition: true,
				CatchClause: true,
				ArrayPattern: true,
			};

			return {
				[["Identifier", "PrivateIdentifier"]](node) {
					const name = node.name;
					const parent = node.parent;

					const nameLength = getGraphemeCount(name);

					const isShort = nameLength < minLength;
					const isLong = nameLength > maxLength;

					if (
						!(isShort || isLong) ||
						exceptions.has(name) ||
						matchesExceptionPattern(name)
					) {
						return; // Nothing to report
					}

					const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type];

					/*
					 * We used the range instead of the node because it's possible
					 * for the same identifier to be represented by two different
					 * nodes, with the most clear example being shorthand properties:
					 * { foo }
					 * In this case, "foo" is represented by one node for the name
					 * and one for the value. The only way to know they are the same
					 * is to look at the range.
					 */
					if (
						isValidExpression &&
						!reportedNodes.has(node.range.toString()) &&
						(isValidExpression === true ||
							isValidExpression(parent, node))
					) {
						reportedNodes.add(node.range.toString());

						let messageId = isShort ? "tooShort" : "tooLong";

						if (node.type === "PrivateIdentifier") {
							messageId += "Private";
						}

						context.report({
							node,
							messageId,
							data: { name, min: minLength, max: maxLength },
						});
					}
				},
			};
		},
	};
	return idLength;
}

/**
 * @fileoverview Rule to flag non-matching identifiers
 * @author Matthieu Larcher
 */

var idMatch;
var hasRequiredIdMatch;

function requireIdMatch () {
	if (hasRequiredIdMatch) return idMatch;
	hasRequiredIdMatch = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	idMatch = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				"^.+$",
				{
					classFields: false,
					ignoreDestructuring: false,
					onlyDeclarations: false,
					properties: false,
				},
			],

			docs: {
				description:
					"Require identifiers to match a specified regular expression",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/id-match",
			},

			schema: [
				{
					type: "string",
				},
				{
					type: "object",
					properties: {
						properties: {
							type: "boolean",
						},
						classFields: {
							type: "boolean",
						},
						onlyDeclarations: {
							type: "boolean",
						},
						ignoreDestructuring: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				notMatch:
					"Identifier '{{name}}' does not match the pattern '{{pattern}}'.",
				notMatchPrivate:
					"Identifier '#{{name}}' does not match the pattern '{{pattern}}'.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Options
			//--------------------------------------------------------------------------
			const [
				pattern,
				{
					classFields: checkClassFields,
					ignoreDestructuring,
					onlyDeclarations,
					properties: checkProperties,
				},
			] = context.options;
			const regexp = new RegExp(pattern, "u");

			const sourceCode = context.sourceCode;
			let globalScope;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			// contains reported nodes to avoid reporting twice on destructuring with shorthand notation
			const reportedNodes = new Set();
			const ALLOWED_PARENT_TYPES = new Set([
				"CallExpression",
				"NewExpression",
			]);
			const DECLARATION_TYPES = new Set([
				"FunctionDeclaration",
				"VariableDeclarator",
			]);
			const IMPORT_TYPES = new Set([
				"ImportSpecifier",
				"ImportNamespaceSpecifier",
				"ImportDefaultSpecifier",
			]);

			/**
			 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
			 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
			 * @param {ASTNode} node `Identifier` node to check.
			 * @returns {boolean} `true` if the node is a reference to a global variable.
			 */
			function isReferenceToGlobalVariable(node) {
				const variable = globalScope.set.get(node.name);

				return (
					variable &&
					variable.defs.length === 0 &&
					variable.references.some(ref => ref.identifier === node)
				);
			}

			/**
			 * Checks if a string matches the provided pattern
			 * @param {string} name The string to check.
			 * @returns {boolean} if the string is a match
			 * @private
			 */
			function isInvalid(name) {
				return !regexp.test(name);
			}

			/**
			 * Checks if a parent of a node is an ObjectPattern.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} if the node is inside an ObjectPattern
			 * @private
			 */
			function isInsideObjectPattern(node) {
				let { parent } = node;

				while (parent) {
					if (parent.type === "ObjectPattern") {
						return true;
					}

					parent = parent.parent;
				}

				return false;
			}

			/**
			 * Verifies if we should report an error or not based on the effective
			 * parent node and the identifier name.
			 * @param {ASTNode} effectiveParent The effective parent node of the node to be reported
			 * @param {string} name The identifier name of the identifier node
			 * @returns {boolean} whether an error should be reported or not
			 */
			function shouldReport(effectiveParent, name) {
				return (
					(!onlyDeclarations ||
						DECLARATION_TYPES.has(effectiveParent.type)) &&
					!ALLOWED_PARENT_TYPES.has(effectiveParent.type) &&
					isInvalid(name)
				);
			}

			/**
			 * Reports an AST node as a rule violation.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 * @private
			 */
			function report(node) {
				/*
				 * We used the range instead of the node because it's possible
				 * for the same identifier to be represented by two different
				 * nodes, with the most clear example being shorthand properties:
				 * { foo }
				 * In this case, "foo" is represented by one node for the name
				 * and one for the value. The only way to know they are the same
				 * is to look at the range.
				 */
				if (!reportedNodes.has(node.range.toString())) {
					const messageId =
						node.type === "PrivateIdentifier"
							? "notMatchPrivate"
							: "notMatch";

					context.report({
						node,
						messageId,
						data: {
							name: node.name,
							pattern,
						},
					});
					reportedNodes.add(node.range.toString());
				}
			}

			return {
				Program(node) {
					globalScope = sourceCode.getScope(node);
				},

				Identifier(node) {
					const name = node.name,
						parent = node.parent,
						effectiveParent =
							parent.type === "MemberExpression"
								? parent.parent
								: parent;

					if (
						isReferenceToGlobalVariable(node) ||
						astUtils.isImportAttributeKey(node)
					) {
						return;
					}

					if (parent.type === "MemberExpression") {
						if (!checkProperties) {
							return;
						}

						// Always check object names
						if (
							parent.object.type === "Identifier" &&
							parent.object.name === name
						) {
							if (isInvalid(name)) {
								report(node);
							}

							// Report AssignmentExpressions left side's assigned variable id
						} else if (
							effectiveParent.type === "AssignmentExpression" &&
							effectiveParent.left.type === "MemberExpression" &&
							effectiveParent.left.property.name === node.name
						) {
							if (isInvalid(name)) {
								report(node);
							}

							// Report AssignmentExpressions only if they are the left side of the assignment
						} else if (
							effectiveParent.type === "AssignmentExpression" &&
							effectiveParent.right.type !== "MemberExpression"
						) {
							if (isInvalid(name)) {
								report(node);
							}
						}

						// For https://github.com/eslint/eslint/issues/15123
					} else if (
						parent.type === "Property" &&
						parent.parent.type === "ObjectExpression" &&
						parent.key === node &&
						!parent.computed
					) {
						if (checkProperties && isInvalid(name)) {
							report(node);
						}

						/*
						 * Properties have their own rules, and
						 * AssignmentPattern nodes can be treated like Properties:
						 * e.g.: const { no_camelcased = false } = bar;
						 */
					} else if (
						parent.type === "Property" ||
						parent.type === "AssignmentPattern"
					) {
						if (
							parent.parent &&
							parent.parent.type === "ObjectPattern"
						) {
							if (
								!ignoreDestructuring &&
								parent.shorthand &&
								parent.value.left &&
								isInvalid(name)
							) {
								report(node);
							}

							const assignmentKeyEqualsValue =
								parent.key.name === parent.value.name;

							// prevent checking righthand side of destructured object
							if (!assignmentKeyEqualsValue && parent.key === node) {
								return;
							}

							const valueIsInvalid =
								parent.value.name && isInvalid(name);

							// ignore destructuring if the option is set, unless a new identifier is created
							if (
								valueIsInvalid &&
								!(assignmentKeyEqualsValue && ignoreDestructuring)
							) {
								report(node);
							}
						}

						// never check properties or always ignore destructuring
						if (
							(!checkProperties && !parent.computed) ||
							(ignoreDestructuring && isInsideObjectPattern(node))
						) {
							return;
						}

						// don't check right hand side of AssignmentExpression to prevent duplicate warnings
						if (
							parent.right !== node &&
							shouldReport(effectiveParent, name)
						) {
							report(node);
						}

						// Check if it's an import specifier
					} else if (IMPORT_TYPES.has(parent.type)) {
						// Report only if the local imported identifier is invalid
						if (
							parent.local &&
							parent.local.name === node.name &&
							isInvalid(name)
						) {
							report(node);
						}
					} else if (parent.type === "PropertyDefinition") {
						if (checkClassFields && isInvalid(name)) {
							report(node);
						}

						// Report anything that is invalid that isn't a CallExpression
					} else if (shouldReport(effectiveParent, name)) {
						report(node);
					}
				},

				PrivateIdentifier(node) {
					const isClassField = node.parent.type === "PropertyDefinition";

					if (isClassField && !checkClassFields) {
						return;
					}

					if (isInvalid(node.name)) {
						report(node);
					}
				},
			};
		},
	};
	return idMatch;
}

/**
 * @fileoverview enforce the location of arrow function bodies
 * @author Sharmila Jesupaul
 * @deprecated in ESLint v8.53.0
 */

var implicitArrowLinebreak;
var hasRequiredImplicitArrowLinebreak;

function requireImplicitArrowLinebreak () {
	if (hasRequiredImplicitArrowLinebreak) return implicitArrowLinebreak;
	hasRequiredImplicitArrowLinebreak = 1;

	const { isCommentToken, isNotOpeningParenToken } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------
	/** @type {import('../shared/types').Rule} */
	implicitArrowLinebreak = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "implicit-arrow-linebreak",
							url: "https://eslint.style/rules/js/implicit-arrow-linebreak",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce the location of arrow function bodies",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/implicit-arrow-linebreak",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["beside", "below"],
				},
			],
			messages: {
				expected: "Expected a linebreak before this expression.",
				unexpected: "Expected no linebreak before this expression.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const option = context.options[0] || "beside";

			/**
			 * Validates the location of an arrow function body
			 * @param {ASTNode} node The arrow function body
			 * @returns {void}
			 */
			function validateExpression(node) {
				if (node.body.type === "BlockStatement") {
					return;
				}

				const arrowToken = sourceCode.getTokenBefore(
					node.body,
					isNotOpeningParenToken,
				);
				const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);

				if (
					arrowToken.loc.end.line === firstTokenOfBody.loc.start.line &&
					option === "below"
				) {
					context.report({
						node: firstTokenOfBody,
						messageId: "expected",
						fix: fixer =>
							fixer.insertTextBefore(firstTokenOfBody, "\n"),
					});
				} else if (
					arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line &&
					option === "beside"
				) {
					context.report({
						node: firstTokenOfBody,
						messageId: "unexpected",
						fix(fixer) {
							if (
								sourceCode.getFirstTokenBetween(
									arrowToken,
									firstTokenOfBody,
									{
										includeComments: true,
										filter: isCommentToken,
									},
								)
							) {
								return null;
							}

							return fixer.replaceTextRange(
								[arrowToken.range[1], firstTokenOfBody.range[0]],
								" ",
							);
						},
					});
				}
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------
			return {
				ArrowFunctionExpression: node => validateExpression(node),
			};
		},
	};
	return implicitArrowLinebreak;
}

/**
 * @fileoverview This rule sets a specific indentation style and width for your code
 *
 * @author Teddy Katz
 * @author Vitaly Puzrin
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */

var indent;
var hasRequiredIndent;

function requireIndent () {
	if (hasRequiredIndent) return indent;
	hasRequiredIndent = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const KNOWN_NODES = new Set([
		"AssignmentExpression",
		"AssignmentPattern",
		"ArrayExpression",
		"ArrayPattern",
		"ArrowFunctionExpression",
		"AwaitExpression",
		"BlockStatement",
		"BinaryExpression",
		"BreakStatement",
		"CallExpression",
		"CatchClause",
		"ChainExpression",
		"ClassBody",
		"ClassDeclaration",
		"ClassExpression",
		"ConditionalExpression",
		"ContinueStatement",
		"DoWhileStatement",
		"DebuggerStatement",
		"EmptyStatement",
		"ExperimentalRestProperty",
		"ExperimentalSpreadProperty",
		"ExpressionStatement",
		"ForStatement",
		"ForInStatement",
		"ForOfStatement",
		"FunctionDeclaration",
		"FunctionExpression",
		"Identifier",
		"IfStatement",
		"Literal",
		"LabeledStatement",
		"LogicalExpression",
		"MemberExpression",
		"MetaProperty",
		"MethodDefinition",
		"NewExpression",
		"ObjectExpression",
		"ObjectPattern",
		"PrivateIdentifier",
		"Program",
		"Property",
		"PropertyDefinition",
		"RestElement",
		"ReturnStatement",
		"SequenceExpression",
		"SpreadElement",
		"StaticBlock",
		"Super",
		"SwitchCase",
		"SwitchStatement",
		"TaggedTemplateExpression",
		"TemplateElement",
		"TemplateLiteral",
		"ThisExpression",
		"ThrowStatement",
		"TryStatement",
		"UnaryExpression",
		"UpdateExpression",
		"VariableDeclaration",
		"VariableDeclarator",
		"WhileStatement",
		"WithStatement",
		"YieldExpression",
		"JSXFragment",
		"JSXOpeningFragment",
		"JSXClosingFragment",
		"JSXIdentifier",
		"JSXNamespacedName",
		"JSXMemberExpression",
		"JSXEmptyExpression",
		"JSXExpressionContainer",
		"JSXElement",
		"JSXClosingElement",
		"JSXOpeningElement",
		"JSXAttribute",
		"JSXSpreadAttribute",
		"JSXText",
		"ExportDefaultDeclaration",
		"ExportNamedDeclaration",
		"ExportAllDeclaration",
		"ExportSpecifier",
		"ImportDeclaration",
		"ImportSpecifier",
		"ImportDefaultSpecifier",
		"ImportNamespaceSpecifier",
		"ImportExpression",
	]);

	/*
	 * General rule strategy:
	 * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another
	 *    specified token or to the first column.
	 * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a
	 *    BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly
	 *    brace of the BlockStatement.
	 * 3. After traversing the AST, calculate the expected indentation levels of every token according to the
	 *    OffsetStorage container.
	 * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file,
	 *    and report the token if the two values are not equal.
	 */

	/**
	 * A mutable map that stores (key, value) pairs. The keys are numeric indices, and must be unique.
	 * This is intended to be a generic wrapper around a map with non-negative integer keys, so that the underlying implementation
	 * can easily be swapped out.
	 */
	class IndexMap {
		/**
		 * Creates an empty map
		 * @param {number} maxKey The maximum key
		 */
		constructor(maxKey) {
			// Initializing the array with the maximum expected size avoids dynamic reallocations that could degrade performance.
			this._values = Array(maxKey + 1);
		}

		/**
		 * Inserts an entry into the map.
		 * @param {number} key The entry's key
		 * @param {any} value The entry's value
		 * @returns {void}
		 */
		insert(key, value) {
			this._values[key] = value;
		}

		/**
		 * Finds the value of the entry with the largest key less than or equal to the provided key
		 * @param {number} key The provided key
		 * @returns {*|undefined} The value of the found entry, or undefined if no such entry exists.
		 */
		findLastNotAfter(key) {
			const values = this._values;

			for (let index = key; index >= 0; index--) {
				const value = values[index];

				if (value) {
					return value;
				}
			}
			return void 0;
		}

		/**
		 * Deletes all of the keys in the interval [start, end)
		 * @param {number} start The start of the range
		 * @param {number} end The end of the range
		 * @returns {void}
		 */
		deleteRange(start, end) {
			this._values.fill(void 0, start, end);
		}
	}

	/**
	 * A helper class to get token-based info related to indentation
	 */
	class TokenInfo {
		/**
		 * @param {SourceCode} sourceCode A SourceCode object
		 */
		constructor(sourceCode) {
			this.sourceCode = sourceCode;
			this.firstTokensByLineNumber = new Map();
			const tokens = sourceCode.tokensAndComments;

			for (let i = 0; i < tokens.length; i++) {
				const token = tokens[i];

				if (!this.firstTokensByLineNumber.has(token.loc.start.line)) {
					this.firstTokensByLineNumber.set(token.loc.start.line, token);
				}
				if (
					!this.firstTokensByLineNumber.has(token.loc.end.line) &&
					sourceCode.text
						.slice(
							token.range[1] - token.loc.end.column,
							token.range[1],
						)
						.trim()
				) {
					this.firstTokensByLineNumber.set(token.loc.end.line, token);
				}
			}
		}

		/**
		 * Gets the first token on a given token's line
		 * @param {Token|ASTNode} token a node or token
		 * @returns {Token} The first token on the given line
		 */
		getFirstTokenOfLine(token) {
			return this.firstTokensByLineNumber.get(token.loc.start.line);
		}

		/**
		 * Determines whether a token is the first token in its line
		 * @param {Token} token The token
		 * @returns {boolean} `true` if the token is the first on its line
		 */
		isFirstTokenOfLine(token) {
			return this.getFirstTokenOfLine(token) === token;
		}

		/**
		 * Get the actual indent of a token
		 * @param {Token} token Token to examine. This should be the first token on its line.
		 * @returns {string} The indentation characters that precede the token
		 */
		getTokenIndent(token) {
			return this.sourceCode.text.slice(
				token.range[0] - token.loc.start.column,
				token.range[0],
			);
		}
	}

	/**
	 * A class to store information on desired offsets of tokens from each other
	 */
	class OffsetStorage {
		/**
		 * @param {TokenInfo} tokenInfo a TokenInfo instance
		 * @param {number} indentSize The desired size of each indentation level
		 * @param {string} indentType The indentation character
		 * @param {number} maxIndex The maximum end index of any token
		 */
		constructor(tokenInfo, indentSize, indentType, maxIndex) {
			this._tokenInfo = tokenInfo;
			this._indentSize = indentSize;
			this._indentType = indentType;

			this._indexMap = new IndexMap(maxIndex);
			this._indexMap.insert(0, { offset: 0, from: null, force: false });

			this._lockedFirstTokens = new WeakMap();
			this._desiredIndentCache = new WeakMap();
			this._ignoredTokens = new WeakSet();
		}

		_getOffsetDescriptor(token) {
			return this._indexMap.findLastNotAfter(token.range[0]);
		}

		/**
		 * Sets the offset column of token B to match the offset column of token A.
		 * - **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In
		 * most cases, `setDesiredOffset` should be used instead.
		 * @param {Token} baseToken The first token
		 * @param {Token} offsetToken The second token, whose offset should be matched to the first token
		 * @returns {void}
		 */
		matchOffsetOf(baseToken, offsetToken) {
			/*
			 * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to
			 * the token that it depends on. For example, with the `ArrayExpression: first` option, the first
			 * token of each element in the array after the first will be mapped to the first token of the first
			 * element. The desired indentation of each of these tokens is computed based on the desired indentation
			 * of the "first" element, rather than through the normal offset mechanism.
			 */
			this._lockedFirstTokens.set(offsetToken, baseToken);
		}

		/**
		 * Sets the desired offset of a token.
		 *
		 * This uses a line-based offset collapsing behavior to handle tokens on the same line.
		 * For example, consider the following two cases:
		 *
		 * (
		 *     [
		 *         bar
		 *     ]
		 * )
		 *
		 * ([
		 *     bar
		 * ])
		 *
		 * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from
		 * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is
		 * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces)
		 * from the start of its line.
		 *
		 * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level
		 * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the
		 * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented
		 * by 1 indent level from the start of the line.
		 *
		 * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node,
		 * without needing to check which lines those tokens are on.
		 *
		 * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive
		 * behavior can occur. For example, consider the following cases:
		 *
		 * foo(
		 * ).
		 *     bar(
		 *         baz
		 *     )
		 *
		 * foo(
		 * ).bar(
		 *     baz
		 * )
		 *
		 * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz`
		 * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz`
		 * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no
		 * collapsing would occur).
		 *
		 * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and
		 * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed
		 * in the second case.
		 * @param {Token} token The token
		 * @param {Token} fromToken The token that `token` should be offset from
		 * @param {number} offset The desired indent level
		 * @returns {void}
		 */
		setDesiredOffset(token, fromToken, offset) {
			return this.setDesiredOffsets(token.range, fromToken, offset);
		}

		/**
		 * Sets the desired offset of all tokens in a range
		 * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens.
		 * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains
		 * it). This means that the offset of each token is updated O(AST depth) times.
		 * It would not be performant to store and update the offsets for each token independently, because the rule would end
		 * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files.
		 *
		 * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following
		 * list could represent the state of the offset tree at a given point:
		 *
		 * - Tokens starting in the interval [0, 15) are aligned with the beginning of the file
		 * - Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token
		 * - Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token
		 * - Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token
		 * - Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token
		 *
		 * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using:
		 * `setDesiredOffsets([30, 43], fooToken, 1);`
		 * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied.
		 * @param {Token} fromToken The token that this is offset from
		 * @param {number} offset The desired indent level
		 * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false.
		 * @returns {void}
		 */
		setDesiredOffsets(range, fromToken, offset, force) {
			/*
			 * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset
			 * descriptor. The tree for the example above would have the following nodes:
			 *
			 * * key: 0, value: { offset: 0, from: null }
			 * * key: 15, value: { offset: 1, from: barToken }
			 * * key: 30, value: { offset: 1, from: fooToken }
			 * * key: 43, value: { offset: 2, from: barToken }
			 * * key: 820, value: { offset: 1, from: bazToken }
			 *
			 * To find the offset descriptor for any given token, one needs to find the node with the largest key
			 * which is <= token.start. To make this operation fast, the nodes are stored in a map indexed by key.
			 */

			const descriptorToInsert = { offset, from: fromToken, force };

			const descriptorAfterRange = this._indexMap.findLastNotAfter(range[1]);

			const fromTokenIsInRange =
				fromToken &&
				fromToken.range[0] >= range[0] &&
				fromToken.range[1] <= range[1];
			const fromTokenDescriptor =
				fromTokenIsInRange && this._getOffsetDescriptor(fromToken);

			// First, remove any existing nodes in the range from the map.
			this._indexMap.deleteRange(range[0] + 1, range[1]);

			// Insert a new node into the map for this range
			this._indexMap.insert(range[0], descriptorToInsert);

			/*
			 * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously,
			 * even if it's in the current range.
			 */
			if (fromTokenIsInRange) {
				this._indexMap.insert(fromToken.range[0], fromTokenDescriptor);
				this._indexMap.insert(fromToken.range[1], descriptorToInsert);
			}

			/*
			 * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following
			 * tokens the same as it was before.
			 */
			this._indexMap.insert(range[1], descriptorAfterRange);
		}

		/**
		 * Gets the desired indent of a token
		 * @param {Token} token The token
		 * @returns {string} The desired indent of the token
		 */
		getDesiredIndent(token) {
			if (!this._desiredIndentCache.has(token)) {
				if (this._ignoredTokens.has(token)) {
					/*
					 * If the token is ignored, use the actual indent of the token as the desired indent.
					 * This ensures that no errors are reported for this token.
					 */
					this._desiredIndentCache.set(
						token,
						this._tokenInfo.getTokenIndent(token),
					);
				} else if (this._lockedFirstTokens.has(token)) {
					const firstToken = this._lockedFirstTokens.get(token);

					this._desiredIndentCache.set(
						token,

						// (indentation for the first element's line)
						this.getDesiredIndent(
							this._tokenInfo.getFirstTokenOfLine(firstToken),
						) +
							// (space between the start of the first element's line and the first element)
							this._indentType.repeat(
								firstToken.loc.start.column -
									this._tokenInfo.getFirstTokenOfLine(firstToken)
										.loc.start.column,
							),
					);
				} else {
					const offsetInfo = this._getOffsetDescriptor(token);
					const offset =
						offsetInfo.from &&
						offsetInfo.from.loc.start.line === token.loc.start.line &&
						!/^\s*?\n/u.test(token.value) &&
						!offsetInfo.force
							? 0
							: offsetInfo.offset * this._indentSize;

					this._desiredIndentCache.set(
						token,
						(offsetInfo.from
							? this.getDesiredIndent(offsetInfo.from)
							: "") + this._indentType.repeat(offset),
					);
				}
			}
			return this._desiredIndentCache.get(token);
		}

		/**
		 * Ignores a token, preventing it from being reported.
		 * @param {Token} token The token
		 * @returns {void}
		 */
		ignoreToken(token) {
			if (this._tokenInfo.isFirstTokenOfLine(token)) {
				this._ignoredTokens.add(token);
			}
		}

		/**
		 * Gets the first token that the given token's indentation is dependent on
		 * @param {Token} token The token
		 * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level
		 */
		getFirstDependency(token) {
			return this._getOffsetDescriptor(token).from;
		}
	}

	const ELEMENT_LIST_SCHEMA = {
		oneOf: [
			{
				type: "integer",
				minimum: 0,
			},
			{
				enum: ["first", "off"],
			},
		],
	};

	/** @type {import('../shared/types').Rule} */
	indent = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "indent",
							url: "https://eslint.style/rules/js/indent",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent indentation",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/indent",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["tab"],
						},
						{
							type: "integer",
							minimum: 0,
						},
					],
				},
				{
					type: "object",
					properties: {
						SwitchCase: {
							type: "integer",
							minimum: 0,
							default: 0,
						},
						VariableDeclarator: {
							oneOf: [
								ELEMENT_LIST_SCHEMA,
								{
									type: "object",
									properties: {
										var: ELEMENT_LIST_SCHEMA,
										let: ELEMENT_LIST_SCHEMA,
										const: ELEMENT_LIST_SCHEMA,
									},
									additionalProperties: false,
								},
							],
						},
						outerIIFEBody: {
							oneOf: [
								{
									type: "integer",
									minimum: 0,
								},
								{
									enum: ["off"],
								},
							],
						},
						MemberExpression: {
							oneOf: [
								{
									type: "integer",
									minimum: 0,
								},
								{
									enum: ["off"],
								},
							],
						},
						FunctionDeclaration: {
							type: "object",
							properties: {
								parameters: ELEMENT_LIST_SCHEMA,
								body: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
						FunctionExpression: {
							type: "object",
							properties: {
								parameters: ELEMENT_LIST_SCHEMA,
								body: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
						StaticBlock: {
							type: "object",
							properties: {
								body: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
						CallExpression: {
							type: "object",
							properties: {
								arguments: ELEMENT_LIST_SCHEMA,
							},
							additionalProperties: false,
						},
						ArrayExpression: ELEMENT_LIST_SCHEMA,
						ObjectExpression: ELEMENT_LIST_SCHEMA,
						ImportDeclaration: ELEMENT_LIST_SCHEMA,
						flatTernaryExpressions: {
							type: "boolean",
							default: false,
						},
						offsetTernaryExpressions: {
							type: "boolean",
							default: false,
						},
						ignoredNodes: {
							type: "array",
							items: {
								type: "string",
								not: {
									pattern: ":exit$",
								},
							},
						},
						ignoreComments: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				wrongIndentation:
					"Expected indentation of {{expected}} but found {{actual}}.",
			},
		},

		create(context) {
			const DEFAULT_VARIABLE_INDENT = 1;
			const DEFAULT_PARAMETER_INDENT = 1;
			const DEFAULT_FUNCTION_BODY_INDENT = 1;

			let indentType = "space";
			let indentSize = 4;
			const options = {
				SwitchCase: 0,
				VariableDeclarator: {
					var: DEFAULT_VARIABLE_INDENT,
					let: DEFAULT_VARIABLE_INDENT,
					const: DEFAULT_VARIABLE_INDENT,
				},
				outerIIFEBody: 1,
				FunctionDeclaration: {
					parameters: DEFAULT_PARAMETER_INDENT,
					body: DEFAULT_FUNCTION_BODY_INDENT,
				},
				FunctionExpression: {
					parameters: DEFAULT_PARAMETER_INDENT,
					body: DEFAULT_FUNCTION_BODY_INDENT,
				},
				StaticBlock: {
					body: DEFAULT_FUNCTION_BODY_INDENT,
				},
				CallExpression: {
					arguments: DEFAULT_PARAMETER_INDENT,
				},
				MemberExpression: 1,
				ArrayExpression: 1,
				ObjectExpression: 1,
				ImportDeclaration: 1,
				flatTernaryExpressions: false,
				ignoredNodes: [],
				ignoreComments: false,
			};

			if (context.options.length) {
				if (context.options[0] === "tab") {
					indentSize = 1;
					indentType = "tab";
				} else {
					indentSize = context.options[0];
					indentType = "space";
				}

				if (context.options[1]) {
					Object.assign(options, context.options[1]);

					if (
						typeof options.VariableDeclarator === "number" ||
						options.VariableDeclarator === "first"
					) {
						options.VariableDeclarator = {
							var: options.VariableDeclarator,
							let: options.VariableDeclarator,
							const: options.VariableDeclarator,
						};
					}
				}
			}

			const sourceCode = context.sourceCode;
			const tokenInfo = new TokenInfo(sourceCode);
			const offsets = new OffsetStorage(
				tokenInfo,
				indentSize,
				indentType === "space" ? " " : "\t",
				sourceCode.text.length,
			);
			const parameterParens = new WeakSet();

			/**
			 * Creates an error message for a line, given the expected/actual indentation.
			 * @param {int} expectedAmount The expected amount of indentation characters for this line
			 * @param {int} actualSpaces The actual number of indentation spaces that were found on this line
			 * @param {int} actualTabs The actual number of indentation tabs that were found on this line
			 * @returns {string} An error message for this line
			 */
			function createErrorMessageData(
				expectedAmount,
				actualSpaces,
				actualTabs,
			) {
				const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs"
				const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space"
				const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs"
				let foundStatement;

				if (actualSpaces > 0) {
					/*
					 * Abbreviate the message if the expected indentation is also spaces.
					 * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces'
					 */
					foundStatement =
						indentType === "space"
							? actualSpaces
							: `${actualSpaces} ${foundSpacesWord}`;
				} else if (actualTabs > 0) {
					foundStatement =
						indentType === "tab"
							? actualTabs
							: `${actualTabs} ${foundTabsWord}`;
				} else {
					foundStatement = "0";
				}
				return {
					expected: expectedStatement,
					actual: foundStatement,
				};
			}

			/**
			 * Reports a given indent violation
			 * @param {Token} token Token violating the indent rule
			 * @param {string} neededIndent Expected indentation string
			 * @returns {void}
			 */
			function report(token, neededIndent) {
				const actualIndent = Array.from(tokenInfo.getTokenIndent(token));
				const numSpaces = actualIndent.filter(char => char === " ").length;
				const numTabs = actualIndent.filter(char => char === "\t").length;

				context.report({
					node: token,
					messageId: "wrongIndentation",
					data: createErrorMessageData(
						neededIndent.length,
						numSpaces,
						numTabs,
					),
					loc: {
						start: { line: token.loc.start.line, column: 0 },
						end: {
							line: token.loc.start.line,
							column: token.loc.start.column,
						},
					},
					fix(fixer) {
						const range = [
							token.range[0] - token.loc.start.column,
							token.range[0],
						];
						const newText = neededIndent;

						return fixer.replaceTextRange(range, newText);
					},
				});
			}

			/**
			 * Checks if a token's indentation is correct
			 * @param {Token} token Token to examine
			 * @param {string} desiredIndent Desired indentation of the string
			 * @returns {boolean} `true` if the token's indentation is correct
			 */
			function validateTokenIndent(token, desiredIndent) {
				const indentation = tokenInfo.getTokenIndent(token);

				return (
					indentation === desiredIndent ||
					// To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs.
					(indentation.includes(" ") && indentation.includes("\t"))
				);
			}

			/**
			 * Check to see if the node is a file level IIFE
			 * @param {ASTNode} node The function node to check.
			 * @returns {boolean} True if the node is the outer IIFE
			 */
			function isOuterIIFE(node) {
				/*
				 * Verify that the node is an IIFE
				 */
				if (
					!node.parent ||
					node.parent.type !== "CallExpression" ||
					node.parent.callee !== node
				) {
					return false;
				}

				/*
				 * Navigate legal ancestors to determine whether this IIFE is outer.
				 * A "legal ancestor" is an expression or statement that causes the function to get executed immediately.
				 * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator.
				 */
				let statement = node.parent && node.parent.parent;

				while (
					(statement.type === "UnaryExpression" &&
						["!", "~", "+", "-"].includes(statement.operator)) ||
					statement.type === "AssignmentExpression" ||
					statement.type === "LogicalExpression" ||
					statement.type === "SequenceExpression" ||
					statement.type === "VariableDeclarator"
				) {
					statement = statement.parent;
				}

				return (
					(statement.type === "ExpressionStatement" ||
						statement.type === "VariableDeclaration") &&
					statement.parent.type === "Program"
				);
			}

			/**
			 * Counts the number of linebreaks that follow the last non-whitespace character in a string
			 * @param {string} string The string to check
			 * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character,
			 * or the total number of linebreaks if the string is all whitespace.
			 */
			function countTrailingLinebreaks(string) {
				const trailingWhitespace = string.match(/\s*$/u)[0];
				const linebreakMatches = trailingWhitespace.match(
					astUtils.createGlobalLinebreakMatcher(),
				);

				return linebreakMatches === null ? 0 : linebreakMatches.length;
			}

			/**
			 * Check indentation for lists of elements (arrays, objects, function params)
			 * @param {ASTNode[]} elements List of elements that should be offset
			 * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '['
			 * @param {Token} endToken The end token of the list, e.g. ']'
			 * @param {number|string} offset The amount that the elements should be offset
			 * @returns {void}
			 */
			function addElementListIndent(elements, startToken, endToken, offset) {
				/**
				 * Gets the first token of a given element, including surrounding parentheses.
				 * @param {ASTNode} element A node in the `elements` list
				 * @returns {Token} The first token of this element
				 */
				function getFirstToken(element) {
					let token = sourceCode.getTokenBefore(element);

					while (
						astUtils.isOpeningParenToken(token) &&
						token !== startToken
					) {
						token = sourceCode.getTokenBefore(token);
					}
					return sourceCode.getTokenAfter(token);
				}

				// Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden)
				offsets.setDesiredOffsets(
					[startToken.range[1], endToken.range[0]],
					startToken,
					typeof offset === "number" ? offset : 1,
				);
				offsets.setDesiredOffset(endToken, startToken, 0);

				// If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level.
				if (offset === "first" && elements.length && !elements[0]) {
					return;
				}
				elements.forEach((element, index) => {
					if (!element) {
						// Skip holes in arrays
						return;
					}
					if (offset === "off") {
						// Ignore the first token of every element if the "off" option is used
						offsets.ignoreToken(getFirstToken(element));
					}

					// Offset the following elements correctly relative to the first element
					if (index === 0) {
						return;
					}
					if (
						offset === "first" &&
						tokenInfo.isFirstTokenOfLine(getFirstToken(element))
					) {
						offsets.matchOffsetOf(
							getFirstToken(elements[0]),
							getFirstToken(element),
						);
					} else {
						const previousElement = elements[index - 1];
						const firstTokenOfPreviousElement =
							previousElement && getFirstToken(previousElement);
						const previousElementLastToken =
							previousElement &&
							sourceCode.getLastToken(previousElement);

						if (
							previousElement &&
							previousElementLastToken.loc.end.line -
								countTrailingLinebreaks(
									previousElementLastToken.value,
								) >
								startToken.loc.end.line
						) {
							offsets.setDesiredOffsets(
								[previousElement.range[1], element.range[1]],
								firstTokenOfPreviousElement,
								0,
							);
						}
					}
				});
			}

			/**
			 * Check and decide whether to check for indentation for blockless nodes
			 * Scenarios are for or while statements without braces around them
			 * @param {ASTNode} node node to examine
			 * @returns {void}
			 */
			function addBlocklessNodeIndent(node) {
				if (node.type !== "BlockStatement") {
					const lastParentToken = sourceCode.getTokenBefore(
						node,
						astUtils.isNotOpeningParenToken,
					);

					let firstBodyToken = sourceCode.getFirstToken(node);
					let lastBodyToken = sourceCode.getLastToken(node);

					while (
						astUtils.isOpeningParenToken(
							sourceCode.getTokenBefore(firstBodyToken),
						) &&
						astUtils.isClosingParenToken(
							sourceCode.getTokenAfter(lastBodyToken),
						)
					) {
						firstBodyToken = sourceCode.getTokenBefore(firstBodyToken);
						lastBodyToken = sourceCode.getTokenAfter(lastBodyToken);
					}

					offsets.setDesiredOffsets(
						[firstBodyToken.range[0], lastBodyToken.range[1]],
						lastParentToken,
						1,
					);
				}
			}

			/**
			 * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`)
			 * @param {ASTNode} node A CallExpression or NewExpression node
			 * @returns {void}
			 */
			function addFunctionCallIndent(node) {
				let openingParen;

				if (node.arguments.length) {
					openingParen = sourceCode.getFirstTokenBetween(
						node.callee,
						node.arguments[0],
						astUtils.isOpeningParenToken,
					);
				} else {
					openingParen = sourceCode.getLastToken(node, 1);
				}
				const closingParen = sourceCode.getLastToken(node);

				parameterParens.add(openingParen);
				parameterParens.add(closingParen);

				/*
				 * If `?.` token exists, set desired offset for that.
				 * This logic is copied from `MemberExpression`'s.
				 */
				if (node.optional) {
					const dotToken = sourceCode.getTokenAfter(
						node.callee,
						astUtils.isQuestionDotToken,
					);
					const calleeParenCount = sourceCode.getTokensBetween(
						node.callee,
						dotToken,
						{ filter: astUtils.isClosingParenToken },
					).length;
					const firstTokenOfCallee = calleeParenCount
						? sourceCode.getTokenBefore(node.callee, {
								skip: calleeParenCount - 1,
							})
						: sourceCode.getFirstToken(node.callee);
					const lastTokenOfCallee = sourceCode.getTokenBefore(dotToken);
					const offsetBase =
						lastTokenOfCallee.loc.end.line ===
						openingParen.loc.start.line
							? lastTokenOfCallee
							: firstTokenOfCallee;

					offsets.setDesiredOffset(dotToken, offsetBase, 1);
				}

				const offsetAfterToken =
					node.callee.type === "TaggedTemplateExpression"
						? sourceCode.getFirstToken(node.callee.quasi)
						: openingParen;
				const offsetToken = sourceCode.getTokenBefore(offsetAfterToken);

				offsets.setDesiredOffset(openingParen, offsetToken, 0);

				addElementListIndent(
					node.arguments,
					openingParen,
					closingParen,
					options.CallExpression.arguments,
				);
			}

			/**
			 * Checks the indentation of parenthesized values, given a list of tokens in a program
			 * @param {Token[]} tokens A list of tokens
			 * @returns {void}
			 */
			function addParensIndent(tokens) {
				const parenStack = [];
				const parenPairs = [];

				for (let i = 0; i < tokens.length; i++) {
					const nextToken = tokens[i];

					if (astUtils.isOpeningParenToken(nextToken)) {
						parenStack.push(nextToken);
					} else if (astUtils.isClosingParenToken(nextToken)) {
						parenPairs.push({
							left: parenStack.pop(),
							right: nextToken,
						});
					}
				}

				for (let i = parenPairs.length - 1; i >= 0; i--) {
					const leftParen = parenPairs[i].left;
					const rightParen = parenPairs[i].right;

					// We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments.
					if (
						!parameterParens.has(leftParen) &&
						!parameterParens.has(rightParen)
					) {
						const parenthesizedTokens = new Set(
							sourceCode.getTokensBetween(leftParen, rightParen),
						);

						parenthesizedTokens.forEach(token => {
							if (
								!parenthesizedTokens.has(
									offsets.getFirstDependency(token),
								)
							) {
								offsets.setDesiredOffset(token, leftParen, 1);
							}
						});
					}

					offsets.setDesiredOffset(rightParen, leftParen, 0);
				}
			}

			/**
			 * Ignore all tokens within an unknown node whose offset do not depend
			 * on another token's offset within the unknown node
			 * @param {ASTNode} node Unknown Node
			 * @returns {void}
			 */
			function ignoreNode(node) {
				const unknownNodeTokens = new Set(
					sourceCode.getTokens(node, { includeComments: true }),
				);

				unknownNodeTokens.forEach(token => {
					if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) {
						const firstTokenOfLine =
							tokenInfo.getFirstTokenOfLine(token);

						if (token === firstTokenOfLine) {
							offsets.ignoreToken(token);
						} else {
							offsets.setDesiredOffset(token, firstTokenOfLine, 0);
						}
					}
				});
			}

			/**
			 * Check whether the given token is on the first line of a statement.
			 * @param {Token} token The token to check.
			 * @param {ASTNode} leafNode The expression node that the token belongs directly.
			 * @returns {boolean} `true` if the token is on the first line of a statement.
			 */
			function isOnFirstLineOfStatement(token, leafNode) {
				let node = leafNode;

				while (
					node.parent &&
					!node.parent.type.endsWith("Statement") &&
					!node.parent.type.endsWith("Declaration")
				) {
					node = node.parent;
				}
				node = node.parent;

				return !node || node.loc.start.line === token.loc.start.line;
			}

			/**
			 * Check whether there are any blank (whitespace-only) lines between
			 * two tokens on separate lines.
			 * @param {Token} firstToken The first token.
			 * @param {Token} secondToken The second token.
			 * @returns {boolean} `true` if the tokens are on separate lines and
			 *   there exists a blank line between them, `false` otherwise.
			 */
			function hasBlankLinesBetween(firstToken, secondToken) {
				const firstTokenLine = firstToken.loc.end.line;
				const secondTokenLine = secondToken.loc.start.line;

				if (
					firstTokenLine === secondTokenLine ||
					firstTokenLine === secondTokenLine - 1
				) {
					return false;
				}

				for (
					let line = firstTokenLine + 1;
					line < secondTokenLine;
					++line
				) {
					if (!tokenInfo.firstTokensByLineNumber.has(line)) {
						return true;
					}
				}

				return false;
			}

			const ignoredNodeFirstTokens = new Set();

			const baseOffsetListeners = {
				"ArrayExpression, ArrayPattern"(node) {
					const openingBracket = sourceCode.getFirstToken(node);
					const closingBracket = sourceCode.getTokenAfter(
						[...node.elements].reverse().find(_ => _) || openingBracket,
						astUtils.isClosingBracketToken,
					);

					addElementListIndent(
						node.elements,
						openingBracket,
						closingBracket,
						options.ArrayExpression,
					);
				},

				"ObjectExpression, ObjectPattern"(node) {
					const openingCurly = sourceCode.getFirstToken(node);
					const closingCurly = sourceCode.getTokenAfter(
						node.properties.length
							? node.properties.at(-1)
							: openingCurly,
						astUtils.isClosingBraceToken,
					);

					addElementListIndent(
						node.properties,
						openingCurly,
						closingCurly,
						options.ObjectExpression,
					);
				},

				ArrowFunctionExpression(node) {
					const maybeOpeningParen = sourceCode.getFirstToken(node, {
						skip: node.async ? 1 : 0,
					});

					if (astUtils.isOpeningParenToken(maybeOpeningParen)) {
						const openingParen = maybeOpeningParen;
						const closingParen = sourceCode.getTokenBefore(
							node.body,
							astUtils.isClosingParenToken,
						);

						parameterParens.add(openingParen);
						parameterParens.add(closingParen);
						addElementListIndent(
							node.params,
							openingParen,
							closingParen,
							options.FunctionExpression.parameters,
						);
					}

					addBlocklessNodeIndent(node.body);
				},

				AssignmentExpression(node) {
					const operator = sourceCode.getFirstTokenBetween(
						node.left,
						node.right,
						token => token.value === node.operator,
					);

					offsets.setDesiredOffsets(
						[operator.range[0], node.range[1]],
						sourceCode.getLastToken(node.left),
						1,
					);
					offsets.ignoreToken(operator);
					offsets.ignoreToken(sourceCode.getTokenAfter(operator));
				},

				"BinaryExpression, LogicalExpression"(node) {
					const operator = sourceCode.getFirstTokenBetween(
						node.left,
						node.right,
						token => token.value === node.operator,
					);

					/*
					 * For backwards compatibility, don't check BinaryExpression indents, e.g.
					 * var foo = bar &&
					 *                   baz;
					 */

					const tokenAfterOperator = sourceCode.getTokenAfter(operator);

					offsets.ignoreToken(operator);
					offsets.ignoreToken(tokenAfterOperator);
					offsets.setDesiredOffset(tokenAfterOperator, operator, 0);
				},

				"BlockStatement, ClassBody"(node) {
					let blockIndentLevel;

					if (node.parent && isOuterIIFE(node.parent)) {
						blockIndentLevel = options.outerIIFEBody;
					} else if (
						node.parent &&
						(node.parent.type === "FunctionExpression" ||
							node.parent.type === "ArrowFunctionExpression")
					) {
						blockIndentLevel = options.FunctionExpression.body;
					} else if (
						node.parent &&
						node.parent.type === "FunctionDeclaration"
					) {
						blockIndentLevel = options.FunctionDeclaration.body;
					} else {
						blockIndentLevel = 1;
					}

					/*
					 * For blocks that aren't lone statements, ensure that the opening curly brace
					 * is aligned with the parent.
					 */
					if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) {
						offsets.setDesiredOffset(
							sourceCode.getFirstToken(node),
							sourceCode.getFirstToken(node.parent),
							0,
						);
					}

					addElementListIndent(
						node.body,
						sourceCode.getFirstToken(node),
						sourceCode.getLastToken(node),
						blockIndentLevel,
					);
				},

				CallExpression: addFunctionCallIndent,

				"ClassDeclaration[superClass], ClassExpression[superClass]"(node) {
					const classToken = sourceCode.getFirstToken(node);
					const extendsToken = sourceCode.getTokenBefore(
						node.superClass,
						astUtils.isNotOpeningParenToken,
					);

					offsets.setDesiredOffsets(
						[extendsToken.range[0], node.body.range[0]],
						classToken,
						1,
					);
				},

				ConditionalExpression(node) {
					const firstToken = sourceCode.getFirstToken(node);

					// `flatTernaryExpressions` option is for the following style:
					// var a =
					//     foo > 0 ? bar :
					//     foo < 0 ? baz :
					//     /*else*/ qiz ;
					if (
						!options.flatTernaryExpressions ||
						!astUtils.isTokenOnSameLine(node.test, node.consequent) ||
						isOnFirstLineOfStatement(firstToken, node)
					) {
						const questionMarkToken = sourceCode.getFirstTokenBetween(
							node.test,
							node.consequent,
							token =>
								token.type === "Punctuator" && token.value === "?",
						);
						const colonToken = sourceCode.getFirstTokenBetween(
							node.consequent,
							node.alternate,
							token =>
								token.type === "Punctuator" && token.value === ":",
						);

						const firstConsequentToken =
							sourceCode.getTokenAfter(questionMarkToken);
						const lastConsequentToken =
							sourceCode.getTokenBefore(colonToken);
						const firstAlternateToken =
							sourceCode.getTokenAfter(colonToken);

						offsets.setDesiredOffset(questionMarkToken, firstToken, 1);
						offsets.setDesiredOffset(colonToken, firstToken, 1);

						offsets.setDesiredOffset(
							firstConsequentToken,
							firstToken,
							firstConsequentToken.type === "Punctuator" &&
								options.offsetTernaryExpressions
								? 2
								: 1,
						);

						/*
						 * The alternate and the consequent should usually have the same indentation.
						 * If they share part of a line, align the alternate against the first token of the consequent.
						 * This allows the alternate to be indented correctly in cases like this:
						 * foo ? (
						 *   bar
						 * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo`
						 *   baz // as a result, `baz` is offset by 1 rather than 2
						 * )
						 */
						if (
							lastConsequentToken.loc.end.line ===
							firstAlternateToken.loc.start.line
						) {
							offsets.setDesiredOffset(
								firstAlternateToken,
								firstConsequentToken,
								0,
							);
						} else {
							/**
							 * If the alternate and consequent do not share part of a line, offset the alternate from the first
							 * token of the conditional expression. For example:
							 * foo ? bar
							 *   : baz
							 *
							 * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up
							 * having no expected indentation.
							 */
							offsets.setDesiredOffset(
								firstAlternateToken,
								firstToken,
								firstAlternateToken.type === "Punctuator" &&
									options.offsetTernaryExpressions
									? 2
									: 1,
							);
						}
					}
				},

				"DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement":
					node => addBlocklessNodeIndent(node.body),

				ExportNamedDeclaration(node) {
					if (node.declaration === null) {
						const closingCurly = sourceCode.getLastToken(
							node,
							astUtils.isClosingBraceToken,
						);

						// Indent the specifiers in `export {foo, bar, baz}`
						addElementListIndent(
							node.specifiers,
							sourceCode.getFirstToken(node, { skip: 1 }),
							closingCurly,
							1,
						);

						if (node.source) {
							// Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'`
							offsets.setDesiredOffsets(
								[closingCurly.range[1], node.range[1]],
								sourceCode.getFirstToken(node),
								1,
							);
						}
					}
				},

				ForStatement(node) {
					const forOpeningParen = sourceCode.getFirstToken(node, 1);

					if (node.init) {
						offsets.setDesiredOffsets(
							node.init.range,
							forOpeningParen,
							1,
						);
					}
					if (node.test) {
						offsets.setDesiredOffsets(
							node.test.range,
							forOpeningParen,
							1,
						);
					}
					if (node.update) {
						offsets.setDesiredOffsets(
							node.update.range,
							forOpeningParen,
							1,
						);
					}
					addBlocklessNodeIndent(node.body);
				},

				"FunctionDeclaration, FunctionExpression"(node) {
					const closingParen = sourceCode.getTokenBefore(node.body);
					const openingParen = sourceCode.getTokenBefore(
						node.params.length ? node.params[0] : closingParen,
					);

					parameterParens.add(openingParen);
					parameterParens.add(closingParen);
					addElementListIndent(
						node.params,
						openingParen,
						closingParen,
						options[node.type].parameters,
					);
				},

				IfStatement(node) {
					addBlocklessNodeIndent(node.consequent);
					if (node.alternate) {
						addBlocklessNodeIndent(node.alternate);
					}
				},

				/*
				 * For blockless nodes with semicolon-first style, don't indent the semicolon.
				 * e.g.
				 * if (foo)
				 *     bar()
				 * ; [1, 2, 3].map(foo)
				 *
				 * Traversal into the node sets indentation of the semicolon, so we need to override it on exit.
				 */
				":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(
					node,
				) {
					let nodesToCheck;

					if (node.type === "IfStatement") {
						nodesToCheck = [node.consequent];
						if (node.alternate) {
							nodesToCheck.push(node.alternate);
						}
					} else {
						nodesToCheck = [node.body];
					}

					for (const nodeToCheck of nodesToCheck) {
						const lastToken = sourceCode.getLastToken(nodeToCheck);

						if (astUtils.isSemicolonToken(lastToken)) {
							const tokenBeforeLast =
								sourceCode.getTokenBefore(lastToken);
							const tokenAfterLast =
								sourceCode.getTokenAfter(lastToken);

							// override indentation of `;` only if its line looks like a semicolon-first style line
							if (
								!astUtils.isTokenOnSameLine(
									tokenBeforeLast,
									lastToken,
								) &&
								tokenAfterLast &&
								astUtils.isTokenOnSameLine(
									lastToken,
									tokenAfterLast,
								)
							) {
								offsets.setDesiredOffset(
									lastToken,
									sourceCode.getFirstToken(node),
									0,
								);
							}
						}
					}
				},

				ImportDeclaration(node) {
					if (
						node.specifiers.some(
							specifier => specifier.type === "ImportSpecifier",
						)
					) {
						const openingCurly = sourceCode.getFirstToken(
							node,
							astUtils.isOpeningBraceToken,
						);
						const closingCurly = sourceCode.getLastToken(
							node,
							astUtils.isClosingBraceToken,
						);

						addElementListIndent(
							node.specifiers.filter(
								specifier => specifier.type === "ImportSpecifier",
							),
							openingCurly,
							closingCurly,
							options.ImportDeclaration,
						);
					}

					const fromToken = sourceCode.getLastToken(
						node,
						token =>
							token.type === "Identifier" && token.value === "from",
					);
					const sourceToken = sourceCode.getLastToken(
						node,
						token => token.type === "String",
					);
					const semiToken = sourceCode.getLastToken(
						node,
						token => token.type === "Punctuator" && token.value === ";",
					);

					if (fromToken) {
						const end =
							semiToken && semiToken.range[1] === sourceToken.range[1]
								? node.range[1]
								: sourceToken.range[1];

						offsets.setDesiredOffsets(
							[fromToken.range[0], end],
							sourceCode.getFirstToken(node),
							1,
						);
					}
				},

				ImportExpression(node) {
					const openingParen = sourceCode.getFirstToken(node, 1);
					const closingParen = sourceCode.getLastToken(node);

					parameterParens.add(openingParen);
					parameterParens.add(closingParen);
					offsets.setDesiredOffset(
						openingParen,
						sourceCode.getTokenBefore(openingParen),
						0,
					);

					addElementListIndent(
						[node.source],
						openingParen,
						closingParen,
						options.CallExpression.arguments,
					);
				},

				"MemberExpression, JSXMemberExpression, MetaProperty"(node) {
					const object =
						node.type === "MetaProperty" ? node.meta : node.object;
					const firstNonObjectToken = sourceCode.getFirstTokenBetween(
						object,
						node.property,
						astUtils.isNotClosingParenToken,
					);
					const secondNonObjectToken =
						sourceCode.getTokenAfter(firstNonObjectToken);

					const objectParenCount = sourceCode.getTokensBetween(
						object,
						node.property,
						{ filter: astUtils.isClosingParenToken },
					).length;
					const firstObjectToken = objectParenCount
						? sourceCode.getTokenBefore(object, {
								skip: objectParenCount - 1,
							})
						: sourceCode.getFirstToken(object);
					const lastObjectToken =
						sourceCode.getTokenBefore(firstNonObjectToken);
					const firstPropertyToken = node.computed
						? firstNonObjectToken
						: secondNonObjectToken;

					if (node.computed) {
						// For computed MemberExpressions, match the closing bracket with the opening bracket.
						offsets.setDesiredOffset(
							sourceCode.getLastToken(node),
							firstNonObjectToken,
							0,
						);
						offsets.setDesiredOffsets(
							node.property.range,
							firstNonObjectToken,
							1,
						);
					}

					/*
					 * If the object ends on the same line that the property starts, match against the last token
					 * of the object, to ensure that the MemberExpression is not indented.
					 *
					 * Otherwise, match against the first token of the object, e.g.
					 * foo
					 *   .bar
					 *   .baz // <-- offset by 1 from `foo`
					 */
					const offsetBase =
						lastObjectToken.loc.end.line ===
						firstPropertyToken.loc.start.line
							? lastObjectToken
							: firstObjectToken;

					if (typeof options.MemberExpression === "number") {
						// Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object.
						offsets.setDesiredOffset(
							firstNonObjectToken,
							offsetBase,
							options.MemberExpression,
						);

						/*
						 * For computed MemberExpressions, match the first token of the property against the opening bracket.
						 * Otherwise, match the first token of the property against the object.
						 */
						offsets.setDesiredOffset(
							secondNonObjectToken,
							node.computed ? firstNonObjectToken : offsetBase,
							options.MemberExpression,
						);
					} else {
						// If the MemberExpression option is off, ignore the dot and the first token of the property.
						offsets.ignoreToken(firstNonObjectToken);
						offsets.ignoreToken(secondNonObjectToken);

						// To ignore the property indentation, ensure that the property tokens depend on the ignored tokens.
						offsets.setDesiredOffset(
							firstNonObjectToken,
							offsetBase,
							0,
						);
						offsets.setDesiredOffset(
							secondNonObjectToken,
							firstNonObjectToken,
							0,
						);
					}
				},

				NewExpression(node) {
					// Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo`
					if (
						node.arguments.length > 0 ||
						(astUtils.isClosingParenToken(
							sourceCode.getLastToken(node),
						) &&
							astUtils.isOpeningParenToken(
								sourceCode.getLastToken(node, 1),
							))
					) {
						addFunctionCallIndent(node);
					}
				},

				Property(node) {
					if (!node.shorthand && !node.method && node.kind === "init") {
						const colon = sourceCode.getFirstTokenBetween(
							node.key,
							node.value,
							astUtils.isColonToken,
						);

						offsets.ignoreToken(sourceCode.getTokenAfter(colon));
					}
				},

				PropertyDefinition(node) {
					const firstToken = sourceCode.getFirstToken(node);
					const maybeSemicolonToken = sourceCode.getLastToken(node);
					let keyLastToken;

					// Indent key.
					if (node.computed) {
						const bracketTokenL = sourceCode.getTokenBefore(
							node.key,
							astUtils.isOpeningBracketToken,
						);
						const bracketTokenR = (keyLastToken =
							sourceCode.getTokenAfter(
								node.key,
								astUtils.isClosingBracketToken,
							));
						const keyRange = [
							bracketTokenL.range[1],
							bracketTokenR.range[0],
						];

						if (bracketTokenL !== firstToken) {
							offsets.setDesiredOffset(bracketTokenL, firstToken, 0);
						}
						offsets.setDesiredOffsets(keyRange, bracketTokenL, 1);
						offsets.setDesiredOffset(bracketTokenR, bracketTokenL, 0);
					} else {
						const idToken = (keyLastToken = sourceCode.getFirstToken(
							node.key,
						));

						if (idToken !== firstToken) {
							offsets.setDesiredOffset(idToken, firstToken, 1);
						}
					}

					// Indent initializer.
					if (node.value) {
						const eqToken = sourceCode.getTokenBefore(
							node.value,
							astUtils.isEqToken,
						);
						const valueToken = sourceCode.getTokenAfter(eqToken);

						offsets.setDesiredOffset(eqToken, keyLastToken, 1);
						offsets.setDesiredOffset(valueToken, eqToken, 1);
						if (astUtils.isSemicolonToken(maybeSemicolonToken)) {
							offsets.setDesiredOffset(
								maybeSemicolonToken,
								eqToken,
								1,
							);
						}
					} else if (astUtils.isSemicolonToken(maybeSemicolonToken)) {
						offsets.setDesiredOffset(
							maybeSemicolonToken,
							keyLastToken,
							1,
						);
					}
				},

				StaticBlock(node) {
					const openingCurly = sourceCode.getFirstToken(node, {
						skip: 1,
					}); // skip the `static` token
					const closingCurly = sourceCode.getLastToken(node);

					addElementListIndent(
						node.body,
						openingCurly,
						closingCurly,
						options.StaticBlock.body,
					);
				},

				SwitchStatement(node) {
					const openingCurly = sourceCode.getTokenAfter(
						node.discriminant,
						astUtils.isOpeningBraceToken,
					);
					const closingCurly = sourceCode.getLastToken(node);

					offsets.setDesiredOffsets(
						[openingCurly.range[1], closingCurly.range[0]],
						openingCurly,
						options.SwitchCase,
					);

					if (node.cases.length) {
						sourceCode
							.getTokensBetween(node.cases.at(-1), closingCurly, {
								includeComments: true,
								filter: astUtils.isCommentToken,
							})
							.forEach(token => offsets.ignoreToken(token));
					}
				},

				SwitchCase(node) {
					if (
						!(
							node.consequent.length === 1 &&
							node.consequent[0].type === "BlockStatement"
						)
					) {
						const caseKeyword = sourceCode.getFirstToken(node);
						const tokenAfterCurrentCase =
							sourceCode.getTokenAfter(node);

						offsets.setDesiredOffsets(
							[caseKeyword.range[1], tokenAfterCurrentCase.range[0]],
							caseKeyword,
							1,
						);
					}
				},

				TemplateLiteral(node) {
					node.expressions.forEach((expression, index) => {
						const previousQuasi = node.quasis[index];
						const nextQuasi = node.quasis[index + 1];
						const tokenToAlignFrom =
							previousQuasi.loc.start.line ===
							previousQuasi.loc.end.line
								? sourceCode.getFirstToken(previousQuasi)
								: null;

						offsets.setDesiredOffsets(
							[previousQuasi.range[1], nextQuasi.range[0]],
							tokenToAlignFrom,
							1,
						);
						offsets.setDesiredOffset(
							sourceCode.getFirstToken(nextQuasi),
							tokenToAlignFrom,
							0,
						);
					});
				},

				VariableDeclaration(node) {
					let variableIndent = Object.hasOwn(
						options.VariableDeclarator,
						node.kind,
					)
						? options.VariableDeclarator[node.kind]
						: DEFAULT_VARIABLE_INDENT;

					const firstToken = sourceCode.getFirstToken(node),
						lastToken = sourceCode.getLastToken(node);

					if (options.VariableDeclarator[node.kind] === "first") {
						if (node.declarations.length > 1) {
							addElementListIndent(
								node.declarations,
								firstToken,
								lastToken,
								"first",
							);
							return;
						}

						variableIndent = DEFAULT_VARIABLE_INDENT;
					}

					if (
						node.declarations.at(-1).loc.start.line >
						node.loc.start.line
					) {
						/*
						 * VariableDeclarator indentation is a bit different from other forms of indentation, in that the
						 * indentation of an opening bracket sometimes won't match that of a closing bracket. For example,
						 * the following indentations are correct:
						 *
						 * var foo = {
						 *   ok: true
						 * };
						 *
						 * var foo = {
						 *     ok: true,
						 *   },
						 *   bar = 1;
						 *
						 * Account for when exiting the AST (after indentations have already been set for the nodes in
						 * the declaration) by manually increasing the indentation level of the tokens in this declarator
						 * on the same line as the start of the declaration, provided that there are declarators that
						 * follow this one.
						 */
						offsets.setDesiredOffsets(
							node.range,
							firstToken,
							variableIndent,
							true,
						);
					} else {
						offsets.setDesiredOffsets(
							node.range,
							firstToken,
							variableIndent,
						);
					}

					if (astUtils.isSemicolonToken(lastToken)) {
						offsets.ignoreToken(lastToken);
					}
				},

				VariableDeclarator(node) {
					if (node.init) {
						const equalOperator = sourceCode.getTokenBefore(
							node.init,
							astUtils.isNotOpeningParenToken,
						);
						const tokenAfterOperator =
							sourceCode.getTokenAfter(equalOperator);

						offsets.ignoreToken(equalOperator);
						offsets.ignoreToken(tokenAfterOperator);
						offsets.setDesiredOffsets(
							[tokenAfterOperator.range[0], node.range[1]],
							equalOperator,
							1,
						);
						offsets.setDesiredOffset(
							equalOperator,
							sourceCode.getLastToken(node.id),
							0,
						);
					}
				},

				"JSXAttribute[value]"(node) {
					const equalsToken = sourceCode.getFirstTokenBetween(
						node.name,
						node.value,
						token => token.type === "Punctuator" && token.value === "=",
					);

					offsets.setDesiredOffsets(
						[equalsToken.range[0], node.value.range[1]],
						sourceCode.getFirstToken(node.name),
						1,
					);
				},

				JSXElement(node) {
					if (node.closingElement) {
						addElementListIndent(
							node.children,
							sourceCode.getFirstToken(node.openingElement),
							sourceCode.getFirstToken(node.closingElement),
							1,
						);
					}
				},

				JSXOpeningElement(node) {
					const firstToken = sourceCode.getFirstToken(node);
					let closingToken;

					if (node.selfClosing) {
						closingToken = sourceCode.getLastToken(node, { skip: 1 });
						offsets.setDesiredOffset(
							sourceCode.getLastToken(node),
							closingToken,
							0,
						);
					} else {
						closingToken = sourceCode.getLastToken(node);
					}
					offsets.setDesiredOffsets(
						node.name.range,
						sourceCode.getFirstToken(node),
					);
					addElementListIndent(
						node.attributes,
						firstToken,
						closingToken,
						1,
					);
				},

				JSXClosingElement(node) {
					const firstToken = sourceCode.getFirstToken(node);

					offsets.setDesiredOffsets(node.name.range, firstToken, 1);
				},

				JSXFragment(node) {
					const firstOpeningToken = sourceCode.getFirstToken(
						node.openingFragment,
					);
					const firstClosingToken = sourceCode.getFirstToken(
						node.closingFragment,
					);

					addElementListIndent(
						node.children,
						firstOpeningToken,
						firstClosingToken,
						1,
					);
				},

				JSXOpeningFragment(node) {
					const firstToken = sourceCode.getFirstToken(node);
					const closingToken = sourceCode.getLastToken(node);

					offsets.setDesiredOffsets(node.range, firstToken, 1);
					offsets.matchOffsetOf(firstToken, closingToken);
				},

				JSXClosingFragment(node) {
					const firstToken = sourceCode.getFirstToken(node);
					const slashToken = sourceCode.getLastToken(node, { skip: 1 });
					const closingToken = sourceCode.getLastToken(node);
					const tokenToMatch = astUtils.isTokenOnSameLine(
						slashToken,
						closingToken,
					)
						? slashToken
						: closingToken;

					offsets.setDesiredOffsets(node.range, firstToken, 1);
					offsets.matchOffsetOf(firstToken, tokenToMatch);
				},

				JSXExpressionContainer(node) {
					const openingCurly = sourceCode.getFirstToken(node);
					const closingCurly = sourceCode.getLastToken(node);

					offsets.setDesiredOffsets(
						[openingCurly.range[1], closingCurly.range[0]],
						openingCurly,
						1,
					);
				},

				JSXSpreadAttribute(node) {
					const openingCurly = sourceCode.getFirstToken(node);
					const closingCurly = sourceCode.getLastToken(node);

					offsets.setDesiredOffsets(
						[openingCurly.range[1], closingCurly.range[0]],
						openingCurly,
						1,
					);
				},

				"*"(node) {
					const firstToken = sourceCode.getFirstToken(node);

					// Ensure that the children of every node are indented at least as much as the first token.
					if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) {
						offsets.setDesiredOffsets(node.range, firstToken, 0);
					}
				},
			};

			const listenerCallQueue = [];

			/*
			 * To ignore the indentation of a node:
			 * 1. Don't call the node's listener when entering it (if it has a listener)
			 * 2. Don't set any offsets against the first token of the node.
			 * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
			 */
			const offsetListeners = {};

			for (const [selector, listener] of Object.entries(
				baseOffsetListeners,
			)) {
				/*
				 * Offset listener calls are deferred until traversal is finished, and are called as
				 * part of the final `Program:exit` listener. This is necessary because a node might
				 * be matched by multiple selectors.
				 *
				 * Example: Suppose there is an offset listener for `Identifier`, and the user has
				 * specified in configuration that `MemberExpression > Identifier` should be ignored.
				 * Due to selector specificity rules, the `Identifier` listener will get called first. However,
				 * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener
				 * should not have been called at all. Without doing extra selector matching, we don't know
				 * whether the Identifier matches the `MemberExpression > Identifier` selector until the
				 * `MemberExpression > Identifier` listener is called.
				 *
				 * To avoid this, the `Identifier` listener isn't called until traversal finishes and all
				 * ignored nodes are known.
				 */
				offsetListeners[selector] = node =>
					listenerCallQueue.push({ listener, node });
			}

			// For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set.
			const ignoredNodes = new Set();

			/**
			 * Ignores a node
			 * @param {ASTNode} node The node to ignore
			 * @returns {void}
			 */
			function addToIgnoredNodes(node) {
				ignoredNodes.add(node);
				ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node));
			}

			const ignoredNodeListeners = options.ignoredNodes.reduce(
				(listeners, ignoredSelector) =>
					Object.assign(listeners, {
						[ignoredSelector]: addToIgnoredNodes,
					}),
				{},
			);

			/*
			 * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation
			 * at the end.
			 *
			 * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears
			 * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored,
			 * so those listeners wouldn't be called anyway.
			 */
			return Object.assign(offsetListeners, ignoredNodeListeners, {
				"*:exit"(node) {
					// If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it.
					if (!KNOWN_NODES.has(node.type)) {
						addToIgnoredNodes(node);
					}
				},
				"Program:exit"() {
					// If ignoreComments option is enabled, ignore all comment tokens.
					if (options.ignoreComments) {
						sourceCode
							.getAllComments()
							.forEach(comment => offsets.ignoreToken(comment));
					}

					// Invoke the queued offset listeners for the nodes that aren't ignored.
					for (let i = 0; i < listenerCallQueue.length; i++) {
						const nodeInfo = listenerCallQueue[i];

						if (!ignoredNodes.has(nodeInfo.node)) {
							nodeInfo.listener(nodeInfo.node);
						}
					}

					// Update the offsets for ignored nodes to prevent their child tokens from being reported.
					ignoredNodes.forEach(ignoreNode);

					addParensIndent(sourceCode.ast.tokens);

					/*
					 * Create a Map from (tokenOrComment) => (precedingToken).
					 * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly.
					 */
					const precedingTokens = new WeakMap();

					for (let i = 0; i < sourceCode.ast.comments.length; i++) {
						const comment = sourceCode.ast.comments[i];

						const tokenOrCommentBefore = sourceCode.getTokenBefore(
							comment,
							{ includeComments: true },
						);
						const hasToken = precedingTokens.has(tokenOrCommentBefore)
							? precedingTokens.get(tokenOrCommentBefore)
							: tokenOrCommentBefore;

						precedingTokens.set(comment, hasToken);
					}

					for (let i = 1; i < sourceCode.lines.length + 1; i++) {
						if (!tokenInfo.firstTokensByLineNumber.has(i)) {
							// Don't check indentation on blank lines
							continue;
						}

						const firstTokenOfLine =
							tokenInfo.firstTokensByLineNumber.get(i);

						if (firstTokenOfLine.loc.start.line !== i) {
							// Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice.
							continue;
						}

						if (astUtils.isCommentToken(firstTokenOfLine)) {
							const tokenBefore =
								precedingTokens.get(firstTokenOfLine);
							const tokenAfter = tokenBefore
								? sourceCode.getTokenAfter(tokenBefore)
								: sourceCode.ast.tokens[0];
							const mayAlignWithBefore =
								tokenBefore &&
								!hasBlankLinesBetween(
									tokenBefore,
									firstTokenOfLine,
								);
							const mayAlignWithAfter =
								tokenAfter &&
								!hasBlankLinesBetween(firstTokenOfLine, tokenAfter);

							/*
							 * If a comment precedes a line that begins with a semicolon token, align to that token, i.e.
							 *
							 * let foo
							 * // comment
							 * ;(async () => {})()
							 */
							if (
								tokenAfter &&
								astUtils.isSemicolonToken(tokenAfter) &&
								!astUtils.isTokenOnSameLine(
									firstTokenOfLine,
									tokenAfter,
								)
							) {
								offsets.setDesiredOffset(
									firstTokenOfLine,
									tokenAfter,
									0,
								);
							}

							// If a comment matches the expected indentation of the token immediately before or after, don't report it.
							if (
								(mayAlignWithBefore &&
									validateTokenIndent(
										firstTokenOfLine,
										offsets.getDesiredIndent(tokenBefore),
									)) ||
								(mayAlignWithAfter &&
									validateTokenIndent(
										firstTokenOfLine,
										offsets.getDesiredIndent(tokenAfter),
									))
							) {
								continue;
							}
						}

						// If the token matches the expected indentation, don't report it.
						if (
							validateTokenIndent(
								firstTokenOfLine,
								offsets.getDesiredIndent(firstTokenOfLine),
							)
						) {
							continue;
						}

						// Otherwise, report the token/comment.
						report(
							firstTokenOfLine,
							offsets.getDesiredIndent(firstTokenOfLine),
						);
					}
				},
			});
		},
	};
	return indent;
}

/**
 * @fileoverview This option sets a specific tab width for your code
 *
 * This rule has been ported and modified from nodeca.
 * @author Vitaly Puzrin
 * @author Gyandeep Singh
 * @deprecated in ESLint v4.0.0
 */

var indentLegacy;
var hasRequiredIndentLegacy;

function requireIndentLegacy () {
	if (hasRequiredIndentLegacy) return indentLegacy;
	hasRequiredIndentLegacy = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------
	// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway.
	/* c8 ignore next */
	/** @type {import('../shared/types').Rule} */
	indentLegacy = {
		meta: {
			type: "layout",

			docs: {
				description: "Enforce consistent indentation",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/indent-legacy",
			},

			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "4.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "indent",
							url: "https://eslint.style/rules/js/indent",
						},
					},
				],
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["tab"],
						},
						{
							type: "integer",
							minimum: 0,
						},
					],
				},
				{
					type: "object",
					properties: {
						SwitchCase: {
							type: "integer",
							minimum: 0,
						},
						VariableDeclarator: {
							oneOf: [
								{
									type: "integer",
									minimum: 0,
								},
								{
									type: "object",
									properties: {
										var: {
											type: "integer",
											minimum: 0,
										},
										let: {
											type: "integer",
											minimum: 0,
										},
										const: {
											type: "integer",
											minimum: 0,
										},
									},
								},
							],
						},
						outerIIFEBody: {
							type: "integer",
							minimum: 0,
						},
						MemberExpression: {
							type: "integer",
							minimum: 0,
						},
						FunctionDeclaration: {
							type: "object",
							properties: {
								parameters: {
									oneOf: [
										{
											type: "integer",
											minimum: 0,
										},
										{
											enum: ["first"],
										},
									],
								},
								body: {
									type: "integer",
									minimum: 0,
								},
							},
						},
						FunctionExpression: {
							type: "object",
							properties: {
								parameters: {
									oneOf: [
										{
											type: "integer",
											minimum: 0,
										},
										{
											enum: ["first"],
										},
									],
								},
								body: {
									type: "integer",
									minimum: 0,
								},
							},
						},
						CallExpression: {
							type: "object",
							properties: {
								parameters: {
									oneOf: [
										{
											type: "integer",
											minimum: 0,
										},
										{
											enum: ["first"],
										},
									],
								},
							},
						},
						ArrayExpression: {
							oneOf: [
								{
									type: "integer",
									minimum: 0,
								},
								{
									enum: ["first"],
								},
							],
						},
						ObjectExpression: {
							oneOf: [
								{
									type: "integer",
									minimum: 0,
								},
								{
									enum: ["first"],
								},
							],
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				expected:
					"Expected indentation of {{expected}} but found {{actual}}.",
			},
		},

		create(context) {
			const DEFAULT_VARIABLE_INDENT = 1;
			const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config
			const DEFAULT_FUNCTION_BODY_INDENT = 1;

			let indentType = "space";
			let indentSize = 4;
			const options = {
				SwitchCase: 0,
				VariableDeclarator: {
					var: DEFAULT_VARIABLE_INDENT,
					let: DEFAULT_VARIABLE_INDENT,
					const: DEFAULT_VARIABLE_INDENT,
				},
				outerIIFEBody: null,
				FunctionDeclaration: {
					parameters: DEFAULT_PARAMETER_INDENT,
					body: DEFAULT_FUNCTION_BODY_INDENT,
				},
				FunctionExpression: {
					parameters: DEFAULT_PARAMETER_INDENT,
					body: DEFAULT_FUNCTION_BODY_INDENT,
				},
				CallExpression: {
					arguments: DEFAULT_PARAMETER_INDENT,
				},
				ArrayExpression: 1,
				ObjectExpression: 1,
			};

			const sourceCode = context.sourceCode;

			if (context.options.length) {
				if (context.options[0] === "tab") {
					indentSize = 1;
					indentType = "tab";
				} /* c8 ignore start */ else if (
					typeof context.options[0] === "number"
				) {
					indentSize = context.options[0];
					indentType = "space";
				} /* c8 ignore stop */

				if (context.options[1]) {
					const opts = context.options[1];

					options.SwitchCase = opts.SwitchCase || 0;
					const variableDeclaratorRules = opts.VariableDeclarator;

					if (typeof variableDeclaratorRules === "number") {
						options.VariableDeclarator = {
							var: variableDeclaratorRules,
							let: variableDeclaratorRules,
							const: variableDeclaratorRules,
						};
					} else if (typeof variableDeclaratorRules === "object") {
						Object.assign(
							options.VariableDeclarator,
							variableDeclaratorRules,
						);
					}

					if (typeof opts.outerIIFEBody === "number") {
						options.outerIIFEBody = opts.outerIIFEBody;
					}

					if (typeof opts.MemberExpression === "number") {
						options.MemberExpression = opts.MemberExpression;
					}

					if (typeof opts.FunctionDeclaration === "object") {
						Object.assign(
							options.FunctionDeclaration,
							opts.FunctionDeclaration,
						);
					}

					if (typeof opts.FunctionExpression === "object") {
						Object.assign(
							options.FunctionExpression,
							opts.FunctionExpression,
						);
					}

					if (typeof opts.CallExpression === "object") {
						Object.assign(options.CallExpression, opts.CallExpression);
					}

					if (
						typeof opts.ArrayExpression === "number" ||
						typeof opts.ArrayExpression === "string"
					) {
						options.ArrayExpression = opts.ArrayExpression;
					}

					if (
						typeof opts.ObjectExpression === "number" ||
						typeof opts.ObjectExpression === "string"
					) {
						options.ObjectExpression = opts.ObjectExpression;
					}
				}
			}

			const caseIndentStore = {};

			/**
			 * Creates an error message for a line, given the expected/actual indentation.
			 * @param {int} expectedAmount The expected amount of indentation characters for this line
			 * @param {int} actualSpaces The actual number of indentation spaces that were found on this line
			 * @param {int} actualTabs The actual number of indentation tabs that were found on this line
			 * @returns {string} An error message for this line
			 */
			function createErrorMessageData(
				expectedAmount,
				actualSpaces,
				actualTabs,
			) {
				const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs"
				const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space"
				const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs"
				let foundStatement;

				if (actualSpaces > 0 && actualTabs > 0) {
					foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs"
				} else if (actualSpaces > 0) {
					/*
					 * Abbreviate the message if the expected indentation is also spaces.
					 * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces'
					 */
					foundStatement =
						indentType === "space"
							? actualSpaces
							: `${actualSpaces} ${foundSpacesWord}`;
				} else if (actualTabs > 0) {
					foundStatement =
						indentType === "tab"
							? actualTabs
							: `${actualTabs} ${foundTabsWord}`;
				} else {
					foundStatement = "0";
				}
				return {
					expected: expectedStatement,
					actual: foundStatement,
				};
			}

			/**
			 * Reports a given indent violation
			 * @param {ASTNode} node Node violating the indent rule
			 * @param {int} needed Expected indentation character count
			 * @param {int} gottenSpaces Indentation space count in the actual node/code
			 * @param {int} gottenTabs Indentation tab count in the actual node/code
			 * @param {Object} [loc] Error line and column location
			 * @param {boolean} isLastNodeCheck Is the error for last node check
			 * @returns {void}
			 */
			function report(
				node,
				needed,
				gottenSpaces,
				gottenTabs,
				loc,
				isLastNodeCheck,
			) {
				if (gottenSpaces && gottenTabs) {
					// To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs.
					return;
				}

				const desiredIndent = (indentType === "space" ? " " : "\t").repeat(
					needed,
				);

				const textRange = isLastNodeCheck
					? [
							node.range[1] - node.loc.end.column,
							node.range[1] -
								node.loc.end.column +
								gottenSpaces +
								gottenTabs,
						]
					: [
							node.range[0] - node.loc.start.column,
							node.range[0] -
								node.loc.start.column +
								gottenSpaces +
								gottenTabs,
						];

				context.report({
					node,
					loc,
					messageId: "expected",
					data: createErrorMessageData(needed, gottenSpaces, gottenTabs),
					fix: fixer => fixer.replaceTextRange(textRange, desiredIndent),
				});
			}

			/**
			 * Get the actual indent of node
			 * @param {ASTNode|Token} node Node to examine
			 * @param {boolean} [byLastLine=false] get indent of node's last line
			 * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also
			 * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and
			 * `badChar` is the amount of the other indentation character.
			 */
			function getNodeIndent(node, byLastLine) {
				const token = byLastLine
					? sourceCode.getLastToken(node)
					: sourceCode.getFirstToken(node);
				const srcCharsBeforeNode = sourceCode
					.getText(token, token.loc.start.column)
					.split("");
				const indentChars = srcCharsBeforeNode.slice(
					0,
					srcCharsBeforeNode.findIndex(
						char => char !== " " && char !== "\t",
					),
				);
				const spaces = indentChars.filter(char => char === " ").length;
				const tabs = indentChars.filter(char => char === "\t").length;

				return {
					space: spaces,
					tab: tabs,
					goodChar: indentType === "space" ? spaces : tabs,
					badChar: indentType === "space" ? tabs : spaces,
				};
			}

			/**
			 * Checks node is the first in its own start line. By default it looks by start line.
			 * @param {ASTNode} node The node to check
			 * @param {boolean} [byEndLocation=false] Lookup based on start position or end
			 * @returns {boolean} true if its the first in the its start line
			 */
			function isNodeFirstInLine(node, byEndLocation) {
				const firstToken =
						byEndLocation === true
							? sourceCode.getLastToken(node, 1)
							: sourceCode.getTokenBefore(node),
					startLine =
						byEndLocation === true
							? node.loc.end.line
							: node.loc.start.line,
					endLine = firstToken ? firstToken.loc.end.line : -1;

				return startLine !== endLine;
			}

			/**
			 * Check indent for node
			 * @param {ASTNode} node Node to check
			 * @param {int} neededIndent needed indent
			 * @returns {void}
			 */
			function checkNodeIndent(node, neededIndent) {
				const actualIndent = getNodeIndent(node, false);

				if (
					node.type !== "ArrayExpression" &&
					node.type !== "ObjectExpression" &&
					(actualIndent.goodChar !== neededIndent ||
						actualIndent.badChar !== 0) &&
					isNodeFirstInLine(node)
				) {
					report(
						node,
						neededIndent,
						actualIndent.space,
						actualIndent.tab,
					);
				}

				if (node.type === "IfStatement" && node.alternate) {
					const elseToken = sourceCode.getTokenBefore(node.alternate);

					checkNodeIndent(elseToken, neededIndent);

					if (!isNodeFirstInLine(node.alternate)) {
						checkNodeIndent(node.alternate, neededIndent);
					}
				}

				if (node.type === "TryStatement" && node.handler) {
					const catchToken = sourceCode.getFirstToken(node.handler);

					checkNodeIndent(catchToken, neededIndent);
				}

				if (node.type === "TryStatement" && node.finalizer) {
					const finallyToken = sourceCode.getTokenBefore(node.finalizer);

					checkNodeIndent(finallyToken, neededIndent);
				}

				if (node.type === "DoWhileStatement") {
					const whileToken = sourceCode.getTokenAfter(node.body);

					checkNodeIndent(whileToken, neededIndent);
				}
			}

			/**
			 * Check indent for nodes list
			 * @param {ASTNode[]} nodes list of node objects
			 * @param {int} indent needed indent
			 * @returns {void}
			 */
			function checkNodesIndent(nodes, indent) {
				nodes.forEach(node => checkNodeIndent(node, indent));
			}

			/**
			 * Check last node line indent this detects, that block closed correctly
			 * @param {ASTNode} node Node to examine
			 * @param {int} lastLineIndent needed indent
			 * @returns {void}
			 */
			function checkLastNodeLineIndent(node, lastLineIndent) {
				const lastToken = sourceCode.getLastToken(node);
				const endIndent = getNodeIndent(lastToken, true);

				if (
					(endIndent.goodChar !== lastLineIndent ||
						endIndent.badChar !== 0) &&
					isNodeFirstInLine(node, true)
				) {
					report(
						node,
						lastLineIndent,
						endIndent.space,
						endIndent.tab,
						{
							line: lastToken.loc.start.line,
							column: lastToken.loc.start.column,
						},
						true,
					);
				}
			}

			/**
			 * Check last node line indent this detects, that block closed correctly
			 * This function for more complicated return statement case, where closing parenthesis may be followed by ';'
			 * @param {ASTNode} node Node to examine
			 * @param {int} firstLineIndent first line needed indent
			 * @returns {void}
			 */
			function checkLastReturnStatementLineIndent(node, firstLineIndent) {
				/*
				 * in case if return statement ends with ');' we have traverse back to ')'
				 * otherwise we'll measure indent for ';' and replace ')'
				 */
				const lastToken = sourceCode.getLastToken(
					node,
					astUtils.isClosingParenToken,
				);
				const textBeforeClosingParenthesis = sourceCode
					.getText(lastToken, lastToken.loc.start.column)
					.slice(0, -1);

				if (textBeforeClosingParenthesis.trim()) {
					// There are tokens before the closing paren, don't report this case
					return;
				}

				const endIndent = getNodeIndent(lastToken, true);

				if (endIndent.goodChar !== firstLineIndent) {
					report(
						node,
						firstLineIndent,
						endIndent.space,
						endIndent.tab,
						{
							line: lastToken.loc.start.line,
							column: lastToken.loc.start.column,
						},
						true,
					);
				}
			}

			/**
			 * Check first node line indent is correct
			 * @param {ASTNode} node Node to examine
			 * @param {int} firstLineIndent needed indent
			 * @returns {void}
			 */
			function checkFirstNodeLineIndent(node, firstLineIndent) {
				const startIndent = getNodeIndent(node, false);

				if (
					(startIndent.goodChar !== firstLineIndent ||
						startIndent.badChar !== 0) &&
					isNodeFirstInLine(node)
				) {
					report(
						node,
						firstLineIndent,
						startIndent.space,
						startIndent.tab,
						{
							line: node.loc.start.line,
							column: node.loc.start.column,
						},
					);
				}
			}

			/**
			 * Returns a parent node of given node based on a specified type
			 * if not present then return null
			 * @param {ASTNode} node node to examine
			 * @param {string} type type that is being looked for
			 * @param {string} stopAtList end points for the evaluating code
			 * @returns {ASTNode|void} if found then node otherwise null
			 */
			function getParentNodeByType(node, type, stopAtList) {
				let parent = node.parent;
				const stopAtSet = new Set(stopAtList || ["Program"]);

				while (
					parent.type !== type &&
					!stopAtSet.has(parent.type) &&
					parent.type !== "Program"
				) {
					parent = parent.parent;
				}

				return parent.type === type ? parent : null;
			}

			/**
			 * Returns the VariableDeclarator based on the current node
			 * if not present then return null
			 * @param {ASTNode} node node to examine
			 * @returns {ASTNode|void} if found then node otherwise null
			 */
			function getVariableDeclaratorNode(node) {
				return getParentNodeByType(node, "VariableDeclarator");
			}

			/**
			 * Check to see if the node is part of the multi-line variable declaration.
			 * Also if its on the same line as the varNode
			 * @param {ASTNode} node node to check
			 * @param {ASTNode} varNode variable declaration node to check against
			 * @returns {boolean} True if all the above condition satisfy
			 */
			function isNodeInVarOnTop(node, varNode) {
				return (
					varNode &&
					varNode.parent.loc.start.line === node.loc.start.line &&
					varNode.parent.declarations.length > 1
				);
			}

			/**
			 * Check to see if the argument before the callee node is multi-line and
			 * there should only be 1 argument before the callee node
			 * @param {ASTNode} node node to check
			 * @returns {boolean} True if arguments are multi-line
			 */
			function isArgBeforeCalleeNodeMultiline(node) {
				const parent = node.parent;

				if (parent.arguments.length >= 2 && parent.arguments[1] === node) {
					return (
						parent.arguments[0].loc.end.line >
						parent.arguments[0].loc.start.line
					);
				}

				return false;
			}

			/**
			 * Check to see if the node is a file level IIFE
			 * @param {ASTNode} node The function node to check.
			 * @returns {boolean} True if the node is the outer IIFE
			 */
			function isOuterIIFE(node) {
				const parent = node.parent;
				let stmt = parent.parent;

				/*
				 * Verify that the node is an IIEF
				 */
				if (parent.type !== "CallExpression" || parent.callee !== node) {
					return false;
				}

				/*
				 * Navigate legal ancestors to determine whether this IIEF is outer
				 */
				while (
					(stmt.type === "UnaryExpression" &&
						(stmt.operator === "!" ||
							stmt.operator === "~" ||
							stmt.operator === "+" ||
							stmt.operator === "-")) ||
					stmt.type === "AssignmentExpression" ||
					stmt.type === "LogicalExpression" ||
					stmt.type === "SequenceExpression" ||
					stmt.type === "VariableDeclarator"
				) {
					stmt = stmt.parent;
				}

				return (
					(stmt.type === "ExpressionStatement" ||
						stmt.type === "VariableDeclaration") &&
					stmt.parent &&
					stmt.parent.type === "Program"
				);
			}

			/**
			 * Check indent for function block content
			 * @param {ASTNode} node A BlockStatement node that is inside of a function.
			 * @returns {void}
			 */
			function checkIndentInFunctionBlock(node) {
				/*
				 * Search first caller in chain.
				 * Ex.:
				 *
				 * Models <- Identifier
				 *   .User
				 *   .find()
				 *   .exec(function() {
				 *   // function body
				 * });
				 *
				 * Looks for 'Models'
				 */
				const calleeNode = node.parent; // FunctionExpression
				let indent;

				if (
					calleeNode.parent &&
					(calleeNode.parent.type === "Property" ||
						calleeNode.parent.type === "ArrayExpression")
				) {
					// If function is part of array or object, comma can be put at left
					indent = getNodeIndent(calleeNode, false).goodChar;
				} else {
					// If function is standalone, simple calculate indent
					indent = getNodeIndent(calleeNode).goodChar;
				}

				if (calleeNode.parent.type === "CallExpression") {
					const calleeParent = calleeNode.parent;

					if (
						calleeNode.type !== "FunctionExpression" &&
						calleeNode.type !== "ArrowFunctionExpression"
					) {
						if (
							calleeParent &&
							calleeParent.loc.start.line < node.loc.start.line
						) {
							indent = getNodeIndent(calleeParent).goodChar;
						}
					} else {
						if (
							isArgBeforeCalleeNodeMultiline(calleeNode) &&
							calleeParent.callee.loc.start.line ===
								calleeParent.callee.loc.end.line &&
							!isNodeFirstInLine(calleeNode)
						) {
							indent = getNodeIndent(calleeParent).goodChar;
						}
					}
				}

				/*
				 * function body indent should be indent + indent size, unless this
				 * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled.
				 */
				let functionOffset = indentSize;

				if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) {
					functionOffset = options.outerIIFEBody * indentSize;
				} else if (calleeNode.type === "FunctionExpression") {
					functionOffset = options.FunctionExpression.body * indentSize;
				} else if (calleeNode.type === "FunctionDeclaration") {
					functionOffset = options.FunctionDeclaration.body * indentSize;
				}
				indent += functionOffset;

				// check if the node is inside a variable
				const parentVarNode = getVariableDeclaratorNode(node);

				if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) {
					indent +=
						indentSize *
						options.VariableDeclarator[parentVarNode.parent.kind];
				}

				if (node.body.length > 0) {
					checkNodesIndent(node.body, indent);
				}

				checkLastNodeLineIndent(node, indent - functionOffset);
			}

			/**
			 * Checks if the given node starts and ends on the same line
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} Whether or not the block starts and ends on the same line.
			 */
			function isSingleLineNode(node) {
				const lastToken = sourceCode.getLastToken(node),
					startLine = node.loc.start.line,
					endLine = lastToken.loc.end.line;

				return startLine === endLine;
			}

			/**
			 * Check indent for array block content or object block content
			 * @param {ASTNode} node node to examine
			 * @returns {void}
			 */
			function checkIndentInArrayOrObjectBlock(node) {
				// Skip inline
				if (isSingleLineNode(node)) {
					return;
				}

				let elements =
					node.type === "ArrayExpression"
						? node.elements
						: node.properties;

				// filter out empty elements example would be [ , 2] so remove first element as espree considers it as null
				elements = elements.filter(elem => elem !== null);

				let nodeIndent;
				let elementsIndent;
				const parentVarNode = getVariableDeclaratorNode(node);

				// TODO - come up with a better strategy in future
				if (isNodeFirstInLine(node)) {
					const parent = node.parent;

					nodeIndent = getNodeIndent(parent).goodChar;
					if (
						!parentVarNode ||
						parentVarNode.loc.start.line !== node.loc.start.line
					) {
						if (
							parent.type !== "VariableDeclarator" ||
							parentVarNode === parentVarNode.parent.declarations[0]
						) {
							if (
								parent.type === "VariableDeclarator" &&
								parentVarNode.loc.start.line ===
									parent.loc.start.line
							) {
								nodeIndent +=
									indentSize *
									options.VariableDeclarator[
										parentVarNode.parent.kind
									];
							} else if (
								parent.type === "ObjectExpression" ||
								parent.type === "ArrayExpression"
							) {
								const parentElements =
									node.parent.type === "ObjectExpression"
										? node.parent.properties
										: node.parent.elements;

								if (
									parentElements[0] &&
									parentElements[0].loc.start.line ===
										parent.loc.start.line &&
									parentElements[0].loc.end.line !==
										parent.loc.start.line
								) ; else if (
									typeof options[parent.type] === "number"
								) {
									nodeIndent += options[parent.type] * indentSize;
								} else {
									nodeIndent = parentElements[0].loc.start.column;
								}
							} else if (
								parent.type === "CallExpression" ||
								parent.type === "NewExpression"
							) {
								if (
									typeof options.CallExpression.arguments ===
									"number"
								) {
									nodeIndent +=
										options.CallExpression.arguments *
										indentSize;
								} else if (
									options.CallExpression.arguments === "first"
								) {
									if (parent.arguments.includes(node)) {
										nodeIndent =
											parent.arguments[0].loc.start.column;
									}
								} else {
									nodeIndent += indentSize;
								}
							} else if (
								parent.type === "LogicalExpression" ||
								parent.type === "ArrowFunctionExpression"
							) {
								nodeIndent += indentSize;
							}
						}
					}

					checkFirstNodeLineIndent(node, nodeIndent);
				} else {
					nodeIndent = getNodeIndent(node).goodChar;
				}

				if (options[node.type] === "first") {
					elementsIndent = elements.length
						? elements[0].loc.start.column
						: 0; // If there are no elements, elementsIndent doesn't matter.
				} else {
					elementsIndent = nodeIndent + indentSize * options[node.type];
				}

				/*
				 * Check if the node is a multiple variable declaration; if so, then
				 * make sure indentation takes that into account.
				 */
				if (isNodeInVarOnTop(node, parentVarNode)) {
					elementsIndent +=
						indentSize *
						options.VariableDeclarator[parentVarNode.parent.kind];
				}

				checkNodesIndent(elements, elementsIndent);

				if (elements.length > 0) {
					// Skip last block line check if last item in same line
					if (elements.at(-1).loc.end.line === node.loc.end.line) {
						return;
					}
				}

				checkLastNodeLineIndent(
					node,
					nodeIndent +
						(isNodeInVarOnTop(node, parentVarNode)
							? options.VariableDeclarator[
									parentVarNode.parent.kind
								] * indentSize
							: 0),
				);
			}

			/**
			 * Check if the node or node body is a BlockStatement or not
			 * @param {ASTNode} node node to test
			 * @returns {boolean} True if it or its body is a block statement
			 */
			function isNodeBodyBlock(node) {
				return (
					node.type === "BlockStatement" ||
					node.type === "ClassBody" ||
					(node.body && node.body.type === "BlockStatement") ||
					(node.consequent && node.consequent.type === "BlockStatement")
				);
			}

			/**
			 * Check indentation for blocks
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function blockIndentationCheck(node) {
				// Skip inline blocks
				if (isSingleLineNode(node)) {
					return;
				}

				if (
					node.parent &&
					(node.parent.type === "FunctionExpression" ||
						node.parent.type === "FunctionDeclaration" ||
						node.parent.type === "ArrowFunctionExpression")
				) {
					checkIndentInFunctionBlock(node);
					return;
				}

				let indent;
				let nodesToCheck;

				/*
				 * For this statements we should check indent from statement beginning,
				 * not from the beginning of the block.
				 */
				const statementsWithProperties = [
					"IfStatement",
					"WhileStatement",
					"ForStatement",
					"ForInStatement",
					"ForOfStatement",
					"DoWhileStatement",
					"ClassDeclaration",
					"TryStatement",
				];

				if (
					node.parent &&
					statementsWithProperties.includes(node.parent.type) &&
					isNodeBodyBlock(node)
				) {
					indent = getNodeIndent(node.parent).goodChar;
				} else if (node.parent && node.parent.type === "CatchClause") {
					indent = getNodeIndent(node.parent.parent).goodChar;
				} else {
					indent = getNodeIndent(node).goodChar;
				}

				if (
					node.type === "IfStatement" &&
					node.consequent.type !== "BlockStatement"
				) {
					nodesToCheck = [node.consequent];
				} else if (Array.isArray(node.body)) {
					nodesToCheck = node.body;
				} else {
					nodesToCheck = [node.body];
				}

				if (nodesToCheck.length > 0) {
					checkNodesIndent(nodesToCheck, indent + indentSize);
				}

				if (node.type === "BlockStatement") {
					checkLastNodeLineIndent(node, indent);
				}
			}

			/**
			 * Filter out the elements which are on the same line of each other or the node.
			 * basically have only 1 elements from each line except the variable declaration line.
			 * @param {ASTNode} node Variable declaration node
			 * @returns {ASTNode[]} Filtered elements
			 */
			function filterOutSameLineVars(node) {
				return node.declarations.reduce((finalCollection, elem) => {
					const lastElem = finalCollection.at(-1);

					if (
						(elem.loc.start.line !== node.loc.start.line &&
							!lastElem) ||
						(lastElem &&
							lastElem.loc.start.line !== elem.loc.start.line)
					) {
						finalCollection.push(elem);
					}

					return finalCollection;
				}, []);
			}

			/**
			 * Check indentation for variable declarations
			 * @param {ASTNode} node node to examine
			 * @returns {void}
			 */
			function checkIndentInVariableDeclarations(node) {
				const elements = filterOutSameLineVars(node);
				const nodeIndent = getNodeIndent(node).goodChar;
				const lastElement = elements.at(-1);

				const elementsIndent =
					nodeIndent + indentSize * options.VariableDeclarator[node.kind];

				checkNodesIndent(elements, elementsIndent);

				// Only check the last line if there is any token after the last item
				if (
					sourceCode.getLastToken(node).loc.end.line <=
					lastElement.loc.end.line
				) {
					return;
				}

				const tokenBeforeLastElement =
					sourceCode.getTokenBefore(lastElement);

				if (tokenBeforeLastElement.value === ",") {
					// Special case for comma-first syntax where the semicolon is indented
					checkLastNodeLineIndent(
						node,
						getNodeIndent(tokenBeforeLastElement).goodChar,
					);
				} else {
					checkLastNodeLineIndent(node, elementsIndent - indentSize);
				}
			}

			/**
			 * Check and decide whether to check for indentation for blockless nodes
			 * Scenarios are for or while statements without braces around them
			 * @param {ASTNode} node node to examine
			 * @returns {void}
			 */
			function blockLessNodes(node) {
				if (node.body.type !== "BlockStatement") {
					blockIndentationCheck(node);
				}
			}

			/**
			 * Returns the expected indentation for the case statement
			 * @param {ASTNode} node node to examine
			 * @param {int} [providedSwitchIndent] indent for switch statement
			 * @returns {int} indent size
			 */
			function expectedCaseIndent(node, providedSwitchIndent) {
				const switchNode =
					node.type === "SwitchStatement" ? node : node.parent;
				const switchIndent =
					typeof providedSwitchIndent === "undefined"
						? getNodeIndent(switchNode).goodChar
						: providedSwitchIndent;
				let caseIndent;

				if (caseIndentStore[switchNode.loc.start.line]) {
					return caseIndentStore[switchNode.loc.start.line];
				}

				if (switchNode.cases.length > 0 && options.SwitchCase === 0) {
					caseIndent = switchIndent;
				} else {
					caseIndent = switchIndent + indentSize * options.SwitchCase;
				}

				caseIndentStore[switchNode.loc.start.line] = caseIndent;
				return caseIndent;
			}

			/**
			 * Checks whether a return statement is wrapped in ()
			 * @param {ASTNode} node node to examine
			 * @returns {boolean} the result
			 */
			function isWrappedInParenthesis(node) {
				const regex = /^return\s*?\(\s*?\);*?/u;

				const statementWithoutArgument = sourceCode
					.getText(node)
					.replace(sourceCode.getText(node.argument), "");

				return regex.test(statementWithoutArgument);
			}

			return {
				Program(node) {
					if (node.body.length > 0) {
						// Root nodes should have no indent
						checkNodesIndent(node.body, getNodeIndent(node).goodChar);
					}
				},

				ClassBody: blockIndentationCheck,

				BlockStatement: blockIndentationCheck,

				WhileStatement: blockLessNodes,

				ForStatement: blockLessNodes,

				ForInStatement: blockLessNodes,

				ForOfStatement: blockLessNodes,

				DoWhileStatement: blockLessNodes,

				IfStatement(node) {
					if (
						node.consequent.type !== "BlockStatement" &&
						node.consequent.loc.start.line > node.loc.start.line
					) {
						blockIndentationCheck(node);
					}
				},

				VariableDeclaration(node) {
					if (
						node.declarations.at(-1).loc.start.line >
						node.declarations[0].loc.start.line
					) {
						checkIndentInVariableDeclarations(node);
					}
				},

				ObjectExpression(node) {
					checkIndentInArrayOrObjectBlock(node);
				},

				ArrayExpression(node) {
					checkIndentInArrayOrObjectBlock(node);
				},

				MemberExpression(node) {
					if (typeof options.MemberExpression === "undefined") {
						return;
					}

					if (isSingleLineNode(node)) {
						return;
					}

					/*
					 * The typical layout of variable declarations and assignments
					 * alter the expectation of correct indentation. Skip them.
					 * TODO: Add appropriate configuration options for variable
					 * declarations and assignments.
					 */
					if (
						getParentNodeByType(node, "VariableDeclarator", [
							"FunctionExpression",
							"ArrowFunctionExpression",
						])
					) {
						return;
					}

					if (
						getParentNodeByType(node, "AssignmentExpression", [
							"FunctionExpression",
						])
					) {
						return;
					}

					const propertyIndent =
						getNodeIndent(node).goodChar +
						indentSize * options.MemberExpression;

					const checkNodes = [node.property];

					const dot = sourceCode.getTokenBefore(node.property);

					if (dot.type === "Punctuator" && dot.value === ".") {
						checkNodes.push(dot);
					}

					checkNodesIndent(checkNodes, propertyIndent);
				},

				SwitchStatement(node) {
					// Switch is not a 'BlockStatement'
					const switchIndent = getNodeIndent(node).goodChar;
					const caseIndent = expectedCaseIndent(node, switchIndent);

					checkNodesIndent(node.cases, caseIndent);

					checkLastNodeLineIndent(node, switchIndent);
				},

				SwitchCase(node) {
					// Skip inline cases
					if (isSingleLineNode(node)) {
						return;
					}
					const caseIndent = expectedCaseIndent(node);

					checkNodesIndent(node.consequent, caseIndent + indentSize);
				},

				FunctionDeclaration(node) {
					if (isSingleLineNode(node)) {
						return;
					}
					if (
						options.FunctionDeclaration.parameters === "first" &&
						node.params.length
					) {
						checkNodesIndent(
							node.params.slice(1),
							node.params[0].loc.start.column,
						);
					} else if (options.FunctionDeclaration.parameters !== null) {
						checkNodesIndent(
							node.params,
							getNodeIndent(node).goodChar +
								indentSize * options.FunctionDeclaration.parameters,
						);
					}
				},

				FunctionExpression(node) {
					if (isSingleLineNode(node)) {
						return;
					}
					if (
						options.FunctionExpression.parameters === "first" &&
						node.params.length
					) {
						checkNodesIndent(
							node.params.slice(1),
							node.params[0].loc.start.column,
						);
					} else if (options.FunctionExpression.parameters !== null) {
						checkNodesIndent(
							node.params,
							getNodeIndent(node).goodChar +
								indentSize * options.FunctionExpression.parameters,
						);
					}
				},

				ReturnStatement(node) {
					if (isSingleLineNode(node)) {
						return;
					}

					const firstLineIndent = getNodeIndent(node).goodChar;

					// in case if return statement is wrapped in parenthesis
					if (isWrappedInParenthesis(node)) {
						checkLastReturnStatementLineIndent(node, firstLineIndent);
					} else {
						checkNodeIndent(node, firstLineIndent);
					}
				},

				CallExpression(node) {
					if (isSingleLineNode(node)) {
						return;
					}
					if (
						options.CallExpression.arguments === "first" &&
						node.arguments.length
					) {
						checkNodesIndent(
							node.arguments.slice(1),
							node.arguments[0].loc.start.column,
						);
					} else if (options.CallExpression.arguments !== null) {
						checkNodesIndent(
							node.arguments,
							getNodeIndent(node).goodChar +
								indentSize * options.CallExpression.arguments,
						);
					}
				},
			};
		},
	};
	return indentLegacy;
}

/**
 * @fileoverview A rule to control the style of variable initializations.
 * @author Colin Ihrig
 */

var initDeclarations;
var hasRequiredInitDeclarations;

function requireInitDeclarations () {
	if (hasRequiredInitDeclarations) return initDeclarations;
	hasRequiredInitDeclarations = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a for loop.
	 * @param {ASTNode} block A node to check.
	 * @returns {boolean} `true` when the node is a for loop.
	 */
	function isForLoop(block) {
		return (
			block.type === "ForInStatement" ||
			block.type === "ForOfStatement" ||
			block.type === "ForStatement"
		);
	}

	/**
	 * Checks whether or not a given declarator node has its initializer.
	 * @param {ASTNode} node A declarator node to check.
	 * @returns {boolean} `true` when the node has its initializer.
	 */
	function isInitialized(node) {
		const declaration = node.parent;
		const block = declaration.parent;

		if (isForLoop(block)) {
			if (block.type === "ForStatement") {
				return block.init === declaration;
			}
			return block.left === declaration;
		}
		return Boolean(node.init);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	initDeclarations = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require or disallow initialization in variable declarations",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/init-declarations",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["always"],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["never"],
							},
							{
								type: "object",
								properties: {
									ignoreForLoopInit: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},
			messages: {
				initialized:
					"Variable '{{idName}}' should be initialized on declaration.",
				notInitialized:
					"Variable '{{idName}}' should not be initialized on declaration.",
			},
		},

		create(context) {
			const MODE_ALWAYS = "always",
				MODE_NEVER = "never";

			const mode = context.options[0] || MODE_ALWAYS;
			const params = context.options[1] || {};

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				"VariableDeclaration:exit"(node) {
					const kind = node.kind,
						declarations = node.declarations;

					for (let i = 0; i < declarations.length; ++i) {
						const declaration = declarations[i],
							id = declaration.id,
							initialized = isInitialized(declaration),
							isIgnoredForLoop =
								params.ignoreForLoopInit && isForLoop(node.parent);
						let messageId = "";

						if (mode === MODE_ALWAYS && !initialized) {
							messageId = "initialized";
						} else if (
							mode === MODE_NEVER &&
							kind !== "const" &&
							initialized &&
							!isIgnoredForLoop
						) {
							messageId = "notInitialized";
						}

						if (id.type === "Identifier" && messageId) {
							context.report({
								node: declaration,
								messageId,
								data: {
									idName: id.name,
								},
							});
						}
					}
				},
			};
		},
	};
	return initDeclarations;
}

/**
 * @fileoverview A rule to ensure consistent quotes used in jsx syntax.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

var jsxQuotes;
var hasRequiredJsxQuotes;

function requireJsxQuotes () {
	if (hasRequiredJsxQuotes) return jsxQuotes;
	hasRequiredJsxQuotes = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const QUOTE_SETTINGS = {
		"prefer-double": {
			quote: '"',
			description: "singlequote",
			convert(str) {
				return str.replace(/'/gu, '"');
			},
		},
		"prefer-single": {
			quote: "'",
			description: "doublequote",
			convert(str) {
				return str.replace(/"/gu, "'");
			},
		},
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	jsxQuotes = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "jsx-quotes",
							url: "https://eslint.style/rules/js/jsx-quotes",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce the consistent use of either double or single quotes in JSX attributes",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/jsx-quotes",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["prefer-single", "prefer-double"],
				},
			],
			messages: {
				unexpected: "Unexpected usage of {{description}}.",
			},
		},

		create(context) {
			const quoteOption = context.options[0] || "prefer-double",
				setting = QUOTE_SETTINGS[quoteOption];

			/**
			 * Checks if the given string literal node uses the expected quotes
			 * @param {ASTNode} node A string literal node.
			 * @returns {boolean} Whether or not the string literal used the expected quotes.
			 * @public
			 */
			function usesExpectedQuotes(node) {
				return (
					node.value.includes(setting.quote) ||
					astUtils.isSurroundedBy(node.raw, setting.quote)
				);
			}

			return {
				JSXAttribute(node) {
					const attributeValue = node.value;

					if (
						attributeValue &&
						astUtils.isStringLiteral(attributeValue) &&
						!usesExpectedQuotes(attributeValue)
					) {
						context.report({
							node: attributeValue,
							messageId: "unexpected",
							data: {
								description: setting.description,
							},
							fix(fixer) {
								return fixer.replaceText(
									attributeValue,
									setting.convert(attributeValue.raw),
								);
							},
						});
					}
				},
			};
		},
	};
	return jsxQuotes;
}

/**
 * @fileoverview Rule to specify spacing of object literal keys and values
 * @author Brandon Mills
 * @deprecated in ESLint v8.53.0
 */

var keySpacing;
var hasRequiredKeySpacing;

function requireKeySpacing () {
	if (hasRequiredKeySpacing) return keySpacing;
	hasRequiredKeySpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { getGraphemeCount } = requireStringUtils();

	/**
	 * Checks whether a string contains a line terminator as defined in
	 * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3
	 * @param {string} str String to test.
	 * @returns {boolean} True if str contains a line terminator.
	 */
	function containsLineTerminator(str) {
		return astUtils.LINEBREAK_MATCHER.test(str);
	}

	/**
	 * Gets the last element of an array.
	 * @param {Array} arr An array.
	 * @returns {any} Last element of arr.
	 */
	function last(arr) {
		return arr.at(-1);
	}

	/**
	 * Checks whether a node is contained on a single line.
	 * @param {ASTNode} node AST Node being evaluated.
	 * @returns {boolean} True if the node is a single line.
	 */
	function isSingleLine(node) {
		return node.loc.end.line === node.loc.start.line;
	}

	/**
	 * Checks whether the properties on a single line.
	 * @param {ASTNode[]} properties List of Property AST nodes.
	 * @returns {boolean} True if all properties is on a single line.
	 */
	function isSingleLineProperties(properties) {
		const [firstProp] = properties,
			lastProp = last(properties);

		return firstProp.loc.start.line === lastProp.loc.end.line;
	}

	/**
	 * Initializes a single option property from the configuration with defaults for undefined values
	 * @param {Object} toOptions Object to be initialized
	 * @param {Object} fromOptions Object to be initialized from
	 * @returns {Object} The object with correctly initialized options and values
	 */
	function initOptionProperty(toOptions, fromOptions) {
		toOptions.mode = fromOptions.mode || "strict";

		// Set value of beforeColon
		if (typeof fromOptions.beforeColon !== "undefined") {
			toOptions.beforeColon = +fromOptions.beforeColon;
		} else {
			toOptions.beforeColon = 0;
		}

		// Set value of afterColon
		if (typeof fromOptions.afterColon !== "undefined") {
			toOptions.afterColon = +fromOptions.afterColon;
		} else {
			toOptions.afterColon = 1;
		}

		// Set align if exists
		if (typeof fromOptions.align !== "undefined") {
			if (typeof fromOptions.align === "object") {
				toOptions.align = fromOptions.align;
			} else {
				// "string"
				toOptions.align = {
					on: fromOptions.align,
					mode: toOptions.mode,
					beforeColon: toOptions.beforeColon,
					afterColon: toOptions.afterColon,
				};
			}
		}

		return toOptions;
	}

	/**
	 * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values
	 * @param {Object} toOptions Object to be initialized
	 * @param {Object} fromOptions Object to be initialized from
	 * @returns {Object} The object with correctly initialized options and values
	 */
	function initOptions(toOptions, fromOptions) {
		if (typeof fromOptions.align === "object") {
			// Initialize the alignment configuration
			toOptions.align = initOptionProperty({}, fromOptions.align);
			toOptions.align.on = fromOptions.align.on || "colon";
			toOptions.align.mode = fromOptions.align.mode || "strict";

			toOptions.multiLine = initOptionProperty(
				{},
				fromOptions.multiLine || fromOptions,
			);
			toOptions.singleLine = initOptionProperty(
				{},
				fromOptions.singleLine || fromOptions,
			);
		} else {
			// string or undefined
			toOptions.multiLine = initOptionProperty(
				{},
				fromOptions.multiLine || fromOptions,
			);
			toOptions.singleLine = initOptionProperty(
				{},
				fromOptions.singleLine || fromOptions,
			);

			// If alignment options are defined in multiLine, pull them out into the general align configuration
			if (toOptions.multiLine.align) {
				toOptions.align = {
					on: toOptions.multiLine.align.on,
					mode:
						toOptions.multiLine.align.mode || toOptions.multiLine.mode,
					beforeColon: toOptions.multiLine.align.beforeColon,
					afterColon: toOptions.multiLine.align.afterColon,
				};
			}
		}

		return toOptions;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	keySpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "key-spacing",
							url: "https://eslint.style/rules/js/key-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing between keys and values in object literal properties",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/key-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					anyOf: [
						{
							type: "object",
							properties: {
								align: {
									anyOf: [
										{
											enum: ["colon", "value"],
										},
										{
											type: "object",
											properties: {
												mode: {
													enum: ["strict", "minimum"],
												},
												on: {
													enum: ["colon", "value"],
												},
												beforeColon: {
													type: "boolean",
												},
												afterColon: {
													type: "boolean",
												},
											},
											additionalProperties: false,
										},
									],
								},
								mode: {
									enum: ["strict", "minimum"],
								},
								beforeColon: {
									type: "boolean",
								},
								afterColon: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								singleLine: {
									type: "object",
									properties: {
										mode: {
											enum: ["strict", "minimum"],
										},
										beforeColon: {
											type: "boolean",
										},
										afterColon: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
								multiLine: {
									type: "object",
									properties: {
										align: {
											anyOf: [
												{
													enum: ["colon", "value"],
												},
												{
													type: "object",
													properties: {
														mode: {
															enum: [
																"strict",
																"minimum",
															],
														},
														on: {
															enum: [
																"colon",
																"value",
															],
														},
														beforeColon: {
															type: "boolean",
														},
														afterColon: {
															type: "boolean",
														},
													},
													additionalProperties: false,
												},
											],
										},
										mode: {
											enum: ["strict", "minimum"],
										},
										beforeColon: {
											type: "boolean",
										},
										afterColon: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								singleLine: {
									type: "object",
									properties: {
										mode: {
											enum: ["strict", "minimum"],
										},
										beforeColon: {
											type: "boolean",
										},
										afterColon: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
								multiLine: {
									type: "object",
									properties: {
										mode: {
											enum: ["strict", "minimum"],
										},
										beforeColon: {
											type: "boolean",
										},
										afterColon: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
								align: {
									type: "object",
									properties: {
										mode: {
											enum: ["strict", "minimum"],
										},
										on: {
											enum: ["colon", "value"],
										},
										beforeColon: {
											type: "boolean",
										},
										afterColon: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				extraKey: "Extra space after {{computed}}key '{{key}}'.",
				extraValue:
					"Extra space before value for {{computed}}key '{{key}}'.",
				missingKey: "Missing space after {{computed}}key '{{key}}'.",
				missingValue:
					"Missing space before value for {{computed}}key '{{key}}'.",
			},
		},

		create(context) {
			/**
			 * OPTIONS
			 * "key-spacing": [2, {
			 *     beforeColon: false,
			 *     afterColon: true,
			 *     align: "colon" // Optional, or "value"
			 * }
			 */
			const options = context.options[0] || {},
				ruleOptions = initOptions({}, options),
				multiLineOptions = ruleOptions.multiLine,
				singleLineOptions = ruleOptions.singleLine,
				alignmentOptions = ruleOptions.align || null;

			const sourceCode = context.sourceCode;

			/**
			 * Determines if the given property is key-value property.
			 * @param {ASTNode} property Property node to check.
			 * @returns {boolean} Whether the property is a key-value property.
			 */
			function isKeyValueProperty(property) {
				return !(
					(
						property.method ||
						property.shorthand ||
						property.kind !== "init" ||
						property.type !== "Property"
					) // Could be "ExperimentalSpreadProperty" or "SpreadElement"
				);
			}

			/**
			 * Starting from the given node (a property.key node here) looks forward
			 * until it finds the colon punctuator and returns it.
			 * @param {ASTNode} node The node to start looking from.
			 * @returns {ASTNode} The colon punctuator.
			 */
			function getNextColon(node) {
				return sourceCode.getTokenAfter(node, astUtils.isColonToken);
			}

			/**
			 * Starting from the given node (a property.key node here) looks forward
			 * until it finds the last token before a colon punctuator and returns it.
			 * @param {ASTNode} node The node to start looking from.
			 * @returns {ASTNode} The last token before a colon punctuator.
			 */
			function getLastTokenBeforeColon(node) {
				const colonToken = getNextColon(node);

				return sourceCode.getTokenBefore(colonToken);
			}

			/**
			 * Starting from the given node (a property.key node here) looks forward
			 * until it finds the first token after a colon punctuator and returns it.
			 * @param {ASTNode} node The node to start looking from.
			 * @returns {ASTNode} The first token after a colon punctuator.
			 */
			function getFirstTokenAfterColon(node) {
				const colonToken = getNextColon(node);

				return sourceCode.getTokenAfter(colonToken);
			}

			/**
			 * Checks whether a property is a member of the property group it follows.
			 * @param {ASTNode} lastMember The last Property known to be in the group.
			 * @param {ASTNode} candidate The next Property that might be in the group.
			 * @returns {boolean} True if the candidate property is part of the group.
			 */
			function continuesPropertyGroup(lastMember, candidate) {
				const groupEndLine = lastMember.loc.start.line,
					candidateValueStartLine = (
						isKeyValueProperty(candidate)
							? getFirstTokenAfterColon(candidate.key)
							: candidate
					).loc.start.line;

				if (candidateValueStartLine - groupEndLine <= 1) {
					return true;
				}

				/*
				 * Check that the first comment is adjacent to the end of the group, the
				 * last comment is adjacent to the candidate property, and that successive
				 * comments are adjacent to each other.
				 */
				const leadingComments = sourceCode.getCommentsBefore(candidate);

				if (
					leadingComments.length &&
					leadingComments[0].loc.start.line - groupEndLine <= 1 &&
					candidateValueStartLine - last(leadingComments).loc.end.line <=
						1
				) {
					for (let i = 1; i < leadingComments.length; i++) {
						if (
							leadingComments[i].loc.start.line -
								leadingComments[i - 1].loc.end.line >
							1
						) {
							return false;
						}
					}
					return true;
				}

				return false;
			}

			/**
			 * Gets an object literal property's key as the identifier name or string value.
			 * @param {ASTNode} property Property node whose key to retrieve.
			 * @returns {string} The property's key.
			 */
			function getKey(property) {
				const key = property.key;

				if (property.computed) {
					return sourceCode.getText().slice(key.range[0], key.range[1]);
				}
				return astUtils.getStaticPropertyName(property);
			}

			/**
			 * Reports an appropriately-formatted error if spacing is incorrect on one
			 * side of the colon.
			 * @param {ASTNode} property Key-value pair in an object literal.
			 * @param {string} side Side being verified - either "key" or "value".
			 * @param {string} whitespace Actual whitespace string.
			 * @param {int} expected Expected whitespace length.
			 * @param {string} mode Value of the mode as "strict" or "minimum"
			 * @returns {void}
			 */
			function report(property, side, whitespace, expected, mode) {
				const diff = whitespace.length - expected;

				if (
					((diff && mode === "strict") ||
						(diff < 0 && mode === "minimum") ||
						(diff > 0 && !expected && mode === "minimum")) &&
					!(expected && containsLineTerminator(whitespace))
				) {
					const nextColon = getNextColon(property.key),
						tokenBeforeColon = sourceCode.getTokenBefore(nextColon, {
							includeComments: true,
						}),
						tokenAfterColon = sourceCode.getTokenAfter(nextColon, {
							includeComments: true,
						}),
						isKeySide = side === "key",
						isExtra = diff > 0,
						diffAbs = Math.abs(diff),
						spaces = Array(diffAbs + 1).join(" ");

					const locStart = isKeySide
						? tokenBeforeColon.loc.end
						: nextColon.loc.start;
					const locEnd = isKeySide
						? nextColon.loc.start
						: tokenAfterColon.loc.start;
					const missingLoc = isKeySide
						? tokenBeforeColon.loc
						: tokenAfterColon.loc;
					const loc = isExtra
						? { start: locStart, end: locEnd }
						: missingLoc;

					let fix;

					if (isExtra) {
						let range;

						// Remove whitespace
						if (isKeySide) {
							range = [
								tokenBeforeColon.range[1],
								tokenBeforeColon.range[1] + diffAbs,
							];
						} else {
							range = [
								tokenAfterColon.range[0] - diffAbs,
								tokenAfterColon.range[0],
							];
						}
						fix = function (fixer) {
							return fixer.removeRange(range);
						};
					} else {
						// Add whitespace
						if (isKeySide) {
							fix = function (fixer) {
								return fixer.insertTextAfter(
									tokenBeforeColon,
									spaces,
								);
							};
						} else {
							fix = function (fixer) {
								return fixer.insertTextBefore(
									tokenAfterColon,
									spaces,
								);
							};
						}
					}

					let messageId;

					if (isExtra) {
						messageId = side === "key" ? "extraKey" : "extraValue";
					} else {
						messageId = side === "key" ? "missingKey" : "missingValue";
					}

					context.report({
						node: property[side],
						loc,
						messageId,
						data: {
							computed: property.computed ? "computed " : "",
							key: getKey(property),
						},
						fix,
					});
				}
			}

			/**
			 * Gets the number of characters in a key, including quotes around string
			 * keys and braces around computed property keys.
			 * @param {ASTNode} property Property of on object literal.
			 * @returns {int} Width of the key.
			 */
			function getKeyWidth(property) {
				const startToken = sourceCode.getFirstToken(property);
				const endToken = getLastTokenBeforeColon(property.key);

				return getGraphemeCount(
					sourceCode
						.getText()
						.slice(startToken.range[0], endToken.range[1]),
				);
			}

			/**
			 * Gets the whitespace around the colon in an object literal property.
			 * @param {ASTNode} property Property node from an object literal.
			 * @returns {Object} Whitespace before and after the property's colon.
			 */
			function getPropertyWhitespace(property) {
				const whitespace = /(\s*):(\s*)/u.exec(
					sourceCode
						.getText()
						.slice(property.key.range[1], property.value.range[0]),
				);

				if (whitespace) {
					return {
						beforeColon: whitespace[1],
						afterColon: whitespace[2],
					};
				}
				return null;
			}

			/**
			 * Creates groups of properties.
			 * @param {ASTNode} node ObjectExpression node being evaluated.
			 * @returns {Array<ASTNode[]>} Groups of property AST node lists.
			 */
			function createGroups(node) {
				if (node.properties.length === 1) {
					return [node.properties];
				}

				return node.properties.reduce(
					(groups, property) => {
						const currentGroup = last(groups),
							prev = last(currentGroup);

						if (!prev || continuesPropertyGroup(prev, property)) {
							currentGroup.push(property);
						} else {
							groups.push([property]);
						}

						return groups;
					},
					[[]],
				);
			}

			/**
			 * Verifies correct vertical alignment of a group of properties.
			 * @param {ASTNode[]} properties List of Property AST nodes.
			 * @returns {void}
			 */
			function verifyGroupAlignment(properties) {
				const length = properties.length,
					widths = properties.map(getKeyWidth), // Width of keys, including quotes
					align = alignmentOptions.on; // "value" or "colon"
				let targetWidth = Math.max(...widths),
					beforeColon,
					afterColon,
					mode;

				if (alignmentOptions && length > 1) {
					// When aligning values within a group, use the alignment configuration.
					beforeColon = alignmentOptions.beforeColon;
					afterColon = alignmentOptions.afterColon;
					mode = alignmentOptions.mode;
				} else {
					beforeColon = multiLineOptions.beforeColon;
					afterColon = multiLineOptions.afterColon;
					mode = alignmentOptions.mode;
				}

				// Conditionally include one space before or after colon
				targetWidth += align === "colon" ? beforeColon : afterColon;

				for (let i = 0; i < length; i++) {
					const property = properties[i];
					const whitespace = getPropertyWhitespace(property);

					if (whitespace) {
						// Object literal getters/setters lack a colon
						const width = widths[i];

						if (align === "value") {
							report(
								property,
								"key",
								whitespace.beforeColon,
								beforeColon,
								mode,
							);
							report(
								property,
								"value",
								whitespace.afterColon,
								targetWidth - width,
								mode,
							);
						} else {
							// align = "colon"
							report(
								property,
								"key",
								whitespace.beforeColon,
								targetWidth - width,
								mode,
							);
							report(
								property,
								"value",
								whitespace.afterColon,
								afterColon,
								mode,
							);
						}
					}
				}
			}

			/**
			 * Verifies spacing of property conforms to specified options.
			 * @param {ASTNode} node Property node being evaluated.
			 * @param {Object} lineOptions Configured singleLine or multiLine options
			 * @returns {void}
			 */
			function verifySpacing(node, lineOptions) {
				const actual = getPropertyWhitespace(node);

				if (actual) {
					// Object literal getters/setters lack colons
					report(
						node,
						"key",
						actual.beforeColon,
						lineOptions.beforeColon,
						lineOptions.mode,
					);
					report(
						node,
						"value",
						actual.afterColon,
						lineOptions.afterColon,
						lineOptions.mode,
					);
				}
			}

			/**
			 * Verifies spacing of each property in a list.
			 * @param {ASTNode[]} properties List of Property AST nodes.
			 * @param {Object} lineOptions Configured singleLine or multiLine options
			 * @returns {void}
			 */
			function verifyListSpacing(properties, lineOptions) {
				const length = properties.length;

				for (let i = 0; i < length; i++) {
					verifySpacing(properties[i], lineOptions);
				}
			}

			/**
			 * Verifies vertical alignment, taking into account groups of properties.
			 * @param {ASTNode} node ObjectExpression node being evaluated.
			 * @returns {void}
			 */
			function verifyAlignment(node) {
				createGroups(node).forEach(group => {
					const properties = group.filter(isKeyValueProperty);

					if (
						properties.length > 0 &&
						isSingleLineProperties(properties)
					) {
						verifyListSpacing(properties, multiLineOptions);
					} else {
						verifyGroupAlignment(properties);
					}
				});
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			if (alignmentOptions) {
				// Verify vertical alignment

				return {
					ObjectExpression(node) {
						if (isSingleLine(node)) {
							verifyListSpacing(
								node.properties.filter(isKeyValueProperty),
								singleLineOptions,
							);
						} else {
							verifyAlignment(node);
						}
					},
				};
			}

			// Obey beforeColon and afterColon in each property as configured
			return {
				Property(node) {
					verifySpacing(
						node,
						isSingleLine(node.parent)
							? singleLineOptions
							: multiLineOptions,
					);
				},
			};
		},
	};
	return keySpacing;
}

/**
 * @fileoverview Rule to enforce spacing before and after keywords.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var keywordSpacing;
var hasRequiredKeywordSpacing;

function requireKeywordSpacing () {
	if (hasRequiredKeywordSpacing) return keywordSpacing;
	hasRequiredKeywordSpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils(),
		keywords = requireKeywords();

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const PREV_TOKEN = /^[)\]}>]$/u;
	const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u;
	const PREV_TOKEN_M = /^[)\]}>*]$/u;
	const NEXT_TOKEN_M = /^[{*]$/u;
	const TEMPLATE_OPEN_PAREN = /\$\{$/u;
	const TEMPLATE_CLOSE_PAREN = /^\}/u;
	const CHECK_TYPE =
		/^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u;
	const KEYS = keywords.concat([
		"as",
		"async",
		"await",
		"from",
		"get",
		"let",
		"of",
		"set",
		"yield",
	]);

	// check duplications.
	(function () {
		KEYS.sort();
		for (let i = 1; i < KEYS.length; ++i) {
			if (KEYS[i] === KEYS[i - 1]) {
				throw new Error(
					`Duplication was found in the keyword list: ${KEYS[i]}`,
				);
			}
		}
	})();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given token is a "Template" token ends with "${".
	 * @param {Token} token A token to check.
	 * @returns {boolean} `true` if the token is a "Template" token ends with "${".
	 */
	function isOpenParenOfTemplate(token) {
		return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value);
	}

	/**
	 * Checks whether or not a given token is a "Template" token starts with "}".
	 * @param {Token} token A token to check.
	 * @returns {boolean} `true` if the token is a "Template" token starts with "}".
	 */
	function isCloseParenOfTemplate(token) {
		return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	keywordSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "keyword-spacing",
							url: "https://eslint.style/rules/js/keyword-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing before and after keywords",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/keyword-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						before: { type: "boolean", default: true },
						after: { type: "boolean", default: true },
						overrides: {
							type: "object",
							properties: KEYS.reduce((retv, key) => {
								retv[key] = {
									type: "object",
									properties: {
										before: { type: "boolean" },
										after: { type: "boolean" },
									},
									additionalProperties: false,
								};
								return retv;
							}, {}),
							additionalProperties: false,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				expectedBefore: 'Expected space(s) before "{{value}}".',
				expectedAfter: 'Expected space(s) after "{{value}}".',
				unexpectedBefore: 'Unexpected space(s) before "{{value}}".',
				unexpectedAfter: 'Unexpected space(s) after "{{value}}".',
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const tokensToIgnore = new WeakSet();

			/**
			 * Reports a given token if there are not space(s) before the token.
			 * @param {Token} token A token to report.
			 * @param {RegExp} pattern A pattern of the previous token to check.
			 * @returns {void}
			 */
			function expectSpaceBefore(token, pattern) {
				const prevToken = sourceCode.getTokenBefore(token);

				if (
					prevToken &&
					(CHECK_TYPE.test(prevToken.type) ||
						pattern.test(prevToken.value)) &&
					!isOpenParenOfTemplate(prevToken) &&
					!tokensToIgnore.has(prevToken) &&
					astUtils.isTokenOnSameLine(prevToken, token) &&
					!sourceCode.isSpaceBetweenTokens(prevToken, token)
				) {
					context.report({
						loc: token.loc,
						messageId: "expectedBefore",
						data: token,
						fix(fixer) {
							return fixer.insertTextBefore(token, " ");
						},
					});
				}
			}

			/**
			 * Reports a given token if there are space(s) before the token.
			 * @param {Token} token A token to report.
			 * @param {RegExp} pattern A pattern of the previous token to check.
			 * @returns {void}
			 */
			function unexpectSpaceBefore(token, pattern) {
				const prevToken = sourceCode.getTokenBefore(token);

				if (
					prevToken &&
					(CHECK_TYPE.test(prevToken.type) ||
						pattern.test(prevToken.value)) &&
					!isOpenParenOfTemplate(prevToken) &&
					!tokensToIgnore.has(prevToken) &&
					astUtils.isTokenOnSameLine(prevToken, token) &&
					sourceCode.isSpaceBetweenTokens(prevToken, token)
				) {
					context.report({
						loc: { start: prevToken.loc.end, end: token.loc.start },
						messageId: "unexpectedBefore",
						data: token,
						fix(fixer) {
							return fixer.removeRange([
								prevToken.range[1],
								token.range[0],
							]);
						},
					});
				}
			}

			/**
			 * Reports a given token if there are not space(s) after the token.
			 * @param {Token} token A token to report.
			 * @param {RegExp} pattern A pattern of the next token to check.
			 * @returns {void}
			 */
			function expectSpaceAfter(token, pattern) {
				const nextToken = sourceCode.getTokenAfter(token);

				if (
					nextToken &&
					(CHECK_TYPE.test(nextToken.type) ||
						pattern.test(nextToken.value)) &&
					!isCloseParenOfTemplate(nextToken) &&
					!tokensToIgnore.has(nextToken) &&
					astUtils.isTokenOnSameLine(token, nextToken) &&
					!sourceCode.isSpaceBetweenTokens(token, nextToken)
				) {
					context.report({
						loc: token.loc,
						messageId: "expectedAfter",
						data: token,
						fix(fixer) {
							return fixer.insertTextAfter(token, " ");
						},
					});
				}
			}

			/**
			 * Reports a given token if there are space(s) after the token.
			 * @param {Token} token A token to report.
			 * @param {RegExp} pattern A pattern of the next token to check.
			 * @returns {void}
			 */
			function unexpectSpaceAfter(token, pattern) {
				const nextToken = sourceCode.getTokenAfter(token);

				if (
					nextToken &&
					(CHECK_TYPE.test(nextToken.type) ||
						pattern.test(nextToken.value)) &&
					!isCloseParenOfTemplate(nextToken) &&
					!tokensToIgnore.has(nextToken) &&
					astUtils.isTokenOnSameLine(token, nextToken) &&
					sourceCode.isSpaceBetweenTokens(token, nextToken)
				) {
					context.report({
						loc: { start: token.loc.end, end: nextToken.loc.start },
						messageId: "unexpectedAfter",
						data: token,
						fix(fixer) {
							return fixer.removeRange([
								token.range[1],
								nextToken.range[0],
							]);
						},
					});
				}
			}

			/**
			 * Parses the option object and determines check methods for each keyword.
			 * @param {Object|undefined} options The option object to parse.
			 * @returns {Object} - Normalized option object.
			 *      Keys are keywords (there are for every keyword).
			 *      Values are instances of `{"before": function, "after": function}`.
			 */
			function parseOptions(options = {}) {
				const before = options.before !== false;
				const after = options.after !== false;
				const defaultValue = {
					before: before ? expectSpaceBefore : unexpectSpaceBefore,
					after: after ? expectSpaceAfter : unexpectSpaceAfter,
				};
				const overrides = (options && options.overrides) || {};
				const retv = Object.create(null);

				for (let i = 0; i < KEYS.length; ++i) {
					const key = KEYS[i];
					const override = overrides[key];

					if (override) {
						const thisBefore =
							"before" in override ? override.before : before;
						const thisAfter =
							"after" in override ? override.after : after;

						retv[key] = {
							before: thisBefore
								? expectSpaceBefore
								: unexpectSpaceBefore,
							after: thisAfter
								? expectSpaceAfter
								: unexpectSpaceAfter,
						};
					} else {
						retv[key] = defaultValue;
					}
				}

				return retv;
			}

			const checkMethodMap = parseOptions(context.options[0]);

			/**
			 * Reports a given token if usage of spacing followed by the token is
			 * invalid.
			 * @param {Token} token A token to report.
			 * @param {RegExp} [pattern] Optional. A pattern of the previous
			 *      token to check.
			 * @returns {void}
			 */
			function checkSpacingBefore(token, pattern) {
				checkMethodMap[token.value].before(token, pattern || PREV_TOKEN);
			}

			/**
			 * Reports a given token if usage of spacing preceded by the token is
			 * invalid.
			 * @param {Token} token A token to report.
			 * @param {RegExp} [pattern] Optional. A pattern of the next
			 *      token to check.
			 * @returns {void}
			 */
			function checkSpacingAfter(token, pattern) {
				checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN);
			}

			/**
			 * Reports a given token if usage of spacing around the token is invalid.
			 * @param {Token} token A token to report.
			 * @returns {void}
			 */
			function checkSpacingAround(token) {
				checkSpacingBefore(token);
				checkSpacingAfter(token);
			}

			/**
			 * Reports the first token of a given node if the first token is a keyword
			 * and usage of spacing around the token is invalid.
			 * @param {ASTNode|null} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingAroundFirstToken(node) {
				const firstToken = node && sourceCode.getFirstToken(node);

				if (firstToken && firstToken.type === "Keyword") {
					checkSpacingAround(firstToken);
				}
			}

			/**
			 * Reports the first token of a given node if the first token is a keyword
			 * and usage of spacing followed by the token is invalid.
			 *
			 * This is used for unary operators (e.g. `typeof`), `function`, and `super`.
			 * Other rules are handling usage of spacing preceded by those keywords.
			 * @param {ASTNode|null} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingBeforeFirstToken(node) {
				const firstToken = node && sourceCode.getFirstToken(node);

				if (firstToken && firstToken.type === "Keyword") {
					checkSpacingBefore(firstToken);
				}
			}

			/**
			 * Reports the previous token of a given node if the token is a keyword and
			 * usage of spacing around the token is invalid.
			 * @param {ASTNode|null} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingAroundTokenBefore(node) {
				if (node) {
					const token = sourceCode.getTokenBefore(
						node,
						astUtils.isKeywordToken,
					);

					checkSpacingAround(token);
				}
			}

			/**
			 * Reports `async` or `function` keywords of a given node if usage of
			 * spacing around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForFunction(node) {
				const firstToken = node && sourceCode.getFirstToken(node);

				if (
					firstToken &&
					((firstToken.type === "Keyword" &&
						firstToken.value === "function") ||
						firstToken.value === "async")
				) {
					checkSpacingBefore(firstToken);
				}
			}

			/**
			 * Reports `class` and `extends` keywords of a given node if usage of
			 * spacing around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForClass(node) {
				checkSpacingAroundFirstToken(node);
				checkSpacingAroundTokenBefore(node.superClass);
			}

			/**
			 * Reports `if` and `else` keywords of a given node if usage of spacing
			 * around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForIfStatement(node) {
				checkSpacingAroundFirstToken(node);
				checkSpacingAroundTokenBefore(node.alternate);
			}

			/**
			 * Reports `try`, `catch`, and `finally` keywords of a given node if usage
			 * of spacing around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForTryStatement(node) {
				checkSpacingAroundFirstToken(node);
				checkSpacingAroundFirstToken(node.handler);
				checkSpacingAroundTokenBefore(node.finalizer);
			}

			/**
			 * Reports `do` and `while` keywords of a given node if usage of spacing
			 * around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForDoWhileStatement(node) {
				checkSpacingAroundFirstToken(node);
				checkSpacingAroundTokenBefore(node.test);
			}

			/**
			 * Reports `for` and `in` keywords of a given node if usage of spacing
			 * around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForForInStatement(node) {
				checkSpacingAroundFirstToken(node);

				const inToken = sourceCode.getTokenBefore(
					node.right,
					astUtils.isNotOpeningParenToken,
				);
				const previousToken = sourceCode.getTokenBefore(inToken);

				if (previousToken.type !== "PrivateIdentifier") {
					checkSpacingBefore(inToken);
				}

				checkSpacingAfter(inToken);
			}

			/**
			 * Reports `for` and `of` keywords of a given node if usage of spacing
			 * around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForForOfStatement(node) {
				if (node.await) {
					checkSpacingBefore(sourceCode.getFirstToken(node, 0));
					checkSpacingAfter(sourceCode.getFirstToken(node, 1));
				} else {
					checkSpacingAroundFirstToken(node);
				}

				const ofToken = sourceCode.getTokenBefore(
					node.right,
					astUtils.isNotOpeningParenToken,
				);
				const previousToken = sourceCode.getTokenBefore(ofToken);

				if (previousToken.type !== "PrivateIdentifier") {
					checkSpacingBefore(ofToken);
				}

				checkSpacingAfter(ofToken);
			}

			/**
			 * Reports `import`, `export`, `as`, and `from` keywords of a given node if
			 * usage of spacing around those keywords is invalid.
			 *
			 * This rule handles the `*` token in module declarations.
			 *
			 *     import*as A from "./a"; /*error Expected space(s) after "import".
			 *                               error Expected space(s) before "as".
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForModuleDeclaration(node) {
				const firstToken = sourceCode.getFirstToken(node);

				checkSpacingBefore(firstToken, PREV_TOKEN_M);
				checkSpacingAfter(firstToken, NEXT_TOKEN_M);

				if (node.type === "ExportDefaultDeclaration") {
					checkSpacingAround(sourceCode.getTokenAfter(firstToken));
				}

				if (node.type === "ExportAllDeclaration" && node.exported) {
					const asToken = sourceCode.getTokenBefore(node.exported);

					checkSpacingBefore(asToken, PREV_TOKEN_M);
					checkSpacingAfter(asToken, NEXT_TOKEN_M);
				}

				if (node.source) {
					const fromToken = sourceCode.getTokenBefore(node.source);

					checkSpacingBefore(fromToken, PREV_TOKEN_M);
					checkSpacingAfter(fromToken, NEXT_TOKEN_M);
				}
			}

			/**
			 * Reports `as` keyword of a given node if usage of spacing around this
			 * keyword is invalid.
			 * @param {ASTNode} node An `ImportSpecifier` node to check.
			 * @returns {void}
			 */
			function checkSpacingForImportSpecifier(node) {
				if (node.imported.range[0] !== node.local.range[0]) {
					const asToken = sourceCode.getTokenBefore(node.local);

					checkSpacingBefore(asToken, PREV_TOKEN_M);
				}
			}

			/**
			 * Reports `as` keyword of a given node if usage of spacing around this
			 * keyword is invalid.
			 * @param {ASTNode} node An `ExportSpecifier` node to check.
			 * @returns {void}
			 */
			function checkSpacingForExportSpecifier(node) {
				if (node.local.range[0] !== node.exported.range[0]) {
					const asToken = sourceCode.getTokenBefore(node.exported);

					checkSpacingBefore(asToken, PREV_TOKEN_M);
					checkSpacingAfter(asToken, NEXT_TOKEN_M);
				}
			}

			/**
			 * Reports `as` keyword of a given node if usage of spacing around this
			 * keyword is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForImportNamespaceSpecifier(node) {
				const asToken = sourceCode.getFirstToken(node, 1);

				checkSpacingBefore(asToken, PREV_TOKEN_M);
			}

			/**
			 * Reports `static`, `get`, and `set` keywords of a given node if usage of
			 * spacing around those keywords is invalid.
			 * @param {ASTNode} node A node to report.
			 * @throws {Error} If unable to find token get, set, or async beside method name.
			 * @returns {void}
			 */
			function checkSpacingForProperty(node) {
				if (node.static) {
					checkSpacingAroundFirstToken(node);
				}
				if (
					node.kind === "get" ||
					node.kind === "set" ||
					((node.method || node.type === "MethodDefinition") &&
						node.value.async)
				) {
					const token = sourceCode.getTokenBefore(node.key, tok => {
						switch (tok.value) {
							case "get":
							case "set":
							case "async":
								return true;
							default:
								return false;
						}
					});

					if (!token) {
						throw new Error(
							"Failed to find token get, set, or async beside method name",
						);
					}

					checkSpacingAround(token);
				}
			}

			/**
			 * Reports `await` keyword of a given node if usage of spacing before
			 * this keyword is invalid.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function checkSpacingForAwaitExpression(node) {
				checkSpacingBefore(sourceCode.getFirstToken(node));
			}

			return {
				// Statements
				DebuggerStatement: checkSpacingAroundFirstToken,
				WithStatement: checkSpacingAroundFirstToken,

				// Statements - Control flow
				BreakStatement: checkSpacingAroundFirstToken,
				ContinueStatement: checkSpacingAroundFirstToken,
				ReturnStatement: checkSpacingAroundFirstToken,
				ThrowStatement: checkSpacingAroundFirstToken,
				TryStatement: checkSpacingForTryStatement,

				// Statements - Choice
				IfStatement: checkSpacingForIfStatement,
				SwitchStatement: checkSpacingAroundFirstToken,
				SwitchCase: checkSpacingAroundFirstToken,

				// Statements - Loops
				DoWhileStatement: checkSpacingForDoWhileStatement,
				ForInStatement: checkSpacingForForInStatement,
				ForOfStatement: checkSpacingForForOfStatement,
				ForStatement: checkSpacingAroundFirstToken,
				WhileStatement: checkSpacingAroundFirstToken,

				// Statements - Declarations
				ClassDeclaration: checkSpacingForClass,
				ExportNamedDeclaration: checkSpacingForModuleDeclaration,
				ExportDefaultDeclaration: checkSpacingForModuleDeclaration,
				ExportAllDeclaration: checkSpacingForModuleDeclaration,
				FunctionDeclaration: checkSpacingForFunction,
				ImportDeclaration: checkSpacingForModuleDeclaration,
				VariableDeclaration: checkSpacingAroundFirstToken,

				// Expressions
				ArrowFunctionExpression: checkSpacingForFunction,
				AwaitExpression: checkSpacingForAwaitExpression,
				ClassExpression: checkSpacingForClass,
				FunctionExpression: checkSpacingForFunction,
				NewExpression: checkSpacingBeforeFirstToken,
				Super: checkSpacingBeforeFirstToken,
				ThisExpression: checkSpacingBeforeFirstToken,
				UnaryExpression: checkSpacingBeforeFirstToken,
				YieldExpression: checkSpacingBeforeFirstToken,

				// Others
				ImportSpecifier: checkSpacingForImportSpecifier,
				ExportSpecifier: checkSpacingForExportSpecifier,
				ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier,
				MethodDefinition: checkSpacingForProperty,
				PropertyDefinition: checkSpacingForProperty,
				StaticBlock: checkSpacingAroundFirstToken,
				Property: checkSpacingForProperty,

				// To avoid conflicts with `space-infix-ops`, e.g. `a > this.b`
				"BinaryExpression[operator='>']"(node) {
					const operatorToken = sourceCode.getTokenBefore(
						node.right,
						astUtils.isNotOpeningParenToken,
					);

					tokensToIgnore.add(operatorToken);
				},
			};
		},
	};
	return keywordSpacing;
}

/**
 * @fileoverview Rule to enforce the position of line comments
 * @author Alberto Rodríguez
 * @deprecated in ESLint v9.3.0
 */

var lineCommentPosition;
var hasRequiredLineCommentPosition;

function requireLineCommentPosition () {
	if (hasRequiredLineCommentPosition) return lineCommentPosition;
	hasRequiredLineCommentPosition = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	lineCommentPosition = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "9.3.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "line-comment-position",
							url: "https://eslint.style/rules/js/line-comment-position",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce position of line comments",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/line-comment-position",
			},

			schema: [
				{
					oneOf: [
						{
							enum: ["above", "beside"],
						},
						{
							type: "object",
							properties: {
								position: {
									enum: ["above", "beside"],
								},
								ignorePattern: {
									type: "string",
								},
								applyDefaultPatterns: {
									type: "boolean",
								},
								applyDefaultIgnorePatterns: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				above: "Expected comment to be above code.",
				beside: "Expected comment to be beside code.",
			},
		},

		create(context) {
			const options = context.options[0];

			let above,
				ignorePattern,
				applyDefaultIgnorePatterns = true;

			if (!options || typeof options === "string") {
				above = !options || options === "above";
			} else {
				above = !options.position || options.position === "above";
				ignorePattern = options.ignorePattern;

				if (Object.hasOwn(options, "applyDefaultIgnorePatterns")) {
					applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns;
				} else {
					applyDefaultIgnorePatterns =
						options.applyDefaultPatterns !== false;
				}
			}

			const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
			const fallThroughRegExp = /^\s*falls?\s?through/u;
			const customIgnoreRegExp = new RegExp(ignorePattern, "u");
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program() {
					const comments = sourceCode.getAllComments();

					comments
						.filter(token => token.type === "Line")
						.forEach(node => {
							if (
								applyDefaultIgnorePatterns &&
								(defaultIgnoreRegExp.test(node.value) ||
									fallThroughRegExp.test(node.value))
							) {
								return;
							}

							if (
								ignorePattern &&
								customIgnoreRegExp.test(node.value)
							) {
								return;
							}

							const previous = sourceCode.getTokenBefore(node, {
								includeComments: true,
							});
							const isOnSameLine =
								previous &&
								previous.loc.end.line === node.loc.start.line;

							if (above) {
								if (isOnSameLine) {
									context.report({
										node,
										messageId: "above",
									});
								}
							} else {
								if (!isOnSameLine) {
									context.report({
										node,
										messageId: "beside",
									});
								}
							}
						});
				},
			};
		},
	};
	return lineCommentPosition;
}

/**
 * @fileoverview Rule to enforce a single linebreak style.
 * @author Erik Mueller
 * @deprecated in ESLint v8.53.0
 */

var linebreakStyle;
var hasRequiredLinebreakStyle;

function requireLinebreakStyle () {
	if (hasRequiredLinebreakStyle) return linebreakStyle;
	hasRequiredLinebreakStyle = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	linebreakStyle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "linebreak-style",
							url: "https://eslint.style/rules/js/linebreak-style",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent linebreak style",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/linebreak-style",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["unix", "windows"],
				},
			],
			messages: {
				expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.",
				expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Builds a fix function that replaces text at the specified range in the source text.
			 * @param {int[]} range The range to replace
			 * @param {string} text The text to insert.
			 * @returns {Function} Fixer function
			 * @private
			 */
			function createFix(range, text) {
				return function (fixer) {
					return fixer.replaceTextRange(range, text);
				};
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: function checkForLinebreakStyle(node) {
					const linebreakStyle = context.options[0] || "unix",
						expectedLF = linebreakStyle === "unix",
						expectedLFChars = expectedLF ? "\n" : "\r\n",
						source = sourceCode.getText(),
						pattern = astUtils.createGlobalLinebreakMatcher();
					let match;

					let i = 0;

					while ((match = pattern.exec(source)) !== null) {
						i++;
						if (match[0] === expectedLFChars) {
							continue;
						}

						const index = match.index;
						const range = [index, index + match[0].length];

						context.report({
							node,
							loc: {
								start: {
									line: i,
									column: sourceCode.lines[i - 1].length,
								},
								end: {
									line: i + 1,
									column: 0,
								},
							},
							messageId: expectedLF ? "expectedLF" : "expectedCRLF",
							fix: createFix(range, expectedLFChars),
						});
					}
				},
			};
		},
	};
	return linebreakStyle;
}

/**
 * @fileoverview Enforces empty lines around comments.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

var linesAroundComment;
var hasRequiredLinesAroundComment;

function requireLinesAroundComment () {
	if (hasRequiredLinesAroundComment) return linesAroundComment;
	hasRequiredLinesAroundComment = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Return an array with any line numbers that are empty.
	 * @param {Array} lines An array of each line of the file.
	 * @returns {Array} An array of line numbers.
	 */
	function getEmptyLineNums(lines) {
		const emptyLines = lines
			.map((line, i) => ({
				code: line.trim(),
				num: i + 1,
			}))
			.filter(line => !line.code)
			.map(line => line.num);

		return emptyLines;
	}

	/**
	 * Return an array with any line numbers that contain comments.
	 * @param {Array} comments An array of comment tokens.
	 * @returns {Array} An array of line numbers.
	 */
	function getCommentLineNums(comments) {
		const lines = [];

		comments.forEach(token => {
			const start = token.loc.start.line;
			const end = token.loc.end.line;

			lines.push(start, end);
		});
		return lines;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	linesAroundComment = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "lines-around-comment",
							url: "https://eslint.style/rules/js/lines-around-comment",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require empty lines around comments",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/lines-around-comment",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						beforeBlockComment: {
							type: "boolean",
							default: true,
						},
						afterBlockComment: {
							type: "boolean",
							default: false,
						},
						beforeLineComment: {
							type: "boolean",
							default: false,
						},
						afterLineComment: {
							type: "boolean",
							default: false,
						},
						allowBlockStart: {
							type: "boolean",
							default: false,
						},
						allowBlockEnd: {
							type: "boolean",
							default: false,
						},
						allowClassStart: {
							type: "boolean",
						},
						allowClassEnd: {
							type: "boolean",
						},
						allowObjectStart: {
							type: "boolean",
						},
						allowObjectEnd: {
							type: "boolean",
						},
						allowArrayStart: {
							type: "boolean",
						},
						allowArrayEnd: {
							type: "boolean",
						},
						ignorePattern: {
							type: "string",
						},
						applyDefaultIgnorePatterns: {
							type: "boolean",
						},
						afterHashbangComment: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				after: "Expected line after comment.",
				before: "Expected line before comment.",
			},
		},

		create(context) {
			const options = Object.assign({}, context.options[0]);
			const ignorePattern = options.ignorePattern;
			const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
			const customIgnoreRegExp = new RegExp(ignorePattern, "u");
			const applyDefaultIgnorePatterns =
				options.applyDefaultIgnorePatterns !== false;

			options.beforeBlockComment =
				typeof options.beforeBlockComment !== "undefined"
					? options.beforeBlockComment
					: true;

			const sourceCode = context.sourceCode;

			const lines = sourceCode.lines,
				numLines = lines.length + 1,
				comments = sourceCode.getAllComments(),
				commentLines = getCommentLineNums(comments),
				emptyLines = getEmptyLineNums(lines),
				commentAndEmptyLines = new Set(commentLines.concat(emptyLines));

			/**
			 * Returns whether or not comments are on lines starting with or ending with code
			 * @param {token} token The comment token to check.
			 * @returns {boolean} True if the comment is not alone.
			 */
			function codeAroundComment(token) {
				let currentToken = token;

				do {
					currentToken = sourceCode.getTokenBefore(currentToken, {
						includeComments: true,
					});
				} while (currentToken && astUtils.isCommentToken(currentToken));

				if (
					currentToken &&
					astUtils.isTokenOnSameLine(currentToken, token)
				) {
					return true;
				}

				currentToken = token;
				do {
					currentToken = sourceCode.getTokenAfter(currentToken, {
						includeComments: true,
					});
				} while (currentToken && astUtils.isCommentToken(currentToken));

				if (
					currentToken &&
					astUtils.isTokenOnSameLine(token, currentToken)
				) {
					return true;
				}

				return false;
			}

			/**
			 * Returns whether or not comments are inside a node type or not.
			 * @param {ASTNode} parent The Comment parent node.
			 * @param {string} nodeType The parent type to check against.
			 * @returns {boolean} True if the comment is inside nodeType.
			 */
			function isParentNodeType(parent, nodeType) {
				return (
					parent.type === nodeType ||
					(parent.body && parent.body.type === nodeType) ||
					(parent.consequent && parent.consequent.type === nodeType)
				);
			}

			/**
			 * Returns the parent node that contains the given token.
			 * @param {token} token The token to check.
			 * @returns {ASTNode|null} The parent node that contains the given token.
			 */
			function getParentNodeOfToken(token) {
				const node = sourceCode.getNodeByRangeIndex(token.range[0]);

				/*
				 * For the purpose of this rule, the comment token is in a `StaticBlock` node only
				 * if it's inside the braces of that `StaticBlock` node.
				 *
				 * Example where this function returns `null`:
				 *
				 *   static
				 *   // comment
				 *   {
				 *   }
				 *
				 * Example where this function returns `StaticBlock` node:
				 *
				 *   static
				 *   {
				 *   // comment
				 *   }
				 *
				 */
				if (node && node.type === "StaticBlock") {
					const openingBrace = sourceCode.getFirstToken(node, {
						skip: 1,
					}); // skip the `static` token

					return token.range[0] >= openingBrace.range[0] ? node : null;
				}

				return node;
			}

			/**
			 * Returns whether or not comments are at the parent start or not.
			 * @param {token} token The Comment token.
			 * @param {string} nodeType The parent type to check against.
			 * @returns {boolean} True if the comment is at parent start.
			 */
			function isCommentAtParentStart(token, nodeType) {
				const parent = getParentNodeOfToken(token);

				if (parent && isParentNodeType(parent, nodeType)) {
					let parentStartNodeOrToken = parent;

					if (parent.type === "StaticBlock") {
						parentStartNodeOrToken = sourceCode.getFirstToken(parent, {
							skip: 1,
						}); // opening brace of the static block
					} else if (parent.type === "SwitchStatement") {
						parentStartNodeOrToken = sourceCode.getTokenAfter(
							parent.discriminant,
							{
								filter: astUtils.isOpeningBraceToken,
							},
						); // opening brace of the switch statement
					}

					return (
						token.loc.start.line -
							parentStartNodeOrToken.loc.start.line ===
						1
					);
				}

				return false;
			}

			/**
			 * Returns whether or not comments are at the parent end or not.
			 * @param {token} token The Comment token.
			 * @param {string} nodeType The parent type to check against.
			 * @returns {boolean} True if the comment is at parent end.
			 */
			function isCommentAtParentEnd(token, nodeType) {
				const parent = getParentNodeOfToken(token);

				return (
					!!parent &&
					isParentNodeType(parent, nodeType) &&
					parent.loc.end.line - token.loc.end.line === 1
				);
			}

			/**
			 * Returns whether or not comments are at the block start or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at block start.
			 */
			function isCommentAtBlockStart(token) {
				return (
					isCommentAtParentStart(token, "ClassBody") ||
					isCommentAtParentStart(token, "BlockStatement") ||
					isCommentAtParentStart(token, "StaticBlock") ||
					isCommentAtParentStart(token, "SwitchCase") ||
					isCommentAtParentStart(token, "SwitchStatement")
				);
			}

			/**
			 * Returns whether or not comments are at the block end or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at block end.
			 */
			function isCommentAtBlockEnd(token) {
				return (
					isCommentAtParentEnd(token, "ClassBody") ||
					isCommentAtParentEnd(token, "BlockStatement") ||
					isCommentAtParentEnd(token, "StaticBlock") ||
					isCommentAtParentEnd(token, "SwitchCase") ||
					isCommentAtParentEnd(token, "SwitchStatement")
				);
			}

			/**
			 * Returns whether or not comments are at the class start or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at class start.
			 */
			function isCommentAtClassStart(token) {
				return isCommentAtParentStart(token, "ClassBody");
			}

			/**
			 * Returns whether or not comments are at the class end or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at class end.
			 */
			function isCommentAtClassEnd(token) {
				return isCommentAtParentEnd(token, "ClassBody");
			}

			/**
			 * Returns whether or not comments are at the object start or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at object start.
			 */
			function isCommentAtObjectStart(token) {
				return (
					isCommentAtParentStart(token, "ObjectExpression") ||
					isCommentAtParentStart(token, "ObjectPattern")
				);
			}

			/**
			 * Returns whether or not comments are at the object end or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at object end.
			 */
			function isCommentAtObjectEnd(token) {
				return (
					isCommentAtParentEnd(token, "ObjectExpression") ||
					isCommentAtParentEnd(token, "ObjectPattern")
				);
			}

			/**
			 * Returns whether or not comments are at the array start or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at array start.
			 */
			function isCommentAtArrayStart(token) {
				return (
					isCommentAtParentStart(token, "ArrayExpression") ||
					isCommentAtParentStart(token, "ArrayPattern")
				);
			}

			/**
			 * Returns whether or not comments are at the array end or not.
			 * @param {token} token The Comment token.
			 * @returns {boolean} True if the comment is at array end.
			 */
			function isCommentAtArrayEnd(token) {
				return (
					isCommentAtParentEnd(token, "ArrayExpression") ||
					isCommentAtParentEnd(token, "ArrayPattern")
				);
			}

			/**
			 * Checks if a comment token has lines around it (ignores inline comments)
			 * @param {token} token The Comment token.
			 * @param {Object} opts Options to determine the newline.
			 * @param {boolean} opts.after Should have a newline after this line.
			 * @param {boolean} opts.before Should have a newline before this line.
			 * @returns {void}
			 */
			function checkForEmptyLine(token, opts) {
				if (
					applyDefaultIgnorePatterns &&
					defaultIgnoreRegExp.test(token.value)
				) {
					return;
				}

				if (ignorePattern && customIgnoreRegExp.test(token.value)) {
					return;
				}

				let after = opts.after,
					before = opts.before;

				const prevLineNum = token.loc.start.line - 1,
					nextLineNum = token.loc.end.line + 1,
					commentIsNotAlone = codeAroundComment(token);

				const blockStartAllowed =
						options.allowBlockStart &&
						isCommentAtBlockStart(token) &&
						!(
							options.allowClassStart === false &&
							isCommentAtClassStart(token)
						),
					blockEndAllowed =
						options.allowBlockEnd &&
						isCommentAtBlockEnd(token) &&
						!(
							options.allowClassEnd === false &&
							isCommentAtClassEnd(token)
						),
					classStartAllowed =
						options.allowClassStart && isCommentAtClassStart(token),
					classEndAllowed =
						options.allowClassEnd && isCommentAtClassEnd(token),
					objectStartAllowed =
						options.allowObjectStart && isCommentAtObjectStart(token),
					objectEndAllowed =
						options.allowObjectEnd && isCommentAtObjectEnd(token),
					arrayStartAllowed =
						options.allowArrayStart && isCommentAtArrayStart(token),
					arrayEndAllowed =
						options.allowArrayEnd && isCommentAtArrayEnd(token);

				const exceptionStartAllowed =
					blockStartAllowed ||
					classStartAllowed ||
					objectStartAllowed ||
					arrayStartAllowed;
				const exceptionEndAllowed =
					blockEndAllowed ||
					classEndAllowed ||
					objectEndAllowed ||
					arrayEndAllowed;

				// ignore top of the file and bottom of the file
				if (prevLineNum < 1) {
					before = false;
				}
				if (nextLineNum >= numLines) {
					after = false;
				}

				// we ignore all inline comments
				if (commentIsNotAlone) {
					return;
				}

				const previousTokenOrComment = sourceCode.getTokenBefore(token, {
					includeComments: true,
				});
				const nextTokenOrComment = sourceCode.getTokenAfter(token, {
					includeComments: true,
				});

				// check for newline before
				if (
					!exceptionStartAllowed &&
					before &&
					!commentAndEmptyLines.has(prevLineNum) &&
					!(
						astUtils.isCommentToken(previousTokenOrComment) &&
						astUtils.isTokenOnSameLine(previousTokenOrComment, token)
					)
				) {
					const lineStart = token.range[0] - token.loc.start.column;
					const range = [lineStart, lineStart];

					context.report({
						node: token,
						messageId: "before",
						fix(fixer) {
							return fixer.insertTextBeforeRange(range, "\n");
						},
					});
				}

				// check for newline after
				if (
					!exceptionEndAllowed &&
					after &&
					!commentAndEmptyLines.has(nextLineNum) &&
					!(
						astUtils.isCommentToken(nextTokenOrComment) &&
						astUtils.isTokenOnSameLine(token, nextTokenOrComment)
					)
				) {
					context.report({
						node: token,
						messageId: "after",
						fix(fixer) {
							return fixer.insertTextAfter(token, "\n");
						},
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program() {
					comments.forEach(token => {
						if (token.type === "Line") {
							if (
								options.beforeLineComment ||
								options.afterLineComment
							) {
								checkForEmptyLine(token, {
									after: options.afterLineComment,
									before: options.beforeLineComment,
								});
							}
						} else if (token.type === "Block") {
							if (
								options.beforeBlockComment ||
								options.afterBlockComment
							) {
								checkForEmptyLine(token, {
									after: options.afterBlockComment,
									before: options.beforeBlockComment,
								});
							}
						} else if (token.type === "Shebang") {
							if (options.afterHashbangComment) {
								checkForEmptyLine(token, {
									after: options.afterHashbangComment,
									before: false,
								});
							}
						}
					});
				},
			};
		},
	};
	return linesAroundComment;
}

/**
 * @fileoverview Require or disallow newlines around directives.
 * @author Kai Cataldo
 * @deprecated in ESLint v4.0.0
 */

var linesAroundDirective;
var hasRequiredLinesAroundDirective;

function requireLinesAroundDirective () {
	if (hasRequiredLinesAroundDirective) return linesAroundDirective;
	hasRequiredLinesAroundDirective = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	linesAroundDirective = {
		meta: {
			type: "layout",

			docs: {
				description: "Require or disallow newlines around directives",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/lines-around-directive",
			},

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never"],
						},
						{
							type: "object",
							properties: {
								before: {
									enum: ["always", "never"],
								},
								after: {
									enum: ["always", "never"],
								},
							},
							additionalProperties: false,
							minProperties: 2,
						},
					],
				},
			],

			fixable: "whitespace",
			messages: {
				expected: 'Expected newline {{location}} "{{value}}" directive.',
				unexpected:
					'Unexpected newline {{location}} "{{value}}" directive.',
			},
			deprecated: {
				message: "The rule was replaced with a more general rule.",
				url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
				deprecatedSince: "4.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message: "The new rule moved to a plugin.",
						url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "padding-line-between-statements",
							url: "https://eslint.style/rules/js/padding-line-between-statements",
						},
					},
				],
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const config = context.options[0] || "always";
			const expectLineBefore =
				typeof config === "string" ? config : config.before;
			const expectLineAfter =
				typeof config === "string" ? config : config.after;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Check if node is preceded by a blank newline.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} Whether or not the passed in node is preceded by a blank newline.
			 */
			function hasNewlineBefore(node) {
				const tokenBefore = sourceCode.getTokenBefore(node, {
					includeComments: true,
				});
				const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0;

				return node.loc.start.line - tokenLineBefore >= 2;
			}

			/**
			 * Gets the last token of a node that is on the same line as the rest of the node.
			 * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing
			 * semicolon on a different line.
			 * @param {ASTNode} node A directive node
			 * @returns {Token} The last token of the node on the line
			 */
			function getLastTokenOnLine(node) {
				const lastToken = sourceCode.getLastToken(node);
				const secondToLastToken = sourceCode.getTokenBefore(lastToken);

				return astUtils.isSemicolonToken(lastToken) &&
					lastToken.loc.start.line > secondToLastToken.loc.end.line
					? secondToLastToken
					: lastToken;
			}

			/**
			 * Check if node is followed by a blank newline.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} Whether or not the passed in node is followed by a blank newline.
			 */
			function hasNewlineAfter(node) {
				const lastToken = getLastTokenOnLine(node);
				const tokenAfter = sourceCode.getTokenAfter(lastToken, {
					includeComments: true,
				});

				return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
			}

			/**
			 * Report errors for newlines around directives.
			 * @param {ASTNode} node Node to check.
			 * @param {string} location Whether the error was found before or after the directive.
			 * @param {boolean} expected Whether or not a newline was expected or unexpected.
			 * @returns {void}
			 */
			function reportError(node, location, expected) {
				context.report({
					node,
					messageId: expected ? "expected" : "unexpected",
					data: {
						value: node.expression.value,
						location,
					},
					fix(fixer) {
						const lastToken = getLastTokenOnLine(node);

						if (expected) {
							return location === "before"
								? fixer.insertTextBefore(node, "\n")
								: fixer.insertTextAfter(lastToken, "\n");
						}
						return fixer.removeRange(
							location === "before"
								? [node.range[0] - 1, node.range[0]]
								: [lastToken.range[1], lastToken.range[1] + 1],
						);
					},
				});
			}

			/**
			 * Check lines around directives in node
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkDirectives(node) {
				const directives = astUtils.getDirectivePrologue(node);

				if (!directives.length) {
					return;
				}

				const firstDirective = directives[0];
				const leadingComments =
					sourceCode.getCommentsBefore(firstDirective);

				/*
				 * Only check before the first directive if it is preceded by a comment or if it is at the top of
				 * the file and expectLineBefore is set to "never". This is to not force a newline at the top of
				 * the file if there are no comments as well as for compatibility with padded-blocks.
				 */
				if (leadingComments.length) {
					if (
						expectLineBefore === "always" &&
						!hasNewlineBefore(firstDirective)
					) {
						reportError(firstDirective, "before", true);
					}

					if (
						expectLineBefore === "never" &&
						hasNewlineBefore(firstDirective)
					) {
						reportError(firstDirective, "before", false);
					}
				} else if (
					node.type === "Program" &&
					expectLineBefore === "never" &&
					!leadingComments.length &&
					hasNewlineBefore(firstDirective)
				) {
					reportError(firstDirective, "before", false);
				}

				const lastDirective = directives.at(-1);
				const statements =
					node.type === "Program" ? node.body : node.body.body;

				/*
				 * Do not check after the last directive if the body only
				 * contains a directive prologue and isn't followed by a comment to ensure
				 * this rule behaves well with padded-blocks.
				 */
				if (
					lastDirective === statements.at(-1) &&
					!lastDirective.trailingComments
				) {
					return;
				}

				if (
					expectLineAfter === "always" &&
					!hasNewlineAfter(lastDirective)
				) {
					reportError(lastDirective, "after", true);
				}

				if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) {
					reportError(lastDirective, "after", false);
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: checkDirectives,
				FunctionDeclaration: checkDirectives,
				FunctionExpression: checkDirectives,
				ArrowFunctionExpression: checkDirectives,
			};
		},
	};
	return linesAroundDirective;
}

/**
 * @fileoverview Rule to check empty newline between class members
 * @author 薛定谔的猫<hh_2013@foxmail.com>
 * @deprecated in ESLint v8.53.0
 */

var linesBetweenClassMembers;
var hasRequiredLinesBetweenClassMembers;

function requireLinesBetweenClassMembers () {
	if (hasRequiredLinesBetweenClassMembers) return linesBetweenClassMembers;
	hasRequiredLinesBetweenClassMembers = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Types of class members.
	 * Those have `test` method to check it matches to the given class member.
	 * @private
	 */
	const ClassMemberTypes = {
		"*": { test: () => true },
		field: { test: node => node.type === "PropertyDefinition" },
		method: { test: node => node.type === "MethodDefinition" },
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	linesBetweenClassMembers = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "lines-between-class-members",
							url: "https://eslint.style/rules/js/lines-between-class-members",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require or disallow an empty line between class members",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/lines-between-class-members",
			},

			fixable: "whitespace",

			schema: [
				{
					anyOf: [
						{
							type: "object",
							properties: {
								enforce: {
									type: "array",
									items: {
										type: "object",
										properties: {
											blankLine: {
												enum: ["always", "never"],
											},
											prev: {
												enum: ["method", "field", "*"],
											},
											next: {
												enum: ["method", "field", "*"],
											},
										},
										additionalProperties: false,
										required: ["blankLine", "prev", "next"],
									},
									minItems: 1,
								},
							},
							additionalProperties: false,
							required: ["enforce"],
						},
						{
							enum: ["always", "never"],
						},
					],
				},
				{
					type: "object",
					properties: {
						exceptAfterSingleLine: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				never: "Unexpected blank line between class members.",
				always: "Expected blank line between class members.",
			},
		},

		create(context) {
			const options = [];

			options[0] = context.options[0] || "always";
			options[1] = context.options[1] || { exceptAfterSingleLine: false };

			const configureList =
				typeof options[0] === "object"
					? options[0].enforce
					: [{ blankLine: options[0], prev: "*", next: "*" }];
			const sourceCode = context.sourceCode;

			/**
			 * Gets a pair of tokens that should be used to check lines between two class member nodes.
			 *
			 * In most cases, this returns the very last token of the current node and
			 * the very first token of the next node.
			 * For example:
			 *
			 *     class C {
			 *         x = 1;   // curLast: `;` nextFirst: `in`
			 *         in = 2
			 *     }
			 *
			 * There is only one exception. If the given node ends with a semicolon, and it looks like
			 * a semicolon-less style's semicolon - one that is not on the same line as the preceding
			 * token, but is on the line where the next class member starts - this returns the preceding
			 * token and the semicolon as boundary tokens.
			 * For example:
			 *
			 *     class C {
			 *         x = 1    // curLast: `1` nextFirst: `;`
			 *         ;in = 2
			 *     }
			 * When determining the desired layout of the code, we should treat this semicolon as
			 * a part of the next class member node instead of the one it technically belongs to.
			 * @param {ASTNode} curNode Current class member node.
			 * @param {ASTNode} nextNode Next class member node.
			 * @returns {Token} The actual last token of `node`.
			 * @private
			 */
			function getBoundaryTokens(curNode, nextNode) {
				const lastToken = sourceCode.getLastToken(curNode);
				const prevToken = sourceCode.getTokenBefore(lastToken);
				const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes

				const isSemicolonLessStyle =
					astUtils.isSemicolonToken(lastToken) &&
					!astUtils.isTokenOnSameLine(prevToken, lastToken) &&
					astUtils.isTokenOnSameLine(lastToken, nextToken);

				return isSemicolonLessStyle
					? { curLast: prevToken, nextFirst: lastToken }
					: { curLast: lastToken, nextFirst: nextToken };
			}

			/**
			 * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member.
			 * @param {Token} prevLastToken The last token in the previous member node.
			 * @param {Token} nextFirstToken The first token in the next member node.
			 * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
			 * @returns {Token} The last token among the consecutive tokens.
			 */
			function findLastConsecutiveTokenAfter(
				prevLastToken,
				nextFirstToken,
				maxLine,
			) {
				const after = sourceCode.getTokenAfter(prevLastToken, {
					includeComments: true,
				});

				if (
					after !== nextFirstToken &&
					after.loc.start.line - prevLastToken.loc.end.line <= maxLine
				) {
					return findLastConsecutiveTokenAfter(
						after,
						nextFirstToken,
						maxLine,
					);
				}
				return prevLastToken;
			}

			/**
			 * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member.
			 * @param {Token} nextFirstToken The first token in the next member node.
			 * @param {Token} prevLastToken The last token in the previous member node.
			 * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
			 * @returns {Token} The first token among the consecutive tokens.
			 */
			function findFirstConsecutiveTokenBefore(
				nextFirstToken,
				prevLastToken,
				maxLine,
			) {
				const before = sourceCode.getTokenBefore(nextFirstToken, {
					includeComments: true,
				});

				if (
					before !== prevLastToken &&
					nextFirstToken.loc.start.line - before.loc.end.line <= maxLine
				) {
					return findFirstConsecutiveTokenBefore(
						before,
						prevLastToken,
						maxLine,
					);
				}
				return nextFirstToken;
			}

			/**
			 * Checks if there is a token or comment between two tokens.
			 * @param {Token} before The token before.
			 * @param {Token} after The token after.
			 * @returns {boolean} True if there is a token or comment between two tokens.
			 */
			function hasTokenOrCommentBetween(before, after) {
				return (
					sourceCode.getTokensBetween(before, after, {
						includeComments: true,
					}).length !== 0
				);
			}

			/**
			 * Checks whether the given node matches the given type.
			 * @param {ASTNode} node The class member node to check.
			 * @param {string} type The class member type to check.
			 * @returns {boolean} `true` if the class member node matched the type.
			 * @private
			 */
			function match(node, type) {
				return ClassMemberTypes[type].test(node);
			}

			/**
			 * Finds the last matched configuration from the configureList.
			 * @param {ASTNode} prevNode The previous node to match.
			 * @param {ASTNode} nextNode The current node to match.
			 * @returns {string|null} Padding type or `null` if no matches were found.
			 * @private
			 */
			function getPaddingType(prevNode, nextNode) {
				for (let i = configureList.length - 1; i >= 0; --i) {
					const configure = configureList[i];
					const matched =
						match(prevNode, configure.prev) &&
						match(nextNode, configure.next);

					if (matched) {
						return configure.blankLine;
					}
				}
				return null;
			}

			return {
				ClassBody(node) {
					const body = node.body;

					for (let i = 0; i < body.length - 1; i++) {
						const curFirst = sourceCode.getFirstToken(body[i]);
						const { curLast, nextFirst } = getBoundaryTokens(
							body[i],
							body[i + 1],
						);
						const isMulti = !astUtils.isTokenOnSameLine(
							curFirst,
							curLast,
						);
						const skip = !isMulti && options[1].exceptAfterSingleLine;
						const beforePadding = findLastConsecutiveTokenAfter(
							curLast,
							nextFirst,
							1,
						);
						const afterPadding = findFirstConsecutiveTokenBefore(
							nextFirst,
							curLast,
							1,
						);
						const isPadded =
							afterPadding.loc.start.line -
								beforePadding.loc.end.line >
							1;
						const hasTokenInPadding = hasTokenOrCommentBetween(
							beforePadding,
							afterPadding,
						);
						const curLineLastToken = findLastConsecutiveTokenAfter(
							curLast,
							nextFirst,
							0,
						);
						const paddingType = getPaddingType(body[i], body[i + 1]);

						if (paddingType === "never" && isPadded) {
							context.report({
								node: body[i + 1],
								messageId: "never",

								fix(fixer) {
									if (hasTokenInPadding) {
										return null;
									}
									return fixer.replaceTextRange(
										[
											beforePadding.range[1],
											afterPadding.range[0],
										],
										"\n",
									);
								},
							});
						} else if (paddingType === "always" && !skip && !isPadded) {
							context.report({
								node: body[i + 1],
								messageId: "always",

								fix(fixer) {
									if (hasTokenInPadding) {
										return null;
									}
									return fixer.insertTextAfter(
										curLineLastToken,
										"\n",
									);
								},
							});
						}
					}
				},
			};
		},
	};
	return linesBetweenClassMembers;
}

/**
 * @fileoverview Rule to replace assignment expressions with logical operator assignment
 * @author Daniel Martens
 */

var logicalAssignmentOperators;
var hasRequiredLogicalAssignmentOperators;

function requireLogicalAssignmentOperators () {
	if (hasRequiredLogicalAssignmentOperators) return logicalAssignmentOperators;
	hasRequiredLogicalAssignmentOperators = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const baseTypes = new Set(["Identifier", "Super", "ThisExpression"]);

	/**
	 * Returns true iff either "undefined" or a void expression (eg. "void 0")
	 * @param {ASTNode} expression Expression to check
	 * @param {import('eslint-scope').Scope} scope Scope of the expression
	 * @returns {boolean} True iff "undefined" or "void ..."
	 */
	function isUndefined(expression, scope) {
		if (expression.type === "Identifier" && expression.name === "undefined") {
			return astUtils.isReferenceToGlobalVariable(scope, expression);
		}

		return (
			expression.type === "UnaryExpression" &&
			expression.operator === "void" &&
			expression.argument.type === "Literal" &&
			expression.argument.value === 0
		);
	}

	/**
	 * Returns true iff the reference is either an identifier or member expression
	 * @param {ASTNode} expression Expression to check
	 * @returns {boolean} True for identifiers and member expressions
	 */
	function isReference(expression) {
		return (
			(expression.type === "Identifier" && expression.name !== "undefined") ||
			expression.type === "MemberExpression"
		);
	}

	/**
	 * Returns true iff the expression checks for nullish with loose equals.
	 * Examples: value == null, value == void 0
	 * @param {ASTNode} expression Test condition
	 * @param {import('eslint-scope').Scope} scope Scope of the expression
	 * @returns {boolean} True iff implicit nullish comparison
	 */
	function isImplicitNullishComparison(expression, scope) {
		if (
			expression.type !== "BinaryExpression" ||
			expression.operator !== "=="
		) {
			return false;
		}

		const reference = isReference(expression.left) ? "left" : "right";
		const nullish = reference === "left" ? "right" : "left";

		return (
			isReference(expression[reference]) &&
			(astUtils.isNullLiteral(expression[nullish]) ||
				isUndefined(expression[nullish], scope))
		);
	}

	/**
	 * Condition with two equal comparisons.
	 * @param {ASTNode} expression Condition
	 * @returns {boolean} True iff matches ? === ? || ? === ?
	 */
	function isDoubleComparison(expression) {
		return (
			expression.type === "LogicalExpression" &&
			expression.operator === "||" &&
			expression.left.type === "BinaryExpression" &&
			expression.left.operator === "===" &&
			expression.right.type === "BinaryExpression" &&
			expression.right.operator === "==="
		);
	}

	/**
	 * Returns true iff the expression checks for undefined and null.
	 * Example: value === null || value === undefined
	 * @param {ASTNode} expression Test condition
	 * @param {import('eslint-scope').Scope} scope Scope of the expression
	 * @returns {boolean} True iff explicit nullish comparison
	 */
	function isExplicitNullishComparison(expression, scope) {
		if (!isDoubleComparison(expression)) {
			return false;
		}
		const leftReference = isReference(expression.left.left) ? "left" : "right";
		const leftNullish = leftReference === "left" ? "right" : "left";
		const rightReference = isReference(expression.right.left)
			? "left"
			: "right";
		const rightNullish = rightReference === "left" ? "right" : "left";

		return (
			astUtils.isSameReference(
				expression.left[leftReference],
				expression.right[rightReference],
			) &&
			((astUtils.isNullLiteral(expression.left[leftNullish]) &&
				isUndefined(expression.right[rightNullish], scope)) ||
				(isUndefined(expression.left[leftNullish], scope) &&
					astUtils.isNullLiteral(expression.right[rightNullish])))
		);
	}

	/**
	 * Returns true for Boolean(arg) calls
	 * @param {ASTNode} expression Test condition
	 * @param {import('eslint-scope').Scope} scope Scope of the expression
	 * @returns {boolean} Whether the expression is a boolean cast
	 */
	function isBooleanCast(expression, scope) {
		return (
			expression.type === "CallExpression" &&
			expression.callee.name === "Boolean" &&
			expression.arguments.length === 1 &&
			astUtils.isReferenceToGlobalVariable(scope, expression.callee)
		);
	}

	/**
	 * Returns true for:
	 * truthiness checks:  value, Boolean(value), !!value
	 * falsiness checks:   !value, !Boolean(value)
	 * nullish checks:     value == null, value === undefined || value === null
	 * @param {ASTNode} expression Test condition
	 * @param {import('eslint-scope').Scope} scope Scope of the expression
	 * @returns {?{ reference: ASTNode, operator: '??'|'||'|'&&'}} Null if not a known existence
	 */
	function getExistence(expression, scope) {
		const isNegated =
			expression.type === "UnaryExpression" && expression.operator === "!";
		const base = isNegated ? expression.argument : expression;

		switch (true) {
			case isReference(base):
				return { reference: base, operator: isNegated ? "||" : "&&" };
			case base.type === "UnaryExpression" &&
				base.operator === "!" &&
				isReference(base.argument):
				return { reference: base.argument, operator: "&&" };
			case isBooleanCast(base, scope) && isReference(base.arguments[0]):
				return {
					reference: base.arguments[0],
					operator: isNegated ? "||" : "&&",
				};
			case isImplicitNullishComparison(expression, scope):
				return {
					reference: isReference(expression.left)
						? expression.left
						: expression.right,
					operator: "??",
				};
			case isExplicitNullishComparison(expression, scope):
				return {
					reference: isReference(expression.left.left)
						? expression.left.left
						: expression.left.right,
					operator: "??",
				};
			default:
				return null;
		}
	}

	/**
	 * Returns true iff the node is inside a with block
	 * @param {ASTNode} node Node to check
	 * @returns {boolean} True iff passed node is inside a with block
	 */
	function isInsideWithBlock(node) {
		if (node.type === "Program") {
			return false;
		}

		return node.parent.type === "WithStatement" && node.parent.body === node
			? true
			: isInsideWithBlock(node.parent);
	}

	/**
	 * Gets the leftmost operand of a consecutive logical expression.
	 * @param {SourceCode} sourceCode The ESLint source code object
	 * @param {LogicalExpression} node LogicalExpression
	 * @returns {Expression} Leftmost operand
	 */
	function getLeftmostOperand(sourceCode, node) {
		let left = node.left;

		while (
			left.type === "LogicalExpression" &&
			left.operator === node.operator
		) {
			if (astUtils.isParenthesised(sourceCode, left)) {
				/*
				 * It should have associativity,
				 * but ignore it if use parentheses to make the evaluation order clear.
				 */
				return left;
			}
			left = left.left;
		}
		return left;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------
	/** @type {import('../shared/types').Rule} */
	logicalAssignmentOperators = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require or disallow logical assignment operator shorthand",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/logical-assignment-operators",
			},

			schema: {
				type: "array",
				oneOf: [
					{
						items: [
							{ const: "always" },
							{
								type: "object",
								properties: {
									enforceForIfStatements: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0, // 0 for allowing passing no options
						maxItems: 2,
					},
					{
						items: [{ const: "never" }],
						minItems: 1,
						maxItems: 1,
					},
				],
			},
			fixable: "code",
			hasSuggestions: true,
			messages: {
				assignment:
					"Assignment (=) can be replaced with operator assignment ({{operator}}).",
				useLogicalOperator:
					"Convert this assignment to use the operator {{ operator }}.",
				logical:
					"Logical expression can be replaced with an assignment ({{ operator }}).",
				convertLogical:
					"Replace this logical expression with an assignment with the operator {{ operator }}.",
				if: "'if' statement can be replaced with a logical operator assignment with operator {{ operator }}.",
				convertIf:
					"Replace this 'if' statement with a logical assignment with operator {{ operator }}.",
				unexpected:
					"Unexpected logical operator assignment ({{operator}}) shorthand.",
				separate:
					"Separate the logical assignment into an assignment with a logical operator.",
			},
		},

		create(context) {
			const mode = context.options[0] === "never" ? "never" : "always";
			const checkIf =
				mode === "always" &&
				context.options.length > 1 &&
				context.options[1].enforceForIfStatements;
			const sourceCode = context.sourceCode;
			const isStrict = sourceCode.getScope(sourceCode.ast).isStrict;

			/**
			 * Returns false if the access could be a getter
			 * @param {ASTNode} node Assignment expression
			 * @returns {boolean} True iff the fix is safe
			 */
			function cannotBeGetter(node) {
				return (
					node.type === "Identifier" &&
					(isStrict || !isInsideWithBlock(node))
				);
			}

			/**
			 * Check whether only a single property is accessed
			 * @param {ASTNode} node reference
			 * @returns {boolean} True iff a single property is accessed
			 */
			function accessesSingleProperty(node) {
				if (!isStrict && isInsideWithBlock(node)) {
					return node.type === "Identifier";
				}

				return (
					node.type === "MemberExpression" &&
					baseTypes.has(node.object.type) &&
					(!node.computed ||
						(node.property.type !== "MemberExpression" &&
							node.property.type !== "ChainExpression"))
				);
			}

			/**
			 * Adds a fixer or suggestion whether on the fix is safe.
			 * @param {{ messageId: string, node: ASTNode }} descriptor Report descriptor without fix or suggest
			 * @param {{ messageId: string, fix: Function }} suggestion Adds the fix or the whole suggestion as only element in "suggest" to suggestion
			 * @param {boolean} shouldBeFixed Fix iff the condition is true
			 * @returns {Object} Descriptor with either an added fix or suggestion
			 */
			function createConditionalFixer(descriptor, suggestion, shouldBeFixed) {
				if (shouldBeFixed) {
					return {
						...descriptor,
						fix: suggestion.fix,
					};
				}

				return {
					...descriptor,
					suggest: [suggestion],
				};
			}

			/**
			 * Returns the operator token for assignments and binary expressions
			 * @param {ASTNode} node AssignmentExpression or BinaryExpression
			 * @returns {import('eslint').AST.Token} Operator token between the left and right expression
			 */
			function getOperatorToken(node) {
				return sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);
			}

			if (mode === "never") {
				return {
					// foo ||= bar
					AssignmentExpression(assignment) {
						if (
							!astUtils.isLogicalAssignmentOperator(
								assignment.operator,
							)
						) {
							return;
						}

						const descriptor = {
							messageId: "unexpected",
							node: assignment,
							data: { operator: assignment.operator },
						};
						const suggestion = {
							messageId: "separate",
							*fix(ruleFixer) {
								if (
									sourceCode.getCommentsInside(assignment)
										.length > 0
								) {
									return;
								}

								const operatorToken = getOperatorToken(assignment);

								// -> foo = bar
								yield ruleFixer.replaceText(operatorToken, "=");

								const assignmentText = sourceCode.getText(
									assignment.left,
								);
								const operator = assignment.operator.slice(0, -1);

								// -> foo = foo || bar
								yield ruleFixer.insertTextAfter(
									operatorToken,
									` ${assignmentText} ${operator}`,
								);

								const precedence =
									astUtils.getPrecedence(assignment.right) <=
									astUtils.getPrecedence({
										type: "LogicalExpression",
										operator,
									});

								// ?? and || / && cannot be mixed but have same precedence
								const mixed =
									assignment.operator === "??=" &&
									astUtils.isLogicalExpression(assignment.right);

								if (
									!astUtils.isParenthesised(
										sourceCode,
										assignment.right,
									) &&
									(precedence || mixed)
								) {
									// -> foo = foo || (bar)
									yield ruleFixer.insertTextBefore(
										assignment.right,
										"(",
									);
									yield ruleFixer.insertTextAfter(
										assignment.right,
										")",
									);
								}
							},
						};

						context.report(
							createConditionalFixer(
								descriptor,
								suggestion,
								cannotBeGetter(assignment.left),
							),
						);
					},
				};
			}

			return {
				// foo = foo || bar
				"AssignmentExpression[operator='='][right.type='LogicalExpression']"(
					assignment,
				) {
					const leftOperand = getLeftmostOperand(
						sourceCode,
						assignment.right,
					);

					if (!astUtils.isSameReference(assignment.left, leftOperand)) {
						return;
					}

					const descriptor = {
						messageId: "assignment",
						node: assignment,
						data: { operator: `${assignment.right.operator}=` },
					};
					const suggestion = {
						messageId: "useLogicalOperator",
						data: { operator: `${assignment.right.operator}=` },
						*fix(ruleFixer) {
							if (
								sourceCode.getCommentsInside(assignment).length > 0
							) {
								return;
							}

							// No need for parenthesis around the assignment based on precedence as the precedence stays the same even with changed operator
							const assignmentOperatorToken =
								getOperatorToken(assignment);

							// -> foo ||= foo || bar
							yield ruleFixer.insertTextBefore(
								assignmentOperatorToken,
								assignment.right.operator,
							);

							// -> foo ||= bar
							const logicalOperatorToken = getOperatorToken(
								leftOperand.parent,
							);
							const firstRightOperandToken =
								sourceCode.getTokenAfter(logicalOperatorToken);

							yield ruleFixer.removeRange([
								leftOperand.parent.range[0],
								firstRightOperandToken.range[0],
							]);
						},
					};

					context.report(
						createConditionalFixer(
							descriptor,
							suggestion,
							cannotBeGetter(assignment.left),
						),
					);
				},

				// foo || (foo = bar)
				'LogicalExpression[right.type="AssignmentExpression"][right.operator="="]'(
					logical,
				) {
					// Right side has to be parenthesized, otherwise would be parsed as (foo || foo) = bar which is illegal
					if (
						isReference(logical.left) &&
						astUtils.isSameReference(logical.left, logical.right.left)
					) {
						const descriptor = {
							messageId: "logical",
							node: logical,
							data: { operator: `${logical.operator}=` },
						};
						const suggestion = {
							messageId: "convertLogical",
							data: { operator: `${logical.operator}=` },
							*fix(ruleFixer) {
								if (
									sourceCode.getCommentsInside(logical).length > 0
								) {
									return;
								}

								const parentPrecedence = astUtils.getPrecedence(
									logical.parent,
								);
								const requiresOuterParenthesis =
									logical.parent.type !== "ExpressionStatement" &&
									(parentPrecedence === -1 ||
										astUtils.getPrecedence({
											type: "AssignmentExpression",
										}) < parentPrecedence);

								if (
									!astUtils.isParenthesised(
										sourceCode,
										logical,
									) &&
									requiresOuterParenthesis
								) {
									yield ruleFixer.insertTextBefore(logical, "(");
									yield ruleFixer.insertTextAfter(logical, ")");
								}

								// Also removes all opening parenthesis
								yield ruleFixer.removeRange([
									logical.range[0],
									logical.right.range[0],
								]); // -> foo = bar)

								// Also removes all ending parenthesis
								yield ruleFixer.removeRange([
									logical.right.range[1],
									logical.range[1],
								]); // -> foo = bar

								const operatorToken = getOperatorToken(
									logical.right,
								);

								yield ruleFixer.insertTextBefore(
									operatorToken,
									logical.operator,
								); // -> foo ||= bar
							},
						};
						const fix =
							cannotBeGetter(logical.left) ||
							accessesSingleProperty(logical.left);

						context.report(
							createConditionalFixer(descriptor, suggestion, fix),
						);
					}
				},

				// if (foo) foo = bar
				"IfStatement[alternate=null]"(ifNode) {
					if (!checkIf) {
						return;
					}

					const hasBody = ifNode.consequent.type === "BlockStatement";

					if (hasBody && ifNode.consequent.body.length !== 1) {
						return;
					}

					const body = hasBody
						? ifNode.consequent.body[0]
						: ifNode.consequent;
					const scope = sourceCode.getScope(ifNode);
					const existence = getExistence(ifNode.test, scope);

					if (
						body.type === "ExpressionStatement" &&
						body.expression.type === "AssignmentExpression" &&
						body.expression.operator === "=" &&
						existence !== null &&
						astUtils.isSameReference(
							existence.reference,
							body.expression.left,
						)
					) {
						const descriptor = {
							messageId: "if",
							node: ifNode,
							data: { operator: `${existence.operator}=` },
						};
						const suggestion = {
							messageId: "convertIf",
							data: { operator: `${existence.operator}=` },
							*fix(ruleFixer) {
								if (
									sourceCode.getCommentsInside(ifNode).length > 0
								) {
									return;
								}

								const firstBodyToken =
									sourceCode.getFirstToken(body);
								const prevToken = sourceCode.getTokenBefore(ifNode);

								if (
									prevToken !== null &&
									prevToken.value !== ";" &&
									prevToken.value !== "{" &&
									firstBodyToken.type !== "Identifier" &&
									firstBodyToken.type !== "Keyword"
								) {
									// Do not fix if the fixed statement could be part of the previous statement (eg. fn() if (a == null) (a) = b --> fn()(a) ??= b)
									return;
								}

								const operatorToken = getOperatorToken(
									body.expression,
								);

								yield ruleFixer.insertTextBefore(
									operatorToken,
									existence.operator,
								); // -> if (foo) foo ||= bar

								yield ruleFixer.removeRange([
									ifNode.range[0],
									body.range[0],
								]); // -> foo ||= bar

								yield ruleFixer.removeRange([
									body.range[1],
									ifNode.range[1],
								]); // -> foo ||= bar, only present if "if" had a body

								const nextToken = sourceCode.getTokenAfter(
									body.expression,
								);

								if (
									hasBody &&
									nextToken !== null &&
									nextToken.value !== ";"
								) {
									yield ruleFixer.insertTextAfter(ifNode, ";");
								}
							},
						};
						const shouldBeFixed =
							cannotBeGetter(existence.reference) ||
							(ifNode.test.type !== "LogicalExpression" &&
								accessesSingleProperty(existence.reference));

						context.report(
							createConditionalFixer(
								descriptor,
								suggestion,
								shouldBeFixed,
							),
						);
					}
				},
			};
		},
	};
	return logicalAssignmentOperators;
}

/**
 * @fileoverview Enforce a maximum number of classes per file
 * @author James Garbutt <https://github.com/43081j>
 */

var maxClassesPerFile;
var hasRequiredMaxClassesPerFile;

function requireMaxClassesPerFile () {
	if (hasRequiredMaxClassesPerFile) return maxClassesPerFile;
	hasRequiredMaxClassesPerFile = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxClassesPerFile = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Enforce a maximum number of classes per file",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-classes-per-file",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 1,
						},
						{
							type: "object",
							properties: {
								ignoreExpressions: {
									type: "boolean",
								},
								max: {
									type: "integer",
									minimum: 1,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				maximumExceeded:
					"File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}.",
			},
		},
		create(context) {
			const [option = {}] = context.options;
			const [ignoreExpressions, max] =
				typeof option === "number"
					? [false, option || 1]
					: [option.ignoreExpressions, option.max || 1];

			let classCount = 0;

			return {
				Program() {
					classCount = 0;
				},
				"Program:exit"(node) {
					if (classCount > max) {
						context.report({
							node,
							messageId: "maximumExceeded",
							data: {
								classCount,
								max,
							},
						});
					}
				},
				ClassDeclaration() {
					classCount++;
				},
				ClassExpression() {
					if (!ignoreExpressions) {
						classCount++;
					}
				},
			};
		},
	};
	return maxClassesPerFile;
}

/**
 * @fileoverview A rule to set the maximum depth block can be nested in a function.
 * @author Ian Christian Myers
 */

var maxDepth;
var hasRequiredMaxDepth;

function requireMaxDepth () {
	if (hasRequiredMaxDepth) return maxDepth;
	hasRequiredMaxDepth = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxDepth = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Enforce a maximum depth that blocks can be nested",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-depth",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								maximum: {
									type: "integer",
									minimum: 0,
								},
								max: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				tooDeeply:
					"Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const functionStack = [],
				option = context.options[0];
			let maxDepth = 4;

			if (
				typeof option === "object" &&
				(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
			) {
				maxDepth = option.maximum || option.max;
			}
			if (typeof option === "number") {
				maxDepth = option;
			}

			/**
			 * When parsing a new function, store it in our function stack
			 * @returns {void}
			 * @private
			 */
			function startFunction() {
				functionStack.push(0);
			}

			/**
			 * When parsing is done then pop out the reference
			 * @returns {void}
			 * @private
			 */
			function endFunction() {
				functionStack.pop();
			}

			/**
			 * Save the block and Evaluate the node
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function pushBlock(node) {
				const len = ++functionStack[functionStack.length - 1];

				if (len > maxDepth) {
					context.report({
						node,
						messageId: "tooDeeply",
						data: { depth: len, maxDepth },
					});
				}
			}

			/**
			 * Pop the saved block
			 * @returns {void}
			 * @private
			 */
			function popBlock() {
				functionStack[functionStack.length - 1]--;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				Program: startFunction,
				FunctionDeclaration: startFunction,
				FunctionExpression: startFunction,
				ArrowFunctionExpression: startFunction,
				StaticBlock: startFunction,

				IfStatement(node) {
					if (node.parent.type !== "IfStatement") {
						pushBlock(node);
					}
				},
				SwitchStatement: pushBlock,
				TryStatement: pushBlock,
				DoWhileStatement: pushBlock,
				WhileStatement: pushBlock,
				WithStatement: pushBlock,
				ForStatement: pushBlock,
				ForInStatement: pushBlock,
				ForOfStatement: pushBlock,

				"IfStatement:exit": popBlock,
				"SwitchStatement:exit": popBlock,
				"TryStatement:exit": popBlock,
				"DoWhileStatement:exit": popBlock,
				"WhileStatement:exit": popBlock,
				"WithStatement:exit": popBlock,
				"ForStatement:exit": popBlock,
				"ForInStatement:exit": popBlock,
				"ForOfStatement:exit": popBlock,

				"FunctionDeclaration:exit": endFunction,
				"FunctionExpression:exit": endFunction,
				"ArrowFunctionExpression:exit": endFunction,
				"StaticBlock:exit": endFunction,
				"Program:exit": endFunction,
			};
		},
	};
	return maxDepth;
}

/**
 * @fileoverview Rule to check for max length on a line.
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

var maxLen;
var hasRequiredMaxLen;

function requireMaxLen () {
	if (hasRequiredMaxLen) return maxLen;
	hasRequiredMaxLen = 1;

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const OPTIONS_SCHEMA = {
		type: "object",
		properties: {
			code: {
				type: "integer",
				minimum: 0,
			},
			comments: {
				type: "integer",
				minimum: 0,
			},
			tabWidth: {
				type: "integer",
				minimum: 0,
			},
			ignorePattern: {
				type: "string",
			},
			ignoreComments: {
				type: "boolean",
			},
			ignoreStrings: {
				type: "boolean",
			},
			ignoreUrls: {
				type: "boolean",
			},
			ignoreTemplateLiterals: {
				type: "boolean",
			},
			ignoreRegExpLiterals: {
				type: "boolean",
			},
			ignoreTrailingComments: {
				type: "boolean",
			},
		},
		additionalProperties: false,
	};

	const OPTIONS_OR_INTEGER_SCHEMA = {
		anyOf: [
			OPTIONS_SCHEMA,
			{
				type: "integer",
				minimum: 0,
			},
		],
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxLen = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "max-len",
							url: "https://eslint.style/rules/js/max-len",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce a maximum line length",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-len",
			},

			schema: [
				OPTIONS_OR_INTEGER_SCHEMA,
				OPTIONS_OR_INTEGER_SCHEMA,
				OPTIONS_SCHEMA,
			],
			messages: {
				max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.",
				maxComment:
					"This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}.",
			},
		},

		create(context) {
			/*
			 * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however:
			 * - They're matching an entire string that we know is a URI
			 * - We're matching part of a string where we think there *might* be a URL
			 * - We're only concerned about URLs, as picking out any URI would cause
			 *   too many false positives
			 * - We don't care about matching the entire URL, any small segment is fine
			 */
			const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u;

			const sourceCode = context.sourceCode;

			/**
			 * Computes the length of a line that may contain tabs. The width of each
			 * tab will be the number of spaces to the next tab stop.
			 * @param {string} line The line.
			 * @param {int} tabWidth The width of each tab stop in spaces.
			 * @returns {int} The computed line length.
			 * @private
			 */
			function computeLineLength(line, tabWidth) {
				let extraCharacterCount = 0;

				line.replace(/\t/gu, (match, offset) => {
					const totalOffset = offset + extraCharacterCount,
						previousTabStopOffset = tabWidth
							? totalOffset % tabWidth
							: 0,
						spaceCount = tabWidth - previousTabStopOffset;

					extraCharacterCount += spaceCount - 1; // -1 for the replaced tab
				});
				return Array.from(line).length + extraCharacterCount;
			}

			// The options object must be the last option specified…
			const options = Object.assign({}, context.options.at(-1));

			// …but max code length…
			if (typeof context.options[0] === "number") {
				options.code = context.options[0];
			}

			// …and tabWidth can be optionally specified directly as integers.
			if (typeof context.options[1] === "number") {
				options.tabWidth = context.options[1];
			}

			const maxLength = typeof options.code === "number" ? options.code : 80,
				tabWidth =
					typeof options.tabWidth === "number" ? options.tabWidth : 4,
				ignoreComments = !!options.ignoreComments,
				ignoreStrings = !!options.ignoreStrings,
				ignoreTemplateLiterals = !!options.ignoreTemplateLiterals,
				ignoreRegExpLiterals = !!options.ignoreRegExpLiterals,
				ignoreTrailingComments =
					!!options.ignoreTrailingComments || !!options.ignoreComments,
				ignoreUrls = !!options.ignoreUrls,
				maxCommentLength = options.comments;
			let ignorePattern = options.ignorePattern || null;

			if (ignorePattern) {
				ignorePattern = new RegExp(ignorePattern, "u");
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Tells if a given comment is trailing: it starts on the current line and
			 * extends to or past the end of the current line.
			 * @param {string} line The source line we want to check for a trailing comment on
			 * @param {number} lineNumber The one-indexed line number for line
			 * @param {ASTNode} comment The comment to inspect
			 * @returns {boolean} If the comment is trailing on the given line
			 */
			function isTrailingComment(line, lineNumber, comment) {
				return (
					comment &&
					comment.loc.start.line === lineNumber &&
					lineNumber <= comment.loc.end.line &&
					(comment.loc.end.line > lineNumber ||
						comment.loc.end.column === line.length)
				);
			}

			/**
			 * Tells if a comment encompasses the entire line.
			 * @param {string} line The source line with a trailing comment
			 * @param {number} lineNumber The one-indexed line number this is on
			 * @param {ASTNode} comment The comment to remove
			 * @returns {boolean} If the comment covers the entire line
			 */
			function isFullLineComment(line, lineNumber, comment) {
				const start = comment.loc.start,
					end = comment.loc.end,
					isFirstTokenOnLine = !line
						.slice(0, comment.loc.start.column)
						.trim();

				return (
					comment &&
					(start.line < lineNumber ||
						(start.line === lineNumber && isFirstTokenOnLine)) &&
					(end.line > lineNumber ||
						(end.line === lineNumber && end.column === line.length))
				);
			}

			/**
			 * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer.
			 */
			function isJSXEmptyExpressionInSingleLineContainer(node) {
				if (
					!node ||
					!node.parent ||
					node.type !== "JSXEmptyExpression" ||
					node.parent.type !== "JSXExpressionContainer"
				) {
					return false;
				}

				const parent = node.parent;

				return parent.loc.start.line === parent.loc.end.line;
			}

			/**
			 * Gets the line after the comment and any remaining trailing whitespace is
			 * stripped.
			 * @param {string} line The source line with a trailing comment
			 * @param {ASTNode} comment The comment to remove
			 * @returns {string} Line without comment and trailing whitespace
			 */
			function stripTrailingComment(line, comment) {
				// loc.column is zero-indexed
				return line.slice(0, comment.loc.start.column).replace(/\s+$/u, "");
			}

			/**
			 * Ensure that an array exists at [key] on `object`, and add `value` to it.
			 * @param {Object} object the object to mutate
			 * @param {string} key the object's key
			 * @param {any} value the value to add
			 * @returns {void}
			 * @private
			 */
			function ensureArrayAndPush(object, key, value) {
				if (!Array.isArray(object[key])) {
					object[key] = [];
				}
				object[key].push(value);
			}

			/**
			 * Retrieves an array containing all strings (" or ') in the source code.
			 * @returns {ASTNode[]} An array of string nodes.
			 */
			function getAllStrings() {
				return sourceCode.ast.tokens.filter(
					token =>
						token.type === "String" ||
						(token.type === "JSXText" &&
							sourceCode.getNodeByRangeIndex(token.range[0] - 1)
								.type === "JSXAttribute"),
				);
			}

			/**
			 * Retrieves an array containing all template literals in the source code.
			 * @returns {ASTNode[]} An array of template literal nodes.
			 */
			function getAllTemplateLiterals() {
				return sourceCode.ast.tokens.filter(
					token => token.type === "Template",
				);
			}

			/**
			 * Retrieves an array containing all RegExp literals in the source code.
			 * @returns {ASTNode[]} An array of RegExp literal nodes.
			 */
			function getAllRegExpLiterals() {
				return sourceCode.ast.tokens.filter(
					token => token.type === "RegularExpression",
				);
			}

			/**
			 *
			 * reduce an array of AST nodes by line number, both start and end.
			 * @param {ASTNode[]} arr array of AST nodes
			 * @returns {Object} accululated AST nodes
			 */
			function groupArrayByLineNumber(arr) {
				const obj = {};

				for (let i = 0; i < arr.length; i++) {
					const node = arr[i];

					for (let j = node.loc.start.line; j <= node.loc.end.line; ++j) {
						ensureArrayAndPush(obj, j, node);
					}
				}
				return obj;
			}

			/**
			 * Returns an array of all comments in the source code.
			 * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer,
			 * the element is changed with JSXExpressionContainer node.
			 * @returns {ASTNode[]} An array of comment nodes
			 */
			function getAllComments() {
				const comments = [];

				sourceCode.getAllComments().forEach(commentNode => {
					const containingNode = sourceCode.getNodeByRangeIndex(
						commentNode.range[0],
					);

					if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) {
						// push a unique node only
						if (comments.at(-1) !== containingNode.parent) {
							comments.push(containingNode.parent);
						}
					} else {
						comments.push(commentNode);
					}
				});

				return comments;
			}

			/**
			 * Check the program for max length
			 * @param {ASTNode} node Node to examine
			 * @returns {void}
			 * @private
			 */
			function checkProgramForMaxLength(node) {
				// split (honors line-ending)
				const lines = sourceCode.lines,
					// list of comments to ignore
					comments =
						ignoreComments || maxCommentLength || ignoreTrailingComments
							? getAllComments()
							: [];

				// we iterate over comments in parallel with the lines
				let commentsIndex = 0;

				const strings = getAllStrings();
				const stringsByLine = groupArrayByLineNumber(strings);

				const templateLiterals = getAllTemplateLiterals();
				const templateLiteralsByLine =
					groupArrayByLineNumber(templateLiterals);

				const regExpLiterals = getAllRegExpLiterals();
				const regExpLiteralsByLine = groupArrayByLineNumber(regExpLiterals);

				lines.forEach((line, i) => {
					// i is zero-indexed, line numbers are one-indexed
					const lineNumber = i + 1;

					/*
					 * if we're checking comment length; we need to know whether this
					 * line is a comment
					 */
					let lineIsComment = false;
					let textToMeasure;

					/*
					 * We can short-circuit the comment checks if we're already out of
					 * comments to check.
					 */
					if (commentsIndex < comments.length) {
						let comment;

						// iterate over comments until we find one past the current line
						do {
							comment = comments[++commentsIndex];
						} while (comment && comment.loc.start.line <= lineNumber);

						// and step back by one
						comment = comments[--commentsIndex];

						if (isFullLineComment(line, lineNumber, comment)) {
							lineIsComment = true;
							textToMeasure = line;
						} else if (
							ignoreTrailingComments &&
							isTrailingComment(line, lineNumber, comment)
						) {
							textToMeasure = stripTrailingComment(line, comment);

							// ignore multiple trailing comments in the same line
							let lastIndex = commentsIndex;

							while (
								isTrailingComment(
									textToMeasure,
									lineNumber,
									comments[--lastIndex],
								)
							) {
								textToMeasure = stripTrailingComment(
									textToMeasure,
									comments[lastIndex],
								);
							}
						} else {
							textToMeasure = line;
						}
					} else {
						textToMeasure = line;
					}
					if (
						(ignorePattern && ignorePattern.test(textToMeasure)) ||
						(ignoreUrls && URL_REGEXP.test(textToMeasure)) ||
						(ignoreStrings && stringsByLine[lineNumber]) ||
						(ignoreTemplateLiterals &&
							templateLiteralsByLine[lineNumber]) ||
						(ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber])
					) {
						// ignore this line
						return;
					}

					const lineLength = computeLineLength(textToMeasure, tabWidth);
					const commentLengthApplies = lineIsComment && maxCommentLength;

					if (lineIsComment && ignoreComments) {
						return;
					}

					const loc = {
						start: {
							line: lineNumber,
							column: 0,
						},
						end: {
							line: lineNumber,
							column: textToMeasure.length,
						},
					};

					if (commentLengthApplies) {
						if (lineLength > maxCommentLength) {
							context.report({
								node,
								loc,
								messageId: "maxComment",
								data: {
									lineLength,
									maxCommentLength,
								},
							});
						}
					} else if (lineLength > maxLength) {
						context.report({
							node,
							loc,
							messageId: "max",
							data: {
								lineLength,
								maxLength,
							},
						});
					}
				});
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				Program: checkProgramForMaxLength,
			};
		},
	};
	return maxLen;
}

/**
 * @fileoverview enforce a maximum file length
 * @author Alberto Rodríguez
 */

var maxLines;
var hasRequiredMaxLines;

function requireMaxLines () {
	if (hasRequiredMaxLines) return maxLines;
	hasRequiredMaxLines = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Creates an array of numbers from `start` up to, but not including, `end`
	 * @param {number} start The start of the range
	 * @param {number} end The end of the range
	 * @returns {number[]} The range of numbers
	 */
	function range(start, end) {
		return [...Array(end - start).keys()].map(x => x + start);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxLines = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Enforce a maximum number of lines per file",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-lines",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								max: {
									type: "integer",
									minimum: 0,
								},
								skipComments: {
									type: "boolean",
								},
								skipBlankLines: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				exceed: "File has too many lines ({{actual}}). Maximum allowed is {{max}}.",
			},
		},

		create(context) {
			const option = context.options[0];
			let max = 300;

			if (typeof option === "object" && Object.hasOwn(option, "max")) {
				max = option.max;
			} else if (typeof option === "number") {
				max = option;
			}

			const skipComments = option && option.skipComments;
			const skipBlankLines = option && option.skipBlankLines;

			const sourceCode = context.sourceCode;

			/**
			 * Returns whether or not a token is a comment node type
			 * @param {Token} token The token to check
			 * @returns {boolean} True if the token is a comment node
			 */
			function isCommentNodeType(token) {
				return token && (token.type === "Block" || token.type === "Line");
			}

			/**
			 * Returns the line numbers of a comment that don't have any code on the same line
			 * @param {Node} comment The comment node to check
			 * @returns {number[]} The line numbers
			 */
			function getLinesWithoutCode(comment) {
				let start = comment.loc.start.line;
				let end = comment.loc.end.line;

				let token;

				token = comment;
				do {
					token = sourceCode.getTokenBefore(token, {
						includeComments: true,
					});
				} while (isCommentNodeType(token));

				if (token && astUtils.isTokenOnSameLine(token, comment)) {
					start += 1;
				}

				token = comment;
				do {
					token = sourceCode.getTokenAfter(token, {
						includeComments: true,
					});
				} while (isCommentNodeType(token));

				if (token && astUtils.isTokenOnSameLine(comment, token)) {
					end -= 1;
				}

				if (start <= end) {
					return range(start, end + 1);
				}
				return [];
			}

			return {
				"Program:exit"() {
					let lines = sourceCode.lines.map((text, i) => ({
						lineNumber: i + 1,
						text,
					}));

					/*
					 * If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end.
					 * That isn't a real line, so we shouldn't count it.
					 */
					if (lines.length > 1 && lines.at(-1).text === "") {
						lines.pop();
					}

					if (skipBlankLines) {
						lines = lines.filter(l => l.text.trim() !== "");
					}

					if (skipComments) {
						const comments = sourceCode.getAllComments();

						const commentLines = new Set(
							comments.flatMap(getLinesWithoutCode),
						);

						lines = lines.filter(l => !commentLines.has(l.lineNumber));
					}

					if (lines.length > max) {
						const loc = {
							start: {
								line: lines[max].lineNumber,
								column: 0,
							},
							end: {
								line: sourceCode.lines.length,
								column: sourceCode.lines.at(-1).length,
							},
						};

						context.report({
							loc,
							messageId: "exceed",
							data: {
								max,
								actual: lines.length,
							},
						});
					}
				},
			};
		},
	};
	return maxLines;
}

/**
 * @fileoverview A rule to set the maximum number of line of code in a function.
 * @author Pete Ward <peteward44@gmail.com>
 */

var maxLinesPerFunction;
var hasRequiredMaxLinesPerFunction;

function requireMaxLinesPerFunction () {
	if (hasRequiredMaxLinesPerFunction) return maxLinesPerFunction;
	hasRequiredMaxLinesPerFunction = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { upperCaseFirst } = requireStringUtils();

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const OPTIONS_SCHEMA = {
		type: "object",
		properties: {
			max: {
				type: "integer",
				minimum: 0,
			},
			skipComments: {
				type: "boolean",
			},
			skipBlankLines: {
				type: "boolean",
			},
			IIFEs: {
				type: "boolean",
			},
		},
		additionalProperties: false,
	};

	const OPTIONS_OR_INTEGER_SCHEMA = {
		oneOf: [
			OPTIONS_SCHEMA,
			{
				type: "integer",
				minimum: 1,
			},
		],
	};

	/**
	 * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values.
	 * @param {Array} comments An array of comment nodes.
	 * @returns {Map<string, Node>} A map with numeric keys (source code line numbers) and comment token values.
	 */
	function getCommentLineNumbers(comments) {
		const map = new Map();

		comments.forEach(comment => {
			for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) {
				map.set(i, comment);
			}
		});
		return map;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxLinesPerFunction = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce a maximum number of lines of code in a function",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-lines-per-function",
			},

			schema: [OPTIONS_OR_INTEGER_SCHEMA],
			messages: {
				exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const lines = sourceCode.lines;

			const option = context.options[0];
			let maxLines = 50;
			let skipComments = false;
			let skipBlankLines = false;
			let IIFEs = false;

			if (typeof option === "object") {
				maxLines = typeof option.max === "number" ? option.max : 50;
				skipComments = !!option.skipComments;
				skipBlankLines = !!option.skipBlankLines;
				IIFEs = !!option.IIFEs;
			} else if (typeof option === "number") {
				maxLines = option;
			}

			const commentLineNumbers = getCommentLineNumbers(
				sourceCode.getAllComments(),
			);

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Tells if a comment encompasses the entire line.
			 * @param {string} line The source line with a trailing comment
			 * @param {number} lineNumber The one-indexed line number this is on
			 * @param {ASTNode} comment The comment to remove
			 * @returns {boolean} If the comment covers the entire line
			 */
			function isFullLineComment(line, lineNumber, comment) {
				const start = comment.loc.start,
					end = comment.loc.end,
					isFirstTokenOnLine =
						start.line === lineNumber &&
						!line.slice(0, start.column).trim(),
					isLastTokenOnLine =
						end.line === lineNumber && !line.slice(end.column).trim();

				return (
					comment &&
					(start.line < lineNumber || isFirstTokenOnLine) &&
					(end.line > lineNumber || isLastTokenOnLine)
				);
			}

			/**
			 * Identifies is a node is a FunctionExpression which is part of an IIFE
			 * @param {ASTNode} node Node to test
			 * @returns {boolean} True if it's an IIFE
			 */
			function isIIFE(node) {
				return (
					(node.type === "FunctionExpression" ||
						node.type === "ArrowFunctionExpression") &&
					node.parent &&
					node.parent.type === "CallExpression" &&
					node.parent.callee === node
				);
			}

			/**
			 * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property
			 * @param {ASTNode} node Node to test
			 * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property
			 */
			function isEmbedded(node) {
				if (!node.parent) {
					return false;
				}
				if (node !== node.parent.value) {
					return false;
				}
				if (node.parent.type === "MethodDefinition") {
					return true;
				}
				if (node.parent.type === "Property") {
					return (
						node.parent.method === true ||
						node.parent.kind === "get" ||
						node.parent.kind === "set"
					);
				}
				return false;
			}

			/**
			 * Count the lines in the function
			 * @param {ASTNode} funcNode Function AST node
			 * @returns {void}
			 * @private
			 */
			function processFunction(funcNode) {
				const node = isEmbedded(funcNode) ? funcNode.parent : funcNode;

				if (!IIFEs && isIIFE(node)) {
					return;
				}
				let lineCount = 0;

				for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
					const line = lines[i];

					if (skipComments) {
						if (
							commentLineNumbers.has(i + 1) &&
							isFullLineComment(
								line,
								i + 1,
								commentLineNumbers.get(i + 1),
							)
						) {
							continue;
						}
					}

					if (skipBlankLines) {
						if (line.match(/^\s*$/u)) {
							continue;
						}
					}

					lineCount++;
				}

				if (lineCount > maxLines) {
					const name = upperCaseFirst(
						astUtils.getFunctionNameWithKind(funcNode),
					);

					context.report({
						node,
						messageId: "exceed",
						data: { name, lineCount, maxLines },
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				FunctionDeclaration: processFunction,
				FunctionExpression: processFunction,
				ArrowFunctionExpression: processFunction,
			};
		},
	};
	return maxLinesPerFunction;
}

/**
 * @fileoverview Rule to enforce a maximum number of nested callbacks.
 * @author Ian Christian Myers
 */

var maxNestedCallbacks;
var hasRequiredMaxNestedCallbacks;

function requireMaxNestedCallbacks () {
	if (hasRequiredMaxNestedCallbacks) return maxNestedCallbacks;
	hasRequiredMaxNestedCallbacks = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxNestedCallbacks = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Enforce a maximum depth that callbacks can be nested",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-nested-callbacks",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								maximum: {
									type: "integer",
									minimum: 0,
								},
								max: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Constants
			//--------------------------------------------------------------------------
			const option = context.options[0];
			let THRESHOLD = 10;

			if (
				typeof option === "object" &&
				(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
			) {
				THRESHOLD = option.maximum || option.max;
			} else if (typeof option === "number") {
				THRESHOLD = option;
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const callbackStack = [];

			/**
			 * Checks a given function node for too many callbacks.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 * @private
			 */
			function checkFunction(node) {
				const parent = node.parent;

				if (parent.type === "CallExpression") {
					callbackStack.push(node);
				}

				if (callbackStack.length > THRESHOLD) {
					const opts = { num: callbackStack.length, max: THRESHOLD };

					context.report({ node, messageId: "exceed", data: opts });
				}
			}

			/**
			 * Pops the call stack.
			 * @returns {void}
			 * @private
			 */
			function popStack() {
				callbackStack.pop();
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				ArrowFunctionExpression: checkFunction,
				"ArrowFunctionExpression:exit": popStack,

				FunctionExpression: checkFunction,
				"FunctionExpression:exit": popStack,
			};
		},
	};
	return maxNestedCallbacks;
}

/**
 * @fileoverview Rule to flag when a function has too many parameters
 * @author Ilya Volodin
 */

var maxParams;
var hasRequiredMaxParams;

function requireMaxParams () {
	if (hasRequiredMaxParams) return maxParams;
	hasRequiredMaxParams = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { upperCaseFirst } = requireStringUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxParams = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce a maximum number of parameters in function definitions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-params",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								maximum: {
									type: "integer",
									minimum: 0,
								},
								max: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const option = context.options[0];
			let numParams = 3;

			if (
				typeof option === "object" &&
				(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
			) {
				numParams = option.maximum || option.max;
			}
			if (typeof option === "number") {
				numParams = option;
			}

			/**
			 * Checks a function to see if it has too many parameters.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 * @private
			 */
			function checkFunction(node) {
				if (node.params.length > numParams) {
					context.report({
						loc: astUtils.getFunctionHeadLoc(node, sourceCode),
						node,
						messageId: "exceed",
						data: {
							name: upperCaseFirst(
								astUtils.getFunctionNameWithKind(node),
							),
							count: node.params.length,
							max: numParams,
						},
					});
				}
			}

			return {
				FunctionDeclaration: checkFunction,
				ArrowFunctionExpression: checkFunction,
				FunctionExpression: checkFunction,
			};
		},
	};
	return maxParams;
}

/**
 * @fileoverview A rule to set the maximum number of statements in a function.
 * @author Ian Christian Myers
 */

var maxStatements;
var hasRequiredMaxStatements;

function requireMaxStatements () {
	if (hasRequiredMaxStatements) return maxStatements;
	hasRequiredMaxStatements = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { upperCaseFirst } = requireStringUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxStatements = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce a maximum number of statements allowed in function blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-statements",
			},

			schema: [
				{
					oneOf: [
						{
							type: "integer",
							minimum: 0,
						},
						{
							type: "object",
							properties: {
								maximum: {
									type: "integer",
									minimum: 0,
								},
								max: {
									type: "integer",
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
				{
					type: "object",
					properties: {
						ignoreTopLevelFunctions: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const functionStack = [],
				option = context.options[0],
				ignoreTopLevelFunctions =
					(context.options[1] &&
						context.options[1].ignoreTopLevelFunctions) ||
					false,
				topLevelFunctions = [];
			let maxStatements = 10;

			if (
				typeof option === "object" &&
				(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
			) {
				maxStatements = option.maximum || option.max;
			} else if (typeof option === "number") {
				maxStatements = option;
			}

			/**
			 * Reports a node if it has too many statements
			 * @param {ASTNode} node node to evaluate
			 * @param {int} count Number of statements in node
			 * @param {int} max Maximum number of statements allowed
			 * @returns {void}
			 * @private
			 */
			function reportIfTooManyStatements(node, count, max) {
				if (count > max) {
					const name = upperCaseFirst(
						astUtils.getFunctionNameWithKind(node),
					);

					context.report({
						node,
						messageId: "exceed",
						data: { name, count, max },
					});
				}
			}

			/**
			 * When parsing a new function, store it in our function stack
			 * @returns {void}
			 * @private
			 */
			function startFunction() {
				functionStack.push(0);
			}

			/**
			 * Evaluate the node at the end of function
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function endFunction(node) {
				const count = functionStack.pop();

				/*
				 * This rule does not apply to class static blocks, but we have to track them so
				 * that statements in them do not count as statements in the enclosing function.
				 */
				if (node.type === "StaticBlock") {
					return;
				}

				if (ignoreTopLevelFunctions && functionStack.length === 0) {
					topLevelFunctions.push({ node, count });
				} else {
					reportIfTooManyStatements(node, count, maxStatements);
				}
			}

			/**
			 * Increment the count of the functions
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function countStatements(node) {
				functionStack[functionStack.length - 1] += node.body.length;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				FunctionDeclaration: startFunction,
				FunctionExpression: startFunction,
				ArrowFunctionExpression: startFunction,
				StaticBlock: startFunction,

				BlockStatement: countStatements,

				"FunctionDeclaration:exit": endFunction,
				"FunctionExpression:exit": endFunction,
				"ArrowFunctionExpression:exit": endFunction,
				"StaticBlock:exit": endFunction,

				"Program:exit"() {
					if (topLevelFunctions.length === 1) {
						return;
					}

					topLevelFunctions.forEach(element => {
						const count = element.count;
						const node = element.node;

						reportIfTooManyStatements(node, count, maxStatements);
					});
				},
			};
		},
	};
	return maxStatements;
}

/**
 * @fileoverview Specify the maximum number of statements allowed per line.
 * @author Kenneth Williams
 * @deprecated in ESLint v8.53.0
 */

var maxStatementsPerLine;
var hasRequiredMaxStatementsPerLine;

function requireMaxStatementsPerLine () {
	if (hasRequiredMaxStatementsPerLine) return maxStatementsPerLine;
	hasRequiredMaxStatementsPerLine = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	maxStatementsPerLine = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "max-statements-per-line",
							url: "https://eslint.style/rules/js/max-statements-per-line",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce a maximum number of statements allowed per line",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/max-statements-per-line",
			},

			schema: [
				{
					type: "object",
					properties: {
						max: {
							type: "integer",
							minimum: 1,
							default: 1,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode,
				options = context.options[0] || {},
				maxStatementsPerLine =
					typeof options.max !== "undefined" ? options.max : 1;

			let lastStatementLine = 0,
				numberOfStatementsOnThisLine = 0,
				firstExtraStatement;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const SINGLE_CHILD_ALLOWED =
				/^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u;

			/**
			 * Reports with the first extra statement, and clears it.
			 * @returns {void}
			 */
			function reportFirstExtraStatementAndClear() {
				if (firstExtraStatement) {
					context.report({
						node: firstExtraStatement,
						messageId: "exceed",
						data: {
							numberOfStatementsOnThisLine,
							maxStatementsPerLine,
							statements:
								numberOfStatementsOnThisLine === 1
									? "statement"
									: "statements",
						},
					});
				}
				firstExtraStatement = null;
			}

			/**
			 * Gets the actual last token of a given node.
			 * @param {ASTNode} node A node to get. This is a node except EmptyStatement.
			 * @returns {Token} The actual last token.
			 */
			function getActualLastToken(node) {
				return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken);
			}

			/**
			 * Addresses a given node.
			 * It updates the state of this rule, then reports the node if the node violated this rule.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function enterStatement(node) {
				const line = node.loc.start.line;

				/*
				 * Skip to allow non-block statements if this is direct child of control statements.
				 * `if (a) foo();` is counted as 1.
				 * But `if (a) foo(); else foo();` should be counted as 2.
				 */
				if (
					SINGLE_CHILD_ALLOWED.test(node.parent.type) &&
					node.parent.alternate !== node
				) {
					return;
				}

				// Update state.
				if (line === lastStatementLine) {
					numberOfStatementsOnThisLine += 1;
				} else {
					reportFirstExtraStatementAndClear();
					numberOfStatementsOnThisLine = 1;
					lastStatementLine = line;
				}

				// Reports if the node violated this rule.
				if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) {
					firstExtraStatement = firstExtraStatement || node;
				}
			}

			/**
			 * Updates the state of this rule with the end line of leaving node to check with the next statement.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function leaveStatement(node) {
				const line = getActualLastToken(node).loc.end.line;

				// Update state.
				if (line !== lastStatementLine) {
					reportFirstExtraStatementAndClear();
					numberOfStatementsOnThisLine = 1;
					lastStatementLine = line;
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				BreakStatement: enterStatement,
				ClassDeclaration: enterStatement,
				ContinueStatement: enterStatement,
				DebuggerStatement: enterStatement,
				DoWhileStatement: enterStatement,
				ExpressionStatement: enterStatement,
				ForInStatement: enterStatement,
				ForOfStatement: enterStatement,
				ForStatement: enterStatement,
				FunctionDeclaration: enterStatement,
				IfStatement: enterStatement,
				ImportDeclaration: enterStatement,
				LabeledStatement: enterStatement,
				ReturnStatement: enterStatement,
				SwitchStatement: enterStatement,
				ThrowStatement: enterStatement,
				TryStatement: enterStatement,
				VariableDeclaration: enterStatement,
				WhileStatement: enterStatement,
				WithStatement: enterStatement,
				ExportNamedDeclaration: enterStatement,
				ExportDefaultDeclaration: enterStatement,
				ExportAllDeclaration: enterStatement,

				"BreakStatement:exit": leaveStatement,
				"ClassDeclaration:exit": leaveStatement,
				"ContinueStatement:exit": leaveStatement,
				"DebuggerStatement:exit": leaveStatement,
				"DoWhileStatement:exit": leaveStatement,
				"ExpressionStatement:exit": leaveStatement,
				"ForInStatement:exit": leaveStatement,
				"ForOfStatement:exit": leaveStatement,
				"ForStatement:exit": leaveStatement,
				"FunctionDeclaration:exit": leaveStatement,
				"IfStatement:exit": leaveStatement,
				"ImportDeclaration:exit": leaveStatement,
				"LabeledStatement:exit": leaveStatement,
				"ReturnStatement:exit": leaveStatement,
				"SwitchStatement:exit": leaveStatement,
				"ThrowStatement:exit": leaveStatement,
				"TryStatement:exit": leaveStatement,
				"VariableDeclaration:exit": leaveStatement,
				"WhileStatement:exit": leaveStatement,
				"WithStatement:exit": leaveStatement,
				"ExportNamedDeclaration:exit": leaveStatement,
				"ExportDefaultDeclaration:exit": leaveStatement,
				"ExportAllDeclaration:exit": leaveStatement,
				"Program:exit": reportFirstExtraStatementAndClear,
			};
		},
	};
	return maxStatementsPerLine;
}

/**
 * @fileoverview enforce a particular style for multiline comments
 * @author Teddy Katz
 * @deprecated in ESLint v9.3.0
 */

var multilineCommentStyle;
var hasRequiredMultilineCommentStyle;

function requireMultilineCommentStyle () {
	if (hasRequiredMultilineCommentStyle) return multilineCommentStyle;
	hasRequiredMultilineCommentStyle = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	multilineCommentStyle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "9.3.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "multiline-comment-style",
							url: "https://eslint.style/rules/js/multiline-comment-style",
						},
					},
				],
			},
			type: "suggestion",
			docs: {
				description: "Enforce a particular style for multiline comments",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/multiline-comment-style",
			},

			fixable: "whitespace",
			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["starred-block", "bare-block"],
							},
						],
						additionalItems: false,
					},
					{
						type: "array",
						items: [
							{
								enum: ["separate-lines"],
							},
							{
								type: "object",
								properties: {
									checkJSDoc: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						additionalItems: false,
					},
				],
			},
			messages: {
				expectedBlock:
					"Expected a block comment instead of consecutive line comments.",
				expectedBareBlock:
					"Expected a block comment without padding stars.",
				startNewline: "Expected a linebreak after '/*'.",
				endNewline: "Expected a linebreak before '*/'.",
				missingStar: "Expected a '*' at the start of this line.",
				alignment:
					"Expected this line to be aligned with the start of the comment.",
				expectedLines:
					"Expected multiple line comments instead of a block comment.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const option = context.options[0] || "starred-block";
			const params = context.options[1] || {};
			const checkJSDoc = !!params.checkJSDoc;

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Checks if a comment line is starred.
			 * @param {string} line A string representing a comment line.
			 * @returns {boolean} Whether or not the comment line is starred.
			 */
			function isStarredCommentLine(line) {
				return /^\s*\*/u.test(line);
			}

			/**
			 * Checks if a comment group is in starred-block form.
			 * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment.
			 * @returns {boolean} Whether or not the comment group is in starred block form.
			 */
			function isStarredBlockComment([firstComment]) {
				if (firstComment.type !== "Block") {
					return false;
				}

				const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER);

				// The first and last lines can only contain whitespace.
				return (
					lines.length > 0 &&
					lines.every((line, i) =>
						(i === 0 || i === lines.length - 1
							? /^\s*$/u
							: /^\s*\*/u
						).test(line),
					)
				);
			}

			/**
			 * Checks if a comment group is in JSDoc form.
			 * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment.
			 * @returns {boolean} Whether or not the comment group is in JSDoc form.
			 */
			function isJSDocComment([firstComment]) {
				if (firstComment.type !== "Block") {
					return false;
				}

				const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER);

				return (
					/^\*\s*$/u.test(lines[0]) &&
					lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
					/^\s*$/u.test(lines.at(-1))
				);
			}

			/**
			 * Processes a comment group that is currently in separate-line form, calculating the offset for each line.
			 * @param {Token[]} commentGroup A group of comments containing multiple line comments.
			 * @returns {string[]} An array of the processed lines.
			 */
			function processSeparateLineComments(commentGroup) {
				const allLinesHaveLeadingSpace = commentGroup
					.map(({ value }) => value)
					.filter(line => line.trim().length)
					.every(line => line.startsWith(" "));

				return commentGroup.map(({ value }) =>
					allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value,
				);
			}

			/**
			 * Processes a comment group that is currently in starred-block form, calculating the offset for each line.
			 * @param {Token} comment A single block comment token in starred-block form.
			 * @returns {string[]} An array of the processed lines.
			 */
			function processStarredBlockComment(comment) {
				const lines = comment.value
					.split(astUtils.LINEBREAK_MATCHER)
					.filter(
						(line, i, linesArr) =>
							!(i === 0 || i === linesArr.length - 1),
					)
					.map(line => line.replace(/^\s*$/u, ""));
				const allLinesHaveLeadingSpace = lines
					.map(line => line.replace(/\s*\*/u, ""))
					.filter(line => line.trim().length)
					.every(line => line.startsWith(" "));

				return lines.map(line =>
					line.replace(
						allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u,
						"",
					),
				);
			}

			/**
			 * Processes a comment group that is currently in bare-block form, calculating the offset for each line.
			 * @param {Token} comment A single block comment token in bare-block form.
			 * @returns {string[]} An array of the processed lines.
			 */
			function processBareBlockComment(comment) {
				const lines = comment.value
					.split(astUtils.LINEBREAK_MATCHER)
					.map(line => line.replace(/^\s*$/u, ""));
				const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])}   `;
				let offset = "";

				/*
				 * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines.
				 * The first line should not be checked because it is inline with the opening block comment delimiter.
				 */
				for (const [i, line] of lines.entries()) {
					if (!line.trim().length || i === 0) {
						continue;
					}

					const [, lineOffset] = line.match(/^(\s*\*?\s*)/u);

					if (lineOffset.length < leadingWhitespace.length) {
						const newOffset = leadingWhitespace.slice(
							lineOffset.length - leadingWhitespace.length,
						);

						if (newOffset.length > offset.length) {
							offset = newOffset;
						}
					}
				}

				return lines.map(line => {
					const match = line.match(/^(\s*\*?\s*)(.*)/u);
					const [, lineOffset, lineContents] = match;

					if (lineOffset.length > leadingWhitespace.length) {
						return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`;
					}

					if (lineOffset.length < leadingWhitespace.length) {
						return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`;
					}

					return lineContents;
				});
			}

			/**
			 * Gets a list of comment lines in a group, formatting leading whitespace as necessary.
			 * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment.
			 * @returns {string[]} A list of comment lines.
			 */
			function getCommentLines(commentGroup) {
				const [firstComment] = commentGroup;

				if (firstComment.type === "Line") {
					return processSeparateLineComments(commentGroup);
				}

				if (isStarredBlockComment(commentGroup)) {
					return processStarredBlockComment(firstComment);
				}

				return processBareBlockComment(firstComment);
			}

			/**
			 * Gets the initial offset (whitespace) from the beginning of a line to a given comment token.
			 * @param {Token} comment The token to check.
			 * @returns {string} The offset from the beginning of a line to the token.
			 */
			function getInitialOffset(comment) {
				return sourceCode.text.slice(
					comment.range[0] - comment.loc.start.column,
					comment.range[0],
				);
			}

			/**
			 * Converts a comment into starred-block form
			 * @param {Token} firstComment The first comment of the group being converted
			 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
			 * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers
			 */
			function convertToStarredBlock(firstComment, commentLinesList) {
				const initialOffset = getInitialOffset(firstComment);

				return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`;
			}

			/**
			 * Converts a comment into separate-line form
			 * @param {Token} firstComment The first comment of the group being converted
			 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
			 * @returns {string} A representation of the comment value in separate-line form
			 */
			function convertToSeparateLines(firstComment, commentLinesList) {
				return commentLinesList
					.map(line => `// ${line}`)
					.join(`\n${getInitialOffset(firstComment)}`);
			}

			/**
			 * Converts a comment into bare-block form
			 * @param {Token} firstComment The first comment of the group being converted
			 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
			 * @returns {string} A representation of the comment value in bare-block form
			 */
			function convertToBlock(firstComment, commentLinesList) {
				return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)}   `)} */`;
			}

			/**
			 * Each method checks a group of comments to see if it's valid according to the given option.
			 * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single
			 * block comment or multiple line comments.
			 * @returns {void}
			 */
			const commentGroupCheckers = {
				"starred-block"(commentGroup) {
					const [firstComment] = commentGroup;
					const commentLines = getCommentLines(commentGroup);

					if (commentLines.some(value => value.includes("*/"))) {
						return;
					}

					if (commentGroup.length > 1) {
						context.report({
							loc: {
								start: firstComment.loc.start,
								end: commentGroup.at(-1).loc.end,
							},
							messageId: "expectedBlock",
							fix(fixer) {
								const range = [
									firstComment.range[0],
									commentGroup.at(-1).range[1],
								];

								return commentLines.some(value =>
									value.startsWith("/"),
								)
									? null
									: fixer.replaceTextRange(
											range,
											convertToStarredBlock(
												firstComment,
												commentLines,
											),
										);
							},
						});
					} else {
						const lines = firstComment.value.split(
							astUtils.LINEBREAK_MATCHER,
						);
						const expectedLeadingWhitespace =
							getInitialOffset(firstComment);
						const expectedLinePrefix = `${expectedLeadingWhitespace} *`;

						if (!/^\*?\s*$/u.test(lines[0])) {
							const start = firstComment.value.startsWith("*")
								? firstComment.range[0] + 1
								: firstComment.range[0];

							context.report({
								loc: {
									start: firstComment.loc.start,
									end: {
										line: firstComment.loc.start.line,
										column: firstComment.loc.start.column + 2,
									},
								},
								messageId: "startNewline",
								fix: fixer =>
									fixer.insertTextAfterRange(
										[start, start + 2],
										`\n${expectedLinePrefix}`,
									),
							});
						}

						if (!/^\s*$/u.test(lines.at(-1))) {
							context.report({
								loc: {
									start: {
										line: firstComment.loc.end.line,
										column: firstComment.loc.end.column - 2,
									},
									end: firstComment.loc.end,
								},
								messageId: "endNewline",
								fix: fixer =>
									fixer.replaceTextRange(
										[
											firstComment.range[1] - 2,
											firstComment.range[1],
										],
										`\n${expectedLinePrefix}/`,
									),
							});
						}

						for (
							let lineNumber = firstComment.loc.start.line + 1;
							lineNumber <= firstComment.loc.end.line;
							lineNumber++
						) {
							const lineText = sourceCode.lines[lineNumber - 1];
							const errorType = isStarredCommentLine(lineText)
								? "alignment"
								: "missingStar";

							if (!lineText.startsWith(expectedLinePrefix)) {
								context.report({
									loc: {
										start: { line: lineNumber, column: 0 },
										end: {
											line: lineNumber,
											column: lineText.length,
										},
									},
									messageId: errorType,
									fix(fixer) {
										const lineStartIndex =
											sourceCode.getIndexFromLoc({
												line: lineNumber,
												column: 0,
											});

										if (errorType === "alignment") {
											const [, commentTextPrefix = ""] =
												lineText.match(/^(\s*\*)/u) || [];
											const commentTextStartIndex =
												lineStartIndex +
												commentTextPrefix.length;

											return fixer.replaceTextRange(
												[
													lineStartIndex,
													commentTextStartIndex,
												],
												expectedLinePrefix,
											);
										}

										const [, commentTextPrefix = ""] =
											lineText.match(/^(\s*)/u) || [];
										const commentTextStartIndex =
											lineStartIndex +
											commentTextPrefix.length;
										let offset;

										for (const [idx, line] of lines.entries()) {
											if (!/\S+/u.test(line)) {
												continue;
											}

											const lineTextToAlignWith =
												sourceCode.lines[
													firstComment.loc.start.line -
														1 +
														idx
												];
											const [
												,
												prefix = "",
												initialOffset = "",
											] =
												lineTextToAlignWith.match(
													/^(\s*(?:\/?\*)?(\s*))/u,
												) || [];

											offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`;

											if (
												/^\s*\//u.test(lineText) &&
												offset.length === 0
											) {
												offset += " ";
											}
											break;
										}

										return fixer.replaceTextRange(
											[lineStartIndex, commentTextStartIndex],
											`${expectedLinePrefix}${offset}`,
										);
									},
								});
							}
						}
					}
				},
				"separate-lines"(commentGroup) {
					const [firstComment] = commentGroup;

					const isJSDoc = isJSDocComment(commentGroup);

					if (firstComment.type !== "Block" || (!checkJSDoc && isJSDoc)) {
						return;
					}

					let commentLines = getCommentLines(commentGroup);

					if (isJSDoc) {
						commentLines = commentLines.slice(
							1,
							commentLines.length - 1,
						);
					}

					const tokenAfter = sourceCode.getTokenAfter(firstComment, {
						includeComments: true,
					});

					if (
						tokenAfter &&
						firstComment.loc.end.line === tokenAfter.loc.start.line
					) {
						return;
					}

					context.report({
						loc: {
							start: firstComment.loc.start,
							end: {
								line: firstComment.loc.start.line,
								column: firstComment.loc.start.column + 2,
							},
						},
						messageId: "expectedLines",
						fix(fixer) {
							return fixer.replaceText(
								firstComment,
								convertToSeparateLines(firstComment, commentLines),
							);
						},
					});
				},
				"bare-block"(commentGroup) {
					if (isJSDocComment(commentGroup)) {
						return;
					}

					const [firstComment] = commentGroup;
					const commentLines = getCommentLines(commentGroup);

					// Disallows consecutive line comments in favor of using a block comment.
					if (
						firstComment.type === "Line" &&
						commentLines.length > 1 &&
						!commentLines.some(value => value.includes("*/"))
					) {
						context.report({
							loc: {
								start: firstComment.loc.start,
								end: commentGroup.at(-1).loc.end,
							},
							messageId: "expectedBlock",
							fix(fixer) {
								return fixer.replaceTextRange(
									[
										firstComment.range[0],
										commentGroup.at(-1).range[1],
									],
									convertToBlock(firstComment, commentLines),
								);
							},
						});
					}

					// Prohibits block comments from having a * at the beginning of each line.
					if (isStarredBlockComment(commentGroup)) {
						context.report({
							loc: {
								start: firstComment.loc.start,
								end: {
									line: firstComment.loc.start.line,
									column: firstComment.loc.start.column + 2,
								},
							},
							messageId: "expectedBareBlock",
							fix(fixer) {
								return fixer.replaceText(
									firstComment,
									convertToBlock(firstComment, commentLines),
								);
							},
						});
					}
				},
			};

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				Program() {
					return sourceCode
						.getAllComments()
						.filter(comment => comment.type !== "Shebang")
						.filter(
							comment =>
								!astUtils.COMMENTS_IGNORE_PATTERN.test(
									comment.value,
								),
						)
						.filter(comment => {
							const tokenBefore = sourceCode.getTokenBefore(comment, {
								includeComments: true,
							});

							return (
								!tokenBefore ||
								tokenBefore.loc.end.line < comment.loc.start.line
							);
						})
						.reduce((commentGroups, comment, index, commentList) => {
							const tokenBefore = sourceCode.getTokenBefore(comment, {
								includeComments: true,
							});

							if (
								comment.type === "Line" &&
								index &&
								commentList[index - 1].type === "Line" &&
								tokenBefore &&
								tokenBefore.loc.end.line ===
									comment.loc.start.line - 1 &&
								tokenBefore === commentList[index - 1]
							) {
								commentGroups.at(-1).push(comment);
							} else {
								commentGroups.push([comment]);
							}

							return commentGroups;
						}, [])
						.filter(
							commentGroup =>
								!(
									commentGroup.length === 1 &&
									commentGroup[0].loc.start.line ===
										commentGroup[0].loc.end.line
								),
						)
						.forEach(commentGroupCheckers[option]);
				},
			};
		},
	};
	return multilineCommentStyle;
}

/**
 * @fileoverview Enforce newlines between operands of ternary expressions
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */

var multilineTernary;
var hasRequiredMultilineTernary;

function requireMultilineTernary () {
	if (hasRequiredMultilineTernary) return multilineTernary;
	hasRequiredMultilineTernary = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	multilineTernary = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "multiline-ternary",
							url: "https://eslint.style/rules/js/multiline-ternary",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce newlines between operands of ternary expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/multiline-ternary",
			},

			schema: [
				{
					enum: ["always", "always-multiline", "never"],
				},
			],

			messages: {
				expectedTestCons:
					"Expected newline between test and consequent of ternary expression.",
				expectedConsAlt:
					"Expected newline between consequent and alternate of ternary expression.",
				unexpectedTestCons:
					"Unexpected newline between test and consequent of ternary expression.",
				unexpectedConsAlt:
					"Unexpected newline between consequent and alternate of ternary expression.",
			},

			fixable: "whitespace",
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const option = context.options[0];
			const multiline = option !== "never";
			const allowSingleLine = option === "always-multiline";

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ConditionalExpression(node) {
					const questionToken = sourceCode.getTokenAfter(
						node.test,
						astUtils.isNotClosingParenToken,
					);
					const colonToken = sourceCode.getTokenAfter(
						node.consequent,
						astUtils.isNotClosingParenToken,
					);

					const firstTokenOfTest = sourceCode.getFirstToken(node);
					const lastTokenOfTest =
						sourceCode.getTokenBefore(questionToken);
					const firstTokenOfConsequent =
						sourceCode.getTokenAfter(questionToken);
					const lastTokenOfConsequent =
						sourceCode.getTokenBefore(colonToken);
					const firstTokenOfAlternate =
						sourceCode.getTokenAfter(colonToken);

					const areTestAndConsequentOnSameLine =
						astUtils.isTokenOnSameLine(
							lastTokenOfTest,
							firstTokenOfConsequent,
						);
					const areConsequentAndAlternateOnSameLine =
						astUtils.isTokenOnSameLine(
							lastTokenOfConsequent,
							firstTokenOfAlternate,
						);

					const hasComments = !!sourceCode.getCommentsInside(node).length;

					if (!multiline) {
						if (!areTestAndConsequentOnSameLine) {
							context.report({
								node: node.test,
								loc: {
									start: firstTokenOfTest.loc.start,
									end: lastTokenOfTest.loc.end,
								},
								messageId: "unexpectedTestCons",
								fix(fixer) {
									if (hasComments) {
										return null;
									}
									const fixers = [];
									const areTestAndQuestionOnSameLine =
										astUtils.isTokenOnSameLine(
											lastTokenOfTest,
											questionToken,
										);
									const areQuestionAndConsOnSameLine =
										astUtils.isTokenOnSameLine(
											questionToken,
											firstTokenOfConsequent,
										);

									if (!areTestAndQuestionOnSameLine) {
										fixers.push(
											fixer.removeRange([
												lastTokenOfTest.range[1],
												questionToken.range[0],
											]),
										);
									}
									if (!areQuestionAndConsOnSameLine) {
										fixers.push(
											fixer.removeRange([
												questionToken.range[1],
												firstTokenOfConsequent.range[0],
											]),
										);
									}

									return fixers;
								},
							});
						}

						if (!areConsequentAndAlternateOnSameLine) {
							context.report({
								node: node.consequent,
								loc: {
									start: firstTokenOfConsequent.loc.start,
									end: lastTokenOfConsequent.loc.end,
								},
								messageId: "unexpectedConsAlt",
								fix(fixer) {
									if (hasComments) {
										return null;
									}
									const fixers = [];
									const areConsAndColonOnSameLine =
										astUtils.isTokenOnSameLine(
											lastTokenOfConsequent,
											colonToken,
										);
									const areColonAndAltOnSameLine =
										astUtils.isTokenOnSameLine(
											colonToken,
											firstTokenOfAlternate,
										);

									if (!areConsAndColonOnSameLine) {
										fixers.push(
											fixer.removeRange([
												lastTokenOfConsequent.range[1],
												colonToken.range[0],
											]),
										);
									}
									if (!areColonAndAltOnSameLine) {
										fixers.push(
											fixer.removeRange([
												colonToken.range[1],
												firstTokenOfAlternate.range[0],
											]),
										);
									}

									return fixers;
								},
							});
						}
					} else {
						if (
							allowSingleLine &&
							node.loc.start.line === node.loc.end.line
						) {
							return;
						}

						if (areTestAndConsequentOnSameLine) {
							context.report({
								node: node.test,
								loc: {
									start: firstTokenOfTest.loc.start,
									end: lastTokenOfTest.loc.end,
								},
								messageId: "expectedTestCons",
								fix: fixer =>
									hasComments
										? null
										: fixer.replaceTextRange(
												[
													lastTokenOfTest.range[1],
													questionToken.range[0],
												],
												"\n",
											),
							});
						}

						if (areConsequentAndAlternateOnSameLine) {
							context.report({
								node: node.consequent,
								loc: {
									start: firstTokenOfConsequent.loc.start,
									end: lastTokenOfConsequent.loc.end,
								},
								messageId: "expectedConsAlt",
								fix: fixer =>
									hasComments
										? null
										: fixer.replaceTextRange(
												[
													lastTokenOfConsequent.range[1],
													colonToken.range[0],
												],
												"\n",
											),
							});
						}
					}
				},
			};
		},
	};
	return multilineTernary;
}

/**
 * @fileoverview Rule to flag use of constructors without capital letters
 * @author Nicholas C. Zakas
 */

var newCap;
var hasRequiredNewCap;

function requireNewCap () {
	if (hasRequiredNewCap) return newCap;
	hasRequiredNewCap = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const CAPS_ALLOWED = [
		"Array",
		"Boolean",
		"Date",
		"Error",
		"Function",
		"Number",
		"Object",
		"RegExp",
		"String",
		"Symbol",
		"BigInt",
	];

	/**
	 * A reducer function to invert an array to an Object mapping the string form of the key, to `true`.
	 * @param {Object} map Accumulator object for the reduce.
	 * @param {string} key Object key to set to `true`.
	 * @returns {Object} Returns the updated Object for further reduction.
	 */
	function invert(map, key) {
		map[key] = true;
		return map;
	}

	/**
	 * Creates an object with the cap is new exceptions as its keys and true as their values.
	 * @param {Object} config Rule configuration
	 * @returns {Object} Object with cap is new exceptions.
	 */
	function calculateCapIsNewExceptions(config) {
		const capIsNewExceptions = Array.from(
			new Set([...config.capIsNewExceptions, ...CAPS_ALLOWED]),
		);

		return capIsNewExceptions.reduce(invert, {});
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	newCap = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require constructor names to begin with a capital letter",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/new-cap",
			},

			schema: [
				{
					type: "object",
					properties: {
						newIsCap: {
							type: "boolean",
						},
						capIsNew: {
							type: "boolean",
						},
						newIsCapExceptions: {
							type: "array",
							items: {
								type: "string",
							},
						},
						newIsCapExceptionPattern: {
							type: "string",
						},
						capIsNewExceptions: {
							type: "array",
							items: {
								type: "string",
							},
						},
						capIsNewExceptionPattern: {
							type: "string",
						},
						properties: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [
				{
					capIsNew: true,
					capIsNewExceptions: CAPS_ALLOWED,
					newIsCap: true,
					newIsCapExceptions: [],
					properties: true,
				},
			],

			messages: {
				upper: "A function with a name starting with an uppercase letter should only be used as a constructor.",
				lower: "A constructor name should not start with a lowercase letter.",
			},
		},

		create(context) {
			const [config] = context.options;
			const skipProperties = !config.properties;

			const newIsCapExceptions = config.newIsCapExceptions.reduce(invert, {});
			const newIsCapExceptionPattern = config.newIsCapExceptionPattern
				? new RegExp(config.newIsCapExceptionPattern, "u")
				: null;

			const capIsNewExceptions = calculateCapIsNewExceptions(config);
			const capIsNewExceptionPattern = config.capIsNewExceptionPattern
				? new RegExp(config.capIsNewExceptionPattern, "u")
				: null;

			const listeners = {};

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Get exact callee name from expression
			 * @param {ASTNode} node CallExpression or NewExpression node
			 * @returns {string} name
			 */
			function extractNameFromExpression(node) {
				return node.callee.type === "Identifier"
					? node.callee.name
					: astUtils.getStaticPropertyName(node.callee) || "";
			}

			/**
			 * Returns the capitalization state of the string -
			 * Whether the first character is uppercase, lowercase, or non-alphabetic
			 * @param {string} str String
			 * @returns {string} capitalization state: "non-alpha", "lower", or "upper"
			 */
			function getCap(str) {
				const firstChar = str.charAt(0);

				const firstCharLower = firstChar.toLowerCase();
				const firstCharUpper = firstChar.toUpperCase();

				if (firstCharLower === firstCharUpper) {
					// char has no uppercase variant, so it's non-alphabetic
					return "non-alpha";
				}
				if (firstChar === firstCharLower) {
					return "lower";
				}
				return "upper";
			}

			/**
			 * Check if capitalization is allowed for a CallExpression
			 * @param {Object} allowedMap Object mapping calleeName to a Boolean
			 * @param {ASTNode} node CallExpression node
			 * @param {string} calleeName Capitalized callee name from a CallExpression
			 * @param {Object} pattern RegExp object from options pattern
			 * @returns {boolean} Returns true if the callee may be capitalized
			 */
			function isCapAllowed(allowedMap, node, calleeName, pattern) {
				const sourceText = sourceCode.getText(node.callee);

				if (allowedMap[calleeName] || allowedMap[sourceText]) {
					return true;
				}

				if (pattern && pattern.test(sourceText)) {
					return true;
				}

				const callee = astUtils.skipChainExpression(node.callee);

				if (calleeName === "UTC" && callee.type === "MemberExpression") {
					// allow if callee is Date.UTC
					return (
						callee.object.type === "Identifier" &&
						callee.object.name === "Date"
					);
				}

				return skipProperties && callee.type === "MemberExpression";
			}

			/**
			 * Reports the given messageId for the given node. The location will be the start of the property or the callee.
			 * @param {ASTNode} node CallExpression or NewExpression node.
			 * @param {string} messageId The messageId to report.
			 * @returns {void}
			 */
			function report(node, messageId) {
				let callee = astUtils.skipChainExpression(node.callee);

				if (callee.type === "MemberExpression") {
					callee = callee.property;
				}

				context.report({ node, loc: callee.loc, messageId });
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			if (config.newIsCap) {
				listeners.NewExpression = function (node) {
					const constructorName = extractNameFromExpression(node);

					if (constructorName) {
						const capitalization = getCap(constructorName);
						const isAllowed =
							capitalization !== "lower" ||
							isCapAllowed(
								newIsCapExceptions,
								node,
								constructorName,
								newIsCapExceptionPattern,
							);

						if (!isAllowed) {
							report(node, "lower");
						}
					}
				};
			}

			if (config.capIsNew) {
				listeners.CallExpression = function (node) {
					const calleeName = extractNameFromExpression(node);

					if (calleeName) {
						const capitalization = getCap(calleeName);
						const isAllowed =
							capitalization !== "upper" ||
							isCapAllowed(
								capIsNewExceptions,
								node,
								calleeName,
								capIsNewExceptionPattern,
							);

						if (!isAllowed) {
							report(node, "upper");
						}
					}
				};
			}

			return listeners;
		},
	};
	return newCap;
}

/**
 * @fileoverview Rule to flag when using constructor without parentheses
 * @author Ilya Volodin
 * @deprecated in ESLint v8.53.0
 */

var newParens;
var hasRequiredNewParens;

function requireNewParens () {
	if (hasRequiredNewParens) return newParens;
	hasRequiredNewParens = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	newParens = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "new-parens",
							url: "https://eslint.style/rules/js/new-parens",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce or disallow parentheses when invoking a constructor with no arguments",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/new-parens",
			},

			fixable: "code",
			schema: [
				{
					enum: ["always", "never"],
				},
			],
			messages: {
				missing: "Missing '()' invoking a constructor.",
				unnecessary:
					"Unnecessary '()' invoking a constructor with no arguments.",
			},
		},

		create(context) {
			const options = context.options;
			const always = options[0] !== "never"; // Default is always

			const sourceCode = context.sourceCode;

			return {
				NewExpression(node) {
					if (node.arguments.length !== 0) {
						return; // if there are arguments, there have to be parens
					}

					const lastToken = sourceCode.getLastToken(node);
					const hasLastParen =
						lastToken && astUtils.isClosingParenToken(lastToken);

					// `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens
					const hasParens =
						hasLastParen &&
						astUtils.isOpeningParenToken(
							sourceCode.getTokenBefore(lastToken),
						) &&
						node.callee.range[1] < node.range[1];

					if (always) {
						if (!hasParens) {
							context.report({
								node,
								messageId: "missing",
								fix: fixer => fixer.insertTextAfter(node, "()"),
							});
						}
					} else {
						if (hasParens) {
							context.report({
								node,
								messageId: "unnecessary",
								fix: fixer => [
									fixer.remove(
										sourceCode.getTokenBefore(lastToken),
									),
									fixer.remove(lastToken),
									fixer.insertTextBefore(node, "("),
									fixer.insertTextAfter(node, ")"),
								],
							});
						}
					}
				},
			};
		},
	};
	return newParens;
}

/**
 * @fileoverview Rule to check empty newline after "var" statement
 * @author Gopal Venkatesan
 * @deprecated in ESLint v4.0.0
 */

var newlineAfterVar;
var hasRequiredNewlineAfterVar;

function requireNewlineAfterVar () {
	if (hasRequiredNewlineAfterVar) return newlineAfterVar;
	hasRequiredNewlineAfterVar = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	newlineAfterVar = {
		meta: {
			type: "layout",

			docs: {
				description:
					"Require or disallow an empty line after variable declarations",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/newline-after-var",
			},
			schema: [
				{
					enum: ["never", "always"],
				},
			],
			fixable: "whitespace",
			messages: {
				expected: "Expected blank line after variable declarations.",
				unexpected: "Unexpected blank line after variable declarations.",
			},

			deprecated: {
				message: "The rule was replaced with a more general rule.",
				url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
				deprecatedSince: "4.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message: "The new rule moved to a plugin.",
						url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "padding-line-between-statements",
							url: "https://eslint.style/rules/js/padding-line-between-statements",
						},
					},
				],
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			// Default `mode` to "always".
			const mode = context.options[0] === "never" ? "never" : "always";

			// Cache starting and ending line numbers of comments for faster lookup
			const commentEndLine = sourceCode
				.getAllComments()
				.reduce((result, token) => {
					result[token.loc.start.line] = token.loc.end.line;
					return result;
				}, {});

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Gets a token from the given node to compare line to the next statement.
			 *
			 * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy.
			 *
			 * - The last token is semicolon.
			 * - The semicolon is on a different line from the previous token of the semicolon.
			 *
			 * This behavior would address semicolon-less style code. e.g.:
			 *
			 *     var foo = 1
			 *
			 *     ;(a || b).doSomething()
			 * @param {ASTNode} node The node to get.
			 * @returns {Token} The token to compare line to the next statement.
			 */
			function getLastToken(node) {
				const lastToken = sourceCode.getLastToken(node);

				if (lastToken.type === "Punctuator" && lastToken.value === ";") {
					const prevToken = sourceCode.getTokenBefore(lastToken);

					if (prevToken.loc.end.line !== lastToken.loc.start.line) {
						return prevToken;
					}
				}

				return lastToken;
			}

			/**
			 * Determine if provided keyword is a variable declaration
			 * @private
			 * @param {string} keyword keyword to test
			 * @returns {boolean} True if `keyword` is a type of var
			 */
			function isVar(keyword) {
				return (
					keyword === "var" || keyword === "let" || keyword === "const"
				);
			}

			/**
			 * Determine if provided keyword is a variant of for specifiers
			 * @private
			 * @param {string} keyword keyword to test
			 * @returns {boolean} True if `keyword` is a variant of for specifier
			 */
			function isForTypeSpecifier(keyword) {
				return (
					keyword === "ForStatement" ||
					keyword === "ForInStatement" ||
					keyword === "ForOfStatement"
				);
			}

			/**
			 * Determine if provided keyword is an export specifiers
			 * @private
			 * @param {string} nodeType nodeType to test
			 * @returns {boolean} True if `nodeType` is an export specifier
			 */
			function isExportSpecifier(nodeType) {
				return (
					nodeType === "ExportNamedDeclaration" ||
					nodeType === "ExportSpecifier" ||
					nodeType === "ExportDefaultDeclaration" ||
					nodeType === "ExportAllDeclaration"
				);
			}

			/**
			 * Determine if provided node is the last of their parent block.
			 * @private
			 * @param {ASTNode} node node to test
			 * @returns {boolean} True if `node` is last of their parent block.
			 */
			function isLastNode(node) {
				const token = sourceCode.getTokenAfter(node);

				return (
					!token || (token.type === "Punctuator" && token.value === "}")
				);
			}

			/**
			 * Gets the last line of a group of consecutive comments
			 * @param {number} commentStartLine The starting line of the group
			 * @returns {number} The number of the last comment line of the group
			 */
			function getLastCommentLineOfBlock(commentStartLine) {
				const currentCommentEnd = commentEndLine[commentStartLine];

				return commentEndLine[currentCommentEnd + 1]
					? getLastCommentLineOfBlock(currentCommentEnd + 1)
					: currentCommentEnd;
			}

			/**
			 * Determine if a token starts more than one line after a comment ends
			 * @param {token} token The token being checked
			 * @param {integer} commentStartLine The line number on which the comment starts
			 * @returns {boolean} True if `token` does not start immediately after a comment
			 */
			function hasBlankLineAfterComment(token, commentStartLine) {
				return (
					token.loc.start.line >
					getLastCommentLineOfBlock(commentStartLine) + 1
				);
			}

			/**
			 * Checks that a blank line exists after a variable declaration when mode is
			 * set to "always", or checks that there is no blank line when mode is set
			 * to "never"
			 * @private
			 * @param {ASTNode} node `VariableDeclaration` node to test
			 * @returns {void}
			 */
			function checkForBlankLine(node) {
				/*
				 * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will
				 * sometimes be second-last if there is a semicolon on a different line.
				 */
				const lastToken = getLastToken(node),
					/*
					 * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken
					 * is the last token of the node.
					 */
					nextToken =
						lastToken === sourceCode.getLastToken(node)
							? sourceCode.getTokenAfter(node)
							: sourceCode.getLastToken(node),
					nextLineNum = lastToken.loc.end.line + 1;

				// Ignore if there is no following statement
				if (!nextToken) {
					return;
				}

				// Ignore if parent of node is a for variant
				if (isForTypeSpecifier(node.parent.type)) {
					return;
				}

				// Ignore if parent of node is an export specifier
				if (isExportSpecifier(node.parent.type)) {
					return;
				}

				/*
				 * Some coding styles use multiple `var` statements, so do nothing if
				 * the next token is a `var` statement.
				 */
				if (nextToken.type === "Keyword" && isVar(nextToken.value)) {
					return;
				}

				// Ignore if it is last statement in a block
				if (isLastNode(node)) {
					return;
				}

				// Next statement is not a `var`...
				const noNextLineToken = nextToken.loc.start.line > nextLineNum;
				const hasNextLineComment =
					typeof commentEndLine[nextLineNum] !== "undefined";

				if (mode === "never" && noNextLineToken && !hasNextLineComment) {
					context.report({
						node,
						messageId: "unexpected",
						fix(fixer) {
							const linesBetween = sourceCode
								.getText()
								.slice(lastToken.range[1], nextToken.range[0])
								.split(astUtils.LINEBREAK_MATCHER);

							return fixer.replaceTextRange(
								[lastToken.range[1], nextToken.range[0]],
								`${linesBetween.slice(0, -1).join("")}\n${linesBetween.at(-1)}`,
							);
						},
					});
				}

				// Token on the next line, or comment without blank line
				if (
					mode === "always" &&
					(!noNextLineToken ||
						(hasNextLineComment &&
							!hasBlankLineAfterComment(nextToken, nextLineNum)))
				) {
					context.report({
						node,
						messageId: "expected",
						fix(fixer) {
							if (
								(noNextLineToken
									? getLastCommentLineOfBlock(nextLineNum)
									: lastToken.loc.end.line) ===
								nextToken.loc.start.line
							) {
								return fixer.insertTextBefore(nextToken, "\n\n");
							}

							return fixer.insertTextBeforeRange(
								[
									nextToken.range[0] - nextToken.loc.start.column,
									nextToken.range[1],
								],
								"\n",
							);
						},
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				VariableDeclaration: checkForBlankLine,
			};
		},
	};
	return newlineAfterVar;
}

/**
 * @fileoverview Rule to require newlines before `return` statement
 * @author Kai Cataldo
 * @deprecated in ESLint v4.0.0
 */

var newlineBeforeReturn;
var hasRequiredNewlineBeforeReturn;

function requireNewlineBeforeReturn () {
	if (hasRequiredNewlineBeforeReturn) return newlineBeforeReturn;
	hasRequiredNewlineBeforeReturn = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	newlineBeforeReturn = {
		meta: {
			type: "layout",

			docs: {
				description: "Require an empty line before `return` statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/newline-before-return",
			},

			fixable: "whitespace",
			schema: [],
			messages: {
				expected: "Expected newline before return statement.",
			},

			deprecated: {
				message: "The rule was replaced with a more general rule.",
				url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
				deprecatedSince: "4.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message: "The new rule moved to a plugin.",
						url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "padding-line-between-statements",
							url: "https://eslint.style/rules/js/padding-line-between-statements",
						},
					},
				],
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Tests whether node is preceded by supplied tokens
			 * @param {ASTNode} node node to check
			 * @param {Array} testTokens array of tokens to test against
			 * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens
			 * @private
			 */
			function isPrecededByTokens(node, testTokens) {
				const tokenBefore = sourceCode.getTokenBefore(node);

				return testTokens.includes(tokenBefore.value);
			}

			/**
			 * Checks whether node is the first node after statement or in block
			 * @param {ASTNode} node node to check
			 * @returns {boolean} Whether or not the node is the first node after statement or in block
			 * @private
			 */
			function isFirstNode(node) {
				const parentType = node.parent.type;

				if (node.parent.body) {
					return Array.isArray(node.parent.body)
						? node.parent.body[0] === node
						: node.parent.body === node;
				}

				if (parentType === "IfStatement") {
					return isPrecededByTokens(node, ["else", ")"]);
				}
				if (parentType === "DoWhileStatement") {
					return isPrecededByTokens(node, ["do"]);
				}
				if (parentType === "SwitchCase") {
					return isPrecededByTokens(node, [":"]);
				}
				return isPrecededByTokens(node, [")"]);
			}

			/**
			 * Returns the number of lines of comments that precede the node
			 * @param {ASTNode} node node to check for overlapping comments
			 * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments
			 * @returns {number} Number of lines of comments that precede the node
			 * @private
			 */
			function calcCommentLines(node, lineNumTokenBefore) {
				const comments = sourceCode.getCommentsBefore(node);
				let numLinesComments = 0;

				if (!comments.length) {
					return numLinesComments;
				}

				comments.forEach(comment => {
					numLinesComments++;

					if (comment.type === "Block") {
						numLinesComments +=
							comment.loc.end.line - comment.loc.start.line;
					}

					// avoid counting lines with inline comments twice
					if (comment.loc.start.line === lineNumTokenBefore) {
						numLinesComments--;
					}

					if (comment.loc.end.line === node.loc.start.line) {
						numLinesComments--;
					}
				});

				return numLinesComments;
			}

			/**
			 * Returns the line number of the token before the node that is passed in as an argument
			 * @param {ASTNode} node The node to use as the start of the calculation
			 * @returns {number} Line number of the token before `node`
			 * @private
			 */
			function getLineNumberOfTokenBefore(node) {
				const tokenBefore = sourceCode.getTokenBefore(node);
				let lineNumTokenBefore;

				/**
				 * Global return (at the beginning of a script) is a special case.
				 * If there is no token before `return`, then we expect no line
				 * break before the return. Comments are allowed to occupy lines
				 * before the global return, just no blank lines.
				 * Setting lineNumTokenBefore to zero in that case results in the
				 * desired behavior.
				 */
				if (tokenBefore) {
					lineNumTokenBefore = tokenBefore.loc.end.line;
				} else {
					lineNumTokenBefore = 0; // global return at beginning of script
				}

				return lineNumTokenBefore;
			}

			/**
			 * Checks whether node is preceded by a newline
			 * @param {ASTNode} node node to check
			 * @returns {boolean} Whether or not the node is preceded by a newline
			 * @private
			 */
			function hasNewlineBefore(node) {
				const lineNumNode = node.loc.start.line;
				const lineNumTokenBefore = getLineNumberOfTokenBefore(node);
				const commentLines = calcCommentLines(node, lineNumTokenBefore);

				return lineNumNode - lineNumTokenBefore - commentLines > 1;
			}

			/**
			 * Checks whether it is safe to apply a fix to a given return statement.
			 *
			 * The fix is not considered safe if the given return statement has leading comments,
			 * as we cannot safely determine if the newline should be added before or after the comments.
			 * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211
			 * @param {ASTNode} node The return statement node to check.
			 * @returns {boolean} `true` if it can fix the node.
			 * @private
			 */
			function canFix(node) {
				const leadingComments = sourceCode.getCommentsBefore(node);
				const lastLeadingComment = leadingComments.at(-1);
				const tokenBefore = sourceCode.getTokenBefore(node);

				if (leadingComments.length === 0) {
					return true;
				}

				/*
				 * if the last leading comment ends in the same line as the previous token and
				 * does not share a line with the `return` node, we can consider it safe to fix.
				 * Example:
				 * function a() {
				 *     var b; //comment
				 *     return;
				 * }
				 */
				if (
					lastLeadingComment.loc.end.line === tokenBefore.loc.end.line &&
					lastLeadingComment.loc.end.line !== node.loc.start.line
				) {
					return true;
				}

				return false;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ReturnStatement(node) {
					if (!isFirstNode(node) && !hasNewlineBefore(node)) {
						context.report({
							node,
							messageId: "expected",
							fix(fixer) {
								if (canFix(node)) {
									const tokenBefore =
										sourceCode.getTokenBefore(node);
									const newlines =
										node.loc.start.line ===
										tokenBefore.loc.end.line
											? "\n\n"
											: "\n";

									return fixer.insertTextBefore(node, newlines);
								}
								return null;
							},
						});
					}
				},
			};
		},
	};
	return newlineBeforeReturn;
}

/**
 * @fileoverview Rule to ensure newline per method call when chaining calls
 * @author Rajendra Patil
 * @author Burak Yigit Kaya
 * @deprecated in ESLint v8.53.0
 */

var newlinePerChainedCall;
var hasRequiredNewlinePerChainedCall;

function requireNewlinePerChainedCall () {
	if (hasRequiredNewlinePerChainedCall) return newlinePerChainedCall;
	hasRequiredNewlinePerChainedCall = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	newlinePerChainedCall = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "newline-per-chained-call",
							url: "https://eslint.style/rules/js/newline-per-chained-call",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require a newline after each call in a method chain",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/newline-per-chained-call",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						ignoreChainWithDepth: {
							type: "integer",
							minimum: 1,
							maximum: 10,
							default: 2,
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				expected: "Expected line break before `{{callee}}`.",
			},
		},

		create(context) {
			const options = context.options[0] || {},
				ignoreChainWithDepth = options.ignoreChainWithDepth || 2;

			const sourceCode = context.sourceCode;

			/**
			 * Get the prefix of a given MemberExpression node.
			 * If the MemberExpression node is a computed value it returns a
			 * left bracket. If not it returns a period.
			 * @param {ASTNode} node A MemberExpression node to get
			 * @returns {string} The prefix of the node.
			 */
			function getPrefix(node) {
				if (node.computed) {
					if (node.optional) {
						return "?.[";
					}
					return "[";
				}
				if (node.optional) {
					return "?.";
				}
				return ".";
			}

			/**
			 * Gets the property text of a given MemberExpression node.
			 * If the text is multiline, this returns only the first line.
			 * @param {ASTNode} node A MemberExpression node to get.
			 * @returns {string} The property text of the node.
			 */
			function getPropertyText(node) {
				const prefix = getPrefix(node);
				const lines = sourceCode
					.getText(node.property)
					.split(astUtils.LINEBREAK_MATCHER);
				const suffix = node.computed && lines.length === 1 ? "]" : "";

				return prefix + lines[0] + suffix;
			}

			return {
				"CallExpression:exit"(node) {
					const callee = astUtils.skipChainExpression(node.callee);

					if (callee.type !== "MemberExpression") {
						return;
					}

					let parent = astUtils.skipChainExpression(callee.object);
					let depth = 1;

					while (parent && parent.callee) {
						depth += 1;
						parent = astUtils.skipChainExpression(
							astUtils.skipChainExpression(parent.callee).object,
						);
					}

					if (
						depth > ignoreChainWithDepth &&
						astUtils.isTokenOnSameLine(callee.object, callee.property)
					) {
						const firstTokenAfterObject = sourceCode.getTokenAfter(
							callee.object,
							astUtils.isNotClosingParenToken,
						);

						context.report({
							node: callee.property,
							loc: {
								start: firstTokenAfterObject.loc.start,
								end: callee.loc.end,
							},
							messageId: "expected",
							data: {
								callee: getPropertyText(callee),
							},
							fix(fixer) {
								return fixer.insertTextBefore(
									firstTokenAfterObject,
									"\n",
								);
							},
						});
					}
				},
			};
		},
	};
	return newlinePerChainedCall;
}

/**
 * @fileoverview Rule to flag use of alert, confirm, prompt
 * @author Nicholas C. Zakas
 */

var noAlert;
var hasRequiredNoAlert;

function requireNoAlert () {
	if (hasRequiredNoAlert) return noAlert;
	hasRequiredNoAlert = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		getStaticPropertyName: getPropertyName,
		getVariableByName,
		skipChainExpression,
	} = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks if the given name is a prohibited identifier.
	 * @param {string} name The name to check
	 * @returns {boolean} Whether or not the name is prohibited.
	 */
	function isProhibitedIdentifier(name) {
		return /^(alert|confirm|prompt)$/u.test(name);
	}

	/**
	 * Finds the eslint-scope reference in the given scope.
	 * @param {Object} scope The scope to search.
	 * @param {ASTNode} node The identifier node.
	 * @returns {Reference|null} Returns the found reference or null if none were found.
	 */
	function findReference(scope, node) {
		const references = scope.references.filter(
			reference =>
				reference.identifier.range[0] === node.range[0] &&
				reference.identifier.range[1] === node.range[1],
		);

		if (references.length === 1) {
			return references[0];
		}
		return null;
	}

	/**
	 * Checks if the given identifier node is shadowed in the given scope.
	 * @param {Object} scope The current scope.
	 * @param {string} node The identifier node to check
	 * @returns {boolean} Whether or not the name is shadowed.
	 */
	function isShadowed(scope, node) {
		const reference = findReference(scope, node);

		return (
			reference && reference.resolved && reference.resolved.defs.length > 0
		);
	}

	/**
	 * Checks if the given identifier node is a ThisExpression in the global scope or the global window property.
	 * @param {Object} scope The current scope.
	 * @param {string} node The identifier node to check
	 * @returns {boolean} Whether or not the node is a reference to the global object.
	 */
	function isGlobalThisReferenceOrGlobalWindow(scope, node) {
		if (scope.type === "global" && node.type === "ThisExpression") {
			return true;
		}
		if (
			node.type === "Identifier" &&
			(node.name === "window" ||
				(node.name === "globalThis" &&
					getVariableByName(scope, "globalThis")))
		) {
			return !isShadowed(scope, node);
		}

		return false;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noAlert = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow the use of `alert`, `confirm`, and `prompt`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-alert",
			},

			schema: [],

			messages: {
				unexpected: "Unexpected {{name}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				CallExpression(node) {
					const callee = skipChainExpression(node.callee),
						currentScope = sourceCode.getScope(node);

					// without window.
					if (callee.type === "Identifier") {
						const name = callee.name;

						if (
							!isShadowed(currentScope, callee) &&
							isProhibitedIdentifier(callee.name)
						) {
							context.report({
								node,
								messageId: "unexpected",
								data: { name },
							});
						}
					} else if (
						callee.type === "MemberExpression" &&
						isGlobalThisReferenceOrGlobalWindow(
							currentScope,
							callee.object,
						)
					) {
						const name = getPropertyName(callee);

						if (isProhibitedIdentifier(name)) {
							context.report({
								node,
								messageId: "unexpected",
								data: { name },
							});
						}
					}
				},
			};
		},
	};
	return noAlert;
}

/**
 * @fileoverview Disallow construction of dense arrays using the Array constructor
 * @author Matt DuVall <http://www.mattduvall.com/>
 */

var noArrayConstructor;
var hasRequiredNoArrayConstructor;

function requireNoArrayConstructor () {
	if (hasRequiredNoArrayConstructor) return noArrayConstructor;
	hasRequiredNoArrayConstructor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		getVariableByName,
		isClosingParenToken,
		isOpeningParenToken,
		isStartOfExpressionStatement,
		needsPrecedingSemicolon,
	} = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noArrayConstructor = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `Array` constructors",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-array-constructor",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				preferLiteral: "The array literal notation [] is preferable.",
				useLiteral: "Replace with an array literal.",
				useLiteralAfterSemicolon:
					"Replace with an array literal, add preceding semicolon.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Gets the text between the calling parentheses of a CallExpression or NewExpression.
			 * @param {ASTNode} node A CallExpression or NewExpression node.
			 * @returns {string} The text between the calling parentheses, or an empty string if there are none.
			 */
			function getArgumentsText(node) {
				const lastToken = sourceCode.getLastToken(node);

				if (!isClosingParenToken(lastToken)) {
					return "";
				}

				let firstToken = node.callee;

				do {
					firstToken = sourceCode.getTokenAfter(firstToken);
					if (!firstToken || firstToken === lastToken) {
						return "";
					}
				} while (!isOpeningParenToken(firstToken));

				return sourceCode.text.slice(
					firstToken.range[1],
					lastToken.range[0],
				);
			}

			/**
			 * Disallow construction of dense arrays using the Array constructor
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function check(node) {
				if (
					node.callee.type !== "Identifier" ||
					node.callee.name !== "Array" ||
					(node.arguments.length === 1 &&
						node.arguments[0].type !== "SpreadElement")
				) {
					return;
				}

				const variable = getVariableByName(
					sourceCode.getScope(node),
					"Array",
				);

				/*
				 * Check if `Array` is a predefined global variable: predefined globals have no declarations,
				 * meaning that the `identifiers` list of the variable object is empty.
				 */
				if (variable && variable.identifiers.length === 0) {
					const argsText = getArgumentsText(node);
					let fixText;
					let messageId;

					/*
					 * Check if the suggested change should include a preceding semicolon or not.
					 * Due to JavaScript's ASI rules, a missing semicolon may be inserted automatically
					 * before an expression like `Array()` or `new Array()`, but not when the expression
					 * is changed into an array literal like `[]`.
					 */
					if (
						isStartOfExpressionStatement(node) &&
						needsPrecedingSemicolon(sourceCode, node)
					) {
						fixText = `;[${argsText}]`;
						messageId = "useLiteralAfterSemicolon";
					} else {
						fixText = `[${argsText}]`;
						messageId = "useLiteral";
					}

					context.report({
						node,
						messageId: "preferLiteral",
						suggest: [
							{
								messageId,
								fix: fixer => fixer.replaceText(node, fixText),
							},
						],
					});
				}
			}

			return {
				CallExpression: check,
				NewExpression: check,
			};
		},
	};
	return noArrayConstructor;
}

/**
 * @fileoverview disallow using an async function as a Promise executor
 * @author Teddy Katz
 */

var noAsyncPromiseExecutor;
var hasRequiredNoAsyncPromiseExecutor;

function requireNoAsyncPromiseExecutor () {
	if (hasRequiredNoAsyncPromiseExecutor) return noAsyncPromiseExecutor;
	hasRequiredNoAsyncPromiseExecutor = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noAsyncPromiseExecutor = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow using an async function as a Promise executor",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-async-promise-executor",
			},

			fixable: null,
			schema: [],
			messages: {
				async: "Promise executor functions should not be async.",
			},
		},

		create(context) {
			return {
				"NewExpression[callee.name='Promise'][arguments.0.async=true]"(
					node,
				) {
					context.report({
						node: context.sourceCode.getFirstToken(
							node.arguments[0],
							token => token.value === "async",
						),
						messageId: "async",
					});
				},
			};
		},
	};
	return noAsyncPromiseExecutor;
}

/**
 * @fileoverview Rule to disallow uses of await inside of loops.
 * @author Nat Mote (nmote)
 */

var noAwaitInLoop;
var hasRequiredNoAwaitInLoop;

function requireNoAwaitInLoop () {
	if (hasRequiredNoAwaitInLoop) return noAwaitInLoop;
	hasRequiredNoAwaitInLoop = 1;

	/**
	 * Check whether it should stop traversing ancestors at the given node.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if it should stop traversing.
	 */
	function isBoundary(node) {
		const t = node.type;

		return (
			t === "FunctionDeclaration" ||
			t === "FunctionExpression" ||
			t === "ArrowFunctionExpression" ||
			/*
			 * Don't report the await expressions on for-await-of loop since it's
			 * asynchronous iteration intentionally.
			 */
			(t === "ForOfStatement" && node.await === true)
		);
	}

	/**
	 * Check whether the given node is in loop.
	 * @param {ASTNode} node A node to check.
	 * @param {ASTNode} parent A parent node to check.
	 * @returns {boolean} `true` if the node is in loop.
	 */
	function isLooped(node, parent) {
		switch (parent.type) {
			case "ForStatement":
				return (
					node === parent.test ||
					node === parent.update ||
					node === parent.body
				);

			case "ForOfStatement":
			case "ForInStatement":
				return node === parent.body;

			case "WhileStatement":
			case "DoWhileStatement":
				return node === parent.test || node === parent.body;

			default:
				return false;
		}
	}

	/** @type {import('../shared/types').Rule} */
	noAwaitInLoop = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow `await` inside of loops",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-await-in-loop",
			},

			schema: [],

			messages: {
				unexpectedAwait: "Unexpected `await` inside a loop.",
			},
		},
		create(context) {
			/**
			 * Validate an await expression.
			 * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
			 * @returns {void}
			 */
			function validate(awaitNode) {
				if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
					return;
				}

				let node = awaitNode;
				let parent = node.parent;

				while (parent && !isBoundary(parent)) {
					if (isLooped(node, parent)) {
						context.report({
							node: awaitNode,
							messageId: "unexpectedAwait",
						});
						return;
					}
					node = parent;
					parent = parent.parent;
				}
			}

			return {
				AwaitExpression: validate,
				ForOfStatement: validate,
			};
		},
	};
	return noAwaitInLoop;
}

/**
 * @fileoverview Rule to flag bitwise identifiers
 * @author Nicholas C. Zakas
 */

var noBitwise;
var hasRequiredNoBitwise;

function requireNoBitwise () {
	if (hasRequiredNoBitwise) return noBitwise;
	hasRequiredNoBitwise = 1;

	/*
	 *
	 * Set of bitwise operators.
	 *
	 */
	const BITWISE_OPERATORS = [
		"^",
		"|",
		"&",
		"<<",
		">>",
		">>>",
		"^=",
		"|=",
		"&=",
		"<<=",
		">>=",
		">>>=",
		"~",
	];

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noBitwise = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allow: [],
					int32Hint: false,
				},
			],

			docs: {
				description: "Disallow bitwise operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-bitwise",
			},

			schema: [
				{
					type: "object",
					properties: {
						allow: {
							type: "array",
							items: {
								enum: BITWISE_OPERATORS,
							},
							uniqueItems: true,
						},
						int32Hint: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "Unexpected use of '{{operator}}'.",
			},
		},

		create(context) {
			const [{ allow: allowed, int32Hint }] = context.options;

			/**
			 * Reports an unexpected use of a bitwise operator.
			 * @param {ASTNode} node Node which contains the bitwise operator.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "unexpected",
					data: { operator: node.operator },
				});
			}

			/**
			 * Checks if the given node has a bitwise operator.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} Whether or not the node has a bitwise operator.
			 */
			function hasBitwiseOperator(node) {
				return BITWISE_OPERATORS.includes(node.operator);
			}

			/**
			 * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} Whether or not the node has a bitwise operator.
			 */
			function allowedOperator(node) {
				return allowed.includes(node.operator);
			}

			/**
			 * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0"
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} whether the node is used in integer typecasting.
			 */
			function isInt32Hint(node) {
				return (
					int32Hint &&
					node.operator === "|" &&
					node.right &&
					node.right.type === "Literal" &&
					node.right.value === 0
				);
			}

			/**
			 * Report if the given node contains a bitwise operator.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkNodeForBitwiseOperator(node) {
				if (
					hasBitwiseOperator(node) &&
					!allowedOperator(node) &&
					!isInt32Hint(node)
				) {
					report(node);
				}
			}

			return {
				AssignmentExpression: checkNodeForBitwiseOperator,
				BinaryExpression: checkNodeForBitwiseOperator,
				UnaryExpression: checkNodeForBitwiseOperator,
			};
		},
	};
	return noBitwise;
}

/**
 * @fileoverview disallow use of the Buffer() constructor
 * @author Teddy Katz
 * @deprecated in ESLint v7.0.0
 */

var noBufferConstructor;
var hasRequiredNoBufferConstructor;

function requireNoBufferConstructor () {
	if (hasRequiredNoBufferConstructor) return noBufferConstructor;
	hasRequiredNoBufferConstructor = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noBufferConstructor = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-deprecated-api",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-deprecated-api.md",
						},
					},
				],
			},

			type: "problem",

			docs: {
				description: "Disallow use of the `Buffer()` constructor",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-buffer-constructor",
			},

			schema: [],

			messages: {
				deprecated:
					"{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead.",
			},
		},

		create(context) {
			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				"CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(
					node,
				) {
					context.report({
						node,
						messageId: "deprecated",
						data: {
							expr:
								node.type === "CallExpression"
									? "Buffer()"
									: "new Buffer()",
						},
					});
				},
			};
		},
	};
	return noBufferConstructor;
}

/**
 * @fileoverview Rule to flag use of arguments.callee and arguments.caller.
 * @author Nicholas C. Zakas
 */

var noCaller;
var hasRequiredNoCaller;

function requireNoCaller () {
	if (hasRequiredNoCaller) return noCaller;
	hasRequiredNoCaller = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noCaller = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow the use of `arguments.caller` or `arguments.callee`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-caller",
			},

			schema: [],

			messages: {
				unexpected: "Avoid arguments.{{prop}}.",
			},
		},

		create(context) {
			return {
				MemberExpression(node) {
					const objectName = node.object.name,
						propertyName = node.property.name;

					if (
						objectName === "arguments" &&
						!node.computed &&
						propertyName &&
						propertyName.match(/^calle[er]$/u)
					) {
						context.report({
							node,
							messageId: "unexpected",
							data: { prop: propertyName },
						});
					}
				},
			};
		},
	};
	return noCaller;
}

/**
 * @fileoverview Rule to flag use of an lexical declarations inside a case clause
 * @author Erik Arvidsson
 */

var noCaseDeclarations;
var hasRequiredNoCaseDeclarations;

function requireNoCaseDeclarations () {
	if (hasRequiredNoCaseDeclarations) return noCaseDeclarations;
	hasRequiredNoCaseDeclarations = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noCaseDeclarations = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow lexical declarations in case clauses",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-case-declarations",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				addBrackets: "Add {} brackets around the case block.",
				unexpected: "Unexpected lexical declaration in case block.",
			},
		},

		create(context) {
			/**
			 * Checks whether or not a node is a lexical declaration.
			 * @param {ASTNode} node A direct child statement of a switch case.
			 * @returns {boolean} Whether or not the node is a lexical declaration.
			 */
			function isLexicalDeclaration(node) {
				switch (node.type) {
					case "FunctionDeclaration":
					case "ClassDeclaration":
						return true;
					case "VariableDeclaration":
						return node.kind !== "var";
					default:
						return false;
				}
			}

			return {
				SwitchCase(node) {
					for (let i = 0; i < node.consequent.length; i++) {
						const statement = node.consequent[i];

						if (isLexicalDeclaration(statement)) {
							context.report({
								node: statement,
								messageId: "unexpected",
								suggest: [
									{
										messageId: "addBrackets",
										fix: fixer => [
											fixer.insertTextBefore(
												node.consequent[0],
												"{ ",
											),
											fixer.insertTextAfter(
												node.consequent.at(-1),
												" }",
											),
										],
									},
								],
							});
						}
					}
				},
			};
		},
	};
	return noCaseDeclarations;
}

/**
 * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier
 * @author Ian Christian Myers
 * @deprecated in ESLint v5.1.0
 */

var noCatchShadow;
var hasRequiredNoCatchShadow;

function requireNoCatchShadow () {
	if (hasRequiredNoCatchShadow) return noCatchShadow;
	hasRequiredNoCatchShadow = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noCatchShadow = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `catch` clause parameters from shadowing variables in the outer scope",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-catch-shadow",
			},

			deprecated: {
				message: "This rule was renamed.",
				url: "https://eslint.org/blog/2018/07/eslint-v5.1.0-released/",
				deprecatedSince: "5.1.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "no-shadow",
							url: "https://eslint.org/docs/rules/no-shadow",
						},
					},
				],
			},
			schema: [],

			messages: {
				mutable:
					"Value of '{{name}}' may be overwritten in IE 8 and earlier.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Check if the parameters are been shadowed
			 * @param {Object} scope current scope
			 * @param {string} name parameter name
			 * @returns {boolean} True is its been shadowed
			 */
			function paramIsShadowing(scope, name) {
				return astUtils.getVariableByName(scope, name) !== null;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				"CatchClause[param!=null]"(node) {
					let scope = sourceCode.getScope(node);

					/*
					 * When ecmaVersion >= 6, CatchClause creates its own scope
					 * so start from one upper scope to exclude the current node
					 */
					if (scope.block === node) {
						scope = scope.upper;
					}

					if (paramIsShadowing(scope, node.param.name)) {
						context.report({
							node,
							messageId: "mutable",
							data: { name: node.param.name },
						});
					}
				},
			};
		},
	};
	return noCatchShadow;
}

/**
 * @fileoverview A rule to disallow modifying variables of class declarations
 * @author Toru Nagashima
 */

var noClassAssign;
var hasRequiredNoClassAssign;

function requireNoClassAssign () {
	if (hasRequiredNoClassAssign) return noClassAssign;
	hasRequiredNoClassAssign = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noClassAssign = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow reassigning class members",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-class-assign",
			},

			schema: [],

			messages: {
				class: "'{{name}}' is a class.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				astUtils
					.getModifyingReferences(variable.references)
					.forEach(reference => {
						context.report({
							node: reference.identifier,
							messageId: "class",
							data: { name: reference.identifier.name },
						});
					});
			}

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check.
			 * @returns {void}
			 */
			function checkForClass(node) {
				sourceCode.getDeclaredVariables(node).forEach(checkVariable);
			}

			return {
				ClassDeclaration: checkForClass,
				ClassExpression: checkForClass,
			};
		},
	};
	return noClassAssign;
}

/**
 * @fileoverview The rule should warn against code that tries to compare against -0.
 * @author Aladdin-ADD <hh_2013@foxmail.com>
 */

var noCompareNegZero;
var hasRequiredNoCompareNegZero;

function requireNoCompareNegZero () {
	if (hasRequiredNoCompareNegZero) return noCompareNegZero;
	hasRequiredNoCompareNegZero = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noCompareNegZero = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow comparing against `-0`",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-compare-neg-zero",
			},

			fixable: null,
			schema: [],

			messages: {
				unexpected:
					"Do not use the '{{operator}}' operator to compare against -0.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Checks a given node is -0
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} `true` if the node is -0.
			 */
			function isNegZero(node) {
				return (
					node.type === "UnaryExpression" &&
					node.operator === "-" &&
					node.argument.type === "Literal" &&
					node.argument.value === 0
				);
			}
			const OPERATORS_TO_CHECK = new Set([
				">",
				">=",
				"<",
				"<=",
				"==",
				"===",
				"!=",
				"!==",
			]);

			return {
				BinaryExpression(node) {
					if (OPERATORS_TO_CHECK.has(node.operator)) {
						if (isNegZero(node.left) || isNegZero(node.right)) {
							context.report({
								node,
								messageId: "unexpected",
								data: { operator: node.operator },
							});
						}
					}
				},
			};
		},
	};
	return noCompareNegZero;
}

/**
 * @fileoverview Rule to flag assignment in a conditional statement's test expression
 * @author Stephen Murray <spmurrayzzz>
 */

var noCondAssign;
var hasRequiredNoCondAssign;

function requireNoCondAssign () {
	if (hasRequiredNoCondAssign) return noCondAssign;
	hasRequiredNoCondAssign = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const TEST_CONDITION_PARENT_TYPES = new Set([
		"IfStatement",
		"WhileStatement",
		"DoWhileStatement",
		"ForStatement",
		"ConditionalExpression",
	]);

	const NODE_DESCRIPTIONS = {
		DoWhileStatement: "a 'do...while' statement",
		ForStatement: "a 'for' statement",
		IfStatement: "an 'if' statement",
		WhileStatement: "a 'while' statement",
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noCondAssign = {
		meta: {
			type: "problem",

			defaultOptions: ["except-parens"],

			docs: {
				description:
					"Disallow assignment operators in conditional expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-cond-assign",
			},

			schema: [
				{
					enum: ["except-parens", "always"],
				},
			],

			messages: {
				unexpected: "Unexpected assignment within {{type}}.",

				// must match JSHint's error message
				missing:
					"Expected a conditional expression and instead saw an assignment.",
			},
		},

		create(context) {
			const [prohibitAssign] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Check whether an AST node is the test expression for a conditional statement.
			 * @param {!Object} node The node to test.
			 * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`.
			 */
			function isConditionalTestExpression(node) {
				return (
					node.parent &&
					TEST_CONDITION_PARENT_TYPES.has(node.parent.type) &&
					node === node.parent.test
				);
			}

			/**
			 * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement.
			 * @param {!Object} node The node to use at the start of the search.
			 * @returns {?Object} The closest ancestor node that represents a conditional statement.
			 */
			function findConditionalAncestor(node) {
				let currentAncestor = node;

				do {
					if (isConditionalTestExpression(currentAncestor)) {
						return currentAncestor.parent;
					}
				} while (
					(currentAncestor = currentAncestor.parent) &&
					!astUtils.isFunction(currentAncestor)
				);

				return null;
			}

			/**
			 * Check whether the code represented by an AST node is enclosed in two sets of parentheses.
			 * @param {!Object} node The node to test.
			 * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`.
			 */
			function isParenthesisedTwice(node) {
				const previousToken = sourceCode.getTokenBefore(node, 1),
					nextToken = sourceCode.getTokenAfter(node, 1);

				return (
					astUtils.isParenthesised(sourceCode, node) &&
					previousToken &&
					astUtils.isOpeningParenToken(previousToken) &&
					previousToken.range[1] <= node.range[0] &&
					astUtils.isClosingParenToken(nextToken) &&
					nextToken.range[0] >= node.range[1]
				);
			}

			/**
			 * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses.
			 * @param {!Object} node The node for the conditional statement.
			 * @returns {void}
			 */
			function testForAssign(node) {
				if (
					node.test &&
					node.test.type === "AssignmentExpression" &&
					(node.type === "ForStatement"
						? !astUtils.isParenthesised(sourceCode, node.test)
						: !isParenthesisedTwice(node.test))
				) {
					context.report({
						node: node.test,
						messageId: "missing",
					});
				}
			}

			/**
			 * Check whether an assignment expression is descended from a conditional statement's test expression.
			 * @param {!Object} node The node for the assignment expression.
			 * @returns {void}
			 */
			function testForConditionalAncestor(node) {
				const ancestor = findConditionalAncestor(node);

				if (ancestor) {
					context.report({
						node,
						messageId: "unexpected",
						data: {
							type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type,
						},
					});
				}
			}

			if (prohibitAssign === "always") {
				return {
					AssignmentExpression: testForConditionalAncestor,
				};
			}

			return {
				DoWhileStatement: testForAssign,
				ForStatement: testForAssign,
				IfStatement: testForAssign,
				WhileStatement: testForAssign,
				ConditionalExpression: testForAssign,
			};
		},
	};
	return noCondAssign;
}

/**
 * @fileoverview A rule to warn against using arrow functions when they could be
 * confused with comparisons
 * @author Jxck <https://github.com/Jxck>
 * @deprecated in ESLint v8.53.0
 */

var noConfusingArrow;
var hasRequiredNoConfusingArrow;

function requireNoConfusingArrow () {
	if (hasRequiredNoConfusingArrow) return noConfusingArrow;
	hasRequiredNoConfusingArrow = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a node is a conditional expression.
	 * @param {ASTNode} node node to test
	 * @returns {boolean} `true` if the node is a conditional expression.
	 */
	function isConditional(node) {
		return node && node.type === "ConditionalExpression";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConfusingArrow = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-confusing-arrow",
							url: "https://eslint.style/rules/js/no-confusing-arrow",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description:
					"Disallow arrow functions where they could be confused with comparisons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-confusing-arrow",
			},

			fixable: "code",

			schema: [
				{
					type: "object",
					properties: {
						allowParens: { type: "boolean", default: true },
						onlyOneSimpleParam: { type: "boolean", default: false },
					},
					additionalProperties: false,
				},
			],

			messages: {
				confusing:
					"Arrow function used ambiguously with a conditional expression.",
			},
		},

		create(context) {
			const config = context.options[0] || {};
			const allowParens = config.allowParens || config.allowParens === void 0;
			const onlyOneSimpleParam = config.onlyOneSimpleParam;
			const sourceCode = context.sourceCode;

			/**
			 * Reports if an arrow function contains an ambiguous conditional.
			 * @param {ASTNode} node A node to check and report.
			 * @returns {void}
			 */
			function checkArrowFunc(node) {
				const body = node.body;

				if (
					isConditional(body) &&
					!(allowParens && astUtils.isParenthesised(sourceCode, body)) &&
					!(
						onlyOneSimpleParam &&
						!(
							node.params.length === 1 &&
							node.params[0].type === "Identifier"
						)
					)
				) {
					context.report({
						node,
						messageId: "confusing",
						fix(fixer) {
							// if `allowParens` is not set to true don't bother wrapping in parens
							return (
								allowParens &&
								fixer.replaceText(
									node.body,
									`(${sourceCode.getText(node.body)})`,
								)
							);
						},
					});
				}
			}

			return {
				ArrowFunctionExpression: checkArrowFunc,
			};
		},
	};
	return noConfusingArrow;
}

/**
 * @fileoverview Rule to flag use of console object
 * @author Nicholas C. Zakas
 */

var noConsole;
var hasRequiredNoConsole;

function requireNoConsole () {
	if (hasRequiredNoConsole) return noConsole;
	hasRequiredNoConsole = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConsole = {
		meta: {
			type: "suggestion",

			defaultOptions: [{}],

			docs: {
				description: "Disallow the use of `console`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-console",
			},

			schema: [
				{
					type: "object",
					properties: {
						allow: {
							type: "array",
							items: {
								type: "string",
							},
							minItems: 1,
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			hasSuggestions: true,

			messages: {
				unexpected: "Unexpected console statement.",
				limited:
					"Unexpected console statement. Only these console methods are allowed: {{ allowed }}.",
				removeConsole: "Remove the console.{{ propertyName }}().",
				removeMethodCall: "Remove the console method call.",
			},
		},

		create(context) {
			const [{ allow: allowed = [] }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Checks whether the given reference is 'console' or not.
			 * @param {eslint-scope.Reference} reference The reference to check.
			 * @returns {boolean} `true` if the reference is 'console'.
			 */
			function isConsole(reference) {
				const id = reference.identifier;

				return id && id.name === "console";
			}

			/**
			 * Checks whether the property name of the given MemberExpression node
			 * is allowed by options or not.
			 * @param {ASTNode} node The MemberExpression node to check.
			 * @returns {boolean} `true` if the property name of the node is allowed.
			 */
			function isAllowed(node) {
				const propertyName = astUtils.getStaticPropertyName(node);

				return propertyName && allowed.includes(propertyName);
			}

			/**
			 * Checks whether the given reference is a member access which is not
			 * allowed by options or not.
			 * @param {eslint-scope.Reference} reference The reference to check.
			 * @returns {boolean} `true` if the reference is a member access which
			 *      is not allowed by options.
			 */
			function isMemberAccessExceptAllowed(reference) {
				const node = reference.identifier;
				const parent = node.parent;

				return (
					parent.type === "MemberExpression" &&
					parent.object === node &&
					!isAllowed(parent)
				);
			}

			/**
			 * Checks if removing the ExpressionStatement node will cause ASI to
			 * break.
			 * eg.
			 * foo()
			 * console.log();
			 * [1, 2, 3].forEach(a => doSomething(a))
			 *
			 * Removing the console.log(); statement should leave two statements, but
			 * here the two statements will become one because [ causes continuation after
			 * foo().
			 * @param {ASTNode} node The ExpressionStatement node to check.
			 * @returns {boolean} `true` if ASI will break after removing the ExpressionStatement
			 *      node.
			 */
			function maybeAsiHazard(node) {
				const SAFE_TOKENS_BEFORE = /^[:;{]$/u; // One of :;{
				const UNSAFE_CHARS_AFTER = /^[-[(/+`]/u; // One of [(/+-`

				const tokenBefore = sourceCode.getTokenBefore(node);
				const tokenAfter = sourceCode.getTokenAfter(node);

				return (
					Boolean(tokenAfter) &&
					UNSAFE_CHARS_AFTER.test(tokenAfter.value) &&
					tokenAfter.value !== "++" &&
					tokenAfter.value !== "--" &&
					Boolean(tokenBefore) &&
					!SAFE_TOKENS_BEFORE.test(tokenBefore.value)
				);
			}

			/**
			 * Checks if the MemberExpression node's parent.parent.parent is a
			 * Program, BlockStatement, StaticBlock, or SwitchCase node. This check
			 * is necessary to avoid providing a suggestion that might cause a syntax error.
			 *
			 * eg. if (a) console.log(b), removing console.log() here will lead to a
			 *     syntax error.
			 *     if (a) { console.log(b) }, removing console.log() here is acceptable.
			 *
			 * Additionally, it checks if the callee of the CallExpression node is
			 * the node itself.
			 *
			 * eg. foo(console.log), cannot provide a suggestion here.
			 * @param {ASTNode} node The MemberExpression node to check.
			 * @returns {boolean} `true` if a suggestion can be provided for a node.
			 */
			function canProvideSuggestions(node) {
				return (
					node.parent.type === "CallExpression" &&
					node.parent.callee === node &&
					node.parent.parent.type === "ExpressionStatement" &&
					astUtils.STATEMENT_LIST_PARENTS.has(
						node.parent.parent.parent.type,
					) &&
					!maybeAsiHazard(node.parent.parent)
				);
			}

			/**
			 * Reports the given reference as a violation.
			 * @param {eslint-scope.Reference} reference The reference to report.
			 * @returns {void}
			 */
			function report(reference) {
				const node = reference.identifier.parent;

				const suggest = [];

				if (canProvideSuggestions(node)) {
					const suggestion = {
						fix(fixer) {
							return fixer.remove(node.parent.parent);
						},
					};

					if (node.computed) {
						suggestion.messageId = "removeMethodCall";
					} else {
						suggestion.messageId = "removeConsole";
						suggestion.data = { propertyName: node.property.name };
					}
					suggest.push(suggestion);
				}
				context.report({
					node,
					loc: node.loc,
					messageId: allowed.length ? "limited" : "unexpected",
					data: { allowed: allowed.join(", ") },
					suggest,
				});
			}

			return {
				"Program:exit"(node) {
					const scope = sourceCode.getScope(node);
					const consoleVar = astUtils.getVariableByName(scope, "console");
					const shadowed = consoleVar && consoleVar.defs.length > 0;

					/*
					 * 'scope.through' includes all references to undefined
					 * variables. If the variable 'console' is not defined, it uses
					 * 'scope.through'.
					 */
					const references = consoleVar
						? consoleVar.references
						: scope.through.filter(isConsole);

					if (!shadowed) {
						references
							.filter(isMemberAccessExceptAllowed)
							.forEach(report);
					}
				},
			};
		},
	};
	return noConsole;
}

/**
 * @fileoverview A rule to disallow modifying variables that are declared using `const`
 * @author Toru Nagashima
 */

var noConstAssign;
var hasRequiredNoConstAssign;

function requireNoConstAssign () {
	if (hasRequiredNoConstAssign) return noConstAssign;
	hasRequiredNoConstAssign = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConstAssign = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow reassigning `const` variables",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-const-assign",
			},

			schema: [],

			messages: {
				const: "'{{name}}' is constant.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				astUtils
					.getModifyingReferences(variable.references)
					.forEach(reference => {
						context.report({
							node: reference.identifier,
							messageId: "const",
							data: { name: reference.identifier.name },
						});
					});
			}

			return {
				VariableDeclaration(node) {
					if (node.kind === "const") {
						sourceCode
							.getDeclaredVariables(node)
							.forEach(checkVariable);
					}
				},
			};
		},
	};
	return noConstAssign;
}

/**
 * @fileoverview Rule to flag constant comparisons and logical expressions that always/never short circuit
 * @author Jordan Eldredge <https://jordaneldredge.com>
 */

var noConstantBinaryExpression;
var hasRequiredNoConstantBinaryExpression;

function requireNoConstantBinaryExpression () {
	if (hasRequiredNoConstantBinaryExpression) return noConstantBinaryExpression;
	hasRequiredNoConstantBinaryExpression = 1;

	const {
		isNullLiteral,
		isConstant,
		isReferenceToGlobalVariable,
		isLogicalAssignmentOperator,
		ECMASCRIPT_GLOBALS,
	} = requireAstUtils();

	const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set([
		"+",
		"-",
		"*",
		"/",
		"%",
		"|",
		"^",
		"&",
		"**",
		"<<",
		">>",
		">>>",
	]);

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a node is `null` or `undefined`. Similar to the one
	 * found in ast-utils.js, but this one correctly handles the edge case that
	 * `undefined` has been redefined.
	 * @param {Scope} scope Scope in which the expression was found.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} Whether or not the node is a `null` or `undefined`.
	 * @public
	 */
	function isNullOrUndefined(scope, node) {
		return (
			isNullLiteral(node) ||
			(node.type === "Identifier" &&
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)) ||
			(node.type === "UnaryExpression" && node.operator === "void")
		);
	}

	/**
	 * Test if an AST node has a statically knowable constant nullishness. Meaning,
	 * it will always resolve to a constant value of either: `null`, `undefined`
	 * or not `null` _or_ `undefined`. An expression that can vary between those
	 * three states at runtime would return `false`.
	 * @param {Scope} scope The scope in which the node was found.
	 * @param {ASTNode} node The AST node being tested.
	 * @param {boolean} nonNullish if `true` then nullish values are not considered constant.
	 * @returns {boolean} Does `node` have constant nullishness?
	 */
	function hasConstantNullishness(scope, node, nonNullish) {
		if (nonNullish && isNullOrUndefined(scope, node)) {
			return false;
		}

		switch (node.type) {
			case "ObjectExpression": // Objects are never nullish
			case "ArrayExpression": // Arrays are never nullish
			case "ArrowFunctionExpression": // Functions never nullish
			case "FunctionExpression": // Functions are never nullish
			case "ClassExpression": // Classes are never nullish
			case "NewExpression": // Objects are never nullish
			case "Literal": // Nullish, or non-nullish, literals never change
			case "TemplateLiteral": // A string is never nullish
			case "UpdateExpression": // Numbers are never nullish
			case "BinaryExpression": // Numbers, strings, or booleans are never nullish
				return true;
			case "CallExpression": {
				if (node.callee.type !== "Identifier") {
					return false;
				}
				const functionName = node.callee.name;

				return (
					(functionName === "Boolean" ||
						functionName === "String" ||
						functionName === "Number") &&
					isReferenceToGlobalVariable(scope, node.callee)
				);
			}
			case "LogicalExpression": {
				return (
					node.operator === "??" &&
					hasConstantNullishness(scope, node.right, true)
				);
			}
			case "AssignmentExpression":
				if (node.operator === "=") {
					return hasConstantNullishness(scope, node.right, nonNullish);
				}

				/*
				 * Handling short-circuiting assignment operators would require
				 * walking the scope. We won't attempt that (for now...) /
				 */
				if (isLogicalAssignmentOperator(node.operator)) {
					return false;
				}

				/*
				 * The remaining assignment expressions all result in a numeric or
				 * string (non-nullish) value:
				 *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
				 */

				return true;
			case "UnaryExpression":
				/*
				 * "void" Always returns `undefined`
				 * "typeof" All types are strings, and thus non-nullish
				 * "!" Boolean is never nullish
				 * "delete" Returns a boolean, which is never nullish
				 * Math operators always return numbers or strings, neither of which
				 * are non-nullish "+", "-", "~"
				 */

				return true;
			case "SequenceExpression": {
				const last = node.expressions.at(-1);

				return hasConstantNullishness(scope, last, nonNullish);
			}
			case "Identifier":
				return (
					node.name === "undefined" &&
					isReferenceToGlobalVariable(scope, node)
				);
			case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
			case "JSXFragment":
				return false;
			default:
				return false;
		}
	}

	/**
	 * Test if an AST node is a boolean value that never changes. Specifically we
	 * test for:
	 * 1. Literal booleans (`true` or `false`)
	 * 2. Unary `!` expressions with a constant value
	 * 3. Constant booleans created via the `Boolean` global function
	 * @param {Scope} scope The scope in which the node was found.
	 * @param {ASTNode} node The node to test
	 * @returns {boolean} Is `node` guaranteed to be a boolean?
	 */
	function isStaticBoolean(scope, node) {
		switch (node.type) {
			case "Literal":
				return typeof node.value === "boolean";
			case "CallExpression":
				return (
					node.callee.type === "Identifier" &&
					node.callee.name === "Boolean" &&
					isReferenceToGlobalVariable(scope, node.callee) &&
					(node.arguments.length === 0 ||
						isConstant(scope, node.arguments[0], true))
				);
			case "UnaryExpression":
				return (
					node.operator === "!" && isConstant(scope, node.argument, true)
				);
			default:
				return false;
		}
	}

	/**
	 * Test if an AST node will always give the same result when compared to a
	 * boolean value. Note that comparison to boolean values is different than
	 * truthiness.
	 * https://262.ecma-international.org/5.1/#sec-11.9.3
	 *
	 * JavaScript `==` operator works by converting the boolean to `1` (true) or
	 * `+0` (false) and then checks the values `==` equality to that number.
	 * @param {Scope} scope The scope in which node was found.
	 * @param {ASTNode} node The node to test.
	 * @returns {boolean} Will `node` always coerce to the same boolean value?
	 */
	function hasConstantLooseBooleanComparison(scope, node) {
		switch (node.type) {
			case "ObjectExpression":
			case "ClassExpression":
				/**
				 * In theory objects like:
				 *
				 * `{toString: () => a}`
				 * `{valueOf: () => a}`
				 *
				 * Or a classes like:
				 *
				 * `class { static toString() { return a } }`
				 * `class { static valueOf() { return a } }`
				 *
				 * Are not constant verifiably when `inBooleanPosition` is
				 * false, but it's an edge case we've opted not to handle.
				 */
				return true;
			case "ArrayExpression": {
				const nonSpreadElements = node.elements.filter(
					e =>
						// Elements can be `null` in sparse arrays: `[,,]`;
						e !== null && e.type !== "SpreadElement",
				);

				/*
				 * Possible future direction if needed: We could check if the
				 * single value would result in variable boolean comparison.
				 * For now we will err on the side of caution since `[x]` could
				 * evaluate to `[0]` or `[1]`.
				 */
				return node.elements.length === 0 || nonSpreadElements.length > 1;
			}
			case "ArrowFunctionExpression":
			case "FunctionExpression":
				return true;
			case "UnaryExpression":
				if (
					node.operator === "void" || // Always returns `undefined`
					node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1.
				) {
					return true;
				}
				if (node.operator === "!") {
					return isConstant(scope, node.argument, true);
				}

				/*
				 * We won't try to reason about +, -, ~, or delete
				 * In theory, for the mathematical operators, we could look at the
				 * argument and try to determine if it coerces to a constant numeric
				 * value.
				 */
				return false;
			case "NewExpression": // Objects might have custom `.valueOf` or `.toString`.
				return false;
			case "CallExpression": {
				if (
					node.callee.type === "Identifier" &&
					node.callee.name === "Boolean" &&
					isReferenceToGlobalVariable(scope, node.callee)
				) {
					return (
						node.arguments.length === 0 ||
						isConstant(scope, node.arguments[0], true)
					);
				}
				return false;
			}
			case "Literal": // True or false, literals never change
				return true;
			case "Identifier":
				return (
					node.name === "undefined" &&
					isReferenceToGlobalVariable(scope, node)
				);
			case "TemplateLiteral":
				/*
				 * In theory we could try to check if the quasi are sufficient to
				 * prove that the expression will always be true, but it would be
				 * tricky to get right. For example: `000.${foo}000`
				 */
				return node.expressions.length === 0;
			case "AssignmentExpression":
				if (node.operator === "=") {
					return hasConstantLooseBooleanComparison(scope, node.right);
				}

				/*
				 * Handling short-circuiting assignment operators would require
				 * walking the scope. We won't attempt that (for now...)
				 *
				 * The remaining assignment expressions all result in a numeric or
				 * string (non-nullish) values which could be truthy or falsy:
				 *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
				 */
				return false;
			case "SequenceExpression": {
				const last = node.expressions.at(-1);

				return hasConstantLooseBooleanComparison(scope, last);
			}
			case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
			case "JSXFragment":
				return false;
			default:
				return false;
		}
	}

	/**
	 * Test if an AST node will always give the same result when _strictly_ compared
	 * to a boolean value. This can happen if the expression can never be boolean, or
	 * if it is always the same boolean value.
	 * @param {Scope} scope The scope in which the node was found.
	 * @param {ASTNode} node The node to test
	 * @returns {boolean} Will `node` always give the same result when compared to a
	 * static boolean value?
	 */
	function hasConstantStrictBooleanComparison(scope, node) {
		switch (node.type) {
			case "ObjectExpression": // Objects are not booleans
			case "ArrayExpression": // Arrays are not booleans
			case "ArrowFunctionExpression": // Functions are not booleans
			case "FunctionExpression":
			case "ClassExpression": // Classes are not booleans
			case "NewExpression": // Objects are not booleans
			case "TemplateLiteral": // Strings are not booleans
			case "Literal": // True, false, or not boolean, literals never change.
			case "UpdateExpression": // Numbers are not booleans
				return true;
			case "BinaryExpression":
				return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator);
			case "UnaryExpression": {
				if (node.operator === "delete") {
					return false;
				}
				if (node.operator === "!") {
					return isConstant(scope, node.argument, true);
				}

				/*
				 * The remaining operators return either strings or numbers, neither
				 * of which are boolean.
				 */
				return true;
			}
			case "SequenceExpression": {
				const last = node.expressions.at(-1);

				return hasConstantStrictBooleanComparison(scope, last);
			}
			case "Identifier":
				return (
					node.name === "undefined" &&
					isReferenceToGlobalVariable(scope, node)
				);
			case "AssignmentExpression":
				if (node.operator === "=") {
					return hasConstantStrictBooleanComparison(scope, node.right);
				}

				/*
				 * Handling short-circuiting assignment operators would require
				 * walking the scope. We won't attempt that (for now...)
				 */
				if (isLogicalAssignmentOperator(node.operator)) {
					return false;
				}

				/*
				 * The remaining assignment expressions all result in either a number
				 * or a string, neither of which can ever be boolean.
				 */
				return true;
			case "CallExpression": {
				if (node.callee.type !== "Identifier") {
					return false;
				}
				const functionName = node.callee.name;

				if (
					(functionName === "String" || functionName === "Number") &&
					isReferenceToGlobalVariable(scope, node.callee)
				) {
					return true;
				}
				if (
					functionName === "Boolean" &&
					isReferenceToGlobalVariable(scope, node.callee)
				) {
					return (
						node.arguments.length === 0 ||
						isConstant(scope, node.arguments[0], true)
					);
				}
				return false;
			}
			case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
			case "JSXFragment":
				return false;
			default:
				return false;
		}
	}

	/**
	 * Test if an AST node will always result in a newly constructed object
	 * @param {Scope} scope The scope in which the node was found.
	 * @param {ASTNode} node The node to test
	 * @returns {boolean} Will `node` always be new?
	 */
	function isAlwaysNew(scope, node) {
		switch (node.type) {
			case "ObjectExpression":
			case "ArrayExpression":
			case "ArrowFunctionExpression":
			case "FunctionExpression":
			case "ClassExpression":
				return true;
			case "NewExpression": {
				if (node.callee.type !== "Identifier") {
					return false;
				}

				/*
				 * All the built-in constructors are always new, but
				 * user-defined constructors could return a sentinel
				 * object.
				 *
				 * Catching these is especially useful for primitive constructors
				 * which return boxed values, a surprising gotcha' in JavaScript.
				 */
				return (
					Object.hasOwn(ECMASCRIPT_GLOBALS, node.callee.name) &&
					isReferenceToGlobalVariable(scope, node.callee)
				);
			}
			case "Literal":
				// Regular expressions are objects, and thus always new
				return typeof node.regex === "object";
			case "SequenceExpression": {
				const last = node.expressions.at(-1);

				return isAlwaysNew(scope, last);
			}
			case "AssignmentExpression":
				if (node.operator === "=") {
					return isAlwaysNew(scope, node.right);
				}
				return false;
			case "ConditionalExpression":
				return (
					isAlwaysNew(scope, node.consequent) &&
					isAlwaysNew(scope, node.alternate)
				);
			case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
			case "JSXFragment":
				return false;
			default:
				return false;
		}
	}

	/**
	 * Checks if one operand will cause the result to be constant.
	 * @param {Scope} scope Scope in which the expression was found.
	 * @param {ASTNode} a One side of the expression
	 * @param {ASTNode} b The other side of the expression
	 * @param {string} operator The binary expression operator
	 * @returns {ASTNode | null} The node which will cause the expression to have a constant result.
	 */
	function findBinaryExpressionConstantOperand(scope, a, b, operator) {
		if (operator === "==" || operator === "!=") {
			if (
				(isNullOrUndefined(scope, a) &&
					hasConstantNullishness(scope, b, false)) ||
				(isStaticBoolean(scope, a) &&
					hasConstantLooseBooleanComparison(scope, b))
			) {
				return b;
			}
		} else if (operator === "===" || operator === "!==") {
			if (
				(isNullOrUndefined(scope, a) &&
					hasConstantNullishness(scope, b, false)) ||
				(isStaticBoolean(scope, a) &&
					hasConstantStrictBooleanComparison(scope, b))
			) {
				return b;
			}
		}
		return null;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConstantBinaryExpression = {
		meta: {
			type: "problem",
			docs: {
				description:
					"Disallow expressions where the operation doesn't affect the value",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-constant-binary-expression",
			},
			schema: [],
			messages: {
				constantBinaryOperand:
					"Unexpected constant binary expression. Compares constantly with the {{otherSide}}-hand side of the `{{operator}}`.",
				constantShortCircuit:
					"Unexpected constant {{property}} on the left-hand side of a `{{operator}}` expression.",
				alwaysNew:
					"Unexpected comparison to newly constructed object. These two values can never be equal.",
				bothAlwaysNew:
					"Unexpected comparison of two newly constructed objects. These two values can never be equal.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				LogicalExpression(node) {
					const { operator, left } = node;
					const scope = sourceCode.getScope(node);

					if (
						(operator === "&&" || operator === "||") &&
						isConstant(scope, left, true)
					) {
						context.report({
							node: left,
							messageId: "constantShortCircuit",
							data: { property: "truthiness", operator },
						});
					} else if (
						operator === "??" &&
						hasConstantNullishness(scope, left, false)
					) {
						context.report({
							node: left,
							messageId: "constantShortCircuit",
							data: { property: "nullishness", operator },
						});
					}
				},
				BinaryExpression(node) {
					const scope = sourceCode.getScope(node);
					const { right, left, operator } = node;
					const rightConstantOperand =
						findBinaryExpressionConstantOperand(
							scope,
							left,
							right,
							operator,
						);
					const leftConstantOperand = findBinaryExpressionConstantOperand(
						scope,
						right,
						left,
						operator,
					);

					if (rightConstantOperand) {
						context.report({
							node: rightConstantOperand,
							messageId: "constantBinaryOperand",
							data: { operator, otherSide: "left" },
						});
					} else if (leftConstantOperand) {
						context.report({
							node: leftConstantOperand,
							messageId: "constantBinaryOperand",
							data: { operator, otherSide: "right" },
						});
					} else if (operator === "===" || operator === "!==") {
						if (isAlwaysNew(scope, left)) {
							context.report({ node: left, messageId: "alwaysNew" });
						} else if (isAlwaysNew(scope, right)) {
							context.report({ node: right, messageId: "alwaysNew" });
						}
					} else if (operator === "==" || operator === "!=") {
						/*
						 * If both sides are "new", then both sides are objects and
						 * therefore they will be compared by reference even with `==`
						 * equality.
						 */
						if (isAlwaysNew(scope, left) && isAlwaysNew(scope, right)) {
							context.report({
								node: left,
								messageId: "bothAlwaysNew",
							});
						}
					}
				},

				/*
				 * In theory we could handle short-circuiting assignment operators,
				 * for some constant values, but that would require walking the
				 * scope to find the value of the variable being assigned. This is
				 * dependant on https://github.com/eslint/eslint/issues/13776
				 *
				 * AssignmentExpression() {},
				 */
			};
		},
	};
	return noConstantBinaryExpression;
}

/**
 * @fileoverview Rule to flag use constant conditions
 * @author Christian Schulz <http://rndm.de>
 */

var noConstantCondition;
var hasRequiredNoConstantCondition;

function requireNoConstantCondition () {
	if (hasRequiredNoConstantCondition) return noConstantCondition;
	hasRequiredNoConstantCondition = 1;

	const { isConstant } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConstantCondition = {
		meta: {
			type: "problem",

			defaultOptions: [{ checkLoops: "allExceptWhileTrue" }],

			docs: {
				description: "Disallow constant expressions in conditions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-constant-condition",
			},

			schema: [
				{
					type: "object",
					properties: {
						checkLoops: {
							enum: [
								"all",
								"allExceptWhileTrue",
								"none",
								true,
								false,
							],
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "Unexpected constant condition.",
			},
		},

		create(context) {
			const loopSetStack = [];
			const sourceCode = context.sourceCode;
			let [{ checkLoops }] = context.options;

			if (checkLoops === true) {
				checkLoops = "all";
			} else if (checkLoops === false) {
				checkLoops = "none";
			}

			let loopsInCurrentScope = new Set();

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Tracks when the given node contains a constant condition.
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 * @private
			 */
			function trackConstantConditionLoop(node) {
				if (
					node.test &&
					isConstant(sourceCode.getScope(node), node.test, true)
				) {
					loopsInCurrentScope.add(node);
				}
			}

			/**
			 * Reports when the set contains the given constant condition node
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 * @private
			 */
			function checkConstantConditionLoopInSet(node) {
				if (loopsInCurrentScope.has(node)) {
					loopsInCurrentScope.delete(node);
					context.report({ node: node.test, messageId: "unexpected" });
				}
			}

			/**
			 * Reports when the given node contains a constant condition.
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 * @private
			 */
			function reportIfConstant(node) {
				if (
					node.test &&
					isConstant(sourceCode.getScope(node), node.test, true)
				) {
					context.report({ node: node.test, messageId: "unexpected" });
				}
			}

			/**
			 * Stores current set of constant loops in loopSetStack temporarily
			 * and uses a new set to track constant loops
			 * @returns {void}
			 * @private
			 */
			function enterFunction() {
				loopSetStack.push(loopsInCurrentScope);
				loopsInCurrentScope = new Set();
			}

			/**
			 * Reports when the set still contains stored constant conditions
			 * @returns {void}
			 * @private
			 */
			function exitFunction() {
				loopsInCurrentScope = loopSetStack.pop();
			}

			/**
			 * Checks node when checkLoops option is enabled
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 * @private
			 */
			function checkLoop(node) {
				if (checkLoops === "all" || checkLoops === "allExceptWhileTrue") {
					trackConstantConditionLoop(node);
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ConditionalExpression: reportIfConstant,
				IfStatement: reportIfConstant,
				WhileStatement(node) {
					if (
						node.test.type === "Literal" &&
						node.test.value === true &&
						checkLoops === "allExceptWhileTrue"
					) {
						return;
					}

					checkLoop(node);
				},
				"WhileStatement:exit": checkConstantConditionLoopInSet,
				DoWhileStatement: checkLoop,
				"DoWhileStatement:exit": checkConstantConditionLoopInSet,
				ForStatement: checkLoop,
				"ForStatement > .test": node => checkLoop(node.parent),
				"ForStatement:exit": checkConstantConditionLoopInSet,
				FunctionDeclaration: enterFunction,
				"FunctionDeclaration:exit": exitFunction,
				FunctionExpression: enterFunction,
				"FunctionExpression:exit": exitFunction,
				YieldExpression: () => loopsInCurrentScope.clear(),
			};
		},
	};
	return noConstantCondition;
}

/**
 * @fileoverview Rule to disallow returning value from constructor.
 * @author Pig Fang <https://github.com/g-plane>
 */

var noConstructorReturn;
var hasRequiredNoConstructorReturn;

function requireNoConstructorReturn () {
	if (hasRequiredNoConstructorReturn) return noConstructorReturn;
	hasRequiredNoConstructorReturn = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noConstructorReturn = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow returning value from constructor",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-constructor-return",
			},

			schema: [],

			fixable: null,

			messages: {
				unexpected: "Unexpected return statement in constructor.",
			},
		},

		create(context) {
			const stack = [];

			return {
				onCodePathStart(_, node) {
					stack.push(node);
				},
				onCodePathEnd() {
					stack.pop();
				},
				ReturnStatement(node) {
					const last = stack.at(-1);

					if (!last.parent) {
						return;
					}

					if (
						last.parent.type === "MethodDefinition" &&
						last.parent.kind === "constructor" &&
						node.argument
					) {
						context.report({
							node,
							messageId: "unexpected",
						});
					}
				},
			};
		},
	};
	return noConstructorReturn;
}

/**
 * @fileoverview Rule to flag use of continue statement
 * @author Borislav Zhivkov
 */

var noContinue;
var hasRequiredNoContinue;

function requireNoContinue () {
	if (hasRequiredNoContinue) return noContinue;
	hasRequiredNoContinue = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noContinue = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `continue` statements",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-continue",
			},

			schema: [],

			messages: {
				unexpected: "Unexpected use of continue statement.",
			},
		},

		create(context) {
			return {
				ContinueStatement(node) {
					context.report({ node, messageId: "unexpected" });
				},
			};
		},
	};
	return noContinue;
}

var regexpp = {};

var hasRequiredRegexpp;

function requireRegexpp () {
	if (hasRequiredRegexpp) return regexpp;
	hasRequiredRegexpp = 1;

	Object.defineProperty(regexpp, '__esModule', { value: true });

	var ast = /*#__PURE__*/Object.freeze({
	    __proto__: null
	});

	const latestEcmaVersion = 2025;

	let largeIdStartRanges = undefined;
	let largeIdContinueRanges = undefined;
	function isIdStart(cp) {
	    if (cp < 0x41)
	        return false;
	    if (cp < 0x5b)
	        return true;
	    if (cp < 0x61)
	        return false;
	    if (cp < 0x7b)
	        return true;
	    return isLargeIdStart(cp);
	}
	function isIdContinue(cp) {
	    if (cp < 0x30)
	        return false;
	    if (cp < 0x3a)
	        return true;
	    if (cp < 0x41)
	        return false;
	    if (cp < 0x5b)
	        return true;
	    if (cp === 0x5f)
	        return true;
	    if (cp < 0x61)
	        return false;
	    if (cp < 0x7b)
	        return true;
	    return isLargeIdStart(cp) || isLargeIdContinue(cp);
	}
	function isLargeIdStart(cp) {
	    return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges()));
	}
	function isLargeIdContinue(cp) {
	    return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges()));
	}
	function initLargeIdStartRanges() {
	    return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1u 3 1 2 0 2 7 m f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 2 1o s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 16 9 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 ds 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk g h9 1wj f1 15v 3t6 6 38f");
	}
	function initLargeIdContinueRanges() {
	    return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 28 3 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 9j 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 k6 6 32 6 6 9 3o7 9 gvt3 6n");
	}
	function isInRange(cp, ranges) {
	    let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
	    while (l < r) {
	        i = ((l + r) / 2) | 0;
	        min = ranges[2 * i];
	        max = ranges[2 * i + 1];
	        if (cp < min) {
	            r = i;
	        }
	        else if (cp > max) {
	            l = i + 1;
	        }
	        else {
	            return true;
	        }
	    }
	    return false;
	}
	function restoreRanges(data) {
	    let last = 0;
	    return data.split(" ").map((s) => (last += parseInt(s, 36) | 0));
	}

	class DataSet {
	    constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025) {
	        this._raw2018 = raw2018;
	        this._raw2019 = raw2019;
	        this._raw2020 = raw2020;
	        this._raw2021 = raw2021;
	        this._raw2022 = raw2022;
	        this._raw2023 = raw2023;
	        this._raw2024 = raw2024;
	        this._raw2025 = raw2025;
	    }
	    get es2018() {
	        var _a;
	        return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" "))));
	    }
	    get es2019() {
	        var _a;
	        return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" "))));
	    }
	    get es2020() {
	        var _a;
	        return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" "))));
	    }
	    get es2021() {
	        var _a;
	        return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" "))));
	    }
	    get es2022() {
	        var _a;
	        return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" "))));
	    }
	    get es2023() {
	        var _a;
	        return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" "))));
	    }
	    get es2024() {
	        var _a;
	        return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" "))));
	    }
	    get es2025() {
	        var _a;
	        return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" "))));
	    }
	}
	const gcNameSet = new Set(["General_Category", "gc"]);
	const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
	const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", "");
	const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", "", "");
	const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", "");
	const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", "");
	function isValidUnicodeProperty(version, name, value) {
	    if (gcNameSet.has(name)) {
	        return version >= 2018 && gcValueSets.es2018.has(value);
	    }
	    if (scNameSet.has(name)) {
	        return ((version >= 2018 && scValueSets.es2018.has(value)) ||
	            (version >= 2019 && scValueSets.es2019.has(value)) ||
	            (version >= 2020 && scValueSets.es2020.has(value)) ||
	            (version >= 2021 && scValueSets.es2021.has(value)) ||
	            (version >= 2022 && scValueSets.es2022.has(value)) ||
	            (version >= 2023 && scValueSets.es2023.has(value)));
	    }
	    return false;
	}
	function isValidLoneUnicodeProperty(version, value) {
	    return ((version >= 2018 && binPropertySets.es2018.has(value)) ||
	        (version >= 2019 && binPropertySets.es2019.has(value)) ||
	        (version >= 2021 && binPropertySets.es2021.has(value)));
	}
	function isValidLoneUnicodePropertyOfString(version, value) {
	    return version >= 2024 && binPropertyOfStringsSets.es2024.has(value);
	}

	const BACKSPACE = 0x08;
	const CHARACTER_TABULATION = 0x09;
	const LINE_FEED = 0x0a;
	const LINE_TABULATION = 0x0b;
	const FORM_FEED = 0x0c;
	const CARRIAGE_RETURN = 0x0d;
	const EXCLAMATION_MARK = 0x21;
	const NUMBER_SIGN = 0x23;
	const DOLLAR_SIGN = 0x24;
	const PERCENT_SIGN = 0x25;
	const AMPERSAND = 0x26;
	const LEFT_PARENTHESIS = 0x28;
	const RIGHT_PARENTHESIS = 0x29;
	const ASTERISK = 0x2a;
	const PLUS_SIGN = 0x2b;
	const COMMA = 0x2c;
	const HYPHEN_MINUS = 0x2d;
	const FULL_STOP = 0x2e;
	const SOLIDUS = 0x2f;
	const DIGIT_ZERO = 0x30;
	const DIGIT_ONE = 0x31;
	const DIGIT_SEVEN = 0x37;
	const DIGIT_NINE = 0x39;
	const COLON = 0x3a;
	const SEMICOLON = 0x3b;
	const LESS_THAN_SIGN = 0x3c;
	const EQUALS_SIGN = 0x3d;
	const GREATER_THAN_SIGN = 0x3e;
	const QUESTION_MARK = 0x3f;
	const COMMERCIAL_AT = 0x40;
	const LATIN_CAPITAL_LETTER_A = 0x41;
	const LATIN_CAPITAL_LETTER_B = 0x42;
	const LATIN_CAPITAL_LETTER_D = 0x44;
	const LATIN_CAPITAL_LETTER_F = 0x46;
	const LATIN_CAPITAL_LETTER_P = 0x50;
	const LATIN_CAPITAL_LETTER_S = 0x53;
	const LATIN_CAPITAL_LETTER_W = 0x57;
	const LATIN_CAPITAL_LETTER_Z = 0x5a;
	const LOW_LINE = 0x5f;
	const LATIN_SMALL_LETTER_A = 0x61;
	const LATIN_SMALL_LETTER_B = 0x62;
	const LATIN_SMALL_LETTER_C = 0x63;
	const LATIN_SMALL_LETTER_D = 0x64;
	const LATIN_SMALL_LETTER_F = 0x66;
	const LATIN_SMALL_LETTER_G = 0x67;
	const LATIN_SMALL_LETTER_I = 0x69;
	const LATIN_SMALL_LETTER_K = 0x6b;
	const LATIN_SMALL_LETTER_M = 0x6d;
	const LATIN_SMALL_LETTER_N = 0x6e;
	const LATIN_SMALL_LETTER_P = 0x70;
	const LATIN_SMALL_LETTER_Q = 0x71;
	const LATIN_SMALL_LETTER_R = 0x72;
	const LATIN_SMALL_LETTER_S = 0x73;
	const LATIN_SMALL_LETTER_T = 0x74;
	const LATIN_SMALL_LETTER_U = 0x75;
	const LATIN_SMALL_LETTER_V = 0x76;
	const LATIN_SMALL_LETTER_W = 0x77;
	const LATIN_SMALL_LETTER_X = 0x78;
	const LATIN_SMALL_LETTER_Y = 0x79;
	const LATIN_SMALL_LETTER_Z = 0x7a;
	const LEFT_SQUARE_BRACKET = 0x5b;
	const REVERSE_SOLIDUS = 0x5c;
	const RIGHT_SQUARE_BRACKET = 0x5d;
	const CIRCUMFLEX_ACCENT = 0x5e;
	const GRAVE_ACCENT = 0x60;
	const LEFT_CURLY_BRACKET = 0x7b;
	const VERTICAL_LINE = 0x7c;
	const RIGHT_CURLY_BRACKET = 0x7d;
	const TILDE = 0x7e;
	const ZERO_WIDTH_NON_JOINER = 0x200c;
	const ZERO_WIDTH_JOINER = 0x200d;
	const LINE_SEPARATOR = 0x2028;
	const PARAGRAPH_SEPARATOR = 0x2029;
	const MIN_CODE_POINT = 0x00;
	const MAX_CODE_POINT = 0x10ffff;
	function isLatinLetter(code) {
	    return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) ||
	        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z));
	}
	function isDecimalDigit(code) {
	    return code >= DIGIT_ZERO && code <= DIGIT_NINE;
	}
	function isOctalDigit(code) {
	    return code >= DIGIT_ZERO && code <= DIGIT_SEVEN;
	}
	function isHexDigit(code) {
	    return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) ||
	        (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) ||
	        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F));
	}
	function isLineTerminator(code) {
	    return (code === LINE_FEED ||
	        code === CARRIAGE_RETURN ||
	        code === LINE_SEPARATOR ||
	        code === PARAGRAPH_SEPARATOR);
	}
	function isValidUnicode(code) {
	    return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT;
	}
	function digitToInt(code) {
	    if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) {
	        return code - LATIN_SMALL_LETTER_A + 10;
	    }
	    if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) {
	        return code - LATIN_CAPITAL_LETTER_A + 10;
	    }
	    return code - DIGIT_ZERO;
	}
	function isLeadSurrogate(code) {
	    return code >= 0xd800 && code <= 0xdbff;
	}
	function isTrailSurrogate(code) {
	    return code >= 0xdc00 && code <= 0xdfff;
	}
	function combineSurrogatePair(lead, trail) {
	    return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
	}

	class GroupSpecifiersAsES2018 {
	    constructor() {
	        this.groupName = new Set();
	    }
	    clear() {
	        this.groupName.clear();
	    }
	    isEmpty() {
	        return !this.groupName.size;
	    }
	    hasInPattern(name) {
	        return this.groupName.has(name);
	    }
	    hasInScope(name) {
	        return this.hasInPattern(name);
	    }
	    addToScope(name) {
	        this.groupName.add(name);
	    }
	    enterDisjunction() {
	    }
	    enterAlternative() {
	    }
	    leaveDisjunction() {
	    }
	}
	class BranchID {
	    constructor(parent, base) {
	        this.parent = parent;
	        this.base = base !== null && base !== void 0 ? base : this;
	    }
	    separatedFrom(other) {
	        var _a, _b;
	        if (this.base === other.base && this !== other) {
	            return true;
	        }
	        if (other.parent && this.separatedFrom(other.parent)) {
	            return true;
	        }
	        return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false;
	    }
	    child() {
	        return new BranchID(this, null);
	    }
	    sibling() {
	        return new BranchID(this.parent, this.base);
	    }
	}
	class GroupSpecifiersAsES2025 {
	    constructor() {
	        this.branchID = new BranchID(null, null);
	        this.groupNames = new Map();
	    }
	    clear() {
	        this.branchID = new BranchID(null, null);
	        this.groupNames.clear();
	    }
	    isEmpty() {
	        return !this.groupNames.size;
	    }
	    enterDisjunction() {
	        this.branchID = this.branchID.child();
	    }
	    enterAlternative(index) {
	        if (index === 0) {
	            return;
	        }
	        this.branchID = this.branchID.sibling();
	    }
	    leaveDisjunction() {
	        this.branchID = this.branchID.parent;
	    }
	    hasInPattern(name) {
	        return this.groupNames.has(name);
	    }
	    hasInScope(name) {
	        const branches = this.groupNames.get(name);
	        if (!branches) {
	            return false;
	        }
	        for (const branch of branches) {
	            if (!branch.separatedFrom(this.branchID)) {
	                return true;
	            }
	        }
	        return false;
	    }
	    addToScope(name) {
	        const branches = this.groupNames.get(name);
	        if (branches) {
	            branches.push(this.branchID);
	            return;
	        }
	        this.groupNames.set(name, [this.branchID]);
	    }
	}

	const legacyImpl = {
	    at(s, end, i) {
	        return i < end ? s.charCodeAt(i) : -1;
	    },
	    width(c) {
	        return 1;
	    },
	};
	const unicodeImpl = {
	    at(s, end, i) {
	        return i < end ? s.codePointAt(i) : -1;
	    },
	    width(c) {
	        return c > 0xffff ? 2 : 1;
	    },
	};
	class Reader {
	    constructor() {
	        this._impl = legacyImpl;
	        this._s = "";
	        this._i = 0;
	        this._end = 0;
	        this._cp1 = -1;
	        this._w1 = 1;
	        this._cp2 = -1;
	        this._w2 = 1;
	        this._cp3 = -1;
	        this._w3 = 1;
	        this._cp4 = -1;
	    }
	    get source() {
	        return this._s;
	    }
	    get index() {
	        return this._i;
	    }
	    get currentCodePoint() {
	        return this._cp1;
	    }
	    get nextCodePoint() {
	        return this._cp2;
	    }
	    get nextCodePoint2() {
	        return this._cp3;
	    }
	    get nextCodePoint3() {
	        return this._cp4;
	    }
	    reset(source, start, end, uFlag) {
	        this._impl = uFlag ? unicodeImpl : legacyImpl;
	        this._s = source;
	        this._end = end;
	        this.rewind(start);
	    }
	    rewind(index) {
	        const impl = this._impl;
	        this._i = index;
	        this._cp1 = impl.at(this._s, this._end, index);
	        this._w1 = impl.width(this._cp1);
	        this._cp2 = impl.at(this._s, this._end, index + this._w1);
	        this._w2 = impl.width(this._cp2);
	        this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2);
	        this._w3 = impl.width(this._cp3);
	        this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3);
	    }
	    advance() {
	        if (this._cp1 !== -1) {
	            const impl = this._impl;
	            this._i += this._w1;
	            this._cp1 = this._cp2;
	            this._w1 = this._w2;
	            this._cp2 = this._cp3;
	            this._w2 = impl.width(this._cp2);
	            this._cp3 = this._cp4;
	            this._w3 = impl.width(this._cp3);
	            this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3);
	        }
	    }
	    eat(cp) {
	        if (this._cp1 === cp) {
	            this.advance();
	            return true;
	        }
	        return false;
	    }
	    eat2(cp1, cp2) {
	        if (this._cp1 === cp1 && this._cp2 === cp2) {
	            this.advance();
	            this.advance();
	            return true;
	        }
	        return false;
	    }
	    eat3(cp1, cp2, cp3) {
	        if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) {
	            this.advance();
	            this.advance();
	            this.advance();
	            return true;
	        }
	        return false;
	    }
	}

	class RegExpSyntaxError extends SyntaxError {
	    constructor(message, index) {
	        super(message);
	        this.index = index;
	    }
	}
	function newRegExpSyntaxError(srcCtx, flags, index, message) {
	    let source = "";
	    if (srcCtx.kind === "literal") {
	        const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end);
	        if (literal) {
	            source = `: ${literal}`;
	        }
	    }
	    else if (srcCtx.kind === "pattern") {
	        const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end);
	        const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`;
	        source = `: /${pattern}/${flagsText}`;
	    }
	    return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index);
	}

	const SYNTAX_CHARACTER = new Set([
	    CIRCUMFLEX_ACCENT,
	    DOLLAR_SIGN,
	    REVERSE_SOLIDUS,
	    FULL_STOP,
	    ASTERISK,
	    PLUS_SIGN,
	    QUESTION_MARK,
	    LEFT_PARENTHESIS,
	    RIGHT_PARENTHESIS,
	    LEFT_SQUARE_BRACKET,
	    RIGHT_SQUARE_BRACKET,
	    LEFT_CURLY_BRACKET,
	    RIGHT_CURLY_BRACKET,
	    VERTICAL_LINE,
	]);
	const CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER = new Set([
	    AMPERSAND,
	    EXCLAMATION_MARK,
	    NUMBER_SIGN,
	    DOLLAR_SIGN,
	    PERCENT_SIGN,
	    ASTERISK,
	    PLUS_SIGN,
	    COMMA,
	    FULL_STOP,
	    COLON,
	    SEMICOLON,
	    LESS_THAN_SIGN,
	    EQUALS_SIGN,
	    GREATER_THAN_SIGN,
	    QUESTION_MARK,
	    COMMERCIAL_AT,
	    CIRCUMFLEX_ACCENT,
	    GRAVE_ACCENT,
	    TILDE,
	]);
	const CLASS_SET_SYNTAX_CHARACTER = new Set([
	    LEFT_PARENTHESIS,
	    RIGHT_PARENTHESIS,
	    LEFT_SQUARE_BRACKET,
	    RIGHT_SQUARE_BRACKET,
	    LEFT_CURLY_BRACKET,
	    RIGHT_CURLY_BRACKET,
	    SOLIDUS,
	    HYPHEN_MINUS,
	    REVERSE_SOLIDUS,
	    VERTICAL_LINE,
	]);
	const CLASS_SET_RESERVED_PUNCTUATOR = new Set([
	    AMPERSAND,
	    HYPHEN_MINUS,
	    EXCLAMATION_MARK,
	    NUMBER_SIGN,
	    PERCENT_SIGN,
	    COMMA,
	    COLON,
	    SEMICOLON,
	    LESS_THAN_SIGN,
	    EQUALS_SIGN,
	    GREATER_THAN_SIGN,
	    COMMERCIAL_AT,
	    GRAVE_ACCENT,
	    TILDE,
	]);
	const FLAG_PROP_TO_CODEPOINT = {
	    global: LATIN_SMALL_LETTER_G,
	    ignoreCase: LATIN_SMALL_LETTER_I,
	    multiline: LATIN_SMALL_LETTER_M,
	    unicode: LATIN_SMALL_LETTER_U,
	    sticky: LATIN_SMALL_LETTER_Y,
	    dotAll: LATIN_SMALL_LETTER_S,
	    hasIndices: LATIN_SMALL_LETTER_D,
	    unicodeSets: LATIN_SMALL_LETTER_V,
	};
	const FLAG_CODEPOINT_TO_PROP = Object.fromEntries(Object.entries(FLAG_PROP_TO_CODEPOINT).map(([k, v]) => [v, k]));
	function isSyntaxCharacter(cp) {
	    return SYNTAX_CHARACTER.has(cp);
	}
	function isClassSetReservedDoublePunctuatorCharacter(cp) {
	    return CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER.has(cp);
	}
	function isClassSetSyntaxCharacter(cp) {
	    return CLASS_SET_SYNTAX_CHARACTER.has(cp);
	}
	function isClassSetReservedPunctuator(cp) {
	    return CLASS_SET_RESERVED_PUNCTUATOR.has(cp);
	}
	function isIdentifierStartChar(cp) {
	    return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE;
	}
	function isIdentifierPartChar(cp) {
	    return (isIdContinue(cp) ||
	        cp === DOLLAR_SIGN ||
	        cp === ZERO_WIDTH_NON_JOINER ||
	        cp === ZERO_WIDTH_JOINER);
	}
	function isUnicodePropertyNameCharacter(cp) {
	    return isLatinLetter(cp) || cp === LOW_LINE;
	}
	function isUnicodePropertyValueCharacter(cp) {
	    return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
	}
	function isRegularExpressionModifier(ch) {
	    return (ch === LATIN_SMALL_LETTER_I ||
	        ch === LATIN_SMALL_LETTER_M ||
	        ch === LATIN_SMALL_LETTER_S);
	}
	class RegExpValidator {
	    constructor(options) {
	        this._reader = new Reader();
	        this._unicodeMode = false;
	        this._unicodeSetsMode = false;
	        this._nFlag = false;
	        this._lastIntValue = 0;
	        this._lastRange = {
	            min: 0,
	            max: Number.POSITIVE_INFINITY,
	        };
	        this._lastStrValue = "";
	        this._lastAssertionIsQuantifiable = false;
	        this._numCapturingParens = 0;
	        this._backreferenceNames = new Set();
	        this._srcCtx = null;
	        this._options = options !== null && options !== void 0 ? options : {};
	        this._groupSpecifiers =
	            this.ecmaVersion >= 2025
	                ? new GroupSpecifiersAsES2025()
	                : new GroupSpecifiersAsES2018();
	    }
	    validateLiteral(source, start = 0, end = source.length) {
	        this._srcCtx = { source, start, end, kind: "literal" };
	        this._unicodeSetsMode = this._unicodeMode = this._nFlag = false;
	        this.reset(source, start, end);
	        this.onLiteralEnter(start);
	        if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) {
	            const flagStart = this.index;
	            const unicode = source.includes("u", flagStart);
	            const unicodeSets = source.includes("v", flagStart);
	            this.validateFlagsInternal(source, flagStart, end);
	            this.validatePatternInternal(source, start + 1, flagStart - 1, {
	                unicode,
	                unicodeSets,
	            });
	        }
	        else if (start >= end) {
	            this.raise("Empty");
	        }
	        else {
	            const c = String.fromCodePoint(this.currentCodePoint);
	            this.raise(`Unexpected character '${c}'`);
	        }
	        this.onLiteralLeave(start, end);
	    }
	    validateFlags(source, start = 0, end = source.length) {
	        this._srcCtx = { source, start, end, kind: "flags" };
	        this.validateFlagsInternal(source, start, end);
	    }
	    validatePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
	        this._srcCtx = { source, start, end, kind: "pattern" };
	        this.validatePatternInternal(source, start, end, uFlagOrFlags);
	    }
	    validatePatternInternal(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
	        const mode = this._parseFlagsOptionToMode(uFlagOrFlags, end);
	        this._unicodeMode = mode.unicodeMode;
	        this._nFlag = mode.nFlag;
	        this._unicodeSetsMode = mode.unicodeSetsMode;
	        this.reset(source, start, end);
	        this.consumePattern();
	        if (!this._nFlag &&
	            this.ecmaVersion >= 2018 &&
	            !this._groupSpecifiers.isEmpty()) {
	            this._nFlag = true;
	            this.rewind(start);
	            this.consumePattern();
	        }
	    }
	    validateFlagsInternal(source, start, end) {
	        const flags = this.parseFlags(source, start, end);
	        this.onRegExpFlags(start, end, flags);
	    }
	    _parseFlagsOptionToMode(uFlagOrFlags, sourceEnd) {
	        let unicode = false;
	        let unicodeSets = false;
	        if (uFlagOrFlags && this.ecmaVersion >= 2015) {
	            if (typeof uFlagOrFlags === "object") {
	                unicode = Boolean(uFlagOrFlags.unicode);
	                if (this.ecmaVersion >= 2024) {
	                    unicodeSets = Boolean(uFlagOrFlags.unicodeSets);
	                }
	            }
	            else {
	                unicode = uFlagOrFlags;
	            }
	        }
	        if (unicode && unicodeSets) {
	            this.raise("Invalid regular expression flags", {
	                index: sourceEnd + 1,
	                unicode,
	                unicodeSets,
	            });
	        }
	        const unicodeMode = unicode || unicodeSets;
	        const nFlag = (unicode && this.ecmaVersion >= 2018) ||
	            unicodeSets ||
	            Boolean(this._options.strict && this.ecmaVersion >= 2023);
	        const unicodeSetsMode = unicodeSets;
	        return { unicodeMode, nFlag, unicodeSetsMode };
	    }
	    get strict() {
	        return Boolean(this._options.strict) || this._unicodeMode;
	    }
	    get ecmaVersion() {
	        var _a;
	        return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
	    }
	    onLiteralEnter(start) {
	        if (this._options.onLiteralEnter) {
	            this._options.onLiteralEnter(start);
	        }
	    }
	    onLiteralLeave(start, end) {
	        if (this._options.onLiteralLeave) {
	            this._options.onLiteralLeave(start, end);
	        }
	    }
	    onRegExpFlags(start, end, flags) {
	        if (this._options.onRegExpFlags) {
	            this._options.onRegExpFlags(start, end, flags);
	        }
	        if (this._options.onFlags) {
	            this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices);
	        }
	    }
	    onPatternEnter(start) {
	        if (this._options.onPatternEnter) {
	            this._options.onPatternEnter(start);
	        }
	    }
	    onPatternLeave(start, end) {
	        if (this._options.onPatternLeave) {
	            this._options.onPatternLeave(start, end);
	        }
	    }
	    onDisjunctionEnter(start) {
	        if (this._options.onDisjunctionEnter) {
	            this._options.onDisjunctionEnter(start);
	        }
	    }
	    onDisjunctionLeave(start, end) {
	        if (this._options.onDisjunctionLeave) {
	            this._options.onDisjunctionLeave(start, end);
	        }
	    }
	    onAlternativeEnter(start, index) {
	        if (this._options.onAlternativeEnter) {
	            this._options.onAlternativeEnter(start, index);
	        }
	    }
	    onAlternativeLeave(start, end, index) {
	        if (this._options.onAlternativeLeave) {
	            this._options.onAlternativeLeave(start, end, index);
	        }
	    }
	    onGroupEnter(start) {
	        if (this._options.onGroupEnter) {
	            this._options.onGroupEnter(start);
	        }
	    }
	    onGroupLeave(start, end) {
	        if (this._options.onGroupLeave) {
	            this._options.onGroupLeave(start, end);
	        }
	    }
	    onModifiersEnter(start) {
	        if (this._options.onModifiersEnter) {
	            this._options.onModifiersEnter(start);
	        }
	    }
	    onModifiersLeave(start, end) {
	        if (this._options.onModifiersLeave) {
	            this._options.onModifiersLeave(start, end);
	        }
	    }
	    onAddModifiers(start, end, flags) {
	        if (this._options.onAddModifiers) {
	            this._options.onAddModifiers(start, end, flags);
	        }
	    }
	    onRemoveModifiers(start, end, flags) {
	        if (this._options.onRemoveModifiers) {
	            this._options.onRemoveModifiers(start, end, flags);
	        }
	    }
	    onCapturingGroupEnter(start, name) {
	        if (this._options.onCapturingGroupEnter) {
	            this._options.onCapturingGroupEnter(start, name);
	        }
	    }
	    onCapturingGroupLeave(start, end, name) {
	        if (this._options.onCapturingGroupLeave) {
	            this._options.onCapturingGroupLeave(start, end, name);
	        }
	    }
	    onQuantifier(start, end, min, max, greedy) {
	        if (this._options.onQuantifier) {
	            this._options.onQuantifier(start, end, min, max, greedy);
	        }
	    }
	    onLookaroundAssertionEnter(start, kind, negate) {
	        if (this._options.onLookaroundAssertionEnter) {
	            this._options.onLookaroundAssertionEnter(start, kind, negate);
	        }
	    }
	    onLookaroundAssertionLeave(start, end, kind, negate) {
	        if (this._options.onLookaroundAssertionLeave) {
	            this._options.onLookaroundAssertionLeave(start, end, kind, negate);
	        }
	    }
	    onEdgeAssertion(start, end, kind) {
	        if (this._options.onEdgeAssertion) {
	            this._options.onEdgeAssertion(start, end, kind);
	        }
	    }
	    onWordBoundaryAssertion(start, end, kind, negate) {
	        if (this._options.onWordBoundaryAssertion) {
	            this._options.onWordBoundaryAssertion(start, end, kind, negate);
	        }
	    }
	    onAnyCharacterSet(start, end, kind) {
	        if (this._options.onAnyCharacterSet) {
	            this._options.onAnyCharacterSet(start, end, kind);
	        }
	    }
	    onEscapeCharacterSet(start, end, kind, negate) {
	        if (this._options.onEscapeCharacterSet) {
	            this._options.onEscapeCharacterSet(start, end, kind, negate);
	        }
	    }
	    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
	        if (this._options.onUnicodePropertyCharacterSet) {
	            this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings);
	        }
	    }
	    onCharacter(start, end, value) {
	        if (this._options.onCharacter) {
	            this._options.onCharacter(start, end, value);
	        }
	    }
	    onBackreference(start, end, ref) {
	        if (this._options.onBackreference) {
	            this._options.onBackreference(start, end, ref);
	        }
	    }
	    onCharacterClassEnter(start, negate, unicodeSets) {
	        if (this._options.onCharacterClassEnter) {
	            this._options.onCharacterClassEnter(start, negate, unicodeSets);
	        }
	    }
	    onCharacterClassLeave(start, end, negate) {
	        if (this._options.onCharacterClassLeave) {
	            this._options.onCharacterClassLeave(start, end, negate);
	        }
	    }
	    onCharacterClassRange(start, end, min, max) {
	        if (this._options.onCharacterClassRange) {
	            this._options.onCharacterClassRange(start, end, min, max);
	        }
	    }
	    onClassIntersection(start, end) {
	        if (this._options.onClassIntersection) {
	            this._options.onClassIntersection(start, end);
	        }
	    }
	    onClassSubtraction(start, end) {
	        if (this._options.onClassSubtraction) {
	            this._options.onClassSubtraction(start, end);
	        }
	    }
	    onClassStringDisjunctionEnter(start) {
	        if (this._options.onClassStringDisjunctionEnter) {
	            this._options.onClassStringDisjunctionEnter(start);
	        }
	    }
	    onClassStringDisjunctionLeave(start, end) {
	        if (this._options.onClassStringDisjunctionLeave) {
	            this._options.onClassStringDisjunctionLeave(start, end);
	        }
	    }
	    onStringAlternativeEnter(start, index) {
	        if (this._options.onStringAlternativeEnter) {
	            this._options.onStringAlternativeEnter(start, index);
	        }
	    }
	    onStringAlternativeLeave(start, end, index) {
	        if (this._options.onStringAlternativeLeave) {
	            this._options.onStringAlternativeLeave(start, end, index);
	        }
	    }
	    get index() {
	        return this._reader.index;
	    }
	    get currentCodePoint() {
	        return this._reader.currentCodePoint;
	    }
	    get nextCodePoint() {
	        return this._reader.nextCodePoint;
	    }
	    get nextCodePoint2() {
	        return this._reader.nextCodePoint2;
	    }
	    get nextCodePoint3() {
	        return this._reader.nextCodePoint3;
	    }
	    reset(source, start, end) {
	        this._reader.reset(source, start, end, this._unicodeMode);
	    }
	    rewind(index) {
	        this._reader.rewind(index);
	    }
	    advance() {
	        this._reader.advance();
	    }
	    eat(cp) {
	        return this._reader.eat(cp);
	    }
	    eat2(cp1, cp2) {
	        return this._reader.eat2(cp1, cp2);
	    }
	    eat3(cp1, cp2, cp3) {
	        return this._reader.eat3(cp1, cp2, cp3);
	    }
	    raise(message, context) {
	        var _a, _b, _c;
	        throw newRegExpSyntaxError(this._srcCtx, {
	            unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode),
	            unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode,
	        }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message);
	    }
	    eatRegExpBody() {
	        const start = this.index;
	        let inClass = false;
	        let escaped = false;
	        for (;;) {
	            const cp = this.currentCodePoint;
	            if (cp === -1 || isLineTerminator(cp)) {
	                const kind = inClass ? "character class" : "regular expression";
	                this.raise(`Unterminated ${kind}`);
	            }
	            if (escaped) {
	                escaped = false;
	            }
	            else if (cp === REVERSE_SOLIDUS) {
	                escaped = true;
	            }
	            else if (cp === LEFT_SQUARE_BRACKET) {
	                inClass = true;
	            }
	            else if (cp === RIGHT_SQUARE_BRACKET) {
	                inClass = false;
	            }
	            else if ((cp === SOLIDUS && !inClass) ||
	                (cp === ASTERISK && this.index === start)) {
	                break;
	            }
	            this.advance();
	        }
	        return this.index !== start;
	    }
	    consumePattern() {
	        const start = this.index;
	        this._numCapturingParens = this.countCapturingParens();
	        this._groupSpecifiers.clear();
	        this._backreferenceNames.clear();
	        this.onPatternEnter(start);
	        this.consumeDisjunction();
	        const cp = this.currentCodePoint;
	        if (this.currentCodePoint !== -1) {
	            if (cp === RIGHT_PARENTHESIS) {
	                this.raise("Unmatched ')'");
	            }
	            if (cp === REVERSE_SOLIDUS) {
	                this.raise("\\ at end of pattern");
	            }
	            if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) {
	                this.raise("Lone quantifier brackets");
	            }
	            const c = String.fromCodePoint(cp);
	            this.raise(`Unexpected character '${c}'`);
	        }
	        for (const name of this._backreferenceNames) {
	            if (!this._groupSpecifiers.hasInPattern(name)) {
	                this.raise("Invalid named capture referenced");
	            }
	        }
	        this.onPatternLeave(start, this.index);
	    }
	    countCapturingParens() {
	        const start = this.index;
	        let inClass = false;
	        let escaped = false;
	        let count = 0;
	        let cp = 0;
	        while ((cp = this.currentCodePoint) !== -1) {
	            if (escaped) {
	                escaped = false;
	            }
	            else if (cp === REVERSE_SOLIDUS) {
	                escaped = true;
	            }
	            else if (cp === LEFT_SQUARE_BRACKET) {
	                inClass = true;
	            }
	            else if (cp === RIGHT_SQUARE_BRACKET) {
	                inClass = false;
	            }
	            else if (cp === LEFT_PARENTHESIS &&
	                !inClass &&
	                (this.nextCodePoint !== QUESTION_MARK ||
	                    (this.nextCodePoint2 === LESS_THAN_SIGN &&
	                        this.nextCodePoint3 !== EQUALS_SIGN &&
	                        this.nextCodePoint3 !== EXCLAMATION_MARK))) {
	                count += 1;
	            }
	            this.advance();
	        }
	        this.rewind(start);
	        return count;
	    }
	    consumeDisjunction() {
	        const start = this.index;
	        let i = 0;
	        this._groupSpecifiers.enterDisjunction();
	        this.onDisjunctionEnter(start);
	        do {
	            this.consumeAlternative(i++);
	        } while (this.eat(VERTICAL_LINE));
	        if (this.consumeQuantifier(true)) {
	            this.raise("Nothing to repeat");
	        }
	        if (this.eat(LEFT_CURLY_BRACKET)) {
	            this.raise("Lone quantifier brackets");
	        }
	        this.onDisjunctionLeave(start, this.index);
	        this._groupSpecifiers.leaveDisjunction();
	    }
	    consumeAlternative(i) {
	        const start = this.index;
	        this._groupSpecifiers.enterAlternative(i);
	        this.onAlternativeEnter(start, i);
	        while (this.currentCodePoint !== -1 && this.consumeTerm()) {
	        }
	        this.onAlternativeLeave(start, this.index, i);
	    }
	    consumeTerm() {
	        if (this._unicodeMode || this.strict) {
	            return (this.consumeAssertion() ||
	                (this.consumeAtom() && this.consumeOptionalQuantifier()));
	        }
	        return ((this.consumeAssertion() &&
	            (!this._lastAssertionIsQuantifiable ||
	                this.consumeOptionalQuantifier())) ||
	            (this.consumeExtendedAtom() && this.consumeOptionalQuantifier()));
	    }
	    consumeOptionalQuantifier() {
	        this.consumeQuantifier();
	        return true;
	    }
	    consumeAssertion() {
	        const start = this.index;
	        this._lastAssertionIsQuantifiable = false;
	        if (this.eat(CIRCUMFLEX_ACCENT)) {
	            this.onEdgeAssertion(start, this.index, "start");
	            return true;
	        }
	        if (this.eat(DOLLAR_SIGN)) {
	            this.onEdgeAssertion(start, this.index, "end");
	            return true;
	        }
	        if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) {
	            this.onWordBoundaryAssertion(start, this.index, "word", true);
	            return true;
	        }
	        if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) {
	            this.onWordBoundaryAssertion(start, this.index, "word", false);
	            return true;
	        }
	        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
	            const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN);
	            let negate = false;
	            if (this.eat(EQUALS_SIGN) ||
	                (negate = this.eat(EXCLAMATION_MARK))) {
	                const kind = lookbehind ? "lookbehind" : "lookahead";
	                this.onLookaroundAssertionEnter(start, kind, negate);
	                this.consumeDisjunction();
	                if (!this.eat(RIGHT_PARENTHESIS)) {
	                    this.raise("Unterminated group");
	                }
	                this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
	                this.onLookaroundAssertionLeave(start, this.index, kind, negate);
	                return true;
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeQuantifier(noConsume = false) {
	        const start = this.index;
	        let min = 0;
	        let max = 0;
	        let greedy = false;
	        if (this.eat(ASTERISK)) {
	            min = 0;
	            max = Number.POSITIVE_INFINITY;
	        }
	        else if (this.eat(PLUS_SIGN)) {
	            min = 1;
	            max = Number.POSITIVE_INFINITY;
	        }
	        else if (this.eat(QUESTION_MARK)) {
	            min = 0;
	            max = 1;
	        }
	        else if (this.eatBracedQuantifier(noConsume)) {
	            ({ min, max } = this._lastRange);
	        }
	        else {
	            return false;
	        }
	        greedy = !this.eat(QUESTION_MARK);
	        if (!noConsume) {
	            this.onQuantifier(start, this.index, min, max, greedy);
	        }
	        return true;
	    }
	    eatBracedQuantifier(noError) {
	        const start = this.index;
	        if (this.eat(LEFT_CURLY_BRACKET)) {
	            if (this.eatDecimalDigits()) {
	                const min = this._lastIntValue;
	                let max = min;
	                if (this.eat(COMMA)) {
	                    max = this.eatDecimalDigits()
	                        ? this._lastIntValue
	                        : Number.POSITIVE_INFINITY;
	                }
	                if (this.eat(RIGHT_CURLY_BRACKET)) {
	                    if (!noError && max < min) {
	                        this.raise("numbers out of order in {} quantifier");
	                    }
	                    this._lastRange = { min, max };
	                    return true;
	                }
	            }
	            if (!noError && (this._unicodeMode || this.strict)) {
	                this.raise("Incomplete quantifier");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeAtom() {
	        return (this.consumePatternCharacter() ||
	            this.consumeDot() ||
	            this.consumeReverseSolidusAtomEscape() ||
	            Boolean(this.consumeCharacterClass()) ||
	            this.consumeCapturingGroup() ||
	            this.consumeUncapturingGroup());
	    }
	    consumeDot() {
	        if (this.eat(FULL_STOP)) {
	            this.onAnyCharacterSet(this.index - 1, this.index, "any");
	            return true;
	        }
	        return false;
	    }
	    consumeReverseSolidusAtomEscape() {
	        const start = this.index;
	        if (this.eat(REVERSE_SOLIDUS)) {
	            if (this.consumeAtomEscape()) {
	                return true;
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeUncapturingGroup() {
	        const start = this.index;
	        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
	            this.onGroupEnter(start);
	            if (this.ecmaVersion >= 2025) {
	                this.consumeModifiers();
	            }
	            if (!this.eat(COLON)) {
	                this.rewind(start + 1);
	                this.raise("Invalid group");
	            }
	            this.consumeDisjunction();
	            if (!this.eat(RIGHT_PARENTHESIS)) {
	                this.raise("Unterminated group");
	            }
	            this.onGroupLeave(start, this.index);
	            return true;
	        }
	        return false;
	    }
	    consumeModifiers() {
	        const start = this.index;
	        const hasAddModifiers = this.eatModifiers();
	        const addModifiersEnd = this.index;
	        const hasHyphen = this.eat(HYPHEN_MINUS);
	        if (!hasAddModifiers && !hasHyphen) {
	            return false;
	        }
	        this.onModifiersEnter(start);
	        const addModifiers = this.parseModifiers(start, addModifiersEnd);
	        this.onAddModifiers(start, addModifiersEnd, addModifiers);
	        if (hasHyphen) {
	            const modifiersStart = this.index;
	            if (!this.eatModifiers() &&
	                !hasAddModifiers &&
	                this.currentCodePoint === COLON) {
	                this.raise("Invalid empty flags");
	            }
	            const modifiers = this.parseModifiers(modifiersStart, this.index);
	            for (const [flagName] of Object.entries(modifiers).filter(([, enable]) => enable)) {
	                if (addModifiers[flagName]) {
	                    this.raise(`Duplicated flag '${String.fromCodePoint(FLAG_PROP_TO_CODEPOINT[flagName])}'`);
	                }
	            }
	            this.onRemoveModifiers(modifiersStart, this.index, modifiers);
	        }
	        this.onModifiersLeave(start, this.index);
	        return true;
	    }
	    consumeCapturingGroup() {
	        const start = this.index;
	        if (this.eat(LEFT_PARENTHESIS)) {
	            let name = null;
	            if (this.ecmaVersion >= 2018) {
	                if (this.consumeGroupSpecifier()) {
	                    name = this._lastStrValue;
	                }
	                else if (this.currentCodePoint === QUESTION_MARK) {
	                    this.rewind(start);
	                    return false;
	                }
	            }
	            else if (this.currentCodePoint === QUESTION_MARK) {
	                this.rewind(start);
	                return false;
	            }
	            this.onCapturingGroupEnter(start, name);
	            this.consumeDisjunction();
	            if (!this.eat(RIGHT_PARENTHESIS)) {
	                this.raise("Unterminated group");
	            }
	            this.onCapturingGroupLeave(start, this.index, name);
	            return true;
	        }
	        return false;
	    }
	    consumeExtendedAtom() {
	        return (this.consumeDot() ||
	            this.consumeReverseSolidusAtomEscape() ||
	            this.consumeReverseSolidusFollowedByC() ||
	            Boolean(this.consumeCharacterClass()) ||
	            this.consumeCapturingGroup() ||
	            this.consumeUncapturingGroup() ||
	            this.consumeInvalidBracedQuantifier() ||
	            this.consumeExtendedPatternCharacter());
	    }
	    consumeReverseSolidusFollowedByC() {
	        const start = this.index;
	        if (this.currentCodePoint === REVERSE_SOLIDUS &&
	            this.nextCodePoint === LATIN_SMALL_LETTER_C) {
	            this._lastIntValue = this.currentCodePoint;
	            this.advance();
	            this.onCharacter(start, this.index, REVERSE_SOLIDUS);
	            return true;
	        }
	        return false;
	    }
	    consumeInvalidBracedQuantifier() {
	        if (this.eatBracedQuantifier(true)) {
	            this.raise("Nothing to repeat");
	        }
	        return false;
	    }
	    consumePatternCharacter() {
	        const start = this.index;
	        const cp = this.currentCodePoint;
	        if (cp !== -1 && !isSyntaxCharacter(cp)) {
	            this.advance();
	            this.onCharacter(start, this.index, cp);
	            return true;
	        }
	        return false;
	    }
	    consumeExtendedPatternCharacter() {
	        const start = this.index;
	        const cp = this.currentCodePoint;
	        if (cp !== -1 &&
	            cp !== CIRCUMFLEX_ACCENT &&
	            cp !== DOLLAR_SIGN &&
	            cp !== REVERSE_SOLIDUS &&
	            cp !== FULL_STOP &&
	            cp !== ASTERISK &&
	            cp !== PLUS_SIGN &&
	            cp !== QUESTION_MARK &&
	            cp !== LEFT_PARENTHESIS &&
	            cp !== RIGHT_PARENTHESIS &&
	            cp !== LEFT_SQUARE_BRACKET &&
	            cp !== VERTICAL_LINE) {
	            this.advance();
	            this.onCharacter(start, this.index, cp);
	            return true;
	        }
	        return false;
	    }
	    consumeGroupSpecifier() {
	        const start = this.index;
	        if (this.eat(QUESTION_MARK)) {
	            if (this.eatGroupName()) {
	                if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
	                    this._groupSpecifiers.addToScope(this._lastStrValue);
	                    return true;
	                }
	                this.raise("Duplicate capture group name");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeAtomEscape() {
	        if (this.consumeBackreference() ||
	            this.consumeCharacterClassEscape() ||
	            this.consumeCharacterEscape() ||
	            (this._nFlag && this.consumeKGroupName())) {
	            return true;
	        }
	        if (this.strict || this._unicodeMode) {
	            this.raise("Invalid escape");
	        }
	        return false;
	    }
	    consumeBackreference() {
	        const start = this.index;
	        if (this.eatDecimalEscape()) {
	            const n = this._lastIntValue;
	            if (n <= this._numCapturingParens) {
	                this.onBackreference(start - 1, this.index, n);
	                return true;
	            }
	            if (this.strict || this._unicodeMode) {
	                this.raise("Invalid escape");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeCharacterClassEscape() {
	        var _a;
	        const start = this.index;
	        if (this.eat(LATIN_SMALL_LETTER_D)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
	            return {};
	        }
	        if (this.eat(LATIN_CAPITAL_LETTER_D)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
	            return {};
	        }
	        if (this.eat(LATIN_SMALL_LETTER_S)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "space", false);
	            return {};
	        }
	        if (this.eat(LATIN_CAPITAL_LETTER_S)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "space", true);
	            return {};
	        }
	        if (this.eat(LATIN_SMALL_LETTER_W)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "word", false);
	            return {};
	        }
	        if (this.eat(LATIN_CAPITAL_LETTER_W)) {
	            this._lastIntValue = -1;
	            this.onEscapeCharacterSet(start - 1, this.index, "word", true);
	            return {};
	        }
	        let negate = false;
	        if (this._unicodeMode &&
	            this.ecmaVersion >= 2018 &&
	            (this.eat(LATIN_SMALL_LETTER_P) ||
	                (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) {
	            this._lastIntValue = -1;
	            let result = null;
	            if (this.eat(LEFT_CURLY_BRACKET) &&
	                (result = this.eatUnicodePropertyValueExpression()) &&
	                this.eat(RIGHT_CURLY_BRACKET)) {
	                if (negate && result.strings) {
	                    this.raise("Invalid property name");
	                }
	                this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", result.key, result.value, negate, (_a = result.strings) !== null && _a !== void 0 ? _a : false);
	                return { mayContainStrings: result.strings };
	            }
	            this.raise("Invalid property name");
	        }
	        return null;
	    }
	    consumeCharacterEscape() {
	        const start = this.index;
	        if (this.eatControlEscape() ||
	            this.eatCControlLetter() ||
	            this.eatZero() ||
	            this.eatHexEscapeSequence() ||
	            this.eatRegExpUnicodeEscapeSequence() ||
	            (!this.strict &&
	                !this._unicodeMode &&
	                this.eatLegacyOctalEscapeSequence()) ||
	            this.eatIdentityEscape()) {
	            this.onCharacter(start - 1, this.index, this._lastIntValue);
	            return true;
	        }
	        return false;
	    }
	    consumeKGroupName() {
	        const start = this.index;
	        if (this.eat(LATIN_SMALL_LETTER_K)) {
	            if (this.eatGroupName()) {
	                const groupName = this._lastStrValue;
	                this._backreferenceNames.add(groupName);
	                this.onBackreference(start - 1, this.index, groupName);
	                return true;
	            }
	            this.raise("Invalid named reference");
	        }
	        return false;
	    }
	    consumeCharacterClass() {
	        const start = this.index;
	        if (this.eat(LEFT_SQUARE_BRACKET)) {
	            const negate = this.eat(CIRCUMFLEX_ACCENT);
	            this.onCharacterClassEnter(start, negate, this._unicodeSetsMode);
	            const result = this.consumeClassContents();
	            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
	                if (this.currentCodePoint === -1) {
	                    this.raise("Unterminated character class");
	                }
	                this.raise("Invalid character in character class");
	            }
	            if (negate && result.mayContainStrings) {
	                this.raise("Negated character class may contain strings");
	            }
	            this.onCharacterClassLeave(start, this.index, negate);
	            return result;
	        }
	        return null;
	    }
	    consumeClassContents() {
	        if (this._unicodeSetsMode) {
	            if (this.currentCodePoint === RIGHT_SQUARE_BRACKET) {
	                return {};
	            }
	            const result = this.consumeClassSetExpression();
	            return result;
	        }
	        const strict = this.strict || this._unicodeMode;
	        for (;;) {
	            const rangeStart = this.index;
	            if (!this.consumeClassAtom()) {
	                break;
	            }
	            const min = this._lastIntValue;
	            if (!this.eat(HYPHEN_MINUS)) {
	                continue;
	            }
	            this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS);
	            if (!this.consumeClassAtom()) {
	                break;
	            }
	            const max = this._lastIntValue;
	            if (min === -1 || max === -1) {
	                if (strict) {
	                    this.raise("Invalid character class");
	                }
	                continue;
	            }
	            if (min > max) {
	                this.raise("Range out of order in character class");
	            }
	            this.onCharacterClassRange(rangeStart, this.index, min, max);
	        }
	        return {};
	    }
	    consumeClassAtom() {
	        const start = this.index;
	        const cp = this.currentCodePoint;
	        if (cp !== -1 &&
	            cp !== REVERSE_SOLIDUS &&
	            cp !== RIGHT_SQUARE_BRACKET) {
	            this.advance();
	            this._lastIntValue = cp;
	            this.onCharacter(start, this.index, this._lastIntValue);
	            return true;
	        }
	        if (this.eat(REVERSE_SOLIDUS)) {
	            if (this.consumeClassEscape()) {
	                return true;
	            }
	            if (!this.strict &&
	                this.currentCodePoint === LATIN_SMALL_LETTER_C) {
	                this._lastIntValue = REVERSE_SOLIDUS;
	                this.onCharacter(start, this.index, this._lastIntValue);
	                return true;
	            }
	            if (this.strict || this._unicodeMode) {
	                this.raise("Invalid escape");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    consumeClassEscape() {
	        const start = this.index;
	        if (this.eat(LATIN_SMALL_LETTER_B)) {
	            this._lastIntValue = BACKSPACE;
	            this.onCharacter(start - 1, this.index, this._lastIntValue);
	            return true;
	        }
	        if (this._unicodeMode && this.eat(HYPHEN_MINUS)) {
	            this._lastIntValue = HYPHEN_MINUS;
	            this.onCharacter(start - 1, this.index, this._lastIntValue);
	            return true;
	        }
	        let cp = 0;
	        if (!this.strict &&
	            !this._unicodeMode &&
	            this.currentCodePoint === LATIN_SMALL_LETTER_C &&
	            (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) {
	            this.advance();
	            this.advance();
	            this._lastIntValue = cp % 0x20;
	            this.onCharacter(start - 1, this.index, this._lastIntValue);
	            return true;
	        }
	        return (Boolean(this.consumeCharacterClassEscape()) ||
	            this.consumeCharacterEscape());
	    }
	    consumeClassSetExpression() {
	        const start = this.index;
	        let mayContainStrings = false;
	        let result = null;
	        if (this.consumeClassSetCharacter()) {
	            if (this.consumeClassSetRangeFromOperator(start)) {
	                this.consumeClassUnionRight({});
	                return {};
	            }
	            mayContainStrings = false;
	        }
	        else if ((result = this.consumeClassSetOperand())) {
	            mayContainStrings = result.mayContainStrings;
	        }
	        else {
	            const cp = this.currentCodePoint;
	            if (cp === REVERSE_SOLIDUS) {
	                this.advance();
	                this.raise("Invalid escape");
	            }
	            if (cp === this.nextCodePoint &&
	                isClassSetReservedDoublePunctuatorCharacter(cp)) {
	                this.raise("Invalid set operation in character class");
	            }
	            this.raise("Invalid character in character class");
	        }
	        if (this.eat2(AMPERSAND, AMPERSAND)) {
	            while (this.currentCodePoint !== AMPERSAND &&
	                (result = this.consumeClassSetOperand())) {
	                this.onClassIntersection(start, this.index);
	                if (!result.mayContainStrings) {
	                    mayContainStrings = false;
	                }
	                if (this.eat2(AMPERSAND, AMPERSAND)) {
	                    continue;
	                }
	                return { mayContainStrings };
	            }
	            this.raise("Invalid character in character class");
	        }
	        if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
	            while (this.consumeClassSetOperand()) {
	                this.onClassSubtraction(start, this.index);
	                if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
	                    continue;
	                }
	                return { mayContainStrings };
	            }
	            this.raise("Invalid character in character class");
	        }
	        return this.consumeClassUnionRight({ mayContainStrings });
	    }
	    consumeClassUnionRight(leftResult) {
	        let mayContainStrings = leftResult.mayContainStrings;
	        for (;;) {
	            const start = this.index;
	            if (this.consumeClassSetCharacter()) {
	                this.consumeClassSetRangeFromOperator(start);
	                continue;
	            }
	            const result = this.consumeClassSetOperand();
	            if (result) {
	                if (result.mayContainStrings) {
	                    mayContainStrings = true;
	                }
	                continue;
	            }
	            break;
	        }
	        return { mayContainStrings };
	    }
	    consumeClassSetRangeFromOperator(start) {
	        const currentStart = this.index;
	        const min = this._lastIntValue;
	        if (this.eat(HYPHEN_MINUS)) {
	            if (this.consumeClassSetCharacter()) {
	                const max = this._lastIntValue;
	                if (min === -1 || max === -1) {
	                    this.raise("Invalid character class");
	                }
	                if (min > max) {
	                    this.raise("Range out of order in character class");
	                }
	                this.onCharacterClassRange(start, this.index, min, max);
	                return true;
	            }
	            this.rewind(currentStart);
	        }
	        return false;
	    }
	    consumeClassSetOperand() {
	        let result = null;
	        if ((result = this.consumeNestedClass())) {
	            return result;
	        }
	        if ((result = this.consumeClassStringDisjunction())) {
	            return result;
	        }
	        if (this.consumeClassSetCharacter()) {
	            return {};
	        }
	        return null;
	    }
	    consumeNestedClass() {
	        const start = this.index;
	        if (this.eat(LEFT_SQUARE_BRACKET)) {
	            const negate = this.eat(CIRCUMFLEX_ACCENT);
	            this.onCharacterClassEnter(start, negate, true);
	            const result = this.consumeClassContents();
	            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
	                this.raise("Unterminated character class");
	            }
	            if (negate && result.mayContainStrings) {
	                this.raise("Negated character class may contain strings");
	            }
	            this.onCharacterClassLeave(start, this.index, negate);
	            return result;
	        }
	        if (this.eat(REVERSE_SOLIDUS)) {
	            const result = this.consumeCharacterClassEscape();
	            if (result) {
	                return result;
	            }
	            this.rewind(start);
	        }
	        return null;
	    }
	    consumeClassStringDisjunction() {
	        const start = this.index;
	        if (this.eat3(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_Q, LEFT_CURLY_BRACKET)) {
	            this.onClassStringDisjunctionEnter(start);
	            let i = 0;
	            let mayContainStrings = false;
	            do {
	                if (this.consumeClassString(i++).mayContainStrings) {
	                    mayContainStrings = true;
	                }
	            } while (this.eat(VERTICAL_LINE));
	            if (this.eat(RIGHT_CURLY_BRACKET)) {
	                this.onClassStringDisjunctionLeave(start, this.index);
	                return { mayContainStrings };
	            }
	            this.raise("Unterminated class string disjunction");
	        }
	        return null;
	    }
	    consumeClassString(i) {
	        const start = this.index;
	        let count = 0;
	        this.onStringAlternativeEnter(start, i);
	        while (this.currentCodePoint !== -1 &&
	            this.consumeClassSetCharacter()) {
	            count++;
	        }
	        this.onStringAlternativeLeave(start, this.index, i);
	        return { mayContainStrings: count !== 1 };
	    }
	    consumeClassSetCharacter() {
	        const start = this.index;
	        const cp = this.currentCodePoint;
	        if (cp !== this.nextCodePoint ||
	            !isClassSetReservedDoublePunctuatorCharacter(cp)) {
	            if (cp !== -1 && !isClassSetSyntaxCharacter(cp)) {
	                this._lastIntValue = cp;
	                this.advance();
	                this.onCharacter(start, this.index, this._lastIntValue);
	                return true;
	            }
	        }
	        if (this.eat(REVERSE_SOLIDUS)) {
	            if (this.consumeCharacterEscape()) {
	                return true;
	            }
	            if (isClassSetReservedPunctuator(this.currentCodePoint)) {
	                this._lastIntValue = this.currentCodePoint;
	                this.advance();
	                this.onCharacter(start, this.index, this._lastIntValue);
	                return true;
	            }
	            if (this.eat(LATIN_SMALL_LETTER_B)) {
	                this._lastIntValue = BACKSPACE;
	                this.onCharacter(start, this.index, this._lastIntValue);
	                return true;
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatGroupName() {
	        if (this.eat(LESS_THAN_SIGN)) {
	            if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) {
	                return true;
	            }
	            this.raise("Invalid capture group name");
	        }
	        return false;
	    }
	    eatRegExpIdentifierName() {
	        if (this.eatRegExpIdentifierStart()) {
	            this._lastStrValue = String.fromCodePoint(this._lastIntValue);
	            while (this.eatRegExpIdentifierPart()) {
	                this._lastStrValue += String.fromCodePoint(this._lastIntValue);
	            }
	            return true;
	        }
	        return false;
	    }
	    eatRegExpIdentifierStart() {
	        const start = this.index;
	        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
	        let cp = this.currentCodePoint;
	        this.advance();
	        if (cp === REVERSE_SOLIDUS &&
	            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
	            cp = this._lastIntValue;
	        }
	        else if (forceUFlag &&
	            isLeadSurrogate(cp) &&
	            isTrailSurrogate(this.currentCodePoint)) {
	            cp = combineSurrogatePair(cp, this.currentCodePoint);
	            this.advance();
	        }
	        if (isIdentifierStartChar(cp)) {
	            this._lastIntValue = cp;
	            return true;
	        }
	        if (this.index !== start) {
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatRegExpIdentifierPart() {
	        const start = this.index;
	        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
	        let cp = this.currentCodePoint;
	        this.advance();
	        if (cp === REVERSE_SOLIDUS &&
	            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
	            cp = this._lastIntValue;
	        }
	        else if (forceUFlag &&
	            isLeadSurrogate(cp) &&
	            isTrailSurrogate(this.currentCodePoint)) {
	            cp = combineSurrogatePair(cp, this.currentCodePoint);
	            this.advance();
	        }
	        if (isIdentifierPartChar(cp)) {
	            this._lastIntValue = cp;
	            return true;
	        }
	        if (this.index !== start) {
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatCControlLetter() {
	        const start = this.index;
	        if (this.eat(LATIN_SMALL_LETTER_C)) {
	            if (this.eatControlLetter()) {
	                return true;
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatZero() {
	        if (this.currentCodePoint === DIGIT_ZERO &&
	            !isDecimalDigit(this.nextCodePoint)) {
	            this._lastIntValue = 0;
	            this.advance();
	            return true;
	        }
	        return false;
	    }
	    eatControlEscape() {
	        if (this.eat(LATIN_SMALL_LETTER_F)) {
	            this._lastIntValue = FORM_FEED;
	            return true;
	        }
	        if (this.eat(LATIN_SMALL_LETTER_N)) {
	            this._lastIntValue = LINE_FEED;
	            return true;
	        }
	        if (this.eat(LATIN_SMALL_LETTER_R)) {
	            this._lastIntValue = CARRIAGE_RETURN;
	            return true;
	        }
	        if (this.eat(LATIN_SMALL_LETTER_T)) {
	            this._lastIntValue = CHARACTER_TABULATION;
	            return true;
	        }
	        if (this.eat(LATIN_SMALL_LETTER_V)) {
	            this._lastIntValue = LINE_TABULATION;
	            return true;
	        }
	        return false;
	    }
	    eatControlLetter() {
	        const cp = this.currentCodePoint;
	        if (isLatinLetter(cp)) {
	            this.advance();
	            this._lastIntValue = cp % 0x20;
	            return true;
	        }
	        return false;
	    }
	    eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
	        const start = this.index;
	        const uFlag = forceUFlag || this._unicodeMode;
	        if (this.eat(LATIN_SMALL_LETTER_U)) {
	            if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
	                this.eatFixedHexDigits(4) ||
	                (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
	                return true;
	            }
	            if (this.strict || uFlag) {
	                this.raise("Invalid unicode escape");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatRegExpUnicodeSurrogatePairEscape() {
	        const start = this.index;
	        if (this.eatFixedHexDigits(4)) {
	            const lead = this._lastIntValue;
	            if (isLeadSurrogate(lead) &&
	                this.eat(REVERSE_SOLIDUS) &&
	                this.eat(LATIN_SMALL_LETTER_U) &&
	                this.eatFixedHexDigits(4)) {
	                const trail = this._lastIntValue;
	                if (isTrailSurrogate(trail)) {
	                    this._lastIntValue = combineSurrogatePair(lead, trail);
	                    return true;
	                }
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatRegExpUnicodeCodePointEscape() {
	        const start = this.index;
	        if (this.eat(LEFT_CURLY_BRACKET) &&
	            this.eatHexDigits() &&
	            this.eat(RIGHT_CURLY_BRACKET) &&
	            isValidUnicode(this._lastIntValue)) {
	            return true;
	        }
	        this.rewind(start);
	        return false;
	    }
	    eatIdentityEscape() {
	        const cp = this.currentCodePoint;
	        if (this.isValidIdentityEscape(cp)) {
	            this._lastIntValue = cp;
	            this.advance();
	            return true;
	        }
	        return false;
	    }
	    isValidIdentityEscape(cp) {
	        if (cp === -1) {
	            return false;
	        }
	        if (this._unicodeMode) {
	            return isSyntaxCharacter(cp) || cp === SOLIDUS;
	        }
	        if (this.strict) {
	            return !isIdContinue(cp);
	        }
	        if (this._nFlag) {
	            return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K);
	        }
	        return cp !== LATIN_SMALL_LETTER_C;
	    }
	    eatDecimalEscape() {
	        this._lastIntValue = 0;
	        let cp = this.currentCodePoint;
	        if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) {
	            do {
	                this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO);
	                this.advance();
	            } while ((cp = this.currentCodePoint) >= DIGIT_ZERO &&
	                cp <= DIGIT_NINE);
	            return true;
	        }
	        return false;
	    }
	    eatUnicodePropertyValueExpression() {
	        const start = this.index;
	        if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) {
	            const key = this._lastStrValue;
	            if (this.eatUnicodePropertyValue()) {
	                const value = this._lastStrValue;
	                if (isValidUnicodeProperty(this.ecmaVersion, key, value)) {
	                    return {
	                        key,
	                        value: value || null,
	                    };
	                }
	                this.raise("Invalid property name");
	            }
	        }
	        this.rewind(start);
	        if (this.eatLoneUnicodePropertyNameOrValue()) {
	            const nameOrValue = this._lastStrValue;
	            if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) {
	                return {
	                    key: "General_Category",
	                    value: nameOrValue || null,
	                };
	            }
	            if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) {
	                return {
	                    key: nameOrValue,
	                    value: null,
	                };
	            }
	            if (this._unicodeSetsMode &&
	                isValidLoneUnicodePropertyOfString(this.ecmaVersion, nameOrValue)) {
	                return {
	                    key: nameOrValue,
	                    value: null,
	                    strings: true,
	                };
	            }
	            this.raise("Invalid property name");
	        }
	        return null;
	    }
	    eatUnicodePropertyName() {
	        this._lastStrValue = "";
	        while (isUnicodePropertyNameCharacter(this.currentCodePoint)) {
	            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
	            this.advance();
	        }
	        return this._lastStrValue !== "";
	    }
	    eatUnicodePropertyValue() {
	        this._lastStrValue = "";
	        while (isUnicodePropertyValueCharacter(this.currentCodePoint)) {
	            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
	            this.advance();
	        }
	        return this._lastStrValue !== "";
	    }
	    eatLoneUnicodePropertyNameOrValue() {
	        return this.eatUnicodePropertyValue();
	    }
	    eatHexEscapeSequence() {
	        const start = this.index;
	        if (this.eat(LATIN_SMALL_LETTER_X)) {
	            if (this.eatFixedHexDigits(2)) {
	                return true;
	            }
	            if (this._unicodeMode || this.strict) {
	                this.raise("Invalid escape");
	            }
	            this.rewind(start);
	        }
	        return false;
	    }
	    eatDecimalDigits() {
	        const start = this.index;
	        this._lastIntValue = 0;
	        while (isDecimalDigit(this.currentCodePoint)) {
	            this._lastIntValue =
	                10 * this._lastIntValue + digitToInt(this.currentCodePoint);
	            this.advance();
	        }
	        return this.index !== start;
	    }
	    eatHexDigits() {
	        const start = this.index;
	        this._lastIntValue = 0;
	        while (isHexDigit(this.currentCodePoint)) {
	            this._lastIntValue =
	                16 * this._lastIntValue + digitToInt(this.currentCodePoint);
	            this.advance();
	        }
	        return this.index !== start;
	    }
	    eatLegacyOctalEscapeSequence() {
	        if (this.eatOctalDigit()) {
	            const n1 = this._lastIntValue;
	            if (this.eatOctalDigit()) {
	                const n2 = this._lastIntValue;
	                if (n1 <= 3 && this.eatOctalDigit()) {
	                    this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue;
	                }
	                else {
	                    this._lastIntValue = n1 * 8 + n2;
	                }
	            }
	            else {
	                this._lastIntValue = n1;
	            }
	            return true;
	        }
	        return false;
	    }
	    eatOctalDigit() {
	        const cp = this.currentCodePoint;
	        if (isOctalDigit(cp)) {
	            this.advance();
	            this._lastIntValue = cp - DIGIT_ZERO;
	            return true;
	        }
	        this._lastIntValue = 0;
	        return false;
	    }
	    eatFixedHexDigits(length) {
	        const start = this.index;
	        this._lastIntValue = 0;
	        for (let i = 0; i < length; ++i) {
	            const cp = this.currentCodePoint;
	            if (!isHexDigit(cp)) {
	                this.rewind(start);
	                return false;
	            }
	            this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp);
	            this.advance();
	        }
	        return true;
	    }
	    eatModifiers() {
	        let ate = false;
	        while (isRegularExpressionModifier(this.currentCodePoint)) {
	            this.advance();
	            ate = true;
	        }
	        return ate;
	    }
	    parseModifiers(start, end) {
	        const { ignoreCase, multiline, dotAll } = this.parseFlags(this._reader.source, start, end);
	        return { ignoreCase, multiline, dotAll };
	    }
	    parseFlags(source, start, end) {
	        const flags = {
	            global: false,
	            ignoreCase: false,
	            multiline: false,
	            unicode: false,
	            sticky: false,
	            dotAll: false,
	            hasIndices: false,
	            unicodeSets: false,
	        };
	        const validFlags = new Set();
	        validFlags.add(LATIN_SMALL_LETTER_G);
	        validFlags.add(LATIN_SMALL_LETTER_I);
	        validFlags.add(LATIN_SMALL_LETTER_M);
	        if (this.ecmaVersion >= 2015) {
	            validFlags.add(LATIN_SMALL_LETTER_U);
	            validFlags.add(LATIN_SMALL_LETTER_Y);
	            if (this.ecmaVersion >= 2018) {
	                validFlags.add(LATIN_SMALL_LETTER_S);
	                if (this.ecmaVersion >= 2022) {
	                    validFlags.add(LATIN_SMALL_LETTER_D);
	                    if (this.ecmaVersion >= 2024) {
	                        validFlags.add(LATIN_SMALL_LETTER_V);
	                    }
	                }
	            }
	        }
	        for (let i = start; i < end; ++i) {
	            const flag = source.charCodeAt(i);
	            if (validFlags.has(flag)) {
	                const prop = FLAG_CODEPOINT_TO_PROP[flag];
	                if (flags[prop]) {
	                    this.raise(`Duplicated flag '${source[i]}'`, {
	                        index: start,
	                    });
	                }
	                flags[prop] = true;
	            }
	            else {
	                this.raise(`Invalid flag '${source[i]}'`, { index: start });
	            }
	        }
	        return flags;
	    }
	}

	const DUMMY_PATTERN = {};
	const DUMMY_FLAGS = {};
	const DUMMY_CAPTURING_GROUP = {};
	function isClassSetOperand(node) {
	    return (node.type === "Character" ||
	        node.type === "CharacterSet" ||
	        node.type === "CharacterClass" ||
	        node.type === "ExpressionCharacterClass" ||
	        node.type === "ClassStringDisjunction");
	}
	class RegExpParserState {
	    constructor(options) {
	        var _a;
	        this._node = DUMMY_PATTERN;
	        this._expressionBufferMap = new Map();
	        this._flags = DUMMY_FLAGS;
	        this._backreferences = [];
	        this._capturingGroups = [];
	        this.source = "";
	        this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict);
	        this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
	    }
	    get pattern() {
	        if (this._node.type !== "Pattern") {
	            throw new Error("UnknownError");
	        }
	        return this._node;
	    }
	    get flags() {
	        if (this._flags.type !== "Flags") {
	            throw new Error("UnknownError");
	        }
	        return this._flags;
	    }
	    onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, unicodeSets, }) {
	        this._flags = {
	            type: "Flags",
	            parent: null,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            global,
	            ignoreCase,
	            multiline,
	            unicode,
	            sticky,
	            dotAll,
	            hasIndices,
	            unicodeSets,
	        };
	    }
	    onPatternEnter(start) {
	        this._node = {
	            type: "Pattern",
	            parent: null,
	            start,
	            end: start,
	            raw: "",
	            alternatives: [],
	        };
	        this._backreferences.length = 0;
	        this._capturingGroups.length = 0;
	    }
	    onPatternLeave(start, end) {
	        this._node.end = end;
	        this._node.raw = this.source.slice(start, end);
	        for (const reference of this._backreferences) {
	            const ref = reference.ref;
	            const groups = typeof ref === "number"
	                ? [this._capturingGroups[ref - 1]]
	                : this._capturingGroups.filter((g) => g.name === ref);
	            if (groups.length === 1) {
	                const group = groups[0];
	                reference.ambiguous = false;
	                reference.resolved = group;
	            }
	            else {
	                reference.ambiguous = true;
	                reference.resolved = groups;
	            }
	            for (const group of groups) {
	                group.references.push(reference);
	            }
	        }
	    }
	    onAlternativeEnter(start) {
	        const parent = this._node;
	        if (parent.type !== "Assertion" &&
	            parent.type !== "CapturingGroup" &&
	            parent.type !== "Group" &&
	            parent.type !== "Pattern") {
	            throw new Error("UnknownError");
	        }
	        this._node = {
	            type: "Alternative",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            elements: [],
	        };
	        parent.alternatives.push(this._node);
	    }
	    onAlternativeLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onGroupEnter(start) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        const group = {
	            type: "Group",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            modifiers: null,
	            alternatives: [],
	        };
	        this._node = group;
	        parent.elements.push(this._node);
	    }
	    onGroupLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "Group" || node.parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onModifiersEnter(start) {
	        const parent = this._node;
	        if (parent.type !== "Group") {
	            throw new Error("UnknownError");
	        }
	        this._node = {
	            type: "Modifiers",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            add: null,
	            remove: null,
	        };
	        parent.modifiers = this._node;
	    }
	    onModifiersLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "Modifiers" || node.parent.type !== "Group") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onAddModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
	        const parent = this._node;
	        if (parent.type !== "Modifiers") {
	            throw new Error("UnknownError");
	        }
	        parent.add = {
	            type: "ModifierFlags",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            ignoreCase,
	            multiline,
	            dotAll,
	        };
	    }
	    onRemoveModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
	        const parent = this._node;
	        if (parent.type !== "Modifiers") {
	            throw new Error("UnknownError");
	        }
	        parent.remove = {
	            type: "ModifierFlags",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            ignoreCase,
	            multiline,
	            dotAll,
	        };
	    }
	    onCapturingGroupEnter(start, name) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        this._node = {
	            type: "CapturingGroup",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            name,
	            alternatives: [],
	            references: [],
	        };
	        parent.elements.push(this._node);
	        this._capturingGroups.push(this._node);
	    }
	    onCapturingGroupLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "CapturingGroup" ||
	            node.parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onQuantifier(start, end, min, max, greedy) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        const element = parent.elements.pop();
	        if (element == null ||
	            element.type === "Quantifier" ||
	            (element.type === "Assertion" && element.kind !== "lookahead")) {
	            throw new Error("UnknownError");
	        }
	        const node = {
	            type: "Quantifier",
	            parent,
	            start: element.start,
	            end,
	            raw: this.source.slice(element.start, end),
	            min,
	            max,
	            greedy,
	            element,
	        };
	        parent.elements.push(node);
	        element.parent = node;
	    }
	    onLookaroundAssertionEnter(start, kind, negate) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        const node = (this._node = {
	            type: "Assertion",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            kind,
	            negate,
	            alternatives: [],
	        });
	        parent.elements.push(node);
	    }
	    onLookaroundAssertionLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "Assertion" || node.parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onEdgeAssertion(start, end, kind) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push({
	            type: "Assertion",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            kind,
	        });
	    }
	    onWordBoundaryAssertion(start, end, kind, negate) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push({
	            type: "Assertion",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            kind,
	            negate,
	        });
	    }
	    onAnyCharacterSet(start, end, kind) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push({
	            type: "CharacterSet",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            kind,
	        });
	    }
	    onEscapeCharacterSet(start, end, kind, negate) {
	        const parent = this._node;
	        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push({
	            type: "CharacterSet",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            kind,
	            negate,
	        });
	    }
	    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
	        const parent = this._node;
	        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
	            throw new Error("UnknownError");
	        }
	        const base = {
	            type: "CharacterSet",
	            parent: null,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            kind,
	            strings: null,
	            key,
	        };
	        if (strings) {
	            if ((parent.type === "CharacterClass" && !parent.unicodeSets) ||
	                negate ||
	                value !== null) {
	                throw new Error("UnknownError");
	            }
	            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
	        }
	        else {
	            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
	        }
	    }
	    onCharacter(start, end, value) {
	        const parent = this._node;
	        if (parent.type !== "Alternative" &&
	            parent.type !== "CharacterClass" &&
	            parent.type !== "StringAlternative") {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push({
	            type: "Character",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            value,
	        });
	    }
	    onBackreference(start, end, ref) {
	        const parent = this._node;
	        if (parent.type !== "Alternative") {
	            throw new Error("UnknownError");
	        }
	        const node = {
	            type: "Backreference",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            ref,
	            ambiguous: false,
	            resolved: DUMMY_CAPTURING_GROUP,
	        };
	        parent.elements.push(node);
	        this._backreferences.push(node);
	    }
	    onCharacterClassEnter(start, negate, unicodeSets) {
	        const parent = this._node;
	        const base = {
	            type: "CharacterClass",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            unicodeSets,
	            negate,
	            elements: [],
	        };
	        if (parent.type === "Alternative") {
	            const node = Object.assign(Object.assign({}, base), { parent });
	            this._node = node;
	            parent.elements.push(node);
	        }
	        else if (parent.type === "CharacterClass" &&
	            parent.unicodeSets &&
	            unicodeSets) {
	            const node = Object.assign(Object.assign({}, base), { parent,
	                unicodeSets });
	            this._node = node;
	            parent.elements.push(node);
	        }
	        else {
	            throw new Error("UnknownError");
	        }
	    }
	    onCharacterClassLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "CharacterClass" ||
	            (node.parent.type !== "Alternative" &&
	                node.parent.type !== "CharacterClass")) {
	            throw new Error("UnknownError");
	        }
	        const parent = node.parent;
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = parent;
	        const expression = this._expressionBufferMap.get(node);
	        if (!expression) {
	            return;
	        }
	        if (node.elements.length > 0) {
	            throw new Error("UnknownError");
	        }
	        this._expressionBufferMap.delete(node);
	        const newNode = {
	            type: "ExpressionCharacterClass",
	            parent,
	            start: node.start,
	            end: node.end,
	            raw: node.raw,
	            negate: node.negate,
	            expression,
	        };
	        expression.parent = newNode;
	        if (node !== parent.elements.pop()) {
	            throw new Error("UnknownError");
	        }
	        parent.elements.push(newNode);
	    }
	    onCharacterClassRange(start, end) {
	        const parent = this._node;
	        if (parent.type !== "CharacterClass") {
	            throw new Error("UnknownError");
	        }
	        const elements = parent.elements;
	        const max = elements.pop();
	        if (!max || max.type !== "Character") {
	            throw new Error("UnknownError");
	        }
	        if (!parent.unicodeSets) {
	            const hyphen = elements.pop();
	            if (!hyphen ||
	                hyphen.type !== "Character" ||
	                hyphen.value !== HYPHEN_MINUS) {
	                throw new Error("UnknownError");
	            }
	        }
	        const min = elements.pop();
	        if (!min || min.type !== "Character") {
	            throw new Error("UnknownError");
	        }
	        const node = {
	            type: "CharacterClassRange",
	            parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            min,
	            max,
	        };
	        min.parent = node;
	        max.parent = node;
	        elements.push(node);
	    }
	    onClassIntersection(start, end) {
	        var _a;
	        const parent = this._node;
	        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
	            throw new Error("UnknownError");
	        }
	        const right = parent.elements.pop();
	        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
	        if (!left ||
	            !right ||
	            left.type === "ClassSubtraction" ||
	            (left.type !== "ClassIntersection" && !isClassSetOperand(left)) ||
	            !isClassSetOperand(right)) {
	            throw new Error("UnknownError");
	        }
	        const node = {
	            type: "ClassIntersection",
	            parent: parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            left,
	            right,
	        };
	        left.parent = node;
	        right.parent = node;
	        this._expressionBufferMap.set(parent, node);
	    }
	    onClassSubtraction(start, end) {
	        var _a;
	        const parent = this._node;
	        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
	            throw new Error("UnknownError");
	        }
	        const right = parent.elements.pop();
	        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
	        if (!left ||
	            !right ||
	            left.type === "ClassIntersection" ||
	            (left.type !== "ClassSubtraction" && !isClassSetOperand(left)) ||
	            !isClassSetOperand(right)) {
	            throw new Error("UnknownError");
	        }
	        const node = {
	            type: "ClassSubtraction",
	            parent: parent,
	            start,
	            end,
	            raw: this.source.slice(start, end),
	            left,
	            right,
	        };
	        left.parent = node;
	        right.parent = node;
	        this._expressionBufferMap.set(parent, node);
	    }
	    onClassStringDisjunctionEnter(start) {
	        const parent = this._node;
	        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
	            throw new Error("UnknownError");
	        }
	        this._node = {
	            type: "ClassStringDisjunction",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            alternatives: [],
	        };
	        parent.elements.push(this._node);
	    }
	    onClassStringDisjunctionLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "ClassStringDisjunction" ||
	            node.parent.type !== "CharacterClass") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	    onStringAlternativeEnter(start) {
	        const parent = this._node;
	        if (parent.type !== "ClassStringDisjunction") {
	            throw new Error("UnknownError");
	        }
	        this._node = {
	            type: "StringAlternative",
	            parent,
	            start,
	            end: start,
	            raw: "",
	            elements: [],
	        };
	        parent.alternatives.push(this._node);
	    }
	    onStringAlternativeLeave(start, end) {
	        const node = this._node;
	        if (node.type !== "StringAlternative") {
	            throw new Error("UnknownError");
	        }
	        node.end = end;
	        node.raw = this.source.slice(start, end);
	        this._node = node.parent;
	    }
	}
	class RegExpParser {
	    constructor(options) {
	        this._state = new RegExpParserState(options);
	        this._validator = new RegExpValidator(this._state);
	    }
	    parseLiteral(source, start = 0, end = source.length) {
	        this._state.source = source;
	        this._validator.validateLiteral(source, start, end);
	        const pattern = this._state.pattern;
	        const flags = this._state.flags;
	        const literal = {
	            type: "RegExpLiteral",
	            parent: null,
	            start,
	            end,
	            raw: source,
	            pattern,
	            flags,
	        };
	        pattern.parent = literal;
	        flags.parent = literal;
	        return literal;
	    }
	    parseFlags(source, start = 0, end = source.length) {
	        this._state.source = source;
	        this._validator.validateFlags(source, start, end);
	        return this._state.flags;
	    }
	    parsePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
	        this._state.source = source;
	        this._validator.validatePattern(source, start, end, uFlagOrFlags);
	        return this._state.pattern;
	    }
	}

	class RegExpVisitor {
	    constructor(handlers) {
	        this._handlers = handlers;
	    }
	    visit(node) {
	        switch (node.type) {
	            case "Alternative":
	                this.visitAlternative(node);
	                break;
	            case "Assertion":
	                this.visitAssertion(node);
	                break;
	            case "Backreference":
	                this.visitBackreference(node);
	                break;
	            case "CapturingGroup":
	                this.visitCapturingGroup(node);
	                break;
	            case "Character":
	                this.visitCharacter(node);
	                break;
	            case "CharacterClass":
	                this.visitCharacterClass(node);
	                break;
	            case "CharacterClassRange":
	                this.visitCharacterClassRange(node);
	                break;
	            case "CharacterSet":
	                this.visitCharacterSet(node);
	                break;
	            case "ClassIntersection":
	                this.visitClassIntersection(node);
	                break;
	            case "ClassStringDisjunction":
	                this.visitClassStringDisjunction(node);
	                break;
	            case "ClassSubtraction":
	                this.visitClassSubtraction(node);
	                break;
	            case "ExpressionCharacterClass":
	                this.visitExpressionCharacterClass(node);
	                break;
	            case "Flags":
	                this.visitFlags(node);
	                break;
	            case "Group":
	                this.visitGroup(node);
	                break;
	            case "Modifiers":
	                this.visitModifiers(node);
	                break;
	            case "ModifierFlags":
	                this.visitModifierFlags(node);
	                break;
	            case "Pattern":
	                this.visitPattern(node);
	                break;
	            case "Quantifier":
	                this.visitQuantifier(node);
	                break;
	            case "RegExpLiteral":
	                this.visitRegExpLiteral(node);
	                break;
	            case "StringAlternative":
	                this.visitStringAlternative(node);
	                break;
	            default:
	                throw new Error(`Unknown type: ${node.type}`);
	        }
	    }
	    visitAlternative(node) {
	        if (this._handlers.onAlternativeEnter) {
	            this._handlers.onAlternativeEnter(node);
	        }
	        node.elements.forEach(this.visit, this);
	        if (this._handlers.onAlternativeLeave) {
	            this._handlers.onAlternativeLeave(node);
	        }
	    }
	    visitAssertion(node) {
	        if (this._handlers.onAssertionEnter) {
	            this._handlers.onAssertionEnter(node);
	        }
	        if (node.kind === "lookahead" || node.kind === "lookbehind") {
	            node.alternatives.forEach(this.visit, this);
	        }
	        if (this._handlers.onAssertionLeave) {
	            this._handlers.onAssertionLeave(node);
	        }
	    }
	    visitBackreference(node) {
	        if (this._handlers.onBackreferenceEnter) {
	            this._handlers.onBackreferenceEnter(node);
	        }
	        if (this._handlers.onBackreferenceLeave) {
	            this._handlers.onBackreferenceLeave(node);
	        }
	    }
	    visitCapturingGroup(node) {
	        if (this._handlers.onCapturingGroupEnter) {
	            this._handlers.onCapturingGroupEnter(node);
	        }
	        node.alternatives.forEach(this.visit, this);
	        if (this._handlers.onCapturingGroupLeave) {
	            this._handlers.onCapturingGroupLeave(node);
	        }
	    }
	    visitCharacter(node) {
	        if (this._handlers.onCharacterEnter) {
	            this._handlers.onCharacterEnter(node);
	        }
	        if (this._handlers.onCharacterLeave) {
	            this._handlers.onCharacterLeave(node);
	        }
	    }
	    visitCharacterClass(node) {
	        if (this._handlers.onCharacterClassEnter) {
	            this._handlers.onCharacterClassEnter(node);
	        }
	        node.elements.forEach(this.visit, this);
	        if (this._handlers.onCharacterClassLeave) {
	            this._handlers.onCharacterClassLeave(node);
	        }
	    }
	    visitCharacterClassRange(node) {
	        if (this._handlers.onCharacterClassRangeEnter) {
	            this._handlers.onCharacterClassRangeEnter(node);
	        }
	        this.visitCharacter(node.min);
	        this.visitCharacter(node.max);
	        if (this._handlers.onCharacterClassRangeLeave) {
	            this._handlers.onCharacterClassRangeLeave(node);
	        }
	    }
	    visitCharacterSet(node) {
	        if (this._handlers.onCharacterSetEnter) {
	            this._handlers.onCharacterSetEnter(node);
	        }
	        if (this._handlers.onCharacterSetLeave) {
	            this._handlers.onCharacterSetLeave(node);
	        }
	    }
	    visitClassIntersection(node) {
	        if (this._handlers.onClassIntersectionEnter) {
	            this._handlers.onClassIntersectionEnter(node);
	        }
	        this.visit(node.left);
	        this.visit(node.right);
	        if (this._handlers.onClassIntersectionLeave) {
	            this._handlers.onClassIntersectionLeave(node);
	        }
	    }
	    visitClassStringDisjunction(node) {
	        if (this._handlers.onClassStringDisjunctionEnter) {
	            this._handlers.onClassStringDisjunctionEnter(node);
	        }
	        node.alternatives.forEach(this.visit, this);
	        if (this._handlers.onClassStringDisjunctionLeave) {
	            this._handlers.onClassStringDisjunctionLeave(node);
	        }
	    }
	    visitClassSubtraction(node) {
	        if (this._handlers.onClassSubtractionEnter) {
	            this._handlers.onClassSubtractionEnter(node);
	        }
	        this.visit(node.left);
	        this.visit(node.right);
	        if (this._handlers.onClassSubtractionLeave) {
	            this._handlers.onClassSubtractionLeave(node);
	        }
	    }
	    visitExpressionCharacterClass(node) {
	        if (this._handlers.onExpressionCharacterClassEnter) {
	            this._handlers.onExpressionCharacterClassEnter(node);
	        }
	        this.visit(node.expression);
	        if (this._handlers.onExpressionCharacterClassLeave) {
	            this._handlers.onExpressionCharacterClassLeave(node);
	        }
	    }
	    visitFlags(node) {
	        if (this._handlers.onFlagsEnter) {
	            this._handlers.onFlagsEnter(node);
	        }
	        if (this._handlers.onFlagsLeave) {
	            this._handlers.onFlagsLeave(node);
	        }
	    }
	    visitGroup(node) {
	        if (this._handlers.onGroupEnter) {
	            this._handlers.onGroupEnter(node);
	        }
	        if (node.modifiers) {
	            this.visit(node.modifiers);
	        }
	        node.alternatives.forEach(this.visit, this);
	        if (this._handlers.onGroupLeave) {
	            this._handlers.onGroupLeave(node);
	        }
	    }
	    visitModifiers(node) {
	        if (this._handlers.onModifiersEnter) {
	            this._handlers.onModifiersEnter(node);
	        }
	        if (node.add) {
	            this.visit(node.add);
	        }
	        if (node.remove) {
	            this.visit(node.remove);
	        }
	        if (this._handlers.onModifiersLeave) {
	            this._handlers.onModifiersLeave(node);
	        }
	    }
	    visitModifierFlags(node) {
	        if (this._handlers.onModifierFlagsEnter) {
	            this._handlers.onModifierFlagsEnter(node);
	        }
	        if (this._handlers.onModifierFlagsLeave) {
	            this._handlers.onModifierFlagsLeave(node);
	        }
	    }
	    visitPattern(node) {
	        if (this._handlers.onPatternEnter) {
	            this._handlers.onPatternEnter(node);
	        }
	        node.alternatives.forEach(this.visit, this);
	        if (this._handlers.onPatternLeave) {
	            this._handlers.onPatternLeave(node);
	        }
	    }
	    visitQuantifier(node) {
	        if (this._handlers.onQuantifierEnter) {
	            this._handlers.onQuantifierEnter(node);
	        }
	        this.visit(node.element);
	        if (this._handlers.onQuantifierLeave) {
	            this._handlers.onQuantifierLeave(node);
	        }
	    }
	    visitRegExpLiteral(node) {
	        if (this._handlers.onRegExpLiteralEnter) {
	            this._handlers.onRegExpLiteralEnter(node);
	        }
	        this.visitPattern(node.pattern);
	        this.visitFlags(node.flags);
	        if (this._handlers.onRegExpLiteralLeave) {
	            this._handlers.onRegExpLiteralLeave(node);
	        }
	    }
	    visitStringAlternative(node) {
	        if (this._handlers.onStringAlternativeEnter) {
	            this._handlers.onStringAlternativeEnter(node);
	        }
	        node.elements.forEach(this.visit, this);
	        if (this._handlers.onStringAlternativeLeave) {
	            this._handlers.onStringAlternativeLeave(node);
	        }
	    }
	}

	function parseRegExpLiteral(source, options) {
	    return new RegExpParser(options).parseLiteral(String(source));
	}
	function validateRegExpLiteral(source, options) {
	    new RegExpValidator(options).validateLiteral(source);
	}
	function visitRegExpAST(node, handlers) {
	    new RegExpVisitor(handlers).visit(node);
	}

	regexpp.AST = ast;
	regexpp.RegExpParser = RegExpParser;
	regexpp.RegExpSyntaxError = RegExpSyntaxError;
	regexpp.RegExpValidator = RegExpValidator;
	regexpp.parseRegExpLiteral = parseRegExpLiteral;
	regexpp.validateRegExpLiteral = validateRegExpLiteral;
	regexpp.visitRegExpAST = visitRegExpAST;
	
	return regexpp;
}

/**
 * @fileoverview Rule to forbid control characters from regular expressions.
 * @author Nicholas C. Zakas
 */

var noControlRegex;
var hasRequiredNoControlRegex;

function requireNoControlRegex () {
	if (hasRequiredNoControlRegex) return noControlRegex;
	hasRequiredNoControlRegex = 1;

	const RegExpValidator = requireRegexpp().RegExpValidator;
	const collector = new (class {
		constructor() {
			this._source = "";
			this._controlChars = [];
			this._validator = new RegExpValidator(this);
		}

		onPatternEnter() {
			/*
			 * `RegExpValidator` may parse the pattern twice in one `validatePattern`.
			 * So `this._controlChars` should be cleared here as well.
			 *
			 * For example, the `/(?<a>\x1f)/` regex will parse the pattern twice.
			 * This is based on the content described in Annex B.
			 * If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice.
			 * See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb
			 */
			this._controlChars = [];
		}

		onCharacter(start, end, cp) {
			if (
				cp >= 0x00 &&
				cp <= 0x1f &&
				(this._source.codePointAt(start) === cp ||
					this._source.slice(start, end).startsWith("\\x") ||
					this._source.slice(start, end).startsWith("\\u"))
			) {
				this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`);
			}
		}

		collectControlChars(regexpStr, flags) {
			const uFlag = typeof flags === "string" && flags.includes("u");
			const vFlag = typeof flags === "string" && flags.includes("v");

			this._controlChars = [];
			this._source = regexpStr;

			try {
				this._validator.validatePattern(regexpStr, void 0, void 0, {
					unicode: uFlag,
					unicodeSets: vFlag,
				}); // Call onCharacter hook
			} catch {
				// Ignore syntax errors in RegExp.
			}
			return this._controlChars;
		}
	})();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noControlRegex = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow control characters in regular expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-control-regex",
			},

			schema: [],

			messages: {
				unexpected:
					"Unexpected control character(s) in regular expression: {{controlChars}}.",
			},
		},

		create(context) {
			/**
			 * Get the regex expression
			 * @param {ASTNode} node `Literal` node to evaluate
			 * @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal
			 * or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined,
			 * the `flags` property will be `null`.
			 * @private
			 */
			function getRegExp(node) {
				if (node.regex) {
					return node.regex;
				}
				if (
					typeof node.value === "string" &&
					(node.parent.type === "NewExpression" ||
						node.parent.type === "CallExpression") &&
					node.parent.callee.type === "Identifier" &&
					node.parent.callee.name === "RegExp" &&
					node.parent.arguments[0] === node
				) {
					const pattern = node.value;
					const flags =
						node.parent.arguments.length > 1 &&
						node.parent.arguments[1].type === "Literal" &&
						typeof node.parent.arguments[1].value === "string"
							? node.parent.arguments[1].value
							: null;

					return { pattern, flags };
				}

				return null;
			}

			return {
				Literal(node) {
					const regExp = getRegExp(node);

					if (regExp) {
						const { pattern, flags } = regExp;
						const controlCharacters = collector.collectControlChars(
							pattern,
							flags,
						);

						if (controlCharacters.length > 0) {
							context.report({
								node,
								messageId: "unexpected",
								data: {
									controlChars: controlCharacters.join(", "),
								},
							});
						}
					}
				},
			};
		},
	};
	return noControlRegex;
}

/**
 * @fileoverview Rule to flag use of a debugger statement
 * @author Nicholas C. Zakas
 */

var noDebugger;
var hasRequiredNoDebugger;

function requireNoDebugger () {
	if (hasRequiredNoDebugger) return noDebugger;
	hasRequiredNoDebugger = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDebugger = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow the use of `debugger`",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-debugger",
			},

			fixable: null,
			schema: [],

			messages: {
				unexpected: "Unexpected 'debugger' statement.",
			},
		},

		create(context) {
			return {
				DebuggerStatement(node) {
					context.report({
						node,
						messageId: "unexpected",
					});
				},
			};
		},
	};
	return noDebugger;
}

/**
 * @fileoverview Rule to flag when deleting variables
 * @author Ilya Volodin
 */

var noDeleteVar;
var hasRequiredNoDeleteVar;

function requireNoDeleteVar () {
	if (hasRequiredNoDeleteVar) return noDeleteVar;
	hasRequiredNoDeleteVar = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDeleteVar = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow deleting variables",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-delete-var",
			},

			schema: [],

			messages: {
				unexpected: "Variables should not be deleted.",
			},
		},

		create(context) {
			return {
				UnaryExpression(node) {
					if (
						node.operator === "delete" &&
						node.argument.type === "Identifier"
					) {
						context.report({ node, messageId: "unexpected" });
					}
				},
			};
		},
	};
	return noDeleteVar;
}

/**
 * @fileoverview Rule to check for ambiguous div operator in regexes
 * @author Matt DuVall <http://www.mattduvall.com>
 */

var noDivRegex;
var hasRequiredNoDivRegex;

function requireNoDivRegex () {
	if (hasRequiredNoDivRegex) return noDivRegex;
	hasRequiredNoDivRegex = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDivRegex = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow equal signs explicitly at the beginning of regular expressions",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-div-regex",
			},

			fixable: "code",

			schema: [],

			messages: {
				unexpected:
					"A regular expression literal can be confused with '/='.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				Literal(node) {
					const token = sourceCode.getFirstToken(node);

					if (
						token.type === "RegularExpression" &&
						token.value[1] === "="
					) {
						context.report({
							node,
							messageId: "unexpected",
							fix(fixer) {
								return fixer.replaceTextRange(
									[token.range[0] + 1, token.range[0] + 2],
									"[=]",
								);
							},
						});
					}
				},
			};
		},
	};
	return noDivRegex;
}

/**
 * @fileoverview Rule to flag duplicate arguments
 * @author Jamund Ferguson
 */

var noDupeArgs;
var hasRequiredNoDupeArgs;

function requireNoDupeArgs () {
	if (hasRequiredNoDupeArgs) return noDupeArgs;
	hasRequiredNoDupeArgs = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDupeArgs = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow duplicate arguments in `function` definitions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-dupe-args",
			},

			schema: [],

			messages: {
				unexpected: "Duplicate param '{{name}}'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Checks whether or not a given definition is a parameter's.
			 * @param {eslint-scope.DefEntry} def A definition to check.
			 * @returns {boolean} `true` if the definition is a parameter's.
			 */
			function isParameter(def) {
				return def.type === "Parameter";
			}

			/**
			 * Determines if a given node has duplicate parameters.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 * @private
			 */
			function checkParams(node) {
				const variables = sourceCode.getDeclaredVariables(node);

				for (let i = 0; i < variables.length; ++i) {
					const variable = variables[i];

					// Checks and reports duplications.
					const defs = variable.defs.filter(isParameter);

					if (defs.length >= 2) {
						context.report({
							node,
							messageId: "unexpected",
							data: { name: variable.name },
						});
					}
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				FunctionDeclaration: checkParams,
				FunctionExpression: checkParams,
			};
		},
	};
	return noDupeArgs;
}

/**
 * @fileoverview A rule to disallow duplicate name in class members.
 * @author Toru Nagashima
 */

var noDupeClassMembers;
var hasRequiredNoDupeClassMembers;

function requireNoDupeClassMembers () {
	if (hasRequiredNoDupeClassMembers) return noDupeClassMembers;
	hasRequiredNoDupeClassMembers = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDupeClassMembers = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow duplicate class members",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-dupe-class-members",
			},

			schema: [],

			messages: {
				unexpected: "Duplicate name '{{name}}'.",
			},
		},

		create(context) {
			let stack = [];

			/**
			 * Gets state of a given member name.
			 * @param {string} name A name of a member.
			 * @param {boolean} isStatic A flag which specifies that is a static member.
			 * @returns {Object} A state of a given member name.
			 *   - retv.init {boolean} A flag which shows the name is declared as normal member.
			 *   - retv.get {boolean} A flag which shows the name is declared as getter.
			 *   - retv.set {boolean} A flag which shows the name is declared as setter.
			 */
			function getState(name, isStatic) {
				const stateMap = stack.at(-1);
				const key = `$${name}`; // to avoid "__proto__".

				if (!stateMap[key]) {
					stateMap[key] = {
						nonStatic: { init: false, get: false, set: false },
						static: { init: false, get: false, set: false },
					};
				}

				return stateMap[key][isStatic ? "static" : "nonStatic"];
			}

			return {
				// Initializes the stack of state of member declarations.
				Program() {
					stack = [];
				},

				// Initializes state of member declarations for the class.
				ClassBody() {
					stack.push(Object.create(null));
				},

				// Disposes the state for the class.
				"ClassBody:exit"() {
					stack.pop();
				},

				// Reports the node if its name has been declared already.
				"MethodDefinition, PropertyDefinition"(node) {
					const name = astUtils.getStaticPropertyName(node);
					const kind =
						node.type === "MethodDefinition" ? node.kind : "field";

					if (name === null || kind === "constructor") {
						return;
					}

					const state = getState(name, node.static);
					let isDuplicate;

					if (kind === "get") {
						isDuplicate = state.init || state.get;
						state.get = true;
					} else if (kind === "set") {
						isDuplicate = state.init || state.set;
						state.set = true;
					} else {
						isDuplicate = state.init || state.get || state.set;
						state.init = true;
					}

					if (isDuplicate) {
						context.report({
							node,
							messageId: "unexpected",
							data: { name },
						});
					}
				},
			};
		},
	};
	return noDupeClassMembers;
}

/**
 * @fileoverview Rule to disallow duplicate conditions in if-else-if chains
 * @author Milos Djermanovic
 */

var noDupeElseIf;
var hasRequiredNoDupeElseIf;

function requireNoDupeElseIf () {
	if (hasRequiredNoDupeElseIf) return noDupeElseIf;
	hasRequiredNoDupeElseIf = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the first given array is a subset of the second given array.
	 * @param {Function} comparator A function to compare two elements, should return `true` if they are equal.
	 * @param {Array} arrA The array to compare from.
	 * @param {Array} arrB The array to compare against.
	 * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`.
	 */
	function isSubsetByComparator(comparator, arrA, arrB) {
		return arrA.every(a => arrB.some(b => comparator(a, b)));
	}

	/**
	 * Splits the given node by the given logical operator.
	 * @param {string} operator Logical operator `||` or `&&`.
	 * @param {ASTNode} node The node to split.
	 * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator.
	 */
	function splitByLogicalOperator(operator, node) {
		if (node.type === "LogicalExpression" && node.operator === operator) {
			return [
				...splitByLogicalOperator(operator, node.left),
				...splitByLogicalOperator(operator, node.right),
			];
		}
		return [node];
	}

	const splitByOr = splitByLogicalOperator.bind(null, "||");
	const splitByAnd = splitByLogicalOperator.bind(null, "&&");

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDupeElseIf = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow duplicate conditions in if-else-if chains",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-dupe-else-if",
			},

			schema: [],

			messages: {
				unexpected:
					"This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes
			 * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators.
			 * @param {ASTNode} a First node.
			 * @param {ASTNode} b Second node.
			 * @returns {boolean} `true` if the nodes are considered to be equal.
			 */
			function equal(a, b) {
				if (a.type !== b.type) {
					return false;
				}

				if (
					a.type === "LogicalExpression" &&
					(a.operator === "||" || a.operator === "&&") &&
					a.operator === b.operator
				) {
					return (
						(equal(a.left, b.left) && equal(a.right, b.right)) ||
						(equal(a.left, b.right) && equal(a.right, b.left))
					);
				}

				return astUtils.equalTokens(a, b, sourceCode);
			}

			const isSubset = isSubsetByComparator.bind(null, equal);

			return {
				IfStatement(node) {
					const test = node.test,
						conditionsToCheck =
							test.type === "LogicalExpression" &&
							test.operator === "&&"
								? [test, ...splitByAnd(test)]
								: [test];
					let current = node,
						listToCheck = conditionsToCheck.map(c =>
							splitByOr(c).map(splitByAnd),
						);

					while (
						current.parent &&
						current.parent.type === "IfStatement" &&
						current.parent.alternate === current
					) {
						current = current.parent;

						const currentOrOperands = splitByOr(current.test).map(
							splitByAnd,
						);

						listToCheck = listToCheck.map(orOperands =>
							orOperands.filter(
								orOperand =>
									!currentOrOperands.some(currentOrOperand =>
										isSubset(currentOrOperand, orOperand),
									),
							),
						);

						if (
							listToCheck.some(orOperands => orOperands.length === 0)
						) {
							context.report({ node: test, messageId: "unexpected" });
							break;
						}
					}
				},
			};
		},
	};
	return noDupeElseIf;
}

/**
 * @fileoverview Rule to flag use of duplicate keys in an object.
 * @author Ian Christian Myers
 */

var noDupeKeys;
var hasRequiredNoDupeKeys;

function requireNoDupeKeys () {
	if (hasRequiredNoDupeKeys) return noDupeKeys;
	hasRequiredNoDupeKeys = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const GET_KIND = /^(?:init|get)$/u;
	const SET_KIND = /^(?:init|set)$/u;

	/**
	 * The class which stores properties' information of an object.
	 */
	class ObjectInfo {
		/**
		 * @param {ObjectInfo|null} upper The information of the outer object.
		 * @param {ASTNode} node The ObjectExpression node of this information.
		 */
		constructor(upper, node) {
			this.upper = upper;
			this.node = node;
			this.properties = new Map();
		}

		/**
		 * Gets the information of the given Property node.
		 * @param {ASTNode} node The Property node to get.
		 * @returns {{get: boolean, set: boolean}} The information of the property.
		 */
		getPropertyInfo(node) {
			const name = astUtils.getStaticPropertyName(node);

			if (!this.properties.has(name)) {
				this.properties.set(name, { get: false, set: false });
			}
			return this.properties.get(name);
		}

		/**
		 * Checks whether the given property has been defined already or not.
		 * @param {ASTNode} node The Property node to check.
		 * @returns {boolean} `true` if the property has been defined.
		 */
		isPropertyDefined(node) {
			const entry = this.getPropertyInfo(node);

			return (
				(GET_KIND.test(node.kind) && entry.get) ||
				(SET_KIND.test(node.kind) && entry.set)
			);
		}

		/**
		 * Defines the given property.
		 * @param {ASTNode} node The Property node to define.
		 * @returns {void}
		 */
		defineProperty(node) {
			const entry = this.getPropertyInfo(node);

			if (GET_KIND.test(node.kind)) {
				entry.get = true;
			}
			if (SET_KIND.test(node.kind)) {
				entry.set = true;
			}
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDupeKeys = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow duplicate keys in object literals",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-dupe-keys",
			},

			schema: [],

			messages: {
				unexpected: "Duplicate key '{{name}}'.",
			},
		},

		create(context) {
			let info = null;

			return {
				ObjectExpression(node) {
					info = new ObjectInfo(info, node);
				},
				"ObjectExpression:exit"() {
					info = info.upper;
				},

				Property(node) {
					const name = astUtils.getStaticPropertyName(node);

					// Skip destructuring.
					if (node.parent.type !== "ObjectExpression") {
						return;
					}

					// Skip if the name is not static.
					if (name === null) {
						return;
					}

					/*
					 * Skip if the property node is a proto setter.
					 * Proto setter is a special syntax that sets
					 * object's prototype instead of creating a property.
					 * It can be in one of the following forms:
					 *
					 *    __proto__: <expression>
					 *    '__proto__': <expression>
					 *    "__proto__": <expression>
					 *
					 * Duplicate proto setters produce parsing errors,
					 * so we can just skip them to not interfere with
					 * regular properties named "__proto__".
					 */
					if (
						name === "__proto__" &&
						node.kind === "init" &&
						!node.computed &&
						!node.shorthand &&
						!node.method
					) {
						return;
					}

					// Reports if the name is defined already.
					if (info.isPropertyDefined(node)) {
						context.report({
							node: info.node,
							loc: node.key.loc,
							messageId: "unexpected",
							data: { name },
						});
					}

					// Update info.
					info.defineProperty(node);
				},
			};
		},
	};
	return noDupeKeys;
}

/**
 * @fileoverview Rule to disallow a duplicate case label.
 * @author Dieter Oberkofler
 * @author Burak Yigit Kaya
 */

var noDuplicateCase;
var hasRequiredNoDuplicateCase;

function requireNoDuplicateCase () {
	if (hasRequiredNoDuplicateCase) return noDuplicateCase;
	hasRequiredNoDuplicateCase = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noDuplicateCase = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow duplicate case labels",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-duplicate-case",
			},

			schema: [],

			messages: {
				unexpected: "Duplicate case label.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether the two given nodes are considered to be equal.
			 * @param {ASTNode} a First node.
			 * @param {ASTNode} b Second node.
			 * @returns {boolean} `true` if the nodes are considered to be equal.
			 */
			function equal(a, b) {
				if (a.type !== b.type) {
					return false;
				}

				return astUtils.equalTokens(a, b, sourceCode);
			}
			return {
				SwitchStatement(node) {
					const previousTests = [];

					for (const switchCase of node.cases) {
						if (switchCase.test) {
							const test = switchCase.test;

							if (
								previousTests.some(previousTest =>
									equal(previousTest, test),
								)
							) {
								context.report({
									node: switchCase,
									messageId: "unexpected",
								});
							} else {
								previousTests.push(test);
							}
						}
					}
				},
			};
		},
	};
	return noDuplicateCase;
}

/**
 * @fileoverview Restrict usage of duplicate imports.
 * @author Simen Bekkhus
 */

var noDuplicateImports;
var hasRequiredNoDuplicateImports;

function requireNoDuplicateImports () {
	if (hasRequiredNoDuplicateImports) return noDuplicateImports;
	hasRequiredNoDuplicateImports = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const NAMED_TYPES = ["ImportSpecifier", "ExportSpecifier"];
	const NAMESPACE_TYPES = [
		"ImportNamespaceSpecifier",
		"ExportNamespaceSpecifier",
	];

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/**
	 * Check if an import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier).
	 * @param {string} importExportType An import/export type to check.
	 * @param {string} type Can be "named" or "namespace"
	 * @returns {boolean} True if import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier) and false if it doesn't.
	 */
	function isImportExportSpecifier(importExportType, type) {
		const arrayToCheck = type === "named" ? NAMED_TYPES : NAMESPACE_TYPES;

		return arrayToCheck.includes(importExportType);
	}

	/**
	 * Return the type of (import|export).
	 * @param {ASTNode} node A node to get.
	 * @returns {string} The type of the (import|export).
	 */
	function getImportExportType(node) {
		if (node.specifiers && node.specifiers.length > 0) {
			const nodeSpecifiers = node.specifiers;
			const index = nodeSpecifiers.findIndex(
				({ type }) =>
					isImportExportSpecifier(type, "named") ||
					isImportExportSpecifier(type, "namespace"),
			);
			const i = index > -1 ? index : 0;

			return nodeSpecifiers[i].type;
		}
		if (node.type === "ExportAllDeclaration") {
			if (node.exported) {
				return "ExportNamespaceSpecifier";
			}
			return "ExportAll";
		}
		return "SideEffectImport";
	}

	/**
	 * Returns a boolean indicates if two (import|export) can be merged
	 * @param {ASTNode} node1 A node to check.
	 * @param {ASTNode} node2 A node to check.
	 * @returns {boolean} True if two (import|export) can be merged, false if they can't.
	 */
	function isImportExportCanBeMerged(node1, node2) {
		const importExportType1 = getImportExportType(node1);
		const importExportType2 = getImportExportType(node2);

		if (
			(importExportType1 === "ExportAll" &&
				importExportType2 !== "ExportAll" &&
				importExportType2 !== "SideEffectImport") ||
			(importExportType1 !== "ExportAll" &&
				importExportType1 !== "SideEffectImport" &&
				importExportType2 === "ExportAll")
		) {
			return false;
		}
		if (
			(isImportExportSpecifier(importExportType1, "namespace") &&
				isImportExportSpecifier(importExportType2, "named")) ||
			(isImportExportSpecifier(importExportType2, "namespace") &&
				isImportExportSpecifier(importExportType1, "named"))
		) {
			return false;
		}
		return true;
	}

	/**
	 * Returns a boolean if we should report (import|export).
	 * @param {ASTNode} node A node to be reported or not.
	 * @param {[ASTNode]} previousNodes An array contains previous nodes of the module imported or exported.
	 * @returns {boolean} True if the (import|export) should be reported.
	 */
	function shouldReportImportExport(node, previousNodes) {
		let i = 0;

		while (i < previousNodes.length) {
			if (isImportExportCanBeMerged(node, previousNodes[i])) {
				return true;
			}
			i++;
		}
		return false;
	}

	/**
	 * Returns array contains only nodes with declarations types equal to type.
	 * @param {[{node: ASTNode, declarationType: string}]} nodes An array contains objects, each object contains a node and a declaration type.
	 * @param {string} type Declaration type.
	 * @returns {[ASTNode]} An array contains only nodes with declarations types equal to type.
	 */
	function getNodesByDeclarationType(nodes, type) {
		return nodes
			.filter(({ declarationType }) => declarationType === type)
			.map(({ node }) => node);
	}

	/**
	 * Returns the name of the module imported or re-exported.
	 * @param {ASTNode} node A node to get.
	 * @returns {string} The name of the module, or empty string if no name.
	 */
	function getModule(node) {
		if (node && node.source && node.source.value) {
			return node.source.value.trim();
		}
		return "";
	}

	/**
	 * Checks if the (import|export) can be merged with at least one import or one export, and reports if so.
	 * @param {RuleContext} context The ESLint rule context object.
	 * @param {ASTNode} node A node to get.
	 * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type.
	 * @param {string} declarationType A declaration type can be an import or export.
	 * @param {boolean} includeExports Whether or not to check for exports in addition to imports.
	 * @returns {void} No return value.
	 */
	function checkAndReport(
		context,
		node,
		modules,
		declarationType,
		includeExports,
	) {
		const module = getModule(node);

		if (modules.has(module)) {
			const previousNodes = modules.get(module);
			const messagesIds = [];
			const importNodes = getNodesByDeclarationType(previousNodes, "import");
			let exportNodes;

			if (includeExports) {
				exportNodes = getNodesByDeclarationType(previousNodes, "export");
			}
			if (declarationType === "import") {
				if (shouldReportImportExport(node, importNodes)) {
					messagesIds.push("import");
				}
				if (includeExports) {
					if (shouldReportImportExport(node, exportNodes)) {
						messagesIds.push("importAs");
					}
				}
			} else if (declarationType === "export") {
				if (shouldReportImportExport(node, exportNodes)) {
					messagesIds.push("export");
				}
				if (shouldReportImportExport(node, importNodes)) {
					messagesIds.push("exportAs");
				}
			}
			messagesIds.forEach(messageId =>
				context.report({
					node,
					messageId,
					data: {
						module,
					},
				}),
			);
		}
	}

	/**
	 * @callback nodeCallback
	 * @param {ASTNode} node A node to handle.
	 */

	/**
	 * Returns a function handling the (imports|exports) of a given file
	 * @param {RuleContext} context The ESLint rule context object.
	 * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type.
	 * @param {string} declarationType A declaration type can be an import or export.
	 * @param {boolean} includeExports Whether or not to check for exports in addition to imports.
	 * @returns {nodeCallback} A function passed to ESLint to handle the statement.
	 */
	function handleImportsExports(
		context,
		modules,
		declarationType,
		includeExports,
	) {
		return function (node) {
			const module = getModule(node);

			if (module) {
				checkAndReport(
					context,
					node,
					modules,
					declarationType,
					includeExports,
				);
				const currentNode = { node, declarationType };
				let nodes = [currentNode];

				if (modules.has(module)) {
					const previousNodes = modules.get(module);

					nodes = [...previousNodes, currentNode];
				}
				modules.set(module, nodes);
			}
		};
	}

	/** @type {import('../shared/types').Rule} */
	noDuplicateImports = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					includeExports: false,
				},
			],

			docs: {
				description: "Disallow duplicate module imports",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-duplicate-imports",
			},

			schema: [
				{
					type: "object",
					properties: {
						includeExports: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				import: "'{{module}}' import is duplicated.",
				importAs: "'{{module}}' import is duplicated as export.",
				export: "'{{module}}' export is duplicated.",
				exportAs: "'{{module}}' export is duplicated as import.",
			},
		},

		create(context) {
			const [{ includeExports }] = context.options;
			const modules = new Map();
			const handlers = {
				ImportDeclaration: handleImportsExports(
					context,
					modules,
					"import",
					includeExports,
				),
			};

			if (includeExports) {
				handlers.ExportNamedDeclaration = handleImportsExports(
					context,
					modules,
					"export",
					includeExports,
				);
				handlers.ExportAllDeclaration = handleImportsExports(
					context,
					modules,
					"export",
					includeExports,
				);
			}
			return handlers;
		},
	};
	return noDuplicateImports;
}

/**
 * @fileoverview Helper class to aid in constructing fix commands.
 * @author Alan Pierce
 */

var fixTracker;
var hasRequiredFixTracker;

function requireFixTracker () {
	if (hasRequiredFixTracker) return fixTracker;
	hasRequiredFixTracker = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A helper class to combine fix options into a fix command. Currently, it
	 * exposes some "retain" methods that extend the range of the text being
	 * replaced so that other fixes won't touch that region in the same pass.
	 */
	class FixTracker {
		/**
		 * Create a new FixTracker.
		 * @param {ruleFixer} fixer A ruleFixer instance.
		 * @param {SourceCode} sourceCode A SourceCode object for the current code.
		 */
		constructor(fixer, sourceCode) {
			this.fixer = fixer;
			this.sourceCode = sourceCode;
			this.retainedRange = null;
		}

		/**
		 * Mark the given range as "retained", meaning that other fixes may not
		 * may not modify this region in the same pass.
		 * @param {int[]} range The range to retain.
		 * @returns {FixTracker} The same RuleFixer, for chained calls.
		 */
		retainRange(range) {
			this.retainedRange = range;
			return this;
		}

		/**
		 * Given a node, find the function containing it (or the entire program) and
		 * mark it as retained, meaning that other fixes may not modify it in this
		 * pass. This is useful for avoiding conflicts in fixes that modify control
		 * flow.
		 * @param {ASTNode} node The node to use as a starting point.
		 * @returns {FixTracker} The same RuleFixer, for chained calls.
		 */
		retainEnclosingFunction(node) {
			const functionNode = astUtils.getUpperFunction(node);

			return this.retainRange(
				functionNode ? functionNode.range : this.sourceCode.ast.range,
			);
		}

		/**
		 * Given a node or token, find the token before and afterward, and mark that
		 * range as retained, meaning that other fixes may not modify it in this
		 * pass. This is useful for avoiding conflicts in fixes that make a small
		 * change to the code where the AST should not be changed.
		 * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting
		 *      point. The token to the left and right are use in the range.
		 * @returns {FixTracker} The same RuleFixer, for chained calls.
		 */
		retainSurroundingTokens(nodeOrToken) {
			const tokenBefore =
				this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken;
			const tokenAfter =
				this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken;

			return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]);
		}

		/**
		 * Create a fix command that replaces the given range with the given text,
		 * accounting for any retained ranges.
		 * @param {int[]} range The range to remove in the fix.
		 * @param {string} text The text to insert in place of the range.
		 * @returns {Object} The fix command.
		 */
		replaceTextRange(range, text) {
			let actualRange;

			if (this.retainedRange) {
				actualRange = [
					Math.min(this.retainedRange[0], range[0]),
					Math.max(this.retainedRange[1], range[1]),
				];
			} else {
				actualRange = range;
			}

			return this.fixer.replaceTextRange(
				actualRange,
				this.sourceCode.text.slice(actualRange[0], range[0]) +
					text +
					this.sourceCode.text.slice(range[1], actualRange[1]),
			);
		}

		/**
		 * Create a fix command that removes the given node or token, accounting for
		 * any retained ranges.
		 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
		 * @returns {Object} The fix command.
		 */
		remove(nodeOrToken) {
			return this.replaceTextRange(nodeOrToken.range, "");
		}
	}

	fixTracker = FixTracker;
	return fixTracker;
}

/**
 * @fileoverview Rule to flag `else` after a `return` in `if`
 * @author Ian Christian Myers
 */

var noElseReturn;
var hasRequiredNoElseReturn;

function requireNoElseReturn () {
	if (hasRequiredNoElseReturn) return noElseReturn;
	hasRequiredNoElseReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const FixTracker = requireFixTracker();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noElseReturn = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ allowElseIf: true }],

			docs: {
				description:
					"Disallow `else` blocks after `return` statements in `if` statements",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-else-return",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowElseIf: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				unexpected: "Unnecessary 'else' after 'return'.",
			},
		},

		create(context) {
			const [{ allowElseIf }] = context.options;
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Checks whether the given names can be safely used to declare block-scoped variables
			 * in the given scope. Name collisions can produce redeclaration syntax errors,
			 * or silently change references and modify behavior of the original code.
			 *
			 * This is not a generic function. In particular, it is assumed that the scope is a function scope or
			 * a function's inner scope, and that the names can be valid identifiers in the given scope.
			 * @param {string[]} names Array of variable names.
			 * @param {eslint-scope.Scope} scope Function scope or a function's inner scope.
			 * @returns {boolean} True if all names can be safely declared, false otherwise.
			 */
			function isSafeToDeclare(names, scope) {
				if (names.length === 0) {
					return true;
				}

				const functionScope = scope.variableScope;

				/*
				 * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments",
				 * all function-scoped variables ('var'), and block-scoped variables defined in the scope.
				 * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope.
				 *
				 * Redeclaring any of these would cause a syntax error, except for the implicit variables.
				 */
				const declaredVariables = scope.variables.filter(
					({ defs }) => defs.length > 0,
				);

				if (declaredVariables.some(({ name }) => names.includes(name))) {
					return false;
				}

				// Redeclaring a catch variable would also cause a syntax error.
				if (scope !== functionScope && scope.upper.type === "catch") {
					if (
						scope.upper.variables.some(({ name }) =>
							names.includes(name),
						)
					) {
						return false;
					}
				}

				/*
				 * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error.
				 * However, if the variable was used, declaring a new one with the same name would change references
				 * and modify behavior.
				 */
				const usedImplicitVariables = scope.variables.filter(
					({ defs, references }) =>
						defs.length === 0 && references.length > 0,
				);

				if (
					usedImplicitVariables.some(({ name }) => names.includes(name))
				) {
					return false;
				}

				/*
				 * Declaring a variable with a name that was already used to reference a variable from an upper scope
				 * would change references and modify behavior.
				 */
				if (scope.through.some(t => names.includes(t.identifier.name))) {
					return false;
				}

				/*
				 * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside
				 * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope.
				 *
				 * For example, this would be a syntax error "Identifier 'a' has already been declared":
				 * function foo() { if (bar) { let a; if (baz) { var a; } } }
				 */
				if (scope !== functionScope) {
					const scopeNodeRange = scope.block.range;
					const variablesToCheck = functionScope.variables.filter(
						({ name }) => names.includes(name),
					);

					if (
						variablesToCheck.some(v =>
							v.defs.some(
								({ node: { range } }) =>
									scopeNodeRange[0] <= range[0] &&
									range[1] <= scopeNodeRange[1],
							),
						)
					) {
						return false;
					}
				}

				return true;
			}

			/**
			 * Checks whether the removal of `else` and its braces is safe from variable name collisions.
			 * @param {Node} node The 'else' node.
			 * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is.
			 * @returns {boolean} True if it is safe, false otherwise.
			 */
			function isSafeFromNameCollisions(node, scope) {
				if (node.type === "FunctionDeclaration") {
					// Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently.
					return false;
				}

				if (node.type !== "BlockStatement") {
					return true;
				}

				const elseBlockScope = scope.childScopes.find(
					({ block }) => block === node,
				);

				if (!elseBlockScope) {
					// ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions.
					return true;
				}

				/*
				 * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains
				 * only block-scoped variables (such as let and const variables or class and function declarations)
				 * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions.
				 */
				const namesToCheck = elseBlockScope.variables.map(
					({ name }) => name,
				);

				return isSafeToDeclare(namesToCheck, scope);
			}

			/**
			 * Display the context report if rule is violated
			 * @param {Node} elseNode The 'else' node
			 * @returns {void}
			 */
			function displayReport(elseNode) {
				const currentScope = sourceCode.getScope(elseNode.parent);

				context.report({
					node: elseNode,
					messageId: "unexpected",
					fix(fixer) {
						if (!isSafeFromNameCollisions(elseNode, currentScope)) {
							return null;
						}

						const startToken = sourceCode.getFirstToken(elseNode);
						const elseToken = sourceCode.getTokenBefore(startToken);
						const source = sourceCode.getText(elseNode);
						const lastIfToken = sourceCode.getTokenBefore(elseToken);
						let fixedSource, firstTokenOfElseBlock;

						if (
							startToken.type === "Punctuator" &&
							startToken.value === "{"
						) {
							firstTokenOfElseBlock =
								sourceCode.getTokenAfter(startToken);
						} else {
							firstTokenOfElseBlock = startToken;
						}

						/*
						 * If the if block does not have curly braces and does not end in a semicolon
						 * and the else block starts with (, [, /, +, ` or -, then it is not
						 * safe to remove the else keyword, because ASI will not add a semicolon
						 * after the if block
						 */
						const ifBlockMaybeUnsafe =
							elseNode.parent.consequent.type !== "BlockStatement" &&
							lastIfToken.value !== ";";
						const elseBlockUnsafe = /^[([/+`-]/u.test(
							firstTokenOfElseBlock.value,
						);

						if (ifBlockMaybeUnsafe && elseBlockUnsafe) {
							return null;
						}

						const endToken = sourceCode.getLastToken(elseNode);
						const lastTokenOfElseBlock =
							sourceCode.getTokenBefore(endToken);

						if (lastTokenOfElseBlock.value !== ";") {
							const nextToken = sourceCode.getTokenAfter(endToken);

							const nextTokenUnsafe =
								nextToken && /^[([/+`-]/u.test(nextToken.value);
							const nextTokenOnSameLine =
								nextToken &&
								nextToken.loc.start.line ===
									lastTokenOfElseBlock.loc.start.line;

							/*
							 * If the else block contents does not end in a semicolon,
							 * and the else block starts with (, [, /, +, ` or -, then it is not
							 * safe to remove the else block, because ASI will not add a semicolon
							 * after the remaining else block contents
							 */
							if (
								nextTokenUnsafe ||
								(nextTokenOnSameLine && nextToken.value !== "}")
							) {
								return null;
							}
						}

						if (
							startToken.type === "Punctuator" &&
							startToken.value === "{"
						) {
							fixedSource = source.slice(1, -1);
						} else {
							fixedSource = source;
						}

						/*
						 * Extend the replacement range to include the entire
						 * function to avoid conflicting with no-useless-return.
						 * https://github.com/eslint/eslint/issues/8026
						 *
						 * Also, to avoid name collisions between two else blocks.
						 */
						return new FixTracker(fixer, sourceCode)
							.retainEnclosingFunction(elseNode)
							.replaceTextRange(
								[elseToken.range[0], elseNode.range[1]],
								fixedSource,
							);
					},
				});
			}

			/**
			 * Check to see if the node is a ReturnStatement
			 * @param {Node} node The node being evaluated
			 * @returns {boolean} True if node is a return
			 */
			function checkForReturn(node) {
				return node.type === "ReturnStatement";
			}

			/**
			 * Naive return checking, does not iterate through the whole
			 * BlockStatement because we make the assumption that the ReturnStatement
			 * will be the last node in the body of the BlockStatement.
			 * @param {Node} node The consequent/alternate node
			 * @returns {boolean} True if it has a return
			 */
			function naiveHasReturn(node) {
				if (node.type === "BlockStatement") {
					const body = node.body,
						lastChildNode = body.at(-1);

					return lastChildNode && checkForReturn(lastChildNode);
				}
				return checkForReturn(node);
			}

			/**
			 * Check to see if the node is valid for evaluation,
			 * meaning it has an else.
			 * @param {Node} node The node being evaluated
			 * @returns {boolean} True if the node is valid
			 */
			function hasElse(node) {
				return node.alternate && node.consequent;
			}

			/**
			 * If the consequent is an IfStatement, check to see if it has an else
			 * and both its consequent and alternate path return, meaning this is
			 * a nested case of rule violation.  If-Else not considered currently.
			 * @param {Node} node The consequent node
			 * @returns {boolean} True if this is a nested rule violation
			 */
			function checkForIf(node) {
				return (
					node.type === "IfStatement" &&
					hasElse(node) &&
					naiveHasReturn(node.alternate) &&
					naiveHasReturn(node.consequent)
				);
			}

			/**
			 * Check the consequent/body node to make sure it is not
			 * a ReturnStatement or an IfStatement that returns on both
			 * code paths.
			 * @param {Node} node The consequent or body node
			 * @returns {boolean} `true` if it is a Return/If node that always returns.
			 */
			function checkForReturnOrIf(node) {
				return checkForReturn(node) || checkForIf(node);
			}

			/**
			 * Check whether a node returns in every codepath.
			 * @param {Node} node The node to be checked
			 * @returns {boolean} `true` if it returns on every codepath.
			 */
			function alwaysReturns(node) {
				if (node.type === "BlockStatement") {
					// If we have a BlockStatement, check each consequent body node.
					return node.body.some(checkForReturnOrIf);
				}

				/*
				 * If not a block statement, make sure the consequent isn't a
				 * ReturnStatement or an IfStatement with returns on both paths.
				 */
				return checkForReturnOrIf(node);
			}

			/**
			 * Check the if statement, but don't catch else-if blocks.
			 * @returns {void}
			 * @param {Node} node The node for the if statement to check
			 * @private
			 */
			function checkIfWithoutElse(node) {
				const parent = node.parent;

				/*
				 * Fixing this would require splitting one statement into two, so no error should
				 * be reported if this node is in a position where only one statement is allowed.
				 */
				if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
					return;
				}

				const consequents = [];
				let alternate;

				for (
					let currentNode = node;
					currentNode.type === "IfStatement";
					currentNode = currentNode.alternate
				) {
					if (!currentNode.alternate) {
						return;
					}
					consequents.push(currentNode.consequent);
					alternate = currentNode.alternate;
				}

				if (consequents.every(alwaysReturns)) {
					displayReport(alternate);
				}
			}

			/**
			 * Check the if statement
			 * @returns {void}
			 * @param {Node} node The node for the if statement to check
			 * @private
			 */
			function checkIfWithElse(node) {
				const parent = node.parent;

				/*
				 * Fixing this would require splitting one statement into two, so no error should
				 * be reported if this node is in a position where only one statement is allowed.
				 */
				if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
					return;
				}

				const alternate = node.alternate;

				if (alternate && alwaysReturns(node.consequent)) {
					displayReport(alternate);
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				"IfStatement:exit": allowElseIf
					? checkIfWithoutElse
					: checkIfWithElse,
			};
		},
	};
	return noElseReturn;
}

/**
 * @fileoverview Rule to flag use of an empty block statement
 * @author Nicholas C. Zakas
 */

var noEmpty;
var hasRequiredNoEmpty;

function requireNoEmpty () {
	if (hasRequiredNoEmpty) return noEmpty;
	hasRequiredNoEmpty = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEmpty = {
		meta: {
			hasSuggestions: true,
			type: "suggestion",

			defaultOptions: [
				{
					allowEmptyCatch: false,
				},
			],

			docs: {
				description: "Disallow empty block statements",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-empty",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowEmptyCatch: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "Empty {{type}} statement.",
				suggestComment: "Add comment inside empty {{type}} statement.",
			},
		},

		create(context) {
			const [{ allowEmptyCatch }] = context.options;
			const sourceCode = context.sourceCode;

			return {
				BlockStatement(node) {
					// if the body is not empty, we can just return immediately
					if (node.body.length !== 0) {
						return;
					}

					// a function is generally allowed to be empty
					if (astUtils.isFunction(node.parent)) {
						return;
					}

					if (allowEmptyCatch && node.parent.type === "CatchClause") {
						return;
					}

					// any other block is only allowed to be empty, if it contains a comment
					if (sourceCode.getCommentsInside(node).length > 0) {
						return;
					}

					context.report({
						node,
						messageId: "unexpected",
						data: { type: "block" },
						suggest: [
							{
								messageId: "suggestComment",
								data: { type: "block" },
								fix(fixer) {
									const range = [
										node.range[0] + 1,
										node.range[1] - 1,
									];

									return fixer.replaceTextRange(
										range,
										" /* empty */ ",
									);
								},
							},
						],
					});
				},

				SwitchStatement(node) {
					if (
						typeof node.cases === "undefined" ||
						node.cases.length === 0
					) {
						context.report({
							node,
							messageId: "unexpected",
							data: { type: "switch" },
						});
					}
				},
			};
		},
	};
	return noEmpty;
}

/**
 * @fileoverview Rule to flag the use of empty character classes in regular expressions
 * @author Ian Christian Myers
 */

var noEmptyCharacterClass;
var hasRequiredNoEmptyCharacterClass;

function requireNoEmptyCharacterClass () {
	if (hasRequiredNoEmptyCharacterClass) return noEmptyCharacterClass;
	hasRequiredNoEmptyCharacterClass = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { RegExpParser, visitRegExpAST } = requireRegexpp();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const parser = new RegExpParser();
	const QUICK_TEST_REGEX = /\[\]/u;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEmptyCharacterClass = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow empty character classes in regular expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-empty-character-class",
			},

			schema: [],

			messages: {
				unexpected: "Empty class.",
			},
		},

		create(context) {
			return {
				"Literal[regex]"(node) {
					const { pattern, flags } = node.regex;

					if (!QUICK_TEST_REGEX.test(pattern)) {
						return;
					}

					let regExpAST;

					try {
						regExpAST = parser.parsePattern(
							pattern,
							0,
							pattern.length,
							{
								unicode: flags.includes("u"),
								unicodeSets: flags.includes("v"),
							},
						);
					} catch {
						// Ignore regular expressions that regexpp cannot parse
						return;
					}

					visitRegExpAST(regExpAST, {
						onCharacterClassEnter(characterClass) {
							if (
								!characterClass.negate &&
								characterClass.elements.length === 0
							) {
								context.report({ node, messageId: "unexpected" });
							}
						},
					});
				},
			};
		},
	};
	return noEmptyCharacterClass;
}

/**
 * @fileoverview Rule to disallow empty functions.
 * @author Toru Nagashima
 */

var noEmptyFunction;
var hasRequiredNoEmptyFunction;

function requireNoEmptyFunction () {
	if (hasRequiredNoEmptyFunction) return noEmptyFunction;
	hasRequiredNoEmptyFunction = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const ALLOW_OPTIONS = Object.freeze([
		"functions",
		"arrowFunctions",
		"generatorFunctions",
		"methods",
		"generatorMethods",
		"getters",
		"setters",
		"constructors",
		"asyncFunctions",
		"asyncMethods",
	]);

	/**
	 * Gets the kind of a given function node.
	 * @param {ASTNode} node A function node to get. This is one of
	 *      an ArrowFunctionExpression, a FunctionDeclaration, or a
	 *      FunctionExpression.
	 * @returns {string} The kind of the function. This is one of "functions",
	 *      "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods",
	 *      "generatorMethods", "asyncMethods", "getters", "setters", and
	 *      "constructors".
	 */
	function getKind(node) {
		const parent = node.parent;
		let kind;

		if (node.type === "ArrowFunctionExpression") {
			return "arrowFunctions";
		}

		// Detects main kind.
		if (parent.type === "Property") {
			if (parent.kind === "get") {
				return "getters";
			}
			if (parent.kind === "set") {
				return "setters";
			}
			kind = parent.method ? "methods" : "functions";
		} else if (parent.type === "MethodDefinition") {
			if (parent.kind === "get") {
				return "getters";
			}
			if (parent.kind === "set") {
				return "setters";
			}
			if (parent.kind === "constructor") {
				return "constructors";
			}
			kind = "methods";
		} else {
			kind = "functions";
		}

		// Detects prefix.
		let prefix;

		if (node.generator) {
			prefix = "generator";
		} else if (node.async) {
			prefix = "async";
		} else {
			return kind;
		}
		return prefix + kind[0].toUpperCase() + kind.slice(1);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEmptyFunction = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ allow: [] }],

			docs: {
				description: "Disallow empty functions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-empty-function",
			},

			schema: [
				{
					type: "object",
					properties: {
						allow: {
							type: "array",
							items: { enum: ALLOW_OPTIONS },
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "Unexpected empty {{name}}.",
			},
		},

		create(context) {
			const [{ allow }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports a given function node if the node matches the following patterns.
			 *
			 * - Not allowed by options.
			 * - The body is empty.
			 * - The body doesn't have any comments.
			 * @param {ASTNode} node A function node to report. This is one of
			 *      an ArrowFunctionExpression, a FunctionDeclaration, or a
			 *      FunctionExpression.
			 * @returns {void}
			 */
			function reportIfEmpty(node) {
				const kind = getKind(node);
				const name = astUtils.getFunctionNameWithKind(node);
				const innerComments = sourceCode.getTokens(node.body, {
					includeComments: true,
					filter: astUtils.isCommentToken,
				});

				if (
					!allow.includes(kind) &&
					node.body.type === "BlockStatement" &&
					node.body.body.length === 0 &&
					innerComments.length === 0
				) {
					context.report({
						node,
						loc: node.body.loc,
						messageId: "unexpected",
						data: { name },
					});
				}
			}

			return {
				ArrowFunctionExpression: reportIfEmpty,
				FunctionDeclaration: reportIfEmpty,
				FunctionExpression: reportIfEmpty,
			};
		},
	};
	return noEmptyFunction;
}

/**
 * @fileoverview Rule to disallow an empty pattern
 * @author Alberto Rodríguez
 */

var noEmptyPattern;
var hasRequiredNoEmptyPattern;

function requireNoEmptyPattern () {
	if (hasRequiredNoEmptyPattern) return noEmptyPattern;
	hasRequiredNoEmptyPattern = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEmptyPattern = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowObjectPatternsAsParameters: false,
				},
			],

			docs: {
				description: "Disallow empty destructuring patterns",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-empty-pattern",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowObjectPatternsAsParameters: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "Unexpected empty {{type}} pattern.",
			},
		},

		create(context) {
			const [{ allowObjectPatternsAsParameters }] = context.options;

			return {
				ObjectPattern(node) {
					if (node.properties.length > 0) {
						return;
					}

					// Allow {} and {} = {} empty object patterns as parameters when allowObjectPatternsAsParameters is true
					if (
						allowObjectPatternsAsParameters &&
						(astUtils.isFunction(node.parent) ||
							(node.parent.type === "AssignmentPattern" &&
								astUtils.isFunction(node.parent.parent) &&
								node.parent.right.type === "ObjectExpression" &&
								node.parent.right.properties.length === 0))
					) {
						return;
					}

					context.report({
						node,
						messageId: "unexpected",
						data: { type: "object" },
					});
				},
				ArrayPattern(node) {
					if (node.elements.length === 0) {
						context.report({
							node,
							messageId: "unexpected",
							data: { type: "array" },
						});
					}
				},
			};
		},
	};
	return noEmptyPattern;
}

/**
 * @fileoverview Rule to disallow empty static blocks.
 * @author Sosuke Suzuki
 */

var noEmptyStaticBlock;
var hasRequiredNoEmptyStaticBlock;

function requireNoEmptyStaticBlock () {
	if (hasRequiredNoEmptyStaticBlock) return noEmptyStaticBlock;
	hasRequiredNoEmptyStaticBlock = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEmptyStaticBlock = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow empty static blocks",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-empty-static-block",
			},

			schema: [],

			messages: {
				unexpected: "Unexpected empty static block.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				StaticBlock(node) {
					if (node.body.length === 0) {
						const closingBrace = sourceCode.getLastToken(node);

						if (
							sourceCode.getCommentsBefore(closingBrace).length === 0
						) {
							context.report({
								node,
								messageId: "unexpected",
							});
						}
					}
				},
			};
		},
	};
	return noEmptyStaticBlock;
}

/**
 * @fileoverview Rule to flag comparisons to null without a type-checking
 * operator.
 * @author Ian Christian Myers
 */

var noEqNull;
var hasRequiredNoEqNull;

function requireNoEqNull () {
	if (hasRequiredNoEqNull) return noEqNull;
	hasRequiredNoEqNull = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEqNull = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `null` comparisons without type-checking operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-eq-null",
			},

			schema: [],

			messages: {
				unexpected: "Use '===' to compare with null.",
			},
		},

		create(context) {
			return {
				BinaryExpression(node) {
					const badOperator =
						node.operator === "==" || node.operator === "!=";

					if (
						(node.right.type === "Literal" &&
							node.right.raw === "null" &&
							badOperator) ||
						(node.left.type === "Literal" &&
							node.left.raw === "null" &&
							badOperator)
					) {
						context.report({ node, messageId: "unexpected" });
					}
				},
			};
		},
	};
	return noEqNull;
}

/**
 * @fileoverview Rule to flag use of eval() statement
 * @author Nicholas C. Zakas
 */

var noEval;
var hasRequiredNoEval;

function requireNoEval () {
	if (hasRequiredNoEval) return noEval;
	hasRequiredNoEval = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const candidatesOfGlobalObject = Object.freeze([
		"global",
		"window",
		"globalThis",
	]);

	/**
	 * Checks a given node is a MemberExpression node which has the specified name's
	 * property.
	 * @param {ASTNode} node A node to check.
	 * @param {string} name A name to check.
	 * @returns {boolean} `true` if the node is a MemberExpression node which has
	 *      the specified name's property
	 */
	function isMember(node, name) {
		return astUtils.isSpecificMemberAccess(node, null, name);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noEval = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowIndirect: false,
				},
			],

			docs: {
				description: "Disallow the use of `eval()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-eval",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowIndirect: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected: "eval can be harmful.",
			},
		},

		create(context) {
			const [{ allowIndirect }] = context.options;
			const sourceCode = context.sourceCode;
			let funcInfo = null;

			/**
			 * Pushes a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack.
			 * Top-level scopes are handled separately.
			 *
			 * This is used in order to check whether or not `this` binding is a
			 * reference to the global object.
			 * @param {ASTNode} node A node of the scope.
			 *      For functions, this is one of FunctionDeclaration, FunctionExpression.
			 *      For class static blocks, this is StaticBlock.
			 *      For class field initializers, this can be any node that is PropertyDefinition#value.
			 * @returns {void}
			 */
			function enterThisScope(node) {
				const strict = sourceCode.getScope(node).isStrict;

				funcInfo = {
					upper: funcInfo,
					node,
					strict,
					isTopLevelOfScript: false,
					defaultThis: false,
					initialized: strict,
				};
			}

			/**
			 * Pops a variable scope from the stack.
			 * @returns {void}
			 */
			function exitThisScope() {
				funcInfo = funcInfo.upper;
			}

			/**
			 * Reports a given node.
			 *
			 * `node` is `Identifier` or `MemberExpression`.
			 * The parent of `node` might be `CallExpression`.
			 *
			 * The location of the report is always `eval` `Identifier` (or possibly
			 * `Literal`). The type of the report is `CallExpression` if the parent is
			 * `CallExpression`. Otherwise, it's the given node type.
			 * @param {ASTNode} node A node to report.
			 * @returns {void}
			 */
			function report(node) {
				const parent = node.parent;
				const locationNode =
					node.type === "MemberExpression" ? node.property : node;

				const reportNode =
					parent.type === "CallExpression" && parent.callee === node
						? parent
						: node;

				context.report({
					node: reportNode,
					loc: locationNode.loc,
					messageId: "unexpected",
				});
			}

			/**
			 * Reports accesses of `eval` via the global object.
			 * @param {eslint-scope.Scope} globalScope The global scope.
			 * @returns {void}
			 */
			function reportAccessingEvalViaGlobalObject(globalScope) {
				for (let i = 0; i < candidatesOfGlobalObject.length; ++i) {
					const name = candidatesOfGlobalObject[i];
					const variable = astUtils.getVariableByName(globalScope, name);

					if (!variable) {
						continue;
					}

					const references = variable.references;

					for (let j = 0; j < references.length; ++j) {
						const identifier = references[j].identifier;
						let node = identifier.parent;

						// To detect code like `window.window.eval`.
						while (isMember(node, name)) {
							node = node.parent;
						}

						// Reports.
						if (isMember(node, "eval")) {
							report(node);
						}
					}
				}
			}

			/**
			 * Reports all accesses of `eval` (excludes direct calls to eval).
			 * @param {eslint-scope.Scope} globalScope The global scope.
			 * @returns {void}
			 */
			function reportAccessingEval(globalScope) {
				const variable = astUtils.getVariableByName(globalScope, "eval");

				if (!variable) {
					return;
				}

				const references = variable.references;

				for (let i = 0; i < references.length; ++i) {
					const reference = references[i];
					const id = reference.identifier;

					if (id.name === "eval" && !astUtils.isCallee(id)) {
						// Is accessing to eval (excludes direct calls to eval)
						report(id);
					}
				}
			}

			if (allowIndirect) {
				// Checks only direct calls to eval. It's simple!
				return {
					"CallExpression:exit"(node) {
						const callee = node.callee;

						/*
						 * Optional call (`eval?.("code")`) is not direct eval.
						 * The direct eval is only step 6.a.vi of https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation
						 * But the optional call is https://tc39.es/ecma262/#sec-optional-chaining-chain-evaluation
						 */
						if (
							!node.optional &&
							astUtils.isSpecificId(callee, "eval")
						) {
							report(callee);
						}
					},
				};
			}

			return {
				"CallExpression:exit"(node) {
					const callee = node.callee;

					if (astUtils.isSpecificId(callee, "eval")) {
						report(callee);
					}
				},

				Program(node) {
					const scope = sourceCode.getScope(node),
						features = context.parserOptions.ecmaFeatures || {},
						strict =
							scope.isStrict ||
							node.sourceType === "module" ||
							(features.globalReturn &&
								scope.childScopes[0].isStrict),
						isTopLevelOfScript =
							node.sourceType !== "module" && !features.globalReturn;

					funcInfo = {
						upper: null,
						node,
						strict,
						isTopLevelOfScript,
						defaultThis: true,
						initialized: true,
					};
				},

				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					exitThisScope();
					reportAccessingEval(globalScope);
					reportAccessingEvalViaGlobalObject(globalScope);
				},

				FunctionDeclaration: enterThisScope,
				"FunctionDeclaration:exit": exitThisScope,
				FunctionExpression: enterThisScope,
				"FunctionExpression:exit": exitThisScope,
				"PropertyDefinition > *.value": enterThisScope,
				"PropertyDefinition > *.value:exit": exitThisScope,
				StaticBlock: enterThisScope,
				"StaticBlock:exit": exitThisScope,

				ThisExpression(node) {
					if (!isMember(node.parent, "eval")) {
						return;
					}

					/*
					 * `this.eval` is found.
					 * Checks whether or not the value of `this` is the global object.
					 */
					if (!funcInfo.initialized) {
						funcInfo.initialized = true;
						funcInfo.defaultThis = astUtils.isDefaultThisBinding(
							funcInfo.node,
							sourceCode,
						);
					}

					// `this` at the top level of scripts always refers to the global object
					if (
						funcInfo.isTopLevelOfScript ||
						(!funcInfo.strict && funcInfo.defaultThis)
					) {
						// `this.eval` is possible built-in `eval`.
						report(node.parent);
					}
				},
			};
		},
	};
	return noEval;
}

/**
 * @fileoverview Rule to flag assignment of the exception parameter
 * @author Stephen Murray <spmurrayzzz>
 */

var noExAssign;
var hasRequiredNoExAssign;

function requireNoExAssign () {
	if (hasRequiredNoExAssign) return noExAssign;
	hasRequiredNoExAssign = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExAssign = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow reassigning exceptions in `catch` clauses",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-ex-assign",
			},

			schema: [],

			messages: {
				unexpected: "Do not assign to the exception parameter.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				astUtils
					.getModifyingReferences(variable.references)
					.forEach(reference => {
						context.report({
							node: reference.identifier,
							messageId: "unexpected",
						});
					});
			}

			return {
				CatchClause(node) {
					sourceCode.getDeclaredVariables(node).forEach(checkVariable);
				},
			};
		},
	};
	return noExAssign;
}

/**
 * @fileoverview Rule to flag adding properties to native object's prototypes.
 * @author David Nelson
 */

var noExtendNative;
var hasRequiredNoExtendNative;

function requireNoExtendNative () {
	if (hasRequiredNoExtendNative) return noExtendNative;
	hasRequiredNoExtendNative = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExtendNative = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ exceptions: [] }],

			docs: {
				description: "Disallow extending native types",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-extend-native",
			},

			schema: [
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: {
								type: "string",
							},
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpected:
					"{{builtin}} prototype is read only, properties should not be added.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const exceptions = new Set(context.options[0].exceptions);
			const modifiedBuiltins = new Set(
				Object.keys(astUtils.ECMASCRIPT_GLOBALS)
					.filter(builtin => builtin[0].toUpperCase() === builtin[0])
					.filter(builtin => !exceptions.has(builtin)),
			);

			/**
			 * Reports a lint error for the given node.
			 * @param {ASTNode} node The node to report.
			 * @param {string} builtin The name of the native builtin being extended.
			 * @returns {void}
			 */
			function reportNode(node, builtin) {
				context.report({
					node,
					messageId: "unexpected",
					data: {
						builtin,
					},
				});
			}

			/**
			 * Check to see if the `prototype` property of the given object
			 * identifier node is being accessed.
			 * @param {ASTNode} identifierNode The Identifier representing the object
			 * to check.
			 * @returns {boolean} True if the identifier is the object of a
			 * MemberExpression and its `prototype` property is being accessed,
			 * false otherwise.
			 */
			function isPrototypePropertyAccessed(identifierNode) {
				return Boolean(
					identifierNode &&
						identifierNode.parent &&
						identifierNode.parent.type === "MemberExpression" &&
						identifierNode.parent.object === identifierNode &&
						astUtils.getStaticPropertyName(identifierNode.parent) ===
							"prototype",
				);
			}

			/**
			 * Check if it's an assignment to the property of the given node.
			 * Example: `*.prop = 0` // the `*` is the given node.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if an assignment to the property of the node.
			 */
			function isAssigningToPropertyOf(node) {
				return (
					node.parent.type === "MemberExpression" &&
					node.parent.object === node &&
					node.parent.parent.type === "AssignmentExpression" &&
					node.parent.parent.left === node.parent
				);
			}

			/**
			 * Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
			 */
			function isInDefinePropertyCall(node) {
				return (
					node.parent.type === "CallExpression" &&
					node.parent.arguments[0] === node &&
					astUtils.isSpecificMemberAccess(
						node.parent.callee,
						"Object",
						/^definePropert(?:y|ies)$/u,
					)
				);
			}

			/**
			 * Check to see if object prototype access is part of a prototype
			 * extension. There are three ways a prototype can be extended:
			 * 1. Assignment to prototype property (Object.prototype.foo = 1)
			 * 2. Object.defineProperty()/Object.defineProperties() on a prototype
			 * If prototype extension is detected, report the AssignmentExpression
			 * or CallExpression node.
			 * @param {ASTNode} identifierNode The Identifier representing the object
			 * which prototype is being accessed and possibly extended.
			 * @returns {void}
			 */
			function checkAndReportPrototypeExtension(identifierNode) {
				if (!isPrototypePropertyAccessed(identifierNode)) {
					return; // This is not `*.prototype` access.
				}

				/*
				 * `identifierNode.parent` is a MemberExpression `*.prototype`.
				 * If it's an optional member access, it may be wrapped by a `ChainExpression` node.
				 */
				const prototypeNode =
					identifierNode.parent.parent.type === "ChainExpression"
						? identifierNode.parent.parent
						: identifierNode.parent;

				if (isAssigningToPropertyOf(prototypeNode)) {
					// `*.prototype` -> MemberExpression -> AssignmentExpression
					reportNode(prototypeNode.parent.parent, identifierNode.name);
				} else if (isInDefinePropertyCall(prototypeNode)) {
					// `*.prototype` -> CallExpression
					reportNode(prototypeNode.parent, identifierNode.name);
				}
			}

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					modifiedBuiltins.forEach(builtin => {
						const builtinVar = globalScope.set.get(builtin);

						if (builtinVar && builtinVar.references) {
							builtinVar.references
								.map(ref => ref.identifier)
								.forEach(checkAndReportPrototypeExtension);
						}
					});
				},
			};
		},
	};
	return noExtendNative;
}

/**
 * @fileoverview Rule to flag unnecessary bind calls
 * @author Bence Dányi <bence@danyi.me>
 */

var noExtraBind;
var hasRequiredNoExtraBind;

function requireNoExtraBind () {
	if (hasRequiredNoExtraBind) return noExtraBind;
	hasRequiredNoExtraBind = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SIDE_EFFECT_FREE_NODE_TYPES = new Set([
		"Literal",
		"Identifier",
		"ThisExpression",
		"FunctionExpression",
	]);

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExtraBind = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary calls to `.bind()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-extra-bind",
			},

			schema: [],
			fixable: "code",

			messages: {
				unexpected: "The function binding is unnecessary.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let scopeInfo = null;

			/**
			 * Checks if a node is free of side effects.
			 *
			 * This check is stricter than it needs to be, in order to keep the implementation simple.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} True if the node is known to be side-effect free, false otherwise.
			 */
			function isSideEffectFree(node) {
				return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type);
			}

			/**
			 * Reports a given function node.
			 * @param {ASTNode} node A node to report. This is a FunctionExpression or
			 *      an ArrowFunctionExpression.
			 * @returns {void}
			 */
			function report(node) {
				const memberNode = node.parent;
				const callNode =
					memberNode.parent.type === "ChainExpression"
						? memberNode.parent.parent
						: memberNode.parent;

				context.report({
					node: callNode,
					messageId: "unexpected",
					loc: memberNode.property.loc,

					fix(fixer) {
						if (!isSideEffectFree(callNode.arguments[0])) {
							return null;
						}

						/*
						 * The list of the first/last token pair of a removal range.
						 * This is two parts because closing parentheses may exist between the method name and arguments.
						 * E.g. `(function(){}.bind ) (obj)`
						 *                    ^^^^^   ^^^^^ < removal ranges
						 * E.g. `(function(){}?.['bind'] ) ?.(obj)`
						 *                    ^^^^^^^^^^   ^^^^^^^ < removal ranges
						 */
						const tokenPairs = [
							[
								// `.`, `?.`, or `[` token.
								sourceCode.getTokenAfter(
									memberNode.object,
									astUtils.isNotClosingParenToken,
								),

								// property name or `]` token.
								sourceCode.getLastToken(memberNode),
							],
							[
								// `?.` or `(` token of arguments.
								sourceCode.getTokenAfter(
									memberNode,
									astUtils.isNotClosingParenToken,
								),

								// `)` token of arguments.
								sourceCode.getLastToken(callNode),
							],
						];
						const firstTokenToRemove = tokenPairs[0][0];
						const lastTokenToRemove = tokenPairs[1][1];

						if (
							sourceCode.commentsExistBetween(
								firstTokenToRemove,
								lastTokenToRemove,
							)
						) {
							return null;
						}

						return tokenPairs.map(([start, end]) =>
							fixer.removeRange([start.range[0], end.range[1]]),
						);
					},
				});
			}

			/**
			 * Checks whether or not a given function node is the callee of `.bind()`
			 * method.
			 *
			 * e.g. `(function() {}.bind(foo))`
			 * @param {ASTNode} node A node to report. This is a FunctionExpression or
			 *      an ArrowFunctionExpression.
			 * @returns {boolean} `true` if the node is the callee of `.bind()` method.
			 */
			function isCalleeOfBindMethod(node) {
				if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) {
					return false;
				}

				// The node of `*.bind` member access.
				const bindNode =
					node.parent.parent.type === "ChainExpression"
						? node.parent.parent
						: node.parent;

				return (
					bindNode.parent.type === "CallExpression" &&
					bindNode.parent.callee === bindNode &&
					bindNode.parent.arguments.length === 1 &&
					bindNode.parent.arguments[0].type !== "SpreadElement"
				);
			}

			/**
			 * Adds a scope information object to the stack.
			 * @param {ASTNode} node A node to add. This node is a FunctionExpression
			 *      or a FunctionDeclaration node.
			 * @returns {void}
			 */
			function enterFunction(node) {
				scopeInfo = {
					isBound: isCalleeOfBindMethod(node),
					thisFound: false,
					upper: scopeInfo,
				};
			}

			/**
			 * Removes the scope information object from the top of the stack.
			 * At the same time, this reports the function node if the function has
			 * `.bind()` and the `this` keywords found.
			 * @param {ASTNode} node A node to remove. This node is a
			 *      FunctionExpression or a FunctionDeclaration node.
			 * @returns {void}
			 */
			function exitFunction(node) {
				if (scopeInfo.isBound && !scopeInfo.thisFound) {
					report(node);
				}

				scopeInfo = scopeInfo.upper;
			}

			/**
			 * Reports a given arrow function if the function is callee of `.bind()`
			 * method.
			 * @param {ASTNode} node A node to report. This node is an
			 *      ArrowFunctionExpression.
			 * @returns {void}
			 */
			function exitArrowFunction(node) {
				if (isCalleeOfBindMethod(node)) {
					report(node);
				}
			}

			/**
			 * Set the mark as the `this` keyword was found in this scope.
			 * @returns {void}
			 */
			function markAsThisFound() {
				if (scopeInfo) {
					scopeInfo.thisFound = true;
				}
			}

			return {
				"ArrowFunctionExpression:exit": exitArrowFunction,
				FunctionDeclaration: enterFunction,
				"FunctionDeclaration:exit": exitFunction,
				FunctionExpression: enterFunction,
				"FunctionExpression:exit": exitFunction,
				ThisExpression: markAsThisFound,
			};
		},
	};
	return noExtraBind;
}

/**
 * @fileoverview Rule to flag unnecessary double negation in Boolean contexts
 * @author Brandon Mills
 */

var noExtraBooleanCast;
var hasRequiredNoExtraBooleanCast;

function requireNoExtraBooleanCast () {
	if (hasRequiredNoExtraBooleanCast) return noExtraBooleanCast;
	hasRequiredNoExtraBooleanCast = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const eslintUtils = /*@__PURE__*/ requireEslintUtils();

	const precedence = astUtils.getPrecedence;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExtraBooleanCast = {
		meta: {
			type: "suggestion",

			defaultOptions: [{}],

			docs: {
				description: "Disallow unnecessary boolean casts",
				recommended: true,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-extra-boolean-cast",
			},

			schema: [
				{
					anyOf: [
						{
							type: "object",
							properties: {
								enforceForInnerExpressions: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},

						// deprecated
						{
							type: "object",
							properties: {
								enforceForLogicalOperands: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			fixable: "code",

			messages: {
				unexpectedCall: "Redundant Boolean call.",
				unexpectedNegation: "Redundant double negation.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ enforceForLogicalOperands, enforceForInnerExpressions }] =
				context.options;

			// Node types which have a test which will coerce values to booleans.
			const BOOLEAN_NODE_TYPES = new Set([
				"IfStatement",
				"DoWhileStatement",
				"WhileStatement",
				"ConditionalExpression",
				"ForStatement",
			]);

			/**
			 * Check if a node is a Boolean function or constructor.
			 * @param {ASTNode} node the node
			 * @returns {boolean} If the node is Boolean function or constructor
			 */
			function isBooleanFunctionOrConstructorCall(node) {
				// Boolean(<bool>) and new Boolean(<bool>)
				return (
					(node.type === "CallExpression" ||
						node.type === "NewExpression") &&
					node.callee.type === "Identifier" &&
					node.callee.name === "Boolean"
				);
			}

			/**
			 * Check if a node is in a context where its value would be coerced to a boolean at runtime.
			 * @param {ASTNode} node The node
			 * @returns {boolean} If it is in a boolean context
			 */
			function isInBooleanContext(node) {
				return (
					(isBooleanFunctionOrConstructorCall(node.parent) &&
						node === node.parent.arguments[0]) ||
					(BOOLEAN_NODE_TYPES.has(node.parent.type) &&
						node === node.parent.test) ||
					// !<bool>
					(node.parent.type === "UnaryExpression" &&
						node.parent.operator === "!")
				);
			}

			/**
			 * Checks whether the node is a context that should report an error
			 * Acts recursively if it is in a logical context
			 * @param {ASTNode} node the node
			 * @returns {boolean} If the node is in one of the flagged contexts
			 */
			function isInFlaggedContext(node) {
				if (node.parent.type === "ChainExpression") {
					return isInFlaggedContext(node.parent);
				}

				/*
				 * legacy behavior - enforceForLogicalOperands will only recurse on
				 * logical expressions, not on other contexts.
				 * enforceForInnerExpressions will recurse on logical expressions
				 * as well as the other recursive syntaxes.
				 */

				if (enforceForLogicalOperands || enforceForInnerExpressions) {
					if (node.parent.type === "LogicalExpression") {
						if (
							node.parent.operator === "||" ||
							node.parent.operator === "&&"
						) {
							return isInFlaggedContext(node.parent);
						}

						// Check the right hand side of a `??` operator.
						if (
							enforceForInnerExpressions &&
							node.parent.operator === "??" &&
							node.parent.right === node
						) {
							return isInFlaggedContext(node.parent);
						}
					}
				}

				if (enforceForInnerExpressions) {
					if (
						node.parent.type === "ConditionalExpression" &&
						(node.parent.consequent === node ||
							node.parent.alternate === node)
					) {
						return isInFlaggedContext(node.parent);
					}

					/*
					 * Check last expression only in a sequence, i.e. if ((1, 2, Boolean(3))) {}, since
					 * the others don't affect the result of the expression.
					 */
					if (
						node.parent.type === "SequenceExpression" &&
						node.parent.expressions.at(-1) === node
					) {
						return isInFlaggedContext(node.parent);
					}
				}

				return isInBooleanContext(node);
			}

			/**
			 * Check if a node has comments inside.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if it has comments inside.
			 */
			function hasCommentsInside(node) {
				return Boolean(sourceCode.getCommentsInside(node).length);
			}

			/**
			 * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if the node is parenthesized.
			 * @private
			 */
			function isParenthesized(node) {
				return eslintUtils.isParenthesized(1, node, sourceCode);
			}

			/**
			 * Determines whether the given node needs to be parenthesized when replacing the previous node.
			 * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list
			 * of possible parent node types. By the same assumption, the node's role in a particular parent is already known.
			 * @param {ASTNode} previousNode Previous node.
			 * @param {ASTNode} node The node to check.
			 * @throws {Error} (Unreachable.)
			 * @returns {boolean} `true` if the node needs to be parenthesized.
			 */
			function needsParens(previousNode, node) {
				if (previousNode.parent.type === "ChainExpression") {
					return needsParens(previousNode.parent, node);
				}

				if (isParenthesized(previousNode)) {
					// parentheses around the previous node will stay, so there is no need for an additional pair
					return false;
				}

				// parent of the previous node will become parent of the replacement node
				const parent = previousNode.parent;

				switch (parent.type) {
					case "CallExpression":
					case "NewExpression":
						return node.type === "SequenceExpression";
					case "IfStatement":
					case "DoWhileStatement":
					case "WhileStatement":
					case "ForStatement":
					case "SequenceExpression":
						return false;
					case "ConditionalExpression":
						if (previousNode === parent.test) {
							return precedence(node) <= precedence(parent);
						}
						if (
							previousNode === parent.consequent ||
							previousNode === parent.alternate
						) {
							return (
								precedence(node) <
								precedence({ type: "AssignmentExpression" })
							);
						}

						/* c8 ignore next */
						throw new Error(
							"Ternary child must be test, consequent, or alternate.",
						);
					case "UnaryExpression":
						return precedence(node) < precedence(parent);
					case "LogicalExpression":
						if (
							astUtils.isMixedLogicalAndCoalesceExpressions(
								node,
								parent,
							)
						) {
							return true;
						}
						if (previousNode === parent.left) {
							return precedence(node) < precedence(parent);
						}
						return precedence(node) <= precedence(parent);

					/* c8 ignore next */
					default:
						throw new Error(`Unexpected parent type: ${parent.type}`);
				}
			}

			return {
				UnaryExpression(node) {
					const parent = node.parent;

					// Exit early if it's guaranteed not to match
					if (
						node.operator !== "!" ||
						parent.type !== "UnaryExpression" ||
						parent.operator !== "!"
					) {
						return;
					}

					if (isInFlaggedContext(parent)) {
						context.report({
							node: parent,
							messageId: "unexpectedNegation",
							fix(fixer) {
								if (hasCommentsInside(parent)) {
									return null;
								}

								if (needsParens(parent, node.argument)) {
									return fixer.replaceText(
										parent,
										`(${sourceCode.getText(node.argument)})`,
									);
								}

								let prefix = "";
								const tokenBefore =
									sourceCode.getTokenBefore(parent);
								const firstReplacementToken =
									sourceCode.getFirstToken(node.argument);

								if (
									tokenBefore &&
									tokenBefore.range[1] === parent.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenBefore,
										firstReplacementToken,
									)
								) {
									prefix = " ";
								}

								return fixer.replaceText(
									parent,
									prefix + sourceCode.getText(node.argument),
								);
							},
						});
					}
				},

				CallExpression(node) {
					if (
						node.callee.type !== "Identifier" ||
						node.callee.name !== "Boolean"
					) {
						return;
					}

					if (isInFlaggedContext(node)) {
						context.report({
							node,
							messageId: "unexpectedCall",
							fix(fixer) {
								const parent = node.parent;

								if (node.arguments.length === 0) {
									if (
										parent.type === "UnaryExpression" &&
										parent.operator === "!"
									) {
										/*
										 * !Boolean() -> true
										 */

										if (hasCommentsInside(parent)) {
											return null;
										}

										const replacement = "true";
										let prefix = "";
										const tokenBefore =
											sourceCode.getTokenBefore(parent);

										if (
											tokenBefore &&
											tokenBefore.range[1] ===
												parent.range[0] &&
											!astUtils.canTokensBeAdjacent(
												tokenBefore,
												replacement,
											)
										) {
											prefix = " ";
										}

										return fixer.replaceText(
											parent,
											prefix + replacement,
										);
									}

									/*
									 * Boolean() -> false
									 */

									if (hasCommentsInside(node)) {
										return null;
									}

									return fixer.replaceText(node, "false");
								}

								if (node.arguments.length === 1) {
									const argument = node.arguments[0];

									if (
										argument.type === "SpreadElement" ||
										hasCommentsInside(node)
									) {
										return null;
									}

									/*
									 * Boolean(expression) -> expression
									 */

									if (needsParens(node, argument)) {
										return fixer.replaceText(
											node,
											`(${sourceCode.getText(argument)})`,
										);
									}

									return fixer.replaceText(
										node,
										sourceCode.getText(argument),
									);
								}

								// two or more arguments
								return null;
							},
						});
					}
				},
			};
		},
	};
	return noExtraBooleanCast;
}

/**
 * @fileoverview Rule to disallow unnecessary labels
 * @author Toru Nagashima
 */

var noExtraLabel;
var hasRequiredNoExtraLabel;

function requireNoExtraLabel () {
	if (hasRequiredNoExtraLabel) return noExtraLabel;
	hasRequiredNoExtraLabel = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExtraLabel = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary labels",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-extra-label",
			},

			schema: [],
			fixable: "code",

			messages: {
				unexpected: "This label '{{name}}' is unnecessary.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let scopeInfo = null;

			/**
			 * Creates a new scope with a breakable statement.
			 * @param {ASTNode} node A node to create. This is a BreakableStatement.
			 * @returns {void}
			 */
			function enterBreakableStatement(node) {
				scopeInfo = {
					label:
						node.parent.type === "LabeledStatement"
							? node.parent.label
							: null,
					breakable: true,
					upper: scopeInfo,
				};
			}

			/**
			 * Removes the top scope of the stack.
			 * @returns {void}
			 */
			function exitBreakableStatement() {
				scopeInfo = scopeInfo.upper;
			}

			/**
			 * Creates a new scope with a labeled statement.
			 *
			 * This ignores it if the body is a breakable statement.
			 * In this case it's handled in the `enterBreakableStatement` function.
			 * @param {ASTNode} node A node to create. This is a LabeledStatement.
			 * @returns {void}
			 */
			function enterLabeledStatement(node) {
				if (!astUtils.isBreakableStatement(node.body)) {
					scopeInfo = {
						label: node.label,
						breakable: false,
						upper: scopeInfo,
					};
				}
			}

			/**
			 * Removes the top scope of the stack.
			 *
			 * This ignores it if the body is a breakable statement.
			 * In this case it's handled in the `exitBreakableStatement` function.
			 * @param {ASTNode} node A node. This is a LabeledStatement.
			 * @returns {void}
			 */
			function exitLabeledStatement(node) {
				if (!astUtils.isBreakableStatement(node.body)) {
					scopeInfo = scopeInfo.upper;
				}
			}

			/**
			 * Reports a given control node if it's unnecessary.
			 * @param {ASTNode} node A node. This is a BreakStatement or a
			 *      ContinueStatement.
			 * @returns {void}
			 */
			function reportIfUnnecessary(node) {
				if (!node.label) {
					return;
				}

				const labelNode = node.label;

				for (let info = scopeInfo; info !== null; info = info.upper) {
					if (
						info.breakable ||
						(info.label && info.label.name === labelNode.name)
					) {
						if (
							info.breakable &&
							info.label &&
							info.label.name === labelNode.name
						) {
							context.report({
								node: labelNode,
								messageId: "unexpected",
								data: labelNode,
								fix(fixer) {
									const breakOrContinueToken =
										sourceCode.getFirstToken(node);

									if (
										sourceCode.commentsExistBetween(
											breakOrContinueToken,
											labelNode,
										)
									) {
										return null;
									}

									return fixer.removeRange([
										breakOrContinueToken.range[1],
										labelNode.range[1],
									]);
								},
							});
						}
						return;
					}
				}
			}

			return {
				WhileStatement: enterBreakableStatement,
				"WhileStatement:exit": exitBreakableStatement,
				DoWhileStatement: enterBreakableStatement,
				"DoWhileStatement:exit": exitBreakableStatement,
				ForStatement: enterBreakableStatement,
				"ForStatement:exit": exitBreakableStatement,
				ForInStatement: enterBreakableStatement,
				"ForInStatement:exit": exitBreakableStatement,
				ForOfStatement: enterBreakableStatement,
				"ForOfStatement:exit": exitBreakableStatement,
				SwitchStatement: enterBreakableStatement,
				"SwitchStatement:exit": exitBreakableStatement,
				LabeledStatement: enterLabeledStatement,
				"LabeledStatement:exit": exitLabeledStatement,
				BreakStatement: reportIfUnnecessary,
				ContinueStatement: reportIfUnnecessary,
			};
		},
	};
	return noExtraLabel;
}

/**
 * @fileoverview Disallow parenthesising higher precedence subexpressions.
 * @author Michael Ficarra
 * @deprecated in ESLint v8.53.0
 */

var noExtraParens;
var hasRequiredNoExtraParens;

function requireNoExtraParens () {
	if (hasRequiredNoExtraParens) return noExtraParens;
	hasRequiredNoExtraParens = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const {
		isParenthesized: isParenthesizedRaw,
	} = /*@__PURE__*/ requireEslintUtils();
	const astUtils = requireAstUtils();

	/** @type {import('../shared/types').Rule} */
	noExtraParens = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-extra-parens",
							url: "https://eslint.style/rules/js/no-extra-parens",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow unnecessary parentheses",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-extra-parens",
			},

			fixable: "code",

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["functions"],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["all"],
							},
							{
								type: "object",
								properties: {
									conditionalAssign: { type: "boolean" },
									ternaryOperandBinaryExpressions: {
										type: "boolean",
									},
									nestedBinaryExpressions: { type: "boolean" },
									returnAssign: { type: "boolean" },
									ignoreJSX: {
										enum: [
											"none",
											"all",
											"single-line",
											"multi-line",
										],
									},
									enforceForArrowConditionals: {
										type: "boolean",
									},
									enforceForSequenceExpressions: {
										type: "boolean",
									},
									enforceForNewInMemberExpressions: {
										type: "boolean",
									},
									enforceForFunctionPrototypeMethods: {
										type: "boolean",
									},
									allowParensAfterCommentPattern: {
										type: "string",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			messages: {
				unexpected: "Unnecessary parentheses around expression.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const tokensToIgnore = new WeakSet();
			const precedence = astUtils.getPrecedence;
			const ALL_NODES = context.options[0] !== "functions";
			const EXCEPT_COND_ASSIGN =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].conditionalAssign === false;
			const EXCEPT_COND_TERNARY =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].ternaryOperandBinaryExpressions === false;
			const NESTED_BINARY =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].nestedBinaryExpressions === false;
			const EXCEPT_RETURN_ASSIGN =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].returnAssign === false;
			const IGNORE_JSX =
				ALL_NODES && context.options[1] && context.options[1].ignoreJSX;
			const IGNORE_ARROW_CONDITIONALS =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].enforceForArrowConditionals === false;
			const IGNORE_SEQUENCE_EXPRESSIONS =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].enforceForSequenceExpressions === false;
			const IGNORE_NEW_IN_MEMBER_EXPR =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].enforceForNewInMemberExpressions === false;
			const IGNORE_FUNCTION_PROTOTYPE_METHODS =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].enforceForFunctionPrototypeMethods === false;
			const ALLOW_PARENS_AFTER_COMMENT_PATTERN =
				ALL_NODES &&
				context.options[1] &&
				context.options[1].allowParensAfterCommentPattern;

			const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({
				type: "AssignmentExpression",
			});
			const PRECEDENCE_OF_UPDATE_EXPR = precedence({
				type: "UpdateExpression",
			});

			let reportsBuffer;

			/**
			 * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node.
			 * Example: function(){}.call()
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is an immediate `call` or `apply` method call.
			 * @private
			 */
			function isImmediateFunctionPrototypeMethodCall(node) {
				const callNode = astUtils.skipChainExpression(node);

				if (callNode.type !== "CallExpression") {
					return false;
				}
				const callee = astUtils.skipChainExpression(callNode.callee);

				return (
					callee.type === "MemberExpression" &&
					callee.object.type === "FunctionExpression" &&
					["call", "apply"].includes(
						astUtils.getStaticPropertyName(callee),
					)
				);
			}

			/**
			 * Determines if this rule should be enforced for a node given the current configuration.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the rule should be enforced for this node.
			 * @private
			 */
			function ruleApplies(node) {
				if (node.type === "JSXElement" || node.type === "JSXFragment") {
					const isSingleLine = node.loc.start.line === node.loc.end.line;

					switch (IGNORE_JSX) {
						// Exclude this JSX element from linting
						case "all":
							return false;

						// Exclude this JSX element if it is multi-line element
						case "multi-line":
							return isSingleLine;

						// Exclude this JSX element if it is single-line element
						case "single-line":
							return !isSingleLine;

						// no default
					}
				}

				if (
					node.type === "SequenceExpression" &&
					IGNORE_SEQUENCE_EXPRESSIONS
				) {
					return false;
				}

				if (
					isImmediateFunctionPrototypeMethodCall(node) &&
					IGNORE_FUNCTION_PROTOTYPE_METHODS
				) {
					return false;
				}

				return (
					ALL_NODES ||
					node.type === "FunctionExpression" ||
					node.type === "ArrowFunctionExpression"
				);
			}

			/**
			 * Determines if a node is surrounded by parentheses.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is parenthesised.
			 * @private
			 */
			function isParenthesised(node) {
				return isParenthesizedRaw(1, node, sourceCode);
			}

			/**
			 * Determines if a node is surrounded by parentheses twice.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is doubly parenthesised.
			 * @private
			 */
			function isParenthesisedTwice(node) {
				return isParenthesizedRaw(2, node, sourceCode);
			}

			/**
			 * Determines if a node is surrounded by (potentially) invalid parentheses.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is incorrectly parenthesised.
			 * @private
			 */
			function hasExcessParens(node) {
				return ruleApplies(node) && isParenthesised(node);
			}

			/**
			 * Determines if a node that is expected to be parenthesised is surrounded by
			 * (potentially) invalid extra parentheses.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
			 * @private
			 */
			function hasDoubleExcessParens(node) {
				return ruleApplies(node) && isParenthesisedTwice(node);
			}

			/**
			 * Determines if a node that is expected to be parenthesised is surrounded by
			 * (potentially) invalid extra parentheses with considering precedence level of the node.
			 * If the preference level of the node is not higher or equal to precedence lower limit, it also checks
			 * whether the node is surrounded by parentheses twice or not.
			 * @param {ASTNode} node The node to be checked.
			 * @param {number} precedenceLowerLimit The lower limit of precedence.
			 * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
			 * @private
			 */
			function hasExcessParensWithPrecedence(node, precedenceLowerLimit) {
				if (ruleApplies(node) && isParenthesised(node)) {
					if (
						precedence(node) >= precedenceLowerLimit ||
						isParenthesisedTwice(node)
					) {
						return true;
					}
				}
				return false;
			}

			/**
			 * Determines if a node test expression is allowed to have a parenthesised assignment
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the assignment can be parenthesised.
			 * @private
			 */
			function isCondAssignException(node) {
				return (
					EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"
				);
			}

			/**
			 * Determines if a node is in a return statement
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is in a return statement.
			 * @private
			 */
			function isInReturnStatement(node) {
				for (
					let currentNode = node;
					currentNode;
					currentNode = currentNode.parent
				) {
					if (
						currentNode.type === "ReturnStatement" ||
						(currentNode.type === "ArrowFunctionExpression" &&
							currentNode.body.type !== "BlockStatement")
					) {
						return true;
					}
				}

				return false;
			}

			/**
			 * Determines if a constructor function is newed-up with parens
			 * @param {ASTNode} newExpression The NewExpression node to be checked.
			 * @returns {boolean} True if the constructor is called with parens.
			 * @private
			 */
			function isNewExpressionWithParens(newExpression) {
				const lastToken = sourceCode.getLastToken(newExpression);
				const penultimateToken = sourceCode.getTokenBefore(lastToken);

				return (
					newExpression.arguments.length > 0 ||
					// The expression should end with its own parens, e.g., new new foo() is not a new expression with parens
					(astUtils.isOpeningParenToken(penultimateToken) &&
						astUtils.isClosingParenToken(lastToken) &&
						newExpression.callee.range[1] < newExpression.range[1])
				);
			}

			/**
			 * Determines if a node is or contains an assignment expression
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is or contains an assignment expression.
			 * @private
			 */
			function containsAssignment(node) {
				if (node.type === "AssignmentExpression") {
					return true;
				}
				if (
					node.type === "ConditionalExpression" &&
					(node.consequent.type === "AssignmentExpression" ||
						node.alternate.type === "AssignmentExpression")
				) {
					return true;
				}
				if (
					(node.left && node.left.type === "AssignmentExpression") ||
					(node.right && node.right.type === "AssignmentExpression")
				) {
					return true;
				}

				return false;
			}

			/**
			 * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the assignment can be parenthesised.
			 * @private
			 */
			function isReturnAssignException(node) {
				if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) {
					return false;
				}

				if (node.type === "ReturnStatement") {
					return node.argument && containsAssignment(node.argument);
				}
				if (
					node.type === "ArrowFunctionExpression" &&
					node.body.type !== "BlockStatement"
				) {
					return containsAssignment(node.body);
				}
				return containsAssignment(node);
			}

			/**
			 * Determines if a node following a [no LineTerminator here] restriction is
			 * surrounded by (potentially) invalid extra parentheses.
			 * @param {Token} token The token preceding the [no LineTerminator here] restriction.
			 * @param {ASTNode} node The node to be checked.
			 * @returns {boolean} True if the node is incorrectly parenthesised.
			 * @private
			 */
			function hasExcessParensNoLineTerminator(token, node) {
				if (token.loc.end.line === node.loc.start.line) {
					return hasExcessParens(node);
				}

				return hasDoubleExcessParens(node);
			}

			/**
			 * Determines whether a node should be preceded by an additional space when removing parens
			 * @param {ASTNode} node node to evaluate; must be surrounded by parentheses
			 * @returns {boolean} `true` if a space should be inserted before the node
			 * @private
			 */
			function requiresLeadingSpace(node) {
				const leftParenToken = sourceCode.getTokenBefore(node);
				const tokenBeforeLeftParen = sourceCode.getTokenBefore(
					leftParenToken,
					{ includeComments: true },
				);
				const tokenAfterLeftParen = sourceCode.getTokenAfter(
					leftParenToken,
					{ includeComments: true },
				);

				return (
					tokenBeforeLeftParen &&
					tokenBeforeLeftParen.range[1] === leftParenToken.range[0] &&
					leftParenToken.range[1] === tokenAfterLeftParen.range[0] &&
					!astUtils.canTokensBeAdjacent(
						tokenBeforeLeftParen,
						tokenAfterLeftParen,
					)
				);
			}

			/**
			 * Determines whether a node should be followed by an additional space when removing parens
			 * @param {ASTNode} node node to evaluate; must be surrounded by parentheses
			 * @returns {boolean} `true` if a space should be inserted after the node
			 * @private
			 */
			function requiresTrailingSpace(node) {
				const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 });
				const rightParenToken = nextTwoTokens[0];
				const tokenAfterRightParen = nextTwoTokens[1];
				const tokenBeforeRightParen = sourceCode.getLastToken(node);

				return (
					rightParenToken &&
					tokenAfterRightParen &&
					!sourceCode.isSpaceBetweenTokens(
						rightParenToken,
						tokenAfterRightParen,
					) &&
					!astUtils.canTokensBeAdjacent(
						tokenBeforeRightParen,
						tokenAfterRightParen,
					)
				);
			}

			/**
			 * Determines if a given expression node is an IIFE
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} `true` if the given node is an IIFE
			 */
			function isIIFE(node) {
				const maybeCallNode = astUtils.skipChainExpression(node);

				return (
					maybeCallNode.type === "CallExpression" &&
					maybeCallNode.callee.type === "FunctionExpression"
				);
			}

			/**
			 * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment.
			 * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax,
			 * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary.
			 * @param {ASTNode} [node] The node to check
			 * @returns {boolean} `true` if the given node can be a valid assignment target
			 */
			function canBeAssignmentTarget(node) {
				return (
					node &&
					(node.type === "Identifier" || node.type === "MemberExpression")
				);
			}

			/**
			 * Checks if a node is fixable.
			 * A node is fixable if removing a single pair of surrounding parentheses does not turn it
			 * into a directive after fixing other nodes.
			 * Almost all nodes are fixable, except if all of the following conditions are met:
			 * The node is a string Literal
			 * It has a single pair of parentheses
			 * It is the only child of an ExpressionStatement
			 * @param {ASTNode} node The node to evaluate.
			 * @returns {boolean} Whether or not the node is fixable.
			 * @private
			 */
			function isFixable(node) {
				// if it's not a string literal it can be autofixed
				if (node.type !== "Literal" || typeof node.value !== "string") {
					return true;
				}
				if (isParenthesisedTwice(node)) {
					return true;
				}
				return !astUtils.isTopLevelExpressionStatement(node.parent);
			}

			/**
			 * Report the node
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function report(node) {
				const leftParenToken = sourceCode.getTokenBefore(node);
				const rightParenToken = sourceCode.getTokenAfter(node);

				if (!isParenthesisedTwice(node)) {
					if (tokensToIgnore.has(sourceCode.getFirstToken(node))) {
						return;
					}

					if (isIIFE(node) && !isParenthesised(node.callee)) {
						return;
					}

					if (ALLOW_PARENS_AFTER_COMMENT_PATTERN) {
						const commentsBeforeLeftParenToken =
							sourceCode.getCommentsBefore(leftParenToken);
						const totalCommentsBeforeLeftParenTokenCount =
							commentsBeforeLeftParenToken.length;
						const ignorePattern = new RegExp(
							ALLOW_PARENS_AFTER_COMMENT_PATTERN,
							"u",
						);

						if (
							totalCommentsBeforeLeftParenTokenCount > 0 &&
							ignorePattern.test(
								commentsBeforeLeftParenToken[
									totalCommentsBeforeLeftParenTokenCount - 1
								].value,
							)
						) {
							return;
						}
					}
				}

				/**
				 * Finishes reporting
				 * @returns {void}
				 * @private
				 */
				function finishReport() {
					context.report({
						node,
						loc: leftParenToken.loc,
						messageId: "unexpected",
						fix: isFixable(node)
							? fixer => {
									const parenthesizedSource =
										sourceCode.text.slice(
											leftParenToken.range[1],
											rightParenToken.range[0],
										);

									return fixer.replaceTextRange(
										[
											leftParenToken.range[0],
											rightParenToken.range[1],
										],
										(requiresLeadingSpace(node) ? " " : "") +
											parenthesizedSource +
											(requiresTrailingSpace(node)
												? " "
												: ""),
									);
								}
							: null,
					});
				}

				if (reportsBuffer) {
					reportsBuffer.reports.push({ node, finishReport });
					return;
				}

				finishReport();
			}

			/**
			 * Evaluate a argument of the node.
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkArgumentWithPrecedence(node) {
				if (
					hasExcessParensWithPrecedence(node.argument, precedence(node))
				) {
					report(node.argument);
				}
			}

			/**
			 * Check if a member expression contains a call expression
			 * @param {ASTNode} node MemberExpression node to evaluate
			 * @returns {boolean} true if found, false if not
			 */
			function doesMemberExpressionContainCallExpression(node) {
				let currentNode = node.object;
				let currentNodeType = node.object.type;

				while (currentNodeType === "MemberExpression") {
					currentNode = currentNode.object;
					currentNodeType = currentNode.type;
				}

				return currentNodeType === "CallExpression";
			}

			/**
			 * Evaluate a new call
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkCallNew(node) {
				const callee = node.callee;

				if (hasExcessParensWithPrecedence(callee, precedence(node))) {
					if (
						hasDoubleExcessParens(callee) ||
						!(
							isIIFE(node) ||
							// (new A)(); new (new A)();
							(callee.type === "NewExpression" &&
								!isNewExpressionWithParens(callee) &&
								!(
									node.type === "NewExpression" &&
									!isNewExpressionWithParens(node)
								)) ||
							// new (a().b)(); new (a.b().c);
							(node.type === "NewExpression" &&
								callee.type === "MemberExpression" &&
								doesMemberExpressionContainCallExpression(
									callee,
								)) ||
							// (a?.b)(); (a?.())();
							(!node.optional && callee.type === "ChainExpression")
						)
					) {
						report(node.callee);
					}
				}
				node.arguments
					.filter(arg =>
						hasExcessParensWithPrecedence(
							arg,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						),
					)
					.forEach(report);
			}

			/**
			 * Evaluate binary logicals
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkBinaryLogical(node) {
				const prec = precedence(node);
				const leftPrecedence = precedence(node.left);
				const rightPrecedence = precedence(node.right);
				const isExponentiation = node.operator === "**";
				const shouldSkipLeft =
					NESTED_BINARY &&
					(node.left.type === "BinaryExpression" ||
						node.left.type === "LogicalExpression");
				const shouldSkipRight =
					NESTED_BINARY &&
					(node.right.type === "BinaryExpression" ||
						node.right.type === "LogicalExpression");

				if (!shouldSkipLeft && hasExcessParens(node.left)) {
					if (
						(!(
							["AwaitExpression", "UnaryExpression"].includes(
								node.left.type,
							) && isExponentiation
						) &&
							!astUtils.isMixedLogicalAndCoalesceExpressions(
								node.left,
								node,
							) &&
							(leftPrecedence > prec ||
								(leftPrecedence === prec && !isExponentiation))) ||
						isParenthesisedTwice(node.left)
					) {
						report(node.left);
					}
				}

				if (!shouldSkipRight && hasExcessParens(node.right)) {
					if (
						(!astUtils.isMixedLogicalAndCoalesceExpressions(
							node.right,
							node,
						) &&
							(rightPrecedence > prec ||
								(rightPrecedence === prec && isExponentiation))) ||
						isParenthesisedTwice(node.right)
					) {
						report(node.right);
					}
				}
			}

			/**
			 * Check the parentheses around the super class of the given class definition.
			 * @param {ASTNode} node The node of class declarations to check.
			 * @returns {void}
			 */
			function checkClass(node) {
				if (!node.superClass) {
					return;
				}

				/*
				 * If `node.superClass` is a LeftHandSideExpression, parentheses are extra.
				 * Otherwise, parentheses are needed.
				 */
				const hasExtraParens =
					precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR
						? hasExcessParens(node.superClass)
						: hasDoubleExcessParens(node.superClass);

				if (hasExtraParens) {
					report(node.superClass);
				}
			}

			/**
			 * Check the parentheses around the argument of the given spread operator.
			 * @param {ASTNode} node The node of spread elements/properties to check.
			 * @returns {void}
			 */
			function checkSpreadOperator(node) {
				if (
					hasExcessParensWithPrecedence(
						node.argument,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.argument);
				}
			}

			/**
			 * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration
			 * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node
			 * @returns {void}
			 */
			function checkExpressionOrExportStatement(node) {
				const firstToken = isParenthesised(node)
					? sourceCode.getTokenBefore(node)
					: sourceCode.getFirstToken(node);
				const secondToken = sourceCode.getTokenAfter(
					firstToken,
					astUtils.isNotOpeningParenToken,
				);
				const thirdToken = secondToken
					? sourceCode.getTokenAfter(secondToken)
					: null;
				const tokenAfterClosingParens = secondToken
					? sourceCode.getTokenAfter(
							secondToken,
							astUtils.isNotClosingParenToken,
						)
					: null;

				if (
					astUtils.isOpeningParenToken(firstToken) &&
					(astUtils.isOpeningBraceToken(secondToken) ||
						(secondToken.type === "Keyword" &&
							(secondToken.value === "function" ||
								secondToken.value === "class" ||
								(secondToken.value === "let" &&
									tokenAfterClosingParens &&
									(astUtils.isOpeningBracketToken(
										tokenAfterClosingParens,
									) ||
										tokenAfterClosingParens.type ===
											"Identifier")))) ||
						(secondToken &&
							secondToken.type === "Identifier" &&
							secondToken.value === "async" &&
							thirdToken &&
							thirdToken.type === "Keyword" &&
							thirdToken.value === "function"))
				) {
					tokensToIgnore.add(secondToken);
				}

				const hasExtraParens =
					node.parent.type === "ExportDefaultDeclaration"
						? hasExcessParensWithPrecedence(
								node,
								PRECEDENCE_OF_ASSIGNMENT_EXPR,
							)
						: hasExcessParens(node);

				if (hasExtraParens) {
					report(node);
				}
			}

			/**
			 * Finds the path from the given node to the specified ancestor.
			 * @param {ASTNode} node First node in the path.
			 * @param {ASTNode} ancestor Last node in the path.
			 * @returns {ASTNode[]} Path, including both nodes.
			 * @throws {Error} If the given node does not have the specified ancestor.
			 */
			function pathToAncestor(node, ancestor) {
				const path = [node];
				let currentNode = node;

				while (currentNode !== ancestor) {
					currentNode = currentNode.parent;

					/* c8 ignore start */
					if (currentNode === null) {
						throw new Error(
							"Nodes are not in the ancestor-descendant relationship.",
						);
					} /* c8 ignore stop */

					path.push(currentNode);
				}

				return path;
			}

			/**
			 * Finds the path from the given node to the specified descendant.
			 * @param {ASTNode} node First node in the path.
			 * @param {ASTNode} descendant Last node in the path.
			 * @returns {ASTNode[]} Path, including both nodes.
			 * @throws {Error} If the given node does not have the specified descendant.
			 */
			function pathToDescendant(node, descendant) {
				return pathToAncestor(descendant, node).reverse();
			}

			/**
			 * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer
			 * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop.
			 * @param {ASTNode} node Ancestor of an 'in' expression.
			 * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself.
			 * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis.
			 */
			function isSafelyEnclosingInExpression(node, child) {
				switch (node.type) {
					case "ArrayExpression":
					case "ArrayPattern":
					case "BlockStatement":
					case "ObjectExpression":
					case "ObjectPattern":
					case "TemplateLiteral":
						return true;
					case "ArrowFunctionExpression":
					case "FunctionExpression":
						return node.params.includes(child);
					case "CallExpression":
					case "NewExpression":
						return node.arguments.includes(child);
					case "MemberExpression":
						return node.computed && node.property === child;
					case "ConditionalExpression":
						return node.consequent === child;
					default:
						return false;
				}
			}

			/**
			 * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately.
			 * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings.
			 * @returns {void}
			 */
			function startNewReportsBuffering() {
				reportsBuffer = {
					upper: reportsBuffer,
					inExpressionNodes: [],
					reports: [],
				};
			}

			/**
			 * Ends the current reports buffering.
			 * @returns {void}
			 */
			function endCurrentReportsBuffering() {
				const { upper, inExpressionNodes, reports } = reportsBuffer;

				if (upper) {
					upper.inExpressionNodes.push(...inExpressionNodes);
					upper.reports.push(...reports);
				} else {
					// flush remaining reports
					reports.forEach(({ finishReport }) => finishReport());
				}

				reportsBuffer = upper;
			}

			/**
			 * Checks whether the given node is in the current reports buffer.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if the node is in the current buffer, false otherwise.
			 */
			function isInCurrentReportsBuffer(node) {
				return reportsBuffer.reports.some(r => r.node === node);
			}

			/**
			 * Removes the given node from the current reports buffer.
			 * @param {ASTNode} node Node to remove.
			 * @returns {void}
			 */
			function removeFromCurrentReportsBuffer(node) {
				reportsBuffer.reports = reportsBuffer.reports.filter(
					r => r.node !== node,
				);
			}

			/**
			 * Checks whether a node is a MemberExpression at NewExpression's callee.
			 * @param {ASTNode} node node to check.
			 * @returns {boolean} True if the node is a MemberExpression at NewExpression's callee. false otherwise.
			 */
			function isMemberExpInNewCallee(node) {
				if (node.type === "MemberExpression") {
					return node.parent.type === "NewExpression" &&
						node.parent.callee === node
						? true
						: node.parent.object === node &&
								isMemberExpInNewCallee(node.parent);
				}
				return false;
			}

			/**
			 * Checks if the left-hand side of an assignment is an identifier, the operator is one of
			 * `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous class or function.
			 *
			 * As per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, an
			 * assignment involving one of the operators `=`, `&&=`, `||=` or `??=` where the right-hand
			 * side is an anonymous class or function and the left-hand side is an *unparenthesized*
			 * identifier has different semantics than other assignments.
			 * Specifically, when an expression like `foo = function () {}` is evaluated, `foo.name`
			 * will be set to the string "foo", i.e. the identifier name. The same thing does not happen
			 * when evaluating `(foo) = function () {}`.
			 * Since the parenthesizing of the identifier in the left-hand side is significant in this
			 * special case, the parentheses, if present, should not be flagged as unnecessary.
			 * @param {ASTNode} node an AssignmentExpression node.
			 * @returns {boolean} `true` if the left-hand side of the assignment is an identifier, the
			 * operator is one of `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous
			 * class or function; otherwise, `false`.
			 */
			function isAnonymousFunctionAssignmentException({
				left,
				operator,
				right,
			}) {
				if (
					left.type === "Identifier" &&
					["=", "&&=", "||=", "??="].includes(operator)
				) {
					const rhsType = right.type;

					if (rhsType === "ArrowFunctionExpression") {
						return true;
					}
					if (
						(rhsType === "FunctionExpression" ||
							rhsType === "ClassExpression") &&
						!right.id
					) {
						return true;
					}
				}
				return false;
			}

			return {
				ArrayExpression(node) {
					node.elements
						.filter(
							e =>
								e &&
								hasExcessParensWithPrecedence(
									e,
									PRECEDENCE_OF_ASSIGNMENT_EXPR,
								),
						)
						.forEach(report);
				},

				ArrayPattern(node) {
					node.elements
						.filter(e => canBeAssignmentTarget(e) && hasExcessParens(e))
						.forEach(report);
				},

				ArrowFunctionExpression(node) {
					if (isReturnAssignException(node)) {
						return;
					}

					if (
						node.body.type === "ConditionalExpression" &&
						IGNORE_ARROW_CONDITIONALS
					) {
						return;
					}

					if (node.body.type !== "BlockStatement") {
						const firstBodyToken = sourceCode.getFirstToken(
							node.body,
							astUtils.isNotOpeningParenToken,
						);
						const tokenBeforeFirst =
							sourceCode.getTokenBefore(firstBodyToken);

						if (
							astUtils.isOpeningParenToken(tokenBeforeFirst) &&
							astUtils.isOpeningBraceToken(firstBodyToken)
						) {
							tokensToIgnore.add(firstBodyToken);
						}
						if (
							hasExcessParensWithPrecedence(
								node.body,
								PRECEDENCE_OF_ASSIGNMENT_EXPR,
							)
						) {
							report(node.body);
						}
					}
				},

				AssignmentExpression(node) {
					if (
						canBeAssignmentTarget(node.left) &&
						hasExcessParens(node.left) &&
						(!isAnonymousFunctionAssignmentException(node) ||
							isParenthesisedTwice(node.left))
					) {
						report(node.left);
					}

					if (
						!isReturnAssignException(node) &&
						hasExcessParensWithPrecedence(node.right, precedence(node))
					) {
						report(node.right);
					}
				},

				BinaryExpression(node) {
					if (reportsBuffer && node.operator === "in") {
						reportsBuffer.inExpressionNodes.push(node);
					}

					checkBinaryLogical(node);
				},

				CallExpression: checkCallNew,

				ConditionalExpression(node) {
					if (isReturnAssignException(node)) {
						return;
					}

					const availableTypes = new Set([
						"BinaryExpression",
						"LogicalExpression",
					]);

					if (
						!(
							EXCEPT_COND_TERNARY &&
							availableTypes.has(node.test.type)
						) &&
						!isCondAssignException(node) &&
						hasExcessParensWithPrecedence(
							node.test,
							precedence({
								type: "LogicalExpression",
								operator: "||",
							}),
						)
					) {
						report(node.test);
					}

					if (
						!(
							EXCEPT_COND_TERNARY &&
							availableTypes.has(node.consequent.type)
						) &&
						hasExcessParensWithPrecedence(
							node.consequent,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.consequent);
					}

					if (
						!(
							EXCEPT_COND_TERNARY &&
							availableTypes.has(node.alternate.type)
						) &&
						hasExcessParensWithPrecedence(
							node.alternate,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.alternate);
					}
				},

				DoWhileStatement(node) {
					if (
						hasExcessParens(node.test) &&
						!isCondAssignException(node)
					) {
						report(node.test);
					}
				},

				ExportDefaultDeclaration: node =>
					checkExpressionOrExportStatement(node.declaration),
				ExpressionStatement: node =>
					checkExpressionOrExportStatement(node.expression),

				ForInStatement(node) {
					if (node.left.type !== "VariableDeclaration") {
						const firstLeftToken = sourceCode.getFirstToken(
							node.left,
							astUtils.isNotOpeningParenToken,
						);

						if (
							firstLeftToken.value === "let" &&
							astUtils.isOpeningBracketToken(
								sourceCode.getTokenAfter(
									firstLeftToken,
									astUtils.isNotClosingParenToken,
								),
							)
						) {
							// ForInStatement#left expression cannot start with `let[`.
							tokensToIgnore.add(firstLeftToken);
						}
					}

					if (hasExcessParens(node.left)) {
						report(node.left);
					}

					if (hasExcessParens(node.right)) {
						report(node.right);
					}
				},

				ForOfStatement(node) {
					if (node.left.type !== "VariableDeclaration") {
						const firstLeftToken = sourceCode.getFirstToken(
							node.left,
							astUtils.isNotOpeningParenToken,
						);

						if (firstLeftToken.value === "let") {
							// ForOfStatement#left expression cannot start with `let`.
							tokensToIgnore.add(firstLeftToken);
						}
					}

					if (hasExcessParens(node.left)) {
						report(node.left);
					}

					if (
						hasExcessParensWithPrecedence(
							node.right,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.right);
					}
				},

				ForStatement(node) {
					if (
						node.test &&
						hasExcessParens(node.test) &&
						!isCondAssignException(node)
					) {
						report(node.test);
					}

					if (node.update && hasExcessParens(node.update)) {
						report(node.update);
					}

					if (node.init) {
						if (node.init.type !== "VariableDeclaration") {
							const firstToken = sourceCode.getFirstToken(
								node.init,
								astUtils.isNotOpeningParenToken,
							);

							if (
								firstToken.value === "let" &&
								astUtils.isOpeningBracketToken(
									sourceCode.getTokenAfter(
										firstToken,
										astUtils.isNotClosingParenToken,
									),
								)
							) {
								// ForStatement#init expression cannot start with `let[`.
								tokensToIgnore.add(firstToken);
							}
						}

						startNewReportsBuffering();

						if (hasExcessParens(node.init)) {
							report(node.init);
						}
					}
				},

				"ForStatement > *.init:exit"(node) {
					/*
					 * Removing parentheses around `in` expressions might change semantics and cause errors.
					 *
					 * For example, this valid for loop:
					 *      for (let a = (b in c); ;);
					 * after removing parentheses would be treated as an invalid for-in loop:
					 *      for (let a = b in c; ;);
					 */

					if (reportsBuffer.reports.length) {
						reportsBuffer.inExpressionNodes.forEach(
							inExpressionNode => {
								const path = pathToDescendant(
									node,
									inExpressionNode,
								);
								let nodeToExclude;

								for (let i = 0; i < path.length; i++) {
									const pathNode = path[i];

									if (i < path.length - 1) {
										const nextPathNode = path[i + 1];

										if (
											isSafelyEnclosingInExpression(
												pathNode,
												nextPathNode,
											)
										) {
											// The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]').
											return;
										}
									}

									if (isParenthesised(pathNode)) {
										if (isInCurrentReportsBuffer(pathNode)) {
											// This node was supposed to be reported, but parentheses might be necessary.

											if (isParenthesisedTwice(pathNode)) {
												/*
												 * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses.
												 * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses.
												 * The remaining pair is safely enclosing the 'in' expression.
												 */
												return;
											}

											// Exclude the outermost node only.
											if (!nodeToExclude) {
												nodeToExclude = pathNode;
											}

											// Don't break the loop here, there might be some safe nodes or parentheses that will stay inside.
										} else {
											// This node will stay parenthesised, the 'in' expression in safely enclosed by '()'.
											return;
										}
									}
								}

								// Exclude the node from the list (i.e. treat parentheses as necessary)
								removeFromCurrentReportsBuffer(nodeToExclude);
							},
						);
					}

					endCurrentReportsBuffering();
				},

				IfStatement(node) {
					if (
						hasExcessParens(node.test) &&
						!isCondAssignException(node)
					) {
						report(node.test);
					}
				},

				ImportExpression(node) {
					const { source } = node;

					if (source.type === "SequenceExpression") {
						if (hasDoubleExcessParens(source)) {
							report(source);
						}
					} else if (hasExcessParens(source)) {
						report(source);
					}
				},

				LogicalExpression: checkBinaryLogical,

				MemberExpression(node) {
					const shouldAllowWrapOnce =
						isMemberExpInNewCallee(node) &&
						doesMemberExpressionContainCallExpression(node);
					const nodeObjHasExcessParens = shouldAllowWrapOnce
						? hasDoubleExcessParens(node.object)
						: hasExcessParens(node.object) &&
							!(
								isImmediateFunctionPrototypeMethodCall(
									node.parent,
								) &&
								node.parent.callee === node &&
								IGNORE_FUNCTION_PROTOTYPE_METHODS
							);

					if (
						nodeObjHasExcessParens &&
						precedence(node.object) >= precedence(node) &&
						(node.computed ||
							!(
								astUtils.isDecimalInteger(node.object) ||
								// RegExp literal is allowed to have parens (#1589)
								(node.object.type === "Literal" &&
									node.object.regex)
							))
					) {
						report(node.object);
					}

					if (
						nodeObjHasExcessParens &&
						node.object.type === "CallExpression"
					) {
						report(node.object);
					}

					if (
						nodeObjHasExcessParens &&
						!IGNORE_NEW_IN_MEMBER_EXPR &&
						node.object.type === "NewExpression" &&
						isNewExpressionWithParens(node.object)
					) {
						report(node.object);
					}

					if (
						nodeObjHasExcessParens &&
						node.optional &&
						node.object.type === "ChainExpression"
					) {
						report(node.object);
					}

					if (node.computed && hasExcessParens(node.property)) {
						report(node.property);
					}
				},

				"MethodDefinition[computed=true]"(node) {
					if (
						hasExcessParensWithPrecedence(
							node.key,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.key);
					}
				},

				NewExpression: checkCallNew,

				ObjectExpression(node) {
					node.properties
						.filter(
							property =>
								property.value &&
								hasExcessParensWithPrecedence(
									property.value,
									PRECEDENCE_OF_ASSIGNMENT_EXPR,
								),
						)
						.forEach(property => report(property.value));
				},

				ObjectPattern(node) {
					node.properties
						.filter(property => {
							const value = property.value;

							return (
								canBeAssignmentTarget(value) &&
								hasExcessParens(value)
							);
						})
						.forEach(property => report(property.value));
				},

				Property(node) {
					if (node.computed) {
						const { key } = node;

						if (
							key &&
							hasExcessParensWithPrecedence(
								key,
								PRECEDENCE_OF_ASSIGNMENT_EXPR,
							)
						) {
							report(key);
						}
					}
				},

				PropertyDefinition(node) {
					if (
						node.computed &&
						hasExcessParensWithPrecedence(
							node.key,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.key);
					}

					if (
						node.value &&
						hasExcessParensWithPrecedence(
							node.value,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.value);
					}
				},

				RestElement(node) {
					const argument = node.argument;

					if (
						canBeAssignmentTarget(argument) &&
						hasExcessParens(argument)
					) {
						report(argument);
					}
				},

				ReturnStatement(node) {
					const returnToken = sourceCode.getFirstToken(node);

					if (isReturnAssignException(node)) {
						return;
					}

					if (
						node.argument &&
						hasExcessParensNoLineTerminator(
							returnToken,
							node.argument,
						) &&
						// RegExp literal is allowed to have parens (#1589)
						!(node.argument.type === "Literal" && node.argument.regex)
					) {
						report(node.argument);
					}
				},

				SequenceExpression(node) {
					const precedenceOfNode = precedence(node);

					node.expressions
						.filter(e =>
							hasExcessParensWithPrecedence(e, precedenceOfNode),
						)
						.forEach(report);
				},

				SwitchCase(node) {
					if (node.test && hasExcessParens(node.test)) {
						report(node.test);
					}
				},

				SwitchStatement(node) {
					if (hasExcessParens(node.discriminant)) {
						report(node.discriminant);
					}
				},

				ThrowStatement(node) {
					const throwToken = sourceCode.getFirstToken(node);

					if (
						hasExcessParensNoLineTerminator(throwToken, node.argument)
					) {
						report(node.argument);
					}
				},

				UnaryExpression: checkArgumentWithPrecedence,
				UpdateExpression(node) {
					if (node.prefix) {
						checkArgumentWithPrecedence(node);
					} else {
						const { argument } = node;
						const operatorToken = sourceCode.getLastToken(node);

						if (
							argument.loc.end.line === operatorToken.loc.start.line
						) {
							checkArgumentWithPrecedence(node);
						} else {
							if (hasDoubleExcessParens(argument)) {
								report(argument);
							}
						}
					}
				},
				AwaitExpression: checkArgumentWithPrecedence,

				VariableDeclarator(node) {
					if (
						node.init &&
						hasExcessParensWithPrecedence(
							node.init,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						) &&
						// RegExp literal is allowed to have parens (#1589)
						!(node.init.type === "Literal" && node.init.regex)
					) {
						report(node.init);
					}
				},

				WhileStatement(node) {
					if (
						hasExcessParens(node.test) &&
						!isCondAssignException(node)
					) {
						report(node.test);
					}
				},

				WithStatement(node) {
					if (hasExcessParens(node.object)) {
						report(node.object);
					}
				},

				YieldExpression(node) {
					if (node.argument) {
						const yieldToken = sourceCode.getFirstToken(node);

						if (
							(precedence(node.argument) >= precedence(node) &&
								hasExcessParensNoLineTerminator(
									yieldToken,
									node.argument,
								)) ||
							hasDoubleExcessParens(node.argument)
						) {
							report(node.argument);
						}
					}
				},

				ClassDeclaration: checkClass,
				ClassExpression: checkClass,

				SpreadElement: checkSpreadOperator,
				SpreadProperty: checkSpreadOperator,
				ExperimentalSpreadProperty: checkSpreadOperator,

				TemplateLiteral(node) {
					node.expressions
						.filter(e => e && hasExcessParens(e))
						.forEach(report);
				},

				AssignmentPattern(node) {
					const { left, right } = node;

					if (canBeAssignmentTarget(left) && hasExcessParens(left)) {
						report(left);
					}

					if (
						right &&
						hasExcessParensWithPrecedence(
							right,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(right);
					}
				},
			};
		},
	};
	return noExtraParens;
}

/**
 * @fileoverview Rule to flag use of unnecessary semicolons
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */

var noExtraSemi;
var hasRequiredNoExtraSemi;

function requireNoExtraSemi () {
	if (hasRequiredNoExtraSemi) return noExtraSemi;
	hasRequiredNoExtraSemi = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const FixTracker = requireFixTracker();
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noExtraSemi = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-extra-semi",
							url: "https://eslint.style/rules/js/no-extra-semi",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary semicolons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-extra-semi",
			},

			fixable: "code",
			schema: [],

			messages: {
				unexpected: "Unnecessary semicolon.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Checks if a node or token is fixable.
			 * A node is fixable if it can be removed without turning a subsequent statement into a directive after fixing other nodes.
			 * @param {Token} nodeOrToken The node or token to check.
			 * @returns {boolean} Whether or not the node is fixable.
			 */
			function isFixable(nodeOrToken) {
				const nextToken = sourceCode.getTokenAfter(nodeOrToken);

				if (!nextToken || nextToken.type !== "String") {
					return true;
				}
				const stringNode = sourceCode.getNodeByRangeIndex(
					nextToken.range[0],
				);

				return !astUtils.isTopLevelExpressionStatement(stringNode.parent);
			}

			/**
			 * Reports an unnecessary semicolon error.
			 * @param {Node|Token} nodeOrToken A node or a token to be reported.
			 * @returns {void}
			 */
			function report(nodeOrToken) {
				context.report({
					node: nodeOrToken,
					messageId: "unexpected",
					fix: isFixable(nodeOrToken)
						? fixer =>
								/*
								 * Expand the replacement range to include the surrounding
								 * tokens to avoid conflicting with semi.
								 * https://github.com/eslint/eslint/issues/7928
								 */
								new FixTracker(fixer, context.sourceCode)
									.retainSurroundingTokens(nodeOrToken)
									.remove(nodeOrToken)
						: null,
				});
			}

			/**
			 * Checks for a part of a class body.
			 * This checks tokens from a specified token to a next MethodDefinition or the end of class body.
			 * @param {Token} firstToken The first token to check.
			 * @returns {void}
			 */
			function checkForPartOfClassBody(firstToken) {
				for (
					let token = firstToken;
					token.type === "Punctuator" &&
					!astUtils.isClosingBraceToken(token);
					token = sourceCode.getTokenAfter(token)
				) {
					if (astUtils.isSemicolonToken(token)) {
						report(token);
					}
				}
			}

			return {
				/**
				 * Reports this empty statement, except if the parent node is a loop.
				 * @param {Node} node A EmptyStatement node to be reported.
				 * @returns {void}
				 */
				EmptyStatement(node) {
					const parent = node.parent,
						allowedParentTypes = [
							"ForStatement",
							"ForInStatement",
							"ForOfStatement",
							"WhileStatement",
							"DoWhileStatement",
							"IfStatement",
							"LabeledStatement",
							"WithStatement",
						];

					if (!allowedParentTypes.includes(parent.type)) {
						report(node);
					}
				},

				/**
				 * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
				 * @param {Node} node A ClassBody node to check.
				 * @returns {void}
				 */
				ClassBody(node) {
					checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`.
				},

				/**
				 * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
				 * @param {Node} node A MethodDefinition node of the start point.
				 * @returns {void}
				 */
				"MethodDefinition, PropertyDefinition, StaticBlock"(node) {
					checkForPartOfClassBody(sourceCode.getTokenAfter(node));
				},
			};
		},
	};
	return noExtraSemi;
}

/**
 * @fileoverview Rule to flag fall-through cases in switch statements.
 * @author Matt DuVall <http://mattduvall.com/>
 */

var noFallthrough;
var hasRequiredNoFallthrough;

function requireNoFallthrough () {
	if (hasRequiredNoFallthrough) return noFallthrough;
	hasRequiredNoFallthrough = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { directivesPattern } = requireDirectives();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu;

	/**
	 * Checks all segments in a set and returns true if any are reachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if any segment is reachable; false otherwise.
	 */
	function isAnySegmentReachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive.
	 * @param {string} comment The comment string to check.
	 * @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments.
	 * @returns {boolean} `true` if the comment string is truly a fallthrough comment.
	 */
	function isFallThroughComment(comment, fallthroughCommentPattern) {
		return (
			fallthroughCommentPattern.test(comment) &&
			!directivesPattern.test(comment.trim())
		);
	}

	/**
	 * Checks whether or not a given case has a fallthrough comment.
	 * @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through.
	 * @param {ASTNode} subsequentCase The case after caseWhichFallsThrough.
	 * @param {RuleContext} context A rule context which stores comments.
	 * @param {RegExp} fallthroughCommentPattern A pattern to match comment to.
	 * @returns {null | object} the comment if the case has a valid fallthrough comment, otherwise null
	 */
	function getFallthroughComment(
		caseWhichFallsThrough,
		subsequentCase,
		context,
		fallthroughCommentPattern,
	) {
		const sourceCode = context.sourceCode;

		if (
			caseWhichFallsThrough.consequent.length === 1 &&
			caseWhichFallsThrough.consequent[0].type === "BlockStatement"
		) {
			const trailingCloseBrace = sourceCode.getLastToken(
				caseWhichFallsThrough.consequent[0],
			);
			const commentInBlock = sourceCode
				.getCommentsBefore(trailingCloseBrace)
				.pop();

			if (
				commentInBlock &&
				isFallThroughComment(
					commentInBlock.value,
					fallthroughCommentPattern,
				)
			) {
				return commentInBlock;
			}
		}

		const comment = sourceCode.getCommentsBefore(subsequentCase).pop();

		if (
			comment &&
			isFallThroughComment(comment.value, fallthroughCommentPattern)
		) {
			return comment;
		}

		return null;
	}

	/**
	 * Checks whether a node and a token are separated by blank lines
	 * @param {ASTNode} node The node to check
	 * @param {Token} token The token to compare against
	 * @returns {boolean} `true` if there are blank lines between node and token
	 */
	function hasBlankLinesBetween(node, token) {
		return token.loc.start.line > node.loc.end.line + 1;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noFallthrough = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowEmptyCase: false,
					reportUnusedFallthroughComment: false,
				},
			],

			docs: {
				description: "Disallow fallthrough of `case` statements",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-fallthrough",
			},

			schema: [
				{
					type: "object",
					properties: {
						commentPattern: {
							type: "string",
						},
						allowEmptyCase: {
							type: "boolean",
						},
						reportUnusedFallthroughComment: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				unusedFallthroughComment:
					"Found a comment that would permit fallthrough, but case cannot fall through.",
				case: "Expected a 'break' statement before 'case'.",
				default: "Expected a 'break' statement before 'default'.",
			},
		},

		create(context) {
			const codePathSegments = [];
			let currentCodePathSegments = new Set();
			const sourceCode = context.sourceCode;
			const [
				{ allowEmptyCase, commentPattern, reportUnusedFallthroughComment },
			] = context.options;
			const fallthroughCommentPattern = commentPattern
				? new RegExp(commentPattern, "u")
				: DEFAULT_FALLTHROUGH_COMMENT;

			/*
			 * We need to use leading comments of the next SwitchCase node because
			 * trailing comments is wrong if semicolons are omitted.
			 */
			let previousCase = null;

			return {
				onCodePathStart() {
					codePathSegments.push(currentCodePathSegments);
					currentCodePathSegments = new Set();
				},

				onCodePathEnd() {
					currentCodePathSegments = codePathSegments.pop();
				},

				onUnreachableCodePathSegmentStart(segment) {
					currentCodePathSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				onCodePathSegmentStart(segment) {
					currentCodePathSegments.add(segment);
				},

				onCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				SwitchCase(node) {
					/*
					 * Checks whether or not there is a fallthrough comment.
					 * And reports the previous fallthrough node if that does not exist.
					 */

					if (previousCase && previousCase.node.parent === node.parent) {
						const previousCaseFallthroughComment =
							getFallthroughComment(
								previousCase.node,
								node,
								context,
								fallthroughCommentPattern,
							);

						if (
							previousCase.isFallthrough &&
							!previousCaseFallthroughComment
						) {
							context.report({
								messageId: node.test ? "case" : "default",
								node,
							});
						} else if (
							reportUnusedFallthroughComment &&
							!previousCase.isSwitchExitReachable &&
							previousCaseFallthroughComment
						) {
							context.report({
								messageId: "unusedFallthroughComment",
								node: previousCaseFallthroughComment,
							});
						}
					}
					previousCase = null;
				},

				"SwitchCase:exit"(node) {
					const nextToken = sourceCode.getTokenAfter(node);

					/*
					 * `reachable` meant fall through because statements preceded by
					 * `break`, `return`, or `throw` are unreachable.
					 * And allows empty cases and the last case.
					 */
					const isSwitchExitReachable = isAnySegmentReachable(
						currentCodePathSegments,
					);
					const isFallthrough =
						isSwitchExitReachable &&
						(node.consequent.length > 0 ||
							(!allowEmptyCase &&
								hasBlankLinesBetween(node, nextToken))) &&
						node.parent.cases.at(-1) !== node;

					previousCase = {
						node,
						isSwitchExitReachable,
						isFallthrough,
					};
				},
			};
		},
	};
	return noFallthrough;
}

/**
 * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal
 * @author James Allardice
 * @deprecated in ESLint v8.53.0
 */

var noFloatingDecimal;
var hasRequiredNoFloatingDecimal;

function requireNoFloatingDecimal () {
	if (hasRequiredNoFloatingDecimal) return noFloatingDecimal;
	hasRequiredNoFloatingDecimal = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noFloatingDecimal = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-floating-decimal",
							url: "https://eslint.style/rules/js/no-floating-decimal",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description:
					"Disallow leading or trailing decimal points in numeric literals",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-floating-decimal",
			},

			schema: [],
			fixable: "code",
			messages: {
				leading: "A leading decimal point can be confused with a dot.",
				trailing: "A trailing decimal point can be confused with a dot.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				Literal(node) {
					if (typeof node.value === "number") {
						if (node.raw.startsWith(".")) {
							context.report({
								node,
								messageId: "leading",
								fix(fixer) {
									const tokenBefore =
										sourceCode.getTokenBefore(node);
									const needsSpaceBefore =
										tokenBefore &&
										tokenBefore.range[1] === node.range[0] &&
										!astUtils.canTokensBeAdjacent(
											tokenBefore,
											`0${node.raw}`,
										);

									return fixer.insertTextBefore(
										node,
										needsSpaceBefore ? " 0" : "0",
									);
								},
							});
						}
						if (node.raw.indexOf(".") === node.raw.length - 1) {
							context.report({
								node,
								messageId: "trailing",
								fix: fixer => fixer.insertTextAfter(node, "0"),
							});
						}
					}
				},
			};
		},
	};
	return noFloatingDecimal;
}

/**
 * @fileoverview Rule to flag use of function declaration identifiers as variables.
 * @author Ian Christian Myers
 */

var noFuncAssign;
var hasRequiredNoFuncAssign;

function requireNoFuncAssign () {
	if (hasRequiredNoFuncAssign) return noFuncAssign;
	hasRequiredNoFuncAssign = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noFuncAssign = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow reassigning `function` declarations",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-func-assign",
			},

			schema: [],

			messages: {
				isAFunction: "'{{name}}' is a function.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Reports a reference if is non initializer and writable.
			 * @param {References} references Collection of reference to check.
			 * @returns {void}
			 */
			function checkReference(references) {
				astUtils.getModifyingReferences(references).forEach(reference => {
					context.report({
						node: reference.identifier,
						messageId: "isAFunction",
						data: {
							name: reference.identifier.name,
						},
					});
				});
			}

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				if (variable.defs[0].type === "FunctionName") {
					checkReference(variable.references);
				}
			}

			/**
			 * Checks parameters of a given function node.
			 * @param {ASTNode} node A function node to check.
			 * @returns {void}
			 */
			function checkForFunction(node) {
				sourceCode.getDeclaredVariables(node).forEach(checkVariable);
			}

			return {
				FunctionDeclaration: checkForFunction,
				FunctionExpression: checkForFunction,
			};
		},
	};
	return noFuncAssign;
}

/**
 * @fileoverview Rule to disallow assignments to native objects or read-only global variables
 * @author Ilya Volodin
 */

var noGlobalAssign;
var hasRequiredNoGlobalAssign;

function requireNoGlobalAssign () {
	if (hasRequiredNoGlobalAssign) return noGlobalAssign;
	hasRequiredNoGlobalAssign = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noGlobalAssign = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ exceptions: [] }],

			docs: {
				description:
					"Disallow assignments to native objects or read-only global variables",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-global-assign",
			},

			schema: [
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: { type: "string" },
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				globalShouldNotBeModified:
					"Read-only global '{{name}}' should not be modified.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ exceptions }] = context.options;

			/**
			 * Reports write references.
			 * @param {Reference} reference A reference to check.
			 * @param {int} index The index of the reference in the references.
			 * @param {Reference[]} references The array that the reference belongs to.
			 * @returns {void}
			 */
			function checkReference(reference, index, references) {
				const identifier = reference.identifier;

				if (
					reference.init === false &&
					reference.isWrite() &&
					/*
					 * Destructuring assignments can have multiple default value,
					 * so possibly there are multiple writeable references for the same identifier.
					 */
					(index === 0 || references[index - 1].identifier !== identifier)
				) {
					context.report({
						node: identifier,
						messageId: "globalShouldNotBeModified",
						data: {
							name: identifier.name,
						},
					});
				}
			}

			/**
			 * Reports write references if a given variable is read-only builtin.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				if (
					variable.writeable === false &&
					!exceptions.includes(variable.name)
				) {
					variable.references.forEach(checkReference);
				}
			}

			return {
				Program(node) {
					const globalScope = sourceCode.getScope(node);

					globalScope.variables.forEach(checkVariable);
				},
			};
		},
	};
	return noGlobalAssign;
}

/**
 * @fileoverview A rule to disallow the type conversions with shorter notations.
 * @author Toru Nagashima
 */

var noImplicitCoercion;
var hasRequiredNoImplicitCoercion;

function requireNoImplicitCoercion () {
	if (hasRequiredNoImplicitCoercion) return noImplicitCoercion;
	hasRequiredNoImplicitCoercion = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u;
	const ALLOWABLE_OPERATORS = ["~", "!!", "+", "- -", "-", "*"];

	/**
	 * Checks whether or not a node is a double logical negating.
	 * @param {ASTNode} node An UnaryExpression node to check.
	 * @returns {boolean} Whether or not the node is a double logical negating.
	 */
	function isDoubleLogicalNegating(node) {
		return (
			node.operator === "!" &&
			node.argument.type === "UnaryExpression" &&
			node.argument.operator === "!"
		);
	}

	/**
	 * Checks whether or not a node is a binary negating of `.indexOf()` method calling.
	 * @param {ASTNode} node An UnaryExpression node to check.
	 * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling.
	 */
	function isBinaryNegatingOfIndexOf(node) {
		if (node.operator !== "~") {
			return false;
		}
		const callNode = astUtils.skipChainExpression(node.argument);

		return (
			callNode.type === "CallExpression" &&
			astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN)
		);
	}

	/**
	 * Checks whether or not a node is a multiplying by one.
	 * @param {BinaryExpression} node A BinaryExpression node to check.
	 * @returns {boolean} Whether or not the node is a multiplying by one.
	 */
	function isMultiplyByOne(node) {
		return (
			node.operator === "*" &&
			((node.left.type === "Literal" && node.left.value === 1) ||
				(node.right.type === "Literal" && node.right.value === 1))
		);
	}

	/**
	 * Checks whether the given node logically represents multiplication by a fraction of `1`.
	 * For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the
	 * whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`.
	 * @param {BinaryExpression} node A BinaryExpression node to check.
	 * @param {SourceCode} sourceCode The source code object.
	 * @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`.
	 */
	function isMultiplyByFractionOfOne(node, sourceCode) {
		return (
			node.type === "BinaryExpression" &&
			node.operator === "*" &&
			node.right.type === "Literal" &&
			node.right.value === 1 &&
			node.parent.type === "BinaryExpression" &&
			node.parent.operator === "/" &&
			node.parent.left === node &&
			!astUtils.isParenthesised(sourceCode, node)
		);
	}

	/**
	 * Checks whether the result of a node is numeric or not
	 * @param {ASTNode} node The node to test
	 * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call
	 */
	function isNumeric(node) {
		return (
			(node.type === "Literal" && typeof node.value === "number") ||
			(node.type === "CallExpression" &&
				(node.callee.name === "Number" ||
					node.callee.name === "parseInt" ||
					node.callee.name === "parseFloat"))
		);
	}

	/**
	 * Returns the first non-numeric operand in a BinaryExpression. Designed to be
	 * used from bottom to up since it walks up the BinaryExpression trees using
	 * node.parent to find the result.
	 * @param {BinaryExpression} node The BinaryExpression node to be walked up on
	 * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null
	 */
	function getNonNumericOperand(node) {
		const left = node.left,
			right = node.right;

		if (right.type !== "BinaryExpression" && !isNumeric(right)) {
			return right;
		}

		if (left.type !== "BinaryExpression" && !isNumeric(left)) {
			return left;
		}

		return null;
	}

	/**
	 * Checks whether an expression evaluates to a string.
	 * @param {ASTNode} node node that represents the expression to check.
	 * @returns {boolean} Whether or not the expression evaluates to a string.
	 */
	function isStringType(node) {
		return (
			astUtils.isStringLiteral(node) ||
			(node.type === "CallExpression" &&
				node.callee.type === "Identifier" &&
				node.callee.name === "String")
		);
	}

	/**
	 * Checks whether a node is an empty string literal or not.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} Whether or not the passed in node is an
	 * empty string literal or not.
	 */
	function isEmptyString(node) {
		return (
			astUtils.isStringLiteral(node) &&
			(node.value === "" ||
				(node.type === "TemplateLiteral" &&
					node.quasis.length === 1 &&
					node.quasis[0].value.cooked === ""))
		);
	}

	/**
	 * Checks whether or not a node is a concatenating with an empty string.
	 * @param {ASTNode} node A BinaryExpression node to check.
	 * @returns {boolean} Whether or not the node is a concatenating with an empty string.
	 */
	function isConcatWithEmptyString(node) {
		return (
			node.operator === "+" &&
			((isEmptyString(node.left) && !isStringType(node.right)) ||
				(isEmptyString(node.right) && !isStringType(node.left)))
		);
	}

	/**
	 * Checks whether or not a node is appended with an empty string.
	 * @param {ASTNode} node An AssignmentExpression node to check.
	 * @returns {boolean} Whether or not the node is appended with an empty string.
	 */
	function isAppendEmptyString(node) {
		return node.operator === "+=" && isEmptyString(node.right);
	}

	/**
	 * Returns the operand that is not an empty string from a flagged BinaryExpression.
	 * @param {ASTNode} node The flagged BinaryExpression node to check.
	 * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression.
	 */
	function getNonEmptyOperand(node) {
		return isEmptyString(node.left) ? node.right : node.left;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noImplicitCoercion = {
		meta: {
			hasSuggestions: true,
			type: "suggestion",

			docs: {
				description: "Disallow shorthand type conversions",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-implicit-coercion",
			},

			fixable: "code",

			schema: [
				{
					type: "object",
					properties: {
						boolean: {
							type: "boolean",
						},
						number: {
							type: "boolean",
						},
						string: {
							type: "boolean",
						},
						disallowTemplateShorthand: {
							type: "boolean",
						},
						allow: {
							type: "array",
							items: {
								enum: ALLOWABLE_OPERATORS,
							},
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [
				{
					allow: [],
					boolean: true,
					disallowTemplateShorthand: false,
					number: true,
					string: true,
				},
			],

			messages: {
				implicitCoercion:
					"Unexpected implicit coercion encountered. Use `{{recommendation}}` instead.",
				useRecommendation: "Use `{{recommendation}}` instead.",
			},
		},

		create(context) {
			const [options] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports an error and autofixes the node
			 * @param {ASTNode} node An ast node to report the error on.
			 * @param {string} recommendation The recommended code for the issue
			 * @param {bool} shouldSuggest Whether this report should offer a suggestion
			 * @param {bool} shouldFix Whether this report should fix the node
			 * @returns {void}
			 */
			function report(node, recommendation, shouldSuggest, shouldFix) {
				/**
				 * Fix function
				 * @param {RuleFixer} fixer The fixer to fix.
				 * @returns {Fix} The fix object.
				 */
				function fix(fixer) {
					const tokenBefore = sourceCode.getTokenBefore(node);

					if (
						tokenBefore?.range[1] === node.range[0] &&
						!astUtils.canTokensBeAdjacent(tokenBefore, recommendation)
					) {
						return fixer.replaceText(node, ` ${recommendation}`);
					}

					return fixer.replaceText(node, recommendation);
				}

				context.report({
					node,
					messageId: "implicitCoercion",
					data: { recommendation },
					fix(fixer) {
						if (!shouldFix) {
							return null;
						}

						return fix(fixer);
					},
					suggest: [
						{
							messageId: "useRecommendation",
							data: { recommendation },
							fix(fixer) {
								if (shouldFix || !shouldSuggest) {
									return null;
								}

								return fix(fixer);
							},
						},
					],
				});
			}

			return {
				UnaryExpression(node) {
					let operatorAllowed;

					// !!foo
					operatorAllowed = options.allow.includes("!!");
					if (
						!operatorAllowed &&
						options.boolean &&
						isDoubleLogicalNegating(node)
					) {
						const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`;
						const variable = astUtils.getVariableByName(
							sourceCode.getScope(node),
							"Boolean",
						);
						const booleanExists = variable?.identifiers.length === 0;

						report(node, recommendation, true, booleanExists);
					}

					// ~foo.indexOf(bar)
					operatorAllowed = options.allow.includes("~");
					if (
						!operatorAllowed &&
						options.boolean &&
						isBinaryNegatingOfIndexOf(node)
					) {
						// `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case.
						const comparison =
							node.argument.type === "ChainExpression"
								? ">= 0"
								: "!== -1";
						const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`;

						report(node, recommendation, false, false);
					}

					// +foo
					operatorAllowed = options.allow.includes("+");
					if (
						!operatorAllowed &&
						options.number &&
						node.operator === "+" &&
						!isNumeric(node.argument)
					) {
						const recommendation = `Number(${sourceCode.getText(node.argument)})`;

						report(node, recommendation, true, false);
					}

					// -(-foo)
					operatorAllowed = options.allow.includes("- -");
					if (
						!operatorAllowed &&
						options.number &&
						node.operator === "-" &&
						node.argument.type === "UnaryExpression" &&
						node.argument.operator === "-" &&
						!isNumeric(node.argument.argument)
					) {
						const recommendation = `Number(${sourceCode.getText(node.argument.argument)})`;

						report(node, recommendation, true, false);
					}
				},

				// Use `:exit` to prevent double reporting
				"BinaryExpression:exit"(node) {
					let operatorAllowed;

					// 1 * foo
					operatorAllowed = options.allow.includes("*");
					const nonNumericOperand =
						!operatorAllowed &&
						options.number &&
						isMultiplyByOne(node) &&
						!isMultiplyByFractionOfOne(node, sourceCode) &&
						getNonNumericOperand(node);

					if (nonNumericOperand) {
						const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`;

						report(node, recommendation, true, false);
					}

					// foo - 0
					operatorAllowed = options.allow.includes("-");
					if (
						!operatorAllowed &&
						options.number &&
						node.operator === "-" &&
						node.right.type === "Literal" &&
						node.right.value === 0 &&
						!isNumeric(node.left)
					) {
						const recommendation = `Number(${sourceCode.getText(node.left)})`;

						report(node, recommendation, true, false);
					}

					// "" + foo
					operatorAllowed = options.allow.includes("+");
					if (
						!operatorAllowed &&
						options.string &&
						isConcatWithEmptyString(node)
					) {
						const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`;

						report(node, recommendation, true, false);
					}
				},

				AssignmentExpression(node) {
					// foo += ""
					const operatorAllowed = options.allow.includes("+");

					if (
						!operatorAllowed &&
						options.string &&
						isAppendEmptyString(node)
					) {
						const code = sourceCode.getText(getNonEmptyOperand(node));
						const recommendation = `${code} = String(${code})`;

						report(node, recommendation, true, false);
					}
				},

				TemplateLiteral(node) {
					if (!options.disallowTemplateShorthand) {
						return;
					}

					// tag`${foo}`
					if (node.parent.type === "TaggedTemplateExpression") {
						return;
					}

					// `` or `${foo}${bar}`
					if (node.expressions.length !== 1) {
						return;
					}

					//  `prefix${foo}`
					if (node.quasis[0].value.cooked !== "") {
						return;
					}

					//  `${foo}postfix`
					if (node.quasis[1].value.cooked !== "") {
						return;
					}

					// if the expression is already a string, then this isn't a coercion
					if (isStringType(node.expressions[0])) {
						return;
					}

					const code = sourceCode.getText(node.expressions[0]);
					const recommendation = `String(${code})`;

					report(node, recommendation, true, false);
				},
			};
		},
	};
	return noImplicitCoercion;
}

/**
 * @fileoverview Rule to check for implicit global variables, functions and classes.
 * @author Joshua Peek
 */

var noImplicitGlobals;
var hasRequiredNoImplicitGlobals;

function requireNoImplicitGlobals () {
	if (hasRequiredNoImplicitGlobals) return noImplicitGlobals;
	hasRequiredNoImplicitGlobals = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noImplicitGlobals = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					lexicalBindings: false,
				},
			],

			docs: {
				description: "Disallow declarations in the global scope",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-implicit-globals",
			},

			schema: [
				{
					type: "object",
					properties: {
						lexicalBindings: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				globalNonLexicalBinding:
					"Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.",
				globalLexicalBinding:
					"Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.",
				globalVariableLeak:
					"Global variable leak, declare the variable if it is intended to be local.",
				assignmentToReadonlyGlobal:
					"Unexpected assignment to read-only global variable.",
				redeclarationOfReadonlyGlobal:
					"Unexpected redeclaration of read-only global variable.",
			},
		},

		create(context) {
			const [{ lexicalBindings: checkLexicalBindings }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Reports the node.
			 * @param {ASTNode} node Node to report.
			 * @param {string} messageId Id of the message to report.
			 * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class.
			 * @returns {void}
			 */
			function report(node, messageId, kind) {
				context.report({
					node,
					messageId,
					data: {
						kind,
					},
				});
			}

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);

					scope.variables.forEach(variable => {
						// Only ESLint global variables have the `writable` key.
						const isReadonlyEslintGlobalVariable =
							variable.writeable === false;
						const isWritableEslintGlobalVariable =
							variable.writeable === true;

						if (isWritableEslintGlobalVariable) {
							// Everything is allowed with writable ESLint global variables.
							return;
						}

						// Variables exported by "exported" block comments
						if (variable.eslintExported) {
							return;
						}

						variable.defs.forEach(def => {
							const defNode = def.node;

							if (
								def.type === "FunctionName" ||
								(def.type === "Variable" &&
									def.parent.kind === "var")
							) {
								if (isReadonlyEslintGlobalVariable) {
									report(
										defNode,
										"redeclarationOfReadonlyGlobal",
									);
								} else {
									report(
										defNode,
										"globalNonLexicalBinding",
										def.type === "FunctionName"
											? "function"
											: `'${def.parent.kind}'`,
									);
								}
							}

							if (checkLexicalBindings) {
								if (
									def.type === "ClassName" ||
									(def.type === "Variable" &&
										(def.parent.kind === "let" ||
											def.parent.kind === "const"))
								) {
									if (isReadonlyEslintGlobalVariable) {
										report(
											defNode,
											"redeclarationOfReadonlyGlobal",
										);
									} else {
										report(
											defNode,
											"globalLexicalBinding",
											def.type === "ClassName"
												? "class"
												: `'${def.parent.kind}'`,
										);
									}
								}
							}
						});
					});

					// Undeclared assigned variables.
					scope.implicit.variables.forEach(variable => {
						const scopeVariable = scope.set.get(variable.name);
						let messageId;

						if (scopeVariable) {
							// ESLint global variable
							if (scopeVariable.writeable) {
								return;
							}
							messageId = "assignmentToReadonlyGlobal";
						} else {
							// Reference to an unknown variable, possible global leak.
							messageId = "globalVariableLeak";
						}

						// def.node is an AssignmentExpression, ForInStatement or ForOfStatement.
						variable.defs.forEach(def => {
							report(def.node, messageId);
						});
					});
				},
			};
		},
	};
	return noImplicitGlobals;
}

/**
 * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval
 * @author James Allardice
 */

var noImpliedEval;
var hasRequiredNoImpliedEval;

function requireNoImpliedEval () {
	if (hasRequiredNoImpliedEval) return noImpliedEval;
	hasRequiredNoImpliedEval = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { getStaticValue } = /*@__PURE__*/ requireEslintUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noImpliedEval = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow the use of `eval()`-like methods",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-implied-eval",
			},

			schema: [],

			messages: {
				impliedEval:
					"Implied eval. Consider passing a function instead of a string.",
			},
		},

		create(context) {
			const GLOBAL_CANDIDATES = Object.freeze([
				"global",
				"window",
				"globalThis",
			]);
			const EVAL_LIKE_FUNC_PATTERN =
				/^(?:set(?:Interval|Timeout)|execScript)$/u;
			const sourceCode = context.sourceCode;

			/**
			 * Checks whether a node is evaluated as a string or not.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} True if the node is evaluated as a string.
			 */
			function isEvaluatedString(node) {
				if (
					(node.type === "Literal" && typeof node.value === "string") ||
					node.type === "TemplateLiteral"
				) {
					return true;
				}
				if (node.type === "BinaryExpression" && node.operator === "+") {
					return (
						isEvaluatedString(node.left) ||
						isEvaluatedString(node.right)
					);
				}
				return false;
			}

			/**
			 * Reports if the `CallExpression` node has evaluated argument.
			 * @param {ASTNode} node A CallExpression to check.
			 * @returns {void}
			 */
			function reportImpliedEvalCallExpression(node) {
				const [firstArgument] = node.arguments;

				if (firstArgument) {
					const staticValue = getStaticValue(
						firstArgument,
						sourceCode.getScope(node),
					);
					const isStaticString =
						staticValue && typeof staticValue.value === "string";
					const isString =
						isStaticString || isEvaluatedString(firstArgument);

					if (isString) {
						context.report({
							node,
							messageId: "impliedEval",
						});
					}
				}
			}

			/**
			 * Reports calls of `implied eval` via the global references.
			 * @param {Variable} globalVar A global variable to check.
			 * @returns {void}
			 */
			function reportImpliedEvalViaGlobal(globalVar) {
				const { references, name } = globalVar;

				references.forEach(ref => {
					const identifier = ref.identifier;
					let node = identifier.parent;

					while (astUtils.isSpecificMemberAccess(node, null, name)) {
						node = node.parent;
					}

					if (
						astUtils.isSpecificMemberAccess(
							node,
							null,
							EVAL_LIKE_FUNC_PATTERN,
						)
					) {
						const calleeNode =
							node.parent.type === "ChainExpression"
								? node.parent
								: node;
						const parent = calleeNode.parent;

						if (
							parent.type === "CallExpression" &&
							parent.callee === calleeNode
						) {
							reportImpliedEvalCallExpression(parent);
						}
					}
				});
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				CallExpression(node) {
					if (
						astUtils.isSpecificId(node.callee, EVAL_LIKE_FUNC_PATTERN)
					) {
						reportImpliedEvalCallExpression(node);
					}
				},
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					GLOBAL_CANDIDATES.map(candidate =>
						astUtils.getVariableByName(globalScope, candidate),
					)
						.filter(
							globalVar => !!globalVar && globalVar.defs.length === 0,
						)
						.forEach(reportImpliedEvalViaGlobal);
				},
			};
		},
	};
	return noImpliedEval;
}

/**
 * @fileoverview Rule to flag updates of imported bindings.
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var noImportAssign;
var hasRequiredNoImportAssign;

function requireNoImportAssign () {
	if (hasRequiredNoImportAssign) return noImportAssign;
	hasRequiredNoImportAssign = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const { findVariable } = /*@__PURE__*/ requireEslintUtils();
	const astUtils = requireAstUtils();

	const WellKnownMutationFunctions = {
		Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u,
		Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u,
	};

	/**
	 * Check if a given node is LHS of an assignment node.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is LHS.
	 */
	function isAssignmentLeft(node) {
		const { parent } = node;

		return (
			(parent.type === "AssignmentExpression" && parent.left === node) ||
			// Destructuring assignments
			parent.type === "ArrayPattern" ||
			(parent.type === "Property" &&
				parent.value === node &&
				parent.parent.type === "ObjectPattern") ||
			parent.type === "RestElement" ||
			(parent.type === "AssignmentPattern" && parent.left === node)
		);
	}

	/**
	 * Check if a given node is the operand of mutation unary operator.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is the operand of mutation unary operator.
	 */
	function isOperandOfMutationUnaryOperator(node) {
		const argumentNode =
			node.parent.type === "ChainExpression" ? node.parent : node;
		const { parent } = argumentNode;

		return (
			(parent.type === "UpdateExpression" &&
				parent.argument === argumentNode) ||
			(parent.type === "UnaryExpression" &&
				parent.operator === "delete" &&
				parent.argument === argumentNode)
		);
	}

	/**
	 * Check if a given node is the iteration variable of `for-in`/`for-of` syntax.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is the iteration variable.
	 */
	function isIterationVariable(node) {
		const { parent } = node;

		return (
			(parent.type === "ForInStatement" && parent.left === node) ||
			(parent.type === "ForOfStatement" && parent.left === node)
		);
	}

	/**
	 * Check if a given node is at the first argument of a well-known mutation function.
	 * - `Object.assign`
	 * - `Object.defineProperty`
	 * - `Object.defineProperties`
	 * - `Object.freeze`
	 * - `Object.setPrototypeOf`
	 * - `Reflect.defineProperty`
	 * - `Reflect.deleteProperty`
	 * - `Reflect.set`
	 * - `Reflect.setPrototypeOf`
	 * @param {ASTNode} node The node to check.
	 * @param {Scope} scope A `escope.Scope` object to find variable (whichever).
	 * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function.
	 */
	function isArgumentOfWellKnownMutationFunction(node, scope) {
		const { parent } = node;

		if (parent.type !== "CallExpression" || parent.arguments[0] !== node) {
			return false;
		}
		const callee = astUtils.skipChainExpression(parent.callee);

		if (
			!astUtils.isSpecificMemberAccess(
				callee,
				"Object",
				WellKnownMutationFunctions.Object,
			) &&
			!astUtils.isSpecificMemberAccess(
				callee,
				"Reflect",
				WellKnownMutationFunctions.Reflect,
			)
		) {
			return false;
		}
		const variable = findVariable(scope, callee.object);

		return variable !== null && variable.scope.type === "global";
	}

	/**
	 * Check if the identifier node is placed at to update members.
	 * @param {ASTNode} id The Identifier node to check.
	 * @param {Scope} scope A `escope.Scope` object to find variable (whichever).
	 * @returns {boolean} `true` if the member of `id` was updated.
	 */
	function isMemberWrite(id, scope) {
		const { parent } = id;

		return (
			(parent.type === "MemberExpression" &&
				parent.object === id &&
				(isAssignmentLeft(parent) ||
					isOperandOfMutationUnaryOperator(parent) ||
					isIterationVariable(parent))) ||
			isArgumentOfWellKnownMutationFunction(id, scope)
		);
	}

	/**
	 * Get the mutation node.
	 * @param {ASTNode} id The Identifier node to get.
	 * @returns {ASTNode} The mutation node.
	 */
	function getWriteNode(id) {
		let node = id.parent;

		while (
			node &&
			node.type !== "AssignmentExpression" &&
			node.type !== "UpdateExpression" &&
			node.type !== "UnaryExpression" &&
			node.type !== "CallExpression" &&
			node.type !== "ForInStatement" &&
			node.type !== "ForOfStatement"
		) {
			node = node.parent;
		}

		return node || id;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noImportAssign = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow assigning to imported bindings",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-import-assign",
			},

			schema: [],

			messages: {
				readonly: "'{{name}}' is read-only.",
				readonlyMember: "The members of '{{name}}' are read-only.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				ImportDeclaration(node) {
					const scope = sourceCode.getScope(node);

					for (const variable of sourceCode.getDeclaredVariables(node)) {
						const shouldCheckMembers = variable.defs.some(
							d => d.node.type === "ImportNamespaceSpecifier",
						);
						let prevIdNode = null;

						for (const reference of variable.references) {
							const idNode = reference.identifier;

							/*
							 * AssignmentPattern (e.g. `[a = 0] = b`) makes two write
							 * references for the same identifier. This should skip
							 * the one of the two in order to prevent redundant reports.
							 */
							if (idNode === prevIdNode) {
								continue;
							}
							prevIdNode = idNode;

							if (reference.isWrite()) {
								context.report({
									node: getWriteNode(idNode),
									messageId: "readonly",
									data: { name: idNode.name },
								});
							} else if (
								shouldCheckMembers &&
								isMemberWrite(idNode, scope)
							) {
								context.report({
									node: getWriteNode(idNode),
									messageId: "readonlyMember",
									data: { name: idNode.name },
								});
							}
						}
					}
				},
			};
		},
	};
	return noImportAssign;
}

/**
 * @fileoverview Enforces or disallows inline comments.
 * @author Greg Cochard
 */

var noInlineComments;
var hasRequiredNoInlineComments;

function requireNoInlineComments () {
	if (hasRequiredNoInlineComments) return noInlineComments;
	hasRequiredNoInlineComments = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noInlineComments = {
		meta: {
			type: "suggestion",

			defaultOptions: [{}],

			docs: {
				description: "Disallow inline comments after code",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-inline-comments",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignorePattern: {
							type: "string",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedInlineComment: "Unexpected comment inline with code.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ ignorePattern }] = context.options;
			const customIgnoreRegExp =
				ignorePattern && new RegExp(ignorePattern, "u");

			/**
			 * Will check that comments are not on lines starting with or ending with code
			 * @param {ASTNode} node The comment node to check
			 * @private
			 * @returns {void}
			 */
			function testCodeAroundComment(node) {
				const startLine = String(sourceCode.lines[node.loc.start.line - 1]),
					endLine = String(sourceCode.lines[node.loc.end.line - 1]),
					preamble = startLine.slice(0, node.loc.start.column).trim(),
					postamble = endLine.slice(node.loc.end.column).trim(),
					isPreambleEmpty = !preamble,
					isPostambleEmpty = !postamble;

				// Nothing on both sides
				if (isPreambleEmpty && isPostambleEmpty) {
					return;
				}

				// Matches the ignore pattern
				if (customIgnoreRegExp && customIgnoreRegExp.test(node.value)) {
					return;
				}

				// JSX Exception
				if (
					(isPreambleEmpty || preamble === "{") &&
					(isPostambleEmpty || postamble === "}")
				) {
					const enclosingNode = sourceCode.getNodeByRangeIndex(
						node.range[0],
					);

					if (
						enclosingNode &&
						enclosingNode.type === "JSXEmptyExpression"
					) {
						return;
					}
				}

				// Don't report ESLint directive comments
				if (astUtils.isDirectiveComment(node)) {
					return;
				}

				context.report({
					node,
					messageId: "unexpectedInlineComment",
				});
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program() {
					sourceCode
						.getAllComments()
						.filter(token => token.type !== "Shebang")
						.forEach(testCodeAroundComment);
				},
			};
		},
	};
	return noInlineComments;
}

/**
 * @fileoverview Rule to enforce declarations in program or function body root.
 * @author Brandon Mills
 */

var noInnerDeclarations;
var hasRequiredNoInnerDeclarations;

function requireNoInnerDeclarations () {
	if (hasRequiredNoInnerDeclarations) return noInnerDeclarations;
	hasRequiredNoInnerDeclarations = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const validParent = new Set([
		"Program",
		"StaticBlock",
		"ExportNamedDeclaration",
		"ExportDefaultDeclaration",
	]);
	const validBlockStatementParent = new Set([
		"FunctionDeclaration",
		"FunctionExpression",
		"ArrowFunctionExpression",
	]);

	/**
	 * Finds the nearest enclosing context where this rule allows declarations and returns its description.
	 * @param {ASTNode} node Node to search from.
	 * @returns {string} Description. One of "program", "function body", "class static block body".
	 */
	function getAllowedBodyDescription(node) {
		let { parent } = node;

		while (parent) {
			if (parent.type === "StaticBlock") {
				return "class static block body";
			}

			if (astUtils.isFunction(parent)) {
				return "function body";
			}

			({ parent } = parent);
		}

		return "program";
	}

	/** @type {import('../shared/types').Rule} */
	noInnerDeclarations = {
		meta: {
			type: "problem",

			defaultOptions: ["functions", { blockScopedFunctions: "allow" }],

			docs: {
				description:
					"Disallow variable or `function` declarations in nested blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-inner-declarations",
			},

			schema: [
				{
					enum: ["functions", "both"],
				},
				{
					type: "object",
					properties: {
						blockScopedFunctions: {
							enum: ["allow", "disallow"],
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				moveDeclToRoot: "Move {{type}} declaration to {{body}} root.",
			},
		},

		create(context) {
			const both = context.options[0] === "both";
			const { blockScopedFunctions } = context.options[1];

			const sourceCode = context.sourceCode;
			const ecmaVersion = context.languageOptions.ecmaVersion;

			/**
			 * Ensure that a given node is at a program or function body's root.
			 * @param {ASTNode} node Declaration node to check.
			 * @returns {void}
			 */
			function check(node) {
				const parent = node.parent;

				if (
					parent.type === "BlockStatement" &&
					validBlockStatementParent.has(parent.parent.type)
				) {
					return;
				}

				if (validParent.has(parent.type)) {
					return;
				}

				context.report({
					node,
					messageId: "moveDeclToRoot",
					data: {
						type:
							node.type === "FunctionDeclaration"
								? "function"
								: "variable",
						body: getAllowedBodyDescription(node),
					},
				});
			}

			return {
				FunctionDeclaration(node) {
					const isInStrictCode = sourceCode.getScope(node).upper.isStrict;

					if (
						blockScopedFunctions === "allow" &&
						ecmaVersion >= 2015 &&
						isInStrictCode
					) {
						return;
					}

					check(node);
				},
				VariableDeclaration(node) {
					if (both && node.kind === "var") {
						check(node);
					}
				},
			};
		},
	};
	return noInnerDeclarations;
}

/**
 * @fileoverview Validate strings passed to the RegExp constructor
 * @author Michael Ficarra
 */

var noInvalidRegexp;
var hasRequiredNoInvalidRegexp;

function requireNoInvalidRegexp () {
	if (hasRequiredNoInvalidRegexp) return noInvalidRegexp;
	hasRequiredNoInvalidRegexp = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const RegExpValidator = requireRegexpp().RegExpValidator;
	const validator = new RegExpValidator();
	const validFlags = "dgimsuvy";
	const undefined1 = void 0;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noInvalidRegexp = {
		meta: {
			type: "problem",

			defaultOptions: [{}],

			docs: {
				description:
					"Disallow invalid regular expression strings in `RegExp` constructors",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-invalid-regexp",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowConstructorFlags: {
							type: "array",
							items: {
								type: "string",
							},
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				regexMessage: "{{message}}.",
			},
		},

		create(context) {
			const [{ allowConstructorFlags }] = context.options;
			let allowedFlags = [];

			if (allowConstructorFlags) {
				const temp = allowConstructorFlags
					.join("")
					.replace(new RegExp(`[${validFlags}]`, "gu"), "");

				if (temp) {
					allowedFlags = [...new Set(temp)];
				}
			}

			/**
			 * Reports error with the provided message.
			 * @param {ASTNode} node The node holding the invalid RegExp
			 * @param {string} message The message to report.
			 * @returns {void}
			 */
			function report(node, message) {
				context.report({
					node,
					messageId: "regexMessage",
					data: { message },
				});
			}

			/**
			 * Check if node is a string
			 * @param {ASTNode} node node to evaluate
			 * @returns {boolean} True if its a string
			 * @private
			 */
			function isString(node) {
				return (
					node &&
					node.type === "Literal" &&
					typeof node.value === "string"
				);
			}

			/**
			 * Gets flags of a regular expression created by the given `RegExp()` or `new RegExp()` call
			 * Examples:
			 *     new RegExp(".")         // => ""
			 *     new RegExp(".", "gu")   // => "gu"
			 *     new RegExp(".", flags)  // => null
			 * @param {ASTNode} node `CallExpression` or `NewExpression` node
			 * @returns {string|null} flags if they can be determined, `null` otherwise
			 * @private
			 */
			function getFlags(node) {
				if (node.arguments.length < 2) {
					return "";
				}

				if (isString(node.arguments[1])) {
					return node.arguments[1].value;
				}

				return null;
			}

			/**
			 * Check syntax error in a given pattern.
			 * @param {string} pattern The RegExp pattern to validate.
			 * @param {Object} flags The RegExp flags to validate.
			 * @param {boolean} [flags.unicode] The Unicode flag.
			 * @param {boolean} [flags.unicodeSets] The UnicodeSets flag.
			 * @returns {string|null} The syntax error.
			 */
			function validateRegExpPattern(pattern, flags) {
				try {
					validator.validatePattern(
						pattern,
						undefined1,
						undefined1,
						flags,
					);
					return null;
				} catch (err) {
					return err.message;
				}
			}

			/**
			 * Check syntax error in a given flags.
			 * @param {string|null} flags The RegExp flags to validate.
			 * @param {string|null} flagsToCheck The RegExp invalid flags.
			 * @param {string} allFlags all valid and allowed flags.
			 * @returns {string|null} The syntax error.
			 */
			function validateRegExpFlags(flags, flagsToCheck, allFlags) {
				const duplicateFlags = [];

				if (typeof flagsToCheck === "string") {
					for (const flag of flagsToCheck) {
						if (allFlags.includes(flag)) {
							duplicateFlags.push(flag);
						}
					}
				}

				/*
				 * `regexpp` checks the combination of `u` and `v` flags when parsing `Pattern` according to `ecma262`,
				 * but this rule may check only the flag when the pattern is unidentifiable, so check it here.
				 * https://tc39.es/ecma262/multipage/text-processing.html#sec-parsepattern
				 */
				if (flags && flags.includes("u") && flags.includes("v")) {
					return "Regex 'u' and 'v' flags cannot be used together";
				}

				if (duplicateFlags.length > 0) {
					return `Duplicate flags ('${duplicateFlags.join("")}') supplied to RegExp constructor`;
				}

				if (!flagsToCheck) {
					return null;
				}

				return `Invalid flags supplied to RegExp constructor '${flagsToCheck}'`;
			}

			return {
				"CallExpression, NewExpression"(node) {
					if (
						node.callee.type !== "Identifier" ||
						node.callee.name !== "RegExp"
					) {
						return;
					}

					const flags = getFlags(node);
					let flagsToCheck = flags;
					const allFlags =
						allowedFlags.length > 0
							? validFlags.split("").concat(allowedFlags)
							: validFlags.split("");

					if (flags) {
						allFlags.forEach(flag => {
							flagsToCheck = flagsToCheck.replace(flag, "");
						});
					}

					let message = validateRegExpFlags(
						flags,
						flagsToCheck,
						allFlags,
					);

					if (message) {
						report(node, message);
						return;
					}

					if (!isString(node.arguments[0])) {
						return;
					}

					const pattern = node.arguments[0].value;

					message =
						// If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag
						flags === null
							? validateRegExpPattern(pattern, {
									unicode: true,
									unicodeSets: false,
								}) &&
								validateRegExpPattern(pattern, {
									unicode: false,
									unicodeSets: true,
								}) &&
								validateRegExpPattern(pattern, {
									unicode: false,
									unicodeSets: false,
								})
							: validateRegExpPattern(pattern, {
									unicode: flags.includes("u"),
									unicodeSets: flags.includes("v"),
								});

					if (message) {
						report(node, message);
					}
				},
			};
		},
	};
	return noInvalidRegexp;
}

/**
 * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`.
 * @author Toru Nagashima
 */

var noInvalidThis;
var hasRequiredNoInvalidThis;

function requireNoInvalidThis () {
	if (hasRequiredNoInvalidThis) return noInvalidThis;
	hasRequiredNoInvalidThis = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines if the given code path is a code path with lexical `this` binding.
	 * That is, if `this` within the code path refers to `this` of surrounding code path.
	 * @param {CodePath} codePath Code path.
	 * @param {ASTNode} node Node that started the code path.
	 * @returns {boolean} `true` if it is a code path with lexical `this` binding.
	 */
	function isCodePathWithLexicalThis(codePath, node) {
		return (
			codePath.origin === "function" &&
			node.type === "ArrowFunctionExpression"
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noInvalidThis = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ capIsConstructor: true }],

			docs: {
				description:
					"Disallow use of `this` in contexts where the value of `this` is `undefined`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-invalid-this",
			},

			schema: [
				{
					type: "object",
					properties: {
						capIsConstructor: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedThis: "Unexpected 'this'.",
			},
		},

		create(context) {
			const [{ capIsConstructor }] = context.options;
			const stack = [],
				sourceCode = context.sourceCode;

			/**
			 * Gets the current checking context.
			 *
			 * The return value has a flag that whether or not `this` keyword is valid.
			 * The flag is initialized when got at the first time.
			 * @returns {{valid: boolean}}
			 *   an object which has a flag that whether or not `this` keyword is valid.
			 */
			stack.getCurrent = function () {
				const current = this.at(-1);

				if (!current.init) {
					current.init = true;
					current.valid = !astUtils.isDefaultThisBinding(
						current.node,
						sourceCode,
						{ capIsConstructor },
					);
				}
				return current;
			};

			return {
				onCodePathStart(codePath, node) {
					if (isCodePathWithLexicalThis(codePath, node)) {
						return;
					}

					if (codePath.origin === "program") {
						const scope = sourceCode.getScope(node);
						const features =
							context.languageOptions.parserOptions.ecmaFeatures ||
							{};

						// `this` at the top level of scripts always refers to the global object
						stack.push({
							init: true,
							node,
							valid: !(
								node.sourceType === "module" ||
								(features.globalReturn &&
									scope.childScopes[0].isStrict)
							),
						});

						return;
					}

					/*
					 * `init: false` means that `valid` isn't determined yet.
					 * Most functions don't use `this`, and the calculation for `valid`
					 * is relatively costly, so we'll calculate it lazily when the first
					 * `this` within the function is traversed. A special case are non-strict
					 * functions, because `this` refers to the global object and therefore is
					 * always valid, so we can set `init: true` right away.
					 */
					stack.push({
						init: !sourceCode.getScope(node).isStrict,
						node,
						valid: true,
					});
				},

				onCodePathEnd(codePath, node) {
					if (isCodePathWithLexicalThis(codePath, node)) {
						return;
					}

					stack.pop();
				},

				// Reports if `this` of the current context is invalid.
				ThisExpression(node) {
					const current = stack.getCurrent();

					if (current && !current.valid) {
						context.report({
							node,
							messageId: "unexpectedThis",
						});
					}
				},
			};
		},
	};
	return noInvalidThis;
}

/**
 * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed
 * @author Jonathan Kingston
 * @author Christophe Porteneuve
 */

var noIrregularWhitespace;
var hasRequiredNoIrregularWhitespace;

function requireNoIrregularWhitespace () {
	if (hasRequiredNoIrregularWhitespace) return noIrregularWhitespace;
	hasRequiredNoIrregularWhitespace = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const ALL_IRREGULARS =
		/[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u;
	const IRREGULAR_WHITESPACE =
		/[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu;
	const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu;
	const LINE_BREAK = astUtils.createGlobalLinebreakMatcher();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noIrregularWhitespace = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					skipComments: false,
					skipJSXText: false,
					skipRegExps: false,
					skipStrings: true,
					skipTemplates: false,
				},
			],

			docs: {
				description: "Disallow irregular whitespace",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-irregular-whitespace",
			},

			schema: [
				{
					type: "object",
					properties: {
						skipComments: {
							type: "boolean",
						},
						skipStrings: {
							type: "boolean",
						},
						skipTemplates: {
							type: "boolean",
						},
						skipRegExps: {
							type: "boolean",
						},
						skipJSXText: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				noIrregularWhitespace: "Irregular whitespace not allowed.",
			},
		},

		create(context) {
			const [
				{
					skipComments,
					skipStrings,
					skipRegExps,
					skipTemplates,
					skipJSXText,
				},
			] = context.options;

			const sourceCode = context.sourceCode;
			const commentNodes = sourceCode.getAllComments();

			// Module store of errors that we have found
			let errors = [];

			/**
			 * Removes errors that occur inside the given node
			 * @param {ASTNode} node to check for matching errors.
			 * @returns {void}
			 * @private
			 */
			function removeWhitespaceError(node) {
				const locStart = node.loc.start;
				const locEnd = node.loc.end;

				errors = errors.filter(
					({ loc: { start: errorLocStart } }) =>
						errorLocStart.line < locStart.line ||
						(errorLocStart.line === locStart.line &&
							errorLocStart.column < locStart.column) ||
						(errorLocStart.line === locEnd.line &&
							errorLocStart.column >= locEnd.column) ||
						errorLocStart.line > locEnd.line,
				);
			}

			/**
			 * Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			 * @param {ASTNode} node to check for matching errors.
			 * @returns {void}
			 * @private
			 */
			function removeInvalidNodeErrorsInLiteral(node) {
				const shouldCheckStrings =
					skipStrings && typeof node.value === "string";
				const shouldCheckRegExps = skipRegExps && Boolean(node.regex);

				if (shouldCheckStrings || shouldCheckRegExps) {
					// If we have irregular characters remove them from the errors list
					if (ALL_IRREGULARS.test(node.raw)) {
						removeWhitespaceError(node);
					}
				}
			}

			/**
			 * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			 * @param {ASTNode} node to check for matching errors.
			 * @returns {void}
			 * @private
			 */
			function removeInvalidNodeErrorsInTemplateLiteral(node) {
				if (typeof node.value.raw === "string") {
					if (ALL_IRREGULARS.test(node.value.raw)) {
						removeWhitespaceError(node);
					}
				}
			}

			/**
			 * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			 * @param {ASTNode} node to check for matching errors.
			 * @returns {void}
			 * @private
			 */
			function removeInvalidNodeErrorsInComment(node) {
				if (ALL_IRREGULARS.test(node.value)) {
					removeWhitespaceError(node);
				}
			}

			/**
			 * Checks JSX nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			 * @param {ASTNode} node to check for matching errors.
			 * @returns {void}
			 * @private
			 */
			function removeInvalidNodeErrorsInJSXText(node) {
				if (ALL_IRREGULARS.test(node.raw)) {
					removeWhitespaceError(node);
				}
			}

			/**
			 * Checks the program source for irregular whitespace
			 * @param {ASTNode} node The program node
			 * @returns {void}
			 * @private
			 */
			function checkForIrregularWhitespace(node) {
				const sourceLines = sourceCode.lines;

				sourceLines.forEach((sourceLine, lineIndex) => {
					const lineNumber = lineIndex + 1;
					let match;

					while (
						(match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null
					) {
						errors.push({
							node,
							messageId: "noIrregularWhitespace",
							loc: {
								start: {
									line: lineNumber,
									column: match.index,
								},
								end: {
									line: lineNumber,
									column: match.index + match[0].length,
								},
							},
						});
					}
				});
			}

			/**
			 * Checks the program source for irregular line terminators
			 * @param {ASTNode} node The program node
			 * @returns {void}
			 * @private
			 */
			function checkForIrregularLineTerminators(node) {
				const source = sourceCode.getText(),
					sourceLines = sourceCode.lines,
					linebreaks = source.match(LINE_BREAK);
				let lastLineIndex = -1,
					match;

				while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) {
					const lineIndex =
						linebreaks.indexOf(match[0], lastLineIndex + 1) || 0;

					errors.push({
						node,
						messageId: "noIrregularWhitespace",
						loc: {
							start: {
								line: lineIndex + 1,
								column: sourceLines[lineIndex].length,
							},
							end: {
								line: lineIndex + 2,
								column: 0,
							},
						},
					});

					lastLineIndex = lineIndex;
				}
			}

			/**
			 * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`.
			 * @returns {void}
			 * @private
			 */
			function noop() {}

			const nodes = {};

			if (ALL_IRREGULARS.test(sourceCode.getText())) {
				nodes.Program = function (node) {
					/*
					 * As we can easily fire warnings for all white space issues with
					 * all the source its simpler to fire them here.
					 * This means we can check all the application code without having
					 * to worry about issues caused in the parser tokens.
					 * When writing this code also evaluating per node was missing out
					 * connecting tokens in some cases.
					 * We can later filter the errors when they are found to be not an
					 * issue in nodes we don't care about.
					 */
					checkForIrregularWhitespace(node);
					checkForIrregularLineTerminators(node);
				};

				nodes.Literal = removeInvalidNodeErrorsInLiteral;
				nodes.TemplateElement = skipTemplates
					? removeInvalidNodeErrorsInTemplateLiteral
					: noop;
				nodes.JSXText = skipJSXText
					? removeInvalidNodeErrorsInJSXText
					: noop;
				nodes["Program:exit"] = function () {
					if (skipComments) {
						// First strip errors occurring in comment nodes.
						commentNodes.forEach(removeInvalidNodeErrorsInComment);
					}

					// If we have any errors remaining report on them
					errors.forEach(error => context.report(error));
				};
			} else {
				nodes.Program = noop;
			}

			return nodes;
		},
	};
	return noIrregularWhitespace;
}

/**
 * @fileoverview Rule to flag usage of __iterator__ property
 * @author Ian Christian Myers
 */

var noIterator;
var hasRequiredNoIterator;

function requireNoIterator () {
	if (hasRequiredNoIterator) return noIterator;
	hasRequiredNoIterator = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { getStaticPropertyName } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noIterator = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow the use of the `__iterator__` property",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-iterator",
			},

			schema: [],

			messages: {
				noIterator: "Reserved name '__iterator__'.",
			},
		},

		create(context) {
			return {
				MemberExpression(node) {
					if (getStaticPropertyName(node) === "__iterator__") {
						context.report({
							node,
							messageId: "noIterator",
						});
					}
				},
			};
		},
	};
	return noIterator;
}

/**
 * @fileoverview Rule to flag labels that are the same as an identifier
 * @author Ian Christian Myers
 */

var noLabelVar;
var hasRequiredNoLabelVar;

function requireNoLabelVar () {
	if (hasRequiredNoLabelVar) return noLabelVar;
	hasRequiredNoLabelVar = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLabelVar = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow labels that share a name with a variable",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-label-var",
			},

			schema: [],

			messages: {
				identifierClashWithLabel:
					"Found identifier with same name as label.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Check if the identifier is present inside current scope
			 * @param {Object} scope current scope
			 * @param {string} name To evaluate
			 * @returns {boolean} True if its present
			 * @private
			 */
			function findIdentifier(scope, name) {
				return astUtils.getVariableByName(scope, name) !== null;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				LabeledStatement(node) {
					// Fetch the innermost scope.
					const scope = sourceCode.getScope(node);

					/*
					 * Recursively find the identifier walking up the scope, starting
					 * with the innermost scope.
					 */
					if (findIdentifier(scope, node.label.name)) {
						context.report({
							node,
							messageId: "identifierClashWithLabel",
						});
					}
				},
			};
		},
	};
	return noLabelVar;
}

/**
 * @fileoverview Disallow Labeled Statements
 * @author Nicholas C. Zakas
 */

var noLabels;
var hasRequiredNoLabels;

function requireNoLabels () {
	if (hasRequiredNoLabels) return noLabels;
	hasRequiredNoLabels = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLabels = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowLoop: false,
					allowSwitch: false,
				},
			],

			docs: {
				description: "Disallow labeled statements",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-labels",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowLoop: {
							type: "boolean",
						},
						allowSwitch: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedLabel: "Unexpected labeled statement.",
				unexpectedLabelInBreak: "Unexpected label in break statement.",
				unexpectedLabelInContinue:
					"Unexpected label in continue statement.",
			},
		},

		create(context) {
			const [{ allowLoop, allowSwitch }] = context.options;
			let scopeInfo = null;

			/**
			 * Gets the kind of a given node.
			 * @param {ASTNode} node A node to get.
			 * @returns {string} The kind of the node.
			 */
			function getBodyKind(node) {
				if (astUtils.isLoop(node)) {
					return "loop";
				}
				if (node.type === "SwitchStatement") {
					return "switch";
				}
				return "other";
			}

			/**
			 * Checks whether the label of a given kind is allowed or not.
			 * @param {string} kind A kind to check.
			 * @returns {boolean} `true` if the kind is allowed.
			 */
			function isAllowed(kind) {
				switch (kind) {
					case "loop":
						return allowLoop;
					case "switch":
						return allowSwitch;
					default:
						return false;
				}
			}

			/**
			 * Checks whether a given name is a label of a loop or not.
			 * @param {string} label A name of a label to check.
			 * @returns {boolean} `true` if the name is a label of a loop.
			 */
			function getKind(label) {
				let info = scopeInfo;

				while (info) {
					if (info.label === label) {
						return info.kind;
					}
					info = info.upper;
				}

				/* c8 ignore next */
				return "other";
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				LabeledStatement(node) {
					scopeInfo = {
						label: node.label.name,
						kind: getBodyKind(node.body),
						upper: scopeInfo,
					};
				},

				"LabeledStatement:exit"(node) {
					if (!isAllowed(scopeInfo.kind)) {
						context.report({
							node,
							messageId: "unexpectedLabel",
						});
					}

					scopeInfo = scopeInfo.upper;
				},

				BreakStatement(node) {
					if (node.label && !isAllowed(getKind(node.label.name))) {
						context.report({
							node,
							messageId: "unexpectedLabelInBreak",
						});
					}
				},

				ContinueStatement(node) {
					if (node.label && !isAllowed(getKind(node.label.name))) {
						context.report({
							node,
							messageId: "unexpectedLabelInContinue",
						});
					}
				},
			};
		},
	};
	return noLabels;
}

/**
 * @fileoverview Rule to flag blocks with no reason to exist
 * @author Brandon Mills
 */

var noLoneBlocks;
var hasRequiredNoLoneBlocks;

function requireNoLoneBlocks () {
	if (hasRequiredNoLoneBlocks) return noLoneBlocks;
	hasRequiredNoLoneBlocks = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLoneBlocks = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary nested blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-lone-blocks",
			},

			schema: [],

			messages: {
				redundantBlock: "Block is redundant.",
				redundantNestedBlock: "Nested block is redundant.",
			},
		},

		create(context) {
			// A stack of lone blocks to be checked for block-level bindings
			const loneBlocks = [];
			let ruleDef;
			const sourceCode = context.sourceCode;

			/**
			 * Reports a node as invalid.
			 * @param {ASTNode} node The node to be reported.
			 * @returns {void}
			 */
			function report(node) {
				const messageId =
					node.parent.type === "BlockStatement" ||
					node.parent.type === "StaticBlock"
						? "redundantNestedBlock"
						: "redundantBlock";

				context.report({
					node,
					messageId,
				});
			}

			/**
			 * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear
			 * @param {ASTNode} node The node to check
			 * @returns {boolean} True if the node is a lone block.
			 */
			function isLoneBlock(node) {
				return (
					node.parent.type === "BlockStatement" ||
					node.parent.type === "StaticBlock" ||
					node.parent.type === "Program" ||
					// Don't report blocks in switch cases if the block is the only statement of the case.
					(node.parent.type === "SwitchCase" &&
						!(
							node.parent.consequent[0] === node &&
							node.parent.consequent.length === 1
						))
				);
			}

			/**
			 * Checks the enclosing block of the current node for block-level bindings,
			 * and "marks it" as valid if any.
			 * @param {ASTNode} node The current node to check.
			 * @returns {void}
			 */
			function markLoneBlock(node) {
				if (loneBlocks.length === 0) {
					return;
				}

				const block = node.parent;

				if (loneBlocks.at(-1) === block) {
					loneBlocks.pop();
				}
			}

			// Default rule definition: report all lone blocks
			ruleDef = {
				BlockStatement(node) {
					if (isLoneBlock(node)) {
						report(node);
					}
				},
			};

			// ES6: report blocks without block-level bindings, or that's only child of another block
			if (context.languageOptions.ecmaVersion >= 2015) {
				ruleDef = {
					BlockStatement(node) {
						if (isLoneBlock(node)) {
							loneBlocks.push(node);
						}
					},
					"BlockStatement:exit"(node) {
						if (loneBlocks.length > 0 && loneBlocks.at(-1) === node) {
							loneBlocks.pop();
							report(node);
						} else if (
							(node.parent.type === "BlockStatement" ||
								node.parent.type === "StaticBlock") &&
							node.parent.body.length === 1
						) {
							report(node);
						}
					},
				};

				ruleDef.VariableDeclaration = function (node) {
					if (node.kind !== "var") {
						markLoneBlock(node);
					}
				};

				ruleDef.FunctionDeclaration = function (node) {
					if (sourceCode.getScope(node).isStrict) {
						markLoneBlock(node);
					}
				};

				ruleDef.ClassDeclaration = markLoneBlock;
			}

			return ruleDef;
		},
	};
	return noLoneBlocks;
}

/**
 * @fileoverview Rule to disallow if as the only statement in an else block
 * @author Brandon Mills
 */

var noLonelyIf;
var hasRequiredNoLonelyIf;

function requireNoLonelyIf () {
	if (hasRequiredNoLonelyIf) return noLonelyIf;
	hasRequiredNoLonelyIf = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLonelyIf = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `if` statements as the only statement in `else` blocks",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-lonely-if",
			},

			schema: [],
			fixable: "code",

			messages: {
				unexpectedLonelyIf:
					"Unexpected if as the only statement in an else block.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				IfStatement(node) {
					const parent = node.parent,
						grandparent = parent.parent;

					if (
						parent &&
						parent.type === "BlockStatement" &&
						parent.body.length === 1 &&
						!astUtils.areBracesNecessary(parent, sourceCode) &&
						grandparent &&
						grandparent.type === "IfStatement" &&
						parent === grandparent.alternate
					) {
						context.report({
							node,
							messageId: "unexpectedLonelyIf",
							fix(fixer) {
								const openingElseCurly =
									sourceCode.getFirstToken(parent);
								const closingElseCurly =
									sourceCode.getLastToken(parent);
								const elseKeyword =
									sourceCode.getTokenBefore(openingElseCurly);
								const tokenAfterElseBlock =
									sourceCode.getTokenAfter(closingElseCurly);
								const lastIfToken = sourceCode.getLastToken(
									node.consequent,
								);
								const sourceText = sourceCode.getText();

								if (
									sourceText
										.slice(
											openingElseCurly.range[1],
											node.range[0],
										)
										.trim() ||
									sourceText
										.slice(
											node.range[1],
											closingElseCurly.range[0],
										)
										.trim()
								) {
									// Don't fix if there are any non-whitespace characters interfering (e.g. comments)
									return null;
								}

								if (
									node.consequent.type !== "BlockStatement" &&
									lastIfToken.value !== ";" &&
									tokenAfterElseBlock &&
									(node.consequent.loc.end.line ===
										tokenAfterElseBlock.loc.start.line ||
										/^[([/+`-]/u.test(
											tokenAfterElseBlock.value,
										) ||
										lastIfToken.value === "++" ||
										lastIfToken.value === "--")
								) {
									/*
									 * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing
									 * the issue would not change semantics due to ASI. If this would happen, don't do a fix.
									 */
									return null;
								}

								return fixer.replaceTextRange(
									[
										openingElseCurly.range[0],
										closingElseCurly.range[1],
									],
									(elseKeyword.range[1] ===
									openingElseCurly.range[0]
										? " "
										: "") + sourceCode.getText(node),
								);
							},
						});
					}
				},
			};
		},
	};
	return noLonelyIf;
}

/**
 * @fileoverview Rule to flag creation of function inside a loop
 * @author Ilya Volodin
 */

var noLoopFunc;
var hasRequiredNoLoopFunc;

function requireNoLoopFunc () {
	if (hasRequiredNoLoopFunc) return noLoopFunc;
	hasRequiredNoLoopFunc = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Identifies is a node is a FunctionExpression which is part of an IIFE
	 * @param {ASTNode} node Node to test
	 * @returns {boolean} True if it's an IIFE
	 */
	function isIIFE(node) {
		return (
			(node.type === "FunctionExpression" ||
				node.type === "ArrowFunctionExpression") &&
			node.parent &&
			node.parent.type === "CallExpression" &&
			node.parent.callee === node
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLoopFunc = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow function declarations that contain unsafe references inside loop statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-loop-func",
			},

			schema: [],

			messages: {
				unsafeRefs:
					"Function declared in a loop contains unsafe references to variable(s) {{ varNames }}.",
			},
		},

		create(context) {
			const SKIPPED_IIFE_NODES = new Set();
			const sourceCode = context.sourceCode;

			/**
			 * Gets the containing loop node of a specified node.
			 *
			 * We don't need to check nested functions, so this ignores those, with the exception of IIFE.
			 * `Scope.through` contains references of nested functions.
			 * @param {ASTNode} node An AST node to get.
			 * @returns {ASTNode|null} The containing loop node of the specified node, or
			 *      `null`.
			 */
			function getContainingLoopNode(node) {
				for (
					let currentNode = node;
					currentNode.parent;
					currentNode = currentNode.parent
				) {
					const parent = currentNode.parent;

					switch (parent.type) {
						case "WhileStatement":
						case "DoWhileStatement":
							return parent;

						case "ForStatement":
							// `init` is outside of the loop.
							if (parent.init !== currentNode) {
								return parent;
							}
							break;

						case "ForInStatement":
						case "ForOfStatement":
							// `right` is outside of the loop.
							if (parent.right !== currentNode) {
								return parent;
							}
							break;

						case "ArrowFunctionExpression":
						case "FunctionExpression":
						case "FunctionDeclaration":
							// We need to check nested functions only in case of IIFE.
							if (SKIPPED_IIFE_NODES.has(parent)) {
								break;
							}

							return null;
					}
				}

				return null;
			}

			/**
			 * Gets the containing loop node of a given node.
			 * If the loop was nested, this returns the most outer loop.
			 * @param {ASTNode} node A node to get. This is a loop node.
			 * @param {ASTNode|null} excludedNode A node that the result node should not
			 *      include.
			 * @returns {ASTNode} The most outer loop node.
			 */
			function getTopLoopNode(node, excludedNode) {
				const border = excludedNode ? excludedNode.range[1] : 0;
				let retv = node;
				let containingLoopNode = node;

				while (
					containingLoopNode &&
					containingLoopNode.range[0] >= border
				) {
					retv = containingLoopNode;
					containingLoopNode = getContainingLoopNode(containingLoopNode);
				}

				return retv;
			}

			/**
			 * Checks whether a given reference which refers to an upper scope's variable is
			 * safe or not.
			 * @param {ASTNode} loopNode A containing loop node.
			 * @param {eslint-scope.Reference} reference A reference to check.
			 * @returns {boolean} `true` if the reference is safe or not.
			 */
			function isSafe(loopNode, reference) {
				const variable = reference.resolved;
				const definition = variable && variable.defs[0];
				const declaration = definition && definition.parent;
				const kind =
					declaration && declaration.type === "VariableDeclaration"
						? declaration.kind
						: "";

				// Variables which are declared by `const` is safe.
				if (kind === "const") {
					return true;
				}

				/*
				 * Variables which are declared by `let` in the loop is safe.
				 * It's a different instance from the next loop step's.
				 */
				if (
					kind === "let" &&
					declaration.range[0] > loopNode.range[0] &&
					declaration.range[1] < loopNode.range[1]
				) {
					return true;
				}

				/*
				 * WriteReferences which exist after this border are unsafe because those
				 * can modify the variable.
				 */
				const border = getTopLoopNode(
					loopNode,
					kind === "let" ? declaration : null,
				).range[0];

				/**
				 * Checks whether a given reference is safe or not.
				 * The reference is every reference of the upper scope's variable we are
				 * looking now.
				 *
				 * It's safe if the reference matches one of the following condition.
				 * - is readonly.
				 * - doesn't exist inside a local function and after the border.
				 * @param {eslint-scope.Reference} upperRef A reference to check.
				 * @returns {boolean} `true` if the reference is safe.
				 */
				function isSafeReference(upperRef) {
					const id = upperRef.identifier;

					return (
						!upperRef.isWrite() ||
						(variable.scope.variableScope ===
							upperRef.from.variableScope &&
							id.range[0] < border)
					);
				}

				return (
					Boolean(variable) && variable.references.every(isSafeReference)
				);
			}

			/**
			 * Reports functions which match the following condition:
			 *
			 * - has a loop node in ancestors.
			 * - has any references which refers to an unsafe variable.
			 * @param {ASTNode} node The AST node to check.
			 * @returns {void}
			 */
			function checkForLoops(node) {
				const loopNode = getContainingLoopNode(node);

				if (!loopNode) {
					return;
				}

				const references = sourceCode.getScope(node).through;

				// Check if the function is not asynchronous or a generator function
				if (!(node.async || node.generator)) {
					if (isIIFE(node)) {
						const isFunctionExpression =
							node.type === "FunctionExpression";

						// Check if the function is referenced elsewhere in the code
						const isFunctionReferenced =
							isFunctionExpression && node.id
								? references.some(
										r => r.identifier.name === node.id.name,
									)
								: false;

						if (!isFunctionReferenced) {
							SKIPPED_IIFE_NODES.add(node);
							return;
						}
					}
				}

				const unsafeRefs = references
					.filter(r => r.resolved && !isSafe(loopNode, r))
					.map(r => r.identifier.name);

				if (unsafeRefs.length > 0) {
					context.report({
						node,
						messageId: "unsafeRefs",
						data: { varNames: `'${unsafeRefs.join("', '")}'` },
					});
				}
			}

			return {
				ArrowFunctionExpression: checkForLoops,
				FunctionExpression: checkForLoops,
				FunctionDeclaration: checkForLoops,
			};
		},
	};
	return noLoopFunc;
}

/**
 * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime
 * @author Jacob Moore
 */

var noLossOfPrecision;
var hasRequiredNoLossOfPrecision;

function requireNoLossOfPrecision () {
	if (hasRequiredNoLossOfPrecision) return noLossOfPrecision;
	hasRequiredNoLossOfPrecision = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noLossOfPrecision = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow literal numbers that lose precision",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-loss-of-precision",
			},
			schema: [],
			messages: {
				noLossOfPrecision:
					"This number literal will lose precision at runtime.",
			},
		},

		create(context) {
			/**
			 * Returns whether the node is number literal
			 * @param {Node} node the node literal being evaluated
			 * @returns {boolean} true if the node is a number literal
			 */
			function isNumber(node) {
				return typeof node.value === "number";
			}

			/**
			 * Gets the source code of the given number literal. Removes `_` numeric separators from the result.
			 * @param {Node} node the number `Literal` node
			 * @returns {string} raw source code of the literal, without numeric separators
			 */
			function getRaw(node) {
				return node.raw.replace(/_/gu, "");
			}

			/**
			 * Checks whether the number is  base ten
			 * @param {ASTNode} node the node being evaluated
			 * @returns {boolean} true if the node is in base ten
			 */
			function isBaseTen(node) {
				const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"];

				return (
					prefixes.every(prefix => !node.raw.startsWith(prefix)) &&
					!/^0[0-7]+$/u.test(node.raw)
				);
			}

			/**
			 * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type
			 * @param {Node} node the node being evaluated
			 * @returns {boolean} true if they do not match
			 */
			function notBaseTenLosesPrecision(node) {
				const rawString = getRaw(node).toUpperCase();
				let base;

				if (rawString.startsWith("0B")) {
					base = 2;
				} else if (rawString.startsWith("0X")) {
					base = 16;
				} else {
					base = 8;
				}

				return !rawString.endsWith(node.value.toString(base).toUpperCase());
			}

			/**
			 * Adds a decimal point to the numeric string at index 1
			 * @param {string} stringNumber the numeric string without any decimal point
			 * @returns {string} the numeric string with a decimal point in the proper place
			 */
			function addDecimalPointToNumber(stringNumber) {
				return `${stringNumber[0]}.${stringNumber.slice(1)}`;
			}

			/**
			 * Returns the number stripped of leading zeros
			 * @param {string} numberAsString the string representation of the number
			 * @returns {string} the stripped string
			 */
			function removeLeadingZeros(numberAsString) {
				for (let i = 0; i < numberAsString.length; i++) {
					if (numberAsString[i] !== "0") {
						return numberAsString.slice(i);
					}
				}
				return numberAsString;
			}

			/**
			 * Returns the number stripped of trailing zeros
			 * @param {string} numberAsString the string representation of the number
			 * @returns {string} the stripped string
			 */
			function removeTrailingZeros(numberAsString) {
				for (let i = numberAsString.length - 1; i >= 0; i--) {
					if (numberAsString[i] !== "0") {
						return numberAsString.slice(0, i + 1);
					}
				}
				return numberAsString;
			}

			/**
			 * Converts an integer to an object containing the integer's coefficient and order of magnitude
			 * @param {string} stringInteger the string representation of the integer being converted
			 * @returns {Object} the object containing the integer's coefficient and order of magnitude
			 */
			function normalizeInteger(stringInteger) {
				const significantDigits = removeTrailingZeros(
					removeLeadingZeros(stringInteger),
				);

				return {
					magnitude: stringInteger.startsWith("0")
						? stringInteger.length - 2
						: stringInteger.length - 1,
					coefficient: addDecimalPointToNumber(significantDigits),
				};
			}

			/**
			 *
			 * Converts a float to an object containing the floats's coefficient and order of magnitude
			 * @param {string} stringFloat the string representation of the float being converted
			 * @returns {Object} the object containing the integer's coefficient and order of magnitude
			 */
			function normalizeFloat(stringFloat) {
				const trimmedFloat = removeLeadingZeros(stringFloat);

				if (trimmedFloat.startsWith(".")) {
					const decimalDigits = trimmedFloat.slice(1);
					const significantDigits = removeLeadingZeros(decimalDigits);

					return {
						magnitude:
							significantDigits.length - decimalDigits.length - 1,
						coefficient: addDecimalPointToNumber(significantDigits),
					};
				}
				return {
					magnitude: trimmedFloat.indexOf(".") - 1,
					coefficient: addDecimalPointToNumber(
						trimmedFloat.replace(".", ""),
					),
				};
			}

			/**
			 * Converts a base ten number to proper scientific notation
			 * @param {string} stringNumber the string representation of the base ten number to be converted
			 * @returns {string} the number converted to scientific notation
			 */
			function convertNumberToScientificNotation(stringNumber) {
				const splitNumber = stringNumber.replace("E", "e").split("e");
				const originalCoefficient = splitNumber[0];
				const normalizedNumber = stringNumber.includes(".")
					? normalizeFloat(originalCoefficient)
					: normalizeInteger(originalCoefficient);
				const normalizedCoefficient = normalizedNumber.coefficient;
				const magnitude =
					splitNumber.length > 1
						? parseInt(splitNumber[1], 10) + normalizedNumber.magnitude
						: normalizedNumber.magnitude;

				return `${normalizedCoefficient}e${magnitude}`;
			}

			/**
			 * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type
			 * @param {Node} node the node being evaluated
			 * @returns {boolean} true if they do not match
			 */
			function baseTenLosesPrecision(node) {
				const normalizedRawNumber = convertNumberToScientificNotation(
					getRaw(node),
				);
				const requestedPrecision = normalizedRawNumber
					.split("e")[0]
					.replace(".", "").length;

				if (requestedPrecision > 100) {
					return true;
				}
				const storedNumber = node.value.toPrecision(requestedPrecision);
				const normalizedStoredNumber =
					convertNumberToScientificNotation(storedNumber);

				return normalizedRawNumber !== normalizedStoredNumber;
			}

			/**
			 * Checks that the user-intended number equals the actual number after is has been converted to the Number type
			 * @param {Node} node the node being evaluated
			 * @returns {boolean} true if they do not match
			 */
			function losesPrecision(node) {
				return isBaseTen(node)
					? baseTenLosesPrecision(node)
					: notBaseTenLosesPrecision(node);
			}

			return {
				Literal(node) {
					if (node.value && isNumber(node) && losesPrecision(node)) {
						context.report({
							messageId: "noLossOfPrecision",
							node,
						});
					}
				},
			};
		},
	};
	return noLossOfPrecision;
}

/**
 * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js)
 * @author Vincent Lemeunier
 */

var noMagicNumbers;
var hasRequiredNoMagicNumbers;

function requireNoMagicNumbers () {
	if (hasRequiredNoMagicNumbers) return noMagicNumbers;
	hasRequiredNoMagicNumbers = 1;

	const astUtils = requireAstUtils();

	// Maximum array length by the ECMAScript Specification.
	const MAX_ARRAY_LENGTH = 2 ** 32 - 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/**
	 * Convert the value to bigint if it's a string. Otherwise return the value as-is.
	 * @param {bigint|number|string} x The value to normalize.
	 * @returns {bigint|number} The normalized value.
	 */
	function normalizeIgnoreValue(x) {
		if (typeof x === "string") {
			return BigInt(x.slice(0, -1));
		}
		return x;
	}

	/** @type {import('../shared/types').Rule} */
	noMagicNumbers = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow magic numbers",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-magic-numbers",
			},

			schema: [
				{
					type: "object",
					properties: {
						detectObjects: {
							type: "boolean",
							default: false,
						},
						enforceConst: {
							type: "boolean",
							default: false,
						},
						ignore: {
							type: "array",
							items: {
								anyOf: [
									{ type: "number" },
									{
										type: "string",
										pattern: "^[+-]?(?:0|[1-9][0-9]*)n$",
									},
								],
							},
							uniqueItems: true,
						},
						ignoreArrayIndexes: {
							type: "boolean",
							default: false,
						},
						ignoreDefaultValues: {
							type: "boolean",
							default: false,
						},
						ignoreClassFieldInitialValues: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				useConst: "Number constants declarations must use 'const'.",
				noMagic: "No magic number: {{raw}}.",
			},
		},

		create(context) {
			const config = context.options[0] || {},
				detectObjects = !!config.detectObjects,
				enforceConst = !!config.enforceConst,
				ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)),
				ignoreArrayIndexes = !!config.ignoreArrayIndexes,
				ignoreDefaultValues = !!config.ignoreDefaultValues,
				ignoreClassFieldInitialValues =
					!!config.ignoreClassFieldInitialValues;

			const okTypes = detectObjects
				? []
				: ["ObjectExpression", "Property", "AssignmentExpression"];

			/**
			 * Returns whether the rule is configured to ignore the given value
			 * @param {bigint|number} value The value to check
			 * @returns {boolean} true if the value is ignored
			 */
			function isIgnoredValue(value) {
				return ignore.has(value);
			}

			/**
			 * Returns whether the number is a default value assignment.
			 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
			 * @returns {boolean} true if the number is a default value
			 */
			function isDefaultValue(fullNumberNode) {
				const parent = fullNumberNode.parent;

				return (
					parent.type === "AssignmentPattern" &&
					parent.right === fullNumberNode
				);
			}

			/**
			 * Returns whether the number is the initial value of a class field.
			 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
			 * @returns {boolean} true if the number is the initial value of a class field.
			 */
			function isClassFieldInitialValue(fullNumberNode) {
				const parent = fullNumberNode.parent;

				return (
					parent.type === "PropertyDefinition" &&
					parent.value === fullNumberNode
				);
			}

			/**
			 * Returns whether the given node is used as a radix within parseInt() or Number.parseInt()
			 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
			 * @returns {boolean} true if the node is radix
			 */
			function isParseIntRadix(fullNumberNode) {
				const parent = fullNumberNode.parent;

				return (
					parent.type === "CallExpression" &&
					fullNumberNode === parent.arguments[1] &&
					(astUtils.isSpecificId(parent.callee, "parseInt") ||
						astUtils.isSpecificMemberAccess(
							parent.callee,
							"Number",
							"parseInt",
						))
				);
			}

			/**
			 * Returns whether the given node is a direct child of a JSX node.
			 * In particular, it aims to detect numbers used as prop values in JSX tags.
			 * Example: <input maxLength={10} />
			 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
			 * @returns {boolean} true if the node is a JSX number
			 */
			function isJSXNumber(fullNumberNode) {
				return fullNumberNode.parent.type.indexOf("JSX") === 0;
			}

			/**
			 * Returns whether the given node is used as an array index.
			 * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294".
			 *
			 * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties,
			 * which can be created and accessed on an array in addition to the array index properties,
			 * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc.
			 *
			 * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295,
			 * thus the maximum valid index is 2 ** 32 - 2 = 4294967294.
			 *
			 * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294".
			 *
			 * Valid examples:
			 * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n]
			 * a[-0] (same as a[0] because -0 coerces to "0")
			 * a[-0n] (-0n evaluates to 0n)
			 *
			 * Invalid examples:
			 * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1]
			 * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"])
			 * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"])
			 * a[1e310] (same as a["Infinity"])
			 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
			 * @param {bigint|number} value Value expressed by the fullNumberNode
			 * @returns {boolean} true if the node is a valid array index
			 */
			function isArrayIndex(fullNumberNode, value) {
				const parent = fullNumberNode.parent;

				return (
					parent.type === "MemberExpression" &&
					parent.property === fullNumberNode &&
					(Number.isInteger(value) || typeof value === "bigint") &&
					value >= 0 &&
					value < MAX_ARRAY_LENGTH
				);
			}

			return {
				Literal(node) {
					if (!astUtils.isNumericLiteral(node)) {
						return;
					}

					let fullNumberNode;
					let value;
					let raw;

					// Treat unary minus as a part of the number
					if (
						node.parent.type === "UnaryExpression" &&
						node.parent.operator === "-"
					) {
						fullNumberNode = node.parent;
						value = -node.value;
						raw = `-${node.raw}`;
					} else {
						fullNumberNode = node;
						value = node.value;
						raw = node.raw;
					}

					const parent = fullNumberNode.parent;

					// Always allow radix arguments and JSX props
					if (
						isIgnoredValue(value) ||
						(ignoreDefaultValues && isDefaultValue(fullNumberNode)) ||
						(ignoreClassFieldInitialValues &&
							isClassFieldInitialValue(fullNumberNode)) ||
						isParseIntRadix(fullNumberNode) ||
						isJSXNumber(fullNumberNode) ||
						(ignoreArrayIndexes && isArrayIndex(fullNumberNode, value))
					) {
						return;
					}

					if (parent.type === "VariableDeclarator") {
						if (enforceConst && parent.parent.kind !== "const") {
							context.report({
								node: fullNumberNode,
								messageId: "useConst",
							});
						}
					} else if (
						!okTypes.includes(parent.type) ||
						(parent.type === "AssignmentExpression" &&
							parent.left.type === "Identifier")
					) {
						context.report({
							node: fullNumberNode,
							messageId: "noMagic",
							data: {
								raw,
							},
						});
					}
				},
			};
		},
	};
	return noMagicNumbers;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var isCombiningCharacter;
var hasRequiredIsCombiningCharacter;

function requireIsCombiningCharacter () {
	if (hasRequiredIsCombiningCharacter) return isCombiningCharacter;
	hasRequiredIsCombiningCharacter = 1;

	/**
	 * Check whether a given character is a combining mark or not.
	 * @param {number} codePoint The character code to check.
	 * @returns {boolean} `true` if the character belongs to the category, any of `Mc`, `Me`, and `Mn`.
	 */
	isCombiningCharacter = function isCombiningCharacter(codePoint) {
		return /^[\p{Mc}\p{Me}\p{Mn}]$/u.test(String.fromCodePoint(codePoint));
	};
	return isCombiningCharacter;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var isEmojiModifier;
var hasRequiredIsEmojiModifier;

function requireIsEmojiModifier () {
	if (hasRequiredIsEmojiModifier) return isEmojiModifier;
	hasRequiredIsEmojiModifier = 1;

	/**
	 * Check whether a given character is an emoji modifier.
	 * @param {number} code The character code to check.
	 * @returns {boolean} `true` if the character is an emoji modifier.
	 */
	isEmojiModifier = function isEmojiModifier(code) {
		return code >= 0x1f3fb && code <= 0x1f3ff;
	};
	return isEmojiModifier;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var isRegionalIndicatorSymbol;
var hasRequiredIsRegionalIndicatorSymbol;

function requireIsRegionalIndicatorSymbol () {
	if (hasRequiredIsRegionalIndicatorSymbol) return isRegionalIndicatorSymbol;
	hasRequiredIsRegionalIndicatorSymbol = 1;

	/**
	 * Check whether a given character is a regional indicator symbol.
	 * @param {number} code The character code to check.
	 * @returns {boolean} `true` if the character is a regional indicator symbol.
	 */
	isRegionalIndicatorSymbol = function isRegionalIndicatorSymbol(code) {
		return code >= 0x1f1e6 && code <= 0x1f1ff;
	};
	return isRegionalIndicatorSymbol;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var isSurrogatePair;
var hasRequiredIsSurrogatePair;

function requireIsSurrogatePair () {
	if (hasRequiredIsSurrogatePair) return isSurrogatePair;
	hasRequiredIsSurrogatePair = 1;

	/**
	 * Check whether given two characters are a surrogate pair.
	 * @param {number} lead The code of the lead character.
	 * @param {number} tail The code of the tail character.
	 * @returns {boolean} `true` if the character pair is a surrogate pair.
	 */
	isSurrogatePair = function isSurrogatePair(lead, tail) {
		return lead >= 0xd800 && lead < 0xdc00 && tail >= 0xdc00 && tail < 0xe000;
	};
	return isSurrogatePair;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var unicode;
var hasRequiredUnicode;

function requireUnicode () {
	if (hasRequiredUnicode) return unicode;
	hasRequiredUnicode = 1;

	const isCombiningCharacter = requireIsCombiningCharacter();
	const isEmojiModifier = requireIsEmojiModifier();
	const isRegionalIndicatorSymbol = requireIsRegionalIndicatorSymbol();
	const isSurrogatePair = requireIsSurrogatePair();

	unicode = {
		isCombiningCharacter,
		isEmojiModifier,
		isRegionalIndicatorSymbol,
		isSurrogatePair,
	};
	return unicode;
}

/**
 * @fileoverview Common utils for regular expressions.
 * @author Josh Goldberg
 * @author Toru Nagashima
 */

var regularExpressions;
var hasRequiredRegularExpressions;

function requireRegularExpressions () {
	if (hasRequiredRegularExpressions) return regularExpressions;
	hasRequiredRegularExpressions = 1;

	const { RegExpValidator } = requireRegexpp();

	const REGEXPP_LATEST_ECMA_VERSION = 2025;

	/**
	 * Checks if the given regular expression pattern would be valid with the `u` flag.
	 * @param {number} ecmaVersion ECMAScript version to parse in.
	 * @param {string} pattern The regular expression pattern to verify.
	 * @param {"u"|"v"} flag The type of Unicode flag
	 * @returns {boolean} `true` if the pattern would be valid with the `u` flag.
	 * `false` if the pattern would be invalid with the `u` flag or the configured
	 * ecmaVersion doesn't support the `u` flag.
	 */
	function isValidWithUnicodeFlag(ecmaVersion, pattern, flag = "u") {
		if (flag === "u" && ecmaVersion <= 5) {
			// ecmaVersion <= 5 doesn't support the 'u' flag
			return false;
		}
		if (flag === "v" && ecmaVersion <= 2023) {
			return false;
		}

		const validator = new RegExpValidator({
			ecmaVersion: Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION),
		});

		try {
			validator.validatePattern(
				pattern,
				void 0,
				void 0,
				flag === "u"
					? {
							unicode: /* uFlag = */ true,
						}
					: {
							unicodeSets: true,
						},
			);
		} catch {
			return false;
		}

		return true;
	}

	regularExpressions = {
		isValidWithUnicodeFlag,
		REGEXPP_LATEST_ECMA_VERSION,
	};
	return regularExpressions;
}

/**
 * @fileoverview Utility functions to locate the source text of each code unit in the value of a string literal or template token.
 * @author Francesco Trotta
 */

var charSource;
var hasRequiredCharSource;

function requireCharSource () {
	if (hasRequiredCharSource) return charSource;
	hasRequiredCharSource = 1;

	/**
	 * Represents a code unit produced by the evaluation of a JavaScript common token like a string
	 * literal or template token.
	 */
	class CodeUnit {
		constructor(start, source) {
			this.start = start;
			this.source = source;
		}

		get end() {
			return this.start + this.length;
		}

		get length() {
			return this.source.length;
		}
	}

	/**
	 * An object used to keep track of the position in a source text where the next characters will be read.
	 */
	class TextReader {
		constructor(source) {
			this.source = source;
			this.pos = 0;
		}

		/**
		 * Advances the reading position of the specified number of characters.
		 * @param {number} length Number of characters to advance.
		 * @returns {void}
		 */
		advance(length) {
			this.pos += length;
		}

		/**
		 * Reads characters from the source.
		 * @param {number} [offset=0] The offset where reading starts, relative to the current position.
		 * @param {number} [length=1] Number of characters to read.
		 * @returns {string} A substring of source characters.
		 */
		read(offset = 0, length = 1) {
			const start = offset + this.pos;

			return this.source.slice(start, start + length);
		}
	}

	const SIMPLE_ESCAPE_SEQUENCES = {
		__proto__: null,
		b: "\b",
		f: "\f",
		n: "\n",
		r: "\r",
		t: "\t",
		v: "\v",
	};

	/**
	 * Reads a hex escape sequence.
	 * @param {TextReader} reader The reader should be positioned on the first hexadecimal digit.
	 * @param {number} length The number of hexadecimal digits.
	 * @returns {string} A code unit.
	 */
	function readHexSequence(reader, length) {
		const str = reader.read(0, length);
		const charCode = parseInt(str, 16);

		reader.advance(length);
		return String.fromCharCode(charCode);
	}

	/**
	 * Reads a Unicode escape sequence.
	 * @param {TextReader} reader The reader should be positioned after the "u".
	 * @returns {string} A code unit.
	 */
	function readUnicodeSequence(reader) {
		const regExp = /\{(?<hexDigits>[\dA-Fa-f]+)\}/uy;

		regExp.lastIndex = reader.pos;
		const match = regExp.exec(reader.source);

		if (match) {
			const codePoint = parseInt(match.groups.hexDigits, 16);

			reader.pos = regExp.lastIndex;
			return String.fromCodePoint(codePoint);
		}
		return readHexSequence(reader, 4);
	}

	/**
	 * Reads an octal escape sequence.
	 * @param {TextReader} reader The reader should be positioned after the first octal digit.
	 * @param {number} maxLength The maximum number of octal digits.
	 * @returns {string} A code unit.
	 */
	function readOctalSequence(reader, maxLength) {
		const [octalStr] = reader.read(-1, maxLength).match(/^[0-7]+/u);

		reader.advance(octalStr.length - 1);
		const octal = parseInt(octalStr, 8);

		return String.fromCharCode(octal);
	}

	/**
	 * Reads an escape sequence or line continuation.
	 * @param {TextReader} reader The reader should be positioned on the backslash.
	 * @returns {string} A string of zero, one or two code units.
	 */
	function readEscapeSequenceOrLineContinuation(reader) {
		const char = reader.read(1);

		reader.advance(2);
		const unitChar = SIMPLE_ESCAPE_SEQUENCES[char];

		if (unitChar) {
			return unitChar;
		}
		switch (char) {
			case "x":
				return readHexSequence(reader, 2);
			case "u":
				return readUnicodeSequence(reader);
			case "\r":
				if (reader.read() === "\n") {
					reader.advance(1);
				}

			// fallthrough
			case "\n":
			case "\u2028":
			case "\u2029":
				return "";
			case "0":
			case "1":
			case "2":
			case "3":
				return readOctalSequence(reader, 3);
			case "4":
			case "5":
			case "6":
			case "7":
				return readOctalSequence(reader, 2);
			default:
				return char;
		}
	}

	/**
	 * Reads an escape sequence or line continuation and generates the respective `CodeUnit` elements.
	 * @param {TextReader} reader The reader should be positioned on the backslash.
	 * @returns {Generator<CodeUnit>} Zero, one or two `CodeUnit` elements.
	 */
	function* mapEscapeSequenceOrLineContinuation(reader) {
		const start = reader.pos;
		const str = readEscapeSequenceOrLineContinuation(reader);
		const end = reader.pos;
		const source = reader.source.slice(start, end);

		switch (str.length) {
			case 0:
				break;
			case 1:
				yield new CodeUnit(start, source);
				break;
			default:
				yield new CodeUnit(start, source);
				yield new CodeUnit(start, source);
				break;
		}
	}

	/**
	 * Parses a string literal.
	 * @param {string} source The string literal to parse, including the delimiting quotes.
	 * @returns {CodeUnit[]} A list of code units produced by the string literal.
	 */
	function parseStringLiteral(source) {
		const reader = new TextReader(source);
		const quote = reader.read();

		reader.advance(1);
		const codeUnits = [];

		for (;;) {
			const char = reader.read();

			if (char === quote) {
				break;
			}
			if (char === "\\") {
				codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader));
			} else {
				codeUnits.push(new CodeUnit(reader.pos, char));
				reader.advance(1);
			}
		}
		return codeUnits;
	}

	/**
	 * Parses a template token.
	 * @param {string} source The template token to parse, including the delimiting sequences `` ` ``, `${` and `}`.
	 * @returns {CodeUnit[]} A list of code units produced by the template token.
	 */
	function parseTemplateToken(source) {
		const reader = new TextReader(source);

		reader.advance(1);
		const codeUnits = [];

		for (;;) {
			const char = reader.read();

			if (char === "`" || (char === "$" && reader.read(1) === "{")) {
				break;
			}
			if (char === "\\") {
				codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader));
			} else {
				let unitSource;

				if (char === "\r" && reader.read(1) === "\n") {
					unitSource = "\r\n";
				} else {
					unitSource = char;
				}
				codeUnits.push(new CodeUnit(reader.pos, unitSource));
				reader.advance(unitSource.length);
			}
		}
		return codeUnits;
	}

	charSource = { parseStringLiteral, parseTemplateToken };
	return charSource;
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

var noMisleadingCharacterClass;
var hasRequiredNoMisleadingCharacterClass;

function requireNoMisleadingCharacterClass () {
	if (hasRequiredNoMisleadingCharacterClass) return noMisleadingCharacterClass;
	hasRequiredNoMisleadingCharacterClass = 1;

	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
		getStaticValue,
		getStringIfConstant,
	} = /*@__PURE__*/ requireEslintUtils();
	const { RegExpParser, visitRegExpAST } = requireRegexpp();
	const {
		isCombiningCharacter,
		isEmojiModifier,
		isRegionalIndicatorSymbol,
		isSurrogatePair,
	} = requireUnicode();
	const astUtils = requireAstUtils();
	const { isValidWithUnicodeFlag } = requireRegularExpressions();
	const {
		parseStringLiteral,
		parseTemplateToken,
	} = requireCharSource();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * @typedef {import('@eslint-community/regexpp').AST.Character} Character
	 * @typedef {import('@eslint-community/regexpp').AST.CharacterClassElement} CharacterClassElement
	 */

	/**
	 * Iterate character sequences of a given nodes.
	 *
	 * CharacterClassRange syntax can steal a part of character sequence,
	 * so this function reverts CharacterClassRange syntax and restore the sequence.
	 * @param {CharacterClassElement[]} nodes The node list to iterate character sequences.
	 * @returns {IterableIterator<Character[]>} The list of character sequences.
	 */
	function* iterateCharacterSequence(nodes) {
		/** @type {Character[]} */
		let seq = [];

		for (const node of nodes) {
			switch (node.type) {
				case "Character":
					seq.push(node);
					break;

				case "CharacterClassRange":
					seq.push(node.min);
					yield seq;
					seq = [node.max];
					break;

				case "CharacterSet":
				case "CharacterClass": // [[]] nesting character class
				case "ClassStringDisjunction": // \q{...}
				case "ExpressionCharacterClass": // [A--B]
					if (seq.length > 0) {
						yield seq;
						seq = [];
					}
					break;

				// no default
			}
		}

		if (seq.length > 0) {
			yield seq;
		}
	}

	/**
	 * Checks whether the given character node is a Unicode code point escape or not.
	 * @param {Character} char the character node to check.
	 * @returns {boolean} `true` if the character node is a Unicode code point escape.
	 */
	function isUnicodeCodePointEscape(char) {
		return /^\\u\{[\da-f]+\}$/iu.test(char.raw);
	}

	/**
	 * Each function returns matched characters if it detects that kind of problem.
	 * @type {Record<string, (chars: Character[]) => IterableIterator<Character[]>>}
	 */
	const findCharacterSequences = {
		*surrogatePairWithoutUFlag(chars) {
			for (const [index, char] of chars.entries()) {
				const previous = chars[index - 1];

				if (
					previous &&
					char &&
					isSurrogatePair(previous.value, char.value) &&
					!isUnicodeCodePointEscape(previous) &&
					!isUnicodeCodePointEscape(char)
				) {
					yield [previous, char];
				}
			}
		},

		*surrogatePair(chars) {
			for (const [index, char] of chars.entries()) {
				const previous = chars[index - 1];

				if (
					previous &&
					char &&
					isSurrogatePair(previous.value, char.value) &&
					(isUnicodeCodePointEscape(previous) ||
						isUnicodeCodePointEscape(char))
				) {
					yield [previous, char];
				}
			}
		},

		*combiningClass(chars, unfilteredChars) {
			/*
			 * When `allowEscape` is `true`, a combined character should only be allowed if the combining mark appears as an escape sequence.
			 * This means that the base character should be considered even if it's escaped.
			 */
			for (const [index, char] of chars.entries()) {
				const previous = unfilteredChars[index - 1];

				if (
					previous &&
					char &&
					isCombiningCharacter(char.value) &&
					!isCombiningCharacter(previous.value)
				) {
					yield [previous, char];
				}
			}
		},

		*emojiModifier(chars) {
			for (const [index, char] of chars.entries()) {
				const previous = chars[index - 1];

				if (
					previous &&
					char &&
					isEmojiModifier(char.value) &&
					!isEmojiModifier(previous.value)
				) {
					yield [previous, char];
				}
			}
		},

		*regionalIndicatorSymbol(chars) {
			for (const [index, char] of chars.entries()) {
				const previous = chars[index - 1];

				if (
					previous &&
					char &&
					isRegionalIndicatorSymbol(char.value) &&
					isRegionalIndicatorSymbol(previous.value)
				) {
					yield [previous, char];
				}
			}
		},

		*zwj(chars) {
			let sequence = null;

			for (const [index, char] of chars.entries()) {
				const previous = chars[index - 1];
				const next = chars[index + 1];

				if (
					previous &&
					char &&
					next &&
					char.value === 0x200d &&
					previous.value !== 0x200d &&
					next.value !== 0x200d
				) {
					if (sequence) {
						if (sequence.at(-1) === previous) {
							sequence.push(char, next); // append to the sequence
						} else {
							yield sequence;
							sequence = chars.slice(index - 1, index + 2);
						}
					} else {
						sequence = chars.slice(index - 1, index + 2);
					}
				}
			}

			if (sequence) {
				yield sequence;
			}
		},
	};

	const kinds = Object.keys(findCharacterSequences);

	/**
	 * Gets the value of the given node if it's a static value other than a regular expression object,
	 * or the node's `regex` property.
	 * The purpose of this method is to provide a replacement for `getStaticValue` in environments where certain regular expressions cannot be evaluated.
	 * A known example is Node.js 18 which does not support the `v` flag.
	 * Calling `getStaticValue` on a regular expression node with the `v` flag on Node.js 18 always returns `null`.
	 * A limitation of this method is that it can only detect a regular expression if the specified node is itself a regular expression literal node.
	 * @param {ASTNode | undefined} node The node to be inspected.
	 * @param {Scope} initialScope Scope to start finding variables. This function tries to resolve identifier references which are in the given scope.
	 * @returns {{ value: any } | { regex: { pattern: string, flags: string } } | null} The static value of the node, or `null`.
	 */
	function getStaticValueOrRegex(node, initialScope) {
		if (!node) {
			return null;
		}
		if (node.type === "Literal" && node.regex) {
			return { regex: node.regex };
		}

		const staticValue = getStaticValue(node, initialScope);

		if (staticValue?.value instanceof RegExp) {
			return null;
		}
		return staticValue;
	}

	/**
	 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
	 * This function requires the source text of the character to be known.
	 * @param {Character} char Character to check.
	 * @param {string} charSource Source text of the character to check.
	 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
	 */
	function checkForAcceptableEscape(char, charSource) {
		if (!charSource.startsWith("\\")) {
			return false;
		}
		const match = /(?<=^\\+).$/su.exec(charSource);

		return match?.[0] !== String.fromCodePoint(char.value);
	}

	/**
	 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
	 * This function works with characters that are produced by a string or template literal.
	 * It requires the source text and the CodeUnit list of the literal to be known.
	 * @param {Character} char Character to check.
	 * @param {string} nodeSource Source text of the string or template literal that produces the character.
	 * @param {CodeUnit[]} codeUnits List of CodeUnit objects of the literal that produces the character.
	 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
	 */
	function checkForAcceptableEscapeInString(char, nodeSource, codeUnits) {
		const firstIndex = char.start;
		const lastIndex = char.end - 1;
		const start = codeUnits[firstIndex].start;
		const end = codeUnits[lastIndex].end;
		const charSource = nodeSource.slice(start, end);

		return checkForAcceptableEscape(char, charSource);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMisleadingCharacterClass = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow characters which are made with multiple code points in character class syntax",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-misleading-character-class",
			},

			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						allowEscape: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				surrogatePairWithoutUFlag:
					"Unexpected surrogate pair in character class. Use 'u' flag.",
				surrogatePair: "Unexpected surrogate pair in character class.",
				combiningClass: "Unexpected combined character in character class.",
				emojiModifier: "Unexpected modified Emoji in character class.",
				regionalIndicatorSymbol:
					"Unexpected national flag in character class.",
				zwj: "Unexpected joined character sequence in character class.",
				suggestUnicodeFlag: "Add unicode 'u' flag to regex.",
			},
		},
		create(context) {
			const allowEscape = context.options[0]?.allowEscape;
			const sourceCode = context.sourceCode;
			const parser = new RegExpParser();
			const checkedPatternNodes = new Set();

			/**
			 * Verify a given regular expression.
			 * @param {Node} node The node to report.
			 * @param {string} pattern The regular expression pattern to verify.
			 * @param {string} flags The flags of the regular expression.
			 * @param {Function} unicodeFixer Fixer for missing "u" flag.
			 * @returns {void}
			 */
			function verify(node, pattern, flags, unicodeFixer) {
				let patternNode;

				try {
					patternNode = parser.parsePattern(pattern, 0, pattern.length, {
						unicode: flags.includes("u"),
						unicodeSets: flags.includes("v"),
					});
				} catch {
					// Ignore regular expressions with syntax errors
					return;
				}

				let codeUnits = null;

				/**
				 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
				 * For the purposes of this rule, an escape sequence is considered acceptable if it consists of one or more backslashes followed by the character being escaped.
				 * @param {Character} char Character to check.
				 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
				 */
				function isAcceptableEscapeSequence(char) {
					if (node.type === "Literal" && node.regex) {
						return checkForAcceptableEscape(char, char.raw);
					}
					if (node.type === "Literal" && typeof node.value === "string") {
						const nodeSource = node.raw;

						codeUnits ??= parseStringLiteral(nodeSource);

						return checkForAcceptableEscapeInString(
							char,
							nodeSource,
							codeUnits,
						);
					}
					if (astUtils.isStaticTemplateLiteral(node)) {
						const nodeSource = sourceCode.getText(node);

						codeUnits ??= parseTemplateToken(nodeSource);

						return checkForAcceptableEscapeInString(
							char,
							nodeSource,
							codeUnits,
						);
					}
					return false;
				}

				const foundKindMatches = new Map();

				visitRegExpAST(patternNode, {
					onCharacterClassEnter(ccNode) {
						for (const unfilteredChars of iterateCharacterSequence(
							ccNode.elements,
						)) {
							let chars;

							if (allowEscape) {
								// Replace escape sequences with null to avoid having them flagged.
								chars = unfilteredChars.map(char =>
									isAcceptableEscapeSequence(char) ? null : char,
								);
							} else {
								chars = unfilteredChars;
							}
							for (const kind of kinds) {
								const matches = findCharacterSequences[kind](
									chars,
									unfilteredChars,
								);

								if (foundKindMatches.has(kind)) {
									foundKindMatches.get(kind).push(...matches);
								} else {
									foundKindMatches.set(kind, [...matches]);
								}
							}
						}
					},
				});

				/**
				 * Finds the report loc(s) for a range of matches.
				 * Only literals and expression-less templates generate granular errors.
				 * @param {Character[][]} matches Lists of individual characters being reported on.
				 * @returns {Location[]} locs for context.report.
				 * @see https://github.com/eslint/eslint/pull/17515
				 */
				function getNodeReportLocations(matches) {
					if (
						!astUtils.isStaticTemplateLiteral(node) &&
						node.type !== "Literal"
					) {
						return matches.length ? [node.loc] : [];
					}
					return matches.map(chars => {
						const firstIndex = chars[0].start;
						const lastIndex = chars.at(-1).end - 1;
						let start;
						let end;

						if (node.type === "TemplateLiteral") {
							const source = sourceCode.getText(node);
							const offset = node.range[0];

							codeUnits ??= parseTemplateToken(source);
							start = offset + codeUnits[firstIndex].start;
							end = offset + codeUnits[lastIndex].end;
						} else if (typeof node.value === "string") {
							// String Literal
							const source = node.raw;
							const offset = node.range[0];

							codeUnits ??= parseStringLiteral(source);
							start = offset + codeUnits[firstIndex].start;
							end = offset + codeUnits[lastIndex].end;
						} else {
							// RegExp Literal
							const offset = node.range[0] + 1; // Add 1 to skip the leading slash.

							start = offset + firstIndex;
							end = offset + lastIndex + 1;
						}

						return {
							start: sourceCode.getLocFromIndex(start),
							end: sourceCode.getLocFromIndex(end),
						};
					});
				}

				for (const [kind, matches] of foundKindMatches) {
					let suggest;

					if (kind === "surrogatePairWithoutUFlag") {
						suggest = [
							{
								messageId: "suggestUnicodeFlag",
								fix: unicodeFixer,
							},
						];
					}

					const locs = getNodeReportLocations(matches);

					for (const loc of locs) {
						context.report({
							node,
							loc,
							messageId: kind,
							suggest,
						});
					}
				}
			}

			return {
				"Literal[regex]"(node) {
					if (checkedPatternNodes.has(node)) {
						return;
					}
					verify(node, node.regex.pattern, node.regex.flags, fixer => {
						if (
							!isValidWithUnicodeFlag(
								context.languageOptions.ecmaVersion,
								node.regex.pattern,
							)
						) {
							return null;
						}

						return fixer.insertTextAfter(node, "u");
					});
				},
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);

					/*
					 * Iterate calls of RegExp.
					 * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`,
					 *       `const {RegExp: a} = window; new a()`, etc...
					 */
					for (const { node: refNode } of tracker.iterateGlobalReferences(
						{
							RegExp: { [CALL]: true, [CONSTRUCT]: true },
						},
					)) {
						let pattern, flags;
						const [patternNode, flagsNode] = refNode.arguments;
						const evaluatedPattern = getStaticValueOrRegex(
							patternNode,
							scope,
						);

						if (!evaluatedPattern) {
							continue;
						}
						if (flagsNode) {
							if (evaluatedPattern.regex) {
								pattern = evaluatedPattern.regex.pattern;
								checkedPatternNodes.add(patternNode);
							} else {
								pattern = String(evaluatedPattern.value);
							}
							flags = getStringIfConstant(flagsNode, scope);
						} else {
							if (evaluatedPattern.regex) {
								continue;
							}
							pattern = String(evaluatedPattern.value);
							flags = "";
						}

						if (typeof flags === "string") {
							verify(patternNode, pattern, flags, fixer => {
								if (
									!isValidWithUnicodeFlag(
										context.languageOptions.ecmaVersion,
										pattern,
									)
								) {
									return null;
								}

								if (refNode.arguments.length === 1) {
									const penultimateToken =
										sourceCode.getLastToken(refNode, {
											skip: 1,
										}); // skip closing parenthesis

									return fixer.insertTextAfter(
										penultimateToken,
										astUtils.isCommaToken(penultimateToken)
											? ' "u",'
											: ', "u"',
									);
								}

								if (
									(flagsNode.type === "Literal" &&
										typeof flagsNode.value === "string") ||
									flagsNode.type === "TemplateLiteral"
								) {
									const range = [
										flagsNode.range[0],
										flagsNode.range[1] - 1,
									];

									return fixer.insertTextAfterRange(range, "u");
								}

								return null;
							});
						}
					}
				},
			};
		},
	};
	return noMisleadingCharacterClass;
}

/**
 * @fileoverview Rule to disallow mixed binary operators.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var noMixedOperators;
var hasRequiredNoMixedOperators;

function requireNoMixedOperators () {
	if (hasRequiredNoMixedOperators) return noMixedOperators;
	hasRequiredNoMixedOperators = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"];
	const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"];
	const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="];
	const LOGICAL_OPERATORS = ["&&", "||"];
	const RELATIONAL_OPERATORS = ["in", "instanceof"];
	const TERNARY_OPERATOR = ["?:"];
	const COALESCE_OPERATOR = ["??"];
	const ALL_OPERATORS = [].concat(
		ARITHMETIC_OPERATORS,
		BITWISE_OPERATORS,
		COMPARISON_OPERATORS,
		LOGICAL_OPERATORS,
		RELATIONAL_OPERATORS,
		TERNARY_OPERATOR,
		COALESCE_OPERATOR,
	);
	const DEFAULT_GROUPS = [
		ARITHMETIC_OPERATORS,
		BITWISE_OPERATORS,
		COMPARISON_OPERATORS,
		LOGICAL_OPERATORS,
		RELATIONAL_OPERATORS,
	];
	const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u;

	/**
	 * Normalizes options.
	 * @param {Object|undefined} options A options object to normalize.
	 * @returns {Object} Normalized option object.
	 */
	function normalizeOptions(options = {}) {
		const hasGroups = options.groups && options.groups.length > 0;
		const groups = hasGroups ? options.groups : DEFAULT_GROUPS;
		const allowSamePrecedence = options.allowSamePrecedence !== false;

		return {
			groups,
			allowSamePrecedence,
		};
	}

	/**
	 * Checks whether any group which includes both given operator exists or not.
	 * @param {Array<string[]>} groups A list of groups to check.
	 * @param {string} left An operator.
	 * @param {string} right Another operator.
	 * @returns {boolean} `true` if such group existed.
	 */
	function includesBothInAGroup(groups, left, right) {
		return groups.some(group => group.includes(left) && group.includes(right));
	}

	/**
	 * Checks whether the given node is a conditional expression and returns the test node else the left node.
	 * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node.
	 * This parent node can be BinaryExpression, LogicalExpression
	 *      , or a ConditionalExpression node
	 * @returns {ASTNode} node the appropriate node(left or test).
	 */
	function getChildNode(node) {
		return node.type === "ConditionalExpression" ? node.test : node.left;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMixedOperators = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-mixed-operators",
							url: "https://eslint.style/rules/js/no-mixed-operators",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description: "Disallow mixed binary operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-mixed-operators",
			},

			schema: [
				{
					type: "object",
					properties: {
						groups: {
							type: "array",
							items: {
								type: "array",
								items: { enum: ALL_OPERATORS },
								minItems: 2,
								uniqueItems: true,
							},
							uniqueItems: true,
						},
						allowSamePrecedence: {
							type: "boolean",
							default: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedMixedOperator:
					"Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const options = normalizeOptions(context.options[0]);

			/**
			 * Checks whether a given node should be ignored by options or not.
			 * @param {ASTNode} node A node to check. This is a BinaryExpression
			 *      node or a LogicalExpression node. This parent node is one of
			 *      them, too.
			 * @returns {boolean} `true` if the node should be ignored.
			 */
			function shouldIgnore(node) {
				const a = node;
				const b = node.parent;

				return (
					!includesBothInAGroup(
						options.groups,
						a.operator,
						b.type === "ConditionalExpression" ? "?:" : b.operator,
					) ||
					(options.allowSamePrecedence &&
						astUtils.getPrecedence(a) === astUtils.getPrecedence(b))
				);
			}

			/**
			 * Checks whether the operator of a given node is mixed with parent
			 * node's operator or not.
			 * @param {ASTNode} node A node to check. This is a BinaryExpression
			 *      node or a LogicalExpression node. This parent node is one of
			 *      them, too.
			 * @returns {boolean} `true` if the node was mixed.
			 */
			function isMixedWithParent(node) {
				return (
					node.operator !== node.parent.operator &&
					!astUtils.isParenthesised(sourceCode, node)
				);
			}

			/**
			 * Gets the operator token of a given node.
			 * @param {ASTNode} node A node to check. This is a BinaryExpression
			 *      node or a LogicalExpression node.
			 * @returns {Token} The operator token of the node.
			 */
			function getOperatorToken(node) {
				return sourceCode.getTokenAfter(
					getChildNode(node),
					astUtils.isNotClosingParenToken,
				);
			}

			/**
			 * Reports both the operator of a given node and the operator of the
			 * parent node.
			 * @param {ASTNode} node A node to check. This is a BinaryExpression
			 *      node or a LogicalExpression node. This parent node is one of
			 *      them, too.
			 * @returns {void}
			 */
			function reportBothOperators(node) {
				const parent = node.parent;
				const left = getChildNode(parent) === node ? node : parent;
				const right = getChildNode(parent) !== node ? node : parent;
				const data = {
					leftOperator: left.operator || "?:",
					rightOperator: right.operator || "?:",
				};

				context.report({
					node: left,
					loc: getOperatorToken(left).loc,
					messageId: "unexpectedMixedOperator",
					data,
				});
				context.report({
					node: right,
					loc: getOperatorToken(right).loc,
					messageId: "unexpectedMixedOperator",
					data,
				});
			}

			/**
			 * Checks between the operator of this node and the operator of the
			 * parent node.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function check(node) {
				if (
					TARGET_NODE_TYPE.test(node.parent.type) &&
					isMixedWithParent(node) &&
					!shouldIgnore(node)
				) {
					reportBothOperators(node);
				}
			}

			return {
				BinaryExpression: check,
				LogicalExpression: check,
			};
		},
	};
	return noMixedOperators;
}

/**
 * @fileoverview Rule to enforce grouped require statements for Node.JS
 * @author Raphael Pigulla
 * @deprecated in ESLint v7.0.0
 */

var noMixedRequires;
var hasRequiredNoMixedRequires;

function requireNoMixedRequires () {
	if (hasRequiredNoMixedRequires) return noMixedRequires;
	hasRequiredNoMixedRequires = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMixedRequires = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-mixed-requires",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-mixed-requires.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description:
					"Disallow `require` calls to be mixed with regular variable declarations",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-mixed-requires",
			},

			schema: [
				{
					oneOf: [
						{
							type: "boolean",
						},
						{
							type: "object",
							properties: {
								grouping: {
									type: "boolean",
								},
								allowCall: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				noMixRequire: "Do not mix 'require' and other declarations.",
				noMixCoreModuleFileComputed:
					"Do not mix core, module, file and computed requires.",
			},
		},

		create(context) {
			const options = context.options[0];
			let grouping = false,
				allowCall = false;

			if (typeof options === "object") {
				grouping = options.grouping;
				allowCall = options.allowCall;
			} else {
				grouping = !!options;
			}

			/**
			 * Returns the list of built-in modules.
			 * @returns {string[]} An array of built-in Node.js modules.
			 */
			function getBuiltinModules() {
				/*
				 * This list is generated using:
				 * `require("repl")._builtinLibs.concat('repl').sort()`
				 * This particular list is as per nodejs v0.12.2 and iojs v0.7.1
				 */
				return [
					"assert",
					"buffer",
					"child_process",
					"cluster",
					"crypto",
					"dgram",
					"dns",
					"domain",
					"events",
					"fs",
					"http",
					"https",
					"net",
					"os",
					"path",
					"punycode",
					"querystring",
					"readline",
					"repl",
					"smalloc",
					"stream",
					"string_decoder",
					"tls",
					"tty",
					"url",
					"util",
					"v8",
					"vm",
					"zlib",
				];
			}

			const BUILTIN_MODULES = getBuiltinModules();

			const DECL_REQUIRE = "require",
				DECL_UNINITIALIZED = "uninitialized",
				DECL_OTHER = "other";

			const REQ_CORE = "core",
				REQ_FILE = "file",
				REQ_MODULE = "module",
				REQ_COMPUTED = "computed";

			/**
			 * Determines the type of a declaration statement.
			 * @param {ASTNode} initExpression The init node of the VariableDeclarator.
			 * @returns {string} The type of declaration represented by the expression.
			 */
			function getDeclarationType(initExpression) {
				if (!initExpression) {
					// "var x;"
					return DECL_UNINITIALIZED;
				}

				if (
					initExpression.type === "CallExpression" &&
					initExpression.callee.type === "Identifier" &&
					initExpression.callee.name === "require"
				) {
					// "var x = require('util');"
					return DECL_REQUIRE;
				}
				if (
					allowCall &&
					initExpression.type === "CallExpression" &&
					initExpression.callee.type === "CallExpression"
				) {
					// "var x = require('diagnose')('sub-module');"
					return getDeclarationType(initExpression.callee);
				}
				if (initExpression.type === "MemberExpression") {
					// "var x = require('glob').Glob;"
					return getDeclarationType(initExpression.object);
				}

				// "var x = 42;"
				return DECL_OTHER;
			}

			/**
			 * Determines the type of module that is loaded via require.
			 * @param {ASTNode} initExpression The init node of the VariableDeclarator.
			 * @returns {string} The module type.
			 */
			function inferModuleType(initExpression) {
				if (initExpression.type === "MemberExpression") {
					// "var x = require('glob').Glob;"
					return inferModuleType(initExpression.object);
				}
				if (initExpression.arguments.length === 0) {
					// "var x = require();"
					return REQ_COMPUTED;
				}

				const arg = initExpression.arguments[0];

				if (arg.type !== "Literal" || typeof arg.value !== "string") {
					// "var x = require(42);"
					return REQ_COMPUTED;
				}

				if (BUILTIN_MODULES.includes(arg.value)) {
					// "var fs = require('fs');"
					return REQ_CORE;
				}
				if (/^\.{0,2}\//u.test(arg.value)) {
					// "var utils = require('./utils');"
					return REQ_FILE;
				}

				// "var async = require('async');"
				return REQ_MODULE;
			}

			/**
			 * Check if the list of variable declarations is mixed, i.e. whether it
			 * contains both require and other declarations.
			 * @param {ASTNode} declarations The list of VariableDeclarators.
			 * @returns {boolean} True if the declarations are mixed, false if not.
			 */
			function isMixed(declarations) {
				const contains = {};

				declarations.forEach(declaration => {
					const type = getDeclarationType(declaration.init);

					contains[type] = true;
				});

				return !!(
					contains[DECL_REQUIRE] &&
					(contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
				);
			}

			/**
			 * Check if all require declarations in the given list are of the same
			 * type.
			 * @param {ASTNode} declarations The list of VariableDeclarators.
			 * @returns {boolean} True if the declarations are grouped, false if not.
			 */
			function isGrouped(declarations) {
				const found = {};

				declarations.forEach(declaration => {
					if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
						found[inferModuleType(declaration.init)] = true;
					}
				});

				return Object.keys(found).length <= 1;
			}

			return {
				VariableDeclaration(node) {
					if (isMixed(node.declarations)) {
						context.report({
							node,
							messageId: "noMixRequire",
						});
					} else if (grouping && !isGrouped(node.declarations)) {
						context.report({
							node,
							messageId: "noMixCoreModuleFileComputed",
						});
					}
				},
			};
		},
	};
	return noMixedRequires;
}

/**
 * @fileoverview Disallow mixed spaces and tabs for indentation
 * @author Jary Niebur
 * @deprecated in ESLint v8.53.0
 */

var noMixedSpacesAndTabs;
var hasRequiredNoMixedSpacesAndTabs;

function requireNoMixedSpacesAndTabs () {
	if (hasRequiredNoMixedSpacesAndTabs) return noMixedSpacesAndTabs;
	hasRequiredNoMixedSpacesAndTabs = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMixedSpacesAndTabs = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-mixed-spaces-and-tabs",
							url: "https://eslint.style/rules/js/no-mixed-spaces-and-tabs",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow mixed spaces and tabs for indentation",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs",
			},

			schema: [
				{
					enum: ["smart-tabs", true, false],
				},
			],

			messages: {
				mixedSpacesAndTabs: "Mixed spaces and tabs.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			let smartTabs;

			switch (context.options[0]) {
				case true: // Support old syntax, maybe add deprecation warning here
				case "smart-tabs":
					smartTabs = true;
					break;
				default:
					smartTabs = false;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				"Program:exit"(node) {
					const lines = sourceCode.lines,
						comments = sourceCode.getAllComments(),
						ignoredCommentLines = new Set();

					// Add all lines except the first ones.
					comments.forEach(comment => {
						for (
							let i = comment.loc.start.line + 1;
							i <= comment.loc.end.line;
							i++
						) {
							ignoredCommentLines.add(i);
						}
					});

					/*
					 * At least one space followed by a tab
					 * or the reverse before non-tab/-space
					 * characters begin.
					 */
					let regex = /^(?=( +|\t+))\1(?:\t| )/u;

					if (smartTabs) {
						/*
						 * At least one space followed by a tab
						 * before non-tab/-space characters begin.
						 */
						regex = /^(?=(\t*))\1(?=( +))\2\t/u;
					}

					lines.forEach((line, i) => {
						const match = regex.exec(line);

						if (match) {
							const lineNumber = i + 1;
							const loc = {
								start: {
									line: lineNumber,
									column: match[0].length - 2,
								},
								end: {
									line: lineNumber,
									column: match[0].length,
								},
							};

							if (!ignoredCommentLines.has(lineNumber)) {
								const containingNode =
									sourceCode.getNodeByRangeIndex(
										sourceCode.getIndexFromLoc(loc.start),
									);

								if (
									!(
										containingNode &&
										["Literal", "TemplateElement"].includes(
											containingNode.type,
										)
									)
								) {
									context.report({
										node,
										loc,
										messageId: "mixedSpacesAndTabs",
									});
								}
							}
						}
					});
				},
			};
		},
	};
	return noMixedSpacesAndTabs;
}

/**
 * @fileoverview Rule to check use of chained assignment expressions
 * @author Stewart Rand
 */

var noMultiAssign;
var hasRequiredNoMultiAssign;

function requireNoMultiAssign () {
	if (hasRequiredNoMultiAssign) return noMultiAssign;
	hasRequiredNoMultiAssign = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMultiAssign = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					ignoreNonDeclaration: false,
				},
			],

			docs: {
				description: "Disallow use of chained assignment expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-multi-assign",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignoreNonDeclaration: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedChain: "Unexpected chained assignment.",
			},
		},

		create(context) {
			const [{ ignoreNonDeclaration }] = context.options;
			const selectors = [
				"VariableDeclarator > AssignmentExpression.init",
				"PropertyDefinition > AssignmentExpression.value",
			];

			if (!ignoreNonDeclaration) {
				selectors.push("AssignmentExpression > AssignmentExpression.right");
			}

			return {
				[selectors](node) {
					context.report({
						node,
						messageId: "unexpectedChain",
					});
				},
			};
		},
	};
	return noMultiAssign;
}

/**
 * @fileoverview Disallow use of multiple spaces.
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */

var noMultiSpaces;
var hasRequiredNoMultiSpaces;

function requireNoMultiSpaces () {
	if (hasRequiredNoMultiSpaces) return noMultiSpaces;
	hasRequiredNoMultiSpaces = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMultiSpaces = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-multi-spaces",
							url: "https://eslint.style/rules/js/no-multi-spaces",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow multiple spaces",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-multi-spaces",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						exceptions: {
							type: "object",
							patternProperties: {
								"^([A-Z][a-z]*)+$": {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
						ignoreEOLComments: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				multipleSpaces: "Multiple spaces found before '{{displayValue}}'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const options = context.options[0] || {};
			const ignoreEOLComments = options.ignoreEOLComments;
			const exceptions = Object.assign(
				{ Property: true },
				options.exceptions,
			);
			const hasExceptions = Object.keys(exceptions).some(
				key => exceptions[key],
			);

			/**
			 * Formats value of given comment token for error message by truncating its length.
			 * @param {Token} token comment token
			 * @returns {string} formatted value
			 * @private
			 */
			function formatReportedCommentValue(token) {
				const valueLines = token.value.split("\n");
				const value = valueLines[0];
				const formattedValue = `${value.slice(0, 12)}...`;

				return valueLines.length === 1 && value.length <= 12
					? value
					: formattedValue;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program() {
					sourceCode.tokensAndComments.forEach(
						(leftToken, leftIndex, tokensAndComments) => {
							if (leftIndex === tokensAndComments.length - 1) {
								return;
							}
							const rightToken = tokensAndComments[leftIndex + 1];

							// Ignore tokens that don't have 2 spaces between them or are on different lines
							if (
								!sourceCode.text
									.slice(leftToken.range[1], rightToken.range[0])
									.includes("  ") ||
								leftToken.loc.end.line < rightToken.loc.start.line
							) {
								return;
							}

							// Ignore comments that are the last token on their line if `ignoreEOLComments` is active.
							if (
								ignoreEOLComments &&
								astUtils.isCommentToken(rightToken) &&
								(leftIndex === tokensAndComments.length - 2 ||
									rightToken.loc.end.line <
										tokensAndComments[leftIndex + 2].loc.start
											.line)
							) {
								return;
							}

							// Ignore tokens that are in a node in the "exceptions" object
							if (hasExceptions) {
								const parentNode = sourceCode.getNodeByRangeIndex(
									rightToken.range[0] - 1,
								);

								if (parentNode && exceptions[parentNode.type]) {
									return;
								}
							}

							let displayValue;

							if (rightToken.type === "Block") {
								displayValue = `/*${formatReportedCommentValue(rightToken)}*/`;
							} else if (rightToken.type === "Line") {
								displayValue = `//${formatReportedCommentValue(rightToken)}`;
							} else {
								displayValue = rightToken.value;
							}

							context.report({
								node: rightToken,
								loc: {
									start: leftToken.loc.end,
									end: rightToken.loc.start,
								},
								messageId: "multipleSpaces",
								data: { displayValue },
								fix: fixer =>
									fixer.replaceTextRange(
										[leftToken.range[1], rightToken.range[0]],
										" ",
									),
							});
						},
					);
				},
			};
		},
	};
	return noMultiSpaces;
}

/**
 * @fileoverview Rule to flag when using multiline strings
 * @author Ilya Volodin
 */

var noMultiStr;
var hasRequiredNoMultiStr;

function requireNoMultiStr () {
	if (hasRequiredNoMultiStr) return noMultiStr;
	hasRequiredNoMultiStr = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMultiStr = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow multiline strings",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-multi-str",
			},

			schema: [],

			messages: {
				multilineString:
					"Multiline support is limited to browsers supporting ES5 only.",
			},
		},

		create(context) {
			/**
			 * Determines if a given node is part of JSX syntax.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node is a JSX node, false if not.
			 * @private
			 */
			function isJSXElement(node) {
				return node.type.indexOf("JSX") === 0;
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				Literal(node) {
					if (
						astUtils.LINEBREAK_MATCHER.test(node.raw) &&
						!isJSXElement(node.parent)
					) {
						context.report({
							node,
							messageId: "multilineString",
						});
					}
				},
			};
		},
	};
	return noMultiStr;
}

/**
 * @fileoverview Disallows multiple blank lines.
 * implementation adapted from the no-trailing-spaces rule.
 * @author Greg Cochard
 * @deprecated in ESLint v8.53.0
 */

var noMultipleEmptyLines;
var hasRequiredNoMultipleEmptyLines;

function requireNoMultipleEmptyLines () {
	if (hasRequiredNoMultipleEmptyLines) return noMultipleEmptyLines;
	hasRequiredNoMultipleEmptyLines = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noMultipleEmptyLines = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-multiple-empty-lines",
							url: "https://eslint.style/rules/js/no-multiple-empty-lines",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow multiple empty lines",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-multiple-empty-lines",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						max: {
							type: "integer",
							minimum: 0,
						},
						maxEOF: {
							type: "integer",
							minimum: 0,
						},
						maxBOF: {
							type: "integer",
							minimum: 0,
						},
					},
					required: ["max"],
					additionalProperties: false,
				},
			],

			messages: {
				blankBeginningOfFile:
					"Too many blank lines at the beginning of file. Max of {{max}} allowed.",
				blankEndOfFile:
					"Too many blank lines at the end of file. Max of {{max}} allowed.",
				consecutiveBlank:
					"More than {{max}} blank {{pluralizedLines}} not allowed.",
			},
		},

		create(context) {
			// Use options.max or 2 as default
			let max = 2,
				maxEOF = max,
				maxBOF = max;

			if (context.options.length) {
				max = context.options[0].max;
				maxEOF =
					typeof context.options[0].maxEOF !== "undefined"
						? context.options[0].maxEOF
						: max;
				maxBOF =
					typeof context.options[0].maxBOF !== "undefined"
						? context.options[0].maxBOF
						: max;
			}

			const sourceCode = context.sourceCode;

			// Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue
			const allLines =
				sourceCode.lines.at(-1) === ""
					? sourceCode.lines.slice(0, -1)
					: sourceCode.lines;
			const templateLiteralLines = new Set();

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				TemplateLiteral(node) {
					node.quasis.forEach(literalPart => {
						// Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines.
						for (
							let ignoredLine = literalPart.loc.start.line;
							ignoredLine < literalPart.loc.end.line;
							ignoredLine++
						) {
							templateLiteralLines.add(ignoredLine);
						}
					});
				},
				"Program:exit"(node) {
					return (
						allLines

							// Given a list of lines, first get a list of line numbers that are non-empty.
							.reduce((nonEmptyLineNumbers, line, index) => {
								if (
									line.trim() ||
									templateLiteralLines.has(index + 1)
								) {
									nonEmptyLineNumbers.push(index + 1);
								}
								return nonEmptyLineNumbers;
							}, [])

							// Add a value at the end to allow trailing empty lines to be checked.
							.concat(allLines.length + 1)

							// Given two line numbers of non-empty lines, report the lines between if the difference is too large.
							.reduce((lastLineNumber, lineNumber) => {
								let messageId, maxAllowed;

								if (lastLineNumber === 0) {
									messageId = "blankBeginningOfFile";
									maxAllowed = maxBOF;
								} else if (lineNumber === allLines.length + 1) {
									messageId = "blankEndOfFile";
									maxAllowed = maxEOF;
								} else {
									messageId = "consecutiveBlank";
									maxAllowed = max;
								}

								if (lineNumber - lastLineNumber - 1 > maxAllowed) {
									context.report({
										node,
										loc: {
											start: {
												line:
													lastLineNumber + maxAllowed + 1,
												column: 0,
											},
											end: { line: lineNumber, column: 0 },
										},
										messageId,
										data: {
											max: maxAllowed,
											pluralizedLines:
												maxAllowed === 1 ? "line" : "lines",
										},
										fix(fixer) {
											const rangeStart =
												sourceCode.getIndexFromLoc({
													line: lastLineNumber + 1,
													column: 0,
												});

											/*
											 * The end of the removal range is usually the start index of the next line.
											 * However, at the end of the file there is no next line, so the end of the
											 * range is just the length of the text.
											 */
											const lineNumberAfterRemovedLines =
												lineNumber - maxAllowed;
											const rangeEnd =
												lineNumberAfterRemovedLines <=
												allLines.length
													? sourceCode.getIndexFromLoc({
															line: lineNumberAfterRemovedLines,
															column: 0,
														})
													: sourceCode.text.length;

											return fixer.removeRange([
												rangeStart,
												rangeEnd,
											]);
										},
									});
								}

								return lineNumber;
							}, 0)
					);
				},
			};
		},
	};
	return noMultipleEmptyLines;
}

/**
 * @fileoverview Rule to disallow assignments to native objects or read-only global variables
 * @author Ilya Volodin
 * @deprecated in ESLint v3.3.0
 */

var noNativeReassign;
var hasRequiredNoNativeReassign;

function requireNoNativeReassign () {
	if (hasRequiredNoNativeReassign) return noNativeReassign;
	hasRequiredNoNativeReassign = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNativeReassign = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow assignments to native objects or read-only global variables",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-native-reassign",
			},

			deprecated: {
				message: "Renamed rule.",
				url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
				deprecatedSince: "3.3.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "no-global-assign",
							url: "https://eslint.org/docs/rules/no-global-assign",
						},
					},
				],
			},

			schema: [
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: { type: "string" },
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				nativeReassign:
					"Read-only global '{{name}}' should not be modified.",
			},
		},

		create(context) {
			const config = context.options[0];
			const exceptions = (config && config.exceptions) || [];
			const sourceCode = context.sourceCode;

			/**
			 * Reports write references.
			 * @param {Reference} reference A reference to check.
			 * @param {int} index The index of the reference in the references.
			 * @param {Reference[]} references The array that the reference belongs to.
			 * @returns {void}
			 */
			function checkReference(reference, index, references) {
				const identifier = reference.identifier;

				if (
					reference.init === false &&
					reference.isWrite() &&
					/*
					 * Destructuring assignments can have multiple default value,
					 * so possibly there are multiple writeable references for the same identifier.
					 */
					(index === 0 || references[index - 1].identifier !== identifier)
				) {
					context.report({
						node: identifier,
						messageId: "nativeReassign",
						data: identifier,
					});
				}
			}

			/**
			 * Reports write references if a given variable is read-only builtin.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				if (
					variable.writeable === false &&
					!exceptions.includes(variable.name)
				) {
					variable.references.forEach(checkReference);
				}
			}

			return {
				Program(node) {
					const globalScope = sourceCode.getScope(node);

					globalScope.variables.forEach(checkVariable);
				},
			};
		},
	};
	return noNativeReassign;
}

/**
 * @fileoverview Rule to disallow a negated condition
 * @author Alberto Rodríguez
 */

var noNegatedCondition;
var hasRequiredNoNegatedCondition;

function requireNoNegatedCondition () {
	if (hasRequiredNoNegatedCondition) return noNegatedCondition;
	hasRequiredNoNegatedCondition = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNegatedCondition = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow negated conditions",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-negated-condition",
			},

			schema: [],

			messages: {
				unexpectedNegated: "Unexpected negated condition.",
			},
		},

		create(context) {
			/**
			 * Determines if a given node is an if-else without a condition on the else
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node has an else without an if.
			 * @private
			 */
			function hasElseWithoutCondition(node) {
				return node.alternate && node.alternate.type !== "IfStatement";
			}

			/**
			 * Determines if a given node is a negated unary expression
			 * @param {Object} test The test object to check.
			 * @returns {boolean} True if the node is a negated unary expression.
			 * @private
			 */
			function isNegatedUnaryExpression(test) {
				return test.type === "UnaryExpression" && test.operator === "!";
			}

			/**
			 * Determines if a given node is a negated binary expression
			 * @param {Test} test The test to check.
			 * @returns {boolean} True if the node is a negated binary expression.
			 * @private
			 */
			function isNegatedBinaryExpression(test) {
				return (
					test.type === "BinaryExpression" &&
					(test.operator === "!=" || test.operator === "!==")
				);
			}

			/**
			 * Determines if a given node has a negated if expression
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} True if the node has a negated if expression.
			 * @private
			 */
			function isNegatedIf(node) {
				return (
					isNegatedUnaryExpression(node.test) ||
					isNegatedBinaryExpression(node.test)
				);
			}

			return {
				IfStatement(node) {
					if (!hasElseWithoutCondition(node)) {
						return;
					}

					if (isNegatedIf(node)) {
						context.report({
							node,
							messageId: "unexpectedNegated",
						});
					}
				},
				ConditionalExpression(node) {
					if (isNegatedIf(node)) {
						context.report({
							node,
							messageId: "unexpectedNegated",
						});
					}
				},
			};
		},
	};
	return noNegatedCondition;
}

/**
 * @fileoverview A rule to disallow negated left operands of the `in` operator
 * @author Michael Ficarra
 * @deprecated in ESLint v3.3.0
 */

var noNegatedInLhs;
var hasRequiredNoNegatedInLhs;

function requireNoNegatedInLhs () {
	if (hasRequiredNoNegatedInLhs) return noNegatedInLhs;
	hasRequiredNoNegatedInLhs = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNegatedInLhs = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow negating the left operand in `in` expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs",
			},

			deprecated: {
				message: "Renamed rule.",
				url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
				deprecatedSince: "3.3.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "no-unsafe-negation",
							url: "https://eslint.org/docs/rules/no-unsafe-negation",
						},
					},
				],
			},
			schema: [],

			messages: {
				negatedLHS: "The 'in' expression's left operand is negated.",
			},
		},

		create(context) {
			return {
				BinaryExpression(node) {
					if (
						node.operator === "in" &&
						node.left.type === "UnaryExpression" &&
						node.left.operator === "!"
					) {
						context.report({ node, messageId: "negatedLHS" });
					}
				},
			};
		},
	};
	return noNegatedInLhs;
}

/**
 * @fileoverview Rule to flag nested ternary expressions
 * @author Ian Christian Myers
 */

var noNestedTernary;
var hasRequiredNoNestedTernary;

function requireNoNestedTernary () {
	if (hasRequiredNoNestedTernary) return noNestedTernary;
	hasRequiredNoNestedTernary = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNestedTernary = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow nested ternary expressions",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-nested-ternary",
			},

			schema: [],

			messages: {
				noNestedTernary: "Do not nest ternary expressions.",
			},
		},

		create(context) {
			return {
				ConditionalExpression(node) {
					if (
						node.alternate.type === "ConditionalExpression" ||
						node.consequent.type === "ConditionalExpression"
					) {
						context.report({
							node,
							messageId: "noNestedTernary",
						});
					}
				},
			};
		},
	};
	return noNestedTernary;
}

/**
 * @fileoverview Rule to flag statements with function invocation preceded by
 * "new" and not part of assignment
 * @author Ilya Volodin
 */

var noNew;
var hasRequiredNoNew;

function requireNoNew () {
	if (hasRequiredNoNew) return noNew;
	hasRequiredNoNew = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNew = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `new` operators outside of assignments or comparisons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new",
			},

			schema: [],

			messages: {
				noNewStatement: "Do not use 'new' for side effects.",
			},
		},

		create(context) {
			return {
				"ExpressionStatement > NewExpression"(node) {
					context.report({
						node: node.parent,
						messageId: "noNewStatement",
					});
				},
			};
		},
	};
	return noNew;
}

/**
 * @fileoverview Rule to flag when using new Function
 * @author Ilya Volodin
 */

var noNewFunc;
var hasRequiredNoNewFunc;

function requireNoNewFunc () {
	if (hasRequiredNoNewFunc) return noNewFunc;
	hasRequiredNoNewFunc = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const callMethods = new Set(["apply", "bind", "call"]);

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewFunc = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `new` operators with the `Function` object",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new-func",
			},

			schema: [],

			messages: {
				noFunctionConstructor: "The Function constructor is eval.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);
					const variable = globalScope.set.get("Function");

					if (variable && variable.defs.length === 0) {
						variable.references.forEach(ref => {
							const idNode = ref.identifier;
							const { parent } = idNode;
							let evalNode;

							if (parent) {
								if (
									idNode === parent.callee &&
									(parent.type === "NewExpression" ||
										parent.type === "CallExpression")
								) {
									evalNode = parent;
								} else if (
									parent.type === "MemberExpression" &&
									idNode === parent.object &&
									callMethods.has(
										astUtils.getStaticPropertyName(parent),
									)
								) {
									const maybeCallee =
										parent.parent.type === "ChainExpression"
											? parent.parent
											: parent;

									if (
										maybeCallee.parent.type ===
											"CallExpression" &&
										maybeCallee.parent.callee === maybeCallee
									) {
										evalNode = maybeCallee.parent;
									}
								}
							}

							if (evalNode) {
								context.report({
									node: evalNode,
									messageId: "noFunctionConstructor",
								});
							}
						});
					}
				},
			};
		},
	};
	return noNewFunc;
}

/**
 * @fileoverview Rule to disallow use of the new operator with global non-constructor functions
 * @author Sosuke Suzuki
 */

var noNewNativeNonconstructor;
var hasRequiredNoNewNativeNonconstructor;

function requireNoNewNativeNonconstructor () {
	if (hasRequiredNoNewNativeNonconstructor) return noNewNativeNonconstructor;
	hasRequiredNoNewNativeNonconstructor = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const nonConstructorGlobalFunctionNames = ["Symbol", "BigInt"];

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewNativeNonconstructor = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow `new` operators with global non-constructor functions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor",
			},

			schema: [],

			messages: {
				noNewNonconstructor:
					"`{{name}}` cannot be called as a constructor.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					for (const nonConstructorName of nonConstructorGlobalFunctionNames) {
						const variable = globalScope.set.get(nonConstructorName);

						if (variable && variable.defs.length === 0) {
							variable.references.forEach(ref => {
								const idNode = ref.identifier;
								const parent = idNode.parent;

								if (
									parent &&
									parent.type === "NewExpression" &&
									parent.callee === idNode
								) {
									context.report({
										node: idNode,
										messageId: "noNewNonconstructor",
										data: { name: nonConstructorName },
									});
								}
							});
						}
					}
				},
			};
		},
	};
	return noNewNativeNonconstructor;
}

/**
 * @fileoverview A rule to disallow calls to the Object constructor
 * @author Matt DuVall <http://www.mattduvall.com/>
 * @deprecated in ESLint v8.50.0
 */

var noNewObject;
var hasRequiredNoNewObject;

function requireNoNewObject () {
	if (hasRequiredNoNewObject) return noNewObject;
	hasRequiredNoNewObject = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewObject = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `Object` constructors",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new-object",
			},

			deprecated: {
				message:
					"The new rule flags more situations where object literal syntax can be used, and it does not report a problem when the `Object` constructor is invoked with an argument.",
				url: "https://eslint.org/blog/2023/09/eslint-v8.50.0-released/",
				deprecatedSince: "8.50.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "no-object-constructor",
							url: "https://eslint.org/docs/rules/no-object-constructor",
						},
					},
				],
			},

			schema: [],

			messages: {
				preferLiteral: "The object literal notation {} is preferable.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				NewExpression(node) {
					const variable = astUtils.getVariableByName(
						sourceCode.getScope(node),
						node.callee.name,
					);

					if (variable && variable.identifiers.length > 0) {
						return;
					}

					if (node.callee.name === "Object") {
						context.report({
							node,
							messageId: "preferLiteral",
						});
					}
				},
			};
		},
	};
	return noNewObject;
}

/**
 * @fileoverview Rule to disallow use of new operator with the `require` function
 * @author Wil Moore III
 * @deprecated in ESLint v7.0.0
 */

var noNewRequire;
var hasRequiredNoNewRequire;

function requireNoNewRequire () {
	if (hasRequiredNoNewRequire) return noNewRequire;
	hasRequiredNoNewRequire = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewRequire = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-new-require",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-new-require.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow `new` operators with calls to `require`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new-require",
			},

			schema: [],

			messages: {
				noNewRequire: "Unexpected use of new with require.",
			},
		},

		create(context) {
			return {
				NewExpression(node) {
					if (
						node.callee.type === "Identifier" &&
						node.callee.name === "require"
					) {
						context.report({
							node,
							messageId: "noNewRequire",
						});
					}
				},
			};
		},
	};
	return noNewRequire;
}

/**
 * @fileoverview Rule to disallow use of the new operator with the `Symbol` object
 * @author Alberto Rodríguez
 * @deprecated in ESLint v9.0.0
 */

var noNewSymbol;
var hasRequiredNoNewSymbol;

function requireNoNewSymbol () {
	if (hasRequiredNoNewSymbol) return noNewSymbol;
	hasRequiredNoNewSymbol = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewSymbol = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow `new` operators with the `Symbol` object",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new-symbol",
			},

			deprecated: {
				message: "The rule was replaced with a more general rule.",
				url: "https://eslint.org/docs/latest/use/migrate-to-9.0.0#eslint-recommended",
				deprecatedSince: "9.0.0",
				availableUntil: null,
				replacedBy: [
					{
						rule: {
							name: "no-new-native-nonconstructor",
							url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor",
						},
					},
				],
			},

			schema: [],

			messages: {
				noNewSymbol: "`Symbol` cannot be called as a constructor.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);
					const variable = globalScope.set.get("Symbol");

					if (variable && variable.defs.length === 0) {
						variable.references.forEach(ref => {
							const idNode = ref.identifier;
							const parent = idNode.parent;

							if (
								parent &&
								parent.type === "NewExpression" &&
								parent.callee === idNode
							) {
								context.report({
									node: idNode,
									messageId: "noNewSymbol",
								});
							}
						});
					}
				},
			};
		},
	};
	return noNewSymbol;
}

/**
 * @fileoverview Rule to flag when using constructor for wrapper objects
 * @author Ilya Volodin
 */

var noNewWrappers;
var hasRequiredNoNewWrappers;

function requireNoNewWrappers () {
	if (hasRequiredNoNewWrappers) return noNewWrappers;
	hasRequiredNoNewWrappers = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { getVariableByName } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNewWrappers = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-new-wrappers",
			},

			schema: [],

			messages: {
				noConstructor: "Do not use {{fn}} as a constructor.",
			},
		},

		create(context) {
			const { sourceCode } = context;

			return {
				NewExpression(node) {
					const wrapperObjects = ["String", "Number", "Boolean"];
					const { name } = node.callee;

					if (wrapperObjects.includes(name)) {
						const variable = getVariableByName(
							sourceCode.getScope(node),
							name,
						);

						if (variable && variable.identifiers.length === 0) {
							context.report({
								node,
								messageId: "noConstructor",
								data: { fn: name },
							});
						}
					}
				},
			};
		},
	};
	return noNewWrappers;
}

/**
 * @fileoverview Rule to disallow `\8` and `\9` escape sequences in string literals.
 * @author Milos Djermanovic
 */

var noNonoctalDecimalEscape;
var hasRequiredNoNonoctalDecimalEscape;

function requireNoNonoctalDecimalEscape () {
	if (hasRequiredNoNonoctalDecimalEscape) return noNonoctalDecimalEscape;
	hasRequiredNoNonoctalDecimalEscape = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const QUICK_TEST_REGEX = /\\[89]/u;

	/**
	 * Returns unicode escape sequence that represents the given character.
	 * @param {string} character A single code unit.
	 * @returns {string} "\uXXXX" sequence.
	 */
	function getUnicodeEscape(character) {
		return `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noNonoctalDecimalEscape = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `\\8` and `\\9` escape sequences in string literals",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				decimalEscape: "Don't use '{{decimalEscape}}' escape sequence.",

				// suggestions
				refactor:
					"Replace '{{original}}' with '{{replacement}}'. This maintains the current functionality.",
				escapeBackslash:
					"Replace '{{original}}' with '{{replacement}}' to include the actual backslash character.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Creates a new Suggestion object.
			 * @param {string} messageId "refactor" or "escapeBackslash".
			 * @param {int[]} range The range to replace.
			 * @param {string} replacement New text for the range.
			 * @returns {Object} Suggestion
			 */
			function createSuggestion(messageId, range, replacement) {
				return {
					messageId,
					data: {
						original: sourceCode.getText().slice(...range),
						replacement,
					},
					fix(fixer) {
						return fixer.replaceTextRange(range, replacement);
					},
				};
			}

			return {
				Literal(node) {
					if (typeof node.value !== "string") {
						return;
					}

					if (!QUICK_TEST_REGEX.test(node.raw)) {
						return;
					}

					const regex =
						/(?:[^\\]|(?<previousEscape>\\.))*?(?<decimalEscape>\\[89])/suy;
					let match;

					while ((match = regex.exec(node.raw))) {
						const { previousEscape, decimalEscape } = match.groups;
						const decimalEscapeRangeEnd =
							node.range[0] + match.index + match[0].length;
						const decimalEscapeRangeStart =
							decimalEscapeRangeEnd - decimalEscape.length;
						const decimalEscapeRange = [
							decimalEscapeRangeStart,
							decimalEscapeRangeEnd,
						];
						const suggest = [];

						// When `regex` is matched, `previousEscape` can only capture characters adjacent to `decimalEscape`
						if (previousEscape === "\\0") {
							/*
							 * Now we have a NULL escape "\0" immediately followed by a decimal escape, e.g.: "\0\8".
							 * Fixing this to "\08" would turn "\0" into a legacy octal escape. To avoid producing
							 * an octal escape while fixing a decimal escape, we provide different suggestions.
							 */
							suggest.push(
								createSuggestion(
									// "\0\8" -> "\u00008"
									"refactor",
									[
										decimalEscapeRangeStart -
											previousEscape.length,
										decimalEscapeRangeEnd,
									],
									`${getUnicodeEscape("\0")}${decimalEscape[1]}`,
								),
								createSuggestion(
									// "\8" -> "\u0038"
									"refactor",
									decimalEscapeRange,
									getUnicodeEscape(decimalEscape[1]),
								),
							);
						} else {
							suggest.push(
								createSuggestion(
									// "\8" -> "8"
									"refactor",
									decimalEscapeRange,
									decimalEscape[1],
								),
							);
						}

						suggest.push(
							createSuggestion(
								// "\8" -> "\\8"
								"escapeBackslash",
								decimalEscapeRange,
								`\\${decimalEscape}`,
							),
						);

						context.report({
							node,
							loc: {
								start: sourceCode.getLocFromIndex(
									decimalEscapeRangeStart,
								),
								end: sourceCode.getLocFromIndex(
									decimalEscapeRangeEnd,
								),
							},
							messageId: "decimalEscape",
							data: {
								decimalEscape,
							},
							suggest,
						});
					}
				},
			};
		},
	};
	return noNonoctalDecimalEscape;
}

/**
 * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function
 * @author James Allardice
 */

var noObjCalls;
var hasRequiredNoObjCalls;

function requireNoObjCalls () {
	if (hasRequiredNoObjCalls) return noObjCalls;
	hasRequiredNoObjCalls = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
	} = /*@__PURE__*/ requireEslintUtils();
	const getPropertyName = requireAstUtils().getStaticPropertyName;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect", "Intl"];

	/**
	 * Returns the name of the node to report
	 * @param {ASTNode} node A node to report
	 * @returns {string} name to report
	 */
	function getReportNodeName(node) {
		if (node.type === "ChainExpression") {
			return getReportNodeName(node.expression);
		}
		if (node.type === "MemberExpression") {
			return getPropertyName(node);
		}
		return node.name;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noObjCalls = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow calling global object properties as functions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-obj-calls",
			},

			schema: [],

			messages: {
				unexpectedCall: "'{{name}}' is not a function.",
				unexpectedRefCall:
					"'{{name}}' is reference to '{{ref}}', which is not a function.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const traceMap = {};

					for (const g of nonCallableGlobals) {
						traceMap[g] = {
							[CALL]: true,
							[CONSTRUCT]: true,
						};
					}

					for (const {
						node: refNode,
						path,
					} of tracker.iterateGlobalReferences(traceMap)) {
						const name = getReportNodeName(refNode.callee);
						const ref = path[0];
						const messageId =
							name === ref ? "unexpectedCall" : "unexpectedRefCall";

						context.report({
							node: refNode,
							messageId,
							data: { name, ref },
						});
					}
				},
			};
		},
	};
	return noObjCalls;
}

/**
 * @fileoverview Rule to disallow calls to the `Object` constructor without an argument
 * @author Francesco Trotta
 */

var noObjectConstructor;
var hasRequiredNoObjectConstructor;

function requireNoObjectConstructor () {
	if (hasRequiredNoObjectConstructor) return noObjectConstructor;
	hasRequiredNoObjectConstructor = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		getVariableByName,
		isArrowToken,
		isStartOfExpressionStatement,
		needsPrecedingSemicolon,
	} = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noObjectConstructor = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow calls to the `Object` constructor without an argument",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-object-constructor",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				preferLiteral: "The object literal notation {} is preferable.",
				useLiteral: "Replace with '{{replacement}}'.",
				useLiteralAfterSemicolon:
					"Replace with '{{replacement}}', add preceding semicolon.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether or not an object literal that replaces a specified node needs to be enclosed in parentheses.
			 * @param {ASTNode} node The node to be replaced.
			 * @returns {boolean} Whether or not parentheses around the object literal are required.
			 */
			function needsParentheses(node) {
				if (isStartOfExpressionStatement(node)) {
					return true;
				}

				const prevToken = sourceCode.getTokenBefore(node);

				if (prevToken && isArrowToken(prevToken)) {
					return true;
				}

				return false;
			}

			/**
			 * Reports on nodes where the `Object` constructor is called without arguments.
			 * @param {ASTNode} node The node to evaluate.
			 * @returns {void}
			 */
			function check(node) {
				if (
					node.callee.type !== "Identifier" ||
					node.callee.name !== "Object" ||
					node.arguments.length
				) {
					return;
				}

				const variable = getVariableByName(
					sourceCode.getScope(node),
					"Object",
				);

				if (variable && variable.identifiers.length === 0) {
					let replacement;
					let fixText;
					let messageId = "useLiteral";

					if (needsParentheses(node)) {
						replacement = "({})";
						if (needsPrecedingSemicolon(sourceCode, node)) {
							fixText = ";({})";
							messageId = "useLiteralAfterSemicolon";
						} else {
							fixText = "({})";
						}
					} else {
						replacement = fixText = "{}";
					}

					context.report({
						node,
						messageId: "preferLiteral",
						suggest: [
							{
								messageId,
								data: { replacement },
								fix: fixer => fixer.replaceText(node, fixText),
							},
						],
					});
				}
			}

			return {
				CallExpression: check,
				NewExpression: check,
			};
		},
	};
	return noObjectConstructor;
}

/**
 * @fileoverview Rule to flag when initializing octal literal
 * @author Ilya Volodin
 */

var noOctal;
var hasRequiredNoOctal;

function requireNoOctal () {
	if (hasRequiredNoOctal) return noOctal;
	hasRequiredNoOctal = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noOctal = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow octal literals",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-octal",
			},

			schema: [],

			messages: {
				noOctal: "Octal literals should not be used.",
			},
		},

		create(context) {
			return {
				Literal(node) {
					if (
						typeof node.value === "number" &&
						/^0[0-9]/u.test(node.raw)
					) {
						context.report({
							node,
							messageId: "noOctal",
						});
					}
				},
			};
		},
	};
	return noOctal;
}

/**
 * @fileoverview Rule to flag octal escape sequences in string literals.
 * @author Ian Christian Myers
 */

var noOctalEscape;
var hasRequiredNoOctalEscape;

function requireNoOctalEscape () {
	if (hasRequiredNoOctalEscape) return noOctalEscape;
	hasRequiredNoOctalEscape = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noOctalEscape = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow octal escape sequences in string literals",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-octal-escape",
			},

			schema: [],

			messages: {
				octalEscapeSequence:
					"Don't use octal: '\\{{sequence}}'. Use '\\u....' instead.",
			},
		},

		create(context) {
			return {
				Literal(node) {
					if (typeof node.value !== "string") {
						return;
					}

					// \0 represents a valid NULL character if it isn't followed by a digit.
					const match = node.raw.match(
						/^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su,
					);

					if (match) {
						context.report({
							node,
							messageId: "octalEscapeSequence",
							data: { sequence: match[1] },
						});
					}
				},
			};
		},
	};
	return noOctalEscape;
}

/**
 * @fileoverview Disallow reassigning function parameters.
 * @author Nat Burns
 */

var noParamReassign;
var hasRequiredNoParamReassign;

function requireNoParamReassign () {
	if (hasRequiredNoParamReassign) return noParamReassign;
	hasRequiredNoParamReassign = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const stopNodePattern =
		/(?:Statement|Declaration|Function(?:Expression)?|Program)$/u;

	/** @type {import('../shared/types').Rule} */
	noParamReassign = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow reassigning function parameters",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-param-reassign",
			},

			schema: [
				{
					oneOf: [
						{
							type: "object",
							properties: {
								props: {
									enum: [false],
								},
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								props: {
									enum: [true],
								},
								ignorePropertyModificationsFor: {
									type: "array",
									items: {
										type: "string",
									},
									uniqueItems: true,
								},
								ignorePropertyModificationsForRegex: {
									type: "array",
									items: {
										type: "string",
									},
									uniqueItems: true,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				assignmentToFunctionParam:
					"Assignment to function parameter '{{name}}'.",
				assignmentToFunctionParamProp:
					"Assignment to property of function parameter '{{name}}'.",
			},
		},

		create(context) {
			const props = context.options[0] && context.options[0].props;
			const ignoredPropertyAssignmentsFor =
				(context.options[0] &&
					context.options[0].ignorePropertyModificationsFor) ||
				[];
			const ignoredPropertyAssignmentsForRegex =
				(context.options[0] &&
					context.options[0].ignorePropertyModificationsForRegex) ||
				[];
			const sourceCode = context.sourceCode;

			/**
			 * Checks whether or not the reference modifies properties of its variable.
			 * @param {Reference} reference A reference to check.
			 * @returns {boolean} Whether or not the reference modifies properties of its variable.
			 */
			function isModifyingProp(reference) {
				let node = reference.identifier;
				let parent = node.parent;

				while (
					parent &&
					(!stopNodePattern.test(parent.type) ||
						parent.type === "ForInStatement" ||
						parent.type === "ForOfStatement")
				) {
					switch (parent.type) {
						// e.g. foo.a = 0;
						case "AssignmentExpression":
							return parent.left === node;

						// e.g. ++foo.a;
						case "UpdateExpression":
							return true;

						// e.g. delete foo.a;
						case "UnaryExpression":
							if (parent.operator === "delete") {
								return true;
							}
							break;

						// e.g. for (foo.a in b) {}
						case "ForInStatement":
						case "ForOfStatement":
							if (parent.left === node) {
								return true;
							}

							// this is a stop node for parent.right and parent.body
							return false;

						// EXCLUDES: e.g. cache.get(foo.a).b = 0;
						case "CallExpression":
							if (parent.callee !== node) {
								return false;
							}
							break;

						// EXCLUDES: e.g. cache[foo.a] = 0;
						case "MemberExpression":
							if (parent.property === node) {
								return false;
							}
							break;

						// EXCLUDES: e.g. ({ [foo]: a }) = bar;
						case "Property":
							if (parent.key === node) {
								return false;
							}

							break;

						// EXCLUDES: e.g. (foo ? a : b).c = bar;
						case "ConditionalExpression":
							if (parent.test === node) {
								return false;
							}

							break;

						// no default
					}

					node = parent;
					parent = node.parent;
				}

				return false;
			}

			/**
			 * Tests that an identifier name matches any of the ignored property assignments.
			 * First we test strings in ignoredPropertyAssignmentsFor.
			 * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings.
			 * @param {string} identifierName A string that describes the name of an identifier to
			 * ignore property assignments for.
			 * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not.
			 */
			function isIgnoredPropertyAssignment(identifierName) {
				return (
					ignoredPropertyAssignmentsFor.includes(identifierName) ||
					ignoredPropertyAssignmentsForRegex.some(ignored =>
						new RegExp(ignored, "u").test(identifierName),
					)
				);
			}

			/**
			 * Reports a reference if is non initializer and writable.
			 * @param {Reference} reference A reference to check.
			 * @param {int} index The index of the reference in the references.
			 * @param {Reference[]} references The array that the reference belongs to.
			 * @returns {void}
			 */
			function checkReference(reference, index, references) {
				const identifier = reference.identifier;

				if (
					identifier &&
					!reference.init &&
					/*
					 * Destructuring assignments can have multiple default value,
					 * so possibly there are multiple writeable references for the same identifier.
					 */
					(index === 0 || references[index - 1].identifier !== identifier)
				) {
					if (reference.isWrite()) {
						context.report({
							node: identifier,
							messageId: "assignmentToFunctionParam",
							data: { name: identifier.name },
						});
					} else if (
						props &&
						isModifyingProp(reference) &&
						!isIgnoredPropertyAssignment(identifier.name)
					) {
						context.report({
							node: identifier,
							messageId: "assignmentToFunctionParamProp",
							data: { name: identifier.name },
						});
					}
				}
			}

			/**
			 * Finds and reports references that are non initializer and writable.
			 * @param {Variable} variable A variable to check.
			 * @returns {void}
			 */
			function checkVariable(variable) {
				if (variable.defs[0].type === "Parameter") {
					variable.references.forEach(checkReference);
				}
			}

			/**
			 * Checks parameters of a given function node.
			 * @param {ASTNode} node A function node to check.
			 * @returns {void}
			 */
			function checkForFunction(node) {
				sourceCode.getDeclaredVariables(node).forEach(checkVariable);
			}

			return {
				// `:exit` is needed for the `node.parent` property of identifier nodes.
				"FunctionDeclaration:exit": checkForFunction,
				"FunctionExpression:exit": checkForFunction,
				"ArrowFunctionExpression:exit": checkForFunction,
			};
		},
	};
	return noParamReassign;
}

/**
 * @fileoverview Disallow string concatenation when using __dirname and __filename
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v7.0.0
 */

var noPathConcat;
var hasRequiredNoPathConcat;

function requireNoPathConcat () {
	if (hasRequiredNoPathConcat) return noPathConcat;
	hasRequiredNoPathConcat = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noPathConcat = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-path-concat",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-path-concat.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description:
					"Disallow string concatenation with `__dirname` and `__filename`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-path-concat",
			},

			schema: [],

			messages: {
				usePathFunctions:
					"Use path.join() or path.resolve() instead of + to create paths.",
			},
		},

		create(context) {
			const MATCHER = /^__(?:dir|file)name$/u;

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				BinaryExpression(node) {
					const left = node.left,
						right = node.right;

					if (
						node.operator === "+" &&
						((left.type === "Identifier" && MATCHER.test(left.name)) ||
							(right.type === "Identifier" &&
								MATCHER.test(right.name)))
					) {
						context.report({
							node,
							messageId: "usePathFunctions",
						});
					}
				},
			};
		},
	};
	return noPathConcat;
}

/**
 * @fileoverview Rule to flag use of unary increment and decrement operators.
 * @author Ian Christian Myers
 * @author Brody McKee (github.com/mrmckeb)
 */

var noPlusplus;
var hasRequiredNoPlusplus;

function requireNoPlusplus () {
	if (hasRequiredNoPlusplus) return noPlusplus;
	hasRequiredNoPlusplus = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the given node is the update node of a `ForStatement`.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is `ForStatement` update.
	 */
	function isForStatementUpdate(node) {
		const parent = node.parent;

		return parent.type === "ForStatement" && parent.update === node;
	}

	/**
	 * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule.
	 * In particular, it returns `true` if the given node is either:
	 *   - The update node of a `ForStatement`: for (;; i++) {}
	 *   - An operand of a sequence expression that is the update node: for (;; foo(), i++) {}
	 *   - An operand of a sequence expression that is child of another sequence expression, etc.,
	 *     up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {}
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is a for loop afterthought.
	 */
	function isForLoopAfterthought(node) {
		const parent = node.parent;

		if (parent.type === "SequenceExpression") {
			return isForLoopAfterthought(parent);
		}

		return isForStatementUpdate(node);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noPlusplus = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowForLoopAfterthoughts: false,
				},
			],

			docs: {
				description: "Disallow the unary operators `++` and `--`",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-plusplus",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowForLoopAfterthoughts: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedUnaryOp: "Unary operator '{{operator}}' used.",
			},
		},

		create(context) {
			const [{ allowForLoopAfterthoughts }] = context.options;

			return {
				UpdateExpression(node) {
					if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) {
						return;
					}

					context.report({
						node,
						messageId: "unexpectedUnaryOp",
						data: {
							operator: node.operator,
						},
					});
				},
			};
		},
	};
	return noPlusplus;
}

/**
 * @fileoverview Disallow the use of process.env()
 * @author Vignesh Anand
 * @deprecated in ESLint v7.0.0
 */

var noProcessEnv;
var hasRequiredNoProcessEnv;

function requireNoProcessEnv () {
	if (hasRequiredNoProcessEnv) return noProcessEnv;
	hasRequiredNoProcessEnv = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noProcessEnv = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-process-env",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-env.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow the use of `process.env`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-process-env",
			},

			schema: [],

			messages: {
				unexpectedProcessEnv: "Unexpected use of process.env.",
			},
		},

		create(context) {
			return {
				MemberExpression(node) {
					const objectName = node.object.name,
						propertyName = node.property.name;

					if (
						objectName === "process" &&
						!node.computed &&
						propertyName &&
						propertyName === "env"
					) {
						context.report({ node, messageId: "unexpectedProcessEnv" });
					}
				},
			};
		},
	};
	return noProcessEnv;
}

/**
 * @fileoverview Disallow the use of process.exit()
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v7.0.0
 */

var noProcessExit;
var hasRequiredNoProcessExit;

function requireNoProcessExit () {
	if (hasRequiredNoProcessExit) return noProcessExit;
	hasRequiredNoProcessExit = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noProcessExit = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-process-exit",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-exit.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow the use of `process.exit()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-process-exit",
			},

			schema: [],

			messages: {
				noProcessExit: "Don't use process.exit(); throw an error instead.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				"CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(
					node,
				) {
					context.report({
						node: node.parent,
						messageId: "noProcessExit",
					});
				},
			};
		},
	};
	return noProcessExit;
}

/**
 * @fileoverview Rule to disallow returning values from Promise executor functions
 * @author Milos Djermanovic
 */

var noPromiseExecutorReturn;
var hasRequiredNoPromiseExecutorReturn;

function requireNoPromiseExecutorReturn () {
	if (hasRequiredNoPromiseExecutorReturn) return noPromiseExecutorReturn;
	hasRequiredNoPromiseExecutorReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { findVariable } = /*@__PURE__*/ requireEslintUtils();
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const functionTypesToCheck = new Set([
		"ArrowFunctionExpression",
		"FunctionExpression",
	]);

	/**
	 * Determines whether the given identifier node is a reference to a global variable.
	 * @param {ASTNode} node `Identifier` node to check.
	 * @param {Scope} scope Scope to which the node belongs.
	 * @returns {boolean} True if the identifier is a reference to a global variable.
	 */
	function isGlobalReference(node, scope) {
		const variable = findVariable(scope, node);

		return (
			variable !== null &&
			variable.scope.type === "global" &&
			variable.defs.length === 0
		);
	}

	/**
	 * Finds function's outer scope.
	 * @param {Scope} scope Function's own scope.
	 * @returns {Scope} Function's outer scope.
	 */
	function getOuterScope(scope) {
		const upper = scope.upper;

		if (upper.type === "function-expression-name") {
			return upper.upper;
		}
		return upper;
	}

	/**
	 * Determines whether the given function node is used as a Promise executor.
	 * @param {ASTNode} node The node to check.
	 * @param {Scope} scope Function's own scope.
	 * @returns {boolean} `true` if the node is a Promise executor.
	 */
	function isPromiseExecutor(node, scope) {
		const parent = node.parent;

		return (
			parent.type === "NewExpression" &&
			parent.arguments[0] === node &&
			parent.callee.type === "Identifier" &&
			parent.callee.name === "Promise" &&
			isGlobalReference(parent.callee, getOuterScope(scope))
		);
	}

	/**
	 * Checks if the given node is a void expression.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} - `true` if the node is a void expression
	 */
	function expressionIsVoid(node) {
		return node.type === "UnaryExpression" && node.operator === "void";
	}

	/**
	 * Fixes the linting error by prepending "void " to the given node
	 * @param {Object} sourceCode context given by context.sourceCode
	 * @param {ASTNode} node The node to fix.
	 * @param {Object} fixer The fixer object provided by ESLint.
	 * @returns {Array<Object>} - An array of fix objects to apply to the node.
	 */
	function voidPrependFixer(sourceCode, node, fixer) {
		const requiresParens =
			// prepending `void ` will fail if the node has a lower precedence than void
			astUtils.getPrecedence(node) <
				astUtils.getPrecedence({
					type: "UnaryExpression",
					operator: "void",
				}) &&
			// check if there are parentheses around the node to avoid redundant parentheses
			!astUtils.isParenthesised(sourceCode, node);

		// avoid parentheses issues
		const returnOrArrowToken = sourceCode.getTokenBefore(
			node,
			node.parent.type === "ArrowFunctionExpression"
				? astUtils.isArrowToken
				: // isReturnToken
					token => token.type === "Keyword" && token.value === "return",
		);

		const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);

		const prependSpace =
			// is return token, as => allows void to be adjacent
			returnOrArrowToken.value === "return" &&
			// If two tokens (return and "(") are adjacent
			returnOrArrowToken.range[1] === firstToken.range[0];

		return [
			fixer.insertTextBefore(
				firstToken,
				`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
			),
			fixer.insertTextAfter(node, requiresParens ? ")" : ""),
		];
	}

	/**
	 * Fixes the linting error by `wrapping {}` around the given node's body.
	 * @param {Object} sourceCode context given by context.sourceCode
	 * @param {ASTNode} node The node to fix.
	 * @param {Object} fixer The fixer object provided by ESLint.
	 * @returns {Array<Object>} - An array of fix objects to apply to the node.
	 */
	function curlyWrapFixer(sourceCode, node, fixer) {
		// https://github.com/eslint/eslint/pull/17282#issuecomment-1592795923
		const arrowToken = sourceCode.getTokenBefore(
			node.body,
			astUtils.isArrowToken,
		);
		const firstToken = sourceCode.getTokenAfter(arrowToken);
		const lastToken = sourceCode.getLastToken(node);

		return [
			fixer.insertTextBefore(firstToken, "{"),
			fixer.insertTextAfter(lastToken, "}"),
		];
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noPromiseExecutorReturn = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowVoid: false,
				},
			],

			docs: {
				description:
					"Disallow returning values from Promise executor functions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-promise-executor-return",
			},

			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						allowVoid: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				returnsValue:
					"Return values from promise executor functions cannot be read.",

				// arrow and function suggestions
				prependVoid: "Prepend `void` to the expression.",

				// only arrow suggestions
				wrapBraces: "Wrap the expression in `{}`.",
			},
		},

		create(context) {
			let funcInfo = null;
			const sourceCode = context.sourceCode;
			const [{ allowVoid }] = context.options;

			return {
				onCodePathStart(_, node) {
					funcInfo = {
						upper: funcInfo,
						shouldCheck:
							functionTypesToCheck.has(node.type) &&
							isPromiseExecutor(node, sourceCode.getScope(node)),
					};

					if (
						// Is a Promise executor
						funcInfo.shouldCheck &&
						node.type === "ArrowFunctionExpression" &&
						node.expression &&
						// Except void
						!(allowVoid && expressionIsVoid(node.body))
					) {
						const suggest = [];

						// prevent useless refactors
						if (allowVoid) {
							suggest.push({
								messageId: "prependVoid",
								fix(fixer) {
									return voidPrependFixer(
										sourceCode,
										node.body,
										fixer,
									);
								},
							});
						}

						// Do not suggest wrapping an unnamed FunctionExpression in braces as that would be invalid syntax.
						if (
							!(
								node.body.type === "FunctionExpression" &&
								!node.body.id
							)
						) {
							suggest.push({
								messageId: "wrapBraces",
								fix(fixer) {
									return curlyWrapFixer(sourceCode, node, fixer);
								},
							});
						}

						context.report({
							node: node.body,
							messageId: "returnsValue",
							suggest,
						});
					}
				},

				onCodePathEnd() {
					funcInfo = funcInfo.upper;
				},

				ReturnStatement(node) {
					if (!(funcInfo.shouldCheck && node.argument)) {
						return;
					}

					// node is `return <expression>`
					if (!allowVoid) {
						context.report({ node, messageId: "returnsValue" });
						return;
					}

					if (expressionIsVoid(node.argument)) {
						return;
					}

					// allowVoid && !expressionIsVoid
					context.report({
						node,
						messageId: "returnsValue",
						suggest: [
							{
								messageId: "prependVoid",
								fix(fixer) {
									return voidPrependFixer(
										sourceCode,
										node.argument,
										fixer,
									);
								},
							},
						],
					});
				},
			};
		},
	};
	return noPromiseExecutorReturn;
}

/**
 * @fileoverview Rule to flag usage of __proto__ property
 * @author Ilya Volodin
 */

var noProto;
var hasRequiredNoProto;

function requireNoProto () {
	if (hasRequiredNoProto) return noProto;
	hasRequiredNoProto = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const { getStaticPropertyName } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noProto = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow the use of the `__proto__` property",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-proto",
			},

			schema: [],

			messages: {
				unexpectedProto: "The '__proto__' property is deprecated.",
			},
		},

		create(context) {
			return {
				MemberExpression(node) {
					if (getStaticPropertyName(node) === "__proto__") {
						context.report({ node, messageId: "unexpectedProto" });
					}
				},
			};
		},
	};
	return noProto;
}

/**
 * @fileoverview Rule to disallow use of Object.prototype builtins on objects
 * @author Andrew Levine
 */

var noPrototypeBuiltins;
var hasRequiredNoPrototypeBuiltins;

function requireNoPrototypeBuiltins () {
	if (hasRequiredNoPrototypeBuiltins) return noPrototypeBuiltins;
	hasRequiredNoPrototypeBuiltins = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Returns true if the node or any of the objects
	 * to the left of it in the member/call chain is optional.
	 *
	 * e.g. `a?.b`, `a?.b.c`, `a?.()`, `a()?.()`
	 * @param {ASTNode} node The expression to check
	 * @returns {boolean} `true` if there is a short-circuiting optional `?.`
	 * in the same option chain to the left of this call or member expression,
	 * or the node itself is an optional call or member `?.`.
	 */
	function isAfterOptional(node) {
		let leftNode;

		if (node.type === "MemberExpression") {
			leftNode = node.object;
		} else if (node.type === "CallExpression") {
			leftNode = node.callee;
		} else {
			return false;
		}
		if (node.optional) {
			return true;
		}
		return isAfterOptional(leftNode);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noPrototypeBuiltins = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow calling some `Object.prototype` methods directly on objects",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-prototype-builtins",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				prototypeBuildIn:
					"Do not access Object.prototype method '{{prop}}' from target object.",
				callObjectPrototype: "Call Object.prototype.{{prop}} explicitly.",
			},
		},

		create(context) {
			const DISALLOWED_PROPS = new Set([
				"hasOwnProperty",
				"isPrototypeOf",
				"propertyIsEnumerable",
			]);

			/**
			 * Reports if a disallowed property is used in a CallExpression
			 * @param {ASTNode} node The CallExpression node.
			 * @returns {void}
			 */
			function disallowBuiltIns(node) {
				const callee = astUtils.skipChainExpression(node.callee);

				if (callee.type !== "MemberExpression") {
					return;
				}

				const propName = astUtils.getStaticPropertyName(callee);

				if (propName !== null && DISALLOWED_PROPS.has(propName)) {
					context.report({
						messageId: "prototypeBuildIn",
						loc: callee.property.loc,
						data: { prop: propName },
						node,
						suggest: [
							{
								messageId: "callObjectPrototype",
								data: { prop: propName },
								fix(fixer) {
									const sourceCode = context.sourceCode;

									/*
									 * A call after an optional chain (e.g. a?.b.hasOwnProperty(c))
									 * must be fixed manually because the call can be short-circuited
									 */
									if (isAfterOptional(node)) {
										return null;
									}

									/*
									 * A call on a ChainExpression (e.g. (a?.hasOwnProperty)(c)) will trigger
									 * no-unsafe-optional-chaining which should be fixed before this suggestion
									 */
									if (node.callee.type === "ChainExpression") {
										return null;
									}

									const objectVariable =
										astUtils.getVariableByName(
											sourceCode.getScope(node),
											"Object",
										);

									/*
									 * We can't use Object if the global Object was shadowed,
									 * or Object does not exist in the global scope for some reason
									 */
									if (
										!objectVariable ||
										objectVariable.scope.type !== "global" ||
										objectVariable.defs.length > 0
									) {
										return null;
									}

									let objectText = sourceCode.getText(
										callee.object,
									);

									if (
										astUtils.getPrecedence(callee.object) <=
										astUtils.getPrecedence({
											type: "SequenceExpression",
										})
									) {
										objectText = `(${objectText})`;
									}

									const openParenToken = sourceCode.getTokenAfter(
										node.callee,
										astUtils.isOpeningParenToken,
									);
									const isEmptyParameters =
										node.arguments.length === 0;
									const delim = isEmptyParameters ? "" : ", ";
									const fixes = [
										fixer.replaceText(
											callee,
											`Object.prototype.${propName}.call`,
										),
										fixer.insertTextAfter(
											openParenToken,
											objectText + delim,
										),
									];

									return fixes;
								},
							},
						],
					});
				}
			}

			return {
				CallExpression: disallowBuiltIns,
			};
		},
	};
	return noPrototypeBuiltins;
}

/**
 * @fileoverview Rule to flag when the same variable is declared more then once.
 * @author Ilya Volodin
 */

var noRedeclare;
var hasRequiredNoRedeclare;

function requireNoRedeclare () {
	if (hasRequiredNoRedeclare) return noRedeclare;
	hasRequiredNoRedeclare = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRedeclare = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ builtinGlobals: true }],

			docs: {
				description: "Disallow variable redeclaration",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-redeclare",
			},

			messages: {
				redeclared: "'{{id}}' is already defined.",
				redeclaredAsBuiltin:
					"'{{id}}' is already defined as a built-in global variable.",
				redeclaredBySyntax:
					"'{{id}}' is already defined by a variable declaration.",
			},

			schema: [
				{
					type: "object",
					properties: {
						builtinGlobals: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],
		},

		create(context) {
			const [{ builtinGlobals }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Iterate declarations of a given variable.
			 * @param {escope.variable} variable The variable object to iterate declarations.
			 * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations.
			 */
			function* iterateDeclarations(variable) {
				if (
					builtinGlobals &&
					(variable.eslintImplicitGlobalSetting === "readonly" ||
						variable.eslintImplicitGlobalSetting === "writable")
				) {
					yield { type: "builtin" };
				}

				for (const id of variable.identifiers) {
					yield { type: "syntax", node: id, loc: id.loc };
				}

				if (variable.eslintExplicitGlobalComments) {
					for (const comment of variable.eslintExplicitGlobalComments) {
						yield {
							type: "comment",
							node: comment,
							loc: astUtils.getNameLocationInGlobalDirectiveComment(
								sourceCode,
								comment,
								variable.name,
							),
						};
					}
				}
			}

			/**
			 * Find variables in a given scope and flag redeclared ones.
			 * @param {Scope} scope An eslint-scope scope object.
			 * @returns {void}
			 * @private
			 */
			function findVariablesInScope(scope) {
				for (const variable of scope.variables) {
					const [declaration, ...extraDeclarations] =
						iterateDeclarations(variable);

					if (extraDeclarations.length === 0) {
						continue;
					}

					/*
					 * If the type of a declaration is different from the type of
					 * the first declaration, it shows the location of the first
					 * declaration.
					 */
					const detailMessageId =
						declaration.type === "builtin"
							? "redeclaredAsBuiltin"
							: "redeclaredBySyntax";
					const data = { id: variable.name };

					// Report extra declarations.
					for (const { type, node, loc } of extraDeclarations) {
						const messageId =
							type === declaration.type
								? "redeclared"
								: detailMessageId;

						context.report({ node, loc, messageId, data });
					}
				}
			}

			/**
			 * Find variables in the current scope.
			 * @param {ASTNode} node The node of the current scope.
			 * @returns {void}
			 * @private
			 */
			function checkForBlock(node) {
				const scope = sourceCode.getScope(node);

				/*
				 * In ES5, some node type such as `BlockStatement` doesn't have that scope.
				 * `scope.block` is a different node in such a case.
				 */
				if (scope.block === node) {
					findVariablesInScope(scope);
				}
			}

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);

					findVariablesInScope(scope);

					// Node.js or ES modules has a special scope.
					if (
						scope.type === "global" &&
						scope.childScopes[0] &&
						// The special scope's block is the Program node.
						scope.block === scope.childScopes[0].block
					) {
						findVariablesInScope(scope.childScopes[0]);
					}
				},

				FunctionDeclaration: checkForBlock,
				FunctionExpression: checkForBlock,
				ArrowFunctionExpression: checkForBlock,

				StaticBlock: checkForBlock,

				BlockStatement: checkForBlock,
				ForStatement: checkForBlock,
				ForInStatement: checkForBlock,
				ForOfStatement: checkForBlock,
				SwitchStatement: checkForBlock,
			};
		},
	};
	return noRedeclare;
}

/**
 * @fileoverview Rule to count multiple spaces in regular expressions
 * @author Matt DuVall <http://www.mattduvall.com/>
 */

var noRegexSpaces;
var hasRequiredNoRegexSpaces;

function requireNoRegexSpaces () {
	if (hasRequiredNoRegexSpaces) return noRegexSpaces;
	hasRequiredNoRegexSpaces = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const regexpp = requireRegexpp();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const regExpParser = new regexpp.RegExpParser();
	const DOUBLE_SPACE = / {2}/u;

	/**
	 * Check if node is a string
	 * @param {ASTNode} node node to evaluate
	 * @returns {boolean} True if its a string
	 * @private
	 */
	function isString(node) {
		return node && node.type === "Literal" && typeof node.value === "string";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRegexSpaces = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow multiple spaces in regular expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-regex-spaces",
			},

			schema: [],
			fixable: "code",

			messages: {
				multipleSpaces: "Spaces are hard to count. Use {{{length}}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Validate regular expression
			 * @param {ASTNode} nodeToReport Node to report.
			 * @param {string} pattern Regular expression pattern to validate.
			 * @param {string} rawPattern Raw representation of the pattern in the source code.
			 * @param {number} rawPatternStartRange Start range of the pattern in the source code.
			 * @param {string} flags Regular expression flags.
			 * @returns {void}
			 * @private
			 */
			function checkRegex(
				nodeToReport,
				pattern,
				rawPattern,
				rawPatternStartRange,
				flags,
			) {
				// Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ ').
				if (!DOUBLE_SPACE.test(rawPattern)) {
					return;
				}

				const characterClassNodes = [];
				let regExpAST;

				try {
					regExpAST = regExpParser.parsePattern(
						pattern,
						0,
						pattern.length,
						{
							unicode: flags.includes("u"),
							unicodeSets: flags.includes("v"),
						},
					);
				} catch {
					// Ignore regular expressions with syntax errors
					return;
				}

				regexpp.visitRegExpAST(regExpAST, {
					onCharacterClassEnter(ccNode) {
						characterClassNodes.push(ccNode);
					},
				});

				const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu;
				let match;

				while ((match = spacesPattern.exec(pattern))) {
					const {
						1: { length },
						index,
					} = match;

					// Report only consecutive spaces that are not in character classes.
					if (
						characterClassNodes.every(
							({ start, end }) => index < start || end <= index,
						)
					) {
						context.report({
							node: nodeToReport,
							messageId: "multipleSpaces",
							data: { length },
							fix(fixer) {
								if (pattern !== rawPattern) {
									return null;
								}
								return fixer.replaceTextRange(
									[
										rawPatternStartRange + index,
										rawPatternStartRange + index + length,
									],
									` {${length}}`,
								);
							},
						});

						// Report only the first occurrence of consecutive spaces
						return;
					}
				}
			}

			/**
			 * Validate regular expression literals
			 * @param {ASTNode} node node to validate
			 * @returns {void}
			 * @private
			 */
			function checkLiteral(node) {
				if (node.regex) {
					const pattern = node.regex.pattern;
					const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/"));
					const rawPatternStartRange = node.range[0] + 1;
					const flags = node.regex.flags;

					checkRegex(
						node,
						pattern,
						rawPattern,
						rawPatternStartRange,
						flags,
					);
				}
			}

			/**
			 * Validate strings passed to the RegExp constructor
			 * @param {ASTNode} node node to validate
			 * @returns {void}
			 * @private
			 */
			function checkFunction(node) {
				const scope = sourceCode.getScope(node);
				const regExpVar = astUtils.getVariableByName(scope, "RegExp");
				const shadowed = regExpVar && regExpVar.defs.length > 0;
				const patternNode = node.arguments[0];

				if (
					node.callee.type === "Identifier" &&
					node.callee.name === "RegExp" &&
					isString(patternNode) &&
					!shadowed
				) {
					const pattern = patternNode.value;
					const rawPattern = patternNode.raw.slice(1, -1);
					const rawPatternStartRange = patternNode.range[0] + 1;
					let flags;

					if (node.arguments.length < 2) {
						// It has no flags.
						flags = "";
					} else {
						const flagsNode = node.arguments[1];

						if (isString(flagsNode)) {
							flags = flagsNode.value;
						} else {
							// The flags cannot be determined.
							return;
						}
					}

					checkRegex(
						node,
						pattern,
						rawPattern,
						rawPatternStartRange,
						flags,
					);
				}
			}

			return {
				Literal: checkLiteral,
				CallExpression: checkFunction,
				NewExpression: checkFunction,
			};
		},
	};
	return noRegexSpaces;
}

/**
 * @fileoverview Rule to disallow specified names in exports
 * @author Milos Djermanovic
 */

var noRestrictedExports;
var hasRequiredNoRestrictedExports;

function requireNoRestrictedExports () {
	if (hasRequiredNoRestrictedExports) return noRestrictedExports;
	hasRequiredNoRestrictedExports = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRestrictedExports = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow specified names in exports",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-exports",
			},

			schema: [
				{
					anyOf: [
						{
							type: "object",
							properties: {
								restrictedNamedExports: {
									type: "array",
									items: {
										type: "string",
									},
									uniqueItems: true,
								},
								restrictedNamedExportsPattern: { type: "string" },
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								restrictedNamedExports: {
									type: "array",
									items: {
										type: "string",
										pattern: "^(?!default$)",
									},
									uniqueItems: true,
								},
								restrictedNamedExportsPattern: { type: "string" },
								restrictDefaultExports: {
									type: "object",
									properties: {
										// Allow/Disallow `export default foo; export default 42; export default function foo() {}` format
										direct: {
											type: "boolean",
										},

										// Allow/Disallow `export { foo as default };` declarations
										named: {
											type: "boolean",
										},

										//  Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations
										defaultFrom: {
											type: "boolean",
										},

										//  Allow/Disallow `export { foo as default } from "mod";` declarations
										namedFrom: {
											type: "boolean",
										},

										//  Allow/Disallow `export * as default from "mod"`; declarations
										namespaceFrom: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				restrictedNamed:
					"'{{name}}' is restricted from being used as an exported name.",
				restrictedDefault: "Exporting 'default' is restricted.",
			},
		},

		create(context) {
			const restrictedNames = new Set(
				context.options[0] && context.options[0].restrictedNamedExports,
			);
			const restrictedNamePattern =
				context.options[0] &&
				context.options[0].restrictedNamedExportsPattern;
			const restrictDefaultExports =
				context.options[0] && context.options[0].restrictDefaultExports;
			const sourceCode = context.sourceCode;

			/**
			 * Checks and reports given exported name.
			 * @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
			 * @returns {void}
			 */
			function checkExportedName(node) {
				const name = astUtils.getModuleExportName(node);

				let matchesRestrictedNamePattern = false;

				if (restrictedNamePattern && name !== "default") {
					const patternRegex = new RegExp(restrictedNamePattern, "u");

					matchesRestrictedNamePattern = patternRegex.test(name);
				}

				if (matchesRestrictedNamePattern || restrictedNames.has(name)) {
					context.report({
						node,
						messageId: "restrictedNamed",
						data: { name },
					});
					return;
				}

				if (name === "default") {
					if (node.parent.type === "ExportAllDeclaration") {
						if (
							restrictDefaultExports &&
							restrictDefaultExports.namespaceFrom
						) {
							context.report({
								node,
								messageId: "restrictedDefault",
							});
						}
					} else {
						// ExportSpecifier
						const isSourceSpecified = !!node.parent.parent.source;
						const specifierLocalName = astUtils.getModuleExportName(
							node.parent.local,
						);

						if (
							!isSourceSpecified &&
							restrictDefaultExports &&
							restrictDefaultExports.named
						) {
							context.report({
								node,
								messageId: "restrictedDefault",
							});
							return;
						}

						if (isSourceSpecified && restrictDefaultExports) {
							if (
								(specifierLocalName === "default" &&
									restrictDefaultExports.defaultFrom) ||
								(specifierLocalName !== "default" &&
									restrictDefaultExports.namedFrom)
							) {
								context.report({
									node,
									messageId: "restrictedDefault",
								});
							}
						}
					}
				}
			}

			return {
				ExportAllDeclaration(node) {
					if (node.exported) {
						checkExportedName(node.exported);
					}
				},

				ExportDefaultDeclaration(node) {
					if (restrictDefaultExports && restrictDefaultExports.direct) {
						context.report({
							node,
							messageId: "restrictedDefault",
						});
					}
				},

				ExportNamedDeclaration(node) {
					const declaration = node.declaration;

					if (declaration) {
						if (
							declaration.type === "FunctionDeclaration" ||
							declaration.type === "ClassDeclaration"
						) {
							checkExportedName(declaration.id);
						} else if (declaration.type === "VariableDeclaration") {
							sourceCode
								.getDeclaredVariables(declaration)
								.map(v =>
									v.defs.find(d => d.parent === declaration),
								)
								.map(d => d.name) // Identifier nodes
								.forEach(checkExportedName);
						}
					} else {
						node.specifiers
							.map(s => s.exported)
							.forEach(checkExportedName);
					}
				},
			};
		},
	};
	return noRestrictedExports;
}

/**
 * @fileoverview Restrict usage of specified globals.
 * @author Benoît Zugmeyer
 */

var noRestrictedGlobals;
var hasRequiredNoRestrictedGlobals;

function requireNoRestrictedGlobals () {
	if (hasRequiredNoRestrictedGlobals) return noRestrictedGlobals;
	hasRequiredNoRestrictedGlobals = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRestrictedGlobals = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow specified global variables",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-globals",
			},

			schema: {
				type: "array",
				items: {
					oneOf: [
						{
							type: "string",
						},
						{
							type: "object",
							properties: {
								name: { type: "string" },
								message: { type: "string" },
							},
							required: ["name"],
							additionalProperties: false,
						},
					],
				},
				uniqueItems: true,
				minItems: 0,
			},

			messages: {
				defaultMessage: "Unexpected use of '{{name}}'.",
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				customMessage: "Unexpected use of '{{name}}'. {{customMessage}}",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			// If no globals are restricted, we don't need to do anything
			if (context.options.length === 0) {
				return {};
			}

			const restrictedGlobalMessages = context.options.reduce(
				(memo, option) => {
					if (typeof option === "string") {
						memo[option] = null;
					} else {
						memo[option.name] = option.message;
					}

					return memo;
				},
				{},
			);

			/**
			 * Report a variable to be used as a restricted global.
			 * @param {Reference} reference the variable reference
			 * @returns {void}
			 * @private
			 */
			function reportReference(reference) {
				const name = reference.identifier.name,
					customMessage = restrictedGlobalMessages[name],
					messageId = customMessage ? "customMessage" : "defaultMessage";

				context.report({
					node: reference.identifier,
					messageId,
					data: {
						name,
						customMessage,
					},
				});
			}

			/**
			 * Check if the given name is a restricted global name.
			 * @param {string} name name of a variable
			 * @returns {boolean} whether the variable is a restricted global or not
			 * @private
			 */
			function isRestricted(name) {
				return Object.hasOwn(restrictedGlobalMessages, name);
			}

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);

					// Report variables declared elsewhere (ex: variables defined as "global" by eslint)
					scope.variables.forEach(variable => {
						if (!variable.defs.length && isRestricted(variable.name)) {
							variable.references.forEach(reportReference);
						}
					});

					// Report variables not declared at all
					scope.through.forEach(reference => {
						if (isRestricted(reference.identifier.name)) {
							reportReference(reference);
						}
					});
				},
			};
		},
	};
	return noRestrictedGlobals;
}

var ignore;
var hasRequiredIgnore;

function requireIgnore () {
	if (hasRequiredIgnore) return ignore;
	hasRequiredIgnore = 1;
	// A simple implementation of make-array
	function makeArray (subject) {
	  return Array.isArray(subject)
	    ? subject
	    : [subject]
	}

	const EMPTY = '';
	const SPACE = ' ';
	const ESCAPE = '\\';
	const REGEX_TEST_BLANK_LINE = /^\s+$/;
	const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
	const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
	const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
	const REGEX_SPLITALL_CRLF = /\r?\n/g;
	// /foo,
	// ./foo,
	// ../foo,
	// .
	// ..
	const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;

	const SLASH = '/';

	// Do not use ternary expression here, since "istanbul ignore next" is buggy
	let TMP_KEY_IGNORE = 'node-ignore';
	/* istanbul ignore else */
	if (typeof Symbol !== 'undefined') {
	  TMP_KEY_IGNORE = Symbol.for('node-ignore');
	}
	const KEY_IGNORE = TMP_KEY_IGNORE;

	const define = (object, key, value) =>
	  Object.defineProperty(object, key, {value});

	const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;

	const RETURN_FALSE = () => false;

	// Sanitize the range of a regular expression
	// The cases are complicated, see test cases for details
	const sanitizeRange = range => range.replace(
	  REGEX_REGEXP_RANGE,
	  (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)
	    ? match
	    // Invalid range (out of order) which is ok for gitignore rules but
	    //   fatal for JavaScript regular expression, so eliminate it.
	    : EMPTY
	);

	// See fixtures #59
	const cleanRangeBackSlash = slashes => {
	  const {length} = slashes;
	  return slashes.slice(0, length - length % 2)
	};

	// > If the pattern ends with a slash,
	// > it is removed for the purpose of the following description,
	// > but it would only find a match with a directory.
	// > In other words, foo/ will match a directory foo and paths underneath it,
	// > but will not match a regular file or a symbolic link foo
	// >  (this is consistent with the way how pathspec works in general in Git).
	// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
	// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
	//      you could use option `mark: true` with `glob`

	// '`foo/`' should not continue with the '`..`'
	const REPLACERS = [

	  [
	    // remove BOM
	    // TODO:
	    // Other similar zero-width characters?
	    /^\uFEFF/,
	    () => EMPTY
	  ],

	  // > Trailing spaces are ignored unless they are quoted with backslash ("\")
	  [
	    // (a\ ) -> (a )
	    // (a  ) -> (a)
	    // (a ) -> (a)
	    // (a \ ) -> (a  )
	    /((?:\\\\)*?)(\\?\s+)$/,
	    (_, m1, m2) => m1 + (
	      m2.indexOf('\\') === 0
	        ? SPACE
	        : EMPTY
	    )
	  ],

	  // replace (\ ) with ' '
	  // (\ ) -> ' '
	  // (\\ ) -> '\\ '
	  // (\\\ ) -> '\\ '
	  [
	    /(\\+?)\s/g,
	    (_, m1) => {
	      const {length} = m1;
	      return m1.slice(0, length - length % 2) + SPACE
	    }
	  ],

	  // Escape metacharacters
	  // which is written down by users but means special for regular expressions.

	  // > There are 12 characters with special meanings:
	  // > - the backslash \,
	  // > - the caret ^,
	  // > - the dollar sign $,
	  // > - the period or dot .,
	  // > - the vertical bar or pipe symbol |,
	  // > - the question mark ?,
	  // > - the asterisk or star *,
	  // > - the plus sign +,
	  // > - the opening parenthesis (,
	  // > - the closing parenthesis ),
	  // > - and the opening square bracket [,
	  // > - the opening curly brace {,
	  // > These special characters are often called "metacharacters".
	  [
	    /[\\$.|*+(){^]/g,
	    match => `\\${match}`
	  ],

	  [
	    // > a question mark (?) matches a single character
	    /(?!\\)\?/g,
	    () => '[^/]'
	  ],

	  // leading slash
	  [

	    // > A leading slash matches the beginning of the pathname.
	    // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
	    // A leading slash matches the beginning of the pathname
	    /^\//,
	    () => '^'
	  ],

	  // replace special metacharacter slash after the leading slash
	  [
	    /\//g,
	    () => '\\/'
	  ],

	  [
	    // > A leading "**" followed by a slash means match in all directories.
	    // > For example, "**/foo" matches file or directory "foo" anywhere,
	    // > the same as pattern "foo".
	    // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
	    // >   under directory "foo".
	    // Notice that the '*'s have been replaced as '\\*'
	    /^\^*\\\*\\\*\\\//,

	    // '**/foo' <-> 'foo'
	    () => '^(?:.*\\/)?'
	  ],

	  // starting
	  [
	    // there will be no leading '/'
	    //   (which has been replaced by section "leading slash")
	    // If starts with '**', adding a '^' to the regular expression also works
	    /^(?=[^^])/,
	    function startingReplacer () {
	      // If has a slash `/` at the beginning or middle
	      return !/\/(?!$)/.test(this)
	        // > Prior to 2.22.1
	        // > If the pattern does not contain a slash /,
	        // >   Git treats it as a shell glob pattern
	        // Actually, if there is only a trailing slash,
	        //   git also treats it as a shell glob pattern

	        // After 2.22.1 (compatible but clearer)
	        // > If there is a separator at the beginning or middle (or both)
	        // > of the pattern, then the pattern is relative to the directory
	        // > level of the particular .gitignore file itself.
	        // > Otherwise the pattern may also match at any level below
	        // > the .gitignore level.
	        ? '(?:^|\\/)'

	        // > Otherwise, Git treats the pattern as a shell glob suitable for
	        // >   consumption by fnmatch(3)
	        : '^'
	    }
	  ],

	  // two globstars
	  [
	    // Use lookahead assertions so that we could match more than one `'/**'`
	    /\\\/\\\*\\\*(?=\\\/|$)/g,

	    // Zero, one or several directories
	    // should not use '*', or it will be replaced by the next replacer

	    // Check if it is not the last `'/**'`
	    (_, index, str) => index + 6 < str.length

	      // case: /**/
	      // > A slash followed by two consecutive asterisks then a slash matches
	      // >   zero or more directories.
	      // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
	      // '/**/'
	      ? '(?:\\/[^\\/]+)*'

	      // case: /**
	      // > A trailing `"/**"` matches everything inside.

	      // #21: everything inside but it should not include the current folder
	      : '\\/.+'
	  ],

	  // normal intermediate wildcards
	  [
	    // Never replace escaped '*'
	    // ignore rule '\*' will match the path '*'

	    // 'abc.*/' -> go
	    // 'abc.*'  -> skip this rule,
	    //    coz trailing single wildcard will be handed by [trailing wildcard]
	    /(^|[^\\]+)(\\\*)+(?=.+)/g,

	    // '*.js' matches '.js'
	    // '*.js' doesn't match 'abc'
	    (_, p1, p2) => {
	      // 1.
	      // > An asterisk "*" matches anything except a slash.
	      // 2.
	      // > Other consecutive asterisks are considered regular asterisks
	      // > and will match according to the previous rules.
	      const unescaped = p2.replace(/\\\*/g, '[^\\/]*');
	      return p1 + unescaped
	    }
	  ],

	  [
	    // unescape, revert step 3 except for back slash
	    // For example, if a user escape a '\\*',
	    // after step 3, the result will be '\\\\\\*'
	    /\\\\\\(?=[$.|*+(){^])/g,
	    () => ESCAPE
	  ],

	  [
	    // '\\\\' -> '\\'
	    /\\\\/g,
	    () => ESCAPE
	  ],

	  [
	    // > The range notation, e.g. [a-zA-Z],
	    // > can be used to match one of the characters in a range.

	    // `\` is escaped by step 3
	    /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
	    (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE
	      // '\\[bar]' -> '\\\\[bar\\]'
	      ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`
	      : close === ']'
	        ? endEscape.length % 2 === 0
	          // A normal case, and it is a range notation
	          // '[bar]'
	          // '[bar\\\\]'
	          ? `[${sanitizeRange(range)}${endEscape}]`
	          // Invalid range notaton
	          // '[bar\\]' -> '[bar\\\\]'
	          : '[]'
	        : '[]'
	  ],

	  // ending
	  [
	    // 'js' will not match 'js.'
	    // 'ab' will not match 'abc'
	    /(?:[^*])$/,

	    // WTF!
	    // https://git-scm.com/docs/gitignore
	    // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
	    // which re-fixes #24, #38

	    // > If there is a separator at the end of the pattern then the pattern
	    // > will only match directories, otherwise the pattern can match both
	    // > files and directories.

	    // 'js*' will not match 'a.js'
	    // 'js/' will not match 'a.js'
	    // 'js' will match 'a.js' and 'a.js/'
	    match => /\/$/.test(match)
	      // foo/ will not match 'foo'
	      ? `${match}$`
	      // foo matches 'foo' and 'foo/'
	      : `${match}(?=$|\\/$)`
	  ],

	  // trailing wildcard
	  [
	    /(\^|\\\/)?\\\*$/,
	    (_, p1) => {
	      const prefix = p1
	        // '\^':
	        // '/*' does not match EMPTY
	        // '/*' does not match everything

	        // '\\\/':
	        // 'abc/*' does not match 'abc/'
	        ? `${p1}[^/]+`

	        // 'a*' matches 'a'
	        // 'a*' matches 'aa'
	        : '[^/]*';

	      return `${prefix}(?=$|\\/$)`
	    }
	  ],
	];

	// A simple cache, because an ignore rule only has only one certain meaning
	const regexCache = Object.create(null);

	// @param {pattern}
	const makeRegex = (pattern, ignoreCase) => {
	  let source = regexCache[pattern];

	  if (!source) {
	    source = REPLACERS.reduce(
	      (prev, [matcher, replacer]) =>
	        prev.replace(matcher, replacer.bind(pattern)),
	      pattern
	    );
	    regexCache[pattern] = source;
	  }

	  return ignoreCase
	    ? new RegExp(source, 'i')
	    : new RegExp(source)
	};

	const isString = subject => typeof subject === 'string';

	// > A blank line matches no files, so it can serve as a separator for readability.
	const checkPattern = pattern => pattern
	  && isString(pattern)
	  && !REGEX_TEST_BLANK_LINE.test(pattern)
	  && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)

	  // > A line starting with # serves as a comment.
	  && pattern.indexOf('#') !== 0;

	const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF);

	class IgnoreRule {
	  constructor (
	    origin,
	    pattern,
	    negative,
	    regex
	  ) {
	    this.origin = origin;
	    this.pattern = pattern;
	    this.negative = negative;
	    this.regex = regex;
	  }
	}

	const createRule = (pattern, ignoreCase) => {
	  const origin = pattern;
	  let negative = false;

	  // > An optional prefix "!" which negates the pattern;
	  if (pattern.indexOf('!') === 0) {
	    negative = true;
	    pattern = pattern.substr(1);
	  }

	  pattern = pattern
	  // > Put a backslash ("\") in front of the first "!" for patterns that
	  // >   begin with a literal "!", for example, `"\!important!.txt"`.
	  .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
	  // > Put a backslash ("\") in front of the first hash for patterns that
	  // >   begin with a hash.
	  .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');

	  const regex = makeRegex(pattern, ignoreCase);

	  return new IgnoreRule(
	    origin,
	    pattern,
	    negative,
	    regex
	  )
	};

	const throwError = (message, Ctor) => {
	  throw new Ctor(message)
	};

	const checkPath = (path, originalPath, doThrow) => {
	  if (!isString(path)) {
	    return doThrow(
	      `path must be a string, but got \`${originalPath}\``,
	      TypeError
	    )
	  }

	  // We don't know if we should ignore EMPTY, so throw
	  if (!path) {
	    return doThrow(`path must not be empty`, TypeError)
	  }

	  // Check if it is a relative path
	  if (checkPath.isNotRelative(path)) {
	    const r = '`path.relative()`d';
	    return doThrow(
	      `path should be a ${r} string, but got "${originalPath}"`,
	      RangeError
	    )
	  }

	  return true
	};

	const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path);

	checkPath.isNotRelative = isNotRelative;
	checkPath.convert = p => p;

	class Ignore {
	  constructor ({
	    ignorecase = true,
	    ignoreCase = ignorecase,
	    allowRelativePaths = false
	  } = {}) {
	    define(this, KEY_IGNORE, true);

	    this._rules = [];
	    this._ignoreCase = ignoreCase;
	    this._allowRelativePaths = allowRelativePaths;
	    this._initCache();
	  }

	  _initCache () {
	    this._ignoreCache = Object.create(null);
	    this._testCache = Object.create(null);
	  }

	  _addPattern (pattern) {
	    // #32
	    if (pattern && pattern[KEY_IGNORE]) {
	      this._rules = this._rules.concat(pattern._rules);
	      this._added = true;
	      return
	    }

	    if (checkPattern(pattern)) {
	      const rule = createRule(pattern, this._ignoreCase);
	      this._added = true;
	      this._rules.push(rule);
	    }
	  }

	  // @param {Array<string> | string | Ignore} pattern
	  add (pattern) {
	    this._added = false;

	    makeArray(
	      isString(pattern)
	        ? splitPattern(pattern)
	        : pattern
	    ).forEach(this._addPattern, this);

	    // Some rules have just added to the ignore,
	    // making the behavior changed.
	    if (this._added) {
	      this._initCache();
	    }

	    return this
	  }

	  // legacy
	  addPattern (pattern) {
	    return this.add(pattern)
	  }

	  //          |           ignored : unignored
	  // negative |   0:0   |   0:1   |   1:0   |   1:1
	  // -------- | ------- | ------- | ------- | --------
	  //     0    |  TEST   |  TEST   |  SKIP   |    X
	  //     1    |  TESTIF |  SKIP   |  TEST   |    X

	  // - SKIP: always skip
	  // - TEST: always test
	  // - TESTIF: only test if checkUnignored
	  // - X: that never happen

	  // @param {boolean} whether should check if the path is unignored,
	  //   setting `checkUnignored` to `false` could reduce additional
	  //   path matching.

	  // @returns {TestResult} true if a file is ignored
	  _testOne (path, checkUnignored) {
	    let ignored = false;
	    let unignored = false;

	    this._rules.forEach(rule => {
	      const {negative} = rule;
	      if (
	        unignored === negative && ignored !== unignored
	        || negative && !ignored && !unignored && !checkUnignored
	      ) {
	        return
	      }

	      const matched = rule.regex.test(path);

	      if (matched) {
	        ignored = !negative;
	        unignored = negative;
	      }
	    });

	    return {
	      ignored,
	      unignored
	    }
	  }

	  // @returns {TestResult}
	  _test (originalPath, cache, checkUnignored, slices) {
	    const path = originalPath
	      // Supports nullable path
	      && checkPath.convert(originalPath);

	    checkPath(
	      path,
	      originalPath,
	      this._allowRelativePaths
	        ? RETURN_FALSE
	        : throwError
	    );

	    return this._t(path, cache, checkUnignored, slices)
	  }

	  _t (path, cache, checkUnignored, slices) {
	    if (path in cache) {
	      return cache[path]
	    }

	    if (!slices) {
	      // path/to/a.js
	      // ['path', 'to', 'a.js']
	      slices = path.split(SLASH);
	    }

	    slices.pop();

	    // If the path has no parent directory, just test it
	    if (!slices.length) {
	      return cache[path] = this._testOne(path, checkUnignored)
	    }

	    const parent = this._t(
	      slices.join(SLASH) + SLASH,
	      cache,
	      checkUnignored,
	      slices
	    );

	    // If the path contains a parent directory, check the parent first
	    return cache[path] = parent.ignored
	      // > It is not possible to re-include a file if a parent directory of
	      // >   that file is excluded.
	      ? parent
	      : this._testOne(path, checkUnignored)
	  }

	  ignores (path) {
	    return this._test(path, this._ignoreCache, false).ignored
	  }

	  createFilter () {
	    return path => !this.ignores(path)
	  }

	  filter (paths) {
	    return makeArray(paths).filter(this.createFilter())
	  }

	  // @returns {TestResult}
	  test (path) {
	    return this._test(path, this._testCache, true)
	  }
	}

	const factory = options => new Ignore(options);

	const isPathValid = path =>
	  checkPath(path && checkPath.convert(path), path, RETURN_FALSE);

	factory.isPathValid = isPathValid;

	// Fixes typescript
	factory.default = factory;

	ignore = factory;

	// Windows
	// --------------------------------------------------------------
	/* istanbul ignore if */
	if (
	  // Detect `process` so that it can run in browsers.
	  typeof browser$1$1 !== 'undefined'
	  && (
	    browser$1$1.env && browser$1$1.env.IGNORE_TEST_WIN32
	    || browser$1$1.platform === 'win32'
	  )
	) {
	  /* eslint no-control-regex: "off" */
	  const makePosix = str => /^\\\\\?\\/.test(str)
	  || /["<>|\u0000-\u001F]+/u.test(str)
	    ? str
	    : str.replace(/\\/g, '/');

	  checkPath.convert = makePosix;

	  // 'C:\\foo'     <- 'C:\\foo' has been converted to 'C:/'
	  // 'd:\\foo'
	  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
	  checkPath.isNotRelative = path =>
	    REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)
	    || isNotRelative(path);
	}
	return ignore;
}

/**
 * @fileoverview Restrict usage of specified node imports.
 * @author Guy Ellis
 */

var noRestrictedImports;
var hasRequiredNoRestrictedImports;

function requireNoRestrictedImports () {
	if (hasRequiredNoRestrictedImports) return noRestrictedImports;
	hasRequiredNoRestrictedImports = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const ignore = requireIgnore();

	const arrayOfStringsOrObjects = {
		type: "array",
		items: {
			anyOf: [
				{ type: "string" },
				{
					type: "object",
					properties: {
						name: { type: "string" },
						message: {
							type: "string",
							minLength: 1,
						},
						importNames: {
							type: "array",
							items: {
								type: "string",
							},
						},
						allowImportNames: {
							type: "array",
							items: {
								type: "string",
							},
						},
					},
					additionalProperties: false,
					required: ["name"],
					not: { required: ["importNames", "allowImportNames"] },
				},
			],
		},
		uniqueItems: true,
	};

	const arrayOfStringsOrObjectPatterns = {
		anyOf: [
			{
				type: "array",
				items: {
					type: "string",
				},
				uniqueItems: true,
			},
			{
				type: "array",
				items: {
					type: "object",
					properties: {
						importNames: {
							type: "array",
							items: {
								type: "string",
							},
							minItems: 1,
							uniqueItems: true,
						},
						allowImportNames: {
							type: "array",
							items: {
								type: "string",
							},
							minItems: 1,
							uniqueItems: true,
						},
						group: {
							type: "array",
							items: {
								type: "string",
							},
							minItems: 1,
							uniqueItems: true,
						},
						regex: {
							type: "string",
						},
						importNamePattern: {
							type: "string",
						},
						allowImportNamePattern: {
							type: "string",
						},
						message: {
							type: "string",
							minLength: 1,
						},
						caseSensitive: {
							type: "boolean",
						},
					},
					additionalProperties: false,
					not: {
						anyOf: [
							{ required: ["importNames", "allowImportNames"] },
							{
								required: [
									"importNamePattern",
									"allowImportNamePattern",
								],
							},
							{ required: ["importNames", "allowImportNamePattern"] },
							{ required: ["importNamePattern", "allowImportNames"] },
							{
								required: [
									"allowImportNames",
									"allowImportNamePattern",
								],
							},
						],
					},
					oneOf: [{ required: ["group"] }, { required: ["regex"] }],
				},
				uniqueItems: true,
			},
		],
	};

	/** @type {import('../shared/types').Rule} */
	noRestrictedImports = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow specified modules when loaded by `import`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-imports",
			},

			messages: {
				path: "'{{importSource}}' import is restricted from being used.",
				pathWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importSource}}' import is restricted from being used. {{customMessage}}",

				patterns:
					"'{{importSource}}' import is restricted from being used by a pattern.",
				patternWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importSource}}' import is restricted from being used by a pattern. {{customMessage}}",

				patternAndImportName:
					"'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern.",
				patternAndImportNameWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}",

				patternAndEverything:
					"* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern.",

				patternAndEverythingWithRegexImportName:
					"* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used.",
				patternAndEverythingWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}",
				patternAndEverythingWithRegexImportNameAndCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used. {{customMessage}}",

				everything:
					"* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.",
				everythingWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}",

				importName:
					"'{{importName}}' import from '{{importSource}}' is restricted.",
				importNameWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}",

				allowedImportName:
					"'{{importName}}' import from '{{importSource}}' is restricted because only '{{allowedImportNames}}' import(s) is/are allowed.",
				allowedImportNameWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importName}}' import from '{{importSource}}' is restricted because only '{{allowedImportNames}}' import(s) is/are allowed. {{customMessage}}",

				everythingWithAllowImportNames:
					"* import is invalid because only '{{allowedImportNames}}' from '{{importSource}}' is/are allowed.",
				everythingWithAllowImportNamesAndCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"* import is invalid because only '{{allowedImportNames}}' from '{{importSource}}' is/are allowed. {{customMessage}}",

				allowedImportNamePattern:
					"'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'.",
				allowedImportNamePatternWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'. {{customMessage}}",

				everythingWithAllowedImportNamePattern:
					"* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed.",
				everythingWithAllowedImportNamePatternWithCustomMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed. {{customMessage}}",
			},

			schema: {
				anyOf: [
					arrayOfStringsOrObjects,
					{
						type: "array",
						items: [
							{
								type: "object",
								properties: {
									paths: arrayOfStringsOrObjects,
									patterns: arrayOfStringsOrObjectPatterns,
								},
								additionalProperties: false,
							},
						],
						additionalItems: false,
					},
				],
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const options = Array.isArray(context.options) ? context.options : [];
			const isPathAndPatternsObject =
				typeof options[0] === "object" &&
				(Object.hasOwn(options[0], "paths") ||
					Object.hasOwn(options[0], "patterns"));

			const restrictedPaths =
				(isPathAndPatternsObject ? options[0].paths : context.options) ||
				[];
			const groupedRestrictedPaths = restrictedPaths.reduce(
				(memo, importSource) => {
					const path =
						typeof importSource === "string"
							? importSource
							: importSource.name;

					if (!memo[path]) {
						memo[path] = [];
					}

					if (typeof importSource === "string") {
						memo[path].push({});
					} else {
						memo[path].push({
							message: importSource.message,
							importNames: importSource.importNames,
							allowImportNames: importSource.allowImportNames,
						});
					}
					return memo;
				},
				Object.create(null),
			);

			// Handle patterns too, either as strings or groups
			let restrictedPatterns =
				(isPathAndPatternsObject ? options[0].patterns : []) || [];

			// standardize to array of objects if we have an array of strings
			if (
				restrictedPatterns.length > 0 &&
				typeof restrictedPatterns[0] === "string"
			) {
				restrictedPatterns = [{ group: restrictedPatterns }];
			}

			// relative paths are supported for this rule
			const restrictedPatternGroups = restrictedPatterns.map(
				({
					group,
					regex,
					message,
					caseSensitive,
					importNames,
					importNamePattern,
					allowImportNames,
					allowImportNamePattern,
				}) => ({
					...(group
						? {
								matcher: ignore({
									allowRelativePaths: true,
									ignorecase: !caseSensitive,
								}).add(group),
							}
						: {}),
					...(typeof regex === "string"
						? {
								regexMatcher: new RegExp(
									regex,
									caseSensitive ? "u" : "iu",
								),
							}
						: {}),
					customMessage: message,
					importNames,
					importNamePattern,
					allowImportNames,
					allowImportNamePattern,
				}),
			);

			// if no imports are restricted we don't need to check
			if (
				Object.keys(restrictedPaths).length === 0 &&
				restrictedPatternGroups.length === 0
			) {
				return {};
			}

			/**
			 * Report a restricted path.
			 * @param {string} importSource path of the import
			 * @param {Map<string,Object[]>} importNames Map of import names that are being imported
			 * @param {node} node representing the restricted path reference
			 * @returns {void}
			 * @private
			 */
			function checkRestrictedPathAndReport(importSource, importNames, node) {
				if (!Object.hasOwn(groupedRestrictedPaths, importSource)) {
					return;
				}

				groupedRestrictedPaths[importSource].forEach(
					restrictedPathEntry => {
						const customMessage = restrictedPathEntry.message;
						const restrictedImportNames =
							restrictedPathEntry.importNames;
						const allowedImportNames =
							restrictedPathEntry.allowImportNames;

						if (!restrictedImportNames && !allowedImportNames) {
							context.report({
								node,
								messageId: customMessage
									? "pathWithCustomMessage"
									: "path",
								data: {
									importSource,
									customMessage,
								},
							});

							return;
						}

						importNames.forEach((specifiers, importName) => {
							if (importName === "*") {
								const [specifier] = specifiers;

								if (restrictedImportNames) {
									context.report({
										node,
										messageId: customMessage
											? "everythingWithCustomMessage"
											: "everything",
										loc: specifier.loc,
										data: {
											importSource,
											importNames: restrictedImportNames,
											customMessage,
										},
									});
								} else if (allowedImportNames) {
									context.report({
										node,
										messageId: customMessage
											? "everythingWithAllowImportNamesAndCustomMessage"
											: "everythingWithAllowImportNames",
										loc: specifier.loc,
										data: {
											importSource,
											allowedImportNames,
											customMessage,
										},
									});
								}

								return;
							}

							if (
								restrictedImportNames &&
								restrictedImportNames.includes(importName)
							) {
								specifiers.forEach(specifier => {
									context.report({
										node,
										messageId: customMessage
											? "importNameWithCustomMessage"
											: "importName",
										loc: specifier.loc,
										data: {
											importSource,
											customMessage,
											importName,
										},
									});
								});
							}

							if (
								allowedImportNames &&
								!allowedImportNames.includes(importName)
							) {
								specifiers.forEach(specifier => {
									context.report({
										node,
										loc: specifier.loc,
										messageId: customMessage
											? "allowedImportNameWithCustomMessage"
											: "allowedImportName",
										data: {
											importSource,
											customMessage,
											importName,
											allowedImportNames,
										},
									});
								});
							}
						});
					},
				);
			}

			/**
			 * Report a restricted path specifically for patterns.
			 * @param {node} node representing the restricted path reference
			 * @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure,
			 * and any restricted import names that have been specified in the config
			 * @param {Map<string,Object[]>} importNames Map of import names that are being imported
			 * @returns {void}
			 * @private
			 */
			function reportPathForPatterns(node, group, importNames) {
				const importSource = node.source.value.trim();

				const customMessage = group.customMessage;
				const restrictedImportNames = group.importNames;
				const restrictedImportNamePattern = group.importNamePattern
					? new RegExp(group.importNamePattern, "u")
					: null;
				const allowedImportNames = group.allowImportNames;
				const allowedImportNamePattern = group.allowImportNamePattern
					? new RegExp(group.allowImportNamePattern, "u")
					: null;

				/**
				 * If we are not restricting to any specific import names and just the pattern itself,
				 * report the error and move on
				 */
				if (
					!restrictedImportNames &&
					!allowedImportNames &&
					!restrictedImportNamePattern &&
					!allowedImportNamePattern
				) {
					context.report({
						node,
						messageId: customMessage
							? "patternWithCustomMessage"
							: "patterns",
						data: {
							importSource,
							customMessage,
						},
					});
					return;
				}

				importNames.forEach((specifiers, importName) => {
					if (importName === "*") {
						const [specifier] = specifiers;

						if (restrictedImportNames) {
							context.report({
								node,
								messageId: customMessage
									? "patternAndEverythingWithCustomMessage"
									: "patternAndEverything",
								loc: specifier.loc,
								data: {
									importSource,
									importNames: restrictedImportNames,
									customMessage,
								},
							});
						} else if (allowedImportNames) {
							context.report({
								node,
								messageId: customMessage
									? "everythingWithAllowImportNamesAndCustomMessage"
									: "everythingWithAllowImportNames",
								loc: specifier.loc,
								data: {
									importSource,
									allowedImportNames,
									customMessage,
								},
							});
						} else if (allowedImportNamePattern) {
							context.report({
								node,
								messageId: customMessage
									? "everythingWithAllowedImportNamePatternWithCustomMessage"
									: "everythingWithAllowedImportNamePattern",
								loc: specifier.loc,
								data: {
									importSource,
									allowedImportNamePattern,
									customMessage,
								},
							});
						} else {
							context.report({
								node,
								messageId: customMessage
									? "patternAndEverythingWithRegexImportNameAndCustomMessage"
									: "patternAndEverythingWithRegexImportName",
								loc: specifier.loc,
								data: {
									importSource,
									importNames: restrictedImportNamePattern,
									customMessage,
								},
							});
						}

						return;
					}

					if (
						(restrictedImportNames &&
							restrictedImportNames.includes(importName)) ||
						(restrictedImportNamePattern &&
							restrictedImportNamePattern.test(importName))
					) {
						specifiers.forEach(specifier => {
							context.report({
								node,
								messageId: customMessage
									? "patternAndImportNameWithCustomMessage"
									: "patternAndImportName",
								loc: specifier.loc,
								data: {
									importSource,
									customMessage,
									importName,
								},
							});
						});
					}

					if (
						allowedImportNames &&
						!allowedImportNames.includes(importName)
					) {
						specifiers.forEach(specifier => {
							context.report({
								node,
								messageId: customMessage
									? "allowedImportNameWithCustomMessage"
									: "allowedImportName",
								loc: specifier.loc,
								data: {
									importSource,
									customMessage,
									importName,
									allowedImportNames,
								},
							});
						});
					} else if (
						allowedImportNamePattern &&
						!allowedImportNamePattern.test(importName)
					) {
						specifiers.forEach(specifier => {
							context.report({
								node,
								messageId: customMessage
									? "allowedImportNamePatternWithCustomMessage"
									: "allowedImportNamePattern",
								loc: specifier.loc,
								data: {
									importSource,
									customMessage,
									importName,
									allowedImportNamePattern,
								},
							});
						});
					}
				});
			}

			/**
			 * Check if the given importSource is restricted by a pattern.
			 * @param {string} importSource path of the import
			 * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails
			 * @returns {boolean} whether the variable is a restricted pattern or not
			 * @private
			 */
			function isRestrictedPattern(importSource, group) {
				return group.regexMatcher
					? group.regexMatcher.test(importSource)
					: group.matcher.ignores(importSource);
			}

			/**
			 * Checks a node to see if any problems should be reported.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 * @private
			 */
			function checkNode(node) {
				const importSource = node.source.value.trim();
				const importNames = new Map();

				if (node.type === "ExportAllDeclaration") {
					const starToken = sourceCode.getFirstToken(node, 1);

					importNames.set("*", [{ loc: starToken.loc }]);
				} else if (node.specifiers) {
					for (const specifier of node.specifiers) {
						let name;
						const specifierData = { loc: specifier.loc };

						if (specifier.type === "ImportDefaultSpecifier") {
							name = "default";
						} else if (specifier.type === "ImportNamespaceSpecifier") {
							name = "*";
						} else if (specifier.imported) {
							name = astUtils.getModuleExportName(specifier.imported);
						} else if (specifier.local) {
							name = astUtils.getModuleExportName(specifier.local);
						}

						if (typeof name === "string") {
							if (importNames.has(name)) {
								importNames.get(name).push(specifierData);
							} else {
								importNames.set(name, [specifierData]);
							}
						}
					}
				}

				checkRestrictedPathAndReport(importSource, importNames, node);
				restrictedPatternGroups.forEach(group => {
					if (isRestrictedPattern(importSource, group)) {
						reportPathForPatterns(node, group, importNames);
					}
				});
			}

			return {
				ImportDeclaration: checkNode,
				ExportNamedDeclaration(node) {
					if (node.source) {
						checkNode(node);
					}
				},
				ExportAllDeclaration: checkNode,
			};
		},
	};
	return noRestrictedImports;
}

/**
 * @fileoverview Restrict usage of specified node modules.
 * @author Christian Schulz
 * @deprecated in ESLint v7.0.0
 */

var noRestrictedModules;
var hasRequiredNoRestrictedModules;

function requireNoRestrictedModules () {
	if (hasRequiredNoRestrictedModules) return noRestrictedModules;
	hasRequiredNoRestrictedModules = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const ignore = requireIgnore();

	const arrayOfStrings = {
		type: "array",
		items: { type: "string" },
		uniqueItems: true,
	};

	const arrayOfStringsOrObjects = {
		type: "array",
		items: {
			anyOf: [
				{ type: "string" },
				{
					type: "object",
					properties: {
						name: { type: "string" },
						message: {
							type: "string",
							minLength: 1,
						},
					},
					additionalProperties: false,
					required: ["name"],
				},
			],
		},
		uniqueItems: true,
	};

	/** @type {import('../shared/types').Rule} */
	noRestrictedModules = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-restricted-require",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-restricted-require.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow specified modules when loaded by `require`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-modules",
			},

			schema: {
				anyOf: [
					arrayOfStringsOrObjects,
					{
						type: "array",
						items: {
							type: "object",
							properties: {
								paths: arrayOfStringsOrObjects,
								patterns: arrayOfStrings,
							},
							additionalProperties: false,
						},
						additionalItems: false,
					},
				],
			},

			messages: {
				defaultMessage: "'{{name}}' module is restricted from being used.",
				customMessage:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{name}}' module is restricted from being used. {{customMessage}}",
				patternMessage:
					"'{{name}}' module is restricted from being used by a pattern.",
			},
		},

		create(context) {
			const options = Array.isArray(context.options) ? context.options : [];
			const isPathAndPatternsObject =
				typeof options[0] === "object" &&
				(Object.hasOwn(options[0], "paths") ||
					Object.hasOwn(options[0], "patterns"));

			const restrictedPaths =
				(isPathAndPatternsObject ? options[0].paths : context.options) ||
				[];
			const restrictedPatterns =
				(isPathAndPatternsObject ? options[0].patterns : []) || [];

			const restrictedPathMessages = restrictedPaths.reduce(
				(memo, importName) => {
					if (typeof importName === "string") {
						memo[importName] = null;
					} else {
						memo[importName.name] = importName.message;
					}
					return memo;
				},
				{},
			);

			// if no imports are restricted we don't need to check
			if (
				Object.keys(restrictedPaths).length === 0 &&
				restrictedPatterns.length === 0
			) {
				return {};
			}

			// relative paths are supported for this rule
			const ig = ignore({ allowRelativePaths: true }).add(restrictedPatterns);

			/**
			 * Function to check if a node is a string literal.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} If the node is a string literal.
			 */
			function isStringLiteral(node) {
				return (
					node &&
					node.type === "Literal" &&
					typeof node.value === "string"
				);
			}

			/**
			 * Function to check if a node is a require call.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} If the node is a require call.
			 */
			function isRequireCall(node) {
				return (
					node.callee.type === "Identifier" &&
					node.callee.name === "require"
				);
			}

			/**
			 * Extract string from Literal or TemplateLiteral node
			 * @param {ASTNode} node The node to extract from
			 * @returns {string|null} Extracted string or null if node doesn't represent a string
			 */
			function getFirstArgumentString(node) {
				if (isStringLiteral(node)) {
					return node.value.trim();
				}

				if (astUtils.isStaticTemplateLiteral(node)) {
					return node.quasis[0].value.cooked.trim();
				}

				return null;
			}

			/**
			 * Report a restricted path.
			 * @param {node} node representing the restricted path reference
			 * @param {string} name restricted path
			 * @returns {void}
			 * @private
			 */
			function reportPath(node, name) {
				const customMessage = restrictedPathMessages[name];
				const messageId = customMessage
					? "customMessage"
					: "defaultMessage";

				context.report({
					node,
					messageId,
					data: {
						name,
						customMessage,
					},
				});
			}

			/**
			 * Check if the given name is a restricted path name
			 * @param {string} name name of a variable
			 * @returns {boolean} whether the variable is a restricted path or not
			 * @private
			 */
			function isRestrictedPath(name) {
				return Object.hasOwn(restrictedPathMessages, name);
			}

			return {
				CallExpression(node) {
					if (isRequireCall(node)) {
						// node has arguments
						if (node.arguments.length) {
							const name = getFirstArgumentString(node.arguments[0]);

							// if first argument is a string literal or a static string template literal
							if (name) {
								// check if argument value is in restricted modules array
								if (isRestrictedPath(name)) {
									reportPath(node, name);
								}

								if (
									restrictedPatterns.length > 0 &&
									ig.ignores(name)
								) {
									context.report({
										node,
										messageId: "patternMessage",
										data: { name },
									});
								}
							}
						}
					}
				},
			};
		},
	};
	return noRestrictedModules;
}

/**
 * @fileoverview Rule to disallow certain object properties
 * @author Will Klein & Eli White
 */

var noRestrictedProperties;
var hasRequiredNoRestrictedProperties;

function requireNoRestrictedProperties () {
	if (hasRequiredNoRestrictedProperties) return noRestrictedProperties;
	hasRequiredNoRestrictedProperties = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRestrictedProperties = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow certain properties on certain objects",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-properties",
			},

			schema: {
				type: "array",
				items: {
					anyOf: [
						// `object` and `property` are both optional, but at least one of them must be provided.
						{
							type: "object",
							properties: {
								object: {
									type: "string",
								},
								property: {
									type: "string",
								},
								message: {
									type: "string",
								},
							},
							additionalProperties: false,
							required: ["object"],
						},
						{
							type: "object",
							properties: {
								object: {
									type: "string",
								},
								property: {
									type: "string",
								},
								message: {
									type: "string",
								},
							},
							additionalProperties: false,
							required: ["property"],
						},
					],
				},
				uniqueItems: true,
			},

			messages: {
				restrictedObjectProperty:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}",
				restrictedProperty:
					// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
					"'{{propertyName}}' is restricted from being used.{{message}}",
			},
		},

		create(context) {
			const restrictedCalls = context.options;

			if (restrictedCalls.length === 0) {
				return {};
			}

			const restrictedProperties = new Map();
			const globallyRestrictedObjects = new Map();
			const globallyRestrictedProperties = new Map();

			restrictedCalls.forEach(option => {
				const objectName = option.object;
				const propertyName = option.property;

				if (typeof objectName === "undefined") {
					globallyRestrictedProperties.set(propertyName, {
						message: option.message,
					});
				} else if (typeof propertyName === "undefined") {
					globallyRestrictedObjects.set(objectName, {
						message: option.message,
					});
				} else {
					if (!restrictedProperties.has(objectName)) {
						restrictedProperties.set(objectName, new Map());
					}

					restrictedProperties.get(objectName).set(propertyName, {
						message: option.message,
					});
				}
			});

			/**
			 * Checks to see whether a property access is restricted, and reports it if so.
			 * @param {ASTNode} node The node to report
			 * @param {string} objectName The name of the object
			 * @param {string} propertyName The name of the property
			 * @returns {undefined}
			 */
			function checkPropertyAccess(node, objectName, propertyName) {
				if (propertyName === null) {
					return;
				}
				const matchedObject = restrictedProperties.get(objectName);
				const matchedObjectProperty = matchedObject
					? matchedObject.get(propertyName)
					: globallyRestrictedObjects.get(objectName);
				const globalMatchedProperty =
					globallyRestrictedProperties.get(propertyName);

				if (matchedObjectProperty) {
					const message = matchedObjectProperty.message
						? ` ${matchedObjectProperty.message}`
						: "";

					context.report({
						node,
						messageId: "restrictedObjectProperty",
						data: {
							objectName,
							propertyName,
							message,
						},
					});
				} else if (globalMatchedProperty) {
					const message = globalMatchedProperty.message
						? ` ${globalMatchedProperty.message}`
						: "";

					context.report({
						node,
						messageId: "restrictedProperty",
						data: {
							propertyName,
							message,
						},
					});
				}
			}

			return {
				MemberExpression(node) {
					checkPropertyAccess(
						node,
						node.object && node.object.name,
						astUtils.getStaticPropertyName(node),
					);
				},
				ObjectPattern(node) {
					let objectName = null;

					if (node.parent.type === "VariableDeclarator") {
						if (
							node.parent.init &&
							node.parent.init.type === "Identifier"
						) {
							objectName = node.parent.init.name;
						}
					} else if (
						node.parent.type === "AssignmentExpression" ||
						node.parent.type === "AssignmentPattern"
					) {
						if (node.parent.right.type === "Identifier") {
							objectName = node.parent.right.name;
						}
					}

					node.properties.forEach(property => {
						checkPropertyAccess(
							node,
							objectName,
							astUtils.getStaticPropertyName(property),
						);
					});
				},
			};
		},
	};
	return noRestrictedProperties;
}

/**
 * @fileoverview Rule to flag use of certain node types
 * @author Burak Yigit Kaya
 */

var noRestrictedSyntax;
var hasRequiredNoRestrictedSyntax;

function requireNoRestrictedSyntax () {
	if (hasRequiredNoRestrictedSyntax) return noRestrictedSyntax;
	hasRequiredNoRestrictedSyntax = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noRestrictedSyntax = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow specified syntax",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-restricted-syntax",
			},

			schema: {
				type: "array",
				items: {
					oneOf: [
						{
							type: "string",
						},
						{
							type: "object",
							properties: {
								selector: { type: "string" },
								message: { type: "string" },
							},
							required: ["selector"],
							additionalProperties: false,
						},
					],
				},
				uniqueItems: true,
				minItems: 0,
			},

			messages: {
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				restrictedSyntax: "{{message}}",
			},
		},

		create(context) {
			return context.options.reduce((result, selectorOrObject) => {
				const isStringFormat = typeof selectorOrObject === "string";
				const hasCustomMessage =
					!isStringFormat && Boolean(selectorOrObject.message);

				const selector = isStringFormat
					? selectorOrObject
					: selectorOrObject.selector;
				const message = hasCustomMessage
					? selectorOrObject.message
					: `Using '${selector}' is not allowed.`;

				return Object.assign(result, {
					[selector](node) {
						context.report({
							node,
							messageId: "restrictedSyntax",
							data: { message },
						});
					},
				});
			}, {});
		},
	};
	return noRestrictedSyntax;
}

/**
 * @fileoverview Rule to flag when return statement contains assignment
 * @author Ilya Volodin
 */

var noReturnAssign;
var hasRequiredNoReturnAssign;

function requireNoReturnAssign () {
	if (hasRequiredNoReturnAssign) return noReturnAssign;
	hasRequiredNoReturnAssign = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SENTINEL_TYPE =
		/^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noReturnAssign = {
		meta: {
			type: "suggestion",

			defaultOptions: ["except-parens"],

			docs: {
				description: "Disallow assignment operators in `return` statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-return-assign",
			},

			schema: [
				{
					enum: ["except-parens", "always"],
				},
			],

			messages: {
				returnAssignment: "Return statement should not contain assignment.",
				arrowAssignment: "Arrow function should not return assignment.",
			},
		},

		create(context) {
			const always = context.options[0] !== "except-parens";
			const sourceCode = context.sourceCode;

			return {
				AssignmentExpression(node) {
					if (!always && astUtils.isParenthesised(sourceCode, node)) {
						return;
					}

					let currentChild = node;
					let parent = currentChild.parent;

					// Find ReturnStatement or ArrowFunctionExpression in ancestors.
					while (parent && !SENTINEL_TYPE.test(parent.type)) {
						currentChild = parent;
						parent = parent.parent;
					}

					// Reports.
					if (parent && parent.type === "ReturnStatement") {
						context.report({
							node: parent,
							messageId: "returnAssignment",
						});
					} else if (
						parent &&
						parent.type === "ArrowFunctionExpression" &&
						parent.body === currentChild
					) {
						context.report({
							node: parent,
							messageId: "arrowAssignment",
						});
					}
				},
			};
		},
	};
	return noReturnAssign;
}

/**
 * @fileoverview Disallows unnecessary `return await`
 * @author Jordan Harband
 * @deprecated in ESLint v8.46.0
 */

var noReturnAwait;
var hasRequiredNoReturnAwait;

function requireNoReturnAwait () {
	if (hasRequiredNoReturnAwait) return noReturnAwait;
	hasRequiredNoReturnAwait = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noReturnAwait = {
		meta: {
			hasSuggestions: true,
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary `return await`",

				recommended: false,

				url: "https://eslint.org/docs/latest/rules/no-return-await",
			},

			fixable: null,

			deprecated: {
				message:
					"The original assumption of the rule no longer holds true because of engine optimization.",
				url: "https://eslint.org/docs/latest/rules/no-return-await",
				deprecatedSince: "8.46.0",
				availableUntil: null,
				replacedBy: [],
			},

			schema: [],

			messages: {
				removeAwait: "Remove redundant `await`.",
				redundantUseOfAwait: "Redundant use of `await` on a return value.",
			},
		},

		create(context) {
			/**
			 * Reports a found unnecessary `await` expression.
			 * @param {ASTNode} node The node representing the `await` expression to report
			 * @returns {void}
			 */
			function reportUnnecessaryAwait(node) {
				context.report({
					node: context.sourceCode.getFirstToken(node),
					loc: node.loc,
					messageId: "redundantUseOfAwait",
					suggest: [
						{
							messageId: "removeAwait",
							fix(fixer) {
								const sourceCode = context.sourceCode;
								const [awaitToken, tokenAfterAwait] =
									sourceCode.getFirstTokens(node, 2);

								const areAwaitAndAwaitedExpressionOnTheSameLine =
									awaitToken.loc.start.line ===
									tokenAfterAwait.loc.start.line;

								if (!areAwaitAndAwaitedExpressionOnTheSameLine) {
									return null;
								}

								const [startOfAwait, endOfAwait] = awaitToken.range;

								const characterAfterAwait =
									sourceCode.text[endOfAwait];
								const trimLength =
									characterAfterAwait === " " ? 1 : 0;

								const range = [
									startOfAwait,
									endOfAwait + trimLength,
								];

								return fixer.removeRange(range);
							},
						},
					],
				});
			}

			/**
			 * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting
			 * this function. For example, a statement in a `try` block will always have an error handler. A statement in
			 * a `catch` block will only have an error handler if there is also a `finally` block.
			 * @param {ASTNode} node A node representing a location where an could be thrown
			 * @returns {boolean} `true` if a thrown error will be caught/handled in this function
			 */
			function hasErrorHandler(node) {
				let ancestor = node;

				while (
					!astUtils.isFunction(ancestor) &&
					ancestor.type !== "Program"
				) {
					if (
						ancestor.parent.type === "TryStatement" &&
						(ancestor === ancestor.parent.block ||
							(ancestor === ancestor.parent.handler &&
								ancestor.parent.finalizer))
					) {
						return true;
					}
					ancestor = ancestor.parent;
				}
				return false;
			}

			/**
			 * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression,
			 * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position.
			 * @param {ASTNode} node A node representing the `await` expression to check
			 * @returns {boolean} The checking result
			 */
			function isInTailCallPosition(node) {
				if (node.parent.type === "ArrowFunctionExpression") {
					return true;
				}
				if (node.parent.type === "ReturnStatement") {
					return !hasErrorHandler(node.parent);
				}
				if (
					node.parent.type === "ConditionalExpression" &&
					(node === node.parent.consequent ||
						node === node.parent.alternate)
				) {
					return isInTailCallPosition(node.parent);
				}
				if (
					node.parent.type === "LogicalExpression" &&
					node === node.parent.right
				) {
					return isInTailCallPosition(node.parent);
				}
				if (
					node.parent.type === "SequenceExpression" &&
					node === node.parent.expressions.at(-1)
				) {
					return isInTailCallPosition(node.parent);
				}
				return false;
			}

			return {
				AwaitExpression(node) {
					if (isInTailCallPosition(node) && !hasErrorHandler(node)) {
						reportUnnecessaryAwait(node);
					}
				},
			};
		},
	};
	return noReturnAwait;
}

/**
 * @fileoverview Rule to disallow `javascript:` URLs
 * @author Ilya Volodin
 */

var noScriptUrl;
var hasRequiredNoScriptUrl;

function requireNoScriptUrl () {
	if (hasRequiredNoScriptUrl) return noScriptUrl;
	hasRequiredNoScriptUrl = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noScriptUrl = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `javascript:` URLs",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-script-url",
			},

			schema: [],

			messages: {
				unexpectedScriptURL: "Script URL is a form of eval.",
			},
		},

		create(context) {
			/**
			 * Check whether a node's static value starts with `javascript:` or not.
			 * And report an error for unexpected script URL.
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function check(node) {
				const value = astUtils.getStaticStringValue(node);

				if (
					typeof value === "string" &&
					value.toLowerCase().indexOf("javascript:") === 0
				) {
					context.report({ node, messageId: "unexpectedScriptURL" });
				}
			}
			return {
				Literal(node) {
					if (node.value && typeof node.value === "string") {
						check(node);
					}
				},
				TemplateLiteral(node) {
					if (
						!(
							node.parent &&
							node.parent.type === "TaggedTemplateExpression"
						)
					) {
						check(node);
					}
				},
			};
		},
	};
	return noScriptUrl;
}

/**
 * @fileoverview Rule to disallow assignments where both sides are exactly the same
 * @author Toru Nagashima
 */

var noSelfAssign;
var hasRequiredNoSelfAssign;

function requireNoSelfAssign () {
	if (hasRequiredNoSelfAssign) return noSelfAssign;
	hasRequiredNoSelfAssign = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SPACES = /\s+/gu;

	/**
	 * Traverses 2 Pattern nodes in parallel, then reports self-assignments.
	 * @param {ASTNode|null} left A left node to traverse. This is a Pattern or
	 *      a Property.
	 * @param {ASTNode|null} right A right node to traverse. This is a Pattern or
	 *      a Property.
	 * @param {boolean} props The flag to check member expressions as well.
	 * @param {Function} report A callback function to report.
	 * @returns {void}
	 */
	function eachSelfAssignment(left, right, props, report) {
		if (!left || !right) ; else if (
			left.type === "Identifier" &&
			right.type === "Identifier" &&
			left.name === right.name
		) {
			report(right);
		} else if (
			left.type === "ArrayPattern" &&
			right.type === "ArrayExpression"
		) {
			const end = Math.min(left.elements.length, right.elements.length);

			for (let i = 0; i < end; ++i) {
				const leftElement = left.elements[i];
				const rightElement = right.elements[i];

				// Avoid cases such as [...a] = [...a, 1]
				if (
					leftElement &&
					leftElement.type === "RestElement" &&
					i < right.elements.length - 1
				) {
					break;
				}

				eachSelfAssignment(leftElement, rightElement, props, report);

				// After a spread element, those indices are unknown.
				if (rightElement && rightElement.type === "SpreadElement") {
					break;
				}
			}
		} else if (left.type === "RestElement" && right.type === "SpreadElement") {
			eachSelfAssignment(left.argument, right.argument, props, report);
		} else if (
			left.type === "ObjectPattern" &&
			right.type === "ObjectExpression" &&
			right.properties.length >= 1
		) {
			/*
			 * Gets the index of the last spread property.
			 * It's possible to overwrite properties followed by it.
			 */
			let startJ = 0;

			for (let i = right.properties.length - 1; i >= 0; --i) {
				const propType = right.properties[i].type;

				if (
					propType === "SpreadElement" ||
					propType === "ExperimentalSpreadProperty"
				) {
					startJ = i + 1;
					break;
				}
			}

			for (let i = 0; i < left.properties.length; ++i) {
				for (let j = startJ; j < right.properties.length; ++j) {
					eachSelfAssignment(
						left.properties[i],
						right.properties[j],
						props,
						report,
					);
				}
			}
		} else if (
			left.type === "Property" &&
			right.type === "Property" &&
			right.kind === "init" &&
			!right.method
		) {
			const leftName = astUtils.getStaticPropertyName(left);

			if (
				leftName !== null &&
				leftName === astUtils.getStaticPropertyName(right)
			) {
				eachSelfAssignment(left.value, right.value, props, report);
			}
		} else if (
			props &&
			astUtils.skipChainExpression(left).type === "MemberExpression" &&
			astUtils.skipChainExpression(right).type === "MemberExpression" &&
			astUtils.isSameReference(left, right)
		) {
			report(right);
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSelfAssign = {
		meta: {
			type: "problem",

			defaultOptions: [{ props: true }],

			docs: {
				description:
					"Disallow assignments where both sides are exactly the same",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-self-assign",
			},

			schema: [
				{
					type: "object",
					properties: {
						props: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				selfAssignment: "'{{name}}' is assigned to itself.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ props }] = context.options;

			/**
			 * Reports a given node as self assignments.
			 * @param {ASTNode} node A node to report. This is an Identifier node.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "selfAssignment",
					data: {
						name: sourceCode.getText(node).replace(SPACES, ""),
					},
				});
			}

			return {
				AssignmentExpression(node) {
					if (["=", "&&=", "||=", "??="].includes(node.operator)) {
						eachSelfAssignment(node.left, node.right, props, report);
					}
				},
			};
		},
	};
	return noSelfAssign;
}

/**
 * @fileoverview Rule to flag comparison where left part is the same as the right
 * part.
 * @author Ilya Volodin
 */

var noSelfCompare;
var hasRequiredNoSelfCompare;

function requireNoSelfCompare () {
	if (hasRequiredNoSelfCompare) return noSelfCompare;
	hasRequiredNoSelfCompare = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSelfCompare = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow comparisons where both sides are exactly the same",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-self-compare",
			},

			schema: [],

			messages: {
				comparingToSelf: "Comparing to itself is potentially pointless.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether two nodes are composed of the same tokens.
			 * @param {ASTNode} nodeA The first node
			 * @param {ASTNode} nodeB The second node
			 * @returns {boolean} true if the nodes have identical token representations
			 */
			function hasSameTokens(nodeA, nodeB) {
				const tokensA = sourceCode.getTokens(nodeA);
				const tokensB = sourceCode.getTokens(nodeB);

				return (
					tokensA.length === tokensB.length &&
					tokensA.every(
						(token, index) =>
							token.type === tokensB[index].type &&
							token.value === tokensB[index].value,
					)
				);
			}

			return {
				BinaryExpression(node) {
					const operators = new Set([
						"===",
						"==",
						"!==",
						"!=",
						">",
						"<",
						">=",
						"<=",
					]);

					if (
						operators.has(node.operator) &&
						hasSameTokens(node.left, node.right)
					) {
						context.report({ node, messageId: "comparingToSelf" });
					}
				},
			};
		},
	};
	return noSelfCompare;
}

/**
 * @fileoverview Rule to flag use of comma operator
 * @author Brandon Mills
 */

var noSequences;
var hasRequiredNoSequences;

function requireNoSequences () {
	if (hasRequiredNoSequences) return noSequences;
	hasRequiredNoSequences = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSequences = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow comma operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-sequences",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowInParentheses: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [
				{
					allowInParentheses: true,
				},
			],

			messages: {
				unexpectedCommaExpression: "Unexpected use of comma operator.",
			},
		},

		create(context) {
			const [{ allowInParentheses }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Parts of the grammar that are required to have parens.
			 */
			const parenthesized = {
				DoWhileStatement: "test",
				IfStatement: "test",
				SwitchStatement: "discriminant",
				WhileStatement: "test",
				WithStatement: "object",
				ArrowFunctionExpression: "body",

				/*
				 * Omitting CallExpression - commas are parsed as argument separators
				 * Omitting NewExpression - commas are parsed as argument separators
				 * Omitting ForInStatement - parts aren't individually parenthesised
				 * Omitting ForStatement - parts aren't individually parenthesised
				 */
			};

			/**
			 * Determines whether a node is required by the grammar to be wrapped in
			 * parens, e.g. the test of an if statement.
			 * @param {ASTNode} node The AST node
			 * @returns {boolean} True if parens around node belong to parent node.
			 */
			function requiresExtraParens(node) {
				return (
					node.parent &&
					parenthesized[node.parent.type] &&
					node === node.parent[parenthesized[node.parent.type]]
				);
			}

			/**
			 * Check if a node is wrapped in parens.
			 * @param {ASTNode} node The AST node
			 * @returns {boolean} True if the node has a paren on each side.
			 */
			function isParenthesised(node) {
				return astUtils.isParenthesised(sourceCode, node);
			}

			/**
			 * Check if a node is wrapped in two levels of parens.
			 * @param {ASTNode} node The AST node
			 * @returns {boolean} True if two parens surround the node on each side.
			 */
			function isParenthesisedTwice(node) {
				const previousToken = sourceCode.getTokenBefore(node, 1),
					nextToken = sourceCode.getTokenAfter(node, 1);

				return (
					isParenthesised(node) &&
					previousToken &&
					nextToken &&
					astUtils.isOpeningParenToken(previousToken) &&
					previousToken.range[1] <= node.range[0] &&
					astUtils.isClosingParenToken(nextToken) &&
					nextToken.range[0] >= node.range[1]
				);
			}

			return {
				SequenceExpression(node) {
					// Always allow sequences in for statement update
					if (
						node.parent.type === "ForStatement" &&
						(node === node.parent.init || node === node.parent.update)
					) {
						return;
					}

					// Wrapping a sequence in extra parens indicates intent
					if (allowInParentheses) {
						if (requiresExtraParens(node)) {
							if (isParenthesisedTwice(node)) {
								return;
							}
						} else {
							if (isParenthesised(node)) {
								return;
							}
						}
					}

					const firstCommaToken = sourceCode.getTokenAfter(
						node.expressions[0],
						astUtils.isCommaToken,
					);

					context.report({
						node,
						loc: firstCommaToken.loc,
						messageId: "unexpectedCommaExpression",
					});
				},
			};
		},
	};
	return noSequences;
}

/**
 * @fileoverview Rule to disallow returning values from setters
 * @author Milos Djermanovic
 */

var noSetterReturn;
var hasRequiredNoSetterReturn;

function requireNoSetterReturn () {
	if (hasRequiredNoSetterReturn) return noSetterReturn;
	hasRequiredNoSetterReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { findVariable } = /*@__PURE__*/ requireEslintUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the given identifier node is a reference to a global variable.
	 * @param {ASTNode} node `Identifier` node to check.
	 * @param {Scope} scope Scope to which the node belongs.
	 * @returns {boolean} True if the identifier is a reference to a global variable.
	 */
	function isGlobalReference(node, scope) {
		const variable = findVariable(scope, node);

		return (
			variable !== null &&
			variable.scope.type === "global" &&
			variable.defs.length === 0
		);
	}

	/**
	 * Determines whether the given node is an argument of the specified global method call, at the given `index` position.
	 * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable.
	 * @param {ASTNode} node The node to check.
	 * @param {Scope} scope Scope to which the node belongs.
	 * @param {string} objectName Name of the global object.
	 * @param {string} methodName Name of the method.
	 * @param {number} index The given position.
	 * @returns {boolean} `true` if the node is argument at the given position.
	 */
	function isArgumentOfGlobalMethodCall(
		node,
		scope,
		objectName,
		methodName,
		index,
	) {
		const callNode = node.parent;

		return (
			callNode.type === "CallExpression" &&
			callNode.arguments[index] === node &&
			astUtils.isSpecificMemberAccess(
				callNode.callee,
				objectName,
				methodName,
			) &&
			isGlobalReference(
				astUtils.skipChainExpression(callNode.callee).object,
				scope,
			)
		);
	}

	/**
	 * Determines whether the given node is used as a property descriptor.
	 * @param {ASTNode} node The node to check.
	 * @param {Scope} scope Scope to which the node belongs.
	 * @returns {boolean} `true` if the node is a property descriptor.
	 */
	function isPropertyDescriptor(node, scope) {
		if (
			isArgumentOfGlobalMethodCall(
				node,
				scope,
				"Object",
				"defineProperty",
				2,
			) ||
			isArgumentOfGlobalMethodCall(
				node,
				scope,
				"Reflect",
				"defineProperty",
				2,
			)
		) {
			return true;
		}

		const parent = node.parent;

		if (parent.type === "Property" && parent.value === node) {
			const grandparent = parent.parent;

			if (
				grandparent.type === "ObjectExpression" &&
				(isArgumentOfGlobalMethodCall(
					grandparent,
					scope,
					"Object",
					"create",
					1,
				) ||
					isArgumentOfGlobalMethodCall(
						grandparent,
						scope,
						"Object",
						"defineProperties",
						1,
					))
			) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Determines whether the given function node is used as a setter function.
	 * @param {ASTNode} node The node to check.
	 * @param {Scope} scope Scope to which the node belongs.
	 * @returns {boolean} `true` if the node is a setter.
	 */
	function isSetter(node, scope) {
		const parent = node.parent;

		if (
			(parent.type === "Property" || parent.type === "MethodDefinition") &&
			parent.kind === "set" &&
			parent.value === node
		) {
			// Setter in an object literal or in a class
			return true;
		}

		if (
			parent.type === "Property" &&
			parent.value === node &&
			astUtils.getStaticPropertyName(parent) === "set" &&
			parent.parent.type === "ObjectExpression" &&
			isPropertyDescriptor(parent.parent, scope)
		) {
			// Setter in a property descriptor
			return true;
		}

		return false;
	}

	/**
	 * Finds function's outer scope.
	 * @param {Scope} scope Function's own scope.
	 * @returns {Scope} Function's outer scope.
	 */
	function getOuterScope(scope) {
		const upper = scope.upper;

		if (upper.type === "function-expression-name") {
			return upper.upper;
		}

		return upper;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSetterReturn = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow returning values from setters",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-setter-return",
			},

			schema: [],

			messages: {
				returnsValue: "Setter cannot return a value.",
			},
		},

		create(context) {
			let funcInfo = null;
			const sourceCode = context.sourceCode;

			/**
			 * Creates and pushes to the stack a function info object for the given function node.
			 * @param {ASTNode} node The function node.
			 * @returns {void}
			 */
			function enterFunction(node) {
				const outerScope = getOuterScope(sourceCode.getScope(node));

				funcInfo = {
					upper: funcInfo,
					isSetter: isSetter(node, outerScope),
				};
			}

			/**
			 * Pops the current function info object from the stack.
			 * @returns {void}
			 */
			function exitFunction() {
				funcInfo = funcInfo.upper;
			}

			/**
			 * Reports the given node.
			 * @param {ASTNode} node Node to report.
			 * @returns {void}
			 */
			function report(node) {
				context.report({ node, messageId: "returnsValue" });
			}

			return {
				/*
				 * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid
				 * false positives, because a ReturnStatement node can belong to a function declaration inside a setter.
				 *
				 * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor,
				 * but that's out of scope for this rule.
				 */
				FunctionDeclaration: enterFunction,
				FunctionExpression: enterFunction,
				ArrowFunctionExpression(node) {
					enterFunction(node);

					if (funcInfo.isSetter && node.expression) {
						// { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement.
						report(node.body);
					}
				},

				"FunctionDeclaration:exit": exitFunction,
				"FunctionExpression:exit": exitFunction,
				"ArrowFunctionExpression:exit": exitFunction,

				ReturnStatement(node) {
					// Global returns (e.g., at the top level of a Node module) don't have `funcInfo`.
					if (funcInfo && funcInfo.isSetter && node.argument) {
						report(node);
					}
				},
			};
		},
	};
	return noSetterReturn;
}

/**
 * @fileoverview Rule to flag on declaring variables already declared in the outer scope
 * @author Ilya Volodin
 */

var noShadow;
var hasRequiredNoShadow;

function requireNoShadow () {
	if (hasRequiredNoShadow) return noShadow;
	hasRequiredNoShadow = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const FUNC_EXPR_NODE_TYPES = new Set([
		"ArrowFunctionExpression",
		"FunctionExpression",
	]);
	const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]);
	const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;
	const SENTINEL_TYPE =
		/^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noShadow = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allow: [],
					builtinGlobals: false,
					hoist: "functions",
					ignoreOnInitialization: false,
				},
			],

			docs: {
				description:
					"Disallow variable declarations from shadowing variables declared in the outer scope",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-shadow",
			},

			schema: [
				{
					type: "object",
					properties: {
						builtinGlobals: { type: "boolean" },
						hoist: { enum: ["all", "functions", "never"] },
						allow: {
							type: "array",
							items: {
								type: "string",
							},
						},
						ignoreOnInitialization: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],

			messages: {
				noShadow:
					"'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.",
				noShadowGlobal: "'{{name}}' is already a global variable.",
			},
		},

		create(context) {
			const [{ builtinGlobals, hoist, allow, ignoreOnInitialization }] =
				context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Checks whether or not a given location is inside of the range of a given node.
			 * @param {ASTNode} node An node to check.
			 * @param {number} location A location to check.
			 * @returns {boolean} `true` if the location is inside of the range of the node.
			 */
			function isInRange(node, location) {
				return (
					node && node.range[0] <= location && location <= node.range[1]
				);
			}

			/**
			 * Searches from the current node through its ancestry to find a matching node.
			 * @param {ASTNode} node a node to get.
			 * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not.
			 * @returns {ASTNode|null} the matching node.
			 */
			function findSelfOrAncestor(node, match) {
				let currentNode = node;

				while (currentNode && !match(currentNode)) {
					currentNode = currentNode.parent;
				}
				return currentNode;
			}

			/**
			 * Finds function's outer scope.
			 * @param {Scope} scope Function's own scope.
			 * @returns {Scope} Function's outer scope.
			 */
			function getOuterScope(scope) {
				const upper = scope.upper;

				if (upper.type === "function-expression-name") {
					return upper.upper;
				}
				return upper;
			}

			/**
			 * Checks if a variable and a shadowedVariable have the same init pattern ancestor.
			 * @param {Object} variable a variable to check.
			 * @param {Object} shadowedVariable a shadowedVariable to check.
			 * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor.
			 */
			function isInitPatternNode(variable, shadowedVariable) {
				const outerDef = shadowedVariable.defs[0];

				if (!outerDef) {
					return false;
				}

				const { variableScope } = variable.scope;

				if (
					!(
						FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) &&
						getOuterScope(variableScope) === shadowedVariable.scope
					)
				) {
					return false;
				}

				const fun = variableScope.block;
				const { parent } = fun;

				const callExpression = findSelfOrAncestor(parent, node =>
					CALL_EXPR_NODE_TYPE.has(node.type),
				);

				if (!callExpression) {
					return false;
				}

				let node = outerDef.name;
				const location = callExpression.range[1];

				while (node) {
					if (node.type === "VariableDeclarator") {
						if (isInRange(node.init, location)) {
							return true;
						}
						if (
							FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
							isInRange(node.parent.parent.right, location)
						) {
							return true;
						}
						break;
					} else if (node.type === "AssignmentPattern") {
						if (isInRange(node.right, location)) {
							return true;
						}
					} else if (SENTINEL_TYPE.test(node.type)) {
						break;
					}

					node = node.parent;
				}

				return false;
			}

			/**
			 * Check if variable name is allowed.
			 * @param {ASTNode} variable The variable to check.
			 * @returns {boolean} Whether or not the variable name is allowed.
			 */
			function isAllowed(variable) {
				return allow.includes(variable.name);
			}

			/**
			 * Checks if a variable of the class name in the class scope of ClassDeclaration.
			 *
			 * ClassDeclaration creates two variables of its name into its outer scope and its class scope.
			 * So we should ignore the variable in the class scope.
			 * @param {Object} variable The variable to check.
			 * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration.
			 */
			function isDuplicatedClassNameVariable(variable) {
				const block = variable.scope.block;

				return (
					block.type === "ClassDeclaration" &&
					block.id === variable.identifiers[0]
				);
			}

			/**
			 * Checks if a variable is inside the initializer of scopeVar.
			 *
			 * To avoid reporting at declarations such as `var a = function a() {};`.
			 * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
			 * @param {Object} variable The variable to check.
			 * @param {Object} scopeVar The scope variable to look for.
			 * @returns {boolean} Whether or not the variable is inside initializer of scopeVar.
			 */
			function isOnInitializer(variable, scopeVar) {
				const outerScope = scopeVar.scope;
				const outerDef = scopeVar.defs[0];
				const outer = outerDef && outerDef.parent && outerDef.parent.range;
				const innerScope = variable.scope;
				const innerDef = variable.defs[0];
				const inner = innerDef && innerDef.name.range;

				return (
					outer &&
					inner &&
					outer[0] < inner[0] &&
					inner[1] < outer[1] &&
					((innerDef.type === "FunctionName" &&
						innerDef.node.type === "FunctionExpression") ||
						innerDef.node.type === "ClassExpression") &&
					outerScope === innerScope.upper
				);
			}

			/**
			 * Get a range of a variable's identifier node.
			 * @param {Object} variable The variable to get.
			 * @returns {Array|undefined} The range of the variable's identifier node.
			 */
			function getNameRange(variable) {
				const def = variable.defs[0];

				return def && def.name.range;
			}

			/**
			 * Get declared line and column of a variable.
			 * @param {eslint-scope.Variable} variable The variable to get.
			 * @returns {Object} The declared line and column of the variable.
			 */
			function getDeclaredLocation(variable) {
				const identifier = variable.identifiers[0];
				let obj;

				if (identifier) {
					obj = {
						global: false,
						line: identifier.loc.start.line,
						column: identifier.loc.start.column + 1,
					};
				} else {
					obj = {
						global: true,
					};
				}
				return obj;
			}

			/**
			 * Checks if a variable is in TDZ of scopeVar.
			 * @param {Object} variable The variable to check.
			 * @param {Object} scopeVar The variable of TDZ.
			 * @returns {boolean} Whether or not the variable is in TDZ of scopeVar.
			 */
			function isInTdz(variable, scopeVar) {
				const outerDef = scopeVar.defs[0];
				const inner = getNameRange(variable);
				const outer = getNameRange(scopeVar);

				return (
					inner &&
					outer &&
					inner[1] < outer[0] &&
					// Excepts FunctionDeclaration if is {"hoist":"function"}.
					(hoist !== "functions" ||
						!outerDef ||
						outerDef.node.type !== "FunctionDeclaration")
				);
			}

			/**
			 * Checks the current context for shadowed variables.
			 * @param {Scope} scope Fixme
			 * @returns {void}
			 */
			function checkForShadows(scope) {
				const variables = scope.variables;

				for (let i = 0; i < variables.length; ++i) {
					const variable = variables[i];

					// Skips "arguments" or variables of a class name in the class scope of ClassDeclaration.
					if (
						variable.identifiers.length === 0 ||
						isDuplicatedClassNameVariable(variable) ||
						isAllowed(variable)
					) {
						continue;
					}

					// Gets shadowed variable.
					const shadowed = astUtils.getVariableByName(
						scope.upper,
						variable.name,
					);

					if (
						shadowed &&
						(shadowed.identifiers.length > 0 ||
							(builtinGlobals && "writeable" in shadowed)) &&
						!isOnInitializer(variable, shadowed) &&
						!(
							ignoreOnInitialization &&
							isInitPatternNode(variable, shadowed)
						) &&
						!(hoist !== "all" && isInTdz(variable, shadowed))
					) {
						const location = getDeclaredLocation(shadowed);
						const messageId = location.global
							? "noShadowGlobal"
							: "noShadow";
						const data = { name: variable.name };

						if (!location.global) {
							data.shadowedLine = location.line;
							data.shadowedColumn = location.column;
						}
						context.report({
							node: variable.identifiers[0],
							messageId,
							data,
						});
					}
				}
			}

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);
					const stack = globalScope.childScopes.slice();

					while (stack.length) {
						const scope = stack.pop();

						stack.push(...scope.childScopes);
						checkForShadows(scope);
					}
				},
			};
		},
	};
	return noShadow;
}

/**
 * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1)
 * @author Michael Ficarra
 */

var noShadowRestrictedNames;
var hasRequiredNoShadowRestrictedNames;

function requireNoShadowRestrictedNames () {
	if (hasRequiredNoShadowRestrictedNames) return noShadowRestrictedNames;
	hasRequiredNoShadowRestrictedNames = 1;

	/**
	 * Determines if a variable safely shadows undefined.
	 * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value
	 * as the global).
	 * @param {eslintScope.Variable} variable The variable to check
	 * @returns {boolean} true if this variable safely shadows `undefined`
	 */
	function safelyShadowsUndefined(variable) {
		return (
			variable.name === "undefined" &&
			variable.references.every(ref => !ref.isWrite()) &&
			variable.defs.every(
				def =>
					def.node.type === "VariableDeclarator" &&
					def.node.init === null,
			)
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noShadowRestrictedNames = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow identifiers from shadowing restricted names",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names",
			},

			schema: [],

			messages: {
				shadowingRestrictedName: "Shadowing of global property '{{name}}'.",
			},
		},

		create(context) {
			const RESTRICTED = new Set([
				"undefined",
				"NaN",
				"Infinity",
				"arguments",
				"eval",
			]);
			const sourceCode = context.sourceCode;

			// Track reported nodes to avoid duplicate reports. For example, on class declarations.
			const reportedNodes = new Set();

			return {
				"VariableDeclaration, :function, CatchClause, ImportDeclaration, ClassDeclaration, ClassExpression"(
					node,
				) {
					for (const variable of sourceCode.getDeclaredVariables(node)) {
						if (
							variable.defs.length > 0 &&
							RESTRICTED.has(variable.name) &&
							!safelyShadowsUndefined(variable)
						) {
							for (const def of variable.defs) {
								const nodeToReport = def.name;

								if (!reportedNodes.has(nodeToReport)) {
									reportedNodes.add(nodeToReport);
									context.report({
										node: nodeToReport,
										messageId: "shadowingRestrictedName",
										data: {
											name: variable.name,
										},
									});
								}
							}
						}
					}
				},
			};
		},
	};
	return noShadowRestrictedNames;
}

/**
 * @fileoverview Rule to check that spaced function application
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v3.3.0
 */

var noSpacedFunc;
var hasRequiredNoSpacedFunc;

function requireNoSpacedFunc () {
	if (hasRequiredNoSpacedFunc) return noSpacedFunc;
	hasRequiredNoSpacedFunc = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSpacedFunc = {
		meta: {
			type: "layout",

			docs: {
				description:
					"Disallow spacing between function identifiers and their applications (deprecated)",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-spaced-func",
			},

			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
				deprecatedSince: "3.3.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "function-call-spacing",
							url: "https://eslint.style/rules/js/function-call-spacing",
						},
					},
				],
			},

			fixable: "whitespace",
			schema: [],

			messages: {
				noSpacedFunction:
					"Unexpected space between function name and paren.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Check if open space is present in a function name
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function detectOpenSpaces(node) {
				const lastCalleeToken = sourceCode.getLastToken(node.callee);
				let prevToken = lastCalleeToken,
					parenToken = sourceCode.getTokenAfter(lastCalleeToken);

				// advances to an open parenthesis.
				while (
					parenToken &&
					parenToken.range[1] < node.range[1] &&
					parenToken.value !== "("
				) {
					prevToken = parenToken;
					parenToken = sourceCode.getTokenAfter(parenToken);
				}

				// look for a space between the callee and the open paren
				if (
					parenToken &&
					parenToken.range[1] < node.range[1] &&
					sourceCode.isSpaceBetweenTokens(prevToken, parenToken)
				) {
					context.report({
						node,
						loc: lastCalleeToken.loc.start,
						messageId: "noSpacedFunction",
						fix(fixer) {
							return fixer.removeRange([
								prevToken.range[1],
								parenToken.range[0],
							]);
						},
					});
				}
			}

			return {
				CallExpression: detectOpenSpaces,
				NewExpression: detectOpenSpaces,
			};
		},
	};
	return noSpacedFunc;
}

/**
 * @fileoverview Disallow sparse arrays
 * @author Nicholas C. Zakas
 */

var noSparseArrays;
var hasRequiredNoSparseArrays;

function requireNoSparseArrays () {
	if (hasRequiredNoSparseArrays) return noSparseArrays;
	hasRequiredNoSparseArrays = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSparseArrays = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow sparse arrays",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-sparse-arrays",
			},

			schema: [],

			messages: {
				unexpectedSparseArray: "Unexpected comma in middle of array.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ArrayExpression(node) {
					if (!node.elements.includes(null)) {
						return;
					}

					const { sourceCode } = context;
					let commaToken;

					for (const [index, element] of node.elements.entries()) {
						if (index === node.elements.length - 1 && element) {
							return;
						}

						commaToken = sourceCode.getTokenAfter(
							element ?? commaToken ?? sourceCode.getFirstToken(node),
							astUtils.isCommaToken,
						);

						if (element) {
							continue;
						}

						context.report({
							node,
							loc: commaToken.loc,
							messageId: "unexpectedSparseArray",
						});
					}
				},
			};
		},
	};
	return noSparseArrays;
}

/**
 * @fileoverview Rule to check for properties whose identifier ends with the string Sync
 * @author Matt DuVall<http://mattduvall.com/>
 * @deprecated in ESLint v7.0.0
 */

var noSync;
var hasRequiredNoSync;

function requireNoSync () {
	if (hasRequiredNoSync) return noSync;
	hasRequiredNoSync = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noSync = {
		meta: {
			deprecated: {
				message: "Node.js rules were moved out of ESLint core.",
				url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
				deprecatedSince: "7.0.0",
				availableUntil: null,
				replacedBy: [
					{
						message:
							"eslint-plugin-n now maintains deprecated Node.js-related rules.",
						plugin: {
							name: "eslint-plugin-n",
							url: "https://github.com/eslint-community/eslint-plugin-n",
						},
						rule: {
							name: "no-sync",
							url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-sync.md",
						},
					},
				],
			},

			type: "suggestion",

			docs: {
				description: "Disallow synchronous methods",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-sync",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowAtRootLevel: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				noSync: "Unexpected sync method: '{{propertyName}}'.",
			},
		},

		create(context) {
			const selector =
				context.options[0] && context.options[0].allowAtRootLevel
					? ":function MemberExpression[property.name=/.*Sync$/]"
					: "MemberExpression[property.name=/.*Sync$/]";

			return {
				[selector](node) {
					context.report({
						node,
						messageId: "noSync",
						data: {
							propertyName: node.property.name,
						},
					});
				},
			};
		},
	};
	return noSync;
}

/**
 * @fileoverview Rule to check for tabs inside a file
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */

var noTabs;
var hasRequiredNoTabs;

function requireNoTabs () {
	if (hasRequiredNoTabs) return noTabs;
	hasRequiredNoTabs = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const tabRegex = /\t+/gu;
	const anyNonWhitespaceRegex = /\S/u;

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noTabs = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-tabs",
							url: "https://eslint.style/rules/js/no-tabs",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow all tabs",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-tabs",
			},
			schema: [
				{
					type: "object",
					properties: {
						allowIndentationTabs: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedTab: "Unexpected tab character.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const allowIndentationTabs =
				context.options &&
				context.options[0] &&
				context.options[0].allowIndentationTabs;

			return {
				Program(node) {
					sourceCode.getLines().forEach((line, index) => {
						let match;

						while ((match = tabRegex.exec(line)) !== null) {
							if (
								allowIndentationTabs &&
								!anyNonWhitespaceRegex.test(
									line.slice(0, match.index),
								)
							) {
								continue;
							}

							context.report({
								node,
								loc: {
									start: {
										line: index + 1,
										column: match.index,
									},
									end: {
										line: index + 1,
										column: match.index + match[0].length,
									},
								},
								messageId: "unexpectedTab",
							});
						}
					});
				},
			};
		},
	};
	return noTabs;
}

/**
 * @fileoverview Warn when using template string syntax in regular strings
 * @author Jeroen Engels
 */

var noTemplateCurlyInString;
var hasRequiredNoTemplateCurlyInString;

function requireNoTemplateCurlyInString () {
	if (hasRequiredNoTemplateCurlyInString) return noTemplateCurlyInString;
	hasRequiredNoTemplateCurlyInString = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noTemplateCurlyInString = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow template literal placeholder syntax in regular strings",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string",
			},

			schema: [],

			messages: {
				unexpectedTemplateExpression:
					"Unexpected template string expression.",
			},
		},

		create(context) {
			const regex = /\$\{[^}]+\}/u;

			return {
				Literal(node) {
					if (typeof node.value === "string" && regex.test(node.value)) {
						context.report({
							node,
							messageId: "unexpectedTemplateExpression",
						});
					}
				},
			};
		},
	};
	return noTemplateCurlyInString;
}

/**
 * @fileoverview Rule to flag use of ternary operators.
 * @author Ian Christian Myers
 */

var noTernary;
var hasRequiredNoTernary;

function requireNoTernary () {
	if (hasRequiredNoTernary) return noTernary;
	hasRequiredNoTernary = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noTernary = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow ternary operators",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-ternary",
			},

			schema: [],

			messages: {
				noTernaryOperator: "Ternary operator used.",
			},
		},

		create(context) {
			return {
				ConditionalExpression(node) {
					context.report({ node, messageId: "noTernaryOperator" });
				},
			};
		},
	};
	return noTernary;
}

/**
 * @fileoverview A rule to disallow using `this`/`super` before `super()`.
 * @author Toru Nagashima
 */

var noThisBeforeSuper;
var hasRequiredNoThisBeforeSuper;

function requireNoThisBeforeSuper () {
	if (hasRequiredNoThisBeforeSuper) return noThisBeforeSuper;
	hasRequiredNoThisBeforeSuper = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a constructor.
	 * @param {ASTNode} node A node to check. This node type is one of
	 *   `Program`, `FunctionDeclaration`, `FunctionExpression`, and
	 *   `ArrowFunctionExpression`.
	 * @returns {boolean} `true` if the node is a constructor.
	 */
	function isConstructorFunction(node) {
		return (
			node.type === "FunctionExpression" &&
			node.parent.type === "MethodDefinition" &&
			node.parent.kind === "constructor"
		);
	}

	/*
	 * Information for each code path segment.
	 * - superCalled:  The flag which shows `super()` called in all code paths.
	 * - invalidNodes: The array of invalid ThisExpression and Super nodes.
	 */
	/**
	 *
	 */
	class SegmentInfo {
		/**
		 * Indicates whether `super()` is called in all code paths.
		 * @type {boolean}
		 */
		superCalled = false;

		/**
		 * The array of invalid ThisExpression and Super nodes.
		 * @type {ASTNode[]}
		 */
		invalidNodes = [];
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noThisBeforeSuper = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow `this`/`super` before calling `super()` in constructors",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-this-before-super",
			},

			schema: [],

			messages: {
				noBeforeSuper: "'{{kind}}' is not allowed before 'super()'.",
			},
		},

		create(context) {
			/*
			 * Information for each constructor.
			 * - upper:      Information of the upper constructor.
			 * - hasExtends: A flag which shows whether the owner class has a valid
			 *   `extends` part.
			 * - scope:      The scope of the owner class.
			 * - codePath:   The code path of this constructor.
			 */
			let funcInfo = null;

			/** @type {Record<string, SegmentInfo>} */
			let segInfoMap = Object.create(null);

			/**
			 * Gets whether or not `super()` is called in a given code path segment.
			 * @param {CodePathSegment} segment A code path segment to get.
			 * @returns {boolean} `true` if `super()` is called.
			 */
			function isCalled(segment) {
				return !segment.reachable || segInfoMap[segment.id]?.superCalled;
			}

			/**
			 * Checks whether or not this is in a constructor.
			 * @returns {boolean} `true` if this is in a constructor.
			 */
			function isInConstructorOfDerivedClass() {
				return Boolean(
					funcInfo && funcInfo.isConstructor && funcInfo.hasExtends,
				);
			}

			/**
			 * Determines if every segment in a set has been called.
			 * @param {Set<CodePathSegment>} segments The segments to search.
			 * @returns {boolean} True if every segment has been called; false otherwise.
			 */
			function isEverySegmentCalled(segments) {
				for (const segment of segments) {
					if (!isCalled(segment)) {
						return false;
					}
				}

				return true;
			}

			/**
			 * Checks whether or not this is before `super()` is called.
			 * @returns {boolean} `true` if this is before `super()` is called.
			 */
			function isBeforeCallOfSuper() {
				return (
					isInConstructorOfDerivedClass() &&
					!isEverySegmentCalled(funcInfo.currentSegments)
				);
			}

			/**
			 * Sets a given node as invalid.
			 * @param {ASTNode} node A node to set as invalid. This is one of
			 *      a ThisExpression and a Super.
			 * @returns {void}
			 */
			function setInvalid(node) {
				const segments = funcInfo.currentSegments;

				for (const segment of segments) {
					if (segment.reachable) {
						segInfoMap[segment.id].invalidNodes.push(node);
					}
				}
			}

			/**
			 * Sets the current segment as `super` was called.
			 * @returns {void}
			 */
			function setSuperCalled() {
				const segments = funcInfo.currentSegments;

				for (const segment of segments) {
					if (segment.reachable) {
						segInfoMap[segment.id].superCalled = true;
					}
				}
			}

			return {
				/**
				 * Adds information of a constructor into the stack.
				 * @param {CodePath} codePath A code path which was started.
				 * @param {ASTNode} node The current node.
				 * @returns {void}
				 */
				onCodePathStart(codePath, node) {
					if (isConstructorFunction(node)) {
						// Class > ClassBody > MethodDefinition > FunctionExpression
						const classNode = node.parent.parent.parent;

						funcInfo = {
							upper: funcInfo,
							isConstructor: true,
							hasExtends: Boolean(
								classNode.superClass &&
									!astUtils.isNullOrUndefined(
										classNode.superClass,
									),
							),
							codePath,
							currentSegments: new Set(),
						};
					} else {
						funcInfo = {
							upper: funcInfo,
							isConstructor: false,
							hasExtends: false,
							codePath,
							currentSegments: new Set(),
						};
					}
				},

				/**
				 * Removes the top of stack item.
				 *
				 * And this traverses all segments of this code path then reports every
				 * invalid node.
				 * @param {CodePath} codePath A code path which was ended.
				 * @returns {void}
				 */
				onCodePathEnd(codePath) {
					const isDerivedClass = funcInfo.hasExtends;

					funcInfo = funcInfo.upper;
					if (!isDerivedClass) {
						return;
					}

					/**
					 * A collection of nodes to avoid duplicate reports.
					 * @type {Set<ASTNode>}
					 */
					const reported = new Set();

					codePath.traverseSegments((segment, controller) => {
						const info = segInfoMap[segment.id];
						const invalidNodes = info.invalidNodes.filter(
							/*
							 * Avoid duplicate reports.
							 * When there is a `finally`, invalidNodes may contain already reported node.
							 */
							node => !reported.has(node),
						);

						for (const invalidNode of invalidNodes) {
							reported.add(invalidNode);

							context.report({
								messageId: "noBeforeSuper",
								node: invalidNode,
								data: {
									kind:
										invalidNode.type === "Super"
											? "super"
											: "this",
								},
							});
						}

						if (info.superCalled) {
							controller.skip();
						}
					});
				},

				/**
				 * Initialize information of a given code path segment.
				 * @param {CodePathSegment} segment A code path segment to initialize.
				 * @returns {void}
				 */
				onCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);

					if (!isInConstructorOfDerivedClass()) {
						return;
					}

					// Initialize info.
					segInfoMap[segment.id] = {
						superCalled:
							segment.prevSegments.length > 0 &&
							segment.prevSegments.every(isCalled),
						invalidNodes: [],
					};
				},

				onUnreachableCodePathSegmentStart(segment) {
					funcInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					funcInfo.currentSegments.delete(segment);
				},

				/**
				 * Update information of the code path segment when a code path was
				 * looped.
				 * @param {CodePathSegment} fromSegment The code path segment of the
				 *      end of a loop.
				 * @param {CodePathSegment} toSegment A code path segment of the head
				 *      of a loop.
				 * @returns {void}
				 */
				onCodePathSegmentLoop(fromSegment, toSegment) {
					if (!isInConstructorOfDerivedClass()) {
						return;
					}

					// Update information inside of the loop.
					funcInfo.codePath.traverseSegments(
						{ first: toSegment, last: fromSegment },
						(segment, controller) => {
							const info =
								segInfoMap[segment.id] ?? new SegmentInfo();

							if (info.superCalled) {
								controller.skip();
							} else if (
								segment.prevSegments.length > 0 &&
								segment.prevSegments.every(isCalled)
							) {
								info.superCalled = true;
							}

							segInfoMap[segment.id] = info;
						},
					);
				},

				/**
				 * Reports if this is before `super()`.
				 * @param {ASTNode} node A target node.
				 * @returns {void}
				 */
				ThisExpression(node) {
					if (isBeforeCallOfSuper()) {
						setInvalid(node);
					}
				},

				/**
				 * Reports if this is before `super()`.
				 * @param {ASTNode} node A target node.
				 * @returns {void}
				 */
				Super(node) {
					if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) {
						setInvalid(node);
					}
				},

				/**
				 * Marks `super()` called.
				 * @param {ASTNode} node A target node.
				 * @returns {void}
				 */
				"CallExpression:exit"(node) {
					if (node.callee.type === "Super" && isBeforeCallOfSuper()) {
						setSuperCalled();
					}
				},

				/**
				 * Resets state.
				 * @returns {void}
				 */
				"Program:exit"() {
					segInfoMap = Object.create(null);
				},
			};
		},
	};
	return noThisBeforeSuper;
}

/**
 * @fileoverview Rule to restrict what can be thrown as an exception.
 * @author Dieter Oberkofler
 */

var noThrowLiteral;
var hasRequiredNoThrowLiteral;

function requireNoThrowLiteral () {
	if (hasRequiredNoThrowLiteral) return noThrowLiteral;
	hasRequiredNoThrowLiteral = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noThrowLiteral = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow throwing literals as exceptions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-throw-literal",
			},

			schema: [],

			messages: {
				object: "Expected an error object to be thrown.",
				undef: "Do not throw undefined.",
			},
		},

		create(context) {
			return {
				ThrowStatement(node) {
					if (!astUtils.couldBeError(node.argument)) {
						context.report({ node, messageId: "object" });
					} else if (node.argument.type === "Identifier") {
						if (node.argument.name === "undefined") {
							context.report({ node, messageId: "undef" });
						}
					}
				},
			};
		},
	};
	return noThrowLiteral;
}

/**
 * @fileoverview Disallow trailing spaces at the end of lines.
 * @author Nodeca Team <https://github.com/nodeca>
 * @deprecated in ESLint v8.53.0
 */

var noTrailingSpaces;
var hasRequiredNoTrailingSpaces;

function requireNoTrailingSpaces () {
	if (hasRequiredNoTrailingSpaces) return noTrailingSpaces;
	hasRequiredNoTrailingSpaces = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noTrailingSpaces = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-trailing-spaces",
							url: "https://eslint.style/rules/js/no-trailing-spaces",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow trailing whitespace at the end of lines",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-trailing-spaces",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						skipBlankLines: {
							type: "boolean",
							default: false,
						},
						ignoreComments: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				trailingSpace: "Trailing spaces not allowed.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]",
				SKIP_BLANK = `^${BLANK_CLASS}*$`,
				NONBLANK = `${BLANK_CLASS}+$`;

			const options = context.options[0] || {},
				skipBlankLines = options.skipBlankLines || false,
				ignoreComments = options.ignoreComments || false;

			/**
			 * Report the error message
			 * @param {ASTNode} node node to report
			 * @param {int[]} location range information
			 * @param {int[]} fixRange Range based on the whole program
			 * @returns {void}
			 */
			function report(node, location, fixRange) {
				/*
				 * Passing node is a bit dirty, because message data will contain big
				 * text in `source`. But... who cares :) ?
				 * One more kludge will not make worse the bloody wizardry of this
				 * plugin.
				 */
				context.report({
					node,
					loc: location,
					messageId: "trailingSpace",
					fix(fixer) {
						return fixer.removeRange(fixRange);
					},
				});
			}

			/**
			 * Given a list of comment nodes, return the line numbers for those comments.
			 * @param {Array} comments An array of comment nodes.
			 * @returns {number[]} An array of line numbers containing comments.
			 */
			function getCommentLineNumbers(comments) {
				const lines = new Set();

				comments.forEach(comment => {
					const endLine =
						comment.type === "Block"
							? comment.loc.end.line - 1
							: comment.loc.end.line;

					for (let i = comment.loc.start.line; i <= endLine; i++) {
						lines.add(i);
					}
				});

				return lines;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: function checkTrailingSpaces(node) {
					/*
					 * Let's hack. Since Espree does not return whitespace nodes,
					 * fetch the source code and do matching via regexps.
					 */

					const re = new RegExp(NONBLANK, "u"),
						skipMatch = new RegExp(SKIP_BLANK, "u"),
						lines = sourceCode.lines,
						linebreaks = sourceCode
							.getText()
							.match(astUtils.createGlobalLinebreakMatcher()),
						comments = sourceCode.getAllComments(),
						commentLineNumbers = getCommentLineNumbers(comments);

					let totalLength = 0;

					for (let i = 0, ii = lines.length; i < ii; i++) {
						const lineNumber = i + 1;

						/*
						 * Always add linebreak length to line length to accommodate for line break (\n or \r\n)
						 * Because during the fix time they also reserve one spot in the array.
						 * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF)
						 */
						const linebreakLength =
							linebreaks && linebreaks[i] ? linebreaks[i].length : 1;
						const lineLength = lines[i].length + linebreakLength;

						const matches = re.exec(lines[i]);

						if (matches) {
							const location = {
								start: {
									line: lineNumber,
									column: matches.index,
								},
								end: {
									line: lineNumber,
									column: lineLength - linebreakLength,
								},
							};

							const rangeStart = totalLength + location.start.column;
							const rangeEnd = totalLength + location.end.column;
							const containingNode =
								sourceCode.getNodeByRangeIndex(rangeStart);

							if (
								containingNode &&
								containingNode.type === "TemplateElement" &&
								rangeStart > containingNode.parent.range[0] &&
								rangeEnd < containingNode.parent.range[1]
							) {
								totalLength += lineLength;
								continue;
							}

							/*
							 * If the line has only whitespace, and skipBlankLines
							 * is true, don't report it
							 */
							if (skipBlankLines && skipMatch.test(lines[i])) {
								totalLength += lineLength;
								continue;
							}

							const fixRange = [rangeStart, rangeEnd];

							if (
								!ignoreComments ||
								!commentLineNumbers.has(lineNumber)
							) {
								report(node, location, fixRange);
							}
						}

						totalLength += lineLength;
					}
				},
			};
		},
	};
	return noTrailingSpaces;
}

/**
 * @fileoverview Rule to flag references to undeclared variables.
 * @author Mark Macdonald
 */

var noUndef;
var hasRequiredNoUndef;

function requireNoUndef () {
	if (hasRequiredNoUndef) return noUndef;
	hasRequiredNoUndef = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks if the given node is the argument of a typeof operator.
	 * @param {ASTNode} node The AST node being checked.
	 * @returns {boolean} Whether or not the node is the argument of a typeof operator.
	 */
	function hasTypeOfOperator(node) {
		const parent = node.parent;

		return parent.type === "UnaryExpression" && parent.operator === "typeof";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUndef = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					typeof: false,
				},
			],

			docs: {
				description:
					"Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-undef",
			},

			schema: [
				{
					type: "object",
					properties: {
						typeof: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				undef: "'{{name}}' is not defined.",
			},
		},

		create(context) {
			const [{ typeof: considerTypeOf }] = context.options;
			const sourceCode = context.sourceCode;

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					globalScope.through.forEach(ref => {
						const identifier = ref.identifier;

						if (!considerTypeOf && hasTypeOfOperator(identifier)) {
							return;
						}

						context.report({
							node: identifier,
							messageId: "undef",
							data: identifier,
						});
					});
				},
			};
		},
	};
	return noUndef;
}

/**
 * @fileoverview Rule to flag when initializing to undefined
 * @author Ilya Volodin
 */

var noUndefInit;
var hasRequiredNoUndefInit;

function requireNoUndefInit () {
	if (hasRequiredNoUndefInit) return noUndefInit;
	hasRequiredNoUndefInit = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUndefInit = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow initializing variables to `undefined`",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-undef-init",
			},

			schema: [],
			fixable: "code",

			messages: {
				unnecessaryUndefinedInit:
					"It's not necessary to initialize '{{name}}' to undefined.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				VariableDeclarator(node) {
					const name = sourceCode.getText(node.id),
						init = node.init && node.init.name,
						scope = sourceCode.getScope(node),
						undefinedVar = astUtils.getVariableByName(
							scope,
							"undefined",
						),
						shadowed = undefinedVar && undefinedVar.defs.length > 0,
						lastToken = sourceCode.getLastToken(node);

					if (
						init === "undefined" &&
						node.parent.kind !== "const" &&
						!shadowed
					) {
						context.report({
							node,
							messageId: "unnecessaryUndefinedInit",
							data: { name },
							fix(fixer) {
								if (node.parent.kind === "var") {
									return null;
								}

								if (
									node.id.type === "ArrayPattern" ||
									node.id.type === "ObjectPattern"
								) {
									// Don't fix destructuring assignment to `undefined`.
									return null;
								}

								if (
									sourceCode.commentsExistBetween(
										node.id,
										lastToken,
									)
								) {
									return null;
								}

								return fixer.removeRange([
									node.id.range[1],
									node.range[1],
								]);
							},
						});
					}
				},
			};
		},
	};
	return noUndefInit;
}

/**
 * @fileoverview Rule to flag references to the undefined variable.
 * @author Michael Ficarra
 */

var noUndefined;
var hasRequiredNoUndefined;

function requireNoUndefined () {
	if (hasRequiredNoUndefined) return noUndefined;
	hasRequiredNoUndefined = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUndefined = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow the use of `undefined` as an identifier",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-undefined",
			},

			schema: [],

			messages: {
				unexpectedUndefined: "Unexpected use of undefined.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Report an invalid "undefined" identifier node.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "unexpectedUndefined",
				});
			}

			/**
			 * Checks the given scope for references to `undefined` and reports
			 * all references found.
			 * @param {eslint-scope.Scope} scope The scope to check.
			 * @returns {void}
			 */
			function checkScope(scope) {
				const undefinedVar = scope.set.get("undefined");

				if (!undefinedVar) {
					return;
				}

				const references = undefinedVar.references;

				const defs = undefinedVar.defs;

				// Report non-initializing references (those are covered in defs below)
				references
					.filter(ref => !ref.init)
					.forEach(ref => report(ref.identifier));

				defs.forEach(def => report(def.name));
			}

			return {
				"Program:exit"(node) {
					const globalScope = sourceCode.getScope(node);

					const stack = [globalScope];

					while (stack.length) {
						const scope = stack.pop();

						stack.push(...scope.childScopes);
						checkScope(scope);
					}
				},
			};
		},
	};
	return noUndefined;
}

/**
 * @fileoverview Rule to flag dangling underscores in variable declarations.
 * @author Matt DuVall <http://www.mattduvall.com>
 */

var noUnderscoreDangle;
var hasRequiredNoUnderscoreDangle;

function requireNoUnderscoreDangle () {
	if (hasRequiredNoUnderscoreDangle) return noUnderscoreDangle;
	hasRequiredNoUnderscoreDangle = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnderscoreDangle = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allow: [],
					allowAfterSuper: false,
					allowAfterThis: false,
					allowAfterThisConstructor: false,
					allowFunctionParams: true,
					allowInArrayDestructuring: true,
					allowInObjectDestructuring: true,
					enforceInClassFields: false,
					enforceInMethodNames: false,
				},
			],

			docs: {
				description: "Disallow dangling underscores in identifiers",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-underscore-dangle",
			},

			schema: [
				{
					type: "object",
					properties: {
						allow: {
							type: "array",
							items: {
								type: "string",
							},
						},
						allowAfterThis: {
							type: "boolean",
						},
						allowAfterSuper: {
							type: "boolean",
						},
						allowAfterThisConstructor: {
							type: "boolean",
						},
						enforceInMethodNames: {
							type: "boolean",
						},
						allowFunctionParams: {
							type: "boolean",
						},
						enforceInClassFields: {
							type: "boolean",
						},
						allowInArrayDestructuring: {
							type: "boolean",
						},
						allowInObjectDestructuring: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedUnderscore:
					"Unexpected dangling '_' in '{{identifier}}'.",
			},
		},

		create(context) {
			const [
				{
					allow,
					allowAfterSuper,
					allowAfterThis,
					allowAfterThisConstructor,
					allowFunctionParams,
					allowInArrayDestructuring,
					allowInObjectDestructuring,
					enforceInClassFields,
					enforceInMethodNames,
				},
			] = context.options;
			const sourceCode = context.sourceCode;

			//-------------------------------------------------------------------------
			// Helpers
			//-------------------------------------------------------------------------

			/**
			 * Check if identifier is present inside the allowed option
			 * @param {string} identifier name of the node
			 * @returns {boolean} true if its is present
			 * @private
			 */
			function isAllowed(identifier) {
				return allow.includes(identifier);
			}

			/**
			 * Check if identifier has a dangling underscore
			 * @param {string} identifier name of the node
			 * @returns {boolean} true if its is present
			 * @private
			 */
			function hasDanglingUnderscore(identifier) {
				const len = identifier.length;

				return (
					identifier !== "_" &&
					(identifier[0] === "_" || identifier[len - 1] === "_")
				);
			}

			/**
			 * Check if identifier is a special case member expression
			 * @param {string} identifier name of the node
			 * @returns {boolean} true if its is a special case
			 * @private
			 */
			function isSpecialCaseIdentifierForMemberExpression(identifier) {
				return identifier === "__proto__";
			}

			/**
			 * Check if identifier is a special case variable expression
			 * @param {string} identifier name of the node
			 * @returns {boolean} true if its is a special case
			 * @private
			 */
			function isSpecialCaseIdentifierInVariableExpression(identifier) {
				// Checks for the underscore library usage here
				return identifier === "_";
			}

			/**
			 * Check if a node is a member reference of this.constructor
			 * @param {ASTNode} node node to evaluate
			 * @returns {boolean} true if it is a reference on this.constructor
			 * @private
			 */
			function isThisConstructorReference(node) {
				return (
					node.object.type === "MemberExpression" &&
					node.object.property.name === "constructor" &&
					node.object.object.type === "ThisExpression"
				);
			}

			/**
			 * Check if function parameter has a dangling underscore.
			 * @param {ASTNode} node function node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInFunctionParameters(node) {
				if (!allowFunctionParams) {
					node.params.forEach(param => {
						const { type } = param;
						let nodeToCheck;

						if (type === "RestElement") {
							nodeToCheck = param.argument;
						} else if (type === "AssignmentPattern") {
							nodeToCheck = param.left;
						} else {
							nodeToCheck = param;
						}

						if (nodeToCheck.type === "Identifier") {
							const identifier = nodeToCheck.name;

							if (
								hasDanglingUnderscore(identifier) &&
								!isAllowed(identifier)
							) {
								context.report({
									node: param,
									messageId: "unexpectedUnderscore",
									data: {
										identifier,
									},
								});
							}
						}
					});
				}
			}

			/**
			 * Check if function has a dangling underscore
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInFunction(node) {
				if (node.type === "FunctionDeclaration" && node.id) {
					const identifier = node.id.name;

					if (
						typeof identifier !== "undefined" &&
						hasDanglingUnderscore(identifier) &&
						!isAllowed(identifier)
					) {
						context.report({
							node,
							messageId: "unexpectedUnderscore",
							data: {
								identifier,
							},
						});
					}
				}
				checkForDanglingUnderscoreInFunctionParameters(node);
			}

			/**
			 * Check if variable expression has a dangling underscore
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInVariableExpression(node) {
				sourceCode.getDeclaredVariables(node).forEach(variable => {
					const definition = variable.defs.find(def => def.node === node);
					const identifierNode = definition.name;
					const identifier = identifierNode.name;
					let parent = identifierNode.parent;

					while (
						![
							"VariableDeclarator",
							"ArrayPattern",
							"ObjectPattern",
						].includes(parent.type)
					) {
						parent = parent.parent;
					}

					if (
						hasDanglingUnderscore(identifier) &&
						!isSpecialCaseIdentifierInVariableExpression(identifier) &&
						!isAllowed(identifier) &&
						!(
							allowInArrayDestructuring &&
							parent.type === "ArrayPattern"
						) &&
						!(
							allowInObjectDestructuring &&
							parent.type === "ObjectPattern"
						)
					) {
						context.report({
							node,
							messageId: "unexpectedUnderscore",
							data: {
								identifier,
							},
						});
					}
				});
			}

			/**
			 * Check if member expression has a dangling underscore
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInMemberExpression(node) {
				const identifier = node.property.name,
					isMemberOfThis = node.object.type === "ThisExpression",
					isMemberOfSuper = node.object.type === "Super",
					isMemberOfThisConstructor = isThisConstructorReference(node);

				if (
					typeof identifier !== "undefined" &&
					hasDanglingUnderscore(identifier) &&
					!(isMemberOfThis && allowAfterThis) &&
					!(isMemberOfSuper && allowAfterSuper) &&
					!(isMemberOfThisConstructor && allowAfterThisConstructor) &&
					!isSpecialCaseIdentifierForMemberExpression(identifier) &&
					!isAllowed(identifier)
				) {
					context.report({
						node,
						messageId: "unexpectedUnderscore",
						data: {
							identifier,
						},
					});
				}
			}

			/**
			 * Check if method declaration or method property has a dangling underscore
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInMethod(node) {
				const identifier = node.key.name;
				const isMethod =
					node.type === "MethodDefinition" ||
					(node.type === "Property" && node.method);

				if (
					typeof identifier !== "undefined" &&
					enforceInMethodNames &&
					isMethod &&
					hasDanglingUnderscore(identifier) &&
					!isAllowed(identifier)
				) {
					context.report({
						node,
						messageId: "unexpectedUnderscore",
						data: {
							identifier:
								node.key.type === "PrivateIdentifier"
									? `#${identifier}`
									: identifier,
						},
					});
				}
			}

			/**
			 * Check if a class field has a dangling underscore
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkForDanglingUnderscoreInClassField(node) {
				const identifier = node.key.name;

				if (
					typeof identifier !== "undefined" &&
					hasDanglingUnderscore(identifier) &&
					enforceInClassFields &&
					!isAllowed(identifier)
				) {
					context.report({
						node,
						messageId: "unexpectedUnderscore",
						data: {
							identifier:
								node.key.type === "PrivateIdentifier"
									? `#${identifier}`
									: identifier,
						},
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				FunctionDeclaration: checkForDanglingUnderscoreInFunction,
				VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
				MemberExpression: checkForDanglingUnderscoreInMemberExpression,
				MethodDefinition: checkForDanglingUnderscoreInMethod,
				PropertyDefinition: checkForDanglingUnderscoreInClassField,
				Property: checkForDanglingUnderscoreInMethod,
				FunctionExpression: checkForDanglingUnderscoreInFunction,
				ArrowFunctionExpression: checkForDanglingUnderscoreInFunction,
			};
		},
	};
	return noUnderscoreDangle;
}

/**
 * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not.
 * @author Glen Mailer
 */

var noUnexpectedMultiline;
var hasRequiredNoUnexpectedMultiline;

function requireNoUnexpectedMultiline () {
	if (hasRequiredNoUnexpectedMultiline) return noUnexpectedMultiline;
	hasRequiredNoUnexpectedMultiline = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnexpectedMultiline = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow confusing multiline expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline",
			},

			schema: [],
			messages: {
				function:
					"Unexpected newline between function and ( of function call.",
				property:
					"Unexpected newline between object and [ of property access.",
				taggedTemplate:
					"Unexpected newline between template tag and template literal.",
				division:
					"Unexpected newline between numerator and division operator.",
			},
		},

		create(context) {
			const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u;

			const sourceCode = context.sourceCode;

			/**
			 * Check to see if there is a newline between the node and the following open bracket
			 * line's expression
			 * @param {ASTNode} node The node to check.
			 * @param {string} messageId The error messageId to use.
			 * @returns {void}
			 * @private
			 */
			function checkForBreakAfter(node, messageId) {
				const openParen = sourceCode.getTokenAfter(
					node,
					astUtils.isNotClosingParenToken,
				);
				const nodeExpressionEnd = sourceCode.getTokenBefore(openParen);

				if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
					context.report({
						node,
						loc: openParen.loc,
						messageId,
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				MemberExpression(node) {
					if (!node.computed || node.optional) {
						return;
					}
					checkForBreakAfter(node.object, "property");
				},

				TaggedTemplateExpression(node) {
					const { quasi } = node;

					// handles common tags, parenthesized tags, and typescript's generic type arguments
					const tokenBefore = sourceCode.getTokenBefore(quasi);

					if (tokenBefore.loc.end.line !== quasi.loc.start.line) {
						context.report({
							node,
							loc: {
								start: quasi.loc.start,
								end: {
									line: quasi.loc.start.line,
									column: quasi.loc.start.column + 1,
								},
							},
							messageId: "taggedTemplate",
						});
					}
				},

				CallExpression(node) {
					if (node.arguments.length === 0 || node.optional) {
						return;
					}
					checkForBreakAfter(node.callee, "function");
				},

				"BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(
					node,
				) {
					const secondSlash = sourceCode.getTokenAfter(
						node,
						token => token.value === "/",
					);
					const tokenAfterOperator =
						sourceCode.getTokenAfter(secondSlash);

					if (
						tokenAfterOperator.type === "Identifier" &&
						REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) &&
						secondSlash.range[1] === tokenAfterOperator.range[0]
					) {
						checkForBreakAfter(node.left, "division");
					}
				},
			};
		},
	};
	return noUnexpectedMultiline;
}

/**
 * @fileoverview Rule to disallow use of unmodified expressions in loop conditions
 * @author Toru Nagashima
 */

var noUnmodifiedLoopCondition;
var hasRequiredNoUnmodifiedLoopCondition;

function requireNoUnmodifiedLoopCondition () {
	if (hasRequiredNoUnmodifiedLoopCondition) return noUnmodifiedLoopCondition;
	hasRequiredNoUnmodifiedLoopCondition = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Traverser = requireTraverser(),
		astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SENTINEL_PATTERN =
		/(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u;
	const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property.
	const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u;
	const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u;
	const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u;

	/**
	 * @typedef {Object} LoopConditionInfo
	 * @property {eslint-scope.Reference} reference - The reference.
	 * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes
	 *      that the reference is belonging to.
	 * @property {Function} isInLoop - The predicate which checks a given reference
	 *      is in this loop.
	 * @property {boolean} modified - The flag that the reference is modified in
	 *      this loop.
	 */

	/**
	 * Checks whether or not a given reference is a write reference.
	 * @param {eslint-scope.Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is a write reference.
	 */
	function isWriteReference(reference) {
		if (reference.init) {
			const def = reference.resolved && reference.resolved.defs[0];

			if (!def || def.type !== "Variable" || def.parent.kind !== "var") {
				return false;
			}
		}
		return reference.isWrite();
	}

	/**
	 * Checks whether or not a given loop condition info does not have the modified
	 * flag.
	 * @param {LoopConditionInfo} condition A loop condition info to check.
	 * @returns {boolean} `true` if the loop condition info is "unmodified".
	 */
	function isUnmodified(condition) {
		return !condition.modified;
	}

	/**
	 * Checks whether or not a given loop condition info does not have the modified
	 * flag and does not have the group this condition belongs to.
	 * @param {LoopConditionInfo} condition A loop condition info to check.
	 * @returns {boolean} `true` if the loop condition info is "unmodified".
	 */
	function isUnmodifiedAndNotBelongToGroup(condition) {
		return !(condition.modified || condition.group);
	}

	/**
	 * Checks whether or not a given reference is inside of a given node.
	 * @param {ASTNode} node A node to check.
	 * @param {eslint-scope.Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is inside of the node.
	 */
	function isInRange(node, reference) {
		const or = node.range;
		const ir = reference.identifier.range;

		return or[0] <= ir[0] && ir[1] <= or[1];
	}

	/**
	 * Checks whether or not a given reference is inside of a loop node's condition.
	 * @param {ASTNode} node A node to check.
	 * @param {eslint-scope.Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is inside of the loop node's
	 *      condition.
	 */
	const isInLoop = {
		WhileStatement: isInRange,
		DoWhileStatement: isInRange,
		ForStatement(node, reference) {
			return (
				isInRange(node, reference) &&
				!(node.init && isInRange(node.init, reference))
			);
		},
	};

	/**
	 * Gets the function which encloses a given reference.
	 * This supports only FunctionDeclaration.
	 * @param {eslint-scope.Reference} reference A reference to get.
	 * @returns {ASTNode|null} The function node or null.
	 */
	function getEncloseFunctionDeclaration(reference) {
		let node = reference.identifier;

		while (node) {
			if (node.type === "FunctionDeclaration") {
				return node.id ? node : null;
			}

			node = node.parent;
		}

		return null;
	}

	/**
	 * Updates the "modified" flags of given loop conditions with given modifiers.
	 * @param {LoopConditionInfo[]} conditions The loop conditions to be updated.
	 * @param {eslint-scope.Reference[]} modifiers The references to update.
	 * @returns {void}
	 */
	function updateModifiedFlag(conditions, modifiers) {
		for (let i = 0; i < conditions.length; ++i) {
			const condition = conditions[i];

			for (let j = 0; !condition.modified && j < modifiers.length; ++j) {
				const modifier = modifiers[j];
				let funcNode, funcVar;

				/*
				 * Besides checking for the condition being in the loop, we want to
				 * check the function that this modifier is belonging to is called
				 * in the loop.
				 * FIXME: This should probably be extracted to a function.
				 */
				const inLoop =
					condition.isInLoop(modifier) ||
					Boolean(
						(funcNode = getEncloseFunctionDeclaration(modifier)) &&
							(funcVar = astUtils.getVariableByName(
								modifier.from.upper,
								funcNode.id.name,
							)) &&
							funcVar.references.some(condition.isInLoop),
					);

				condition.modified = inLoop;
			}
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnmodifiedLoopCondition = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow unmodified loop conditions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition",
			},

			schema: [],

			messages: {
				loopConditionNotModified:
					"'{{name}}' is not modified in this loop.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let groupMap = null;

			/**
			 * Reports a given condition info.
			 * @param {LoopConditionInfo} condition A loop condition info to report.
			 * @returns {void}
			 */
			function report(condition) {
				const node = condition.reference.identifier;

				context.report({
					node,
					messageId: "loopConditionNotModified",
					data: node,
				});
			}

			/**
			 * Registers given conditions to the group the condition belongs to.
			 * @param {LoopConditionInfo[]} conditions A loop condition info to
			 *      register.
			 * @returns {void}
			 */
			function registerConditionsToGroup(conditions) {
				for (let i = 0; i < conditions.length; ++i) {
					const condition = conditions[i];

					if (condition.group) {
						let group = groupMap.get(condition.group);

						if (!group) {
							group = [];
							groupMap.set(condition.group, group);
						}
						group.push(condition);
					}
				}
			}

			/**
			 * Reports references which are inside of unmodified groups.
			 * @param {LoopConditionInfo[]} conditions A loop condition info to report.
			 * @returns {void}
			 */
			function checkConditionsInGroup(conditions) {
				if (conditions.every(isUnmodified)) {
					conditions.forEach(report);
				}
			}

			/**
			 * Checks whether or not a given group node has any dynamic elements.
			 * @param {ASTNode} root A node to check.
			 *      This node is one of BinaryExpression or ConditionalExpression.
			 * @returns {boolean} `true` if the node is dynamic.
			 */
			function hasDynamicExpressions(root) {
				let retv = false;

				Traverser.traverse(root, {
					visitorKeys: sourceCode.visitorKeys,
					enter(node) {
						if (DYNAMIC_PATTERN.test(node.type)) {
							retv = true;
							this.break();
						} else if (SKIP_PATTERN.test(node.type)) {
							this.skip();
						}
					},
				});

				return retv;
			}

			/**
			 * Creates the loop condition information from a given reference.
			 * @param {eslint-scope.Reference} reference A reference to create.
			 * @returns {LoopConditionInfo|null} Created loop condition info, or null.
			 */
			function toLoopCondition(reference) {
				if (reference.init) {
					return null;
				}

				let group = null;
				let child = reference.identifier;
				let node = child.parent;

				while (node) {
					if (SENTINEL_PATTERN.test(node.type)) {
						if (LOOP_PATTERN.test(node.type) && node.test === child) {
							// This reference is inside of a loop condition.
							return {
								reference,
								group,
								isInLoop: isInLoop[node.type].bind(null, node),
								modified: false,
							};
						}

						// This reference is outside of a loop condition.
						break;
					}

					/*
					 * If it's inside of a group, OK if either operand is modified.
					 * So stores the group this reference belongs to.
					 */
					if (GROUP_PATTERN.test(node.type)) {
						// If this expression is dynamic, no need to check.
						if (hasDynamicExpressions(node)) {
							break;
						} else {
							group = node;
						}
					}

					child = node;
					node = node.parent;
				}

				return null;
			}

			/**
			 * Finds unmodified references which are inside of a loop condition.
			 * Then reports the references which are outside of groups.
			 * @param {eslint-scope.Variable} variable A variable to report.
			 * @returns {void}
			 */
			function checkReferences(variable) {
				// Gets references that exist in loop conditions.
				const conditions = variable.references
					.map(toLoopCondition)
					.filter(Boolean);

				if (conditions.length === 0) {
					return;
				}

				// Registers the conditions to belonging groups.
				registerConditionsToGroup(conditions);

				// Check the conditions are modified.
				const modifiers = variable.references.filter(isWriteReference);

				if (modifiers.length > 0) {
					updateModifiedFlag(conditions, modifiers);
				}

				/*
				 * Reports the conditions which are not belonging to groups.
				 * Others will be reported after all variables are done.
				 */
				conditions.filter(isUnmodifiedAndNotBelongToGroup).forEach(report);
			}

			return {
				"Program:exit"(node) {
					const queue = [sourceCode.getScope(node)];

					groupMap = new Map();

					let scope;

					while ((scope = queue.pop())) {
						queue.push(...scope.childScopes);
						scope.variables.forEach(checkReferences);
					}

					groupMap.forEach(checkConditionsInGroup);
					groupMap = null;
				},
			};
		},
	};
	return noUnmodifiedLoopCondition;
}

/**
 * @fileoverview Rule to flag no-unneeded-ternary
 * @author Gyandeep Singh
 */

var noUnneededTernary;
var hasRequiredNoUnneededTernary;

function requireNoUnneededTernary () {
	if (hasRequiredNoUnneededTernary) return noUnneededTernary;
	hasRequiredNoUnneededTernary = 1;

	const astUtils = requireAstUtils();

	// Operators that always result in a boolean value
	const BOOLEAN_OPERATORS = new Set([
		"==",
		"===",
		"!=",
		"!==",
		">",
		">=",
		"<",
		"<=",
		"in",
		"instanceof",
	]);
	const OPERATOR_INVERSES = {
		"==": "!=",
		"!=": "==",
		"===": "!==",
		"!==": "===",

		// Operators like < and >= are not true inverses, since both will return false with NaN.
	};
	const OR_PRECEDENCE = astUtils.getPrecedence({
		type: "LogicalExpression",
		operator: "||",
	});

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnneededTernary = {
		meta: {
			type: "suggestion",

			defaultOptions: [{ defaultAssignment: true }],

			docs: {
				description:
					"Disallow ternary operators when simpler alternatives exist",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary",
			},

			schema: [
				{
					type: "object",
					properties: {
						defaultAssignment: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				unnecessaryConditionalExpression:
					"Unnecessary use of boolean literals in conditional expression.",
				unnecessaryConditionalAssignment:
					"Unnecessary use of conditional expression for default assignment.",
			},
		},

		create(context) {
			const [{ defaultAssignment }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Test if the node is a boolean literal
			 * @param {ASTNode} node The node to report.
			 * @returns {boolean} True if the its a boolean literal
			 * @private
			 */
			function isBooleanLiteral(node) {
				return node.type === "Literal" && typeof node.value === "boolean";
			}

			/**
			 * Creates an expression that represents the boolean inverse of the expression represented by the original node
			 * @param {ASTNode} node A node representing an expression
			 * @returns {string} A string representing an inverted expression
			 */
			function invertExpression(node) {
				if (
					node.type === "BinaryExpression" &&
					Object.hasOwn(OPERATOR_INVERSES, node.operator)
				) {
					const operatorToken = sourceCode.getFirstTokenBetween(
						node.left,
						node.right,
						token => token.value === node.operator,
					);
					const text = sourceCode.getText();

					return (
						text.slice(node.range[0], operatorToken.range[0]) +
						OPERATOR_INVERSES[node.operator] +
						text.slice(operatorToken.range[1], node.range[1])
					);
				}

				if (
					astUtils.getPrecedence(node) <
					astUtils.getPrecedence({ type: "UnaryExpression" })
				) {
					return `!(${astUtils.getParenthesisedText(sourceCode, node)})`;
				}
				return `!${astUtils.getParenthesisedText(sourceCode, node)}`;
			}

			/**
			 * Tests if a given node always evaluates to a boolean value
			 * @param {ASTNode} node An expression node
			 * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value
			 */
			function isBooleanExpression(node) {
				return (
					(node.type === "BinaryExpression" &&
						BOOLEAN_OPERATORS.has(node.operator)) ||
					(node.type === "UnaryExpression" && node.operator === "!")
				);
			}

			/**
			 * Test if the node matches the pattern id ? id : expression
			 * @param {ASTNode} node The ConditionalExpression to check.
			 * @returns {boolean} True if the pattern is matched, and false otherwise
			 * @private
			 */
			function matchesDefaultAssignment(node) {
				return (
					node.test.type === "Identifier" &&
					node.consequent.type === "Identifier" &&
					node.test.name === node.consequent.name
				);
			}

			return {
				ConditionalExpression(node) {
					if (
						isBooleanLiteral(node.alternate) &&
						isBooleanLiteral(node.consequent)
					) {
						context.report({
							node,
							messageId: "unnecessaryConditionalExpression",
							fix(fixer) {
								if (
									node.consequent.value === node.alternate.value
								) {
									// Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true`
									return node.test.type === "Identifier"
										? fixer.replaceText(
												node,
												node.consequent.value.toString(),
											)
										: null;
								}
								if (node.alternate.value) {
									// Replace `foo() ? false : true` with `!(foo())`
									return fixer.replaceText(
										node,
										invertExpression(node.test),
									);
								}

								// Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise.

								return fixer.replaceText(
									node,
									isBooleanExpression(node.test)
										? astUtils.getParenthesisedText(
												sourceCode,
												node.test,
											)
										: `!${invertExpression(node.test)}`,
								);
							},
						});
					} else if (
						!defaultAssignment &&
						matchesDefaultAssignment(node)
					) {
						context.report({
							node,
							messageId: "unnecessaryConditionalAssignment",
							fix(fixer) {
								const shouldParenthesizeAlternate =
									(astUtils.getPrecedence(node.alternate) <
										OR_PRECEDENCE ||
										astUtils.isCoalesceExpression(
											node.alternate,
										)) &&
									!astUtils.isParenthesised(
										sourceCode,
										node.alternate,
									);
								const alternateText = shouldParenthesizeAlternate
									? `(${sourceCode.getText(node.alternate)})`
									: astUtils.getParenthesisedText(
											sourceCode,
											node.alternate,
										);
								const testText = astUtils.getParenthesisedText(
									sourceCode,
									node.test,
								);

								return fixer.replaceText(
									node,
									`${testText} || ${alternateText}`,
								);
							},
						});
					}
				},
			};
		},
	};
	return noUnneededTernary;
}

/**
 * @fileoverview Checks for unreachable code due to return, throws, break, and continue.
 * @author Joel Feenstra
 */

var noUnreachable;
var hasRequiredNoUnreachable;

function requireNoUnreachable () {
	if (hasRequiredNoUnreachable) return noUnreachable;
	hasRequiredNoUnreachable = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * @typedef {Object} ConstructorInfo
	 * @property {ConstructorInfo | null} upper Info about the constructor that encloses this constructor.
	 * @property {boolean} hasSuperCall The flag about having `super()` expressions.
	 */

	/**
	 * Checks whether or not a given variable declarator has the initializer.
	 * @param {ASTNode} node A VariableDeclarator node to check.
	 * @returns {boolean} `true` if the node has the initializer.
	 */
	function isInitialized(node) {
		return Boolean(node.init);
	}

	/**
	 * Checks all segments in a set and returns true if all are unreachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if all segments are unreachable; false otherwise.
	 */
	function areAllSegmentsUnreachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return false;
			}
		}

		return true;
	}

	/**
	 * The class to distinguish consecutive unreachable statements.
	 */
	class ConsecutiveRange {
		constructor(sourceCode) {
			this.sourceCode = sourceCode;
			this.startNode = null;
			this.endNode = null;
		}

		/**
		 * The location object of this range.
		 * @type {Object}
		 */
		get location() {
			return {
				start: this.startNode.loc.start,
				end: this.endNode.loc.end,
			};
		}

		/**
		 * `true` if this range is empty.
		 * @type {boolean}
		 */
		get isEmpty() {
			return !(this.startNode && this.endNode);
		}

		/**
		 * Checks whether the given node is inside of this range.
		 * @param {ASTNode|Token} node The node to check.
		 * @returns {boolean} `true` if the node is inside of this range.
		 */
		contains(node) {
			return (
				node.range[0] >= this.startNode.range[0] &&
				node.range[1] <= this.endNode.range[1]
			);
		}

		/**
		 * Checks whether the given node is consecutive to this range.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is consecutive to this range.
		 */
		isConsecutive(node) {
			return this.contains(this.sourceCode.getTokenBefore(node));
		}

		/**
		 * Merges the given node to this range.
		 * @param {ASTNode} node The node to merge.
		 * @returns {void}
		 */
		merge(node) {
			this.endNode = node;
		}

		/**
		 * Resets this range by the given node or null.
		 * @param {ASTNode|null} node The node to reset, or null.
		 * @returns {void}
		 */
		reset(node) {
			this.startNode = this.endNode = node;
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnreachable = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unreachable",
			},

			schema: [],

			messages: {
				unreachableCode: "Unreachable code.",
			},
		},

		create(context) {
			/** @type {ConstructorInfo | null} */
			let constructorInfo = null;

			/** @type {ConsecutiveRange} */
			const range = new ConsecutiveRange(context.sourceCode);

			/** @type {Array<Set<CodePathSegment>>} */
			const codePathSegments = [];

			/** @type {Set<CodePathSegment>} */
			let currentCodePathSegments = new Set();

			/**
			 * Reports a given node if it's unreachable.
			 * @param {ASTNode} node A statement node to report.
			 * @returns {void}
			 */
			function reportIfUnreachable(node) {
				let nextNode = null;

				if (
					node &&
					(node.type === "PropertyDefinition" ||
						areAllSegmentsUnreachable(currentCodePathSegments))
				) {
					// Store this statement to distinguish consecutive statements.
					if (range.isEmpty) {
						range.reset(node);
						return;
					}

					// Skip if this statement is inside of the current range.
					if (range.contains(node)) {
						return;
					}

					// Merge if this statement is consecutive to the current range.
					if (range.isConsecutive(node)) {
						range.merge(node);
						return;
					}

					nextNode = node;
				}

				/*
				 * Report the current range since this statement is reachable or is
				 * not consecutive to the current range.
				 */
				if (!range.isEmpty) {
					context.report({
						messageId: "unreachableCode",
						loc: range.location,
						node: range.startNode,
					});
				}

				// Update the current range.
				range.reset(nextNode);
			}

			return {
				// Manages the current code path.
				onCodePathStart() {
					codePathSegments.push(currentCodePathSegments);
					currentCodePathSegments = new Set();
				},

				onCodePathEnd() {
					currentCodePathSegments = codePathSegments.pop();
				},

				onUnreachableCodePathSegmentStart(segment) {
					currentCodePathSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				onCodePathSegmentStart(segment) {
					currentCodePathSegments.add(segment);
				},

				// Registers for all statement nodes (excludes FunctionDeclaration).
				BlockStatement: reportIfUnreachable,
				BreakStatement: reportIfUnreachable,
				ClassDeclaration: reportIfUnreachable,
				ContinueStatement: reportIfUnreachable,
				DebuggerStatement: reportIfUnreachable,
				DoWhileStatement: reportIfUnreachable,
				ExpressionStatement: reportIfUnreachable,
				ForInStatement: reportIfUnreachable,
				ForOfStatement: reportIfUnreachable,
				ForStatement: reportIfUnreachable,
				IfStatement: reportIfUnreachable,
				ImportDeclaration: reportIfUnreachable,
				LabeledStatement: reportIfUnreachable,
				ReturnStatement: reportIfUnreachable,
				SwitchStatement: reportIfUnreachable,
				ThrowStatement: reportIfUnreachable,
				TryStatement: reportIfUnreachable,

				VariableDeclaration(node) {
					if (
						node.kind !== "var" ||
						node.declarations.some(isInitialized)
					) {
						reportIfUnreachable(node);
					}
				},

				WhileStatement: reportIfUnreachable,
				WithStatement: reportIfUnreachable,
				ExportNamedDeclaration: reportIfUnreachable,
				ExportDefaultDeclaration: reportIfUnreachable,
				ExportAllDeclaration: reportIfUnreachable,

				"Program:exit"() {
					reportIfUnreachable();
				},

				/*
				 * Instance fields defined in a subclass are never created if the constructor of the subclass
				 * doesn't call `super()`, so their definitions are unreachable code.
				 */
				"MethodDefinition[kind='constructor']"() {
					constructorInfo = {
						upper: constructorInfo,
						hasSuperCall: false,
					};
				},
				"MethodDefinition[kind='constructor']:exit"(node) {
					const { hasSuperCall } = constructorInfo;

					constructorInfo = constructorInfo.upper;

					// skip typescript constructors without the body
					if (!node.value.body) {
						return;
					}

					const classDefinition = node.parent.parent;

					if (classDefinition.superClass && !hasSuperCall) {
						for (const element of classDefinition.body.body) {
							if (
								element.type === "PropertyDefinition" &&
								!element.static
							) {
								reportIfUnreachable(element);
							}
						}
					}
				},
				"CallExpression > Super.callee"() {
					if (constructorInfo) {
						constructorInfo.hasSuperCall = true;
					}
				},
			};
		},
	};
	return noUnreachable;
}

/**
 * @fileoverview Rule to disallow loops with a body that allows only one iteration
 * @author Milos Djermanovic
 */

var noUnreachableLoop;
var hasRequiredNoUnreachableLoop;

function requireNoUnreachableLoop () {
	if (hasRequiredNoUnreachableLoop) return noUnreachableLoop;
	hasRequiredNoUnreachableLoop = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const allLoopTypes = [
		"WhileStatement",
		"DoWhileStatement",
		"ForStatement",
		"ForInStatement",
		"ForOfStatement",
	];

	/**
	 * Checks all segments in a set and returns true if any are reachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if any segment is reachable; false otherwise.
	 */
	function isAnySegmentReachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Determines whether the given node is the first node in the code path to which a loop statement
	 * 'loops' for the next iteration.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is a looping target.
	 */
	function isLoopingTarget(node) {
		const parent = node.parent;

		if (parent) {
			switch (parent.type) {
				case "WhileStatement":
					return node === parent.test;
				case "DoWhileStatement":
					return node === parent.body;
				case "ForStatement":
					return node === (parent.update || parent.test || parent.body);
				case "ForInStatement":
				case "ForOfStatement":
					return node === parent.left;

				// no default
			}
		}

		return false;
	}

	/**
	 * Creates an array with elements from the first given array that are not included in the second given array.
	 * @param {Array} arrA The array to compare from.
	 * @param {Array} arrB The array to compare against.
	 * @returns {Array} a new array that represents `arrA \ arrB`.
	 */
	function getDifference(arrA, arrB) {
		return arrA.filter(a => !arrB.includes(a));
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnreachableLoop = {
		meta: {
			type: "problem",

			defaultOptions: [{ ignore: [] }],

			docs: {
				description:
					"Disallow loops with a body that allows only one iteration",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-unreachable-loop",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignore: {
							type: "array",
							items: {
								enum: allLoopTypes,
							},
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				invalid: "Invalid loop. Its body allows only one iteration.",
			},
		},

		create(context) {
			const [{ ignore: ignoredLoopTypes }] = context.options;
			const loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes),
				loopSelector = loopTypesToCheck.join(","),
				loopsByTargetSegments = new Map(),
				loopsToReport = new Set();

			const codePathSegments = [];
			let currentCodePathSegments = new Set();

			return {
				onCodePathStart() {
					codePathSegments.push(currentCodePathSegments);
					currentCodePathSegments = new Set();
				},

				onCodePathEnd() {
					currentCodePathSegments = codePathSegments.pop();
				},

				onUnreachableCodePathSegmentStart(segment) {
					currentCodePathSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					currentCodePathSegments.delete(segment);
				},

				onCodePathSegmentStart(segment, node) {
					currentCodePathSegments.add(segment);

					if (isLoopingTarget(node)) {
						const loop = node.parent;

						loopsByTargetSegments.set(segment, loop);
					}
				},

				onCodePathSegmentLoop(_, toSegment, node) {
					const loop = loopsByTargetSegments.get(toSegment);

					/**
					 * The second iteration is reachable, meaning that the loop is valid by the logic of this rule,
					 * only if there is at least one loop event with the appropriate target (which has been already
					 * determined in the `loopsByTargetSegments` map), raised from either:
					 *
					 * - the end of the loop's body (in which case `node === loop`)
					 * - a `continue` statement
					 *
					 * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes.
					 */
					if (node === loop || node.type === "ContinueStatement") {
						// Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw.
						loopsToReport.delete(loop);
					}
				},

				[loopSelector](node) {
					/**
					 * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise.
					 * For unreachable segments, the code path analysis does not raise events required for this implementation.
					 */
					if (isAnySegmentReachable(currentCodePathSegments)) {
						loopsToReport.add(node);
					}
				},

				"Program:exit"() {
					loopsToReport.forEach(node =>
						context.report({ node, messageId: "invalid" }),
					);
				},
			};
		},
	};
	return noUnreachableLoop;
}

/**
 * @fileoverview Rule to flag unsafe statements in finally block
 * @author Onur Temizkan
 */

var noUnsafeFinally;
var hasRequiredNoUnsafeFinally;

function requireNoUnsafeFinally () {
	if (hasRequiredNoUnsafeFinally) return noUnsafeFinally;
	hasRequiredNoUnsafeFinally = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SENTINEL_NODE_TYPE_RETURN_THROW =
		/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u;
	const SENTINEL_NODE_TYPE_BREAK =
		/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u;
	const SENTINEL_NODE_TYPE_CONTINUE =
		/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnsafeFinally = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow control flow statements in `finally` blocks",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unsafe-finally",
			},

			schema: [],

			messages: {
				unsafeUsage: "Unsafe usage of {{nodeType}}.",
			},
		},
		create(context) {
			/**
			 * Checks if the node is the finalizer of a TryStatement
			 * @param {ASTNode} node node to check.
			 * @returns {boolean} - true if the node is the finalizer of a TryStatement
			 */
			function isFinallyBlock(node) {
				return (
					node.parent.type === "TryStatement" &&
					node.parent.finalizer === node
				);
			}

			/**
			 * Climbs up the tree if the node is not a sentinel node
			 * @param {ASTNode} node node to check.
			 * @param {string} label label of the break or continue statement
			 * @returns {boolean} - return whether the node is a finally block or a sentinel node
			 */
			function isInFinallyBlock(node, label) {
				let labelInside = false;
				let sentinelNodeType;

				if (node.type === "BreakStatement" && !node.label) {
					sentinelNodeType = SENTINEL_NODE_TYPE_BREAK;
				} else if (node.type === "ContinueStatement") {
					sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE;
				} else {
					sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW;
				}

				for (
					let currentNode = node;
					currentNode && !sentinelNodeType.test(currentNode.type);
					currentNode = currentNode.parent
				) {
					if (
						currentNode.parent.label &&
						label &&
						currentNode.parent.label.name === label.name
					) {
						labelInside = true;
					}
					if (isFinallyBlock(currentNode)) {
						if (label && labelInside) {
							return false;
						}
						return true;
					}
				}
				return false;
			}

			/**
			 * Checks whether the possibly-unsafe statement is inside a finally block.
			 * @param {ASTNode} node node to check.
			 * @returns {void}
			 */
			function check(node) {
				if (isInFinallyBlock(node, node.label)) {
					context.report({
						messageId: "unsafeUsage",
						data: {
							nodeType: node.type,
						},
						node,
						line: node.loc.line,
						column: node.loc.column,
					});
				}
			}

			return {
				ReturnStatement: check,
				ThrowStatement: check,
				BreakStatement: check,
				ContinueStatement: check,
			};
		},
	};
	return noUnsafeFinally;
}

/**
 * @fileoverview Rule to disallow negating the left operand of relational operators
 * @author Toru Nagashima
 */

var noUnsafeNegation;
var hasRequiredNoUnsafeNegation;

function requireNoUnsafeNegation () {
	if (hasRequiredNoUnsafeNegation) return noUnsafeNegation;
	hasRequiredNoUnsafeNegation = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether the given operator is `in` or `instanceof`
	 * @param {string} op The operator type to check.
	 * @returns {boolean} `true` if the operator is `in` or `instanceof`
	 */
	function isInOrInstanceOfOperator(op) {
		return op === "in" || op === "instanceof";
	}

	/**
	 * Checks whether the given operator is an ordering relational operator or not.
	 * @param {string} op The operator type to check.
	 * @returns {boolean} `true` if the operator is an ordering relational operator.
	 */
	function isOrderingRelationalOperator(op) {
		return op === "<" || op === ">" || op === ">=" || op === "<=";
	}

	/**
	 * Checks whether the given node is a logical negation expression or not.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is a logical negation expression.
	 */
	function isNegation(node) {
		return node.type === "UnaryExpression" && node.operator === "!";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnsafeNegation = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					enforceForOrderingRelations: false,
				},
			],

			docs: {
				description:
					"Disallow negating the left operand of relational operators",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unsafe-negation",
			},

			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						enforceForOrderingRelations: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: null,

			messages: {
				unexpected:
					"Unexpected negating the left operand of '{{operator}}' operator.",
				suggestNegatedExpression:
					"Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.",
				suggestParenthesisedNegation:
					"Wrap negation in '()' to make the intention explicit. This preserves the current behavior.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ enforceForOrderingRelations }] = context.options;

			return {
				BinaryExpression(node) {
					const operator = node.operator;
					const orderingRelationRuleApplies =
						enforceForOrderingRelations &&
						isOrderingRelationalOperator(operator);

					if (
						(isInOrInstanceOfOperator(operator) ||
							orderingRelationRuleApplies) &&
						isNegation(node.left) &&
						!astUtils.isParenthesised(sourceCode, node.left)
					) {
						context.report({
							node,
							loc: node.left.loc,
							messageId: "unexpected",
							data: { operator },
							suggest: [
								{
									messageId: "suggestNegatedExpression",
									data: { operator },
									fix(fixer) {
										const negationToken =
											sourceCode.getFirstToken(node.left);
										const fixRange = [
											negationToken.range[1],
											node.range[1],
										];
										const text = sourceCode.text.slice(
											fixRange[0],
											fixRange[1],
										);

										return fixer.replaceTextRange(
											fixRange,
											`(${text})`,
										);
									},
								},
								{
									messageId: "suggestParenthesisedNegation",
									fix(fixer) {
										return fixer.replaceText(
											node.left,
											`(${sourceCode.getText(node.left)})`,
										);
									},
								},
							],
						});
					}
				},
			};
		},
	};
	return noUnsafeNegation;
}

/**
 * @fileoverview Rule to disallow unsafe optional chaining
 * @author Yeon JuAn
 */

var noUnsafeOptionalChaining;
var hasRequiredNoUnsafeOptionalChaining;

function requireNoUnsafeOptionalChaining () {
	if (hasRequiredNoUnsafeOptionalChaining) return noUnsafeOptionalChaining;
	hasRequiredNoUnsafeOptionalChaining = 1;

	const UNSAFE_ARITHMETIC_OPERATORS = new Set(["+", "-", "/", "*", "%", "**"]);
	const UNSAFE_ASSIGNMENT_OPERATORS = new Set([
		"+=",
		"-=",
		"/=",
		"*=",
		"%=",
		"**=",
	]);
	const UNSAFE_RELATIONAL_OPERATORS = new Set(["in", "instanceof"]);

	/**
	 * Checks whether a node is a destructuring pattern or not
	 * @param {ASTNode} node node to check
	 * @returns {boolean} `true` if a node is a destructuring pattern, otherwise `false`
	 */
	function isDestructuringPattern(node) {
		return node.type === "ObjectPattern" || node.type === "ArrayPattern";
	}

	/** @type {import('../shared/types').Rule} */
	noUnsafeOptionalChaining = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					disallowArithmeticOperators: false,
				},
			],

			docs: {
				description:
					"Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining",
			},
			schema: [
				{
					type: "object",
					properties: {
						disallowArithmeticOperators: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			fixable: null,
			messages: {
				unsafeOptionalChain:
					"Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError.",
				unsafeArithmetic:
					"Unsafe arithmetic operation on optional chaining. It can result in NaN.",
			},
		},

		create(context) {
			const [{ disallowArithmeticOperators }] = context.options;

			/**
			 * Reports unsafe usage of optional chaining
			 * @param {ASTNode} node node to report
			 * @returns {void}
			 */
			function reportUnsafeUsage(node) {
				context.report({
					messageId: "unsafeOptionalChain",
					node,
				});
			}

			/**
			 * Reports unsafe arithmetic operation on optional chaining
			 * @param {ASTNode} node node to report
			 * @returns {void}
			 */
			function reportUnsafeArithmetic(node) {
				context.report({
					messageId: "unsafeArithmetic",
					node,
				});
			}

			/**
			 * Checks and reports if a node can short-circuit with `undefined` by optional chaining.
			 * @param {ASTNode} [node] node to check
			 * @param {Function} reportFunc report function
			 * @returns {void}
			 */
			function checkUndefinedShortCircuit(node, reportFunc) {
				if (!node) {
					return;
				}
				switch (node.type) {
					case "LogicalExpression":
						if (node.operator === "||" || node.operator === "??") {
							checkUndefinedShortCircuit(node.right, reportFunc);
						} else if (node.operator === "&&") {
							checkUndefinedShortCircuit(node.left, reportFunc);
							checkUndefinedShortCircuit(node.right, reportFunc);
						}
						break;
					case "SequenceExpression":
						checkUndefinedShortCircuit(
							node.expressions.at(-1),
							reportFunc,
						);
						break;
					case "ConditionalExpression":
						checkUndefinedShortCircuit(node.consequent, reportFunc);
						checkUndefinedShortCircuit(node.alternate, reportFunc);
						break;
					case "AwaitExpression":
						checkUndefinedShortCircuit(node.argument, reportFunc);
						break;
					case "ChainExpression":
						reportFunc(node);
						break;
				}
			}

			/**
			 * Checks unsafe usage of optional chaining
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkUnsafeUsage(node) {
				checkUndefinedShortCircuit(node, reportUnsafeUsage);
			}

			/**
			 * Checks unsafe arithmetic operations on optional chaining
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkUnsafeArithmetic(node) {
				checkUndefinedShortCircuit(node, reportUnsafeArithmetic);
			}

			return {
				"AssignmentExpression, AssignmentPattern"(node) {
					if (isDestructuringPattern(node.left)) {
						checkUnsafeUsage(node.right);
					}
				},
				"ClassDeclaration, ClassExpression"(node) {
					checkUnsafeUsage(node.superClass);
				},
				CallExpression(node) {
					if (!node.optional) {
						checkUnsafeUsage(node.callee);
					}
				},
				NewExpression(node) {
					checkUnsafeUsage(node.callee);
				},
				VariableDeclarator(node) {
					if (isDestructuringPattern(node.id)) {
						checkUnsafeUsage(node.init);
					}
				},
				MemberExpression(node) {
					if (!node.optional) {
						checkUnsafeUsage(node.object);
					}
				},
				TaggedTemplateExpression(node) {
					checkUnsafeUsage(node.tag);
				},
				ForOfStatement(node) {
					checkUnsafeUsage(node.right);
				},
				SpreadElement(node) {
					if (node.parent && node.parent.type !== "ObjectExpression") {
						checkUnsafeUsage(node.argument);
					}
				},
				BinaryExpression(node) {
					if (UNSAFE_RELATIONAL_OPERATORS.has(node.operator)) {
						checkUnsafeUsage(node.right);
					}
					if (
						disallowArithmeticOperators &&
						UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
					) {
						checkUnsafeArithmetic(node.right);
						checkUnsafeArithmetic(node.left);
					}
				},
				WithStatement(node) {
					checkUnsafeUsage(node.object);
				},
				UnaryExpression(node) {
					if (
						disallowArithmeticOperators &&
						UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
					) {
						checkUnsafeArithmetic(node.argument);
					}
				},
				AssignmentExpression(node) {
					if (
						disallowArithmeticOperators &&
						UNSAFE_ASSIGNMENT_OPERATORS.has(node.operator)
					) {
						checkUnsafeArithmetic(node.right);
					}
				},
			};
		},
	};
	return noUnsafeOptionalChaining;
}

/**
 * @fileoverview Flag expressions in statement position that do not side effect
 * @author Michael Ficarra
 */

var noUnusedExpressions;
var hasRequiredNoUnusedExpressions;

function requireNoUnusedExpressions () {
	if (hasRequiredNoUnusedExpressions) return noUnusedExpressions;
	hasRequiredNoUnusedExpressions = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/**
	 * Returns `true`.
	 * @returns {boolean} `true`.
	 */
	function alwaysTrue() {
		return true;
	}

	/**
	 * Returns `false`.
	 * @returns {boolean} `false`.
	 */
	function alwaysFalse() {
		return false;
	}

	/** @type {import('../shared/types').Rule} */
	noUnusedExpressions = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unused expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-unused-expressions",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowShortCircuit: {
							type: "boolean",
						},
						allowTernary: {
							type: "boolean",
						},
						allowTaggedTemplates: {
							type: "boolean",
						},
						enforceForJSX: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [
				{
					allowShortCircuit: false,
					allowTernary: false,
					allowTaggedTemplates: false,
					enforceForJSX: false,
				},
			],

			messages: {
				unusedExpression:
					"Expected an assignment or function call and instead saw an expression.",
			},
		},

		create(context) {
			const [
				{
					allowShortCircuit,
					allowTernary,
					allowTaggedTemplates,
					enforceForJSX,
				},
			] = context.options;

			/**
			 * Has AST suggesting a directive.
			 * @param {ASTNode} node any node
			 * @returns {boolean} whether the given node structurally represents a directive
			 */
			function looksLikeDirective(node) {
				return (
					node.type === "ExpressionStatement" &&
					node.expression.type === "Literal" &&
					typeof node.expression.value === "string"
				);
			}

			/**
			 * Gets the leading sequence of members in a list that pass the predicate.
			 * @param {Function} predicate ([a] -> Boolean) the function used to make the determination
			 * @param {a[]} list the input list
			 * @returns {a[]} the leading sequence of members in the given list that pass the given predicate
			 */
			function takeWhile(predicate, list) {
				for (let i = 0; i < list.length; ++i) {
					if (!predicate(list[i])) {
						return list.slice(0, i);
					}
				}
				return list.slice();
			}

			/**
			 * Gets leading directives nodes in a Node body.
			 * @param {ASTNode} node a Program or BlockStatement node
			 * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
			 */
			function directives(node) {
				return takeWhile(looksLikeDirective, node.body);
			}

			/**
			 * Detect if a Node is a directive.
			 * @param {ASTNode} node any node
			 * @returns {boolean} whether the given node is considered a directive in its current position
			 */
			function isDirective(node) {
				/**
				 * https://tc39.es/ecma262/#directive-prologue
				 *
				 * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue.
				 * Class static blocks do not have directive prologue.
				 */
				return (
					astUtils.isTopLevelExpressionStatement(node) &&
					directives(node.parent).includes(node)
				);
			}

			/**
			 * The member functions return `true` if the type has no side-effects.
			 * Unknown nodes are handled as `false`, then this rule ignores those.
			 */
			const Checker = Object.assign(Object.create(null), {
				isDisallowed(node) {
					return (Checker[node.type] || alwaysFalse)(node);
				},

				ArrayExpression: alwaysTrue,
				ArrowFunctionExpression: alwaysTrue,
				BinaryExpression: alwaysTrue,
				ChainExpression(node) {
					return Checker.isDisallowed(node.expression);
				},
				ClassExpression: alwaysTrue,
				ConditionalExpression(node) {
					if (allowTernary) {
						return (
							Checker.isDisallowed(node.consequent) ||
							Checker.isDisallowed(node.alternate)
						);
					}
					return true;
				},
				FunctionExpression: alwaysTrue,
				Identifier: alwaysTrue,
				JSXElement() {
					return enforceForJSX;
				},
				JSXFragment() {
					return enforceForJSX;
				},
				Literal: alwaysTrue,
				LogicalExpression(node) {
					if (allowShortCircuit) {
						return Checker.isDisallowed(node.right);
					}
					return true;
				},
				MemberExpression: alwaysTrue,
				MetaProperty: alwaysTrue,
				ObjectExpression: alwaysTrue,
				SequenceExpression: alwaysTrue,
				TaggedTemplateExpression() {
					return !allowTaggedTemplates;
				},
				TemplateLiteral: alwaysTrue,
				ThisExpression: alwaysTrue,
				UnaryExpression(node) {
					return node.operator !== "void" && node.operator !== "delete";
				},
			});

			return {
				ExpressionStatement(node) {
					if (
						Checker.isDisallowed(node.expression) &&
						!isDirective(node)
					) {
						context.report({ node, messageId: "unusedExpression" });
					}
				},
			};
		},
	};
	return noUnusedExpressions;
}

/**
 * @fileoverview Rule to disallow unused labels.
 * @author Toru Nagashima
 */

var noUnusedLabels;
var hasRequiredNoUnusedLabels;

function requireNoUnusedLabels () {
	if (hasRequiredNoUnusedLabels) return noUnusedLabels;
	hasRequiredNoUnusedLabels = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnusedLabels = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unused labels",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unused-labels",
			},

			schema: [],

			fixable: "code",

			messages: {
				unused: "'{{name}}:' is defined but never used.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let scopeInfo = null;

			/**
			 * Adds a scope info to the stack.
			 * @param {ASTNode} node A node to add. This is a LabeledStatement.
			 * @returns {void}
			 */
			function enterLabeledScope(node) {
				scopeInfo = {
					label: node.label.name,
					used: false,
					upper: scopeInfo,
				};
			}

			/**
			 * Checks if a `LabeledStatement` node is fixable.
			 * For a node to be fixable, there must be no comments between the label and the body.
			 * Furthermore, is must be possible to remove the label without turning the body statement into a
			 * directive after other fixes are applied.
			 * @param {ASTNode} node The node to evaluate.
			 * @returns {boolean} Whether or not the node is fixable.
			 */
			function isFixable(node) {
				/*
				 * Only perform a fix if there are no comments between the label and the body. This will be the case
				 * when there is exactly one token/comment (the ":") between the label and the body.
				 */
				if (
					sourceCode.getTokenAfter(node.label, {
						includeComments: true,
					}) !==
					sourceCode.getTokenBefore(node.body, { includeComments: true })
				) {
					return false;
				}

				// Looking for the node's deepest ancestor which is not a `LabeledStatement`.
				let ancestor = node.parent;

				while (ancestor.type === "LabeledStatement") {
					ancestor = ancestor.parent;
				}

				if (
					ancestor.type === "Program" ||
					(ancestor.type === "BlockStatement" &&
						astUtils.isFunction(ancestor.parent))
				) {
					const { body } = node;

					if (
						body.type === "ExpressionStatement" &&
						((body.expression.type === "Literal" &&
							typeof body.expression.value === "string") ||
							astUtils.isStaticTemplateLiteral(body.expression))
					) {
						return false; // potential directive
					}
				}
				return true;
			}

			/**
			 * Removes the top of the stack.
			 * At the same time, this reports the label if it's never used.
			 * @param {ASTNode} node A node to report. This is a LabeledStatement.
			 * @returns {void}
			 */
			function exitLabeledScope(node) {
				if (!scopeInfo.used) {
					context.report({
						node: node.label,
						messageId: "unused",
						data: node.label,
						fix: isFixable(node)
							? fixer =>
									fixer.removeRange([
										node.range[0],
										node.body.range[0],
									])
							: null,
					});
				}

				scopeInfo = scopeInfo.upper;
			}

			/**
			 * Marks the label of a given node as used.
			 * @param {ASTNode} node A node to mark. This is a BreakStatement or
			 *      ContinueStatement.
			 * @returns {void}
			 */
			function markAsUsed(node) {
				if (!node.label) {
					return;
				}

				const label = node.label.name;
				let info = scopeInfo;

				while (info) {
					if (info.label === label) {
						info.used = true;
						break;
					}
					info = info.upper;
				}
			}

			return {
				LabeledStatement: enterLabeledScope,
				"LabeledStatement:exit": exitLabeledScope,
				BreakStatement: markAsUsed,
				ContinueStatement: markAsUsed,
			};
		},
	};
	return noUnusedLabels;
}

/**
 * @fileoverview Rule to flag declared but unused private class members
 * @author Tim van der Lippe
 */

var noUnusedPrivateClassMembers;
var hasRequiredNoUnusedPrivateClassMembers;

function requireNoUnusedPrivateClassMembers () {
	if (hasRequiredNoUnusedPrivateClassMembers) return noUnusedPrivateClassMembers;
	hasRequiredNoUnusedPrivateClassMembers = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnusedPrivateClassMembers = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow unused private class members",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unused-private-class-members",
			},

			schema: [],

			messages: {
				unusedPrivateClassMember:
					"'{{classMemberName}}' is defined but never used.",
			},
		},

		create(context) {
			const trackedClasses = [];

			/**
			 * Check whether the current node is in a write only assignment.
			 * @param {ASTNode} privateIdentifierNode Node referring to a private identifier
			 * @returns {boolean} Whether the node is in a write only assignment
			 * @private
			 */
			function isWriteOnlyAssignment(privateIdentifierNode) {
				const parentStatement = privateIdentifierNode.parent.parent;
				const isAssignmentExpression =
					parentStatement.type === "AssignmentExpression";

				if (
					!isAssignmentExpression &&
					parentStatement.type !== "ForInStatement" &&
					parentStatement.type !== "ForOfStatement" &&
					parentStatement.type !== "AssignmentPattern"
				) {
					return false;
				}

				// It is a write-only usage, since we still allow usages on the right for reads
				if (parentStatement.left !== privateIdentifierNode.parent) {
					return false;
				}

				// For any other operator (such as '+=') we still consider it a read operation
				if (isAssignmentExpression && parentStatement.operator !== "=") {
					/*
					 * However, if the read operation is "discarded" in an empty statement, then
					 * we consider it write only.
					 */
					return parentStatement.parent.type === "ExpressionStatement";
				}

				return true;
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				// Collect all declared members up front and assume they are all unused
				ClassBody(classBodyNode) {
					const privateMembers = new Map();

					trackedClasses.unshift(privateMembers);
					for (const bodyMember of classBodyNode.body) {
						if (
							bodyMember.type === "PropertyDefinition" ||
							bodyMember.type === "MethodDefinition"
						) {
							if (bodyMember.key.type === "PrivateIdentifier") {
								privateMembers.set(bodyMember.key.name, {
									declaredNode: bodyMember,
									isAccessor:
										bodyMember.type === "MethodDefinition" &&
										(bodyMember.kind === "set" ||
											bodyMember.kind === "get"),
								});
							}
						}
					}
				},

				/*
				 * Process all usages of the private identifier and remove a member from
				 * `declaredAndUnusedPrivateMembers` if we deem it used.
				 */
				PrivateIdentifier(privateIdentifierNode) {
					const classBody = trackedClasses.find(classProperties =>
						classProperties.has(privateIdentifierNode.name),
					);

					// Can't happen, as it is a parser to have a missing class body, but let's code defensively here.
					if (!classBody) {
						return;
					}

					// In case any other usage was already detected, we can short circuit the logic here.
					const memberDefinition = classBody.get(
						privateIdentifierNode.name,
					);

					if (memberDefinition.isUsed) {
						return;
					}

					// The definition of the class member itself
					if (
						privateIdentifierNode.parent.type ===
							"PropertyDefinition" ||
						privateIdentifierNode.parent.type === "MethodDefinition"
					) {
						return;
					}

					/*
					 * Any usage of an accessor is considered a read, as the getter/setter can have
					 * side-effects in its definition.
					 */
					if (memberDefinition.isAccessor) {
						memberDefinition.isUsed = true;
						return;
					}

					// Any assignments to this member, except for assignments that also read
					if (isWriteOnlyAssignment(privateIdentifierNode)) {
						return;
					}

					const wrappingExpressionType =
						privateIdentifierNode.parent.parent.type;
					const parentOfWrappingExpressionType =
						privateIdentifierNode.parent.parent.parent.type;

					// A statement which only increments (`this.#x++;`)
					if (
						wrappingExpressionType === "UpdateExpression" &&
						parentOfWrappingExpressionType === "ExpressionStatement"
					) {
						return;
					}

					/*
					 * ({ x: this.#usedInDestructuring } = bar);
					 *
					 * But should treat the following as a read:
					 * ({ [this.#x]: a } = foo);
					 */
					if (
						wrappingExpressionType === "Property" &&
						parentOfWrappingExpressionType === "ObjectPattern" &&
						privateIdentifierNode.parent.parent.value ===
							privateIdentifierNode.parent
					) {
						return;
					}

					// [...this.#unusedInRestPattern] = bar;
					if (wrappingExpressionType === "RestElement") {
						return;
					}

					// [this.#unusedInAssignmentPattern] = bar;
					if (wrappingExpressionType === "ArrayPattern") {
						return;
					}

					/*
					 * We can't delete the memberDefinition, as we need to keep track of which member we are marking as used.
					 * In the case of nested classes, we only mark the first member we encounter as used. If you were to delete
					 * the member, then any subsequent usage could incorrectly mark the member of an encapsulating parent class
					 * as used, which is incorrect.
					 */
					memberDefinition.isUsed = true;
				},

				/*
				 * Post-process the class members and report any remaining members.
				 * Since private members can only be accessed in the current class context,
				 * we can safely assume that all usages are within the current class body.
				 */
				"ClassBody:exit"() {
					const unusedPrivateMembers = trackedClasses.shift();

					for (const [
						classMemberName,
						{ declaredNode, isUsed },
					] of unusedPrivateMembers.entries()) {
						if (isUsed) {
							continue;
						}
						context.report({
							node: declaredNode,
							loc: declaredNode.key.loc,
							messageId: "unusedPrivateClassMember",
							data: {
								classMemberName: `#${classMemberName}`,
							},
						});
					}
				},
			};
		},
	};
	return noUnusedPrivateClassMembers;
}

/**
 * @fileoverview Rule to flag declared but unused variables
 * @author Ilya Volodin
 */

var noUnusedVars;
var hasRequiredNoUnusedVars;

function requireNoUnusedVars () {
	if (hasRequiredNoUnusedVars) return noUnusedVars;
	hasRequiredNoUnusedVars = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * A simple name for the types of variables that this rule supports
	 * @typedef {'array-destructure'|'catch-clause'|'parameter'|'variable'} VariableType
	 */

	/**
	 * Bag of data used for formatting the `unusedVar` lint message.
	 * @typedef {Object} UnusedVarMessageData
	 * @property {string} varName The name of the unused var.
	 * @property {'defined'|'assigned a value'} action Description of the vars state.
	 * @property {string} additional Any additional info to be appended at the end.
	 */

	/**
	 * Bag of data used for formatting the `usedIgnoredVar` lint message.
	 * @typedef {Object} UsedIgnoredVarMessageData
	 * @property {string} varName The name of the unused var.
	 * @property {string} additional Any additional info to be appended at the end.
	 */

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUnusedVars = {
		meta: {
			type: "problem",

			docs: {
				description: "Disallow unused variables",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-unused-vars",
			},

			hasSuggestions: true,

			schema: [
				{
					oneOf: [
						{
							enum: ["all", "local"],
						},
						{
							type: "object",
							properties: {
								vars: {
									enum: ["all", "local"],
								},
								varsIgnorePattern: {
									type: "string",
								},
								args: {
									enum: ["all", "after-used", "none"],
								},
								ignoreRestSiblings: {
									type: "boolean",
								},
								argsIgnorePattern: {
									type: "string",
								},
								caughtErrors: {
									enum: ["all", "none"],
								},
								caughtErrorsIgnorePattern: {
									type: "string",
								},
								destructuredArrayIgnorePattern: {
									type: "string",
								},
								ignoreClassWithStaticInitBlock: {
									type: "boolean",
								},
								reportUsedIgnorePattern: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				unusedVar:
					"'{{varName}}' is {{action}} but never used{{additional}}.",
				usedIgnoredVar:
					"'{{varName}}' is marked as ignored but is used{{additional}}.",
				removeVar: "Remove unused variable '{{varName}}'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const REST_PROPERTY_TYPE =
				/^(?:RestElement|(?:Experimental)?RestProperty)$/u;

			const config = {
				vars: "all",
				args: "after-used",
				ignoreRestSiblings: false,
				caughtErrors: "all",
				ignoreClassWithStaticInitBlock: false,
				reportUsedIgnorePattern: false,
			};

			const firstOption = context.options[0];

			if (firstOption) {
				if (typeof firstOption === "string") {
					config.vars = firstOption;
				} else {
					config.vars = firstOption.vars || config.vars;
					config.args = firstOption.args || config.args;
					config.ignoreRestSiblings =
						firstOption.ignoreRestSiblings || config.ignoreRestSiblings;
					config.caughtErrors =
						firstOption.caughtErrors || config.caughtErrors;
					config.ignoreClassWithStaticInitBlock =
						firstOption.ignoreClassWithStaticInitBlock ||
						config.ignoreClassWithStaticInitBlock;
					config.reportUsedIgnorePattern =
						firstOption.reportUsedIgnorePattern ||
						config.reportUsedIgnorePattern;

					if (firstOption.varsIgnorePattern) {
						config.varsIgnorePattern = new RegExp(
							firstOption.varsIgnorePattern,
							"u",
						);
					}

					if (firstOption.argsIgnorePattern) {
						config.argsIgnorePattern = new RegExp(
							firstOption.argsIgnorePattern,
							"u",
						);
					}

					if (firstOption.caughtErrorsIgnorePattern) {
						config.caughtErrorsIgnorePattern = new RegExp(
							firstOption.caughtErrorsIgnorePattern,
							"u",
						);
					}

					if (firstOption.destructuredArrayIgnorePattern) {
						config.destructuredArrayIgnorePattern = new RegExp(
							firstOption.destructuredArrayIgnorePattern,
							"u",
						);
					}
				}
			}

			/**
			 * Determines what variable type a def is.
			 * @param  {Object} def the declaration to check
			 * @returns {VariableType} a simple name for the types of variables that this rule supports
			 */
			function defToVariableType(def) {
				/*
				 * This `destructuredArrayIgnorePattern` error report works differently from the catch
				 * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the
				 * `destructuredArrayIgnorePattern` will be checked for array destructuring. However,
				 * for the purposes of the report, the currently defined behavior is to only inform the
				 * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact
				 * that the `varsIgnorePattern` would also apply). If it's not present, the user will be
				 * informed of the `varsIgnorePattern`, assuming that's present.
				 */
				if (
					config.destructuredArrayIgnorePattern &&
					def.name.parent.type === "ArrayPattern"
				) {
					return "array-destructure";
				}

				switch (def.type) {
					case "CatchClause":
						return "catch-clause";
					case "Parameter":
						return "parameter";

					default:
						return "variable";
				}
			}

			/**
			 * Gets a given variable's description and configured ignore pattern
			 * based on the provided variableType
			 * @param {VariableType} variableType a simple name for the types of variables that this rule supports
			 * @throws {Error} (Unreachable)
			 * @returns {[string | undefined, string | undefined]} the given variable's description and
			 * ignore pattern
			 */
			function getVariableDescription(variableType) {
				let pattern;
				let variableDescription;

				switch (variableType) {
					case "array-destructure":
						pattern = config.destructuredArrayIgnorePattern;
						variableDescription = "elements of array destructuring";
						break;

					case "catch-clause":
						pattern = config.caughtErrorsIgnorePattern;
						variableDescription = "caught errors";
						break;

					case "parameter":
						pattern = config.argsIgnorePattern;
						variableDescription = "args";
						break;

					case "variable":
						pattern = config.varsIgnorePattern;
						variableDescription = "vars";
						break;

					default:
						throw new Error(
							`Unexpected variable type: ${variableType}`,
						);
				}

				if (pattern) {
					pattern = pattern.toString();
				}

				return [variableDescription, pattern];
			}

			/**
			 * Generates the message data about the variable being defined and unused,
			 * including the ignore pattern if configured.
			 * @param {Variable} unusedVar eslint-scope variable object.
			 * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
			 */
			function getDefinedMessageData(unusedVar) {
				const def = unusedVar.defs && unusedVar.defs[0];
				let additionalMessageData = "";

				if (def) {
					const [variableDescription, pattern] = getVariableDescription(
						defToVariableType(def),
					);

					if (pattern && variableDescription) {
						additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
					}
				}

				return {
					varName: unusedVar.name,
					action: "defined",
					additional: additionalMessageData,
				};
			}

			/**
			 * Generate the warning message about the variable being
			 * assigned and unused, including the ignore pattern if configured.
			 * @param {Variable} unusedVar eslint-scope variable object.
			 * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
			 */
			function getAssignedMessageData(unusedVar) {
				const def = unusedVar.defs && unusedVar.defs[0];
				let additionalMessageData = "";

				if (def) {
					const [variableDescription, pattern] = getVariableDescription(
						defToVariableType(def),
					);

					if (pattern && variableDescription) {
						additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
					}
				}

				return {
					varName: unusedVar.name,
					action: "assigned a value",
					additional: additionalMessageData,
				};
			}

			/**
			 * Generate the warning message about a variable being used even though
			 * it is marked as being ignored.
			 * @param {Variable} variable eslint-scope variable object
			 * @param {VariableType} variableType a simple name for the types of variables that this rule supports
			 * @returns {UsedIgnoredVarMessageData} The message data to be used with
			 * this used ignored variable.
			 */
			function getUsedIgnoredMessageData(variable, variableType) {
				const [variableDescription, pattern] =
					getVariableDescription(variableType);

				let additionalMessageData = "";

				if (pattern && variableDescription) {
					additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`;
				}

				return {
					varName: variable.name,
					additional: additionalMessageData,
				};
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const STATEMENT_TYPE = /(?:Statement|Declaration)$/u;

			/**
			 * Determines if a given variable is being exported from a module.
			 * @param {Variable} variable eslint-scope variable object.
			 * @returns {boolean} True if the variable is exported, false if not.
			 * @private
			 */
			function isExported(variable) {
				const definition = variable.defs[0];

				if (definition) {
					let node = definition.node;

					if (node.type === "VariableDeclarator") {
						node = node.parent;
					} else if (definition.type === "Parameter") {
						return false;
					}

					return node.parent.type.indexOf("Export") === 0;
				}
				return false;
			}

			/**
			 * Checks whether a node is a sibling of the rest property or not.
			 * @param {ASTNode} node a node to check
			 * @returns {boolean} True if the node is a sibling of the rest property, otherwise false.
			 */
			function hasRestSibling(node) {
				return (
					node.type === "Property" &&
					node.parent.type === "ObjectPattern" &&
					REST_PROPERTY_TYPE.test(node.parent.properties.at(-1).type)
				);
			}

			/**
			 * Determines if a variable has a sibling rest property
			 * @param {Variable} variable eslint-scope variable object.
			 * @returns {boolean} True if the variable has a sibling rest property, false if not.
			 * @private
			 */
			function hasRestSpreadSibling(variable) {
				if (config.ignoreRestSiblings) {
					const hasRestSiblingDefinition = variable.defs.some(def =>
						hasRestSibling(def.name.parent),
					);
					const hasRestSiblingReference = variable.references.some(ref =>
						hasRestSibling(ref.identifier.parent),
					);

					return hasRestSiblingDefinition || hasRestSiblingReference;
				}

				return false;
			}

			/**
			 * Determines if a reference is a read operation.
			 * @param {Reference} ref An eslint-scope Reference
			 * @returns {boolean} whether the given reference represents a read operation
			 * @private
			 */
			function isReadRef(ref) {
				return ref.isRead();
			}

			/**
			 * Determine if an identifier is referencing an enclosing function name.
			 * @param {Reference} ref The reference to check.
			 * @param {ASTNode[]} nodes The candidate function nodes.
			 * @returns {boolean} True if it's a self-reference, false if not.
			 * @private
			 */
			function isSelfReference(ref, nodes) {
				let scope = ref.from;

				while (scope) {
					if (nodes.includes(scope.block)) {
						return true;
					}

					scope = scope.upper;
				}

				return false;
			}

			/**
			 * Gets a list of function definitions for a specified variable.
			 * @param {Variable} variable eslint-scope variable object.
			 * @returns {ASTNode[]} Function nodes.
			 * @private
			 */
			function getFunctionDefinitions(variable) {
				const functionDefinitions = [];

				variable.defs.forEach(def => {
					const { type, node } = def;

					// FunctionDeclarations
					if (type === "FunctionName") {
						functionDefinitions.push(node);
					}

					// FunctionExpressions
					if (
						type === "Variable" &&
						node.init &&
						(node.init.type === "FunctionExpression" ||
							node.init.type === "ArrowFunctionExpression")
					) {
						functionDefinitions.push(node.init);
					}
				});
				return functionDefinitions;
			}

			/**
			 * Checks the position of given nodes.
			 * @param {ASTNode} inner A node which is expected as inside.
			 * @param {ASTNode} outer A node which is expected as outside.
			 * @returns {boolean} `true` if the `inner` node exists in the `outer` node.
			 * @private
			 */
			function isInside(inner, outer) {
				return (
					inner.range[0] >= outer.range[0] &&
					inner.range[1] <= outer.range[1]
				);
			}

			/**
			 * Checks whether a given node is unused expression or not.
			 * @param {ASTNode} node The node itself
			 * @returns {boolean} The node is an unused expression.
			 * @private
			 */
			function isUnusedExpression(node) {
				const parent = node.parent;

				if (parent.type === "ExpressionStatement") {
					return true;
				}

				if (parent.type === "SequenceExpression") {
					const isLastExpression = parent.expressions.at(-1) === node;

					if (!isLastExpression) {
						return true;
					}
					return isUnusedExpression(parent);
				}

				return false;
			}

			/**
			 * If a given reference is left-hand side of an assignment, this gets
			 * the right-hand side node of the assignment.
			 *
			 * In the following cases, this returns null.
			 *
			 * - The reference is not the LHS of an assignment expression.
			 * - The reference is inside of a loop.
			 * - The reference is inside of a function scope which is different from
			 *   the declaration.
			 * @param {eslint-scope.Reference} ref A reference to check.
			 * @param {ASTNode} prevRhsNode The previous RHS node.
			 * @returns {ASTNode|null} The RHS node or null.
			 * @private
			 */
			function getRhsNode(ref, prevRhsNode) {
				const id = ref.identifier;
				const parent = id.parent;
				const refScope = ref.from.variableScope;
				const varScope = ref.resolved.scope.variableScope;
				const canBeUsedLater =
					refScope !== varScope || astUtils.isInLoop(id);

				/*
				 * Inherits the previous node if this reference is in the node.
				 * This is for `a = a + a`-like code.
				 */
				if (prevRhsNode && isInside(id, prevRhsNode)) {
					return prevRhsNode;
				}

				if (
					parent.type === "AssignmentExpression" &&
					isUnusedExpression(parent) &&
					id === parent.left &&
					!canBeUsedLater
				) {
					return parent.right;
				}
				return null;
			}

			/**
			 * Checks whether a given function node is stored to somewhere or not.
			 * If the function node is stored, the function can be used later.
			 * @param {ASTNode} funcNode A function node to check.
			 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
			 * @returns {boolean} `true` if under the following conditions:
			 *      - the funcNode is assigned to a variable.
			 *      - the funcNode is bound as an argument of a function call.
			 *      - the function is bound to a property and the object satisfies above conditions.
			 * @private
			 */
			function isStorableFunction(funcNode, rhsNode) {
				let node = funcNode;
				let parent = funcNode.parent;

				while (parent && isInside(parent, rhsNode)) {
					switch (parent.type) {
						case "SequenceExpression":
							if (parent.expressions.at(-1) !== node) {
								return false;
							}
							break;

						case "CallExpression":
						case "NewExpression":
							return parent.callee !== node;

						case "AssignmentExpression":
						case "TaggedTemplateExpression":
						case "YieldExpression":
							return true;

						default:
							if (STATEMENT_TYPE.test(parent.type)) {
								/*
								 * If it encountered statements, this is a complex pattern.
								 * Since analyzing complex patterns is hard, this returns `true` to avoid false positive.
								 */
								return true;
							}
					}

					node = parent;
					parent = parent.parent;
				}

				return false;
			}

			/**
			 * Checks whether a given Identifier node exists inside of a function node which can be used later.
			 *
			 * "can be used later" means:
			 * - the function is assigned to a variable.
			 * - the function is bound to a property and the object can be used later.
			 * - the function is bound as an argument of a function call.
			 *
			 * If a reference exists in a function which can be used later, the reference is read when the function is called.
			 * @param {ASTNode} id An Identifier node to check.
			 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
			 * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later.
			 * @private
			 */
			function isInsideOfStorableFunction(id, rhsNode) {
				const funcNode = astUtils.getUpperFunction(id);

				return (
					funcNode &&
					isInside(funcNode, rhsNode) &&
					isStorableFunction(funcNode, rhsNode)
				);
			}

			/**
			 * Checks whether a given reference is a read to update itself or not.
			 * @param {eslint-scope.Reference} ref A reference to check.
			 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
			 * @returns {boolean} The reference is a read to update itself.
			 * @private
			 */
			function isReadForItself(ref, rhsNode) {
				const id = ref.identifier;
				const parent = id.parent;

				return (
					ref.isRead() &&
					// self update. e.g. `a += 1`, `a++`
					((parent.type === "AssignmentExpression" &&
						parent.left === id &&
						isUnusedExpression(parent) &&
						!astUtils.isLogicalAssignmentOperator(parent.operator)) ||
						(parent.type === "UpdateExpression" &&
							isUnusedExpression(parent)) ||
						// in RHS of an assignment for itself. e.g. `a = a + 1`
						(rhsNode &&
							isInside(id, rhsNode) &&
							!isInsideOfStorableFunction(id, rhsNode)))
				);
			}

			/**
			 * Determine if an identifier is used either in for-in or for-of loops.
			 * @param {Reference} ref The reference to check.
			 * @returns {boolean} whether reference is used in the for-in loops
			 * @private
			 */
			function isForInOfRef(ref) {
				let target = ref.identifier.parent;

				// "for (var ...) { return; }"
				if (target.type === "VariableDeclarator") {
					target = target.parent.parent;
				}

				if (
					target.type !== "ForInStatement" &&
					target.type !== "ForOfStatement"
				) {
					return false;
				}

				// "for (...) { return; }"
				if (target.body.type === "BlockStatement") {
					target = target.body.body[0];

					// "for (...) return;"
				} else {
					target = target.body;
				}

				// For empty loop body
				if (!target) {
					return false;
				}

				return target.type === "ReturnStatement";
			}

			/**
			 * Determines if the variable is used.
			 * @param {Variable} variable The variable to check.
			 * @returns {boolean} True if the variable is used
			 * @private
			 */
			function isUsedVariable(variable) {
				if (variable.eslintUsed) {
					return true;
				}

				const functionNodes = getFunctionDefinitions(variable);
				const isFunctionDefinition = functionNodes.length > 0;

				let rhsNode = null;

				return variable.references.some(ref => {
					if (isForInOfRef(ref)) {
						return true;
					}

					const forItself = isReadForItself(ref, rhsNode);

					rhsNode = getRhsNode(ref, rhsNode);

					return (
						isReadRef(ref) &&
						!forItself &&
						!(
							isFunctionDefinition &&
							isSelfReference(ref, functionNodes)
						)
					);
				});
			}

			/**
			 * Checks whether the given variable is after the last used parameter.
			 * @param {eslint-scope.Variable} variable The variable to check.
			 * @returns {boolean} `true` if the variable is defined after the last
			 * used parameter.
			 */
			function isAfterLastUsedArg(variable) {
				const def = variable.defs[0];
				const params = sourceCode.getDeclaredVariables(def.node);
				const posteriorParams = params.slice(params.indexOf(variable) + 1);

				// If any used parameters occur after this parameter, do not report.
				return !posteriorParams.some(
					v => v.references.length > 0 || v.eslintUsed,
				);
			}

			/**
			 * Gets an array of variables without read references.
			 * @param {Scope} scope an eslint-scope Scope object.
			 * @param {Variable[]} unusedVars an array that saving result.
			 * @returns {Variable[]} unused variables of the scope and descendant scopes.
			 * @private
			 */
			function collectUnusedVariables(scope, unusedVars) {
				const variables = scope.variables;
				const childScopes = scope.childScopes;
				let i, l;

				if (scope.type !== "global" || config.vars === "all") {
					for (i = 0, l = variables.length; i < l; ++i) {
						const variable = variables[i];

						// skip a variable of class itself name in the class scope
						if (
							scope.type === "class" &&
							scope.block.id === variable.identifiers[0]
						) {
							continue;
						}

						// skip function expression names
						if (scope.functionExpressionScope) {
							continue;
						}

						// skip variables marked with markVariableAsUsed()
						if (
							!config.reportUsedIgnorePattern &&
							variable.eslintUsed
						) {
							continue;
						}

						// skip implicit "arguments" variable
						if (
							scope.type === "function" &&
							variable.name === "arguments" &&
							variable.identifiers.length === 0
						) {
							continue;
						}

						// explicit global variables don't have definitions.
						const def = variable.defs[0];

						if (def) {
							const type = def.type;
							const refUsedInArrayPatterns = variable.references.some(
								ref =>
									ref.identifier.parent.type === "ArrayPattern",
							);

							// skip elements of array destructuring patterns
							if (
								(def.name.parent.type === "ArrayPattern" ||
									refUsedInArrayPatterns) &&
								config.destructuredArrayIgnorePattern &&
								config.destructuredArrayIgnorePattern.test(
									def.name.name,
								)
							) {
								if (
									config.reportUsedIgnorePattern &&
									isUsedVariable(variable)
								) {
									context.report({
										node: def.name,
										messageId: "usedIgnoredVar",
										data: getUsedIgnoredMessageData(
											variable,
											"array-destructure",
										),
									});
								}

								continue;
							}

							if (type === "ClassName") {
								const hasStaticBlock = def.node.body.body.some(
									node => node.type === "StaticBlock",
								);

								if (
									config.ignoreClassWithStaticInitBlock &&
									hasStaticBlock
								) {
									continue;
								}
							}

							// skip catch variables
							if (type === "CatchClause") {
								if (config.caughtErrors === "none") {
									continue;
								}

								// skip ignored parameters
								if (
									config.caughtErrorsIgnorePattern &&
									config.caughtErrorsIgnorePattern.test(
										def.name.name,
									)
								) {
									if (
										config.reportUsedIgnorePattern &&
										isUsedVariable(variable)
									) {
										context.report({
											node: def.name,
											messageId: "usedIgnoredVar",
											data: getUsedIgnoredMessageData(
												variable,
												"catch-clause",
											),
										});
									}

									continue;
								}
							} else if (type === "Parameter") {
								// skip any setter argument
								if (
									(def.node.parent.type === "Property" ||
										def.node.parent.type ===
											"MethodDefinition") &&
									def.node.parent.kind === "set"
								) {
									continue;
								}

								// if "args" option is "none", skip any parameter
								if (config.args === "none") {
									continue;
								}

								// skip ignored parameters
								if (
									config.argsIgnorePattern &&
									config.argsIgnorePattern.test(def.name.name)
								) {
									if (
										config.reportUsedIgnorePattern &&
										isUsedVariable(variable)
									) {
										context.report({
											node: def.name,
											messageId: "usedIgnoredVar",
											data: getUsedIgnoredMessageData(
												variable,
												"parameter",
											),
										});
									}

									continue;
								}

								// if "args" option is "after-used", skip used variables
								if (
									config.args === "after-used" &&
									astUtils.isFunction(def.name.parent) &&
									!isAfterLastUsedArg(variable)
								) {
									continue;
								}
							} else {
								// skip ignored variables
								if (
									config.varsIgnorePattern &&
									config.varsIgnorePattern.test(def.name.name)
								) {
									if (
										config.reportUsedIgnorePattern &&
										isUsedVariable(variable)
									) {
										context.report({
											node: def.name,
											messageId: "usedIgnoredVar",
											data: getUsedIgnoredMessageData(
												variable,
												"variable",
											),
										});
									}

									continue;
								}
							}
						}

						if (
							!isUsedVariable(variable) &&
							!isExported(variable) &&
							!hasRestSpreadSibling(variable)
						) {
							unusedVars.push(variable);
						}
					}
				}

				for (i = 0, l = childScopes.length; i < l; ++i) {
					collectUnusedVariables(childScopes[i], unusedVars);
				}

				return unusedVars;
			}

			/**
			 * fixes unused variables
			 * @param {Object} fixer fixer object
			 * @param {Object} unusedVar unused variable to fix
			 * @returns {Object} fixer object
			 */
			function handleFixes(fixer, unusedVar) {
				const id = unusedVar.identifiers[0];
				const parent = id.parent;
				const parentType = parent.type;
				const tokenBefore = sourceCode.getTokenBefore(id);
				const tokenAfter = sourceCode.getTokenAfter(id);
				const isFunction = astUtils.isFunction;
				const isLoop = astUtils.isLoop;
				const allWriteReferences = unusedVar.references.filter(ref =>
					ref.isWrite(),
				);

				/**
				 * get range from token before of a given node
				 * @param {ASTNode} node node of identifier
				 * @param {number} skips number of token to skip
				 * @returns {number} start range of token before the identifier
				 */
				function getPreviousTokenStart(node, skips) {
					return sourceCode.getTokenBefore(node, skips).range[0];
				}

				/**
				 * get range to token after of a given node
				 * @param {ASTNode} node node of identifier
				 * @param {number} skips number of token to skip
				 * @returns {number} end range of token after the identifier
				 */
				function getNextTokenEnd(node, skips) {
					return sourceCode.getTokenAfter(node, skips).range[1];
				}

				/**
				 * get the value of token before of a given node
				 * @param {ASTNode} node node of identifier
				 * @returns {string} value of token before the identifier
				 */
				function getTokenBeforeValue(node) {
					return sourceCode.getTokenBefore(node).value;
				}

				/**
				 * get the value of token after of a given node
				 * @param {ASTNode} node node of identifier
				 * @returns {string} value of token after the identifier
				 */
				function getTokenAfterValue(node) {
					return sourceCode.getTokenAfter(node).value;
				}

				/**
				 * Check if an array has a single element with null as other element.
				 * @param {ASTNode} node ArrayPattern node
				 * @returns {boolean} true if array has single element with other null elements
				 */
				function hasSingleElement(node) {
					return node.elements.filter(e => e !== null).length === 1;
				}

				/**
				 * check whether import specifier has an import of particular type
				 * @param {ASTNode} node ImportDeclaration node
				 * @param {string} type type of import to check
				 * @returns {boolean} true if import specifier has import of specified type
				 */
				function hasImportOfCertainType(node, type) {
					return node.specifiers.some(e => e.type === type);
				}

				/**
				 * Check whether declaration is safe to remove or not
				 * @param {ASTNode} nextToken next token of unused variable
				 * @param {ASTNode} prevToken previous token of unused variable
				 * @returns {boolean} true if declaration is not safe to remove
				 */
				function isDeclarationNotSafeToRemove(nextToken, prevToken) {
					return (
						nextToken.type === "String" ||
						(prevToken &&
							!astUtils.isSemicolonToken(prevToken) &&
							!astUtils.isOpeningBraceToken(prevToken))
					);
				}

				/**
				 * give fixes for unused variables in function parameters
				 * @param {ASTNode} node node to check
				 * @returns {Object} fixer object
				 */
				function fixFunctionParameters(node) {
					const parentNode = node.parent;

					if (isFunction(parentNode)) {
						// remove unused function parameter if there is only a single parameter
						if (parentNode.params.length === 1) {
							return fixer.removeRange(node.range);
						}

						// remove first unused function parameter when there are multiple parameters
						if (
							getTokenBeforeValue(node) === "(" &&
							getTokenAfterValue(node) === ","
						) {
							return fixer.removeRange([
								node.range[0],
								getNextTokenEnd(node),
							]);
						}

						// remove unused function parameters except first one when there are multiple parameters
						return fixer.removeRange([
							getPreviousTokenStart(node),
							node.range[1],
						]);
					}

					return null;
				}

				/**
				 * fix unused variable declarations and function parameters
				 * @param {ASTNode} node parent node to identifier
				 * @returns {Object} fixer object
				 */
				function fixVariables(node) {
					const parentNode = node.parent;

					// remove unused declared variables such as var a = b; or var a = b, c;
					if (parentNode.type === "VariableDeclarator") {
						// skip variable in for (const [ foo ] of bar);
						if (isLoop(parentNode.parent.parent)) {
							return null;
						}

						/*
						 * remove unused declared variable with single declaration such as 'var a = b;'
						 * remove complete declaration when there is an unused variable in 'const { a } = foo;', same for arrays.
						 */
						if (parentNode.parent.declarations.length === 1) {
							// if next token is a string it could become a directive if node is removed -> no suggestion.
							const nextToken = sourceCode.getTokenAfter(
								parentNode.parent,
							);

							// if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
							const prevToken = sourceCode.getTokenBefore(
								parentNode.parent,
							);

							if (
								nextToken &&
								isDeclarationNotSafeToRemove(nextToken, prevToken)
							) {
								return null;
							}

							return fixer.removeRange(parentNode.parent.range);
						}

						/*
						 * remove unused declared variable with multiple declaration except first one such as 'var a = b, c = d;'
						 * fix 'let bar = "hello", { a } = foo;' to 'let bar = "hello";' if 'a' is unused, same for arrays.
						 */
						if (getTokenBeforeValue(parentNode) === ",") {
							return fixer.removeRange([
								getPreviousTokenStart(parentNode),
								parentNode.range[1],
							]);
						}

						/*
						 * remove first unused declared variable when there are multiple declarations
						 * fix 'let { a } = foo, bar = "hello";' to 'let  bar = "hello";' if 'a' is unused, same for arrays.
						 */
						return fixer.removeRange([
							parentNode.range[0],
							getNextTokenEnd(parentNode),
						]);
					}

					// fixes [{a: {k}}], [{a: [k]}]
					if (getTokenBeforeValue(node) === ":") {
						if (parentNode.parent.type === "ObjectPattern") {
							// eslint-disable-next-line no-use-before-define -- due to interdependency of functions
							return fixObjectWithValueSeparator(node);
						}
					}

					// fix unused function parameters
					return fixFunctionParameters(node);
				}

				/**
				 * fix nested object like { a: { b } }
				 * @param {ASTNode} node parent node to check
				 * @returns {Object} fixer object
				 */
				function fixNestedObjectVariable(node) {
					const parentNode = node.parent;

					// fix for { a: { b: { c: { d } } } }
					if (
						parentNode.parent.parent.parent.type === "ObjectPattern" &&
						parentNode.parent.properties.length === 1
					) {
						return fixNestedObjectVariable(parentNode.parent);
					}

					// fix for { a: { b } }
					if (parentNode.parent.type === "ObjectPattern") {
						// fix for unused variables in dectructured object with single property in variable decalartion and function parameter
						if (parentNode.parent.properties.length === 1) {
							return fixVariables(parentNode.parent);
						}

						// fix for first unused property when there are multiple properties such as '{ a: { b }, c }'
						if (getTokenBeforeValue(parentNode) === "{") {
							return fixer.removeRange([
								parentNode.range[0],
								getNextTokenEnd(parentNode),
							]);
						}

						// fix for unused property except first one when there are multiple properties such as '{ k, a: { b } }'
						return fixer.removeRange([
							getPreviousTokenStart(parentNode),
							parentNode.range[1],
						]);
					}

					return null;
				}

				/**
				 * fix unused variables in array and nested array
				 * @param {ASTNode} node parent node to check
				 * @returns {Object} fixer object
				 */
				function fixNestedArrayVariable(node) {
					const parentNode = node.parent;

					// fix for nested arrays [[ a ]]
					if (
						parentNode.parent.type === "ArrayPattern" &&
						hasSingleElement(parentNode)
					) {
						return fixNestedArrayVariable(parentNode);
					}

					if (hasSingleElement(parentNode)) {
						// fixes { a: [{ b }] } or { a: [[ b ]] }
						if (getTokenBeforeValue(parentNode) === ":") {
							return fixVariables(parentNode);
						}

						// fixes [a, ...[[ b ]]] or [a, ...[{ b }]]
						if (parentNode.parent.type === "RestElement") {
							// eslint-disable-next-line no-use-before-define -- due to interdependency of functions
							return fixRestInPattern(parentNode.parent);
						}

						// fix unused variables in destructured array in variable declaration or function parameter
						return fixVariables(parentNode);
					}

					// remove last unused array element
					if (
						getTokenBeforeValue(node) === "," &&
						getTokenAfterValue(node) === "]"
					) {
						return fixer.removeRange([
							getPreviousTokenStart(node),
							node.range[1],
						]);
					}

					// remove unused array element
					return fixer.removeRange(node.range);
				}

				/**
				 * fix cases like {a: {k}} or {a: [k]}
				 * @param {ASTNode} node parent node to check
				 * @returns {Object} fixer object
				 */
				function fixObjectWithValueSeparator(node) {
					const parentNode = node.parent.parent;

					// fix cases like [{a : { b }}] or [{a : [ b ]}]
					if (
						parentNode.parent.type === "ArrayPattern" &&
						parentNode.properties.length === 1
					) {
						return fixNestedArrayVariable(parentNode);
					}

					// fix cases like {a: {k}} or {a: [k]}
					return fixNestedObjectVariable(node);
				}

				/**
				 * fix ...[[a]] or ...[{a}] like patterns
				 * @param {ASTNode} node parent node to check
				 * @returns {Object} fixer object
				 */
				function fixRestInPattern(node) {
					const parentNode = node.parent;

					// fix ...[[a]] or ...[{a}] in function parameters
					if (isFunction(parentNode)) {
						if (parentNode.params.length === 1) {
							return fixer.removeRange(node.range);
						}

						return fixer.removeRange([
							getPreviousTokenStart(node),
							node.range[1],
						]);
					}

					// fix rest in nested array pattern like [[a, ...[b]]]
					if (parentNode.type === "ArrayPattern") {
						// fix [[...[b]]]
						if (hasSingleElement(parentNode)) {
							if (parentNode.parent.type === "ArrayPattern") {
								return fixNestedArrayVariable(parentNode);
							}

							// fix 'const [...[b]] = foo; and function foo([...[b]]) {}
							return fixVariables(parentNode);
						}

						// fix [[a, ...[b]]]
						return fixer.removeRange([
							getPreviousTokenStart(node),
							node.range[1],
						]);
					}

					return null;
				}

				// skip fix when variable has references that would be left behind
				if (
					allWriteReferences.some(
						ref => ref.identifier.range[0] !== id.range[0],
					)
				) {
					return null;
				}

				// remove declared variables such as var a; or var a, b;
				if (parentType === "VariableDeclarator") {
					if (parent.parent.declarations.length === 1) {
						// prevent fix of variable in forOf and forIn loops.
						if (
							isLoop(parent.parent.parent) &&
							parent.parent.parent.body !== parent.parent
						) {
							return null;
						}

						// removes only variable not semicolon in 'if (foo()) var bar;' or in 'loops' or in 'with' statement.
						if (
							parent.parent.parent.type === "IfStatement" ||
							isLoop(parent.parent.parent) ||
							(parent.parent.parent.type === "WithStatement" &&
								parent.parent.parent.body === parent.parent)
						) {
							return fixer.replaceText(parent.parent, ";");
						}

						// if next token is a string it could become a directive if node is removed -> no suggestion.
						const nextToken = sourceCode.getTokenAfter(parent.parent);

						// if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
						const prevToken = sourceCode.getTokenBefore(parent.parent);

						if (
							nextToken &&
							isDeclarationNotSafeToRemove(nextToken, prevToken)
						) {
							return null;
						}

						// remove unused declared variable with single declaration like 'var a = b;'
						return fixer.removeRange(parent.parent.range);
					}

					// remove unused declared variable with multiple declaration except first one like 'var a = b, c = d;'
					if (tokenBefore.value === ",") {
						return fixer.removeRange([
							tokenBefore.range[0],
							parent.range[1],
						]);
					}

					// remove first unused declared variable when there are multiple declarations
					return fixer.removeRange([
						parent.range[0],
						getNextTokenEnd(parent),
					]);
				}

				// remove variables in object patterns
				if (parent.parent.type === "ObjectPattern") {
					if (parent.parent.properties.length === 1) {
						// fix [a, ...{b}]
						if (parent.parent.parent.type === "RestElement") {
							return fixRestInPattern(parent.parent.parent);
						}

						// fix [{ a }]
						if (parent.parent.parent.type === "ArrayPattern") {
							return fixNestedArrayVariable(parent.parent);
						}

						/*
						 * var {a} = foo;
						 * function a({a}) {}
						 * fix const { a: { b } } = foo;
						 */
						return fixVariables(parent.parent);
					}

					// fix const { a:b } = foo;
					if (tokenBefore.value === ":") {
						// remove first unused variable in const { a:b } = foo;
						if (
							getTokenBeforeValue(parent) === "{" &&
							getTokenAfterValue(parent) === ","
						) {
							return fixer.removeRange([
								parent.range[0],
								getNextTokenEnd(parent),
							]);
						}

						// remove unused variables in const { a: b, c: d } = foo; except first one
						return fixer.removeRange([
							getPreviousTokenStart(parent),
							id.range[1],
						]);
					}
				}

				// remove unused variables inside an array
				if (parentType === "ArrayPattern") {
					if (hasSingleElement(parent)) {
						// fix [a, ...[b]]
						if (parent.parent.type === "RestElement") {
							return fixRestInPattern(parent.parent);
						}

						// fix [ [a] ]
						if (parent.parent.type === "ArrayPattern") {
							return fixNestedArrayVariable(parent);
						}

						/*
						 * fix var [a] = foo;
						 * fix function foo([a]) {}
						 * fix const { a: [b] } = foo;
						 */
						return fixVariables(parent);
					}

					// if "a" is unused in [a, b ,c] fixes to [, b, c]
					if (tokenBefore.value === "," && tokenAfter.value === ",") {
						return fixer.removeRange(id.range);
					}
				}

				// remove unused rest elements
				if (parentType === "RestElement") {
					// fix [a, ...rest]
					if (parent.parent.type === "ArrayPattern") {
						if (hasSingleElement(parent.parent)) {
							// fix [[...rest]] when there is only rest element
							if (parent.parent.parent.type === "ArrayPattern") {
								return fixNestedArrayVariable(parent.parent);
							}

							// fix 'const [...rest] = foo;' and 'function foo([...rest]) {}'
							return fixVariables(parent.parent);
						}

						// fix [a, ...rest]
						return fixer.removeRange([
							getPreviousTokenStart(id, 1),
							id.range[1],
						]);
					}

					// fix { a, ...rest}
					if (parent.parent.type === "ObjectPattern") {
						// fix 'const {...rest} = foo;' and 'function foo({...rest}) {}'
						if (parent.parent.properties.length === 1) {
							return fixVariables(parent.parent);
						}

						// fix { a, ...rest} when there are multiple properties
						return fixer.removeRange([
							getPreviousTokenStart(id, 1),
							id.range[1],
						]);
					}

					// fix function foo(...rest) {}
					if (isFunction(parent.parent)) {
						// remove unused rest in function parameter if there is only single parameter
						if (parent.parent.params.length === 1) {
							return fixer.removeRange(parent.range);
						}

						// remove unused rest in function parameter if there multiple parameter
						return fixer.removeRange([
							getPreviousTokenStart(parent),
							parent.range[1],
						]);
					}
				}

				if (parentType === "AssignmentPattern") {
					// fix [a = aDefault]
					if (parent.parent.type === "ArrayPattern") {
						return fixNestedArrayVariable(parent);
					}

					// fix {a = aDefault}
					if (parent.parent.parent.type === "ObjectPattern") {
						if (parent.parent.parent.properties.length === 1) {
							// fixes [{a = aDefault}]
							if (
								parent.parent.parent.parent.type === "ArrayPattern"
							) {
								return fixNestedArrayVariable(parent.parent.parent);
							}

							// fix 'const {a = aDefault} = foo;' and 'function foo({a = aDefault}) {}'
							return fixVariables(parent.parent.parent);
						}

						// fix unused 'a' in {a = aDefault} if it is the first property
						if (
							getTokenBeforeValue(parent.parent) === "{" &&
							getTokenAfterValue(parent.parent) === ","
						) {
							return fixer.removeRange([
								parent.parent.range[0],
								getNextTokenEnd(parent.parent),
							]);
						}

						// fix unused 'b' in {a, b = aDefault} if it is not the first property
						return fixer.removeRange([
							getPreviousTokenStart(parent.parent),
							parent.parent.range[1],
						]);
					}

					// fix unused assignment patterns in function parameters
					if (isFunction(parent.parent)) {
						return fixFunctionParameters(parent);
					}
				}

				// remove unused functions
				if (parentType === "FunctionDeclaration" && parent.id === id) {
					return fixer.removeRange(parent.range);
				}

				// remove unused default import
				if (parentType === "ImportDefaultSpecifier") {
					// remove unused default import when there are not other imports
					if (
						!hasImportOfCertainType(parent.parent, "ImportSpecifier") &&
						!hasImportOfCertainType(
							parent.parent,
							"ImportNamespaceSpecifier",
						)
					) {
						return fixer.removeRange([
							parent.range[0],
							parent.parent.source.range[0],
						]);
					}

					// remove unused default import when there are other imports also
					return fixer.removeRange([id.range[0], tokenAfter.range[1]]);
				}

				if (parentType === "ImportSpecifier") {
					// remove unused imports when there is a single import
					if (
						parent.parent.specifiers.filter(
							e => e.type === "ImportSpecifier",
						).length === 1
					) {
						// remove unused import when there is no default import
						if (
							!hasImportOfCertainType(
								parent.parent,
								"ImportDefaultSpecifier",
							)
						) {
							return fixer.removeRange(parent.parent.range);
						}

						// fixes "import foo from 'module';" to "import 'module';"
						return fixer.removeRange([
							getPreviousTokenStart(parent, 1),
							tokenAfter.range[1],
						]);
					}

					if (getTokenBeforeValue(parent) === "{") {
						return fixer.removeRange([
							parent.range[0],
							getNextTokenEnd(parent),
						]);
					}

					return fixer.removeRange([
						getPreviousTokenStart(parent),
						parent.range[1],
					]);
				}

				if (parentType === "ImportNamespaceSpecifier") {
					if (
						hasImportOfCertainType(
							parent.parent,
							"ImportDefaultSpecifier",
						)
					) {
						return fixer.removeRange([
							getPreviousTokenStart(parent),
							parent.range[1],
						]);
					}

					// fixes "import * as foo from 'module';" to "import 'module';"
					return fixer.removeRange([
						parent.range[0],
						parent.parent.source.range[0],
					]);
				}

				// skip error in catch(error) variable
				if (parentType === "CatchClause") {
					return null;
				}

				// remove unused declared classes
				if (parentType === "ClassDeclaration") {
					return fixer.removeRange(parent.range);
				}

				// remove unused varible that is in a sequence [a,b] fixes to [a]
				if (tokenBefore?.value === ",") {
					return fixer.removeRange([tokenBefore.range[0], id.range[1]]);
				}

				// remove unused varible that is in a sequence inside function arguments and object pattern
				if (tokenAfter.value === ",") {
					// fix function foo(a, b) {}
					if (tokenBefore.value === "(") {
						return fixer.removeRange([
							id.range[0],
							tokenAfter.range[1],
						]);
					}

					// fix const {a, b} = foo;
					if (tokenBefore.value === "{") {
						return fixer.removeRange([
							id.range[0],
							tokenAfter.range[1],
						]);
					}
				}

				if (
					parentType === "ArrowFunctionExpression" &&
					parent.params.length === 1 &&
					tokenAfter?.value !== ")"
				) {
					return fixer.replaceText(id, "()");
				}

				return fixer.removeRange(id.range);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				"Program:exit"(programNode) {
					const unusedVars = collectUnusedVariables(
						sourceCode.getScope(programNode),
						[],
					);

					for (let i = 0, l = unusedVars.length; i < l; ++i) {
						const unusedVar = unusedVars[i];

						// Report the first declaration.
						if (unusedVar.defs.length > 0) {
							// report last write reference, https://github.com/eslint/eslint/issues/14324
							const writeReferences = unusedVar.references.filter(
								ref =>
									ref.isWrite() &&
									ref.from.variableScope ===
										unusedVar.scope.variableScope,
							);

							let referenceToReport;

							if (writeReferences.length > 0) {
								referenceToReport = writeReferences.at(-1);
							}

							context.report({
								node: referenceToReport
									? referenceToReport.identifier
									: unusedVar.identifiers[0],
								messageId: "unusedVar",
								data: unusedVar.references.some(ref =>
									ref.isWrite(),
								)
									? getAssignedMessageData(unusedVar)
									: getDefinedMessageData(unusedVar),
								suggest: [
									{
										messageId: "removeVar",
										data: {
											varName: unusedVar.name,
										},
										fix(fixer) {
											return handleFixes(fixer, unusedVar);
										},
									},
								],
							});

							// If there are no regular declaration, report the first `/*globals*/` comment directive.
						} else if (unusedVar.eslintExplicitGlobalComments) {
							const directiveComment =
								unusedVar.eslintExplicitGlobalComments[0];

							context.report({
								node: programNode,
								loc: astUtils.getNameLocationInGlobalDirectiveComment(
									sourceCode,
									directiveComment,
									unusedVar.name,
								),
								messageId: "unusedVar",
								data: getDefinedMessageData(unusedVar),
							});
						}
					}
				},
			};
		},
	};
	return noUnusedVars;
}

/**
 * @fileoverview Rule to flag use of variables before they are defined
 * @author Ilya Volodin
 */

var noUseBeforeDefine;
var hasRequiredNoUseBeforeDefine;

function requireNoUseBeforeDefine () {
	if (hasRequiredNoUseBeforeDefine) return noUseBeforeDefine;
	hasRequiredNoUseBeforeDefine = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const SENTINEL_TYPE =
		/^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;
	const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;

	/**
	 * Parses a given value as options.
	 * @param {any} options A value to parse.
	 * @returns {Object} The parsed options.
	 */
	function parseOptions(options) {
		if (typeof options === "object" && options !== null) {
			return options;
		}

		const functions = typeof options === "string" ? options !== "nofunc" : true;

		return {
			functions,
			classes: true,
			variables: true,
			allowNamedExports: false,
		};
	}

	/**
	 * Checks whether or not a given location is inside of the range of a given node.
	 * @param {ASTNode} node An node to check.
	 * @param {number} location A location to check.
	 * @returns {boolean} `true` if the location is inside of the range of the node.
	 */
	function isInRange(node, location) {
		return node && node.range[0] <= location && location <= node.range[1];
	}

	/**
	 * Checks whether or not a given location is inside of the range of a class static initializer.
	 * Static initializers are static blocks and initializers of static fields.
	 * @param {ASTNode} node `ClassBody` node to check static initializers.
	 * @param {number} location A location to check.
	 * @returns {boolean} `true` if the location is inside of a class static initializer.
	 */
	function isInClassStaticInitializerRange(node, location) {
		return node.body.some(
			classMember =>
				(classMember.type === "StaticBlock" &&
					isInRange(classMember, location)) ||
				(classMember.type === "PropertyDefinition" &&
					classMember.static &&
					classMember.value &&
					isInRange(classMember.value, location)),
		);
	}

	/**
	 * Checks whether a given scope is the scope of a class static initializer.
	 * Static initializers are static blocks and initializers of static fields.
	 * @param {eslint-scope.Scope} scope A scope to check.
	 * @returns {boolean} `true` if the scope is a class static initializer scope.
	 */
	function isClassStaticInitializerScope(scope) {
		if (scope.type === "class-static-block") {
			return true;
		}

		if (scope.type === "class-field-initializer") {
			// `scope.block` is PropertyDefinition#value node
			const propertyDefinition = scope.block.parent;

			return propertyDefinition.static;
		}

		return false;
	}

	/**
	 * Checks whether a given reference is evaluated in an execution context
	 * that isn't the one where the variable it refers to is defined.
	 * Execution contexts are:
	 * - top-level
	 * - functions
	 * - class field initializers (implicit functions)
	 * - class static blocks (implicit functions)
	 * Static class field initializers and class static blocks are automatically run during the class definition evaluation,
	 * and therefore we'll consider them as a part of the parent execution context.
	 * Example:
	 *
	 *   const x = 1;
	 *
	 *   x; // returns `false`
	 *   () => x; // returns `true`
	 *
	 *   class C {
	 *       field = x; // returns `true`
	 *       static field = x; // returns `false`
	 *
	 *       method() {
	 *           x; // returns `true`
	 *       }
	 *
	 *       static method() {
	 *           x; // returns `true`
	 *       }
	 *
	 *       static {
	 *           x; // returns `false`
	 *       }
	 *   }
	 * @param {eslint-scope.Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is from a separate execution context.
	 */
	function isFromSeparateExecutionContext(reference) {
		const variable = reference.resolved;
		let scope = reference.from;

		// Scope#variableScope represents execution context
		while (variable.scope.variableScope !== scope.variableScope) {
			if (isClassStaticInitializerScope(scope.variableScope)) {
				scope = scope.variableScope.upper;
			} else {
				return true;
			}
		}

		return false;
	}

	/**
	 * Checks whether or not a given reference is evaluated during the initialization of its variable.
	 *
	 * This returns `true` in the following cases:
	 *
	 *     var a = a
	 *     var [a = a] = list
	 *     var {a = a} = obj
	 *     for (var a in a) {}
	 *     for (var a of a) {}
	 *     var C = class { [C]; };
	 *     var C = class { static foo = C; };
	 *     var C = class { static { foo = C; } };
	 *     class C extends C {}
	 *     class C extends (class { static foo = C; }) {}
	 *     class C { [C]; }
	 * @param {Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is evaluated during the initialization.
	 */
	function isEvaluatedDuringInitialization(reference) {
		if (isFromSeparateExecutionContext(reference)) {
			/*
			 * Even if the reference appears in the initializer, it isn't evaluated during the initialization.
			 * For example, `const x = () => x;` is valid.
			 */
			return false;
		}

		const location = reference.identifier.range[1];
		const definition = reference.resolved.defs[0];

		if (definition.type === "ClassName") {
			// `ClassDeclaration` or `ClassExpression`
			const classDefinition = definition.node;

			return (
				isInRange(classDefinition, location) &&
				/*
				 * Class binding is initialized before running static initializers.
				 * For example, `class C { static foo = C; static { bar = C; } }` is valid.
				 */
				!isInClassStaticInitializerRange(classDefinition.body, location)
			);
		}

		let node = definition.name.parent;

		while (node) {
			if (node.type === "VariableDeclarator") {
				if (isInRange(node.init, location)) {
					return true;
				}
				if (
					FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
					isInRange(node.parent.parent.right, location)
				) {
					return true;
				}
				break;
			} else if (node.type === "AssignmentPattern") {
				if (isInRange(node.right, location)) {
					return true;
				}
			} else if (SENTINEL_TYPE.test(node.type)) {
				break;
			}

			node = node.parent;
		}

		return false;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUseBeforeDefine = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow the use of variables before they are defined",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-use-before-define",
			},

			schema: [
				{
					oneOf: [
						{
							enum: ["nofunc"],
						},
						{
							type: "object",
							properties: {
								functions: { type: "boolean" },
								classes: { type: "boolean" },
								variables: { type: "boolean" },
								allowNamedExports: { type: "boolean" },
							},
							additionalProperties: false,
						},
					],
				},
			],

			defaultOptions: [
				{
					classes: true,
					functions: true,
					variables: true,
					allowNamedExports: false,
				},
			],

			messages: {
				usedBeforeDefined: "'{{name}}' was used before it was defined.",
			},
		},

		create(context) {
			const options = parseOptions(context.options[0]);
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether a given reference should be checked.
			 *
			 * Returns `false` if the reference is:
			 * - initialization's (e.g., `let a = 1`).
			 * - referring to an undefined variable (i.e., if it's an unresolved reference).
			 * - referring to a variable that is defined, but not in the given source code
			 *   (e.g., global environment variable or `arguments` in functions).
			 * - allowed by options.
			 * @param {eslint-scope.Reference} reference The reference
			 * @returns {boolean} `true` if the reference should be checked
			 */
			function shouldCheck(reference) {
				if (reference.init) {
					return false;
				}

				const { identifier } = reference;

				if (
					options.allowNamedExports &&
					identifier.parent.type === "ExportSpecifier" &&
					identifier.parent.local === identifier
				) {
					return false;
				}

				const variable = reference.resolved;

				if (!variable || variable.defs.length === 0) {
					return false;
				}

				const definitionType = variable.defs[0].type;

				if (!options.functions && definitionType === "FunctionName") {
					return false;
				}

				if (
					((!options.variables && definitionType === "Variable") ||
						(!options.classes && definitionType === "ClassName")) &&
					// don't skip checking the reference if it's in the same execution context, because of TDZ
					isFromSeparateExecutionContext(reference)
				) {
					return false;
				}

				return true;
			}

			/**
			 * Finds and validates all references in a given scope and its child scopes.
			 * @param {eslint-scope.Scope} scope The scope object.
			 * @returns {void}
			 */
			function checkReferencesInScope(scope) {
				scope.references.filter(shouldCheck).forEach(reference => {
					const variable = reference.resolved;
					const definitionIdentifier = variable.defs[0].name;

					if (
						reference.identifier.range[1] <
							definitionIdentifier.range[1] ||
						isEvaluatedDuringInitialization(reference)
					) {
						context.report({
							node: reference.identifier,
							messageId: "usedBeforeDefined",
							data: reference.identifier,
						});
					}
				});

				scope.childScopes.forEach(checkReferencesInScope);
			}

			return {
				Program(node) {
					checkReferencesInScope(sourceCode.getScope(node));
				},
			};
		},
	};
	return noUseBeforeDefine;
}

/**
 * @fileoverview A rule to disallow unnecessary assignments`.
 * @author Yosuke Ota
 */

var noUselessAssignment;
var hasRequiredNoUselessAssignment;

function requireNoUselessAssignment () {
	if (hasRequiredNoUselessAssignment) return noUselessAssignment;
	hasRequiredNoUselessAssignment = 1;

	const { findVariable } = /*@__PURE__*/ requireEslintUtils();

	//------------------------------------------------------------------------------
	// Types
	//------------------------------------------------------------------------------

	/** @typedef {import("estree").Node} ASTNode */
	/** @typedef {import("estree").Pattern} Pattern */
	/** @typedef {import("estree").Identifier} Identifier */
	/** @typedef {import("estree").VariableDeclarator} VariableDeclarator */
	/** @typedef {import("estree").AssignmentExpression} AssignmentExpression */
	/** @typedef {import("estree").UpdateExpression} UpdateExpression */
	/** @typedef {import("estree").Expression} Expression */
	/** @typedef {import("eslint-scope").Scope} Scope */
	/** @typedef {import("eslint-scope").Variable} Variable */
	/** @typedef {import("../linter/code-path-analysis/code-path")} CodePath */
	/** @typedef {import("../linter/code-path-analysis/code-path-segment")} CodePathSegment */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Extract identifier from the given pattern node used on the left-hand side of the assignment.
	 * @param {Pattern} pattern The pattern node to extract identifier
	 * @returns {Iterable<Identifier>} The extracted identifier
	 */
	function* extractIdentifiersFromPattern(pattern) {
		switch (pattern.type) {
			case "Identifier":
				yield pattern;
				return;
			case "ObjectPattern":
				for (const property of pattern.properties) {
					yield* extractIdentifiersFromPattern(
						property.type === "Property" ? property.value : property,
					);
				}
				return;
			case "ArrayPattern":
				for (const element of pattern.elements) {
					if (!element) {
						continue;
					}
					yield* extractIdentifiersFromPattern(element);
				}
				return;
			case "RestElement":
				yield* extractIdentifiersFromPattern(pattern.argument);
				return;
			case "AssignmentPattern":
				yield* extractIdentifiersFromPattern(pattern.left);

			// no default
		}
	}

	/**
	 * Checks whether the given identifier node is evaluated after the assignment identifier.
	 * @param {AssignmentInfo} assignment The assignment info.
	 * @param {Identifier} identifier The identifier to check.
	 * @returns {boolean} `true` if the given identifier node is evaluated after the assignment identifier.
	 */
	function isIdentifierEvaluatedAfterAssignment(assignment, identifier) {
		if (identifier.range[0] < assignment.identifier.range[1]) {
			return false;
		}
		if (
			assignment.expression &&
			assignment.expression.range[0] <= identifier.range[0] &&
			identifier.range[1] <= assignment.expression.range[1]
		) {
			/*
			 * The identifier node is in an expression that is evaluated before the assignment.
			 * e.g. x = id;
			 *          ^^ identifier to check
			 *      ^      assignment identifier
			 */
			return false;
		}

		/*
		 * e.g.
		 *      x = 42; id;
		 *              ^^ identifier to check
		 *      ^          assignment identifier
		 *      let { x, y = id } = obj;
		 *                   ^^  identifier to check
		 *            ^          assignment identifier
		 */
		return true;
	}

	/**
	 * Checks whether the given identifier node is used between the assigned identifier and the equal sign.
	 *
	 * e.g. let { x, y = x } = obj;
	 *                   ^   identifier to check
	 *            ^          assigned identifier
	 * @param {AssignmentInfo} assignment The assignment info.
	 * @param {Identifier} identifier The identifier to check.
	 * @returns {boolean} `true` if the given identifier node is used between the assigned identifier and the equal sign.
	 */
	function isIdentifierUsedBetweenAssignedAndEqualSign(assignment, identifier) {
		if (!assignment.expression) {
			return false;
		}
		return (
			assignment.identifier.range[1] <= identifier.range[0] &&
			identifier.range[1] <= assignment.expression.range[0]
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessAssignment = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow variable assignments when the value is not used",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-useless-assignment",
			},

			schema: [],

			messages: {
				unnecessaryAssignment:
					"This assigned value is not used in subsequent statements.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * @typedef {Object} ScopeStack
			 * @property {CodePath} codePath The code path of this scope stack.
			 * @property {Scope} scope The scope of this scope stack.
			 * @property {ScopeStack} upper The upper scope stack.
			 * @property {Record<string, ScopeStackSegmentInfo>} segments The map of ScopeStackSegmentInfo.
			 * @property {Set<CodePathSegment>} currentSegments The current CodePathSegments.
			 * @property {Map<Variable, AssignmentInfo[]>} assignments The map of list of AssignmentInfo for each variable.
			 * @property {Array} tryStatementBlocks The array of TryStatement block nodes in this scope stack.
			 */
			/**
			 * @typedef {Object} ScopeStackSegmentInfo
			 * @property {CodePathSegment} segment The code path segment.
			 * @property {Identifier|null} first The first identifier that appears within the segment.
			 * @property {Identifier|null} last The last identifier that appears within the segment.
			 * `first` and `last` are used to determine whether an identifier exists within the segment position range.
			 * Since it is used as a range of segments, we should originally hold all nodes, not just identifiers,
			 * but since the only nodes to be judged are identifiers, it is sufficient to have a range of identifiers.
			 */
			/**
			 * @typedef {Object} AssignmentInfo
			 * @property {Variable} variable The variable that is assigned.
			 * @property {Identifier} identifier The identifier that is assigned.
			 * @property {VariableDeclarator|AssignmentExpression|UpdateExpression} node The node where the variable was updated.
			 * @property {Expression|null} expression The expression that is evaluated before the assignment.
			 * @property {CodePathSegment[]} segments The code path segments where the assignment was made.
			 */

			/** @type {ScopeStack} */
			let scopeStack = null;

			/** @type {Set<Scope>} */
			const codePathStartScopes = new Set();

			/**
			 * Gets the scope of code path start from given scope
			 * @param {Scope} scope The initial scope
			 * @returns {Scope} The scope of code path start
			 * @throws {Error} Unexpected error
			 */
			function getCodePathStartScope(scope) {
				let target = scope;

				while (target) {
					if (codePathStartScopes.has(target)) {
						return target;
					}
					target = target.upper;
				}

				// Should be unreachable
				return null;
			}

			/**
			 * Verify the given scope stack.
			 * @param {ScopeStack} target The scope stack to verify.
			 * @returns {void}
			 */
			function verify(target) {
				/**
				 * Checks whether the given identifier is used in the segment.
				 * @param {CodePathSegment} segment The code path segment.
				 * @param {Identifier} identifier The identifier to check.
				 * @returns {boolean} `true` if the identifier is used in the segment.
				 */
				function isIdentifierUsedInSegment(segment, identifier) {
					const segmentInfo = target.segments[segment.id];

					return (
						segmentInfo.first &&
						segmentInfo.last &&
						segmentInfo.first.range[0] <= identifier.range[0] &&
						identifier.range[1] <= segmentInfo.last.range[1]
					);
				}

				/**
				 * Verifies whether the given assignment info is an used assignment.
				 * Report if it is an unused assignment.
				 * @param {AssignmentInfo} targetAssignment The assignment info to verify.
				 * @param {AssignmentInfo[]} allAssignments The list of all assignment info for variables.
				 * @returns {void}
				 */
				function verifyAssignmentIsUsed(targetAssignment, allAssignments) {
					// Skip assignment if it is in a try block.
					const isAssignmentInTryBlock = target.tryStatementBlocks.some(
						tryBlock =>
							tryBlock.range[0] <=
								targetAssignment.identifier.range[0] &&
							targetAssignment.identifier.range[1] <=
								tryBlock.range[1],
					);

					if (isAssignmentInTryBlock) {
						return;
					}

					/**
					 * @typedef {Object} SubsequentSegmentData
					 * @property {CodePathSegment} segment The code path segment
					 * @property {AssignmentInfo} [assignment] The first occurrence of the assignment within the segment.
					 * There is no need to check if the variable is used after this assignment,
					 * as the value it was assigned will be used.
					 */

					/**
					 * Information used in `getSubsequentSegments()`.
					 * To avoid unnecessary iterations, cache information that has already been iterated over,
					 * and if additional iterations are needed, start iterating from the retained position.
					 */
					const subsequentSegmentData = {
						/**
						 * Cache of subsequent segment information list that have already been iterated.
						 * @type {SubsequentSegmentData[]}
						 */
						results: [],

						/**
						 * Subsequent segments that have already been iterated on. Used to avoid infinite loops.
						 * @type {Set<CodePathSegment>}
						 */
						subsequentSegments: new Set(),

						/**
						 * Unexplored code path segment.
						 * If additional iterations are needed, consume this information and iterate.
						 * @type {CodePathSegment[]}
						 */
						queueSegments: targetAssignment.segments.flatMap(
							segment => segment.nextSegments,
						),
					};

					/**
					 * Gets the subsequent segments from the segment of
					 * the assignment currently being validated (targetAssignment).
					 * @returns {Iterable<SubsequentSegmentData>} the subsequent segments
					 */
					function* getSubsequentSegments() {
						yield* subsequentSegmentData.results;

						while (subsequentSegmentData.queueSegments.length > 0) {
							const nextSegment =
								subsequentSegmentData.queueSegments.shift();

							if (
								subsequentSegmentData.subsequentSegments.has(
									nextSegment,
								)
							) {
								continue;
							}
							subsequentSegmentData.subsequentSegments.add(
								nextSegment,
							);

							const assignmentInSegment = allAssignments.find(
								otherAssignment =>
									otherAssignment.segments.includes(
										nextSegment,
									) &&
									!isIdentifierUsedBetweenAssignedAndEqualSign(
										otherAssignment,
										targetAssignment.identifier,
									),
							);

							if (!assignmentInSegment) {
								/*
								 * Stores the next segment to explore.
								 * If `assignmentInSegment` exists,
								 * we are guarding it because we don't need to explore the next segment.
								 */
								subsequentSegmentData.queueSegments.push(
									...nextSegment.nextSegments,
								);
							}

							/** @type {SubsequentSegmentData} */
							const result = {
								segment: nextSegment,
								assignment: assignmentInSegment,
							};

							subsequentSegmentData.results.push(result);
							yield result;
						}
					}

					if (
						targetAssignment.variable.references.some(
							ref => ref.identifier.type !== "Identifier",
						)
					) {
						/**
						 * Skip checking for a variable that has at least one non-identifier reference.
						 * It's generated by plugins and cannot be handled reliably in the core rule.
						 */
						return;
					}

					const readReferences =
						targetAssignment.variable.references.filter(reference =>
							reference.isRead(),
						);

					if (!readReferences.length) {
						/*
						 * It is not just an unnecessary assignment, but an unnecessary (unused) variable
						 * and thus should not be reported by this rule because it is reported by `no-unused-vars`.
						 */
						return;
					}

					/**
					 * Other assignment on the current segment and after current assignment.
					 */
					const otherAssignmentAfterTargetAssignment =
						allAssignments.find(assignment => {
							if (
								assignment === targetAssignment ||
								(assignment.segments.length &&
									assignment.segments.every(
										segment =>
											!targetAssignment.segments.includes(
												segment,
											),
									))
							) {
								return false;
							}
							if (
								isIdentifierEvaluatedAfterAssignment(
									targetAssignment,
									assignment.identifier,
								)
							) {
								return true;
							}
							if (
								assignment.expression &&
								assignment.expression.range[0] <=
									targetAssignment.identifier.range[0] &&
								targetAssignment.identifier.range[1] <=
									assignment.expression.range[1]
							) {
								/*
								 * The target assignment is in an expression that is evaluated before the assignment.
								 * e.g. x=(x=1);
								 *         ^^^ targetAssignment
								 *      ^^^^^^^ assignment
								 */
								return true;
							}

							return false;
						});

					for (const reference of readReferences) {
						/*
						 * If the scope of the reference is outside the current code path scope,
						 * we cannot track whether this assignment is not used.
						 * For example, it can also be called asynchronously.
						 */
						if (
							target.scope !== getCodePathStartScope(reference.from)
						) {
							return;
						}

						// Checks if it is used in the same segment as the target assignment.
						if (
							isIdentifierEvaluatedAfterAssignment(
								targetAssignment,
								reference.identifier,
							) &&
							(isIdentifierUsedBetweenAssignedAndEqualSign(
								targetAssignment,
								reference.identifier,
							) ||
								targetAssignment.segments.some(segment =>
									isIdentifierUsedInSegment(
										segment,
										reference.identifier,
									),
								))
						) {
							if (
								otherAssignmentAfterTargetAssignment &&
								isIdentifierEvaluatedAfterAssignment(
									otherAssignmentAfterTargetAssignment,
									reference.identifier,
								)
							) {
								// There was another assignment before the reference. Therefore, it has not been used yet.
								continue;
							}

							// Uses in statements after the written identifier.
							return;
						}

						if (otherAssignmentAfterTargetAssignment) {
							/*
							 * The assignment was followed by another assignment in the same segment.
							 * Therefore, there is no need to check the next segment.
							 */
							continue;
						}

						// Check subsequent segments.
						for (const subsequentSegment of getSubsequentSegments()) {
							if (
								isIdentifierUsedInSegment(
									subsequentSegment.segment,
									reference.identifier,
								)
							) {
								if (
									subsequentSegment.assignment &&
									isIdentifierEvaluatedAfterAssignment(
										subsequentSegment.assignment,
										reference.identifier,
									)
								) {
									// There was another assignment before the reference. Therefore, it has not been used yet.
									continue;
								}

								// It is used
								return;
							}
						}
					}
					context.report({
						node: targetAssignment.identifier,
						messageId: "unnecessaryAssignment",
					});
				}

				// Verify that each assignment in the code path is used.
				for (const assignments of target.assignments.values()) {
					assignments.sort(
						(a, b) => a.identifier.range[0] - b.identifier.range[0],
					);
					for (const assignment of assignments) {
						verifyAssignmentIsUsed(assignment, assignments);
					}
				}
			}

			return {
				onCodePathStart(codePath, node) {
					const scope = sourceCode.getScope(node);

					scopeStack = {
						upper: scopeStack,
						codePath,
						scope,
						segments: Object.create(null),
						currentSegments: new Set(),
						assignments: new Map(),
						tryStatementBlocks: [],
					};
					codePathStartScopes.add(scopeStack.scope);
				},
				onCodePathEnd() {
					verify(scopeStack);

					scopeStack = scopeStack.upper;
				},
				onCodePathSegmentStart(segment) {
					const segmentInfo = { segment, first: null, last: null };

					scopeStack.segments[segment.id] = segmentInfo;
					scopeStack.currentSegments.add(segment);
				},
				onCodePathSegmentEnd(segment) {
					scopeStack.currentSegments.delete(segment);
				},
				TryStatement(node) {
					scopeStack.tryStatementBlocks.push(node.block);
				},
				Identifier(node) {
					for (const segment of scopeStack.currentSegments) {
						const segmentInfo = scopeStack.segments[segment.id];

						if (!segmentInfo.first) {
							segmentInfo.first = node;
						}
						segmentInfo.last = node;
					}
				},
				":matches(VariableDeclarator[init!=null], AssignmentExpression, UpdateExpression):exit"(
					node,
				) {
					if (scopeStack.currentSegments.size === 0) {
						// Ignore unreachable segments
						return;
					}

					const assignments = scopeStack.assignments;

					let pattern;
					let expression = null;

					if (node.type === "VariableDeclarator") {
						pattern = node.id;
						expression = node.init;
					} else if (node.type === "AssignmentExpression") {
						pattern = node.left;
						expression = node.right;
					} else {
						// UpdateExpression
						pattern = node.argument;
					}

					for (const identifier of extractIdentifiersFromPattern(
						pattern,
					)) {
						const scope = sourceCode.getScope(identifier);

						/** @type {Variable} */
						const variable = findVariable(scope, identifier);

						if (!variable) {
							continue;
						}

						// We don't know where global variables are used.
						if (
							variable.scope.type === "global" &&
							variable.defs.length === 0
						) {
							continue;
						}

						/*
						 * If the scope of the variable is outside the current code path scope,
						 * we cannot track whether this assignment is not used.
						 */
						if (
							scopeStack.scope !==
							getCodePathStartScope(variable.scope)
						) {
							continue;
						}

						// Variables marked by `markVariableAsUsed()` or
						// exported by "exported" block comment.
						if (variable.eslintUsed) {
							continue;
						}

						// Variables exported by ESM export syntax
						if (variable.scope.type === "module") {
							if (
								variable.defs.some(
									def =>
										(def.type === "Variable" &&
											def.parent.parent.type ===
												"ExportNamedDeclaration") ||
										(def.type === "FunctionName" &&
											(def.node.parent.type ===
												"ExportNamedDeclaration" ||
												def.node.parent.type ===
													"ExportDefaultDeclaration")) ||
										(def.type === "ClassName" &&
											(def.node.parent.type ===
												"ExportNamedDeclaration" ||
												def.node.parent.type ===
													"ExportDefaultDeclaration")),
								)
							) {
								continue;
							}
							if (
								variable.references.some(
									reference =>
										reference.identifier.parent.type ===
										"ExportSpecifier",
								)
							) {
								// It have `export { ... }` reference.
								continue;
							}
						}

						let list = assignments.get(variable);

						if (!list) {
							list = [];
							assignments.set(variable, list);
						}
						list.push({
							variable,
							identifier,
							node,
							expression,
							segments: [...scopeStack.currentSegments],
						});
					}
				},
			};
		},
	};
	return noUselessAssignment;
}

/**
 * @fileoverview Rule to disallow useless backreferences in regular expressions
 * @author Milos Djermanovic
 */

var noUselessBackreference;
var hasRequiredNoUselessBackreference;

function requireNoUselessBackreference () {
	if (hasRequiredNoUselessBackreference) return noUselessBackreference;
	hasRequiredNoUselessBackreference = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
		getStringIfConstant,
	} = /*@__PURE__*/ requireEslintUtils();
	const { RegExpParser, visitRegExpAST } = requireRegexpp();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const parser = new RegExpParser();

	/**
	 * Finds the path from the given `regexpp` AST node to the root node.
	 * @param {regexpp.Node} node Node.
	 * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node.
	 */
	function getPathToRoot(node) {
		const path = [];
		let current = node;

		do {
			path.push(current);
			current = current.parent;
		} while (current);

		return path;
	}

	/**
	 * Determines whether the given `regexpp` AST node is a lookaround node.
	 * @param {regexpp.Node} node Node.
	 * @returns {boolean} `true` if it is a lookaround node.
	 */
	function isLookaround(node) {
		return (
			node.type === "Assertion" &&
			(node.kind === "lookahead" || node.kind === "lookbehind")
		);
	}

	/**
	 * Determines whether the given `regexpp` AST node is a negative lookaround node.
	 * @param {regexpp.Node} node Node.
	 * @returns {boolean} `true` if it is a negative lookaround node.
	 */
	function isNegativeLookaround(node) {
		return isLookaround(node) && node.negate;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessBackreference = {
		meta: {
			type: "problem",

			docs: {
				description:
					"Disallow useless backreferences in regular expressions",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-useless-backreference",
			},

			schema: [],

			messages: {
				nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} from within that group.",
				forward:
					"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears later in the pattern.",
				backward:
					"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears before in the same lookbehind.",
				disjunctive:
					"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in another alternative.",
				intoNegativeLookaround:
					"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in a negative lookaround.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Checks and reports useless backreferences in the given regular expression.
			 * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call.
			 * @param {string} pattern Regular expression pattern.
			 * @param {string} flags Regular expression flags.
			 * @returns {void}
			 */
			function checkRegex(node, pattern, flags) {
				let regExpAST;

				try {
					regExpAST = parser.parsePattern(pattern, 0, pattern.length, {
						unicode: flags.includes("u"),
						unicodeSets: flags.includes("v"),
					});
				} catch {
					// Ignore regular expressions with syntax errors
					return;
				}

				visitRegExpAST(regExpAST, {
					onBackreferenceEnter(bref) {
						const groups = [bref.resolved].flat(),
							brefPath = getPathToRoot(bref);

						const problems = groups.map(group => {
							const groupPath = getPathToRoot(group);

							if (brefPath.includes(group)) {
								// group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match.
								return {
									messageId: "nested",
									group,
								};
							}

							// Start from the root to find the lowest common ancestor.
							let i = brefPath.length - 1,
								j = groupPath.length - 1;

							do {
								i--;
								j--;
							} while (brefPath[i] === groupPath[j]);

							const indexOfLowestCommonAncestor = j + 1,
								groupCut = groupPath.slice(
									0,
									indexOfLowestCommonAncestor,
								),
								commonPath = groupPath.slice(
									indexOfLowestCommonAncestor,
								),
								lowestCommonLookaround =
									commonPath.find(isLookaround),
								isMatchingBackward =
									lowestCommonLookaround &&
									lowestCommonLookaround.kind === "lookbehind";

							if (groupCut.at(-1).type === "Alternative") {
								// group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive.
								return {
									messageId: "disjunctive",
									group,
								};
							}
							if (!isMatchingBackward && bref.end <= group.start) {
								// bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match.
								return {
									messageId: "forward",
									group,
								};
							}
							if (isMatchingBackward && group.end <= bref.start) {
								// the opposite of the previous when the regex is matching backward in a lookbehind context.
								return {
									messageId: "backward",
									group,
								};
							}
							if (groupCut.some(isNegativeLookaround)) {
								// group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match.
								return {
									messageId: "intoNegativeLookaround",
									group,
								};
							}

							return null;
						});

						if (
							problems.length === 0 ||
							problems.some(problem => !problem)
						) {
							// If there are no problems or no problems with any group then do not report it.
							return;
						}

						let problemsToReport;

						// Gets problems that appear in the same disjunction.
						const problemsInSameDisjunction = problems.filter(
							problem => problem.messageId !== "disjunctive",
						);

						if (problemsInSameDisjunction.length) {
							// Only report problems that appear in the same disjunction.
							problemsToReport = problemsInSameDisjunction;
						} else {
							// If all groups appear in different disjunctions, report it.
							problemsToReport = problems;
						}

						const [{ messageId, group }, ...other] = problemsToReport;
						let otherGroups = "";

						if (other.length === 1) {
							otherGroups = " and another group";
						} else if (other.length > 1) {
							otherGroups = ` and other ${other.length} groups`;
						}
						context.report({
							node,
							messageId,
							data: {
								bref: bref.raw,
								group: group.raw,
								otherGroups,
							},
						});
					},
				});
			}

			return {
				"Literal[regex]"(node) {
					const { pattern, flags } = node.regex;

					checkRegex(node, pattern, flags);
				},
				Program(node) {
					const scope = sourceCode.getScope(node),
						tracker = new ReferenceTracker(scope),
						traceMap = {
							RegExp: {
								[CALL]: true,
								[CONSTRUCT]: true,
							},
						};

					for (const { node: refNode } of tracker.iterateGlobalReferences(
						traceMap,
					)) {
						const [patternNode, flagsNode] = refNode.arguments,
							pattern = getStringIfConstant(patternNode, scope),
							flags = getStringIfConstant(flagsNode, scope);

						if (typeof pattern === "string") {
							checkRegex(refNode, pattern, flags || "");
						}
					}
				},
			};
		},
	};
	return noUselessBackreference;
}

/**
 * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`.
 * @author Toru Nagashima
 */

var noUselessCall;
var hasRequiredNoUselessCall;

function requireNoUselessCall () {
	if (hasRequiredNoUselessCall) return noUselessCall;
	hasRequiredNoUselessCall = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a node is a `.call()`/`.apply()`.
	 * @param {ASTNode} node A CallExpression node to check.
	 * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`.
	 */
	function isCallOrNonVariadicApply(node) {
		const callee = astUtils.skipChainExpression(node.callee);

		return (
			callee.type === "MemberExpression" &&
			callee.property.type === "Identifier" &&
			callee.computed === false &&
			((callee.property.name === "call" && node.arguments.length >= 1) ||
				(callee.property.name === "apply" &&
					node.arguments.length === 2 &&
					node.arguments[1].type === "ArrayExpression"))
		);
	}

	/**
	 * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`.
	 * @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
	 * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`.
	 * @param {SourceCode} sourceCode The ESLint source code object.
	 * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`.
	 */
	function isValidThisArg(expectedThis, thisArg, sourceCode) {
		if (!expectedThis) {
			return astUtils.isNullOrUndefined(thisArg);
		}
		return astUtils.equalTokens(expectedThis, thisArg, sourceCode);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessCall = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow unnecessary calls to `.call()` and `.apply()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-useless-call",
			},

			schema: [],

			messages: {
				unnecessaryCall: "Unnecessary '.{{name}}()'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				CallExpression(node) {
					if (!isCallOrNonVariadicApply(node)) {
						return;
					}

					const callee = astUtils.skipChainExpression(node.callee);
					const applied = astUtils.skipChainExpression(callee.object);
					const expectedThis =
						applied.type === "MemberExpression" ? applied.object : null;
					const thisArg = node.arguments[0];

					if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
						context.report({
							node,
							messageId: "unnecessaryCall",
							data: { name: callee.property.name },
						});
					}
				},
			};
		},
	};
	return noUselessCall;
}

/**
 * @fileoverview Reports useless `catch` clauses that just rethrow their error.
 * @author Teddy Katz
 */

var noUselessCatch;
var hasRequiredNoUselessCatch;

function requireNoUselessCatch () {
	if (hasRequiredNoUselessCatch) return noUselessCatch;
	hasRequiredNoUselessCatch = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessCatch = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary `catch` clauses",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-useless-catch",
			},

			schema: [],

			messages: {
				unnecessaryCatchClause: "Unnecessary catch clause.",
				unnecessaryCatch: "Unnecessary try/catch wrapper.",
			},
		},

		create(context) {
			return {
				CatchClause(node) {
					if (
						node.param &&
						node.param.type === "Identifier" &&
						node.body.body.length &&
						node.body.body[0].type === "ThrowStatement" &&
						node.body.body[0].argument.type === "Identifier" &&
						node.body.body[0].argument.name === node.param.name
					) {
						if (node.parent.finalizer) {
							context.report({
								node,
								messageId: "unnecessaryCatchClause",
							});
						} else {
							context.report({
								node: node.parent,
								messageId: "unnecessaryCatch",
							});
						}
					}
				},
			};
		},
	};
	return noUselessCatch;
}

/**
 * @fileoverview Rule to disallow unnecessary computed property keys in object literals
 * @author Burak Yigit Kaya
 */

var noUselessComputedKey;
var hasRequiredNoUselessComputedKey;

function requireNoUselessComputedKey () {
	if (hasRequiredNoUselessComputedKey) return noUselessComputedKey;
	hasRequiredNoUselessComputedKey = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the computed key syntax is unnecessarily used for the given node.
	 * In particular, it determines whether removing the square brackets and using the content between them
	 * directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior.
	 * Valid non-computed keys are only: identifiers, number literals and string literals.
	 * Only literals can preserve the same behavior, with a few exceptions for specific node types:
	 * Property
	 *   - { ["__proto__"]: foo } defines a property named "__proto__"
	 *     { "__proto__": foo } defines object's prototype
	 * PropertyDefinition
	 *   - class C { ["constructor"]; } defines an instance field named "constructor"
	 *     class C { "constructor"; } produces a parsing error
	 *   - class C { static ["constructor"]; } defines a static field named "constructor"
	 *     class C { static "constructor"; } produces a parsing error
	 *   - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script)
	 *     class C { static "prototype"; } produces a parsing error (breaks the whole script)
	 * MethodDefinition
	 *   - class C { ["constructor"]() {} } defines a prototype method named "constructor"
	 *     class C { "constructor"() {} } defines the constructor
	 *   - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script)
	 *     class C { static "prototype"() {} } produces a parsing error (breaks the whole script)
	 * @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`.
	 * @throws {Error} (Unreachable.)
	 * @returns {void} `true` if the node has useless computed key.
	 */
	function hasUselessComputedKey(node) {
		if (!node.computed) {
			return false;
		}

		const { key } = node;

		if (key.type !== "Literal") {
			return false;
		}

		const { value } = key;

		if (typeof value !== "number" && typeof value !== "string") {
			return false;
		}

		switch (node.type) {
			case "Property":
				if (node.parent.type === "ObjectExpression") {
					return value !== "__proto__";
				}
				return true;

			case "PropertyDefinition":
				if (node.static) {
					return value !== "constructor" && value !== "prototype";
				}

				return value !== "constructor";

			case "MethodDefinition":
				if (node.static) {
					return value !== "prototype";
				}

				return value !== "constructor";

			/* c8 ignore next */
			default:
				throw new Error(`Unexpected node type: ${node.type}`);
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessComputedKey = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					enforceForClassMembers: true,
				},
			],

			docs: {
				description:
					"Disallow unnecessary computed property keys in objects and classes",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-useless-computed-key",
			},

			schema: [
				{
					type: "object",
					properties: {
						enforceForClassMembers: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			fixable: "code",

			messages: {
				unnecessarilyComputedProperty:
					"Unnecessarily computed property [{{property}}] found.",
			},
		},
		create(context) {
			const sourceCode = context.sourceCode;
			const [{ enforceForClassMembers }] = context.options;

			/**
			 * Reports a given node if it violated this rule.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function check(node) {
				if (hasUselessComputedKey(node)) {
					const { key } = node;

					context.report({
						node,
						messageId: "unnecessarilyComputedProperty",
						data: { property: sourceCode.getText(key) },
						fix(fixer) {
							const leftSquareBracket = sourceCode.getTokenBefore(
								key,
								astUtils.isOpeningBracketToken,
							);
							const rightSquareBracket = sourceCode.getTokenAfter(
								key,
								astUtils.isClosingBracketToken,
							);

							// If there are comments between the brackets and the property name, don't do a fix.
							if (
								sourceCode.commentsExistBetween(
									leftSquareBracket,
									rightSquareBracket,
								)
							) {
								return null;
							}

							const tokenBeforeLeftBracket =
								sourceCode.getTokenBefore(leftSquareBracket);

							// Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} })
							const needsSpaceBeforeKey =
								tokenBeforeLeftBracket.range[1] ===
									leftSquareBracket.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenBeforeLeftBracket,
									sourceCode.getFirstToken(key),
								);

							const replacementKey =
								(needsSpaceBeforeKey ? " " : "") + key.raw;

							return fixer.replaceTextRange(
								[
									leftSquareBracket.range[0],
									rightSquareBracket.range[1],
								],
								replacementKey,
							);
						},
					});
				}
			}

			/**
			 * A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`.
			 * @returns {void}
			 * @private
			 */
			function noop() {}

			return {
				Property: check,
				MethodDefinition: enforceForClassMembers ? check : noop,
				PropertyDefinition: enforceForClassMembers ? check : noop,
			};
		},
	};
	return noUselessComputedKey;
}

/**
 * @fileoverview disallow unnecessary concatenation of template strings
 * @author Henry Zhu
 */

var noUselessConcat;
var hasRequiredNoUselessConcat;

function requireNoUselessConcat () {
	if (hasRequiredNoUselessConcat) return noUselessConcat;
	hasRequiredNoUselessConcat = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a concatenation.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a concatenation.
	 */
	function isConcatenation(node) {
		return node.type === "BinaryExpression" && node.operator === "+";
	}

	/**
	 * Checks if the given token is a `+` token or not.
	 * @param {Token} token The token to check.
	 * @returns {boolean} `true` if the token is a `+` token.
	 */
	function isConcatOperatorToken(token) {
		return token.value === "+" && token.type === "Punctuator";
	}

	/**
	 * Get's the right most node on the left side of a BinaryExpression with + operator.
	 * @param {ASTNode} node A BinaryExpression node to check.
	 * @returns {ASTNode} node
	 */
	function getLeft(node) {
		let left = node.left;

		while (isConcatenation(left)) {
			left = left.right;
		}
		return left;
	}

	/**
	 * Get's the left most node on the right side of a BinaryExpression with + operator.
	 * @param {ASTNode} node A BinaryExpression node to check.
	 * @returns {ASTNode} node
	 */
	function getRight(node) {
		let right = node.right;

		while (isConcatenation(right)) {
			right = right.left;
		}
		return right;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessConcat = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow unnecessary concatenation of literals or template literals",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-useless-concat",
			},

			schema: [],

			messages: {
				unexpectedConcat: "Unexpected string concatenation of literals.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				BinaryExpression(node) {
					// check if not concatenation
					if (node.operator !== "+") {
						return;
					}

					// account for the `foo + "a" + "b"` case
					const left = getLeft(node);
					const right = getRight(node);

					if (
						astUtils.isStringLiteral(left) &&
						astUtils.isStringLiteral(right) &&
						astUtils.isTokenOnSameLine(left, right)
					) {
						const operatorToken = sourceCode.getFirstTokenBetween(
							left,
							right,
							isConcatOperatorToken,
						);

						context.report({
							node,
							loc: operatorToken.loc,
							messageId: "unexpectedConcat",
						});
					}
				},
			};
		},
	};
	return noUselessConcat;
}

/**
 * @fileoverview Rule to flag the use of redundant constructors in classes.
 * @author Alberto Rodríguez
 */

var noUselessConstructor;
var hasRequiredNoUselessConstructor;

function requireNoUselessConstructor () {
	if (hasRequiredNoUselessConstructor) return noUselessConstructor;
	hasRequiredNoUselessConstructor = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether any of a method's parameters have a decorator or are a parameter property.
	 * @param {ASTNode} node A method definition node.
	 * @returns {boolean} `true` if any parameter had a decorator or is a parameter property.
	 */
	function hasDecoratorsOrParameterProperty(node) {
		return node.value.params.some(
			param =>
				param.decorators?.length || param.type === "TSParameterProperty",
		);
	}

	/**
	 * Checks whether a node's accessibility makes it not useless.
	 * @param {ASTNode} node A method definition node.
	 * @returns {boolean} `true` if the node has a useful accessibility.
	 */
	function hasUsefulAccessibility(node) {
		switch (node.accessibility) {
			case "protected":
			case "private":
				return true;
			case "public":
				return !!node.parent.parent.superClass;
			default:
				return false;
		}
	}

	/**
	 * Checks whether a given array of statements is a single call of `super`.
	 * @param {ASTNode[]} body An array of statements to check.
	 * @returns {boolean} `true` if the body is a single call of `super`.
	 */
	function isSingleSuperCall(body) {
		return (
			body.length === 1 &&
			body[0].type === "ExpressionStatement" &&
			body[0].expression.type === "CallExpression" &&
			body[0].expression.callee.type === "Super"
		);
	}

	/**
	 * Checks whether a given node is a pattern which doesn't have any side effects.
	 * Default parameters and Destructuring parameters can have side effects.
	 * @param {ASTNode} node A pattern node.
	 * @returns {boolean} `true` if the node doesn't have any side effects.
	 */
	function isSimple(node) {
		return node.type === "Identifier" || node.type === "RestElement";
	}

	/**
	 * Checks whether a given array of expressions is `...arguments` or not.
	 * `super(...arguments)` passes all arguments through.
	 * @param {ASTNode[]} superArgs An array of expressions to check.
	 * @returns {boolean} `true` if the superArgs is `...arguments`.
	 */
	function isSpreadArguments(superArgs) {
		return (
			superArgs.length === 1 &&
			superArgs[0].type === "SpreadElement" &&
			superArgs[0].argument.type === "Identifier" &&
			superArgs[0].argument.name === "arguments"
		);
	}

	/**
	 * Checks whether given 2 nodes are identifiers which have the same name or not.
	 * @param {ASTNode} ctorParam A node to check.
	 * @param {ASTNode} superArg A node to check.
	 * @returns {boolean} `true` if the nodes are identifiers which have the same
	 *      name.
	 */
	function isValidIdentifierPair(ctorParam, superArg) {
		return (
			ctorParam.type === "Identifier" &&
			superArg.type === "Identifier" &&
			ctorParam.name === superArg.name
		);
	}

	/**
	 * Checks whether given 2 nodes are a rest/spread pair which has the same values.
	 * @param {ASTNode} ctorParam A node to check.
	 * @param {ASTNode} superArg A node to check.
	 * @returns {boolean} `true` if the nodes are a rest/spread pair which has the
	 *      same values.
	 */
	function isValidRestSpreadPair(ctorParam, superArg) {
		return (
			ctorParam.type === "RestElement" &&
			superArg.type === "SpreadElement" &&
			isValidIdentifierPair(ctorParam.argument, superArg.argument)
		);
	}

	/**
	 * Checks whether given 2 nodes have the same value or not.
	 * @param {ASTNode} ctorParam A node to check.
	 * @param {ASTNode} superArg A node to check.
	 * @returns {boolean} `true` if the nodes have the same value or not.
	 */
	function isValidPair(ctorParam, superArg) {
		return (
			isValidIdentifierPair(ctorParam, superArg) ||
			isValidRestSpreadPair(ctorParam, superArg)
		);
	}

	/**
	 * Checks whether the parameters of a constructor and the arguments of `super()`
	 * have the same values or not.
	 * @param {ASTNode} ctorParams The parameters of a constructor to check.
	 * @param {ASTNode} superArgs The arguments of `super()` to check.
	 * @returns {boolean} `true` if those have the same values.
	 */
	function isPassingThrough(ctorParams, superArgs) {
		if (ctorParams.length !== superArgs.length) {
			return false;
		}

		for (let i = 0; i < ctorParams.length; ++i) {
			if (!isValidPair(ctorParams[i], superArgs[i])) {
				return false;
			}
		}

		return true;
	}

	/**
	 * Checks whether the constructor body is a redundant super call.
	 * @param {Array} body constructor body content.
	 * @param {Array} ctorParams The params to check against super call.
	 * @returns {boolean} true if the constructor body is redundant
	 */
	function isRedundantSuperCall(body, ctorParams) {
		return (
			isSingleSuperCall(body) &&
			ctorParams.every(isSimple) &&
			(isSpreadArguments(body[0].expression.arguments) ||
				isPassingThrough(ctorParams, body[0].expression.arguments))
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessConstructor = {
		meta: {
			dialects: ["javascript", "typescript"],
			language: "javascript",
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary constructors",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-useless-constructor",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				noUselessConstructor: "Useless constructor.",
				removeConstructor: "Remove the constructor.",
			},
		},

		create(context) {
			/**
			 * Checks whether a node is a redundant constructor
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkForConstructor(node) {
				if (
					node.kind !== "constructor" ||
					node.value.type !== "FunctionExpression" ||
					hasDecoratorsOrParameterProperty(node) ||
					hasUsefulAccessibility(node)
				) {
					return;
				}

				/*
				 * Prevent crashing on parsers which do not require class constructor
				 * to have a body, e.g. typescript and flow
				 */
				if (!node.value.body) {
					return;
				}

				const body = node.value.body.body;
				const ctorParams = node.value.params;
				const superClass = node.parent.parent.superClass;

				if (
					superClass
						? isRedundantSuperCall(body, ctorParams)
						: body.length === 0
				) {
					context.report({
						node,
						messageId: "noUselessConstructor",
						suggest: [
							{
								messageId: "removeConstructor",
								*fix(fixer) {
									const nextToken =
										context.sourceCode.getTokenAfter(node);
									const addSemiColon =
										nextToken.type === "Punctuator" &&
										nextToken.value === "[" &&
										astUtils.needsPrecedingSemicolon(
											context.sourceCode,
											node,
										);

									yield fixer.replaceText(
										node,
										addSemiColon ? ";" : "",
									);
								},
							},
						],
					});
				}
			}

			return {
				MethodDefinition: checkForConstructor,
			};
		},
	};
	return noUselessConstructor;
}

/**
 * @fileoverview Look for useless escapes in strings and regexes
 * @author Onur Temizkan
 */

var noUselessEscape;
var hasRequiredNoUselessEscape;

function requireNoUselessEscape () {
	if (hasRequiredNoUselessEscape) return noUselessEscape;
	hasRequiredNoUselessEscape = 1;

	const astUtils = requireAstUtils();
	const { RegExpParser, visitRegExpAST } = requireRegexpp();

	/**
	 * @typedef {import('@eslint-community/regexpp').AST.CharacterClass} CharacterClass
	 * @typedef {import('@eslint-community/regexpp').AST.ExpressionCharacterClass} ExpressionCharacterClass
	 */
	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/**
	 * Returns the union of two sets.
	 * @param {Set} setA The first set
	 * @param {Set} setB The second set
	 * @returns {Set} The union of the two sets
	 */
	function union(setA, setB) {
		return new Set(
			(function* () {
				yield* setA;
				yield* setB;
			})(),
		);
	}

	const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS);
	const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]");
	const REGEX_NON_CHARCLASS_ESCAPES = union(
		REGEX_GENERAL_ESCAPES,
		new Set("^/.$*+?[{}|()Bk"),
	);

	/*
	 * Set of characters that require escaping in character classes in `unicodeSets` mode.
	 * ( ) [ ] { } / - \ | are ClassSetSyntaxCharacter
	 */
	const REGEX_CLASSSET_CHARACTER_ESCAPES = union(
		REGEX_GENERAL_ESCAPES,
		new Set("q/[{}|()-"),
	);

	/*
	 * A single character set of ClassSetReservedDoublePunctuator.
	 * && !! ## $$ %% ** ++ ,, .. :: ;; << == >> ?? @@ ^^ `` ~~ are ClassSetReservedDoublePunctuator
	 */
	const REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR = new Set(
		"!#$%&*+,.:;<=>?@^`~",
	);

	/** @type {import('../shared/types').Rule} */
	noUselessEscape = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow unnecessary escape characters",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-useless-escape",
			},

			hasSuggestions: true,

			messages: {
				unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
				removeEscape:
					"Remove the `\\`. This maintains the current functionality.",
				removeEscapeDoNotKeepSemantics:
					"Remove the `\\` if it was inserted by mistake.",
				escapeBackslash:
					"Replace the `\\` with `\\\\` to include the actual backslash character.",
			},

			schema: [],
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const parser = new RegExpParser();

			/**
			 * Reports a node
			 * @param {ASTNode} node The node to report
			 * @param {number} startOffset The backslash's offset from the start of the node
			 * @param {string} character The uselessly escaped character (not including the backslash)
			 * @param {boolean} [disableEscapeBackslashSuggest] `true` if escapeBackslash suggestion should be turned off.
			 * @returns {void}
			 */
			function report(
				node,
				startOffset,
				character,
				disableEscapeBackslashSuggest,
			) {
				const rangeStart = node.range[0] + startOffset;
				const range = [rangeStart, rangeStart + 1];
				const start = sourceCode.getLocFromIndex(rangeStart);

				context.report({
					node,
					loc: {
						start,
						end: { line: start.line, column: start.column + 1 },
					},
					messageId: "unnecessaryEscape",
					data: { character },
					suggest: [
						{
							// Removing unnecessary `\` characters in a directive is not guaranteed to maintain functionality.
							messageId: astUtils.isDirective(node.parent)
								? "removeEscapeDoNotKeepSemantics"
								: "removeEscape",
							fix(fixer) {
								return fixer.removeRange(range);
							},
						},
						...(disableEscapeBackslashSuggest
							? []
							: [
									{
										messageId: "escapeBackslash",
										fix(fixer) {
											return fixer.insertTextBeforeRange(
												range,
												"\\",
											);
										},
									},
								]),
					],
				});
			}

			/**
			 * Checks if the escape character in given string slice is unnecessary.
			 * @private
			 * @param {ASTNode} node node to validate.
			 * @param {string} match string slice to validate.
			 * @returns {void}
			 */
			function validateString(node, match) {
				const isTemplateElement = node.type === "TemplateElement";
				const escapedChar = match[0][1];
				let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar);
				let isQuoteEscape;

				if (isTemplateElement) {
					isQuoteEscape = escapedChar === "`";

					if (escapedChar === "$") {
						// Warn if `\$` is not followed by `{`
						isUnnecessaryEscape = match.input[match.index + 2] !== "{";
					} else if (escapedChar === "{") {
						/*
						 * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping
						 * is necessary and the rule should not warn. If preceded by `/$`, the rule
						 * will warn for the `/$` instead, as it is the first unnecessarily escaped character.
						 */
						isUnnecessaryEscape = match.input[match.index - 1] !== "$";
					}
				} else {
					isQuoteEscape = escapedChar === node.raw[0];
				}

				if (isUnnecessaryEscape && !isQuoteEscape) {
					report(node, match.index, match[0].slice(1));
				}
			}

			/**
			 * Checks if the escape character in given regexp is unnecessary.
			 * @private
			 * @param {ASTNode} node node to validate.
			 * @returns {void}
			 */
			function validateRegExp(node) {
				const { pattern, flags } = node.regex;
				let patternNode;
				const unicode = flags.includes("u");
				const unicodeSets = flags.includes("v");

				try {
					patternNode = parser.parsePattern(pattern, 0, pattern.length, {
						unicode,
						unicodeSets,
					});
				} catch {
					// Ignore regular expressions with syntax errors
					return;
				}

				/** @type {(CharacterClass | ExpressionCharacterClass)[]} */
				const characterClassStack = [];

				visitRegExpAST(patternNode, {
					onCharacterClassEnter: characterClassNode =>
						characterClassStack.unshift(characterClassNode),
					onCharacterClassLeave: () => characterClassStack.shift(),
					onExpressionCharacterClassEnter: characterClassNode =>
						characterClassStack.unshift(characterClassNode),
					onExpressionCharacterClassLeave: () =>
						characterClassStack.shift(),
					onCharacterEnter(characterNode) {
						if (!characterNode.raw.startsWith("\\")) {
							// It's not an escaped character.
							return;
						}

						const escapedChar = characterNode.raw.slice(1);

						if (
							escapedChar !==
							String.fromCodePoint(characterNode.value)
						) {
							// It's a valid escape.
							return;
						}
						let allowedEscapes;

						if (characterClassStack.length) {
							allowedEscapes = unicodeSets
								? REGEX_CLASSSET_CHARACTER_ESCAPES
								: REGEX_GENERAL_ESCAPES;
						} else {
							allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES;
						}
						if (allowedEscapes.has(escapedChar)) {
							return;
						}

						const reportedIndex = characterNode.start + 1;
						let disableEscapeBackslashSuggest = false;

						if (characterClassStack.length) {
							const characterClassNode = characterClassStack[0];

							if (escapedChar === "^") {
								/*
								 * The '^' character is also a special case; it must always be escaped outside of character classes, but
								 * it only needs to be escaped in character classes if it's at the beginning of the character class. To
								 * account for this, consider it to be a valid escape character outside of character classes, and filter
								 * out '^' characters that appear at the start of a character class.
								 */
								if (
									characterClassNode.start + 1 ===
									characterNode.start
								) {
									return;
								}
							}
							if (!unicodeSets) {
								if (escapedChar === "-") {
									/*
									 * The '-' character is a special case, because it's only valid to escape it if it's in a character
									 * class, and is not at either edge of the character class. To account for this, don't consider '-'
									 * characters to be valid in general, and filter out '-' characters that appear in the middle of a
									 * character class.
									 */
									if (
										characterClassNode.start + 1 !==
											characterNode.start &&
										characterNode.end !==
											characterClassNode.end - 1
									) {
										return;
									}
								}
							} else {
								// unicodeSets mode
								if (
									REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR.has(
										escapedChar,
									)
								) {
									// Escaping is valid if it is a ClassSetReservedDoublePunctuator.
									if (
										pattern[characterNode.end] === escapedChar
									) {
										return;
									}
									if (
										pattern[characterNode.start - 1] ===
										escapedChar
									) {
										if (escapedChar !== "^") {
											return;
										}

										// If the previous character is a `negate` caret(`^`), escape to caret is unnecessary.

										if (!characterClassNode.negate) {
											return;
										}
										const negateCaretIndex =
											characterClassNode.start + 1;

										if (
											negateCaretIndex <
											characterNode.start - 1
										) {
											return;
										}
									}
								}

								if (
									characterNode.parent.type ===
										"ClassIntersection" ||
									characterNode.parent.type === "ClassSubtraction"
								) {
									disableEscapeBackslashSuggest = true;
								}
							}
						}

						report(
							node,
							reportedIndex,
							escapedChar,
							disableEscapeBackslashSuggest,
						);
					},
				});
			}

			/**
			 * Checks if a node has an escape.
			 * @param {ASTNode} node node to check.
			 * @returns {void}
			 */
			function check(node) {
				const isTemplateElement = node.type === "TemplateElement";

				if (
					isTemplateElement &&
					node.parent &&
					node.parent.parent &&
					node.parent.parent.type === "TaggedTemplateExpression" &&
					node.parent === node.parent.parent.quasi
				) {
					// Don't report tagged template literals, because the backslash character is accessible to the tag function.
					return;
				}

				if (typeof node.value === "string" || isTemplateElement) {
					/*
					 * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/.
					 * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25.
					 */
					if (
						node.parent.type === "JSXAttribute" ||
						node.parent.type === "JSXElement" ||
						node.parent.type === "JSXFragment"
					) {
						return;
					}

					const value = isTemplateElement
						? sourceCode.getText(node)
						: node.raw;
					const pattern = /\\[^\d]/gu;
					let match;

					while ((match = pattern.exec(value))) {
						validateString(node, match);
					}
				} else if (node.regex) {
					validateRegExp(node);
				}
			}

			return {
				Literal: check,
				TemplateElement: check,
			};
		},
	};
	return noUselessEscape;
}

/**
 * @fileoverview Disallow renaming import, export, and destructured assignments to the same name.
 * @author Kai Cataldo
 */

var noUselessRename;
var hasRequiredNoUselessRename;

function requireNoUselessRename () {
	if (hasRequiredNoUselessRename) return noUselessRename;
	hasRequiredNoUselessRename = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessRename = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					ignoreDestructuring: false,
					ignoreImport: false,
					ignoreExport: false,
				},
			],

			docs: {
				description:
					"Disallow renaming import, export, and destructured assignments to the same name",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-useless-rename",
			},

			fixable: "code",

			schema: [
				{
					type: "object",
					properties: {
						ignoreDestructuring: { type: "boolean" },
						ignoreImport: { type: "boolean" },
						ignoreExport: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],

			messages: {
				unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ ignoreDestructuring, ignoreImport, ignoreExport }] =
				context.options;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports error for unnecessarily renamed assignments
			 * @param {ASTNode} node node to report
			 * @param {ASTNode} initial node with initial name value
			 * @param {string} type the type of the offending node
			 * @returns {void}
			 */
			function reportError(node, initial, type) {
				const name =
					initial.type === "Identifier" ? initial.name : initial.value;

				return context.report({
					node,
					messageId: "unnecessarilyRenamed",
					data: {
						name,
						type,
					},
					fix(fixer) {
						const replacementNode =
							node.type === "Property" ? node.value : node.local;

						if (
							sourceCode.getCommentsInside(node).length >
							sourceCode.getCommentsInside(replacementNode).length
						) {
							return null;
						}

						// Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties.
						if (
							replacementNode.type === "AssignmentPattern" &&
							astUtils.isParenthesised(
								sourceCode,
								replacementNode.left,
							)
						) {
							return null;
						}

						return fixer.replaceText(
							node,
							sourceCode.getText(replacementNode),
						);
					},
				});
			}

			/**
			 * Checks whether a destructured assignment is unnecessarily renamed
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkDestructured(node) {
				if (ignoreDestructuring) {
					return;
				}

				for (const property of node.properties) {
					/**
					 * Properties using shorthand syntax and rest elements can not be renamed.
					 * If the property is computed, we have no idea if a rename is useless or not.
					 */
					if (
						property.type !== "Property" ||
						property.shorthand ||
						property.computed
					) {
						continue;
					}

					const key =
						(property.key.type === "Identifier" && property.key.name) ||
						(property.key.type === "Literal" && property.key.value);
					const renamedKey =
						property.value.type === "AssignmentPattern"
							? property.value.left.name
							: property.value.name;

					if (key === renamedKey) {
						reportError(
							property,
							property.key,
							"Destructuring assignment",
						);
					}
				}
			}

			/**
			 * Checks whether an import is unnecessarily renamed
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkImport(node) {
				if (ignoreImport) {
					return;
				}

				if (
					node.imported.range[0] !== node.local.range[0] &&
					astUtils.getModuleExportName(node.imported) === node.local.name
				) {
					reportError(node, node.imported, "Import");
				}
			}

			/**
			 * Checks whether an export is unnecessarily renamed
			 * @param {ASTNode} node node to check
			 * @returns {void}
			 */
			function checkExport(node) {
				if (ignoreExport) {
					return;
				}

				if (
					node.local.range[0] !== node.exported.range[0] &&
					astUtils.getModuleExportName(node.local) ===
						astUtils.getModuleExportName(node.exported)
				) {
					reportError(node, node.local, "Export");
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				ObjectPattern: checkDestructured,
				ImportSpecifier: checkImport,
				ExportSpecifier: checkExport,
			};
		},
	};
	return noUselessRename;
}

/**
 * @fileoverview Disallow redundant return statements
 * @author Teddy Katz
 */

var noUselessReturn;
var hasRequiredNoUselessReturn;

function requireNoUselessReturn () {
	if (hasRequiredNoUselessReturn) return noUselessReturn;
	hasRequiredNoUselessReturn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils(),
		FixTracker = requireFixTracker();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Removes the given element from the array.
	 * @param {Array} array The source array to remove.
	 * @param {any} element The target item to remove.
	 * @returns {void}
	 */
	function remove(array, element) {
		const index = array.indexOf(element);

		if (index !== -1) {
			array.splice(index, 1);
		}
	}

	/**
	 * Checks whether it can remove the given return statement or not.
	 * @param {ASTNode} node The return statement node to check.
	 * @returns {boolean} `true` if the node is removable.
	 */
	function isRemovable(node) {
		return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type);
	}

	/**
	 * Checks whether the given return statement is in a `finally` block or not.
	 * @param {ASTNode} node The return statement node to check.
	 * @returns {boolean} `true` if the node is in a `finally` block.
	 */
	function isInFinally(node) {
		for (
			let currentNode = node;
			currentNode && currentNode.parent && !astUtils.isFunction(currentNode);
			currentNode = currentNode.parent
		) {
			if (
				currentNode.parent.type === "TryStatement" &&
				currentNode.parent.finalizer === currentNode
			) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Checks all segments in a set and returns true if any are reachable.
	 * @param {Set<CodePathSegment>} segments The segments to check.
	 * @returns {boolean} True if any segment is reachable; false otherwise.
	 */
	function isAnySegmentReachable(segments) {
		for (const segment of segments) {
			if (segment.reachable) {
				return true;
			}
		}

		return false;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noUselessReturn = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow redundant return statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-useless-return",
			},

			fixable: "code",
			schema: [],

			messages: {
				unnecessaryReturn: "Unnecessary return statement.",
			},
		},

		create(context) {
			const segmentInfoMap = new WeakMap();
			const sourceCode = context.sourceCode;
			let scopeInfo = null;

			/**
			 * Checks whether the given segment is terminated by a return statement or not.
			 * @param {CodePathSegment} segment The segment to check.
			 * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable.
			 */
			function isReturned(segment) {
				const info = segmentInfoMap.get(segment);

				return !info || info.returned;
			}

			/**
			 * Collects useless return statements from the given previous segments.
			 *
			 * A previous segment may be an unreachable segment.
			 * In that case, the information object of the unreachable segment is not
			 * initialized because `onCodePathSegmentStart` event is not notified for
			 * unreachable segments.
			 * This goes to the previous segments of the unreachable segment recursively
			 * if the unreachable segment was generated by a return statement. Otherwise,
			 * this ignores the unreachable segment.
			 *
			 * This behavior would simulate code paths for the case that the return
			 * statement does not exist.
			 * @param {ASTNode[]} uselessReturns The collected return statements.
			 * @param {CodePathSegment[]} prevSegments The previous segments to traverse.
			 * @param {WeakSet<CodePathSegment>} [providedTraversedSegments] A set of segments that have already been traversed in this call
			 * @returns {ASTNode[]} `uselessReturns`.
			 */
			function getUselessReturns(
				uselessReturns,
				prevSegments,
				providedTraversedSegments,
			) {
				const traversedSegments =
					providedTraversedSegments || new WeakSet();

				for (const segment of prevSegments) {
					if (!segment.reachable) {
						if (!traversedSegments.has(segment)) {
							traversedSegments.add(segment);
							getUselessReturns(
								uselessReturns,
								segment.allPrevSegments.filter(isReturned),
								traversedSegments,
							);
						}
						continue;
					}

					if (segmentInfoMap.has(segment)) {
						uselessReturns.push(
							...segmentInfoMap.get(segment).uselessReturns,
						);
					}
				}

				return uselessReturns;
			}

			/**
			 * Removes the return statements on the given segment from the useless return
			 * statement list.
			 *
			 * This segment may be an unreachable segment.
			 * In that case, the information object of the unreachable segment is not
			 * initialized because `onCodePathSegmentStart` event is not notified for
			 * unreachable segments.
			 * This goes to the previous segments of the unreachable segment recursively
			 * if the unreachable segment was generated by a return statement. Otherwise,
			 * this ignores the unreachable segment.
			 *
			 * This behavior would simulate code paths for the case that the return
			 * statement does not exist.
			 * @param {CodePathSegment} segment The segment to get return statements.
			 * @param {Set<CodePathSegment>} usedUnreachableSegments A set of segments that have already been traversed in this call.
			 * @returns {void}
			 */
			function markReturnStatementsOnSegmentAsUsed(
				segment,
				usedUnreachableSegments,
			) {
				if (!segment.reachable) {
					usedUnreachableSegments.add(segment);
					segment.allPrevSegments
						.filter(isReturned)
						.filter(
							prevSegment =>
								!usedUnreachableSegments.has(prevSegment),
						)
						.forEach(prevSegment =>
							markReturnStatementsOnSegmentAsUsed(
								prevSegment,
								usedUnreachableSegments,
							),
						);
					return;
				}

				const info = segmentInfoMap.get(segment);

				if (!info) {
					return;
				}

				info.uselessReturns = info.uselessReturns.filter(node => {
					if (
						scopeInfo.traversedTryBlockStatements &&
						scopeInfo.traversedTryBlockStatements.length > 0
					) {
						const returnInitialRange = node.range[0];
						const returnFinalRange = node.range[1];

						const areBlocksInRange =
							scopeInfo.traversedTryBlockStatements.some(
								tryBlockStatement => {
									const blockInitialRange =
										tryBlockStatement.range[0];
									const blockFinalRange =
										tryBlockStatement.range[1];

									return (
										returnInitialRange >= blockInitialRange &&
										returnFinalRange <= blockFinalRange
									);
								},
							);

						if (areBlocksInRange) {
							return true;
						}
					}

					remove(scopeInfo.uselessReturns, node);
					return false;
				});
			}

			/**
			 * Removes the return statements on the current segments from the useless
			 * return statement list.
			 *
			 * This function will be called at every statement except FunctionDeclaration,
			 * BlockStatement, and BreakStatement.
			 *
			 * - FunctionDeclarations are always executed whether it's returned or not.
			 * - BlockStatements do nothing.
			 * - BreakStatements go the next merely.
			 * @returns {void}
			 */
			function markReturnStatementsOnCurrentSegmentsAsUsed() {
				scopeInfo.currentSegments.forEach(segment =>
					markReturnStatementsOnSegmentAsUsed(segment, new Set()),
				);
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				// Makes and pushes a new scope information.
				onCodePathStart(codePath) {
					scopeInfo = {
						upper: scopeInfo,
						uselessReturns: [],
						traversedTryBlockStatements: [],
						codePath,
						currentSegments: new Set(),
					};
				},

				// Reports useless return statements if exist.
				onCodePathEnd() {
					for (const node of scopeInfo.uselessReturns) {
						context.report({
							node,
							loc: node.loc,
							messageId: "unnecessaryReturn",
							fix(fixer) {
								if (
									isRemovable(node) &&
									!sourceCode.getCommentsInside(node).length
								) {
									/*
									 * Extend the replacement range to include the
									 * entire function to avoid conflicting with
									 * no-else-return.
									 * https://github.com/eslint/eslint/issues/8026
									 */
									return new FixTracker(fixer, sourceCode)
										.retainEnclosingFunction(node)
										.remove(node);
								}
								return null;
							},
						});
					}

					scopeInfo = scopeInfo.upper;
				},

				/*
				 * Initializes segments.
				 * NOTE: This event is notified for only reachable segments.
				 */
				onCodePathSegmentStart(segment) {
					scopeInfo.currentSegments.add(segment);

					const info = {
						uselessReturns: getUselessReturns(
							[],
							segment.allPrevSegments,
						),
						returned: false,
					};

					// Stores the info.
					segmentInfoMap.set(segment, info);
				},

				onUnreachableCodePathSegmentStart(segment) {
					scopeInfo.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					scopeInfo.currentSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					scopeInfo.currentSegments.delete(segment);
				},

				// Adds ReturnStatement node to check whether it's useless or not.
				ReturnStatement(node) {
					if (node.argument) {
						markReturnStatementsOnCurrentSegmentsAsUsed();
					}
					if (
						node.argument ||
						astUtils.isInLoop(node) ||
						isInFinally(node) ||
						// Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647).
						!isAnySegmentReachable(scopeInfo.currentSegments)
					) {
						return;
					}

					for (const segment of scopeInfo.currentSegments) {
						const info = segmentInfoMap.get(segment);

						if (info) {
							info.uselessReturns.push(node);
							info.returned = true;
						}
					}
					scopeInfo.uselessReturns.push(node);
				},

				"TryStatement > BlockStatement.block:exit"(node) {
					scopeInfo.traversedTryBlockStatements.push(node);
				},

				"TryStatement:exit"() {
					scopeInfo.traversedTryBlockStatements.pop();
				},

				/*
				 * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement.
				 * Removes return statements of the current segments from the useless return statement list.
				 */
				ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
				ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
				LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
				WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
				ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
				ExportDefaultDeclaration:
					markReturnStatementsOnCurrentSegmentsAsUsed,
				ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
			};
		},
	};
	return noUselessReturn;
}

/**
 * @fileoverview Rule to check for the usage of var.
 * @author Jamund Ferguson
 */

var noVar;
var hasRequiredNoVar;

function requireNoVar () {
	if (hasRequiredNoVar) return noVar;
	hasRequiredNoVar = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Check whether a given variable is a global variable or not.
	 * @param {eslint-scope.Variable} variable The variable to check.
	 * @returns {boolean} `true` if the variable is a global variable.
	 */
	function isGlobal(variable) {
		return Boolean(variable.scope) && variable.scope.type === "global";
	}

	/**
	 * Finds the nearest function scope or global scope walking up the scope
	 * hierarchy.
	 * @param {eslint-scope.Scope} scope The scope to traverse.
	 * @returns {eslint-scope.Scope} a function scope or global scope containing the given
	 *      scope.
	 */
	function getEnclosingFunctionScope(scope) {
		let currentScope = scope;

		while (currentScope.type !== "function" && currentScope.type !== "global") {
			currentScope = currentScope.upper;
		}
		return currentScope;
	}

	/**
	 * Checks whether the given variable has any references from a more specific
	 * function expression (i.e. a closure).
	 * @param {eslint-scope.Variable} variable A variable to check.
	 * @returns {boolean} `true` if the variable is used from a closure.
	 */
	function isReferencedInClosure(variable) {
		const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope);

		return variable.references.some(
			reference =>
				getEnclosingFunctionScope(reference.from) !==
				enclosingFunctionScope,
		);
	}

	/**
	 * Checks whether the given node is the assignee of a loop.
	 * @param {ASTNode} node A VariableDeclaration node to check.
	 * @returns {boolean} `true` if the declaration is assigned as part of loop
	 *      iteration.
	 */
	function isLoopAssignee(node) {
		return (
			(node.parent.type === "ForOfStatement" ||
				node.parent.type === "ForInStatement") &&
			node === node.parent.left
		);
	}

	/**
	 * Checks whether the given variable declaration is immediately initialized.
	 * @param {ASTNode} node A VariableDeclaration node to check.
	 * @returns {boolean} `true` if the declaration has an initializer.
	 */
	function isDeclarationInitialized(node) {
		return node.declarations.every(declarator => declarator.init !== null);
	}

	const SCOPE_NODE_TYPE =
		/^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u;

	/**
	 * Gets the scope node which directly contains a given node.
	 * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or
	 *      an `Identifier`.
	 * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`,
	 *      `SwitchStatement`, `ForStatement`, `ForInStatement`, and
	 *      `ForOfStatement`.
	 */
	function getScopeNode(node) {
		for (
			let currentNode = node;
			currentNode;
			currentNode = currentNode.parent
		) {
			if (SCOPE_NODE_TYPE.test(currentNode.type)) {
				return currentNode;
			}
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Checks whether a given variable is redeclared or not.
	 * @param {eslint-scope.Variable} variable A variable to check.
	 * @returns {boolean} `true` if the variable is redeclared.
	 */
	function isRedeclared(variable) {
		return variable.defs.length >= 2;
	}

	/**
	 * Checks whether a given variable is used from outside of the specified scope.
	 * @param {ASTNode} scopeNode A scope node to check.
	 * @returns {Function} The predicate function which checks whether a given
	 *      variable is used from outside of the specified scope.
	 */
	function isUsedFromOutsideOf(scopeNode) {
		/**
		 * Checks whether a given reference is inside of the specified scope or not.
		 * @param {eslint-scope.Reference} reference A reference to check.
		 * @returns {boolean} `true` if the reference is inside of the specified
		 *      scope.
		 */
		function isOutsideOfScope(reference) {
			const scope = scopeNode.range;
			const id = reference.identifier.range;

			return id[0] < scope[0] || id[1] > scope[1];
		}

		return function (variable) {
			return variable.references.some(isOutsideOfScope);
		};
	}

	/**
	 * Creates the predicate function which checks whether a variable has their references in TDZ.
	 *
	 * The predicate function would return `true`:
	 *
	 * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};)
	 * - if a reference is in the expression of their default value.  E.g. (var {a = a} = {};)
	 * - if a reference is in the expression of their initializer.  E.g. (var a = a;)
	 * @param {ASTNode} node The initializer node of VariableDeclarator.
	 * @returns {Function} The predicate function.
	 * @private
	 */
	function hasReferenceInTDZ(node) {
		const initStart = node.range[0];
		const initEnd = node.range[1];

		return variable => {
			const id = variable.defs[0].name;
			const idStart = id.range[0];
			const defaultValue =
				id.parent.type === "AssignmentPattern" ? id.parent.right : null;
			const defaultStart = defaultValue && defaultValue.range[0];
			const defaultEnd = defaultValue && defaultValue.range[1];

			return variable.references.some(reference => {
				const start = reference.identifier.range[0];
				const end = reference.identifier.range[1];

				return (
					!reference.init &&
					(start < idStart ||
						(defaultValue !== null &&
							start >= defaultStart &&
							end <= defaultEnd) ||
						(!astUtils.isFunction(node) &&
							start >= initStart &&
							end <= initEnd))
				);
			});
		};
	}

	/**
	 * Checks whether a given variable has name that is allowed for 'var' declarations,
	 * but disallowed for `let` declarations.
	 * @param {eslint-scope.Variable} variable The variable to check.
	 * @returns {boolean} `true` if the variable has a disallowed name.
	 */
	function hasNameDisallowedForLetDeclarations(variable) {
		return variable.name === "let";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noVar = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require `let` or `const` instead of `var`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-var",
			},

			schema: [],
			fixable: "code",

			messages: {
				unexpectedVar: "Unexpected var, use let or const instead.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Checks whether the variables which are defined by the given declarator node have their references in TDZ.
			 * @param {ASTNode} declarator The VariableDeclarator node to check.
			 * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ.
			 */
			function hasSelfReferenceInTDZ(declarator) {
				if (!declarator.init) {
					return false;
				}
				const variables = sourceCode.getDeclaredVariables(declarator);

				return variables.some(hasReferenceInTDZ(declarator.init));
			}

			/**
			 * Checks whether it can fix a given variable declaration or not.
			 * It cannot fix if the following cases:
			 *
			 * - A variable is a global variable.
			 * - A variable is declared on a SwitchCase node.
			 * - A variable is redeclared.
			 * - A variable is used from outside the scope.
			 * - A variable is used from a closure within a loop.
			 * - A variable might be used before it is assigned within a loop.
			 * - A variable might be used in TDZ.
			 * - A variable is declared in statement position (e.g. a single-line `IfStatement`)
			 * - A variable has name that is disallowed for `let` declarations.
			 *
			 * ## A variable is declared on a SwitchCase node.
			 *
			 * If this rule modifies 'var' declarations on a SwitchCase node, it
			 * would generate the warnings of 'no-case-declarations' rule. And the
			 * 'eslint:recommended' preset includes 'no-case-declarations' rule, so
			 * this rule doesn't modify those declarations.
			 *
			 * ## A variable is redeclared.
			 *
			 * The language spec disallows redeclarations of `let` declarations.
			 * Those variables would cause syntax errors.
			 *
			 * ## A variable is used from outside the scope.
			 *
			 * The language spec disallows accesses from outside of the scope for
			 * `let` declarations. Those variables would cause reference errors.
			 *
			 * ## A variable is used from a closure within a loop.
			 *
			 * A `var` declaration within a loop shares the same variable instance
			 * across all loop iterations, while a `let` declaration creates a new
			 * instance for each iteration. This means if a variable in a loop is
			 * referenced by any closure, changing it from `var` to `let` would
			 * change the behavior in a way that is generally unsafe.
			 *
			 * ## A variable might be used before it is assigned within a loop.
			 *
			 * Within a loop, a `let` declaration without an initializer will be
			 * initialized to null, while a `var` declaration will retain its value
			 * from the previous iteration, so it is only safe to change `var` to
			 * `let` if we can statically determine that the variable is always
			 * assigned a value before its first access in the loop body. To keep
			 * the implementation simple, we only convert `var` to `let` within
			 * loops when the variable is a loop assignee or the declaration has an
			 * initializer.
			 * @param {ASTNode} node A variable declaration node to check.
			 * @returns {boolean} `true` if it can fix the node.
			 */
			function canFix(node) {
				const variables = sourceCode.getDeclaredVariables(node);
				const scopeNode = getScopeNode(node);

				if (
					node.parent.type === "SwitchCase" ||
					node.declarations.some(hasSelfReferenceInTDZ) ||
					variables.some(isGlobal) ||
					variables.some(isRedeclared) ||
					variables.some(isUsedFromOutsideOf(scopeNode)) ||
					variables.some(hasNameDisallowedForLetDeclarations)
				) {
					return false;
				}

				if (astUtils.isInLoop(node)) {
					if (variables.some(isReferencedInClosure)) {
						return false;
					}
					if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) {
						return false;
					}
				}

				if (
					!isLoopAssignee(node) &&
					!(
						node.parent.type === "ForStatement" &&
						node.parent.init === node
					) &&
					!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)
				) {
					// If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed.
					return false;
				}

				return true;
			}

			/**
			 * Reports a given variable declaration node.
			 * @param {ASTNode} node A variable declaration node to report.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "unexpectedVar",

					fix(fixer) {
						const varToken = sourceCode.getFirstToken(node, {
							filter: t => t.value === "var",
						});

						return canFix(node)
							? fixer.replaceText(varToken, "let")
							: null;
					},
				});
			}

			return {
				"VariableDeclaration:exit"(node) {
					if (node.kind === "var") {
						report(node);
					}
				},
			};
		},
	};
	return noVar;
}

/**
 * @fileoverview Rule to disallow use of void operator.
 * @author Mike Sidorov
 */

var noVoid;
var hasRequiredNoVoid;

function requireNoVoid () {
	if (hasRequiredNoVoid) return noVoid;
	hasRequiredNoVoid = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noVoid = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowAsStatement: false,
				},
			],

			docs: {
				description: "Disallow `void` operators",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-void",
			},

			messages: {
				noVoid: "Expected 'undefined' and instead saw 'void'.",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowAsStatement: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
		},

		create(context) {
			const [{ allowAsStatement }] = context.options;

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				'UnaryExpression[operator="void"]'(node) {
					if (
						allowAsStatement &&
						node.parent &&
						node.parent.type === "ExpressionStatement"
					) {
						return;
					}
					context.report({
						node,
						messageId: "noVoid",
					});
				},
			};
		},
	};
	return noVoid;
}

/**
 * @fileoverview Rule that warns about used warning comments
 * @author Alexander Schmidt <https://github.com/lxanders>
 */

var noWarningComments;
var hasRequiredNoWarningComments;

function requireNoWarningComments () {
	if (hasRequiredNoWarningComments) return noWarningComments;
	hasRequiredNoWarningComments = 1;

	const escapeRegExp = requireEscapeStringRegexp();
	const astUtils = requireAstUtils();

	const CHAR_LIMIT = 40;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noWarningComments = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					location: "start",
					terms: ["todo", "fixme", "xxx"],
				},
			],

			docs: {
				description: "Disallow specified warning terms in comments",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/no-warning-comments",
			},

			schema: [
				{
					type: "object",
					properties: {
						terms: {
							type: "array",
							items: {
								type: "string",
							},
						},
						location: {
							enum: ["start", "anywhere"],
						},
						decoration: {
							type: "array",
							items: {
								type: "string",
								pattern: "^\\S$",
							},
							minItems: 1,
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedComment:
					"Unexpected '{{matchedTerm}}' comment: '{{comment}}'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const [{ decoration, location, terms: warningTerms }] = context.options;
			const escapedDecoration = escapeRegExp(
				decoration ? decoration.join("") : "",
			);
			const selfConfigRegEx = /\bno-warning-comments\b/u;

			/**
			 * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified
			 * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not
			 * require word boundaries on that side.
			 * @param {string} term A term to convert to a RegExp
			 * @returns {RegExp} The term converted to a RegExp
			 */
			function convertToRegExp(term) {
				const escaped = escapeRegExp(term);

				/*
				 * When matching at the start, ignore leading whitespace, and
				 * there's no need to worry about word boundaries.
				 *
				 * These expressions for the prefix and suffix are designed as follows:
				 * ^   handles any terms at the beginning of a comment.
				 *     e.g. terms ["TODO"] matches `//TODO something`
				 * $   handles any terms at the end of a comment
				 *     e.g. terms ["TODO"] matches `// something TODO`
				 * \b  handles terms preceded/followed by word boundary
				 *     e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX`
				 *          terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix`
				 *
				 * For location start:
				 * [\s]* handles optional leading spaces
				 *     e.g. terms ["TODO"] matches `//    TODO something`
				 * [\s\*]* (where "\*" is the escaped string of decoration)
				 *     handles optional leading spaces or decoration characters (for "start" location only)
				 *     e.g. terms ["TODO"] matches `/**** TODO something ... `
				 */
				const wordBoundary = "\\b";

				let prefix = "";

				if (location === "start") {
					prefix = `^[\\s${escapedDecoration}]*`;
				} else if (/^\w/u.test(term)) {
					prefix = wordBoundary;
				}

				const suffix = /\w$/u.test(term) ? wordBoundary : "";
				const flags = "iu"; // Case-insensitive with Unicode case folding.

				/*
				 * For location "start", the typical regex is:
				 *   /^[\s]*ESCAPED_TERM\b/iu.
				 * Or if decoration characters are specified (e.g. "*"), then any of
				 * those characters may appear in any order at the start:
				 *   /^[\s\*]*ESCAPED_TERM\b/iu.
				 *
				 * For location "anywhere" the typical regex is
				 *   /\bESCAPED_TERM\b/iu
				 *
				 * If it starts or ends with non-word character, the prefix and suffix are empty, respectively.
				 */
				return new RegExp(`${prefix}${escaped}${suffix}`, flags);
			}

			const warningRegExps = warningTerms.map(convertToRegExp);

			/**
			 * Checks the specified comment for matches of the configured warning terms and returns the matches.
			 * @param {string} comment The comment which is checked.
			 * @returns {Array} All matched warning terms for this comment.
			 */
			function commentContainsWarningTerm(comment) {
				const matches = [];

				warningRegExps.forEach((regex, index) => {
					if (regex.test(comment)) {
						matches.push(warningTerms[index]);
					}
				});

				return matches;
			}

			/**
			 * Checks the specified node for matching warning comments and reports them.
			 * @param {ASTNode} node The AST node being checked.
			 * @returns {void} undefined.
			 */
			function checkComment(node) {
				const comment = node.value;

				if (
					astUtils.isDirectiveComment(node) &&
					selfConfigRegEx.test(comment)
				) {
					return;
				}

				const matches = commentContainsWarningTerm(comment);

				matches.forEach(matchedTerm => {
					let commentToDisplay = "";
					let truncated = false;

					for (const c of comment.trim().split(/\s+/u)) {
						const tmp = commentToDisplay
							? `${commentToDisplay} ${c}`
							: c;

						if (tmp.length <= CHAR_LIMIT) {
							commentToDisplay = tmp;
						} else {
							truncated = true;
							break;
						}
					}

					context.report({
						node,
						messageId: "unexpectedComment",
						data: {
							matchedTerm,
							comment: `${commentToDisplay}${truncated ? "..." : ""}`,
						},
					});
				});
			}

			return {
				Program() {
					const comments = sourceCode.getAllComments();

					comments
						.filter(token => token.type !== "Shebang")
						.forEach(checkComment);
				},
			};
		},
	};
	return noWarningComments;
}

/**
 * @fileoverview Rule to disallow whitespace before properties
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */

var noWhitespaceBeforeProperty;
var hasRequiredNoWhitespaceBeforeProperty;

function requireNoWhitespaceBeforeProperty () {
	if (hasRequiredNoWhitespaceBeforeProperty) return noWhitespaceBeforeProperty;
	hasRequiredNoWhitespaceBeforeProperty = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noWhitespaceBeforeProperty = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "no-whitespace-before-property",
							url: "https://eslint.style/rules/js/no-whitespace-before-property",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Disallow whitespace before properties",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property",
			},

			fixable: "whitespace",
			schema: [],

			messages: {
				unexpectedWhitespace:
					"Unexpected whitespace before property {{propName}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports whitespace before property token
			 * @param {ASTNode} node the node to report in the event of an error
			 * @param {Token} leftToken the left token
			 * @param {Token} rightToken the right token
			 * @returns {void}
			 * @private
			 */
			function reportError(node, leftToken, rightToken) {
				context.report({
					node,
					messageId: "unexpectedWhitespace",
					data: {
						propName: sourceCode.getText(node.property),
					},
					fix(fixer) {
						let replacementText = "";

						if (
							!node.computed &&
							!node.optional &&
							astUtils.isDecimalInteger(node.object)
						) {
							/*
							 * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError.
							 * Don't fix this case.
							 */
							return null;
						}

						// Don't fix if comments exist.
						if (
							sourceCode.commentsExistBetween(leftToken, rightToken)
						) {
							return null;
						}

						if (node.optional) {
							replacementText = "?.";
						} else if (!node.computed) {
							replacementText = ".";
						}

						return fixer.replaceTextRange(
							[leftToken.range[1], rightToken.range[0]],
							replacementText,
						);
					},
				});
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				MemberExpression(node) {
					let rightToken;
					let leftToken;

					if (!astUtils.isTokenOnSameLine(node.object, node.property)) {
						return;
					}

					if (node.computed) {
						rightToken = sourceCode.getTokenBefore(
							node.property,
							astUtils.isOpeningBracketToken,
						);
						leftToken = sourceCode.getTokenBefore(
							rightToken,
							node.optional ? 1 : 0,
						);
					} else {
						rightToken = sourceCode.getFirstToken(node.property);
						leftToken = sourceCode.getTokenBefore(rightToken, 1);
					}

					if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
						reportError(node, leftToken, rightToken);
					}
				},
			};
		},
	};
	return noWhitespaceBeforeProperty;
}

/**
 * @fileoverview Rule to flag use of with statement
 * @author Nicholas C. Zakas
 */

var noWith;
var hasRequiredNoWith;

function requireNoWith () {
	if (hasRequiredNoWith) return noWith;
	hasRequiredNoWith = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	noWith = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Disallow `with` statements",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/no-with",
			},

			schema: [],

			messages: {
				unexpectedWith: "Unexpected use of 'with' statement.",
			},
		},

		create(context) {
			return {
				WithStatement(node) {
					context.report({ node, messageId: "unexpectedWith" });
				},
			};
		},
	};
	return noWith;
}

/**
 * @fileoverview enforce the location of single-line statements
 * @author Teddy Katz
 * @deprecated in ESLint v8.53.0
 */

var nonblockStatementBodyPosition;
var hasRequiredNonblockStatementBodyPosition;

function requireNonblockStatementBodyPosition () {
	if (hasRequiredNonblockStatementBodyPosition) return nonblockStatementBodyPosition;
	hasRequiredNonblockStatementBodyPosition = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const POSITION_SCHEMA = { enum: ["beside", "below", "any"] };

	/** @type {import('../shared/types').Rule} */
	nonblockStatementBodyPosition = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "nonblock-statement-body-position",
							url: "https://eslint.style/rules/js/nonblock-statement-body-position",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce the location of single-line statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position",
			},

			fixable: "whitespace",

			schema: [
				POSITION_SCHEMA,
				{
					properties: {
						overrides: {
							properties: {
								if: POSITION_SCHEMA,
								else: POSITION_SCHEMA,
								while: POSITION_SCHEMA,
								do: POSITION_SCHEMA,
								for: POSITION_SCHEMA,
							},
							additionalProperties: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				expectNoLinebreak: "Expected no linebreak before this statement.",
				expectLinebreak: "Expected a linebreak before this statement.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Gets the applicable preference for a particular keyword
			 * @param {string} keywordName The name of a keyword, e.g. 'if'
			 * @returns {string} The applicable option for the keyword, e.g. 'beside'
			 */
			function getOption(keywordName) {
				return (
					(context.options[1] &&
						context.options[1].overrides &&
						context.options[1].overrides[keywordName]) ||
					context.options[0] ||
					"beside"
				);
			}

			/**
			 * Validates the location of a single-line statement
			 * @param {ASTNode} node The single-line statement
			 * @param {string} keywordName The applicable keyword name for the single-line statement
			 * @returns {void}
			 */
			function validateStatement(node, keywordName) {
				const option = getOption(keywordName);

				if (node.type === "BlockStatement" || option === "any") {
					return;
				}

				const tokenBefore = sourceCode.getTokenBefore(node);

				if (
					tokenBefore.loc.end.line === node.loc.start.line &&
					option === "below"
				) {
					context.report({
						node,
						messageId: "expectLinebreak",
						fix: fixer => fixer.insertTextBefore(node, "\n"),
					});
				} else if (
					tokenBefore.loc.end.line !== node.loc.start.line &&
					option === "beside"
				) {
					context.report({
						node,
						messageId: "expectNoLinebreak",
						fix(fixer) {
							if (
								sourceCode
									.getText()
									.slice(tokenBefore.range[1], node.range[0])
									.trim()
							) {
								return null;
							}
							return fixer.replaceTextRange(
								[tokenBefore.range[1], node.range[0]],
								" ",
							);
						},
					});
				}
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				IfStatement(node) {
					validateStatement(node.consequent, "if");

					// Check the `else` node, but don't check 'else if' statements.
					if (node.alternate && node.alternate.type !== "IfStatement") {
						validateStatement(node.alternate, "else");
					}
				},
				WhileStatement: node => validateStatement(node.body, "while"),
				DoWhileStatement: node => validateStatement(node.body, "do"),
				ForStatement: node => validateStatement(node.body, "for"),
				ForInStatement: node => validateStatement(node.body, "for"),
				ForOfStatement: node => validateStatement(node.body, "for"),
			};
		},
	};
	return nonblockStatementBodyPosition;
}

/**
 * @fileoverview Rule to require or disallow line breaks inside braces.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var objectCurlyNewline;
var hasRequiredObjectCurlyNewline;

function requireObjectCurlyNewline () {
	if (hasRequiredObjectCurlyNewline) return objectCurlyNewline;
	hasRequiredObjectCurlyNewline = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	// Schema objects.
	const OPTION_VALUE = {
		oneOf: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					multiline: {
						type: "boolean",
					},
					minProperties: {
						type: "integer",
						minimum: 0,
					},
					consistent: {
						type: "boolean",
					},
				},
				additionalProperties: false,
				minProperties: 1,
			},
		],
	};

	/**
	 * Normalizes a given option value.
	 * @param {string|Object|undefined} value An option value to parse.
	 * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object.
	 */
	function normalizeOptionValue(value) {
		let multiline = false;
		let minProperties = Number.POSITIVE_INFINITY;
		let consistent = false;

		if (value) {
			if (value === "always") {
				minProperties = 0;
			} else if (value === "never") {
				minProperties = Number.POSITIVE_INFINITY;
			} else {
				multiline = Boolean(value.multiline);
				minProperties = value.minProperties || Number.POSITIVE_INFINITY;
				consistent = Boolean(value.consistent);
			}
		} else {
			consistent = true;
		}

		return { multiline, minProperties, consistent };
	}

	/**
	 * Checks if a value is an object.
	 * @param {any} value The value to check
	 * @returns {boolean} `true` if the value is an object, otherwise `false`
	 */
	function isObject(value) {
		return typeof value === "object" && value !== null;
	}

	/**
	 * Checks if an option is a node-specific option
	 * @param {any} option The option to check
	 * @returns {boolean} `true` if the option is node-specific, otherwise `false`
	 */
	function isNodeSpecificOption(option) {
		return isObject(option) || typeof option === "string";
	}

	/**
	 * Normalizes a given option value.
	 * @param {string|Object|undefined} options An option value to parse.
	 * @returns {{
	 *   ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean},
	 *   ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean},
	 *   ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean},
	 *   ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean}
	 * }} Normalized option object.
	 */
	function normalizeOptions(options) {
		if (
			isObject(options) &&
			Object.values(options).some(isNodeSpecificOption)
		) {
			return {
				ObjectExpression: normalizeOptionValue(options.ObjectExpression),
				ObjectPattern: normalizeOptionValue(options.ObjectPattern),
				ImportDeclaration: normalizeOptionValue(options.ImportDeclaration),
				ExportNamedDeclaration: normalizeOptionValue(
					options.ExportDeclaration,
				),
			};
		}

		const value = normalizeOptionValue(options);

		return {
			ObjectExpression: value,
			ObjectPattern: value,
			ImportDeclaration: value,
			ExportNamedDeclaration: value,
		};
	}

	/**
	 * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration
	 * node needs to be checked for missing line breaks
	 * @param {ASTNode} node Node under inspection
	 * @param {Object} options option specific to node type
	 * @param {Token} first First object property
	 * @param {Token} last Last object property
	 * @returns {boolean} `true` if node needs to be checked for missing line breaks
	 */
	function areLineBreaksRequired(node, options, first, last) {
		let objectProperties;

		if (node.type === "ObjectExpression" || node.type === "ObjectPattern") {
			objectProperties = node.properties;
		} else {
			// is ImportDeclaration or ExportNamedDeclaration
			objectProperties = node.specifiers.filter(
				s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier",
			);
		}

		return (
			objectProperties.length >= options.minProperties ||
			(options.multiline &&
				objectProperties.length > 0 &&
				first.loc.start.line !== last.loc.end.line)
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	objectCurlyNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "object-curly-newline",
							url: "https://eslint.style/rules/js/object-curly-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent line breaks after opening and before closing braces",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/object-curly-newline",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						OPTION_VALUE,
						{
							type: "object",
							properties: {
								ObjectExpression: OPTION_VALUE,
								ObjectPattern: OPTION_VALUE,
								ImportDeclaration: OPTION_VALUE,
								ExportDeclaration: OPTION_VALUE,
							},
							additionalProperties: false,
							minProperties: 1,
						},
					],
				},
			],

			messages: {
				unexpectedLinebreakBeforeClosingBrace:
					"Unexpected line break before this closing brace.",
				unexpectedLinebreakAfterOpeningBrace:
					"Unexpected line break after this opening brace.",
				expectedLinebreakBeforeClosingBrace:
					"Expected a line break before this closing brace.",
				expectedLinebreakAfterOpeningBrace:
					"Expected a line break after this opening brace.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const normalizedOptions = normalizeOptions(context.options[0]);

			/**
			 * Reports a given node if it violated this rule.
			 * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node.
			 * @returns {void}
			 */
			function check(node) {
				const options = normalizedOptions[node.type];

				if (
					(node.type === "ImportDeclaration" &&
						!node.specifiers.some(
							specifier => specifier.type === "ImportSpecifier",
						)) ||
					(node.type === "ExportNamedDeclaration" &&
						!node.specifiers.some(
							specifier => specifier.type === "ExportSpecifier",
						))
				) {
					return;
				}

				const openBrace = sourceCode.getFirstToken(
					node,
					token => token.value === "{",
				);

				let closeBrace;

				if (node.typeAnnotation) {
					closeBrace = sourceCode.getTokenBefore(node.typeAnnotation);
				} else {
					closeBrace = sourceCode.getLastToken(
						node,
						token => token.value === "}",
					);
				}

				let first = sourceCode.getTokenAfter(openBrace, {
					includeComments: true,
				});
				let last = sourceCode.getTokenBefore(closeBrace, {
					includeComments: true,
				});

				const needsLineBreaks = areLineBreaksRequired(
					node,
					options,
					first,
					last,
				);

				const hasCommentsFirstToken = astUtils.isCommentToken(first);
				const hasCommentsLastToken = astUtils.isCommentToken(last);

				/*
				 * Use tokens or comments to check multiline or not.
				 * But use only tokens to check whether line breaks are needed.
				 * This allows:
				 *     var obj = { // eslint-disable-line foo
				 *         a: 1
				 *     }
				 */
				first = sourceCode.getTokenAfter(openBrace);
				last = sourceCode.getTokenBefore(closeBrace);

				if (needsLineBreaks) {
					if (astUtils.isTokenOnSameLine(openBrace, first)) {
						context.report({
							messageId: "expectedLinebreakAfterOpeningBrace",
							node,
							loc: openBrace.loc,
							fix(fixer) {
								if (hasCommentsFirstToken) {
									return null;
								}

								return fixer.insertTextAfter(openBrace, "\n");
							},
						});
					}
					if (astUtils.isTokenOnSameLine(last, closeBrace)) {
						context.report({
							messageId: "expectedLinebreakBeforeClosingBrace",
							node,
							loc: closeBrace.loc,
							fix(fixer) {
								if (hasCommentsLastToken) {
									return null;
								}

								return fixer.insertTextBefore(closeBrace, "\n");
							},
						});
					}
				} else {
					const consistent = options.consistent;
					const hasLineBreakBetweenOpenBraceAndFirst =
						!astUtils.isTokenOnSameLine(openBrace, first);
					const hasLineBreakBetweenCloseBraceAndLast =
						!astUtils.isTokenOnSameLine(last, closeBrace);

					if (
						(!consistent && hasLineBreakBetweenOpenBraceAndFirst) ||
						(consistent &&
							hasLineBreakBetweenOpenBraceAndFirst &&
							!hasLineBreakBetweenCloseBraceAndLast)
					) {
						context.report({
							messageId: "unexpectedLinebreakAfterOpeningBrace",
							node,
							loc: openBrace.loc,
							fix(fixer) {
								if (hasCommentsFirstToken) {
									return null;
								}

								return fixer.removeRange([
									openBrace.range[1],
									first.range[0],
								]);
							},
						});
					}
					if (
						(!consistent && hasLineBreakBetweenCloseBraceAndLast) ||
						(consistent &&
							!hasLineBreakBetweenOpenBraceAndFirst &&
							hasLineBreakBetweenCloseBraceAndLast)
					) {
						context.report({
							messageId: "unexpectedLinebreakBeforeClosingBrace",
							node,
							loc: closeBrace.loc,
							fix(fixer) {
								if (hasCommentsLastToken) {
									return null;
								}

								return fixer.removeRange([
									last.range[1],
									closeBrace.range[0],
								]);
							},
						});
					}
				}
			}

			return {
				ObjectExpression: check,
				ObjectPattern: check,
				ImportDeclaration: check,
				ExportNamedDeclaration: check,
			};
		},
	};
	return objectCurlyNewline;
}

/**
 * @fileoverview Disallows or enforces spaces inside of object literals.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

var objectCurlySpacing;
var hasRequiredObjectCurlySpacing;

function requireObjectCurlySpacing () {
	if (hasRequiredObjectCurlySpacing) return objectCurlySpacing;
	hasRequiredObjectCurlySpacing = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	objectCurlySpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "object-curly-spacing",
							url: "https://eslint.style/rules/js/object-curly-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing inside braces",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/object-curly-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						arraysInObjects: {
							type: "boolean",
						},
						objectsInObjects: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				requireSpaceBefore: "A space is required before '{{token}}'.",
				requireSpaceAfter: "A space is required after '{{token}}'.",
				unexpectedSpaceBefore:
					"There should be no space before '{{token}}'.",
				unexpectedSpaceAfter: "There should be no space after '{{token}}'.",
			},
		},

		create(context) {
			const spaced = context.options[0] === "always",
				sourceCode = context.sourceCode;

			/**
			 * Determines whether an option is set, relative to the spacing option.
			 * If spaced is "always", then check whether option is set to false.
			 * If spaced is "never", then check whether option is set to true.
			 * @param {Object} option The option to exclude.
			 * @returns {boolean} Whether or not the property is excluded.
			 */
			function isOptionSet(option) {
				return context.options[1]
					? context.options[1][option] === !spaced
					: false;
			}

			const options = {
				spaced,
				arraysInObjectsException: isOptionSet("arraysInObjects"),
				objectsInObjectsException: isOptionSet("objectsInObjects"),
			};

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports that there shouldn't be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoBeginningSpace(node, token) {
				const nextToken = context.sourceCode.getTokenAfter(token, {
					includeComments: true,
				});

				context.report({
					node,
					loc: { start: token.loc.end, end: nextToken.loc.start },
					messageId: "unexpectedSpaceAfter",
					data: {
						token: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							token.range[1],
							nextToken.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there shouldn't be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportNoEndingSpace(node, token) {
				const previousToken = context.sourceCode.getTokenBefore(token, {
					includeComments: true,
				});

				context.report({
					node,
					loc: { start: previousToken.loc.end, end: token.loc.start },
					messageId: "unexpectedSpaceBefore",
					data: {
						token: token.value,
					},
					fix(fixer) {
						return fixer.removeRange([
							previousToken.range[1],
							token.range[0],
						]);
					},
				});
			}

			/**
			 * Reports that there should be a space after the first token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredBeginningSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "requireSpaceAfter",
					data: {
						token: token.value,
					},
					fix(fixer) {
						return fixer.insertTextAfter(token, " ");
					},
				});
			}

			/**
			 * Reports that there should be a space before the last token
			 * @param {ASTNode} node The node to report in the event of an error.
			 * @param {Token} token The token to use for the report.
			 * @returns {void}
			 */
			function reportRequiredEndingSpace(node, token) {
				context.report({
					node,
					loc: token.loc,
					messageId: "requireSpaceBefore",
					data: {
						token: token.value,
					},
					fix(fixer) {
						return fixer.insertTextBefore(token, " ");
					},
				});
			}

			/**
			 * Determines if spacing in curly braces is valid.
			 * @param {ASTNode} node The AST node to check.
			 * @param {Token} first The first token to check (should be the opening brace)
			 * @param {Token} second The second token to check (should be first after the opening brace)
			 * @param {Token} penultimate The penultimate token to check (should be last before closing brace)
			 * @param {Token} last The last token to check (should be closing brace)
			 * @returns {void}
			 */
			function validateBraceSpacing(node, first, second, penultimate, last) {
				if (astUtils.isTokenOnSameLine(first, second)) {
					const firstSpaced = sourceCode.isSpaceBetweenTokens(
						first,
						second,
					);

					if (options.spaced && !firstSpaced) {
						reportRequiredBeginningSpace(node, first);
					}
					if (!options.spaced && firstSpaced && second.type !== "Line") {
						reportNoBeginningSpace(node, first);
					}
				}

				if (astUtils.isTokenOnSameLine(penultimate, last)) {
					const shouldCheckPenultimate =
						(options.arraysInObjectsException &&
							astUtils.isClosingBracketToken(penultimate)) ||
						(options.objectsInObjectsException &&
							astUtils.isClosingBraceToken(penultimate));
					const penultimateType =
						shouldCheckPenultimate &&
						sourceCode.getNodeByRangeIndex(penultimate.range[0]).type;

					const closingCurlyBraceMustBeSpaced =
						(options.arraysInObjectsException &&
							penultimateType === "ArrayExpression") ||
						(options.objectsInObjectsException &&
							(penultimateType === "ObjectExpression" ||
								penultimateType === "ObjectPattern"))
							? !options.spaced
							: options.spaced;

					const lastSpaced = sourceCode.isSpaceBetweenTokens(
						penultimate,
						last,
					);

					if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
						reportRequiredEndingSpace(node, last);
					}
					if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
						reportNoEndingSpace(node, last);
					}
				}
			}

			/**
			 * Gets '}' token of an object node.
			 *
			 * Because the last token of object patterns might be a type annotation,
			 * this traverses tokens preceded by the last property, then returns the
			 * first '}' token.
			 * @param {ASTNode} node The node to get. This node is an
			 *      ObjectExpression or an ObjectPattern. And this node has one or
			 *      more properties.
			 * @returns {Token} '}' token.
			 */
			function getClosingBraceOfObject(node) {
				const lastProperty = node.properties.at(-1);

				return sourceCode.getTokenAfter(
					lastProperty,
					astUtils.isClosingBraceToken,
				);
			}

			/**
			 * Reports a given object node if spacing in curly braces is invalid.
			 * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check.
			 * @returns {void}
			 */
			function checkForObject(node) {
				if (node.properties.length === 0) {
					return;
				}

				const first = sourceCode.getFirstToken(node),
					last = getClosingBraceOfObject(node),
					second = sourceCode.getTokenAfter(first, {
						includeComments: true,
					}),
					penultimate = sourceCode.getTokenBefore(last, {
						includeComments: true,
					});

				validateBraceSpacing(node, first, second, penultimate, last);
			}

			/**
			 * Reports a given import node if spacing in curly braces is invalid.
			 * @param {ASTNode} node An ImportDeclaration node to check.
			 * @returns {void}
			 */
			function checkForImport(node) {
				if (node.specifiers.length === 0) {
					return;
				}

				let firstSpecifier = node.specifiers[0];
				const lastSpecifier = node.specifiers.at(-1);

				if (lastSpecifier.type !== "ImportSpecifier") {
					return;
				}
				if (firstSpecifier.type !== "ImportSpecifier") {
					firstSpecifier = node.specifiers[1];
				}

				const first = sourceCode.getTokenBefore(firstSpecifier),
					last = sourceCode.getTokenAfter(
						lastSpecifier,
						astUtils.isNotCommaToken,
					),
					second = sourceCode.getTokenAfter(first, {
						includeComments: true,
					}),
					penultimate = sourceCode.getTokenBefore(last, {
						includeComments: true,
					});

				validateBraceSpacing(node, first, second, penultimate, last);
			}

			/**
			 * Reports a given export node if spacing in curly braces is invalid.
			 * @param {ASTNode} node An ExportNamedDeclaration node to check.
			 * @returns {void}
			 */
			function checkForExport(node) {
				if (node.specifiers.length === 0) {
					return;
				}

				const firstSpecifier = node.specifiers[0],
					lastSpecifier = node.specifiers.at(-1),
					first = sourceCode.getTokenBefore(firstSpecifier),
					last = sourceCode.getTokenAfter(
						lastSpecifier,
						astUtils.isNotCommaToken,
					),
					second = sourceCode.getTokenAfter(first, {
						includeComments: true,
					}),
					penultimate = sourceCode.getTokenBefore(last, {
						includeComments: true,
					});

				validateBraceSpacing(node, first, second, penultimate, last);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				// var {x} = y;
				ObjectPattern: checkForObject,

				// var y = {x: 'y'}
				ObjectExpression: checkForObject,

				// import {y} from 'x';
				ImportDeclaration: checkForImport,

				// export {name} from 'yo';
				ExportNamedDeclaration: checkForExport,
			};
		},
	};
	return objectCurlySpacing;
}

/**
 * @fileoverview Rule to enforce placing object properties on separate lines.
 * @author Vitor Balocco
 * @deprecated in ESLint v8.53.0
 */

var objectPropertyNewline;
var hasRequiredObjectPropertyNewline;

function requireObjectPropertyNewline () {
	if (hasRequiredObjectPropertyNewline) return objectPropertyNewline;
	hasRequiredObjectPropertyNewline = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	objectPropertyNewline = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "object-property-newline",
							url: "https://eslint.style/rules/js/object-property-newline",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce placing object properties on separate lines",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/object-property-newline",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowAllPropertiesOnSameLine: {
							type: "boolean",
							default: false,
						},
						allowMultiplePropertiesPerLine: {
							// Deprecated
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "whitespace",

			messages: {
				propertiesOnNewlineAll:
					"Object properties must go on a new line if they aren't all on the same line.",
				propertiesOnNewline: "Object properties must go on a new line.",
			},
		},

		create(context) {
			const allowSameLine =
				context.options[0] &&
				(context.options[0].allowAllPropertiesOnSameLine ||
					context.options[0]
						.allowMultiplePropertiesPerLine); /* Deprecated */
			const messageId = allowSameLine
				? "propertiesOnNewlineAll"
				: "propertiesOnNewline";

			const sourceCode = context.sourceCode;

			return {
				ObjectExpression(node) {
					if (allowSameLine) {
						if (node.properties.length > 1) {
							const firstTokenOfFirstProperty =
								sourceCode.getFirstToken(node.properties[0]);
							const lastTokenOfLastProperty = sourceCode.getLastToken(
								node.properties.at(-1),
							);

							if (
								firstTokenOfFirstProperty.loc.end.line ===
								lastTokenOfLastProperty.loc.start.line
							) {
								// All keys and values are on the same line
								return;
							}
						}
					}

					for (let i = 1; i < node.properties.length; i++) {
						const lastTokenOfPreviousProperty = sourceCode.getLastToken(
							node.properties[i - 1],
						);
						const firstTokenOfCurrentProperty =
							sourceCode.getFirstToken(node.properties[i]);

						if (
							lastTokenOfPreviousProperty.loc.end.line ===
							firstTokenOfCurrentProperty.loc.start.line
						) {
							context.report({
								node,
								loc: firstTokenOfCurrentProperty.loc,
								messageId,
								fix(fixer) {
									const comma = sourceCode.getTokenBefore(
										firstTokenOfCurrentProperty,
									);
									const rangeAfterComma = [
										comma.range[1],
										firstTokenOfCurrentProperty.range[0],
									];

									// Don't perform a fix if there are any comments between the comma and the next property.
									if (
										sourceCode.text
											.slice(
												rangeAfterComma[0],
												rangeAfterComma[1],
											)
											.trim()
									) {
										return null;
									}

									return fixer.replaceTextRange(
										rangeAfterComma,
										"\n",
									);
								},
							});
						}
					}
				},
			};
		},
	};
	return objectPropertyNewline;
}

/**
 * @fileoverview Rule to enforce concise object methods and properties.
 * @author Jamund Ferguson
 */

var objectShorthand;
var hasRequiredObjectShorthand;

function requireObjectShorthand () {
	if (hasRequiredObjectShorthand) return objectShorthand;
	hasRequiredObjectShorthand = 1;

	const OPTIONS = {
		always: "always",
		never: "never",
		methods: "methods",
		properties: "properties",
		consistent: "consistent",
		consistentAsNeeded: "consistent-as-needed",
	};

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------
	/** @type {import('../shared/types').Rule} */
	objectShorthand = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require or disallow method and property shorthand syntax for object literals",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/object-shorthand",
			},

			fixable: "code",

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: [
									"always",
									"methods",
									"properties",
									"never",
									"consistent",
									"consistent-as-needed",
								],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: ["always", "methods", "properties"],
							},
							{
								type: "object",
								properties: {
									avoidQuotes: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
					{
						type: "array",
						items: [
							{
								enum: ["always", "methods"],
							},
							{
								type: "object",
								properties: {
									ignoreConstructors: {
										type: "boolean",
									},
									methodsIgnorePattern: {
										type: "string",
									},
									avoidQuotes: {
										type: "boolean",
									},
									avoidExplicitReturnArrows: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			messages: {
				expectedAllPropertiesShorthanded:
					"Expected shorthand for all properties.",
				expectedLiteralMethodLongform:
					"Expected longform method syntax for string literal keys.",
				expectedPropertyShorthand: "Expected property shorthand.",
				expectedPropertyLongform: "Expected longform property syntax.",
				expectedMethodShorthand: "Expected method shorthand.",
				expectedMethodLongform: "Expected longform method syntax.",
				unexpectedMix:
					"Unexpected mix of shorthand and non-shorthand properties.",
			},
		},

		create(context) {
			const APPLY = context.options[0] || OPTIONS.always;
			const APPLY_TO_METHODS =
				APPLY === OPTIONS.methods || APPLY === OPTIONS.always;
			const APPLY_TO_PROPS =
				APPLY === OPTIONS.properties || APPLY === OPTIONS.always;
			const APPLY_NEVER = APPLY === OPTIONS.never;
			const APPLY_CONSISTENT = APPLY === OPTIONS.consistent;
			const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded;

			const PARAMS = context.options[1] || {};
			const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors;
			const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern
				? new RegExp(PARAMS.methodsIgnorePattern, "u")
				: null;
			const AVOID_QUOTES = PARAMS.avoidQuotes;
			const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows;
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const CTOR_PREFIX_REGEX = /[^_$0-9]/u;

			/**
			 * Determines if the first character of the name is a capital letter.
			 * @param {string} name The name of the node to evaluate.
			 * @returns {boolean} True if the first character of the property name is a capital letter, false if not.
			 * @private
			 */
			function isConstructor(name) {
				const match = CTOR_PREFIX_REGEX.exec(name);

				// Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8'
				if (!match) {
					return false;
				}

				const firstChar = name.charAt(match.index);

				return firstChar === firstChar.toUpperCase();
			}

			/**
			 * Determines if the property can have a shorthand form.
			 * @param {ASTNode} property Property AST node
			 * @returns {boolean} True if the property can have a shorthand form
			 * @private
			 */
			function canHaveShorthand(property) {
				return (
					property.kind !== "set" &&
					property.kind !== "get" &&
					property.type !== "SpreadElement" &&
					property.type !== "SpreadProperty" &&
					property.type !== "ExperimentalSpreadProperty"
				);
			}

			/**
			 * Checks whether a node is a string literal.
			 * @param {ASTNode} node Any AST node.
			 * @returns {boolean} `true` if it is a string literal.
			 */
			function isStringLiteral(node) {
				return node.type === "Literal" && typeof node.value === "string";
			}

			/**
			 * Determines if the property is a shorthand or not.
			 * @param {ASTNode} property Property AST node
			 * @returns {boolean} True if the property is considered shorthand, false if not.
			 * @private
			 */
			function isShorthand(property) {
				// property.method is true when `{a(){}}`.
				return property.shorthand || property.method;
			}

			/**
			 * Determines if the property's key and method or value are named equally.
			 * @param {ASTNode} property Property AST node
			 * @returns {boolean} True if the key and value are named equally, false if not.
			 * @private
			 */
			function isRedundant(property) {
				const value = property.value;

				if (value.type === "FunctionExpression") {
					return !value.id; // Only anonymous should be shorthand method.
				}
				if (value.type === "Identifier") {
					return astUtils.getStaticPropertyName(property) === value.name;
				}

				return false;
			}

			/**
			 * Ensures that an object's properties are consistently shorthand, or not shorthand at all.
			 * @param {ASTNode} node Property AST node
			 * @param {boolean} checkRedundancy Whether to check longform redundancy
			 * @returns {void}
			 */
			function checkConsistency(node, checkRedundancy) {
				// We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand.
				const properties = node.properties.filter(canHaveShorthand);

				// Do we still have properties left after filtering the getters and setters?
				if (properties.length > 0) {
					const shorthandProperties = properties.filter(isShorthand);

					/*
					 * If we do not have an equal number of longform properties as
					 * shorthand properties, we are using the annotations inconsistently
					 */
					if (shorthandProperties.length !== properties.length) {
						// We have at least 1 shorthand property
						if (shorthandProperties.length > 0) {
							context.report({ node, messageId: "unexpectedMix" });
						} else if (checkRedundancy) {
							/*
							 * If all properties of the object contain a method or value with a name matching it's key,
							 * all the keys are redundant.
							 */
							const canAlwaysUseShorthand =
								properties.every(isRedundant);

							if (canAlwaysUseShorthand) {
								context.report({
									node,
									messageId: "expectedAllPropertiesShorthanded",
								});
							}
						}
					}
				}
			}

			/**
			 * Fixes a FunctionExpression node by making it into a shorthand property.
			 * @param {SourceCodeFixer} fixer The fixer object
			 * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value
			 * @returns {Object} A fix for this node
			 */
			function makeFunctionShorthand(fixer, node) {
				const firstKeyToken = node.computed
					? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken)
					: sourceCode.getFirstToken(node.key);
				const lastKeyToken = node.computed
					? sourceCode.getFirstTokenBetween(
							node.key,
							node.value,
							astUtils.isClosingBracketToken,
						)
					: sourceCode.getLastToken(node.key);
				const keyText = sourceCode.text.slice(
					firstKeyToken.range[0],
					lastKeyToken.range[1],
				);
				let keyPrefix = "";

				// key: /* */ () => {}
				if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) {
					return null;
				}

				if (node.value.async) {
					keyPrefix += "async ";
				}
				if (node.value.generator) {
					keyPrefix += "*";
				}

				const fixRange = [firstKeyToken.range[0], node.range[1]];
				const methodPrefix = keyPrefix + keyText;

				if (node.value.type === "FunctionExpression") {
					const functionToken = sourceCode
						.getTokens(node.value)
						.find(
							token =>
								token.type === "Keyword" &&
								token.value === "function",
						);
					const tokenBeforeParams = node.value.generator
						? sourceCode.getTokenAfter(functionToken)
						: functionToken;

					return fixer.replaceTextRange(
						fixRange,
						methodPrefix +
							sourceCode.text.slice(
								tokenBeforeParams.range[1],
								node.value.range[1],
							),
					);
				}

				const arrowToken = sourceCode.getTokenBefore(
					node.value.body,
					astUtils.isArrowToken,
				);
				const fnBody = sourceCode.text.slice(
					arrowToken.range[1],
					node.value.range[1],
				);

				// First token should not be `async`
				const firstValueToken = sourceCode.getFirstToken(node.value, {
					skip: node.value.async ? 1 : 0,
				});

				const sliceStart = firstValueToken.range[0];
				const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1];
				const shouldAddParens =
					node.value.params.length === 1 &&
					node.value.params[0].range[0] === sliceStart;

				const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd);
				const newParamText = shouldAddParens
					? `(${oldParamText})`
					: oldParamText;

				return fixer.replaceTextRange(
					fixRange,
					methodPrefix + newParamText + fnBody,
				);
			}

			/**
			 * Fixes a FunctionExpression node by making it into a longform property.
			 * @param {SourceCodeFixer} fixer The fixer object
			 * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value
			 * @returns {Object} A fix for this node
			 */
			function makeFunctionLongform(fixer, node) {
				const firstKeyToken = node.computed
					? sourceCode.getTokens(node).find(token => token.value === "[")
					: sourceCode.getFirstToken(node.key);
				const lastKeyToken = node.computed
					? sourceCode
							.getTokensBetween(node.key, node.value)
							.find(token => token.value === "]")
					: sourceCode.getLastToken(node.key);
				const keyText = sourceCode.text.slice(
					firstKeyToken.range[0],
					lastKeyToken.range[1],
				);
				let functionHeader = "function";

				if (node.value.async) {
					functionHeader = `async ${functionHeader}`;
				}
				if (node.value.generator) {
					functionHeader = `${functionHeader}*`;
				}

				return fixer.replaceTextRange(
					[node.range[0], lastKeyToken.range[1]],
					`${keyText}: ${functionHeader}`,
				);
			}

			/*
			 * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`),
			 * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is
			 * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical
			 * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered,
			 * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited.
			 * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them
			 * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule,
			 * because converting it into a method would change the value of one of the lexical identifiers.
			 */
			const lexicalScopeStack = [];
			const arrowsWithLexicalIdentifiers = new WeakSet();
			const argumentsIdentifiers = new WeakSet();

			/**
			 * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack.
			 * Also, this marks all `arguments` identifiers so that they can be detected later.
			 * @param {ASTNode} node The node representing the function.
			 * @returns {void}
			 */
			function enterFunction(node) {
				lexicalScopeStack.unshift(new Set());
				sourceCode
					.getScope(node)
					.variables.filter(variable => variable.name === "arguments")
					.forEach(variable => {
						variable.references
							.map(ref => ref.identifier)
							.forEach(identifier =>
								argumentsIdentifiers.add(identifier),
							);
					});
			}

			/**
			 * Exits a function. This pops the current set of arrow functions off the lexical scope stack.
			 * @returns {void}
			 */
			function exitFunction() {
				lexicalScopeStack.shift();
			}

			/**
			 * Marks the current function as having a lexical keyword. This implies that all arrow functions
			 * in the current lexical scope contain a reference to this lexical keyword.
			 * @returns {void}
			 */
			function reportLexicalIdentifier() {
				lexicalScopeStack[0].forEach(arrowFunction =>
					arrowsWithLexicalIdentifiers.add(arrowFunction),
				);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: enterFunction,
				FunctionDeclaration: enterFunction,
				FunctionExpression: enterFunction,
				"Program:exit": exitFunction,
				"FunctionDeclaration:exit": exitFunction,
				"FunctionExpression:exit": exitFunction,

				ArrowFunctionExpression(node) {
					lexicalScopeStack[0].add(node);
				},
				"ArrowFunctionExpression:exit"(node) {
					lexicalScopeStack[0].delete(node);
				},

				ThisExpression: reportLexicalIdentifier,
				Super: reportLexicalIdentifier,
				MetaProperty(node) {
					if (
						node.meta.name === "new" &&
						node.property.name === "target"
					) {
						reportLexicalIdentifier();
					}
				},
				Identifier(node) {
					if (argumentsIdentifiers.has(node)) {
						reportLexicalIdentifier();
					}
				},

				ObjectExpression(node) {
					if (APPLY_CONSISTENT) {
						checkConsistency(node, false);
					} else if (APPLY_CONSISTENT_AS_NEEDED) {
						checkConsistency(node, true);
					}
				},

				"Property:exit"(node) {
					const isConciseProperty = node.method || node.shorthand;

					// Ignore destructuring assignment
					if (node.parent.type === "ObjectPattern") {
						return;
					}

					// getters and setters are ignored
					if (node.kind === "get" || node.kind === "set") {
						return;
					}

					// only computed methods can fail the following checks
					if (
						node.computed &&
						node.value.type !== "FunctionExpression" &&
						node.value.type !== "ArrowFunctionExpression"
					) {
						return;
					}

					//--------------------------------------------------------------
					// Checks for property/method shorthand.
					if (isConciseProperty) {
						if (
							node.method &&
							(APPLY_NEVER ||
								(AVOID_QUOTES && isStringLiteral(node.key)))
						) {
							const messageId = APPLY_NEVER
								? "expectedMethodLongform"
								: "expectedLiteralMethodLongform";

							// { x() {} } should be written as { x: function() {} }
							context.report({
								node,
								messageId,
								fix: fixer => makeFunctionLongform(fixer, node),
							});
						} else if (APPLY_NEVER) {
							// { x } should be written as { x: x }
							context.report({
								node,
								messageId: "expectedPropertyLongform",
								fix: fixer =>
									fixer.insertTextAfter(
										node.key,
										`: ${node.key.name}`,
									),
							});
						}
					} else if (
						APPLY_TO_METHODS &&
						!node.value.id &&
						(node.value.type === "FunctionExpression" ||
							node.value.type === "ArrowFunctionExpression")
					) {
						if (
							IGNORE_CONSTRUCTORS &&
							node.key.type === "Identifier" &&
							isConstructor(node.key.name)
						) {
							return;
						}

						if (METHODS_IGNORE_PATTERN) {
							const propertyName =
								astUtils.getStaticPropertyName(node);

							if (
								propertyName !== null &&
								METHODS_IGNORE_PATTERN.test(propertyName)
							) {
								return;
							}
						}

						if (AVOID_QUOTES && isStringLiteral(node.key)) {
							return;
						}

						// {[x]: function(){}} should be written as {[x]() {}}
						if (
							node.value.type === "FunctionExpression" ||
							(node.value.type === "ArrowFunctionExpression" &&
								node.value.body.type === "BlockStatement" &&
								AVOID_EXPLICIT_RETURN_ARROWS &&
								!arrowsWithLexicalIdentifiers.has(node.value))
						) {
							context.report({
								node,
								messageId: "expectedMethodShorthand",
								fix: fixer => makeFunctionShorthand(fixer, node),
							});
						}
					} else if (
						node.value.type === "Identifier" &&
						node.key.name === node.value.name &&
						APPLY_TO_PROPS
					) {
						// {x: x} should be written as {x}
						context.report({
							node,
							messageId: "expectedPropertyShorthand",
							fix(fixer) {
								// x: /* */ x
								// x: (/* */ x)
								if (sourceCode.getCommentsInside(node).length > 0) {
									return null;
								}

								return fixer.replaceText(node, node.value.name);
							},
						});
					} else if (
						node.value.type === "Identifier" &&
						node.key.type === "Literal" &&
						node.key.value === node.value.name &&
						APPLY_TO_PROPS
					) {
						if (AVOID_QUOTES) {
							return;
						}

						// {"x": x} should be written as {x}
						context.report({
							node,
							messageId: "expectedPropertyShorthand",
							fix(fixer) {
								// "x": /* */ x
								// "x": (/* */ x)
								if (sourceCode.getCommentsInside(node).length > 0) {
									return null;
								}

								return fixer.replaceText(node, node.value.name);
							},
						});
					}
				},
			};
		},
	};
	return objectShorthand;
}

/**
 * @fileoverview A rule to control the use of single variable declarations.
 * @author Ian Christian Myers
 */

var oneVar;
var hasRequiredOneVar;

function requireOneVar () {
	if (hasRequiredOneVar) return oneVar;
	hasRequiredOneVar = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the given node is in a statement list.
	 * @param {ASTNode} node node to check
	 * @returns {boolean} `true` if the given node is in a statement list
	 */
	function isInStatementList(node) {
		return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	oneVar = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce variables to be declared either together or separately in functions",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/one-var",
			},

			fixable: "code",

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never", "consecutive"],
						},
						{
							type: "object",
							properties: {
								separateRequires: {
									type: "boolean",
								},
								var: {
									enum: ["always", "never", "consecutive"],
								},
								let: {
									enum: ["always", "never", "consecutive"],
								},
								const: {
									enum: ["always", "never", "consecutive"],
								},
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								initialized: {
									enum: ["always", "never", "consecutive"],
								},
								uninitialized: {
									enum: ["always", "never", "consecutive"],
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				combineUninitialized:
					"Combine this with the previous '{{type}}' statement with uninitialized variables.",
				combineInitialized:
					"Combine this with the previous '{{type}}' statement with initialized variables.",
				splitUninitialized:
					"Split uninitialized '{{type}}' declarations into multiple statements.",
				splitInitialized:
					"Split initialized '{{type}}' declarations into multiple statements.",
				splitRequires:
					"Split requires to be separated into a single block.",
				combine: "Combine this with the previous '{{type}}' statement.",
				split: "Split '{{type}}' declarations into multiple statements.",
			},
		},

		create(context) {
			const MODE_ALWAYS = "always";
			const MODE_NEVER = "never";
			const MODE_CONSECUTIVE = "consecutive";
			const mode = context.options[0] || MODE_ALWAYS;

			const options = {};

			if (typeof mode === "string") {
				// simple options configuration with just a string
				options.var = { uninitialized: mode, initialized: mode };
				options.let = { uninitialized: mode, initialized: mode };
				options.const = { uninitialized: mode, initialized: mode };
			} else if (typeof mode === "object") {
				// options configuration is an object
				options.separateRequires = !!mode.separateRequires;
				options.var = { uninitialized: mode.var, initialized: mode.var };
				options.let = { uninitialized: mode.let, initialized: mode.let };
				options.const = {
					uninitialized: mode.const,
					initialized: mode.const,
				};
				if (Object.hasOwn(mode, "uninitialized")) {
					options.var.uninitialized = mode.uninitialized;
					options.let.uninitialized = mode.uninitialized;
					options.const.uninitialized = mode.uninitialized;
				}
				if (Object.hasOwn(mode, "initialized")) {
					options.var.initialized = mode.initialized;
					options.let.initialized = mode.initialized;
					options.const.initialized = mode.initialized;
				}
			}

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			const functionStack = [];
			const blockStack = [];

			/**
			 * Increments the blockStack counter.
			 * @returns {void}
			 * @private
			 */
			function startBlock() {
				blockStack.push({
					let: { initialized: false, uninitialized: false },
					const: { initialized: false, uninitialized: false },
				});
			}

			/**
			 * Increments the functionStack counter.
			 * @returns {void}
			 * @private
			 */
			function startFunction() {
				functionStack.push({ initialized: false, uninitialized: false });
				startBlock();
			}

			/**
			 * Decrements the blockStack counter.
			 * @returns {void}
			 * @private
			 */
			function endBlock() {
				blockStack.pop();
			}

			/**
			 * Decrements the functionStack counter.
			 * @returns {void}
			 * @private
			 */
			function endFunction() {
				functionStack.pop();
				endBlock();
			}

			/**
			 * Check if a variable declaration is a require.
			 * @param {ASTNode} decl variable declaration Node
			 * @returns {bool} if decl is a require, return true; else return false.
			 * @private
			 */
			function isRequire(decl) {
				return (
					decl.init &&
					decl.init.type === "CallExpression" &&
					decl.init.callee.name === "require"
				);
			}

			/**
			 * Records whether initialized/uninitialized/required variables are defined in current scope.
			 * @param {string} statementType node.kind, one of: "var", "let", or "const"
			 * @param {ASTNode[]} declarations List of declarations
			 * @param {Object} currentScope The scope being investigated
			 * @returns {void}
			 * @private
			 */
			function recordTypes(statementType, declarations, currentScope) {
				for (let i = 0; i < declarations.length; i++) {
					if (declarations[i].init === null) {
						if (
							options[statementType] &&
							options[statementType].uninitialized === MODE_ALWAYS
						) {
							currentScope.uninitialized = true;
						}
					} else {
						if (
							options[statementType] &&
							options[statementType].initialized === MODE_ALWAYS
						) {
							if (
								options.separateRequires &&
								isRequire(declarations[i])
							) {
								currentScope.required = true;
							} else {
								currentScope.initialized = true;
							}
						}
					}
				}
			}

			/**
			 * Determines the current scope (function or block)
			 * @param {string} statementType node.kind, one of: "var", "let", or "const"
			 * @returns {Object} The scope associated with statementType
			 */
			function getCurrentScope(statementType) {
				let currentScope;

				if (statementType === "var") {
					currentScope = functionStack.at(-1);
				} else if (statementType === "let") {
					currentScope = blockStack.at(-1).let;
				} else if (statementType === "const") {
					currentScope = blockStack.at(-1).const;
				}
				return currentScope;
			}

			/**
			 * Counts the number of initialized and uninitialized declarations in a list of declarations
			 * @param {ASTNode[]} declarations List of declarations
			 * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
			 * @private
			 */
			function countDeclarations(declarations) {
				const counts = { uninitialized: 0, initialized: 0 };

				for (let i = 0; i < declarations.length; i++) {
					if (declarations[i].init === null) {
						counts.uninitialized++;
					} else {
						counts.initialized++;
					}
				}
				return counts;
			}

			/**
			 * Determines if there is more than one var statement in the current scope.
			 * @param {string} statementType node.kind, one of: "var", "let", or "const"
			 * @param {ASTNode[]} declarations List of declarations
			 * @returns {boolean} Returns true if it is the first var declaration, false if not.
			 * @private
			 */
			function hasOnlyOneStatement(statementType, declarations) {
				const declarationCounts = countDeclarations(declarations);
				const currentOptions = options[statementType] || {};
				const currentScope = getCurrentScope(statementType);
				const hasRequires = declarations.some(isRequire);

				if (
					currentOptions.uninitialized === MODE_ALWAYS &&
					currentOptions.initialized === MODE_ALWAYS
				) {
					if (currentScope.uninitialized || currentScope.initialized) {
						if (!hasRequires) {
							return false;
						}
					}
				}

				if (declarationCounts.uninitialized > 0) {
					if (
						currentOptions.uninitialized === MODE_ALWAYS &&
						currentScope.uninitialized
					) {
						return false;
					}
				}
				if (declarationCounts.initialized > 0) {
					if (
						currentOptions.initialized === MODE_ALWAYS &&
						currentScope.initialized
					) {
						if (!hasRequires) {
							return false;
						}
					}
				}
				if (currentScope.required && hasRequires) {
					return false;
				}
				recordTypes(statementType, declarations, currentScope);
				return true;
			}

			/**
			 * Fixer to join VariableDeclaration's into a single declaration
			 * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join
			 * @returns {Function} The fixer function
			 */
			function joinDeclarations(declarations) {
				const declaration = declarations[0];
				const body = Array.isArray(declaration.parent.parent.body)
					? declaration.parent.parent.body
					: [];
				const currentIndex = body.findIndex(
					node => node.range[0] === declaration.parent.range[0],
				);
				const previousNode = body[currentIndex - 1];

				return fixer => {
					const type = sourceCode.getTokenBefore(declaration);
					const prevSemi = sourceCode.getTokenBefore(type);
					const res = [];

					if (
						previousNode &&
						previousNode.kind === sourceCode.getText(type)
					) {
						if (prevSemi.value === ";") {
							res.push(fixer.replaceText(prevSemi, ","));
						} else {
							res.push(fixer.insertTextAfter(prevSemi, ","));
						}
						res.push(fixer.replaceText(type, ""));
					}

					return res;
				};
			}

			/**
			 * Fixer to split a VariableDeclaration into individual declarations
			 * @param {VariableDeclaration} declaration The `VariableDeclaration` to split
			 * @returns {Function|null} The fixer function
			 */
			function splitDeclarations(declaration) {
				const { parent } = declaration;

				// don't autofix code such as: if (foo) var x, y;
				if (
					!isInStatementList(
						parent.type === "ExportNamedDeclaration"
							? parent
							: declaration,
					)
				) {
					return null;
				}

				return fixer =>
					declaration.declarations
						.map(declarator => {
							const tokenAfterDeclarator =
								sourceCode.getTokenAfter(declarator);

							if (tokenAfterDeclarator === null) {
								return null;
							}

							const afterComma = sourceCode.getTokenAfter(
								tokenAfterDeclarator,
								{ includeComments: true },
							);

							if (tokenAfterDeclarator.value !== ",") {
								return null;
							}

							const exportPlacement =
								declaration.parent.type === "ExportNamedDeclaration"
									? "export "
									: "";

							/*
							 * `var x,y`
							 * tokenAfterDeclarator ^^ afterComma
							 */
							if (
								afterComma.range[0] ===
								tokenAfterDeclarator.range[1]
							) {
								return fixer.replaceText(
									tokenAfterDeclarator,
									`; ${exportPlacement}${declaration.kind} `,
								);
							}

							/*
							 * `var x,
							 * tokenAfterDeclarator ^
							 *      y`
							 *      ^ afterComma
							 */
							if (
								afterComma.loc.start.line >
									tokenAfterDeclarator.loc.end.line ||
								afterComma.type === "Line" ||
								afterComma.type === "Block"
							) {
								let lastComment = afterComma;

								while (
									lastComment.type === "Line" ||
									lastComment.type === "Block"
								) {
									lastComment = sourceCode.getTokenAfter(
										lastComment,
										{ includeComments: true },
									);
								}

								return fixer.replaceTextRange(
									[
										tokenAfterDeclarator.range[0],
										lastComment.range[0],
									],
									`;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${exportPlacement}${declaration.kind} `,
								);
							}

							return fixer.replaceText(
								tokenAfterDeclarator,
								`; ${exportPlacement}${declaration.kind}`,
							);
						})
						.filter(x => x);
			}

			/**
			 * Checks a given VariableDeclaration node for errors.
			 * @param {ASTNode} node The VariableDeclaration node to check
			 * @returns {void}
			 * @private
			 */
			function checkVariableDeclaration(node) {
				const parent = node.parent;
				const type = node.kind;

				if (!options[type]) {
					return;
				}

				const declarations = node.declarations;
				const declarationCounts = countDeclarations(declarations);
				const mixedRequires =
					declarations.some(isRequire) && !declarations.every(isRequire);

				if (options[type].initialized === MODE_ALWAYS) {
					if (options.separateRequires && mixedRequires) {
						context.report({
							node,
							messageId: "splitRequires",
						});
					}
				}

				// consecutive
				const nodeIndex =
					(parent.body &&
						parent.body.length > 0 &&
						parent.body.indexOf(node)) ||
					0;

				if (nodeIndex > 0) {
					const previousNode = parent.body[nodeIndex - 1];
					const isPreviousNodeDeclaration =
						previousNode.type === "VariableDeclaration";
					const declarationsWithPrevious = declarations.concat(
						previousNode.declarations || [],
					);

					if (
						isPreviousNodeDeclaration &&
						previousNode.kind === type &&
						!(
							declarationsWithPrevious.some(isRequire) &&
							!declarationsWithPrevious.every(isRequire)
						)
					) {
						const previousDeclCounts = countDeclarations(
							previousNode.declarations,
						);

						if (
							options[type].initialized === MODE_CONSECUTIVE &&
							options[type].uninitialized === MODE_CONSECUTIVE
						) {
							context.report({
								node,
								messageId: "combine",
								data: {
									type,
								},
								fix: joinDeclarations(declarations),
							});
						} else if (
							options[type].initialized === MODE_CONSECUTIVE &&
							declarationCounts.initialized > 0 &&
							previousDeclCounts.initialized > 0
						) {
							context.report({
								node,
								messageId: "combineInitialized",
								data: {
									type,
								},
								fix: joinDeclarations(declarations),
							});
						} else if (
							options[type].uninitialized === MODE_CONSECUTIVE &&
							declarationCounts.uninitialized > 0 &&
							previousDeclCounts.uninitialized > 0
						) {
							context.report({
								node,
								messageId: "combineUninitialized",
								data: {
									type,
								},
								fix: joinDeclarations(declarations),
							});
						}
					}
				}

				// always
				if (!hasOnlyOneStatement(type, declarations)) {
					if (
						options[type].initialized === MODE_ALWAYS &&
						options[type].uninitialized === MODE_ALWAYS
					) {
						context.report({
							node,
							messageId: "combine",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					} else {
						if (
							options[type].initialized === MODE_ALWAYS &&
							declarationCounts.initialized > 0
						) {
							context.report({
								node,
								messageId: "combineInitialized",
								data: {
									type,
								},
								fix: joinDeclarations(declarations),
							});
						}
						if (
							options[type].uninitialized === MODE_ALWAYS &&
							declarationCounts.uninitialized > 0
						) {
							if (
								node.parent.left === node &&
								(node.parent.type === "ForInStatement" ||
									node.parent.type === "ForOfStatement")
							) {
								return;
							}
							context.report({
								node,
								messageId: "combineUninitialized",
								data: {
									type,
								},
								fix: joinDeclarations(declarations),
							});
						}
					}
				}

				// never
				if (parent.type !== "ForStatement" || parent.init !== node) {
					const totalDeclarations =
						declarationCounts.uninitialized +
						declarationCounts.initialized;

					if (totalDeclarations > 1) {
						if (
							options[type].initialized === MODE_NEVER &&
							options[type].uninitialized === MODE_NEVER
						) {
							// both initialized and uninitialized
							context.report({
								node,
								messageId: "split",
								data: {
									type,
								},
								fix: splitDeclarations(node),
							});
						} else if (
							options[type].initialized === MODE_NEVER &&
							declarationCounts.initialized > 0
						) {
							// initialized
							context.report({
								node,
								messageId: "splitInitialized",
								data: {
									type,
								},
								fix: splitDeclarations(node),
							});
						} else if (
							options[type].uninitialized === MODE_NEVER &&
							declarationCounts.uninitialized > 0
						) {
							// uninitialized
							context.report({
								node,
								messageId: "splitUninitialized",
								data: {
									type,
								},
								fix: splitDeclarations(node),
							});
						}
					}
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				Program: startFunction,
				FunctionDeclaration: startFunction,
				FunctionExpression: startFunction,
				ArrowFunctionExpression: startFunction,
				StaticBlock: startFunction, // StaticBlock creates a new scope for `var` variables

				BlockStatement: startBlock,
				ForStatement: startBlock,
				ForInStatement: startBlock,
				ForOfStatement: startBlock,
				SwitchStatement: startBlock,
				VariableDeclaration: checkVariableDeclaration,
				"ForStatement:exit": endBlock,
				"ForOfStatement:exit": endBlock,
				"ForInStatement:exit": endBlock,
				"SwitchStatement:exit": endBlock,
				"BlockStatement:exit": endBlock,

				"Program:exit": endFunction,
				"FunctionDeclaration:exit": endFunction,
				"FunctionExpression:exit": endFunction,
				"ArrowFunctionExpression:exit": endFunction,
				"StaticBlock:exit": endFunction,
			};
		},
	};
	return oneVar;
}

/**
 * @fileoverview Rule to check multiple var declarations per line
 * @author Alberto Rodríguez
 * @deprecated in ESLint v8.53.0
 */

var oneVarDeclarationPerLine;
var hasRequiredOneVarDeclarationPerLine;

function requireOneVarDeclarationPerLine () {
	if (hasRequiredOneVarDeclarationPerLine) return oneVarDeclarationPerLine;
	hasRequiredOneVarDeclarationPerLine = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	oneVarDeclarationPerLine = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "one-var-declaration-per-line",
							url: "https://eslint.style/rules/js/one-var-declaration-per-line",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description:
					"Require or disallow newlines around variable declarations",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line",
			},

			schema: [
				{
					enum: ["always", "initializations"],
				},
			],

			fixable: "whitespace",

			messages: {
				expectVarOnNewline:
					"Expected variable declaration to be on a new line.",
			},
		},

		create(context) {
			const always = context.options[0] === "always";

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Determine if provided keyword is a variant of for specifiers
			 * @private
			 * @param {string} keyword keyword to test
			 * @returns {boolean} True if `keyword` is a variant of for specifier
			 */
			function isForTypeSpecifier(keyword) {
				return (
					keyword === "ForStatement" ||
					keyword === "ForInStatement" ||
					keyword === "ForOfStatement"
				);
			}

			/**
			 * Checks newlines around variable declarations.
			 * @private
			 * @param {ASTNode} node `VariableDeclaration` node to test
			 * @returns {void}
			 */
			function checkForNewLine(node) {
				if (isForTypeSpecifier(node.parent.type)) {
					return;
				}

				const declarations = node.declarations;
				let prev;

				declarations.forEach(current => {
					if (prev && prev.loc.end.line === current.loc.start.line) {
						if (always || prev.init || current.init) {
							context.report({
								node,
								messageId: "expectVarOnNewline",
								loc: current.loc,
								fix: fixer => fixer.insertTextBefore(current, "\n"),
							});
						}
					}
					prev = current;
				});
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				VariableDeclaration: checkForNewLine,
			};
		},
	};
	return oneVarDeclarationPerLine;
}

/**
 * @fileoverview Rule to replace assignment expressions with operator assignment
 * @author Brandon Mills
 */

var operatorAssignment;
var hasRequiredOperatorAssignment;

function requireOperatorAssignment () {
	if (hasRequiredOperatorAssignment) return operatorAssignment;
	hasRequiredOperatorAssignment = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether an operator is commutative and has an operator assignment
	 * shorthand form.
	 * @param {string} operator Operator to check.
	 * @returns {boolean} True if the operator is commutative and has a
	 *     shorthand form.
	 */
	function isCommutativeOperatorWithShorthand(operator) {
		return ["*", "&", "^", "|"].includes(operator);
	}

	/**
	 * Checks whether an operator is not commutative and has an operator assignment
	 * shorthand form.
	 * @param {string} operator Operator to check.
	 * @returns {boolean} True if the operator is not commutative and has
	 *     a shorthand form.
	 */
	function isNonCommutativeOperatorWithShorthand(operator) {
		return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/**
	 * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and)
	 * toString calls regardless of whether assignment shorthand is used)
	 * @param {ASTNode} node The node on the left side of the expression
	 * @returns {boolean} `true` if the node can be fixed
	 */
	function canBeFixed(node) {
		return (
			node.type === "Identifier" ||
			(node.type === "MemberExpression" &&
				(node.object.type === "Identifier" ||
					node.object.type === "ThisExpression") &&
				(!node.computed || node.property.type === "Literal"))
		);
	}

	/** @type {import('../shared/types').Rule} */
	operatorAssignment = {
		meta: {
			type: "suggestion",

			defaultOptions: ["always"],

			docs: {
				description:
					"Require or disallow assignment operator shorthand where possible",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/operator-assignment",
			},

			schema: [
				{
					enum: ["always", "never"],
				},
			],

			fixable: "code",
			messages: {
				replaced:
					"Assignment (=) can be replaced with operator assignment ({{operator}}).",
				unexpected:
					"Unexpected operator assignment ({{operator}}) shorthand.",
			},
		},

		create(context) {
			const never = context.options[0] === "never";
			const sourceCode = context.sourceCode;

			/**
			 * Returns the operator token of an AssignmentExpression or BinaryExpression
			 * @param {ASTNode} node An AssignmentExpression or BinaryExpression node
			 * @returns {Token} The operator token in the node
			 */
			function getOperatorToken(node) {
				return sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);
			}

			/**
			 * Ensures that an assignment uses the shorthand form where possible.
			 * @param {ASTNode} node An AssignmentExpression node.
			 * @returns {void}
			 */
			function verify(node) {
				if (
					node.operator !== "=" ||
					node.right.type !== "BinaryExpression"
				) {
					return;
				}

				const left = node.left;
				const expr = node.right;
				const operator = expr.operator;

				if (
					isCommutativeOperatorWithShorthand(operator) ||
					isNonCommutativeOperatorWithShorthand(operator)
				) {
					const replacementOperator = `${operator}=`;

					if (astUtils.isSameReference(left, expr.left, true)) {
						context.report({
							node,
							messageId: "replaced",
							data: { operator: replacementOperator },
							fix(fixer) {
								if (canBeFixed(left) && canBeFixed(expr.left)) {
									const equalsToken = getOperatorToken(node);
									const operatorToken = getOperatorToken(expr);
									const leftText = sourceCode
										.getText()
										.slice(node.range[0], equalsToken.range[0]);
									const rightText = sourceCode
										.getText()
										.slice(
											operatorToken.range[1],
											node.right.range[1],
										);

									// Check for comments that would be removed.
									if (
										sourceCode.commentsExistBetween(
											equalsToken,
											operatorToken,
										)
									) {
										return null;
									}

									return fixer.replaceText(
										node,
										`${leftText}${replacementOperator}${rightText}`,
									);
								}
								return null;
							},
						});
					} else if (
						astUtils.isSameReference(left, expr.right, true) &&
						isCommutativeOperatorWithShorthand(operator)
					) {
						/*
						 * This case can't be fixed safely.
						 * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would
						 * change the execution order of the valueOf() functions.
						 */
						context.report({
							node,
							messageId: "replaced",
							data: { operator: replacementOperator },
						});
					}
				}
			}

			/**
			 * Warns if an assignment expression uses operator assignment shorthand.
			 * @param {ASTNode} node An AssignmentExpression node.
			 * @returns {void}
			 */
			function prohibit(node) {
				if (
					node.operator !== "=" &&
					!astUtils.isLogicalAssignmentOperator(node.operator)
				) {
					context.report({
						node,
						messageId: "unexpected",
						data: { operator: node.operator },
						fix(fixer) {
							if (canBeFixed(node.left)) {
								const firstToken = sourceCode.getFirstToken(node);
								const operatorToken = getOperatorToken(node);
								const leftText = sourceCode
									.getText()
									.slice(node.range[0], operatorToken.range[0]);
								const newOperator = node.operator.slice(0, -1);
								let rightText;

								// Check for comments that would be duplicated.
								if (
									sourceCode.commentsExistBetween(
										firstToken,
										operatorToken,
									)
								) {
									return null;
								}

								// If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side.
								if (
									astUtils.getPrecedence(node.right) <=
										astUtils.getPrecedence({
											type: "BinaryExpression",
											operator: newOperator,
										}) &&
									!astUtils.isParenthesised(
										sourceCode,
										node.right,
									)
								) {
									rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`;
								} else {
									const tokenAfterOperator =
										sourceCode.getTokenAfter(operatorToken, {
											includeComments: true,
										});
									let rightTextPrefix = "";

									if (
										operatorToken.range[1] ===
											tokenAfterOperator.range[0] &&
										!astUtils.canTokensBeAdjacent(
											{
												type: "Punctuator",
												value: newOperator,
											},
											tokenAfterOperator,
										)
									) {
										rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar
									}

									rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`;
								}

								return fixer.replaceText(
									node,
									`${leftText}= ${leftText}${newOperator}${rightText}`,
								);
							}
							return null;
						},
					});
				}
			}

			return {
				AssignmentExpression: !never ? verify : prohibit,
			};
		},
	};
	return operatorAssignment;
}

/**
 * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
 * @author Benoît Zugmeyer
 * @deprecated in ESLint v8.53.0
 */

var operatorLinebreak;
var hasRequiredOperatorLinebreak;

function requireOperatorLinebreak () {
	if (hasRequiredOperatorLinebreak) return operatorLinebreak;
	hasRequiredOperatorLinebreak = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	operatorLinebreak = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "operator-linebreak",
							url: "https://eslint.style/rules/js/operator-linebreak",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent linebreak style for operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/operator-linebreak",
			},

			schema: [
				{
					enum: ["after", "before", "none", null],
				},
				{
					type: "object",
					properties: {
						overrides: {
							type: "object",
							additionalProperties: {
								enum: ["after", "before", "none", "ignore"],
							},
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				operatorAtBeginning:
					"'{{operator}}' should be placed at the beginning of the line.",
				operatorAtEnd:
					"'{{operator}}' should be placed at the end of the line.",
				badLinebreak: "Bad line breaking before and after '{{operator}}'.",
				noLinebreak:
					"There should be no line break before or after '{{operator}}'.",
			},
		},

		create(context) {
			const usedDefaultGlobal = !context.options[0];
			const globalStyle = context.options[0] || "after";
			const options = context.options[1] || {};
			const styleOverrides = options.overrides
				? Object.assign({}, options.overrides)
				: {};

			if (usedDefaultGlobal && !styleOverrides["?"]) {
				styleOverrides["?"] = "before";
			}

			if (usedDefaultGlobal && !styleOverrides[":"]) {
				styleOverrides[":"] = "before";
			}

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Gets a fixer function to fix rule issues
			 * @param {Token} operatorToken The operator token of an expression
			 * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none'
			 * @returns {Function} A fixer function
			 */
			function getFixer(operatorToken, desiredStyle) {
				return fixer => {
					const tokenBefore = sourceCode.getTokenBefore(operatorToken);
					const tokenAfter = sourceCode.getTokenAfter(operatorToken);
					const textBefore = sourceCode.text.slice(
						tokenBefore.range[1],
						operatorToken.range[0],
					);
					const textAfter = sourceCode.text.slice(
						operatorToken.range[1],
						tokenAfter.range[0],
					);
					const hasLinebreakBefore = !astUtils.isTokenOnSameLine(
						tokenBefore,
						operatorToken,
					);
					const hasLinebreakAfter = !astUtils.isTokenOnSameLine(
						operatorToken,
						tokenAfter,
					);
					let newTextBefore, newTextAfter;

					if (
						hasLinebreakBefore !== hasLinebreakAfter &&
						desiredStyle !== "none"
					) {
						// If there is a comment before and after the operator, don't do a fix.
						if (
							sourceCode.getTokenBefore(operatorToken, {
								includeComments: true,
							}) !== tokenBefore &&
							sourceCode.getTokenAfter(operatorToken, {
								includeComments: true,
							}) !== tokenAfter
						) {
							return null;
						}

						/*
						 * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator.
						 * foo &&
						 *           bar
						 * would get fixed to
						 * foo
						 *        && bar
						 */
						newTextBefore = textAfter;
						newTextAfter = textBefore;
					} else {
						const LINEBREAK_REGEX =
							astUtils.createGlobalLinebreakMatcher();

						// Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings.
						newTextBefore =
							desiredStyle === "before" || textBefore.trim()
								? textBefore
								: textBefore.replace(LINEBREAK_REGEX, "");
						newTextAfter =
							desiredStyle === "after" || textAfter.trim()
								? textAfter
								: textAfter.replace(LINEBREAK_REGEX, "");

						// If there was no change (due to interfering comments), don't output a fix.
						if (
							newTextBefore === textBefore &&
							newTextAfter === textAfter
						) {
							return null;
						}
					}

					if (
						newTextAfter === "" &&
						tokenAfter.type === "Punctuator" &&
						"+-".includes(operatorToken.value) &&
						tokenAfter.value === operatorToken.value
					) {
						// To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-.
						newTextAfter += " ";
					}

					return fixer.replaceTextRange(
						[tokenBefore.range[1], tokenAfter.range[0]],
						newTextBefore + operatorToken.value + newTextAfter,
					);
				};
			}

			/**
			 * Checks the operator placement
			 * @param {ASTNode} node The node to check
			 * @param {ASTNode} rightSide The node that comes after the operator in `node`
			 * @param {string} operator The operator
			 * @private
			 * @returns {void}
			 */
			function validateNode(node, rightSide, operator) {
				/*
				 * Find the operator token by searching from the right side, because between the left side and the operator
				 * there could be additional tokens from type annotations. Search specifically for the token which
				 * value equals the operator, in order to skip possible opening parentheses before the right side node.
				 */
				const operatorToken = sourceCode.getTokenBefore(
					rightSide,
					token => token.value === operator,
				);
				const leftToken = sourceCode.getTokenBefore(operatorToken);
				const rightToken = sourceCode.getTokenAfter(operatorToken);
				const operatorStyleOverride = styleOverrides[operator];
				const style = operatorStyleOverride || globalStyle;
				const fix = getFixer(operatorToken, style);

				// if single line
				if (
					astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
					astUtils.isTokenOnSameLine(operatorToken, rightToken)
				) ; else if (
					operatorStyleOverride !== "ignore" &&
					!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
					!astUtils.isTokenOnSameLine(operatorToken, rightToken)
				) {
					// lone operator
					context.report({
						node,
						loc: operatorToken.loc,
						messageId: "badLinebreak",
						data: {
							operator,
						},
						fix,
					});
				} else if (
					style === "before" &&
					astUtils.isTokenOnSameLine(leftToken, operatorToken)
				) {
					context.report({
						node,
						loc: operatorToken.loc,
						messageId: "operatorAtBeginning",
						data: {
							operator,
						},
						fix,
					});
				} else if (
					style === "after" &&
					astUtils.isTokenOnSameLine(operatorToken, rightToken)
				) {
					context.report({
						node,
						loc: operatorToken.loc,
						messageId: "operatorAtEnd",
						data: {
							operator,
						},
						fix,
					});
				} else if (style === "none") {
					context.report({
						node,
						loc: operatorToken.loc,
						messageId: "noLinebreak",
						data: {
							operator,
						},
						fix,
					});
				}
			}

			/**
			 * Validates a binary expression using `validateNode`
			 * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
			 * @returns {void}
			 */
			function validateBinaryExpression(node) {
				validateNode(node, node.right, node.operator);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				BinaryExpression: validateBinaryExpression,
				LogicalExpression: validateBinaryExpression,
				AssignmentExpression: validateBinaryExpression,
				VariableDeclarator(node) {
					if (node.init) {
						validateNode(node, node.init, "=");
					}
				},
				PropertyDefinition(node) {
					if (node.value) {
						validateNode(node, node.value, "=");
					}
				},
				ConditionalExpression(node) {
					validateNode(node, node.consequent, "?");
					validateNode(node, node.alternate, ":");
				},
			};
		},
	};
	return operatorLinebreak;
}

/**
 * @fileoverview A rule to ensure blank lines within blocks.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

var paddedBlocks;
var hasRequiredPaddedBlocks;

function requirePaddedBlocks () {
	if (hasRequiredPaddedBlocks) return paddedBlocks;
	hasRequiredPaddedBlocks = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	paddedBlocks = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "padded-blocks",
							url: "https://eslint.style/rules/js/padded-blocks",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require or disallow padding within blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/padded-blocks",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never"],
						},
						{
							type: "object",
							properties: {
								blocks: {
									enum: ["always", "never"],
								},
								switches: {
									enum: ["always", "never"],
								},
								classes: {
									enum: ["always", "never"],
								},
							},
							additionalProperties: false,
							minProperties: 1,
						},
					],
				},
				{
					type: "object",
					properties: {
						allowSingleLineBlocks: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				alwaysPadBlock: "Block must be padded by blank lines.",
				neverPadBlock: "Block must not be padded by blank lines.",
			},
		},

		create(context) {
			const options = {};
			const typeOptions = context.options[0] || "always";
			const exceptOptions = context.options[1] || {};

			if (typeof typeOptions === "string") {
				const shouldHavePadding = typeOptions === "always";

				options.blocks = shouldHavePadding;
				options.switches = shouldHavePadding;
				options.classes = shouldHavePadding;
			} else {
				if (Object.hasOwn(typeOptions, "blocks")) {
					options.blocks = typeOptions.blocks === "always";
				}
				if (Object.hasOwn(typeOptions, "switches")) {
					options.switches = typeOptions.switches === "always";
				}
				if (Object.hasOwn(typeOptions, "classes")) {
					options.classes = typeOptions.classes === "always";
				}
			}

			if (Object.hasOwn(exceptOptions, "allowSingleLineBlocks")) {
				options.allowSingleLineBlocks =
					exceptOptions.allowSingleLineBlocks === true;
			}

			const sourceCode = context.sourceCode;

			/**
			 * Gets the open brace token from a given node.
			 * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace.
			 * @returns {Token} The token of the open brace.
			 */
			function getOpenBrace(node) {
				if (node.type === "SwitchStatement") {
					return sourceCode.getTokenBefore(node.cases[0]);
				}

				if (node.type === "StaticBlock") {
					return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token
				}

				// `BlockStatement` or `ClassBody`
				return sourceCode.getFirstToken(node);
			}

			/**
			 * Checks if the given parameter is a comment node
			 * @param {ASTNode|Token} node An AST node or token
			 * @returns {boolean} True if node is a comment
			 */
			function isComment(node) {
				return node.type === "Line" || node.type === "Block";
			}

			/**
			 * Checks if there is padding between two tokens
			 * @param {Token} first The first token
			 * @param {Token} second The second token
			 * @returns {boolean} True if there is at least a line between the tokens
			 */
			function isPaddingBetweenTokens(first, second) {
				return second.loc.start.line - first.loc.end.line >= 2;
			}

			/**
			 * Checks if the given token has a blank line after it.
			 * @param {Token} token The token to check.
			 * @returns {boolean} Whether or not the token is followed by a blank line.
			 */
			function getFirstBlockToken(token) {
				let prev,
					first = token;

				do {
					prev = first;
					first = sourceCode.getTokenAfter(first, {
						includeComments: true,
					});
				} while (
					isComment(first) &&
					first.loc.start.line === prev.loc.end.line
				);

				return first;
			}

			/**
			 * Checks if the given token is preceded by a blank line.
			 * @param {Token} token The token to check
			 * @returns {boolean} Whether or not the token is preceded by a blank line
			 */
			function getLastBlockToken(token) {
				let last = token,
					next;

				do {
					next = last;
					last = sourceCode.getTokenBefore(last, {
						includeComments: true,
					});
				} while (
					isComment(last) &&
					last.loc.end.line === next.loc.start.line
				);

				return last;
			}

			/**
			 * Checks if a node should be padded, according to the rule config.
			 * @param {ASTNode} node The AST node to check.
			 * @throws {Error} (Unreachable)
			 * @returns {boolean} True if the node should be padded, false otherwise.
			 */
			function requirePaddingFor(node) {
				switch (node.type) {
					case "BlockStatement":
					case "StaticBlock":
						return options.blocks;
					case "SwitchStatement":
						return options.switches;
					case "ClassBody":
						return options.classes;

					/* c8 ignore next */
					default:
						throw new Error("unreachable");
				}
			}

			/**
			 * Checks the given BlockStatement node to be padded if the block is not empty.
			 * @param {ASTNode} node The AST node of a BlockStatement.
			 * @returns {void} undefined.
			 */
			function checkPadding(node) {
				const openBrace = getOpenBrace(node),
					firstBlockToken = getFirstBlockToken(openBrace),
					tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, {
						includeComments: true,
					}),
					closeBrace = sourceCode.getLastToken(node),
					lastBlockToken = getLastBlockToken(closeBrace),
					tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, {
						includeComments: true,
					}),
					blockHasTopPadding = isPaddingBetweenTokens(
						tokenBeforeFirst,
						firstBlockToken,
					),
					blockHasBottomPadding = isPaddingBetweenTokens(
						lastBlockToken,
						tokenAfterLast,
					);

				if (
					options.allowSingleLineBlocks &&
					astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)
				) {
					return;
				}

				if (requirePaddingFor(node)) {
					if (!blockHasTopPadding) {
						context.report({
							node,
							loc: {
								start: tokenBeforeFirst.loc.start,
								end: firstBlockToken.loc.start,
							},
							fix(fixer) {
								return fixer.insertTextAfter(
									tokenBeforeFirst,
									"\n",
								);
							},
							messageId: "alwaysPadBlock",
						});
					}
					if (!blockHasBottomPadding) {
						context.report({
							node,
							loc: {
								end: tokenAfterLast.loc.start,
								start: lastBlockToken.loc.end,
							},
							fix(fixer) {
								return fixer.insertTextBefore(tokenAfterLast, "\n");
							},
							messageId: "alwaysPadBlock",
						});
					}
				} else {
					if (blockHasTopPadding) {
						context.report({
							node,
							loc: {
								start: tokenBeforeFirst.loc.start,
								end: firstBlockToken.loc.start,
							},
							fix(fixer) {
								return fixer.replaceTextRange(
									[
										tokenBeforeFirst.range[1],
										firstBlockToken.range[0] -
											firstBlockToken.loc.start.column,
									],
									"\n",
								);
							},
							messageId: "neverPadBlock",
						});
					}

					if (blockHasBottomPadding) {
						context.report({
							node,
							loc: {
								end: tokenAfterLast.loc.start,
								start: lastBlockToken.loc.end,
							},
							messageId: "neverPadBlock",
							fix(fixer) {
								return fixer.replaceTextRange(
									[
										lastBlockToken.range[1],
										tokenAfterLast.range[0] -
											tokenAfterLast.loc.start.column,
									],
									"\n",
								);
							},
						});
					}
				}
			}

			const rule = {};

			if (Object.hasOwn(options, "switches")) {
				rule.SwitchStatement = function (node) {
					if (node.cases.length === 0) {
						return;
					}
					checkPadding(node);
				};
			}

			if (Object.hasOwn(options, "blocks")) {
				rule.BlockStatement = function (node) {
					if (node.body.length === 0) {
						return;
					}
					checkPadding(node);
				};
				rule.StaticBlock = rule.BlockStatement;
			}

			if (Object.hasOwn(options, "classes")) {
				rule.ClassBody = function (node) {
					if (node.body.length === 0) {
						return;
					}
					checkPadding(node);
				};
			}

			return rule;
		},
	};
	return paddedBlocks;
}

/**
 * @fileoverview Rule to require or disallow newlines between statements
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var paddingLineBetweenStatements;
var hasRequiredPaddingLineBetweenStatements;

function requirePaddingLineBetweenStatements () {
	if (hasRequiredPaddingLineBetweenStatements) return paddingLineBetweenStatements;
	hasRequiredPaddingLineBetweenStatements = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`;
	const PADDING_LINE_SEQUENCE = new RegExp(
		String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`,
		"u",
	);
	const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u;
	const CJS_IMPORT = /^require\(/u;

	/**
	 * Creates tester which check if a node starts with specific keyword.
	 * @param {string} keyword The keyword to test.
	 * @returns {Object} the created tester.
	 * @private
	 */
	function newKeywordTester(keyword) {
		return {
			test: (node, sourceCode) =>
				sourceCode.getFirstToken(node).value === keyword,
		};
	}

	/**
	 * Creates tester which check if a node starts with specific keyword and spans a single line.
	 * @param {string} keyword The keyword to test.
	 * @returns {Object} the created tester.
	 * @private
	 */
	function newSinglelineKeywordTester(keyword) {
		return {
			test: (node, sourceCode) =>
				node.loc.start.line === node.loc.end.line &&
				sourceCode.getFirstToken(node).value === keyword,
		};
	}

	/**
	 * Creates tester which check if a node starts with specific keyword and spans multiple lines.
	 * @param {string} keyword The keyword to test.
	 * @returns {Object} the created tester.
	 * @private
	 */
	function newMultilineKeywordTester(keyword) {
		return {
			test: (node, sourceCode) =>
				node.loc.start.line !== node.loc.end.line &&
				sourceCode.getFirstToken(node).value === keyword,
		};
	}

	/**
	 * Creates tester which check if a node is specific type.
	 * @param {string} type The node type to test.
	 * @returns {Object} the created tester.
	 * @private
	 */
	function newNodeTypeTester(type) {
		return {
			test: node => node.type === type,
		};
	}

	/**
	 * Checks the given node is an expression statement of IIFE.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is an expression statement of IIFE.
	 * @private
	 */
	function isIIFEStatement(node) {
		if (node.type === "ExpressionStatement") {
			let call = astUtils.skipChainExpression(node.expression);

			if (call.type === "UnaryExpression") {
				call = astUtils.skipChainExpression(call.argument);
			}
			return (
				call.type === "CallExpression" && astUtils.isFunction(call.callee)
			);
		}
		return false;
	}

	/**
	 * Checks whether the given node is a block-like statement.
	 * This checks the last token of the node is the closing brace of a block.
	 * @param {SourceCode} sourceCode The source code to get tokens.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is a block-like statement.
	 * @private
	 */
	function isBlockLikeStatement(sourceCode, node) {
		// do-while with a block is a block-like statement.
		if (
			node.type === "DoWhileStatement" &&
			node.body.type === "BlockStatement"
		) {
			return true;
		}

		/*
		 * IIFE is a block-like statement specially from
		 * JSCS#disallowPaddingNewLinesAfterBlocks.
		 */
		if (isIIFEStatement(node)) {
			return true;
		}

		// Checks the last token is a closing brace of blocks.
		const lastToken = sourceCode.getLastToken(
			node,
			astUtils.isNotSemicolonToken,
		);
		const belongingNode =
			lastToken && astUtils.isClosingBraceToken(lastToken)
				? sourceCode.getNodeByRangeIndex(lastToken.range[0])
				: null;

		return (
			Boolean(belongingNode) &&
			(belongingNode.type === "BlockStatement" ||
				belongingNode.type === "SwitchStatement")
		);
	}

	/**
	 * Gets the actual last token.
	 *
	 * If a semicolon is semicolon-less style's semicolon, this ignores it.
	 * For example:
	 *
	 *     foo()
	 *     ;[1, 2, 3].forEach(bar)
	 * @param {SourceCode} sourceCode The source code to get tokens.
	 * @param {ASTNode} node The node to get.
	 * @returns {Token} The actual last token.
	 * @private
	 */
	function getActualLastToken(sourceCode, node) {
		const semiToken = sourceCode.getLastToken(node);
		const prevToken = sourceCode.getTokenBefore(semiToken);
		const nextToken = sourceCode.getTokenAfter(semiToken);
		const isSemicolonLessStyle = Boolean(
			prevToken &&
				nextToken &&
				prevToken.range[0] >= node.range[0] &&
				astUtils.isSemicolonToken(semiToken) &&
				semiToken.loc.start.line !== prevToken.loc.end.line &&
				semiToken.loc.end.line === nextToken.loc.start.line,
		);

		return isSemicolonLessStyle ? prevToken : semiToken;
	}

	/**
	 * This returns the concatenation of the first 2 captured strings.
	 * @param {string} _ Unused. Whole matched string.
	 * @param {string} trailingSpaces The trailing spaces of the first line.
	 * @param {string} indentSpaces The indentation spaces of the last line.
	 * @returns {string} The concatenation of trailingSpaces and indentSpaces.
	 * @private
	 */
	function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) {
		return trailingSpaces + indentSpaces;
	}

	/**
	 * Check and report statements for `any` configuration.
	 * It does nothing.
	 * @returns {void}
	 * @private
	 */
	function verifyForAny() {}

	/**
	 * Check and report statements for `never` configuration.
	 * This autofix removes blank lines between the given 2 statements.
	 * However, if comments exist between 2 blank lines, it does not remove those
	 * blank lines automatically.
	 * @param {RuleContext} context The rule context to report.
	 * @param {ASTNode} _ Unused. The previous node to check.
	 * @param {ASTNode} nextNode The next node to check.
	 * @param {Array<Token[]>} paddingLines The array of token pairs that blank
	 * lines exist between the pair.
	 * @returns {void}
	 * @private
	 */
	function verifyForNever(context, _, nextNode, paddingLines) {
		if (paddingLines.length === 0) {
			return;
		}

		context.report({
			node: nextNode,
			messageId: "unexpectedBlankLine",
			fix(fixer) {
				if (paddingLines.length >= 2) {
					return null;
				}

				const prevToken = paddingLines[0][0];
				const nextToken = paddingLines[0][1];
				const start = prevToken.range[1];
				const end = nextToken.range[0];
				const text = context.sourceCode.text
					.slice(start, end)
					.replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines);

				return fixer.replaceTextRange([start, end], text);
			},
		});
	}

	/**
	 * Check and report statements for `always` configuration.
	 * This autofix inserts a blank line between the given 2 statements.
	 * If the `prevNode` has trailing comments, it inserts a blank line after the
	 * trailing comments.
	 * @param {RuleContext} context The rule context to report.
	 * @param {ASTNode} prevNode The previous node to check.
	 * @param {ASTNode} nextNode The next node to check.
	 * @param {Array<Token[]>} paddingLines The array of token pairs that blank
	 * lines exist between the pair.
	 * @returns {void}
	 * @private
	 */
	function verifyForAlways(context, prevNode, nextNode, paddingLines) {
		if (paddingLines.length > 0) {
			return;
		}

		context.report({
			node: nextNode,
			messageId: "expectedBlankLine",
			fix(fixer) {
				const sourceCode = context.sourceCode;
				let prevToken = getActualLastToken(sourceCode, prevNode);
				const nextToken =
					sourceCode.getFirstTokenBetween(prevToken, nextNode, {
						includeComments: true,

						/**
						 * Skip the trailing comments of the previous node.
						 * This inserts a blank line after the last trailing comment.
						 *
						 * For example:
						 *
						 *     foo(); // trailing comment.
						 *     // comment.
						 *     bar();
						 *
						 * Get fixed to:
						 *
						 *     foo(); // trailing comment.
						 *
						 *     // comment.
						 *     bar();
						 * @param {Token} token The token to check.
						 * @returns {boolean} `true` if the token is not a trailing comment.
						 * @private
						 */
						filter(token) {
							if (astUtils.isTokenOnSameLine(prevToken, token)) {
								prevToken = token;
								return false;
							}
							return true;
						},
					}) || nextNode;
				const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken)
					? "\n\n"
					: "\n";

				return fixer.insertTextAfter(prevToken, insertText);
			},
		});
	}

	/**
	 * Types of blank lines.
	 * `any`, `never`, and `always` are defined.
	 * Those have `verify` method to check and report statements.
	 * @private
	 */
	const PaddingTypes = {
		any: { verify: verifyForAny },
		never: { verify: verifyForNever },
		always: { verify: verifyForAlways },
	};

	/**
	 * Types of statements.
	 * Those have `test` method to check it matches to the given statement.
	 * @private
	 */
	const StatementTypes = {
		"*": { test: () => true },
		"block-like": {
			test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node),
		},
		"cjs-export": {
			test: (node, sourceCode) =>
				node.type === "ExpressionStatement" &&
				node.expression.type === "AssignmentExpression" &&
				CJS_EXPORT.test(sourceCode.getText(node.expression.left)),
		},
		"cjs-import": {
			test: (node, sourceCode) =>
				node.type === "VariableDeclaration" &&
				node.declarations.length > 0 &&
				Boolean(node.declarations[0].init) &&
				CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)),
		},
		directive: {
			test: astUtils.isDirective,
		},
		expression: {
			test: node =>
				node.type === "ExpressionStatement" && !astUtils.isDirective(node),
		},
		iife: {
			test: isIIFEStatement,
		},
		"multiline-block-like": {
			test: (node, sourceCode) =>
				node.loc.start.line !== node.loc.end.line &&
				isBlockLikeStatement(sourceCode, node),
		},
		"multiline-expression": {
			test: node =>
				node.loc.start.line !== node.loc.end.line &&
				node.type === "ExpressionStatement" &&
				!astUtils.isDirective(node),
		},

		"multiline-const": newMultilineKeywordTester("const"),
		"multiline-let": newMultilineKeywordTester("let"),
		"multiline-var": newMultilineKeywordTester("var"),
		"singleline-const": newSinglelineKeywordTester("const"),
		"singleline-let": newSinglelineKeywordTester("let"),
		"singleline-var": newSinglelineKeywordTester("var"),

		block: newNodeTypeTester("BlockStatement"),
		empty: newNodeTypeTester("EmptyStatement"),
		function: newNodeTypeTester("FunctionDeclaration"),

		break: newKeywordTester("break"),
		case: newKeywordTester("case"),
		class: newKeywordTester("class"),
		const: newKeywordTester("const"),
		continue: newKeywordTester("continue"),
		debugger: newKeywordTester("debugger"),
		default: newKeywordTester("default"),
		do: newKeywordTester("do"),
		export: newKeywordTester("export"),
		for: newKeywordTester("for"),
		if: newKeywordTester("if"),
		import: newKeywordTester("import"),
		let: newKeywordTester("let"),
		return: newKeywordTester("return"),
		switch: newKeywordTester("switch"),
		throw: newKeywordTester("throw"),
		try: newKeywordTester("try"),
		var: newKeywordTester("var"),
		while: newKeywordTester("while"),
		with: newKeywordTester("with"),
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	paddingLineBetweenStatements = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "padding-line-between-statements",
							url: "https://eslint.style/rules/js/padding-line-between-statements",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require or disallow padding lines between statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/padding-line-between-statements",
			},

			fixable: "whitespace",

			schema: {
				definitions: {
					paddingType: {
						enum: Object.keys(PaddingTypes),
					},
					statementType: {
						anyOf: [
							{ enum: Object.keys(StatementTypes) },
							{
								type: "array",
								items: { enum: Object.keys(StatementTypes) },
								minItems: 1,
								uniqueItems: true,
							},
						],
					},
				},
				type: "array",
				items: {
					type: "object",
					properties: {
						blankLine: { $ref: "#/definitions/paddingType" },
						prev: { $ref: "#/definitions/statementType" },
						next: { $ref: "#/definitions/statementType" },
					},
					additionalProperties: false,
					required: ["blankLine", "prev", "next"],
				},
			},

			messages: {
				unexpectedBlankLine: "Unexpected blank line before this statement.",
				expectedBlankLine: "Expected blank line before this statement.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const configureList = context.options || [];
			let scopeInfo = null;

			/**
			 * Processes to enter to new scope.
			 * This manages the current previous statement.
			 * @returns {void}
			 * @private
			 */
			function enterScope() {
				scopeInfo = {
					upper: scopeInfo,
					prevNode: null,
				};
			}

			/**
			 * Processes to exit from the current scope.
			 * @returns {void}
			 * @private
			 */
			function exitScope() {
				scopeInfo = scopeInfo.upper;
			}

			/**
			 * Checks whether the given node matches the given type.
			 * @param {ASTNode} node The statement node to check.
			 * @param {string|string[]} type The statement type to check.
			 * @returns {boolean} `true` if the statement node matched the type.
			 * @private
			 */
			function match(node, type) {
				let innerStatementNode = node;

				while (innerStatementNode.type === "LabeledStatement") {
					innerStatementNode = innerStatementNode.body;
				}
				if (Array.isArray(type)) {
					return type.some(match.bind(null, innerStatementNode));
				}
				return StatementTypes[type].test(innerStatementNode, sourceCode);
			}

			/**
			 * Finds the last matched configure from configureList.
			 * @param {ASTNode} prevNode The previous statement to match.
			 * @param {ASTNode} nextNode The current statement to match.
			 * @returns {Object} The tester of the last matched configure.
			 * @private
			 */
			function getPaddingType(prevNode, nextNode) {
				for (let i = configureList.length - 1; i >= 0; --i) {
					const configure = configureList[i];
					const matched =
						match(prevNode, configure.prev) &&
						match(nextNode, configure.next);

					if (matched) {
						return PaddingTypes[configure.blankLine];
					}
				}
				return PaddingTypes.any;
			}

			/**
			 * Gets padding line sequences between the given 2 statements.
			 * Comments are separators of the padding line sequences.
			 * @param {ASTNode} prevNode The previous statement to count.
			 * @param {ASTNode} nextNode The current statement to count.
			 * @returns {Array<Token[]>} The array of token pairs.
			 * @private
			 */
			function getPaddingLineSequences(prevNode, nextNode) {
				const pairs = [];
				let prevToken = getActualLastToken(sourceCode, prevNode);

				if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) {
					do {
						const token = sourceCode.getTokenAfter(prevToken, {
							includeComments: true,
						});

						if (token.loc.start.line - prevToken.loc.end.line >= 2) {
							pairs.push([prevToken, token]);
						}
						prevToken = token;
					} while (prevToken.range[0] < nextNode.range[0]);
				}

				return pairs;
			}

			/**
			 * Verify padding lines between the given node and the previous node.
			 * @param {ASTNode} node The node to verify.
			 * @returns {void}
			 * @private
			 */
			function verify(node) {
				const parentType = node.parent.type;
				const validParent =
					astUtils.STATEMENT_LIST_PARENTS.has(parentType) ||
					parentType === "SwitchStatement";

				if (!validParent) {
					return;
				}

				// Save this node as the current previous statement.
				const prevNode = scopeInfo.prevNode;

				// Verify.
				if (prevNode) {
					const type = getPaddingType(prevNode, node);
					const paddingLines = getPaddingLineSequences(prevNode, node);

					type.verify(context, prevNode, node, paddingLines);
				}

				scopeInfo.prevNode = node;
			}

			/**
			 * Verify padding lines between the given node and the previous node.
			 * Then process to enter to new scope.
			 * @param {ASTNode} node The node to verify.
			 * @returns {void}
			 * @private
			 */
			function verifyThenEnterScope(node) {
				verify(node);
				enterScope();
			}

			return {
				Program: enterScope,
				BlockStatement: enterScope,
				SwitchStatement: enterScope,
				StaticBlock: enterScope,
				"Program:exit": exitScope,
				"BlockStatement:exit": exitScope,
				"SwitchStatement:exit": exitScope,
				"StaticBlock:exit": exitScope,

				":statement": verify,

				SwitchCase: verifyThenEnterScope,
				"SwitchCase:exit": exitScope,
			};
		},
	};
	return paddingLineBetweenStatements;
}

/**
 * @fileoverview A rule to suggest using arrow functions as callbacks.
 * @author Toru Nagashima
 */

var preferArrowCallback;
var hasRequiredPreferArrowCallback;

function requirePreferArrowCallback () {
	if (hasRequiredPreferArrowCallback) return preferArrowCallback;
	hasRequiredPreferArrowCallback = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given variable is a function name.
	 * @param {eslint-scope.Variable} variable A variable to check.
	 * @returns {boolean} `true` if the variable is a function name.
	 */
	function isFunctionName(variable) {
		return variable && variable.defs[0].type === "FunctionName";
	}

	/**
	 * Checks whether or not a given MetaProperty node equals to a given value.
	 * @param {ASTNode} node A MetaProperty node to check.
	 * @param {string} metaName The name of `MetaProperty.meta`.
	 * @param {string} propertyName The name of `MetaProperty.property`.
	 * @returns {boolean} `true` if the node is the specific value.
	 */
	function checkMetaProperty(node, metaName, propertyName) {
		return node.meta.name === metaName && node.property.name === propertyName;
	}

	/**
	 * Gets the variable object of `arguments` which is defined implicitly.
	 * @param {eslint-scope.Scope} scope A scope to get.
	 * @returns {eslint-scope.Variable} The found variable object.
	 */
	function getVariableOfArguments(scope) {
		const variables = scope.variables;

		for (let i = 0; i < variables.length; ++i) {
			const variable = variables[i];

			if (variable.name === "arguments") {
				/*
				 * If there was a parameter which is named "arguments", the
				 * implicit "arguments" is not defined.
				 * So does fast return with null.
				 */
				return variable.identifiers.length === 0 ? variable : null;
			}
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Checks whether or not a given node is a callback.
	 * @param {ASTNode} node A node to check.
	 * @throws {Error} (Unreachable.)
	 * @returns {Object}
	 *   {boolean} retv.isCallback - `true` if the node is a callback.
	 *   {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`.
	 */
	function getCallbackInfo(node) {
		const retv = { isCallback: false, isLexicalThis: false };
		let currentNode = node;
		let parent = node.parent;
		let bound = false;

		while (currentNode) {
			switch (parent.type) {
				// Checks parents recursively.

				case "LogicalExpression":
				case "ChainExpression":
				case "ConditionalExpression":
					break;

				// Checks whether the parent node is `.bind(this)` call.
				case "MemberExpression":
					if (
						parent.object === currentNode &&
						!parent.property.computed &&
						parent.property.type === "Identifier" &&
						parent.property.name === "bind"
					) {
						const maybeCallee =
							parent.parent.type === "ChainExpression"
								? parent.parent
								: parent;

						if (astUtils.isCallee(maybeCallee)) {
							if (!bound) {
								bound = true; // Use only the first `.bind()` to make `isLexicalThis` value.
								retv.isLexicalThis =
									maybeCallee.parent.arguments.length === 1 &&
									maybeCallee.parent.arguments[0].type ===
										"ThisExpression";
							}
							parent = maybeCallee.parent;
						} else {
							return retv;
						}
					} else {
						return retv;
					}
					break;

				// Checks whether the node is a callback.
				case "CallExpression":
				case "NewExpression":
					if (parent.callee !== currentNode) {
						retv.isCallback = true;
					}
					return retv;

				default:
					return retv;
			}

			currentNode = parent;
			parent = parent.parent;
		}

		/* c8 ignore next */
		throw new Error("unreachable");
	}

	/**
	 * Checks whether a simple list of parameters contains any duplicates. This does not handle complex
	 * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate
	 * parameter names anyway. Instead, it always returns `false` for complex parameter lists.
	 * @param {ASTNode[]} paramsList The list of parameters for a function
	 * @returns {boolean} `true` if the list of parameters contains any duplicates
	 */
	function hasDuplicateParams(paramsList) {
		return (
			paramsList.every(param => param.type === "Identifier") &&
			paramsList.length !== new Set(paramsList.map(param => param.name)).size
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferArrowCallback = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{ allowNamedFunctions: false, allowUnboundThis: true },
			],

			docs: {
				description: "Require using arrow functions for callbacks",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback",
			},

			schema: [
				{
					type: "object",
					properties: {
						allowNamedFunctions: {
							type: "boolean",
						},
						allowUnboundThis: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				preferArrowCallback: "Unexpected function expression.",
			},
		},

		create(context) {
			const [{ allowNamedFunctions, allowUnboundThis }] = context.options;
			const sourceCode = context.sourceCode;

			/*
			 * {Array<{this: boolean, super: boolean, meta: boolean}>}
			 * - this - A flag which shows there are one or more ThisExpression.
			 * - super - A flag which shows there are one or more Super.
			 * - meta - A flag which shows there are one or more MethProperty.
			 */
			let stack = [];

			/**
			 * Pushes new function scope with all `false` flags.
			 * @returns {void}
			 */
			function enterScope() {
				stack.push({ this: false, super: false, meta: false });
			}

			/**
			 * Pops a function scope from the stack.
			 * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope.
			 */
			function exitScope() {
				return stack.pop();
			}

			return {
				// Reset internal state.
				Program() {
					stack = [];
				},

				// If there are below, it cannot replace with arrow functions merely.
				ThisExpression() {
					const info = stack.at(-1);

					if (info) {
						info.this = true;
					}
				},

				Super() {
					const info = stack.at(-1);

					if (info) {
						info.super = true;
					}
				},

				MetaProperty(node) {
					const info = stack.at(-1);

					if (info && checkMetaProperty(node, "new", "target")) {
						info.meta = true;
					}
				},

				// To skip nested scopes.
				FunctionDeclaration: enterScope,
				"FunctionDeclaration:exit": exitScope,

				// Main.
				FunctionExpression: enterScope,
				"FunctionExpression:exit"(node) {
					const scopeInfo = exitScope();

					// Skip named function expressions
					if (allowNamedFunctions && node.id && node.id.name) {
						return;
					}

					// Skip generators.
					if (node.generator) {
						return;
					}

					// Skip recursive functions.
					const nameVar = sourceCode.getDeclaredVariables(node)[0];

					if (isFunctionName(nameVar) && nameVar.references.length > 0) {
						return;
					}

					// Skip if it's using arguments.
					const variable = getVariableOfArguments(
						sourceCode.getScope(node),
					);

					if (variable && variable.references.length > 0) {
						return;
					}

					// Reports if it's a callback which can replace with arrows.
					const callbackInfo = getCallbackInfo(node);

					if (
						callbackInfo.isCallback &&
						(!allowUnboundThis ||
							!scopeInfo.this ||
							callbackInfo.isLexicalThis) &&
						!scopeInfo.super &&
						!scopeInfo.meta
					) {
						context.report({
							node,
							messageId: "preferArrowCallback",
							*fix(fixer) {
								if (
									(!callbackInfo.isLexicalThis &&
										scopeInfo.this) ||
									hasDuplicateParams(node.params)
								) {
									/*
									 * If the callback function does not have .bind(this) and contains a reference to `this`, there
									 * is no way to determine what `this` should be, so don't perform any fixes.
									 * If the callback function has duplicates in its list of parameters (possible in sloppy mode),
									 * don't replace it with an arrow function, because this is a SyntaxError with arrow functions.
									 */
									return;
								}

								// Remove `.bind(this)` if exists.
								if (callbackInfo.isLexicalThis) {
									const memberNode = node.parent;

									/*
									 * If `.bind(this)` exists but the parent is not `.bind(this)`, don't remove it automatically.
									 * E.g. `(foo || function(){}).bind(this)`
									 */
									if (memberNode.type !== "MemberExpression") {
										return;
									}

									const callNode = memberNode.parent;
									const firstTokenToRemove =
										sourceCode.getTokenAfter(
											memberNode.object,
											astUtils.isNotClosingParenToken,
										);
									const lastTokenToRemove =
										sourceCode.getLastToken(callNode);

									/*
									 * If the member expression is parenthesized, don't remove the right paren.
									 * E.g. `(function(){}.bind)(this)`
									 *                    ^^^^^^^^^^^^
									 */
									if (
										astUtils.isParenthesised(
											sourceCode,
											memberNode,
										)
									) {
										return;
									}

									// If comments exist in the `.bind(this)`, don't remove those.
									if (
										sourceCode.commentsExistBetween(
											firstTokenToRemove,
											lastTokenToRemove,
										)
									) {
										return;
									}

									yield fixer.removeRange([
										firstTokenToRemove.range[0],
										lastTokenToRemove.range[1],
									]);
								}

								// Convert the function expression to an arrow function.
								const functionToken = sourceCode.getFirstToken(
									node,
									node.async ? 1 : 0,
								);
								const leftParenToken = sourceCode.getTokenAfter(
									functionToken,
									astUtils.isOpeningParenToken,
								);
								const tokenBeforeBody = sourceCode.getTokenBefore(
									node.body,
								);

								if (
									sourceCode.commentsExistBetween(
										functionToken,
										leftParenToken,
									)
								) {
									// Remove only extra tokens to keep comments.
									yield fixer.remove(functionToken);
									if (node.id) {
										yield fixer.remove(node.id);
									}
								} else {
									// Remove extra tokens and spaces.
									yield fixer.removeRange([
										functionToken.range[0],
										leftParenToken.range[0],
									]);
								}
								yield fixer.insertTextAfter(tokenBeforeBody, " =>");

								// Get the node that will become the new arrow function.
								let replacedNode = callbackInfo.isLexicalThis
									? node.parent.parent
									: node;

								if (replacedNode.type === "ChainExpression") {
									replacedNode = replacedNode.parent;
								}

								/*
								 * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then
								 * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even
								 * though `foo || function() {}` is valid.
								 */
								if (
									replacedNode.parent.type !== "CallExpression" &&
									replacedNode.parent.type !==
										"ConditionalExpression" &&
									!astUtils.isParenthesised(
										sourceCode,
										replacedNode,
									) &&
									!astUtils.isParenthesised(sourceCode, node)
								) {
									yield fixer.insertTextBefore(replacedNode, "(");
									yield fixer.insertTextAfter(replacedNode, ")");
								}
							},
						});
					}
				},
			};
		},
	};
	return preferArrowCallback;
}

/**
 * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
 * @author Toru Nagashima
 */

var preferConst;
var hasRequiredPreferConst;

function requirePreferConst () {
	if (hasRequiredPreferConst) return preferConst;
	hasRequiredPreferConst = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const FixTracker = requireFixTracker();
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const PATTERN_TYPE =
		/^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u;
	const DECLARATION_HOST_TYPE =
		/^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u;
	const DESTRUCTURING_HOST_TYPE =
		/^(?:VariableDeclarator|AssignmentExpression)$/u;

	/**
	 * Checks whether a given node is located at `ForStatement.init` or not.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is located at `ForStatement.init`.
	 */
	function isInitOfForStatement(node) {
		return node.parent.type === "ForStatement" && node.parent.init === node;
	}

	/**
	 * Checks whether a given Identifier node becomes a VariableDeclaration or not.
	 * @param {ASTNode} identifier An Identifier node to check.
	 * @returns {boolean} `true` if the node can become a VariableDeclaration.
	 */
	function canBecomeVariableDeclaration(identifier) {
		let node = identifier.parent;

		while (PATTERN_TYPE.test(node.type)) {
			node = node.parent;
		}

		return (
			node.type === "VariableDeclarator" ||
			(node.type === "AssignmentExpression" &&
				node.parent.type === "ExpressionStatement" &&
				DECLARATION_HOST_TYPE.test(node.parent.parent.type))
		);
	}

	/**
	 * Checks if an property or element is from outer scope or function parameters
	 * in destructing pattern.
	 * @param {string} name A variable name to be checked.
	 * @param {eslint-scope.Scope} initScope A scope to start find.
	 * @returns {boolean} Indicates if the variable is from outer scope or function parameters.
	 */
	function isOuterVariableInDestructing(name, initScope) {
		if (
			initScope.through.some(
				ref => ref.resolved && ref.resolved.name === name,
			)
		) {
			return true;
		}

		const variable = astUtils.getVariableByName(initScope, name);

		if (variable !== null) {
			return variable.defs.some(def => def.type === "Parameter");
		}

		return false;
	}

	/**
	 * Gets the VariableDeclarator/AssignmentExpression node that a given reference
	 * belongs to.
	 * This is used to detect a mix of reassigned and never reassigned in a
	 * destructuring.
	 * @param {eslint-scope.Reference} reference A reference to get.
	 * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
	 *      null.
	 */
	function getDestructuringHost(reference) {
		if (!reference.isWrite()) {
			return null;
		}
		let node = reference.identifier.parent;

		while (PATTERN_TYPE.test(node.type)) {
			node = node.parent;
		}

		if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
			return null;
		}
		return node;
	}

	/**
	 * Determines if a destructuring assignment node contains
	 * any MemberExpression nodes. This is used to determine if a
	 * variable that is only written once using destructuring can be
	 * safely converted into a const declaration.
	 * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check.
	 * @returns {boolean} True if the destructuring pattern contains
	 *      a MemberExpression, false if not.
	 */
	function hasMemberExpressionAssignment(node) {
		switch (node.type) {
			case "ObjectPattern":
				return node.properties.some(prop => {
					if (prop) {
						/*
						 * Spread elements have an argument property while
						 * others have a value property. Because different
						 * parsers use different node types for spread elements,
						 * we just check if there is an argument property.
						 */
						return hasMemberExpressionAssignment(
							prop.argument || prop.value,
						);
					}

					return false;
				});

			case "ArrayPattern":
				return node.elements.some(element => {
					if (element) {
						return hasMemberExpressionAssignment(element);
					}

					return false;
				});

			case "AssignmentPattern":
				return hasMemberExpressionAssignment(node.left);

			case "MemberExpression":
				return true;

			// no default
		}

		return false;
	}

	/**
	 * Gets an identifier node of a given variable.
	 *
	 * If the initialization exists or one or more reading references exist before
	 * the first assignment, the identifier node is the node of the declaration.
	 * Otherwise, the identifier node is the node of the first assignment.
	 *
	 * If the variable should not change to const, this function returns null.
	 * - If the variable is reassigned.
	 * - If the variable is never initialized nor assigned.
	 * - If the variable is initialized in a different scope from the declaration.
	 * - If the unique assignment of the variable cannot change to a declaration.
	 *   e.g. `if (a) b = 1` / `return (b = 1)`
	 * - If the variable is declared in the global scope and `eslintUsed` is `true`.
	 *   `/*exported foo` directive comment makes such variables. This rule does not
	 *   warn such variables because this rule cannot distinguish whether the
	 *   exported variables are reassigned or not.
	 * @param {eslint-scope.Variable} variable A variable to get.
	 * @param {boolean} ignoreReadBeforeAssign
	 *      The value of `ignoreReadBeforeAssign` option.
	 * @returns {ASTNode|null}
	 *      An Identifier node if the variable should change to const.
	 *      Otherwise, null.
	 */
	function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
		if (variable.eslintUsed && variable.scope.type === "global") {
			return null;
		}

		// Finds the unique WriteReference.
		let writer = null;
		let isReadBeforeInit = false;
		const references = variable.references;

		for (let i = 0; i < references.length; ++i) {
			const reference = references[i];

			if (reference.isWrite()) {
				const isReassigned =
					writer !== null && writer.identifier !== reference.identifier;

				if (isReassigned) {
					return null;
				}

				const destructuringHost = getDestructuringHost(reference);

				if (
					destructuringHost !== null &&
					destructuringHost.left !== void 0
				) {
					const leftNode = destructuringHost.left;
					let hasOuterVariables = false,
						hasNonIdentifiers = false;

					if (leftNode.type === "ObjectPattern") {
						const properties = leftNode.properties;

						hasOuterVariables = properties
							.filter(prop => prop.value)
							.map(prop => prop.value.name)
							.some(name =>
								isOuterVariableInDestructing(name, variable.scope),
							);

						hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
					} else if (leftNode.type === "ArrayPattern") {
						const elements = leftNode.elements;

						hasOuterVariables = elements
							.map(element => element && element.name)
							.some(name =>
								isOuterVariableInDestructing(name, variable.scope),
							);

						hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
					}

					if (hasOuterVariables || hasNonIdentifiers) {
						return null;
					}
				}

				writer = reference;
			} else if (reference.isRead() && writer === null) {
				if (ignoreReadBeforeAssign) {
					return null;
				}
				isReadBeforeInit = true;
			}
		}

		/*
		 * If the assignment is from a different scope, ignore it.
		 * If the assignment cannot change to a declaration, ignore it.
		 */
		const shouldBeConst =
			writer !== null &&
			writer.from === variable.scope &&
			canBecomeVariableDeclaration(writer.identifier);

		if (!shouldBeConst) {
			return null;
		}

		if (isReadBeforeInit) {
			return variable.defs[0].name;
		}

		return writer.identifier;
	}

	/**
	 * Groups by the VariableDeclarator/AssignmentExpression node that each
	 * reference of given variables belongs to.
	 * This is used to detect a mix of reassigned and never reassigned in a
	 * destructuring.
	 * @param {eslint-scope.Variable[]} variables Variables to group by destructuring.
	 * @param {boolean} ignoreReadBeforeAssign
	 *      The value of `ignoreReadBeforeAssign` option.
	 * @returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.
	 */
	function groupByDestructuring(variables, ignoreReadBeforeAssign) {
		const identifierMap = new Map();

		for (let i = 0; i < variables.length; ++i) {
			const variable = variables[i];
			const references = variable.references;
			const identifier = getIdentifierIfShouldBeConst(
				variable,
				ignoreReadBeforeAssign,
			);
			let prevId = null;

			for (let j = 0; j < references.length; ++j) {
				const reference = references[j];
				const id = reference.identifier;

				/*
				 * Avoid counting a reference twice or more for default values of
				 * destructuring.
				 */
				if (id === prevId) {
					continue;
				}
				prevId = id;

				// Add the identifier node into the destructuring group.
				const group = getDestructuringHost(reference);

				if (group) {
					if (identifierMap.has(group)) {
						identifierMap.get(group).push(identifier);
					} else {
						identifierMap.set(group, [identifier]);
					}
				}
			}
		}

		return identifierMap;
	}

	/**
	 * Finds the nearest parent of node with a given type.
	 * @param {ASTNode} node The node to search from.
	 * @param {string} type The type field of the parent node.
	 * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise.
	 * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists.
	 */
	function findUp(node, type, shouldStop) {
		if (!node || shouldStop(node)) {
			return null;
		}
		if (node.type === type) {
			return node;
		}
		return findUp(node.parent, type, shouldStop);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferConst = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					destructuring: "any",
					ignoreReadBeforeAssign: false,
				},
			],

			docs: {
				description:
					"Require `const` declarations for variables that are never reassigned after declared",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-const",
			},

			fixable: "code",

			schema: [
				{
					type: "object",
					properties: {
						destructuring: { enum: ["any", "all"] },
						ignoreReadBeforeAssign: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],
			messages: {
				useConst: "'{{name}}' is never reassigned. Use 'const' instead.",
			},
		},

		create(context) {
			const [{ destructuring, ignoreReadBeforeAssign }] = context.options;
			const shouldMatchAnyDestructuredVariable = destructuring !== "all";
			const sourceCode = context.sourceCode;
			const variables = [];
			let reportCount = 0;
			let checkedId = null;
			let checkedName = "";

			/**
			 * Reports given identifier nodes if all of the nodes should be declared
			 * as const.
			 *
			 * The argument 'nodes' is an array of Identifier nodes.
			 * This node is the result of 'getIdentifierIfShouldBeConst()', so it's
			 * nullable. In simple declaration or assignment cases, the length of
			 * the array is 1. In destructuring cases, the length of the array can
			 * be 2 or more.
			 * @param {(eslint-scope.Reference|null)[]} nodes
			 *      References which are grouped by destructuring to report.
			 * @returns {void}
			 */
			function checkGroup(nodes) {
				const nodesToReport = nodes.filter(Boolean);

				if (
					nodes.length &&
					(shouldMatchAnyDestructuredVariable ||
						nodesToReport.length === nodes.length)
				) {
					const varDeclParent = findUp(
						nodes[0],
						"VariableDeclaration",
						parentNode => parentNode.type.endsWith("Statement"),
					);
					const isVarDecParentNull = varDeclParent === null;

					if (
						!isVarDecParentNull &&
						varDeclParent.declarations.length > 0
					) {
						const firstDeclaration = varDeclParent.declarations[0];

						if (firstDeclaration.init) {
							const firstDecParent = firstDeclaration.init.parent;

							/*
							 * First we check the declaration type and then depending on
							 * if the type is a "VariableDeclarator" or its an "ObjectPattern"
							 * we compare the name and id from the first identifier, if the names are different
							 * we assign the new name, id and reset the count of reportCount and nodeCount in
							 * order to check each block for the number of reported errors and base our fix
							 * based on comparing nodes.length and nodesToReport.length.
							 */

							if (firstDecParent.type === "VariableDeclarator") {
								if (firstDecParent.id.name !== checkedName) {
									checkedName = firstDecParent.id.name;
									reportCount = 0;
								}

								if (firstDecParent.id.type === "ObjectPattern") {
									if (firstDecParent.init.name !== checkedName) {
										checkedName = firstDecParent.init.name;
										reportCount = 0;
									}
								}

								if (firstDecParent.id !== checkedId) {
									checkedId = firstDecParent.id;
									reportCount = 0;
								}
							}
						}
					}

					let shouldFix =
						varDeclParent &&
						// Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop)
						(varDeclParent.parent.type === "ForInStatement" ||
							varDeclParent.parent.type === "ForOfStatement" ||
							varDeclParent.declarations.every(
								declaration => declaration.init,
							)) &&
						/*
						 * If options.destructuring is "all", then this warning will not occur unless
						 * every assignment in the destructuring should be const. In that case, it's safe
						 * to apply the fix.
						 */
						nodesToReport.length === nodes.length;

					if (
						!isVarDecParentNull &&
						varDeclParent.declarations &&
						varDeclParent.declarations.length !== 1
					) {
						if (
							varDeclParent &&
							varDeclParent.declarations &&
							varDeclParent.declarations.length >= 1
						) {
							/*
							 * Add nodesToReport.length to a count, then comparing the count to the length
							 * of the declarations in the current block.
							 */

							reportCount += nodesToReport.length;

							let totalDeclarationsCount = 0;

							varDeclParent.declarations.forEach(declaration => {
								if (declaration.id.type === "ObjectPattern") {
									totalDeclarationsCount +=
										declaration.id.properties.length;
								} else if (declaration.id.type === "ArrayPattern") {
									totalDeclarationsCount +=
										declaration.id.elements.length;
								} else {
									totalDeclarationsCount += 1;
								}
							});

							shouldFix =
								shouldFix && reportCount === totalDeclarationsCount;
						}
					}

					nodesToReport.forEach(node => {
						context.report({
							node,
							messageId: "useConst",
							data: node,
							fix: shouldFix
								? fixer => {
										const letKeywordToken =
											sourceCode.getFirstToken(
												varDeclParent,
												t => t.value === varDeclParent.kind,
											);

										/**
										 * Extend the replacement range to the whole declaration,
										 * in order to prevent other fixes in the same pass
										 * https://github.com/eslint/eslint/issues/13899
										 */
										return new FixTracker(fixer, sourceCode)
											.retainRange(varDeclParent.range)
											.replaceTextRange(
												letKeywordToken.range,
												"const",
											);
									}
								: null,
						});
					});
				}
			}

			return {
				"Program:exit"() {
					groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(
						checkGroup,
					);
				},

				VariableDeclaration(node) {
					if (node.kind === "let" && !isInitOfForStatement(node)) {
						variables.push(...sourceCode.getDeclaredVariables(node));
					}
				},
			};
		},
	};
	return preferConst;
}

/**
 * @fileoverview Prefer destructuring from arrays and objects
 * @author Alex LaFroscia
 */

var preferDestructuring;
var hasRequiredPreferDestructuring;

function requirePreferDestructuring () {
	if (hasRequiredPreferDestructuring) return preferDestructuring;
	hasRequiredPreferDestructuring = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const PRECEDENCE_OF_ASSIGNMENT_EXPR = astUtils.getPrecedence({
		type: "AssignmentExpression",
	});

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferDestructuring = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require destructuring from arrays and/or objects",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-destructuring",
			},

			fixable: "code",

			schema: [
				{
					/*
					 * old support {array: Boolean, object: Boolean}
					 * new support {VariableDeclarator: {}, AssignmentExpression: {}}
					 */
					oneOf: [
						{
							type: "object",
							properties: {
								VariableDeclarator: {
									type: "object",
									properties: {
										array: {
											type: "boolean",
										},
										object: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
								AssignmentExpression: {
									type: "object",
									properties: {
										array: {
											type: "boolean",
										},
										object: {
											type: "boolean",
										},
									},
									additionalProperties: false,
								},
							},
							additionalProperties: false,
						},
						{
							type: "object",
							properties: {
								array: {
									type: "boolean",
								},
								object: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
				{
					type: "object",
					properties: {
						enforceForRenamedProperties: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				preferDestructuring: "Use {{type}} destructuring.",
			},
		},
		create(context) {
			const enabledTypes = context.options[0];
			const enforceForRenamedProperties =
				context.options[1] &&
				context.options[1].enforceForRenamedProperties;
			let normalizedOptions = {
				VariableDeclarator: { array: true, object: true },
				AssignmentExpression: { array: true, object: true },
			};

			if (enabledTypes) {
				normalizedOptions =
					typeof enabledTypes.array !== "undefined" ||
					typeof enabledTypes.object !== "undefined"
						? {
								VariableDeclarator: enabledTypes,
								AssignmentExpression: enabledTypes,
							}
						: enabledTypes;
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Checks if destructuring type should be checked.
			 * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator"
			 * @param {string} destructuringType "array" or "object"
			 * @returns {boolean} `true` if the destructuring type should be checked for the given node
			 */
			function shouldCheck(nodeType, destructuringType) {
				return (
					normalizedOptions &&
					normalizedOptions[nodeType] &&
					normalizedOptions[nodeType][destructuringType]
				);
			}

			/**
			 * Determines if the given node is accessing an array index
			 *
			 * This is used to differentiate array index access from object property
			 * access.
			 * @param {ASTNode} node the node to evaluate
			 * @returns {boolean} whether or not the node is an integer
			 */
			function isArrayIndexAccess(node) {
				return Number.isInteger(node.property.value);
			}

			/**
			 * Report that the given node should use destructuring
			 * @param {ASTNode} reportNode the node to report
			 * @param {string} type the type of destructuring that should have been done
			 * @param {Function|null} fix the fix function or null to pass to context.report
			 * @returns {void}
			 */
			function report(reportNode, type, fix) {
				context.report({
					node: reportNode,
					messageId: "preferDestructuring",
					data: { type },
					fix,
				});
			}

			/**
			 * Determines if a node should be fixed into object destructuring
			 *
			 * The fixer only fixes the simplest case of object destructuring,
			 * like: `let x = a.x`;
			 *
			 * Assignment expression is not fixed.
			 * Array destructuring is not fixed.
			 * Renamed property is not fixed.
			 * @param {ASTNode} node the node to evaluate
			 * @returns {boolean} whether or not the node should be fixed
			 */
			function shouldFix(node) {
				return (
					node.type === "VariableDeclarator" &&
					node.id.type === "Identifier" &&
					node.init.type === "MemberExpression" &&
					!node.init.computed &&
					node.init.property.type === "Identifier" &&
					node.id.name === node.init.property.name
				);
			}

			/**
			 * Fix a node into object destructuring.
			 * This function only handles the simplest case of object destructuring,
			 * see {@link shouldFix}.
			 * @param {SourceCodeFixer} fixer the fixer object
			 * @param {ASTNode} node the node to be fixed.
			 * @returns {Object} a fix for the node
			 */
			function fixIntoObjectDestructuring(fixer, node) {
				const rightNode = node.init;
				const sourceCode = context.sourceCode;

				// Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved.
				if (
					sourceCode.getCommentsInside(node).length >
					sourceCode.getCommentsInside(rightNode.object).length
				) {
					return null;
				}

				let objectText = sourceCode.getText(rightNode.object);

				if (
					astUtils.getPrecedence(rightNode.object) <
					PRECEDENCE_OF_ASSIGNMENT_EXPR
				) {
					objectText = `(${objectText})`;
				}

				return fixer.replaceText(
					node,
					`{${rightNode.property.name}} = ${objectText}`,
				);
			}

			/**
			 * Check that the `prefer-destructuring` rules are followed based on the
			 * given left- and right-hand side of the assignment.
			 *
			 * Pulled out into a separate method so that VariableDeclarators and
			 * AssignmentExpressions can share the same verification logic.
			 * @param {ASTNode} leftNode the left-hand side of the assignment
			 * @param {ASTNode} rightNode the right-hand side of the assignment
			 * @param {ASTNode} reportNode the node to report the error on
			 * @returns {void}
			 */
			function performCheck(leftNode, rightNode, reportNode) {
				if (
					rightNode.type !== "MemberExpression" ||
					rightNode.object.type === "Super" ||
					rightNode.property.type === "PrivateIdentifier"
				) {
					return;
				}

				if (isArrayIndexAccess(rightNode)) {
					if (shouldCheck(reportNode.type, "array")) {
						report(reportNode, "array", null);
					}
					return;
				}

				const fix = shouldFix(reportNode)
					? fixer => fixIntoObjectDestructuring(fixer, reportNode)
					: null;

				if (
					shouldCheck(reportNode.type, "object") &&
					enforceForRenamedProperties
				) {
					report(reportNode, "object", fix);
					return;
				}

				if (shouldCheck(reportNode.type, "object")) {
					const property = rightNode.property;

					if (
						(property.type === "Literal" &&
							leftNode.name === property.value) ||
						(property.type === "Identifier" &&
							leftNode.name === property.name &&
							!rightNode.computed)
					) {
						report(reportNode, "object", fix);
					}
				}
			}

			/**
			 * Check if a given variable declarator is coming from an property access
			 * that should be using destructuring instead
			 * @param {ASTNode} node the variable declarator to check
			 * @returns {void}
			 */
			function checkVariableDeclarator(node) {
				// Skip if variable is declared without assignment
				if (!node.init) {
					return;
				}

				// We only care about member expressions past this point
				if (node.init.type !== "MemberExpression") {
					return;
				}

				performCheck(node.id, node.init, node);
			}

			/**
			 * Run the `prefer-destructuring` check on an AssignmentExpression
			 * @param {ASTNode} node the AssignmentExpression node
			 * @returns {void}
			 */
			function checkAssignmentExpression(node) {
				if (node.operator === "=") {
					performCheck(node.left, node.right, node);
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				VariableDeclarator: checkVariableDeclarator,
				AssignmentExpression: checkAssignmentExpression,
			};
		},
	};
	return preferDestructuring;
}

/**
 * @fileoverview Rule to disallow Math.pow in favor of the ** operator
 * @author Milos Djermanovic
 */

var preferExponentiationOperator;
var hasRequiredPreferExponentiationOperator;

function requirePreferExponentiationOperator () {
	if (hasRequiredPreferExponentiationOperator) return preferExponentiationOperator;
	hasRequiredPreferExponentiationOperator = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const { CALL, ReferenceTracker } = /*@__PURE__*/ requireEslintUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({
		type: "BinaryExpression",
		operator: "**",
	});

	/**
	 * Determines whether the given node needs parens if used as the base in an exponentiation binary expression.
	 * @param {ASTNode} base The node to check.
	 * @returns {boolean} `true` if the node needs to be parenthesised.
	 */
	function doesBaseNeedParens(base) {
		return (
			// '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c
			astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR ||
			// An unary operator cannot be used immediately before an exponentiation expression
			base.type === "AwaitExpression" ||
			base.type === "UnaryExpression"
		);
	}

	/**
	 * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression.
	 * @param {ASTNode} exponent The node to check.
	 * @returns {boolean} `true` if the node needs to be parenthesised.
	 */
	function doesExponentNeedParens(exponent) {
		// '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c
		return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR;
	}

	/**
	 * Determines whether an exponentiation binary expression at the place of the given node would need parens.
	 * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression.
	 * @param {SourceCode} sourceCode A SourceCode object.
	 * @returns {boolean} `true` if the expression needs to be parenthesised.
	 */
	function doesExponentiationExpressionNeedParens(node, sourceCode) {
		const parent =
			node.parent.type === "ChainExpression"
				? node.parent.parent
				: node.parent;

		const parentPrecedence = astUtils.getPrecedence(parent);
		const needsParens =
			parent.type === "ClassDeclaration" ||
			(parent.type.endsWith("Expression") &&
				(parentPrecedence === -1 ||
					parentPrecedence >= PRECEDENCE_OF_EXPONENTIATION_EXPR) &&
				!(
					parent.type === "BinaryExpression" &&
					parent.operator === "**" &&
					parent.right === node
				) &&
				!(
					(parent.type === "CallExpression" ||
						parent.type === "NewExpression") &&
					parent.arguments.includes(node)
				) &&
				!(
					parent.type === "MemberExpression" &&
					parent.computed &&
					parent.property === node
				) &&
				!(parent.type === "ArrayExpression"));

		return needsParens && !astUtils.isParenthesised(sourceCode, node);
	}

	/**
	 * Optionally parenthesizes given text.
	 * @param {string} text The text to parenthesize.
	 * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised.
	 * @returns {string} parenthesised or unchanged text.
	 */
	function parenthesizeIfShould(text, shouldParenthesize) {
		return shouldParenthesize ? `(${text})` : text;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferExponentiationOperator = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow the use of `Math.pow` in favor of the `**` operator",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator",
			},

			schema: [],
			fixable: "code",

			messages: {
				useExponentiation: "Use the '**' operator instead of 'Math.pow'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Reports the given node.
			 * @param {ASTNode} node 'Math.pow()' node to report.
			 * @returns {void}
			 */
			function report(node) {
				context.report({
					node,
					messageId: "useExponentiation",
					fix(fixer) {
						if (
							node.arguments.length !== 2 ||
							node.arguments.some(
								arg => arg.type === "SpreadElement",
							) ||
							sourceCode.getCommentsInside(node).length > 0
						) {
							return null;
						}

						const base = node.arguments[0],
							exponent = node.arguments[1],
							baseText = sourceCode.getText(base),
							exponentText = sourceCode.getText(exponent),
							shouldParenthesizeBase = doesBaseNeedParens(base),
							shouldParenthesizeExponent =
								doesExponentNeedParens(exponent),
							shouldParenthesizeAll =
								doesExponentiationExpressionNeedParens(
									node,
									sourceCode,
								);

						let prefix = "",
							suffix = "";

						if (!shouldParenthesizeAll) {
							if (!shouldParenthesizeBase) {
								const firstReplacementToken =
										sourceCode.getFirstToken(base),
									tokenBefore = sourceCode.getTokenBefore(node);

								if (
									tokenBefore &&
									tokenBefore.range[1] === node.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenBefore,
										firstReplacementToken,
									)
								) {
									prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c
								}
							}
							if (!shouldParenthesizeExponent) {
								const lastReplacementToken =
										sourceCode.getLastToken(exponent),
									tokenAfter = sourceCode.getTokenAfter(node);

								if (
									tokenAfter &&
									node.range[1] === tokenAfter.range[0] &&
									!astUtils.canTokensBeAdjacent(
										lastReplacementToken,
										tokenAfter,
									)
								) {
									suffix = " "; // Math.pow(a, b)in c -> a**b in c
								}
							}
						}

						const baseReplacement = parenthesizeIfShould(
								baseText,
								shouldParenthesizeBase,
							),
							exponentReplacement = parenthesizeIfShould(
								exponentText,
								shouldParenthesizeExponent,
							),
							replacement = parenthesizeIfShould(
								`${baseReplacement}**${exponentReplacement}`,
								shouldParenthesizeAll,
							);

						return fixer.replaceText(
							node,
							`${prefix}${replacement}${suffix}`,
						);
					},
				});
			}

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const trackMap = {
						Math: {
							pow: { [CALL]: true },
						},
					};

					for (const { node: refNode } of tracker.iterateGlobalReferences(
						trackMap,
					)) {
						report(refNode);
					}
				},
			};
		},
	};
	return preferExponentiationOperator;
}

/**
 * @fileoverview Rule to enforce requiring named capture groups in regular expression.
 * @author Pig Fang <https://github.com/g-plane>
 */

var preferNamedCaptureGroup;
var hasRequiredPreferNamedCaptureGroup;

function requirePreferNamedCaptureGroup () {
	if (hasRequiredPreferNamedCaptureGroup) return preferNamedCaptureGroup;
	hasRequiredPreferNamedCaptureGroup = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
		getStringIfConstant,
	} = /*@__PURE__*/ requireEslintUtils();
	const regexpp = requireRegexpp();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const parser = new regexpp.RegExpParser();

	/**
	 * Creates fixer suggestions for the regex, if statically determinable.
	 * @param {number} groupStart Starting index of the regex group.
	 * @param {string} pattern The regular expression pattern to be checked.
	 * @param {string} rawText Source text of the regexNode.
	 * @param {ASTNode} regexNode AST node which contains the regular expression.
	 * @returns {Array<SuggestionResult>} Fixer suggestions for the regex, if statically determinable.
	 */
	function suggestIfPossible(groupStart, pattern, rawText, regexNode) {
		switch (regexNode.type) {
			case "Literal":
				if (typeof regexNode.value === "string" && rawText.includes("\\")) {
					return null;
				}
				break;
			case "TemplateLiteral":
				if (
					regexNode.expressions.length ||
					rawText.slice(1, -1) !== pattern
				) {
					return null;
				}
				break;
			default:
				return null;
		}

		const start = regexNode.range[0] + groupStart + 2;

		return [
			{
				fix(fixer) {
					const existingTemps = pattern.match(/temp\d+/gu) || [];
					const highestTempCount = existingTemps.reduce(
						(previous, next) =>
							Math.max(previous, Number(next.slice("temp".length))),
						0,
					);

					return fixer.insertTextBeforeRange(
						[start, start],
						`?<temp${highestTempCount + 1}>`,
					);
				},
				messageId: "addGroupName",
			},
			{
				fix(fixer) {
					return fixer.insertTextBeforeRange([start, start], "?:");
				},
				messageId: "addNonCapture",
			},
		];
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferNamedCaptureGroup = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce using named capture group in regular expression",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group",
			},

			hasSuggestions: true,

			schema: [],

			messages: {
				addGroupName: "Add name to capture group.",
				addNonCapture: "Convert group to non-capturing.",
				required:
					"Capture group '{{group}}' should be converted to a named or non-capturing group.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Function to check regular expression.
			 * @param {string} pattern The regular expression pattern to be checked.
			 * @param {ASTNode} node AST node which contains the regular expression or a call/new expression.
			 * @param {ASTNode} regexNode AST node which contains the regular expression.
			 * @param {string|null} flags The regular expression flags to be checked.
			 * @returns {void}
			 */
			function checkRegex(pattern, node, regexNode, flags) {
				let ast;

				try {
					ast = parser.parsePattern(pattern, 0, pattern.length, {
						unicode: Boolean(flags && flags.includes("u")),
						unicodeSets: Boolean(flags && flags.includes("v")),
					});
				} catch {
					// ignore regex syntax errors
					return;
				}

				regexpp.visitRegExpAST(ast, {
					onCapturingGroupEnter(group) {
						if (!group.name) {
							const rawText = sourceCode.getText(regexNode);
							const suggest = suggestIfPossible(
								group.start,
								pattern,
								rawText,
								regexNode,
							);

							context.report({
								node,
								messageId: "required",
								data: {
									group: group.raw,
								},
								suggest,
							});
						}
					},
				});
			}

			return {
				Literal(node) {
					if (node.regex) {
						checkRegex(
							node.regex.pattern,
							node,
							node,
							node.regex.flags,
						);
					}
				},
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const traceMap = {
						RegExp: {
							[CALL]: true,
							[CONSTRUCT]: true,
						},
					};

					for (const { node: refNode } of tracker.iterateGlobalReferences(
						traceMap,
					)) {
						const regex = getStringIfConstant(refNode.arguments[0]);
						const flags = getStringIfConstant(refNode.arguments[1]);

						if (regex) {
							checkRegex(regex, refNode, refNode.arguments[0], flags);
						}
					}
				},
			};
		},
	};
	return preferNamedCaptureGroup;
}

/**
 * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals
 * @author Annie Zhang, Henry Zhu
 */

var preferNumericLiterals;
var hasRequiredPreferNumericLiterals;

function requirePreferNumericLiterals () {
	if (hasRequiredPreferNumericLiterals) return preferNumericLiterals;
	hasRequiredPreferNumericLiterals = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const radixMap = new Map([
		[2, { system: "binary", literalPrefix: "0b" }],
		[8, { system: "octal", literalPrefix: "0o" }],
		[16, { system: "hexadecimal", literalPrefix: "0x" }],
	]);

	/**
	 * Checks to see if a CallExpression's callee node is `parseInt` or
	 * `Number.parseInt`.
	 * @param {ASTNode} calleeNode The callee node to evaluate.
	 * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`,
	 * false otherwise.
	 */
	function isParseInt(calleeNode) {
		return (
			astUtils.isSpecificId(calleeNode, "parseInt") ||
			astUtils.isSpecificMemberAccess(calleeNode, "Number", "parseInt")
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferNumericLiterals = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals",
			},

			schema: [],

			messages: {
				useLiteral:
					"Use {{system}} literals instead of {{functionName}}().",
			},

			fixable: "code",
		},

		create(context) {
			const sourceCode = context.sourceCode;

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				"CallExpression[arguments.length=2]"(node) {
					const [strNode, radixNode] = node.arguments,
						str = astUtils.getStaticStringValue(strNode),
						radix = radixNode.value;

					if (
						str !== null &&
						astUtils.isStringLiteral(strNode) &&
						radixNode.type === "Literal" &&
						typeof radix === "number" &&
						radixMap.has(radix) &&
						isParseInt(node.callee)
					) {
						const { system, literalPrefix } = radixMap.get(radix);

						context.report({
							node,
							messageId: "useLiteral",
							data: {
								system,
								functionName: sourceCode.getText(node.callee),
							},
							fix(fixer) {
								if (sourceCode.getCommentsInside(node).length) {
									return null;
								}

								const replacement = `${literalPrefix}${str}`;

								if (+replacement !== parseInt(str, radix)) {
									/*
									 * If the newly-produced literal would be invalid, (e.g. 0b1234),
									 * or it would yield an incorrect parseInt result for some other reason, don't make a fix.
									 *
									 * If `str` had numeric separators, `+replacement` will evaluate to `NaN` because unary `+`
									 * per the specification doesn't support numeric separators. Thus, the above condition will be `true`
									 * (`NaN !== anything` is always `true`) regardless of the `parseInt(str, radix)` value.
									 * Consequently, no autofixes will be made. This is correct behavior because `parseInt` also
									 * doesn't support numeric separators, but it does parse part of the string before the first `_`,
									 * so the autofix would be invalid:
									 *
									 *   parseInt("1_1", 2) // === 1
									 *   0b1_1 // === 3
									 */
									return null;
								}

								const tokenBefore = sourceCode.getTokenBefore(node),
									tokenAfter = sourceCode.getTokenAfter(node);
								let prefix = "",
									suffix = "";

								if (
									tokenBefore &&
									tokenBefore.range[1] === node.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenBefore,
										replacement,
									)
								) {
									prefix = " ";
								}

								if (
									tokenAfter &&
									node.range[1] === tokenAfter.range[0] &&
									!astUtils.canTokensBeAdjacent(
										replacement,
										tokenAfter,
									)
								) {
									suffix = " ";
								}

								return fixer.replaceText(
									node,
									`${prefix}${replacement}${suffix}`,
								);
							},
						});
					}
				},
			};
		},
	};
	return preferNumericLiterals;
}

/**
 * @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
 * @author Nitin Kumar
 * @author Gautam Arora
 */

var preferObjectHasOwn;
var hasRequiredPreferObjectHasOwn;

function requirePreferObjectHasOwn () {
	if (hasRequiredPreferObjectHasOwn) return preferObjectHasOwn;
	hasRequiredPreferObjectHasOwn = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks if the given node is considered to be an access to a property of `Object.prototype`.
	 * @param {ASTNode} node `MemberExpression` node to evaluate.
	 * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node).
	 */
	function hasLeftHandObject(node) {
		/*
		 * ({}).hasOwnProperty.call(obj, prop) - `true`
		 * ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty
		 */
		if (
			node.object.type === "ObjectExpression" &&
			node.object.properties.length === 0
		) {
			return true;
		}

		const objectNodeToCheck =
			node.object.type === "MemberExpression" &&
			astUtils.getStaticPropertyName(node.object) === "prototype"
				? node.object.object
				: node.object;

		if (
			objectNodeToCheck.type === "Identifier" &&
			objectNodeToCheck.name === "Object"
		) {
			return true;
		}

		return false;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferObjectHasOwn = {
		meta: {
			type: "suggestion",
			docs: {
				description:
					"Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-object-has-own",
			},
			schema: [],
			messages: {
				useHasOwn:
					"Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'.",
			},
			fixable: "code",
		},
		create(context) {
			const sourceCode = context.sourceCode;

			return {
				CallExpression(node) {
					if (
						!(
							node.callee.type === "MemberExpression" &&
							node.callee.object.type === "MemberExpression"
						)
					) {
						return;
					}

					const calleePropertyName = astUtils.getStaticPropertyName(
						node.callee,
					);
					const objectPropertyName = astUtils.getStaticPropertyName(
						node.callee.object,
					);
					const isObject = hasLeftHandObject(node.callee.object);

					// check `Object` scope
					const scope = sourceCode.getScope(node);
					const variable = astUtils.getVariableByName(scope, "Object");

					if (
						calleePropertyName === "call" &&
						objectPropertyName === "hasOwnProperty" &&
						isObject &&
						variable &&
						variable.scope.type === "global"
					) {
						context.report({
							node,
							messageId: "useHasOwn",
							fix(fixer) {
								if (
									sourceCode.getCommentsInside(node.callee)
										.length > 0
								) {
									return null;
								}

								const tokenJustBeforeNode =
									sourceCode.getTokenBefore(node.callee, {
										includeComments: true,
									});

								// for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
								if (
									tokenJustBeforeNode &&
									tokenJustBeforeNode.range[1] ===
										node.callee.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenJustBeforeNode,
										"Object.hasOwn",
									)
								) {
									return fixer.replaceText(
										node.callee,
										" Object.hasOwn",
									);
								}

								return fixer.replaceText(
									node.callee,
									"Object.hasOwn",
								);
							},
						});
					}
				},
			};
		},
	};
	return preferObjectHasOwn;
}

/**
 * @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
 * @author Sharmila Jesupaul
 */

var preferObjectSpread;
var hasRequiredPreferObjectSpread;

function requirePreferObjectSpread () {
	if (hasRequiredPreferObjectSpread) return preferObjectSpread;
	hasRequiredPreferObjectSpread = 1;

	const { CALL, ReferenceTracker } = /*@__PURE__*/ requireEslintUtils();
	const {
		isCommaToken,
		isOpeningParenToken,
		isClosingParenToken,
		isParenthesised,
	} = requireAstUtils();

	const ANY_SPACE = /\s/u;

	/**
	 * Helper that checks if the Object.assign call has array spread
	 * @param {ASTNode} node The node that the rule warns on
	 * @returns {boolean} - Returns true if the Object.assign call has array spread
	 */
	function hasArraySpread(node) {
		return node.arguments.some(arg => arg.type === "SpreadElement");
	}

	/**
	 * Determines whether the given node is an accessor property (getter/setter).
	 * @param {ASTNode} node Node to check.
	 * @returns {boolean} `true` if the node is a getter or a setter.
	 */
	function isAccessorProperty(node) {
		return (
			node.type === "Property" && (node.kind === "get" || node.kind === "set")
		);
	}

	/**
	 * Determines whether the given object expression node has accessor properties (getters/setters).
	 * @param {ASTNode} node `ObjectExpression` node to check.
	 * @returns {boolean} `true` if the node has at least one getter/setter.
	 */
	function hasAccessors(node) {
		return node.properties.some(isAccessorProperty);
	}

	/**
	 * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters).
	 * @param {ASTNode} node `CallExpression` node to check.
	 * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter.
	 */
	function hasArgumentsWithAccessors(node) {
		return node.arguments
			.filter(arg => arg.type === "ObjectExpression")
			.some(hasAccessors);
	}

	/**
	 * Helper that checks if the node needs parentheses to be valid JS.
	 * The default is to wrap the node in parentheses to avoid parsing errors.
	 * @param {ASTNode} node The node that the rule warns on
	 * @param {Object} sourceCode in context sourcecode object
	 * @returns {boolean} - Returns true if the node needs parentheses
	 */
	function needsParens(node, sourceCode) {
		const parent = node.parent;

		switch (parent.type) {
			case "VariableDeclarator":
			case "ArrayExpression":
			case "ReturnStatement":
			case "CallExpression":
			case "Property":
				return false;
			case "AssignmentExpression":
				return parent.left === node && !isParenthesised(sourceCode, node);
			default:
				return !isParenthesised(sourceCode, node);
		}
	}

	/**
	 * Determines if an argument needs parentheses. The default is to not add parens.
	 * @param {ASTNode} node The node to be checked.
	 * @param {Object} sourceCode in context sourcecode object
	 * @returns {boolean} True if the node needs parentheses
	 */
	function argNeedsParens(node, sourceCode) {
		switch (node.type) {
			case "AssignmentExpression":
			case "ArrowFunctionExpression":
			case "ConditionalExpression":
				return !isParenthesised(sourceCode, node);
			default:
				return false;
		}
	}

	/**
	 * Get the parenthesis tokens of a given ObjectExpression node.
	 * This includes the braces of the object literal and enclosing parentheses.
	 * @param {ASTNode} node The node to get.
	 * @param {Token} leftArgumentListParen The opening paren token of the argument list.
	 * @param {SourceCode} sourceCode The source code object to get tokens.
	 * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location.
	 */
	function getParenTokens(node, leftArgumentListParen, sourceCode) {
		const parens = [
			sourceCode.getFirstToken(node),
			sourceCode.getLastToken(node),
		];
		let leftNext = sourceCode.getTokenBefore(node);
		let rightNext = sourceCode.getTokenAfter(node);

		// Note: don't include the parens of the argument list.
		while (
			leftNext &&
			rightNext &&
			leftNext.range[0] > leftArgumentListParen.range[0] &&
			isOpeningParenToken(leftNext) &&
			isClosingParenToken(rightNext)
		) {
			parens.push(leftNext, rightNext);
			leftNext = sourceCode.getTokenBefore(leftNext);
			rightNext = sourceCode.getTokenAfter(rightNext);
		}

		return parens.sort((a, b) => a.range[0] - b.range[0]);
	}

	/**
	 * Get the range of a given token and around whitespaces.
	 * @param {Token} token The token to get range.
	 * @param {SourceCode} sourceCode The source code object to get tokens.
	 * @returns {number} The end of the range of the token and around whitespaces.
	 */
	function getStartWithSpaces(token, sourceCode) {
		const text = sourceCode.text;
		let start = token.range[0];

		// If the previous token is a line comment then skip this step to avoid commenting this token out.
		{
			const prevToken = sourceCode.getTokenBefore(token, {
				includeComments: true,
			});

			if (prevToken && prevToken.type === "Line") {
				return start;
			}
		}

		// Detect spaces before the token.
		while (ANY_SPACE.test(text[start - 1] || "")) {
			start -= 1;
		}

		return start;
	}

	/**
	 * Get the range of a given token and around whitespaces.
	 * @param {Token} token The token to get range.
	 * @param {SourceCode} sourceCode The source code object to get tokens.
	 * @returns {number} The start of the range of the token and around whitespaces.
	 */
	function getEndWithSpaces(token, sourceCode) {
		const text = sourceCode.text;
		let end = token.range[1];

		// Detect spaces after the token.
		while (ANY_SPACE.test(text[end] || "")) {
			end += 1;
		}

		return end;
	}

	/**
	 * Autofixes the Object.assign call to use an object spread instead.
	 * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call
	 * @param {string} sourceCode sourceCode of the Object.assign call
	 * @returns {Function} autofixer - replaces the Object.assign with a spread object.
	 */
	function defineFixer(node, sourceCode) {
		return function* (fixer) {
			const leftParen = sourceCode.getTokenAfter(
				node.callee,
				isOpeningParenToken,
			);
			const rightParen = sourceCode.getLastToken(node);

			// Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren.
			yield fixer.removeRange([node.range[0], leftParen.range[0]]);

			// Replace the parens of argument list to braces.
			if (needsParens(node, sourceCode)) {
				yield fixer.replaceText(leftParen, "({");
				yield fixer.replaceText(rightParen, "})");
			} else {
				yield fixer.replaceText(leftParen, "{");
				yield fixer.replaceText(rightParen, "}");
			}

			// Process arguments.
			for (const argNode of node.arguments) {
				const innerParens = getParenTokens(argNode, leftParen, sourceCode);
				const left = innerParens.shift();
				const right = innerParens.pop();

				if (argNode.type === "ObjectExpression") {
					const maybeTrailingComma = sourceCode.getLastToken(argNode, 1);
					const maybeArgumentComma = sourceCode.getTokenAfter(right);

					/*
					 * Make bare this object literal.
					 * And remove spaces inside of the braces for better formatting.
					 */
					for (const innerParen of innerParens) {
						yield fixer.remove(innerParen);
					}
					const leftRange = [
						left.range[0],
						getEndWithSpaces(left, sourceCode),
					];
					const rightRange = [
						Math.max(
							getStartWithSpaces(right, sourceCode),
							leftRange[1],
						), // Ensure ranges don't overlap
						right.range[1],
					];

					yield fixer.removeRange(leftRange);
					yield fixer.removeRange(rightRange);

					// Remove the comma of this argument if it's duplication.
					if (
						(argNode.properties.length === 0 ||
							isCommaToken(maybeTrailingComma)) &&
						isCommaToken(maybeArgumentComma)
					) {
						yield fixer.remove(maybeArgumentComma);
					}
				} else {
					// Make spread.
					if (argNeedsParens(argNode, sourceCode)) {
						yield fixer.insertTextBefore(left, "...(");
						yield fixer.insertTextAfter(right, ")");
					} else {
						yield fixer.insertTextBefore(left, "...");
					}
				}
			}
		};
	}

	/** @type {import('../shared/types').Rule} */
	preferObjectSpread = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-object-spread",
			},

			schema: [],
			fixable: "code",

			messages: {
				useSpreadMessage:
					"Use an object spread instead of `Object.assign` eg: `{ ...foo }`.",
				useLiteralMessage:
					"Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const trackMap = {
						Object: {
							assign: { [CALL]: true },
						},
					};

					// Iterate all calls of `Object.assign` (only of the global variable `Object`).
					for (const { node: refNode } of tracker.iterateGlobalReferences(
						trackMap,
					)) {
						if (
							refNode.arguments.length >= 1 &&
							refNode.arguments[0].type === "ObjectExpression" &&
							!hasArraySpread(refNode) &&
							!(
								refNode.arguments.length > 1 &&
								hasArgumentsWithAccessors(refNode)
							)
						) {
							const messageId =
								refNode.arguments.length === 1
									? "useLiteralMessage"
									: "useSpreadMessage";
							const fix = defineFixer(refNode, sourceCode);

							context.report({ node: refNode, messageId, fix });
						}
					}
				},
			};
		},
	};
	return preferObjectSpread;
}

/**
 * @fileoverview restrict values that can be used as Promise rejection reasons
 * @author Teddy Katz
 */

var preferPromiseRejectErrors;
var hasRequiredPreferPromiseRejectErrors;

function requirePreferPromiseRejectErrors () {
	if (hasRequiredPreferPromiseRejectErrors) return preferPromiseRejectErrors;
	hasRequiredPreferPromiseRejectErrors = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferPromiseRejectErrors = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowEmptyReject: false,
				},
			],

			docs: {
				description:
					"Require using Error objects as Promise rejection reasons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors",
			},

			fixable: null,

			schema: [
				{
					type: "object",
					properties: {
						allowEmptyReject: { type: "boolean" },
					},
					additionalProperties: false,
				},
			],

			messages: {
				rejectAnError:
					"Expected the Promise rejection reason to be an Error.",
			},
		},

		create(context) {
			const [{ allowEmptyReject }] = context.options;
			const sourceCode = context.sourceCode;

			//----------------------------------------------------------------------
			// Helpers
			//----------------------------------------------------------------------

			/**
			 * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error
			 * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise
			 * @returns {void}
			 */
			function checkRejectCall(callExpression) {
				if (!callExpression.arguments.length && allowEmptyReject) {
					return;
				}
				if (
					!callExpression.arguments.length ||
					!astUtils.couldBeError(callExpression.arguments[0]) ||
					(callExpression.arguments[0].type === "Identifier" &&
						callExpression.arguments[0].name === "undefined")
				) {
					context.report({
						node: callExpression,
						messageId: "rejectAnError",
					});
				}
			}

			/**
			 * Determines whether a function call is a Promise.reject() call
			 * @param {ASTNode} node A CallExpression node
			 * @returns {boolean} `true` if the call is a Promise.reject() call
			 */
			function isPromiseRejectCall(node) {
				return astUtils.isSpecificMemberAccess(
					node.callee,
					"Promise",
					"reject",
				);
			}

			//----------------------------------------------------------------------
			// Public
			//----------------------------------------------------------------------

			return {
				// Check `Promise.reject(value)` calls.
				CallExpression(node) {
					if (isPromiseRejectCall(node)) {
						checkRejectCall(node);
					}
				},

				/*
				 * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls.
				 * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that
				 * the nodes in the expression already have the `parent` property.
				 */
				"NewExpression:exit"(node) {
					if (
						node.callee.type === "Identifier" &&
						node.callee.name === "Promise" &&
						node.arguments.length &&
						astUtils.isFunction(node.arguments[0]) &&
						node.arguments[0].params.length > 1 &&
						node.arguments[0].params[1].type === "Identifier"
					) {
						sourceCode
							.getDeclaredVariables(node.arguments[0])

							/*
							 * Find the first variable that matches the second parameter's name.
							 * If the first parameter has the same name as the second parameter, then the variable will actually
							 * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten
							 * by the second parameter. It's not possible for an expression with the variable to be evaluated before
							 * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or
							 * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for
							 * this case.
							 */
							.find(
								variable =>
									variable.name ===
									node.arguments[0].params[1].name,
							)

							// Get the references to that variable.
							.references // Only check the references that read the parameter's value.
							.filter(ref => ref.isRead())

							// Only check the references that are used as the callee in a function call, e.g. `reject(foo)`.
							.filter(
								ref =>
									ref.identifier.parent.type ===
										"CallExpression" &&
									ref.identifier === ref.identifier.parent.callee,
							)

							// Check the argument of the function call to determine whether it's an Error.
							.forEach(ref => checkRejectCall(ref.identifier.parent));
					}
				},
			};
		},
	};
	return preferPromiseRejectErrors;
}

/**
 * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods
 * @author Keith Cirkel <http://keithcirkel.co.uk>
 * @deprecated in ESLint v3.9.0
 */

var preferReflect;
var hasRequiredPreferReflect;

function requirePreferReflect () {
	if (hasRequiredPreferReflect) return preferReflect;
	hasRequiredPreferReflect = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferReflect = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require `Reflect` methods where applicable",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-reflect",
			},

			deprecated: {
				message: "The original intention of this rule was misguided.",
				url: "https://eslint.org/docs/latest/rules/prefer-reflect",
				deprecatedSince: "3.9.0",
				availableUntil: null,
				replacedBy: [],
			},

			schema: [
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: {
								enum: [
									"apply",
									"call",
									"delete",
									"defineProperty",
									"getOwnPropertyDescriptor",
									"getPrototypeOf",
									"setPrototypeOf",
									"isExtensible",
									"getOwnPropertyNames",
									"preventExtensions",
								],
							},
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				preferReflect:
					"Avoid using {{existing}}, instead use {{substitute}}.",
			},
		},

		create(context) {
			const existingNames = {
				apply: "Function.prototype.apply",
				call: "Function.prototype.call",
				defineProperty: "Object.defineProperty",
				getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor",
				getPrototypeOf: "Object.getPrototypeOf",
				setPrototypeOf: "Object.setPrototypeOf",
				isExtensible: "Object.isExtensible",
				getOwnPropertyNames: "Object.getOwnPropertyNames",
				preventExtensions: "Object.preventExtensions",
			};

			const reflectSubstitutes = {
				apply: "Reflect.apply",
				call: "Reflect.apply",
				defineProperty: "Reflect.defineProperty",
				getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor",
				getPrototypeOf: "Reflect.getPrototypeOf",
				setPrototypeOf: "Reflect.setPrototypeOf",
				isExtensible: "Reflect.isExtensible",
				getOwnPropertyNames: "Reflect.getOwnPropertyNames",
				preventExtensions: "Reflect.preventExtensions",
			};

			const exceptions = (context.options[0] || {}).exceptions || [];

			/**
			 * Reports the Reflect violation based on the `existing` and `substitute`
			 * @param {Object} node The node that violates the rule.
			 * @param {string} existing The existing method name that has been used.
			 * @param {string} substitute The Reflect substitute that should be used.
			 * @returns {void}
			 */
			function report(node, existing, substitute) {
				context.report({
					node,
					messageId: "preferReflect",
					data: {
						existing,
						substitute,
					},
				});
			}

			return {
				CallExpression(node) {
					const methodName = (node.callee.property || {}).name;
					const isReflectCall =
						(node.callee.object || {}).name === "Reflect";
					const hasReflectSubstitute = Object.hasOwn(
						reflectSubstitutes,
						methodName,
					);
					const userConfiguredException = exceptions.includes(methodName);

					if (
						hasReflectSubstitute &&
						!isReflectCall &&
						!userConfiguredException
					) {
						report(
							node,
							existingNames[methodName],
							reflectSubstitutes[methodName],
						);
					}
				},
				UnaryExpression(node) {
					const isDeleteOperator = node.operator === "delete";
					const targetsIdentifier = node.argument.type === "Identifier";
					const userConfiguredException = exceptions.includes("delete");

					if (
						isDeleteOperator &&
						!targetsIdentifier &&
						!userConfiguredException
					) {
						report(
							node,
							"the delete keyword",
							"Reflect.deleteProperty",
						);
					}
				},
			};
		},
	};
	return preferReflect;
}

/**
 * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals
 * @author Milos Djermanovic
 */

var preferRegexLiterals;
var hasRequiredPreferRegexLiterals;

function requirePreferRegexLiterals () {
	if (hasRequiredPreferRegexLiterals) return preferRegexLiterals;
	hasRequiredPreferRegexLiterals = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
		findVariable,
	} = /*@__PURE__*/ requireEslintUtils();
	const {
		RegExpValidator,
		visitRegExpAST,
		RegExpParser,
	} = requireRegexpp();
	const { canTokensBeAdjacent } = requireAstUtils();
	const { REGEXPP_LATEST_ECMA_VERSION } = requireRegularExpressions();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines whether the given node is a string literal.
	 * @param {ASTNode} node Node to check.
	 * @returns {boolean} True if the node is a string literal.
	 */
	function isStringLiteral(node) {
		return node.type === "Literal" && typeof node.value === "string";
	}

	/**
	 * Determines whether the given node is a regex literal.
	 * @param {ASTNode} node Node to check.
	 * @returns {boolean} True if the node is a regex literal.
	 */
	function isRegexLiteral(node) {
		return node.type === "Literal" && Object.hasOwn(node, "regex");
	}

	const validPrecedingTokens = new Set([
		"(",
		";",
		"[",
		",",
		"=",
		"+",
		"*",
		"-",
		"?",
		"~",
		"%",
		"**",
		"!",
		"typeof",
		"instanceof",
		"&&",
		"||",
		"??",
		"return",
		"...",
		"delete",
		"void",
		"in",
		"<",
		">",
		"<=",
		">=",
		"==",
		"===",
		"!=",
		"!==",
		"<<",
		">>",
		">>>",
		"&",
		"|",
		"^",
		":",
		"{",
		"=>",
		"*=",
		"<<=",
		">>=",
		">>>=",
		"^=",
		"|=",
		"&=",
		"??=",
		"||=",
		"&&=",
		"**=",
		"+=",
		"-=",
		"/=",
		"%=",
		"/",
		"do",
		"break",
		"continue",
		"debugger",
		"case",
		"throw",
	]);

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferRegexLiterals = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					disallowRedundantWrapping: false,
				},
			],

			docs: {
				description:
					"Disallow use of the `RegExp` constructor in favor of regular expression literals",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-regex-literals",
			},

			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						disallowRedundantWrapping: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedRegExp:
					"Use a regular expression literal instead of the 'RegExp' constructor.",
				replaceWithLiteral:
					"Replace with an equivalent regular expression literal.",
				replaceWithLiteralAndFlags:
					"Replace with an equivalent regular expression literal with flags '{{ flags }}'.",
				replaceWithIntendedLiteralAndFlags:
					"Replace with a regular expression literal with flags '{{ flags }}'.",
				unexpectedRedundantRegExp:
					"Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
				unexpectedRedundantRegExpWithFlags:
					"Use regular expression literal with flags instead of the 'RegExp' constructor.",
			},
		},

		create(context) {
			const [{ disallowRedundantWrapping }] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether the given identifier node is a reference to a global variable.
			 * @param {ASTNode} node `Identifier` node to check.
			 * @returns {boolean} True if the identifier is a reference to a global variable.
			 */
			function isGlobalReference(node) {
				const scope = sourceCode.getScope(node);
				const variable = findVariable(scope, node);

				return (
					variable !== null &&
					variable.scope.type === "global" &&
					variable.defs.length === 0
				);
			}

			/**
			 * Determines whether the given node is a String.raw`` tagged template expression
			 * with a static template literal.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if the node is String.raw`` with a static template.
			 */
			function isStringRawTaggedStaticTemplateLiteral(node) {
				return (
					node.type === "TaggedTemplateExpression" &&
					astUtils.isSpecificMemberAccess(node.tag, "String", "raw") &&
					isGlobalReference(
						astUtils.skipChainExpression(node.tag).object,
					) &&
					astUtils.isStaticTemplateLiteral(node.quasi)
				);
			}

			/**
			 * Gets the value of a string
			 * @param {ASTNode} node The node to get the string of.
			 * @returns {string|null} The value of the node.
			 */
			function getStringValue(node) {
				if (isStringLiteral(node)) {
					return node.value;
				}

				if (astUtils.isStaticTemplateLiteral(node)) {
					return node.quasis[0].value.cooked;
				}

				if (isStringRawTaggedStaticTemplateLiteral(node)) {
					return node.quasi.quasis[0].value.raw;
				}

				return null;
			}

			/**
			 * Determines whether the given node is considered to be a static string by the logic of this rule.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if the node is a static string.
			 */
			function isStaticString(node) {
				return (
					isStringLiteral(node) ||
					astUtils.isStaticTemplateLiteral(node) ||
					isStringRawTaggedStaticTemplateLiteral(node)
				);
			}

			/**
			 * Determines whether the relevant arguments of the given are all static string literals.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if all arguments are static strings.
			 */
			function hasOnlyStaticStringArguments(node) {
				const args = node.arguments;

				if (
					(args.length === 1 || args.length === 2) &&
					args.every(isStaticString)
				) {
					return true;
				}

				return false;
			}

			/**
			 * Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped.
			 * @param {ASTNode} node Node to check.
			 * @returns {boolean} True if the node already contains a regex literal argument.
			 */
			function isUnnecessarilyWrappedRegexLiteral(node) {
				const args = node.arguments;

				if (args.length === 1 && isRegexLiteral(args[0])) {
					return true;
				}

				if (
					args.length === 2 &&
					isRegexLiteral(args[0]) &&
					isStaticString(args[1])
				) {
					return true;
				}

				return false;
			}

			/**
			 * Returns a ecmaVersion compatible for regexpp.
			 * @param {number} ecmaVersion The ecmaVersion to convert.
			 * @returns {import("@eslint-community/regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp.
			 */
			function getRegexppEcmaVersion(ecmaVersion) {
				if (ecmaVersion <= 5) {
					return 5;
				}
				return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION);
			}

			const regexppEcmaVersion = getRegexppEcmaVersion(
				context.languageOptions.ecmaVersion,
			);

			/**
			 * Makes a character escaped or else returns null.
			 * @param {string} character The character to escape.
			 * @returns {string} The resulting escaped character.
			 */
			function resolveEscapes(character) {
				switch (character) {
					case "\n":
					case "\\\n":
						return "\\n";

					case "\r":
					case "\\\r":
						return "\\r";

					case "\t":
					case "\\\t":
						return "\\t";

					case "\v":
					case "\\\v":
						return "\\v";

					case "\f":
					case "\\\f":
						return "\\f";

					case "/":
						return "\\/";

					default:
						return null;
				}
			}

			/**
			 * Checks whether the given regex and flags are valid for the ecma version or not.
			 * @param {string} pattern The regex pattern to check.
			 * @param {string | undefined} flags The regex flags to check.
			 * @returns {boolean} True if the given regex pattern and flags are valid for the ecma version.
			 */
			function isValidRegexForEcmaVersion(pattern, flags) {
				const validator = new RegExpValidator({
					ecmaVersion: regexppEcmaVersion,
				});

				try {
					validator.validatePattern(pattern, 0, pattern.length, {
						unicode: flags ? flags.includes("u") : false,
						unicodeSets: flags ? flags.includes("v") : false,
					});
					if (flags) {
						validator.validateFlags(flags);
					}
					return true;
				} catch {
					return false;
				}
			}

			/**
			 * Checks whether two given regex flags contain the same flags or not.
			 * @param {string} flagsA The regex flags.
			 * @param {string} flagsB The regex flags.
			 * @returns {boolean} True if two regex flags contain same flags.
			 */
			function areFlagsEqual(flagsA, flagsB) {
				return [...flagsA].sort().join("") === [...flagsB].sort().join("");
			}

			/**
			 * Merges two regex flags.
			 * @param {string} flagsA The regex flags.
			 * @param {string} flagsB The regex flags.
			 * @returns {string} The merged regex flags.
			 */
			function mergeRegexFlags(flagsA, flagsB) {
				const flagsSet = new Set([...flagsA, ...flagsB]);

				return [...flagsSet].join("");
			}

			/**
			 * Checks whether a give node can be fixed to the given regex pattern and flags.
			 * @param {ASTNode} node The node to check.
			 * @param {string} pattern The regex pattern to check.
			 * @param {string} flags The regex flags
			 * @returns {boolean} True if a node can be fixed to the given regex pattern and flags.
			 */
			function canFixTo(node, pattern, flags) {
				const tokenBefore = sourceCode.getTokenBefore(node);

				return (
					sourceCode.getCommentsInside(node).length === 0 &&
					(!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) &&
					isValidRegexForEcmaVersion(pattern, flags)
				);
			}

			/**
			 * Returns a safe output code considering the before and after tokens.
			 * @param {ASTNode} node The regex node.
			 * @param {string} newRegExpValue The new regex expression value.
			 * @returns {string} The output code.
			 */
			function getSafeOutput(node, newRegExpValue) {
				const tokenBefore = sourceCode.getTokenBefore(node);
				const tokenAfter = sourceCode.getTokenAfter(node);

				return (
					(tokenBefore &&
					!canTokensBeAdjacent(tokenBefore, newRegExpValue) &&
					tokenBefore.range[1] === node.range[0]
						? " "
						: "") +
					newRegExpValue +
					(tokenAfter &&
					!canTokensBeAdjacent(newRegExpValue, tokenAfter) &&
					node.range[1] === tokenAfter.range[0]
						? " "
						: "")
				);
			}

			return {
				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const traceMap = {
						RegExp: {
							[CALL]: true,
							[CONSTRUCT]: true,
						},
					};

					for (const { node: refNode } of tracker.iterateGlobalReferences(
						traceMap,
					)) {
						if (
							disallowRedundantWrapping &&
							isUnnecessarilyWrappedRegexLiteral(refNode)
						) {
							const regexNode = refNode.arguments[0];

							if (refNode.arguments.length === 2) {
								const suggests = [];

								const argFlags =
									getStringValue(refNode.arguments[1]) || "";

								if (
									canFixTo(
										refNode,
										regexNode.regex.pattern,
										argFlags,
									)
								) {
									suggests.push({
										messageId: "replaceWithLiteralAndFlags",
										pattern: regexNode.regex.pattern,
										flags: argFlags,
									});
								}

								const literalFlags = regexNode.regex.flags || "";
								const mergedFlags = mergeRegexFlags(
									literalFlags,
									argFlags,
								);

								if (
									!areFlagsEqual(mergedFlags, argFlags) &&
									canFixTo(
										refNode,
										regexNode.regex.pattern,
										mergedFlags,
									)
								) {
									suggests.push({
										messageId:
											"replaceWithIntendedLiteralAndFlags",
										pattern: regexNode.regex.pattern,
										flags: mergedFlags,
									});
								}

								context.report({
									node: refNode,
									messageId: "unexpectedRedundantRegExpWithFlags",
									suggest: suggests.map(
										({ flags, pattern, messageId }) => ({
											messageId,
											data: {
												flags,
											},
											fix(fixer) {
												return fixer.replaceText(
													refNode,
													getSafeOutput(
														refNode,
														`/${pattern}/${flags}`,
													),
												);
											},
										}),
									),
								});
							} else {
								const outputs = [];

								if (
									canFixTo(
										refNode,
										regexNode.regex.pattern,
										regexNode.regex.flags,
									)
								) {
									outputs.push(sourceCode.getText(regexNode));
								}

								context.report({
									node: refNode,
									messageId: "unexpectedRedundantRegExp",
									suggest: outputs.map(output => ({
										messageId: "replaceWithLiteral",
										fix(fixer) {
											return fixer.replaceText(
												refNode,
												getSafeOutput(refNode, output),
											);
										},
									})),
								});
							}
						} else if (hasOnlyStaticStringArguments(refNode)) {
							let regexContent = getStringValue(refNode.arguments[0]);
							let noFix = false;
							let flags;

							if (refNode.arguments[1]) {
								flags = getStringValue(refNode.arguments[1]);
							}

							if (!canFixTo(refNode, regexContent, flags)) {
								noFix = true;
							}

							if (
								!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.><?,'"|:;]*$/u.test(
									regexContent,
								)
							) {
								noFix = true;
							}

							if (regexContent && !noFix) {
								let charIncrease = 0;

								const ast = new RegExpParser({
									ecmaVersion: regexppEcmaVersion,
								}).parsePattern(
									regexContent,
									0,
									regexContent.length,
									{
										unicode: flags
											? flags.includes("u")
											: false,
										unicodeSets: flags
											? flags.includes("v")
											: false,
									},
								);

								visitRegExpAST(ast, {
									onCharacterEnter(characterNode) {
										const escaped = resolveEscapes(
											characterNode.raw,
										);

										if (escaped) {
											regexContent =
												regexContent.slice(
													0,
													characterNode.start +
														charIncrease,
												) +
												escaped +
												regexContent.slice(
													characterNode.end +
														charIncrease,
												);

											if (characterNode.raw.length === 1) {
												charIncrease += 1;
											}
										}
									},
								});
							}

							const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`;

							context.report({
								node: refNode,
								messageId: "unexpectedRegExp",
								suggest: noFix
									? []
									: [
											{
												messageId: "replaceWithLiteral",
												fix(fixer) {
													return fixer.replaceText(
														refNode,
														getSafeOutput(
															refNode,
															newRegExpValue,
														),
													);
												},
											},
										],
							});
						}
					}
				},
			};
		},
	};
	return preferRegexLiterals;
}

/**
 * @fileoverview Rule to
 * @author Toru Nagashima
 */

var preferRestParams;
var hasRequiredPreferRestParams;

function requirePreferRestParams () {
	if (hasRequiredPreferRestParams) return preferRestParams;
	hasRequiredPreferRestParams = 1;

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Gets the variable object of `arguments` which is defined implicitly.
	 * @param {eslint-scope.Scope} scope A scope to get.
	 * @returns {eslint-scope.Variable} The found variable object.
	 */
	function getVariableOfArguments(scope) {
		const variables = scope.variables;

		for (let i = 0; i < variables.length; ++i) {
			const variable = variables[i];

			if (variable.name === "arguments") {
				/*
				 * If there was a parameter which is named "arguments", the implicit "arguments" is not defined.
				 * So does fast return with null.
				 */
				return variable.identifiers.length === 0 ? variable : null;
			}
		}

		/* c8 ignore next */
		return null;
	}

	/**
	 * Checks if the given reference is not normal member access.
	 *
	 * - arguments         .... true    // not member access
	 * - arguments[i]      .... true    // computed member access
	 * - arguments[0]      .... true    // computed member access
	 * - arguments.length  .... false   // normal member access
	 * @param {eslint-scope.Reference} reference The reference to check.
	 * @returns {boolean} `true` if the reference is not normal member access.
	 */
	function isNotNormalMemberAccess(reference) {
		const id = reference.identifier;
		const parent = id.parent;

		return !(
			parent.type === "MemberExpression" &&
			parent.object === id &&
			!parent.computed
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferRestParams = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require rest parameters instead of `arguments`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/prefer-rest-params",
			},

			schema: [],

			messages: {
				preferRestParams: "Use the rest parameters instead of 'arguments'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Reports a given reference.
			 * @param {eslint-scope.Reference} reference A reference to report.
			 * @returns {void}
			 */
			function report(reference) {
				context.report({
					node: reference.identifier,
					loc: reference.identifier.loc,
					messageId: "preferRestParams",
				});
			}

			/**
			 * Reports references of the implicit `arguments` variable if exist.
			 * @param {ASTNode} node The node representing the function.
			 * @returns {void}
			 */
			function checkForArguments(node) {
				const argumentsVar = getVariableOfArguments(
					sourceCode.getScope(node),
				);

				if (argumentsVar) {
					argumentsVar.references
						.filter(isNotNormalMemberAccess)
						.forEach(report);
				}
			}

			return {
				"FunctionDeclaration:exit": checkForArguments,
				"FunctionExpression:exit": checkForArguments,
			};
		},
	};
	return preferRestParams;
}

/**
 * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`.
 * @author Toru Nagashima
 */

var preferSpread;
var hasRequiredPreferSpread;

function requirePreferSpread () {
	if (hasRequiredPreferSpread) return preferSpread;
	hasRequiredPreferSpread = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a node is a `.apply()` for variadic.
	 * @param {ASTNode} node A CallExpression node to check.
	 * @returns {boolean} Whether or not the node is a `.apply()` for variadic.
	 */
	function isVariadicApplyCalling(node) {
		return (
			astUtils.isSpecificMemberAccess(node.callee, null, "apply") &&
			node.arguments.length === 2 &&
			node.arguments[1].type !== "ArrayExpression" &&
			node.arguments[1].type !== "SpreadElement"
		);
	}

	/**
	 * Checks whether or not `thisArg` is not changed by `.apply()`.
	 * @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
	 * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`.
	 * @param {RuleContext} context The ESLint rule context object.
	 * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`.
	 */
	function isValidThisArg(expectedThis, thisArg, context) {
		if (!expectedThis) {
			return astUtils.isNullOrUndefined(thisArg);
		}
		return astUtils.equalTokens(expectedThis, thisArg, context);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferSpread = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require spread operators instead of `.apply()`",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-spread",
			},

			schema: [],
			fixable: null,

			messages: {
				preferSpread: "Use the spread operator instead of '.apply()'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				CallExpression(node) {
					if (!isVariadicApplyCalling(node)) {
						return;
					}

					const applied = astUtils.skipChainExpression(
						astUtils.skipChainExpression(node.callee).object,
					);
					const expectedThis =
						applied.type === "MemberExpression" ? applied.object : null;
					const thisArg = node.arguments[0];

					if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
						context.report({
							node,
							messageId: "preferSpread",
						});
					}
				},
			};
		},
	};
	return preferSpread;
}

/**
 * @fileoverview A rule to suggest using template literals instead of string concatenation.
 * @author Toru Nagashima
 */

var preferTemplate;
var hasRequiredPreferTemplate;

function requirePreferTemplate () {
	if (hasRequiredPreferTemplate) return preferTemplate;
	hasRequiredPreferTemplate = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether or not a given node is a concatenation.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a concatenation.
	 */
	function isConcatenation(node) {
		return node.type === "BinaryExpression" && node.operator === "+";
	}

	/**
	 * Gets the top binary expression node for concatenation in parents of a given node.
	 * @param {ASTNode} node A node to get.
	 * @returns {ASTNode} the top binary expression node in parents of a given node.
	 */
	function getTopConcatBinaryExpression(node) {
		let currentNode = node;

		while (isConcatenation(currentNode.parent)) {
			currentNode = currentNode.parent;
		}
		return currentNode;
	}

	/**
	 * Checks whether or not a node contains a string literal with an octal or non-octal decimal escape sequence
	 * @param {ASTNode} node A node to check
	 * @returns {boolean} `true` if at least one string literal within the node contains
	 * an octal or non-octal decimal escape sequence
	 */
	function hasOctalOrNonOctalDecimalEscapeSequence(node) {
		if (isConcatenation(node)) {
			return (
				hasOctalOrNonOctalDecimalEscapeSequence(node.left) ||
				hasOctalOrNonOctalDecimalEscapeSequence(node.right)
			);
		}

		// No need to check TemplateLiterals – would throw parsing error
		if (node.type === "Literal" && typeof node.value === "string") {
			return astUtils.hasOctalOrNonOctalDecimalEscapeSequence(node.raw);
		}

		return false;
	}

	/**
	 * Checks whether or not a given binary expression has string literals.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node has string literals.
	 */
	function hasStringLiteral(node) {
		if (isConcatenation(node)) {
			// `left` is deeper than `right` normally.
			return hasStringLiteral(node.right) || hasStringLiteral(node.left);
		}
		return astUtils.isStringLiteral(node);
	}

	/**
	 * Checks whether or not a given binary expression has non string literals.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node has non string literals.
	 */
	function hasNonStringLiteral(node) {
		if (isConcatenation(node)) {
			// `left` is deeper than `right` normally.
			return (
				hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left)
			);
		}
		return !astUtils.isStringLiteral(node);
	}

	/**
	 * Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal.
	 * @param {ASTNode} node The node that will be fixed to a template literal
	 * @returns {boolean} `true` if the node will start with a template curly.
	 */
	function startsWithTemplateCurly(node) {
		if (node.type === "BinaryExpression") {
			return startsWithTemplateCurly(node.left);
		}
		if (node.type === "TemplateLiteral") {
			return (
				node.expressions.length &&
				node.quasis.length &&
				node.quasis[0].range[0] === node.quasis[0].range[1]
			);
		}
		return node.type !== "Literal" || typeof node.value !== "string";
	}

	/**
	 * Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal.
	 * @param {ASTNode} node The node that will be fixed to a template literal
	 * @returns {boolean} `true` if the node will end with a template curly.
	 */
	function endsWithTemplateCurly(node) {
		if (node.type === "BinaryExpression") {
			return startsWithTemplateCurly(node.right);
		}
		if (node.type === "TemplateLiteral") {
			return (
				node.expressions.length &&
				node.quasis.length &&
				node.quasis.at(-1).range[0] === node.quasis.at(-1).range[1]
			);
		}
		return node.type !== "Literal" || typeof node.value !== "string";
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	preferTemplate = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require template literals instead of string concatenation",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/prefer-template",
			},

			schema: [],
			fixable: "code",

			messages: {
				unexpectedStringConcatenation: "Unexpected string concatenation.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let done = Object.create(null);

			/**
			 * Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens.
			 * @param {ASTNode} node1 The first node
			 * @param {ASTNode} node2 The second node
			 * @returns {string} The text between the nodes, excluding other tokens
			 */
			function getTextBetween(node1, node2) {
				const allTokens = [node1]
					.concat(sourceCode.getTokensBetween(node1, node2))
					.concat(node2);
				const sourceText = sourceCode.getText();

				return allTokens
					.slice(0, -1)
					.reduce(
						(accumulator, token, index) =>
							accumulator +
							sourceText.slice(
								token.range[1],
								allTokens[index + 1].range[0],
							),
						"",
					);
			}

			/**
			 * Returns a template literal form of the given node.
			 * @param {ASTNode} currentNode A node that should be converted to a template literal
			 * @param {string} textBeforeNode Text that should appear before the node
			 * @param {string} textAfterNode Text that should appear after the node
			 * @returns {string} A string form of this node, represented as a template literal
			 */
			function getTemplateLiteral(
				currentNode,
				textBeforeNode,
				textAfterNode,
			) {
				if (
					currentNode.type === "Literal" &&
					typeof currentNode.value === "string"
				) {
					/*
					 * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted
					 * as a template placeholder. However, if the code already contains a backslash before the ${ or `
					 * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause
					 * an actual backslash character to appear before the dollar sign).
					 */
					return `\`${currentNode.raw
						.slice(1, -1)
						.replace(/\\*(\$\{|`)/gu, matched => {
							if (matched.lastIndexOf("\\") % 2) {
								return `\\${matched}`;
							}
							return matched;

							// Unescape any quotes that appear in the original Literal that no longer need to be escaped.
						})
						.replace(
							new RegExp(`\\\\${currentNode.raw[0]}`, "gu"),
							currentNode.raw[0],
						)}\``;
				}

				if (currentNode.type === "TemplateLiteral") {
					return sourceCode.getText(currentNode);
				}

				if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) {
					const plusSign = sourceCode.getFirstTokenBetween(
						currentNode.left,
						currentNode.right,
						token => token.value === "+",
					);
					const textBeforePlus = getTextBetween(
						currentNode.left,
						plusSign,
					);
					const textAfterPlus = getTextBetween(
						plusSign,
						currentNode.right,
					);
					const leftEndsWithCurly = endsWithTemplateCurly(
						currentNode.left,
					);
					const rightStartsWithCurly = startsWithTemplateCurly(
						currentNode.right,
					);

					if (leftEndsWithCurly) {
						// If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket.
						// `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */  }${baz}`
						return (
							getTemplateLiteral(
								currentNode.left,
								textBeforeNode,
								textBeforePlus + textAfterPlus,
							).slice(0, -1) +
							getTemplateLiteral(
								currentNode.right,
								null,
								textAfterNode,
							).slice(1)
						);
					}
					if (rightStartsWithCurly) {
						// Otherwise, if the right side of the expression starts with a template curly, add the text there.
						// 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */  bar}baz`
						return (
							getTemplateLiteral(
								currentNode.left,
								textBeforeNode,
								null,
							).slice(0, -1) +
							getTemplateLiteral(
								currentNode.right,
								textBeforePlus + textAfterPlus,
								textAfterNode,
							).slice(1)
						);
					}

					/*
					 * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put
					 * the text between them.
					 */
					return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`;
				}

				return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``;
			}

			/**
			 * Returns a fixer object that converts a non-string binary expression to a template literal
			 * @param {SourceCodeFixer} fixer The fixer object
			 * @param {ASTNode} node A node that should be converted to a template literal
			 * @returns {Object} A fix for this binary expression
			 */
			function fixNonStringBinaryExpression(fixer, node) {
				const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

				if (hasOctalOrNonOctalDecimalEscapeSequence(topBinaryExpr)) {
					return null;
				}

				return fixer.replaceText(
					topBinaryExpr,
					getTemplateLiteral(topBinaryExpr, null, null),
				);
			}

			/**
			 * Reports if a given node is string concatenation with non string literals.
			 * @param {ASTNode} node A node to check.
			 * @returns {void}
			 */
			function checkForStringConcat(node) {
				if (
					!astUtils.isStringLiteral(node) ||
					!isConcatenation(node.parent)
				) {
					return;
				}

				const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

				// Checks whether or not this node had been checked already.
				if (done[topBinaryExpr.range[0]]) {
					return;
				}
				done[topBinaryExpr.range[0]] = true;

				if (hasNonStringLiteral(topBinaryExpr)) {
					context.report({
						node: topBinaryExpr,
						messageId: "unexpectedStringConcatenation",
						fix: fixer => fixNonStringBinaryExpression(fixer, node),
					});
				}
			}

			return {
				Program() {
					done = Object.create(null);
				},

				Literal: checkForStringConcat,
				TemplateLiteral: checkForStringConcat,
			};
		},
	};
	return preferTemplate;
}

/**
 * @fileoverview Rule to flag non-quoted property names in object literals.
 * @author Mathias Bynens <http://mathiasbynens.be/>
 * @deprecated in ESLint v8.53.0
 */

var quoteProps;
var hasRequiredQuoteProps;

function requireQuoteProps () {
	if (hasRequiredQuoteProps) return quoteProps;
	hasRequiredQuoteProps = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const espree = requireEspree();
	const astUtils = requireAstUtils();
	const keywords = requireKeywords();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	quoteProps = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "quote-props",
							url: "https://eslint.style/rules/js/quote-props",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description: "Require quotes around object literal property names",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/quote-props",
			},

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: [
									"always",
									"as-needed",
									"consistent",
									"consistent-as-needed",
								],
							},
						],
						minItems: 0,
						maxItems: 1,
					},
					{
						type: "array",
						items: [
							{
								enum: [
									"always",
									"as-needed",
									"consistent",
									"consistent-as-needed",
								],
							},
							{
								type: "object",
								properties: {
									keywords: {
										type: "boolean",
									},
									unnecessary: {
										type: "boolean",
									},
									numbers: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			fixable: "code",
			messages: {
				requireQuotesDueToReservedWord:
					"Properties should be quoted as '{{property}}' is a reserved word.",
				inconsistentlyQuotedProperty:
					"Inconsistently quoted property '{{key}}' found.",
				unnecessarilyQuotedProperty:
					"Unnecessarily quoted property '{{property}}' found.",
				unquotedReservedProperty:
					"Unquoted reserved word '{{property}}' used as key.",
				unquotedNumericProperty:
					"Unquoted number literal '{{property}}' used as key.",
				unquotedPropertyFound: "Unquoted property '{{property}}' found.",
				redundantQuoting:
					"Properties shouldn't be quoted as all quotes are redundant.",
			},
		},

		create(context) {
			const MODE = context.options[0],
				KEYWORDS = context.options[1] && context.options[1].keywords,
				CHECK_UNNECESSARY =
					!context.options[1] || context.options[1].unnecessary !== false,
				NUMBERS = context.options[1] && context.options[1].numbers,
				sourceCode = context.sourceCode;

			/**
			 * Checks whether a certain string constitutes an ES3 token
			 * @param {string} tokenStr The string to be checked.
			 * @returns {boolean} `true` if it is an ES3 token.
			 */
			function isKeyword(tokenStr) {
				return keywords.includes(tokenStr);
			}

			/**
			 * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary)
			 * @param {string} rawKey The raw key value from the source
			 * @param {espreeTokens} tokens The espree-tokenized node key
			 * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked
			 * @returns {boolean} Whether or not a key has redundant quotes.
			 * @private
			 */
			function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) {
				return (
					tokens.length === 1 &&
					tokens[0].start === 0 &&
					tokens[0].end === rawKey.length &&
					(["Identifier", "Keyword", "Null", "Boolean"].includes(
						tokens[0].type,
					) ||
						(tokens[0].type === "Numeric" &&
							!skipNumberLiterals &&
							String(+tokens[0].value) === tokens[0].value))
				);
			}

			/**
			 * Returns a string representation of a property node with quotes removed
			 * @param {ASTNode} key Key AST Node, which may or may not be quoted
			 * @returns {string} A replacement string for this property
			 */
			function getUnquotedKey(key) {
				return key.type === "Identifier" ? key.name : key.value;
			}

			/**
			 * Returns a string representation of a property node with quotes added
			 * @param {ASTNode} key Key AST Node, which may or may not be quoted
			 * @returns {string} A replacement string for this property
			 */
			function getQuotedKey(key) {
				if (key.type === "Literal" && typeof key.value === "string") {
					// If the key is already a string literal, don't replace the quotes with double quotes.
					return sourceCode.getText(key);
				}

				// Otherwise, the key is either an identifier or a number literal.
				return `"${key.type === "Identifier" ? key.name : key.value}"`;
			}

			/**
			 * Ensures that a property's key is quoted only when necessary
			 * @param {ASTNode} node Property AST node
			 * @returns {void}
			 */
			function checkUnnecessaryQuotes(node) {
				const key = node.key;

				if (node.method || node.computed || node.shorthand) {
					return;
				}

				if (key.type === "Literal" && typeof key.value === "string") {
					let tokens;

					try {
						tokens = espree.tokenize(key.value);
					} catch {
						return;
					}

					if (tokens.length !== 1) {
						return;
					}

					const isKeywordToken = isKeyword(tokens[0].value);

					if (isKeywordToken && KEYWORDS) {
						return;
					}

					if (
						CHECK_UNNECESSARY &&
						areQuotesRedundant(key.value, tokens, NUMBERS)
					) {
						context.report({
							node,
							messageId: "unnecessarilyQuotedProperty",
							data: { property: key.value },
							fix: fixer =>
								fixer.replaceText(key, getUnquotedKey(key)),
						});
					}
				} else if (
					KEYWORDS &&
					key.type === "Identifier" &&
					isKeyword(key.name)
				) {
					context.report({
						node,
						messageId: "unquotedReservedProperty",
						data: { property: key.name },
						fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
					});
				} else if (
					NUMBERS &&
					key.type === "Literal" &&
					astUtils.isNumericLiteral(key)
				) {
					context.report({
						node,
						messageId: "unquotedNumericProperty",
						data: { property: key.value },
						fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
					});
				}
			}

			/**
			 * Ensures that a property's key is quoted
			 * @param {ASTNode} node Property AST node
			 * @returns {void}
			 */
			function checkOmittedQuotes(node) {
				const key = node.key;

				if (
					!node.method &&
					!node.computed &&
					!node.shorthand &&
					!(key.type === "Literal" && typeof key.value === "string")
				) {
					context.report({
						node,
						messageId: "unquotedPropertyFound",
						data: { property: key.name || key.value },
						fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
					});
				}
			}

			/**
			 * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes
			 * @param {ASTNode} node Property AST node
			 * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy
			 * @returns {void}
			 */
			function checkConsistency(node, checkQuotesRedundancy) {
				const quotedProps = [],
					unquotedProps = [];
				let keywordKeyName = null,
					necessaryQuotes = false;

				node.properties.forEach(property => {
					const key = property.key;

					if (
						!key ||
						property.method ||
						property.computed ||
						property.shorthand
					) {
						return;
					}

					if (key.type === "Literal" && typeof key.value === "string") {
						quotedProps.push(property);

						if (checkQuotesRedundancy) {
							let tokens;

							try {
								tokens = espree.tokenize(key.value);
							} catch {
								necessaryQuotes = true;
								return;
							}

							necessaryQuotes =
								necessaryQuotes ||
								!areQuotesRedundant(key.value, tokens) ||
								(KEYWORDS && isKeyword(tokens[0].value));
						}
					} else if (
						KEYWORDS &&
						checkQuotesRedundancy &&
						key.type === "Identifier" &&
						isKeyword(key.name)
					) {
						unquotedProps.push(property);
						necessaryQuotes = true;
						keywordKeyName = key.name;
					} else {
						unquotedProps.push(property);
					}
				});

				if (
					checkQuotesRedundancy &&
					quotedProps.length &&
					!necessaryQuotes
				) {
					quotedProps.forEach(property => {
						context.report({
							node: property,
							messageId: "redundantQuoting",
							fix: fixer =>
								fixer.replaceText(
									property.key,
									getUnquotedKey(property.key),
								),
						});
					});
				} else if (unquotedProps.length && keywordKeyName) {
					unquotedProps.forEach(property => {
						context.report({
							node: property,
							messageId: "requireQuotesDueToReservedWord",
							data: { property: keywordKeyName },
							fix: fixer =>
								fixer.replaceText(
									property.key,
									getQuotedKey(property.key),
								),
						});
					});
				} else if (quotedProps.length && unquotedProps.length) {
					unquotedProps.forEach(property => {
						context.report({
							node: property,
							messageId: "inconsistentlyQuotedProperty",
							data: { key: property.key.name || property.key.value },
							fix: fixer =>
								fixer.replaceText(
									property.key,
									getQuotedKey(property.key),
								),
						});
					});
				}
			}

			return {
				Property(node) {
					if (MODE === "always" || !MODE) {
						checkOmittedQuotes(node);
					}
					if (MODE === "as-needed") {
						checkUnnecessaryQuotes(node);
					}
				},
				ObjectExpression(node) {
					if (MODE === "consistent") {
						checkConsistency(node, false);
					}
					if (MODE === "consistent-as-needed") {
						checkConsistency(node, true);
					}
				},
			};
		},
	};
	return quoteProps;
}

/**
 * @fileoverview A rule to choose between single and double quote marks
 * @author Matt DuVall <http://www.mattduvall.com/>, Brandon Payton
 * @deprecated in ESLint v8.53.0
 */

var quotes;
var hasRequiredQuotes;

function requireQuotes () {
	if (hasRequiredQuotes) return quotes;
	hasRequiredQuotes = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Constants
	//------------------------------------------------------------------------------

	const QUOTE_SETTINGS = {
		double: {
			quote: '"',
			alternateQuote: "'",
			description: "doublequote",
		},
		single: {
			quote: "'",
			alternateQuote: '"',
			description: "singlequote",
		},
		backtick: {
			quote: "`",
			alternateQuote: '"',
			description: "backtick",
		},
	};

	// An unescaped newline is a newline preceded by an even number of backslashes.
	const UNESCAPED_LINEBREAK_PATTERN = new RegExp(
		String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`,
		"u",
	);

	/**
	 * Switches quoting of javascript string between ' " and `
	 * escaping and unescaping as necessary.
	 * Only escaping of the minimal set of characters is changed.
	 * Note: escaping of newlines when switching from backtick to other quotes is not handled.
	 * @param {string} str A string to convert.
	 * @returns {string} The string with changed quotes.
	 * @private
	 */
	QUOTE_SETTINGS.double.convert =
		QUOTE_SETTINGS.single.convert =
		QUOTE_SETTINGS.backtick.convert =
			function (str) {
				const newQuote = this.quote;
				const oldQuote = str[0];

				if (newQuote === oldQuote) {
					return str;
				}
				return (
					newQuote +
					str
						.slice(1, -1)
						.replace(
							/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu,
							(match, escaped, newline) => {
								if (
									escaped === oldQuote ||
									(oldQuote === "`" && escaped === "${")
								) {
									return escaped; // unescape
								}
								if (
									match === newQuote ||
									(newQuote === "`" && match === "${")
								) {
									return `\\${match}`; // escape
								}
								if (newline && oldQuote === "`") {
									return "\\n"; // escape newlines
								}
								return match;
							},
						) +
					newQuote
				);
			};

	const AVOID_ESCAPE = "avoid-escape";

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	quotes = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "quotes",
							url: "https://eslint.style/rules/js/quotes",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce the consistent use of either backticks, double, or single quotes",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/quotes",
			},

			fixable: "code",

			schema: [
				{
					enum: ["single", "double", "backtick"],
				},
				{
					anyOf: [
						{
							enum: ["avoid-escape"],
						},
						{
							type: "object",
							properties: {
								avoidEscape: {
									type: "boolean",
								},
								allowTemplateLiterals: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				wrongQuotes: "Strings must use {{description}}.",
			},
		},

		create(context) {
			const quoteOption = context.options[0],
				settings = QUOTE_SETTINGS[quoteOption || "double"],
				options = context.options[1],
				allowTemplateLiterals =
					options && options.allowTemplateLiterals === true,
				sourceCode = context.sourceCode;
			let avoidEscape = options && options.avoidEscape === true;

			// deprecated
			if (options === AVOID_ESCAPE) {
				avoidEscape = true;
			}

			/**
			 * Determines if a given node is part of JSX syntax.
			 *
			 * This function returns `true` in the following cases:
			 *
			 * - `<div className="foo"></div>` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`.
			 * - `<div>foo</div>` ... If the literal is a text content, the parent of the literal is `JSXElement`.
			 * - `<>foo</>` ... If the literal is a text content, the parent of the literal is `JSXFragment`.
			 *
			 * In particular, this function returns `false` in the following cases:
			 *
			 * - `<div className={"foo"}></div>`
			 * - `<div>{"foo"}</div>`
			 *
			 * In both cases, inside of the braces is handled as normal JavaScript.
			 * The braces are `JSXExpressionContainer` nodes.
			 * @param {ASTNode} node The Literal node to check.
			 * @returns {boolean} True if the node is a part of JSX, false if not.
			 * @private
			 */
			function isJSXLiteral(node) {
				return (
					node.parent.type === "JSXAttribute" ||
					node.parent.type === "JSXElement" ||
					node.parent.type === "JSXFragment"
				);
			}

			/**
			 * Checks whether or not a given node is a directive.
			 * The directive is a `ExpressionStatement` which has only a string literal not surrounded by
			 * parentheses.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} Whether or not the node is a directive.
			 * @private
			 */
			function isDirective(node) {
				return (
					node.type === "ExpressionStatement" &&
					node.expression.type === "Literal" &&
					typeof node.expression.value === "string" &&
					!astUtils.isParenthesised(sourceCode, node.expression)
				);
			}

			/**
			 * Checks whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue.
			 * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive}
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} Whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue.
			 * @private
			 */
			function isExpressionInOrJustAfterDirectivePrologue(node) {
				if (!astUtils.isTopLevelExpressionStatement(node.parent)) {
					return false;
				}
				const block = node.parent.parent;

				// Check the node is at a prologue.
				for (let i = 0; i < block.body.length; ++i) {
					const statement = block.body[i];

					if (statement === node.parent) {
						return true;
					}
					if (!isDirective(statement)) {
						break;
					}
				}

				return false;
			}

			/**
			 * Checks whether or not a given node is allowed as non backtick.
			 * @param {ASTNode} node A node to check.
			 * @returns {boolean} Whether or not the node is allowed as non backtick.
			 * @private
			 */
			function isAllowedAsNonBacktick(node) {
				const parent = node.parent;

				switch (parent.type) {
					// Directive Prologues.
					case "ExpressionStatement":
						return (
							!astUtils.isParenthesised(sourceCode, node) &&
							isExpressionInOrJustAfterDirectivePrologue(node)
						);

					// LiteralPropertyName.
					case "Property":
					case "PropertyDefinition":
					case "MethodDefinition":
						return parent.key === node && !parent.computed;

					// ModuleSpecifier.
					case "ImportDeclaration":
					case "ExportNamedDeclaration":
						return parent.source === node;

					// ModuleExportName or ModuleSpecifier.
					case "ExportAllDeclaration":
						return parent.exported === node || parent.source === node;

					// ModuleExportName.
					case "ImportSpecifier":
						return parent.imported === node;

					// ModuleExportName.
					case "ExportSpecifier":
						return parent.local === node || parent.exported === node;

					// Others don't allow.
					default:
						return false;
				}
			}

			/**
			 * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings.
			 * @param {ASTNode} node A TemplateLiteral node to check.
			 * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings.
			 * @private
			 */
			function isUsingFeatureOfTemplateLiteral(node) {
				const hasTag =
					node.parent.type === "TaggedTemplateExpression" &&
					node === node.parent.quasi;

				if (hasTag) {
					return true;
				}

				const hasStringInterpolation = node.expressions.length > 0;

				if (hasStringInterpolation) {
					return true;
				}

				const isMultilineString =
					node.quasis.length >= 1 &&
					UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw);

				if (isMultilineString) {
					return true;
				}

				return false;
			}

			return {
				Literal(node) {
					const val = node.value,
						rawVal = node.raw;

					if (settings && typeof val === "string") {
						let isValid =
							(quoteOption === "backtick" &&
								isAllowedAsNonBacktick(node)) ||
							isJSXLiteral(node) ||
							astUtils.isSurroundedBy(rawVal, settings.quote);

						if (!isValid && avoidEscape) {
							isValid =
								astUtils.isSurroundedBy(
									rawVal,
									settings.alternateQuote,
								) && rawVal.includes(settings.quote);
						}

						if (!isValid) {
							context.report({
								node,
								messageId: "wrongQuotes",
								data: {
									description: settings.description,
								},
								fix(fixer) {
									if (
										quoteOption === "backtick" &&
										astUtils.hasOctalOrNonOctalDecimalEscapeSequence(
											rawVal,
										)
									) {
										/*
										 * An octal or non-octal decimal escape sequence in a template literal would
										 * produce syntax error, even in non-strict mode.
										 */
										return null;
									}

									return fixer.replaceText(
										node,
										settings.convert(node.raw),
									);
								},
							});
						}
					}
				},

				TemplateLiteral(node) {
					// Don't throw an error if backticks are expected or a template literal feature is in use.
					if (
						allowTemplateLiterals ||
						quoteOption === "backtick" ||
						isUsingFeatureOfTemplateLiteral(node)
					) {
						return;
					}

					context.report({
						node,
						messageId: "wrongQuotes",
						data: {
							description: settings.description,
						},
						fix(fixer) {
							if (
								astUtils.isTopLevelExpressionStatement(
									node.parent,
								) &&
								!astUtils.isParenthesised(sourceCode, node)
							) {
								/*
								 * TemplateLiterals aren't actually directives, but fixing them might turn
								 * them into directives and change the behavior of the code.
								 */
								return null;
							}
							return fixer.replaceText(
								node,
								settings.convert(sourceCode.getText(node)),
							);
						},
					});
				},
			};
		},
	};
	return quotes;
}

/**
 * @fileoverview Rule to flag use of parseInt without a radix argument
 * @author James Allardice
 */

var radix;
var hasRequiredRadix;

function requireRadix () {
	if (hasRequiredRadix) return radix;
	hasRequiredRadix = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const MODE_ALWAYS = "always",
		MODE_AS_NEEDED = "as-needed";

	const validRadixValues = new Set(
		Array.from({ length: 37 - 2 }, (_, index) => index + 2),
	);

	/**
	 * Checks whether a given variable is shadowed or not.
	 * @param {eslint-scope.Variable} variable A variable to check.
	 * @returns {boolean} `true` if the variable is shadowed.
	 */
	function isShadowed(variable) {
		return variable.defs.length >= 1;
	}

	/**
	 * Checks whether a given node is a MemberExpression of `parseInt` method or not.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a MemberExpression of `parseInt`
	 *      method.
	 */
	function isParseIntMethod(node) {
		return (
			node.type === "MemberExpression" &&
			!node.computed &&
			node.property.type === "Identifier" &&
			node.property.name === "parseInt"
		);
	}

	/**
	 * Checks whether a given node is a valid value of radix or not.
	 *
	 * The following values are invalid.
	 *
	 * - A literal except integers between 2 and 36.
	 * - undefined.
	 * @param {ASTNode} radix A node of radix to check.
	 * @returns {boolean} `true` if the node is valid.
	 */
	function isValidRadix(radix) {
		return !(
			(radix.type === "Literal" && !validRadixValues.has(radix.value)) ||
			(radix.type === "Identifier" && radix.name === "undefined")
		);
	}

	/**
	 * Checks whether a given node is a default value of radix or not.
	 * @param {ASTNode} radix A node of radix to check.
	 * @returns {boolean} `true` if the node is the literal node of `10`.
	 */
	function isDefaultRadix(radix) {
		return radix.type === "Literal" && radix.value === 10;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	radix = {
		meta: {
			type: "suggestion",

			defaultOptions: [MODE_ALWAYS],

			docs: {
				description:
					"Enforce the consistent use of the radix argument when using `parseInt()`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/radix",
			},

			hasSuggestions: true,

			schema: [
				{
					enum: ["always", "as-needed"],
				},
			],

			messages: {
				missingParameters: "Missing parameters.",
				redundantRadix: "Redundant radix parameter.",
				missingRadix: "Missing radix parameter.",
				invalidRadix:
					"Invalid radix parameter, must be an integer between 2 and 36.",
				addRadixParameter10:
					"Add radix parameter `10` for parsing decimal numbers.",
			},
		},

		create(context) {
			const [mode] = context.options;
			const sourceCode = context.sourceCode;

			/**
			 * Checks the arguments of a given CallExpression node and reports it if it
			 * offends this rule.
			 * @param {ASTNode} node A CallExpression node to check.
			 * @returns {void}
			 */
			function checkArguments(node) {
				const args = node.arguments;

				switch (args.length) {
					case 0:
						context.report({
							node,
							messageId: "missingParameters",
						});
						break;

					case 1:
						if (mode === MODE_ALWAYS) {
							context.report({
								node,
								messageId: "missingRadix",
								suggest: [
									{
										messageId: "addRadixParameter10",
										fix(fixer) {
											const tokens =
												sourceCode.getTokens(node);
											const lastToken = tokens.at(-1); // Parenthesis.
											const secondToLastToken = tokens.at(-2); // May or may not be a comma.
											const hasTrailingComma =
												secondToLastToken.type ===
													"Punctuator" &&
												secondToLastToken.value === ",";

											return fixer.insertTextBefore(
												lastToken,
												hasTrailingComma ? " 10," : ", 10",
											);
										},
									},
								],
							});
						}
						break;

					default:
						if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) {
							context.report({
								node,
								messageId: "redundantRadix",
							});
						} else if (!isValidRadix(args[1])) {
							context.report({
								node,
								messageId: "invalidRadix",
							});
						}
						break;
				}
			}

			return {
				"Program:exit"(node) {
					const scope = sourceCode.getScope(node);
					let variable;

					// Check `parseInt()`
					variable = astUtils.getVariableByName(scope, "parseInt");
					if (variable && !isShadowed(variable)) {
						variable.references.forEach(reference => {
							const idNode = reference.identifier;

							if (astUtils.isCallee(idNode)) {
								checkArguments(idNode.parent);
							}
						});
					}

					// Check `Number.parseInt()`
					variable = astUtils.getVariableByName(scope, "Number");
					if (variable && !isShadowed(variable)) {
						variable.references.forEach(reference => {
							const parentNode = reference.identifier.parent;
							const maybeCallee =
								parentNode.parent.type === "ChainExpression"
									? parentNode.parent
									: parentNode;

							if (
								isParseIntMethod(parentNode) &&
								astUtils.isCallee(maybeCallee)
							) {
								checkArguments(maybeCallee.parent);
							}
						});
					}
				},
			};
		},
	};
	return radix;
}

/**
 * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield`
 * @author Teddy Katz
 * @author Toru Nagashima
 */

var requireAtomicUpdates;
var hasRequiredRequireAtomicUpdates;

function requireRequireAtomicUpdates () {
	if (hasRequiredRequireAtomicUpdates) return requireAtomicUpdates;
	hasRequiredRequireAtomicUpdates = 1;

	/**
	 * Make the map from identifiers to each reference.
	 * @param {escope.Scope} scope The scope to get references.
	 * @param {Map<Identifier, escope.Reference>} [outReferenceMap] The map from identifier nodes to each reference object.
	 * @returns {Map<Identifier, escope.Reference>} `referenceMap`.
	 */
	function createReferenceMap(scope, outReferenceMap = new Map()) {
		for (const reference of scope.references) {
			if (reference.resolved === null) {
				continue;
			}

			outReferenceMap.set(reference.identifier, reference);
		}
		for (const childScope of scope.childScopes) {
			if (childScope.type !== "function") {
				createReferenceMap(childScope, outReferenceMap);
			}
		}

		return outReferenceMap;
	}

	/**
	 * Get `reference.writeExpr` of a given reference.
	 * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a`
	 * @param {escope.Reference} reference The reference to get.
	 * @returns {Expression|null} The `reference.writeExpr`.
	 */
	function getWriteExpr(reference) {
		if (reference.writeExpr) {
			return reference.writeExpr;
		}
		let node = reference.identifier;

		while (node) {
			const t = node.parent.type;

			if (t === "AssignmentExpression" && node.parent.left === node) {
				return node.parent.right;
			}
			if (t === "MemberExpression" && node.parent.object === node) {
				node = node.parent;
				continue;
			}

			break;
		}

		return null;
	}

	/**
	 * Checks if an expression is a variable that can only be observed within the given function.
	 * @param {Variable|null} variable The variable to check
	 * @param {boolean} isMemberAccess If `true` then this is a member access.
	 * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure.
	 */
	function isLocalVariableWithoutEscape(variable, isMemberAccess) {
		if (!variable) {
			return false; // A global variable which was not defined.
		}

		// If the reference is a property access and the variable is a parameter, it handles the variable is not local.
		if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) {
			return false;
		}

		const functionScope = variable.scope.variableScope;

		return variable.references.every(
			reference => reference.from.variableScope === functionScope,
		);
	}

	/**
	 * Represents segment information.
	 */
	class SegmentInfo {
		constructor() {
			this.info = new WeakMap();
		}

		/**
		 * Initialize the segment information.
		 * @param {PathSegment} segment The segment to initialize.
		 * @returns {void}
		 */
		initialize(segment) {
			const outdatedReadVariables = new Set();
			const freshReadVariables = new Set();

			for (const prevSegment of segment.prevSegments) {
				const info = this.info.get(prevSegment);

				if (info) {
					info.outdatedReadVariables.forEach(
						Set.prototype.add,
						outdatedReadVariables,
					);
					info.freshReadVariables.forEach(
						Set.prototype.add,
						freshReadVariables,
					);
				}
			}

			this.info.set(segment, { outdatedReadVariables, freshReadVariables });
		}

		/**
		 * Mark a given variable as read on given segments.
		 * @param {PathSegment[]} segments The segments that it read the variable on.
		 * @param {Variable} variable The variable to be read.
		 * @returns {void}
		 */
		markAsRead(segments, variable) {
			for (const segment of segments) {
				const info = this.info.get(segment);

				if (info) {
					info.freshReadVariables.add(variable);

					// If a variable is freshly read again, then it's no more out-dated.
					info.outdatedReadVariables.delete(variable);
				}
			}
		}

		/**
		 * Move `freshReadVariables` to `outdatedReadVariables`.
		 * @param {PathSegment[]} segments The segments to process.
		 * @returns {void}
		 */
		makeOutdated(segments) {
			for (const segment of segments) {
				const info = this.info.get(segment);

				if (info) {
					info.freshReadVariables.forEach(
						Set.prototype.add,
						info.outdatedReadVariables,
					);
					info.freshReadVariables.clear();
				}
			}
		}

		/**
		 * Check if a given variable is outdated on the current segments.
		 * @param {PathSegment[]} segments The current segments.
		 * @param {Variable} variable The variable to check.
		 * @returns {boolean} `true` if the variable is outdated on the segments.
		 */
		isOutdated(segments, variable) {
			for (const segment of segments) {
				const info = this.info.get(segment);

				if (info && info.outdatedReadVariables.has(variable)) {
					return true;
				}
			}
			return false;
		}
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	requireAtomicUpdates = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					allowProperties: false,
				},
			],

			docs: {
				description:
					"Disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/require-atomic-updates",
			},

			fixable: null,

			schema: [
				{
					type: "object",
					properties: {
						allowProperties: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				nonAtomicUpdate:
					"Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`.",
				nonAtomicObjectUpdate:
					"Possible race condition: `{{value}}` might be assigned based on an outdated state of `{{object}}`.",
			},
		},

		create(context) {
			const [{ allowProperties }] = context.options;

			const sourceCode = context.sourceCode;
			const assignmentReferences = new Map();
			const segmentInfo = new SegmentInfo();
			let stack = null;

			return {
				onCodePathStart(codePath, node) {
					const scope = sourceCode.getScope(node);
					const shouldVerify =
						scope.type === "function" &&
						(scope.block.async || scope.block.generator);

					stack = {
						upper: stack,
						codePath,
						referenceMap: shouldVerify
							? createReferenceMap(scope)
							: null,
						currentSegments: new Set(),
					};
				},
				onCodePathEnd() {
					stack = stack.upper;
				},

				// Initialize the segment information.
				onCodePathSegmentStart(segment) {
					segmentInfo.initialize(segment);
					stack.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentStart(segment) {
					stack.currentSegments.add(segment);
				},

				onUnreachableCodePathSegmentEnd(segment) {
					stack.currentSegments.delete(segment);
				},

				onCodePathSegmentEnd(segment) {
					stack.currentSegments.delete(segment);
				},

				// Handle references to prepare verification.
				Identifier(node) {
					const { referenceMap } = stack;
					const reference = referenceMap && referenceMap.get(node);

					// Ignore if this is not a valid variable reference.
					if (!reference) {
						return;
					}
					const variable = reference.resolved;
					const writeExpr = getWriteExpr(reference);
					const isMemberAccess =
						reference.identifier.parent.type === "MemberExpression";

					// Add a fresh read variable.
					if (
						reference.isRead() &&
						!(writeExpr && writeExpr.parent.operator === "=")
					) {
						segmentInfo.markAsRead(stack.currentSegments, variable);
					}

					/*
					 * Register the variable to verify after ESLint traversed the `writeExpr` node
					 * if this reference is an assignment to a variable which is referred from other closure.
					 */
					if (
						writeExpr &&
						writeExpr.parent.right === writeExpr && // ← exclude variable declarations.
						!isLocalVariableWithoutEscape(variable, isMemberAccess)
					) {
						let refs = assignmentReferences.get(writeExpr);

						if (!refs) {
							refs = [];
							assignmentReferences.set(writeExpr, refs);
						}

						refs.push(reference);
					}
				},

				/*
				 * Verify assignments.
				 * If the reference exists in `outdatedReadVariables` list, report it.
				 */
				":expression:exit"(node) {
					// referenceMap exists if this is in a resumable function scope.
					if (!stack.referenceMap) {
						return;
					}

					// Mark the read variables on this code path as outdated.
					if (
						node.type === "AwaitExpression" ||
						node.type === "YieldExpression"
					) {
						segmentInfo.makeOutdated(stack.currentSegments);
					}

					// Verify.
					const references = assignmentReferences.get(node);

					if (references) {
						assignmentReferences.delete(node);

						for (const reference of references) {
							const variable = reference.resolved;

							if (
								segmentInfo.isOutdated(
									stack.currentSegments,
									variable,
								)
							) {
								if (node.parent.left === reference.identifier) {
									context.report({
										node: node.parent,
										messageId: "nonAtomicUpdate",
										data: {
											value: variable.name,
										},
									});
								} else if (!allowProperties) {
									context.report({
										node: node.parent,
										messageId: "nonAtomicObjectUpdate",
										data: {
											value: sourceCode.getText(
												node.parent.left,
											),
											object: variable.name,
										},
									});
								}
							}
						}
					}
				},
			};
		},
	};
	return requireAtomicUpdates;
}

/**
 * @fileoverview Rule to disallow async functions which have no `await` expression.
 * @author Toru Nagashima
 */

var requireAwait;
var hasRequiredRequireAwait;

function requireRequireAwait () {
	if (hasRequiredRequireAwait) return requireAwait;
	hasRequiredRequireAwait = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Capitalize the 1st letter of the given text.
	 * @param {string} text The text to capitalize.
	 * @returns {string} The text that the 1st letter was capitalized.
	 */
	function capitalizeFirstLetter(text) {
		return text[0].toUpperCase() + text.slice(1);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	requireAwait = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Disallow async functions which have no `await` expression",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/require-await",
			},

			schema: [],

			messages: {
				missingAwait: "{{name}} has no 'await' expression.",
				removeAsync: "Remove 'async'.",
			},

			hasSuggestions: true,
		},

		create(context) {
			const sourceCode = context.sourceCode;
			let scopeInfo = null;

			/**
			 * Push the scope info object to the stack.
			 * @returns {void}
			 */
			function enterFunction() {
				scopeInfo = {
					upper: scopeInfo,
					hasAwait: false,
				};
			}

			/**
			 * Pop the top scope info object from the stack.
			 * Also, it reports the function if needed.
			 * @param {ASTNode} node The node to report.
			 * @returns {void}
			 */
			function exitFunction(node) {
				if (
					!node.generator &&
					node.async &&
					!scopeInfo.hasAwait &&
					!astUtils.isEmptyFunction(node)
				) {
					/*
					 * If the function belongs to a method definition or
					 * property, then the function's range may not include the
					 * `async` keyword and we should look at the parent instead.
					 */
					const nodeWithAsyncKeyword =
						(node.parent.type === "MethodDefinition" &&
							node.parent.value === node) ||
						(node.parent.type === "Property" &&
							node.parent.method &&
							node.parent.value === node)
							? node.parent
							: node;

					const asyncToken = sourceCode.getFirstToken(
						nodeWithAsyncKeyword,
						token => token.value === "async",
					);
					const asyncRange = [
						asyncToken.range[0],
						sourceCode.getTokenAfter(asyncToken, {
							includeComments: true,
						}).range[0],
					];

					/*
					 * Removing the `async` keyword can cause parsing errors if the current
					 * statement is relying on automatic semicolon insertion. If ASI is currently
					 * being used, then we should replace the `async` keyword with a semicolon.
					 */
					const nextToken = sourceCode.getTokenAfter(asyncToken);
					const addSemiColon =
						nextToken.type === "Punctuator" &&
						(nextToken.value === "[" || nextToken.value === "(") &&
						(nodeWithAsyncKeyword.type === "MethodDefinition" ||
							astUtils.isStartOfExpressionStatement(
								nodeWithAsyncKeyword,
							)) &&
						astUtils.needsPrecedingSemicolon(
							sourceCode,
							nodeWithAsyncKeyword,
						);

					context.report({
						node,
						loc: astUtils.getFunctionHeadLoc(node, sourceCode),
						messageId: "missingAwait",
						data: {
							name: capitalizeFirstLetter(
								astUtils.getFunctionNameWithKind(node),
							),
						},
						suggest: [
							{
								messageId: "removeAsync",
								fix: fixer =>
									fixer.replaceTextRange(
										asyncRange,
										addSemiColon ? ";" : "",
									),
							},
						],
					});
				}

				scopeInfo = scopeInfo.upper;
			}

			return {
				FunctionDeclaration: enterFunction,
				FunctionExpression: enterFunction,
				ArrowFunctionExpression: enterFunction,
				"FunctionDeclaration:exit": exitFunction,
				"FunctionExpression:exit": exitFunction,
				"ArrowFunctionExpression:exit": exitFunction,

				AwaitExpression() {
					if (!scopeInfo) {
						return;
					}

					scopeInfo.hasAwait = true;
				},
				ForOfStatement(node) {
					if (!scopeInfo) {
						return;
					}

					if (node.await) {
						scopeInfo.hasAwait = true;
					}
				},
			};
		},
	};
	return requireAwait;
}

/**
 * @fileoverview Rule to enforce the use of `u` or `v` flag on regular expressions.
 * @author Toru Nagashima
 */

var requireUnicodeRegexp;
var hasRequiredRequireUnicodeRegexp;

function requireRequireUnicodeRegexp () {
	if (hasRequiredRequireUnicodeRegexp) return requireUnicodeRegexp;
	hasRequiredRequireUnicodeRegexp = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const {
		CALL,
		CONSTRUCT,
		ReferenceTracker,
		getStringIfConstant,
	} = /*@__PURE__*/ requireEslintUtils();
	const astUtils = requireAstUtils();
	const { isValidWithUnicodeFlag } = requireRegularExpressions();

	/**
	 * Checks whether the flag configuration should be treated as a missing flag.
	 * @param {"u"|"v"|undefined} requireFlag A particular flag to require
	 * @param {string} flags The regex flags
	 * @returns {boolean} Whether the flag configuration results in a missing flag.
	 */
	function checkFlags(requireFlag, flags) {
		let missingFlag;

		if (requireFlag === "v") {
			missingFlag = !flags.includes("v");
		} else if (requireFlag === "u") {
			missingFlag = !flags.includes("u");
		} else {
			missingFlag = !flags.includes("u") && !flags.includes("v");
		}

		return missingFlag;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	requireUnicodeRegexp = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Enforce the use of `u` or `v` flag on regular expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/require-unicode-regexp",
			},

			hasSuggestions: true,

			messages: {
				addUFlag: "Add the 'u' flag.",
				addVFlag: "Add the 'v' flag.",
				requireUFlag: "Use the 'u' flag.",
				requireVFlag: "Use the 'v' flag.",
			},

			schema: [
				{
					type: "object",
					properties: {
						requireFlag: {
							enum: ["u", "v"],
						},
					},
					additionalProperties: false,
				},
			],
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const { requireFlag } = context.options[0] ?? {};

			return {
				"Literal[regex]"(node) {
					const flags = node.regex.flags || "";

					const missingFlag = checkFlags(requireFlag, flags);

					if (missingFlag) {
						context.report({
							messageId:
								requireFlag === "v"
									? "requireVFlag"
									: "requireUFlag",
							node,
							suggest: isValidWithUnicodeFlag(
								context.languageOptions.ecmaVersion,
								node.regex.pattern,
								requireFlag,
							)
								? [
										{
											fix(fixer) {
												const replaceFlag =
													requireFlag ?? "u";
												const regex =
													sourceCode.getText(node);
												const slashPos =
													regex.lastIndexOf("/");

												if (requireFlag) {
													const flag =
														requireFlag === "u"
															? "v"
															: "u";

													if (
														regex.includes(
															flag,
															slashPos,
														)
													) {
														return fixer.replaceText(
															node,
															regex.slice(
																0,
																slashPos,
															) +
																regex
																	.slice(slashPos)
																	.replace(
																		flag,
																		requireFlag,
																	),
														);
													}
												}

												return fixer.insertTextAfter(
													node,
													replaceFlag,
												);
											},
											messageId:
												requireFlag === "v"
													? "addVFlag"
													: "addUFlag",
										},
									]
								: null,
						});
					}
				},

				Program(node) {
					const scope = sourceCode.getScope(node);
					const tracker = new ReferenceTracker(scope);
					const trackMap = {
						RegExp: { [CALL]: true, [CONSTRUCT]: true },
					};

					for (const { node: refNode } of tracker.iterateGlobalReferences(
						trackMap,
					)) {
						const [patternNode, flagsNode] = refNode.arguments;

						if (patternNode && patternNode.type === "SpreadElement") {
							continue;
						}
						const pattern = getStringIfConstant(patternNode, scope);
						const flags = getStringIfConstant(flagsNode, scope);

						let missingFlag = !flagsNode;

						if (typeof flags === "string") {
							missingFlag = checkFlags(requireFlag, flags);
						}

						if (missingFlag) {
							context.report({
								messageId:
									requireFlag === "v"
										? "requireVFlag"
										: "requireUFlag",
								node: refNode,
								suggest:
									typeof pattern === "string" &&
									isValidWithUnicodeFlag(
										context.languageOptions.ecmaVersion,
										pattern,
										requireFlag,
									)
										? [
												{
													fix(fixer) {
														const replaceFlag =
															requireFlag ?? "u";

														if (flagsNode) {
															if (
																(flagsNode.type ===
																	"Literal" &&
																	typeof flagsNode.value ===
																		"string") ||
																flagsNode.type ===
																	"TemplateLiteral"
															) {
																const flagsNodeText =
																	sourceCode.getText(
																		flagsNode,
																	);
																const flag =
																	requireFlag ===
																	"u"
																		? "v"
																		: "u";

																if (
																	flags.includes(
																		flag,
																	)
																) {
																	// Avoid replacing "u" in escapes like `\uXXXX`
																	if (
																		flagsNode.type ===
																			"Literal" &&
																		flagsNode.raw.includes(
																			"\\",
																		)
																	) {
																		return null;
																	}

																	// Avoid replacing "u" in expressions like "`${regularFlags}g`"
																	if (
																		flagsNode.type ===
																			"TemplateLiteral" &&
																		(flagsNode
																			.expressions
																			.length ||
																			flagsNode.quasis.some(
																				({
																					value: {
																						raw,
																					},
																				}) =>
																					raw.includes(
																						"\\",
																					),
																			))
																	) {
																		return null;
																	}

																	return fixer.replaceText(
																		flagsNode,
																		flagsNodeText.replace(
																			flag,
																			replaceFlag,
																		),
																	);
																}

																return fixer.replaceText(
																	flagsNode,
																	[
																		flagsNodeText.slice(
																			0,
																			flagsNodeText.length -
																				1,
																		),
																		flagsNodeText.slice(
																			flagsNodeText.length -
																				1,
																		),
																	].join(
																		replaceFlag,
																	),
																);
															}

															// We intentionally don't suggest concatenating + "u" to non-literals
															return null;
														}

														const penultimateToken =
															sourceCode.getLastToken(
																refNode,
																{ skip: 1 },
															); // skip closing parenthesis

														return fixer.insertTextAfter(
															penultimateToken,
															astUtils.isCommaToken(
																penultimateToken,
															)
																? ` "${replaceFlag}",`
																: `, "${replaceFlag}"`,
														);
													},
													messageId:
														requireFlag === "v"
															? "addVFlag"
															: "addUFlag",
												},
											]
										: null,
							});
						}
					}
				},
			};
		},
	};
	return requireUnicodeRegexp;
}

/**
 * @fileoverview Rule to flag the generator functions that does not have yield.
 * @author Toru Nagashima
 */

var requireYield;
var hasRequiredRequireYield;

function requireRequireYield () {
	if (hasRequiredRequireYield) return requireYield;
	hasRequiredRequireYield = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	requireYield = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require generator functions to contain `yield`",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/require-yield",
			},

			schema: [],

			messages: {
				missingYield: "This generator function does not have 'yield'.",
			},
		},

		create(context) {
			const stack = [];

			/**
			 * If the node is a generator function, start counting `yield` keywords.
			 * @param {Node} node A function node to check.
			 * @returns {void}
			 */
			function beginChecking(node) {
				if (node.generator) {
					stack.push(0);
				}
			}

			/**
			 * If the node is a generator function, end counting `yield` keywords, then
			 * reports result.
			 * @param {Node} node A function node to check.
			 * @returns {void}
			 */
			function endChecking(node) {
				if (!node.generator) {
					return;
				}

				const countYield = stack.pop();

				if (countYield === 0 && node.body.body.length > 0) {
					context.report({ node, messageId: "missingYield" });
				}
			}

			return {
				FunctionDeclaration: beginChecking,
				"FunctionDeclaration:exit": endChecking,
				FunctionExpression: beginChecking,
				"FunctionExpression:exit": endChecking,

				// Increases the count of `yield` keyword.
				YieldExpression() {
					if (stack.length > 0) {
						stack[stack.length - 1] += 1;
					}
				},
			};
		},
	};
	return requireYield;
}

/**
 * @fileoverview Enforce spacing between rest and spread operators and their expressions.
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */

var restSpreadSpacing;
var hasRequiredRestSpreadSpacing;

function requireRestSpreadSpacing () {
	if (hasRequiredRestSpreadSpacing) return restSpreadSpacing;
	hasRequiredRestSpreadSpacing = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	restSpreadSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "rest-spread-spacing",
							url: "https://eslint.style/rules/js/rest-spread-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce spacing between rest and spread operators and their expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/rest-spread-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
			],

			messages: {
				unexpectedWhitespace:
					"Unexpected whitespace after {{type}} operator.",
				expectedWhitespace: "Expected whitespace after {{type}} operator.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode,
				alwaysSpace = context.options[0] === "always";

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Checks whitespace between rest/spread operators and their expressions
			 * @param {ASTNode} node The node to check
			 * @returns {void}
			 */
			function checkWhiteSpace(node) {
				const operator = sourceCode.getFirstToken(node),
					nextToken = sourceCode.getTokenAfter(operator),
					hasWhitespace = sourceCode.isSpaceBetweenTokens(
						operator,
						nextToken,
					);
				let type;

				switch (node.type) {
					case "SpreadElement":
						type = "spread";
						if (node.parent.type === "ObjectExpression") {
							type += " property";
						}
						break;
					case "RestElement":
						type = "rest";
						if (node.parent.type === "ObjectPattern") {
							type += " property";
						}
						break;
					case "ExperimentalSpreadProperty":
						type = "spread property";
						break;
					case "ExperimentalRestProperty":
						type = "rest property";
						break;
					default:
						return;
				}

				if (alwaysSpace && !hasWhitespace) {
					context.report({
						node,
						loc: operator.loc,
						messageId: "expectedWhitespace",
						data: {
							type,
						},
						fix(fixer) {
							return fixer.replaceTextRange(
								[operator.range[1], nextToken.range[0]],
								" ",
							);
						},
					});
				} else if (!alwaysSpace && hasWhitespace) {
					context.report({
						node,
						loc: {
							start: operator.loc.end,
							end: nextToken.loc.start,
						},
						messageId: "unexpectedWhitespace",
						data: {
							type,
						},
						fix(fixer) {
							return fixer.removeRange([
								operator.range[1],
								nextToken.range[0],
							]);
						},
					});
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				SpreadElement: checkWhiteSpace,
				RestElement: checkWhiteSpace,
				ExperimentalSpreadProperty: checkWhiteSpace,
				ExperimentalRestProperty: checkWhiteSpace,
			};
		},
	};
	return restSpreadSpacing;
}

/**
 * @fileoverview Rule to flag missing semicolons.
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */

var semi;
var hasRequiredSemi;

function requireSemi () {
	if (hasRequiredSemi) return semi;
	hasRequiredSemi = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const FixTracker = requireFixTracker();
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	semi = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "semi",
							url: "https://eslint.style/rules/js/semi",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require or disallow semicolons instead of ASI",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/semi",
			},

			fixable: "code",

			schema: {
				anyOf: [
					{
						type: "array",
						items: [
							{
								enum: ["never"],
							},
							{
								type: "object",
								properties: {
									beforeStatementContinuationChars: {
										enum: ["always", "any", "never"],
									},
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
					{
						type: "array",
						items: [
							{
								enum: ["always"],
							},
							{
								type: "object",
								properties: {
									omitLastInOneLineBlock: { type: "boolean" },
									omitLastInOneLineClassBody: { type: "boolean" },
								},
								additionalProperties: false,
							},
						],
						minItems: 0,
						maxItems: 2,
					},
				],
			},

			messages: {
				missingSemi: "Missing semicolon.",
				extraSemi: "Extra semicolon.",
			},
		},

		create(context) {
			const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-`
			const unsafeClassFieldNames = new Set(["get", "set", "static"]);
			const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]);
			const options = context.options[1];
			const never = context.options[0] === "never";
			const exceptOneLine = Boolean(
				options && options.omitLastInOneLineBlock,
			);
			const exceptOneLineClassBody = Boolean(
				options && options.omitLastInOneLineClassBody,
			);
			const beforeStatementContinuationChars =
				(options && options.beforeStatementContinuationChars) || "any";
			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Reports a semicolon error with appropriate location and message.
			 * @param {ASTNode} node The node with an extra or missing semicolon.
			 * @param {boolean} missing True if the semicolon is missing.
			 * @returns {void}
			 */
			function report(node, missing) {
				const lastToken = sourceCode.getLastToken(node);
				let messageId, fix, loc;

				if (!missing) {
					messageId = "missingSemi";
					loc = {
						start: lastToken.loc.end,
						end: astUtils.getNextLocation(
							sourceCode,
							lastToken.loc.end,
						),
					};
					fix = function (fixer) {
						return fixer.insertTextAfter(lastToken, ";");
					};
				} else {
					messageId = "extraSemi";
					loc = lastToken.loc;
					fix = function (fixer) {
						/*
						 * Expand the replacement range to include the surrounding
						 * tokens to avoid conflicting with no-extra-semi.
						 * https://github.com/eslint/eslint/issues/7928
						 */
						return new FixTracker(fixer, sourceCode)
							.retainSurroundingTokens(lastToken)
							.remove(lastToken);
					};
				}

				context.report({
					node,
					loc,
					messageId,
					fix,
				});
			}

			/**
			 * Check whether a given semicolon token is redundant.
			 * @param {Token} semiToken A semicolon token to check.
			 * @returns {boolean} `true` if the next token is `;` or `}`.
			 */
			function isRedundantSemi(semiToken) {
				const nextToken = sourceCode.getTokenAfter(semiToken);

				return (
					!nextToken ||
					astUtils.isClosingBraceToken(nextToken) ||
					astUtils.isSemicolonToken(nextToken)
				);
			}

			/**
			 * Check whether a given token is the closing brace of an arrow function.
			 * @param {Token} lastToken A token to check.
			 * @returns {boolean} `true` if the token is the closing brace of an arrow function.
			 */
			function isEndOfArrowBlock(lastToken) {
				if (!astUtils.isClosingBraceToken(lastToken)) {
					return false;
				}
				const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]);

				return (
					node.type === "BlockStatement" &&
					node.parent.type === "ArrowFunctionExpression"
				);
			}

			/**
			 * Checks if a given PropertyDefinition node followed by a semicolon
			 * can safely remove that semicolon. It is not to safe to remove if
			 * the class field name is "get", "set", or "static", or if
			 * followed by a generator method.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} `true` if the node cannot have the semicolon
			 *      removed.
			 */
			function maybeClassFieldAsiHazard(node) {
				if (node.type !== "PropertyDefinition") {
					return false;
				}

				/*
				 * Computed property names and non-identifiers are always safe
				 * as they can be distinguished from keywords easily.
				 */
				const needsNameCheck =
					!node.computed && node.key.type === "Identifier";

				/*
				 * Certain names are problematic unless they also have a
				 * a way to distinguish between keywords and property
				 * names.
				 */
				if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) {
					/*
					 * Special case: If the field name is `static`,
					 * it is only valid if the field is marked as static,
					 * so "static static" is okay but "static" is not.
					 */
					const isStaticStatic =
						node.static && node.key.name === "static";

					/*
					 * For other unsafe names, we only care if there is no
					 * initializer. No initializer = hazard.
					 */
					if (!isStaticStatic && !node.value) {
						return true;
					}
				}

				const followingToken = sourceCode.getTokenAfter(node);

				return unsafeClassFieldFollowers.has(followingToken.value);
			}

			/**
			 * Check whether a given node is on the same line with the next token.
			 * @param {Node} node A statement node to check.
			 * @returns {boolean} `true` if the node is on the same line with the next token.
			 */
			function isOnSameLineWithNextToken(node) {
				const prevToken = sourceCode.getLastToken(node, 1);
				const nextToken = sourceCode.getTokenAfter(node);

				return (
					!!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken)
				);
			}

			/**
			 * Check whether a given node can connect the next line if the next line is unreliable.
			 * @param {Node} node A statement node to check.
			 * @returns {boolean} `true` if the node can connect the next line.
			 */
			function maybeAsiHazardAfter(node) {
				const t = node.type;

				if (
					t === "DoWhileStatement" ||
					t === "BreakStatement" ||
					t === "ContinueStatement" ||
					t === "DebuggerStatement" ||
					t === "ImportDeclaration" ||
					t === "ExportAllDeclaration"
				) {
					return false;
				}
				if (t === "ReturnStatement") {
					return Boolean(node.argument);
				}
				if (t === "ExportNamedDeclaration") {
					return Boolean(node.declaration);
				}
				if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) {
					return false;
				}

				return true;
			}

			/**
			 * Check whether a given token can connect the previous statement.
			 * @param {Token} token A token to check.
			 * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`.
			 */
			function maybeAsiHazardBefore(token) {
				return (
					Boolean(token) &&
					OPT_OUT_PATTERN.test(token.value) &&
					token.value !== "++" &&
					token.value !== "--"
				);
			}

			/**
			 * Check if the semicolon of a given node is unnecessary, only true if:
			 *   - next token is a valid statement divider (`;` or `}`).
			 *   - next token is on a new line and the node is not connectable to the new line.
			 * @param {Node} node A statement node to check.
			 * @returns {boolean} whether the semicolon is unnecessary.
			 */
			function canRemoveSemicolon(node) {
				if (isRedundantSemi(sourceCode.getLastToken(node))) {
					return true; // `;;` or `;}`
				}
				if (maybeClassFieldAsiHazard(node)) {
					return false;
				}
				if (isOnSameLineWithNextToken(node)) {
					return false; // One liner.
				}

				// continuation characters should not apply to class fields
				if (
					node.type !== "PropertyDefinition" &&
					beforeStatementContinuationChars === "never" &&
					!maybeAsiHazardAfter(node)
				) {
					return true; // ASI works. This statement doesn't connect to the next.
				}
				if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) {
					return true; // ASI works. The next token doesn't connect to this statement.
				}

				return false;
			}

			/**
			 * Checks a node to see if it's the last item in a one-liner block.
			 * Block is any `BlockStatement` or `StaticBlock` node. Block is a one-liner if its
			 * braces (and consequently everything between them) are on the same line.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} whether the node is the last item in a one-liner block.
			 */
			function isLastInOneLinerBlock(node) {
				const parent = node.parent;
				const nextToken = sourceCode.getTokenAfter(node);

				if (!nextToken || nextToken.value !== "}") {
					return false;
				}

				if (parent.type === "BlockStatement") {
					return parent.loc.start.line === parent.loc.end.line;
				}

				if (parent.type === "StaticBlock") {
					const openingBrace = sourceCode.getFirstToken(parent, {
						skip: 1,
					}); // skip the `static` token

					return openingBrace.loc.start.line === parent.loc.end.line;
				}

				return false;
			}

			/**
			 * Checks a node to see if it's the last item in a one-liner `ClassBody` node.
			 * ClassBody is a one-liner if its braces (and consequently everything between them) are on the same line.
			 * @param {ASTNode} node The node to check.
			 * @returns {boolean} whether the node is the last item in a one-liner ClassBody.
			 */
			function isLastInOneLinerClassBody(node) {
				const parent = node.parent;
				const nextToken = sourceCode.getTokenAfter(node);

				if (!nextToken || nextToken.value !== "}") {
					return false;
				}

				if (parent.type === "ClassBody") {
					return parent.loc.start.line === parent.loc.end.line;
				}

				return false;
			}

			/**
			 * Checks a node to see if it's followed by a semicolon.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkForSemicolon(node) {
				const isSemi = astUtils.isSemicolonToken(
					sourceCode.getLastToken(node),
				);

				if (never) {
					if (isSemi && canRemoveSemicolon(node)) {
						report(node, true);
					} else if (
						!isSemi &&
						beforeStatementContinuationChars === "always" &&
						node.type !== "PropertyDefinition" &&
						maybeAsiHazardBefore(sourceCode.getTokenAfter(node))
					) {
						report(node);
					}
				} else {
					const oneLinerBlock =
						exceptOneLine && isLastInOneLinerBlock(node);
					const oneLinerClassBody =
						exceptOneLineClassBody && isLastInOneLinerClassBody(node);
					const oneLinerBlockOrClassBody =
						oneLinerBlock || oneLinerClassBody;

					if (isSemi && oneLinerBlockOrClassBody) {
						report(node, true);
					} else if (!isSemi && !oneLinerBlockOrClassBody) {
						report(node);
					}
				}
			}

			/**
			 * Checks to see if there's a semicolon after a variable declaration.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkForSemicolonForVariableDeclaration(node) {
				const parent = node.parent;

				if (
					(parent.type !== "ForStatement" || parent.init !== node) &&
					(!/^For(?:In|Of)Statement/u.test(parent.type) ||
						parent.left !== node)
				) {
					checkForSemicolon(node);
				}
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				VariableDeclaration: checkForSemicolonForVariableDeclaration,
				ExpressionStatement: checkForSemicolon,
				ReturnStatement: checkForSemicolon,
				ThrowStatement: checkForSemicolon,
				DoWhileStatement: checkForSemicolon,
				DebuggerStatement: checkForSemicolon,
				BreakStatement: checkForSemicolon,
				ContinueStatement: checkForSemicolon,
				ImportDeclaration: checkForSemicolon,
				ExportAllDeclaration: checkForSemicolon,
				ExportNamedDeclaration(node) {
					if (!node.declaration) {
						checkForSemicolon(node);
					}
				},
				ExportDefaultDeclaration(node) {
					if (
						!/(?:Class|Function)Declaration/u.test(
							node.declaration.type,
						)
					) {
						checkForSemicolon(node);
					}
				},
				PropertyDefinition: checkForSemicolon,
			};
		},
	};
	return semi;
}

/**
 * @fileoverview Validates spacing before and after semicolon
 * @author Mathias Schreck
 * @deprecated in ESLint v8.53.0
 */

var semiSpacing;
var hasRequiredSemiSpacing;

function requireSemiSpacing () {
	if (hasRequiredSemiSpacing) return semiSpacing;
	hasRequiredSemiSpacing = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	semiSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "semi-spacing",
							url: "https://eslint.style/rules/js/semi-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing before and after semicolons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/semi-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						before: {
							type: "boolean",
							default: false,
						},
						after: {
							type: "boolean",
							default: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedWhitespaceBefore:
					"Unexpected whitespace before semicolon.",
				unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.",
				missingWhitespaceBefore: "Missing whitespace before semicolon.",
				missingWhitespaceAfter: "Missing whitespace after semicolon.",
			},
		},

		create(context) {
			const config = context.options[0],
				sourceCode = context.sourceCode;
			let requireSpaceBefore = false,
				requireSpaceAfter = true;

			if (typeof config === "object") {
				requireSpaceBefore = config.before;
				requireSpaceAfter = config.after;
			}

			/**
			 * Checks if a given token has leading whitespace.
			 * @param {Object} token The token to check.
			 * @returns {boolean} True if the given token has leading space, false if not.
			 */
			function hasLeadingSpace(token) {
				const tokenBefore = sourceCode.getTokenBefore(token);

				return (
					tokenBefore &&
					astUtils.isTokenOnSameLine(tokenBefore, token) &&
					sourceCode.isSpaceBetweenTokens(tokenBefore, token)
				);
			}

			/**
			 * Checks if a given token has trailing whitespace.
			 * @param {Object} token The token to check.
			 * @returns {boolean} True if the given token has trailing space, false if not.
			 */
			function hasTrailingSpace(token) {
				const tokenAfter = sourceCode.getTokenAfter(token);

				return (
					tokenAfter &&
					astUtils.isTokenOnSameLine(token, tokenAfter) &&
					sourceCode.isSpaceBetweenTokens(token, tokenAfter)
				);
			}

			/**
			 * Checks if the given token is the last token in its line.
			 * @param {Token} token The token to check.
			 * @returns {boolean} Whether or not the token is the last in its line.
			 */
			function isLastTokenInCurrentLine(token) {
				const tokenAfter = sourceCode.getTokenAfter(token);

				return !(
					tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)
				);
			}

			/**
			 * Checks if the given token is the first token in its line
			 * @param {Token} token The token to check.
			 * @returns {boolean} Whether or not the token is the first in its line.
			 */
			function isFirstTokenInCurrentLine(token) {
				const tokenBefore = sourceCode.getTokenBefore(token);

				return !(
					tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)
				);
			}

			/**
			 * Checks if the next token of a given token is a closing parenthesis.
			 * @param {Token} token The token to check.
			 * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis.
			 */
			function isBeforeClosingParen(token) {
				const nextToken = sourceCode.getTokenAfter(token);

				return (
					(nextToken && astUtils.isClosingBraceToken(nextToken)) ||
					astUtils.isClosingParenToken(nextToken)
				);
			}

			/**
			 * Report location example :
			 *
			 * for unexpected space `before`
			 *
			 * var a = 'b'   ;
			 *            ^^^
			 *
			 * for unexpected space `after`
			 *
			 * var a = 'b';  c = 10;
			 *             ^^
			 *
			 * Reports if the given token has invalid spacing.
			 * @param {Token} token The semicolon token to check.
			 * @param {ASTNode} node The corresponding node of the token.
			 * @returns {void}
			 */
			function checkSemicolonSpacing(token, node) {
				if (astUtils.isSemicolonToken(token)) {
					if (hasLeadingSpace(token)) {
						if (!requireSpaceBefore) {
							const tokenBefore = sourceCode.getTokenBefore(token);
							const loc = {
								start: tokenBefore.loc.end,
								end: token.loc.start,
							};

							context.report({
								node,
								loc,
								messageId: "unexpectedWhitespaceBefore",
								fix(fixer) {
									return fixer.removeRange([
										tokenBefore.range[1],
										token.range[0],
									]);
								},
							});
						}
					} else {
						if (requireSpaceBefore) {
							const loc = token.loc;

							context.report({
								node,
								loc,
								messageId: "missingWhitespaceBefore",
								fix(fixer) {
									return fixer.insertTextBefore(token, " ");
								},
							});
						}
					}

					if (
						!isFirstTokenInCurrentLine(token) &&
						!isLastTokenInCurrentLine(token) &&
						!isBeforeClosingParen(token)
					) {
						if (hasTrailingSpace(token)) {
							if (!requireSpaceAfter) {
								const tokenAfter = sourceCode.getTokenAfter(token);
								const loc = {
									start: token.loc.end,
									end: tokenAfter.loc.start,
								};

								context.report({
									node,
									loc,
									messageId: "unexpectedWhitespaceAfter",
									fix(fixer) {
										return fixer.removeRange([
											token.range[1],
											tokenAfter.range[0],
										]);
									},
								});
							}
						} else {
							if (requireSpaceAfter) {
								const loc = token.loc;

								context.report({
									node,
									loc,
									messageId: "missingWhitespaceAfter",
									fix(fixer) {
										return fixer.insertTextAfter(token, " ");
									},
								});
							}
						}
					}
				}
			}

			/**
			 * Checks the spacing of the semicolon with the assumption that the last token is the semicolon.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkNode(node) {
				const token = sourceCode.getLastToken(node);

				checkSemicolonSpacing(token, node);
			}

			return {
				VariableDeclaration: checkNode,
				ExpressionStatement: checkNode,
				BreakStatement: checkNode,
				ContinueStatement: checkNode,
				DebuggerStatement: checkNode,
				DoWhileStatement: checkNode,
				ReturnStatement: checkNode,
				ThrowStatement: checkNode,
				ImportDeclaration: checkNode,
				ExportNamedDeclaration: checkNode,
				ExportAllDeclaration: checkNode,
				ExportDefaultDeclaration: checkNode,
				ForStatement(node) {
					if (node.init) {
						checkSemicolonSpacing(
							sourceCode.getTokenAfter(node.init),
							node,
						);
					}

					if (node.test) {
						checkSemicolonSpacing(
							sourceCode.getTokenAfter(node.test),
							node,
						);
					}
				},
				PropertyDefinition: checkNode,
			};
		},
	};
	return semiSpacing;
}

/**
 * @fileoverview Rule to enforce location of semicolons.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var semiStyle;
var hasRequiredSemiStyle;

function requireSemiStyle () {
	if (hasRequiredSemiStyle) return semiStyle;
	hasRequiredSemiStyle = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	const SELECTOR = [
		"BreakStatement",
		"ContinueStatement",
		"DebuggerStatement",
		"DoWhileStatement",
		"ExportAllDeclaration",
		"ExportDefaultDeclaration",
		"ExportNamedDeclaration",
		"ExpressionStatement",
		"ImportDeclaration",
		"ReturnStatement",
		"ThrowStatement",
		"VariableDeclaration",
		"PropertyDefinition",
	].join(",");

	/**
	 * Get the child node list of a given node.
	 * This returns `BlockStatement#body`, `StaticBlock#body`, `Program#body`,
	 * `ClassBody#body`, or `SwitchCase#consequent`.
	 * This is used to check whether a node is the first/last child.
	 * @param {Node} node A node to get child node list.
	 * @returns {Node[]|null} The child node list.
	 */
	function getChildren(node) {
		const t = node.type;

		if (
			t === "BlockStatement" ||
			t === "StaticBlock" ||
			t === "Program" ||
			t === "ClassBody"
		) {
			return node.body;
		}
		if (t === "SwitchCase") {
			return node.consequent;
		}
		return null;
	}

	/**
	 * Check whether a given node is the last statement in the parent block.
	 * @param {Node} node A node to check.
	 * @returns {boolean} `true` if the node is the last statement in the parent block.
	 */
	function isLastChild(node) {
		const t = node.parent.type;

		if (
			t === "IfStatement" &&
			node.parent.consequent === node &&
			node.parent.alternate
		) {
			// before `else` keyword.
			return true;
		}
		if (t === "DoWhileStatement") {
			// before `while` keyword.
			return true;
		}
		const nodeList = getChildren(node.parent);

		return nodeList !== null && nodeList.at(-1) === node; // before `}` or etc.
	}

	/** @type {import('../shared/types').Rule} */
	semiStyle = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "semi-style",
							url: "https://eslint.style/rules/js/semi-style",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce location of semicolons",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/semi-style",
			},

			schema: [{ enum: ["last", "first"] }],
			fixable: "whitespace",

			messages: {
				expectedSemiColon: "Expected this semicolon to be at {{pos}}.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const option = context.options[0] || "last";

			/**
			 * Check the given semicolon token.
			 * @param {Token} semiToken The semicolon token to check.
			 * @param {"first"|"last"} expected The expected location to check.
			 * @returns {void}
			 */
			function check(semiToken, expected) {
				const prevToken = sourceCode.getTokenBefore(semiToken);
				const nextToken = sourceCode.getTokenAfter(semiToken);
				const prevIsSameLine =
					!prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken);
				const nextIsSameLine =
					!nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken);

				if (
					(expected === "last" && !prevIsSameLine) ||
					(expected === "first" && !nextIsSameLine)
				) {
					context.report({
						loc: semiToken.loc,
						messageId: "expectedSemiColon",
						data: {
							pos:
								expected === "last"
									? "the end of the previous line"
									: "the beginning of the next line",
						},
						fix(fixer) {
							if (
								prevToken &&
								nextToken &&
								sourceCode.commentsExistBetween(
									prevToken,
									nextToken,
								)
							) {
								return null;
							}

							const start = prevToken
								? prevToken.range[1]
								: semiToken.range[0];
							const end = nextToken
								? nextToken.range[0]
								: semiToken.range[1];
							const text = expected === "last" ? ";\n" : "\n;";

							return fixer.replaceTextRange([start, end], text);
						},
					});
				}
			}

			return {
				[SELECTOR](node) {
					if (option === "first" && isLastChild(node)) {
						return;
					}

					const lastToken = sourceCode.getLastToken(node);

					if (astUtils.isSemicolonToken(lastToken)) {
						check(lastToken, option);
					}
				},

				ForStatement(node) {
					const firstSemi =
						node.init &&
						sourceCode.getTokenAfter(
							node.init,
							astUtils.isSemicolonToken,
						);
					const secondSemi =
						node.test &&
						sourceCode.getTokenAfter(
							node.test,
							astUtils.isSemicolonToken,
						);

					if (firstSemi) {
						check(firstSemi, "last");
					}
					if (secondSemi) {
						check(secondSemi, "last");
					}
				},
			};
		},
	};
	return semiStyle;
}

/**
 * @fileoverview Rule to enforce sorted `import` declarations within modules
 * @author Christian Schuller
 */

var sortImports;
var hasRequiredSortImports;

function requireSortImports () {
	if (hasRequiredSortImports) return sortImports;
	hasRequiredSortImports = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	sortImports = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					allowSeparatedGroups: false,
					ignoreCase: false,
					ignoreDeclarationSort: false,
					ignoreMemberSort: false,
					memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
				},
			],

			docs: {
				description: "Enforce sorted `import` declarations within modules",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/sort-imports",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignoreCase: {
							type: "boolean",
						},
						memberSyntaxSortOrder: {
							type: "array",
							items: {
								enum: ["none", "all", "multiple", "single"],
							},
							uniqueItems: true,
							minItems: 4,
							maxItems: 4,
						},
						ignoreDeclarationSort: {
							type: "boolean",
						},
						ignoreMemberSort: {
							type: "boolean",
						},
						allowSeparatedGroups: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				sortImportsAlphabetically:
					"Imports should be sorted alphabetically.",
				sortMembersAlphabetically:
					"Member '{{memberName}}' of the import declaration should be sorted alphabetically.",
				unexpectedSyntaxOrder:
					"Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.",
			},
		},

		create(context) {
			const [
				{
					ignoreCase,
					ignoreDeclarationSort,
					ignoreMemberSort,
					memberSyntaxSortOrder,
					allowSeparatedGroups,
				},
			] = context.options;
			const sourceCode = context.sourceCode;
			let previousDeclaration = null;

			/**
			 * Gets the used member syntax style.
			 *
			 * import "my-module.js" --> none
			 * import * as myModule from "my-module.js" --> all
			 * import {myMember} from "my-module.js" --> single
			 * import {foo, bar} from  "my-module.js" --> multiple
			 * @param {ASTNode} node the ImportDeclaration node.
			 * @returns {string} used member parameter style, ["all", "multiple", "single"]
			 */
			function usedMemberSyntax(node) {
				if (node.specifiers.length === 0) {
					return "none";
				}
				if (node.specifiers[0].type === "ImportNamespaceSpecifier") {
					return "all";
				}
				if (node.specifiers.length === 1) {
					return "single";
				}
				return "multiple";
			}

			/**
			 * Gets the group by member parameter index for given declaration.
			 * @param {ASTNode} node the ImportDeclaration node.
			 * @returns {number} the declaration group by member index.
			 */
			function getMemberParameterGroupIndex(node) {
				return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node));
			}

			/**
			 * Gets the local name of the first imported module.
			 * @param {ASTNode} node the ImportDeclaration node.
			 * @returns {?string} the local name of the first imported module.
			 */
			function getFirstLocalMemberName(node) {
				if (node.specifiers[0]) {
					return node.specifiers[0].local.name;
				}
				return null;
			}

			/**
			 * Calculates number of lines between two nodes. It is assumed that the given `left` node appears before
			 * the given `right` node in the source code. Lines are counted from the end of the `left` node till the
			 * start of the `right` node. If the given nodes are on the same line, it returns `0`, same as if they were
			 * on two consecutive lines.
			 * @param {ASTNode} left node that appears before the given `right` node.
			 * @param {ASTNode} right node that appears after the given `left` node.
			 * @returns {number} number of lines between nodes.
			 */
			function getNumberOfLinesBetween(left, right) {
				return Math.max(right.loc.start.line - left.loc.end.line - 1, 0);
			}

			return {
				ImportDeclaration(node) {
					if (!ignoreDeclarationSort) {
						if (
							previousDeclaration &&
							allowSeparatedGroups &&
							getNumberOfLinesBetween(previousDeclaration, node) > 0
						) {
							// reset declaration sort
							previousDeclaration = null;
						}

						if (previousDeclaration) {
							const currentMemberSyntaxGroupIndex =
									getMemberParameterGroupIndex(node),
								previousMemberSyntaxGroupIndex =
									getMemberParameterGroupIndex(
										previousDeclaration,
									);
							let currentLocalMemberName =
									getFirstLocalMemberName(node),
								previousLocalMemberName =
									getFirstLocalMemberName(previousDeclaration);

							if (ignoreCase) {
								previousLocalMemberName =
									previousLocalMemberName &&
									previousLocalMemberName.toLowerCase();
								currentLocalMemberName =
									currentLocalMemberName &&
									currentLocalMemberName.toLowerCase();
							}

							/*
							 * When the current declaration uses a different member syntax,
							 * then check if the ordering is correct.
							 * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name.
							 */
							if (
								currentMemberSyntaxGroupIndex !==
								previousMemberSyntaxGroupIndex
							) {
								if (
									currentMemberSyntaxGroupIndex <
									previousMemberSyntaxGroupIndex
								) {
									context.report({
										node,
										messageId: "unexpectedSyntaxOrder",
										data: {
											syntaxA:
												memberSyntaxSortOrder[
													currentMemberSyntaxGroupIndex
												],
											syntaxB:
												memberSyntaxSortOrder[
													previousMemberSyntaxGroupIndex
												],
										},
									});
								}
							} else {
								if (
									previousLocalMemberName &&
									currentLocalMemberName &&
									currentLocalMemberName < previousLocalMemberName
								) {
									context.report({
										node,
										messageId: "sortImportsAlphabetically",
									});
								}
							}
						}

						previousDeclaration = node;
					}

					if (!ignoreMemberSort) {
						const importSpecifiers = node.specifiers.filter(
							specifier => specifier.type === "ImportSpecifier",
						);
						const getSortableName = ignoreCase
							? specifier => specifier.local.name.toLowerCase()
							: specifier => specifier.local.name;
						const firstUnsortedIndex = importSpecifiers
							.map(getSortableName)
							.findIndex(
								(name, index, array) => array[index - 1] > name,
							);

						if (firstUnsortedIndex !== -1) {
							context.report({
								node: importSpecifiers[firstUnsortedIndex],
								messageId: "sortMembersAlphabetically",
								data: {
									memberName:
										importSpecifiers[firstUnsortedIndex].local
											.name,
								},
								fix(fixer) {
									if (
										importSpecifiers.some(
											specifier =>
												sourceCode.getCommentsBefore(
													specifier,
												).length ||
												sourceCode.getCommentsAfter(
													specifier,
												).length,
										)
									) {
										// If there are comments in the ImportSpecifier list, don't rearrange the specifiers.
										return null;
									}

									return fixer.replaceTextRange(
										[
											importSpecifiers[0].range[0],
											importSpecifiers.at(-1).range[1],
										],
										importSpecifiers

											// Clone the importSpecifiers array to avoid mutating it
											.slice()

											// Sort the array into the desired order
											.sort((specifierA, specifierB) => {
												const aName =
													getSortableName(specifierA);
												const bName =
													getSortableName(specifierB);

												return aName > bName ? 1 : -1;
											})

											// Build a string out of the sorted list of import specifiers and the text between the originals
											.reduce(
												(sourceText, specifier, index) => {
													const textAfterSpecifier =
														index ===
														importSpecifiers.length - 1
															? ""
															: sourceCode
																	.getText()
																	.slice(
																		importSpecifiers[
																			index
																		].range[1],
																		importSpecifiers[
																			index +
																				1
																		].range[0],
																	);

													return (
														sourceText +
														sourceCode.getText(
															specifier,
														) +
														textAfterSpecifier
													);
												},
												"",
											),
									);
								},
							});
						}
					}
				},
			};
		},
	};
	return sortImports;
}

var naturalCompare = {exports: {}};

var hasRequiredNaturalCompare;

function requireNaturalCompare () {
	if (hasRequiredNaturalCompare) return naturalCompare.exports;
	hasRequiredNaturalCompare = 1;
	/*
	 * @version    1.4.0
	 * @date       2015-10-26
	 * @stability  3 - Stable
	 * @author     Lauri Rooden (https://github.com/litejs/natural-compare-lite)
	 * @license    MIT License
	 */


	var naturalCompare$1 = function(a, b) {
		var i, codeA
		, codeB = 1
		, posA = 0
		, posB = 0
		, alphabet = String.alphabet;

		function getCode(str, pos, code) {
			if (code) {
				for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
				return +str.slice(pos - 1, i)
			}
			code = alphabet && alphabet.indexOf(str.charAt(pos));
			return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
				: code < 46 ? 65               // -
				: code < 48 ? code - 1
				: code < 58 ? code + 18        // 0-9
				: code < 65 ? code - 11
				: code < 91 ? code + 11        // A-Z
				: code < 97 ? code - 37
				: code < 123 ? code + 5        // a-z
				: code - 63
		}


		if ((a+="") != (b+="")) for (;codeB;) {
			codeA = getCode(a, posA++);
			codeB = getCode(b, posB++);

			if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
				codeA = getCode(a, posA, posA);
				codeB = getCode(b, posB, posA = i);
				posB = i;
			}

			if (codeA != codeB) return (codeA < codeB) ? -1 : 1
		}
		return 0
	};

	try {
		naturalCompare.exports = naturalCompare$1;
	} catch (e) {
		String.naturalCompare = naturalCompare$1;
	}
	return naturalCompare.exports;
}

/**
 * @fileoverview Rule to require object keys to be sorted
 * @author Toru Nagashima
 */

var sortKeys;
var hasRequiredSortKeys;

function requireSortKeys () {
	if (hasRequiredSortKeys) return sortKeys;
	hasRequiredSortKeys = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils(),
		naturalCompare = requireNaturalCompare();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Gets the property name of the given `Property` node.
	 *
	 * - If the property's key is an `Identifier` node, this returns the key's name
	 *   whether it's a computed property or not.
	 * - If the property has a static name, this returns the static name.
	 * - Otherwise, this returns null.
	 * @param {ASTNode} node The `Property` node to get.
	 * @returns {string|null} The property name or null.
	 * @private
	 */
	function getPropertyName(node) {
		const staticName = astUtils.getStaticPropertyName(node);

		if (staticName !== null) {
			return staticName;
		}

		return node.key.name || null;
	}

	/**
	 * Functions which check that the given 2 names are in specific order.
	 *
	 * Postfix `I` is meant insensitive.
	 * Postfix `N` is meant natural.
	 * @private
	 */
	const isValidOrders = {
		asc(a, b) {
			return a <= b;
		},
		ascI(a, b) {
			return a.toLowerCase() <= b.toLowerCase();
		},
		ascN(a, b) {
			return naturalCompare(a, b) <= 0;
		},
		ascIN(a, b) {
			return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0;
		},
		desc(a, b) {
			return isValidOrders.asc(b, a);
		},
		descI(a, b) {
			return isValidOrders.ascI(b, a);
		},
		descN(a, b) {
			return isValidOrders.ascN(b, a);
		},
		descIN(a, b) {
			return isValidOrders.ascIN(b, a);
		},
	};

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	sortKeys = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				"asc",
				{
					allowLineSeparatedGroups: false,
					caseSensitive: true,
					ignoreComputedKeys: false,
					minKeys: 2,
					natural: false,
				},
			],

			docs: {
				description: "Require object keys to be sorted",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/sort-keys",
			},

			schema: [
				{
					enum: ["asc", "desc"],
				},
				{
					type: "object",
					properties: {
						caseSensitive: {
							type: "boolean",
						},
						natural: {
							type: "boolean",
						},
						minKeys: {
							type: "integer",
							minimum: 2,
						},
						allowLineSeparatedGroups: {
							type: "boolean",
						},
						ignoreComputedKeys: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				sortKeys:
					"Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'.",
			},
		},

		create(context) {
			const [
				order,
				{
					caseSensitive,
					natural,
					minKeys,
					allowLineSeparatedGroups,
					ignoreComputedKeys,
				},
			] = context.options;
			const insensitive = !caseSensitive;
			const isValidOrder =
				isValidOrders[
					order + (insensitive ? "I" : "") + (natural ? "N" : "")
				];

			// The stack to save the previous property's name for each object literals.
			let stack = null;
			const sourceCode = context.sourceCode;

			return {
				ObjectExpression(node) {
					stack = {
						upper: stack,
						prevNode: null,
						prevBlankLine: false,
						prevName: null,
						numKeys: node.properties.length,
					};
				},

				"ObjectExpression:exit"() {
					stack = stack.upper;
				},

				SpreadElement(node) {
					if (node.parent.type === "ObjectExpression") {
						stack.prevName = null;
					}
				},

				Property(node) {
					if (node.parent.type === "ObjectPattern") {
						return;
					}

					if (ignoreComputedKeys && node.computed) {
						stack.prevName = null; // reset sort
						return;
					}

					const prevName = stack.prevName;
					const numKeys = stack.numKeys;
					const thisName = getPropertyName(node);

					// Get tokens between current node and previous node
					const tokens =
						stack.prevNode &&
						sourceCode.getTokensBetween(stack.prevNode, node, {
							includeComments: true,
						});

					let isBlankLineBetweenNodes = stack.prevBlankLine;

					if (tokens) {
						// check blank line between tokens
						tokens.forEach((token, index) => {
							const previousToken = tokens[index - 1];

							if (
								previousToken &&
								token.loc.start.line - previousToken.loc.end.line >
									1
							) {
								isBlankLineBetweenNodes = true;
							}
						});

						// check blank line between the current node and the last token
						if (
							!isBlankLineBetweenNodes &&
							node.loc.start.line - tokens.at(-1).loc.end.line > 1
						) {
							isBlankLineBetweenNodes = true;
						}

						// check blank line between the first token and the previous node
						if (
							!isBlankLineBetweenNodes &&
							tokens[0].loc.start.line - stack.prevNode.loc.end.line >
								1
						) {
							isBlankLineBetweenNodes = true;
						}
					}

					stack.prevNode = node;

					if (thisName !== null) {
						stack.prevName = thisName;
					}

					if (allowLineSeparatedGroups && isBlankLineBetweenNodes) {
						stack.prevBlankLine = thisName === null;
						return;
					}

					if (
						prevName === null ||
						thisName === null ||
						numKeys < minKeys
					) {
						return;
					}

					if (!isValidOrder(prevName, thisName)) {
						context.report({
							node,
							loc: node.key.loc,
							messageId: "sortKeys",
							data: {
								thisName,
								prevName,
								order,
								insensitive: insensitive ? "insensitive " : "",
								natural: natural ? "natural " : "",
							},
						});
					}
				},
			};
		},
	};
	return sortKeys;
}

/**
 * @fileoverview Rule to require sorting of variables within a single Variable Declaration block
 * @author Ilya Volodin
 */

var sortVars;
var hasRequiredSortVars;

function requireSortVars () {
	if (hasRequiredSortVars) return sortVars;
	hasRequiredSortVars = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	sortVars = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				{
					ignoreCase: false,
				},
			],

			docs: {
				description:
					"Require variables within the same declaration block to be sorted",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/sort-vars",
			},

			schema: [
				{
					type: "object",
					properties: {
						ignoreCase: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",

			messages: {
				sortVars:
					"Variables within the same declaration block should be sorted alphabetically.",
			},
		},

		create(context) {
			const [{ ignoreCase }] = context.options;
			const sourceCode = context.sourceCode;

			return {
				VariableDeclaration(node) {
					const idDeclarations = node.declarations.filter(
						decl => decl.id.type === "Identifier",
					);
					const getSortableName = ignoreCase
						? decl => decl.id.name.toLowerCase()
						: decl => decl.id.name;
					const unfixable = idDeclarations.some(
						decl => decl.init !== null && decl.init.type !== "Literal",
					);
					let fixed = false;

					idDeclarations.slice(1).reduce((memo, decl) => {
						const lastVariableName = getSortableName(memo),
							currentVariableName = getSortableName(decl);

						if (currentVariableName < lastVariableName) {
							context.report({
								node: decl,
								messageId: "sortVars",
								fix(fixer) {
									if (unfixable || fixed) {
										return null;
									}
									return fixer.replaceTextRange(
										[
											idDeclarations[0].range[0],
											idDeclarations.at(-1).range[1],
										],
										idDeclarations

											// Clone the idDeclarations array to avoid mutating it
											.slice()

											// Sort the array into the desired order
											.sort((declA, declB) => {
												const aName =
													getSortableName(declA);
												const bName =
													getSortableName(declB);

												return aName > bName ? 1 : -1;
											})

											// Build a string out of the sorted list of identifier declarations and the text between the originals
											.reduce(
												(sourceText, identifier, index) => {
													const textAfterIdentifier =
														index ===
														idDeclarations.length - 1
															? ""
															: sourceCode
																	.getText()
																	.slice(
																		idDeclarations[
																			index
																		].range[1],
																		idDeclarations[
																			index +
																				1
																		].range[0],
																	);

													return (
														sourceText +
														sourceCode.getText(
															identifier,
														) +
														textAfterIdentifier
													);
												},
												"",
											),
									);
								},
							});
							fixed = true;
							return memo;
						}
						return decl;
					}, idDeclarations[0]);
				},
			};
		},
	};
	return sortVars;
}

/**
 * @fileoverview A rule to ensure whitespace before blocks.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

var spaceBeforeBlocks;
var hasRequiredSpaceBeforeBlocks;

function requireSpaceBeforeBlocks () {
	if (hasRequiredSpaceBeforeBlocks) return spaceBeforeBlocks;
	hasRequiredSpaceBeforeBlocks = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Checks whether the given node represents the body of a function.
	 * @param {ASTNode} node the node to check.
	 * @returns {boolean} `true` if the node is function body.
	 */
	function isFunctionBody(node) {
		const parent = node.parent;

		return (
			node.type === "BlockStatement" &&
			astUtils.isFunction(parent) &&
			parent.body === node
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spaceBeforeBlocks = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "space-before-blocks",
							url: "https://eslint.style/rules/js/space-before-blocks",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing before blocks",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/space-before-blocks",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never"],
						},
						{
							type: "object",
							properties: {
								keywords: {
									enum: ["always", "never", "off"],
								},
								functions: {
									enum: ["always", "never", "off"],
								},
								classes: {
									enum: ["always", "never", "off"],
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				unexpectedSpace: "Unexpected space before opening brace.",
				missingSpace: "Missing space before opening brace.",
			},
		},

		create(context) {
			const config = context.options[0],
				sourceCode = context.sourceCode;
			let alwaysFunctions = true,
				alwaysKeywords = true,
				alwaysClasses = true,
				neverFunctions = false,
				neverKeywords = false,
				neverClasses = false;

			if (typeof config === "object") {
				alwaysFunctions = config.functions === "always";
				alwaysKeywords = config.keywords === "always";
				alwaysClasses = config.classes === "always";
				neverFunctions = config.functions === "never";
				neverKeywords = config.keywords === "never";
				neverClasses = config.classes === "never";
			} else if (config === "never") {
				alwaysFunctions = false;
				alwaysKeywords = false;
				alwaysClasses = false;
				neverFunctions = true;
				neverKeywords = true;
				neverClasses = true;
			}

			/**
			 * Checks whether the spacing before the given block is already controlled by another rule:
			 * - `arrow-spacing` checks spaces after `=>`.
			 * - `keyword-spacing` checks spaces after keywords in certain contexts.
			 * - `switch-colon-spacing` checks spaces after `:` of switch cases.
			 * @param {Token} precedingToken first token before the block.
			 * @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node.
			 * @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules.
			 */
			function isConflicted(precedingToken, node) {
				return (
					astUtils.isArrowToken(precedingToken) ||
					(astUtils.isKeywordToken(precedingToken) &&
						!isFunctionBody(node)) ||
					(astUtils.isColonToken(precedingToken) &&
						node.parent &&
						node.parent.type === "SwitchCase" &&
						precedingToken ===
							astUtils.getSwitchCaseColonToken(
								node.parent,
								sourceCode,
							))
				);
			}

			/**
			 * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line.
			 * @param {ASTNode|Token} node The AST node of a BlockStatement.
			 * @returns {void} undefined.
			 */
			function checkPrecedingSpace(node) {
				const precedingToken = sourceCode.getTokenBefore(node);

				if (
					precedingToken &&
					!isConflicted(precedingToken, node) &&
					astUtils.isTokenOnSameLine(precedingToken, node)
				) {
					const hasSpace = sourceCode.isSpaceBetweenTokens(
						precedingToken,
						node,
					);
					let requireSpace;
					let requireNoSpace;

					if (isFunctionBody(node)) {
						requireSpace = alwaysFunctions;
						requireNoSpace = neverFunctions;
					} else if (node.type === "ClassBody") {
						requireSpace = alwaysClasses;
						requireNoSpace = neverClasses;
					} else {
						requireSpace = alwaysKeywords;
						requireNoSpace = neverKeywords;
					}

					if (requireSpace && !hasSpace) {
						context.report({
							node,
							messageId: "missingSpace",
							fix(fixer) {
								return fixer.insertTextBefore(node, " ");
							},
						});
					} else if (requireNoSpace && hasSpace) {
						context.report({
							node,
							messageId: "unexpectedSpace",
							fix(fixer) {
								return fixer.removeRange([
									precedingToken.range[1],
									node.range[0],
								]);
							},
						});
					}
				}
			}

			/**
			 * Checks if the CaseBlock of an given SwitchStatement node has a preceding space.
			 * @param {ASTNode} node The node of a SwitchStatement.
			 * @returns {void} undefined.
			 */
			function checkSpaceBeforeCaseBlock(node) {
				const cases = node.cases;
				let openingBrace;

				if (cases.length > 0) {
					openingBrace = sourceCode.getTokenBefore(cases[0]);
				} else {
					openingBrace = sourceCode.getLastToken(node, 1);
				}

				checkPrecedingSpace(openingBrace);
			}

			return {
				BlockStatement: checkPrecedingSpace,
				ClassBody: checkPrecedingSpace,
				SwitchStatement: checkSpaceBeforeCaseBlock,
			};
		},
	};
	return spaceBeforeBlocks;
}

/**
 * @fileoverview Rule to validate spacing before function paren.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

var spaceBeforeFunctionParen;
var hasRequiredSpaceBeforeFunctionParen;

function requireSpaceBeforeFunctionParen () {
	if (hasRequiredSpaceBeforeFunctionParen) return spaceBeforeFunctionParen;
	hasRequiredSpaceBeforeFunctionParen = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spaceBeforeFunctionParen = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "space-before-function-paren",
							url: "https://eslint.style/rules/js/space-before-function-paren",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing before `function` definition opening parenthesis",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/space-before-function-paren",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["always", "never"],
						},
						{
							type: "object",
							properties: {
								anonymous: {
									enum: ["always", "never", "ignore"],
								},
								named: {
									enum: ["always", "never", "ignore"],
								},
								asyncArrow: {
									enum: ["always", "never", "ignore"],
								},
							},
							additionalProperties: false,
						},
					],
				},
			],

			messages: {
				unexpectedSpace: "Unexpected space before function parentheses.",
				missingSpace: "Missing space before function parentheses.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const baseConfig =
				typeof context.options[0] === "string"
					? context.options[0]
					: "always";
			const overrideConfig =
				typeof context.options[0] === "object" ? context.options[0] : {};

			/**
			 * Determines whether a function has a name.
			 * @param {ASTNode} node The function node.
			 * @returns {boolean} Whether the function has a name.
			 */
			function isNamedFunction(node) {
				if (node.id) {
					return true;
				}

				const parent = node.parent;

				return (
					parent.type === "MethodDefinition" ||
					(parent.type === "Property" &&
						(parent.kind === "get" ||
							parent.kind === "set" ||
							parent.method))
				);
			}

			/**
			 * Gets the config for a given function
			 * @param {ASTNode} node The function node
			 * @returns {string} "always", "never", or "ignore"
			 */
			function getConfigForFunction(node) {
				if (node.type === "ArrowFunctionExpression") {
					// Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar
					if (
						node.async &&
						astUtils.isOpeningParenToken(
							sourceCode.getFirstToken(node, { skip: 1 }),
						)
					) {
						return overrideConfig.asyncArrow || baseConfig;
					}
				} else if (isNamedFunction(node)) {
					return overrideConfig.named || baseConfig;

					// `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}`
				} else if (!node.generator) {
					return overrideConfig.anonymous || baseConfig;
				}

				return "ignore";
			}

			/**
			 * Checks the parens of a function node
			 * @param {ASTNode} node A function node
			 * @returns {void}
			 */
			function checkFunction(node) {
				const functionConfig = getConfigForFunction(node);

				if (functionConfig === "ignore") {
					return;
				}

				const rightToken = sourceCode.getFirstToken(
					node,
					astUtils.isOpeningParenToken,
				);
				const leftToken = sourceCode.getTokenBefore(rightToken);
				const hasSpacing = sourceCode.isSpaceBetweenTokens(
					leftToken,
					rightToken,
				);

				if (hasSpacing && functionConfig === "never") {
					context.report({
						node,
						loc: {
							start: leftToken.loc.end,
							end: rightToken.loc.start,
						},
						messageId: "unexpectedSpace",
						fix(fixer) {
							const comments =
								sourceCode.getCommentsBefore(rightToken);

							// Don't fix anything if there's a single line comment between the left and the right token
							if (comments.some(comment => comment.type === "Line")) {
								return null;
							}
							return fixer.replaceTextRange(
								[leftToken.range[1], rightToken.range[0]],
								comments.reduce(
									(text, comment) =>
										text + sourceCode.getText(comment),
									"",
								),
							);
						},
					});
				} else if (!hasSpacing && functionConfig === "always") {
					context.report({
						node,
						loc: rightToken.loc,
						messageId: "missingSpace",
						fix: fixer => fixer.insertTextAfter(leftToken, " "),
					});
				}
			}

			return {
				ArrowFunctionExpression: checkFunction,
				FunctionDeclaration: checkFunction,
				FunctionExpression: checkFunction,
			};
		},
	};
	return spaceBeforeFunctionParen;
}

/**
 * @fileoverview Disallows or enforces spaces inside of parentheses.
 * @author Jonathan Rajavuori
 * @deprecated in ESLint v8.53.0
 */

var spaceInParens;
var hasRequiredSpaceInParens;

function requireSpaceInParens () {
	if (hasRequiredSpaceInParens) return spaceInParens;
	hasRequiredSpaceInParens = 1;

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spaceInParens = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "space-in-parens",
							url: "https://eslint.style/rules/js/space-in-parens",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce consistent spacing inside parentheses",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/space-in-parens",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: {
								enum: ["{}", "[]", "()", "empty"],
							},
							uniqueItems: true,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missingOpeningSpace: "There must be a space after this paren.",
				missingClosingSpace: "There must be a space before this paren.",
				rejectedOpeningSpace: "There should be no space after this paren.",
				rejectedClosingSpace: "There should be no space before this paren.",
			},
		},

		create(context) {
			const ALWAYS = context.options[0] === "always",
				exceptionsArrayOptions =
					(context.options[1] && context.options[1].exceptions) || [],
				options = {};

			let exceptions;

			if (exceptionsArrayOptions.length) {
				options.braceException = exceptionsArrayOptions.includes("{}");
				options.bracketException = exceptionsArrayOptions.includes("[]");
				options.parenException = exceptionsArrayOptions.includes("()");
				options.empty = exceptionsArrayOptions.includes("empty");
			}

			/**
			 * Produces an object with the opener and closer exception values
			 * @returns {Object} `openers` and `closers` exception values
			 * @private
			 */
			function getExceptions() {
				const openers = [],
					closers = [];

				if (options.braceException) {
					openers.push("{");
					closers.push("}");
				}

				if (options.bracketException) {
					openers.push("[");
					closers.push("]");
				}

				if (options.parenException) {
					openers.push("(");
					closers.push(")");
				}

				if (options.empty) {
					openers.push(")");
					closers.push("(");
				}

				return {
					openers,
					closers,
				};
			}

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------
			const sourceCode = context.sourceCode;

			/**
			 * Determines if a token is one of the exceptions for the opener paren
			 * @param {Object} token The token to check
			 * @returns {boolean} True if the token is one of the exceptions for the opener paren
			 */
			function isOpenerException(token) {
				return exceptions.openers.includes(token.value);
			}

			/**
			 * Determines if a token is one of the exceptions for the closer paren
			 * @param {Object} token The token to check
			 * @returns {boolean} True if the token is one of the exceptions for the closer paren
			 */
			function isCloserException(token) {
				return exceptions.closers.includes(token.value);
			}

			/**
			 * Determines if an opening paren is immediately followed by a required space
			 * @param {Object} openingParenToken The paren token
			 * @param {Object} tokenAfterOpeningParen The token after it
			 * @returns {boolean} True if the opening paren is missing a required space
			 */
			function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) {
				if (
					sourceCode.isSpaceBetweenTokens(
						openingParenToken,
						tokenAfterOpeningParen,
					)
				) {
					return false;
				}

				if (
					!options.empty &&
					astUtils.isClosingParenToken(tokenAfterOpeningParen)
				) {
					return false;
				}

				if (ALWAYS) {
					return !isOpenerException(tokenAfterOpeningParen);
				}
				return isOpenerException(tokenAfterOpeningParen);
			}

			/**
			 * Determines if an opening paren is immediately followed by a disallowed space
			 * @param {Object} openingParenToken The paren token
			 * @param {Object} tokenAfterOpeningParen The token after it
			 * @returns {boolean} True if the opening paren has a disallowed space
			 */
			function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) {
				if (
					!astUtils.isTokenOnSameLine(
						openingParenToken,
						tokenAfterOpeningParen,
					)
				) {
					return false;
				}

				if (tokenAfterOpeningParen.type === "Line") {
					return false;
				}

				if (
					!sourceCode.isSpaceBetweenTokens(
						openingParenToken,
						tokenAfterOpeningParen,
					)
				) {
					return false;
				}

				if (ALWAYS) {
					return isOpenerException(tokenAfterOpeningParen);
				}
				return !isOpenerException(tokenAfterOpeningParen);
			}

			/**
			 * Determines if a closing paren is immediately preceded by a required space
			 * @param {Object} tokenBeforeClosingParen The token before the paren
			 * @param {Object} closingParenToken The paren token
			 * @returns {boolean} True if the closing paren is missing a required space
			 */
			function closerMissingSpace(
				tokenBeforeClosingParen,
				closingParenToken,
			) {
				if (
					sourceCode.isSpaceBetweenTokens(
						tokenBeforeClosingParen,
						closingParenToken,
					)
				) {
					return false;
				}

				if (
					!options.empty &&
					astUtils.isOpeningParenToken(tokenBeforeClosingParen)
				) {
					return false;
				}

				if (ALWAYS) {
					return !isCloserException(tokenBeforeClosingParen);
				}
				return isCloserException(tokenBeforeClosingParen);
			}

			/**
			 * Determines if a closer paren is immediately preceded by a disallowed space
			 * @param {Object} tokenBeforeClosingParen The token before the paren
			 * @param {Object} closingParenToken The paren token
			 * @returns {boolean} True if the closing paren has a disallowed space
			 */
			function closerRejectsSpace(
				tokenBeforeClosingParen,
				closingParenToken,
			) {
				if (
					!astUtils.isTokenOnSameLine(
						tokenBeforeClosingParen,
						closingParenToken,
					)
				) {
					return false;
				}

				if (
					!sourceCode.isSpaceBetweenTokens(
						tokenBeforeClosingParen,
						closingParenToken,
					)
				) {
					return false;
				}

				if (ALWAYS) {
					return isCloserException(tokenBeforeClosingParen);
				}
				return !isCloserException(tokenBeforeClosingParen);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: function checkParenSpaces(node) {
					exceptions = getExceptions();
					const tokens = sourceCode.tokensAndComments;

					tokens.forEach((token, i) => {
						const prevToken = tokens[i - 1];
						const nextToken = tokens[i + 1];

						// if token is not an opening or closing paren token, do nothing
						if (
							!astUtils.isOpeningParenToken(token) &&
							!astUtils.isClosingParenToken(token)
						) {
							return;
						}

						// if token is an opening paren and is not followed by a required space
						if (
							token.value === "(" &&
							openerMissingSpace(token, nextToken)
						) {
							context.report({
								node,
								loc: token.loc,
								messageId: "missingOpeningSpace",
								fix(fixer) {
									return fixer.insertTextAfter(token, " ");
								},
							});
						}

						// if token is an opening paren and is followed by a disallowed space
						if (
							token.value === "(" &&
							openerRejectsSpace(token, nextToken)
						) {
							context.report({
								node,
								loc: {
									start: token.loc.end,
									end: nextToken.loc.start,
								},
								messageId: "rejectedOpeningSpace",
								fix(fixer) {
									return fixer.removeRange([
										token.range[1],
										nextToken.range[0],
									]);
								},
							});
						}

						// if token is a closing paren and is not preceded by a required space
						if (
							token.value === ")" &&
							closerMissingSpace(prevToken, token)
						) {
							context.report({
								node,
								loc: token.loc,
								messageId: "missingClosingSpace",
								fix(fixer) {
									return fixer.insertTextBefore(token, " ");
								},
							});
						}

						// if token is a closing paren and is preceded by a disallowed space
						if (
							token.value === ")" &&
							closerRejectsSpace(prevToken, token)
						) {
							context.report({
								node,
								loc: {
									start: prevToken.loc.end,
									end: token.loc.start,
								},
								messageId: "rejectedClosingSpace",
								fix(fixer) {
									return fixer.removeRange([
										prevToken.range[1],
										token.range[0],
									]);
								},
							});
						}
					});
				},
			};
		},
	};
	return spaceInParens;
}

/**
 * @fileoverview Require spaces around infix operators
 * @author Michael Ficarra
 * @deprecated in ESLint v8.53.0
 */

var spaceInfixOps;
var hasRequiredSpaceInfixOps;

function requireSpaceInfixOps () {
	if (hasRequiredSpaceInfixOps) return spaceInfixOps;
	hasRequiredSpaceInfixOps = 1;

	const { isEqToken } = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spaceInfixOps = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "space-infix-ops",
							url: "https://eslint.style/rules/js/space-infix-ops",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require spacing around infix operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/space-infix-ops",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						int32Hint: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				missingSpace: "Operator '{{operator}}' must be spaced.",
			},
		},

		create(context) {
			const int32Hint = context.options[0]
				? context.options[0].int32Hint === true
				: false;
			const sourceCode = context.sourceCode;

			/**
			 * Returns the first token which violates the rule
			 * @param {ASTNode} left The left node of the main node
			 * @param {ASTNode} right The right node of the main node
			 * @param {string} op The operator of the main node
			 * @returns {Object} The violator token or null
			 * @private
			 */
			function getFirstNonSpacedToken(left, right, op) {
				const operator = sourceCode.getFirstTokenBetween(
					left,
					right,
					token => token.value === op,
				);
				const prev = sourceCode.getTokenBefore(operator);
				const next = sourceCode.getTokenAfter(operator);

				if (
					!sourceCode.isSpaceBetweenTokens(prev, operator) ||
					!sourceCode.isSpaceBetweenTokens(operator, next)
				) {
					return operator;
				}

				return null;
			}

			/**
			 * Reports an AST node as a rule violation
			 * @param {ASTNode} mainNode The node to report
			 * @param {Object} culpritToken The token which has a problem
			 * @returns {void}
			 * @private
			 */
			function report(mainNode, culpritToken) {
				context.report({
					node: mainNode,
					loc: culpritToken.loc,
					messageId: "missingSpace",
					data: {
						operator: culpritToken.value,
					},
					fix(fixer) {
						const previousToken =
							sourceCode.getTokenBefore(culpritToken);
						const afterToken = sourceCode.getTokenAfter(culpritToken);
						let fixString = "";

						if (culpritToken.range[0] - previousToken.range[1] === 0) {
							fixString = " ";
						}

						fixString += culpritToken.value;

						if (afterToken.range[0] - culpritToken.range[1] === 0) {
							fixString += " ";
						}

						return fixer.replaceText(culpritToken, fixString);
					},
				});
			}

			/**
			 * Check if the node is binary then report
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkBinary(node) {
				const leftNode = node.left.typeAnnotation
					? node.left.typeAnnotation
					: node.left;
				const rightNode = node.right;

				// search for = in AssignmentPattern nodes
				const operator = node.operator || "=";

				const nonSpacedNode = getFirstNonSpacedToken(
					leftNode,
					rightNode,
					operator,
				);

				if (nonSpacedNode) {
					if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) {
						report(node, nonSpacedNode);
					}
				}
			}

			/**
			 * Check if the node is conditional
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkConditional(node) {
				const nonSpacedConsequentNode = getFirstNonSpacedToken(
					node.test,
					node.consequent,
					"?",
				);
				const nonSpacedAlternateNode = getFirstNonSpacedToken(
					node.consequent,
					node.alternate,
					":",
				);

				if (nonSpacedConsequentNode) {
					report(node, nonSpacedConsequentNode);
				}

				if (nonSpacedAlternateNode) {
					report(node, nonSpacedAlternateNode);
				}
			}

			/**
			 * Check if the node is a variable
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkVar(node) {
				const leftNode = node.id.typeAnnotation
					? node.id.typeAnnotation
					: node.id;
				const rightNode = node.init;

				if (rightNode) {
					const nonSpacedNode = getFirstNonSpacedToken(
						leftNode,
						rightNode,
						"=",
					);

					if (nonSpacedNode) {
						report(node, nonSpacedNode);
					}
				}
			}

			return {
				AssignmentExpression: checkBinary,
				AssignmentPattern: checkBinary,
				BinaryExpression: checkBinary,
				LogicalExpression: checkBinary,
				ConditionalExpression: checkConditional,
				VariableDeclarator: checkVar,

				PropertyDefinition(node) {
					if (!node.value) {
						return;
					}

					/*
					 * Because of computed properties and type annotations, some
					 * tokens may exist between `node.key` and `=`.
					 * Therefore, find the `=` from the right.
					 */
					const operatorToken = sourceCode.getTokenBefore(
						node.value,
						isEqToken,
					);
					const leftToken = sourceCode.getTokenBefore(operatorToken);
					const rightToken = sourceCode.getTokenAfter(operatorToken);

					if (
						!sourceCode.isSpaceBetweenTokens(
							leftToken,
							operatorToken,
						) ||
						!sourceCode.isSpaceBetweenTokens(operatorToken, rightToken)
					) {
						report(node, operatorToken);
					}
				},
			};
		},
	};
	return spaceInfixOps;
}

/**
 * @fileoverview This rule should require or disallow spaces before or after unary operations.
 * @author Marcin Kumorek
 * @deprecated in ESLint v8.53.0
 */

var spaceUnaryOps;
var hasRequiredSpaceUnaryOps;

function requireSpaceUnaryOps () {
	if (hasRequiredSpaceUnaryOps) return spaceUnaryOps;
	hasRequiredSpaceUnaryOps = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spaceUnaryOps = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "space-unary-ops",
							url: "https://eslint.style/rules/js/space-unary-ops",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Enforce consistent spacing before or after unary operators",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/space-unary-ops",
			},

			fixable: "whitespace",

			schema: [
				{
					type: "object",
					properties: {
						words: {
							type: "boolean",
							default: true,
						},
						nonwords: {
							type: "boolean",
							default: false,
						},
						overrides: {
							type: "object",
							additionalProperties: {
								type: "boolean",
							},
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				unexpectedBefore:
					"Unexpected space before unary operator '{{operator}}'.",
				unexpectedAfter:
					"Unexpected space after unary operator '{{operator}}'.",
				unexpectedAfterWord:
					"Unexpected space after unary word operator '{{word}}'.",
				wordOperator:
					"Unary word operator '{{word}}' must be followed by whitespace.",
				operator:
					"Unary operator '{{operator}}' must be followed by whitespace.",
				beforeUnaryExpressions:
					"Space is required before unary expressions '{{token}}'.",
			},
		},

		create(context) {
			const options = context.options[0] || { words: true, nonwords: false };

			const sourceCode = context.sourceCode;

			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Check if the node is the first "!" in a "!!" convert to Boolean expression
			 * @param {ASTnode} node AST node
			 * @returns {boolean} Whether or not the node is first "!" in "!!"
			 */
			function isFirstBangInBangBangExpression(node) {
				return (
					node &&
					node.type === "UnaryExpression" &&
					node.argument.operator === "!" &&
					node.argument &&
					node.argument.type === "UnaryExpression" &&
					node.argument.operator === "!"
				);
			}

			/**
			 * Checks if an override exists for a given operator.
			 * @param {string} operator Operator
			 * @returns {boolean} Whether or not an override has been provided for the operator
			 */
			function overrideExistsForOperator(operator) {
				return (
					options.overrides && Object.hasOwn(options.overrides, operator)
				);
			}

			/**
			 * Gets the value that the override was set to for this operator
			 * @param {string} operator Operator
			 * @returns {boolean} Whether or not an override enforces a space with this operator
			 */
			function overrideEnforcesSpaces(operator) {
				return options.overrides[operator];
			}

			/**
			 * Verify Unary Word Operator has spaces after the word operator
			 * @param {ASTnode} node AST node
			 * @param {Object} firstToken first token from the AST node
			 * @param {Object} secondToken second token from the AST node
			 * @param {string} word The word to be used for reporting
			 * @returns {void}
			 */
			function verifyWordHasSpaces(node, firstToken, secondToken, word) {
				if (secondToken.range[0] === firstToken.range[1]) {
					context.report({
						node,
						messageId: "wordOperator",
						data: {
							word,
						},
						fix(fixer) {
							return fixer.insertTextAfter(firstToken, " ");
						},
					});
				}
			}

			/**
			 * Verify Unary Word Operator doesn't have spaces after the word operator
			 * @param {ASTnode} node AST node
			 * @param {Object} firstToken first token from the AST node
			 * @param {Object} secondToken second token from the AST node
			 * @param {string} word The word to be used for reporting
			 * @returns {void}
			 */
			function verifyWordDoesntHaveSpaces(
				node,
				firstToken,
				secondToken,
				word,
			) {
				if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) {
					if (secondToken.range[0] > firstToken.range[1]) {
						context.report({
							node,
							messageId: "unexpectedAfterWord",
							data: {
								word,
							},
							fix(fixer) {
								return fixer.removeRange([
									firstToken.range[1],
									secondToken.range[0],
								]);
							},
						});
					}
				}
			}

			/**
			 * Check Unary Word Operators for spaces after the word operator
			 * @param {ASTnode} node AST node
			 * @param {Object} firstToken first token from the AST node
			 * @param {Object} secondToken second token from the AST node
			 * @param {string} word The word to be used for reporting
			 * @returns {void}
			 */
			function checkUnaryWordOperatorForSpaces(
				node,
				firstToken,
				secondToken,
				word,
			) {
				if (overrideExistsForOperator(word)) {
					if (overrideEnforcesSpaces(word)) {
						verifyWordHasSpaces(node, firstToken, secondToken, word);
					} else {
						verifyWordDoesntHaveSpaces(
							node,
							firstToken,
							secondToken,
							word,
						);
					}
				} else if (options.words) {
					verifyWordHasSpaces(node, firstToken, secondToken, word);
				} else {
					verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
				}
			}

			/**
			 * Verifies YieldExpressions satisfy spacing requirements
			 * @param {ASTnode} node AST node
			 * @returns {void}
			 */
			function checkForSpacesAfterYield(node) {
				const tokens = sourceCode.getFirstTokens(node, 3),
					word = "yield";

				if (!node.argument || node.delegate) {
					return;
				}

				checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
			}

			/**
			 * Verifies AwaitExpressions satisfy spacing requirements
			 * @param {ASTNode} node AwaitExpression AST node
			 * @returns {void}
			 */
			function checkForSpacesAfterAwait(node) {
				const tokens = sourceCode.getFirstTokens(node, 3);

				checkUnaryWordOperatorForSpaces(
					node,
					tokens[0],
					tokens[1],
					"await",
				);
			}

			/**
			 * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator
			 * @param {ASTnode} node AST node
			 * @param {Object} firstToken First token in the expression
			 * @param {Object} secondToken Second token in the expression
			 * @returns {void}
			 */
			function verifyNonWordsHaveSpaces(node, firstToken, secondToken) {
				if (node.prefix) {
					if (isFirstBangInBangBangExpression(node)) {
						return;
					}
					if (firstToken.range[1] === secondToken.range[0]) {
						context.report({
							node,
							messageId: "operator",
							data: {
								operator: firstToken.value,
							},
							fix(fixer) {
								return fixer.insertTextAfter(firstToken, " ");
							},
						});
					}
				} else {
					if (firstToken.range[1] === secondToken.range[0]) {
						context.report({
							node,
							messageId: "beforeUnaryExpressions",
							data: {
								token: secondToken.value,
							},
							fix(fixer) {
								return fixer.insertTextBefore(secondToken, " ");
							},
						});
					}
				}
			}

			/**
			 * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator
			 * @param {ASTnode} node AST node
			 * @param {Object} firstToken First token in the expression
			 * @param {Object} secondToken Second token in the expression
			 * @returns {void}
			 */
			function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
				if (node.prefix) {
					if (secondToken.range[0] > firstToken.range[1]) {
						context.report({
							node,
							messageId: "unexpectedAfter",
							data: {
								operator: firstToken.value,
							},
							fix(fixer) {
								if (
									astUtils.canTokensBeAdjacent(
										firstToken,
										secondToken,
									)
								) {
									return fixer.removeRange([
										firstToken.range[1],
										secondToken.range[0],
									]);
								}
								return null;
							},
						});
					}
				} else {
					if (secondToken.range[0] > firstToken.range[1]) {
						context.report({
							node,
							messageId: "unexpectedBefore",
							data: {
								operator: secondToken.value,
							},
							fix(fixer) {
								return fixer.removeRange([
									firstToken.range[1],
									secondToken.range[0],
								]);
							},
						});
					}
				}
			}

			/**
			 * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements
			 * @param {ASTnode} node AST node
			 * @returns {void}
			 */
			function checkForSpaces(node) {
				const tokens =
					node.type === "UpdateExpression" && !node.prefix
						? sourceCode.getLastTokens(node, 2)
						: sourceCode.getFirstTokens(node, 2);
				const firstToken = tokens[0];
				const secondToken = tokens[1];

				if (
					(node.type === "NewExpression" || node.prefix) &&
					firstToken.type === "Keyword"
				) {
					checkUnaryWordOperatorForSpaces(
						node,
						firstToken,
						secondToken,
						firstToken.value,
					);
					return;
				}

				const operator = node.prefix ? tokens[0].value : tokens[1].value;

				if (overrideExistsForOperator(operator)) {
					if (overrideEnforcesSpaces(operator)) {
						verifyNonWordsHaveSpaces(node, firstToken, secondToken);
					} else {
						verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
					}
				} else if (options.nonwords) {
					verifyNonWordsHaveSpaces(node, firstToken, secondToken);
				} else {
					verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
				}
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				UnaryExpression: checkForSpaces,
				UpdateExpression: checkForSpaces,
				NewExpression: checkForSpaces,
				YieldExpression: checkForSpacesAfterYield,
				AwaitExpression: checkForSpacesAfterAwait,
			};
		},
	};
	return spaceUnaryOps;
}

/**
 * @fileoverview Source code for spaced-comments rule
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */

var spacedComment;
var hasRequiredSpacedComment;

function requireSpacedComment () {
	if (hasRequiredSpacedComment) return spacedComment;
	hasRequiredSpacedComment = 1;

	const escapeRegExp = requireEscapeStringRegexp();
	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Escapes the control characters of a given string.
	 * @param {string} s A string to escape.
	 * @returns {string} An escaped string.
	 */
	function escape(s) {
		return `(?:${escapeRegExp(s)})`;
	}

	/**
	 * Escapes the control characters of a given string.
	 * And adds a repeat flag.
	 * @param {string} s A string to escape.
	 * @returns {string} An escaped string.
	 */
	function escapeAndRepeat(s) {
		return `${escape(s)}+`;
	}

	/**
	 * Parses `markers` option.
	 * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments.
	 * @param {string[]} [markers] A marker list.
	 * @returns {string[]} A marker list.
	 */
	function parseMarkersOption(markers) {
		// `*` is a marker for JSDoc comments.
		if (!markers.includes("*")) {
			return markers.concat("*");
		}

		return markers;
	}

	/**
	 * Creates string pattern for exceptions.
	 * Generated pattern:
	 *
	 * 1. A space or an exception pattern sequence.
	 * @param {string[]} exceptions An exception pattern list.
	 * @returns {string} A regular expression string for exceptions.
	 */
	function createExceptionsPattern(exceptions) {
		let pattern = "";

		/*
		 * A space or an exception pattern sequence.
		 * []                 ==> "\s"
		 * ["-"]              ==> "(?:\s|\-+$)"
		 * ["-", "="]         ==> "(?:\s|(?:\-+|=+)$)"
		 * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24)
		 */
		if (exceptions.length === 0) {
			// a space.
			pattern += "\\s";
		} else {
			// a space or...
			pattern += "(?:\\s|";

			if (exceptions.length === 1) {
				// a sequence of the exception pattern.
				pattern += escapeAndRepeat(exceptions[0]);
			} else {
				// a sequence of one of the exception patterns.
				pattern += "(?:";
				pattern += exceptions.map(escapeAndRepeat).join("|");
				pattern += ")";
			}
			pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`;
		}

		return pattern;
	}

	/**
	 * Creates RegExp object for `always` mode.
	 * Generated pattern for beginning of comment:
	 *
	 * 1. First, a marker or nothing.
	 * 2. Next, a space or an exception pattern sequence.
	 * @param {string[]} markers A marker list.
	 * @param {string[]} exceptions An exception pattern list.
	 * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode.
	 */
	function createAlwaysStylePattern(markers, exceptions) {
		let pattern = "^";

		/*
		 * A marker or nothing.
		 * ["*"]            ==> "\*?"
		 * ["*", "!"]       ==> "(?:\*|!)?"
		 * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
		 */
		if (markers.length === 1) {
			// the marker.
			pattern += escape(markers[0]);
		} else {
			// one of markers.
			pattern += "(?:";
			pattern += markers.map(escape).join("|");
			pattern += ")";
		}

		pattern += "?"; // or nothing.
		pattern += createExceptionsPattern(exceptions);

		return new RegExp(pattern, "u");
	}

	/**
	 * Creates RegExp object for `never` mode.
	 * Generated pattern for beginning of comment:
	 *
	 * 1. First, a marker or nothing (captured).
	 * 2. Next, a space or a tab.
	 * @param {string[]} markers A marker list.
	 * @returns {RegExp} A RegExp object for `never` mode.
	 */
	function createNeverStylePattern(markers) {
		const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`;

		return new RegExp(pattern, "u");
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	spacedComment = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "spaced-comment",
							url: "https://eslint.style/rules/js/spaced-comment",
						},
					},
				],
			},
			type: "suggestion",

			docs: {
				description:
					"Enforce consistent spacing after the `//` or `/*` in a comment",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/spaced-comment",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						exceptions: {
							type: "array",
							items: {
								type: "string",
							},
						},
						markers: {
							type: "array",
							items: {
								type: "string",
							},
						},
						line: {
							type: "object",
							properties: {
								exceptions: {
									type: "array",
									items: {
										type: "string",
									},
								},
								markers: {
									type: "array",
									items: {
										type: "string",
									},
								},
							},
							additionalProperties: false,
						},
						block: {
							type: "object",
							properties: {
								exceptions: {
									type: "array",
									items: {
										type: "string",
									},
								},
								markers: {
									type: "array",
									items: {
										type: "string",
									},
								},
								balanced: {
									type: "boolean",
									default: false,
								},
							},
							additionalProperties: false,
						},
					},
					additionalProperties: false,
				},
			],

			messages: {
				unexpectedSpaceAfterMarker:
					"Unexpected space or tab after marker ({{refChar}}) in comment.",
				expectedExceptionAfter:
					"Expected exception block, space or tab after '{{refChar}}' in comment.",
				unexpectedSpaceBefore:
					"Unexpected space or tab before '*/' in comment.",
				unexpectedSpaceAfter:
					"Unexpected space or tab after '{{refChar}}' in comment.",
				expectedSpaceBefore:
					"Expected space or tab before '*/' in comment.",
				expectedSpaceAfter:
					"Expected space or tab after '{{refChar}}' in comment.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			// Unless the first option is never, require a space
			const requireSpace = context.options[0] !== "never";

			/*
			 * Parse the second options.
			 * If markers don't include `"*"`, it's added automatically for JSDoc
			 * comments.
			 */
			const config = context.options[1] || {};
			const balanced = config.block && config.block.balanced;

			const styleRules = ["block", "line"].reduce((rule, type) => {
				const markers = parseMarkersOption(
					(config[type] && config[type].markers) || config.markers || [],
				);
				const exceptions =
					(config[type] && config[type].exceptions) ||
					config.exceptions ||
					[];
				const endNeverPattern = "[ \t]+$";

				// Create RegExp object for valid patterns.
				rule[type] = {
					beginRegex: requireSpace
						? createAlwaysStylePattern(markers, exceptions)
						: createNeverStylePattern(markers),
					endRegex:
						balanced && requireSpace
							? new RegExp(
									`${createExceptionsPattern(exceptions)}$`,
									"u",
								)
							: new RegExp(endNeverPattern, "u"),
					hasExceptions: exceptions.length > 0,
					captureMarker: new RegExp(
						`^(${markers.map(escape).join("|")})`,
						"u",
					),
					markers: new Set(markers),
				};

				return rule;
			}, {});

			/**
			 * Reports a beginning spacing error with an appropriate message.
			 * @param {ASTNode} node A comment node to check.
			 * @param {string} messageId An error message to report.
			 * @param {Array} match An array of match results for markers.
			 * @param {string} refChar Character used for reference in the error message.
			 * @returns {void}
			 */
			function reportBegin(node, messageId, match, refChar) {
				const type = node.type.toLowerCase(),
					commentIdentifier = type === "block" ? "/*" : "//";

				context.report({
					node,
					fix(fixer) {
						const start = node.range[0];
						let end = start + 2;

						if (requireSpace) {
							if (match) {
								end += match[0].length;
							}
							return fixer.insertTextAfterRange([start, end], " ");
						}
						end += match[0].length;
						return fixer.replaceTextRange(
							[start, end],
							commentIdentifier + (match[1] ? match[1] : ""),
						);
					},
					messageId,
					data: { refChar },
				});
			}

			/**
			 * Reports an ending spacing error with an appropriate message.
			 * @param {ASTNode} node A comment node to check.
			 * @param {string} messageId An error message to report.
			 * @param {string} match An array of the matched whitespace characters.
			 * @returns {void}
			 */
			function reportEnd(node, messageId, match) {
				context.report({
					node,
					fix(fixer) {
						if (requireSpace) {
							return fixer.insertTextAfterRange(
								[node.range[0], node.range[1] - 2],
								" ",
							);
						}
						const end = node.range[1] - 2,
							start = end - match[0].length;

						return fixer.replaceTextRange([start, end], "");
					},
					messageId,
				});
			}

			/**
			 * Reports a given comment if it's invalid.
			 * @param {ASTNode} node a comment node to check.
			 * @returns {void}
			 */
			function checkCommentForSpace(node) {
				const type = node.type.toLowerCase(),
					rule = styleRules[type],
					commentIdentifier = type === "block" ? "/*" : "//";

				// Ignores empty comments and comments that consist only of a marker.
				if (node.value.length === 0 || rule.markers.has(node.value)) {
					return;
				}

				const beginMatch = rule.beginRegex.exec(node.value);
				const endMatch = rule.endRegex.exec(node.value);

				// Checks.
				if (requireSpace) {
					if (!beginMatch) {
						const hasMarker = rule.captureMarker.exec(node.value);
						const marker = hasMarker
							? commentIdentifier + hasMarker[0]
							: commentIdentifier;

						if (rule.hasExceptions) {
							reportBegin(
								node,
								"expectedExceptionAfter",
								hasMarker,
								marker,
							);
						} else {
							reportBegin(
								node,
								"expectedSpaceAfter",
								hasMarker,
								marker,
							);
						}
					}

					if (balanced && type === "block" && !endMatch) {
						reportEnd(node, "expectedSpaceBefore");
					}
				} else {
					if (beginMatch) {
						if (!beginMatch[1]) {
							reportBegin(
								node,
								"unexpectedSpaceAfter",
								beginMatch,
								commentIdentifier,
							);
						} else {
							reportBegin(
								node,
								"unexpectedSpaceAfterMarker",
								beginMatch,
								beginMatch[1],
							);
						}
					}

					if (balanced && type === "block" && endMatch) {
						reportEnd(node, "unexpectedSpaceBefore", endMatch);
					}
				}
			}

			return {
				Program() {
					const comments = sourceCode.getAllComments();

					comments
						.filter(token => token.type !== "Shebang")
						.forEach(checkCommentForSpace);
				},
			};
		},
	};
	return spacedComment;
}

/**
 * @fileoverview Rule to control usage of strict mode directives.
 * @author Brandon Mills
 */

var strict;
var hasRequiredStrict;

function requireStrict () {
	if (hasRequiredStrict) return strict;
	hasRequiredStrict = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Gets all of the Use Strict Directives in the Directive Prologue of a group of
	 * statements.
	 * @param {ASTNode[]} statements Statements in the program or function body.
	 * @returns {ASTNode[]} All of the Use Strict Directives.
	 */
	function getUseStrictDirectives(statements) {
		const directives = [];

		for (let i = 0; i < statements.length; i++) {
			const statement = statements[i];

			if (
				statement.type === "ExpressionStatement" &&
				statement.expression.type === "Literal" &&
				statement.expression.value === "use strict"
			) {
				directives[i] = statement;
			} else {
				break;
			}
		}

		return directives;
	}

	/**
	 * Checks whether a given parameter is a simple parameter.
	 * @param {ASTNode} node A pattern node to check.
	 * @returns {boolean} `true` if the node is an Identifier node.
	 */
	function isSimpleParameter(node) {
		return node.type === "Identifier";
	}

	/**
	 * Checks whether a given parameter list is a simple parameter list.
	 * @param {ASTNode[]} params A parameter list to check.
	 * @returns {boolean} `true` if the every parameter is an Identifier node.
	 */
	function isSimpleParameterList(params) {
		return params.every(isSimpleParameter);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	strict = {
		meta: {
			type: "suggestion",

			defaultOptions: ["safe"],

			docs: {
				description: "Require or disallow strict mode directives",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/strict",
			},

			schema: [
				{
					enum: ["never", "global", "function", "safe"],
				},
			],

			fixable: "code",
			messages: {
				function: "Use the function form of 'use strict'.",
				global: "Use the global form of 'use strict'.",
				multiple: "Multiple 'use strict' directives.",
				never: "Strict mode is not permitted.",
				unnecessary: "Unnecessary 'use strict' directive.",
				module: "'use strict' is unnecessary inside of modules.",
				implied:
					"'use strict' is unnecessary when implied strict mode is enabled.",
				unnecessaryInClasses:
					"'use strict' is unnecessary inside of classes.",
				nonSimpleParameterList:
					"'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.",
				wrap: "Wrap {{name}} in a function with 'use strict' directive.",
			},
		},

		create(context) {
			const ecmaFeatures = context.parserOptions.ecmaFeatures || {},
				scopes = [],
				classScopes = [];
			let [mode] = context.options;

			if (ecmaFeatures.impliedStrict) {
				mode = "implied";
			} else if (mode === "safe") {
				mode =
					ecmaFeatures.globalReturn ||
					context.languageOptions.sourceType === "commonjs"
						? "global"
						: "function";
			}

			/**
			 * Determines whether a reported error should be fixed, depending on the error type.
			 * @param {string} errorType The type of error
			 * @returns {boolean} `true` if the reported error should be fixed
			 */
			function shouldFix(errorType) {
				return (
					errorType === "multiple" ||
					errorType === "unnecessary" ||
					errorType === "module" ||
					errorType === "implied" ||
					errorType === "unnecessaryInClasses"
				);
			}

			/**
			 * Gets a fixer function to remove a given 'use strict' directive.
			 * @param {ASTNode} node The directive that should be removed
			 * @returns {Function} A fixer function
			 */
			function getFixFunction(node) {
				return fixer => fixer.remove(node);
			}

			/**
			 * Report a slice of an array of nodes with a given message.
			 * @param {ASTNode[]} nodes Nodes.
			 * @param {string} start Index to start from.
			 * @param {string} end Index to end before.
			 * @param {string} messageId Message to display.
			 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
			 * @returns {void}
			 */
			function reportSlice(nodes, start, end, messageId, fix) {
				nodes.slice(start, end).forEach(node => {
					context.report({
						node,
						messageId,
						fix: fix ? getFixFunction(node) : null,
					});
				});
			}

			/**
			 * Report all nodes in an array with a given message.
			 * @param {ASTNode[]} nodes Nodes.
			 * @param {string} messageId Message id to display.
			 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
			 * @returns {void}
			 */
			function reportAll(nodes, messageId, fix) {
				reportSlice(nodes, 0, nodes.length, messageId, fix);
			}

			/**
			 * Report all nodes in an array, except the first, with a given message.
			 * @param {ASTNode[]} nodes Nodes.
			 * @param {string} messageId Message id to display.
			 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
			 * @returns {void}
			 */
			function reportAllExceptFirst(nodes, messageId, fix) {
				reportSlice(nodes, 1, nodes.length, messageId, fix);
			}

			/**
			 * Entering a function in 'function' mode pushes a new nested scope onto the
			 * stack. The new scope is true if the nested function is strict mode code.
			 * @param {ASTNode} node The function declaration or expression.
			 * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node.
			 * @returns {void}
			 */
			function enterFunctionInFunctionMode(node, useStrictDirectives) {
				const isInClass = classScopes.length > 0,
					isParentGlobal =
						scopes.length === 0 && classScopes.length === 0,
					isParentStrict = scopes.length > 0 && scopes.at(-1),
					isStrict = useStrictDirectives.length > 0;

				if (isStrict) {
					if (!isSimpleParameterList(node.params)) {
						context.report({
							node: useStrictDirectives[0],
							messageId: "nonSimpleParameterList",
						});
					} else if (isParentStrict) {
						context.report({
							node: useStrictDirectives[0],
							messageId: "unnecessary",
							fix: getFixFunction(useStrictDirectives[0]),
						});
					} else if (isInClass) {
						context.report({
							node: useStrictDirectives[0],
							messageId: "unnecessaryInClasses",
							fix: getFixFunction(useStrictDirectives[0]),
						});
					}

					reportAllExceptFirst(useStrictDirectives, "multiple", true);
				} else if (isParentGlobal) {
					if (isSimpleParameterList(node.params)) {
						context.report({ node, messageId: "function" });
					} else {
						context.report({
							node,
							messageId: "wrap",
							data: { name: astUtils.getFunctionNameWithKind(node) },
						});
					}
				}

				scopes.push(isParentStrict || isStrict);
			}

			/**
			 * Exiting a function in 'function' mode pops its scope off the stack.
			 * @returns {void}
			 */
			function exitFunctionInFunctionMode() {
				scopes.pop();
			}

			/**
			 * Enter a function and either:
			 * - Push a new nested scope onto the stack (in 'function' mode).
			 * - Report all the Use Strict Directives (in the other modes).
			 * @param {ASTNode} node The function declaration or expression.
			 * @returns {void}
			 */
			function enterFunction(node) {
				const isBlock = node.body.type === "BlockStatement",
					useStrictDirectives = isBlock
						? getUseStrictDirectives(node.body.body)
						: [];

				if (mode === "function") {
					enterFunctionInFunctionMode(node, useStrictDirectives);
				} else if (useStrictDirectives.length > 0) {
					if (isSimpleParameterList(node.params)) {
						reportAll(useStrictDirectives, mode, shouldFix(mode));
					} else {
						context.report({
							node: useStrictDirectives[0],
							messageId: "nonSimpleParameterList",
						});
						reportAllExceptFirst(useStrictDirectives, "multiple", true);
					}
				}
			}

			const rule = {
				Program(node) {
					const useStrictDirectives = getUseStrictDirectives(node.body);

					if (node.sourceType === "module") {
						mode = "module";
					}

					if (mode === "global") {
						if (
							node.body.length > 0 &&
							useStrictDirectives.length === 0
						) {
							context.report({ node, messageId: "global" });
						}
						reportAllExceptFirst(useStrictDirectives, "multiple", true);
					} else {
						reportAll(useStrictDirectives, mode, shouldFix(mode));
					}
				},
				FunctionDeclaration: enterFunction,
				FunctionExpression: enterFunction,
				ArrowFunctionExpression: enterFunction,
			};

			if (mode === "function") {
				Object.assign(rule, {
					// Inside of class bodies are always strict mode.
					ClassBody() {
						classScopes.push(true);
					},
					"ClassBody:exit"() {
						classScopes.pop();
					},

					"FunctionDeclaration:exit": exitFunctionInFunctionMode,
					"FunctionExpression:exit": exitFunctionInFunctionMode,
					"ArrowFunctionExpression:exit": exitFunctionInFunctionMode,
				});
			}

			return rule;
		},
	};
	return strict;
}

/**
 * @fileoverview Rule to enforce spacing around colons of switch statements.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var switchColonSpacing;
var hasRequiredSwitchColonSpacing;

function requireSwitchColonSpacing () {
	if (hasRequiredSwitchColonSpacing) return switchColonSpacing;
	hasRequiredSwitchColonSpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	switchColonSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "switch-colon-spacing",
							url: "https://eslint.style/rules/js/switch-colon-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Enforce spacing around colons of switch statements",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/switch-colon-spacing",
			},

			schema: [
				{
					type: "object",
					properties: {
						before: { type: "boolean", default: false },
						after: { type: "boolean", default: true },
					},
					additionalProperties: false,
				},
			],
			fixable: "whitespace",
			messages: {
				expectedBefore: "Expected space(s) before this colon.",
				expectedAfter: "Expected space(s) after this colon.",
				unexpectedBefore: "Unexpected space(s) before this colon.",
				unexpectedAfter: "Unexpected space(s) after this colon.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const options = context.options[0] || {};
			const beforeSpacing = options.before === true; // false by default
			const afterSpacing = options.after !== false; // true by default

			/**
			 * Check whether the spacing between the given 2 tokens is valid or not.
			 * @param {Token} left The left token to check.
			 * @param {Token} right The right token to check.
			 * @param {boolean} expected The expected spacing to check. `true` if there should be a space.
			 * @returns {boolean} `true` if the spacing between the tokens is valid.
			 */
			function isValidSpacing(left, right, expected) {
				return (
					astUtils.isClosingBraceToken(right) ||
					!astUtils.isTokenOnSameLine(left, right) ||
					sourceCode.isSpaceBetweenTokens(left, right) === expected
				);
			}

			/**
			 * Check whether comments exist between the given 2 tokens.
			 * @param {Token} left The left token to check.
			 * @param {Token} right The right token to check.
			 * @returns {boolean} `true` if comments exist between the given 2 tokens.
			 */
			function commentsExistBetween(left, right) {
				return (
					sourceCode.getFirstTokenBetween(left, right, {
						includeComments: true,
						filter: astUtils.isCommentToken,
					}) !== null
				);
			}

			/**
			 * Fix the spacing between the given 2 tokens.
			 * @param {RuleFixer} fixer The fixer to fix.
			 * @param {Token} left The left token of fix range.
			 * @param {Token} right The right token of fix range.
			 * @param {boolean} spacing The spacing style. `true` if there should be a space.
			 * @returns {Fix|null} The fix object.
			 */
			function fix(fixer, left, right, spacing) {
				if (commentsExistBetween(left, right)) {
					return null;
				}
				if (spacing) {
					return fixer.insertTextAfter(left, " ");
				}
				return fixer.removeRange([left.range[1], right.range[0]]);
			}

			return {
				SwitchCase(node) {
					const colonToken = astUtils.getSwitchCaseColonToken(
						node,
						sourceCode,
					);
					const beforeToken = sourceCode.getTokenBefore(colonToken);
					const afterToken = sourceCode.getTokenAfter(colonToken);

					if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) {
						context.report({
							node,
							loc: colonToken.loc,
							messageId: beforeSpacing
								? "expectedBefore"
								: "unexpectedBefore",
							fix: fixer =>
								fix(fixer, beforeToken, colonToken, beforeSpacing),
						});
					}
					if (!isValidSpacing(colonToken, afterToken, afterSpacing)) {
						context.report({
							node,
							loc: colonToken.loc,
							messageId: afterSpacing
								? "expectedAfter"
								: "unexpectedAfter",
							fix: fixer =>
								fix(fixer, colonToken, afterToken, afterSpacing),
						});
					}
				},
			};
		},
	};
	return switchColonSpacing;
}

/**
 * @fileoverview Rule to enforce description with the `Symbol` object
 * @author Jarek Rencz
 */

var symbolDescription;
var hasRequiredSymbolDescription;

function requireSymbolDescription () {
	if (hasRequiredSymbolDescription) return symbolDescription;
	hasRequiredSymbolDescription = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	symbolDescription = {
		meta: {
			type: "suggestion",

			docs: {
				description: "Require symbol descriptions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/symbol-description",
			},
			fixable: null,
			schema: [],
			messages: {
				expected: "Expected Symbol to have a description.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			/**
			 * Reports if node does not conform the rule in case rule is set to
			 * report missing description
			 * @param {ASTNode} node A CallExpression node to check.
			 * @returns {void}
			 */
			function checkArgument(node) {
				if (node.arguments.length === 0) {
					context.report({
						node,
						messageId: "expected",
					});
				}
			}

			return {
				"Program:exit"(node) {
					const scope = sourceCode.getScope(node);
					const variable = astUtils.getVariableByName(scope, "Symbol");

					if (variable && variable.defs.length === 0) {
						variable.references.forEach(reference => {
							const idNode = reference.identifier;

							if (astUtils.isCallee(idNode)) {
								checkArgument(idNode.parent);
							}
						});
					}
				},
			};
		},
	};
	return symbolDescription;
}

/**
 * @fileoverview Rule to enforce spacing around embedded expressions of template strings
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

var templateCurlySpacing;
var hasRequiredTemplateCurlySpacing;

function requireTemplateCurlySpacing () {
	if (hasRequiredTemplateCurlySpacing) return templateCurlySpacing;
	hasRequiredTemplateCurlySpacing = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	templateCurlySpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "template-curly-spacing",
							url: "https://eslint.style/rules/js/template-curly-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require or disallow spacing around embedded expressions of template strings",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/template-curly-spacing",
			},

			fixable: "whitespace",

			schema: [{ enum: ["always", "never"] }],
			messages: {
				expectedBefore: "Expected space(s) before '}'.",
				expectedAfter: "Expected space(s) after '${'.",
				unexpectedBefore: "Unexpected space(s) before '}'.",
				unexpectedAfter: "Unexpected space(s) after '${'.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;
			const always = context.options[0] === "always";

			/**
			 * Checks spacing before `}` of a given token.
			 * @param {Token} token A token to check. This is a Template token.
			 * @returns {void}
			 */
			function checkSpacingBefore(token) {
				if (!token.value.startsWith("}")) {
					return; // starts with a backtick, this is the first template element in the template literal
				}

				const prevToken = sourceCode.getTokenBefore(token, {
						includeComments: true,
					}),
					hasSpace = sourceCode.isSpaceBetween(prevToken, token);

				if (!astUtils.isTokenOnSameLine(prevToken, token)) {
					return;
				}

				if (always && !hasSpace) {
					context.report({
						loc: {
							start: token.loc.start,
							end: {
								line: token.loc.start.line,
								column: token.loc.start.column + 1,
							},
						},
						messageId: "expectedBefore",
						fix: fixer => fixer.insertTextBefore(token, " "),
					});
				}

				if (!always && hasSpace) {
					context.report({
						loc: {
							start: prevToken.loc.end,
							end: token.loc.start,
						},
						messageId: "unexpectedBefore",
						fix: fixer =>
							fixer.removeRange([prevToken.range[1], token.range[0]]),
					});
				}
			}

			/**
			 * Checks spacing after `${` of a given token.
			 * @param {Token} token A token to check. This is a Template token.
			 * @returns {void}
			 */
			function checkSpacingAfter(token) {
				if (!token.value.endsWith("${")) {
					return; // ends with a backtick, this is the last template element in the template literal
				}

				const nextToken = sourceCode.getTokenAfter(token, {
						includeComments: true,
					}),
					hasSpace = sourceCode.isSpaceBetween(token, nextToken);

				if (!astUtils.isTokenOnSameLine(token, nextToken)) {
					return;
				}

				if (always && !hasSpace) {
					context.report({
						loc: {
							start: {
								line: token.loc.end.line,
								column: token.loc.end.column - 2,
							},
							end: token.loc.end,
						},
						messageId: "expectedAfter",
						fix: fixer => fixer.insertTextAfter(token, " "),
					});
				}

				if (!always && hasSpace) {
					context.report({
						loc: {
							start: token.loc.end,
							end: nextToken.loc.start,
						},
						messageId: "unexpectedAfter",
						fix: fixer =>
							fixer.removeRange([token.range[1], nextToken.range[0]]),
					});
				}
			}

			return {
				TemplateElement(node) {
					const token = sourceCode.getFirstToken(node);

					checkSpacingBefore(token);
					checkSpacingAfter(token);
				},
			};
		},
	};
	return templateCurlySpacing;
}

/**
 * @fileoverview Rule to check spacing between template tags and their literals
 * @author Jonathan Wilsson
 * @deprecated in ESLint v8.53.0
 */

var templateTagSpacing;
var hasRequiredTemplateTagSpacing;

function requireTemplateTagSpacing () {
	if (hasRequiredTemplateTagSpacing) return templateTagSpacing;
	hasRequiredTemplateTagSpacing = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	templateTagSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "template-tag-spacing",
							url: "https://eslint.style/rules/js/template-tag-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require or disallow spacing between template tags and their literals",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/template-tag-spacing",
			},

			fixable: "whitespace",

			schema: [{ enum: ["always", "never"] }],
			messages: {
				unexpected:
					"Unexpected space between template tag and template literal.",
				missing: "Missing space between template tag and template literal.",
			},
		},

		create(context) {
			const never = context.options[0] !== "always";
			const sourceCode = context.sourceCode;

			/**
			 * Check if a space is present between a template tag and its literal
			 * @param {ASTNode} node node to evaluate
			 * @returns {void}
			 * @private
			 */
			function checkSpacing(node) {
				const tagToken = sourceCode.getTokenBefore(node.quasi);
				const literalToken = sourceCode.getFirstToken(node.quasi);
				const hasWhitespace = sourceCode.isSpaceBetweenTokens(
					tagToken,
					literalToken,
				);

				if (never && hasWhitespace) {
					context.report({
						node,
						loc: {
							start: tagToken.loc.end,
							end: literalToken.loc.start,
						},
						messageId: "unexpected",
						fix(fixer) {
							const comments = sourceCode.getCommentsBefore(
								node.quasi,
							);

							// Don't fix anything if there's a single line comment after the template tag
							if (comments.some(comment => comment.type === "Line")) {
								return null;
							}

							return fixer.replaceTextRange(
								[tagToken.range[1], literalToken.range[0]],
								comments.reduce(
									(text, comment) =>
										text + sourceCode.getText(comment),
									"",
								),
							);
						},
					});
				} else if (!never && !hasWhitespace) {
					context.report({
						node,
						loc: {
							start: node.loc.start,
							end: literalToken.loc.start,
						},
						messageId: "missing",
						fix(fixer) {
							return fixer.insertTextAfter(tagToken, " ");
						},
					});
				}
			}

			return {
				TaggedTemplateExpression: checkSpacing,
			};
		},
	};
	return templateTagSpacing;
}

/**
 * @fileoverview Require or disallow Unicode BOM
 * @author Andrew Johnston <https://github.com/ehjay>
 */

var unicodeBom;
var hasRequiredUnicodeBom;

function requireUnicodeBom () {
	if (hasRequiredUnicodeBom) return unicodeBom;
	hasRequiredUnicodeBom = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	unicodeBom = {
		meta: {
			type: "layout",

			defaultOptions: ["never"],

			docs: {
				description: "Require or disallow Unicode byte order mark (BOM)",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/unicode-bom",
			},

			fixable: "whitespace",

			schema: [
				{
					enum: ["always", "never"],
				},
			],
			messages: {
				expected: "Expected Unicode BOM (Byte Order Mark).",
				unexpected: "Unexpected Unicode BOM (Byte Order Mark).",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program: function checkUnicodeBOM(node) {
					const sourceCode = context.sourceCode,
						location = { column: 0, line: 1 };
					const [requireBOM] = context.options;

					if (!sourceCode.hasBOM && requireBOM === "always") {
						context.report({
							node,
							loc: location,
							messageId: "expected",
							fix(fixer) {
								return fixer.insertTextBeforeRange(
									[0, 1],
									"\uFEFF",
								);
							},
						});
					} else if (sourceCode.hasBOM && requireBOM === "never") {
						context.report({
							node,
							loc: location,
							messageId: "unexpected",
							fix(fixer) {
								return fixer.removeRange([-1, 0]);
							},
						});
					}
				},
			};
		},
	};
	return unicodeBom;
}

/**
 * @fileoverview Rule to flag comparisons to the value NaN
 * @author James Allardice
 */

var useIsnan;
var hasRequiredUseIsnan;

function requireUseIsnan () {
	if (hasRequiredUseIsnan) return useIsnan;
	hasRequiredUseIsnan = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines if the given node is a NaN `Identifier` node.
	 * @param {ASTNode|null} node The node to check.
	 * @returns {boolean} `true` if the node is 'NaN' identifier.
	 */
	function isNaNIdentifier(node) {
		if (!node) {
			return false;
		}

		const nodeToCheck =
			node.type === "SequenceExpression" ? node.expressions.at(-1) : node;

		return (
			astUtils.isSpecificId(nodeToCheck, "NaN") ||
			astUtils.isSpecificMemberAccess(nodeToCheck, "Number", "NaN")
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	useIsnan = {
		meta: {
			hasSuggestions: true,
			type: "problem",

			docs: {
				description: "Require calls to `isNaN()` when checking for `NaN`",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/use-isnan",
			},

			schema: [
				{
					type: "object",
					properties: {
						enforceForSwitchCase: {
							type: "boolean",
						},
						enforceForIndexOf: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			defaultOptions: [
				{
					enforceForIndexOf: false,
					enforceForSwitchCase: true,
				},
			],

			messages: {
				comparisonWithNaN: "Use the isNaN function to compare with NaN.",
				switchNaN:
					"'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.",
				caseNaN:
					"'case NaN' can never match. Use Number.isNaN before the switch.",
				indexOfNaN:
					"Array prototype method '{{ methodName }}' cannot find NaN.",
				replaceWithIsNaN: "Replace with Number.isNaN.",
				replaceWithCastingAndIsNaN:
					"Replace with Number.isNaN and cast to a Number.",
				replaceWithFindIndex:
					"Replace with Array.prototype.{{ methodName }}.",
			},
		},

		create(context) {
			const [{ enforceForIndexOf, enforceForSwitchCase }] = context.options;
			const sourceCode = context.sourceCode;

			const fixableOperators = new Set(["==", "===", "!=", "!=="]);
			const castableOperators = new Set(["==", "!="]);

			/**
			 * Get a fixer for a binary expression that compares to NaN.
			 * @param  {ASTNode} node The node to fix.
			 * @param {function(string): string} wrapValue A function that wraps the compared value with a fix.
			 * @returns {function(Fixer): Fix} The fixer function.
			 */
			function getBinaryExpressionFixer(node, wrapValue) {
				return fixer => {
					const comparedValue = isNaNIdentifier(node.left)
						? node.right
						: node.left;
					const shouldWrap = comparedValue.type === "SequenceExpression";
					const shouldNegate = node.operator[0] === "!";

					const negation = shouldNegate ? "!" : "";
					let comparedValueText = sourceCode.getText(comparedValue);

					if (shouldWrap) {
						comparedValueText = `(${comparedValueText})`;
					}

					const fixedValue = wrapValue(comparedValueText);

					return fixer.replaceText(node, `${negation}${fixedValue}`);
				};
			}

			/**
			 * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkBinaryExpression(node) {
				if (
					/^(?:[<>]|[!=]=)=?$/u.test(node.operator) &&
					(isNaNIdentifier(node.left) || isNaNIdentifier(node.right))
				) {
					const suggestedFixes = [];
					const NaNNode = isNaNIdentifier(node.left)
						? node.left
						: node.right;

					const isSequenceExpression =
						NaNNode.type === "SequenceExpression";
					const isSuggestable =
						fixableOperators.has(node.operator) &&
						!isSequenceExpression;
					const isCastable = castableOperators.has(node.operator);

					if (isSuggestable) {
						suggestedFixes.push({
							messageId: "replaceWithIsNaN",
							fix: getBinaryExpressionFixer(
								node,
								value => `Number.isNaN(${value})`,
							),
						});

						if (isCastable) {
							suggestedFixes.push({
								messageId: "replaceWithCastingAndIsNaN",
								fix: getBinaryExpressionFixer(
									node,
									value => `Number.isNaN(Number(${value}))`,
								),
							});
						}
					}

					context.report({
						node,
						messageId: "comparisonWithNaN",
						suggest: suggestedFixes,
					});
				}
			}

			/**
			 * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:`
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkSwitchStatement(node) {
				if (isNaNIdentifier(node.discriminant)) {
					context.report({ node, messageId: "switchNaN" });
				}

				for (const switchCase of node.cases) {
					if (isNaNIdentifier(switchCase.test)) {
						context.report({ node: switchCase, messageId: "caseNaN" });
					}
				}
			}

			/**
			 * Checks the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`.
			 * @param {ASTNode} node The node to check.
			 * @returns {void}
			 */
			function checkCallExpression(node) {
				const callee = astUtils.skipChainExpression(node.callee);

				if (callee.type === "MemberExpression") {
					const methodName = astUtils.getStaticPropertyName(callee);

					if (
						(methodName === "indexOf" ||
							methodName === "lastIndexOf") &&
						node.arguments.length <= 2 &&
						isNaNIdentifier(node.arguments[0])
					) {
						/*
						 * To retain side effects, it's essential to address `NaN` beforehand, which
						 * is not possible with fixes like `arr.findIndex(Number.isNaN)`.
						 */
						const isSuggestable =
							node.arguments[0].type !== "SequenceExpression" &&
							!node.arguments[1];
						const suggestedFixes = [];

						if (isSuggestable) {
							const shouldWrap = callee.computed;
							const findIndexMethod =
								methodName === "indexOf"
									? "findIndex"
									: "findLastIndex";
							const propertyName = shouldWrap
								? `"${findIndexMethod}"`
								: findIndexMethod;

							suggestedFixes.push({
								messageId: "replaceWithFindIndex",
								data: { methodName: findIndexMethod },
								fix: fixer => [
									fixer.replaceText(
										callee.property,
										propertyName,
									),
									fixer.replaceText(
										node.arguments[0],
										"Number.isNaN",
									),
								],
							});
						}

						context.report({
							node,
							messageId: "indexOfNaN",
							data: { methodName },
							suggest: suggestedFixes,
						});
					}
				}
			}

			const listeners = {
				BinaryExpression: checkBinaryExpression,
			};

			if (enforceForSwitchCase) {
				listeners.SwitchStatement = checkSwitchStatement;
			}

			if (enforceForIndexOf) {
				listeners.CallExpression = checkCallExpression;
			}

			return listeners;
		},
	};
	return useIsnan;
}

/**
 * @fileoverview Ensures that the results of typeof are compared against a valid string
 * @author Ian Christian Myers
 */

var validTypeof;
var hasRequiredValidTypeof;

function requireValidTypeof () {
	if (hasRequiredValidTypeof) return validTypeof;
	hasRequiredValidTypeof = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	validTypeof = {
		meta: {
			type: "problem",

			defaultOptions: [
				{
					requireStringLiterals: false,
				},
			],

			docs: {
				description:
					"Enforce comparing `typeof` expressions against valid strings",
				recommended: true,
				url: "https://eslint.org/docs/latest/rules/valid-typeof",
			},

			hasSuggestions: true,

			schema: [
				{
					type: "object",
					properties: {
						requireStringLiterals: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],
			messages: {
				invalidValue: "Invalid typeof comparison value.",
				notString: "Typeof comparisons should be to string literals.",
				suggestString: 'Use `"{{type}}"` instead of `{{type}}`.',
			},
		},

		create(context) {
			const VALID_TYPES = new Set([
					"symbol",
					"undefined",
					"object",
					"boolean",
					"number",
					"string",
					"function",
					"bigint",
				]),
				OPERATORS = new Set(["==", "===", "!=", "!=="]);
			const sourceCode = context.sourceCode;
			const [{ requireStringLiterals }] = context.options;

			let globalScope;

			/**
			 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
			 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
			 * @param {ASTNode} node `Identifier` node to check.
			 * @returns {boolean} `true` if the node is a reference to a global variable.
			 */
			function isReferenceToGlobalVariable(node) {
				const variable = globalScope.set.get(node.name);

				return (
					variable &&
					variable.defs.length === 0 &&
					variable.references.some(ref => ref.identifier === node)
				);
			}

			/**
			 * Determines whether a node is a typeof expression.
			 * @param {ASTNode} node The node
			 * @returns {boolean} `true` if the node is a typeof expression
			 */
			function isTypeofExpression(node) {
				return (
					node.type === "UnaryExpression" && node.operator === "typeof"
				);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				Program(node) {
					globalScope = sourceCode.getScope(node);
				},

				UnaryExpression(node) {
					if (isTypeofExpression(node)) {
						const { parent } = node;

						if (
							parent.type === "BinaryExpression" &&
							OPERATORS.has(parent.operator)
						) {
							const sibling =
								parent.left === node ? parent.right : parent.left;

							if (
								sibling.type === "Literal" ||
								astUtils.isStaticTemplateLiteral(sibling)
							) {
								const value =
									sibling.type === "Literal"
										? sibling.value
										: sibling.quasis[0].value.cooked;

								if (!VALID_TYPES.has(value)) {
									context.report({
										node: sibling,
										messageId: "invalidValue",
									});
								}
							} else if (
								sibling.type === "Identifier" &&
								sibling.name === "undefined" &&
								isReferenceToGlobalVariable(sibling)
							) {
								context.report({
									node: sibling,
									messageId: requireStringLiterals
										? "notString"
										: "invalidValue",
									suggest: [
										{
											messageId: "suggestString",
											data: { type: "undefined" },
											fix(fixer) {
												return fixer.replaceText(
													sibling,
													'"undefined"',
												);
											},
										},
									],
								});
							} else if (
								requireStringLiterals &&
								!isTypeofExpression(sibling)
							) {
								context.report({
									node: sibling,
									messageId: "notString",
								});
							}
						}
					}
				},
			};
		},
	};
	return validTypeof;
}

/**
 * @fileoverview Rule to enforce var declarations are only at the top of a function.
 * @author Danny Fritz
 * @author Gyandeep Singh
 */

var varsOnTop;
var hasRequiredVarsOnTop;

function requireVarsOnTop () {
	if (hasRequiredVarsOnTop) return varsOnTop;
	hasRequiredVarsOnTop = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	varsOnTop = {
		meta: {
			type: "suggestion",

			docs: {
				description:
					"Require `var` declarations be placed at the top of their containing scope",
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/vars-on-top",
			},

			schema: [],
			messages: {
				top: "All 'var' declarations must be at the top of the function scope.",
			},
		},

		create(context) {
			//--------------------------------------------------------------------------
			// Helpers
			//--------------------------------------------------------------------------

			/**
			 * Has AST suggesting a directive.
			 * @param {ASTNode} node any node
			 * @returns {boolean} whether the given node structurally represents a directive
			 */
			function looksLikeDirective(node) {
				return (
					node.type === "ExpressionStatement" &&
					node.expression.type === "Literal" &&
					typeof node.expression.value === "string"
				);
			}

			/**
			 * Check to see if its a ES6 import declaration
			 * @param {ASTNode} node any node
			 * @returns {boolean} whether the given node represents a import declaration
			 */
			function looksLikeImport(node) {
				return (
					node.type === "ImportDeclaration" ||
					node.type === "ImportSpecifier" ||
					node.type === "ImportDefaultSpecifier" ||
					node.type === "ImportNamespaceSpecifier"
				);
			}

			/**
			 * Checks whether a given node is a variable declaration or not.
			 * @param {ASTNode} node any node
			 * @returns {boolean} `true` if the node is a variable declaration.
			 */
			function isVariableDeclaration(node) {
				return (
					node.type === "VariableDeclaration" ||
					(node.type === "ExportNamedDeclaration" &&
						node.declaration &&
						node.declaration.type === "VariableDeclaration")
				);
			}

			/**
			 * Checks whether this variable is on top of the block body
			 * @param {ASTNode} node The node to check
			 * @param {ASTNode[]} statements collection of ASTNodes for the parent node block
			 * @returns {boolean} True if var is on top otherwise false
			 */
			function isVarOnTop(node, statements) {
				const l = statements.length;
				let i = 0;

				// Skip over directives and imports. Static blocks don't have either.
				if (node.parent.type !== "StaticBlock") {
					for (; i < l; ++i) {
						if (
							!looksLikeDirective(statements[i]) &&
							!looksLikeImport(statements[i])
						) {
							break;
						}
					}
				}

				for (; i < l; ++i) {
					if (!isVariableDeclaration(statements[i])) {
						return false;
					}
					if (statements[i] === node) {
						return true;
					}
				}

				return false;
			}

			/**
			 * Checks whether variable is on top at the global level
			 * @param {ASTNode} node The node to check
			 * @param {ASTNode} parent Parent of the node
			 * @returns {void}
			 */
			function globalVarCheck(node, parent) {
				if (!isVarOnTop(node, parent.body)) {
					context.report({ node, messageId: "top" });
				}
			}

			/**
			 * Checks whether variable is on top at functional block scope level
			 * @param {ASTNode} node The node to check
			 * @returns {void}
			 */
			function blockScopeVarCheck(node) {
				const { parent } = node;

				if (
					parent.type === "BlockStatement" &&
					/Function/u.test(parent.parent.type) &&
					isVarOnTop(node, parent.body)
				) {
					return;
				}

				if (
					parent.type === "StaticBlock" &&
					isVarOnTop(node, parent.body)
				) {
					return;
				}

				context.report({ node, messageId: "top" });
			}

			//--------------------------------------------------------------------------
			// Public API
			//--------------------------------------------------------------------------

			return {
				"VariableDeclaration[kind='var']"(node) {
					if (node.parent.type === "ExportNamedDeclaration") {
						globalVarCheck(node.parent, node.parent.parent);
					} else if (node.parent.type === "Program") {
						globalVarCheck(node, node.parent);
					} else {
						blockScopeVarCheck(node);
					}
				},
			};
		},
	};
	return varsOnTop;
}

/**
 * @fileoverview Rule to flag when IIFE is not wrapped in parens
 * @author Ilya Volodin
 * @deprecated in ESLint v8.53.0
 */

var wrapIife;
var hasRequiredWrapIife;

function requireWrapIife () {
	if (hasRequiredWrapIife) return wrapIife;
	hasRequiredWrapIife = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const astUtils = requireAstUtils();
	const eslintUtils = /*@__PURE__*/ requireEslintUtils();

	//----------------------------------------------------------------------
	// Helpers
	//----------------------------------------------------------------------

	/**
	 * Check if the given node is callee of a `NewExpression` node
	 * @param {ASTNode} node node to check
	 * @returns {boolean} True if the node is callee of a `NewExpression` node
	 * @private
	 */
	function isCalleeOfNewExpression(node) {
		const maybeCallee =
			node.parent.type === "ChainExpression" ? node.parent : node;

		return (
			maybeCallee.parent.type === "NewExpression" &&
			maybeCallee.parent.callee === maybeCallee
		);
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	wrapIife = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "wrap-iife",
							url: "https://eslint.style/rules/js/wrap-iife",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require parentheses around immediate `function` invocations",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/wrap-iife",
			},

			schema: [
				{
					enum: ["outside", "inside", "any"],
				},
				{
					type: "object",
					properties: {
						functionPrototypeMethods: {
							type: "boolean",
							default: false,
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",
			messages: {
				wrapInvocation:
					"Wrap an immediate function invocation in parentheses.",
				wrapExpression: "Wrap only the function expression in parens.",
				moveInvocation:
					"Move the invocation into the parens that contain the function.",
			},
		},

		create(context) {
			const style = context.options[0] || "outside";
			const includeFunctionPrototypeMethods =
				context.options[1] && context.options[1].functionPrototypeMethods;

			const sourceCode = context.sourceCode;

			/**
			 * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if()
			 * @param {ASTNode} node node to evaluate
			 * @returns {boolean} True if it is wrapped in any parens
			 * @private
			 */
			function isWrappedInAnyParens(node) {
				return astUtils.isParenthesised(sourceCode, node);
			}

			/**
			 * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count
			 * @param {ASTNode} node node to evaluate
			 * @returns {boolean} True if it is wrapped in grouping parens
			 * @private
			 */
			function isWrappedInGroupingParens(node) {
				return eslintUtils.isParenthesized(1, node, sourceCode);
			}

			/**
			 * Get the function node from an IIFE
			 * @param {ASTNode} node node to evaluate
			 * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist
			 */
			function getFunctionNodeFromIIFE(node) {
				const callee = astUtils.skipChainExpression(node.callee);

				if (callee.type === "FunctionExpression") {
					return callee;
				}

				if (
					includeFunctionPrototypeMethods &&
					callee.type === "MemberExpression" &&
					callee.object.type === "FunctionExpression" &&
					(astUtils.getStaticPropertyName(callee) === "call" ||
						astUtils.getStaticPropertyName(callee) === "apply")
				) {
					return callee.object;
				}

				return null;
			}

			return {
				CallExpression(node) {
					const innerNode = getFunctionNodeFromIIFE(node);

					if (!innerNode) {
						return;
					}

					const isCallExpressionWrapped = isWrappedInAnyParens(node),
						isFunctionExpressionWrapped =
							isWrappedInAnyParens(innerNode);

					if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) {
						context.report({
							node,
							messageId: "wrapInvocation",
							fix(fixer) {
								const nodeToSurround =
									style === "inside" ? innerNode : node;

								return fixer.replaceText(
									nodeToSurround,
									`(${sourceCode.getText(nodeToSurround)})`,
								);
							},
						});
					} else if (style === "inside" && !isFunctionExpressionWrapped) {
						context.report({
							node,
							messageId: "wrapExpression",
							fix(fixer) {
								// The outer call expression will always be wrapped at this point.

								if (
									isWrappedInGroupingParens(node) &&
									!isCalleeOfNewExpression(node)
								) {
									/*
									 * Parenthesize the function expression and remove unnecessary grouping parens around the call expression.
									 * Replace the range between the end of the function expression and the end of the call expression.
									 * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`.
									 */

									const parenAfter =
										sourceCode.getTokenAfter(node);

									return fixer.replaceTextRange(
										[innerNode.range[1], parenAfter.range[1]],
										`)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}`,
									);
								}

								/*
								 * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens.
								 * These parens cannot be removed, so just parenthesize the function expression.
								 */

								return fixer.replaceText(
									innerNode,
									`(${sourceCode.getText(innerNode)})`,
								);
							},
						});
					} else if (style === "outside" && !isCallExpressionWrapped) {
						context.report({
							node,
							messageId: "moveInvocation",
							fix(fixer) {
								/*
								 * The inner function expression will always be wrapped at this point.
								 * It's only necessary to replace the range between the end of the function expression
								 * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)`
								 * should get replaced with `(bar))`.
								 */
								const parenAfter =
									sourceCode.getTokenAfter(innerNode);

								return fixer.replaceTextRange(
									[parenAfter.range[0], node.range[1]],
									`${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})`,
								);
							},
						});
					}
				},
			};
		},
	};
	return wrapIife;
}

/**
 * @fileoverview Rule to flag when regex literals are not wrapped in parens
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

var wrapRegex;
var hasRequiredWrapRegex;

function requireWrapRegex () {
	if (hasRequiredWrapRegex) return wrapRegex;
	hasRequiredWrapRegex = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	wrapRegex = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "wrap-regex",
							url: "https://eslint.style/rules/js/wrap-regex",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description: "Require parenthesis around regex literals",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/wrap-regex",
			},

			schema: [],
			fixable: "code",

			messages: {
				requireParens:
					"Wrap the regexp literal in parens to disambiguate the slash.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			return {
				Literal(node) {
					const token = sourceCode.getFirstToken(node),
						nodeType = token.type;

					if (nodeType === "RegularExpression") {
						const beforeToken = sourceCode.getTokenBefore(node);
						const afterToken = sourceCode.getTokenAfter(node);
						const { parent } = node;

						if (
							parent.type === "MemberExpression" &&
							parent.object === node &&
							!(
								beforeToken &&
								beforeToken.value === "(" &&
								afterToken &&
								afterToken.value === ")"
							)
						) {
							context.report({
								node,
								messageId: "requireParens",
								fix: fixer =>
									fixer.replaceText(
										node,
										`(${sourceCode.getText(node)})`,
									),
							});
						}
					}
				},
			};
		},
	};
	return wrapRegex;
}

/**
 * @fileoverview Rule to check the spacing around the * in yield* expressions.
 * @author Bryan Smith
 * @deprecated in ESLint v8.53.0
 */

var yieldStarSpacing;
var hasRequiredYieldStarSpacing;

function requireYieldStarSpacing () {
	if (hasRequiredYieldStarSpacing) return yieldStarSpacing;
	hasRequiredYieldStarSpacing = 1;

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	yieldStarSpacing = {
		meta: {
			deprecated: {
				message: "Formatting rules are being moved out of ESLint core.",
				url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
				deprecatedSince: "8.53.0",
				availableUntil: "10.0.0",
				replacedBy: [
					{
						message:
							"ESLint Stylistic now maintains deprecated stylistic core rules.",
						url: "https://eslint.style/guide/migration",
						plugin: {
							name: "@stylistic/eslint-plugin-js",
							url: "https://eslint.style/packages/js",
						},
						rule: {
							name: "yield-star-spacing",
							url: "https://eslint.style/rules/js/yield-star-spacing",
						},
					},
				],
			},
			type: "layout",

			docs: {
				description:
					"Require or disallow spacing around the `*` in `yield*` expressions",
				recommended: false,
				url: "https://eslint.org/docs/latest/rules/yield-star-spacing",
			},

			fixable: "whitespace",

			schema: [
				{
					oneOf: [
						{
							enum: ["before", "after", "both", "neither"],
						},
						{
							type: "object",
							properties: {
								before: { type: "boolean" },
								after: { type: "boolean" },
							},
							additionalProperties: false,
						},
					],
				},
			],
			messages: {
				missingBefore: "Missing space before *.",
				missingAfter: "Missing space after *.",
				unexpectedBefore: "Unexpected space before *.",
				unexpectedAfter: "Unexpected space after *.",
			},
		},

		create(context) {
			const sourceCode = context.sourceCode;

			const mode = (function (option) {
				if (!option || typeof option === "string") {
					return {
						before: { before: true, after: false },
						after: { before: false, after: true },
						both: { before: true, after: true },
						neither: { before: false, after: false },
					}[option || "after"];
				}
				return option;
			})(context.options[0]);

			/**
			 * Checks the spacing between two tokens before or after the star token.
			 * @param {string} side Either "before" or "after".
			 * @param {Token} leftToken `function` keyword token if side is "before", or
			 *     star token if side is "after".
			 * @param {Token} rightToken Star token if side is "before", or identifier
			 *     token if side is "after".
			 * @returns {void}
			 */
			function checkSpacing(side, leftToken, rightToken) {
				if (
					sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !==
					mode[side]
				) {
					const after = leftToken.value === "*";
					const spaceRequired = mode[side];
					const node = after ? leftToken : rightToken;
					let messageId;

					if (spaceRequired) {
						messageId =
							side === "before" ? "missingBefore" : "missingAfter";
					} else {
						messageId =
							side === "before"
								? "unexpectedBefore"
								: "unexpectedAfter";
					}

					context.report({
						node,
						messageId,
						fix(fixer) {
							if (spaceRequired) {
								if (after) {
									return fixer.insertTextAfter(node, " ");
								}
								return fixer.insertTextBefore(node, " ");
							}
							return fixer.removeRange([
								leftToken.range[1],
								rightToken.range[0],
							]);
						},
					});
				}
			}

			/**
			 * Enforces the spacing around the star if node is a yield* expression.
			 * @param {ASTNode} node A yield expression node.
			 * @returns {void}
			 */
			function checkExpression(node) {
				if (!node.delegate) {
					return;
				}

				const tokens = sourceCode.getFirstTokens(node, 3);
				const yieldToken = tokens[0];
				const starToken = tokens[1];
				const nextToken = tokens[2];

				checkSpacing("before", yieldToken, starToken);
				checkSpacing("after", starToken, nextToken);
			}

			return {
				YieldExpression: checkExpression,
			};
		},
	};
	return yieldStarSpacing;
}

/**
 * @fileoverview Rule to require or disallow yoda comparisons
 * @author Nicholas C. Zakas
 */

var yoda;
var hasRequiredYoda;

function requireYoda () {
	if (hasRequiredYoda) return yoda;
	hasRequiredYoda = 1;

	//--------------------------------------------------------------------------
	// Requirements
	//--------------------------------------------------------------------------

	const astUtils = requireAstUtils();

	//--------------------------------------------------------------------------
	// Helpers
	//--------------------------------------------------------------------------

	/**
	 * Determines whether an operator is a comparison operator.
	 * @param {string} operator The operator to check.
	 * @returns {boolean} Whether or not it is a comparison operator.
	 */
	function isComparisonOperator(operator) {
		return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator);
	}

	/**
	 * Determines whether an operator is an equality operator.
	 * @param {string} operator The operator to check.
	 * @returns {boolean} Whether or not it is an equality operator.
	 */
	function isEqualityOperator(operator) {
		return /^(==|===)$/u.test(operator);
	}

	/**
	 * Determines whether an operator is one used in a range test.
	 * Allowed operators are `<` and `<=`.
	 * @param {string} operator The operator to check.
	 * @returns {boolean} Whether the operator is used in range tests.
	 */
	function isRangeTestOperator(operator) {
		return ["<", "<="].includes(operator);
	}

	/**
	 * Determines whether a non-Literal node is a negative number that should be
	 * treated as if it were a single Literal node.
	 * @param {ASTNode} node Node to test.
	 * @returns {boolean} True if the node is a negative number that looks like a
	 *                    real literal and should be treated as such.
	 */
	function isNegativeNumericLiteral(node) {
		return (
			node.type === "UnaryExpression" &&
			node.operator === "-" &&
			node.prefix &&
			astUtils.isNumericLiteral(node.argument)
		);
	}

	/**
	 * Determines whether a non-Literal node should be treated as a single Literal node.
	 * @param {ASTNode} node Node to test
	 * @returns {boolean} True if the node should be treated as a single Literal node.
	 */
	function looksLikeLiteral(node) {
		return (
			isNegativeNumericLiteral(node) || astUtils.isStaticTemplateLiteral(node)
		);
	}

	/**
	 * Attempts to derive a Literal node from nodes that are treated like literals.
	 * @param {ASTNode} node Node to normalize.
	 * @returns {ASTNode} One of the following options.
	 *  1. The original node if the node is already a Literal
	 *  2. A normalized Literal node with the negative number as the value if the
	 *     node represents a negative number literal.
	 *  3. A normalized Literal node with the string as the value if the node is
	 *     a Template Literal without expression.
	 *  4. Otherwise `null`.
	 */
	function getNormalizedLiteral(node) {
		if (node.type === "Literal") {
			return node;
		}

		if (isNegativeNumericLiteral(node)) {
			return {
				type: "Literal",
				value: -node.argument.value,
				raw: `-${node.argument.value}`,
			};
		}

		if (astUtils.isStaticTemplateLiteral(node)) {
			return {
				type: "Literal",
				value: node.quasis[0].value.cooked,
				raw: node.quasis[0].value.raw,
			};
		}

		return null;
	}

	//------------------------------------------------------------------------------
	// Rule Definition
	//------------------------------------------------------------------------------

	/** @type {import('../shared/types').Rule} */
	yoda = {
		meta: {
			type: "suggestion",

			defaultOptions: [
				"never",
				{
					exceptRange: false,
					onlyEquality: false,
				},
			],

			docs: {
				description: 'Require or disallow "Yoda" conditions',
				recommended: false,
				frozen: true,
				url: "https://eslint.org/docs/latest/rules/yoda",
			},

			schema: [
				{
					enum: ["always", "never"],
				},
				{
					type: "object",
					properties: {
						exceptRange: {
							type: "boolean",
						},
						onlyEquality: {
							type: "boolean",
						},
					},
					additionalProperties: false,
				},
			],

			fixable: "code",
			messages: {
				expected:
					"Expected literal to be on the {{expectedSide}} side of {{operator}}.",
			},
		},

		create(context) {
			const [when, { exceptRange, onlyEquality }] = context.options;
			const always = when === "always";
			const sourceCode = context.sourceCode;

			/**
			 * Determines whether node represents a range test.
			 * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside"
			 * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and
			 * both operators must be `<` or `<=`. Finally, the literal on the left side
			 * must be less than or equal to the literal on the right side so that the
			 * test makes any sense.
			 * @param {ASTNode} node LogicalExpression node to test.
			 * @returns {boolean} Whether node is a range test.
			 */
			function isRangeTest(node) {
				const left = node.left,
					right = node.right;

				/**
				 * Determines whether node is of the form `0 <= x && x < 1`.
				 * @returns {boolean} Whether node is a "between" range test.
				 */
				function isBetweenTest() {
					if (
						node.operator === "&&" &&
						astUtils.isSameReference(left.right, right.left)
					) {
						const leftLiteral = getNormalizedLiteral(left.left);
						const rightLiteral = getNormalizedLiteral(right.right);

						if (leftLiteral === null && rightLiteral === null) {
							return false;
						}

						if (rightLiteral === null || leftLiteral === null) {
							return true;
						}

						if (leftLiteral.value <= rightLiteral.value) {
							return true;
						}
					}
					return false;
				}

				/**
				 * Determines whether node is of the form `x < 0 || 1 <= x`.
				 * @returns {boolean} Whether node is an "outside" range test.
				 */
				function isOutsideTest() {
					if (
						node.operator === "||" &&
						astUtils.isSameReference(left.left, right.right)
					) {
						const leftLiteral = getNormalizedLiteral(left.right);
						const rightLiteral = getNormalizedLiteral(right.left);

						if (leftLiteral === null && rightLiteral === null) {
							return false;
						}

						if (rightLiteral === null || leftLiteral === null) {
							return true;
						}

						if (leftLiteral.value <= rightLiteral.value) {
							return true;
						}
					}

					return false;
				}

				/**
				 * Determines whether node is wrapped in parentheses.
				 * @returns {boolean} Whether node is preceded immediately by an open
				 *                    paren token and followed immediately by a close
				 *                    paren token.
				 */
				function isParenWrapped() {
					return astUtils.isParenthesised(sourceCode, node);
				}

				return (
					node.type === "LogicalExpression" &&
					left.type === "BinaryExpression" &&
					right.type === "BinaryExpression" &&
					isRangeTestOperator(left.operator) &&
					isRangeTestOperator(right.operator) &&
					(isBetweenTest() || isOutsideTest()) &&
					isParenWrapped()
				);
			}

			const OPERATOR_FLIP_MAP = {
				"===": "===",
				"!==": "!==",
				"==": "==",
				"!=": "!=",
				"<": ">",
				">": "<",
				"<=": ">=",
				">=": "<=",
			};

			/**
			 * Returns a string representation of a BinaryExpression node with its sides/operator flipped around.
			 * @param {ASTNode} node The BinaryExpression node
			 * @returns {string} A string representation of the node with the sides and operator flipped
			 */
			function getFlippedString(node) {
				const operatorToken = sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);
				const lastLeftToken = sourceCode.getTokenBefore(operatorToken);
				const firstRightToken = sourceCode.getTokenAfter(operatorToken);

				const source = sourceCode.getText();

				const leftText = source.slice(
					node.range[0],
					lastLeftToken.range[1],
				);
				const textBeforeOperator = source.slice(
					lastLeftToken.range[1],
					operatorToken.range[0],
				);
				const textAfterOperator = source.slice(
					operatorToken.range[1],
					firstRightToken.range[0],
				);
				const rightText = source.slice(
					firstRightToken.range[0],
					node.range[1],
				);

				const tokenBefore = sourceCode.getTokenBefore(node);
				const tokenAfter = sourceCode.getTokenAfter(node);
				let prefix = "";
				let suffix = "";

				if (
					tokenBefore &&
					tokenBefore.range[1] === node.range[0] &&
					!astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken)
				) {
					prefix = " ";
				}

				if (
					tokenAfter &&
					node.range[1] === tokenAfter.range[0] &&
					!astUtils.canTokensBeAdjacent(lastLeftToken, tokenAfter)
				) {
					suffix = " ";
				}

				return (
					prefix +
					rightText +
					textBeforeOperator +
					OPERATOR_FLIP_MAP[operatorToken.value] +
					textAfterOperator +
					leftText +
					suffix
				);
			}

			//--------------------------------------------------------------------------
			// Public
			//--------------------------------------------------------------------------

			return {
				BinaryExpression(node) {
					const expectedLiteral = always ? node.left : node.right;
					const expectedNonLiteral = always ? node.right : node.left;

					// If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error.
					if (
						(expectedNonLiteral.type === "Literal" ||
							looksLikeLiteral(expectedNonLiteral)) &&
						!(
							expectedLiteral.type === "Literal" ||
							looksLikeLiteral(expectedLiteral)
						) &&
						!(!isEqualityOperator(node.operator) && onlyEquality) &&
						isComparisonOperator(node.operator) &&
						!(exceptRange && isRangeTest(node.parent))
					) {
						context.report({
							node,
							messageId: "expected",
							data: {
								operator: node.operator,
								expectedSide: always ? "left" : "right",
							},
							fix: fixer =>
								fixer.replaceText(node, getFlippedString(node)),
						});
					}
				},
			};
		},
	};
	return yoda;
}

/**
 * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without
 * using the file-system directly.
 * @author Peter (Somogyvari) Metz
 */

var rules$2;
var hasRequiredRules$1;

function requireRules$1 () {
	if (hasRequiredRules$1) return rules$2;
	hasRequiredRules$1 = 1;

	/* eslint sort-keys: ["error", "asc"] -- More readable for long list */

	const { LazyLoadingRuleMap } = requireLazyLoadingRuleMap();

	/** @type {Map<string, import("../shared/types").Rule>} */
	rules$2 = new LazyLoadingRuleMap(
		Object.entries({
			"accessor-pairs": () => requireAccessorPairs(),
			"array-bracket-newline": () => requireArrayBracketNewline(),
			"array-bracket-spacing": () => requireArrayBracketSpacing(),
			"array-callback-return": () => requireArrayCallbackReturn(),
			"array-element-newline": () => requireArrayElementNewline(),
			"arrow-body-style": () => requireArrowBodyStyle(),
			"arrow-parens": () => requireArrowParens(),
			"arrow-spacing": () => requireArrowSpacing(),
			"block-scoped-var": () => requireBlockScopedVar(),
			"block-spacing": () => requireBlockSpacing(),
			"brace-style": () => requireBraceStyle(),
			"callback-return": () => requireCallbackReturn(),
			camelcase: () => requireCamelcase(),
			"capitalized-comments": () => requireCapitalizedComments(),
			"class-methods-use-this": () => requireClassMethodsUseThis(),
			"comma-dangle": () => requireCommaDangle(),
			"comma-spacing": () => requireCommaSpacing(),
			"comma-style": () => requireCommaStyle(),
			complexity: () => requireComplexity(),
			"computed-property-spacing": () =>
				requireComputedPropertySpacing(),
			"consistent-return": () => requireConsistentReturn(),
			"consistent-this": () => requireConsistentThis(),
			"constructor-super": () => requireConstructorSuper(),
			curly: () => requireCurly(),
			"default-case": () => requireDefaultCase(),
			"default-case-last": () => requireDefaultCaseLast(),
			"default-param-last": () => requireDefaultParamLast(),
			"dot-location": () => requireDotLocation(),
			"dot-notation": () => requireDotNotation(),
			"eol-last": () => requireEolLast(),
			eqeqeq: () => requireEqeqeq(),
			"for-direction": () => requireForDirection(),
			"func-call-spacing": () => requireFuncCallSpacing(),
			"func-name-matching": () => requireFuncNameMatching(),
			"func-names": () => requireFuncNames(),
			"func-style": () => requireFuncStyle(),
			"function-call-argument-newline": () =>
				requireFunctionCallArgumentNewline(),
			"function-paren-newline": () => requireFunctionParenNewline(),
			"generator-star-spacing": () => requireGeneratorStarSpacing(),
			"getter-return": () => requireGetterReturn(),
			"global-require": () => requireGlobalRequire(),
			"grouped-accessor-pairs": () => requireGroupedAccessorPairs(),
			"guard-for-in": () => requireGuardForIn(),
			"handle-callback-err": () => requireHandleCallbackErr(),
			"id-blacklist": () => requireIdBlacklist(),
			"id-denylist": () => requireIdDenylist(),
			"id-length": () => requireIdLength(),
			"id-match": () => requireIdMatch(),
			"implicit-arrow-linebreak": () => requireImplicitArrowLinebreak(),
			indent: () => requireIndent(),
			"indent-legacy": () => requireIndentLegacy(),
			"init-declarations": () => requireInitDeclarations(),
			"jsx-quotes": () => requireJsxQuotes(),
			"key-spacing": () => requireKeySpacing(),
			"keyword-spacing": () => requireKeywordSpacing(),
			"line-comment-position": () => requireLineCommentPosition(),
			"linebreak-style": () => requireLinebreakStyle(),
			"lines-around-comment": () => requireLinesAroundComment(),
			"lines-around-directive": () => requireLinesAroundDirective(),
			"lines-between-class-members": () =>
				requireLinesBetweenClassMembers(),
			"logical-assignment-operators": () =>
				requireLogicalAssignmentOperators(),
			"max-classes-per-file": () => requireMaxClassesPerFile(),
			"max-depth": () => requireMaxDepth(),
			"max-len": () => requireMaxLen(),
			"max-lines": () => requireMaxLines(),
			"max-lines-per-function": () => requireMaxLinesPerFunction(),
			"max-nested-callbacks": () => requireMaxNestedCallbacks(),
			"max-params": () => requireMaxParams(),
			"max-statements": () => requireMaxStatements(),
			"max-statements-per-line": () => requireMaxStatementsPerLine(),
			"multiline-comment-style": () => requireMultilineCommentStyle(),
			"multiline-ternary": () => requireMultilineTernary(),
			"new-cap": () => requireNewCap(),
			"new-parens": () => requireNewParens(),
			"newline-after-var": () => requireNewlineAfterVar(),
			"newline-before-return": () => requireNewlineBeforeReturn(),
			"newline-per-chained-call": () => requireNewlinePerChainedCall(),
			"no-alert": () => requireNoAlert(),
			"no-array-constructor": () => requireNoArrayConstructor(),
			"no-async-promise-executor": () =>
				requireNoAsyncPromiseExecutor(),
			"no-await-in-loop": () => requireNoAwaitInLoop(),
			"no-bitwise": () => requireNoBitwise(),
			"no-buffer-constructor": () => requireNoBufferConstructor(),
			"no-caller": () => requireNoCaller(),
			"no-case-declarations": () => requireNoCaseDeclarations(),
			"no-catch-shadow": () => requireNoCatchShadow(),
			"no-class-assign": () => requireNoClassAssign(),
			"no-compare-neg-zero": () => requireNoCompareNegZero(),
			"no-cond-assign": () => requireNoCondAssign(),
			"no-confusing-arrow": () => requireNoConfusingArrow(),
			"no-console": () => requireNoConsole(),
			"no-const-assign": () => requireNoConstAssign(),
			"no-constant-binary-expression": () =>
				requireNoConstantBinaryExpression(),
			"no-constant-condition": () => requireNoConstantCondition(),
			"no-constructor-return": () => requireNoConstructorReturn(),
			"no-continue": () => requireNoContinue(),
			"no-control-regex": () => requireNoControlRegex(),
			"no-debugger": () => requireNoDebugger(),
			"no-delete-var": () => requireNoDeleteVar(),
			"no-div-regex": () => requireNoDivRegex(),
			"no-dupe-args": () => requireNoDupeArgs(),
			"no-dupe-class-members": () => requireNoDupeClassMembers(),
			"no-dupe-else-if": () => requireNoDupeElseIf(),
			"no-dupe-keys": () => requireNoDupeKeys(),
			"no-duplicate-case": () => requireNoDuplicateCase(),
			"no-duplicate-imports": () => requireNoDuplicateImports(),
			"no-else-return": () => requireNoElseReturn(),
			"no-empty": () => requireNoEmpty(),
			"no-empty-character-class": () => requireNoEmptyCharacterClass(),
			"no-empty-function": () => requireNoEmptyFunction(),
			"no-empty-pattern": () => requireNoEmptyPattern(),
			"no-empty-static-block": () => requireNoEmptyStaticBlock(),
			"no-eq-null": () => requireNoEqNull(),
			"no-eval": () => requireNoEval(),
			"no-ex-assign": () => requireNoExAssign(),
			"no-extend-native": () => requireNoExtendNative(),
			"no-extra-bind": () => requireNoExtraBind(),
			"no-extra-boolean-cast": () => requireNoExtraBooleanCast(),
			"no-extra-label": () => requireNoExtraLabel(),
			"no-extra-parens": () => requireNoExtraParens(),
			"no-extra-semi": () => requireNoExtraSemi(),
			"no-fallthrough": () => requireNoFallthrough(),
			"no-floating-decimal": () => requireNoFloatingDecimal(),
			"no-func-assign": () => requireNoFuncAssign(),
			"no-global-assign": () => requireNoGlobalAssign(),
			"no-implicit-coercion": () => requireNoImplicitCoercion(),
			"no-implicit-globals": () => requireNoImplicitGlobals(),
			"no-implied-eval": () => requireNoImpliedEval(),
			"no-import-assign": () => requireNoImportAssign(),
			"no-inline-comments": () => requireNoInlineComments(),
			"no-inner-declarations": () => requireNoInnerDeclarations(),
			"no-invalid-regexp": () => requireNoInvalidRegexp(),
			"no-invalid-this": () => requireNoInvalidThis(),
			"no-irregular-whitespace": () => requireNoIrregularWhitespace(),
			"no-iterator": () => requireNoIterator(),
			"no-label-var": () => requireNoLabelVar(),
			"no-labels": () => requireNoLabels(),
			"no-lone-blocks": () => requireNoLoneBlocks(),
			"no-lonely-if": () => requireNoLonelyIf(),
			"no-loop-func": () => requireNoLoopFunc(),
			"no-loss-of-precision": () => requireNoLossOfPrecision(),
			"no-magic-numbers": () => requireNoMagicNumbers(),
			"no-misleading-character-class": () =>
				requireNoMisleadingCharacterClass(),
			"no-mixed-operators": () => requireNoMixedOperators(),
			"no-mixed-requires": () => requireNoMixedRequires(),
			"no-mixed-spaces-and-tabs": () => requireNoMixedSpacesAndTabs(),
			"no-multi-assign": () => requireNoMultiAssign(),
			"no-multi-spaces": () => requireNoMultiSpaces(),
			"no-multi-str": () => requireNoMultiStr(),
			"no-multiple-empty-lines": () => requireNoMultipleEmptyLines(),
			"no-native-reassign": () => requireNoNativeReassign(),
			"no-negated-condition": () => requireNoNegatedCondition(),
			"no-negated-in-lhs": () => requireNoNegatedInLhs(),
			"no-nested-ternary": () => requireNoNestedTernary(),
			"no-new": () => requireNoNew(),
			"no-new-func": () => requireNoNewFunc(),
			"no-new-native-nonconstructor": () =>
				requireNoNewNativeNonconstructor(),
			"no-new-object": () => requireNoNewObject(),
			"no-new-require": () => requireNoNewRequire(),
			"no-new-symbol": () => requireNoNewSymbol(),
			"no-new-wrappers": () => requireNoNewWrappers(),
			"no-nonoctal-decimal-escape": () =>
				requireNoNonoctalDecimalEscape(),
			"no-obj-calls": () => requireNoObjCalls(),
			"no-object-constructor": () => requireNoObjectConstructor(),
			"no-octal": () => requireNoOctal(),
			"no-octal-escape": () => requireNoOctalEscape(),
			"no-param-reassign": () => requireNoParamReassign(),
			"no-path-concat": () => requireNoPathConcat(),
			"no-plusplus": () => requireNoPlusplus(),
			"no-process-env": () => requireNoProcessEnv(),
			"no-process-exit": () => requireNoProcessExit(),
			"no-promise-executor-return": () =>
				requireNoPromiseExecutorReturn(),
			"no-proto": () => requireNoProto(),
			"no-prototype-builtins": () => requireNoPrototypeBuiltins(),
			"no-redeclare": () => requireNoRedeclare(),
			"no-regex-spaces": () => requireNoRegexSpaces(),
			"no-restricted-exports": () => requireNoRestrictedExports(),
			"no-restricted-globals": () => requireNoRestrictedGlobals(),
			"no-restricted-imports": () => requireNoRestrictedImports(),
			"no-restricted-modules": () => requireNoRestrictedModules(),
			"no-restricted-properties": () => requireNoRestrictedProperties(),
			"no-restricted-syntax": () => requireNoRestrictedSyntax(),
			"no-return-assign": () => requireNoReturnAssign(),
			"no-return-await": () => requireNoReturnAwait(),
			"no-script-url": () => requireNoScriptUrl(),
			"no-self-assign": () => requireNoSelfAssign(),
			"no-self-compare": () => requireNoSelfCompare(),
			"no-sequences": () => requireNoSequences(),
			"no-setter-return": () => requireNoSetterReturn(),
			"no-shadow": () => requireNoShadow(),
			"no-shadow-restricted-names": () =>
				requireNoShadowRestrictedNames(),
			"no-spaced-func": () => requireNoSpacedFunc(),
			"no-sparse-arrays": () => requireNoSparseArrays(),
			"no-sync": () => requireNoSync(),
			"no-tabs": () => requireNoTabs(),
			"no-template-curly-in-string": () =>
				requireNoTemplateCurlyInString(),
			"no-ternary": () => requireNoTernary(),
			"no-this-before-super": () => requireNoThisBeforeSuper(),
			"no-throw-literal": () => requireNoThrowLiteral(),
			"no-trailing-spaces": () => requireNoTrailingSpaces(),
			"no-undef": () => requireNoUndef(),
			"no-undef-init": () => requireNoUndefInit(),
			"no-undefined": () => requireNoUndefined(),
			"no-underscore-dangle": () => requireNoUnderscoreDangle(),
			"no-unexpected-multiline": () => requireNoUnexpectedMultiline(),
			"no-unmodified-loop-condition": () =>
				requireNoUnmodifiedLoopCondition(),
			"no-unneeded-ternary": () => requireNoUnneededTernary(),
			"no-unreachable": () => requireNoUnreachable(),
			"no-unreachable-loop": () => requireNoUnreachableLoop(),
			"no-unsafe-finally": () => requireNoUnsafeFinally(),
			"no-unsafe-negation": () => requireNoUnsafeNegation(),
			"no-unsafe-optional-chaining": () =>
				requireNoUnsafeOptionalChaining(),
			"no-unused-expressions": () => requireNoUnusedExpressions(),
			"no-unused-labels": () => requireNoUnusedLabels(),
			"no-unused-private-class-members": () =>
				requireNoUnusedPrivateClassMembers(),
			"no-unused-vars": () => requireNoUnusedVars(),
			"no-use-before-define": () => requireNoUseBeforeDefine(),
			"no-useless-assignment": () => requireNoUselessAssignment(),
			"no-useless-backreference": () => requireNoUselessBackreference(),
			"no-useless-call": () => requireNoUselessCall(),
			"no-useless-catch": () => requireNoUselessCatch(),
			"no-useless-computed-key": () => requireNoUselessComputedKey(),
			"no-useless-concat": () => requireNoUselessConcat(),
			"no-useless-constructor": () => requireNoUselessConstructor(),
			"no-useless-escape": () => requireNoUselessEscape(),
			"no-useless-rename": () => requireNoUselessRename(),
			"no-useless-return": () => requireNoUselessReturn(),
			"no-var": () => requireNoVar(),
			"no-void": () => requireNoVoid(),
			"no-warning-comments": () => requireNoWarningComments(),
			"no-whitespace-before-property": () =>
				requireNoWhitespaceBeforeProperty(),
			"no-with": () => requireNoWith(),
			"nonblock-statement-body-position": () =>
				requireNonblockStatementBodyPosition(),
			"object-curly-newline": () => requireObjectCurlyNewline(),
			"object-curly-spacing": () => requireObjectCurlySpacing(),
			"object-property-newline": () => requireObjectPropertyNewline(),
			"object-shorthand": () => requireObjectShorthand(),
			"one-var": () => requireOneVar(),
			"one-var-declaration-per-line": () =>
				requireOneVarDeclarationPerLine(),
			"operator-assignment": () => requireOperatorAssignment(),
			"operator-linebreak": () => requireOperatorLinebreak(),
			"padded-blocks": () => requirePaddedBlocks(),
			"padding-line-between-statements": () =>
				requirePaddingLineBetweenStatements(),
			"prefer-arrow-callback": () => requirePreferArrowCallback(),
			"prefer-const": () => requirePreferConst(),
			"prefer-destructuring": () => requirePreferDestructuring(),
			"prefer-exponentiation-operator": () =>
				requirePreferExponentiationOperator(),
			"prefer-named-capture-group": () =>
				requirePreferNamedCaptureGroup(),
			"prefer-numeric-literals": () => requirePreferNumericLiterals(),
			"prefer-object-has-own": () => requirePreferObjectHasOwn(),
			"prefer-object-spread": () => requirePreferObjectSpread(),
			"prefer-promise-reject-errors": () =>
				requirePreferPromiseRejectErrors(),
			"prefer-reflect": () => requirePreferReflect(),
			"prefer-regex-literals": () => requirePreferRegexLiterals(),
			"prefer-rest-params": () => requirePreferRestParams(),
			"prefer-spread": () => requirePreferSpread(),
			"prefer-template": () => requirePreferTemplate(),
			"quote-props": () => requireQuoteProps(),
			quotes: () => requireQuotes(),
			radix: () => requireRadix(),
			"require-atomic-updates": () => requireRequireAtomicUpdates(),
			"require-await": () => requireRequireAwait(),
			"require-unicode-regexp": () => requireRequireUnicodeRegexp(),
			"require-yield": () => requireRequireYield(),
			"rest-spread-spacing": () => requireRestSpreadSpacing(),
			semi: () => requireSemi(),
			"semi-spacing": () => requireSemiSpacing(),
			"semi-style": () => requireSemiStyle(),
			"sort-imports": () => requireSortImports(),
			"sort-keys": () => requireSortKeys(),
			"sort-vars": () => requireSortVars(),
			"space-before-blocks": () => requireSpaceBeforeBlocks(),
			"space-before-function-paren": () =>
				requireSpaceBeforeFunctionParen(),
			"space-in-parens": () => requireSpaceInParens(),
			"space-infix-ops": () => requireSpaceInfixOps(),
			"space-unary-ops": () => requireSpaceUnaryOps(),
			"spaced-comment": () => requireSpacedComment(),
			strict: () => requireStrict(),
			"switch-colon-spacing": () => requireSwitchColonSpacing(),
			"symbol-description": () => requireSymbolDescription(),
			"template-curly-spacing": () => requireTemplateCurlySpacing(),
			"template-tag-spacing": () => requireTemplateTagSpacing(),
			"unicode-bom": () => requireUnicodeBom(),
			"use-isnan": () => requireUseIsnan(),
			"valid-typeof": () => requireValidTypeof(),
			"vars-on-top": () => requireVarsOnTop(),
			"wrap-iife": () => requireWrapIife(),
			"wrap-regex": () => requireWrapRegex(),
			"yield-star-spacing": () => requireYieldStarSpacing(),
			yoda: () => requireYoda(),
		}),
	);
	return rules$2;
}

/**
 * @fileoverview Defines a storage for rules.
 * @author Nicholas C. Zakas
 * @author aladdin-add
 */

var rules$1;
var hasRequiredRules;

function requireRules () {
	if (hasRequiredRules) return rules$1;
	hasRequiredRules = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const builtInRules = requireRules$1();

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/** @typedef {import("../shared/types").Rule} Rule */

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * A storage for rules.
	 */
	class Rules {
		constructor() {
			this._rules = Object.create(null);
		}

		/**
		 * Registers a rule module for rule id in storage.
		 * @param {string} ruleId Rule id (file name).
		 * @param {Rule} rule Rule object.
		 * @returns {void}
		 */
		define(ruleId, rule) {
			this._rules[ruleId] = rule;
		}

		/**
		 * Access rule handler by id (file name).
		 * @param {string} ruleId Rule id (file name).
		 * @returns {Rule} Rule object.
		 */
		get(ruleId) {
			if (typeof this._rules[ruleId] === "string") {
				this.define(ruleId, commonjsRequire(this._rules[ruleId]));
			}
			if (this._rules[ruleId]) {
				return this._rules[ruleId];
			}
			if (builtInRules.has(ruleId)) {
				return builtInRules.get(ruleId);
			}

			return null;
		}

		*[Symbol.iterator]() {
			yield* builtInRules;

			for (const ruleId of Object.keys(this._rules)) {
				yield [ruleId, this.get(ruleId)];
			}
		}
	}

	rules$1 = Rules;
	return rules$1;
}

/**
 * @fileoverview An object that caches and applies source code fixes.
 * @author Nicholas C. Zakas
 */

var sourceCodeFixer;
var hasRequiredSourceCodeFixer;

function requireSourceCodeFixer () {
	if (hasRequiredSourceCodeFixer) return sourceCodeFixer;
	hasRequiredSourceCodeFixer = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const debug = requireSrc()("eslint:source-code-fixer");

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	const BOM = "\uFEFF";

	/**
	 * Compares items in a messages array by range.
	 * @param {Message} a The first message.
	 * @param {Message} b The second message.
	 * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
	 * @private
	 */
	function compareMessagesByFixRange(a, b) {
		return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1];
	}

	/**
	 * Compares items in a messages array by line and column.
	 * @param {Message} a The first message.
	 * @param {Message} b The second message.
	 * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
	 * @private
	 */
	function compareMessagesByLocation(a, b) {
		return a.line - b.line || a.column - b.column;
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Utility for apply fixes to source code.
	 * @constructor
	 */
	function SourceCodeFixer() {
		Object.freeze(this);
	}

	/**
	 * Applies the fixes specified by the messages to the given text. Tries to be
	 * smart about the fixes and won't apply fixes over the same area in the text.
	 * @param {string} sourceText The text to apply the changes to.
	 * @param {Message[]} messages The array of messages reported by ESLint.
	 * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed
	 * @returns {Object} An object containing the fixed text and any unfixed messages.
	 */
	SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) {
		debug("Applying fixes");

		if (shouldFix === false) {
			debug("shouldFix parameter was false, not attempting fixes");
			return {
				fixed: false,
				messages,
				output: sourceText,
			};
		}

		// clone the array
		const remainingMessages = [],
			fixes = [],
			bom = sourceText.startsWith(BOM) ? BOM : "",
			text = bom ? sourceText.slice(1) : sourceText;
		let lastPos = Number.NEGATIVE_INFINITY,
			output = bom;

		/**
		 * Try to use the 'fix' from a problem.
		 * @param {Message} problem The message object to apply fixes from
		 * @returns {boolean} Whether fix was successfully applied
		 */
		function attemptFix(problem) {
			const fix = problem.fix;
			const start = fix.range[0];
			const end = fix.range[1];

			// Remain it as a problem if it's overlapped or it's a negative range
			if (lastPos >= start || start > end) {
				remainingMessages.push(problem);
				return false;
			}

			// Remove BOM.
			if (
				(start < 0 && end >= 0) ||
				(start === 0 && fix.text.startsWith(BOM))
			) {
				output = "";
			}

			// Make output to this fix.
			output += text.slice(Math.max(0, lastPos), Math.max(0, start));
			output += fix.text;
			lastPos = end;
			return true;
		}

		messages.forEach(problem => {
			if (Object.hasOwn(problem, "fix") && problem.fix) {
				fixes.push(problem);
			} else {
				remainingMessages.push(problem);
			}
		});

		if (fixes.length) {
			debug("Found fixes to apply");
			let fixesWereApplied = false;

			for (const problem of fixes.sort(compareMessagesByFixRange)) {
				if (typeof shouldFix !== "function" || shouldFix(problem)) {
					attemptFix(problem);

					/*
					 * The only time attemptFix will fail is if a previous fix was
					 * applied which conflicts with it.  So we can mark this as true.
					 */
					fixesWereApplied = true;
				} else {
					remainingMessages.push(problem);
				}
			}
			output += text.slice(Math.max(0, lastPos));

			return {
				fixed: fixesWereApplied,
				messages: remainingMessages.sort(compareMessagesByLocation),
				output,
			};
		}

		debug("No fixes to apply");
		return {
			fixed: false,
			messages,
			output: bom + text,
		};
	};

	sourceCodeFixer = SourceCodeFixer;
	return sourceCodeFixer;
}

var stats;
var hasRequiredStats;

function requireStats () {
	if (hasRequiredStats) return stats;
	hasRequiredStats = 1;

	/**
	 * Start time measurement
	 * @returns {[number, number]} t variable for tracking time
	 */
	function startTime() {
		return browser$1$1.hrtime();
	}

	/**
	 * End time measurement
	 * @param {[number, number]} t Variable for tracking time
	 * @returns {number} The measured time in milliseconds
	 */
	function endTime(t) {
		const time = browser$1$1.hrtime(t);

		return time[0] * 1e3 + time[1] / 1e6;
	}

	stats = {
		startTime,
		endTime,
	};
	return stats;
}

var timing;
var hasRequiredTiming;

function requireTiming () {
	if (hasRequiredTiming) return timing;
	hasRequiredTiming = 1;

	const { startTime, endTime } = requireStats();

	//------------------------------------------------------------------------------
	// Module definition
	//------------------------------------------------------------------------------

	const enabled = !!browser$1$1.env.TIMING;

	/**
	 * Decide how many rules to show in the output list.
	 * @returns {number} the number of rules to show
	 */
	function getListSize() {
		const MINIMUM_SIZE = 10;

		if (typeof browser$1$1.env.TIMING !== "string") {
			return MINIMUM_SIZE;
		}

		if (browser$1$1.env.TIMING.toLowerCase() === "all") {
			return Number.POSITIVE_INFINITY;
		}

		const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt(browser$1$1.env.TIMING, 10);

		return TIMING_ENV_VAR_AS_INTEGER > 10
			? TIMING_ENV_VAR_AS_INTEGER
			: MINIMUM_SIZE;
	}

	/* c8 ignore next */
	timing = (function () {
		const data = Object.create(null);

		/**
		 * Time the run
		 * @param {any} key key from the data object
		 * @param {Function} fn function to be called
		 * @param {boolean} stats if 'stats' is true, return the result and the time difference
		 * @returns {Function} function to be executed
		 * @private
		 */
		function time(key, fn, stats) {
			return function (...args) {
				const t = startTime();
				const result = fn(...args);
				const tdiff = endTime(t);

				if (enabled) {
					if (typeof data[key] === "undefined") {
						data[key] = 0;
					}

					data[key] += tdiff;
				}

				return stats ? { result, tdiff } : result;
			};
		}

		return {
			time,
			enabled,
			getListSize,
		};
	})();
	return timing;
}

var rules = {
	"generator-star": [
		"generator-star-spacing"
	],
	"global-strict": [
		"strict"
	],
	"no-arrow-condition": [
		"no-confusing-arrow",
		"no-constant-condition"
	],
	"no-comma-dangle": [
		"comma-dangle"
	],
	"no-empty-class": [
		"no-empty-character-class"
	],
	"no-empty-label": [
		"no-labels"
	],
	"no-extra-strict": [
		"strict"
	],
	"no-reserved-keys": [
		"quote-props"
	],
	"no-space-before-semi": [
		"semi-spacing"
	],
	"no-wrap-func": [
		"no-extra-parens"
	],
	"space-after-function-name": [
		"space-before-function-paren"
	],
	"space-after-keywords": [
		"keyword-spacing"
	],
	"space-before-function-parentheses": [
		"space-before-function-paren"
	],
	"space-before-keywords": [
		"keyword-spacing"
	],
	"space-in-brackets": [
		"object-curly-spacing",
		"array-bracket-spacing",
		"computed-property-spacing"
	],
	"space-return-throw-case": [
		"keyword-spacing"
	],
	"space-unary-word-ops": [
		"space-unary-ops"
	],
	"spaced-line-comment": [
		"spaced-comment"
	]
};
var require$$17 = {
	rules: rules
};

/**
 * @fileoverview Shared functions to work with configs.
 * @author Nicholas C. Zakas
 */

var flatConfigHelpers;
var hasRequiredFlatConfigHelpers;

function requireFlatConfigHelpers () {
	if (hasRequiredFlatConfigHelpers) return flatConfigHelpers;
	hasRequiredFlatConfigHelpers = 1;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/** @typedef {import("../shared/types").Rule} Rule */

	//------------------------------------------------------------------------------
	// Private Members
	//------------------------------------------------------------------------------

	// JSON schema that disallows passing any options
	const noOptionsSchema = Object.freeze({
		type: "array",
		minItems: 0,
		maxItems: 0,
	});

	//-----------------------------------------------------------------------------
	// Functions
	//-----------------------------------------------------------------------------

	/**
	 * Parses a ruleId into its plugin and rule parts.
	 * @param {string} ruleId The rule ID to parse.
	 * @returns {{pluginName:string,ruleName:string}} The plugin and rule
	 *      parts of the ruleId;
	 */
	function parseRuleId(ruleId) {
		let pluginName, ruleName;

		// distinguish between core rules and plugin rules
		if (ruleId.includes("/")) {
			// mimic scoped npm packages
			if (ruleId.startsWith("@")) {
				pluginName = ruleId.slice(0, ruleId.lastIndexOf("/"));
			} else {
				pluginName = ruleId.slice(0, ruleId.indexOf("/"));
			}

			ruleName = ruleId.slice(pluginName.length + 1);
		} else {
			pluginName = "@";
			ruleName = ruleId;
		}

		return {
			pluginName,
			ruleName,
		};
	}

	/**
	 * Retrieves a rule instance from a given config based on the ruleId.
	 * @param {string} ruleId The rule ID to look for.
	 * @param {FlatConfig} config The config to search.
	 * @returns {import("../shared/types").Rule|undefined} The rule if found
	 *      or undefined if not.
	 */
	function getRuleFromConfig(ruleId, config) {
		const { pluginName, ruleName } = parseRuleId(ruleId);

		return config.plugins?.[pluginName]?.rules?.[ruleName];
	}

	/**
	 * Gets a complete options schema for a rule.
	 * @param {Rule} rule A rule object
	 * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
	 * @returns {Object|null} JSON Schema for the rule's options. `null` if `meta.schema` is `false`.
	 */
	function getRuleOptionsSchema(rule) {
		if (!rule.meta) {
			return { ...noOptionsSchema }; // default if `meta.schema` is not specified
		}

		const schema = rule.meta.schema;

		if (typeof schema === "undefined") {
			return { ...noOptionsSchema }; // default if `meta.schema` is not specified
		}

		// `schema:false` is an allowed explicit opt-out of options validation for the rule
		if (schema === false) {
			return null;
		}

		if (typeof schema !== "object" || schema === null) {
			throw new TypeError("Rule's `meta.schema` must be an array or object");
		}

		// ESLint-specific array form needs to be converted into a valid JSON Schema definition
		if (Array.isArray(schema)) {
			if (schema.length) {
				return {
					type: "array",
					items: schema,
					minItems: 0,
					maxItems: schema.length,
				};
			}

			// `schema:[]` is an explicit way to specify that the rule does not accept any options
			return { ...noOptionsSchema };
		}

		// `schema:<object>` is assumed to be a valid JSON Schema definition
		return schema;
	}

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	flatConfigHelpers = {
		parseRuleId,
		getRuleFromConfig,
		getRuleOptionsSchema,
	};
	return flatConfigHelpers;
}

var flatConfigArray = {};

var cjs$1 = {};

var posix = {};

var hasRequiredPosix;

function requirePosix () {
	if (hasRequiredPosix) return posix;
	hasRequiredPosix = 1;

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	function assertPath(path) {
	  if (typeof path !== "string") {
	    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function stripSuffix(name, suffix) {
	  if (suffix.length >= name.length) {
	    return name;
	  }
	  const lenDiff = name.length - suffix.length;
	  for(let i = suffix.length - 1; i >= 0; --i){
	    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
	      return name;
	    }
	  }
	  return name.slice(0, -suffix.length);
	}
	function lastPathSegment(path, isSep, start = 0) {
	  let matchedNonSeparator = false;
	  let end = path.length;
	  for(let i = path.length - 1; i >= start; --i){
	    if (isSep(path.charCodeAt(i))) {
	      if (matchedNonSeparator) {
	        start = i + 1;
	        break;
	      }
	    } else if (!matchedNonSeparator) {
	      matchedNonSeparator = true;
	      end = i + 1;
	    }
	  }
	  return path.slice(start, end);
	}
	function assertArgs$1(path, suffix) {
	  assertPath(path);
	  if (path.length === 0) return path;
	  if (typeof suffix !== "string") {
	    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	function stripTrailingSeparators(segment, isSep) {
	  if (segment.length <= 1) {
	    return segment;
	  }
	  let end = segment.length;
	  for(let i = segment.length - 1; i > 0; i--){
	    if (isSep(segment.charCodeAt(i))) {
	      end = i;
	    } else {
	      break;
	    }
	  }
	  return segment.slice(0, end);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	// Alphabet chars.
	// Non-alphabetic chars.
	const CHAR_DOT = 46; /* . */ 
	const CHAR_FORWARD_SLASH = 47; /* / */

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	function isPosixPathSeparator(code) {
	  return code === CHAR_FORWARD_SLASH;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the last portion of a `path`.
	 * Trailing directory separators are ignored, and optional suffix is removed.
	 *
	 * @example Usage
	 * ```ts
	 * import { basename } from "@std/path/posix/basename";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(basename("/home/user/Documents/"), "Documents");
	 * assertEquals(basename("/home/user/Documents/image.png"), "image.png");
	 * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image");
	 * ```
	 *
	 * @example Working with URLs
	 *
	 * Note: This function doesn't automatically strip hash and query parts from
	 * URLs. If your URL contains a hash or query, remove them before passing the
	 * URL to the function. This can be done by passing the URL to `new URL(url)`,
	 * and setting the `hash` and `search` properties to empty strings.
	 *
	 * ```ts
	 * import { basename } from "@std/path/posix/basename";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts");
	 * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod");
	 * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b");
	 * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `basename` from `@std/path/posix/unstable-basename`.
	 *
	 * @param path The path to extract the name from.
	 * @param suffix The suffix to remove from extracted name.
	 * @returns The extracted name.
	 */ function basename(path, suffix = "") {
	  assertArgs$1(path, suffix);
	  const lastSegment = lastPathSegment(path, isPosixPathSeparator);
	  const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
	  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * The character used to separate entries in the PATH environment variable.
	 */ const DELIMITER = ":";
	/**
	 * The character used to separate components of a file path.
	 */ const SEPARATOR = "/";
	/**
	 * A regular expression that matches one or more path separators.
	 */ const SEPARATOR_PATTERN = /\/+/;

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg$3(path) {
	  assertPath(path);
	  if (path.length === 0) return ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the directory path of a `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { dirname } from "@std/path/posix/dirname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(dirname("/home/user/Documents/"), "/home/user");
	 * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents");
	 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
	 * ```
	 *
	 * @example Working with URLs
	 *
	 * ```ts
	 * import { dirname } from "@std/path/posix/dirname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
	 * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path");
	 * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `dirname` from `@std/path/posix/unstable-dirname`.
	 *
	 * @param path The path to get the directory from.
	 * @returns The directory path.
	 */ function dirname(path) {
	  assertArg$3(path);
	  let end = -1;
	  let matchedNonSeparator = false;
	  for(let i = path.length - 1; i >= 1; --i){
	    if (isPosixPathSeparator(path.charCodeAt(i))) {
	      if (matchedNonSeparator) {
	        end = i;
	        break;
	      }
	    } else {
	      matchedNonSeparator = true;
	    }
	  }
	  // No matches. Fallback based on provided path:
	  //
	  // - leading slashes paths
	  //     "/foo" => "/"
	  //     "///foo" => "/"
	  // - no slash path
	  //     "foo" => "."
	  if (end === -1) {
	    return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
	  }
	  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the extension of the `path` with leading period.
	 *
	 * @example Usage
	 * ```ts
	 * import { extname } from "@std/path/posix/extname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(extname("/home/user/Documents/file.ts"), ".ts");
	 * assertEquals(extname("/home/user/Documents/"), "");
	 * assertEquals(extname("/home/user/Documents/image.png"), ".png");
	 * ```
	 *
	 * @example Working with URLs
	 *
	 * Note: This function doesn't automatically strip hash and query parts from
	 * URLs. If your URL contains a hash or query, remove them before passing the
	 * URL to the function. This can be done by passing the URL to `new URL(url)`,
	 * and setting the `hash` and `search` properties to empty strings.
	 *
	 * ```ts
	 * import { extname } from "@std/path/posix/extname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts");
	 * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b");
	 * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `extname` from `@std/path/posix/unstable-extname`.
	 *
	 * @param path The path to get the extension from.
	 * @returns The extension (ex. for `file.ts` returns `.ts`).
	 */ function extname(path) {
	  assertPath(path);
	  let startDot = -1;
	  let startPart = 0;
	  let end = -1;
	  let matchedSlash = true;
	  // Track the state of characters (if any) we see before our first dot and
	  // after any path separator we find
	  let preDotState = 0;
	  for(let i = path.length - 1; i >= 0; --i){
	    const code = path.charCodeAt(i);
	    if (isPosixPathSeparator(code)) {
	      // If we reached a path separator that was not part of a set of path
	      // separators at the end of the string, stop now
	      if (!matchedSlash) {
	        startPart = i + 1;
	        break;
	      }
	      continue;
	    }
	    if (end === -1) {
	      // We saw the first non-path separator, mark this as the end of our
	      // extension
	      matchedSlash = false;
	      end = i + 1;
	    }
	    if (code === CHAR_DOT) {
	      // If this is our first dot, mark it as the start of our extension
	      if (startDot === -1) startDot = i;
	      else if (preDotState !== 1) preDotState = 1;
	    } else if (startDot !== -1) {
	      // We saw a non-dot and non-path separator before our dot, so we should
	      // have a good chance at having a non-empty extension
	      preDotState = -1;
	    }
	  }
	  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
	  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
	  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
	    return "";
	  }
	  return path.slice(startDot, end);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function _format(sep, pathObject) {
	  const dir = pathObject.dir || pathObject.root;
	  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
	  if (!dir) return base;
	  if (base === sep) return dir;
	  if (dir === pathObject.root) return dir + base;
	  return dir + sep + base;
	}
	function assertArg$2(pathObject) {
	  if (pathObject === null || typeof pathObject !== "object") {
	    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Generate a path from `ParsedPath` object.
	 *
	 * @example Usage
	 * ```ts
	 * import { format } from "@std/path/posix/format";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = format({
	 *   root: "/",
	 *   dir: "/path/dir",
	 *   base: "file.txt",
	 *   ext: ".txt",
	 *   name: "file"
	 * });
	 * assertEquals(path, "/path/dir/file.txt");
	 * ```
	 *
	 * @param pathObject The path object to format.
	 * @returns The formatted path.
	 */ function format(pathObject) {
	  assertArg$2(pathObject);
	  return _format("/", pathObject);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg$1(url) {
	  url = url instanceof URL ? url : new URL(url);
	  if (url.protocol !== "file:") {
	    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
	  }
	  return url;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Converts a file URL to a path string.
	 *
	 * @example Usage
	 * ```ts
	 * import { fromFileUrl } from "@std/path/posix/from-file-url";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
	 * ```
	 *
	 * @param url The file URL to convert.
	 * @returns The path string.
	 */ function fromFileUrl(url) {
	  url = assertArg$1(url);
	  return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Verifies whether provided path is absolute.
	 *
	 * @example Usage
	 * ```ts
	 * import { isAbsolute } from "@std/path/posix/is-absolute";
	 * import { assert, assertFalse } from "@std/assert";
	 *
	 * assert(isAbsolute("/home/user/Documents/"));
	 * assertFalse(isAbsolute("home/user/Documents/"));
	 * ```
	 *
	 * @param path The path to verify.
	 * @returns Whether the path is absolute.
	 */ function isAbsolute(path) {
	  assertPath(path);
	  return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg(path) {
	  assertPath(path);
	  if (path.length === 0) return ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	// Resolves . and .. elements in a path with directory names
	function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
	  let res = "";
	  let lastSegmentLength = 0;
	  let lastSlash = -1;
	  let dots = 0;
	  let code;
	  for(let i = 0; i <= path.length; ++i){
	    if (i < path.length) code = path.charCodeAt(i);
	    else if (isPathSeparator(code)) break;
	    else code = CHAR_FORWARD_SLASH;
	    if (isPathSeparator(code)) {
	      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
	        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
	          if (res.length > 2) {
	            const lastSlashIndex = res.lastIndexOf(separator);
	            if (lastSlashIndex === -1) {
	              res = "";
	              lastSegmentLength = 0;
	            } else {
	              res = res.slice(0, lastSlashIndex);
	              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
	            }
	            lastSlash = i;
	            dots = 0;
	            continue;
	          } else if (res.length === 2 || res.length === 1) {
	            res = "";
	            lastSegmentLength = 0;
	            lastSlash = i;
	            dots = 0;
	            continue;
	          }
	        }
	        if (allowAboveRoot) {
	          if (res.length > 0) res += `${separator}..`;
	          else res = "..";
	          lastSegmentLength = 2;
	        }
	      } else {
	        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
	        else res = path.slice(lastSlash + 1, i);
	        lastSegmentLength = i - lastSlash - 1;
	      }
	      lastSlash = i;
	      dots = 0;
	    } else if (code === CHAR_DOT && dots !== -1) {
	      ++dots;
	    } else {
	      dots = -1;
	    }
	  }
	  return res;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Normalize the `path`, resolving `'..'` and `'.'` segments.
	 * Note that resolving these segments does not necessarily mean that all will be eliminated.
	 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
	 *
	 * @example Usage
	 * ```ts
	 * import { normalize } from "@std/path/posix/normalize";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = normalize("/foo/bar//baz/asdf/quux/..");
	 * assertEquals(path, "/foo/bar/baz/asdf");
	 * ```
	 *
	 * @example Working with URLs
	 *
	 * Note: This function will remove the double slashes from a URL's scheme.
	 * Hence, do not pass a full URL to this function. Instead, pass the pathname of
	 * the URL.
	 *
	 * ```ts
	 * import { normalize } from "@std/path/posix/normalize";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const url = new URL("https://deno.land");
	 * url.pathname = normalize("//std//assert//.//mod.ts");
	 * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
	 *
	 * url.pathname = normalize("std/assert/../async/retry.ts");
	 * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `normalize` from `@std/path/posix/unstable-normalize`.
	 *
	 * @param path The path to normalize.
	 * @returns The normalized path.
	 */ function normalize(path) {
	  assertArg(path);
	  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
	  const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
	  // Normalize the path
	  path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
	  if (path.length === 0 && !isAbsolute) path = ".";
	  if (path.length > 0 && trailingSeparator) path += "/";
	  if (isAbsolute) return `/${path}`;
	  return path;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Join all given a sequence of `paths`,then normalizes the resulting path.
	 *
	 * @example Usage
	 * ```ts
	 * import { join } from "@std/path/posix/join";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = join("/foo", "bar", "baz/asdf", "quux", "..");
	 * assertEquals(path, "/foo/bar/baz/asdf");
	 * ```
	 *
	 * @example Working with URLs
	 * ```ts
	 * import { join } from "@std/path/posix/join";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const url = new URL("https://deno.land");
	 * url.pathname = join("std", "path", "mod.ts");
	 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
	 *
	 * url.pathname = join("//std", "path/", "/mod.ts");
	 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `join` from `@std/path/posix/unstable-join`.
	 *
	 * @param paths The paths to join.
	 * @returns The joined path.
	 */ function join(...paths) {
	  if (paths.length === 0) return ".";
	  paths.forEach((path)=>assertPath(path));
	  const joined = paths.filter((path)=>path.length > 0).join("/");
	  return joined === "" ? "." : normalize(joined);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return a `ParsedPath` object of the `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { parse } from "@std/path/posix/parse";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = parse("/home/user/file.txt");
	 * assertEquals(path, {
	 *   root: "/",
	 *   dir: "/home/user",
	 *   base: "file.txt",
	 *   ext: ".txt",
	 *   name: "file"
	 * });
	 * ```
	 *
	 * @param path The path to parse.
	 * @returns The parsed path object.
	 */ function parse(path) {
	  assertPath(path);
	  const ret = {
	    root: "",
	    dir: "",
	    base: "",
	    ext: "",
	    name: ""
	  };
	  if (path.length === 0) return ret;
	  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
	  let start;
	  if (isAbsolute) {
	    ret.root = "/";
	    start = 1;
	  } else {
	    start = 0;
	  }
	  let startDot = -1;
	  let startPart = 0;
	  let end = -1;
	  let matchedSlash = true;
	  let i = path.length - 1;
	  // Track the state of characters (if any) we see before our first dot and
	  // after any path separator we find
	  let preDotState = 0;
	  // Get non-dir info
	  for(; i >= start; --i){
	    const code = path.charCodeAt(i);
	    if (isPosixPathSeparator(code)) {
	      // If we reached a path separator that was not part of a set of path
	      // separators at the end of the string, stop now
	      if (!matchedSlash) {
	        startPart = i + 1;
	        break;
	      }
	      continue;
	    }
	    if (end === -1) {
	      // We saw the first non-path separator, mark this as the end of our
	      // extension
	      matchedSlash = false;
	      end = i + 1;
	    }
	    if (code === CHAR_DOT) {
	      // If this is our first dot, mark it as the start of our extension
	      if (startDot === -1) startDot = i;
	      else if (preDotState !== 1) preDotState = 1;
	    } else if (startDot !== -1) {
	      // We saw a non-dot and non-path separator before our dot, so we should
	      // have a good chance at having a non-empty extension
	      preDotState = -1;
	    }
	  }
	  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
	  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
	  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
	    if (end !== -1) {
	      if (startPart === 0 && isAbsolute) {
	        ret.base = ret.name = path.slice(1, end);
	      } else {
	        ret.base = ret.name = path.slice(startPart, end);
	      }
	    }
	    // Fallback to '/' in case there is no basename
	    ret.base = ret.base || "/";
	  } else {
	    if (startPart === 0 && isAbsolute) {
	      ret.name = path.slice(1, startDot);
	      ret.base = path.slice(1, end);
	    } else {
	      ret.name = path.slice(startPart, startDot);
	      ret.base = path.slice(startPart, end);
	    }
	    ret.ext = path.slice(startDot, end);
	  }
	  if (startPart > 0) {
	    ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
	  } else if (isAbsolute) ret.dir = "/";
	  return ret;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Resolves path segments into a `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { resolve } from "@std/path/posix/resolve";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
	 * assertEquals(path, "/foo/bar/baz/asdf");
	 * ```
	 *
	 * @param pathSegments The path segments to resolve.
	 * @returns The resolved path.
	 */ function resolve(...pathSegments) {
	  let resolvedPath = "";
	  let resolvedAbsolute = false;
	  for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){
	    let path;
	    if (i >= 0) path = pathSegments[i];
	    else {
	      // deno-lint-ignore no-explicit-any
	      const { Deno } = globalThis;
	      if (typeof Deno?.cwd !== "function") {
	        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
	      }
	      path = Deno.cwd();
	    }
	    assertPath(path);
	    // Skip empty entries
	    if (path.length === 0) {
	      continue;
	    }
	    resolvedPath = `${path}/${resolvedPath}`;
	    resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
	  }
	  // At this point the path should be resolved to a full absolute path, but
	  // handle relative paths to be safe (might happen when Deno.cwd() fails)
	  // Normalize the path
	  resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
	  if (resolvedAbsolute) {
	    if (resolvedPath.length > 0) return `/${resolvedPath}`;
	    else return "/";
	  } else if (resolvedPath.length > 0) return resolvedPath;
	  else return ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArgs(from, to) {
	  assertPath(from);
	  assertPath(to);
	  if (from === to) return "";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the relative path from `from` to `to` based on current working directory.
	 *
	 * If `from` and `to` are the same, return an empty string.
	 *
	 * @example Usage
	 * ```ts
	 * import { relative } from "@std/path/posix/relative";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
	 * assertEquals(path, "../../impl/bbb");
	 * ```
	 *
	 * @param from The path to start from.
	 * @param to The path to reach.
	 * @returns The relative path.
	 */ function relative(from, to) {
	  assertArgs(from, to);
	  from = resolve(from);
	  to = resolve(to);
	  if (from === to) return "";
	  // Trim any leading backslashes
	  let fromStart = 1;
	  const fromEnd = from.length;
	  for(; fromStart < fromEnd; ++fromStart){
	    if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break;
	  }
	  const fromLen = fromEnd - fromStart;
	  // Trim any leading backslashes
	  let toStart = 1;
	  const toEnd = to.length;
	  for(; toStart < toEnd; ++toStart){
	    if (!isPosixPathSeparator(to.charCodeAt(toStart))) break;
	  }
	  const toLen = toEnd - toStart;
	  // Compare paths to find the longest common path from root
	  const length = fromLen < toLen ? fromLen : toLen;
	  let lastCommonSep = -1;
	  let i = 0;
	  for(; i <= length; ++i){
	    if (i === length) {
	      if (toLen > length) {
	        if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
	          // We get here if `from` is the exact base path for `to`.
	          // For example: from='/foo/bar'; to='/foo/bar/baz'
	          return to.slice(toStart + i + 1);
	        } else if (i === 0) {
	          // We get here if `from` is the root
	          // For example: from='/'; to='/foo'
	          return to.slice(toStart + i);
	        }
	      } else if (fromLen > length) {
	        if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
	          // We get here if `to` is the exact base path for `from`.
	          // For example: from='/foo/bar/baz'; to='/foo/bar'
	          lastCommonSep = i;
	        } else if (i === 0) {
	          // We get here if `to` is the root.
	          // For example: from='/foo'; to='/'
	          lastCommonSep = 0;
	        }
	      }
	      break;
	    }
	    const fromCode = from.charCodeAt(fromStart + i);
	    const toCode = to.charCodeAt(toStart + i);
	    if (fromCode !== toCode) break;
	    else if (isPosixPathSeparator(fromCode)) lastCommonSep = i;
	  }
	  let out = "";
	  // Generate the relative path based on the path difference between `to`
	  // and `from`
	  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
	    if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
	      if (out.length === 0) out += "..";
	      else out += "/..";
	    }
	  }
	  // Lastly, append the rest of the destination (`to`) path that comes after
	  // the common path parts
	  if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
	  else {
	    toStart += lastCommonSep;
	    if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart;
	    return to.slice(toStart);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	const WHITESPACE_ENCODINGS = {
	  "\u0009": "%09",
	  "\u000A": "%0A",
	  "\u000B": "%0B",
	  "\u000C": "%0C",
	  "\u000D": "%0D",
	  "\u0020": "%20"
	};
	function encodeWhitespace(string) {
	  return string.replaceAll(/[\s]/g, (c)=>{
	    return WHITESPACE_ENCODINGS[c] ?? c;
	  });
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Converts a path string to a file URL.
	 *
	 * @example Usage
	 * ```ts
	 * import { toFileUrl } from "@std/path/posix/to-file-url";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
	 * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
	 * ```
	 *
	 * @param path The path to convert.
	 * @returns The file URL.
	 */ function toFileUrl(path) {
	  if (!isAbsolute(path)) {
	    throw new TypeError(`Path must be absolute: received "${path}"`);
	  }
	  const url = new URL("file:///");
	  url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
	  return url;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Converts a path to a namespaced path. This function returns the path as is on posix.
	 *
	 * @example Usage
	 * ```ts
	 * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
	 * ```
	 *
	 * @param path The path.
	 * @returns The namespaced path.
	 */ function toNamespacedPath(path) {
	  // Non-op on posix systems
	  return path;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function common$1(paths, sep) {
	  const [first = "", ...remaining] = paths;
	  const parts = first.split(sep);
	  let endOfPrefix = parts.length;
	  let append = "";
	  for (const path of remaining){
	    const compare = path.split(sep);
	    if (compare.length <= endOfPrefix) {
	      endOfPrefix = compare.length;
	      append = "";
	    }
	    for(let i = 0; i < endOfPrefix; i++){
	      if (compare[i] !== parts[i]) {
	        endOfPrefix = i;
	        append = i === 0 ? "" : sep;
	        break;
	      }
	    }
	  }
	  return parts.slice(0, endOfPrefix).join(sep) + append;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/** Determines the common path from a set of paths for POSIX systems.
	 *
	 * @example Usage
	 * ```ts
	 * import { common } from "@std/path/posix/common";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = common([
	 *   "./deno/std/path/mod.ts",
	 *   "./deno/std/fs/mod.ts",
	 * ]);
	 * assertEquals(path, "./deno/std/");
	 * ```
	 *
	 * @param paths The paths to compare.
	 * @returns The common path.
	 */ function common(paths) {
	  return common$1(paths, SEPARATOR);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
	 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
	 */ const REG_EXP_ESCAPE_CHARS = [
	  "!",
	  "$",
	  "(",
	  ")",
	  "*",
	  "+",
	  ".",
	  "=",
	  "?",
	  "[",
	  "\\",
	  "^",
	  "{",
	  "|"
	];
	const RANGE_ESCAPE_CHARS = [
	  "-",
	  "\\",
	  "]"
	];
	function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
	caseInsensitive = false } = {}) {
	  if (glob === "") {
	    return /(?!)/;
	  }
	  // Remove trailing separators.
	  let newLength = glob.length;
	  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
	  glob = glob.slice(0, newLength);
	  let regExpString = "";
	  // Terminates correctly. Trust that `j` is incremented every iteration.
	  for(let j = 0; j < glob.length;){
	    let segment = "";
	    const groupStack = [];
	    let inRange = false;
	    let inEscape = false;
	    let endsWithSep = false;
	    let i = j;
	    // Terminates with `i` at the non-inclusive end of the current segment.
	    for(; i < glob.length && !c.seps.includes(glob[i]); i++){
	      if (inEscape) {
	        inEscape = false;
	        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
	        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
	        continue;
	      }
	      if (glob[i] === c.escapePrefix) {
	        inEscape = true;
	        continue;
	      }
	      if (glob[i] === "[") {
	        if (!inRange) {
	          inRange = true;
	          segment += "[";
	          if (glob[i + 1] === "!") {
	            i++;
	            segment += "^";
	          } else if (glob[i + 1] === "^") {
	            i++;
	            segment += "\\^";
	          }
	          continue;
	        } else if (glob[i + 1] === ":") {
	          let k = i + 1;
	          let value = "";
	          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
	            value += glob[k + 1];
	            k++;
	          }
	          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
	            i = k + 2;
	            if (value === "alnum") segment += "\\dA-Za-z";
	            else if (value === "alpha") segment += "A-Za-z";
	            else if (value === "ascii") segment += "\x00-\x7F";
	            else if (value === "blank") segment += "\t ";
	            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
	            else if (value === "digit") segment += "\\d";
	            else if (value === "graph") segment += "\x21-\x7E";
	            else if (value === "lower") segment += "a-z";
	            else if (value === "print") segment += "\x20-\x7E";
	            else if (value === "punct") {
	              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
	            } else if (value === "space") segment += "\\s\v";
	            else if (value === "upper") segment += "A-Z";
	            else if (value === "word") segment += "\\w";
	            else if (value === "xdigit") segment += "\\dA-Fa-f";
	            continue;
	          }
	        }
	      }
	      if (glob[i] === "]" && inRange) {
	        inRange = false;
	        segment += "]";
	        continue;
	      }
	      if (inRange) {
	        segment += glob[i];
	        continue;
	      }
	      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
	        segment += ")";
	        const type = groupStack.pop();
	        if (type === "!") {
	          segment += c.wildcard;
	        } else if (type !== "@") {
	          segment += type;
	        }
	        continue;
	      }
	      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
	        segment += "|";
	        continue;
	      }
	      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("+");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("@");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "?") {
	        if (extended && glob[i + 1] === "(") {
	          i++;
	          groupStack.push("?");
	          segment += "(?:";
	        } else {
	          segment += ".";
	        }
	        continue;
	      }
	      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("!");
	        segment += "(?!";
	        continue;
	      }
	      if (glob[i] === "{") {
	        groupStack.push("BRACE");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
	        groupStack.pop();
	        segment += ")";
	        continue;
	      }
	      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
	        segment += "|";
	        continue;
	      }
	      if (glob[i] === "*") {
	        if (extended && glob[i + 1] === "(") {
	          i++;
	          groupStack.push("*");
	          segment += "(?:";
	        } else {
	          const prevChar = glob[i - 1];
	          let numStars = 1;
	          while(glob[i + 1] === "*"){
	            i++;
	            numStars++;
	          }
	          const nextChar = glob[i + 1];
	          if (globstarOption && numStars === 2 && [
	            ...c.seps,
	            undefined
	          ].includes(prevChar) && [
	            ...c.seps,
	            undefined
	          ].includes(nextChar)) {
	            segment += c.globstar;
	            endsWithSep = true;
	          } else {
	            segment += c.wildcard;
	          }
	        }
	        continue;
	      }
	      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
	    }
	    // Check for unclosed groups or a dangling backslash.
	    if (groupStack.length > 0 || inRange || inEscape) {
	      // Parse failure. Take all characters from this segment literally.
	      segment = "";
	      for (const c of glob.slice(j, i)){
	        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
	        endsWithSep = false;
	      }
	    }
	    regExpString += segment;
	    if (!endsWithSep) {
	      regExpString += i < glob.length ? c.sep : c.sepMaybe;
	      endsWithSep = true;
	    }
	    // Terminates with `i` at the start of the next segment.
	    while(c.seps.includes(glob[i]))i++;
	    j = i;
	  }
	  regExpString = `^${regExpString}$`;
	  return new RegExp(regExpString, caseInsensitive ? "i" : "");
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	const constants = {
	  sep: "/+",
	  sepMaybe: "/*",
	  seps: [
	    "/"
	  ],
	  globstar: "(?:[^/]*(?:/|$)+)*",
	  wildcard: "[^/]*",
	  escapePrefix: "\\"
	};
	/** Convert a glob string to a regular expression.
	 *
	 * Tries to match bash glob expansion as closely as possible.
	 *
	 * Basic glob syntax:
	 * - `*` - Matches everything without leaving the path segment.
	 * - `?` - Matches any single character.
	 * - `{foo,bar}` - Matches `foo` or `bar`.
	 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
	 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
	 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
	 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
	 *     - `[[:alnum:]]` - Matches any digit or letter.
	 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
	 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
	 *       for a complete list of supported character classes.
	 * - `\` - Escapes the next character for an `os` other than `"windows"`.
	 * - \` - Escapes the next character for `os` set to `"windows"`.
	 * - `/` - Path separator.
	 * - `\` - Additional path separator only for `os` set to `"windows"`.
	 *
	 * Extended syntax:
	 * - Requires `{ extended: true }`.
	 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
	 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
	 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
	 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
	 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
	 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
	 *
	 * Globstar syntax:
	 * - Requires `{ globstar: true }`.
	 * - `**` - Matches any number of any path segments.
	 *     - Must comprise its entire path segment in the provided glob.
	 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
	 *
	 * Note the following properties:
	 * - The generated `RegExp` is anchored at both start and end.
	 * - Repeating and trailing separators are tolerated. Trailing separators in the
	 *   provided glob have no meaning and are discarded.
	 * - Absolute globs will only match absolute paths, etc.
	 * - Empty globs will match nothing.
	 * - Any special glob syntax must be contained to one path segment. For example,
	 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
	 *   first segment ends with an unclosed group.
	 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
	 *   parse error has occurred. Every character for that segment is taken
	 *   literally in this event.
	 *
	 * Limitations:
	 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
	 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
	 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
	 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
	 *   the group occurs not nested at the end of the segment.
	 *
	 * @example Usage
	 * ```ts
	 * import { globToRegExp } from "@std/path/posix/glob-to-regexp";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/);
	 * ```
	 *
	 * @param glob Glob string to convert.
	 * @param options Conversion options.
	 * @returns The regular expression equivalent to the glob.
	 */ function globToRegExp(glob, options = {}) {
	  return _globToRegExp(constants, glob, options);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Test whether the given string is a glob.
	 *
	 * @example Usage
	 * ```ts
	 * import { isGlob } from "@std/path/is-glob";
	 * import { assert } from "@std/assert";
	 *
	 * assert(!isGlob("foo/bar/../baz"));
	 * assert(isGlob("foo/*ar/../baz"));
	 * ```
	 *
	 * @param str String to test.
	 * @returns `true` if the given string is a glob, otherwise `false`
	 */ function isGlob(str) {
	  const chars = {
	    "{": "}",
	    "(": ")",
	    "[": "]"
	  };
	  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
	  if (str === "") {
	    return false;
	  }
	  let match;
	  while(match = regex.exec(str)){
	    if (match[2]) return true;
	    let idx = match.index + match[0].length;
	    // if an open bracket/brace/paren is escaped,
	    // set the index to the next closing character
	    const open = match[1];
	    const close = open ? chars[open] : null;
	    if (open && close) {
	      const n = str.indexOf(close, idx);
	      if (n !== -1) {
	        idx = n + 1;
	      }
	    }
	    str = str.slice(idx);
	  }
	  return false;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
	 *
	 * @example Usage
	 * ```ts
	 * import { normalizeGlob } from "@std/path/posix/normalize-glob";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = normalizeGlob("foo/bar/../*", { globstar: true });
	 * assertEquals(path, "foo/*");
	 * ```
	 *
	 * @param glob The glob to normalize.
	 * @param options The options to use.
	 * @returns The normalized path.
	 */ function normalizeGlob(glob, options = {}) {
	  const { globstar = false } = options;
	  if (glob.match(/\0/g)) {
	    throw new Error(`Glob contains invalid characters: "${glob}"`);
	  }
	  if (!globstar) {
	    return normalize(glob);
	  }
	  const s = SEPARATOR_PATTERN.source;
	  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
	  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
	 *
	 * @example Usage
	 * ```ts
	 * import { joinGlobs } from "@std/path/posix/join-globs";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
	 * assertEquals(path, "foo/bar/**");
	 * ```
	 *
	 * @param globs The globs to join.
	 * @param options The options to use.
	 * @returns The joined path.
	 */ function joinGlobs(globs, options = {}) {
	  const { globstar = false } = options;
	  if (!globstar || globs.length === 0) {
	    return join(...globs);
	  }
	  let joined;
	  for (const glob of globs){
	    const path = glob;
	    if (path.length > 0) {
	      if (!joined) joined = path;
	      else joined += `${SEPARATOR}${path}`;
	    }
	  }
	  if (!joined) return ".";
	  return normalizeGlob(joined, {
	    globstar
	  });
	}

	posix.DELIMITER = DELIMITER;
	posix.SEPARATOR = SEPARATOR;
	posix.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
	posix.basename = basename;
	posix.common = common;
	posix.dirname = dirname;
	posix.extname = extname;
	posix.format = format;
	posix.fromFileUrl = fromFileUrl;
	posix.globToRegExp = globToRegExp;
	posix.isAbsolute = isAbsolute;
	posix.isGlob = isGlob;
	posix.join = join;
	posix.joinGlobs = joinGlobs;
	posix.normalize = normalize;
	posix.normalizeGlob = normalizeGlob;
	posix.parse = parse;
	posix.relative = relative;
	posix.resolve = resolve;
	posix.toFileUrl = toFileUrl;
	posix.toNamespacedPath = toNamespacedPath;
	return posix;
}

var windows = {};

var hasRequiredWindows;

function requireWindows () {
	if (hasRequiredWindows) return windows;
	hasRequiredWindows = 1;

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	function assertPath(path) {
	  if (typeof path !== "string") {
	    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function stripSuffix(name, suffix) {
	  if (suffix.length >= name.length) {
	    return name;
	  }
	  const lenDiff = name.length - suffix.length;
	  for(let i = suffix.length - 1; i >= 0; --i){
	    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
	      return name;
	    }
	  }
	  return name.slice(0, -suffix.length);
	}
	function lastPathSegment(path, isSep, start = 0) {
	  let matchedNonSeparator = false;
	  let end = path.length;
	  for(let i = path.length - 1; i >= start; --i){
	    if (isSep(path.charCodeAt(i))) {
	      if (matchedNonSeparator) {
	        start = i + 1;
	        break;
	      }
	    } else if (!matchedNonSeparator) {
	      matchedNonSeparator = true;
	      end = i + 1;
	    }
	  }
	  return path.slice(start, end);
	}
	function assertArgs$1(path, suffix) {
	  assertPath(path);
	  if (path.length === 0) return path;
	  if (typeof suffix !== "string") {
	    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	// Alphabet chars.
	const CHAR_UPPERCASE_A = 65; /* A */ 
	const CHAR_LOWERCASE_A = 97; /* a */ 
	const CHAR_UPPERCASE_Z = 90; /* Z */ 
	const CHAR_LOWERCASE_Z = 122; /* z */ 
	// Non-alphabetic chars.
	const CHAR_DOT = 46; /* . */ 
	const CHAR_FORWARD_SLASH = 47; /* / */ 
	const CHAR_BACKWARD_SLASH = 92; /* \ */ 
	const CHAR_COLON = 58; /* : */ 
	const CHAR_QUESTION_MARK = 63; /* ? */

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	function stripTrailingSeparators(segment, isSep) {
	  if (segment.length <= 1) {
	    return segment;
	  }
	  let end = segment.length;
	  for(let i = segment.length - 1; i > 0; i--){
	    if (isSep(segment.charCodeAt(i))) {
	      end = i;
	    } else {
	      break;
	    }
	  }
	  return segment.slice(0, end);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	function isPosixPathSeparator(code) {
	  return code === CHAR_FORWARD_SLASH;
	}
	function isPathSeparator(code) {
	  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
	}
	function isWindowsDeviceRoot(code) {
	  return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the last portion of a `path`.
	 * Trailing directory separators are ignored, and optional suffix is removed.
	 *
	 * @example Usage
	 * ```ts
	 * import { basename } from "@std/path/windows/basename";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(basename("C:\\user\\Documents\\"), "Documents");
	 * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
	 * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `basename` from `@std/path/windows/unstable-basename`.
	 *
	 * @param path The path to extract the name from.
	 * @param suffix The suffix to remove from extracted name.
	 * @returns The extracted name.
	 */ function basename(path, suffix = "") {
	  assertArgs$1(path, suffix);
	  // Check for a drive letter prefix so as not to mistake the following
	  // path separator as an extra separator at the end of the path that can be
	  // disregarded
	  let start = 0;
	  if (path.length >= 2) {
	    const drive = path.charCodeAt(0);
	    if (isWindowsDeviceRoot(drive)) {
	      if (path.charCodeAt(1) === CHAR_COLON) start = 2;
	    }
	  }
	  const lastSegment = lastPathSegment(path, isPathSeparator, start);
	  const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
	  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * The character used to separate entries in the PATH environment variable.
	 */ const DELIMITER = ";";
	/**
	 * The character used to separate components of a file path.
	 */ const SEPARATOR = "\\";
	/**
	 * A regular expression that matches one or more path separators.
	 */ const SEPARATOR_PATTERN = /[\\/]+/;

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg$3(path) {
	  assertPath(path);
	  if (path.length === 0) return ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the directory path of a `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { dirname } from "@std/path/windows/dirname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const dir = dirname("C:\\foo\\bar\\baz.ext");
	 * assertEquals(dir, "C:\\foo\\bar");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `dirname` from `@std/path/windows/unstable-dirname`.
	 *
	 * @param path The path to get the directory from.
	 * @returns The directory path.
	 */ function dirname(path) {
	  assertArg$3(path);
	  const len = path.length;
	  let rootEnd = -1;
	  let end = -1;
	  let matchedSlash = true;
	  let offset = 0;
	  const code = path.charCodeAt(0);
	  // Try to match a root
	  if (len > 1) {
	    if (isPathSeparator(code)) {
	      // Possible UNC root
	      rootEnd = offset = 1;
	      if (isPathSeparator(path.charCodeAt(1))) {
	        // Matched double path separator at beginning
	        let j = 2;
	        let last = j;
	        // Match 1 or more non-path separators
	        for(; j < len; ++j){
	          if (isPathSeparator(path.charCodeAt(j))) break;
	        }
	        if (j < len && j !== last) {
	          // Matched!
	          last = j;
	          // Match 1 or more path separators
	          for(; j < len; ++j){
	            if (!isPathSeparator(path.charCodeAt(j))) break;
	          }
	          if (j < len && j !== last) {
	            // Matched!
	            last = j;
	            // Match 1 or more non-path separators
	            for(; j < len; ++j){
	              if (isPathSeparator(path.charCodeAt(j))) break;
	            }
	            if (j === len) {
	              // We matched a UNC root only
	              return path;
	            }
	            if (j !== last) {
	              // We matched a UNC root with leftovers
	              // Offset by 1 to include the separator after the UNC root to
	              // treat it as a "normal root" on top of a (UNC) root
	              rootEnd = offset = j + 1;
	            }
	          }
	        }
	      }
	    } else if (isWindowsDeviceRoot(code)) {
	      // Possible device root
	      if (path.charCodeAt(1) === CHAR_COLON) {
	        rootEnd = offset = 2;
	        if (len > 2) {
	          if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
	        }
	      }
	    }
	  } else if (isPathSeparator(code)) {
	    // `path` contains just a path separator, exit early to avoid
	    // unnecessary work
	    return path;
	  }
	  for(let i = len - 1; i >= offset; --i){
	    if (isPathSeparator(path.charCodeAt(i))) {
	      if (!matchedSlash) {
	        end = i;
	        break;
	      }
	    } else {
	      // We saw the first non-path separator
	      matchedSlash = false;
	    }
	  }
	  if (end === -1) {
	    if (rootEnd === -1) return ".";
	    else end = rootEnd;
	  }
	  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the extension of the `path` with leading period.
	 *
	 * @example Usage
	 * ```ts
	 * import { extname } from "@std/path/windows/extname";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const ext = extname("file.ts");
	 * assertEquals(ext, ".ts");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `extname` from `@std/path/windows/unstable-extname`.
	 *
	 * @param path The path to get the extension from.
	 * @returns The extension of the `path`.
	 */ function extname(path) {
	  assertPath(path);
	  let start = 0;
	  let startDot = -1;
	  let startPart = 0;
	  let end = -1;
	  let matchedSlash = true;
	  // Track the state of characters (if any) we see before our first dot and
	  // after any path separator we find
	  let preDotState = 0;
	  // Check for a drive letter prefix so as not to mistake the following
	  // path separator as an extra separator at the end of the path that can be
	  // disregarded
	  if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
	    start = startPart = 2;
	  }
	  for(let i = path.length - 1; i >= start; --i){
	    const code = path.charCodeAt(i);
	    if (isPathSeparator(code)) {
	      // If we reached a path separator that was not part of a set of path
	      // separators at the end of the string, stop now
	      if (!matchedSlash) {
	        startPart = i + 1;
	        break;
	      }
	      continue;
	    }
	    if (end === -1) {
	      // We saw the first non-path separator, mark this as the end of our
	      // extension
	      matchedSlash = false;
	      end = i + 1;
	    }
	    if (code === CHAR_DOT) {
	      // If this is our first dot, mark it as the start of our extension
	      if (startDot === -1) startDot = i;
	      else if (preDotState !== 1) preDotState = 1;
	    } else if (startDot !== -1) {
	      // We saw a non-dot and non-path separator before our dot, so we should
	      // have a good chance at having a non-empty extension
	      preDotState = -1;
	    }
	  }
	  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
	  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
	  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
	    return "";
	  }
	  return path.slice(startDot, end);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function _format(sep, pathObject) {
	  const dir = pathObject.dir || pathObject.root;
	  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
	  if (!dir) return base;
	  if (base === sep) return dir;
	  if (dir === pathObject.root) return dir + base;
	  return dir + sep + base;
	}
	function assertArg$2(pathObject) {
	  if (pathObject === null || typeof pathObject !== "object") {
	    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Generate a path from `ParsedPath` object.
	 *
	 * @example Usage
	 * ```ts
	 * import { format } from "@std/path/windows/format";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = format({
	 *   root: "C:\\",
	 *   dir: "C:\\path\\dir",
	 *   base: "file.txt",
	 *   ext: ".txt",
	 *   name: "file"
	 * });
	 * assertEquals(path, "C:\\path\\dir\\file.txt");
	 * ```
	 *
	 * @param pathObject The path object to format.
	 * @returns The formatted path.
	 */ function format(pathObject) {
	  assertArg$2(pathObject);
	  return _format("\\", pathObject);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg$1(url) {
	  url = url instanceof URL ? url : new URL(url);
	  if (url.protocol !== "file:") {
	    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
	  }
	  return url;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Converts a file URL to a path string.
	 *
	 * @example Usage
	 * ```ts
	 * import { fromFileUrl } from "@std/path/windows/from-file-url";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
	 * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
	 * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
	 * ```
	 *
	 * @param url The file URL to convert.
	 * @returns The path string.
	 */ function fromFileUrl(url) {
	  url = assertArg$1(url);
	  let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
	  if (url.hostname !== "") {
	    // Note: The `URL` implementation guarantees that the drive letter and
	    // hostname are mutually exclusive. Otherwise it would not have been valid
	    // to append the hostname and path like this.
	    path = `\\\\${url.hostname}${path}`;
	  }
	  return path;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Verifies whether provided path is absolute.
	 *
	 * @example Usage
	 * ```ts
	 * import { isAbsolute } from "@std/path/windows/is-absolute";
	 * import { assert, assertFalse } from "@std/assert";
	 *
	 * assert(isAbsolute("C:\\foo\\bar"));
	 * assertFalse(isAbsolute("..\\baz"));
	 * ```
	 *
	 * @param path The path to verify.
	 * @returns `true` if the path is absolute, `false` otherwise.
	 */ function isAbsolute(path) {
	  assertPath(path);
	  const len = path.length;
	  if (len === 0) return false;
	  const code = path.charCodeAt(0);
	  if (isPathSeparator(code)) {
	    return true;
	  } else if (isWindowsDeviceRoot(code)) {
	    // Possible device root
	    if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
	      if (isPathSeparator(path.charCodeAt(2))) return true;
	    }
	  }
	  return false;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArg(path) {
	  assertPath(path);
	  if (path.length === 0) return ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// Copyright the Browserify authors. MIT License.
	// Ported from https://github.com/browserify/path-browserify/
	// This module is browser compatible.
	// Resolves . and .. elements in a path with directory names
	function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
	  let res = "";
	  let lastSegmentLength = 0;
	  let lastSlash = -1;
	  let dots = 0;
	  let code;
	  for(let i = 0; i <= path.length; ++i){
	    if (i < path.length) code = path.charCodeAt(i);
	    else if (isPathSeparator(code)) break;
	    else code = CHAR_FORWARD_SLASH;
	    if (isPathSeparator(code)) {
	      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
	        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
	          if (res.length > 2) {
	            const lastSlashIndex = res.lastIndexOf(separator);
	            if (lastSlashIndex === -1) {
	              res = "";
	              lastSegmentLength = 0;
	            } else {
	              res = res.slice(0, lastSlashIndex);
	              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
	            }
	            lastSlash = i;
	            dots = 0;
	            continue;
	          } else if (res.length === 2 || res.length === 1) {
	            res = "";
	            lastSegmentLength = 0;
	            lastSlash = i;
	            dots = 0;
	            continue;
	          }
	        }
	        if (allowAboveRoot) {
	          if (res.length > 0) res += `${separator}..`;
	          else res = "..";
	          lastSegmentLength = 2;
	        }
	      } else {
	        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
	        else res = path.slice(lastSlash + 1, i);
	        lastSegmentLength = i - lastSlash - 1;
	      }
	      lastSlash = i;
	      dots = 0;
	    } else if (code === CHAR_DOT && dots !== -1) {
	      ++dots;
	    } else {
	      dots = -1;
	    }
	  }
	  return res;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Normalize the `path`, resolving `'..'` and `'.'` segments.
	 * Note that resolving these segments does not necessarily mean that all will be eliminated.
	 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
	 *
	 * @example Usage
	 * ```ts
	 * import { normalize } from "@std/path/windows/normalize";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const normalized = normalize("C:\\foo\\..\\bar");
	 * assertEquals(normalized, "C:\\bar");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `normalize` from `@std/path/windows/unstable-normalize`.
	 *
	 * @param path The path to normalize
	 * @returns The normalized path
	 */ function normalize(path) {
	  assertArg(path);
	  const len = path.length;
	  let rootEnd = 0;
	  let device;
	  let isAbsolute = false;
	  const code = path.charCodeAt(0);
	  // Try to match a root
	  if (len > 1) {
	    if (isPathSeparator(code)) {
	      // Possible UNC root
	      // If we started with a separator, we know we at least have an absolute
	      // path of some kind (UNC or otherwise)
	      isAbsolute = true;
	      if (isPathSeparator(path.charCodeAt(1))) {
	        // Matched double path separator at beginning
	        let j = 2;
	        let last = j;
	        // Match 1 or more non-path separators
	        for(; j < len; ++j){
	          if (isPathSeparator(path.charCodeAt(j))) break;
	        }
	        if (j < len && j !== last) {
	          const firstPart = path.slice(last, j);
	          // Matched!
	          last = j;
	          // Match 1 or more path separators
	          for(; j < len; ++j){
	            if (!isPathSeparator(path.charCodeAt(j))) break;
	          }
	          if (j < len && j !== last) {
	            // Matched!
	            last = j;
	            // Match 1 or more non-path separators
	            for(; j < len; ++j){
	              if (isPathSeparator(path.charCodeAt(j))) break;
	            }
	            if (j === len) {
	              // We matched a UNC root only
	              // Return the normalized version of the UNC root since there
	              // is nothing left to process
	              return `\\\\${firstPart}\\${path.slice(last)}\\`;
	            } else if (j !== last) {
	              // We matched a UNC root with leftovers
	              device = `\\\\${firstPart}\\${path.slice(last, j)}`;
	              rootEnd = j;
	            }
	          }
	        }
	      } else {
	        rootEnd = 1;
	      }
	    } else if (isWindowsDeviceRoot(code)) {
	      // Possible device root
	      if (path.charCodeAt(1) === CHAR_COLON) {
	        device = path.slice(0, 2);
	        rootEnd = 2;
	        if (len > 2) {
	          if (isPathSeparator(path.charCodeAt(2))) {
	            // Treat separator following drive name as an absolute path
	            // indicator
	            isAbsolute = true;
	            rootEnd = 3;
	          }
	        }
	      }
	    }
	  } else if (isPathSeparator(code)) {
	    // `path` contains just a path separator, exit early to avoid unnecessary
	    // work
	    return "\\";
	  }
	  let tail;
	  if (rootEnd < len) {
	    tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
	  } else {
	    tail = "";
	  }
	  if (tail.length === 0 && !isAbsolute) tail = ".";
	  if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
	    tail += "\\";
	  }
	  if (device === undefined) {
	    if (isAbsolute) {
	      if (tail.length > 0) return `\\${tail}`;
	      else return "\\";
	    }
	    return tail;
	  } else if (isAbsolute) {
	    if (tail.length > 0) return `${device}\\${tail}`;
	    else return `${device}\\`;
	  }
	  return device + tail;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Join all given a sequence of `paths`,then normalizes the resulting path.
	 *
	 * @example Usage
	 * ```ts
	 * import { join } from "@std/path/windows/join";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const joined = join("C:\\foo", "bar", "baz\\..");
	 * assertEquals(joined, "C:\\foo\\bar");
	 * ```
	 *
	 * Note: If you are working with file URLs,
	 * use the new version of `join` from `@std/path/windows/unstable-join`.
	 *
	 * @param paths The paths to join.
	 * @returns The joined path.
	 */ function join(...paths) {
	  paths.forEach((path)=>assertPath(path));
	  paths = paths.filter((path)=>path.length > 0);
	  if (paths.length === 0) return ".";
	  // Make sure that the joined path doesn't start with two slashes, because
	  // normalize() will mistake it for an UNC path then.
	  //
	  // This step is skipped when it is very clear that the user actually
	  // intended to point at an UNC path. This is assumed when the first
	  // non-empty string arguments starts with exactly two slashes followed by
	  // at least one more non-slash character.
	  //
	  // Note that for normalize() to treat a path as an UNC path it needs to
	  // have at least 2 components, so we don't filter for that here.
	  // This means that the user can use join to construct UNC paths from
	  // a server name and a share name; for example:
	  //   path.join('//server', 'share') -> '\\\\server\\share\\'
	  let needsReplace = true;
	  let slashCount = 0;
	  const firstPart = paths[0];
	  if (isPathSeparator(firstPart.charCodeAt(0))) {
	    ++slashCount;
	    const firstLen = firstPart.length;
	    if (firstLen > 1) {
	      if (isPathSeparator(firstPart.charCodeAt(1))) {
	        ++slashCount;
	        if (firstLen > 2) {
	          if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
	          else {
	            // We matched a UNC path in the first part
	            needsReplace = false;
	          }
	        }
	      }
	    }
	  }
	  let joined = paths.join("\\");
	  if (needsReplace) {
	    // Find any more consecutive slashes we need to replace
	    for(; slashCount < joined.length; ++slashCount){
	      if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
	    }
	    // Replace the slashes if needed
	    if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
	  }
	  return normalize(joined);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return a `ParsedPath` object of the `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { parse } from "@std/path/windows/parse";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const parsed = parse("C:\\foo\\bar\\baz.ext");
	 * assertEquals(parsed, {
	 *   root: "C:\\",
	 *   dir: "C:\\foo\\bar",
	 *   base: "baz.ext",
	 *   ext: ".ext",
	 *   name: "baz",
	 * });
	 * ```
	 *
	 * @param path The path to parse.
	 * @returns The `ParsedPath` object.
	 */ function parse(path) {
	  assertPath(path);
	  const ret = {
	    root: "",
	    dir: "",
	    base: "",
	    ext: "",
	    name: ""
	  };
	  const len = path.length;
	  if (len === 0) return ret;
	  let rootEnd = 0;
	  let code = path.charCodeAt(0);
	  // Try to match a root
	  if (len > 1) {
	    if (isPathSeparator(code)) {
	      // Possible UNC root
	      rootEnd = 1;
	      if (isPathSeparator(path.charCodeAt(1))) {
	        // Matched double path separator at beginning
	        let j = 2;
	        let last = j;
	        // Match 1 or more non-path separators
	        for(; j < len; ++j){
	          if (isPathSeparator(path.charCodeAt(j))) break;
	        }
	        if (j < len && j !== last) {
	          // Matched!
	          last = j;
	          // Match 1 or more path separators
	          for(; j < len; ++j){
	            if (!isPathSeparator(path.charCodeAt(j))) break;
	          }
	          if (j < len && j !== last) {
	            // Matched!
	            last = j;
	            // Match 1 or more non-path separators
	            for(; j < len; ++j){
	              if (isPathSeparator(path.charCodeAt(j))) break;
	            }
	            if (j === len) {
	              // We matched a UNC root only
	              rootEnd = j;
	            } else if (j !== last) {
	              // We matched a UNC root with leftovers
	              rootEnd = j + 1;
	            }
	          }
	        }
	      }
	    } else if (isWindowsDeviceRoot(code)) {
	      // Possible device root
	      if (path.charCodeAt(1) === CHAR_COLON) {
	        rootEnd = 2;
	        if (len > 2) {
	          if (isPathSeparator(path.charCodeAt(2))) {
	            if (len === 3) {
	              // `path` contains just a drive root, exit early to avoid
	              // unnecessary work
	              ret.root = ret.dir = path;
	              ret.base = "\\";
	              return ret;
	            }
	            rootEnd = 3;
	          }
	        } else {
	          // `path` contains just a relative drive root, exit early to avoid
	          // unnecessary work
	          ret.root = ret.dir = path;
	          return ret;
	        }
	      }
	    }
	  } else if (isPathSeparator(code)) {
	    // `path` contains just a path separator, exit early to avoid
	    // unnecessary work
	    ret.root = ret.dir = path;
	    ret.base = "\\";
	    return ret;
	  }
	  if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
	  let startDot = -1;
	  let startPart = rootEnd;
	  let end = -1;
	  let matchedSlash = true;
	  let i = path.length - 1;
	  // Track the state of characters (if any) we see before our first dot and
	  // after any path separator we find
	  let preDotState = 0;
	  // Get non-dir info
	  for(; i >= rootEnd; --i){
	    code = path.charCodeAt(i);
	    if (isPathSeparator(code)) {
	      // If we reached a path separator that was not part of a set of path
	      // separators at the end of the string, stop now
	      if (!matchedSlash) {
	        startPart = i + 1;
	        break;
	      }
	      continue;
	    }
	    if (end === -1) {
	      // We saw the first non-path separator, mark this as the end of our
	      // extension
	      matchedSlash = false;
	      end = i + 1;
	    }
	    if (code === CHAR_DOT) {
	      // If this is our first dot, mark it as the start of our extension
	      if (startDot === -1) startDot = i;
	      else if (preDotState !== 1) preDotState = 1;
	    } else if (startDot !== -1) {
	      // We saw a non-dot and non-path separator before our dot, so we should
	      // have a good chance at having a non-empty extension
	      preDotState = -1;
	    }
	  }
	  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
	  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
	  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
	    if (end !== -1) {
	      ret.base = ret.name = path.slice(startPart, end);
	    }
	  } else {
	    ret.name = path.slice(startPart, startDot);
	    ret.base = path.slice(startPart, end);
	    ret.ext = path.slice(startDot, end);
	  }
	  // Fallback to '\' in case there is no basename
	  ret.base = ret.base || "\\";
	  // If the directory is the root, use the entire root as the `dir` including
	  // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
	  // trailing slash (`C:\abc\def` -> `C:\abc`).
	  if (startPart > 0 && startPart !== rootEnd) {
	    ret.dir = path.slice(0, startPart - 1);
	  } else ret.dir = ret.root;
	  return ret;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Resolves path segments into a `path`.
	 *
	 * @example Usage
	 * ```ts
	 * import { resolve } from "@std/path/windows/resolve";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const resolved = resolve("C:\\foo\\bar", "..\\baz");
	 * assertEquals(resolved, "C:\\foo\\baz");
	 * ```
	 *
	 * @param pathSegments The path segments to process to path
	 * @returns The resolved path
	 */ function resolve(...pathSegments) {
	  let resolvedDevice = "";
	  let resolvedTail = "";
	  let resolvedAbsolute = false;
	  for(let i = pathSegments.length - 1; i >= -1; i--){
	    let path;
	    // deno-lint-ignore no-explicit-any
	    const { Deno } = globalThis;
	    if (i >= 0) {
	      path = pathSegments[i];
	    } else if (!resolvedDevice) {
	      if (typeof Deno?.cwd !== "function") {
	        throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");
	      }
	      path = Deno.cwd();
	    } else {
	      if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
	        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
	      }
	      path = Deno.cwd();
	      // Verify that a cwd was found and that it actually points
	      // to our drive. If not, default to the drive's root.
	      if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
	        path = `${resolvedDevice}\\`;
	      }
	    }
	    assertPath(path);
	    const len = path.length;
	    // Skip empty entries
	    if (len === 0) continue;
	    let rootEnd = 0;
	    let device = "";
	    let isAbsolute = false;
	    const code = path.charCodeAt(0);
	    // Try to match a root
	    if (len > 1) {
	      if (isPathSeparator(code)) {
	        // Possible UNC root
	        // If we started with a separator, we know we at least have an
	        // absolute path of some kind (UNC or otherwise)
	        isAbsolute = true;
	        if (isPathSeparator(path.charCodeAt(1))) {
	          // Matched double path separator at beginning
	          let j = 2;
	          let last = j;
	          // Match 1 or more non-path separators
	          for(; j < len; ++j){
	            if (isPathSeparator(path.charCodeAt(j))) break;
	          }
	          if (j < len && j !== last) {
	            const firstPart = path.slice(last, j);
	            // Matched!
	            last = j;
	            // Match 1 or more path separators
	            for(; j < len; ++j){
	              if (!isPathSeparator(path.charCodeAt(j))) break;
	            }
	            if (j < len && j !== last) {
	              // Matched!
	              last = j;
	              // Match 1 or more non-path separators
	              for(; j < len; ++j){
	                if (isPathSeparator(path.charCodeAt(j))) break;
	              }
	              if (j === len) {
	                // We matched a UNC root only
	                device = `\\\\${firstPart}\\${path.slice(last)}`;
	                rootEnd = j;
	              } else if (j !== last) {
	                // We matched a UNC root with leftovers
	                device = `\\\\${firstPart}\\${path.slice(last, j)}`;
	                rootEnd = j;
	              }
	            }
	          }
	        } else {
	          rootEnd = 1;
	        }
	      } else if (isWindowsDeviceRoot(code)) {
	        // Possible device root
	        if (path.charCodeAt(1) === CHAR_COLON) {
	          device = path.slice(0, 2);
	          rootEnd = 2;
	          if (len > 2) {
	            if (isPathSeparator(path.charCodeAt(2))) {
	              // Treat separator following drive name as an absolute path
	              // indicator
	              isAbsolute = true;
	              rootEnd = 3;
	            }
	          }
	        }
	      }
	    } else if (isPathSeparator(code)) {
	      // `path` contains just a path separator
	      rootEnd = 1;
	      isAbsolute = true;
	    }
	    if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
	      continue;
	    }
	    if (resolvedDevice.length === 0 && device.length > 0) {
	      resolvedDevice = device;
	    }
	    if (!resolvedAbsolute) {
	      resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
	      resolvedAbsolute = isAbsolute;
	    }
	    if (resolvedAbsolute && resolvedDevice.length > 0) break;
	  }
	  // At this point the path should be resolved to a full absolute path,
	  // but handle relative paths to be safe (might happen when Deno.cwd()
	  // fails)
	  // Normalize the tail path
	  resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
	  return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function assertArgs(from, to) {
	  assertPath(from);
	  assertPath(to);
	  if (from === to) return "";
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Return the relative path from `from` to `to` based on current working directory.
	 *
	 * An example in windws, for instance:
	 *  from = 'C:\\orandea\\test\\aaa'
	 *  to = 'C:\\orandea\\impl\\bbb'
	 * The output of the function should be: '..\\..\\impl\\bbb'
	 *
	 * @example Usage
	 * ```ts
	 * import { relative } from "@std/path/windows/relative";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
	 * assertEquals(relativePath, "..\\..\\impl\\bbb");
	 * ```
	 *
	 * @param from The path from which to calculate the relative path
	 * @param to The path to which to calculate the relative path
	 * @returns The relative path from `from` to `to`
	 */ function relative(from, to) {
	  assertArgs(from, to);
	  const fromOrig = resolve(from);
	  const toOrig = resolve(to);
	  if (fromOrig === toOrig) return "";
	  from = fromOrig.toLowerCase();
	  to = toOrig.toLowerCase();
	  if (from === to) return "";
	  // Trim any leading backslashes
	  let fromStart = 0;
	  let fromEnd = from.length;
	  for(; fromStart < fromEnd; ++fromStart){
	    if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
	  }
	  // Trim trailing backslashes (applicable to UNC paths only)
	  for(; fromEnd - 1 > fromStart; --fromEnd){
	    if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
	  }
	  const fromLen = fromEnd - fromStart;
	  // Trim any leading backslashes
	  let toStart = 0;
	  let toEnd = to.length;
	  for(; toStart < toEnd; ++toStart){
	    if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
	  }
	  // Trim trailing backslashes (applicable to UNC paths only)
	  for(; toEnd - 1 > toStart; --toEnd){
	    if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
	  }
	  const toLen = toEnd - toStart;
	  // Compare paths to find the longest common path from root
	  const length = fromLen < toLen ? fromLen : toLen;
	  let lastCommonSep = -1;
	  let i = 0;
	  for(; i <= length; ++i){
	    if (i === length) {
	      if (toLen > length) {
	        if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
	          // We get here if `from` is the exact base path for `to`.
	          // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
	          return toOrig.slice(toStart + i + 1);
	        } else if (i === 2) {
	          // We get here if `from` is the device root.
	          // For example: from='C:\\'; to='C:\\foo'
	          return toOrig.slice(toStart + i);
	        }
	      }
	      if (fromLen > length) {
	        if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
	          // We get here if `to` is the exact base path for `from`.
	          // For example: from='C:\\foo\\bar'; to='C:\\foo'
	          lastCommonSep = i;
	        } else if (i === 2) {
	          // We get here if `to` is the device root.
	          // For example: from='C:\\foo\\bar'; to='C:\\'
	          lastCommonSep = 3;
	        }
	      }
	      break;
	    }
	    const fromCode = from.charCodeAt(fromStart + i);
	    const toCode = to.charCodeAt(toStart + i);
	    if (fromCode !== toCode) break;
	    else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
	  }
	  // We found a mismatch before the first common path separator was seen, so
	  // return the original `to`.
	  if (i !== length && lastCommonSep === -1) {
	    return toOrig;
	  }
	  let out = "";
	  if (lastCommonSep === -1) lastCommonSep = 0;
	  // Generate the relative path based on the path difference between `to` and
	  // `from`
	  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
	    if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
	      if (out.length === 0) out += "..";
	      else out += "\\..";
	    }
	  }
	  // Lastly, append the rest of the destination (`to`) path that comes after
	  // the common path parts
	  if (out.length > 0) {
	    return out + toOrig.slice(toStart + lastCommonSep, toEnd);
	  } else {
	    toStart += lastCommonSep;
	    if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
	    return toOrig.slice(toStart, toEnd);
	  }
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	const WHITESPACE_ENCODINGS = {
	  "\u0009": "%09",
	  "\u000A": "%0A",
	  "\u000B": "%0B",
	  "\u000C": "%0C",
	  "\u000D": "%0D",
	  "\u0020": "%20"
	};
	function encodeWhitespace(string) {
	  return string.replaceAll(/[\s]/g, (c)=>{
	    return WHITESPACE_ENCODINGS[c] ?? c;
	  });
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Converts a path string to a file URL.
	 *
	 * @example Usage
	 * ```ts
	 * import { toFileUrl } from "@std/path/windows/to-file-url";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo"));
	 * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo"));
	 * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo"));
	 * ```
	 * @param path The path to convert.
	 * @returns The file URL.
	 */ function toFileUrl(path) {
	  if (!isAbsolute(path)) {
	    throw new TypeError(`Path must be absolute: received "${path}"`);
	  }
	  const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
	  const url = new URL("file:///");
	  url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
	  if (hostname !== undefined && hostname !== "localhost") {
	    url.hostname = hostname;
	    if (!url.hostname) {
	      throw new TypeError(`Invalid hostname: "${url.hostname}"`);
	    }
	  }
	  return url;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Resolves path to a namespace path
	 *
	 * @example Usage
	 * ```ts
	 * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const namespaced = toNamespacedPath("C:\\foo\\bar");
	 * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar");
	 * ```
	 *
	 * @param path The path to resolve to namespaced path
	 * @returns The resolved namespaced path
	 */ function toNamespacedPath(path) {
	  // Note: this will *probably* throw somewhere.
	  if (typeof path !== "string") return path;
	  if (path.length === 0) return "";
	  const resolvedPath = resolve(path);
	  if (resolvedPath.length >= 3) {
	    if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
	      // Possible UNC root
	      if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
	        const code = resolvedPath.charCodeAt(2);
	        if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
	          // Matched non-long UNC root, convert the path to a long UNC path
	          return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
	        }
	      }
	    } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
	      // Possible device root
	      if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
	        // Matched device root, convert the path to a long UNC path
	        return `\\\\?\\${resolvedPath}`;
	      }
	    }
	  }
	  return path;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	function common$1(paths, sep) {
	  const [first = "", ...remaining] = paths;
	  const parts = first.split(sep);
	  let endOfPrefix = parts.length;
	  let append = "";
	  for (const path of remaining){
	    const compare = path.split(sep);
	    if (compare.length <= endOfPrefix) {
	      endOfPrefix = compare.length;
	      append = "";
	    }
	    for(let i = 0; i < endOfPrefix; i++){
	      if (compare[i] !== parts[i]) {
	        endOfPrefix = i;
	        append = i === 0 ? "" : sep;
	        break;
	      }
	    }
	  }
	  return parts.slice(0, endOfPrefix).join(sep) + append;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Determines the common path from a set of paths for Windows systems.
	 *
	 * @example Usage
	 * ```ts
	 * import { common } from "@std/path/windows/common";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const path = common([
	 *   "C:\\foo\\bar",
	 *   "C:\\foo\\baz",
	 * ]);
	 * assertEquals(path, "C:\\foo\\");
	 * ```
	 *
	 * @param paths The paths to compare.
	 * @returns The common path.
	 */ function common(paths) {
	  return common$1(paths, SEPARATOR);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
	 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
	 */ const REG_EXP_ESCAPE_CHARS = [
	  "!",
	  "$",
	  "(",
	  ")",
	  "*",
	  "+",
	  ".",
	  "=",
	  "?",
	  "[",
	  "\\",
	  "^",
	  "{",
	  "|"
	];
	const RANGE_ESCAPE_CHARS = [
	  "-",
	  "\\",
	  "]"
	];
	function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
	caseInsensitive = false } = {}) {
	  if (glob === "") {
	    return /(?!)/;
	  }
	  // Remove trailing separators.
	  let newLength = glob.length;
	  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
	  glob = glob.slice(0, newLength);
	  let regExpString = "";
	  // Terminates correctly. Trust that `j` is incremented every iteration.
	  for(let j = 0; j < glob.length;){
	    let segment = "";
	    const groupStack = [];
	    let inRange = false;
	    let inEscape = false;
	    let endsWithSep = false;
	    let i = j;
	    // Terminates with `i` at the non-inclusive end of the current segment.
	    for(; i < glob.length && !c.seps.includes(glob[i]); i++){
	      if (inEscape) {
	        inEscape = false;
	        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
	        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
	        continue;
	      }
	      if (glob[i] === c.escapePrefix) {
	        inEscape = true;
	        continue;
	      }
	      if (glob[i] === "[") {
	        if (!inRange) {
	          inRange = true;
	          segment += "[";
	          if (glob[i + 1] === "!") {
	            i++;
	            segment += "^";
	          } else if (glob[i + 1] === "^") {
	            i++;
	            segment += "\\^";
	          }
	          continue;
	        } else if (glob[i + 1] === ":") {
	          let k = i + 1;
	          let value = "";
	          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
	            value += glob[k + 1];
	            k++;
	          }
	          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
	            i = k + 2;
	            if (value === "alnum") segment += "\\dA-Za-z";
	            else if (value === "alpha") segment += "A-Za-z";
	            else if (value === "ascii") segment += "\x00-\x7F";
	            else if (value === "blank") segment += "\t ";
	            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
	            else if (value === "digit") segment += "\\d";
	            else if (value === "graph") segment += "\x21-\x7E";
	            else if (value === "lower") segment += "a-z";
	            else if (value === "print") segment += "\x20-\x7E";
	            else if (value === "punct") {
	              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
	            } else if (value === "space") segment += "\\s\v";
	            else if (value === "upper") segment += "A-Z";
	            else if (value === "word") segment += "\\w";
	            else if (value === "xdigit") segment += "\\dA-Fa-f";
	            continue;
	          }
	        }
	      }
	      if (glob[i] === "]" && inRange) {
	        inRange = false;
	        segment += "]";
	        continue;
	      }
	      if (inRange) {
	        segment += glob[i];
	        continue;
	      }
	      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
	        segment += ")";
	        const type = groupStack.pop();
	        if (type === "!") {
	          segment += c.wildcard;
	        } else if (type !== "@") {
	          segment += type;
	        }
	        continue;
	      }
	      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
	        segment += "|";
	        continue;
	      }
	      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("+");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("@");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "?") {
	        if (extended && glob[i + 1] === "(") {
	          i++;
	          groupStack.push("?");
	          segment += "(?:";
	        } else {
	          segment += ".";
	        }
	        continue;
	      }
	      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
	        i++;
	        groupStack.push("!");
	        segment += "(?!";
	        continue;
	      }
	      if (glob[i] === "{") {
	        groupStack.push("BRACE");
	        segment += "(?:";
	        continue;
	      }
	      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
	        groupStack.pop();
	        segment += ")";
	        continue;
	      }
	      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
	        segment += "|";
	        continue;
	      }
	      if (glob[i] === "*") {
	        if (extended && glob[i + 1] === "(") {
	          i++;
	          groupStack.push("*");
	          segment += "(?:";
	        } else {
	          const prevChar = glob[i - 1];
	          let numStars = 1;
	          while(glob[i + 1] === "*"){
	            i++;
	            numStars++;
	          }
	          const nextChar = glob[i + 1];
	          if (globstarOption && numStars === 2 && [
	            ...c.seps,
	            undefined
	          ].includes(prevChar) && [
	            ...c.seps,
	            undefined
	          ].includes(nextChar)) {
	            segment += c.globstar;
	            endsWithSep = true;
	          } else {
	            segment += c.wildcard;
	          }
	        }
	        continue;
	      }
	      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
	    }
	    // Check for unclosed groups or a dangling backslash.
	    if (groupStack.length > 0 || inRange || inEscape) {
	      // Parse failure. Take all characters from this segment literally.
	      segment = "";
	      for (const c of glob.slice(j, i)){
	        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
	        endsWithSep = false;
	      }
	    }
	    regExpString += segment;
	    if (!endsWithSep) {
	      regExpString += i < glob.length ? c.sep : c.sepMaybe;
	      endsWithSep = true;
	    }
	    // Terminates with `i` at the start of the next segment.
	    while(c.seps.includes(glob[i]))i++;
	    j = i;
	  }
	  regExpString = `^${regExpString}$`;
	  return new RegExp(regExpString, caseInsensitive ? "i" : "");
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	const constants = {
	  sep: "(?:\\\\|/)+",
	  sepMaybe: "(?:\\\\|/)*",
	  seps: [
	    "\\",
	    "/"
	  ],
	  globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
	  wildcard: "[^\\\\/]*",
	  escapePrefix: "`"
	};
	/** Convert a glob string to a regular expression.
	 *
	 * Tries to match bash glob expansion as closely as possible.
	 *
	 * Basic glob syntax:
	 * - `*` - Matches everything without leaving the path segment.
	 * - `?` - Matches any single character.
	 * - `{foo,bar}` - Matches `foo` or `bar`.
	 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
	 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
	 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
	 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
	 *     - `[[:alnum:]]` - Matches any digit or letter.
	 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
	 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
	 *       for a complete list of supported character classes.
	 * - `\` - Escapes the next character for an `os` other than `"windows"`.
	 * - \` - Escapes the next character for `os` set to `"windows"`.
	 * - `/` - Path separator.
	 * - `\` - Additional path separator only for `os` set to `"windows"`.
	 *
	 * Extended syntax:
	 * - Requires `{ extended: true }`.
	 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
	 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
	 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
	 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
	 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
	 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
	 *
	 * Globstar syntax:
	 * - Requires `{ globstar: true }`.
	 * - `**` - Matches any number of any path segments.
	 *     - Must comprise its entire path segment in the provided glob.
	 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
	 *
	 * Note the following properties:
	 * - The generated `RegExp` is anchored at both start and end.
	 * - Repeating and trailing separators are tolerated. Trailing separators in the
	 *   provided glob have no meaning and are discarded.
	 * - Absolute globs will only match absolute paths, etc.
	 * - Empty globs will match nothing.
	 * - Any special glob syntax must be contained to one path segment. For example,
	 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
	 *   first segment ends with an unclosed group.
	 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
	 *   parse error has occurred. Every character for that segment is taken
	 *   literally in this event.
	 *
	 * Limitations:
	 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
	 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
	 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
	 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
	 *   the group occurs not nested at the end of the segment.
	 *
	 * @example Usage
	 * ```ts
	 * import { globToRegExp } from "@std/path/windows/glob-to-regexp";
	 * import { assertEquals } from "@std/assert";
	 *
	 * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/);
	 * ```
	 *
	 * @param glob Glob string to convert.
	 * @param options Conversion options.
	 * @returns The regular expression equivalent to the glob.
	 */ function globToRegExp(glob, options = {}) {
	  return _globToRegExp(constants, glob, options);
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Test whether the given string is a glob.
	 *
	 * @example Usage
	 * ```ts
	 * import { isGlob } from "@std/path/is-glob";
	 * import { assert } from "@std/assert";
	 *
	 * assert(!isGlob("foo/bar/../baz"));
	 * assert(isGlob("foo/*ar/../baz"));
	 * ```
	 *
	 * @param str String to test.
	 * @returns `true` if the given string is a glob, otherwise `false`
	 */ function isGlob(str) {
	  const chars = {
	    "{": "}",
	    "(": ")",
	    "[": "]"
	  };
	  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
	  if (str === "") {
	    return false;
	  }
	  let match;
	  while(match = regex.exec(str)){
	    if (match[2]) return true;
	    let idx = match.index + match[0].length;
	    // if an open bracket/brace/paren is escaped,
	    // set the index to the next closing character
	    const open = match[1];
	    const close = open ? chars[open] : null;
	    if (open && close) {
	      const n = str.indexOf(close, idx);
	      if (n !== -1) {
	        idx = n + 1;
	      }
	    }
	    str = str.slice(idx);
	  }
	  return false;
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
	 *
	 * @example Usage
	 * ```ts
	 * import { normalizeGlob } from "@std/path/windows/normalize-glob";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
	 * assertEquals(normalized, "**\\bar");
	 * ```
	 *
	 * @param glob The glob pattern to normalize.
	 * @param options The options for glob pattern.
	 * @returns The normalized glob pattern.
	 */ function normalizeGlob(glob, options = {}) {
	  const { globstar = false } = options;
	  if (glob.match(/\0/g)) {
	    throw new Error(`Glob contains invalid characters: "${glob}"`);
	  }
	  if (!globstar) {
	    return normalize(glob);
	  }
	  const s = SEPARATOR_PATTERN.source;
	  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
	  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
	}

	// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
	// This module is browser compatible.
	/**
	 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
	 *
	 * @example Usage
	 *
	 * ```ts
	 * import { joinGlobs } from "@std/path/windows/join-globs";
	 * import { assertEquals } from "@std/assert";
	 *
	 * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true });
	 * assertEquals(joined, "foo\\**\\bar");
	 * ```
	 *
	 * @param globs The globs to join.
	 * @param options The options for glob pattern.
	 * @returns The joined glob pattern.
	 */ function joinGlobs(globs, options = {}) {
	  const { globstar = false } = options;
	  if (!globstar || globs.length === 0) {
	    return join(...globs);
	  }
	  let joined;
	  for (const glob of globs){
	    const path = glob;
	    if (path.length > 0) {
	      if (!joined) joined = path;
	      else joined += `${SEPARATOR}${path}`;
	    }
	  }
	  if (!joined) return ".";
	  return normalizeGlob(joined, {
	    globstar
	  });
	}

	windows.DELIMITER = DELIMITER;
	windows.SEPARATOR = SEPARATOR;
	windows.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
	windows.basename = basename;
	windows.common = common;
	windows.dirname = dirname;
	windows.extname = extname;
	windows.format = format;
	windows.fromFileUrl = fromFileUrl;
	windows.globToRegExp = globToRegExp;
	windows.isAbsolute = isAbsolute;
	windows.isGlob = isGlob;
	windows.join = join;
	windows.joinGlobs = joinGlobs;
	windows.normalize = normalize;
	windows.normalizeGlob = normalizeGlob;
	windows.parse = parse;
	windows.relative = relative;
	windows.resolve = resolve;
	windows.toFileUrl = toFileUrl;
	windows.toNamespacedPath = toNamespacedPath;
	return windows;
}

var concatMap;
var hasRequiredConcatMap;

function requireConcatMap () {
	if (hasRequiredConcatMap) return concatMap;
	hasRequiredConcatMap = 1;
	concatMap = function (xs, fn) {
	    var res = [];
	    for (var i = 0; i < xs.length; i++) {
	        var x = fn(xs[i], i);
	        if (isArray(x)) res.push.apply(res, x);
	        else res.push(x);
	    }
	    return res;
	};

	var isArray = Array.isArray || function (xs) {
	    return Object.prototype.toString.call(xs) === '[object Array]';
	};
	return concatMap;
}

var balancedMatch;
var hasRequiredBalancedMatch;

function requireBalancedMatch () {
	if (hasRequiredBalancedMatch) return balancedMatch;
	hasRequiredBalancedMatch = 1;
	balancedMatch = balanced;
	function balanced(a, b, str) {
	  if (a instanceof RegExp) a = maybeMatch(a, str);
	  if (b instanceof RegExp) b = maybeMatch(b, str);

	  var r = range(a, b, str);

	  return r && {
	    start: r[0],
	    end: r[1],
	    pre: str.slice(0, r[0]),
	    body: str.slice(r[0] + a.length, r[1]),
	    post: str.slice(r[1] + b.length)
	  };
	}

	function maybeMatch(reg, str) {
	  var m = str.match(reg);
	  return m ? m[0] : null;
	}

	balanced.range = range;
	function range(a, b, str) {
	  var begs, beg, left, right, result;
	  var ai = str.indexOf(a);
	  var bi = str.indexOf(b, ai + 1);
	  var i = ai;

	  if (ai >= 0 && bi > 0) {
	    if(a===b) {
	      return [ai, bi];
	    }
	    begs = [];
	    left = str.length;

	    while (i >= 0 && !result) {
	      if (i == ai) {
	        begs.push(i);
	        ai = str.indexOf(a, i + 1);
	      } else if (begs.length == 1) {
	        result = [ begs.pop(), bi ];
	      } else {
	        beg = begs.pop();
	        if (beg < left) {
	          left = beg;
	          right = bi;
	        }

	        bi = str.indexOf(b, i + 1);
	      }

	      i = ai < bi && ai >= 0 ? ai : bi;
	    }

	    if (begs.length) {
	      result = [ left, right ];
	    }
	  }

	  return result;
	}
	return balancedMatch;
}

var braceExpansion;
var hasRequiredBraceExpansion;

function requireBraceExpansion () {
	if (hasRequiredBraceExpansion) return braceExpansion;
	hasRequiredBraceExpansion = 1;
	var concatMap = requireConcatMap();
	var balanced = requireBalancedMatch();

	braceExpansion = expandTop;

	var escSlash = '\0SLASH'+Math.random()+'\0';
	var escOpen = '\0OPEN'+Math.random()+'\0';
	var escClose = '\0CLOSE'+Math.random()+'\0';
	var escComma = '\0COMMA'+Math.random()+'\0';
	var escPeriod = '\0PERIOD'+Math.random()+'\0';

	function numeric(str) {
	  return parseInt(str, 10) == str
	    ? parseInt(str, 10)
	    : str.charCodeAt(0);
	}

	function escapeBraces(str) {
	  return str.split('\\\\').join(escSlash)
	            .split('\\{').join(escOpen)
	            .split('\\}').join(escClose)
	            .split('\\,').join(escComma)
	            .split('\\.').join(escPeriod);
	}

	function unescapeBraces(str) {
	  return str.split(escSlash).join('\\')
	            .split(escOpen).join('{')
	            .split(escClose).join('}')
	            .split(escComma).join(',')
	            .split(escPeriod).join('.');
	}


	// Basically just str.split(","), but handling cases
	// where we have nested braced sections, which should be
	// treated as individual members, like {a,{b,c},d}
	function parseCommaParts(str) {
	  if (!str)
	    return [''];

	  var parts = [];
	  var m = balanced('{', '}', str);

	  if (!m)
	    return str.split(',');

	  var pre = m.pre;
	  var body = m.body;
	  var post = m.post;
	  var p = pre.split(',');

	  p[p.length-1] += '{' + body + '}';
	  var postParts = parseCommaParts(post);
	  if (post.length) {
	    p[p.length-1] += postParts.shift();
	    p.push.apply(p, postParts);
	  }

	  parts.push.apply(parts, p);

	  return parts;
	}

	function expandTop(str) {
	  if (!str)
	    return [];

	  // I don't know why Bash 4.3 does this, but it does.
	  // Anything starting with {} will have the first two bytes preserved
	  // but *only* at the top level, so {},a}b will not expand to anything,
	  // but a{},b}c will be expanded to [a}c,abc].
	  // One could argue that this is a bug in Bash, but since the goal of
	  // this module is to match Bash's rules, we escape a leading {}
	  if (str.substr(0, 2) === '{}') {
	    str = '\\{\\}' + str.substr(2);
	  }

	  return expand(escapeBraces(str), true).map(unescapeBraces);
	}

	function embrace(str) {
	  return '{' + str + '}';
	}
	function isPadded(el) {
	  return /^-?0\d/.test(el);
	}

	function lte(i, y) {
	  return i <= y;
	}
	function gte(i, y) {
	  return i >= y;
	}

	function expand(str, isTop) {
	  var expansions = [];

	  var m = balanced('{', '}', str);
	  if (!m || /\$$/.test(m.pre)) return [str];

	  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
	  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
	  var isSequence = isNumericSequence || isAlphaSequence;
	  var isOptions = m.body.indexOf(',') >= 0;
	  if (!isSequence && !isOptions) {
	    // {a},b}
	    if (m.post.match(/,.*\}/)) {
	      str = m.pre + '{' + m.body + escClose + m.post;
	      return expand(str);
	    }
	    return [str];
	  }

	  var n;
	  if (isSequence) {
	    n = m.body.split(/\.\./);
	  } else {
	    n = parseCommaParts(m.body);
	    if (n.length === 1) {
	      // x{{a,b}}y ==> x{a}y x{b}y
	      n = expand(n[0], false).map(embrace);
	      if (n.length === 1) {
	        var post = m.post.length
	          ? expand(m.post, false)
	          : [''];
	        return post.map(function(p) {
	          return m.pre + n[0] + p;
	        });
	      }
	    }
	  }

	  // at this point, n is the parts, and we know it's not a comma set
	  // with a single entry.

	  // no need to expand pre, since it is guaranteed to be free of brace-sets
	  var pre = m.pre;
	  var post = m.post.length
	    ? expand(m.post, false)
	    : [''];

	  var N;

	  if (isSequence) {
	    var x = numeric(n[0]);
	    var y = numeric(n[1]);
	    var width = Math.max(n[0].length, n[1].length);
	    var incr = n.length == 3
	      ? Math.abs(numeric(n[2]))
	      : 1;
	    var test = lte;
	    var reverse = y < x;
	    if (reverse) {
	      incr *= -1;
	      test = gte;
	    }
	    var pad = n.some(isPadded);

	    N = [];

	    for (var i = x; test(i, y); i += incr) {
	      var c;
	      if (isAlphaSequence) {
	        c = String.fromCharCode(i);
	        if (c === '\\')
	          c = '';
	      } else {
	        c = String(i);
	        if (pad) {
	          var need = width - c.length;
	          if (need > 0) {
	            var z = new Array(need + 1).join('0');
	            if (i < 0)
	              c = '-' + z + c.slice(1);
	            else
	              c = z + c;
	          }
	        }
	      }
	      N.push(c);
	    }
	  } else {
	    N = concatMap(n, function(el) { return expand(el, false) });
	  }

	  for (var j = 0; j < N.length; j++) {
	    for (var k = 0; k < post.length; k++) {
	      var expansion = pre + N[j] + post[k];
	      if (!isTop || isSequence || expansion)
	        expansions.push(expansion);
	    }
	  }

	  return expansions;
	}
	return braceExpansion;
}

var minimatch_1;
var hasRequiredMinimatch;

function requireMinimatch () {
	if (hasRequiredMinimatch) return minimatch_1;
	hasRequiredMinimatch = 1;
	minimatch_1 = minimatch;
	minimatch.Minimatch = Minimatch;

	var path = (function () { try { return require$$0$1 } catch (e) {}}()) || {
	  sep: '/'
	};
	minimatch.sep = path.sep;

	var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
	var expand = requireBraceExpansion();

	var plTypes = {
	  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
	  '?': { open: '(?:', close: ')?' },
	  '+': { open: '(?:', close: ')+' },
	  '*': { open: '(?:', close: ')*' },
	  '@': { open: '(?:', close: ')' }
	};

	// any single thing other than /
	// don't need to escape / when using new RegExp()
	var qmark = '[^/]';

	// * => any number of characters
	var star = qmark + '*?';

	// ** when dots are allowed.  Anything goes, except .. and .
	// not (^ or / followed by one or two dots followed by $ or /),
	// followed by anything, any number of times.
	var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';

	// not a ^ or / followed by a dot,
	// followed by anything, any number of times.
	var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';

	// characters that need to be escaped in RegExp.
	var reSpecials = charSet('().*{}+?[]^$\\!');

	// "abc" -> { a:true, b:true, c:true }
	function charSet (s) {
	  return s.split('').reduce(function (set, c) {
	    set[c] = true;
	    return set
	  }, {})
	}

	// normalizes slashes.
	var slashSplit = /\/+/;

	minimatch.filter = filter;
	function filter (pattern, options) {
	  options = options || {};
	  return function (p, i, list) {
	    return minimatch(p, pattern, options)
	  }
	}

	function ext (a, b) {
	  b = b || {};
	  var t = {};
	  Object.keys(a).forEach(function (k) {
	    t[k] = a[k];
	  });
	  Object.keys(b).forEach(function (k) {
	    t[k] = b[k];
	  });
	  return t
	}

	minimatch.defaults = function (def) {
	  if (!def || typeof def !== 'object' || !Object.keys(def).length) {
	    return minimatch
	  }

	  var orig = minimatch;

	  var m = function minimatch (p, pattern, options) {
	    return orig(p, pattern, ext(def, options))
	  };

	  m.Minimatch = function Minimatch (pattern, options) {
	    return new orig.Minimatch(pattern, ext(def, options))
	  };
	  m.Minimatch.defaults = function defaults (options) {
	    return orig.defaults(ext(def, options)).Minimatch
	  };

	  m.filter = function filter (pattern, options) {
	    return orig.filter(pattern, ext(def, options))
	  };

	  m.defaults = function defaults (options) {
	    return orig.defaults(ext(def, options))
	  };

	  m.makeRe = function makeRe (pattern, options) {
	    return orig.makeRe(pattern, ext(def, options))
	  };

	  m.braceExpand = function braceExpand (pattern, options) {
	    return orig.braceExpand(pattern, ext(def, options))
	  };

	  m.match = function (list, pattern, options) {
	    return orig.match(list, pattern, ext(def, options))
	  };

	  return m
	};

	Minimatch.defaults = function (def) {
	  return minimatch.defaults(def).Minimatch
	};

	function minimatch (p, pattern, options) {
	  assertValidPattern(pattern);

	  if (!options) options = {};

	  // shortcut: comments match nothing.
	  if (!options.nocomment && pattern.charAt(0) === '#') {
	    return false
	  }

	  return new Minimatch(pattern, options).match(p)
	}

	function Minimatch (pattern, options) {
	  if (!(this instanceof Minimatch)) {
	    return new Minimatch(pattern, options)
	  }

	  assertValidPattern(pattern);

	  if (!options) options = {};

	  pattern = pattern.trim();

	  // windows support: need to use /, not \
	  if (!options.allowWindowsEscape && path.sep !== '/') {
	    pattern = pattern.split(path.sep).join('/');
	  }

	  this.options = options;
	  this.set = [];
	  this.pattern = pattern;
	  this.regexp = null;
	  this.negate = false;
	  this.comment = false;
	  this.empty = false;
	  this.partial = !!options.partial;

	  // make the set of regexps etc.
	  this.make();
	}

	Minimatch.prototype.debug = function () {};

	Minimatch.prototype.make = make;
	function make () {
	  var pattern = this.pattern;
	  var options = this.options;

	  // empty patterns and comments match nothing.
	  if (!options.nocomment && pattern.charAt(0) === '#') {
	    this.comment = true;
	    return
	  }
	  if (!pattern) {
	    this.empty = true;
	    return
	  }

	  // step 1: figure out negation, etc.
	  this.parseNegate();

	  // step 2: expand braces
	  var set = this.globSet = this.braceExpand();

	  if (options.debug) this.debug = function debug() { console.error.apply(console, arguments); };

	  this.debug(this.pattern, set);

	  // step 3: now we have a set, so turn each one into a series of path-portion
	  // matching patterns.
	  // These will be regexps, except in the case of "**", which is
	  // set to the GLOBSTAR object for globstar behavior,
	  // and will not contain any / characters
	  set = this.globParts = set.map(function (s) {
	    return s.split(slashSplit)
	  });

	  this.debug(this.pattern, set);

	  // glob --> regexps
	  set = set.map(function (s, si, set) {
	    return s.map(this.parse, this)
	  }, this);

	  this.debug(this.pattern, set);

	  // filter out everything that didn't compile properly.
	  set = set.filter(function (s) {
	    return s.indexOf(false) === -1
	  });

	  this.debug(this.pattern, set);

	  this.set = set;
	}

	Minimatch.prototype.parseNegate = parseNegate;
	function parseNegate () {
	  var pattern = this.pattern;
	  var negate = false;
	  var options = this.options;
	  var negateOffset = 0;

	  if (options.nonegate) return

	  for (var i = 0, l = pattern.length
	    ; i < l && pattern.charAt(i) === '!'
	    ; i++) {
	    negate = !negate;
	    negateOffset++;
	  }

	  if (negateOffset) this.pattern = pattern.substr(negateOffset);
	  this.negate = negate;
	}

	// Brace expansion:
	// a{b,c}d -> abd acd
	// a{b,}c -> abc ac
	// a{0..3}d -> a0d a1d a2d a3d
	// a{b,c{d,e}f}g -> abg acdfg acefg
	// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
	//
	// Invalid sets are not expanded.
	// a{2..}b -> a{2..}b
	// a{b}c -> a{b}c
	minimatch.braceExpand = function (pattern, options) {
	  return braceExpand(pattern, options)
	};

	Minimatch.prototype.braceExpand = braceExpand;

	function braceExpand (pattern, options) {
	  if (!options) {
	    if (this instanceof Minimatch) {
	      options = this.options;
	    } else {
	      options = {};
	    }
	  }

	  pattern = typeof pattern === 'undefined'
	    ? this.pattern : pattern;

	  assertValidPattern(pattern);

	  // Thanks to Yeting Li <https://github.com/yetingli> for
	  // improving this regexp to avoid a ReDOS vulnerability.
	  if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
	    // shortcut. no need to expand.
	    return [pattern]
	  }

	  return expand(pattern)
	}

	var MAX_PATTERN_LENGTH = 1024 * 64;
	var assertValidPattern = function (pattern) {
	  if (typeof pattern !== 'string') {
	    throw new TypeError('invalid pattern')
	  }

	  if (pattern.length > MAX_PATTERN_LENGTH) {
	    throw new TypeError('pattern is too long')
	  }
	};

	// parse a component of the expanded set.
	// At this point, no pattern may contain "/" in it
	// so we're going to return a 2d array, where each entry is the full
	// pattern, split on '/', and then turned into a regular expression.
	// A regexp is made at the end which joins each array with an
	// escaped /, and another full one which joins each regexp with |.
	//
	// Following the lead of Bash 4.1, note that "**" only has special meaning
	// when it is the *only* thing in a path portion.  Otherwise, any series
	// of * is equivalent to a single *.  Globstar behavior is enabled by
	// default, and can be disabled by setting options.noglobstar.
	Minimatch.prototype.parse = parse;
	var SUBPARSE = {};
	function parse (pattern, isSub) {
	  assertValidPattern(pattern);

	  var options = this.options;

	  // shortcuts
	  if (pattern === '**') {
	    if (!options.noglobstar)
	      return GLOBSTAR
	    else
	      pattern = '*';
	  }
	  if (pattern === '') return ''

	  var re = '';
	  var hasMagic = !!options.nocase;
	  var escaping = false;
	  // ? => one single character
	  var patternListStack = [];
	  var negativeLists = [];
	  var stateChar;
	  var inClass = false;
	  var reClassStart = -1;
	  var classStart = -1;
	  // . and .. never match anything that doesn't start with .,
	  // even when options.dot is set.
	  var patternStart = pattern.charAt(0) === '.' ? '' // anything
	  // not (start or / followed by . or .. followed by / or end)
	  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
	  : '(?!\\.)';
	  var self = this;

	  function clearStateChar () {
	    if (stateChar) {
	      // we had some state-tracking character
	      // that wasn't consumed by this pass.
	      switch (stateChar) {
	        case '*':
	          re += star;
	          hasMagic = true;
	        break
	        case '?':
	          re += qmark;
	          hasMagic = true;
	        break
	        default:
	          re += '\\' + stateChar;
	        break
	      }
	      self.debug('clearStateChar %j %j', stateChar, re);
	      stateChar = false;
	    }
	  }

	  for (var i = 0, len = pattern.length, c
	    ; (i < len) && (c = pattern.charAt(i))
	    ; i++) {
	    this.debug('%s\t%s %s %j', pattern, i, re, c);

	    // skip over any that are escaped.
	    if (escaping && reSpecials[c]) {
	      re += '\\' + c;
	      escaping = false;
	      continue
	    }

	    switch (c) {
	      /* istanbul ignore next */
	      case '/': {
	        // completely not allowed, even escaped.
	        // Should already be path-split by now.
	        return false
	      }

	      case '\\':
	        clearStateChar();
	        escaping = true;
	      continue

	      // the various stateChar values
	      // for the "extglob" stuff.
	      case '?':
	      case '*':
	      case '+':
	      case '@':
	      case '!':
	        this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);

	        // all of those are literals inside a class, except that
	        // the glob [!a] means [^a] in regexp
	        if (inClass) {
	          this.debug('  in class');
	          if (c === '!' && i === classStart + 1) c = '^';
	          re += c;
	          continue
	        }

	        // if we already have a stateChar, then it means
	        // that there was something like ** or +? in there.
	        // Handle the stateChar, then proceed with this one.
	        self.debug('call clearStateChar %j', stateChar);
	        clearStateChar();
	        stateChar = c;
	        // if extglob is disabled, then +(asdf|foo) isn't a thing.
	        // just clear the statechar *now*, rather than even diving into
	        // the patternList stuff.
	        if (options.noext) clearStateChar();
	      continue

	      case '(':
	        if (inClass) {
	          re += '(';
	          continue
	        }

	        if (!stateChar) {
	          re += '\\(';
	          continue
	        }

	        patternListStack.push({
	          type: stateChar,
	          start: i - 1,
	          reStart: re.length,
	          open: plTypes[stateChar].open,
	          close: plTypes[stateChar].close
	        });
	        // negation is (?:(?!js)[^/]*)
	        re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
	        this.debug('plType %j %j', stateChar, re);
	        stateChar = false;
	      continue

	      case ')':
	        if (inClass || !patternListStack.length) {
	          re += '\\)';
	          continue
	        }

	        clearStateChar();
	        hasMagic = true;
	        var pl = patternListStack.pop();
	        // negation is (?:(?!js)[^/]*)
	        // The others are (?:<pattern>)<type>
	        re += pl.close;
	        if (pl.type === '!') {
	          negativeLists.push(pl);
	        }
	        pl.reEnd = re.length;
	      continue

	      case '|':
	        if (inClass || !patternListStack.length || escaping) {
	          re += '\\|';
	          escaping = false;
	          continue
	        }

	        clearStateChar();
	        re += '|';
	      continue

	      // these are mostly the same in regexp and glob
	      case '[':
	        // swallow any state-tracking char before the [
	        clearStateChar();

	        if (inClass) {
	          re += '\\' + c;
	          continue
	        }

	        inClass = true;
	        classStart = i;
	        reClassStart = re.length;
	        re += c;
	      continue

	      case ']':
	        //  a right bracket shall lose its special
	        //  meaning and represent itself in
	        //  a bracket expression if it occurs
	        //  first in the list.  -- POSIX.2 2.8.3.2
	        if (i === classStart + 1 || !inClass) {
	          re += '\\' + c;
	          escaping = false;
	          continue
	        }

	        // handle the case where we left a class open.
	        // "[z-a]" is valid, equivalent to "\[z-a\]"
	        // split where the last [ was, make sure we don't have
	        // an invalid re. if so, re-walk the contents of the
	        // would-be class to re-translate any characters that
	        // were passed through as-is
	        // TODO: It would probably be faster to determine this
	        // without a try/catch and a new RegExp, but it's tricky
	        // to do safely.  For now, this is safe and works.
	        var cs = pattern.substring(classStart + 1, i);
	        try {
	          RegExp('[' + cs + ']');
	        } catch (er) {
	          // not a valid class!
	          var sp = this.parse(cs, SUBPARSE);
	          re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
	          hasMagic = hasMagic || sp[1];
	          inClass = false;
	          continue
	        }

	        // finish up the class.
	        hasMagic = true;
	        inClass = false;
	        re += c;
	      continue

	      default:
	        // swallow any state char that wasn't consumed
	        clearStateChar();

	        if (escaping) {
	          // no need
	          escaping = false;
	        } else if (reSpecials[c]
	          && !(c === '^' && inClass)) {
	          re += '\\';
	        }

	        re += c;

	    } // switch
	  } // for

	  // handle the case where we left a class open.
	  // "[abc" is valid, equivalent to "\[abc"
	  if (inClass) {
	    // split where the last [ was, and escape it
	    // this is a huge pita.  We now have to re-walk
	    // the contents of the would-be class to re-translate
	    // any characters that were passed through as-is
	    cs = pattern.substr(classStart + 1);
	    sp = this.parse(cs, SUBPARSE);
	    re = re.substr(0, reClassStart) + '\\[' + sp[0];
	    hasMagic = hasMagic || sp[1];
	  }

	  // handle the case where we had a +( thing at the *end*
	  // of the pattern.
	  // each pattern list stack adds 3 chars, and we need to go through
	  // and escape any | chars that were passed through as-is for the regexp.
	  // Go through and escape them, taking care not to double-escape any
	  // | chars that were already escaped.
	  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
	    var tail = re.slice(pl.reStart + pl.open.length);
	    this.debug('setting tail', re, pl);
	    // maybe some even number of \, then maybe 1 \, followed by a |
	    tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
	      if (!$2) {
	        // the | isn't already escaped, so escape it.
	        $2 = '\\';
	      }

	      // need to escape all those slashes *again*, without escaping the
	      // one that we need for escaping the | character.  As it works out,
	      // escaping an even number of slashes can be done by simply repeating
	      // it exactly after itself.  That's why this trick works.
	      //
	      // I am sorry that you have to see this.
	      return $1 + $1 + $2 + '|'
	    });

	    this.debug('tail=%j\n   %s', tail, tail, pl, re);
	    var t = pl.type === '*' ? star
	      : pl.type === '?' ? qmark
	      : '\\' + pl.type;

	    hasMagic = true;
	    re = re.slice(0, pl.reStart) + t + '\\(' + tail;
	  }

	  // handle trailing things that only matter at the very end.
	  clearStateChar();
	  if (escaping) {
	    // trailing \\
	    re += '\\\\';
	  }

	  // only need to apply the nodot start if the re starts with
	  // something that could conceivably capture a dot
	  var addPatternStart = false;
	  switch (re.charAt(0)) {
	    case '[': case '.': case '(': addPatternStart = true;
	  }

	  // Hack to work around lack of negative lookbehind in JS
	  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
	  // like 'a.xyz.yz' doesn't match.  So, the first negative
	  // lookahead, has to look ALL the way ahead, to the end of
	  // the pattern.
	  for (var n = negativeLists.length - 1; n > -1; n--) {
	    var nl = negativeLists[n];

	    var nlBefore = re.slice(0, nl.reStart);
	    var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
	    var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
	    var nlAfter = re.slice(nl.reEnd);

	    nlLast += nlAfter;

	    // Handle nested stuff like *(*.js|!(*.json)), where open parens
	    // mean that we should *not* include the ) in the bit that is considered
	    // "after" the negated section.
	    var openParensBefore = nlBefore.split('(').length - 1;
	    var cleanAfter = nlAfter;
	    for (i = 0; i < openParensBefore; i++) {
	      cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
	    }
	    nlAfter = cleanAfter;

	    var dollar = '';
	    if (nlAfter === '' && isSub !== SUBPARSE) {
	      dollar = '$';
	    }
	    var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
	    re = newRe;
	  }

	  // if the re is not "" at this point, then we need to make sure
	  // it doesn't match against an empty path part.
	  // Otherwise a/* will match a/, which it should not.
	  if (re !== '' && hasMagic) {
	    re = '(?=.)' + re;
	  }

	  if (addPatternStart) {
	    re = patternStart + re;
	  }

	  // parsing just a piece of a larger pattern.
	  if (isSub === SUBPARSE) {
	    return [re, hasMagic]
	  }

	  // skip the regexp for non-magical patterns
	  // unescape anything in it, though, so that it'll be
	  // an exact match against a file etc.
	  if (!hasMagic) {
	    return globUnescape(pattern)
	  }

	  var flags = options.nocase ? 'i' : '';
	  try {
	    var regExp = new RegExp('^' + re + '$', flags);
	  } catch (er) /* istanbul ignore next - should be impossible */ {
	    // If it was an invalid regular expression, then it can't match
	    // anything.  This trick looks for a character after the end of
	    // the string, which is of course impossible, except in multi-line
	    // mode, but it's not a /m regex.
	    return new RegExp('$.')
	  }

	  regExp._glob = pattern;
	  regExp._src = re;

	  return regExp
	}

	minimatch.makeRe = function (pattern, options) {
	  return new Minimatch(pattern, options || {}).makeRe()
	};

	Minimatch.prototype.makeRe = makeRe;
	function makeRe () {
	  if (this.regexp || this.regexp === false) return this.regexp

	  // at this point, this.set is a 2d array of partial
	  // pattern strings, or "**".
	  //
	  // It's better to use .match().  This function shouldn't
	  // be used, really, but it's pretty convenient sometimes,
	  // when you just want to work with a regex.
	  var set = this.set;

	  if (!set.length) {
	    this.regexp = false;
	    return this.regexp
	  }
	  var options = this.options;

	  var twoStar = options.noglobstar ? star
	    : options.dot ? twoStarDot
	    : twoStarNoDot;
	  var flags = options.nocase ? 'i' : '';

	  var re = set.map(function (pattern) {
	    return pattern.map(function (p) {
	      return (p === GLOBSTAR) ? twoStar
	      : (typeof p === 'string') ? regExpEscape(p)
	      : p._src
	    }).join('\\\/')
	  }).join('|');

	  // must match entire pattern
	  // ending in a * or ** will make it less strict.
	  re = '^(?:' + re + ')$';

	  // can match anything, as long as it's not this.
	  if (this.negate) re = '^(?!' + re + ').*$';

	  try {
	    this.regexp = new RegExp(re, flags);
	  } catch (ex) /* istanbul ignore next - should be impossible */ {
	    this.regexp = false;
	  }
	  return this.regexp
	}

	minimatch.match = function (list, pattern, options) {
	  options = options || {};
	  var mm = new Minimatch(pattern, options);
	  list = list.filter(function (f) {
	    return mm.match(f)
	  });
	  if (mm.options.nonull && !list.length) {
	    list.push(pattern);
	  }
	  return list
	};

	Minimatch.prototype.match = function match (f, partial) {
	  if (typeof partial === 'undefined') partial = this.partial;
	  this.debug('match', f, this.pattern);
	  // short-circuit in the case of busted things.
	  // comments, etc.
	  if (this.comment) return false
	  if (this.empty) return f === ''

	  if (f === '/' && partial) return true

	  var options = this.options;

	  // windows: need to use /, not \
	  if (path.sep !== '/') {
	    f = f.split(path.sep).join('/');
	  }

	  // treat the test path as a set of pathparts.
	  f = f.split(slashSplit);
	  this.debug(this.pattern, 'split', f);

	  // just ONE of the pattern sets in this.set needs to match
	  // in order for it to be valid.  If negating, then just one
	  // match means that we have failed.
	  // Either way, return on the first hit.

	  var set = this.set;
	  this.debug(this.pattern, 'set', set);

	  // Find the basename of the path by looking for the last non-empty segment
	  var filename;
	  var i;
	  for (i = f.length - 1; i >= 0; i--) {
	    filename = f[i];
	    if (filename) break
	  }

	  for (i = 0; i < set.length; i++) {
	    var pattern = set[i];
	    var file = f;
	    if (options.matchBase && pattern.length === 1) {
	      file = [filename];
	    }
	    var hit = this.matchOne(file, pattern, partial);
	    if (hit) {
	      if (options.flipNegate) return true
	      return !this.negate
	    }
	  }

	  // didn't get any hits.  this is success if it's a negative
	  // pattern, failure otherwise.
	  if (options.flipNegate) return false
	  return this.negate
	};

	// set partial to true to test if, for example,
	// "/a/b" matches the start of "/*/b/*/d"
	// Partial means, if you run out of file before you run
	// out of pattern, then that's fine, as long as all
	// the parts match.
	Minimatch.prototype.matchOne = function (file, pattern, partial) {
	  var options = this.options;

	  this.debug('matchOne',
	    { 'this': this, file: file, pattern: pattern });

	  this.debug('matchOne', file.length, pattern.length);

	  for (var fi = 0,
	      pi = 0,
	      fl = file.length,
	      pl = pattern.length
	      ; (fi < fl) && (pi < pl)
	      ; fi++, pi++) {
	    this.debug('matchOne loop');
	    var p = pattern[pi];
	    var f = file[fi];

	    this.debug(pattern, p, f);

	    // should be impossible.
	    // some invalid regexp stuff in the set.
	    /* istanbul ignore if */
	    if (p === false) return false

	    if (p === GLOBSTAR) {
	      this.debug('GLOBSTAR', [pattern, p, f]);

	      // "**"
	      // a/**/b/**/c would match the following:
	      // a/b/x/y/z/c
	      // a/x/y/z/b/c
	      // a/b/x/b/x/c
	      // a/b/c
	      // To do this, take the rest of the pattern after
	      // the **, and see if it would match the file remainder.
	      // If so, return success.
	      // If not, the ** "swallows" a segment, and try again.
	      // This is recursively awful.
	      //
	      // a/**/b/**/c matching a/b/x/y/z/c
	      // - a matches a
	      // - doublestar
	      //   - matchOne(b/x/y/z/c, b/**/c)
	      //     - b matches b
	      //     - doublestar
	      //       - matchOne(x/y/z/c, c) -> no
	      //       - matchOne(y/z/c, c) -> no
	      //       - matchOne(z/c, c) -> no
	      //       - matchOne(c, c) yes, hit
	      var fr = fi;
	      var pr = pi + 1;
	      if (pr === pl) {
	        this.debug('** at the end');
	        // a ** at the end will just swallow the rest.
	        // We have found a match.
	        // however, it will not swallow /.x, unless
	        // options.dot is set.
	        // . and .. are *never* matched by **, for explosively
	        // exponential reasons.
	        for (; fi < fl; fi++) {
	          if (file[fi] === '.' || file[fi] === '..' ||
	            (!options.dot && file[fi].charAt(0) === '.')) return false
	        }
	        return true
	      }

	      // ok, let's see if we can swallow whatever we can.
	      while (fr < fl) {
	        var swallowee = file[fr];

	        this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);

	        // XXX remove this slice.  Just pass the start index.
	        if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
	          this.debug('globstar found match!', fr, fl, swallowee);
	          // found a match.
	          return true
	        } else {
	          // can't swallow "." or ".." ever.
	          // can only swallow ".foo" when explicitly asked.
	          if (swallowee === '.' || swallowee === '..' ||
	            (!options.dot && swallowee.charAt(0) === '.')) {
	            this.debug('dot detected!', file, fr, pattern, pr);
	            break
	          }

	          // ** swallows a segment, and continue.
	          this.debug('globstar swallow a segment, and continue');
	          fr++;
	        }
	      }

	      // no match was found.
	      // However, in partial mode, we can't say this is necessarily over.
	      // If there's more *pattern* left, then
	      /* istanbul ignore if */
	      if (partial) {
	        // ran out of file
	        this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
	        if (fr === fl) return true
	      }
	      return false
	    }

	    // something other than **
	    // non-magic patterns just have to match exactly
	    // patterns with magic have been turned into regexps.
	    var hit;
	    if (typeof p === 'string') {
	      hit = f === p;
	      this.debug('string match', p, f, hit);
	    } else {
	      hit = f.match(p);
	      this.debug('pattern match', p, f, hit);
	    }

	    if (!hit) return false
	  }

	  // Note: ending in / means that we'll get a final ""
	  // at the end of the pattern.  This can only match a
	  // corresponding "" at the end of the file.
	  // If the file ends in /, then it can only match a
	  // a pattern that ends in /, unless the pattern just
	  // doesn't have any more for it. But, a/b/ should *not*
	  // match "a/b/*", even though "" matches against the
	  // [^/]*? pattern, except in partial mode, where it might
	  // simply not be reached yet.
	  // However, a/b/ should still satisfy a/*

	  // now either we fell off the end of the pattern, or we're done.
	  if (fi === fl && pi === pl) {
	    // ran out of pattern and filename at the same time.
	    // an exact hit!
	    return true
	  } else if (fi === fl) {
	    // ran out of file, but still had pattern left.
	    // this is ok if we're doing the match as part of
	    // a glob fs traversal.
	    return partial
	  } else /* istanbul ignore else */ if (pi === pl) {
	    // ran out of pattern, still have file left.
	    // this is only acceptable if we're on the very last
	    // empty segment of a file with a trailing slash.
	    // a/* should match a/b/
	    return (fi === fl - 1) && (file[fi] === '')
	  }

	  // should be unreachable.
	  /* istanbul ignore next */
	  throw new Error('wtf?')
	};

	// replace stuff like \* with *
	function globUnescape (s) {
	  return s.replace(/\\(.)/g, '$1')
	}

	function regExpEscape (s) {
	  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
	}
	return minimatch_1;
}

var cjs = {};

var hasRequiredCjs$1;

function requireCjs$1 () {
	if (hasRequiredCjs$1) return cjs;
	hasRequiredCjs$1 = 1;

	/**
	 * @fileoverview Merge Strategy
	 */

	//-----------------------------------------------------------------------------
	// Class
	//-----------------------------------------------------------------------------

	/**
	 * Container class for several different merge strategies.
	 */
	class MergeStrategy {
		/**
		 * Merges two keys by overwriting the first with the second.
		 * @param {*} value1 The value from the first object key.
		 * @param {*} value2 The value from the second object key.
		 * @returns {*} The second value.
		 */
		static overwrite(value1, value2) {
			return value2;
		}

		/**
		 * Merges two keys by replacing the first with the second only if the
		 * second is defined.
		 * @param {*} value1 The value from the first object key.
		 * @param {*} value2 The value from the second object key.
		 * @returns {*} The second value if it is defined.
		 */
		static replace(value1, value2) {
			if (typeof value2 !== "undefined") {
				return value2;
			}

			return value1;
		}

		/**
		 * Merges two properties by assigning properties from the second to the first.
		 * @param {*} value1 The value from the first object key.
		 * @param {*} value2 The value from the second object key.
		 * @returns {*} A new object containing properties from both value1 and
		 *      value2.
		 */
		static assign(value1, value2) {
			return Object.assign({}, value1, value2);
		}
	}

	/**
	 * @fileoverview Validation Strategy
	 */

	//-----------------------------------------------------------------------------
	// Class
	//-----------------------------------------------------------------------------

	/**
	 * Container class for several different validation strategies.
	 */
	class ValidationStrategy {
		/**
		 * Validates that a value is an array.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static array(value) {
			if (!Array.isArray(value)) {
				throw new TypeError("Expected an array.");
			}
		}

		/**
		 * Validates that a value is a boolean.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static boolean(value) {
			if (typeof value !== "boolean") {
				throw new TypeError("Expected a Boolean.");
			}
		}

		/**
		 * Validates that a value is a number.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static number(value) {
			if (typeof value !== "number") {
				throw new TypeError("Expected a number.");
			}
		}

		/**
		 * Validates that a value is a object.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static object(value) {
			if (!value || typeof value !== "object") {
				throw new TypeError("Expected an object.");
			}
		}

		/**
		 * Validates that a value is a object or null.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static "object?"(value) {
			if (typeof value !== "object") {
				throw new TypeError("Expected an object or null.");
			}
		}

		/**
		 * Validates that a value is a string.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static string(value) {
			if (typeof value !== "string") {
				throw new TypeError("Expected a string.");
			}
		}

		/**
		 * Validates that a value is a non-empty string.
		 * @param {*} value The value to validate.
		 * @returns {void}
		 * @throws {TypeError} If the value is invalid.
		 */
		static "string!"(value) {
			if (typeof value !== "string" || value.length === 0) {
				throw new TypeError("Expected a non-empty string.");
			}
		}
	}

	/**
	 * @fileoverview Object Schema
	 */


	//-----------------------------------------------------------------------------
	// Types
	//-----------------------------------------------------------------------------

	/** @typedef {import("./types.ts").ObjectDefinition} ObjectDefinition */
	/** @typedef {import("./types.ts").PropertyDefinition} PropertyDefinition */

	//-----------------------------------------------------------------------------
	// Private
	//-----------------------------------------------------------------------------

	/**
	 * Validates a schema strategy.
	 * @param {string} name The name of the key this strategy is for.
	 * @param {PropertyDefinition} definition The strategy for the object key.
	 * @returns {void}
	 * @throws {Error} When the strategy is missing a name.
	 * @throws {Error} When the strategy is missing a merge() method.
	 * @throws {Error} When the strategy is missing a validate() method.
	 */
	function validateDefinition(name, definition) {
		let hasSchema = false;
		if (definition.schema) {
			if (typeof definition.schema === "object") {
				hasSchema = true;
			} else {
				throw new TypeError("Schema must be an object.");
			}
		}

		if (typeof definition.merge === "string") {
			if (!(definition.merge in MergeStrategy)) {
				throw new TypeError(
					`Definition for key "${name}" missing valid merge strategy.`,
				);
			}
		} else if (!hasSchema && typeof definition.merge !== "function") {
			throw new TypeError(
				`Definition for key "${name}" must have a merge property.`,
			);
		}

		if (typeof definition.validate === "string") {
			if (!(definition.validate in ValidationStrategy)) {
				throw new TypeError(
					`Definition for key "${name}" missing valid validation strategy.`,
				);
			}
		} else if (!hasSchema && typeof definition.validate !== "function") {
			throw new TypeError(
				`Definition for key "${name}" must have a validate() method.`,
			);
		}
	}

	//-----------------------------------------------------------------------------
	// Errors
	//-----------------------------------------------------------------------------

	/**
	 * Error when an unexpected key is found.
	 */
	class UnexpectedKeyError extends Error {
		/**
		 * Creates a new instance.
		 * @param {string} key The key that was unexpected.
		 */
		constructor(key) {
			super(`Unexpected key "${key}" found.`);
		}
	}

	/**
	 * Error when a required key is missing.
	 */
	class MissingKeyError extends Error {
		/**
		 * Creates a new instance.
		 * @param {string} key The key that was missing.
		 */
		constructor(key) {
			super(`Missing required key "${key}".`);
		}
	}

	/**
	 * Error when a key requires other keys that are missing.
	 */
	class MissingDependentKeysError extends Error {
		/**
		 * Creates a new instance.
		 * @param {string} key The key that was unexpected.
		 * @param {Array<string>} requiredKeys The keys that are required.
		 */
		constructor(key, requiredKeys) {
			super(`Key "${key}" requires keys "${requiredKeys.join('", "')}".`);
		}
	}

	/**
	 * Wrapper error for errors occuring during a merge or validate operation.
	 */
	class WrapperError extends Error {
		/**
		 * Creates a new instance.
		 * @param {string} key The object key causing the error.
		 * @param {Error} source The source error.
		 */
		constructor(key, source) {
			super(`Key "${key}": ${source.message}`, { cause: source });

			// copy over custom properties that aren't represented
			for (const sourceKey of Object.keys(source)) {
				if (!(sourceKey in this)) {
					this[sourceKey] = source[sourceKey];
				}
			}
		}
	}

	//-----------------------------------------------------------------------------
	// Main
	//-----------------------------------------------------------------------------

	/**
	 * Represents an object validation/merging schema.
	 */
	class ObjectSchema {
		/**
		 * Track all definitions in the schema by key.
		 * @type {Map<string, PropertyDefinition>}
		 */
		#definitions = new Map();

		/**
		 * Separately track any keys that are required for faster validtion.
		 * @type {Map<string, PropertyDefinition>}
		 */
		#requiredKeys = new Map();

		/**
		 * Creates a new instance.
		 * @param {ObjectDefinition} definitions The schema definitions.
		 */
		constructor(definitions) {
			if (!definitions) {
				throw new Error("Schema definitions missing.");
			}

			// add in all strategies
			for (const key of Object.keys(definitions)) {
				validateDefinition(key, definitions[key]);

				// normalize merge and validate methods if subschema is present
				if (typeof definitions[key].schema === "object") {
					const schema = new ObjectSchema(definitions[key].schema);
					definitions[key] = {
						...definitions[key],
						merge(first = {}, second = {}) {
							return schema.merge(first, second);
						},
						validate(value) {
							ValidationStrategy.object(value);
							schema.validate(value);
						},
					};
				}

				// normalize the merge method in case there's a string
				if (typeof definitions[key].merge === "string") {
					definitions[key] = {
						...definitions[key],
						merge: MergeStrategy[
							/** @type {string} */ (definitions[key].merge)
						],
					};
				}

				// normalize the validate method in case there's a string
				if (typeof definitions[key].validate === "string") {
					definitions[key] = {
						...definitions[key],
						validate:
							ValidationStrategy[
								/** @type {string} */ (definitions[key].validate)
							],
					};
				}

				this.#definitions.set(key, definitions[key]);

				if (definitions[key].required) {
					this.#requiredKeys.set(key, definitions[key]);
				}
			}
		}

		/**
		 * Determines if a strategy has been registered for the given object key.
		 * @param {string} key The object key to find a strategy for.
		 * @returns {boolean} True if the key has a strategy registered, false if not.
		 */
		hasKey(key) {
			return this.#definitions.has(key);
		}

		/**
		 * Merges objects together to create a new object comprised of the keys
		 * of the all objects. Keys are merged based on the each key's merge
		 * strategy.
		 * @param {...Object} objects The objects to merge.
		 * @returns {Object} A new object with a mix of all objects' keys.
		 * @throws {Error} If any object is invalid.
		 */
		merge(...objects) {
			// double check arguments
			if (objects.length < 2) {
				throw new TypeError("merge() requires at least two arguments.");
			}

			if (
				objects.some(
					object => object === null || typeof object !== "object",
				)
			) {
				throw new TypeError("All arguments must be objects.");
			}

			return objects.reduce((result, object) => {
				this.validate(object);

				for (const [key, strategy] of this.#definitions) {
					try {
						if (key in result || key in object) {
							const merge = /** @type {Function} */ (strategy.merge);
							const value = merge.call(
								this,
								result[key],
								object[key],
							);
							if (value !== undefined) {
								result[key] = value;
							}
						}
					} catch (ex) {
						throw new WrapperError(key, ex);
					}
				}
				return result;
			}, {});
		}

		/**
		 * Validates an object's keys based on the validate strategy for each key.
		 * @param {Object} object The object to validate.
		 * @returns {void}
		 * @throws {Error} When the object is invalid.
		 */
		validate(object) {
			// check existing keys first
			for (const key of Object.keys(object)) {
				// check to see if the key is defined
				if (!this.hasKey(key)) {
					throw new UnexpectedKeyError(key);
				}

				// validate existing keys
				const definition = this.#definitions.get(key);

				// first check to see if any other keys are required
				if (Array.isArray(definition.requires)) {
					if (
						!definition.requires.every(otherKey => otherKey in object)
					) {
						throw new MissingDependentKeysError(
							key,
							definition.requires,
						);
					}
				}

				// now apply remaining validation strategy
				try {
					const validate = /** @type {Function} */ (definition.validate);
					validate.call(definition, object[key]);
				} catch (ex) {
					throw new WrapperError(key, ex);
				}
			}

			// ensure required keys aren't missing
			for (const [key] of this.#requiredKeys) {
				if (!(key in object)) {
					throw new MissingKeyError(key);
				}
			}
		}
	}

	cjs.MergeStrategy = MergeStrategy;
	cjs.ObjectSchema = ObjectSchema;
	cjs.ValidationStrategy = ValidationStrategy;
	return cjs;
}

var hasRequiredCjs;

function requireCjs () {
	if (hasRequiredCjs) return cjs$1;
	hasRequiredCjs = 1;
	(function (exports) {

		var posixPath = requirePosix();
		var windowsPath = requireWindows();
		var minimatch = requireMinimatch();
		var createDebug = requireSrc();
		var objectSchema = requireCjs$1();

		function _interopNamespaceDefault(e) {
			var n = Object.create(null);
			if (e) {
				Object.keys(e).forEach(function (k) {
					if (k !== 'default') {
						var d = Object.getOwnPropertyDescriptor(e, k);
						Object.defineProperty(n, k, d.get ? d : {
							enumerable: true,
							get: function () { return e[k]; }
						});
					}
				});
			}
			n.default = e;
			return Object.freeze(n);
		}

		var posixPath__namespace = /*#__PURE__*/_interopNamespaceDefault(posixPath);
		var windowsPath__namespace = /*#__PURE__*/_interopNamespaceDefault(windowsPath);

		/**
		 * @fileoverview ConfigSchema
		 * @author Nicholas C. Zakas
		 */

		//------------------------------------------------------------------------------
		// Types
		//------------------------------------------------------------------------------

		/** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */
		/** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */

		//------------------------------------------------------------------------------
		// Helpers
		//------------------------------------------------------------------------------

		/**
		 * A strategy that does nothing.
		 * @type {PropertyDefinition}
		 */
		const NOOP_STRATEGY = {
			required: false,
			merge() {
				return undefined;
			},
			validate() {},
		};

		//------------------------------------------------------------------------------
		// Exports
		//------------------------------------------------------------------------------

		/**
		 * The base schema that every ConfigArray uses.
		 * @type {ObjectDefinition}
		 */
		const baseSchema = Object.freeze({
			name: {
				required: false,
				merge() {
					return undefined;
				},
				validate(value) {
					if (typeof value !== "string") {
						throw new TypeError("Property must be a string.");
					}
				},
			},
			files: NOOP_STRATEGY,
			ignores: NOOP_STRATEGY,
		});

		/**
		 * @fileoverview ConfigSchema
		 * @author Nicholas C. Zakas
		 */

		//------------------------------------------------------------------------------
		// Types
		//------------------------------------------------------------------------------


		//------------------------------------------------------------------------------
		// Helpers
		//------------------------------------------------------------------------------

		/**
		 * Asserts that a given value is an array.
		 * @param {*} value The value to check.
		 * @returns {void}
		 * @throws {TypeError} When the value is not an array.
		 */
		function assertIsArray(value) {
			if (!Array.isArray(value)) {
				throw new TypeError("Expected value to be an array.");
			}
		}

		/**
		 * Asserts that a given value is an array containing only strings and functions.
		 * @param {*} value The value to check.
		 * @returns {void}
		 * @throws {TypeError} When the value is not an array of strings and functions.
		 */
		function assertIsArrayOfStringsAndFunctions(value) {
			assertIsArray(value);

			if (
				value.some(
					item => typeof item !== "string" && typeof item !== "function",
				)
			) {
				throw new TypeError(
					"Expected array to only contain strings and functions.",
				);
			}
		}

		/**
		 * Asserts that a given value is a non-empty array.
		 * @param {*} value The value to check.
		 * @returns {void}
		 * @throws {TypeError} When the value is not an array or an empty array.
		 */
		function assertIsNonEmptyArray(value) {
			if (!Array.isArray(value) || value.length === 0) {
				throw new TypeError("Expected value to be a non-empty array.");
			}
		}

		//------------------------------------------------------------------------------
		// Exports
		//------------------------------------------------------------------------------

		/**
		 * The schema for `files` and `ignores` that every ConfigArray uses.
		 * @type {ObjectDefinition}
		 */
		const filesAndIgnoresSchema = Object.freeze({
			files: {
				required: false,
				merge() {
					return undefined;
				},
				validate(value) {
					// first check if it's an array
					assertIsNonEmptyArray(value);

					// then check each member
					value.forEach(item => {
						if (Array.isArray(item)) {
							assertIsArrayOfStringsAndFunctions(item);
						} else if (
							typeof item !== "string" &&
							typeof item !== "function"
						) {
							throw new TypeError(
								"Items must be a string, a function, or an array of strings and functions.",
							);
						}
					});
				},
			},
			ignores: {
				required: false,
				merge() {
					return undefined;
				},
				validate: assertIsArrayOfStringsAndFunctions,
			},
		});

		/**
		 * @fileoverview ConfigArray
		 * @author Nicholas C. Zakas
		 */


		//------------------------------------------------------------------------------
		// Types
		//------------------------------------------------------------------------------

		/** @typedef {import("./types.ts").ConfigObject} ConfigObject */
		/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */
		/** @typedef {import("minimatch").IMinimatch} IMinimatch */
		/** @typedef {import("@jsr/std__path")} PathImpl */

		/*
		 * This is a bit of a hack to make TypeScript happy with the Rollup-created
		 * CommonJS file. Rollup doesn't do object destructuring for imported files
		 * and instead imports the default via `require()`. This messes up type checking
		 * for `ObjectSchema`. To work around that, we just import the type manually
		 * and give it a different name to use in the JSDoc comments.
		 */
		/** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */

		//------------------------------------------------------------------------------
		// Helpers
		//------------------------------------------------------------------------------

		const Minimatch = minimatch.Minimatch;
		const debug = createDebug("@eslint/config-array");

		/**
		 * A cache for minimatch instances.
		 * @type {Map<string, IMinimatch>}
		 */
		const minimatchCache = new Map();

		/**
		 * A cache for negated minimatch instances.
		 * @type {Map<string, IMinimatch>}
		 */
		const negatedMinimatchCache = new Map();

		/**
		 * Options to use with minimatch.
		 * @type {Object}
		 */
		const MINIMATCH_OPTIONS = {
			// matchBase: true,
			dot: true,
			allowWindowsEscape: true,
		};

		/**
		 * The types of config objects that are supported.
		 * @type {Set<string>}
		 */
		const CONFIG_TYPES = new Set(["array", "function"]);

		/**
		 * Fields that are considered metadata and not part of the config object.
		 * @type {Set<string>}
		 */
		const META_FIELDS = new Set(["name"]);

		/**
		 * A schema containing just files and ignores for early validation.
		 * @type {ObjectSchemaInstance}
		 */
		const FILES_AND_IGNORES_SCHEMA = new objectSchema.ObjectSchema(filesAndIgnoresSchema);

		// Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`.

		const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" });
		const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" });
		const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({
			status: "unconfigured",
		});

		// Match two leading dots followed by a slash or the end of input.
		const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u;

		/**
		 * Wrapper error for config validation errors that adds a name to the front of the
		 * error message.
		 */
		class ConfigError extends Error {
			/**
			 * Creates a new instance.
			 * @param {string} name The config object name causing the error.
			 * @param {number} index The index of the config object in the array.
			 * @param {Object} options The options for the error.
			 * @param {Error} [options.cause] The error that caused this error.
			 * @param {string} [options.message] The message to use for the error.
			 */
			constructor(name, index, { cause, message }) {
				const finalMessage = message || cause.message;

				super(`Config ${name}: ${finalMessage}`, { cause });

				// copy over custom properties that aren't represented
				if (cause) {
					for (const key of Object.keys(cause)) {
						if (!(key in this)) {
							this[key] = cause[key];
						}
					}
				}

				/**
				 * The name of the error.
				 * @type {string}
				 * @readonly
				 */
				this.name = "ConfigError";

				/**
				 * The index of the config object in the array.
				 * @type {number}
				 * @readonly
				 */
				this.index = index;
			}
		}

		/**
		 * Gets the name of a config object.
		 * @param {ConfigObject} config The config object to get the name of.
		 * @returns {string} The name of the config object.
		 */
		function getConfigName(config) {
			if (config && typeof config.name === "string" && config.name) {
				return `"${config.name}"`;
			}

			return "(unnamed)";
		}

		/**
		 * Rethrows a config error with additional information about the config object.
		 * @param {object} config The config object to get the name of.
		 * @param {number} index The index of the config object in the array.
		 * @param {Error} error The error to rethrow.
		 * @throws {ConfigError} When the error is rethrown for a config.
		 */
		function rethrowConfigError(config, index, error) {
			const configName = getConfigName(config);
			throw new ConfigError(configName, index, { cause: error });
		}

		/**
		 * Shorthand for checking if a value is a string.
		 * @param {any} value The value to check.
		 * @returns {boolean} True if a string, false if not.
		 */
		function isString(value) {
			return typeof value === "string";
		}

		/**
		 * Creates a function that asserts that the config is valid
		 * during normalization. This checks that the config is not nullish
		 * and that files and ignores keys  of a config object are valid as per base schema.
		 * @param {Object} config The config object to check.
		 * @param {number} index The index of the config object in the array.
		 * @returns {void}
		 * @throws {ConfigError} If the files and ignores keys of a config object are not valid.
		 */
		function assertValidBaseConfig(config, index) {
			if (config === null) {
				throw new ConfigError(getConfigName(config), index, {
					message: "Unexpected null config.",
				});
			}

			if (config === undefined) {
				throw new ConfigError(getConfigName(config), index, {
					message: "Unexpected undefined config.",
				});
			}

			if (typeof config !== "object") {
				throw new ConfigError(getConfigName(config), index, {
					message: "Unexpected non-object config.",
				});
			}

			const validateConfig = {};

			if ("files" in config) {
				validateConfig.files = config.files;
			}

			if ("ignores" in config) {
				validateConfig.ignores = config.ignores;
			}

			try {
				FILES_AND_IGNORES_SCHEMA.validate(validateConfig);
			} catch (validationError) {
				rethrowConfigError(config, index, validationError);
			}
		}

		/**
		 * Wrapper around minimatch that caches minimatch patterns for
		 * faster matching speed over multiple file path evaluations.
		 * @param {string} filepath The file path to match.
		 * @param {string} pattern The glob pattern to match against.
		 * @param {object} options The minimatch options to use.
		 * @returns
		 */
		function doMatch(filepath, pattern, options = {}) {
			let cache = minimatchCache;

			if (options.flipNegate) {
				cache = negatedMinimatchCache;
			}

			let matcher = cache.get(pattern);

			if (!matcher) {
				matcher = new Minimatch(
					pattern,
					Object.assign({}, MINIMATCH_OPTIONS, options),
				);
				cache.set(pattern, matcher);
			}

			return matcher.match(filepath);
		}

		/**
		 * Normalizes a `ConfigArray` by flattening it and executing any functions
		 * that are found inside.
		 * @param {Array} items The items in a `ConfigArray`.
		 * @param {Object} context The context object to pass into any function
		 *      found.
		 * @param {Array<string>} extraConfigTypes The config types to check.
		 * @returns {Promise<Array>} A flattened array containing only config objects.
		 * @throws {TypeError} When a config function returns a function.
		 */
		async function normalize(items, context, extraConfigTypes) {
			const allowFunctions = extraConfigTypes.includes("function");
			const allowArrays = extraConfigTypes.includes("array");

			async function* flatTraverse(array) {
				for (let item of array) {
					if (typeof item === "function") {
						if (!allowFunctions) {
							throw new TypeError("Unexpected function.");
						}

						item = item(context);
						if (item.then) {
							item = await item;
						}
					}

					if (Array.isArray(item)) {
						if (!allowArrays) {
							throw new TypeError("Unexpected array.");
						}
						yield* flatTraverse(item);
					} else if (typeof item === "function") {
						throw new TypeError(
							"A config function can only return an object or array.",
						);
					} else {
						yield item;
					}
				}
			}

			/*
			 * Async iterables cannot be used with the spread operator, so we need to manually
			 * create the array to return.
			 */
			const asyncIterable = await flatTraverse(items);
			const configs = [];

			for await (const config of asyncIterable) {
				configs.push(config);
			}

			return configs;
		}

		/**
		 * Normalizes a `ConfigArray` by flattening it and executing any functions
		 * that are found inside.
		 * @param {Array} items The items in a `ConfigArray`.
		 * @param {Object} context The context object to pass into any function
		 *      found.
		 * @param {Array<string>} extraConfigTypes The config types to check.
		 * @returns {Array} A flattened array containing only config objects.
		 * @throws {TypeError} When a config function returns a function.
		 */
		function normalizeSync(items, context, extraConfigTypes) {
			const allowFunctions = extraConfigTypes.includes("function");
			const allowArrays = extraConfigTypes.includes("array");

			function* flatTraverse(array) {
				for (let item of array) {
					if (typeof item === "function") {
						if (!allowFunctions) {
							throw new TypeError("Unexpected function.");
						}

						item = item(context);
						if (item.then) {
							throw new TypeError(
								"Async config functions are not supported.",
							);
						}
					}

					if (Array.isArray(item)) {
						if (!allowArrays) {
							throw new TypeError("Unexpected array.");
						}

						yield* flatTraverse(item);
					} else if (typeof item === "function") {
						throw new TypeError(
							"A config function can only return an object or array.",
						);
					} else {
						yield item;
					}
				}
			}

			return [...flatTraverse(items)];
		}

		/**
		 * Determines if a given file path should be ignored based on the given
		 * matcher.
		 * @param {Array<string|((string) => boolean)>} ignores The ignore patterns to check.
		 * @param {string} filePath The unprocessed file path to check.
		 * @param {string} relativeFilePath The path of the file to check relative to the base path,
		 * 		using forward slash (`"/"`) as a separator.
		 * @returns {boolean} True if the path should be ignored and false if not.
		 */
		function shouldIgnorePath(ignores, filePath, relativeFilePath) {
			return ignores.reduce((ignored, matcher) => {
				if (!ignored) {
					if (typeof matcher === "function") {
						return matcher(filePath);
					}

					// don't check negated patterns because we're not ignored yet
					if (!matcher.startsWith("!")) {
						return doMatch(relativeFilePath, matcher);
					}

					// otherwise we're still not ignored
					return false;
				}

				// only need to check negated patterns because we're ignored
				if (typeof matcher === "string" && matcher.startsWith("!")) {
					return !doMatch(relativeFilePath, matcher, {
						flipNegate: true,
					});
				}

				return ignored;
			}, false);
		}

		/**
		 * Determines if a given file path is matched by a config based on
		 * `ignores` only.
		 * @param {string} filePath The unprocessed file path to check.
		 * @param {string} relativeFilePath The path of the file to check relative to the base path,
		 * 		using forward slash (`"/"`) as a separator.
		 * @param {Object} config The config object to check.
		 * @returns {boolean} True if the file path is matched by the config,
		 *      false if not.
		 */
		function pathMatchesIgnores(filePath, relativeFilePath, config) {
			return (
				Object.keys(config).filter(key => !META_FIELDS.has(key)).length > 1 &&
				!shouldIgnorePath(config.ignores, filePath, relativeFilePath)
			);
		}

		/**
		 * Determines if a given file path is matched by a config. If the config
		 * has no `files` field, then it matches; otherwise, if a `files` field
		 * is present then we match the globs in `files` and exclude any globs in
		 * `ignores`.
		 * @param {string} filePath The unprocessed file path to check.
		 * @param {string} relativeFilePath The path of the file to check relative to the base path,
		 * 		using forward slash (`"/"`) as a separator.
		 * @param {Object} config The config object to check.
		 * @returns {boolean} True if the file path is matched by the config,
		 *      false if not.
		 */
		function pathMatches(filePath, relativeFilePath, config) {
			// match both strings and functions
			function match(pattern) {
				if (isString(pattern)) {
					return doMatch(relativeFilePath, pattern);
				}

				if (typeof pattern === "function") {
					return pattern(filePath);
				}

				throw new TypeError(`Unexpected matcher type ${pattern}.`);
			}

			// check for all matches to config.files
			let filePathMatchesPattern = config.files.some(pattern => {
				if (Array.isArray(pattern)) {
					return pattern.every(match);
				}

				return match(pattern);
			});

			/*
			 * If the file path matches the config.files patterns, then check to see
			 * if there are any files to ignore.
			 */
			if (filePathMatchesPattern && config.ignores) {
				filePathMatchesPattern = !shouldIgnorePath(
					config.ignores,
					filePath,
					relativeFilePath,
				);
			}

			return filePathMatchesPattern;
		}

		/**
		 * Ensures that a ConfigArray has been normalized.
		 * @param {ConfigArray} configArray The ConfigArray to check.
		 * @returns {void}
		 * @throws {Error} When the `ConfigArray` is not normalized.
		 */
		function assertNormalized(configArray) {
			// TODO: Throw more verbose error
			if (!configArray.isNormalized()) {
				throw new Error(
					"ConfigArray must be normalized to perform this operation.",
				);
			}
		}

		/**
		 * Ensures that config types are valid.
		 * @param {Array<string>} extraConfigTypes The config types to check.
		 * @returns {void}
		 * @throws {Error} When the config types array is invalid.
		 */
		function assertExtraConfigTypes(extraConfigTypes) {
			if (extraConfigTypes.length > 2) {
				throw new TypeError(
					"configTypes must be an array with at most two items.",
				);
			}

			for (const configType of extraConfigTypes) {
				if (!CONFIG_TYPES.has(configType)) {
					throw new TypeError(
						`Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`,
					);
				}
			}
		}

		/**
		 * Returns path-handling implementations for Unix or Windows, depending on a given absolute path.
		 * @param {string} fileOrDirPath The absolute path to check.
		 * @returns {PathImpl} Path-handling implementations for the specified path.
		 * @throws An error is thrown if the specified argument is not an absolute path.
		 */
		function getPathImpl(fileOrDirPath) {
			// Posix absolute paths always start with a slash.
			if (fileOrDirPath.startsWith("/")) {
				return posixPath__namespace;
			}

			// Windows absolute paths start with a letter followed by a colon and at least one backslash,
			// or with two backslashes in the case of UNC paths.
			// Forward slashed are automatically normalized to backslashes.
			if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) {
				return windowsPath__namespace;
			}

			throw new Error(
				`Expected an absolute path but received "${fileOrDirPath}"`,
			);
		}

		/**
		 * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`).
		 * @param {string} fileOrDirPath The unprocessed path to convert.
		 * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative.
		 * @param {PathImpl} path Path-handling implementations.
		 * @returns {string} A relative path with all separator characters replaced by forward slashes.
		 */
		function toRelativePath(fileOrDirPath, namespacedBasePath, path) {
			const fullPath = path.resolve(namespacedBasePath, fileOrDirPath);
			const namespacedFullPath = path.toNamespacedPath(fullPath);
			const relativePath = path.relative(namespacedBasePath, namespacedFullPath);
			return relativePath.replaceAll(path.SEPARATOR, "/");
		}

		//------------------------------------------------------------------------------
		// Public Interface
		//------------------------------------------------------------------------------

		const ConfigArraySymbol = {
			isNormalized: Symbol("isNormalized"),
			configCache: Symbol("configCache"),
			schema: Symbol("schema"),
			finalizeConfig: Symbol("finalizeConfig"),
			preprocessConfig: Symbol("preprocessConfig"),
		};

		// used to store calculate data for faster lookup
		const dataCache = new WeakMap();

		/**
		 * Represents an array of config objects and provides method for working with
		 * those config objects.
		 */
		class ConfigArray extends Array {
			/**
			 * The namespaced path of the config file directory.
			 * @type {string}
			 */
			#namespacedBasePath;

			/**
			 * Path-handling implementations.
			 * @type {PathImpl}
			 */
			#path;

			/**
			 * Creates a new instance of ConfigArray.
			 * @param {Iterable|Function|Object} configs An iterable yielding config
			 *      objects, or a config function, or a config object.
			 * @param {Object} options The options for the ConfigArray.
			 * @param {string} [options.basePath="/"] The absolute path of the config file directory.
			 * 		Defaults to `"/"`.
			 * @param {boolean} [options.normalized=false] Flag indicating if the
			 *      configs have already been normalized.
			 * @param {Object} [options.schema] The additional schema
			 *      definitions to use for the ConfigArray schema.
			 * @param {Array<string>} [options.extraConfigTypes] List of config types supported.
			 */
			constructor(
				configs,
				{
					basePath = "/",
					normalized = false,
					schema: customSchema,
					extraConfigTypes = [],
				} = {},
			) {
				super();

				/**
				 * Tracks if the array has been normalized.
				 * @property isNormalized
				 * @type {boolean}
				 * @private
				 */
				this[ConfigArraySymbol.isNormalized] = normalized;

				/**
				 * The schema used for validating and merging configs.
				 * @property schema
				 * @type {ObjectSchemaInstance}
				 * @private
				 */
				this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema(
					Object.assign({}, customSchema, baseSchema),
				);

				if (!isString(basePath) || !basePath) {
					throw new TypeError("basePath must be a non-empty string");
				}

				/**
				 * The path of the config file that this array was loaded from.
				 * This is used to calculate filename matches.
				 * @property basePath
				 * @type {string}
				 */
				this.basePath = basePath;

				assertExtraConfigTypes(extraConfigTypes);

				/**
				 * The supported config types.
				 * @type {Array<string>}
				 */
				this.extraConfigTypes = [...extraConfigTypes];
				Object.freeze(this.extraConfigTypes);

				/**
				 * A cache to store calculated configs for faster repeat lookup.
				 * @property configCache
				 * @type {Map<string, Object>}
				 * @private
				 */
				this[ConfigArraySymbol.configCache] = new Map();

				// init cache
				dataCache.set(this, {
					explicitMatches: new Map(),
					directoryMatches: new Map(),
					files: undefined,
					ignores: undefined,
				});

				// load the configs into this array
				if (Array.isArray(configs)) {
					this.push(...configs);
				} else {
					this.push(configs);
				}

				// select path-handling implementations depending on the base path
				this.#path = getPathImpl(basePath);

				// On Windows, `path.relative()` returns an absolute path when given two paths on different drives.
				// The namespaced base path is useful to make sure that calculated relative paths are always relative.
				// On Unix, it is identical to the base path.
				this.#namespacedBasePath = this.#path.toNamespacedPath(basePath);
			}

			/**
			 * Prevent normal array methods from creating a new `ConfigArray` instance.
			 * This is to ensure that methods such as `slice()` won't try to create a
			 * new instance of `ConfigArray` behind the scenes as doing so may throw
			 * an error due to the different constructor signature.
			 * @type {ArrayConstructor} The `Array` constructor.
			 */
			static get [Symbol.species]() {
				return Array;
			}

			/**
			 * Returns the `files` globs from every config object in the array.
			 * This can be used to determine which files will be matched by a
			 * config array or to use as a glob pattern when no patterns are provided
			 * for a command line interface.
			 * @returns {Array<string|Function>} An array of matchers.
			 */
			get files() {
				assertNormalized(this);

				// if this data has been cached, retrieve it
				const cache = dataCache.get(this);

				if (cache.files) {
					return cache.files;
				}

				// otherwise calculate it

				const result = [];

				for (const config of this) {
					if (config.files) {
						config.files.forEach(filePattern => {
							result.push(filePattern);
						});
					}
				}

				// store result
				cache.files = result;
				dataCache.set(this, cache);

				return result;
			}

			/**
			 * Returns ignore matchers that should always be ignored regardless of
			 * the matching `files` fields in any configs. This is necessary to mimic
			 * the behavior of things like .gitignore and .eslintignore, allowing a
			 * globbing operation to be faster.
			 * @returns {string[]} An array of string patterns and functions to be ignored.
			 */
			get ignores() {
				assertNormalized(this);

				// if this data has been cached, retrieve it
				const cache = dataCache.get(this);

				if (cache.ignores) {
					return cache.ignores;
				}

				// otherwise calculate it

				const result = [];

				for (const config of this) {
					/*
					 * We only count ignores if there are no other keys in the object.
					 * In this case, it acts list a globally ignored pattern. If there
					 * are additional keys, then ignores act like exclusions.
					 */
					if (
						config.ignores &&
						Object.keys(config).filter(key => !META_FIELDS.has(key))
							.length === 1
					) {
						result.push(...config.ignores);
					}
				}

				// store result
				cache.ignores = result;
				dataCache.set(this, cache);

				return result;
			}

			/**
			 * Indicates if the config array has been normalized.
			 * @returns {boolean} True if the config array is normalized, false if not.
			 */
			isNormalized() {
				return this[ConfigArraySymbol.isNormalized];
			}

			/**
			 * Normalizes a config array by flattening embedded arrays and executing
			 * config functions.
			 * @param {Object} [context] The context object for config functions.
			 * @returns {Promise<ConfigArray>} The current ConfigArray instance.
			 */
			async normalize(context = {}) {
				if (!this.isNormalized()) {
					const normalizedConfigs = await normalize(
						this,
						context,
						this.extraConfigTypes,
					);
					this.length = 0;
					this.push(
						...normalizedConfigs.map(
							this[ConfigArraySymbol.preprocessConfig].bind(this),
						),
					);
					this.forEach(assertValidBaseConfig);
					this[ConfigArraySymbol.isNormalized] = true;

					// prevent further changes
					Object.freeze(this);
				}

				return this;
			}

			/**
			 * Normalizes a config array by flattening embedded arrays and executing
			 * config functions.
			 * @param {Object} [context] The context object for config functions.
			 * @returns {ConfigArray} The current ConfigArray instance.
			 */
			normalizeSync(context = {}) {
				if (!this.isNormalized()) {
					const normalizedConfigs = normalizeSync(
						this,
						context,
						this.extraConfigTypes,
					);
					this.length = 0;
					this.push(
						...normalizedConfigs.map(
							this[ConfigArraySymbol.preprocessConfig].bind(this),
						),
					);
					this.forEach(assertValidBaseConfig);
					this[ConfigArraySymbol.isNormalized] = true;

					// prevent further changes
					Object.freeze(this);
				}

				return this;
			}

			/* eslint-disable class-methods-use-this -- Desired as instance methods */

			/**
			 * Finalizes the state of a config before being cached and returned by
			 * `getConfig()`. Does nothing by default but is provided to be
			 * overridden by subclasses as necessary.
			 * @param {Object} config The config to finalize.
			 * @returns {Object} The finalized config.
			 */
			[ConfigArraySymbol.finalizeConfig](config) {
				return config;
			}

			/**
			 * Preprocesses a config during the normalization process. This is the
			 * method to override if you want to convert an array item before it is
			 * validated for the first time. For example, if you want to replace a
			 * string with an object, this is the method to override.
			 * @param {Object} config The config to preprocess.
			 * @returns {Object} The config to use in place of the argument.
			 */
			[ConfigArraySymbol.preprocessConfig](config) {
				return config;
			}

			/* eslint-enable class-methods-use-this -- Desired as instance methods */

			/**
			 * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
			 * @param {string} filePath The path of a file to get a config for.
			 * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
			 * An object with an optional property `config` and property `status`.
			 * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
			 * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
			 */
			getConfigWithStatus(filePath) {
				assertNormalized(this);

				const cache = this[ConfigArraySymbol.configCache];

				// first check the cache for a filename match to avoid duplicate work
				if (cache.has(filePath)) {
					return cache.get(filePath);
				}

				// check to see if the file is outside the base path

				const relativeFilePath = toRelativePath(
					filePath,
					this.#namespacedBasePath,
					this.#path,
				);

				if (EXTERNAL_PATH_REGEX.test(relativeFilePath)) {
					debug(`No config for file ${filePath} outside of base path`);

					// cache and return result
					cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL);
					return CONFIG_WITH_STATUS_EXTERNAL;
				}

				// next check to see if the file should be ignored

				// check if this should be ignored due to its directory
				if (this.isDirectoryIgnored(this.#path.dirname(filePath))) {
					debug(`Ignoring ${filePath} based on directory pattern`);

					// cache and return result
					cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
					return CONFIG_WITH_STATUS_IGNORED;
				}

				if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) {
					debug(`Ignoring ${filePath} based on file pattern`);

					// cache and return result
					cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
					return CONFIG_WITH_STATUS_IGNORED;
				}

				// filePath isn't automatically ignored, so try to construct config

				const matchingConfigIndices = [];
				let matchFound = false;
				const universalPattern = /^\*$|\/\*{1,2}$/u;

				this.forEach((config, index) => {
					if (!config.files) {
						if (!config.ignores) {
							debug(`Universal config found for ${filePath}`);
							matchingConfigIndices.push(index);
							return;
						}

						if (pathMatchesIgnores(filePath, relativeFilePath, config)) {
							debug(
								`Matching config found for ${filePath} (based on ignores: ${config.ignores})`,
							);
							matchingConfigIndices.push(index);
							return;
						}

						debug(
							`Skipped config found for ${filePath} (based on ignores: ${config.ignores})`,
						);
						return;
					}

					/*
					 * If a config has a files pattern * or patterns ending in /** or /*,
					 * and the filePath only matches those patterns, then the config is only
					 * applied if there is another config where the filePath matches
					 * a file with a specific extensions such as *.js.
					 */

					const universalFiles = config.files.filter(pattern =>
						universalPattern.test(pattern),
					);

					// universal patterns were found so we need to check the config twice
					if (universalFiles.length) {
						debug("Universal files patterns found. Checking carefully.");

						const nonUniversalFiles = config.files.filter(
							pattern => !universalPattern.test(pattern),
						);

						// check that the config matches without the non-universal files first
						if (
							nonUniversalFiles.length &&
							pathMatches(filePath, relativeFilePath, {
								files: nonUniversalFiles,
								ignores: config.ignores,
							})
						) {
							debug(`Matching config found for ${filePath}`);
							matchingConfigIndices.push(index);
							matchFound = true;
							return;
						}

						// if there wasn't a match then check if it matches with universal files
						if (
							universalFiles.length &&
							pathMatches(filePath, relativeFilePath, {
								files: universalFiles,
								ignores: config.ignores,
							})
						) {
							debug(`Matching config found for ${filePath}`);
							matchingConfigIndices.push(index);
							return;
						}

						// if we make here, then there was no match
						return;
					}

					// the normal case
					if (pathMatches(filePath, relativeFilePath, config)) {
						debug(`Matching config found for ${filePath}`);
						matchingConfigIndices.push(index);
						matchFound = true;
					}
				});

				// if matching both files and ignores, there will be no config to create
				if (!matchFound) {
					debug(`No matching configs found for ${filePath}`);

					// cache and return result
					cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED);
					return CONFIG_WITH_STATUS_UNCONFIGURED;
				}

				// check to see if there is a config cached by indices
				const indicesKey = matchingConfigIndices.toString();
				let configWithStatus = cache.get(indicesKey);

				if (configWithStatus) {
					// also store for filename for faster lookup next time
					cache.set(filePath, configWithStatus);

					return configWithStatus;
				}

				// otherwise construct the config

				// eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error
				let finalConfig = matchingConfigIndices.reduce((result, index) => {
					try {
						return this[ConfigArraySymbol.schema].merge(
							result,
							this[index],
						);
					} catch (validationError) {
						rethrowConfigError(this[index], index, validationError);
					}
				}, {});

				finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig);

				configWithStatus = Object.freeze({
					config: finalConfig,
					status: "matched",
				});
				cache.set(filePath, configWithStatus);
				cache.set(indicesKey, configWithStatus);

				return configWithStatus;
			}

			/**
			 * Returns the config object for a given file path.
			 * @param {string} filePath The path of a file to get a config for.
			 * @returns {Object|undefined} The config object for this file or `undefined`.
			 */
			getConfig(filePath) {
				return this.getConfigWithStatus(filePath).config;
			}

			/**
			 * Determines whether a file has a config or why it doesn't.
			 * @param {string} filePath The path of the file to check.
			 * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
			 * * `"ignored"`: the file is ignored
			 * * `"external"`: the file is outside the base path
			 * * `"unconfigured"`: the file is not matched by any config
			 * * `"matched"`: the file has a matching config
			 */
			getConfigStatus(filePath) {
				return this.getConfigWithStatus(filePath).status;
			}

			/**
			 * Determines if the given filepath is ignored based on the configs.
			 * @param {string} filePath The path of a file to check.
			 * @returns {boolean} True if the path is ignored, false if not.
			 * @deprecated Use `isFileIgnored` instead.
			 */
			isIgnored(filePath) {
				return this.isFileIgnored(filePath);
			}

			/**
			 * Determines if the given filepath is ignored based on the configs.
			 * @param {string} filePath The path of a file to check.
			 * @returns {boolean} True if the path is ignored, false if not.
			 */
			isFileIgnored(filePath) {
				return this.getConfigStatus(filePath) === "ignored";
			}

			/**
			 * Determines if the given directory is ignored based on the configs.
			 * This checks only default `ignores` that don't have `files` in the
			 * same config. A pattern such as `/foo` be considered to ignore the directory
			 * while a pattern such as `/foo/**` is not considered to ignore the
			 * directory because it is matching files.
			 * @param {string} directoryPath The path of a directory to check.
			 * @returns {boolean} True if the directory is ignored, false if not. Will
			 * 		return true for any directory that is not inside of `basePath`.
			 * @throws {Error} When the `ConfigArray` is not normalized.
			 */
			isDirectoryIgnored(directoryPath) {
				assertNormalized(this);

				const relativeDirectoryPath = toRelativePath(
					directoryPath,
					this.#namespacedBasePath,
					this.#path,
				);

				// basePath directory can never be ignored
				if (relativeDirectoryPath === "") {
					return false;
				}

				if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) {
					return true;
				}

				// first check the cache
				const cache = dataCache.get(this).directoryMatches;

				if (cache.has(relativeDirectoryPath)) {
					return cache.get(relativeDirectoryPath);
				}

				const directoryParts = relativeDirectoryPath.split("/");
				let relativeDirectoryToCheck = "";
				let result;

				/*
				 * In order to get the correct gitignore-style ignores, where an
				 * ignored parent directory cannot have any descendants unignored,
				 * we need to check every directory starting at the parent all
				 * the way down to the actual requested directory.
				 *
				 * We aggressively cache all of this info to make sure we don't
				 * have to recalculate everything for every call.
				 */
				do {
					relativeDirectoryToCheck += `${directoryParts.shift()}/`;

					result = shouldIgnorePath(
						this.ignores,
						this.#path.join(this.basePath, relativeDirectoryToCheck),
						relativeDirectoryToCheck,
					);

					cache.set(relativeDirectoryToCheck, result);
				} while (!result && directoryParts.length);

				// also cache the result for the requested path
				cache.set(relativeDirectoryPath, result);

				return result;
			}
		}

		Object.defineProperty(exports, "ObjectSchema", {
			enumerable: true,
			get: function () { return objectSchema.ObjectSchema; }
		});
		exports.ConfigArray = ConfigArray;
		exports.ConfigArraySymbol = ConfigArraySymbol; 
	} (cjs$1));
	return cjs$1;
}

/**
 * @fileoverview Helpers for severity values (e.g. normalizing different types).
 * @author Bryan Mishkin
 */

var severity;
var hasRequiredSeverity;

function requireSeverity () {
	if (hasRequiredSeverity) return severity;
	hasRequiredSeverity = 1;

	/**
	 * Convert severity value of different types to a string.
	 * @param {string|number} severity severity value
	 * @throws error if severity is invalid
	 * @returns {string} severity string
	 */
	function normalizeSeverityToString(severity) {
		if ([2, "2", "error"].includes(severity)) {
			return "error";
		}
		if ([1, "1", "warn"].includes(severity)) {
			return "warn";
		}
		if ([0, "0", "off"].includes(severity)) {
			return "off";
		}
		throw new Error(`Invalid severity value: ${severity}`);
	}

	/**
	 * Convert severity value of different types to a number.
	 * @param {string|number} severity severity value
	 * @throws error if severity is invalid
	 * @returns {number} severity number
	 */
	function normalizeSeverityToNumber(severity) {
		if ([2, "2", "error"].includes(severity)) {
			return 2;
		}
		if ([1, "1", "warn"].includes(severity)) {
			return 1;
		}
		if ([0, "0", "off"].includes(severity)) {
			return 0;
		}
		throw new Error(`Invalid severity value: ${severity}`);
	}

	severity = {
		normalizeSeverityToString,
		normalizeSeverityToNumber,
	};
	return severity;
}

/**
 * @fileoverview Flat config schema
 * @author Nicholas C. Zakas
 */

var flatConfigSchema_1;
var hasRequiredFlatConfigSchema;

function requireFlatConfigSchema () {
	if (hasRequiredFlatConfigSchema) return flatConfigSchema_1;
	hasRequiredFlatConfigSchema = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const { normalizeSeverityToNumber } = requireSeverity();

	//-----------------------------------------------------------------------------
	// Type Definitions
	//-----------------------------------------------------------------------------

	/**
	 * @typedef ObjectPropertySchema
	 * @property {Function|string} merge The function or name of the function to call
	 *      to merge multiple objects with this property.
	 * @property {Function|string} validate The function or name of the function to call
	 *      to validate the value of this property.
	 */

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	const ruleSeverities = new Map([
		[0, 0],
		["off", 0],
		[1, 1],
		["warn", 1],
		[2, 2],
		["error", 2],
	]);

	/**
	 * Check if a value is a non-null object.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is a non-null object.
	 */
	function isNonNullObject(value) {
		return typeof value === "object" && value !== null;
	}

	/**
	 * Check if a value is a non-null non-array object.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is a non-null non-array object.
	 */
	function isNonArrayObject(value) {
		return isNonNullObject(value) && !Array.isArray(value);
	}

	/**
	 * Check if a value is undefined.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is undefined.
	 */
	function isUndefined(value) {
		return typeof value === "undefined";
	}

	/**
	 * Deeply merges two non-array objects.
	 * @param {Object} first The base object.
	 * @param {Object} second The overrides object.
	 * @param {Map<string, Map<string, Object>>} [mergeMap] Maps the combination of first and second arguments to a merged result.
	 * @returns {Object} An object with properties from both first and second.
	 */
	function deepMerge(first, second, mergeMap = new Map()) {
		let secondMergeMap = mergeMap.get(first);

		if (secondMergeMap) {
			const result = secondMergeMap.get(second);

			if (result) {
				// If this combination of first and second arguments has been already visited, return the previously created result.
				return result;
			}
		} else {
			secondMergeMap = new Map();
			mergeMap.set(first, secondMergeMap);
		}

		/*
		 * First create a result object where properties from the second object
		 * overwrite properties from the first. This sets up a baseline to use
		 * later rather than needing to inspect and change every property
		 * individually.
		 */
		const result = {
			...first,
			...second,
		};

		delete result.__proto__; // eslint-disable-line no-proto -- don't merge own property "__proto__"

		// Store the pending result for this combination of first and second arguments.
		secondMergeMap.set(second, result);

		for (const key of Object.keys(second)) {
			// avoid hairy edge case
			if (
				key === "__proto__" ||
				!Object.prototype.propertyIsEnumerable.call(first, key)
			) {
				continue;
			}

			const firstValue = first[key];
			const secondValue = second[key];

			if (isNonArrayObject(firstValue) && isNonArrayObject(secondValue)) {
				result[key] = deepMerge(firstValue, secondValue, mergeMap);
			} else if (isUndefined(secondValue)) {
				result[key] = firstValue;
			}
		}

		return result;
	}

	/**
	 * Normalizes the rule options config for a given rule by ensuring that
	 * it is an array and that the first item is 0, 1, or 2.
	 * @param {Array|string|number} ruleOptions The rule options config.
	 * @returns {Array} An array of rule options.
	 */
	function normalizeRuleOptions(ruleOptions) {
		const finalOptions = Array.isArray(ruleOptions)
			? ruleOptions.slice(0)
			: [ruleOptions];

		finalOptions[0] = ruleSeverities.get(finalOptions[0]);
		return structuredClone(finalOptions);
	}

	/**
	 * Determines if an object has any methods.
	 * @param {Object} object The object to check.
	 * @returns {boolean} `true` if the object has any methods.
	 */
	function hasMethod(object) {
		for (const key of Object.keys(object)) {
			if (typeof object[key] === "function") {
				return true;
			}
		}

		return false;
	}

	//-----------------------------------------------------------------------------
	// Assertions
	//-----------------------------------------------------------------------------

	/**
	 * The error type when a rule's options are configured with an invalid type.
	 */
	class InvalidRuleOptionsError extends Error {
		/**
		 * @param {string} ruleId Rule name being configured.
		 * @param {any} value The invalid value.
		 */
		constructor(ruleId, value) {
			super(
				`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`,
			);
			this.messageTemplate = "invalid-rule-options";
			this.messageData = { ruleId, value };
		}
	}

	/**
	 * Validates that a value is a valid rule options entry.
	 * @param {string} ruleId Rule name being configured.
	 * @param {any} value The value to check.
	 * @returns {void}
	 * @throws {InvalidRuleOptionsError} If the value isn't a valid rule options.
	 */
	function assertIsRuleOptions(ruleId, value) {
		if (
			typeof value !== "string" &&
			typeof value !== "number" &&
			!Array.isArray(value)
		) {
			throw new InvalidRuleOptionsError(ruleId, value);
		}
	}

	/**
	 * The error type when a rule's severity is invalid.
	 */
	class InvalidRuleSeverityError extends Error {
		/**
		 * @param {string} ruleId Rule name being configured.
		 * @param {any} value The invalid value.
		 */
		constructor(ruleId, value) {
			super(
				`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`,
			);
			this.messageTemplate = "invalid-rule-severity";
			this.messageData = { ruleId, value };
		}
	}

	/**
	 * Validates that a value is valid rule severity.
	 * @param {string} ruleId Rule name being configured.
	 * @param {any} value The value to check.
	 * @returns {void}
	 * @throws {InvalidRuleSeverityError} If the value isn't a valid rule severity.
	 */
	function assertIsRuleSeverity(ruleId, value) {
		const severity = ruleSeverities.get(value);

		if (typeof severity === "undefined") {
			throw new InvalidRuleSeverityError(ruleId, value);
		}
	}

	/**
	 * Validates that a given string is the form pluginName/objectName.
	 * @param {string} value The string to check.
	 * @returns {void}
	 * @throws {TypeError} If the string isn't in the correct format.
	 */
	function assertIsPluginMemberName(value) {
		if (!/[@a-z0-9-_$]+(?:\/(?:[a-z0-9-_$]+))+$/iu.test(value)) {
			throw new TypeError(
				`Expected string in the form "pluginName/objectName" but found "${value}".`,
			);
		}
	}

	/**
	 * Validates that a value is an object.
	 * @param {any} value The value to check.
	 * @returns {void}
	 * @throws {TypeError} If the value isn't an object.
	 */
	function assertIsObject(value) {
		if (!isNonNullObject(value)) {
			throw new TypeError("Expected an object.");
		}
	}

	/**
	 * The error type when there's an eslintrc-style options in a flat config.
	 */
	class IncompatibleKeyError extends Error {
		/**
		 * @param {string} key The invalid key.
		 */
		constructor(key) {
			super(
				"This appears to be in eslintrc format rather than flat config format.",
			);
			this.messageTemplate = "eslintrc-incompat";
			this.messageData = { key };
		}
	}

	/**
	 * The error type when there's an eslintrc-style plugins array found.
	 */
	class IncompatiblePluginsError extends Error {
		/**
		 * Creates a new instance.
		 * @param {Array<string>} plugins The plugins array.
		 */
		constructor(plugins) {
			super(
				"This appears to be in eslintrc format (array of strings) rather than flat config format (object).",
			);
			this.messageTemplate = "eslintrc-plugins";
			this.messageData = { plugins };
		}
	}

	//-----------------------------------------------------------------------------
	// Low-Level Schemas
	//-----------------------------------------------------------------------------

	/** @type {ObjectPropertySchema} */
	const booleanSchema = {
		merge: "replace",
		validate: "boolean",
	};

	const ALLOWED_SEVERITIES = new Set(["error", "warn", "off", 2, 1, 0]);

	/** @type {ObjectPropertySchema} */
	const disableDirectiveSeveritySchema = {
		merge(first, second) {
			const value = second === void 0 ? first : second;

			if (typeof value === "boolean") {
				return value ? "warn" : "off";
			}

			return normalizeSeverityToNumber(value);
		},
		validate(value) {
			if (!(ALLOWED_SEVERITIES.has(value) || typeof value === "boolean")) {
				throw new TypeError(
					'Expected one of: "error", "warn", "off", 0, 1, 2, or a boolean.',
				);
			}
		},
	};

	/** @type {ObjectPropertySchema} */
	const unusedInlineConfigsSeveritySchema = {
		merge(first, second) {
			const value = second === void 0 ? first : second;

			return normalizeSeverityToNumber(value);
		},
		validate(value) {
			if (!ALLOWED_SEVERITIES.has(value)) {
				throw new TypeError(
					'Expected one of: "error", "warn", "off", 0, 1, or 2.',
				);
			}
		},
	};

	/** @type {ObjectPropertySchema} */
	const deepObjectAssignSchema = {
		merge(first = {}, second = {}) {
			return deepMerge(first, second);
		},
		validate: "object",
	};

	//-----------------------------------------------------------------------------
	// High-Level Schemas
	//-----------------------------------------------------------------------------

	/** @type {ObjectPropertySchema} */
	const languageOptionsSchema = {
		merge(first = {}, second = {}) {
			const result = deepMerge(first, second);

			for (const [key, value] of Object.entries(result)) {
				/*
				 * Special case: Because the `parser` property is an object, it should
				 * not be deep merged. Instead, it should be replaced if it exists in
				 * the second object. To make this more generic, we just check for
				 * objects with methods and replace them if they exist in the second
				 * object.
				 */
				if (isNonArrayObject(value)) {
					if (hasMethod(value)) {
						result[key] = second[key] ?? first[key];
						continue;
					}

					// for other objects, make sure we aren't reusing the same object
					result[key] = { ...result[key] };
					continue;
				}
			}

			return result;
		},
		validate: "object",
	};

	/** @type {ObjectPropertySchema} */
	const languageSchema = {
		merge: "replace",
		validate: assertIsPluginMemberName,
	};

	/** @type {ObjectPropertySchema} */
	const pluginsSchema = {
		merge(first = {}, second = {}) {
			const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
			const result = {};

			// manually validate that plugins are not redefined
			for (const key of keys) {
				// avoid hairy edge case
				if (key === "__proto__") {
					continue;
				}

				if (key in first && key in second && first[key] !== second[key]) {
					throw new TypeError(`Cannot redefine plugin "${key}".`);
				}

				result[key] = second[key] || first[key];
			}

			return result;
		},
		validate(value) {
			// first check the value to be sure it's an object
			if (value === null || typeof value !== "object") {
				throw new TypeError("Expected an object.");
			}

			// make sure it's not an array, which would mean eslintrc-style is used
			if (Array.isArray(value)) {
				throw new IncompatiblePluginsError(value);
			}

			// second check the keys to make sure they are objects
			for (const key of Object.keys(value)) {
				// avoid hairy edge case
				if (key === "__proto__") {
					continue;
				}

				if (value[key] === null || typeof value[key] !== "object") {
					throw new TypeError(`Key "${key}": Expected an object.`);
				}
			}
		},
	};

	/** @type {ObjectPropertySchema} */
	const processorSchema = {
		merge: "replace",
		validate(value) {
			if (typeof value === "string") {
				assertIsPluginMemberName(value);
			} else if (value && typeof value === "object") {
				if (
					typeof value.preprocess !== "function" ||
					typeof value.postprocess !== "function"
				) {
					throw new TypeError(
						"Object must have a preprocess() and a postprocess() method.",
					);
				}
			} else {
				throw new TypeError("Expected an object or a string.");
			}
		},
	};

	/** @type {ObjectPropertySchema} */
	const rulesSchema = {
		merge(first = {}, second = {}) {
			const result = {
				...first,
				...second,
			};

			for (const ruleId of Object.keys(result)) {
				try {
					// avoid hairy edge case
					if (ruleId === "__proto__") {
						/* eslint-disable-next-line no-proto -- Though deprecated, may still be present */
						delete result.__proto__;
						continue;
					}

					result[ruleId] = normalizeRuleOptions(result[ruleId]);

					/*
					 * If either rule config is missing, then the correct
					 * config is already present and we just need to normalize
					 * the severity.
					 */
					if (!(ruleId in first) || !(ruleId in second)) {
						continue;
					}

					const firstRuleOptions = normalizeRuleOptions(first[ruleId]);
					const secondRuleOptions = normalizeRuleOptions(second[ruleId]);

					/*
					 * If the second rule config only has a severity (length of 1),
					 * then use that severity and keep the rest of the options from
					 * the first rule config.
					 */
					if (secondRuleOptions.length === 1) {
						result[ruleId] = [
							secondRuleOptions[0],
							...firstRuleOptions.slice(1),
						];
						continue;
					}

					/*
					 * In any other situation, then the second rule config takes
					 * precedence. That means the value at `result[ruleId]` is
					 * already correct and no further work is necessary.
					 */
				} catch (ex) {
					throw new Error(`Key "${ruleId}": ${ex.message}`, {
						cause: ex,
					});
				}
			}

			return result;
		},

		validate(value) {
			assertIsObject(value);

			/*
			 * We are not checking the rule schema here because there is no
			 * guarantee that the rule definition is present at this point. Instead
			 * we wait and check the rule schema during the finalization step
			 * of calculating a config.
			 */
			for (const ruleId of Object.keys(value)) {
				// avoid hairy edge case
				if (ruleId === "__proto__") {
					continue;
				}

				const ruleOptions = value[ruleId];

				assertIsRuleOptions(ruleId, ruleOptions);

				if (Array.isArray(ruleOptions)) {
					assertIsRuleSeverity(ruleId, ruleOptions[0]);
				} else {
					assertIsRuleSeverity(ruleId, ruleOptions);
				}
			}
		},
	};

	/**
	 * Creates a schema that always throws an error. Useful for warning
	 * about eslintrc-style keys.
	 * @param {string} key The eslintrc key to create a schema for.
	 * @returns {ObjectPropertySchema} The schema.
	 */
	function createEslintrcErrorSchema(key) {
		return {
			merge: "replace",
			validate() {
				throw new IncompatibleKeyError(key);
			},
		};
	}

	const eslintrcKeys = [
		"env",
		"extends",
		"globals",
		"ignorePatterns",
		"noInlineConfig",
		"overrides",
		"parser",
		"parserOptions",
		"reportUnusedDisableDirectives",
		"root",
	];

	//-----------------------------------------------------------------------------
	// Full schema
	//-----------------------------------------------------------------------------

	const flatConfigSchema = {
		// eslintrc-style keys that should always error
		...Object.fromEntries(
			eslintrcKeys.map(key => [key, createEslintrcErrorSchema(key)]),
		),

		// flat config keys
		settings: deepObjectAssignSchema,
		linterOptions: {
			schema: {
				noInlineConfig: booleanSchema,
				reportUnusedDisableDirectives: disableDirectiveSeveritySchema,
				reportUnusedInlineConfigs: unusedInlineConfigsSeveritySchema,
			},
		},
		language: languageSchema,
		languageOptions: languageOptionsSchema,
		processor: processorSchema,
		plugins: pluginsSchema,
		rules: rulesSchema,
	};

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	flatConfigSchema_1 = {
		flatConfigSchema,
		hasMethod,
		assertIsRuleSeverity,
	};
	return flatConfigSchema_1;
}

var defaultConfig = {};

/**
 * @fileoverview The schema to validate language options
 * @author Nicholas C. Zakas
 */

var validateLanguageOptions_1;
var hasRequiredValidateLanguageOptions;

function requireValidateLanguageOptions () {
	if (hasRequiredValidateLanguageOptions) return validateLanguageOptions_1;
	hasRequiredValidateLanguageOptions = 1;

	//-----------------------------------------------------------------------------
	// Data
	//-----------------------------------------------------------------------------

	const globalVariablesValues = new Set([
		true,
		"true",
		"writable",
		"writeable",
		false,
		"false",
		"readonly",
		"readable",
		null,
		"off",
	]);

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Check if a value is a non-null object.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is a non-null object.
	 */
	function isNonNullObject(value) {
		return typeof value === "object" && value !== null;
	}

	/**
	 * Check if a value is a non-null non-array object.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is a non-null non-array object.
	 */
	function isNonArrayObject(value) {
		return isNonNullObject(value) && !Array.isArray(value);
	}

	/**
	 * Check if a value is undefined.
	 * @param {any} value The value to check.
	 * @returns {boolean} `true` if the value is undefined.
	 */
	function isUndefined(value) {
		return typeof value === "undefined";
	}

	//-----------------------------------------------------------------------------
	// Schemas
	//-----------------------------------------------------------------------------

	/**
	 * Validates the ecmaVersion property.
	 * @param {string|number} ecmaVersion The value to check.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	function validateEcmaVersion(ecmaVersion) {
		if (isUndefined(ecmaVersion)) {
			throw new TypeError(
				'Key "ecmaVersion": Expected an "ecmaVersion" property.',
			);
		}

		if (typeof ecmaVersion !== "number" && ecmaVersion !== "latest") {
			throw new TypeError(
				'Key "ecmaVersion": Expected a number or "latest".',
			);
		}
	}

	/**
	 * Validates the sourceType property.
	 * @param {string} sourceType The value to check.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	function validateSourceType(sourceType) {
		if (
			typeof sourceType !== "string" ||
			!/^(?:script|module|commonjs)$/u.test(sourceType)
		) {
			throw new TypeError(
				'Key "sourceType": Expected "script", "module", or "commonjs".',
			);
		}
	}

	/**
	 * Validates the globals property.
	 * @param {Object} globals The value to check.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	function validateGlobals(globals) {
		if (!isNonArrayObject(globals)) {
			throw new TypeError('Key "globals": Expected an object.');
		}

		for (const key of Object.keys(globals)) {
			// avoid hairy edge case
			if (key === "__proto__") {
				continue;
			}

			if (key !== key.trim()) {
				throw new TypeError(
					`Key "globals": Global "${key}" has leading or trailing whitespace.`,
				);
			}

			if (!globalVariablesValues.has(globals[key])) {
				throw new TypeError(
					`Key "globals": Key "${key}": Expected "readonly", "writable", or "off".`,
				);
			}
		}
	}

	/**
	 * Validates the parser property.
	 * @param {Object} parser The value to check.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	function validateParser(parser) {
		if (
			!parser ||
			typeof parser !== "object" ||
			(typeof parser.parse !== "function" &&
				typeof parser.parseForESLint !== "function")
		) {
			throw new TypeError(
				'Key "parser": Expected object with parse() or parseForESLint() method.',
			);
		}
	}

	/**
	 * Validates the language options.
	 * @param {Object} languageOptions The language options to validate.
	 * @returns {void}
	 * @throws {TypeError} If the language options are invalid.
	 */
	function validateLanguageOptions(languageOptions) {
		if (!isNonArrayObject(languageOptions)) {
			throw new TypeError("Expected an object.");
		}

		const {
			ecmaVersion,
			sourceType,
			globals,
			parser,
			parserOptions,
			...otherOptions
		} = languageOptions;

		if ("ecmaVersion" in languageOptions) {
			validateEcmaVersion(ecmaVersion);
		}

		if ("sourceType" in languageOptions) {
			validateSourceType(sourceType);
		}

		if ("globals" in languageOptions) {
			validateGlobals(globals);
		}

		if ("parser" in languageOptions) {
			validateParser(parser);
		}

		if ("parserOptions" in languageOptions) {
			if (!isNonArrayObject(parserOptions)) {
				throw new TypeError('Key "parserOptions": Expected an object.');
			}
		}

		const otherOptionKeys = Object.keys(otherOptions);

		if (otherOptionKeys.length > 0) {
			throw new TypeError(`Unexpected key "${otherOptionKeys[0]}" found.`);
		}
	}

	validateLanguageOptions_1 = { validateLanguageOptions };
	return validateLanguageOptions_1;
}

/**
 * @fileoverview JavaScript Language Object
 * @author Nicholas C. Zakas
 */

var js;
var hasRequiredJs;

function requireJs () {
	if (hasRequiredJs) return js;
	hasRequiredJs = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const { SourceCode } = requireSourceCode();
	const createDebug = requireSrc();
	const astUtils = requireAstUtils$1();
	const espree = requireEspree();
	const eslintScope = requireEslintScope();
	const evk = requireEslintVisitorKeys$2();
	const { validateLanguageOptions } = requireValidateLanguageOptions();
	const { LATEST_ECMA_VERSION } = requireEcmaVersion();

	//-----------------------------------------------------------------------------
	// Type Definitions
	//-----------------------------------------------------------------------------

	/** @typedef {import("@eslint/core").File} File */
	/** @typedef {import("@eslint/core").Language} Language */
	/** @typedef {import("@eslint/core").OkParseResult} OkParseResult */

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	const debug = createDebug("eslint:languages:js");
	const DEFAULT_ECMA_VERSION = 5;
	const parserSymbol = Symbol.for("eslint.RuleTester.parser");

	/**
	 * Analyze scope of the given AST.
	 * @param {ASTNode} ast The `Program` node to analyze.
	 * @param {LanguageOptions} languageOptions The parser options.
	 * @param {Record<string, string[]>} visitorKeys The visitor keys.
	 * @returns {ScopeManager} The analysis result.
	 */
	function analyzeScope(ast, languageOptions, visitorKeys) {
		const parserOptions = languageOptions.parserOptions;
		const ecmaFeatures = parserOptions.ecmaFeatures || {};
		const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;

		return eslintScope.analyze(ast, {
			ignoreEval: true,
			nodejsScope: ecmaFeatures.globalReturn,
			impliedStrict: ecmaFeatures.impliedStrict,
			ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
			sourceType: languageOptions.sourceType || "script",
			childVisitorKeys: visitorKeys || evk.KEYS,
			fallback: evk.getKeys,
		});
	}

	/**
	 * Determines if a given object is Espree.
	 * @param {Object} parser The parser to check.
	 * @returns {boolean} True if the parser is Espree or false if not.
	 */
	function isEspree(parser) {
		return !!(parser === espree || parser[parserSymbol] === espree);
	}

	/**
	 * Normalize ECMAScript version from the initial config into languageOptions (year)
	 * format.
	 * @param {any} [ecmaVersion] ECMAScript version from the initial config
	 * @returns {number} normalized ECMAScript version
	 */
	function normalizeEcmaVersionForLanguageOptions(ecmaVersion) {
		switch (ecmaVersion) {
			case 3:
				return 3;

			// void 0 = no ecmaVersion specified so use the default
			case 5:
			case void 0:
				return 5;

			default:
				if (typeof ecmaVersion === "number") {
					return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009;
				}
		}

		/*
		 * We default to the latest supported ecmaVersion for everything else.
		 * Remember, this is for languageOptions.ecmaVersion, which sets the version
		 * that is used for a number of processes inside of ESLint. It's normally
		 * safe to assume people want the latest unless otherwise specified.
		 */
		return LATEST_ECMA_VERSION;
	}

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * @type {Language}
	 */
	js = {
		fileType: "text",
		lineStart: 1,
		columnStart: 0,
		nodeTypeKey: "type",
		visitorKeys: evk.KEYS,

		defaultLanguageOptions: {
			sourceType: "module",
			ecmaVersion: "latest",
			parser: espree,
			parserOptions: {},
		},

		validateLanguageOptions,

		/**
		 * Normalizes the language options.
		 * @param {Object} languageOptions The language options to normalize.
		 * @returns {Object} The normalized language options.
		 */
		normalizeLanguageOptions(languageOptions) {
			languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
				languageOptions.ecmaVersion,
			);

			// Espree expects this information to be passed in
			if (isEspree(languageOptions.parser)) {
				const parserOptions = languageOptions.parserOptions;

				if (languageOptions.sourceType) {
					parserOptions.sourceType = languageOptions.sourceType;

					if (
						parserOptions.sourceType === "module" &&
						parserOptions.ecmaFeatures &&
						parserOptions.ecmaFeatures.globalReturn
					) {
						parserOptions.ecmaFeatures.globalReturn = false;
					}
				}
			}

			return languageOptions;
		},

		/**
		 * Determines if a given node matches a given selector class.
		 * @param {string} className The class name to check.
		 * @param {ASTNode} node The node to check.
		 * @param {Array<ASTNode>} ancestry The ancestry of the node.
		 * @returns {boolean} True if there's a match, false if not.
		 * @throws {Error} When an unknown class name is passed.
		 */
		matchesSelectorClass(className, node, ancestry) {
			/*
			 * Copyright (c) 2013, Joel Feenstra
			 * All rights reserved.
			 *
			 * Redistribution and use in source and binary forms, with or without
			 * modification, are permitted provided that the following conditions are met:
			 *    * Redistributions of source code must retain the above copyright
			 *      notice, this list of conditions and the following disclaimer.
			 *    * Redistributions in binary form must reproduce the above copyright
			 *      notice, this list of conditions and the following disclaimer in the
			 *      documentation and/or other materials provided with the distribution.
			 *    * Neither the name of the ESQuery nor the names of its contributors may
			 *      be used to endorse or promote products derived from this software without
			 *      specific prior written permission.
			 *
			 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
			 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
			 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
			 * DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY
			 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
			 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
			 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
			 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
			 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
			 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
			 */

			switch (className.toLowerCase()) {
				case "statement":
					if (node.type.slice(-9) === "Statement") {
						return true;
					}

				// fallthrough: interface Declaration <: Statement { }

				case "declaration":
					return node.type.slice(-11) === "Declaration";

				case "pattern":
					if (node.type.slice(-7) === "Pattern") {
						return true;
					}

				// fallthrough: interface Expression <: Node, Pattern { }

				case "expression":
					return (
						node.type.slice(-10) === "Expression" ||
						node.type.slice(-7) === "Literal" ||
						(node.type === "Identifier" &&
							(ancestry.length === 0 ||
								ancestry[0].type !== "MetaProperty")) ||
						node.type === "MetaProperty"
					);

				case "function":
					return (
						node.type === "FunctionDeclaration" ||
						node.type === "FunctionExpression" ||
						node.type === "ArrowFunctionExpression"
					);

				default:
					throw new Error(`Unknown class name: ${className}`);
			}
		},

		/**
		 * Parses the given file into an AST.
		 * @param {File} file The virtual file to parse.
		 * @param {Object} options Additional options passed from ESLint.
		 * @param {LanguageOptions} options.languageOptions The language options.
		 * @returns {Object} The result of parsing.
		 */
		parse(file, { languageOptions }) {
			// Note: BOM already removed
			const { body: text, path: filePath } = file;
			const textToParse = text.replace(
				astUtils.shebangPattern,
				(match, captured) => `//${captured}`,
			);
			const { ecmaVersion, sourceType, parser } = languageOptions;
			const parserOptions = Object.assign(
				{ ecmaVersion, sourceType },
				languageOptions.parserOptions,
				{
					loc: true,
					range: true,
					raw: true,
					tokens: true,
					comment: true,
					eslintVisitorKeys: true,
					eslintScopeManager: true,
					filePath,
				},
			);

			/*
			 * Check for parsing errors first. If there's a parsing error, nothing
			 * else can happen. However, a parsing error does not throw an error
			 * from this method - it's just considered a fatal error message, a
			 * problem that ESLint identified just like any other.
			 */
			try {
				debug("Parsing:", filePath);
				const parseResult =
					typeof parser.parseForESLint === "function"
						? parser.parseForESLint(textToParse, parserOptions)
						: { ast: parser.parse(textToParse, parserOptions) };

				debug("Parsing successful:", filePath);

				const {
					ast,
					services: parserServices = {},
					visitorKeys = evk.KEYS,
					scopeManager,
				} = parseResult;

				return {
					ok: true,
					ast,
					parserServices,
					visitorKeys,
					scopeManager,
				};
			} catch (ex) {
				// If the message includes a leading line number, strip it:
				const message = ex.message.replace(/^line \d+:/iu, "").trim();

				debug("%s\n%s", message, ex.stack);

				return {
					ok: false,
					errors: [
						{
							message,
							line: ex.lineNumber,
							column: ex.column,
						},
					],
				};
			}
		},

		/**
		 * Creates a new `SourceCode` object from the given information.
		 * @param {File} file The virtual file to create a `SourceCode` object from.
		 * @param {OkParseResult} parseResult The result returned from `parse()`.
		 * @param {Object} options Additional options passed from ESLint.
		 * @param {LanguageOptions} options.languageOptions The language options.
		 * @returns {SourceCode} The new `SourceCode` object.
		 */
		createSourceCode(file, parseResult, { languageOptions }) {
			const { body: text, path: filePath, bom: hasBOM } = file;
			const { ast, parserServices, visitorKeys } = parseResult;

			debug("Scope analysis:", filePath);
			const scopeManager =
				parseResult.scopeManager ||
				analyzeScope(ast, languageOptions, visitorKeys);

			debug("Scope analysis successful:", filePath);

			return new SourceCode({
				text,
				ast,
				hasBOM,
				parserServices,
				scopeManager,
				visitorKeys,
			});
		},
	};
	return js;
}

/**
 * @fileoverview Default configuration
 * @author Nicholas C. Zakas
 */

var hasRequiredDefaultConfig;

function requireDefaultConfig () {
	if (hasRequiredDefaultConfig) return defaultConfig;
	hasRequiredDefaultConfig = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const Rules = requireRules$1();

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	const sharedDefaultConfig = [
		// intentionally empty config to ensure these files are globbed by default
		{
			files: ["**/*.js", "**/*.mjs"],
		},
		{
			files: ["**/*.cjs"],
			languageOptions: {
				sourceType: "commonjs",
				ecmaVersion: "latest",
			},
		},
	];

	defaultConfig.defaultConfig = Object.freeze([
		{
			plugins: {
				"@": {
					languages: {
						js: requireJs(),
					},

					/*
					 * Because we try to delay loading rules until absolutely
					 * necessary, a proxy allows us to hook into the lazy-loading
					 * aspect of the rules map while still keeping all of the
					 * relevant configuration inside of the config array.
					 */
					rules: new Proxy(
						{},
						{
							get(target, property) {
								return Rules.get(property);
							},

							has(target, property) {
								return Rules.has(property);
							},
						},
					),
				},
			},
			language: "@/js",
			linterOptions: {
				reportUnusedDisableDirectives: 1,
			},
		},

		// default ignores are listed here
		{
			ignores: ["**/node_modules/", ".git/"],
		},

		...sharedDefaultConfig,
	]);

	defaultConfig.defaultRuleTesterConfig = Object.freeze([
		{ files: ["**"] }, // Make sure the default config matches for all files

		...sharedDefaultConfig,
	]);
	return defaultConfig;
}

/**
 * @fileoverview Applies default rule options
 * @author JoshuaKGoldberg
 */

var deepMergeArrays_1;
var hasRequiredDeepMergeArrays;

function requireDeepMergeArrays () {
	if (hasRequiredDeepMergeArrays) return deepMergeArrays_1;
	hasRequiredDeepMergeArrays = 1;

	/**
	 * Check if the variable contains an object strictly rejecting arrays
	 * @param {unknown} value an object
	 * @returns {boolean} Whether value is an object
	 */
	function isObjectNotArray(value) {
		return typeof value === "object" && value !== null && !Array.isArray(value);
	}

	/**
	 * Deeply merges second on top of first, creating a new {} object if needed.
	 * @param {T} first Base, default value.
	 * @param {U} second User-specified value.
	 * @returns {T | U | (T & U)} Merged equivalent of second on top of first.
	 */
	function deepMergeObjects(first, second) {
		if (second === void 0) {
			return first;
		}

		if (!isObjectNotArray(first) || !isObjectNotArray(second)) {
			return second;
		}

		const result = { ...first, ...second };

		for (const key of Object.keys(second)) {
			if (Object.prototype.propertyIsEnumerable.call(first, key)) {
				result[key] = deepMergeObjects(first[key], second[key]);
			}
		}

		return result;
	}

	/**
	 * Deeply merges second on top of first, creating a new [] array if needed.
	 * @param {T[]} first Base, default values.
	 * @param {U[]} second User-specified values.
	 * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.
	 */
	function deepMergeArrays(first, second) {
		if (!first || !second) {
			return second || first || [];
		}

		return [
			...first.map((value, i) =>
				deepMergeObjects(value, i < second.length ? second[i] : void 0),
			),
			...second.slice(first.length),
		];
	}

	deepMergeArrays_1 = { deepMergeArrays };
	return deepMergeArrays_1;
}

var ruleValidator = {};

var id = "http://json-schema.org/draft-04/schema#";
var $schema = "http://json-schema.org/draft-04/schema#";
var description = "Core schema meta-schema";
var definitions = {
	schemaArray: {
		type: "array",
		minItems: 1,
		items: {
			$ref: "#"
		}
	},
	positiveInteger: {
		type: "integer",
		minimum: 0
	},
	positiveIntegerDefault0: {
		allOf: [
			{
				$ref: "#/definitions/positiveInteger"
			},
			{
				"default": 0
			}
		]
	},
	simpleTypes: {
		"enum": [
			"array",
			"boolean",
			"integer",
			"null",
			"number",
			"object",
			"string"
		]
	},
	stringArray: {
		type: "array",
		items: {
			type: "string"
		},
		minItems: 1,
		uniqueItems: true
	}
};
var type = "object";
var properties = {
	id: {
		type: "string"
	},
	$schema: {
		type: "string"
	},
	title: {
		type: "string"
	},
	description: {
		type: "string"
	},
	"default": {
	},
	multipleOf: {
		type: "number",
		minimum: 0,
		exclusiveMinimum: true
	},
	maximum: {
		type: "number"
	},
	exclusiveMaximum: {
		type: "boolean",
		"default": false
	},
	minimum: {
		type: "number"
	},
	exclusiveMinimum: {
		type: "boolean",
		"default": false
	},
	maxLength: {
		$ref: "#/definitions/positiveInteger"
	},
	minLength: {
		$ref: "#/definitions/positiveIntegerDefault0"
	},
	pattern: {
		type: "string",
		format: "regex"
	},
	additionalItems: {
		anyOf: [
			{
				type: "boolean"
			},
			{
				$ref: "#"
			}
		],
		"default": {
		}
	},
	items: {
		anyOf: [
			{
				$ref: "#"
			},
			{
				$ref: "#/definitions/schemaArray"
			}
		],
		"default": {
		}
	},
	maxItems: {
		$ref: "#/definitions/positiveInteger"
	},
	minItems: {
		$ref: "#/definitions/positiveIntegerDefault0"
	},
	uniqueItems: {
		type: "boolean",
		"default": false
	},
	maxProperties: {
		$ref: "#/definitions/positiveInteger"
	},
	minProperties: {
		$ref: "#/definitions/positiveIntegerDefault0"
	},
	required: {
		$ref: "#/definitions/stringArray"
	},
	additionalProperties: {
		anyOf: [
			{
				type: "boolean"
			},
			{
				$ref: "#"
			}
		],
		"default": {
		}
	},
	definitions: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		"default": {
		}
	},
	properties: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		"default": {
		}
	},
	patternProperties: {
		type: "object",
		additionalProperties: {
			$ref: "#"
		},
		"default": {
		}
	},
	dependencies: {
		type: "object",
		additionalProperties: {
			anyOf: [
				{
					$ref: "#"
				},
				{
					$ref: "#/definitions/stringArray"
				}
			]
		}
	},
	"enum": {
		type: "array",
		minItems: 1,
		uniqueItems: true
	},
	type: {
		anyOf: [
			{
				$ref: "#/definitions/simpleTypes"
			},
			{
				type: "array",
				items: {
					$ref: "#/definitions/simpleTypes"
				},
				minItems: 1,
				uniqueItems: true
			}
		]
	},
	format: {
		type: "string"
	},
	allOf: {
		$ref: "#/definitions/schemaArray"
	},
	anyOf: {
		$ref: "#/definitions/schemaArray"
	},
	oneOf: {
		$ref: "#/definitions/schemaArray"
	},
	not: {
		$ref: "#"
	}
};
var dependencies = {
	exclusiveMaximum: [
		"maximum"
	],
	exclusiveMinimum: [
		"minimum"
	]
};
var require$$1 = {
	id: id,
	$schema: $schema,
	description: description,
	definitions: definitions,
	type: type,
	properties: properties,
	dependencies: dependencies,
	"default": {
}
};

/**
 * @fileoverview The instance of Ajv validator.
 * @author Evgeny Poberezkin
 */

var ajv;
var hasRequiredAjv;

function requireAjv () {
	if (hasRequiredAjv) return ajv;
	hasRequiredAjv = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const Ajv = requireAjv$1(),
		metaSchema = require$$1;

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	ajv = (additionalOptions = {}) => {
		const ajv = new Ajv({
			meta: false,
			useDefaults: true,
			validateSchema: false,
			missingRefs: "ignore",
			verbose: true,
			schemaId: "auto",
			...additionalOptions,
		});

		ajv.addMetaSchema(metaSchema);
		// eslint-disable-next-line no-underscore-dangle -- Ajv's API
		ajv._opts.defaultMeta = metaSchema.id;

		return ajv;
	};
	return ajv;
}

/**
 * @fileoverview Rule Validator
 * @author Nicholas C. Zakas
 */

var hasRequiredRuleValidator;

function requireRuleValidator () {
	if (hasRequiredRuleValidator) return ruleValidator;
	hasRequiredRuleValidator = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const ajvImport = requireAjv();
	const ajv = ajvImport();
	const {
		parseRuleId,
		getRuleFromConfig,
		getRuleOptionsSchema,
	} = requireFlatConfigHelpers();
	const ruleReplacements = require$$17;

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	/**
	 * Throws a helpful error when a rule cannot be found.
	 * @param {Object} ruleId The rule identifier.
	 * @param {string} ruleId.pluginName The ID of the rule to find.
	 * @param {string} ruleId.ruleName The ID of the rule to find.
	 * @param {Object} config The config to search in.
	 * @throws {TypeError} For missing plugin or rule.
	 * @returns {void}
	 */
	function throwRuleNotFoundError({ pluginName, ruleName }, config) {
		const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`;

		const errorMessageHeader = `Key "rules": Key "${ruleId}"`;

		let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}" in configuration.`;

		const missingPluginErrorMessage = errorMessage;

		// if the plugin exists then we need to check if the rule exists
		if (config.plugins && config.plugins[pluginName]) {
			const replacementRuleName = ruleReplacements.rules[ruleName];

			if (pluginName === "@" && replacementRuleName) {
				errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`;
			} else {
				errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`;

				// otherwise, let's see if we can find the rule name elsewhere
				for (const [otherPluginName, otherPlugin] of Object.entries(
					config.plugins,
				)) {
					if (otherPlugin.rules && otherPlugin.rules[ruleName]) {
						errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`;
						break;
					}
				}
			}

			// falls through to throw error
		}

		const error = new TypeError(errorMessage);

		if (errorMessage === missingPluginErrorMessage) {
			error.messageTemplate = "config-plugin-missing";
			error.messageData = { pluginName, ruleId };
		}

		throw error;
	}

	/**
	 * The error type when a rule has an invalid `meta.schema`.
	 */
	class InvalidRuleOptionsSchemaError extends Error {
		/**
		 * Creates a new instance.
		 * @param {string} ruleId Id of the rule that has an invalid `meta.schema`.
		 * @param {Error} processingError Error caught while processing the `meta.schema`.
		 */
		constructor(ruleId, processingError) {
			super(
				`Error while processing options validation schema of rule '${ruleId}': ${processingError.message}`,
				{ cause: processingError },
			);
			this.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA";
		}
	}

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * Implements validation functionality for the rules portion of a config.
	 */
	class RuleValidator {
		/**
		 * Creates a new instance.
		 */
		constructor() {
			/**
			 * A collection of compiled validators for rules that have already
			 * been validated.
			 * @type {WeakMap}
			 */
			this.validators = new WeakMap();
		}

		/**
		 * Validates all of the rule configurations in a config against each
		 * rule's schema.
		 * @param {Object} config The full config to validate. This object must
		 *      contain both the rules section and the plugins section.
		 * @returns {void}
		 * @throws {Error} If a rule's configuration does not match its schema.
		 */
		validate(config) {
			if (!config.rules) {
				return;
			}

			for (const [ruleId, ruleOptions] of Object.entries(config.rules)) {
				// check for edge case
				if (ruleId === "__proto__") {
					continue;
				}

				/*
				 * If a rule is disabled, we don't do any validation. This allows
				 * users to safely set any value to 0 or "off" without worrying
				 * that it will cause a validation error.
				 *
				 * Note: ruleOptions is always an array at this point because
				 * this validation occurs after FlatConfigArray has merged and
				 * normalized values.
				 */
				if (ruleOptions[0] === 0) {
					continue;
				}

				const rule = getRuleFromConfig(ruleId, config);

				if (!rule) {
					throwRuleNotFoundError(parseRuleId(ruleId), config);
				}

				// Precompile and cache validator the first time
				if (!this.validators.has(rule)) {
					try {
						const schema = getRuleOptionsSchema(rule);

						if (schema) {
							this.validators.set(rule, ajv.compile(schema));
						}
					} catch (err) {
						throw new InvalidRuleOptionsSchemaError(ruleId, err);
					}
				}

				const validateRule = this.validators.get(rule);

				if (validateRule) {
					validateRule(ruleOptions.slice(1));

					if (validateRule.errors) {
						throw new Error(
							`Key "rules": Key "${ruleId}":\n${validateRule.errors
								.map(error => {
									if (
										error.keyword === "additionalProperties" &&
										error.schema === false &&
										typeof error.parentSchema?.properties ===
											"object" &&
										typeof error.params?.additionalProperty ===
											"string"
									) {
										const expectedProperties = Object.keys(
											error.parentSchema.properties,
										).map(property => `"${property}"`);

										return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n\t\tUnexpected property "${error.params.additionalProperty}". Expected properties: ${expectedProperties.join(", ")}.\n`;
									}

									return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`;
								})
								.join("")}`,
						);
					}
				}
			}
		}
	}

	ruleValidator.RuleValidator = RuleValidator;
	return ruleValidator;
}

/**
 * @fileoverview The `Config` class
 * @author Nicholas C. Zakas
 */

var config;
var hasRequiredConfig;

function requireConfig () {
	if (hasRequiredConfig) return config;
	hasRequiredConfig = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const { deepMergeArrays } = requireDeepMergeArrays();
	const { getRuleFromConfig } = requireFlatConfigHelpers();
	const { flatConfigSchema, hasMethod } = requireFlatConfigSchema();
	const { RuleValidator } = requireRuleValidator();
	const { ObjectSchema } = requireCjs();

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	const ruleValidator = new RuleValidator();

	const severities = new Map([
		[0, 0],
		[1, 1],
		[2, 2],
		["off", 0],
		["warn", 1],
		["error", 2],
	]);

	/**
	 * Splits a plugin identifier in the form a/b/c into two parts: a/b and c.
	 * @param {string} identifier The identifier to parse.
	 * @returns {{objectName: string, pluginName: string}} The parts of the plugin
	 *      name.
	 */
	function splitPluginIdentifier(identifier) {
		const parts = identifier.split("/");

		return {
			objectName: parts.pop(),
			pluginName: parts.join("/"),
		};
	}

	/**
	 * Returns the name of an object in the config by reading its `meta` key.
	 * @param {Object} object The object to check.
	 * @returns {string?} The name of the object if found or `null` if there
	 *      is no name.
	 */
	function getObjectId(object) {
		// first check old-style name
		let name = object.name;

		if (!name) {
			if (!object.meta) {
				return null;
			}

			name = object.meta.name;

			if (!name) {
				return null;
			}
		}

		// now check for old-style version
		let version = object.version;

		if (!version) {
			version = object.meta && object.meta.version;
		}

		// if there's a version then append that
		if (version) {
			return `${name}@${version}`;
		}

		return name;
	}

	/**
	 * Converts a languageOptions object to a JSON representation.
	 * @param {Record<string, any>} languageOptions The options to create a JSON
	 *     representation of.
	 * @param {string} objectKey The key of the object being converted.
	 * @returns {Record<string, any>} The JSON representation of the languageOptions.
	 * @throws {TypeError} If a function is found in the languageOptions.
	 */
	function languageOptionsToJSON(languageOptions, objectKey = "languageOptions") {
		const result = {};

		for (const [key, value] of Object.entries(languageOptions)) {
			if (value) {
				if (typeof value === "object") {
					const name = getObjectId(value);

					if (name && hasMethod(value)) {
						result[key] = name;
					} else {
						result[key] = languageOptionsToJSON(value, key);
					}
					continue;
				}

				if (typeof value === "function") {
					const error = new TypeError(
						`Cannot serialize key "${key}" in ${objectKey}: Function values are not supported.`,
					);

					error.messageTemplate = "config-serialize-function";
					error.messageData = { key, objectKey };

					throw error;
				}
			}

			result[key] = value;
		}

		return result;
	}

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * Represents a normalized configuration object.
	 */
	class Config {
		/**
		 * The name to use for the language when serializing to JSON.
		 * @type {string|undefined}
		 */
		#languageName;

		/**
		 * The name to use for the processor when serializing to JSON.
		 * @type {string|undefined}
		 */
		#processorName;

		/**
		 * Creates a new instance.
		 * @param {Object} config The configuration object.
		 */
		constructor(config) {
			const { plugins, language, languageOptions, processor, ...otherKeys } =
				config;

			// Validate config object
			const schema = new ObjectSchema(flatConfigSchema);

			schema.validate(config);

			// first, copy all the other keys over
			Object.assign(this, otherKeys);

			// ensure that a language is specified
			if (!language) {
				throw new TypeError("Key 'language' is required.");
			}

			// copy the rest over
			this.plugins = plugins;
			this.language = language;

			// Check language value
			const {
				pluginName: languagePluginName,
				objectName: localLanguageName,
			} = splitPluginIdentifier(language);

			this.#languageName = language;

			if (
				!plugins ||
				!plugins[languagePluginName] ||
				!plugins[languagePluginName].languages ||
				!plugins[languagePluginName].languages[localLanguageName]
			) {
				throw new TypeError(
					`Key "language": Could not find "${localLanguageName}" in plugin "${languagePluginName}".`,
				);
			}

			this.language =
				plugins[languagePluginName].languages[localLanguageName];

			if (this.language.defaultLanguageOptions ?? languageOptions) {
				this.languageOptions = flatConfigSchema.languageOptions.merge(
					this.language.defaultLanguageOptions,
					languageOptions,
				);
			} else {
				this.languageOptions = {};
			}

			// Validate language options
			try {
				this.language.validateLanguageOptions(this.languageOptions);
			} catch (error) {
				throw new TypeError(`Key "languageOptions": ${error.message}`, {
					cause: error,
				});
			}

			// Normalize language options if necessary
			if (this.language.normalizeLanguageOptions) {
				this.languageOptions = this.language.normalizeLanguageOptions(
					this.languageOptions,
				);
			}

			// Check processor value
			if (processor) {
				this.processor = processor;

				if (typeof processor === "string") {
					const { pluginName, objectName: localProcessorName } =
						splitPluginIdentifier(processor);

					this.#processorName = processor;

					if (
						!plugins ||
						!plugins[pluginName] ||
						!plugins[pluginName].processors ||
						!plugins[pluginName].processors[localProcessorName]
					) {
						throw new TypeError(
							`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`,
						);
					}

					this.processor =
						plugins[pluginName].processors[localProcessorName];
				} else if (typeof processor === "object") {
					this.#processorName = getObjectId(processor);
					this.processor = processor;
				} else {
					throw new TypeError(
						"Key 'processor' must be a string or an object.",
					);
				}
			}

			// Process the rules
			if (this.rules) {
				this.#normalizeRulesConfig();
				ruleValidator.validate(this);
			}
		}

		/**
		 * Converts the configuration to a JSON representation.
		 * @returns {Record<string, any>} The JSON representation of the configuration.
		 * @throws {Error} If the configuration cannot be serialized.
		 */
		toJSON() {
			if (this.processor && !this.#processorName) {
				throw new Error(
					"Could not serialize processor object (missing 'meta' object).",
				);
			}

			if (!this.#languageName) {
				throw new Error(
					"Could not serialize language object (missing 'meta' object).",
				);
			}

			return {
				...this,
				plugins: Object.entries(this.plugins).map(([namespace, plugin]) => {
					const pluginId = getObjectId(plugin);

					if (!pluginId) {
						return namespace;
					}

					return `${namespace}:${pluginId}`;
				}),
				language: this.#languageName,
				languageOptions: languageOptionsToJSON(this.languageOptions),
				processor: this.#processorName,
			};
		}

		/**
		 * Normalizes the rules configuration. Ensures that each rule config is
		 * an array and that the severity is a number. Applies meta.defaultOptions.
		 * This function modifies `this.rules`.
		 * @returns {void}
		 */
		#normalizeRulesConfig() {
			for (const [ruleId, originalConfig] of Object.entries(this.rules)) {
				// ensure rule config is an array
				let ruleConfig = Array.isArray(originalConfig)
					? originalConfig
					: [originalConfig];

				// normalize severity
				ruleConfig[0] = severities.get(ruleConfig[0]);

				const rule = getRuleFromConfig(ruleId, this);

				// apply meta.defaultOptions
				const slicedOptions = ruleConfig.slice(1);
				const mergedOptions = deepMergeArrays(
					rule?.meta?.defaultOptions,
					slicedOptions,
				);

				if (mergedOptions.length) {
					ruleConfig = [ruleConfig[0], ...mergedOptions];
				}

				this.rules[ruleId] = ruleConfig;
			}
		}
	}

	config = { Config };
	return config;
}

/**
 * @fileoverview Flat Config Array
 * @author Nicholas C. Zakas
 */

var hasRequiredFlatConfigArray;

function requireFlatConfigArray () {
	if (hasRequiredFlatConfigArray) return flatConfigArray;
	hasRequiredFlatConfigArray = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const { ConfigArray, ConfigArraySymbol } = requireCjs();
	const { flatConfigSchema } = requireFlatConfigSchema();
	const { defaultConfig } = requireDefaultConfig();
	const { Config } = requireConfig();

	//-----------------------------------------------------------------------------
	// Helpers
	//-----------------------------------------------------------------------------

	/**
	 * Fields that are considered metadata and not part of the config object.
	 */
	const META_FIELDS = new Set(["name"]);

	/**
	 * Wraps a config error with details about where the error occurred.
	 * @param {Error} error The original error.
	 * @param {number} originalLength The original length of the config array.
	 * @param {number} baseLength The length of the base config.
	 * @returns {TypeError} The new error with details.
	 */
	function wrapConfigErrorWithDetails(error, originalLength, baseLength) {
		let location = "user-defined";
		let configIndex = error.index;

		/*
		 * A config array is set up in this order:
		 * 1. Base config
		 * 2. Original configs
		 * 3. User-defined configs
		 * 4. CLI-defined configs
		 *
		 * So we need to adjust the index to account for the base config.
		 *
		 * - If the index is less than the base length, it's in the base config
		 *   (as specified by `baseConfig` argument to `FlatConfigArray` constructor).
		 * - If the index is greater than the base length but less than the original
		 *   length + base length, it's in the original config. The original config
		 *   is passed to the `FlatConfigArray` constructor as the first argument.
		 * - Otherwise, it's in the user-defined config, which is loaded from the
		 *   config file and merged with any command-line options.
		 */
		if (error.index < baseLength) {
			location = "base";
		} else if (error.index < originalLength + baseLength) {
			location = "original";
			configIndex = error.index - baseLength;
		} else {
			configIndex = error.index - originalLength - baseLength;
		}

		return new TypeError(
			`${error.message.slice(0, -1)} at ${location} index ${configIndex}.`,
			{ cause: error },
		);
	}

	const originalBaseConfig = Symbol("originalBaseConfig");
	const originalLength = Symbol("originalLength");
	const baseLength = Symbol("baseLength");

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * Represents an array containing configuration information for ESLint.
	 */
	class FlatConfigArray extends ConfigArray {
		/**
		 * Creates a new instance.
		 * @param {*[]} configs An array of configuration information.
		 * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options
		 *      to use for the config array instance.
		 */
		constructor(
			configs,
			{ basePath, shouldIgnore = true, baseConfig = defaultConfig } = {},
		) {
			super(configs, {
				basePath,
				schema: flatConfigSchema,
			});

			/**
			 * The original length of the array before any modifications.
			 * @type {number}
			 */
			this[originalLength] = this.length;

			if (baseConfig[Symbol.iterator]) {
				this.unshift(...baseConfig);
			} else {
				this.unshift(baseConfig);
			}

			/**
			 * The length of the array after applying the base config.
			 * @type {number}
			 */
			this[baseLength] = this.length - this[originalLength];

			/**
			 * The base config used to build the config array.
			 * @type {Array<FlatConfig>}
			 */
			this[originalBaseConfig] = baseConfig;
			Object.defineProperty(this, originalBaseConfig, { writable: false });

			/**
			 * Determines if `ignores` fields should be honored.
			 * If true, then all `ignores` fields are honored.
			 * if false, then only `ignores` fields in the baseConfig are honored.
			 * @type {boolean}
			 */
			this.shouldIgnore = shouldIgnore;
			Object.defineProperty(this, "shouldIgnore", { writable: false });
		}

		/**
		 * Normalizes the array by calling the superclass method and catching/rethrowing
		 * any ConfigError exceptions with additional details.
		 * @param {any} [context] The context to use to normalize the array.
		 * @returns {Promise<FlatConfigArray>} A promise that resolves when the array is normalized.
		 */
		normalize(context) {
			return super.normalize(context).catch(error => {
				if (error.name === "ConfigError") {
					throw wrapConfigErrorWithDetails(
						error,
						this[originalLength],
						this[baseLength],
					);
				}

				throw error;
			});
		}

		/**
		 * Normalizes the array by calling the superclass method and catching/rethrowing
		 * any ConfigError exceptions with additional details.
		 * @param {any} [context] The context to use to normalize the array.
		 * @returns {FlatConfigArray} The current instance.
		 * @throws {TypeError} If the config is invalid.
		 */
		normalizeSync(context) {
			try {
				return super.normalizeSync(context);
			} catch (error) {
				if (error.name === "ConfigError") {
					throw wrapConfigErrorWithDetails(
						error,
						this[originalLength],
						this[baseLength],
					);
				}

				throw error;
			}
		}

		/* eslint-disable class-methods-use-this -- Desired as instance method */
		/**
		 * Replaces a config with another config to allow us to put strings
		 * in the config array that will be replaced by objects before
		 * normalization.
		 * @param {Object} config The config to preprocess.
		 * @returns {Object} The preprocessed config.
		 */
		[ConfigArraySymbol.preprocessConfig](config) {
			/*
			 * If a config object has `ignores` and no other non-meta fields, then it's an object
			 * for global ignores. If `shouldIgnore` is false, that object shouldn't apply,
			 * so we'll remove its `ignores`.
			 */
			if (
				!this.shouldIgnore &&
				!this[originalBaseConfig].includes(config) &&
				config.ignores &&
				Object.keys(config).filter(key => !META_FIELDS.has(key)).length ===
					1
			) {
				/* eslint-disable-next-line no-unused-vars -- need to strip off other keys */
				const { ignores, ...otherKeys } = config;

				return otherKeys;
			}

			return config;
		}

		/**
		 * Finalizes the config by replacing plugin references with their objects
		 * and validating rule option schemas.
		 * @param {Object} config The config to finalize.
		 * @returns {Object} The finalized config.
		 * @throws {TypeError} If the config is invalid.
		 */
		[ConfigArraySymbol.finalizeConfig](config) {
			return new Config(config);
		}
		/* eslint-enable class-methods-use-this -- Desired as instance method */
	}

	flatConfigArray.FlatConfigArray = FlatConfigArray;
	return flatConfigArray;
}

/**
 * @fileoverview Shared flags for ESLint.
 */

var flags;
var hasRequiredFlags;

function requireFlags () {
	if (hasRequiredFlags) return flags;
	hasRequiredFlags = 1;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/**
	 * @typedef {Object} InactiveFlagData
	 * @property {string} description Flag description
	 * @property {string | null} [replacedBy] Can be either:
	 *   - An active flag (string) that enables the same feature.
	 *   - `null` if the feature is now enabled by default.
	 *   - Omitted if the feature has been abandoned.
	 */

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * The set of flags that change ESLint behavior with a description.
	 * @type {Map<string, string>}
	 */
	const activeFlags = new Map([
		["test_only", "Used only for testing."],
		[
			"unstable_config_lookup_from_file",
			"Look up `eslint.config.js` from the file being linted.",
		],
	]);

	/**
	 * The set of flags that used to be active.
	 * @type {Map<string, InactiveFlagData>}
	 */
	const inactiveFlags = new Map([
		[
			"test_only_replaced",
			{
				description:
					"Used only for testing flags that have been replaced by other flags.",
				replacedBy: "test_only",
			},
		],
		[
			"test_only_enabled_by_default",
			{
				description:
					"Used only for testing flags whose features have been enabled by default.",
				replacedBy: null,
			},
		],
		[
			"test_only_abandoned",
			{
				description:
					"Used only for testing flags whose features have been abandoned.",
			},
		],
		[
			"unstable_ts_config",
			{
				description: "Enable TypeScript configuration files.",
				replacedBy: null,
			},
		],
	]);

	/**
	 * Creates a message that describes the reason the flag is inactive.
	 * @param {InactiveFlagData} inactiveFlagData Data for the inactive flag.
	 * @returns {string} Message describing the reason the flag is inactive.
	 */
	function getInactivityReasonMessage({ replacedBy }) {
		if (typeof replacedBy === "undefined") {
			return "This feature has been abandoned.";
		}

		if (typeof replacedBy === "string") {
			return `This flag has been renamed '${replacedBy}' to reflect its stabilization. Please use '${replacedBy}' instead.`;
		}

		// null
		return "This feature is now enabled by default.";
	}

	flags = {
		activeFlags,
		inactiveFlags,
		getInactivityReasonMessage,
	};
	return flags;
}

/**
 * @fileoverview Virtual file
 * @author Nicholas C. Zakas
 */

var vfile;
var hasRequiredVfile;

function requireVfile () {
	if (hasRequiredVfile) return vfile;
	hasRequiredVfile = 1;

	//-----------------------------------------------------------------------------
	// Type Definitions
	//-----------------------------------------------------------------------------

	/** @typedef {import("@eslint/core").File} File */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines if a given value has a byte order mark (BOM).
	 * @param {string|Uint8Array} value The value to check.
	 * @returns {boolean} `true` if the value has a BOM, `false` otherwise.
	 */
	function hasUnicodeBOM(value) {
		return typeof value === "string"
			? value.charCodeAt(0) === 0xfeff
			: value[0] === 0xef && value[1] === 0xbb && value[2] === 0xbf;
	}

	/**
	 * Strips Unicode BOM from the given value.
	 * @param {string|Uint8Array} value The value to remove the BOM from.
	 * @returns {string|Uint8Array} The stripped value.
	 */
	function stripUnicodeBOM(value) {
		if (!hasUnicodeBOM(value)) {
			return value;
		}

		if (typeof value === "string") {
			/*
			 * Check Unicode BOM.
			 * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF.
			 * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters
			 */
			return value.slice(1);
		}

		/*
		 * In a Uint8Array, the BOM is represented by three bytes: 0xEF, 0xBB, and 0xBF,
		 * so we can just remove the first three bytes.
		 */
		return value.slice(3);
	}

	//------------------------------------------------------------------------------
	// Exports
	//------------------------------------------------------------------------------

	/**
	 * Represents a virtual file inside of ESLint.
	 * @implements {File}
	 */
	class VFile {
		/**
		 * The file path including any processor-created virtual path.
		 * @type {string}
		 * @readonly
		 */
		path;

		/**
		 * The file path on disk.
		 * @type {string}
		 * @readonly
		 */
		physicalPath;

		/**
		 * The file contents.
		 * @type {string|Uint8Array}
		 * @readonly
		 */
		body;

		/**
		 * The raw body of the file, including a BOM if present.
		 * @type {string|Uint8Array}
		 * @readonly
		 */
		rawBody;

		/**
		 * Indicates whether the file has a byte order mark (BOM).
		 * @type {boolean}
		 * @readonly
		 */
		bom;

		/**
		 * Creates a new instance.
		 * @param {string} path The file path.
		 * @param {string|Uint8Array} body The file contents.
		 * @param {Object} [options] Additional options.
		 * @param {string} [options.physicalPath] The file path on disk.
		 */
		constructor(path, body, { physicalPath } = {}) {
			this.path = path;
			this.physicalPath = physicalPath ?? path;
			this.bom = hasUnicodeBOM(body);
			this.body = stripUnicodeBOM(body);
			this.rawBody = body;
		}
	}

	vfile = { VFile };
	return vfile;
}

/**
 * @fileoverview ESLint Parser
 * @author Nicholas C. Zakas
 */

var parserService;
var hasRequiredParserService;

function requireParserService () {
	if (hasRequiredParserService) return parserService;
	hasRequiredParserService = 1;

	//-----------------------------------------------------------------------------
	// Types
	//-----------------------------------------------------------------------------

	/** @typedef {import("../linter/vfile.js").VFile} VFile */
	/** @typedef {import("@eslint/core").Language} Language */
	/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * The parser for ESLint.
	 */
	class ParserService {
		/**
		 * Parses the given file synchronously.
		 * @param {VFile} file The file to parse.
		 * @param {{language:Language,languageOptions:LanguageOptions}} config The configuration to use.
		 * @returns {Object} An object with the parsed source code or errors.
		 * @throws {Error} If the parser returns a promise.
		 */
		parseSync(file, config) {
			const { language, languageOptions } = config;
			const result = language.parse(file, { languageOptions });

			if (typeof result.then === "function") {
				throw new Error("Unsupported: Language parser returned a promise.");
			}

			if (result.ok) {
				return {
					ok: true,
					sourceCode: language.createSourceCode(file, result, {
						languageOptions,
					}),
				};
			}

			// if we made it to here there was an error
			return {
				ok: false,
				errors: result.errors.map(error => ({
					ruleId: null,
					nodeType: null,
					fatal: true,
					severity: 2,
					message: `Parsing error: ${error.message}`,
					line: error.line,
					column: error.column,
				})),
			};
		}
	}

	parserService = { ParserService };
	return parserService;
}

var fileContext = {};

/**
 * @fileoverview The FileContext class.
 * @author Nicholas C. Zakas
 */

var hasRequiredFileContext;

function requireFileContext () {
	if (hasRequiredFileContext) return fileContext;
	hasRequiredFileContext = 1;

	/**
	 * Represents a file context that the linter can use to lint a file.
	 */
	class FileContext {
		/**
		 * The current working directory.
		 * @type {string}
		 */
		cwd;

		/**
		 * The filename of the file being linted.
		 * @type {string}
		 */
		filename;

		/**
		 * The physical filename of the file being linted.
		 * @type {string}
		 */
		physicalFilename;

		/**
		 * The source code of the file being linted.
		 * @type {SourceCode}
		 */
		sourceCode;

		/**
		 * The parser options for the file being linted.
		 * @type {Record<string, unknown>}
		 * @deprecated Use `languageOptions` instead.
		 */
		parserOptions;

		/**
		 * The path to the parser used to parse this file.
		 * @type {string}
		 * @deprecated No longer supported.
		 */
		parserPath;

		/**
		 * The language options used when parsing this file.
		 * @type {Record<string, unknown>}
		 */
		languageOptions;

		/**
		 * The settings for the file being linted.
		 * @type {Record<string, unknown>}
		 */
		settings;

		/**
		 * Creates a new instance.
		 * @param {Object} config The configuration object for the file context.
		 * @param {string} config.cwd The current working directory.
		 * @param {string} config.filename The filename of the file being linted.
		 * @param {string} config.physicalFilename The physical filename of the file being linted.
		 * @param {SourceCode} config.sourceCode The source code of the file being linted.
		 * @param {Record<string, unknown>} config.parserOptions The parser options for the file being linted.
		 * @param {string} config.parserPath The path to the parser used to parse this file.
		 * @param {Record<string, unknown>} config.languageOptions The language options used when parsing this file.
		 * @param {Record<string, unknown>} config.settings The settings for the file being linted.
		 */
		constructor({
			cwd,
			filename,
			physicalFilename,
			sourceCode,
			parserOptions,
			parserPath,
			languageOptions,
			settings,
		}) {
			this.cwd = cwd;
			this.filename = filename;
			this.physicalFilename = physicalFilename;
			this.sourceCode = sourceCode;
			this.parserOptions = parserOptions;
			this.parserPath = parserPath;
			this.languageOptions = languageOptions;
			this.settings = settings;

			Object.freeze(this);
		}

		/**
		 * Gets the current working directory.
		 * @returns {string} The current working directory.
		 * @deprecated Use `cwd` instead.
		 */
		getCwd() {
			return this.cwd;
		}

		/**
		 * Gets the filename of the file being linted.
		 * @returns {string} The filename of the file being linted.
		 * @deprecated Use `filename` instead.
		 */
		getFilename() {
			return this.filename;
		}

		/**
		 * Gets the physical filename of the file being linted.
		 * @returns {string} The physical filename of the file being linted.
		 * @deprecated Use `physicalFilename` instead.
		 */
		getPhysicalFilename() {
			return this.physicalFilename;
		}

		/**
		 * Gets the source code of the file being linted.
		 * @returns {SourceCode} The source code of the file being linted.
		 * @deprecated Use `sourceCode` instead.
		 */
		getSourceCode() {
			return this.sourceCode;
		}
	}

	fileContext.FileContext = FileContext;
	return fileContext;
}

/**
 * @fileoverview ESLint Processor Service
 * @author Nicholas C. Zakas
 */

var processorService;
var hasRequiredProcessorService;

function requireProcessorService () {
	if (hasRequiredProcessorService) return processorService;
	hasRequiredProcessorService = 1;

	//-----------------------------------------------------------------------------
	// Requirements
	//-----------------------------------------------------------------------------

	const path = require$$0$1;
	const { VFile } = requireVfile();

	//-----------------------------------------------------------------------------
	// Types
	//-----------------------------------------------------------------------------

	/** @typedef {import("../shared/types.js").LintMessage} LintMessage */
	/** @typedef {import("../linter/vfile.js").VFile} VFile */
	/** @typedef {import("@eslint/core").Language} Language */
	/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */
	/** @typedef {import("eslint").Linter.Processor} Processor */

	//-----------------------------------------------------------------------------
	// Exports
	//-----------------------------------------------------------------------------

	/**
	 * The service that applies processors to files.
	 */
	class ProcessorService {
		/**
		 * Preprocesses the given file synchronously.
		 * @param {VFile} file The file to preprocess.
		 * @param {{processor:Processor}} config The configuration to use.
		 * @returns {{ok:boolean, files?: Array<VFile>, errors?: Array<LintMessage>}} An array of preprocessed files or errors.
		 * @throws {Error} If the preprocessor returns a promise.
		 */
		preprocessSync(file, config) {
			const { processor } = config;
			let blocks;

			try {
				blocks = processor.preprocess(file.rawBody, file.path);
			} catch (ex) {
				// If the message includes a leading line number, strip it:
				const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;

				return {
					ok: false,
					errors: [
						{
							ruleId: null,
							fatal: true,
							severity: 2,
							message,
							line: ex.lineNumber,
							column: ex.column,
							nodeType: null,
						},
					],
				};
			}

			if (typeof blocks.then === "function") {
				throw new Error("Unsupported: Preprocessor returned a promise.");
			}

			return {
				ok: true,
				files: blocks.map((block, i) => {
					// Legacy behavior: return the block as a string
					if (typeof block === "string") {
						return block;
					}

					const filePath = path.join(file.path, `${i}_${block.filename}`);

					return new VFile(filePath, block.text, {
						physicalPath: file.physicalPath,
					});
				}),
			};
		}

		/**
		 * Postprocesses the given messages synchronously.
		 * @param {VFile} file The file to postprocess.
		 * @param {LintMessage[][]} messages The messages to postprocess.
		 * @param {{processor:Processor}} config The configuration to use.
		 * @returns {LintMessage[]} The postprocessed messages.
		 */
		postprocessSync(file, messages, config) {
			const { processor } = config;

			return processor.postprocess(messages, file.path);
		}
	}

	processorService = { ProcessorService };
	return processorService;
}

/**
 * @fileoverview Utilities to operate on option objects.
 * @author Josh Goldberg
 */

var optionUtils;
var hasRequiredOptionUtils;

function requireOptionUtils () {
	if (hasRequiredOptionUtils) return optionUtils;
	hasRequiredOptionUtils = 1;

	/**
	 * Determines whether any of input's properties are different
	 * from values that already exist in original.
	 * @template T
	 * @param {Partial<T>} input New value.
	 * @param {T} original Original value.
	 * @returns {boolean} Whether input includes an explicit difference.
	 */
	function containsDifferentProperty(input, original) {
		if (input === original) {
			return false;
		}

		if (
			typeof input !== typeof original ||
			Array.isArray(input) !== Array.isArray(original)
		) {
			return true;
		}

		if (Array.isArray(input)) {
			return (
				input.length !== original.length ||
				input.some((value, i) =>
					containsDifferentProperty(value, original[i]),
				)
			);
		}

		if (typeof input === "object") {
			if (input === null || original === null) {
				return true;
			}

			const inputKeys = Object.keys(input);
			const originalKeys = Object.keys(original);

			return (
				inputKeys.length !== originalKeys.length ||
				inputKeys.some(
					inputKey =>
						!Object.hasOwn(original, inputKey) ||
						containsDifferentProperty(
							input[inputKey],
							original[inputKey],
						),
				)
			);
		}

		return true;
	}

	optionUtils = {
		containsDifferentProperty,
	};
	return optionUtils;
}

var linter;
var hasRequiredLinter;

function requireLinter () {
	if (hasRequiredLinter) return linter;
	hasRequiredLinter = 1;

	//------------------------------------------------------------------------------
	// Requirements
	//------------------------------------------------------------------------------

	const path = require$$0$1,
		eslintScope = requireEslintScope(),
		evk = requireEslintVisitorKeys$2(),
		espree = requireEspree(),
		merge = requireLodash_merge(),
		pkg = require$$5,
		{
			Legacy: {
				ConfigOps,
				ConfigValidator,
				environments: BuiltInEnvironments,
			},
		} = requireEslintrcUniversal(),
		Traverser = requireTraverser(),
		{ SourceCode } = requireSourceCode(),
		applyDisableDirectives = requireApplyDisableDirectives(),
		{ ConfigCommentParser } = requireCjs$2(),
		NodeEventGenerator = requireNodeEventGenerator(),
		createReportTranslator = requireReportTranslator(),
		Rules = requireRules(),
		createEmitter = requireSafeEmitter(),
		SourceCodeFixer = requireSourceCodeFixer(),
		timing = requireTiming(),
		ruleReplacements = require$$17;
	const { getRuleFromConfig } = requireFlatConfigHelpers();
	const { FlatConfigArray } = requireFlatConfigArray();
	const { startTime, endTime } = requireStats();
	const { RuleValidator } = requireRuleValidator();
	const { assertIsRuleSeverity } = requireFlatConfigSchema();
	const {
		normalizeSeverityToString,
		normalizeSeverityToNumber,
	} = requireSeverity();
	const { deepMergeArrays } = requireDeepMergeArrays();
	const jslang = requireJs();
	const {
		activeFlags,
		inactiveFlags,
		getInactivityReasonMessage,
	} = requireFlags();
	const debug = requireSrc()("eslint:linter");
	const MAX_AUTOFIX_PASSES = 10;
	const DEFAULT_PARSER_NAME = "espree";
	const DEFAULT_ECMA_VERSION = 5;
	const commentParser = new ConfigCommentParser();
	const DEFAULT_ERROR_LOC = {
		start: { line: 1, column: 0 },
		end: { line: 1, column: 1 },
	};
	const parserSymbol = Symbol.for("eslint.RuleTester.parser");
	const { LATEST_ECMA_VERSION } = requireEcmaVersion();
	const { VFile } = requireVfile();
	const { ParserService } = requireParserService();
	const { FileContext } = requireFileContext();
	const { ProcessorService } = requireProcessorService();
	const { containsDifferentProperty } = requireOptionUtils();
	const STEP_KIND_VISIT = 1;
	const STEP_KIND_CALL = 2;

	//------------------------------------------------------------------------------
	// Typedefs
	//------------------------------------------------------------------------------

	/** @typedef {import("../shared/types").ConfigData} ConfigData */
	/** @typedef {import("../shared/types").Environment} Environment */
	/** @typedef {import("../shared/types").GlobalConf} GlobalConf */
	/** @typedef {import("../shared/types").LintMessage} LintMessage */
	/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
	/** @typedef {import("../shared/types").ParserOptions} ParserOptions */
	/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */
	/** @typedef {import("../shared/types").Processor} Processor */
	/** @typedef {import("../shared/types").Rule} Rule */
	/** @typedef {import("../shared/types").Times} Times */
	/** @typedef {import("@eslint/core").Language} Language */
	/** @typedef {import("@eslint/core").RuleSeverity} RuleSeverity */
	/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */
	/** @typedef {import("../types").Linter.StringSeverity} StringSeverity */

	/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
	/**
	 * @template T
	 * @typedef {{ [P in keyof T]-?: T[P] }} Required
	 */
	/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */

	/**
	 * @typedef {Object} DisableDirective
	 * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type Type of directive
	 * @property {number} line The line number
	 * @property {number} column The column number
	 * @property {(string|null)} ruleId The rule ID
	 * @property {string} justification The justification of directive
	 */

	/**
	 * The private data for `Linter` instance.
	 * @typedef {Object} LinterInternalSlots
	 * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used.
	 * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used.
	 * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced.
	 * @property {Map<string, Parser>} parserMap The loaded parsers.
	 * @property {Times} times The times spent on applying a rule to a file (see `stats` option).
	 * @property {Rules} ruleMap The loaded rules.
	 */

	/**
	 * @typedef {Object} VerifyOptions
	 * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability
	 *      to change config once it is set. Defaults to true if not supplied.
	 *      Useful if you want to validate JS without comments overriding rules.
	 * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix`
	 *      properties into the lint result.
	 * @property {string} [filename] the filename of the source code.
	 * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for
	 *      unused `eslint-disable` directives.
	 * @property {Function} [ruleFilter] A predicate function that determines whether a given rule should run.
	 */

	/**
	 * @typedef {Object} ProcessorOptions
	 * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the
	 *      predicate function that selects adopt code blocks.
	 * @property {Processor.postprocess} [postprocess] postprocessor for report
	 *      messages. If provided, this should accept an array of the message lists
	 *      for each code block returned from the preprocessor, apply a mapping to
	 *      the messages as appropriate, and return a one-dimensional array of
	 *      messages.
	 * @property {Processor.preprocess} [preprocess] preprocessor for source text.
	 *      If provided, this should accept a string of source text, and return an
	 *      array of code blocks to lint.
	 */

	/**
	 * @typedef {Object} FixOptions
	 * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines
	 *      whether fixes should be applied.
	 */

	/**
	 * @typedef {Object} InternalOptions
	 * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments.
	 * @property {StringSeverity} reportUnusedDisableDirectives Severity to report unused disable directives, if not "off" (boolean values were normalized).
	 * @property {StringSeverity} reportUnusedInlineConfigs Severity to report unused inline configs, if not "off".
	 */

	//------------------------------------------------------------------------------
	// Helpers
	//------------------------------------------------------------------------------

	/**
	 * Determines if a given object is Espree.
	 * @param {Object} parser The parser to check.
	 * @returns {boolean} True if the parser is Espree or false if not.
	 */
	function isEspree(parser) {
		return !!(parser === espree || parser[parserSymbol] === espree);
	}

	/**
	 * Ensures that variables representing built-in properties of the Global Object,
	 * and any globals declared by special block comments, are present in the global
	 * scope.
	 * @param {Scope} globalScope The global scope.
	 * @param {Object} configGlobals The globals declared in configuration
	 * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration
	 * @returns {void}
	 */
	function addDeclaredGlobals(
		globalScope,
		configGlobals,
		{ exportedVariables, enabledGlobals },
	) {
		// Define configured global variables.
		for (const id of new Set([
			...Object.keys(configGlobals),
			...Object.keys(enabledGlobals),
		])) {
			/*
			 * `ConfigOps.normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would
			 * typically be caught when validating a config anyway (validity for inline global comments is checked separately).
			 */
			const configValue =
				configGlobals[id] === void 0
					? void 0
					: ConfigOps.normalizeConfigGlobal(configGlobals[id]);
			const commentValue = enabledGlobals[id] && enabledGlobals[id].value;
			const value = commentValue || configValue;
			const sourceComments =
				enabledGlobals[id] && enabledGlobals[id].comments;

			if (value === "off") {
				continue;
			}

			let variable = globalScope.set.get(id);

			if (!variable) {
				variable = new eslintScope.Variable(id, globalScope);

				globalScope.variables.push(variable);
				globalScope.set.set(id, variable);
			}

			variable.eslintImplicitGlobalSetting = configValue;
			variable.eslintExplicitGlobal = sourceComments !== void 0;
			variable.eslintExplicitGlobalComments = sourceComments;
			variable.writeable = value === "writable";
		}

		// mark all exported variables as such
		Object.keys(exportedVariables).forEach(name => {
			const variable = globalScope.set.get(name);

			if (variable) {
				variable.eslintUsed = true;
				variable.eslintExported = true;
			}
		});

		/*
		 * "through" contains all references which definitions cannot be found.
		 * Since we augment the global scope using configuration, we need to update
		 * references and remove the ones that were added by configuration.
		 */
		globalScope.through = globalScope.through.filter(reference => {
			const name = reference.identifier.name;
			const variable = globalScope.set.get(name);

			if (variable) {
				/*
				 * Links the variable and the reference.
				 * And this reference is removed from `Scope#through`.
				 */
				reference.resolved = variable;
				variable.references.push(reference);

				return false;
			}

			return true;
		});
	}

	/**
	 * creates a missing-rule message.
	 * @param {string} ruleId the ruleId to create
	 * @returns {string} created error message
	 * @private
	 */
	function createMissingRuleMessage(ruleId) {
		return Object.hasOwn(ruleReplacements.rules, ruleId)
			? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}`
			: `Definition for rule '${ruleId}' was not found.`;
	}

	/**
	 * Updates a given location based on the language offsets. This allows us to
	 * change 0-based locations to 1-based locations. We always want ESLint
	 * reporting lines and columns starting from 1.
	 * @param {Object} location The location to update.
	 * @param {number} location.line The starting line number.
	 * @param {number} location.column The starting column number.
	 * @param {number} [location.endLine] The ending line number.
	 * @param {number} [location.endColumn] The ending column number.
	 * @param {Language} language The language to use to adjust the location information.
	 * @returns {Object} The updated location.
	 */
	function updateLocationInformation(
		{ line, column, endLine, endColumn },
		language,
	) {
		const columnOffset = language.columnStart === 1 ? 0 : 1;
		const lineOffset = language.lineStart === 1 ? 0 : 1;

		// calculate separately to account for undefined
		const finalEndLine = endLine === void 0 ? endLine : endLine + lineOffset;
		const finalEndColumn =
			endColumn === void 0 ? endColumn : endColumn + columnOffset;

		return {
			line: line + lineOffset,
			column: column + columnOffset,
			endLine: finalEndLine,
			endColumn: finalEndColumn,
		};
	}

	/**
	 * creates a linting problem
	 * @param {Object} options to create linting error
	 * @param {string} [options.ruleId] the ruleId to report
	 * @param {Object} [options.loc] the loc to report
	 * @param {string} [options.message] the error message to report
	 * @param {RuleSeverity} [options.severity] the error message to report
	 * @param {Language} [options.language] the language to use to adjust the location information
	 * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId.
	 * @private
	 */
	function createLintingProblem(options) {
		const {
			ruleId = null,
			loc = DEFAULT_ERROR_LOC,
			message = createMissingRuleMessage(options.ruleId),
			severity = 2,

			// fallback for eslintrc mode
			language = {
				columnStart: 0,
				lineStart: 1,
			},
		} = options;

		return {
			ruleId,
			message,
			...updateLocationInformation(
				{
					line: loc.start.line,
					column: loc.start.column,
					endLine: loc.end.line,
					endColumn: loc.end.column,
				},
				language,
			),
			severity,
			nodeType: null,
		};
	}

	/**
	 * Wraps the value in an Array if it isn't already one.
	 * @template T
	 * @param {T|T[]} value Value to be wrapped.
	 * @returns {Array} The value as an array.
	 */
	function asArray(value) {
		return Array.isArray(value) ? value : [value];
	}

	/**
	 * Pushes a problem to inlineConfigProblems if ruleOptions are redundant.
	 * @param {ConfigData} config Provided config.
	 * @param {Object} loc A line/column location
	 * @param {Array} problems Problems that may be added to.
	 * @param {string} ruleId The rule ID.
	 * @param {Array} ruleOptions The rule options, merged with the config's.
	 * @param {Array} ruleOptionsInline The rule options from the comment.
	 * @param {"error"|"warn"} severity The severity to report.
	 * @returns {void}
	 */
	function addProblemIfSameSeverityAndOptions(
		config,
		loc,
		problems,
		ruleId,
		ruleOptions,
		ruleOptionsInline,
		severity,
	) {
		const existingConfigRaw = config.rules?.[ruleId];
		const existingConfig = existingConfigRaw
			? asArray(existingConfigRaw)
			: ["off"];
		const existingSeverity = normalizeSeverityToString(existingConfig[0]);
		const inlineSeverity = normalizeSeverityToString(ruleOptions[0]);
		const sameSeverity = existingSeverity === inlineSeverity;

		if (!sameSeverity) {
			return;
		}

		const alreadyConfigured = existingConfigRaw
			? `is already configured to '${existingSeverity}'`
			: "is not enabled so can't be turned off";
		let message;

		if (
			(existingConfig.length === 1 && ruleOptions.length === 1) ||
			existingSeverity === "off"
		) {
			message = `Unused inline config ('${ruleId}' ${alreadyConfigured}).`;
		} else if (
			!containsDifferentProperty(
				ruleOptions.slice(1),
				existingConfig.slice(1),
			)
		) {
			message =
				ruleOptionsInline.length === 1
					? `Unused inline config ('${ruleId}' ${alreadyConfigured}).`
					: `Unused inline config ('${ruleId}' ${alreadyConfigured} with the same options).`;
		}

		if (message) {
			problems.push(
				createLintingProblem({
					ruleId: null,
					message,
					loc,
					language: config.language,
					severity: normalizeSeverityToNumber(severity),
				}),
			);
		}
	}

	/**
	 * Creates a collection of disable directives from a comment
	 * @param {Object} options to create disable directives
	 * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment
	 * @param {string} options.value The value after the directive in the comment
	 * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`)
	 * @param {string} options.justification The justification of the directive
	 * @param {ASTNode|token} options.node The Comment node/token.
	 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
	 * @param {Language} language The language to use to adjust the location information.
	 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
	 * @returns {Object} Directives and problems from the comment
	 */
	function createDisableDirectives(
		{ type, value, justification, node },
		ruleMapper,
		language,
		sourceCode,
	) {
		const ruleIds = Object.keys(commentParser.parseListConfig(value));
		const directiveRules = ruleIds.length ? ruleIds : [null];
		const result = {
			directives: [], // valid disable directives
			directiveProblems: [], // problems in directives
		};
		const parentDirective = { node, value, ruleIds };

		for (const ruleId of directiveRules) {
			const loc = sourceCode.getLoc(node);

			// push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
			if (ruleId === null || !!ruleMapper(ruleId)) {
				if (type === "disable-next-line") {
					const { line, column } = updateLocationInformation(
						loc.end,
						language,
					);

					result.directives.push({
						parentDirective,
						type,
						line,
						column,
						ruleId,
						justification,
					});
				} else {
					const { line, column } = updateLocationInformation(
						loc.start,
						language,
					);

					result.directives.push({
						parentDirective,
						type,
						line,
						column,
						ruleId,
						justification,
					});
				}
			} else {
				result.directiveProblems.push(
					createLintingProblem({ ruleId, loc, language }),
				);
			}
		}
		return result;
	}

	/**
	 * Parses comments in file to extract file-specific config of rules, globals
	 * and environments and merges them with global config; also code blocks
	 * where reporting is disabled or enabled and merges them with reporting config.
	 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
	 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
	 * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from.
	 * @param {ConfigData} config Provided config.
	 * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: LintMessage[], disableDirectives: DisableDirective[]}}
	 * A collection of the directive comments that were found, along with any problems that occurred when parsing
	 */
	function getDirectiveComments(
		sourceCode,
		ruleMapper,
		warnInlineConfig,
		config,
	) {
		const configuredRules = {};
		const enabledGlobals = Object.create(null);
		const exportedVariables = {};
		const problems = [];
		const disableDirectives = [];
		const validator = new ConfigValidator({
			builtInRules: Rules,
		});

		sourceCode
			.getInlineConfigNodes()
			.filter(token => token.type !== "Shebang")
			.forEach(comment => {
				const directive = commentParser.parseDirective(comment.value);

				if (!directive) {
					return;
				}

				const {
					label,
					value,
					justification: justificationPart,
				} = directive;

				const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(
					label,
				);

				if (comment.type === "Line" && !lineCommentSupported) {
					return;
				}

				const loc = sourceCode.getLoc(comment);

				if (warnInlineConfig) {
					const kind =
						comment.type === "Block" ? `/*${label}*/` : `//${label}`;

					problems.push(
						createLintingProblem({
							ruleId: null,
							message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`,
							loc,
							severity: 1,
						}),
					);
					return;
				}

				if (
					label === "eslint-disable-line" &&
					loc.start.line !== loc.end.line
				) {
					const message = `${label} comment should not span multiple lines.`;

					problems.push(
						createLintingProblem({
							ruleId: null,
							message,
							loc,
						}),
					);
					return;
				}

				switch (label) {
					case "eslint-disable":
					case "eslint-enable":
					case "eslint-disable-next-line":
					case "eslint-disable-line": {
						const directiveType = label.slice("eslint-".length);
						const { directives, directiveProblems } =
							createDisableDirectives(
								{
									type: directiveType,
									value,
									justification: justificationPart,
									node: comment,
								},
								ruleMapper,
								jslang,
								sourceCode,
							);

						disableDirectives.push(...directives);
						problems.push(...directiveProblems);
						break;
					}

					case "exported":
						Object.assign(
							exportedVariables,
							commentParser.parseListConfig(value),
						);
						break;

					case "globals":
					case "global":
						for (const [id, idSetting] of Object.entries(
							commentParser.parseStringConfig(value),
						)) {
							let normalizedValue;

							try {
								normalizedValue =
									ConfigOps.normalizeConfigGlobal(idSetting);
							} catch (err) {
								problems.push(
									createLintingProblem({
										ruleId: null,
										loc,
										message: err.message,
									}),
								);
								continue;
							}

							if (enabledGlobals[id]) {
								enabledGlobals[id].comments.push(comment);
								enabledGlobals[id].value = normalizedValue;
							} else {
								enabledGlobals[id] = {
									comments: [comment],
									value: normalizedValue,
								};
							}
						}
						break;

					case "eslint": {
						const parseResult =
							commentParser.parseJSONLikeConfig(value);

						if (parseResult.ok) {
							Object.keys(parseResult.config).forEach(name => {
								const rule = ruleMapper(name);
								const ruleValue = parseResult.config[name];

								if (!rule) {
									problems.push(
										createLintingProblem({ ruleId: name, loc }),
									);
									return;
								}

								if (Object.hasOwn(configuredRules, name)) {
									problems.push(
										createLintingProblem({
											message: `Rule "${name}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
											loc,
										}),
									);
									return;
								}

								let ruleOptions = asArray(ruleValue);

								/*
								 * If the rule was already configured, inline rule configuration that
								 * only has severity should retain options from the config and just override the severity.
								 *
								 * Example:
								 *
								 *   {
								 *       rules: {
								 *           curly: ["error", "multi"]
								 *       }
								 *   }
								 *
								 *   /* eslint curly: ["warn"] * /
								 *
								 *   Results in:
								 *
								 *   curly: ["warn", "multi"]
								 */
								if (
									/*
									 * If inline config for the rule has only severity
									 */
									ruleOptions.length === 1 &&
									/*
									 * And the rule was already configured
									 */
									config.rules &&
									Object.hasOwn(config.rules, name)
								) {
									/*
									 * Then use severity from the inline config and options from the provided config
									 */
									ruleOptions = [
										ruleOptions[0], // severity from the inline config
										...asArray(config.rules[name]).slice(1), // options from the provided config
									];
								}

								try {
									validator.validateRuleOptions(
										rule,
										name,
										ruleOptions,
									);
								} catch (err) {
									/*
									 * If the rule has invalid `meta.schema`, throw the error because
									 * this is not an invalid inline configuration but an invalid rule.
									 */
									if (
										err.code ===
										"ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
									) {
										throw err;
									}

									problems.push(
										createLintingProblem({
											ruleId: name,
											message: err.message,
											loc,
										}),
									);

									// do not apply the config, if found invalid options.
									return;
								}

								configuredRules[name] = ruleOptions;
							});
						} else {
							const problem = createLintingProblem({
								ruleId: null,
								loc,
								message: parseResult.error.message,
							});

							problem.fatal = true;
							problems.push(problem);
						}

						break;
					}

					// no default
				}
			});

		return {
			configuredRules,
			enabledGlobals,
			exportedVariables,
			problems,
			disableDirectives,
		};
	}

	/**
	 * Parses comments in file to extract disable directives.
	 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
	 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
	 * @param {Language} language The language to use to adjust the location information
	 * @returns {{problems: LintMessage[], disableDirectives: DisableDirective[]}}
	 * A collection of the directive comments that were found, along with any problems that occurred when parsing
	 */
	function getDirectiveCommentsForFlatConfig(sourceCode, ruleMapper, language) {
		const disableDirectives = [];
		const problems = [];

		if (sourceCode.getDisableDirectives) {
			const { directives: directivesSources, problems: directivesProblems } =
				sourceCode.getDisableDirectives();

			problems.push(
				...directivesProblems.map(directiveProblem =>
					createLintingProblem({
						...directiveProblem,
						language,
					}),
				),
			);

			directivesSources.forEach(directive => {
				const { directives, directiveProblems } = createDisableDirectives(
					directive,
					ruleMapper,
					language,
					sourceCode,
				);

				disableDirectives.push(...directives);
				problems.push(...directiveProblems);
			});
		}

		return {
			problems,
			disableDirectives,
		};
	}

	/**
	 * Normalize ECMAScript version from the initial config
	 * @param {Parser} parser The parser which uses this options.
	 * @param {number} ecmaVersion ECMAScript version from the initial config
	 * @returns {number} normalized ECMAScript version
	 */
	function normalizeEcmaVersion(parser, ecmaVersion) {
		if (isEspree(parser)) {
			if (ecmaVersion === "latest") {
				return espree.latestEcmaVersion;
			}
		}

		/*
		 * Calculate ECMAScript edition number from official year version starting with
		 * ES2015, which corresponds with ES6 (or a difference of 2009).
		 */
		return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion;
	}

	/**
	 * Normalize ECMAScript version from the initial config into languageOptions (year)
	 * format.
	 * @param {any} [ecmaVersion] ECMAScript version from the initial config
	 * @returns {number} normalized ECMAScript version
	 */
	function normalizeEcmaVersionForLanguageOptions(ecmaVersion) {
		switch (ecmaVersion) {
			case 3:
				return 3;

			// void 0 = no ecmaVersion specified so use the default
			case 5:
			case void 0:
				return 5;

			default:
				if (typeof ecmaVersion === "number") {
					return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009;
				}
		}

		/*
		 * We default to the latest supported ecmaVersion for everything else.
		 * Remember, this is for languageOptions.ecmaVersion, which sets the version
		 * that is used for a number of processes inside of ESLint. It's normally
		 * safe to assume people want the latest unless otherwise specified.
		 */
		return LATEST_ECMA_VERSION;
	}

	const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)(?:\*\/|$)/gsu;

	/**
	 * Checks whether or not there is a comment which has "eslint-env *" in a given text.
	 * @param {string} text A source code text to check.
	 * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment.
	 */
	function findEslintEnv(text) {
		let match, retv;

		eslintEnvPattern.lastIndex = 0;

		while ((match = eslintEnvPattern.exec(text)) !== null) {
			if (match[0].endsWith("*/")) {
				retv = Object.assign(
					retv || {},
					commentParser.parseListConfig(
						commentParser.parseDirective(match[0].slice(2, -2)).value,
					),
				);
			}
		}

		return retv;
	}

	/**
	 * Convert "/path/to/<text>" to "<text>".
	 * `CLIEngine#executeOnText()` method gives "/path/to/<text>" if the filename
	 * was omitted because `configArray.extractConfig()` requires an absolute path.
	 * But the linter should pass `<text>` to `RuleContext#filename` in that
	 * case.
	 * Also, code blocks can have their virtual filename. If the parent filename was
	 * `<text>`, the virtual filename is `<text>/0_foo.js` or something like (i.e.,
	 * it's not an absolute path).
	 * @param {string} filename The filename to normalize.
	 * @returns {string} The normalized filename.
	 */
	function normalizeFilename(filename) {
		const parts = filename.split(path.sep);
		const index = parts.lastIndexOf("<text>");

		return index === -1 ? filename : parts.slice(index).join(path.sep);
	}

	/**
	 * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a
	 * consistent shape.
	 * @param {VerifyOptions} providedOptions Options
	 * @param {ConfigData} config Config.
	 * @returns {Required<VerifyOptions> & InternalOptions} Normalized options
	 */
	function normalizeVerifyOptions(providedOptions, config) {
		const linterOptions = config.linterOptions || config;

		// .noInlineConfig for eslintrc, .linterOptions.noInlineConfig for flat
		const disableInlineConfig = linterOptions.noInlineConfig === true;
		const ignoreInlineConfig = providedOptions.allowInlineConfig === false;
		const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig
			? ` (${config.configNameOfNoInlineConfig})`
			: "";

		let reportUnusedDisableDirectives =
			providedOptions.reportUnusedDisableDirectives;

		if (typeof reportUnusedDisableDirectives === "boolean") {
			reportUnusedDisableDirectives = reportUnusedDisableDirectives
				? "error"
				: "off";
		}
		if (typeof reportUnusedDisableDirectives !== "string") {
			if (typeof linterOptions.reportUnusedDisableDirectives === "boolean") {
				reportUnusedDisableDirectives =
					linterOptions.reportUnusedDisableDirectives ? "warn" : "off";
			} else {
				reportUnusedDisableDirectives =
					linterOptions.reportUnusedDisableDirectives === void 0
						? "off"
						: normalizeSeverityToString(
								linterOptions.reportUnusedDisableDirectives,
							);
			}
		}

		const reportUnusedInlineConfigs =
			linterOptions.reportUnusedInlineConfigs === void 0
				? "off"
				: normalizeSeverityToString(
						linterOptions.reportUnusedInlineConfigs,
					);

		let ruleFilter = providedOptions.ruleFilter;

		if (typeof ruleFilter !== "function") {
			ruleFilter = () => true;
		}

		return {
			filename: normalizeFilename(providedOptions.filename || "<input>"),
			allowInlineConfig: !ignoreInlineConfig,
			warnInlineConfig:
				disableInlineConfig && !ignoreInlineConfig
					? `your config${configNameOfNoInlineConfig}`
					: null,
			reportUnusedDisableDirectives,
			reportUnusedInlineConfigs,
			disableFixes: Boolean(providedOptions.disableFixes),
			stats: providedOptions.stats,
			ruleFilter,
		};
	}

	/**
	 * Combines the provided parserOptions with the options from environments
	 * @param {Parser} parser The parser which uses this options.
	 * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config
	 * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments
	 * @returns {ParserOptions} Resulting parser options after merge
	 */
	function resolveParserOptions(parser, providedOptions, enabledEnvironments) {
		const parserOptionsFromEnv = enabledEnvironments
			.filter(env => env.parserOptions)
			.reduce(
				(parserOptions, env) => merge(parserOptions, env.parserOptions),
				{},
			);
		const mergedParserOptions = merge(
			parserOptionsFromEnv,
			providedOptions || {},
		);
		const isModule = mergedParserOptions.sourceType === "module";

		if (isModule) {
			/*
			 * can't have global return inside of modules
			 * TODO: espree validate parserOptions.globalReturn when sourceType is setting to module.(@aladdin-add)
			 */
			mergedParserOptions.ecmaFeatures = Object.assign(
				{},
				mergedParserOptions.ecmaFeatures,
				{ globalReturn: false },
			);
		}

		mergedParserOptions.ecmaVersion = normalizeEcmaVersion(
			parser,
			mergedParserOptions.ecmaVersion,
		);

		return mergedParserOptions;
	}

	/**
	 * Converts parserOptions to languageOptions for backwards compatibility with eslintrc.
	 * @param {ConfigData} config Config object.
	 * @param {Object} config.globals Global variable definitions.
	 * @param {Parser} config.parser The parser to use.
	 * @param {ParserOptions} config.parserOptions The parserOptions to use.
	 * @returns {LanguageOptions} The languageOptions equivalent.
	 */
	function createLanguageOptions({
		globals: configuredGlobals,
		parser,
		parserOptions,
	}) {
		const { ecmaVersion, sourceType } = parserOptions;

		return {
			globals: configuredGlobals,
			ecmaVersion: normalizeEcmaVersionForLanguageOptions(ecmaVersion),
			sourceType,
			parser,
			parserOptions,
		};
	}

	/**
	 * Combines the provided globals object with the globals from environments
	 * @param {Record<string, GlobalConf>} providedGlobals The 'globals' key in a config
	 * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments
	 * @returns {Record<string, GlobalConf>} The resolved globals object
	 */
	function resolveGlobals(providedGlobals, enabledEnvironments) {
		return Object.assign(
			Object.create(null),
			...enabledEnvironments
				.filter(env => env.globals)
				.map(env => env.globals),
			providedGlobals,
		);
	}

	/**
	 * Store time measurements in map
	 * @param {number} time Time measurement
	 * @param {Object} timeOpts Options relating which time was measured
	 * @param {WeakMap<Linter, LinterInternalSlots>} slots Linter internal slots map
	 * @returns {void}
	 */
	function storeTime(time, timeOpts, slots) {
		const { type, key } = timeOpts;

		if (!slots.times) {
			slots.times = { passes: [{}] };
		}

		const passIndex = slots.fixPasses;

		if (passIndex > slots.times.passes.length - 1) {
			slots.times.passes.push({});
		}

		if (key) {
			slots.times.passes[passIndex][type] ??= {};
			slots.times.passes[passIndex][type][key] ??= { total: 0 };
			slots.times.passes[passIndex][type][key].total += time;
		} else {
			slots.times.passes[passIndex][type] ??= { total: 0 };
			slots.times.passes[passIndex][type].total += time;
		}
	}

	/**
	 * Get the options for a rule (not including severity), if any
	 * @param {RuleConfig} ruleConfig rule configuration
	 * @param {Object|undefined} defaultOptions rule.meta.defaultOptions
	 * @returns {Array} of rule options, empty Array if none
	 */
	function getRuleOptions(ruleConfig, defaultOptions) {
		if (Array.isArray(ruleConfig)) {
			return deepMergeArrays(defaultOptions, ruleConfig.slice(1));
		}
		return defaultOptions ?? [];
	}

	/**
	 * Analyze scope of the given AST.
	 * @param {ASTNode} ast The `Program` node to analyze.
	 * @param {LanguageOptions} languageOptions The parser options.
	 * @param {Record<string, string[]>} visitorKeys The visitor keys.
	 * @returns {ScopeManager} The analysis result.
	 */
	function analyzeScope(ast, languageOptions, visitorKeys) {
		const parserOptions = languageOptions.parserOptions;
		const ecmaFeatures = parserOptions.ecmaFeatures || {};
		const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;

		return eslintScope.analyze(ast, {
			ignoreEval: true,
			nodejsScope: ecmaFeatures.globalReturn,
			impliedStrict: ecmaFeatures.impliedStrict,
			ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
			sourceType: languageOptions.sourceType || "script",
			childVisitorKeys: evk.KEYS,
			fallback: Traverser.getKeys,
		});
	}

	/**
	 * Runs a rule, and gets its listeners
	 * @param {Rule} rule A rule object
	 * @param {Context} ruleContext The context that should be passed to the rule
	 * @throws {TypeError} If `rule` is not an object with a `create` method
	 * @throws {any} Any error during the rule's `create`
	 * @returns {Object} A map of selector listeners provided by the rule
	 */
	function createRuleListeners(rule, ruleContext) {
		if (
			!rule ||
			typeof rule !== "object" ||
			typeof rule.create !== "function"
		) {
			throw new TypeError(
				`Error while loading rule '${ruleContext.id}': Rule must be an object with a \`create\` method`,
			);
		}

		try {
			return rule.create(ruleContext);
		} catch (ex) {
			ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`;
			throw ex;
		}
	}

	/**
	 * Runs the given rules on the given SourceCode object
	 * @param {SourceCode} sourceCode A SourceCode object for the given text
	 * @param {Object} configuredRules The rules configuration
	 * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules
	 * @param {string | undefined} parserName The name of the parser in the config
	 * @param {Language} language The language object used for parsing.
	 * @param {LanguageOptions} languageOptions The options for parsing the code.
	 * @param {Object} settings The settings that were enabled in the config
	 * @param {string} filename The reported filename of the code
	 * @param {boolean} applyDefaultOptions If true, apply rules' meta.defaultOptions in computing their config options.
	 * @param {boolean} disableFixes If true, it doesn't make `fix` properties.
	 * @param {string | undefined} cwd cwd of the cli
	 * @param {string} physicalFilename The full path of the file on disk without any code block information
	 * @param {Function} ruleFilter A predicate function to filter which rules should be executed.
	 * @param {boolean} stats If true, stats are collected appended to the result
	 * @param {WeakMap<Linter, LinterInternalSlots>} slots InternalSlotsMap of linter
	 * @returns {LintMessage[]} An array of reported problems
	 * @throws {Error} If traversal into a node fails.
	 */
	function runRules(
		sourceCode,
		configuredRules,
		ruleMapper,
		parserName,
		language,
		languageOptions,
		settings,
		filename,
		applyDefaultOptions,
		disableFixes,
		cwd,
		physicalFilename,
		ruleFilter,
		stats,
		slots,
	) {
		const emitter = createEmitter();

		// must happen first to assign all node.parent properties
		const eventQueue = sourceCode.traverse();

		/*
		 * Create a frozen object with the ruleContext properties and methods that are shared by all rules.
		 * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the
		 * properties once for each rule.
		 */
		const sharedTraversalContext = new FileContext({
			cwd,
			filename,
			physicalFilename: physicalFilename || filename,
			sourceCode,
			parserOptions: {
				...languageOptions.parserOptions,
			},
			parserPath: parserName,
			languageOptions,
			settings,
		});

		const lintingProblems = [];

		Object.keys(configuredRules).forEach(ruleId => {
			const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]);

			// not load disabled rules
			if (severity === 0) {
				return;
			}

			if (ruleFilter && !ruleFilter({ ruleId, severity })) {
				return;
			}

			const rule = ruleMapper(ruleId);

			if (!rule) {
				lintingProblems.push(createLintingProblem({ ruleId, language }));
				return;
			}

			const messageIds = rule.meta && rule.meta.messages;
			let reportTranslator = null;
			const ruleContext = Object.freeze(
				Object.assign(Object.create(sharedTraversalContext), {
					id: ruleId,
					options: getRuleOptions(
						configuredRules[ruleId],
						applyDefaultOptions ? rule.meta?.defaultOptions : void 0,
					),
					report(...args) {
						/*
						 * Create a report translator lazily.
						 * In a vast majority of cases, any given rule reports zero errors on a given
						 * piece of code. Creating a translator lazily avoids the performance cost of
						 * creating a new translator function for each rule that usually doesn't get
						 * called.
						 *
						 * Using lazy report translators improves end-to-end performance by about 3%
						 * with Node 8.4.0.
						 */
						if (reportTranslator === null) {
							reportTranslator = createReportTranslator({
								ruleId,
								severity,
								sourceCode,
								messageIds,
								disableFixes,
								language,
							});
						}
						const problem = reportTranslator(...args);

						if (problem.fix && !(rule.meta && rule.meta.fixable)) {
							throw new Error(
								'Fixable rules must set the `meta.fixable` property to "code" or "whitespace".',
							);
						}
						if (
							problem.suggestions &&
							!(rule.meta && rule.meta.hasSuggestions === true)
						) {
							if (
								rule.meta &&
								rule.meta.docs &&
								typeof rule.meta.docs.suggestion !== "undefined"
							) {
								// Encourage migration from the former property name.
								throw new Error(
									"Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint.",
								);
							}
							throw new Error(
								"Rules with suggestions must set the `meta.hasSuggestions` property to `true`.",
							);
						}
						lintingProblems.push(problem);
					},
				}),
			);

			const ruleListenersReturn =
				timing.enabled || stats
					? timing.time(
							ruleId,
							createRuleListeners,
							stats,
						)(rule, ruleContext)
					: createRuleListeners(rule, ruleContext);

			const ruleListeners = stats
				? ruleListenersReturn.result
				: ruleListenersReturn;

			if (stats) {
				storeTime(
					ruleListenersReturn.tdiff,
					{ type: "rules", key: ruleId },
					slots,
				);
			}

			/**
			 * Include `ruleId` in error logs
			 * @param {Function} ruleListener A rule method that listens for a node.
			 * @returns {Function} ruleListener wrapped in error handler
			 */
			function addRuleErrorHandler(ruleListener) {
				return function ruleErrorHandler(...listenerArgs) {
					try {
						const ruleListenerReturn = ruleListener(...listenerArgs);

						const ruleListenerResult = stats
							? ruleListenerReturn.result
							: ruleListenerReturn;

						if (stats) {
							storeTime(
								ruleListenerReturn.tdiff,
								{ type: "rules", key: ruleId },
								slots,
							);
						}

						return ruleListenerResult;
					} catch (e) {
						e.ruleId = ruleId;
						throw e;
					}
				};
			}

			if (typeof ruleListeners === "undefined" || ruleListeners === null) {
				throw new Error(
					`The create() function for rule '${ruleId}' did not return an object.`,
				);
			}

			// add all the selectors from the rule as listeners
			Object.keys(ruleListeners).forEach(selector => {
				const ruleListener =
					timing.enabled || stats
						? timing.time(ruleId, ruleListeners[selector], stats)
						: ruleListeners[selector];

				emitter.on(selector, addRuleErrorHandler(ruleListener));
			});
		});

		const eventGenerator = new NodeEventGenerator(emitter, {
			visitorKeys: sourceCode.visitorKeys ?? language.visitorKeys,
			fallback: Traverser.getKeys,
			matchClass: language.matchesSelectorClass ?? (() => false),
			nodeTypeKey: language.nodeTypeKey,
		});

		for (const step of eventQueue) {
			switch (step.kind) {
				case STEP_KIND_VISIT: {
					try {
						if (step.phase === 1) {
							eventGenerator.enterNode(step.target);
						} else {
							eventGenerator.leaveNode(step.target);
						}
					} catch (err) {
						err.currentNode = step.target;
						throw err;
					}
					break;
				}

				case STEP_KIND_CALL: {
					emitter.emit(step.target, ...step.args);
					break;
				}

				default:
					throw new Error(
						`Invalid traversal step found: "${step.type}".`,
					);
			}
		}

		return lintingProblems;
	}

	/**
	 * Ensure the source code to be a string.
	 * @param {string|SourceCode} textOrSourceCode The text or source code object.
	 * @returns {string} The source code text.
	 */
	function ensureText(textOrSourceCode) {
		if (typeof textOrSourceCode === "object") {
			const { hasBOM, text } = textOrSourceCode;
			const bom = hasBOM ? "\uFEFF" : "";

			return bom + text;
		}

		return String(textOrSourceCode);
	}

	/**
	 * Get an environment.
	 * @param {LinterInternalSlots} slots The internal slots of Linter.
	 * @param {string} envId The environment ID to get.
	 * @returns {Environment|null} The environment.
	 */
	function getEnv(slots, envId) {
		return (
			(slots.lastConfigArray &&
				slots.lastConfigArray.pluginEnvironments.get(envId)) ||
			BuiltInEnvironments.get(envId) ||
			null
		);
	}

	/**
	 * Get a rule.
	 * @param {LinterInternalSlots} slots The internal slots of Linter.
	 * @param {string} ruleId The rule ID to get.
	 * @returns {Rule|null} The rule.
	 */
	function getRule(slots, ruleId) {
		return (
			(slots.lastConfigArray &&
				slots.lastConfigArray.pluginRules.get(ruleId)) ||
			slots.ruleMap.get(ruleId)
		);
	}

	/**
	 * Normalize the value of the cwd
	 * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined.
	 * @returns {string | undefined} normalized cwd
	 */
	function normalizeCwd(cwd) {
		if (cwd) {
			return cwd;
		}
		if (typeof browser$1$1 === "object") {
			return browser$1$1.cwd();
		}

		// It's more explicit to assign the undefined
		// eslint-disable-next-line no-undefined -- Consistently returning a value
		return undefined;
	}

	/**
	 * The map to store private data.
	 * @type {WeakMap<Linter, LinterInternalSlots>}
	 */
	const internalSlotsMap = new WeakMap();

	/**
	 * Throws an error when the given linter is in flat config mode.
	 * @param {Linter} linter The linter to check.
	 * @returns {void}
	 * @throws {Error} If the linter is in flat config mode.
	 */
	function assertEslintrcConfig(linter) {
		const { configType } = internalSlotsMap.get(linter);

		if (configType === "flat") {
			throw new Error(
				"This method cannot be used with flat config. Add your entries directly into the config array.",
			);
		}
	}

	//------------------------------------------------------------------------------
	// Public Interface
	//------------------------------------------------------------------------------

	/**
	 * Object that is responsible for verifying JavaScript text
	 * @name Linter
	 */
	class Linter {
		/**
		 * Initialize the Linter.
		 * @param {Object} [config] the config object
		 * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
		 * @param {Array<string>} [config.flags] the feature flags to enable.
		 * @param {"flat"|"eslintrc"} [config.configType="flat"] the type of config used.
		 */
		constructor({ cwd, configType = "flat", flags = [] } = {}) {
			const processedFlags = [];

			flags.forEach(flag => {
				if (inactiveFlags.has(flag)) {
					const inactiveFlagData = inactiveFlags.get(flag);
					const inactivityReason =
						getInactivityReasonMessage(inactiveFlagData);

					if (typeof inactiveFlagData.replacedBy === "undefined") {
						throw new Error(
							`The flag '${flag}' is inactive: ${inactivityReason}`,
						);
					}

					// if there's a replacement, enable it instead of original
					if (typeof inactiveFlagData.replacedBy === "string") {
						processedFlags.push(inactiveFlagData.replacedBy);
					}

					globalThis.process?.emitWarning?.(
						`The flag '${flag}' is inactive: ${inactivityReason}`,
						`ESLintInactiveFlag_${flag}`,
					);

					return;
				}

				if (!activeFlags.has(flag)) {
					throw new Error(`Unknown flag '${flag}'.`);
				}

				processedFlags.push(flag);
			});

			internalSlotsMap.set(this, {
				cwd: normalizeCwd(cwd),
				flags: processedFlags,
				lastConfigArray: null,
				lastSourceCode: null,
				lastSuppressedMessages: [],
				configType, // TODO: Remove after flat config conversion
				parserMap: new Map([["espree", espree]]),
				ruleMap: new Rules(),
			});

			this.version = pkg.version;
		}

		/**
		 * Getter for package version.
		 * @static
		 * @returns {string} The version from package.json.
		 */
		static get version() {
			return pkg.version;
		}

		/**
		 * Indicates if the given feature flag is enabled for this instance.
		 * @param {string} flag The feature flag to check.
		 * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
		 */
		hasFlag(flag) {
			return internalSlotsMap.get(this).flags.includes(flag);
		}

		/**
		 * Lint using eslintrc and without processors.
		 * @param {VFile} file The file to lint.
		 * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything.
		 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
		 * @throws {Error} If during rule execution.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
		 */
		#eslintrcVerifyWithoutProcessors(file, providedConfig, providedOptions) {
			const slots = internalSlotsMap.get(this);
			const config = providedConfig || {};
			const options = normalizeVerifyOptions(providedOptions, config);

			// Resolve parser.
			let parserName = DEFAULT_PARSER_NAME;
			let parser = espree;

			if (typeof config.parser === "object" && config.parser !== null) {
				parserName = config.parser.filePath;
				parser = config.parser.definition;
			} else if (typeof config.parser === "string") {
				if (!slots.parserMap.has(config.parser)) {
					return [
						{
							ruleId: null,
							fatal: true,
							severity: 2,
							message: `Configured parser '${config.parser}' was not found.`,
							line: 0,
							column: 0,
							nodeType: null,
						},
					];
				}
				parserName = config.parser;
				parser = slots.parserMap.get(config.parser);
			}

			// search and apply "eslint-env *".
			const envInFile =
				options.allowInlineConfig && !options.warnInlineConfig
					? findEslintEnv(file.body)
					: {};
			const resolvedEnvConfig = Object.assign(
				{ builtin: true },
				config.env,
				envInFile,
			);
			const enabledEnvs = Object.keys(resolvedEnvConfig)
				.filter(envName => resolvedEnvConfig[envName])
				.map(envName => getEnv(slots, envName))
				.filter(env => env);

			const parserOptions = resolveParserOptions(
				parser,
				config.parserOptions || {},
				enabledEnvs,
			);
			const configuredGlobals = resolveGlobals(
				config.globals || {},
				enabledEnvs,
			);
			const settings = config.settings || {};
			const languageOptions = createLanguageOptions({
				globals: config.globals,
				parser,
				parserOptions,
			});

			if (!slots.lastSourceCode) {
				let t;

				if (options.stats) {
					t = startTime();
				}

				const parserService = new ParserService();
				const parseResult = parserService.parseSync(file, {
					language: jslang,
					languageOptions,
				});

				if (options.stats) {
					const time = endTime(t);
					const timeOpts = { type: "parse" };

					storeTime(time, timeOpts, slots);
				}

				if (!parseResult.ok) {
					return parseResult.errors;
				}

				slots.lastSourceCode = parseResult.sourceCode;
			} else {
				/*
				 * If the given source code object as the first argument does not have scopeManager, analyze the scope.
				 * This is for backward compatibility (SourceCode is frozen so it cannot rebind).
				 */
				if (!slots.lastSourceCode.scopeManager) {
					slots.lastSourceCode = new SourceCode({
						text: slots.lastSourceCode.text,
						ast: slots.lastSourceCode.ast,
						hasBOM: slots.lastSourceCode.hasBOM,
						parserServices: slots.lastSourceCode.parserServices,
						visitorKeys: slots.lastSourceCode.visitorKeys,
						scopeManager: analyzeScope(
							slots.lastSourceCode.ast,
							languageOptions,
						),
					});
				}
			}

			const sourceCode = slots.lastSourceCode;
			const commentDirectives = options.allowInlineConfig
				? getDirectiveComments(
						sourceCode,
						ruleId => getRule(slots, ruleId),
						options.warnInlineConfig,
						config,
					)
				: {
						configuredRules: {},
						enabledGlobals: {},
						exportedVariables: {},
						problems: [],
						disableDirectives: [],
					};

			addDeclaredGlobals(
				sourceCode.scopeManager.scopes[0],
				configuredGlobals,
				{
					exportedVariables: commentDirectives.exportedVariables,
					enabledGlobals: commentDirectives.enabledGlobals,
				},
			);

			const configuredRules = Object.assign(
				{},
				config.rules,
				commentDirectives.configuredRules,
			);

			let lintingProblems;

			try {
				lintingProblems = runRules(
					sourceCode,
					configuredRules,
					ruleId => getRule(slots, ruleId),
					parserName,
					jslang,
					languageOptions,
					settings,
					options.filename,
					true,
					options.disableFixes,
					slots.cwd,
					providedOptions.physicalFilename,
					null,
					options.stats,
					slots,
				);
			} catch (err) {
				err.message += `\nOccurred while linting ${options.filename}`;
				debug("An error occurred while traversing");
				debug("Filename:", options.filename);
				if (err.currentNode) {
					const { line } = sourceCode.getLoc(err.currentNode).start;

					debug("Line:", line);
					err.message += `:${line}`;
				}
				debug("Parser Options:", parserOptions);
				debug("Parser Path:", parserName);
				debug("Settings:", settings);

				if (err.ruleId) {
					err.message += `\nRule: "${err.ruleId}"`;
				}

				throw err;
			}

			return applyDisableDirectives({
				language: jslang,
				sourceCode,
				directives: commentDirectives.disableDirectives,
				disableFixes: options.disableFixes,
				problems: lintingProblems
					.concat(commentDirectives.problems)
					.sort(
						(problemA, problemB) =>
							problemA.line - problemB.line ||
							problemA.column - problemB.column,
					),
				reportUnusedDisableDirectives:
					options.reportUnusedDisableDirectives,
			});
		}

		/**
		 * Same as linter.verify, except without support for processors.
		 * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
		 * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything.
		 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
		 * @throws {Error} If during rule execution.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
		 */
		_verifyWithoutProcessors(
			textOrSourceCode,
			providedConfig,
			providedOptions,
		) {
			const slots = internalSlotsMap.get(this);
			const filename = normalizeFilename(
				providedOptions.filename || "<input>",
			);
			let text;

			// evaluate arguments
			if (typeof textOrSourceCode === "string") {
				slots.lastSourceCode = null;
				text = textOrSourceCode;
			} else {
				slots.lastSourceCode = textOrSourceCode;
				text = textOrSourceCode.text;
			}

			const file = new VFile(filename, text, {
				physicalPath: providedOptions.physicalFilename,
			});

			return this.#eslintrcVerifyWithoutProcessors(
				file,
				providedConfig,
				providedOptions,
			);
		}

		/**
		 * Verifies the text against the rules specified by the second argument.
		 * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
		 * @param {ConfigData|ConfigArray} config An ESLintConfig instance to configure everything.
		 * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked.
		 *      If this is not set, the filename will default to '<input>' in the rule context. If
		 *      an object, then it has "filename", "allowInlineConfig", and some properties.
		 * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
		 */
		verify(textOrSourceCode, config, filenameOrOptions) {
			debug("Verify");

			const { configType, cwd } = internalSlotsMap.get(this);

			const options =
				typeof filenameOrOptions === "string"
					? { filename: filenameOrOptions }
					: filenameOrOptions || {};

			const configToUse = config ?? {};

			if (configType !== "eslintrc") {
				/*
				 * Because of how Webpack packages up the files, we can't
				 * compare directly to `FlatConfigArray` using `instanceof`
				 * because it's not the same `FlatConfigArray` as in the tests.
				 * So, we work around it by assuming an array is, in fact, a
				 * `FlatConfigArray` if it has a `getConfig()` method.
				 */
				let configArray = configToUse;

				if (
					!Array.isArray(configToUse) ||
					typeof configToUse.getConfig !== "function"
				) {
					configArray = new FlatConfigArray(configToUse, {
						basePath: cwd,
					});
					configArray.normalizeSync();
				}

				return this._distinguishSuppressedMessages(
					this._verifyWithFlatConfigArray(
						textOrSourceCode,
						configArray,
						options,
						true,
					),
				);
			}

			if (typeof configToUse.extractConfig === "function") {
				return this._distinguishSuppressedMessages(
					this._verifyWithConfigArray(
						textOrSourceCode,
						configToUse,
						options,
					),
				);
			}

			/*
			 * If we get to here, it means `config` is just an object rather
			 * than a config array so we can go right into linting.
			 */

			/*
			 * `Linter` doesn't support `overrides` property in configuration.
			 * So we cannot apply multiple processors.
			 */
			if (options.preprocess || options.postprocess) {
				return this._distinguishSuppressedMessages(
					this._verifyWithProcessor(
						textOrSourceCode,
						configToUse,
						options,
					),
				);
			}
			return this._distinguishSuppressedMessages(
				this._verifyWithoutProcessors(
					textOrSourceCode,
					configToUse,
					options,
				),
			);
		}

		/**
		 * Verify with a processor.
		 * @param {string|SourceCode} textOrSourceCode The source code.
		 * @param {FlatConfig} config The config array.
		 * @param {VerifyOptions&ProcessorOptions} options The options.
		 * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
		 */
		_verifyWithFlatConfigArrayAndProcessor(
			textOrSourceCode,
			config,
			options,
			configForRecursive,
		) {
			const slots = internalSlotsMap.get(this);
			const filename = options.filename || "<input>";
			const filenameToExpose = normalizeFilename(filename);
			const physicalFilename = options.physicalFilename || filenameToExpose;
			const text = ensureText(textOrSourceCode);
			const file = new VFile(filenameToExpose, text, {
				physicalPath: physicalFilename,
			});

			const preprocess = options.preprocess || (rawText => [rawText]);
			const postprocess =
				options.postprocess || (messagesList => messagesList.flat());

			const processorService = new ProcessorService();
			const preprocessResult = processorService.preprocessSync(file, {
				processor: {
					preprocess,
					postprocess,
				},
			});

			if (!preprocessResult.ok) {
				return preprocessResult.errors;
			}

			const filterCodeBlock =
				options.filterCodeBlock ||
				(blockFilename => blockFilename.endsWith(".js"));
			const originalExtname = path.extname(filename);
			const { files } = preprocessResult;

			const messageLists = files.map(block => {
				debug("A code block was found: %o", block.path || "(unnamed)");

				// Keep the legacy behavior.
				if (typeof block === "string") {
					return this._verifyWithFlatConfigArrayAndWithoutProcessors(
						block,
						config,
						options,
					);
				}

				// Skip this block if filtered.
				if (!filterCodeBlock(block.path, block.body)) {
					debug("This code block was skipped.");
					return [];
				}

				// Resolve configuration again if the file content or extension was changed.
				if (
					configForRecursive &&
					(text !== block.rawBody ||
						path.extname(block.path) !== originalExtname)
				) {
					debug(
						"Resolving configuration again because the file content or extension was changed.",
					);
					return this._verifyWithFlatConfigArray(
						block.rawBody,
						configForRecursive,
						{
							...options,
							filename: block.path,
							physicalFilename: block.physicalPath,
						},
					);
				}

				slots.lastSourceCode = null;

				// Does lint.
				return this.#flatVerifyWithoutProcessors(block, config, {
					...options,
					filename: block.path,
					physicalFilename: block.physicalPath,
				});
			});

			return processorService.postprocessSync(file, messageLists, {
				processor: {
					preprocess,
					postprocess,
				},
			});
		}

		/**
		 * Verify using flat config and without any processors.
		 * @param {VFile} file The file to lint.
		 * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything.
		 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
		 * @throws {Error} If during rule execution.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
		 */
		#flatVerifyWithoutProcessors(file, providedConfig, providedOptions) {
			const slots = internalSlotsMap.get(this);
			const config = providedConfig || {};
			const { settings = {}, languageOptions } = config;
			const options = normalizeVerifyOptions(providedOptions, config);

			if (!slots.lastSourceCode) {
				let t;

				if (options.stats) {
					t = startTime();
				}

				const parserService = new ParserService();
				const parseResult = parserService.parseSync(file, config);

				if (options.stats) {
					const time = endTime(t);

					storeTime(time, { type: "parse" }, slots);
				}

				if (!parseResult.ok) {
					return parseResult.errors;
				}

				slots.lastSourceCode = parseResult.sourceCode;
			} else {
				/*
				 * If the given source code object as the first argument does not have scopeManager, analyze the scope.
				 * This is for backward compatibility (SourceCode is frozen so it cannot rebind).
				 *
				 * We check explicitly for `null` to ensure that this is a JS-flavored language.
				 * For non-JS languages we don't want to do this.
				 *
				 * TODO: Remove this check when we stop exporting the `SourceCode` object.
				 */
				if (slots.lastSourceCode.scopeManager === null) {
					slots.lastSourceCode = new SourceCode({
						text: slots.lastSourceCode.text,
						ast: slots.lastSourceCode.ast,
						hasBOM: slots.lastSourceCode.hasBOM,
						parserServices: slots.lastSourceCode.parserServices,
						visitorKeys: slots.lastSourceCode.visitorKeys,
						scopeManager: analyzeScope(
							slots.lastSourceCode.ast,
							languageOptions,
						),
					});
				}
			}

			const sourceCode = slots.lastSourceCode;

			/*
			 * Make adjustments based on the language options. For JavaScript,
			 * this is primarily about adding variables into the global scope
			 * to account for ecmaVersion and configured globals.
			 */
			sourceCode.applyLanguageOptions?.(languageOptions);

			const mergedInlineConfig = {
				rules: {},
			};
			const inlineConfigProblems = [];

			/*
			 * Inline config can be either enabled or disabled. If disabled, it's possible
			 * to detect the inline config and emit a warning (though this is not required).
			 * So we first check to see if inline config is allowed at all, and if so, we
			 * need to check if it's a warning or not.
			 */
			if (options.allowInlineConfig) {
				// if inline config should warn then add the warnings
				if (options.warnInlineConfig) {
					if (sourceCode.getInlineConfigNodes) {
						sourceCode.getInlineConfigNodes().forEach(node => {
							const loc = sourceCode.getLoc(node);
							const range = sourceCode.getRange(node);

							inlineConfigProblems.push(
								createLintingProblem({
									ruleId: null,
									message: `'${sourceCode.text.slice(range[0], range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`,
									loc,
									severity: 1,
									language: config.language,
								}),
							);
						});
					}
				} else {
					const inlineConfigResult = sourceCode.applyInlineConfig?.();

					if (inlineConfigResult) {
						inlineConfigProblems.push(
							...inlineConfigResult.problems
								.map(problem =>
									createLintingProblem({
										...problem,
										language: config.language,
									}),
								)
								.map(problem => {
									problem.fatal = true;
									return problem;
								}),
						);

						// next we need to verify information about the specified rules
						const ruleValidator = new RuleValidator();

						for (const {
							config: inlineConfig,
							loc,
						} of inlineConfigResult.configs) {
							Object.keys(inlineConfig.rules).forEach(ruleId => {
								const rule = getRuleFromConfig(ruleId, config);
								const ruleValue = inlineConfig.rules[ruleId];

								if (!rule) {
									inlineConfigProblems.push(
										createLintingProblem({
											ruleId,
											loc,
											language: config.language,
										}),
									);
									return;
								}

								if (
									Object.hasOwn(mergedInlineConfig.rules, ruleId)
								) {
									inlineConfigProblems.push(
										createLintingProblem({
											message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
											loc,
											language: config.language,
										}),
									);
									return;
								}

								try {
									const ruleOptionsInline = asArray(ruleValue);
									let ruleOptions = ruleOptionsInline;

									assertIsRuleSeverity(ruleId, ruleOptions[0]);

									/*
									 * If the rule was already configured, inline rule configuration that
									 * only has severity should retain options from the config and just override the severity.
									 *
									 * Example:
									 *
									 *   {
									 *       rules: {
									 *           curly: ["error", "multi"]
									 *       }
									 *   }
									 *
									 *   /* eslint curly: ["warn"] * /
									 *
									 *   Results in:
									 *
									 *   curly: ["warn", "multi"]
									 */

									let shouldValidateOptions = true;

									if (
										/*
										 * If inline config for the rule has only severity
										 */
										ruleOptions.length === 1 &&
										/*
										 * And the rule was already configured
										 */
										config.rules &&
										Object.hasOwn(config.rules, ruleId)
									) {
										/*
										 * Then use severity from the inline config and options from the provided config
										 */
										ruleOptions = [
											ruleOptions[0], // severity from the inline config
											...config.rules[ruleId].slice(1), // options from the provided config
										];

										// if the rule was enabled, the options have already been validated
										if (config.rules[ruleId][0] > 0) {
											shouldValidateOptions = false;
										}
									} else {
										/**
										 * Since we know the user provided options, apply defaults on top of them
										 */
										const slicedOptions = ruleOptions.slice(1);
										const mergedOptions = deepMergeArrays(
											rule.meta?.defaultOptions,
											slicedOptions,
										);

										if (mergedOptions.length) {
											ruleOptions = [
												ruleOptions[0],
												...mergedOptions,
											];
										}
									}

									if (
										options.reportUnusedInlineConfigs !== "off"
									) {
										addProblemIfSameSeverityAndOptions(
											config,
											loc,
											inlineConfigProblems,
											ruleId,
											ruleOptions,
											ruleOptionsInline,
											options.reportUnusedInlineConfigs,
										);
									}

									if (shouldValidateOptions) {
										ruleValidator.validate({
											plugins: config.plugins,
											rules: {
												[ruleId]: ruleOptions,
											},
										});
									}

									mergedInlineConfig.rules[ruleId] = ruleOptions;
								} catch (err) {
									/*
									 * If the rule has invalid `meta.schema`, throw the error because
									 * this is not an invalid inline configuration but an invalid rule.
									 */
									if (
										err.code ===
										"ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
									) {
										throw err;
									}

									let baseMessage = err.message
										.slice(
											err.message.startsWith('Key "rules":')
												? err.message.indexOf(":", 12) + 1
												: err.message.indexOf(":") + 1,
										)
										.trim();

									if (err.messageTemplate) {
										baseMessage += ` You passed "${ruleValue}".`;
									}

									inlineConfigProblems.push(
										createLintingProblem({
											ruleId,
											message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`,
											loc,
											language: config.language,
										}),
									);
								}
							});
						}
					}
				}
			}

			const commentDirectives =
				options.allowInlineConfig && !options.warnInlineConfig
					? getDirectiveCommentsForFlatConfig(
							sourceCode,
							ruleId => getRuleFromConfig(ruleId, config),
							config.language,
						)
					: { problems: [], disableDirectives: [] };

			const configuredRules = Object.assign(
				{},
				config.rules,
				mergedInlineConfig.rules,
			);

			let lintingProblems;

			sourceCode.finalize?.();

			try {
				lintingProblems = runRules(
					sourceCode,
					configuredRules,
					ruleId => getRuleFromConfig(ruleId, config),
					void 0,
					config.language,
					languageOptions,
					settings,
					options.filename,
					false,
					options.disableFixes,
					slots.cwd,
					providedOptions.physicalFilename,
					options.ruleFilter,
					options.stats,
					slots,
				);
			} catch (err) {
				err.message += `\nOccurred while linting ${options.filename}`;
				debug("An error occurred while traversing");
				debug("Filename:", options.filename);
				if (err.currentNode) {
					const { line } = sourceCode.getLoc(err.currentNode).start;

					debug("Line:", line);
					err.message += `:${line}`;
				}
				debug("Parser Options:", languageOptions.parserOptions);

				// debug("Parser Path:", parserName);
				debug("Settings:", settings);

				if (err.ruleId) {
					err.message += `\nRule: "${err.ruleId}"`;
				}

				throw err;
			}

			return applyDisableDirectives({
				language: config.language,
				sourceCode,
				directives: commentDirectives.disableDirectives,
				disableFixes: options.disableFixes,
				problems: lintingProblems
					.concat(commentDirectives.problems)
					.concat(inlineConfigProblems)
					.sort(
						(problemA, problemB) =>
							problemA.line - problemB.line ||
							problemA.column - problemB.column,
					),
				reportUnusedDisableDirectives:
					options.reportUnusedDisableDirectives,
				ruleFilter: options.ruleFilter,
				configuredRules,
			});
		}

		/**
		 * Same as linter.verify, except without support for processors.
		 * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
		 * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything.
		 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
		 * @throws {Error} If during rule execution.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
		 */
		_verifyWithFlatConfigArrayAndWithoutProcessors(
			textOrSourceCode,
			providedConfig,
			providedOptions,
		) {
			const slots = internalSlotsMap.get(this);
			const filename = normalizeFilename(
				providedOptions.filename || "<input>",
			);
			let text;

			// evaluate arguments
			if (typeof textOrSourceCode === "string") {
				slots.lastSourceCode = null;
				text = textOrSourceCode;
			} else {
				slots.lastSourceCode = textOrSourceCode;
				text = textOrSourceCode.text;
			}

			const file = new VFile(filename, text, {
				physicalPath: providedOptions.physicalFilename,
			});

			return this.#flatVerifyWithoutProcessors(
				file,
				providedConfig,
				providedOptions,
			);
		}

		/**
		 * Verify a given code with `ConfigArray`.
		 * @param {string|SourceCode} textOrSourceCode The source code.
		 * @param {ConfigArray} configArray The config array.
		 * @param {VerifyOptions&ProcessorOptions} options The options.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
		 */
		_verifyWithConfigArray(textOrSourceCode, configArray, options) {
			debug("With ConfigArray: %s", options.filename);

			// Store the config array in order to get plugin envs and rules later.
			internalSlotsMap.get(this).lastConfigArray = configArray;

			// Extract the final config for this file.
			const config = configArray.extractConfig(options.filename);
			const processor =
				config.processor &&
				configArray.pluginProcessors.get(config.processor);

			// Verify.
			if (processor) {
				debug("Apply the processor: %o", config.processor);
				const { preprocess, postprocess, supportsAutofix } = processor;
				const disableFixes = options.disableFixes || !supportsAutofix;

				return this._verifyWithProcessor(
					textOrSourceCode,
					config,
					{ ...options, disableFixes, postprocess, preprocess },
					configArray,
				);
			}
			return this._verifyWithoutProcessors(textOrSourceCode, config, options);
		}

		/**
		 * Verify a given code with a flat config.
		 * @param {string|SourceCode} textOrSourceCode The source code.
		 * @param {FlatConfigArray} configArray The config array.
		 * @param {VerifyOptions&ProcessorOptions} options The options.
		 * @param {boolean} [firstCall=false] Indicates if this is being called directly
		 *      from verify(). (TODO: Remove once eslintrc is removed.)
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
		 */
		_verifyWithFlatConfigArray(
			textOrSourceCode,
			configArray,
			options,
			firstCall = false,
		) {
			debug("With flat config: %s", options.filename);

			// we need a filename to match configs against
			const filename = options.filename || "__placeholder__.js";

			// Store the config array in order to get plugin envs and rules later.
			internalSlotsMap.get(this).lastConfigArray = configArray;
			const config = configArray.getConfig(filename);

			if (!config) {
				return [
					{
						ruleId: null,
						severity: 1,
						message: `No matching configuration found for ${filename}.`,
						line: 0,
						column: 0,
						nodeType: null,
					},
				];
			}

			// Verify.
			if (config.processor) {
				debug("Apply the processor: %o", config.processor);
				const { preprocess, postprocess, supportsAutofix } =
					config.processor;
				const disableFixes = options.disableFixes || !supportsAutofix;

				return this._verifyWithFlatConfigArrayAndProcessor(
					textOrSourceCode,
					config,
					{ ...options, filename, disableFixes, postprocess, preprocess },
					configArray,
				);
			}

			// check for options-based processing
			if (firstCall && (options.preprocess || options.postprocess)) {
				return this._verifyWithFlatConfigArrayAndProcessor(
					textOrSourceCode,
					config,
					options,
				);
			}

			return this._verifyWithFlatConfigArrayAndWithoutProcessors(
				textOrSourceCode,
				config,
				options,
			);
		}

		/**
		 * Verify with a processor.
		 * @param {string|SourceCode} textOrSourceCode The source code.
		 * @param {ConfigData|ExtractedConfig} config The config array.
		 * @param {VerifyOptions&ProcessorOptions} options The options.
		 * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
		 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
		 */
		_verifyWithProcessor(
			textOrSourceCode,
			config,
			options,
			configForRecursive,
		) {
			const slots = internalSlotsMap.get(this);
			const filename = options.filename || "<input>";
			const filenameToExpose = normalizeFilename(filename);
			const physicalFilename = options.physicalFilename || filenameToExpose;
			const text = ensureText(textOrSourceCode);
			const file = new VFile(filenameToExpose, text, {
				physicalPath: physicalFilename,
			});

			const preprocess = options.preprocess || (rawText => [rawText]);
			const postprocess =
				options.postprocess || (messagesList => messagesList.flat());

			const processorService = new ProcessorService();
			const preprocessResult = processorService.preprocessSync(file, {
				processor: {
					preprocess,
					postprocess,
				},
			});

			if (!preprocessResult.ok) {
				return preprocessResult.errors;
			}

			const filterCodeBlock =
				options.filterCodeBlock ||
				(blockFilePath => blockFilePath.endsWith(".js"));
			const originalExtname = path.extname(filename);

			const { files } = preprocessResult;

			const messageLists = files.map(block => {
				debug("A code block was found: %o", block.path ?? "(unnamed)");

				// Keep the legacy behavior.
				if (typeof block === "string") {
					return this._verifyWithoutProcessors(block, config, options);
				}

				// Skip this block if filtered.
				if (!filterCodeBlock(block.path, block.body)) {
					debug("This code block was skipped.");
					return [];
				}

				// Resolve configuration again if the file content or extension was changed.
				if (
					configForRecursive &&
					(text !== block.rawBody ||
						path.extname(block.path) !== originalExtname)
				) {
					debug(
						"Resolving configuration again because the file content or extension was changed.",
					);
					return this._verifyWithConfigArray(
						block.rawBody,
						configForRecursive,
						{
							...options,
							filename: block.path,
							physicalFilename: block.physicalPath,
						},
					);
				}

				slots.lastSourceCode = null;

				// Does lint.
				return this.#eslintrcVerifyWithoutProcessors(block, config, {
					...options,
					filename: block.path,
					physicalFilename: block.physicalPath,
				});
			});

			return processorService.postprocessSync(file, messageLists, {
				processor: {
					preprocess,
					postprocess,
				},
			});
		}

		/**
		 * Given a list of reported problems, distinguish problems between normal messages and suppressed messages.
		 * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages.
		 * @param {Array<LintMessage|SuppressedLintMessage>} problems A list of reported problems.
		 * @returns {LintMessage[]} A list of LintMessage.
		 */
		_distinguishSuppressedMessages(problems) {
			const messages = [];
			const suppressedMessages = [];
			const slots = internalSlotsMap.get(this);

			for (const problem of problems) {
				if (problem.suppressions) {
					suppressedMessages.push(problem);
				} else {
					messages.push(problem);
				}
			}

			slots.lastSuppressedMessages = suppressedMessages;

			return messages;
		}

		/**
		 * Gets the SourceCode object representing the parsed source.
		 * @returns {SourceCode} The SourceCode object.
		 */
		getSourceCode() {
			return internalSlotsMap.get(this).lastSourceCode;
		}

		/**
		 * Gets the times spent on (parsing, fixing, linting) a file.
		 * @returns {LintTimes} The times.
		 */
		getTimes() {
			return internalSlotsMap.get(this).times ?? { passes: [] };
		}

		/**
		 * Gets the number of autofix passes that were made in the last run.
		 * @returns {number} The number of autofix passes.
		 */
		getFixPassCount() {
			return internalSlotsMap.get(this).fixPasses ?? 0;
		}

		/**
		 * Gets the list of SuppressedLintMessage produced in the last running.
		 * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage
		 */
		getSuppressedMessages() {
			return internalSlotsMap.get(this).lastSuppressedMessages;
		}

		/**
		 * Defines a new linting rule.
		 * @param {string} ruleId A unique rule identifier
		 * @param {Rule} rule A rule object
		 * @returns {void}
		 */
		defineRule(ruleId, rule) {
			assertEslintrcConfig(this);
			internalSlotsMap.get(this).ruleMap.define(ruleId, rule);
		}

		/**
		 * Defines many new linting rules.
		 * @param {Record<string, Rule>} rulesToDefine map from unique rule identifier to rule
		 * @returns {void}
		 */
		defineRules(rulesToDefine) {
			assertEslintrcConfig(this);
			Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => {
				this.defineRule(ruleId, rulesToDefine[ruleId]);
			});
		}

		/**
		 * Gets an object with all loaded rules.
		 * @returns {Map<string, Rule>} All loaded rules
		 */
		getRules() {
			assertEslintrcConfig(this);
			const { lastConfigArray, ruleMap } = internalSlotsMap.get(this);

			return new Map(
				(function* () {
					yield* ruleMap;

					if (lastConfigArray) {
						yield* lastConfigArray.pluginRules;
					}
				})(),
			);
		}

		/**
		 * Define a new parser module
		 * @param {string} parserId Name of the parser
		 * @param {Parser} parserModule The parser object
		 * @returns {void}
		 */
		defineParser(parserId, parserModule) {
			assertEslintrcConfig(this);
			internalSlotsMap.get(this).parserMap.set(parserId, parserModule);
		}

		/**
		 * Performs multiple autofix passes over the text until as many fixes as possible
		 * have been applied.
		 * @param {string} text The source text to apply fixes to.
		 * @param {ConfigData|ConfigArray|FlatConfigArray} config The ESLint config object to use.
		 * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use.
		 * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the
		 *      SourceCodeFixer.
		 */
		verifyAndFix(text, config, options) {
			let messages,
				fixedResult,
				fixed = false,
				passNumber = 0,
				currentText = text,
				secondPreviousText,
				previousText;
			const debugTextDescription =
				(options && options.filename) || `${text.slice(0, 10)}...`;
			const shouldFix =
				options && typeof options.fix !== "undefined" ? options.fix : true;
			const stats = options?.stats;

			/**
			 * This loop continues until one of the following is true:
			 *
			 * 1. No more fixes have been applied.
			 * 2. Ten passes have been made.
			 *
			 * That means anytime a fix is successfully applied, there will be another pass.
			 * Essentially, guaranteeing a minimum of two passes.
			 */
			const slots = internalSlotsMap.get(this);

			// Remove lint times from the last run.
			if (stats) {
				delete slots.times;
				slots.fixPasses = 0;
			}

			do {
				passNumber++;
				let tTotal;

				if (stats) {
					tTotal = startTime();
				}

				debug(
					`Linting code for ${debugTextDescription} (pass ${passNumber})`,
				);
				messages = this.verify(currentText, config, options);

				debug(
					`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`,
				);
				let t;

				if (stats) {
					t = startTime();
				}

				fixedResult = SourceCodeFixer.applyFixes(
					currentText,
					messages,
					shouldFix,
				);

				if (stats) {
					if (fixedResult.fixed) {
						const time = endTime(t);

						storeTime(time, { type: "fix" }, slots);
						slots.fixPasses++;
					} else {
						storeTime(0, { type: "fix" }, slots);
					}
				}

				/*
				 * stop if there are any syntax errors.
				 * 'fixedResult.output' is a empty string.
				 */
				if (messages.length === 1 && messages[0].fatal) {
					break;
				}

				// keep track if any fixes were ever applied - important for return value
				fixed = fixed || fixedResult.fixed;

				// update to use the fixed output instead of the original text
				secondPreviousText = previousText;
				previousText = currentText;
				currentText = fixedResult.output;

				if (stats) {
					tTotal = endTime(tTotal);
					const passIndex = slots.times.passes.length - 1;

					slots.times.passes[passIndex].total = tTotal;
				}

				// Stop if we've made a circular fix
				if (
					passNumber > 1 &&
					currentText.length === secondPreviousText.length &&
					currentText === secondPreviousText
				) {
					debug(
						`Circular fixes detected after pass ${passNumber}. Exiting fix loop.`,
					);
					globalThis?.process?.emitWarning?.(
						`Circular fixes detected while fixing ${options?.filename ?? "text"}. It is likely that you have conflicting rules in your configuration.`,
						"ESLintCircularFixesWarning",
					);
					break;
				}
			} while (fixedResult.fixed && passNumber < MAX_AUTOFIX_PASSES);

			/*
			 * If the last result had fixes, we need to lint again to be sure we have
			 * the most up-to-date information.
			 */
			if (fixedResult.fixed) {
				let tTotal;

				if (stats) {
					tTotal = startTime();
				}

				fixedResult.messages = this.verify(currentText, config, options);

				if (stats) {
					storeTime(0, { type: "fix" }, slots);
					slots.times.passes.at(-1).total = endTime(tTotal);
				}
			}

			// ensure the last result properly reflects if fixes were done
			fixedResult.fixed = fixed;
			fixedResult.output = currentText;

			return fixedResult;
		}
	}

	linter = {
		Linter,

		/**
		 * Get the internal slots of a given Linter instance for tests.
		 * @param {Linter} instance The Linter instance to get.
		 * @returns {LinterInternalSlots} The internal slots.
		 */
		getLinterInternalSlots(instance) {
			return internalSlotsMap.get(instance);
		},
	};
	return linter;
}

function getLinter() {
	return requireLinter().Linter;
}

var Linter = eslintLinterBrowserify.Linter = getLinter();

export { Linter, eslintLinterBrowserify as default };
