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a,GAAW,EAAQ,WACtC,GAAI,EAAY,CACf,IAAI,EAAW,EAAM,MAAM,IAAI,OAAQ,IAAU,OAAO,cAAc,IAAO,KAAK,IAC9E,OAAO,UAAU,kBACpB,EAAW,EAAS,QAAQ,IAAK,MAE9B,OAAO,UAAU,cACpB,EAAW,EAAS,QAAQ,IAAK,KAE9B,OAAO,UAAU,aACpB,EAAW,EAAS,QAAQ,IAAK,KAElC,EAAW,EACZ,CAEA,OAAO,SAAS,IAGjB,OAAO,QAAU","file":"/npm/regexpu-core@6.5.5/rewrite-pattern.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.51.2.\n * Original file: /npm/regexpu-core@6.5.5/rewrite-pattern.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nconst generate = require('regjsgen').generate;\nconst parse = require('regjsparser').parse;\nconst regenerate = require('regenerate');\nconst unicodeMatchProperty = require('unicode-match-property-ecmascript');\nconst unicodeMatchPropertyValue = require('unicode-match-property-value-ecmascript');\nconst iuMappings = require('./data/iu-mappings.js');\nconst iBMPMappings = require('./data/i-bmp-mappings.js');\nconst iuFoldings = require('./data/iu-foldings.js');\nconst ESCAPE_SETS = require('./data/character-class-escape-sets.js');\nconst { UNICODE_SET, UNICODE_IV_SET } = require('./data/all-characters.js');\n\nfunction flatMap(array, callback) {\n\tconst result = [];\n\tarray.forEach(item => {\n\t\tconst res = callback(item);\n\t\tif (Array.isArray(res)) {\n\t\t\tresult.push.apply(result, res);\n\t\t} else {\n\t\t\tresult.push(res);\n\t\t}\n\t});\n\treturn result;\n}\n\n// https://tc39.es/ecma262/#prod-SyntaxCharacter\nconst SYNTAX_CHARS = /[\\\\^$.*+?()[\\]{}|]/g;\nconst SYNTAX_CODE_POINTS = new Set(Array.from('\\\\^$.*+?()[]{}|', (ch) => ch.codePointAt(0)));\n\nconst ASTRAL_SET = regenerate().addRange(0x10000, 0x10FFFF);\n\nconst NEWLINE_SET = regenerate().add(\n\t// `LineTerminator`s (https://mths.be/es6#sec-line-terminators):\n\t0x000A, // Line Feed <LF>\n\t0x000D, // Carriage Return <CR>\n\t0x2028, // Line Separator <LS>\n\t0x2029  // Paragraph Separator <PS>\n);\n\n// Prepare a Regenerate set containing all code points that are supposed to be\n// matched by `/./u`. https://mths.be/es6#sec-atom\nconst DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points\n\t.remove(NEWLINE_SET);\n\nconst getCharacterClassEscapeSet = (character, unicode, ignoreCase, shouldApplySCF) => {\n\tif (unicode) {\n\t\tif (ignoreCase) {\n\t\t\tconst result = ESCAPE_SETS.UNICODE_IGNORE_CASE.get(character);\n\t\t\tif (shouldApplySCF) {\n\t\t\t\treturn ESCAPE_SETS.UNICODESET_IGNORE_CASE.get(character);\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn ESCAPE_SETS.UNICODE.get(character);\n\t}\n\treturn ESCAPE_SETS.REGULAR.get(character);\n};\n\nconst getUnicodeDotSet = (dotAll) => {\n\treturn dotAll ? UNICODE_SET : DOT_SET_UNICODE;\n};\n\nconst getUnicodePropertyValueSet = (property, value) => {\n\tconst path = value ?\n\t\t`${ property }/${ value }` :\n\t\t`Binary_Property/${ property }`;\n\ttry {\n\t\treturn require(`regenerate-unicode-properties/${ path }.js`);\n\t} catch (exception) {\n\t\tthrow new Error(\n\t\t\t`Failed to recognize value \\`${ value }\\` for property ` +\n\t\t\t`\\`${ property }\\`.`\n\t\t);\n\t}\n};\n\nconst handleLoneUnicodePropertyNameOrValue = (value) => {\n\t// It could be a `General_Category` value or a binary property.\n\t// Note: `unicodeMatchPropertyValue` throws on invalid values.\n\ttry {\n\t\tconst property = 'General_Category';\n\t\tconst category = unicodeMatchPropertyValue(property, value);\n\t\treturn getUnicodePropertyValueSet(property, category);\n\t} catch (exception) {}\n\t// It’s not a `General_Category` value, so check if it’s a property\n\t// of strings.\n\ttry {\n\t\treturn getUnicodePropertyValueSet('Property_of_Strings', value);\n\t} catch (exception) {}\n\t// Lastly, check if it’s a binary property of single code points.\n\t// Note: `unicodeMatchProperty` throws on invalid properties.\n\tconst property = unicodeMatchProperty(value);\n\treturn getUnicodePropertyValueSet(property);\n};\n\nconst getUnicodePropertyEscapeSet = (value, isNegative, isUnicodeSetIgnoreCase) => {\n\tconst parts = value.split('=');\n\tconst firstPart = parts[0];\n\tlet set;\n\tif (parts.length == 1) {\n\t\tset = handleLoneUnicodePropertyNameOrValue(firstPart);\n\t} else {\n\t\t// The pattern consists of two parts, i.e. `Property=Value`.\n\t\tconst property = unicodeMatchProperty(firstPart);\n\t\tconst value = unicodeMatchPropertyValue(property, parts[1]);\n\t\tset = getUnicodePropertyValueSet(property, value);\n\t}\n\tif (isNegative) {\n\t\tif (set.strings) {\n\t\t\tthrow new Error('Cannot negate Unicode property of strings');\n\t\t}\n\t\treturn {\n\t\t\tcharacters: getCharacterComplementSet(set.characters, isUnicodeSetIgnoreCase),\n\t\t\tstrings: new Map()\n\t\t};\n\t}\n\treturn {\n\t\tcharacters: set.characters.clone(),\n\t\tstrings: set.strings ? getPropertyOfStringsEntries(set, isUnicodeSetIgnoreCase) : new Map()\n\t};\n};\n\n// The `longStrings` entries of each property of strings, which only depend on\n// the property's data and on whether the keys are case-folded, so that they\n// are computed once per property.\nconst PROPERTY_OF_STRINGS_ENTRIES = new WeakMap();\nconst PROPERTY_OF_STRINGS_ENTRIES_IGNORE_CASE = new WeakMap();\n\nconst getPropertyOfStringsEntries = (set, ignoreCase) => {\n\tconst cache = ignoreCase ? PROPERTY_OF_STRINGS_ENTRIES_IGNORE_CASE : PROPERTY_OF_STRINGS_ENTRIES;\n\tlet entries = cache.get(set);\n\tif (!entries) {\n\t\tentries = new Map();\n\t\tfor (const str of set.strings) {\n\t\t\tentries.set(getClassStringKey(Array.from(str, ch => ch.codePointAt(0)), ignoreCase), {\n\t\t\t\t// We need to escape strings like *️⃣ to make sure that they can be safely used in unions.\n\t\t\t\tsource: str.replace(SYNTAX_CHARS, '\\\\$&'),\n\t\t\t\tlength: str.length\n\t\t\t});\n\t\t}\n\t\tcache.set(set, entries);\n\t}\n\t// This is shared by all patterns, so it must not be modified: set operations\n\t// add the `longStrings` of their operands to their own map.\n\treturn entries;\n};\n\nconst getUnicodePropertyEscapeCharacterClassData = (property, isNegative, isUnicodeSetIgnoreCase, shouldApplySCF) => {\n\tconst set = getUnicodePropertyEscapeSet(property, isNegative, isUnicodeSetIgnoreCase);\n\tconst data = getCharacterClassEmptyData();\n\tconst singleChars = shouldApplySCF ? simpleCaseFoldingSet(set.characters) : set.characters;\n\tconst caseEqFlags = configGetCaseEqFlags();\n\tif (caseEqFlags) {\n\t\tsingleChars.add(getCaseEquivalentsOfSet(singleChars, caseEqFlags));\n\t}\n\tdata.singleChars = singleChars;\n\tif (set.strings.size > 0) {\n\t\tdata.longStrings = set.strings;\n\t\tdata.maybeIncludesStrings = true;\n\t}\n\treturn data;\n};\n\nconst CASE_EQ_FLAG_NONE = 0b00;\nconst CASE_EQ_FLAG_BMP = 0b01;\nconst CASE_EQ_FLAG_UNICODE = 0b10;\n\n// Code points for which getCaseEquivalents may return a non-empty list,\n// regardless of the flags.\nconst CASE_EQ_CANDIDATES = regenerate(Array.from(iuMappings.keys()), Array.from(iBMPMappings.keys()))\n\t.addRange(0x41, 0x5A)\n\t.addRange(0x61, 0x7A);\n\n// Returns the case equivalents of all code points in the given set. Only the\n// candidates are visited, instead of every code point of a (potentially huge) set.\nconst getCaseEquivalentsOfSet = (set, caseEqFlags) => {\n\tconst result = [];\n\tfor (const codePoint of set.clone().intersection(CASE_EQ_CANDIDATES).toArray()) {\n\t\tconst list = getCaseEquivalents(codePoint, caseEqFlags);\n\t\tif (list) result.push(...list);\n\t}\n\treturn result;\n};\n\nfunction configGetCaseEqFlags() {\n\tlet flags = CASE_EQ_FLAG_NONE;\n\tif (config.modifiersData.i === true) {\n\t\tif (config.transform.modifiers) {\n\t\t\tflags |= CASE_EQ_FLAG_BMP;\n\t\t\tif (config.flags.unicode || config.flags.unicodeSets) {\n\t\t\t\tflags |= CASE_EQ_FLAG_UNICODE;\n\t\t\t}\n\t\t}\n\t} else if (config.modifiersData.i === undefined) {\n\t\tif (config.transform.unicodeFlag && config.flags.ignoreCase) {\n\t\t\tflags |= CASE_EQ_FLAG_UNICODE;\n\t\t}\n\t}\n\treturn flags;\n}\n\nfunction configWordCharactersChanged() {\n\tif (!config.transform.modifiers || !config.useUnicodeFlag) {\n\t\treturn false;\n\t}\n\treturn config.isIgnoreCaseMode !== config.outputIgnoreCase;\n}\n\n// Ranges with fewer code points than this, e.g. `a-z`, are visited code point\n// by code point, which is faster than intersecting them with the candidates.\nconst SMALL_RANGE_SIZE = 32;\n\n// Returns the case equivalents of all code points in the given range.\nconst getCaseEquivalentsOfRange = (min, max, caseEqFlags) => {\n\tif (max - min >= SMALL_RANGE_SIZE) {\n\t\treturn getCaseEquivalentsOfSet(regenerate().addRange(min, max), caseEqFlags);\n\t}\n\tconst result = [];\n\tfor (let codePoint = min; codePoint <= max; codePoint++) {\n\t\tconst list = getCaseEquivalents(codePoint, caseEqFlags);\n\t\tif (list) result.push(...list);\n\t}\n\treturn result;\n};\n\n// Given a range of code points, add any case-equivalent code points in that range\n// to a set.\nregenerate.prototype.iuAddRange = function(min, max, caseEqFlags) {\n\treturn this.add(getCaseEquivalentsOfRange(min, max, caseEqFlags));\n};\nregenerate.prototype.iuRemoveRange = function(min, max, caseEqFlags) {\n\treturn this.remove(getCaseEquivalentsOfRange(min, max, caseEqFlags));\n};\n\nconst update = (item, pattern) => {\n\tlet tree = parse(pattern, config.useUnicodeFlag ? 'u' : '', {\n\t\tlookbehind: true,\n\t\tnamedGroups: true,\n\t\tunicodePropertyEscape: true,\n\t\tunicodeSet: true,\n\t\tmodifiers: true,\n\t});\n\tswitch (tree.type) {\n\t\tcase 'characterClass':\n\t\tcase 'group':\n\t\tcase 'value':\n\t\t\t// No wrapping needed.\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Wrap the pattern in a non-capturing group.\n\t\t\ttree = wrap(tree, pattern);\n\t}\n\tObject.assign(item, tree);\n};\n\nconst wrap = (tree, pattern) => {\n\t// Wrap the pattern in a non-capturing group.\n\treturn {\n\t\t'type': 'group',\n\t\t'behavior': 'ignore',\n\t\t'body': [tree],\n\t\t'raw': `(?:${ pattern })`\n\t};\n};\n\n/**\n * Given any codepoint ch, returns false or an array of characters,\n * such that for every c in the array,\n *   c != ch and Canonicalize(~, c) == Canonicalize(~, ch)\n *\n * where Canonicalize is defined in\n * https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch\n * @param {number} codePoint input code point\n * @param {number} flags bitwise flags composed of CASE_EQ_FLAG_*\n * @returns false | number[]\n */\nconst getCaseEquivalents = (codePoint, flags) => {\n\t// Most code points have no case equivalents, so look them up without\n\t// allocating any arrays.\n\tconst unicodeMapping = (flags & CASE_EQ_FLAG_UNICODE) ? iuMappings.get(codePoint) : undefined;\n\tconst bmpMapping = (flags & CASE_EQ_FLAG_BMP) ? getBMPCaseMapping(codePoint) : undefined;\n\tif (unicodeMapping === undefined) {\n\t\tif (bmpMapping === undefined) return false;\n\t\treturn typeof bmpMapping === 'number' ? [bmpMapping] : bmpMapping.slice();\n\t}\n\tconst result = typeof unicodeMapping === 'number' ? [unicodeMapping] : unicodeMapping.slice();\n\tif (flags & CASE_EQ_FLAG_BMP) {\n\t\t// Also add what the `u` flag equivalents are equivalent to without it.\n\t\tconst length = result.length;\n\t\tfor (let index = 0; index < length; index++) {\n\t\t\tconst mapping = getBMPCaseMapping(result[index]);\n\t\t\tif (mapping !== undefined) {\n\t\t\t\tpushMapping(result, mapping);\n\t\t\t}\n\t\t}\n\t\tif (bmpMapping !== undefined) {\n\t\t\tpushMapping(result, bmpMapping);\n\t\t}\n\t}\n\treturn result;\n};\n\n// Appends a mapping value, which is a code point or an array of code points.\nconst pushMapping = (array, mapping) => {\n\tif (typeof mapping === 'number') {\n\t\tarray.push(mapping);\n\t} else {\n\t\tarray.push(...mapping);\n\t}\n};\n\n// Returns the code point or code points that the given code point is case\n// equivalent to without the `u` flag, or `undefined` if there are none.\nconst getBMPCaseMapping = (codePoint) => {\n\t// Fast path for ASCII characters\n\tif (codePoint >= 0x41 && codePoint <= 0x5A) {\n\t\treturn codePoint + 0x20;\n\t}\n\tif (codePoint >= 0x61 && codePoint <= 0x7A) {\n\t\treturn codePoint - 0x20;\n\t}\n\treturn iBMPMappings.get(codePoint);\n};\n\n// https://tc39.es/ecma262/#sec-maybesimplecasefolding\nconst simpleCaseFolding = (codePoint) => {\n\t// Fast path for ASCII characters\n\tif (codePoint <= 0x7F) {\n\t\tif (codePoint >= 0x41 && codePoint <= 0x5A) {\n\t\t\treturn codePoint + 0x20;\n\t\t}\n\t\treturn codePoint;\n\t}\n\treturn iuFoldings.get(codePoint) || codePoint;\n}\n\n// Code points that simpleCaseFolding may map to a different code point.\nconst SCF_CANDIDATES = regenerate(Array.from(iuFoldings.keys())).addRange(0x41, 0x5A);\n\n// Returns a new set with simpleCaseFolding applied to every code point of the\n// given set. Only the candidates are visited, instead of every code point.\nconst simpleCaseFoldingSet = (set) => {\n\tconst candidates = set.clone().intersection(SCF_CANDIDATES).toArray();\n\t// Remove all candidates before adding the folded ones, so that a folded\n\t// code point that is also in the set is not removed again.\n\treturn set.clone().remove(candidates).add(candidates.map(simpleCaseFolding));\n};\n\n// Returns the complement of the given code points, i.e. of `[^...]` or\n// `\\P{...}`. With the `v` and `i` flags, the complement only contains code\n// points that are their own simple case folding, and the given code points are\n// case folded before they are removed\n// (see https://tc39.es/ecma262/#sec-charactercomplement).\nconst getCharacterComplementSet = (set, isUnicodeSetIgnoreCase) => {\n\treturn isUnicodeSetIgnoreCase\n\t\t? UNICODE_IV_SET.clone().remove(simpleCaseFoldingSet(set))\n\t\t: UNICODE_SET.clone().remove(set);\n};\n\n// How each kind of class combines its operands into its data. The first\n// operand of `&&` and `--` is added to the empty set with `union`, so only\n// `union` handles ranges, which cannot be operands of `&&` and `--`.\nconst SET_OPERATION_HANDLERS = {\n\tunion: {\n\t\tregSet: (data, set) => {\n\t\t\tdata.singleChars.add(set);\n\t\t},\n\t\trange: (data, start, end) => {\n\t\t\tdata.singleChars.addRange(start, end);\n\t\t},\n\t\tiuRange: (data, start, end, caseEqFlags) => {\n\t\t\tdata.singleChars.iuAddRange(start, end, caseEqFlags);\n\t\t},\n\t\tnested: (data, nestedData) => {\n\t\t\tdata.singleChars.add(nestedData.singleChars);\n\t\t\tnestedData.longStrings.forEach((value, key) => data.longStrings.set(key, value));\n\t\t\tif (nestedData.maybeIncludesStrings) data.maybeIncludesStrings = true;\n\t\t}\n\t},\n\tintersection: {\n\t\tregSet: (data, set) => {\n\t\t\tdata.singleChars.intersection(set);\n\t\t\tdata.longStrings.clear();\n\t\t\tdata.maybeIncludesStrings = false;\n\t\t},\n\t\tnested: (data, nestedData) => {\n\t\t\tdata.singleChars.intersection(nestedData.singleChars);\n\t\t\tfor (const key of data.longStrings.keys()) {\n\t\t\t\tif (!nestedData.longStrings.has(key)) data.longStrings.delete(key);\n\t\t\t}\n\t\t\tif (!nestedData.maybeIncludesStrings) data.maybeIncludesStrings = false;\n\t\t}\n\t},\n\tsubtraction: {\n\t\tregSet: (data, set) => {\n\t\t\tdata.singleChars.remove(set);\n\t\t},\n\t\tnested: (data, nestedData) => {\n\t\t\tdata.singleChars.remove(nestedData.singleChars);\n\t\t\tfor (const key of data.longStrings.keys()) {\n\t\t\t\tif (nestedData.longStrings.has(key)) data.longStrings.delete(key);\n\t\t\t}\n\t\t}\n\t}\n};\n\n// `A && [^B]` and `A -- [^B]` remove or keep the code points of `B`, which is\n// much faster than computing the complement of `B` first. Since `[^B]` never\n// contains strings, the strings of `A` are all removed or all kept.\nconst NEGATED_OPERAND_HANDLERS = {\n\tintersection: (data, nestedData) => {\n\t\tdata.singleChars.remove(nestedData.singleChars);\n\t\tdata.longStrings.clear();\n\t\tdata.maybeIncludesStrings = false;\n\t},\n\tsubtraction: (data, nestedData) => {\n\t\tdata.singleChars.intersection(nestedData.singleChars);\n\t}\n};\n\n// Returns the key that identifies a class string by the code points it matches.\n// The code points are not joined into a string, which would give a lone lead\n// surrogate followed by a lone trail surrogate, e.g. `\\uD83D\\u{DE00}`, the same\n// key as the astral code point they encode. With `ignoreCase`, the code points\n// are simple case folded, so that e.g. `ab` and `AB` get the same key.\nconst getClassStringKey = (codePoints, ignoreCase) =>\n\t(ignoreCase ? codePoints.map(simpleCaseFolding) : codePoints).join(',');\n\nconst getCharacterClassEmptyData = () => ({\n\ttransformed: config.transform.unicodeFlag,\n\tsingleChars: regenerate(),\n\t// Maps the key of each string (see `getClassStringKey`) to its pattern\n\t// `source` and its `length` in code units. Strings are compared by their\n\t// keys, since the same string can be spelled in different ways, e.g.\n\t// `\\q{ab}` and `\\q{\\x61b}`, and under the `i` flag in different cases.\n\tlongStrings: new Map(),\n\thasEmptyString: false,\n\tmaybeIncludesStrings: false\n});\n\nconst concatCaseEquivalents = (codePoint, caseEqFlags) => {\n\tconst caseEquivalents = getCaseEquivalents(codePoint, caseEqFlags);\n\tif (caseEquivalents) {\n\t\treturn [codePoint, ...caseEquivalents];\n\t}\n\treturn [codePoint];\n};\n\nconst isSurrogate = (codePoint) => codePoint >= 0xD800 && codePoint <= 0xDFFF;\n\n// Without the `u` flag, regenerate keeps a lone surrogate from matching half of\n// a surrogate pair: a lead surrogate is followed by `(?![\\uDC00-\\uDFFF])`, and\n// a trail surrogate is preceded by `(?:[^\\uD800-\\uDBFF]|^)`, which matches the\n// preceding character as well. In a class string, the character preceding a\n// trail surrogate is the previous code point of the string, so the guard is\n// left out there. If that code point is a lead surrogate, its lookahead fails.\nconst classStringCodePointToString = (set, codePoint, isFirst, regenerateOptions) =>\n\t!isFirst && !regenerateOptions.hasUnicodeFlag && codePoint >= 0xDC00 && codePoint <= 0xDFFF\n\t\t? set.toString({ bmpOnly: true })\n\t\t: set.toString(regenerateOptions);\n\nconst computeClassStrings = (classStrings, regenerateOptions, caseEqFlags, shouldApplySCF) => {\n\tlet data = getCharacterClassEmptyData();\n\n\tfor (const string of classStrings.strings) {\n\t\tif (string.characters.length === 1) {\n\t\t\tconst codePoint = shouldApplySCF ? simpleCaseFolding(string.characters[0].codePoint) : string.characters[0].codePoint\n\t\t\tconcatCaseEquivalents(codePoint, caseEqFlags).forEach((cp) => {\n\t\t\t\tdata.singleChars.add(cp);\n\t\t\t});\n\t\t} else {\n\t\t\tconst codePoints = [];\n\t\t\tlet stringifiedString = '';\n\t\t\tif (caseEqFlags) {\n\t\t\t\tfor (const ch of string.characters) {\n\t\t\t\t\tconst codePoint = shouldApplySCF ? simpleCaseFolding(ch.codePoint) : ch.codePoint;\n\t\t\t\t\tconst set = regenerate(concatCaseEquivalents(codePoint, caseEqFlags));\n\t\t\t\t\tstringifiedString += classStringCodePointToString(set, codePoint, codePoints.length === 0, regenerateOptions);\n\t\t\t\t\tcodePoints.push(codePoint);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const ch of string.characters) {\n\t\t\t\t\tconst codePoint = shouldApplySCF ? simpleCaseFolding(ch.codePoint) : ch.codePoint;\n\t\t\t\t\tif (!config.useUnicodeFlag && isSurrogate(codePoint)) {\n\t\t\t\t\t\t// However it's spelled, a lone surrogate needs a guard against\n\t\t\t\t\t\t// matching half of a surrogate pair.\n\t\t\t\t\t\tstringifiedString += classStringCodePointToString(regenerate(codePoint), codePoint, codePoints.length === 0, regenerateOptions);\n\t\t\t\t\t} else if (codePoint !== ch.codePoint) {\n\t\t\t\t\t\tstringifiedString += regenerate(codePoint).toString(regenerateOptions);\n\t\t\t\t\t} else if (ch.kind === 'symbol' && SYNTAX_CODE_POINTS.has(codePoint)) {\n\t\t\t\t\t\t// Characters such as `*` and `.` need no escaping in `\\q{}`, but\n\t\t\t\t\t\t// they do once the string is emitted outside of a class.\n\t\t\t\t\t\tstringifiedString += '\\\\' + generate(ch);\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tch.kind === 'identifier' ||\n\t\t\t\t\t\tch.kind === 'singleEscape' ||\n\t\t\t\t\t\t(ch.kind === 'unicodeCodePointEscape' && !config.useUnicodeFlag)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Escapes such as `\\&` and `\\-` are only valid in classes, `\\b`\n\t\t\t\t\t\t// only means U+0008 in classes, and `\\u{...}` needs the `u` flag,\n\t\t\t\t\t\t// so generate these from their code point instead.\n\t\t\t\t\t\tstringifiedString += regenerate(codePoint).toString(regenerateOptions);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstringifiedString += generate(ch);\n\t\t\t\t\t}\n\t\t\t\t\tcodePoints.push(codePoint);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdata.longStrings.set(getClassStringKey(codePoints, config.isIgnoreCaseMode), {\n\t\t\t\tsource: stringifiedString,\n\t\t\t\tlength: codePoints.reduce((length, codePoint) => length + (codePoint > 0xFFFF ? 2 : 1), 0)\n\t\t\t});\n\t\t\tdata.maybeIncludesStrings = true;\n\t\t}\n\t}\n\n\treturn data;\n}\n\n// Returns the data of the complement of the given nested class data, i.e. of\n// `[^...]`, which never contains strings: negating a class that may contain\n// strings throws when its data is computed.\nconst getCharacterClassComplementData = (nestedData, caseEqFlags) => {\n\tconst data = getCharacterClassEmptyData();\n\tdata.singleChars = getCharacterComplementSet(\n\t\tnestedData.singleChars,\n\t\tconfig.flags.unicodeSets && config.isIgnoreCaseMode\n\t);\n\tif (caseEqFlags) {\n\t\tdata.singleChars.add(getCaseEquivalentsOfSet(data.singleChars, caseEqFlags));\n\t}\n\treturn data;\n};\n\nconst computeCharacterClass = (characterClassItem, regenerateOptions, shouldApplySCF) => {\n\tlet data = getCharacterClassEmptyData();\n\n\tlet caseEqFlags = configGetCaseEqFlags();\n\n\tswitch (characterClassItem.kind) {\n\t\tcase 'union':\n\t\t\tbreak;\n\t\tcase 'intersection':\n\t\tcase 'subtraction':\n\t\t\tif (config.transform.unicodeSetsFlag) data.transformed = true;\n\t\t\tif (config.isIgnoreCaseMode) {\n\t\t\t\tshouldApplySCF = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t// reached. Code coverage tools should ignore it.\n\t\t/* node:coverage ignore next */\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown character class kind: ${ characterClassItem.kind }`);\n\t}\n\n\tfor (const [index, item] of characterClassItem.body.entries()) {\n\t\tconst handler = SET_OPERATION_HANDLERS[index === 0 ? 'union' : characterClassItem.kind];\n\t\tswitch (item.type) {\n\t\t\tcase 'value':\n\t\t\t\tconst codePoint = shouldApplySCF ? simpleCaseFolding(item.codePoint) : item.codePoint;\n\t\t\t\tconst list = concatCaseEquivalents(codePoint, caseEqFlags);\n\t\t\t\thandler.regSet(data, regenerate(list));\n\t\t\t\tif (list.length > 1) {\n\t\t\t\t\tdata.transformed = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassRange':\n\t\t\t\tconst min = item.min.codePoint;\n\t\t\t\tconst max = item.max.codePoint;\n\t\t\t\tif (shouldApplySCF) {\n\t\t\t\t\thandler.regSet(data, simpleCaseFoldingSet(regenerate().addRange(min, max)));\n\t\t\t\t} else {\n\t\t\t\t\thandler.range(data, min, max);\n\t\t\t\t}\n\t\t\t\tif (caseEqFlags) {\n\t\t\t\t\t// If shouldApplySCF is true, it is still ok to call iuRange because\n\t\t\t\t\t// the set [min, max] shares the same case equivalents with scf([min, max])\n\t\t\t\t\thandler.iuRange(data, min, max, caseEqFlags);\n\t\t\t\t\tdata.transformed = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassEscape':\n\t\t\t\thandler.regSet(data, getCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.flags.unicode || config.flags.unicodeSets,\n\t\t\t\t\tconfig.isIgnoreCaseMode,\n\t\t\t\t\t// When the `i` modifier is removed (`CASE_EQ_FLAG_BMP`), the other\n\t\t\t\t\t// operands include all their case equivalents, so the\n\t\t\t\t\t// case-insensitive escape set, which already includes them, is used\n\t\t\t\t\t// instead of its simple case folding.\n\t\t\t\t\tshouldApplySCF && !(caseEqFlags & CASE_EQ_FLAG_BMP)\n\t\t\t\t));\n\t\t\t\tif ((item.value === 'w' || item.value === 'W') && configWordCharactersChanged()) {\n\t\t\t\t\tdata.transformed = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'unicodePropertyEscape':\n\t\t\t\tconst nestedData = getUnicodePropertyEscapeCharacterClassData(\n\t\t\t\t\titem.value,\n\t\t\t\t\titem.negative,\n\t\t\t\t\tconfig.flags.unicodeSets && config.isIgnoreCaseMode,\n\t\t\t\t\tshouldApplySCF\n\t\t\t\t);\n\t\t\t\thandler.nested(data, nestedData);\n\t\t\t\tdata.transformed =\n\t\t\t\t\tdata.transformed ||\n\t\t\t\t\tconfig.transform.unicodePropertyEscapes ||\n\t\t\t\t\t(config.transform.unicodeSetsFlag && (nestedData.maybeIncludesStrings || characterClassItem.kind !== \"union\" || item.negative));\n\t\t\t\tbreak;\n\t\t\tcase 'characterClass':\n\t\t\t\tconst res = computeCharacterClass(item, regenerateOptions, shouldApplySCF);\n\t\t\t\tif (!item.negative) {\n\t\t\t\t\thandler.nested(data, res);\n\t\t\t\t} else if (index === 0 || characterClassItem.kind === 'union') {\n\t\t\t\t\thandler.nested(data, getCharacterClassComplementData(res, caseEqFlags));\n\t\t\t\t} else {\n\t\t\t\t\tNEGATED_OPERAND_HANDLERS[characterClassItem.kind](data, res);\n\t\t\t\t}\n\t\t\t\tdata.transformed = true;\n\t\t\t\tbreak;\n\t\t\tcase 'classStrings':\n\t\t\t\thandler.nested(data, computeClassStrings(item, regenerateOptions, caseEqFlags, shouldApplySCF));\n\t\t\t\tdata.transformed = true;\n\t\t\t\tbreak;\n\t\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t\t// reached. Code coverage tools should ignore it.\n\t\t\t/* node:coverage ignore next */\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t\t}\n\t}\n\n\tif (characterClassItem.negative && data.maybeIncludesStrings) {\n\t\tthrow new SyntaxError('Cannot negate set containing strings');\n\t}\n\n\treturn data;\n}\n\nconst processCharacterClass = (\n\tcharacterClassItem,\n\tregenerateOptions,\n\tcomputed = computeCharacterClass(characterClassItem, regenerateOptions)\n) => {\n\tconst negative = characterClassItem.negative;\n\tconst { singleChars, transformed, longStrings } = computed;\n\tif (transformed) {\n\t\tconst setStr = singleChars.toString(regenerateOptions);\n\n\t\tif (negative) {\n\t\t\tif (config.useUnicodeFlag) {\n\t\t\t\tupdate(characterClassItem, `[^${setStr[0] === '[' ? setStr.slice(1, -1) : setStr}]`)\n\t\t\t} else {\n\t\t\t\tif (config.flags.unicode || config.flags.unicodeSets) {\n\t\t\t\t\tif (config.flags.ignoreCase) {\n\t\t\t\t\t\tconst astralCharsSet = singleChars.clone().intersection(ASTRAL_SET);\n\t\t\t\t\t\t// Assumption: singleChars do not contain lone surrogates.\n\t\t\t\t\t\t// Regex like /[^\\ud800]/u is not supported\n\t\t\t\t\t\tconst surrogateOrBMPSetStr = singleChars\n\t\t\t\t\t\t\t.clone()\n\t\t\t\t\t\t\t.remove(astralCharsSet)\n\t\t\t\t\t\t\t.addRange(0xd800, 0xdfff)\n\t\t\t\t\t\t\t.toString({ bmpOnly: true });\n\t\t\t\t\t\t// Don't generate negative lookahead for astral characters\n\t\t\t\t\t\t// because the case folding is not working anyway as we break\n\t\t\t\t\t\t// code points into surrogate pairs.\n\t\t\t\t\t\tconst astralNegativeSetStr = ASTRAL_SET\n\t\t\t\t\t\t\t.clone()\n\t\t\t\t\t\t\t.remove(astralCharsSet)\n\t\t\t\t\t\t\t.toString(regenerateOptions);\n\t\t\t\t\t\t// The transform here does not support lone surrogates.\n\t\t\t\t\t\tupdate(\n\t\t\t\t\t\t\tcharacterClassItem,\n\t\t\t\t\t\t\t`(?!${surrogateOrBMPSetStr})[^]|${astralNegativeSetStr}`\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Generate negative set directly when case folding is not involved.\n\t\t\t\t\t\tconst negativeSet = UNICODE_SET.clone().remove(singleChars);\n\t\t\t\t\t\tupdate(characterClassItem, negativeSet.toString(regenerateOptions));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tupdate(characterClassItem, `(?!${setStr})[^]`);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst hasEmptyString = longStrings.has('');\n\t\t\tconst strings = Array.from(longStrings.values()).sort((a, b) => b.length - a.length);\n\t\t\tconst pieces = strings.map(string => string.source);\n\n\t\t\tif (setStr !== '[]' || longStrings.size === 0) {\n\t\t\t\tpieces.splice(pieces.length - (hasEmptyString ? 1 : 0), 0, setStr);\n\t\t\t}\n\n\t\t\tupdate(characterClassItem, pieces.join('|'));\n\t\t}\n\t}\n\treturn characterClassItem;\n};\n\nconst assertNoUnmatchedReferences = (groups) => {\n\tconst unmatchedReferencesNames = Object.keys(groups.unmatchedReferences);\n\tif (unmatchedReferencesNames.length > 0) {\n\t\tthrow new Error(`Unknown group names: ${unmatchedReferencesNames}`);\n\t}\n};\n\nconst processModifiers = (item, regenerateOptions, groups) => {\n\tconst enabling = item.modifierFlags.enabling;\n\tconst disabling = item.modifierFlags.disabling;\n\n\tconst oldData = Object.assign({}, config.modifiersData);\n\n\tfor (const flag of enabling) {\n\t\tconfig.modifiersData[flag] = true;\n\t}\n\tfor (const flag of disabling) {\n\t\tconfig.modifiersData[flag] = false;\n\t}\n\n\tif (config.transform.modifiers) {\n\t\tdelete item.modifierFlags;\n\t\titem.behavior = 'ignore';\n\t}\n\n\titem.body = item.body.map(term => {\n\t\treturn processTerm(term, regenerateOptions, groups);\n\t});\n\n\tconfig.modifiersData = oldData;\n\n\treturn item;\n}\n\nconst processTerm = (item, regenerateOptions, groups) => {\n\tswitch (item.type) {\n\t\tcase 'dot':\n\t\t\tif (config.transform.unicodeFlag) {\n\t\t\t\tupdate(\n\t\t\t\t\titem,\n\t\t\t\t\tgetUnicodeDotSet(config.isDotAllMode).toString(regenerateOptions)\n\t\t\t\t);\n\t\t\t} else if ((config.modifiersData.s != null ? config.modifiersData.s && config.transform.modifiers : config.transform.dotAllFlag)) {\n\t\t\t\t// TODO: consider changing this at the regenerate level.\n\t\t\t\tupdate(item, '[^]');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'characterClass':\n\t\t\titem = processCharacterClass(item, regenerateOptions);\n\t\t\tbreak;\n\t\tcase 'unicodePropertyEscape':\n\t\t\tconst data = getUnicodePropertyEscapeCharacterClassData(item.value, item.negative, config.flags.unicodeSets && config.isIgnoreCaseMode);\n\t\t\tif (data.maybeIncludesStrings) {\n\t\t\t\tif (!config.flags.unicodeSets) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Properties of strings are only supported when using the unicodeSets (v) flag.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (config.transform.unicodeSetsFlag) {\n\t\t\t\t\tdata.transformed = true;\n\t\t\t\t\titem = processCharacterClass(item, regenerateOptions, data);\n\t\t\t\t}\n\t\t\t} else if (config.transform.unicodePropertyEscapes || configGetCaseEqFlags()) {\n\t\t\t\tupdate(\n\t\t\t\t\titem,\n\t\t\t\t\tdata.singleChars.toString(regenerateOptions)\n\t\t\t\t);\n\t\t\t} else if (item.negative && config.transform.unicodeSetsFlag && config.isIgnoreCaseMode) {\n\t\t\t\t// With the `i` flag, `\\P{...}` matches the code points whose simple\n\t\t\t\t// case folding is not in the case folded property with the `v` flag,\n\t\t\t\t// but all code points that are not in the property with the `u` flag.\n\t\t\t\t// `[^\\p{...}]` matches the former with both flags.\n\t\t\t\tupdate(item, `[^\\\\p{${ item.value }}]`);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'characterClassEscape':\n\t\t\tif (\n\t\t\t\tconfig.transform.unicodeFlag ||\n\t\t\t\t((item.value === 'w' || item.value === 'W') && configWordCharactersChanged())\n\t\t\t) {\n\t\t\t\tupdate(\n\t\t\t\t\titem,\n\t\t\t\t\tgetCharacterClassEscapeSet(\n\t\t\t\t\t\titem.value,\n\t\t\t\t\t\t/* both conditions above imply config.flags.unicode or config.flags.unicodeSets */ true,\n\t\t\t\t\t\tconfig.isIgnoreCaseMode\n\t\t\t\t\t).toString(regenerateOptions)\n\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'group':\n\t\t\tif (item.behavior == 'normal') {\n\t\t\t\tgroups.lastIndex++;\n\t\t\t}\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\n\t\t\t\tif (groups.namesConflicts[name]) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Group '${ name }' has already been defined in this context.`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tgroups.namesConflicts[name] = true;\n\n\t\t\t\tif (config.transform.namedGroups) {\n\t\t\t\t\tdelete item.name;\n\t\t\t\t}\n\n\t\t\t\tconst index = groups.lastIndex;\n\t\t\t\tif (!groups.names[name]) {\n\t\t\t\t\tgroups.names[name] = [];\n\t\t\t\t}\n\t\t\t\tgroups.names[name].push(index);\n\n\t\t\t\tif (groups.onNamedGroup) {\n\t\t\t\t\tgroups.onNamedGroup.call(null, name, index);\n\t\t\t\t}\n\n\t\t\t\tif (groups.unmatchedReferences[name]) {\n\t\t\t\t\tdelete groups.unmatchedReferences[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (item.modifierFlags) {\n\t\t\t\treturn processModifiers(item, regenerateOptions, groups);\n\t\t\t}\n\t\t\t/* falls through */\n\t\tcase 'quantifier':\n\t\t\titem.body = item.body.map(term => {\n\t\t\t\treturn processTerm(term, regenerateOptions, groups);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'disjunction':\n\t\t\tconst outerNamesConflicts = groups.namesConflicts;\n\t\t\titem.body = item.body.map(term => {\n\t\t\t\tgroups.namesConflicts = Object.create(outerNamesConflicts);\n\t\t\t\treturn processTerm(term, regenerateOptions, groups);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'alternative':\n\t\t\titem.body = flatMap(item.body, term => {\n\t\t\t\tconst res = processTerm(term, regenerateOptions, groups);\n\t\t\t\t// Alternatives cannot contain alternatives; flatten them.\n\t\t\t\treturn res.type === 'alternative' ? res.body : res;\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\tconst codePoint = item.codePoint;\n\t\t\tconst caseEqFlags = configGetCaseEqFlags();\n\t\t\tconst list = concatCaseEquivalents(codePoint, caseEqFlags);\n\t\t\tif (list.length === 1 && item.kind === \"symbol\" && codePoint >= 0x20 && codePoint <= 0x7E) {\n\t\t\t\t// skip regenerate when it is a printable ASCII symbol\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst set = regenerate(list);\n\t\t\tupdate(item, set.toString(regenerateOptions));\n\t\t\tbreak;\n\t\tcase 'reference':\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\t\t\t\tconst indexes = groups.names[name];\n\t\t\t\tif (!indexes) {\n\t\t\t\t\tgroups.unmatchedReferences[name] = true;\n\t\t\t\t}\n\n\t\t\t\tif (config.transform.namedGroups) {\n\t\t\t\t\tif (indexes) {\n\t\t\t\t\t\tconst body = indexes.map(index => ({\n\t\t\t\t\t\t\t'type': 'reference',\n\t\t\t\t\t\t\t'matchIndex': index,\n\t\t\t\t\t\t\t'raw': '\\\\' + index,\n\t\t\t\t\t\t}));\n\t\t\t\t\t\tif (body.length === 1) {\n\t\t\t\t\t\t\treturn body[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t'type': 'alternative',\n\t\t\t\t\t\t\t'body': body,\n\t\t\t\t\t\t\t'raw': body.map(term => term.raw).join(''),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// This named reference comes before the group where it’s defined,\n\t\t\t\t\t// so it’s always an empty match.\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'type': 'group',\n\t\t\t\t\t\t'behavior': 'ignore',\n\t\t\t\t\t\t'body': [],\n\t\t\t\t\t\t'raw': '(?:)',\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'anchor':\n\t\t\tif (config.modifiersData.m && config.transform.modifiers) {\n\t\t\t\tif (item.kind == 'start') {\n\t\t\t\t\tupdate(item, `(?:^|(?<=${NEWLINE_SET.toString()}))`);\n\t\t\t\t} else if (item.kind == 'end') {\n\t\t\t\t\tupdate(item, `(?:$|(?=${NEWLINE_SET.toString()}))`);\n\t\t\t\t}\n\t\t\t}\n\t\tcase 'empty':\n\t\t\t// Nothing to do here.\n\t\t\tbreak;\n\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t// reached. Code coverage tools should ignore it.\n\t\t/* node:coverage ignore next */\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t}\n\treturn item;\n};\n\nconst config = {\n\t'flags': {\n\t\t'ignoreCase': false,\n\t\t'unicode': false,\n\t\t'unicodeSets': false,\n\t\t'dotAll': false,\n\t\t'multiline': false,\n\t},\n\t'transform': {\n\t\t'dotAllFlag': false,\n\t\t'unicodeFlag': false,\n\t\t'unicodeSetsFlag': false,\n\t\t'unicodePropertyEscapes': false,\n\t\t'namedGroups': false,\n\t\t'modifiers': false,\n\t},\n\t'modifiersData': {\n\t\t'i': undefined,\n\t\t's': undefined,\n\t\t'm': undefined,\n\t},\n\t// Whether the output regex has the `i` flag.\n\t'outputIgnoreCase': false,\n\tget useUnicodeFlag() {\n\t\treturn (this.flags.unicode || this.flags.unicodeSets) && !this.transform.unicodeFlag;\n\t},\n\tget isDotAllMode() {\n\t\treturn (this.modifiersData.s !== undefined ? this.modifiersData.s : this.flags.dotAll);\n\t},\n\tget isIgnoreCaseMode() {\n\t\treturn (this.modifiersData.i !== undefined ? this.modifiersData.i : this.flags.ignoreCase);\n\t}\n};\n\nconst validateOptions = (options) => {\n\tif (!options) return;\n\n\tfor (const key of Object.keys(options)) {\n\t\tconst value = options[key];\n\t\tswitch (key) {\n\t\t\tcase 'dotAllFlag':\n\t\t\tcase 'unicodeFlag':\n\t\t\tcase 'unicodePropertyEscapes':\n\t\t\tcase 'unicodeSetsFlag':\n\t\t\tcase 'namedGroups':\n\t\t\t\tif (value != null && value !== false && value !== 'transform') {\n\t\t\t\t\tthrow new Error(`.${key} must be false (default) or 'transform'.`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// todo: remove modifiers: 'parse' in regexpu-core v7\n\t\t\tcase 'modifiers':\n\t\t\t\tif (value != null && value !== false && value !== 'parse' && value !== 'transform') {\n\t\t\t\t\tthrow new Error(`.${key} must be false (default), 'parse' or 'transform'.`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'onNamedGroup':\n\t\t\tcase 'onNewFlags':\n\t\t\t\tif (value != null && typeof value !== 'function') {\n\t\t\t\t\tthrow new Error(`.${key} must be a function.`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`.${key} is not a valid regexpu-core option.`);\n\t\t}\n\t}\n};\n\nconst hasFlag = (flags, flag) => flags ? flags.includes(flag) : false;\nconst transform = (options, name) => options ? options[name] === 'transform' : false;\n\nconst rewritePattern = (pattern, flags, options) => {\n\tvalidateOptions(options);\n\n\tconfig.flags.unicode = hasFlag(flags, 'u');\n\tconfig.flags.unicodeSets = hasFlag(flags, 'v');\n\tconfig.flags.ignoreCase = hasFlag(flags, 'i');\n\tconfig.flags.dotAll = hasFlag(flags, 's');\n\tconfig.flags.multiline = hasFlag(flags, 'm');\n\n\tconfig.transform.dotAllFlag = config.flags.dotAll && transform(options, 'dotAllFlag');\n\tconfig.transform.unicodeFlag = (config.flags.unicode || config.flags.unicodeSets) && transform(options, 'unicodeFlag');\n\tconfig.transform.unicodeSetsFlag = config.flags.unicodeSets && transform(options, 'unicodeSetsFlag');\n\n\t// unicodeFlag: 'transform' implies unicodePropertyEscapes: 'transform'\n\tconfig.transform.unicodePropertyEscapes = (config.flags.unicode || config.flags.unicodeSets) && (\n\t\ttransform(options, 'unicodeFlag') || transform(options, 'unicodePropertyEscapes')\n\t);\n\tconfig.transform.namedGroups = transform(options, 'namedGroups');\n\tconfig.transform.modifiers = transform(options, 'modifiers');\n\n\tconfig.modifiersData.i = undefined;\n\tconfig.modifiersData.s = undefined;\n\tconfig.modifiersData.m = undefined;\n\n\tconst regjsparserFeatures = {\n\t\t// Enable every stable RegExp feature by default\n\t\t'modifiers': true,\n\t\t'unicodePropertyEscape': true,\n\t\t'unicodeSet': true,\n\t\t'namedGroups': true,\n\t\t'lookbehind': true,\n\t};\n\n\tconst regenerateOptions = {\n\t\t'hasUnicodeFlag': config.useUnicodeFlag,\n\t\t'bmpOnly': !config.flags.unicode && !config.flags.unicodeSets\n\t};\n\n\tconst groups = {\n\t\t'onNamedGroup': options && options.onNamedGroup,\n\t\t'lastIndex': 0,\n\t\t'names': Object.create(null), // { [name]: Array<index> }\n\t\t'namesConflicts': Object.create(null), // { [name]: true }\n\t\t'unmatchedReferences': Object.create(null) // { [name]: true }\n\t};\n\n\tconst tree = parse(pattern, flags, regjsparserFeatures);\n\n\tif (config.transform.modifiers) {\n\t\tif (/\\(\\?[a-z]*-[a-z]+:/.test(pattern)) {\n\t\t\t// the pattern _likely_ contain inline disabled modifiers\n\t\t\t// we need to traverse to make sure that they are actually modifiers and to collect them\n\t\t\tconst allDisabledModifiers = Object.create(null)\n\t\t\tconst itemStack = [tree];\n\t\t\tlet node;\n\t\t\twhile (node = itemStack.pop(), node != undefined) {\n\t\t\t\tif (Array.isArray(node)) {\n\t\t\t\t\tArray.prototype.push.apply(itemStack, node);\n\t\t\t\t} else if (typeof node == 'object' && node != null) {\n\t\t\t\t\tfor (const key of Object.keys(node)) {\n\t\t\t\t\t\tconst value = node[key];\n\t\t\t\t\t\tif (key == 'modifierFlags') {\n\t\t\t\t\t\t\tfor (const flag of value.disabling) {\n\t\t\t\t\t\t\t\tallDisabledModifiers[flag] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (typeof value == 'object' && value != null) {\n\t\t\t\t\t\t\titemStack.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (allDisabledModifiers.i) {\n\t\t\t\tconfig.modifiersData.i = config.flags.ignoreCase;\n\t\t\t}\n\t\t\tif (allDisabledModifiers.m) {\n\t\t\t\tconfig.modifiersData.m = config.flags.multiline;\n\t\t\t}\n\t\t\tif (allDisabledModifiers.s) {\n\t\t\t\tconfig.modifiersData.s = config.flags.dotAll;\n\t\t\t}\n\t\t}\n\t}\n\n\t// The `i` flag is removed from the output when the top-level case\n\t// sensitivity is handled by the transform (see `onNewFlags` below).\n\tconfig.outputIgnoreCase = config.flags.ignoreCase && !config.modifiersData.i;\n\n\t// Note: `processTerm` mutates `tree` and `groups`.\n\tprocessTerm(tree, regenerateOptions, groups);\n\tassertNoUnmatchedReferences(groups);\n\n\tconst onNewFlags = options && options.onNewFlags;\n\tif (onNewFlags) {\n\t\tlet newFlags = flags.split('').filter((flag) => !config.modifiersData[flag]).join('');\n\t\tif (config.transform.unicodeSetsFlag) {\n\t\t\tnewFlags = newFlags.replace('v', 'u');\n\t\t}\n\t\tif (config.transform.unicodeFlag) {\n\t\t\tnewFlags = newFlags.replace('u', '');\n\t\t}\n\t\tif (config.transform.dotAllFlag) {\n\t\t\tnewFlags = newFlags.replace('s', '');\n\t\t}\n\t\tonNewFlags(newFlags);\n\t}\n\n\treturn generate(tree);\n};\n\nmodule.exports = rewritePattern;\n"]}