/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __toBinary = /* @__PURE__ */ (() => { var table = new Uint8Array(128); for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i; return (base64) => { var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0); for (var i2 = 0, j = 0; i2 < n; ) { var c0 = table[base64.charCodeAt(i2++)], c1 = table[base64.charCodeAt(i2++)]; var c2 = table[base64.charCodeAt(i2++)], c3 = table[base64.charCodeAt(i2++)]; bytes[j++] = c0 << 2 | c1 >> 4; bytes[j++] = c1 << 4 | c2 >> 2; bytes[j++] = c2 << 6 | c3; } return bytes; }; })(); // node_modules/clean-css/lib/optimizer/level-0/optimize.js var require_optimize = __commonJS({ "node_modules/clean-css/lib/optimizer/level-0/optimize.js"(exports, module2) { function level0Optimize(tokens) { return tokens; } module2.exports = level0Optimize; } }); // node_modules/clean-css/lib/utils/natural-compare.js var require_natural_compare = __commonJS({ "node_modules/clean-css/lib/utils/natural-compare.js"(exports, module2) { var NUMBER_PATTERN = /([0-9]+)/; function naturalCompare(value1, value2) { var keys1 = ("" + value1).split(NUMBER_PATTERN).map(tryParseInt); var keys2 = ("" + value2).split(NUMBER_PATTERN).map(tryParseInt); var key1; var key2; var compareFirst = Math.min(keys1.length, keys2.length); var i, l; for (i = 0, l = compareFirst; i < l; i++) { key1 = keys1[i]; key2 = keys2[i]; if (key1 != key2) { return key1 > key2 ? 1 : -1; } } return keys1.length > keys2.length ? 1 : keys1.length == keys2.length ? 0 : -1; } function tryParseInt(value) { return "" + parseInt(value) == value ? parseInt(value) : value; } module2.exports = naturalCompare; } }); // node_modules/clean-css/lib/optimizer/level-1/sort-selectors.js var require_sort_selectors = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/sort-selectors.js"(exports, module2) { var naturalCompare = require_natural_compare(); function naturalSorter(scope1, scope2) { return naturalCompare(scope1[1], scope2[1]); } function standardSorter(scope1, scope2) { return scope1[1] > scope2[1] ? 1 : -1; } function sortSelectors(selectors, method) { switch (method) { case "natural": return selectors.sort(naturalSorter); case "standard": return selectors.sort(standardSorter); case "none": case false: return selectors; } } module2.exports = sortSelectors; } }); // node_modules/clean-css/lib/utils/override.js var require_override = __commonJS({ "node_modules/clean-css/lib/utils/override.js"(exports, module2) { function override(source1, source2) { var target = {}; var key1; var key2; var item; for (key1 in source1) { item = source1[key1]; if (Array.isArray(item)) { target[key1] = item.slice(0); } else if (typeof item == "object" && item !== null) { target[key1] = override(item, {}); } else { target[key1] = item; } } for (key2 in source2) { item = source2[key2]; if (key2 in target && Array.isArray(item)) { target[key2] = item.slice(0); } else if (key2 in target && typeof item == "object" && item !== null) { target[key2] = override(target[key2], item); } else { target[key2] = item; } } return target; } module2.exports = override; } }); // node_modules/clean-css/lib/options/format.js var require_format = __commonJS({ "node_modules/clean-css/lib/options/format.js"(exports, module2) { var systemLineBreak = require("os").EOL; var override = require_override(); var Breaks = { AfterAtRule: "afterAtRule", AfterBlockBegins: "afterBlockBegins", AfterBlockEnds: "afterBlockEnds", AfterComment: "afterComment", AfterProperty: "afterProperty", AfterRuleBegins: "afterRuleBegins", AfterRuleEnds: "afterRuleEnds", BeforeBlockEnds: "beforeBlockEnds", BetweenSelectors: "betweenSelectors" }; var BreakWith = { CarriageReturnLineFeed: "\r\n", LineFeed: "\n", System: systemLineBreak }; var IndentWith = { Space: " ", Tab: " " }; var Spaces = { AroundSelectorRelation: "aroundSelectorRelation", BeforeBlockBegins: "beforeBlockBegins", BeforeValue: "beforeValue" }; var DEFAULTS = { breaks: breaks(false), breakWith: BreakWith.System, indentBy: 0, indentWith: IndentWith.Space, spaces: spaces(false), wrapAt: false, semicolonAfterLastProperty: false }; var BEAUTIFY_ALIAS = "beautify"; var KEEP_BREAKS_ALIAS = "keep-breaks"; var OPTION_SEPARATOR = ";"; var OPTION_NAME_VALUE_SEPARATOR = ":"; var HASH_VALUES_OPTION_SEPARATOR = ","; var HASH_VALUES_NAME_VALUE_SEPARATOR = "="; var FALSE_KEYWORD_1 = "false"; var FALSE_KEYWORD_2 = "off"; var TRUE_KEYWORD_1 = "true"; var TRUE_KEYWORD_2 = "on"; function breaks(value) { var breakOptions = {}; breakOptions[Breaks.AfterAtRule] = value; breakOptions[Breaks.AfterBlockBegins] = value; breakOptions[Breaks.AfterBlockEnds] = value; breakOptions[Breaks.AfterComment] = value; breakOptions[Breaks.AfterProperty] = value; breakOptions[Breaks.AfterRuleBegins] = value; breakOptions[Breaks.AfterRuleEnds] = value; breakOptions[Breaks.BeforeBlockEnds] = value; breakOptions[Breaks.BetweenSelectors] = value; return breakOptions; } function spaces(value) { var spaceOptions = {}; spaceOptions[Spaces.AroundSelectorRelation] = value; spaceOptions[Spaces.BeforeBlockBegins] = value; spaceOptions[Spaces.BeforeValue] = value; return spaceOptions; } function formatFrom(source) { if (source === void 0 || source === false) { return false; } if (typeof source == "object" && "breakWith" in source) { source = override(source, { breakWith: mapBreakWith(source.breakWith) }); } if (typeof source == "object" && "indentBy" in source) { source = override(source, { indentBy: parseInt(source.indentBy) }); } if (typeof source == "object" && "indentWith" in source) { source = override(source, { indentWith: mapIndentWith(source.indentWith) }); } if (typeof source == "object") { return remapBreaks(override(DEFAULTS, source)); } if (typeof source == "string" && source == BEAUTIFY_ALIAS) { return remapBreaks(override(DEFAULTS, { breaks: breaks(true), indentBy: 2, spaces: spaces(true) })); } if (typeof source == "string" && source == KEEP_BREAKS_ALIAS) { return remapBreaks(override(DEFAULTS, { breaks: { afterAtRule: true, afterBlockBegins: true, afterBlockEnds: true, afterComment: true, afterRuleEnds: true, beforeBlockEnds: true } })); } if (typeof source == "string") { return remapBreaks(override(DEFAULTS, toHash(source))); } return DEFAULTS; } function toHash(string) { return string.split(OPTION_SEPARATOR).reduce(function(accumulator, directive) { var parts = directive.split(OPTION_NAME_VALUE_SEPARATOR); var name = parts[0]; var value = parts[1]; if (name == "breaks" || name == "spaces") { accumulator[name] = hashValuesToHash(value); } else if (name == "indentBy" || name == "wrapAt") { accumulator[name] = parseInt(value); } else if (name == "indentWith") { accumulator[name] = mapIndentWith(value); } else if (name == "breakWith") { accumulator[name] = mapBreakWith(value); } return accumulator; }, {}); } function hashValuesToHash(string) { return string.split(HASH_VALUES_OPTION_SEPARATOR).reduce(function(accumulator, directive) { var parts = directive.split(HASH_VALUES_NAME_VALUE_SEPARATOR); var name = parts[0]; var value = parts[1]; accumulator[name] = normalizeValue(value); return accumulator; }, {}); } function normalizeValue(value) { switch (value) { case FALSE_KEYWORD_1: case FALSE_KEYWORD_2: return false; case TRUE_KEYWORD_1: case TRUE_KEYWORD_2: return true; default: return value; } } function mapBreakWith(value) { switch (value) { case "windows": case "crlf": case BreakWith.CarriageReturnLineFeed: return BreakWith.CarriageReturnLineFeed; case "unix": case "lf": case BreakWith.LineFeed: return BreakWith.LineFeed; default: return systemLineBreak; } } function mapIndentWith(value) { switch (value) { case "space": return IndentWith.Space; case "tab": return IndentWith.Tab; default: return value; } } function remapBreaks(source) { for (var key in Breaks) { var breakName = Breaks[key]; var breakValue = source.breaks[breakName]; if (breakValue === true) { source.breaks[breakName] = source.breakWith; } else if (breakValue === false) { source.breaks[breakName] = ""; } else { source.breaks[breakName] = source.breakWith.repeat(parseInt(breakValue)); } } return source; } module2.exports = { Breaks, Spaces, formatFrom }; } }); // node_modules/clean-css/lib/tokenizer/marker.js var require_marker = __commonJS({ "node_modules/clean-css/lib/tokenizer/marker.js"(exports, module2) { var Marker = { ASTERISK: "*", AT: "@", BACK_SLASH: "\\", CARRIAGE_RETURN: "\r", CLOSE_CURLY_BRACKET: "}", CLOSE_ROUND_BRACKET: ")", CLOSE_SQUARE_BRACKET: "]", COLON: ":", COMMA: ",", DOUBLE_QUOTE: '"', EXCLAMATION: "!", FORWARD_SLASH: "/", INTERNAL: "-clean-css-", NEW_LINE_NIX: "\n", OPEN_CURLY_BRACKET: "{", OPEN_ROUND_BRACKET: "(", OPEN_SQUARE_BRACKET: "[", SEMICOLON: ";", SINGLE_QUOTE: "'", SPACE: " ", TAB: " ", UNDERSCORE: "_" }; module2.exports = Marker; } }); // node_modules/clean-css/lib/utils/format-position.js var require_format_position = __commonJS({ "node_modules/clean-css/lib/utils/format-position.js"(exports, module2) { function formatPosition(metadata) { var line = metadata[0]; var column = metadata[1]; var source = metadata[2]; return source ? source + ":" + line + ":" + column : line + ":" + column; } module2.exports = formatPosition; } }); // node_modules/clean-css/lib/optimizer/level-1/tidy-rules.js var require_tidy_rules = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/tidy-rules.js"(exports, module2) { var Spaces = require_format().Spaces; var Marker = require_marker(); var formatPosition = require_format_position(); var CASE_ATTRIBUTE_PATTERN = /[\s"'][iI]\s*\]/; var CASE_RESTORE_PATTERN = /([\d\w])([iI])\]/g; var DOUBLE_QUOTE_CASE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"([iI])/g; var DOUBLE_QUOTE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g; var HTML_COMMENT_PATTERN = /^(?:(?:)\s*)+/; var SINGLE_QUOTE_CASE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g; var SINGLE_QUOTE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g; var RELATION_PATTERN = /[>+~]/; var WHITESPACE_PATTERN = /\s/; var ASTERISK_PLUS_HTML_HACK = "*+html "; var ASTERISK_FIRST_CHILD_PLUS_HTML_HACK = "*:first-child+html "; var LESS_THAN = "<"; var PSEUDO_CLASSES_WITH_SELECTORS = [ ":current", ":future", ":has", ":host", ":host-context", ":is", ":not", ":past", ":where" ]; function hasInvalidCharacters(value) { var isEscaped; var isInvalid = false; var character; var isQuote = false; var i, l; for (i = 0, l = value.length; i < l; i++) { character = value[i]; if (isEscaped) { } else if (character == Marker.SINGLE_QUOTE || character == Marker.DOUBLE_QUOTE) { isQuote = !isQuote; } else if (!isQuote && (character == Marker.CLOSE_CURLY_BRACKET || character == Marker.EXCLAMATION || character == LESS_THAN || character == Marker.SEMICOLON)) { isInvalid = true; break; } else if (!isQuote && i === 0 && RELATION_PATTERN.test(character)) { isInvalid = true; break; } isEscaped = character == Marker.BACK_SLASH; } return isInvalid; } function removeWhitespace(value, format) { var stripped = []; var character; var isNewLineNix; var isNewLineWin; var isEscaped; var wasEscaped; var isQuoted; var isSingleQuoted; var isDoubleQuoted; var isAttribute; var isRelation; var isWhitespace; var isSpaceAwarePseudoClass; var roundBracketLevel = 0; var wasComma = false; var wasRelation = false; var wasWhitespace = false; var withCaseAttribute = CASE_ATTRIBUTE_PATTERN.test(value); var spaceAroundRelation = format && format.spaces[Spaces.AroundSelectorRelation]; var i, l; for (i = 0, l = value.length; i < l; i++) { character = value[i]; isNewLineNix = character == Marker.NEW_LINE_NIX; isNewLineWin = character == Marker.NEW_LINE_NIX && value[i - 1] == Marker.CARRIAGE_RETURN; isQuoted = isSingleQuoted || isDoubleQuoted; isRelation = !isAttribute && !isEscaped && roundBracketLevel === 0 && RELATION_PATTERN.test(character); isWhitespace = WHITESPACE_PATTERN.test(character); isSpaceAwarePseudoClass = roundBracketLevel == 1 && character == Marker.CLOSE_ROUND_BRACKET ? false : isSpaceAwarePseudoClass || roundBracketLevel === 0 && character == Marker.COLON && isPseudoClassWithSelectors(value, i); if (wasEscaped && isQuoted && isNewLineWin) { stripped.pop(); stripped.pop(); } else if (isEscaped && isQuoted && isNewLineNix) { stripped.pop(); } else if (isEscaped) { stripped.push(character); } else if (character == Marker.OPEN_SQUARE_BRACKET && !isQuoted) { stripped.push(character); isAttribute = true; } else if (character == Marker.CLOSE_SQUARE_BRACKET && !isQuoted) { stripped.push(character); isAttribute = false; } else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted) { stripped.push(character); roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted) { stripped.push(character); roundBracketLevel--; } else if (character == Marker.SINGLE_QUOTE && !isQuoted) { stripped.push(character); isSingleQuoted = true; } else if (character == Marker.DOUBLE_QUOTE && !isQuoted) { stripped.push(character); isDoubleQuoted = true; } else if (character == Marker.SINGLE_QUOTE && isQuoted) { stripped.push(character); isSingleQuoted = false; } else if (character == Marker.DOUBLE_QUOTE && isQuoted) { stripped.push(character); isDoubleQuoted = false; } else if (isWhitespace && wasRelation && !spaceAroundRelation) { continue; } else if (!isWhitespace && wasRelation && spaceAroundRelation) { stripped.push(Marker.SPACE); stripped.push(character); } else if (isWhitespace && !wasWhitespace && wasComma && roundBracketLevel > 0 && isSpaceAwarePseudoClass) { } else if (isWhitespace && !wasWhitespace && roundBracketLevel > 0 && isSpaceAwarePseudoClass) { stripped.push(character); } else if (isWhitespace && (isAttribute || roundBracketLevel > 0) && !isQuoted) { } else if (isWhitespace && wasWhitespace && !isQuoted) { } else if ((isNewLineWin || isNewLineNix) && (isAttribute || roundBracketLevel > 0) && isQuoted) { } else if (isRelation && wasWhitespace && !spaceAroundRelation) { stripped.pop(); stripped.push(character); } else if (isRelation && !wasWhitespace && spaceAroundRelation) { stripped.push(Marker.SPACE); stripped.push(character); } else if (isWhitespace) { stripped.push(Marker.SPACE); } else { stripped.push(character); } wasEscaped = isEscaped; isEscaped = character == Marker.BACK_SLASH; wasRelation = isRelation; wasWhitespace = isWhitespace; wasComma = character == Marker.COMMA; } return withCaseAttribute ? stripped.join("").replace(CASE_RESTORE_PATTERN, "$1 $2]") : stripped.join(""); } function isPseudoClassWithSelectors(value, colonPosition) { var pseudoClass = value.substring(colonPosition, value.indexOf(Marker.OPEN_ROUND_BRACKET, colonPosition)); return PSEUDO_CLASSES_WITH_SELECTORS.indexOf(pseudoClass) > -1; } function removeQuotes(value) { if (value.indexOf("'") == -1 && value.indexOf('"') == -1) { return value; } return value.replace(SINGLE_QUOTE_CASE_PATTERN, "=$1 $2").replace(SINGLE_QUOTE_PATTERN, "=$1$2").replace(DOUBLE_QUOTE_CASE_PATTERN, "=$1 $2").replace(DOUBLE_QUOTE_PATTERN, "=$1$2"); } function replacePseudoClasses(value) { return value.replace("nth-child(1)", "first-child").replace("nth-of-type(1)", "first-of-type").replace("nth-of-type(even)", "nth-of-type(2n)").replace("nth-child(even)", "nth-child(2n)").replace("nth-of-type(2n+1)", "nth-of-type(odd)").replace("nth-child(2n+1)", "nth-child(odd)").replace("nth-last-child(1)", "last-child").replace("nth-last-of-type(1)", "last-of-type").replace("nth-last-of-type(even)", "nth-last-of-type(2n)").replace("nth-last-child(even)", "nth-last-child(2n)").replace("nth-last-of-type(2n+1)", "nth-last-of-type(odd)").replace("nth-last-child(2n+1)", "nth-last-child(odd)"); } function tidyRules(rules, removeUnsupported, adjacentSpace, format, warnings) { var list = []; var repeated = []; function removeHTMLComment(rule2, match) { warnings.push("HTML comment '" + match + "' at " + formatPosition(rule2[2][0]) + ". Removing."); return ""; } for (var i = 0, l = rules.length; i < l; i++) { var rule = rules[i]; var reduced = rule[1]; reduced = reduced.replace(HTML_COMMENT_PATTERN, removeHTMLComment.bind(null, rule)); if (hasInvalidCharacters(reduced)) { warnings.push("Invalid selector '" + rule[1] + "' at " + formatPosition(rule[2][0]) + ". Ignoring."); continue; } reduced = removeWhitespace(reduced, format); reduced = removeQuotes(reduced); if (adjacentSpace && reduced.indexOf("nav") > 0) { reduced = reduced.replace(/\+nav(\S|$)/, "+ nav$1"); } if (removeUnsupported && reduced.indexOf(ASTERISK_PLUS_HTML_HACK) > -1) { continue; } if (removeUnsupported && reduced.indexOf(ASTERISK_FIRST_CHILD_PLUS_HTML_HACK) > -1) { continue; } if (reduced.indexOf("*") > -1) { reduced = reduced.replace(/\*([:#.[])/g, "$1").replace(/^(:first-child)?\+html/, "*$1+html"); } if (repeated.indexOf(reduced) > -1) { continue; } reduced = replacePseudoClasses(reduced); rule[1] = reduced; repeated.push(reduced); list.push(rule); } if (list.length == 1 && list[0][1].length === 0) { warnings.push("Empty selector '" + list[0][1] + "' at " + formatPosition(list[0][2][0]) + ". Ignoring."); list = []; } return list; } module2.exports = tidyRules; } }); // node_modules/clean-css/lib/optimizer/level-1/tidy-block.js var require_tidy_block = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/tidy-block.js"(exports, module2) { var SUPPORTED_COMPACT_BLOCK_MATCHER = /^@media\W/; var SUPPORTED_QUOTE_REMOVAL_MATCHER = /^@(?:keyframes|-moz-keyframes|-o-keyframes|-webkit-keyframes)\W/; function tidyBlock(values, spaceAfterClosingBrace) { var withoutSpaceAfterClosingBrace; var withoutQuotes; var i; for (i = values.length - 1; i >= 0; i--) { withoutSpaceAfterClosingBrace = !spaceAfterClosingBrace && SUPPORTED_COMPACT_BLOCK_MATCHER.test(values[i][1]); withoutQuotes = SUPPORTED_QUOTE_REMOVAL_MATCHER.test(values[i][1]); values[i][1] = values[i][1].replace(/\n|\r\n/g, " ").replace(/\s+/g, " ").replace(/(,|:|\() /g, "$1").replace(/ \)/g, ")"); if (withoutQuotes) { values[i][1] = values[i][1].replace(/'([a-zA-Z][a-zA-Z\d\-_]+)'/, "$1").replace(/"([a-zA-Z][a-zA-Z\d\-_]+)"/, "$1"); } if (withoutSpaceAfterClosingBrace) { values[i][1] = values[i][1].replace(/\) /g, ")"); } } return values; } module2.exports = tidyBlock; } }); // node_modules/clean-css/lib/optimizer/level-1/tidy-at-rule.js var require_tidy_at_rule = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/tidy-at-rule.js"(exports, module2) { function tidyAtRule(value) { return value.replace(/\s+/g, " ").replace(/url\(\s+/g, "url(").replace(/\s+\)/g, ")").trim(); } module2.exports = tidyAtRule; } }); // node_modules/clean-css/lib/optimizer/hack.js var require_hack = __commonJS({ "node_modules/clean-css/lib/optimizer/hack.js"(exports, module2) { var Hack = { ASTERISK: "asterisk", BANG: "bang", BACKSLASH: "backslash", UNDERSCORE: "underscore" }; module2.exports = Hack; } }); // node_modules/clean-css/lib/optimizer/remove-unused.js var require_remove_unused = __commonJS({ "node_modules/clean-css/lib/optimizer/remove-unused.js"(exports, module2) { function removeUnused(properties) { for (var i = properties.length - 1; i >= 0; i--) { var property = properties[i]; if (property.unused) { property.all.splice(property.position, 1); } } } module2.exports = removeUnused; } }); // node_modules/clean-css/lib/optimizer/restore-from-optimizing.js var require_restore_from_optimizing = __commonJS({ "node_modules/clean-css/lib/optimizer/restore-from-optimizing.js"(exports, module2) { var Hack = require_hack(); var Marker = require_marker(); var ASTERISK_HACK = "*"; var BACKSLASH_HACK = "\\"; var IMPORTANT_TOKEN = "!important"; var UNDERSCORE_HACK = "_"; var BANG_HACK = "!ie"; function restoreFromOptimizing(properties, restoreCallback) { var property; var restored; var current; var i; for (i = properties.length - 1; i >= 0; i--) { property = properties[i]; if (property.dynamic && property.important) { restoreImportant(property); continue; } if (property.dynamic) { continue; } if (property.unused) { continue; } if (!property.dirty && !property.important && !property.hack) { continue; } if (property.optimizable && restoreCallback) { restored = restoreCallback(property); property.value = restored; } else { restored = property.value; } if (property.important) { restoreImportant(property); } if (property.hack) { restoreHack(property); } if ("all" in property) { current = property.all[property.position]; current[1][1] = property.name; current.splice(2, current.length - 1); Array.prototype.push.apply(current, restored); } } } function restoreImportant(property) { property.value[property.value.length - 1][1] += IMPORTANT_TOKEN; } function restoreHack(property) { if (property.hack[0] == Hack.UNDERSCORE) { property.name = UNDERSCORE_HACK + property.name; } else if (property.hack[0] == Hack.ASTERISK) { property.name = ASTERISK_HACK + property.name; } else if (property.hack[0] == Hack.BACKSLASH) { property.value[property.value.length - 1][1] += BACKSLASH_HACK + property.hack[1]; } else if (property.hack[0] == Hack.BANG) { property.value[property.value.length - 1][1] += Marker.SPACE + BANG_HACK; } } module2.exports = restoreFromOptimizing; } }); // node_modules/clean-css/lib/tokenizer/token.js var require_token = __commonJS({ "node_modules/clean-css/lib/tokenizer/token.js"(exports, module2) { var Token = { AT_RULE: "at-rule", AT_RULE_BLOCK: "at-rule-block", AT_RULE_BLOCK_SCOPE: "at-rule-block-scope", COMMENT: "comment", NESTED_BLOCK: "nested-block", NESTED_BLOCK_SCOPE: "nested-block-scope", PROPERTY: "property", PROPERTY_BLOCK: "property-block", PROPERTY_NAME: "property-name", PROPERTY_VALUE: "property-value", RAW: "raw", RULE: "rule", RULE_SCOPE: "rule-scope" }; module2.exports = Token; } }); // node_modules/clean-css/lib/optimizer/wrap-for-optimizing.js var require_wrap_for_optimizing = __commonJS({ "node_modules/clean-css/lib/optimizer/wrap-for-optimizing.js"(exports, module2) { var Hack = require_hack(); var Marker = require_marker(); var Token = require_token(); var Match = { ASTERISK: "*", BACKSLASH: "\\", BANG: "!", BANG_SUFFIX_PATTERN: /!\w+$/, IMPORTANT_TOKEN: "!important", IMPORTANT_TOKEN_PATTERN: new RegExp("!important$", "i"), IMPORTANT_WORD: "important", IMPORTANT_WORD_PATTERN: new RegExp("important$", "i"), SUFFIX_BANG_PATTERN: /!$/, UNDERSCORE: "_", VARIABLE_REFERENCE_PATTERN: /var\(--.+\)$/ }; function wrapAll(properties, skipProperties) { var wrapped = []; var single; var property; var i; for (i = properties.length - 1; i >= 0; i--) { property = properties[i]; if (property[0] != Token.PROPERTY) { continue; } if (skipProperties && skipProperties.indexOf(property[1][1]) > -1) { continue; } single = wrapSingle(property); single.all = properties; single.position = i; wrapped.unshift(single); } return wrapped; } function someVariableReferences(property) { var i, l; var value; for (i = 2, l = property.length; i < l; i++) { value = property[i]; if (value[0] != Token.PROPERTY_VALUE) { continue; } if (isVariableReference(value[1])) { return true; } } return false; } function isVariableReference(value) { return Match.VARIABLE_REFERENCE_PATTERN.test(value); } function isMultiplex(property) { var value; var i, l; for (i = 3, l = property.length; i < l; i++) { value = property[i]; if (value[0] == Token.PROPERTY_VALUE && (value[1] == Marker.COMMA || value[1] == Marker.FORWARD_SLASH)) { return true; } } return false; } function hackFrom(property) { var match = false; var name = property[1][1]; var lastValue = property[property.length - 1]; if (name[0] == Match.UNDERSCORE) { match = [Hack.UNDERSCORE]; } else if (name[0] == Match.ASTERISK) { match = [Hack.ASTERISK]; } else if (lastValue[1][0] == Match.BANG && !lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)) { match = [Hack.BANG]; } else if (lastValue[1].indexOf(Match.BANG) > 0 && !lastValue[1].match(Match.IMPORTANT_WORD_PATTERN) && Match.BANG_SUFFIX_PATTERN.test(lastValue[1])) { match = [Hack.BANG]; } else if (lastValue[1].indexOf(Match.BACKSLASH) > 0 && lastValue[1].indexOf(Match.BACKSLASH) == lastValue[1].length - Match.BACKSLASH.length - 1) { match = [Hack.BACKSLASH, lastValue[1].substring(lastValue[1].indexOf(Match.BACKSLASH) + 1)]; } else if (lastValue[1].indexOf(Match.BACKSLASH) === 0 && lastValue[1].length == 2) { match = [Hack.BACKSLASH, lastValue[1].substring(1)]; } return match; } function isImportant(property) { if (property.length < 3) { return false; } var lastValue = property[property.length - 1]; if (Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])) { return true; } if (Match.IMPORTANT_WORD_PATTERN.test(lastValue[1]) && Match.SUFFIX_BANG_PATTERN.test(property[property.length - 2][1])) { return true; } return false; } function stripImportant(property) { var lastValue = property[property.length - 1]; var oneButLastValue = property[property.length - 2]; if (Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])) { lastValue[1] = lastValue[1].replace(Match.IMPORTANT_TOKEN_PATTERN, ""); } else { lastValue[1] = lastValue[1].replace(Match.IMPORTANT_WORD_PATTERN, ""); oneButLastValue[1] = oneButLastValue[1].replace(Match.SUFFIX_BANG_PATTERN, ""); } if (lastValue[1].length === 0) { property.pop(); } if (oneButLastValue[1].length === 0) { property.pop(); } } function stripPrefixHack(property) { property[1][1] = property[1][1].substring(1); } function stripSuffixHack(property, hackFrom2) { var lastValue = property[property.length - 1]; lastValue[1] = lastValue[1].substring(0, lastValue[1].indexOf(hackFrom2[0] == Hack.BACKSLASH ? Match.BACKSLASH : Match.BANG)).trim(); if (lastValue[1].length === 0) { property.pop(); } } function wrapSingle(property) { var importantProperty = isImportant(property); if (importantProperty) { stripImportant(property); } var whichHack = hackFrom(property); if (whichHack[0] == Hack.ASTERISK || whichHack[0] == Hack.UNDERSCORE) { stripPrefixHack(property); } else if (whichHack[0] == Hack.BACKSLASH || whichHack[0] == Hack.BANG) { stripSuffixHack(property, whichHack); } return { block: property[2] && property[2][0] == Token.PROPERTY_BLOCK, components: [], dirty: false, dynamic: someVariableReferences(property), hack: whichHack, important: importantProperty, name: property[1][1], multiplex: property.length > 3 ? isMultiplex(property) : false, optimizable: true, position: 0, shorthand: false, unused: false, value: property.slice(2) }; } module2.exports = { all: wrapAll, single: wrapSingle }; } }); // node_modules/clean-css/lib/optimizer/invalid-property-error.js var require_invalid_property_error = __commonJS({ "node_modules/clean-css/lib/optimizer/invalid-property-error.js"(exports, module2) { function InvalidPropertyError(message) { this.name = "InvalidPropertyError"; this.message = message; this.stack = new Error().stack; } InvalidPropertyError.prototype = Object.create(Error.prototype); InvalidPropertyError.prototype.constructor = InvalidPropertyError; module2.exports = InvalidPropertyError; } }); // node_modules/clean-css/lib/optimizer/configuration/break-up.js var require_break_up = __commonJS({ "node_modules/clean-css/lib/optimizer/configuration/break-up.js"(exports, module2) { var InvalidPropertyError = require_invalid_property_error(); var wrapSingle = require_wrap_for_optimizing().single; var Token = require_token(); var Marker = require_marker(); var formatPosition = require_format_position(); function _anyIsInherit(values) { var i, l; for (i = 0, l = values.length; i < l; i++) { if (values[i][1] == "inherit") { return true; } } return false; } function _colorFilter(validator) { return function(value) { return value[1] == "invert" || validator.isColor(value[1]) || validator.isPrefixed(value[1]); }; } function _styleFilter(validator) { return function(value) { return value[1] != "inherit" && validator.isStyleKeyword(value[1]) && !validator.isColorFunction(value[1]); }; } function _wrapDefault(name, property, configuration) { var descriptor = configuration[name]; if (descriptor.doubleValues && descriptor.defaultValue.length == 2) { return wrapSingle([ Token.PROPERTY, [Token.PROPERTY_NAME, name], [Token.PROPERTY_VALUE, descriptor.defaultValue[0]], [Token.PROPERTY_VALUE, descriptor.defaultValue[1]] ]); } if (descriptor.doubleValues && descriptor.defaultValue.length == 1) { return wrapSingle([ Token.PROPERTY, [Token.PROPERTY_NAME, name], [Token.PROPERTY_VALUE, descriptor.defaultValue[0]] ]); } return wrapSingle([ Token.PROPERTY, [Token.PROPERTY_NAME, name], [Token.PROPERTY_VALUE, descriptor.defaultValue] ]); } function _widthFilter(validator) { return function(value) { return value[1] != "inherit" && (validator.isWidth(value[1]) || validator.isUnit(value[1]) || validator.isDynamicUnit(value[1])) && !validator.isStyleKeyword(value[1]) && !validator.isColorFunction(value[1]); }; } function animation(property, configuration, validator) { var duration = _wrapDefault(property.name + "-duration", property, configuration); var timing = _wrapDefault(property.name + "-timing-function", property, configuration); var delay = _wrapDefault(property.name + "-delay", property, configuration); var iteration = _wrapDefault(property.name + "-iteration-count", property, configuration); var direction = _wrapDefault(property.name + "-direction", property, configuration); var fill = _wrapDefault(property.name + "-fill-mode", property, configuration); var play = _wrapDefault(property.name + "-play-state", property, configuration); var name = _wrapDefault(property.name + "-name", property, configuration); var components = [duration, timing, delay, iteration, direction, fill, play, name]; var values = property.value; var value; var durationSet = false; var timingSet = false; var delaySet = false; var iterationSet = false; var directionSet = false; var fillSet = false; var playSet = false; var nameSet = false; var i; var l; if (property.value.length == 1 && property.value[0][1] == "inherit") { duration.value = timing.value = delay.value = iteration.value = direction.value = fill.value = play.value = name.value = property.value; return components; } if (values.length > 1 && _anyIsInherit(values)) { throw new InvalidPropertyError("Invalid animation values at " + formatPosition(values[0][2][0]) + ". Ignoring."); } for (i = 0, l = values.length; i < l; i++) { value = values[i]; if (validator.isTime(value[1]) && !durationSet) { duration.value = [value]; durationSet = true; } else if (validator.isTime(value[1]) && !delaySet) { delay.value = [value]; delaySet = true; } else if ((validator.isGlobal(value[1]) || validator.isTimingFunction(value[1])) && !timingSet) { timing.value = [value]; timingSet = true; } else if ((validator.isAnimationIterationCountKeyword(value[1]) || validator.isPositiveNumber(value[1])) && !iterationSet) { iteration.value = [value]; iterationSet = true; } else if (validator.isAnimationDirectionKeyword(value[1]) && !directionSet) { direction.value = [value]; directionSet = true; } else if (validator.isAnimationFillModeKeyword(value[1]) && !fillSet) { fill.value = [value]; fillSet = true; } else if (validator.isAnimationPlayStateKeyword(value[1]) && !playSet) { play.value = [value]; playSet = true; } else if ((validator.isAnimationNameKeyword(value[1]) || validator.isIdentifier(value[1])) && !nameSet) { name.value = [value]; nameSet = true; } else { throw new InvalidPropertyError("Invalid animation value at " + formatPosition(value[2][0]) + ". Ignoring."); } } return components; } function background(property, configuration, validator) { var image = _wrapDefault("background-image", property, configuration); var position = _wrapDefault("background-position", property, configuration); var size = _wrapDefault("background-size", property, configuration); var repeat = _wrapDefault("background-repeat", property, configuration); var attachment = _wrapDefault("background-attachment", property, configuration); var origin = _wrapDefault("background-origin", property, configuration); var clip = _wrapDefault("background-clip", property, configuration); var color = _wrapDefault("background-color", property, configuration); var components = [image, position, size, repeat, attachment, origin, clip, color]; var values = property.value; var positionSet = false; var clipSet = false; var originSet = false; var repeatSet = false; var anyValueSet = false; if (property.value.length == 1 && property.value[0][1] == "inherit") { color.value = image.value = repeat.value = position.value = size.value = origin.value = clip.value = property.value; return components; } if (property.value.length == 1 && property.value[0][1] == "0 0") { return components; } for (var i = values.length - 1; i >= 0; i--) { var value = values[i]; if (validator.isBackgroundAttachmentKeyword(value[1])) { attachment.value = [value]; anyValueSet = true; } else if (validator.isBackgroundClipKeyword(value[1]) || validator.isBackgroundOriginKeyword(value[1])) { if (clipSet) { origin.value = [value]; originSet = true; } else { clip.value = [value]; clipSet = true; } anyValueSet = true; } else if (validator.isBackgroundRepeatKeyword(value[1])) { if (repeatSet) { repeat.value.unshift(value); } else { repeat.value = [value]; repeatSet = true; } anyValueSet = true; } else if (validator.isBackgroundPositionKeyword(value[1]) || validator.isBackgroundSizeKeyword(value[1]) || validator.isUnit(value[1]) || validator.isDynamicUnit(value[1])) { if (i > 0) { var previousValue = values[i - 1]; if (previousValue[1] == Marker.FORWARD_SLASH) { size.value = [value]; } else if (i > 1 && values[i - 2][1] == Marker.FORWARD_SLASH) { size.value = [previousValue, value]; i -= 2; } else { if (!positionSet) { position.value = []; } position.value.unshift(value); positionSet = true; } } else { if (!positionSet) { position.value = []; } position.value.unshift(value); positionSet = true; } anyValueSet = true; } else if ((color.value[0][1] == configuration[color.name].defaultValue || color.value[0][1] == "none") && (validator.isColor(value[1]) || validator.isPrefixed(value[1]))) { color.value = [value]; anyValueSet = true; } else if (validator.isUrl(value[1]) || validator.isFunction(value[1])) { image.value = [value]; anyValueSet = true; } } if (clipSet && !originSet) { origin.value = clip.value.slice(0); } if (!anyValueSet) { throw new InvalidPropertyError("Invalid background value at " + formatPosition(values[0][2][0]) + ". Ignoring."); } return components; } function borderRadius(property, configuration) { var values = property.value; var splitAt = -1; for (var i = 0, l = values.length; i < l; i++) { if (values[i][1] == Marker.FORWARD_SLASH) { splitAt = i; break; } } if (splitAt === 0 || splitAt === values.length - 1) { throw new InvalidPropertyError("Invalid border-radius value at " + formatPosition(values[0][2][0]) + ". Ignoring."); } var target = _wrapDefault(property.name, property, configuration); target.value = splitAt > -1 ? values.slice(0, splitAt) : values.slice(0); target.components = fourValues(target, configuration); var remainder = _wrapDefault(property.name, property, configuration); remainder.value = splitAt > -1 ? values.slice(splitAt + 1) : values.slice(0); remainder.components = fourValues(remainder, configuration); for (var j = 0; j < 4; j++) { target.components[j].multiplex = true; target.components[j].value = target.components[j].value.concat(remainder.components[j].value); } return target.components; } function font(property, configuration, validator) { var style = _wrapDefault("font-style", property, configuration); var variant = _wrapDefault("font-variant", property, configuration); var weight = _wrapDefault("font-weight", property, configuration); var stretch = _wrapDefault("font-stretch", property, configuration); var size = _wrapDefault("font-size", property, configuration); var height = _wrapDefault("line-height", property, configuration); var family = _wrapDefault("font-family", property, configuration); var components = [style, variant, weight, stretch, size, height, family]; var values = property.value; var fuzzyMatched = 4; var index = 0; var isStretchSet = false; var isStretchValid; var isStyleSet = false; var isStyleValid; var isVariantSet = false; var isVariantValid; var isWeightSet = false; var isWeightValid; var appendableFamilyName = false; if (!values[index]) { throw new InvalidPropertyError("Missing font values at " + formatPosition(property.all[property.position][1][2][0]) + ". Ignoring."); } if (values.length == 1 && values[0][1] == "inherit") { style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values; return components; } if (values.length == 1 && (validator.isFontKeyword(values[0][1]) || validator.isGlobal(values[0][1]) || validator.isPrefixed(values[0][1]))) { values[0][1] = Marker.INTERNAL + values[0][1]; style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values; return components; } if (values.length < 2 || !_anyIsFontSize(values, validator) || !_anyIsFontFamily(values, validator)) { throw new InvalidPropertyError("Invalid font values at " + formatPosition(property.all[property.position][1][2][0]) + ". Ignoring."); } if (values.length > 1 && _anyIsInherit(values)) { throw new InvalidPropertyError("Invalid font values at " + formatPosition(values[0][2][0]) + ". Ignoring."); } while (index < fuzzyMatched) { isStretchValid = validator.isFontStretchKeyword(values[index][1]) || validator.isGlobal(values[index][1]); isStyleValid = validator.isFontStyleKeyword(values[index][1]) || validator.isGlobal(values[index][1]); isVariantValid = validator.isFontVariantKeyword(values[index][1]) || validator.isGlobal(values[index][1]); isWeightValid = validator.isFontWeightKeyword(values[index][1]) || validator.isGlobal(values[index][1]); if (isStyleValid && !isStyleSet) { style.value = [values[index]]; isStyleSet = true; } else if (isVariantValid && !isVariantSet) { variant.value = [values[index]]; isVariantSet = true; } else if (isWeightValid && !isWeightSet) { weight.value = [values[index]]; isWeightSet = true; } else if (isStretchValid && !isStretchSet) { stretch.value = [values[index]]; isStretchSet = true; } else if (isStyleValid && isStyleSet || isVariantValid && isVariantSet || isWeightValid && isWeightSet || isStretchValid && isStretchSet) { throw new InvalidPropertyError("Invalid font style / variant / weight / stretch value at " + formatPosition(values[0][2][0]) + ". Ignoring."); } else { break; } index++; } if (validator.isFontSizeKeyword(values[index][1]) || validator.isUnit(values[index][1]) && !validator.isDynamicUnit(values[index][1])) { size.value = [values[index]]; index++; } else { throw new InvalidPropertyError("Missing font size at " + formatPosition(values[0][2][0]) + ". Ignoring."); } if (!values[index]) { throw new InvalidPropertyError("Missing font family at " + formatPosition(values[0][2][0]) + ". Ignoring."); } if (values[index] && values[index][1] == Marker.FORWARD_SLASH && values[index + 1] && (validator.isLineHeightKeyword(values[index + 1][1]) || validator.isUnit(values[index + 1][1]) || validator.isNumber(values[index + 1][1]))) { height.value = [values[index + 1]]; index++; index++; } family.value = []; while (values[index]) { if (values[index][1] == Marker.COMMA) { appendableFamilyName = false; } else { if (appendableFamilyName) { family.value[family.value.length - 1][1] += Marker.SPACE + values[index][1]; } else { family.value.push(values[index]); } appendableFamilyName = true; } index++; } if (family.value.length === 0) { throw new InvalidPropertyError("Missing font family at " + formatPosition(values[0][2][0]) + ". Ignoring."); } return components; } function _anyIsFontSize(values, validator) { var value; var i, l; for (i = 0, l = values.length; i < l; i++) { value = values[i]; if (validator.isFontSizeKeyword(value[1]) || validator.isUnit(value[1]) && !validator.isDynamicUnit(value[1]) || validator.isFunction(value[1])) { return true; } } return false; } function _anyIsFontFamily(values, validator) { var value; var i, l; for (i = 0, l = values.length; i < l; i++) { value = values[i]; if (validator.isIdentifier(value[1]) || validator.isQuotedText(value[1])) { return true; } } return false; } function fourValues(property, configuration) { var componentNames = configuration[property.name].components; var components = []; var value = property.value; if (value.length < 1) { return []; } if (value.length < 2) { value[1] = value[0].slice(0); } if (value.length < 3) { value[2] = value[0].slice(0); } if (value.length < 4) { value[3] = value[1].slice(0); } for (var i = componentNames.length - 1; i >= 0; i--) { var component = wrapSingle([ Token.PROPERTY, [Token.PROPERTY_NAME, componentNames[i]] ]); component.value = [value[i]]; components.unshift(component); } return components; } function multiplex(splitWith) { return function(property, configuration, validator) { var splitsAt = []; var values = property.value; var i, j, l, m; for (i = 0, l = values.length; i < l; i++) { if (values[i][1] == ",") { splitsAt.push(i); } } if (splitsAt.length === 0) { return splitWith(property, configuration, validator); } var splitComponents = []; for (i = 0, l = splitsAt.length; i <= l; i++) { var from = i === 0 ? 0 : splitsAt[i - 1] + 1; var to = i < l ? splitsAt[i] : values.length; var _property = _wrapDefault(property.name, property, configuration); _property.value = values.slice(from, to); if (_property.value.length > 0) { splitComponents.push(splitWith(_property, configuration, validator)); } } var components = splitComponents[0]; for (i = 0, l = components.length; i < l; i++) { components[i].multiplex = true; for (j = 1, m = splitComponents.length; j < m; j++) { components[i].value.push([Token.PROPERTY_VALUE, Marker.COMMA]); Array.prototype.push.apply(components[i].value, splitComponents[j][i].value); } } return components; }; } function listStyle(property, configuration, validator) { var type = _wrapDefault("list-style-type", property, configuration); var position = _wrapDefault("list-style-position", property, configuration); var image = _wrapDefault("list-style-image", property, configuration); var components = [type, position, image]; if (property.value.length == 1 && property.value[0][1] == "inherit") { type.value = position.value = image.value = [property.value[0]]; return components; } var values = property.value.slice(0); var total = values.length; var index = 0; for (index = 0, total = values.length; index < total; index++) { if (validator.isUrl(values[index][1]) || values[index][1] == "0") { image.value = [values[index]]; values.splice(index, 1); break; } } for (index = 0, total = values.length; index < total; index++) { if (validator.isListStylePositionKeyword(values[index][1])) { position.value = [values[index]]; values.splice(index, 1); break; } } if (values.length > 0 && (validator.isListStyleTypeKeyword(values[0][1]) || validator.isIdentifier(values[0][1]))) { type.value = [values[0]]; } return components; } function transition(property, configuration, validator) { var prop = _wrapDefault(property.name + "-property", property, configuration); var duration = _wrapDefault(property.name + "-duration", property, configuration); var timing = _wrapDefault(property.name + "-timing-function", property, configuration); var delay = _wrapDefault(property.name + "-delay", property, configuration); var components = [prop, duration, timing, delay]; var values = property.value; var value; var durationSet = false; var delaySet = false; var propSet = false; var timingSet = false; var i; var l; if (property.value.length == 1 && property.value[0][1] == "inherit") { prop.value = duration.value = timing.value = delay.value = property.value; return components; } if (values.length > 1 && _anyIsInherit(values)) { throw new InvalidPropertyError("Invalid animation values at " + formatPosition(values[0][2][0]) + ". Ignoring."); } for (i = 0, l = values.length; i < l; i++) { value = values[i]; if (validator.isTime(value[1]) && !durationSet) { duration.value = [value]; durationSet = true; } else if (validator.isTime(value[1]) && !delaySet) { delay.value = [value]; delaySet = true; } else if ((validator.isGlobal(value[1]) || validator.isTimingFunction(value[1])) && !timingSet) { timing.value = [value]; timingSet = true; } else if (validator.isIdentifier(value[1]) && !propSet) { prop.value = [value]; propSet = true; } else { throw new InvalidPropertyError("Invalid animation value at " + formatPosition(value[2][0]) + ". Ignoring."); } } return components; } function widthStyleColor(property, configuration, validator) { var descriptor = configuration[property.name]; var components = [ _wrapDefault(descriptor.components[0], property, configuration), _wrapDefault(descriptor.components[1], property, configuration), _wrapDefault(descriptor.components[2], property, configuration) ]; var color, style, width; for (var i = 0; i < 3; i++) { var component = components[i]; if (component.name.indexOf("color") > 0) { color = component; } else if (component.name.indexOf("style") > 0) { style = component; } else { width = component; } } if (property.value.length == 1 && property.value[0][1] == "inherit" || property.value.length == 3 && property.value[0][1] == "inherit" && property.value[1][1] == "inherit" && property.value[2][1] == "inherit") { color.value = style.value = width.value = [property.value[0]]; return components; } var values = property.value.slice(0); var match, matches; if (values.length > 0) { matches = values.filter(_widthFilter(validator)); match = matches.length > 1 && (matches[0][1] == "none" || matches[0][1] == "auto") ? matches[1] : matches[0]; if (match) { width.value = [match]; values.splice(values.indexOf(match), 1); } } if (values.length > 0) { match = values.filter(_styleFilter(validator))[0]; if (match) { style.value = [match]; values.splice(values.indexOf(match), 1); } } if (values.length > 0) { match = values.filter(_colorFilter(validator))[0]; if (match) { color.value = [match]; values.splice(values.indexOf(match), 1); } } return components; } module2.exports = { animation, background, border: widthStyleColor, borderRadius, font, fourValues, listStyle, multiplex, outline: widthStyleColor, transition }; } }); // node_modules/clean-css/lib/optimizer/vendor-prefixes.js var require_vendor_prefixes = __commonJS({ "node_modules/clean-css/lib/optimizer/vendor-prefixes.js"(exports, module2) { var VENDOR_PREFIX_PATTERN = /(?:^|\W)(-\w+-)/g; function unique(value) { var prefixes = []; var match; while ((match = VENDOR_PREFIX_PATTERN.exec(value)) !== null) { if (prefixes.indexOf(match[0]) == -1) { prefixes.push(match[0]); } } return prefixes; } function same(value1, value2) { return unique(value1).sort().join(",") == unique(value2).sort().join(","); } module2.exports = { unique, same }; } }); // node_modules/clean-css/lib/optimizer/configuration/properties/understandable.js var require_understandable = __commonJS({ "node_modules/clean-css/lib/optimizer/configuration/properties/understandable.js"(exports, module2) { var sameVendorPrefixes = require_vendor_prefixes().same; function understandable(validator, value1, value2, _position, isPaired) { if (!sameVendorPrefixes(value1, value2)) { return false; } if (isPaired && validator.isVariable(value1) !== validator.isVariable(value2)) { return false; } return true; } module2.exports = understandable; } }); // node_modules/clean-css/lib/optimizer/configuration/can-override.js var require_can_override = __commonJS({ "node_modules/clean-css/lib/optimizer/configuration/can-override.js"(exports, module2) { var understandable = require_understandable(); function animationIterationCount(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2); } function animationName(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2); } function areSameFunction(validator, value1, value2) { if (!validator.isFunction(value1) || !validator.isFunction(value2)) { return false; } var function1Name = value1.substring(0, value1.indexOf("(")); var function2Name = value2.substring(0, value2.indexOf("(")); var function1Value = value1.substring(function1Name.length + 1, value1.length - 1); var function2Value = value2.substring(function2Name.length + 1, value2.length - 1); if (validator.isFunction(function1Value) || validator.isFunction(function2Value)) { return function1Name === function2Name && areSameFunction(validator, function1Value, function2Value); } return function1Name === function2Name; } function backgroundPosition(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2)) { return true; } return unit(validator, value1, value2); } function backgroundSize(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2)) { return true; } return unit(validator, value1, value2); } function color(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isColor(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (!validator.colorOpacity && (validator.isRgbColor(value1) || validator.isHslColor(value1))) { return false; } if (!validator.colorOpacity && (validator.isRgbColor(value2) || validator.isHslColor(value2))) { return false; } if (!validator.colorHexAlpha && (validator.isHexAlphaColor(value1) || validator.isHexAlphaColor(value2))) { return false; } if (validator.isColor(value1) && validator.isColor(value2)) { return true; } return sameFunctionOrValue(validator, value1, value2); } function components(overrideCheckers) { return function(validator, value1, value2, position) { return overrideCheckers[position](validator, value1, value2); }; } function fontFamily(validator, value1, value2) { return understandable(validator, value1, value2, 0, true); } function image(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isImage(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (validator.isImage(value2)) { return true; } if (validator.isImage(value1)) { return false; } return sameFunctionOrValue(validator, value1, value2); } function keyword(propertyName2) { return function(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isKeyword(propertyName2)(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isKeyword(propertyName2)(value2); }; } function keywordWithGlobal(propertyName2) { return function(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isKeyword(propertyName2)(value2) || validator.isGlobal(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isKeyword(propertyName2)(value2) || validator.isGlobal(value2); }; } function propertyName(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isIdentifier(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isIdentifier(value2); } function sameFunctionOrValue(validator, value1, value2) { return areSameFunction(validator, value1, value2) ? true : value1 === value2; } function textShadow(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2); } function time(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isTime(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (validator.isTime(value1) && !validator.isTime(value2)) { return false; } if (validator.isTime(value2)) { return true; } if (validator.isTime(value1)) { return false; } if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) { return true; } return sameFunctionOrValue(validator, value1, value2); } function timingFunction(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isTimingFunction(value2) || validator.isGlobal(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isTimingFunction(value2) || validator.isGlobal(value2); } function unit(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isUnit(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if (validator.isUnit(value1) && !validator.isUnit(value2)) { return false; } if (validator.isUnit(value2)) { return true; } if (validator.isUnit(value1)) { return false; } if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) { return true; } return sameFunctionOrValue(validator, value1, value2); } function unitOrKeywordWithGlobal(propertyName2) { var byKeyword = keywordWithGlobal(propertyName2); return function(validator, value1, value2) { return unit(validator, value1, value2) || byKeyword(validator, value1, value2); }; } function unitOrNumber(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isNumber(value2))) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } if ((validator.isUnit(value1) || validator.isNumber(value1)) && !(validator.isUnit(value2) || validator.isNumber(value2))) { return false; } if (validator.isUnit(value2) || validator.isNumber(value2)) { return true; } if (validator.isUnit(value1) || validator.isNumber(value1)) { return false; } if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) { return true; } return sameFunctionOrValue(validator, value1, value2); } function zIndex(validator, value1, value2) { if (!understandable(validator, value1, value2, 0, true) && !validator.isZIndex(value2)) { return false; } if (validator.isVariable(value1) && validator.isVariable(value2)) { return true; } return validator.isZIndex(value2); } module2.exports = { generic: { color, components, image, propertyName, time, timingFunction, unit, unitOrNumber }, property: { animationDirection: keywordWithGlobal("animation-direction"), animationFillMode: keyword("animation-fill-mode"), animationIterationCount, animationName, animationPlayState: keywordWithGlobal("animation-play-state"), backgroundAttachment: keyword("background-attachment"), backgroundClip: keywordWithGlobal("background-clip"), backgroundOrigin: keyword("background-origin"), backgroundPosition, backgroundRepeat: keyword("background-repeat"), backgroundSize, bottom: unitOrKeywordWithGlobal("bottom"), borderCollapse: keyword("border-collapse"), borderStyle: keywordWithGlobal("*-style"), clear: keywordWithGlobal("clear"), cursor: keywordWithGlobal("cursor"), display: keywordWithGlobal("display"), float: keywordWithGlobal("float"), left: unitOrKeywordWithGlobal("left"), fontFamily, fontStretch: keywordWithGlobal("font-stretch"), fontStyle: keywordWithGlobal("font-style"), fontVariant: keywordWithGlobal("font-variant"), fontWeight: keywordWithGlobal("font-weight"), listStyleType: keywordWithGlobal("list-style-type"), listStylePosition: keywordWithGlobal("list-style-position"), outlineStyle: keywordWithGlobal("*-style"), overflow: keywordWithGlobal("overflow"), position: keywordWithGlobal("position"), right: unitOrKeywordWithGlobal("right"), textAlign: keywordWithGlobal("text-align"), textDecoration: keywordWithGlobal("text-decoration"), textOverflow: keywordWithGlobal("text-overflow"), textShadow, top: unitOrKeywordWithGlobal("top"), transform: sameFunctionOrValue, verticalAlign: unitOrKeywordWithGlobal("vertical-align"), visibility: keywordWithGlobal("visibility"), whiteSpace: keywordWithGlobal("white-space"), zIndex } }; } }); // node_modules/clean-css/lib/optimizer/clone.js var require_clone = __commonJS({ "node_modules/clean-css/lib/optimizer/clone.js"(exports, module2) { var wrapSingle = require_wrap_for_optimizing().single; var Token = require_token(); function deep(property) { var cloned = shallow(property); for (var i = property.components.length - 1; i >= 0; i--) { var component = shallow(property.components[i]); component.value = property.components[i].value.slice(0); cloned.components.unshift(component); } cloned.dirty = true; cloned.value = property.value.slice(0); return cloned; } function shallow(property) { var cloned = wrapSingle([ Token.PROPERTY, [Token.PROPERTY_NAME, property.name] ]); cloned.important = property.important; cloned.hack = property.hack; cloned.unused = false; return cloned; } module2.exports = { deep, shallow }; } }); // node_modules/clean-css/lib/optimizer/configuration/restore.js var require_restore = __commonJS({ "node_modules/clean-css/lib/optimizer/configuration/restore.js"(exports, module2) { var shallowClone = require_clone().shallow; var Token = require_token(); var Marker = require_marker(); function isInheritOnly(values) { for (var i = 0, l = values.length; i < l; i++) { var value = values[i][1]; if (value != "inherit" && value != Marker.COMMA && value != Marker.FORWARD_SLASH) { return false; } } return true; } function background(property, configuration, lastInMultiplex) { var components = property.components; var restored = []; var needsOne, needsBoth; function restoreValue(component2) { Array.prototype.unshift.apply(restored, component2.value); } function isDefaultValue(component2) { var descriptor = configuration[component2.name]; if (descriptor.doubleValues && descriptor.defaultValue.length == 1) { return component2.value[0][1] == descriptor.defaultValue[0] && (component2.value[1] ? component2.value[1][1] == descriptor.defaultValue[0] : true); } if (descriptor.doubleValues && descriptor.defaultValue.length != 1) { return component2.value[0][1] == descriptor.defaultValue[0] && (component2.value[1] ? component2.value[1][1] : component2.value[0][1]) == descriptor.defaultValue[1]; } return component2.value[0][1] == descriptor.defaultValue; } for (var i = components.length - 1; i >= 0; i--) { var component = components[i]; var isDefault2 = isDefaultValue(component); if (component.name == "background-clip") { var originComponent = components[i - 1]; var isOriginDefault = isDefaultValue(originComponent); needsOne = component.value[0][1] == originComponent.value[0][1]; needsBoth = !needsOne && (isOriginDefault && !isDefault2 || !isOriginDefault && !isDefault2 || !isOriginDefault && isDefault2 && component.value[0][1] != originComponent.value[0][1]); if (needsOne) { restoreValue(originComponent); } else if (needsBoth) { restoreValue(component); restoreValue(originComponent); } i--; } else if (component.name == "background-size") { var positionComponent = components[i - 1]; var isPositionDefault = isDefaultValue(positionComponent); needsOne = !isPositionDefault && isDefault2; needsBoth = !needsOne && (isPositionDefault && !isDefault2 || !isPositionDefault && !isDefault2); if (needsOne) { restoreValue(positionComponent); } else if (needsBoth) { restoreValue(component); restored.unshift([Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]); restoreValue(positionComponent); } else if (positionComponent.value.length == 1) { restoreValue(positionComponent); } i--; } else { if (isDefault2 || configuration[component.name].multiplexLastOnly && !lastInMultiplex) { continue; } restoreValue(component); } } if (restored.length === 0 && property.value.length == 1 && property.value[0][1] == "0") { restored.push(property.value[0]); } if (restored.length === 0) { restored.push([Token.PROPERTY_VALUE, configuration[property.name].defaultValue]); } if (isInheritOnly(restored)) { return [restored[0]]; } return restored; } function borderRadius(property) { if (property.multiplex) { var horizontal = shallowClone(property); var vertical = shallowClone(property); for (var i = 0; i < 4; i++) { var component = property.components[i]; var horizontalComponent = shallowClone(property); horizontalComponent.value = [component.value[0]]; horizontal.components.push(horizontalComponent); var verticalComponent = shallowClone(property); verticalComponent.value = [component.value[1] || component.value[0]]; vertical.components.push(verticalComponent); } var horizontalValues = fourValues(horizontal); var verticalValues = fourValues(vertical); if (horizontalValues.length == verticalValues.length && horizontalValues[0][1] == verticalValues[0][1] && (horizontalValues.length > 1 ? horizontalValues[1][1] == verticalValues[1][1] : true) && (horizontalValues.length > 2 ? horizontalValues[2][1] == verticalValues[2][1] : true) && (horizontalValues.length > 3 ? horizontalValues[3][1] == verticalValues[3][1] : true)) { return horizontalValues; } return horizontalValues.concat([[Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]]).concat(verticalValues); } return fourValues(property); } function font(property, configuration) { var components = property.components; var restored = []; var component; var componentIndex = 0; var fontFamilyIndex = 0; if (property.value[0][1].indexOf(Marker.INTERNAL) === 0) { property.value[0][1] = property.value[0][1].substring(Marker.INTERNAL.length); return property.value; } while (componentIndex < 4) { component = components[componentIndex]; if (component.value[0][1] != configuration[component.name].defaultValue) { Array.prototype.push.apply(restored, component.value); } componentIndex++; } Array.prototype.push.apply(restored, components[componentIndex].value); componentIndex++; if (components[componentIndex].value[0][1] != configuration[components[componentIndex].name].defaultValue) { Array.prototype.push.apply(restored, [[Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]]); Array.prototype.push.apply(restored, components[componentIndex].value); } componentIndex++; while (components[componentIndex].value[fontFamilyIndex]) { restored.push(components[componentIndex].value[fontFamilyIndex]); if (components[componentIndex].value[fontFamilyIndex + 1]) { restored.push([Token.PROPERTY_VALUE, Marker.COMMA]); } fontFamilyIndex++; } if (isInheritOnly(restored)) { return [restored[0]]; } return restored; } function fourValues(property) { var components = property.components; var value1 = components[0].value[0]; var value2 = components[1].value[0]; var value3 = components[2].value[0]; var value4 = components[3].value[0]; if (value1[1] == value2[1] && value1[1] == value3[1] && value1[1] == value4[1]) { return [value1]; } if (value1[1] == value3[1] && value2[1] == value4[1]) { return [value1, value2]; } if (value2[1] == value4[1]) { return [value1, value2, value3]; } return [value1, value2, value3, value4]; } function multiplex(restoreWith) { return function(property, configuration) { if (!property.multiplex) { return restoreWith(property, configuration, true); } var multiplexSize = 0; var restored = []; var componentMultiplexSoFar = {}; var i, l; for (i = 0, l = property.components[0].value.length; i < l; i++) { if (property.components[0].value[i][1] == Marker.COMMA) { multiplexSize++; } } for (i = 0; i <= multiplexSize; i++) { var _property = shallowClone(property); for (var j = 0, m = property.components.length; j < m; j++) { var componentToClone = property.components[j]; var _component = shallowClone(componentToClone); _property.components.push(_component); for (var k = componentMultiplexSoFar[_component.name] || 0, n = componentToClone.value.length; k < n; k++) { if (componentToClone.value[k][1] == Marker.COMMA) { componentMultiplexSoFar[_component.name] = k + 1; break; } _component.value.push(componentToClone.value[k]); } } var lastInMultiplex = i == multiplexSize; var _restored = restoreWith(_property, configuration, lastInMultiplex); Array.prototype.push.apply(restored, _restored); if (i < multiplexSize) { restored.push([Token.PROPERTY_VALUE, Marker.COMMA]); } } return restored; }; } function withoutDefaults(property, configuration) { var components = property.components; var restored = []; for (var i = components.length - 1; i >= 0; i--) { var component = components[i]; var descriptor = configuration[component.name]; if (component.value[0][1] != descriptor.defaultValue || "keepUnlessDefault" in descriptor && !isDefault(components, configuration, descriptor.keepUnlessDefault)) { restored.unshift(component.value[0]); } } if (restored.length === 0) { restored.push([Token.PROPERTY_VALUE, configuration[property.name].defaultValue]); } if (isInheritOnly(restored)) { return [restored[0]]; } return restored; } function isDefault(components, configuration, propertyName) { var component; var i, l; for (i = 0, l = components.length; i < l; i++) { component = components[i]; if (component.name == propertyName && component.value[0][1] == configuration[propertyName].defaultValue) { return true; } } return false; } module2.exports = { background, borderRadius, font, fourValues, multiplex, withoutDefaults }; } }); // node_modules/clean-css/lib/options/rounding-precision.js var require_rounding_precision = __commonJS({ "node_modules/clean-css/lib/options/rounding-precision.js"(exports, module2) { var override = require_override(); var INTEGER_PATTERN = /^\d+$/; var ALL_UNITS = ["*", "all"]; var DEFAULT_PRECISION = "off"; var DIRECTIVES_SEPARATOR = ","; var DIRECTIVE_VALUE_SEPARATOR = "="; function roundingPrecisionFrom(source) { return override(defaults(DEFAULT_PRECISION), buildPrecisionFrom(source)); } function defaults(value) { return { ch: value, cm: value, em: value, ex: value, in: value, mm: value, pc: value, pt: value, px: value, q: value, rem: value, vh: value, vmax: value, vmin: value, vw: value, "%": value }; } function buildPrecisionFrom(source) { if (source === null || source === void 0) { return {}; } if (typeof source == "boolean") { return {}; } if (typeof source == "number" && source == -1) { return defaults(DEFAULT_PRECISION); } if (typeof source == "number") { return defaults(source); } if (typeof source == "string" && INTEGER_PATTERN.test(source)) { return defaults(parseInt(source)); } if (typeof source == "string" && source == DEFAULT_PRECISION) { return defaults(DEFAULT_PRECISION); } if (typeof source == "object") { return source; } return source.split(DIRECTIVES_SEPARATOR).reduce(function(accumulator, directive) { var directiveParts = directive.split(DIRECTIVE_VALUE_SEPARATOR); var name = directiveParts[0]; var value = parseInt(directiveParts[1]); if (Number.isNaN(value) || value == -1) { value = DEFAULT_PRECISION; } if (ALL_UNITS.indexOf(name) > -1) { accumulator = override(accumulator, defaults(value)); } else { accumulator[name] = value; } return accumulator; }, {}); } module2.exports = { DEFAULT: DEFAULT_PRECISION, roundingPrecisionFrom }; } }); // node_modules/clean-css/lib/options/optimization-level.js var require_optimization_level = __commonJS({ "node_modules/clean-css/lib/options/optimization-level.js"(exports, module2) { var roundingPrecisionFrom = require_rounding_precision().roundingPrecisionFrom; var override = require_override(); var OptimizationLevel = { Zero: "0", One: "1", Two: "2" }; var DEFAULTS = {}; DEFAULTS[OptimizationLevel.Zero] = {}; DEFAULTS[OptimizationLevel.One] = { cleanupCharsets: true, normalizeUrls: true, optimizeBackground: true, optimizeBorderRadius: true, optimizeFilter: true, optimizeFontWeight: true, optimizeOutline: true, removeEmpty: true, removeNegativePaddings: true, removeQuotes: true, removeWhitespace: true, replaceMultipleZeros: true, replaceTimeUnits: true, replaceZeroUnits: true, roundingPrecision: roundingPrecisionFrom(void 0), selectorsSortingMethod: "standard", specialComments: "all", tidyAtRules: true, tidyBlockScopes: true, tidySelectors: true, variableValueOptimizers: [] }; DEFAULTS[OptimizationLevel.Two] = { mergeAdjacentRules: true, mergeIntoShorthands: true, mergeMedia: true, mergeNonAdjacentRules: true, mergeSemantically: false, overrideProperties: true, removeEmpty: true, reduceNonAdjacentRules: true, removeDuplicateFontRules: true, removeDuplicateMediaBlocks: true, removeDuplicateRules: true, removeUnusedAtRules: false, restructureRules: false, skipProperties: [] }; var ALL_KEYWORD_1 = "*"; var ALL_KEYWORD_2 = "all"; var FALSE_KEYWORD_1 = "false"; var FALSE_KEYWORD_2 = "off"; var TRUE_KEYWORD_1 = "true"; var TRUE_KEYWORD_2 = "on"; var LIST_VALUE_SEPARATOR = ","; var OPTION_SEPARATOR = ";"; var OPTION_VALUE_SEPARATOR = ":"; function optimizationLevelFrom(source) { var level = override(DEFAULTS, {}); var Zero = OptimizationLevel.Zero; var One = OptimizationLevel.One; var Two = OptimizationLevel.Two; if (source === void 0) { delete level[Two]; return level; } if (typeof source == "string") { source = parseInt(source); } if (typeof source == "number" && source === parseInt(Two)) { return level; } if (typeof source == "number" && source === parseInt(One)) { delete level[Two]; return level; } if (typeof source == "number" && source === parseInt(Zero)) { delete level[Two]; delete level[One]; return level; } if (typeof source == "object") { source = covertValuesToHashes(source); } if (One in source && "roundingPrecision" in source[One]) { source[One].roundingPrecision = roundingPrecisionFrom(source[One].roundingPrecision); } if (Two in source && "skipProperties" in source[Two] && typeof source[Two].skipProperties == "string") { source[Two].skipProperties = source[Two].skipProperties.split(LIST_VALUE_SEPARATOR); } if (Zero in source || One in source || Two in source) { level[Zero] = override(level[Zero], source[Zero]); } if (One in source && ALL_KEYWORD_1 in source[One]) { level[One] = override(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_1]))); delete source[One][ALL_KEYWORD_1]; } if (One in source && ALL_KEYWORD_2 in source[One]) { level[One] = override(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_2]))); delete source[One][ALL_KEYWORD_2]; } if (One in source || Two in source) { level[One] = override(level[One], source[One]); } else { delete level[One]; } if (Two in source && ALL_KEYWORD_1 in source[Two]) { level[Two] = override(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_1]))); delete source[Two][ALL_KEYWORD_1]; } if (Two in source && ALL_KEYWORD_2 in source[Two]) { level[Two] = override(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_2]))); delete source[Two][ALL_KEYWORD_2]; } if (Two in source) { level[Two] = override(level[Two], source[Two]); } else { delete level[Two]; } return level; } function defaults(level, value) { var options = override(DEFAULTS[level], {}); var key; for (key in options) { if (typeof options[key] == "boolean") { options[key] = value; } } return options; } function normalizeValue(value) { switch (value) { case FALSE_KEYWORD_1: case FALSE_KEYWORD_2: return false; case TRUE_KEYWORD_1: case TRUE_KEYWORD_2: return true; default: return value; } } function covertValuesToHashes(source) { var clonedSource = override(source, {}); var level; var i; for (i = 0; i <= 2; i++) { level = "" + i; if (level in clonedSource && (clonedSource[level] === void 0 || clonedSource[level] === false)) { delete clonedSource[level]; } if (level in clonedSource && clonedSource[level] === true) { clonedSource[level] = {}; } if (level in clonedSource && typeof clonedSource[level] == "string") { clonedSource[level] = covertToHash(clonedSource[level], level); } } return clonedSource; } function covertToHash(asString, level) { return asString.split(OPTION_SEPARATOR).reduce(function(accumulator, directive) { var parts = directive.split(OPTION_VALUE_SEPARATOR); var name = parts[0]; var value = parts[1]; var normalizedValue = normalizeValue(value); if (ALL_KEYWORD_1 == name || ALL_KEYWORD_2 == name) { accumulator = override(accumulator, defaults(level, normalizedValue)); } else { accumulator[name] = normalizedValue; } return accumulator; }, {}); } module2.exports = { OptimizationLevel, optimizationLevelFrom }; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/background.js var require_background = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/background.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var plugin = { level1: { property: function background(_rule, property, options) { var values = property.value; if (!options.level[OptimizationLevel.One].optimizeBackground) { return; } if (values.length == 1 && values[0][1] == "none") { values[0][1] = "0 0"; } if (values.length == 1 && values[0][1] == "transparent") { values[0][1] = "0 0"; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/box-shadow.js var require_box_shadow = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/box-shadow.js"(exports, module2) { var plugin = { level1: { property: function boxShadow(_rule, property) { var values = property.value; if (values.length == 4 && values[0][1] === "0" && values[1][1] === "0" && values[2][1] === "0" && values[3][1] === "0") { property.value.splice(2); property.dirty = true; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/border-radius.js var require_border_radius = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/border-radius.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var plugin = { level1: { property: function borderRadius(_rule, property, options) { var values = property.value; if (!options.level[OptimizationLevel.One].optimizeBorderRadius) { return; } if (values.length == 3 && values[1][1] == "/" && values[0][1] == values[2][1]) { property.value.splice(1); property.dirty = true; } else if (values.length == 5 && values[2][1] == "/" && values[0][1] == values[3][1] && values[1][1] == values[4][1]) { property.value.splice(2); property.dirty = true; } else if (values.length == 7 && values[3][1] == "/" && values[0][1] == values[4][1] && values[1][1] == values[5][1] && values[2][1] == values[6][1]) { property.value.splice(3); property.dirty = true; } else if (values.length == 9 && values[4][1] == "/" && values[0][1] == values[5][1] && values[1][1] == values[6][1] && values[2][1] == values[7][1] && values[3][1] == values[8][1]) { property.value.splice(4); property.dirty = true; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/filter.js var require_filter = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/filter.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var ALPHA_OR_CHROMA_FILTER_PATTERN = /progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\W)/; var NO_SPACE_AFTER_COMMA_PATTERN = /,(\S)/g; var WHITESPACE_AROUND_EQUALS_PATTERN = / ?= ?/g; var plugin = { level1: { property: function filter(_rule, property, options) { if (!options.compatibility.properties.ieFilters) { return; } if (!options.level[OptimizationLevel.One].optimizeFilter) { return; } if (property.value.length == 1) { property.value[0][1] = property.value[0][1].replace(ALPHA_OR_CHROMA_FILTER_PATTERN, function(match, filter2, suffix) { return filter2.toLowerCase() + suffix; }); } property.value[0][1] = property.value[0][1].replace(NO_SPACE_AFTER_COMMA_PATTERN, ", $1").replace(WHITESPACE_AROUND_EQUALS_PATTERN, "="); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/font-weight.js var require_font_weight = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/font-weight.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var plugin = { level1: { property: function fontWeight(_rule, property, options) { var value = property.value[0][1]; if (!options.level[OptimizationLevel.One].optimizeFontWeight) { return; } if (value == "normal") { value = "400"; } else if (value == "bold") { value = "700"; } property.value[0][1] = value; } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/margin.js var require_margin = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/margin.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var plugin = { level1: { property: function margin(_rule, property, options) { var values = property.value; if (!options.level[OptimizationLevel.One].replaceMultipleZeros) { return; } if (values.length == 4 && values[0][1] === "0" && values[1][1] === "0" && values[2][1] === "0" && values[3][1] === "0") { property.value.splice(1); property.dirty = true; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/outline.js var require_outline = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/outline.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var plugin = { level1: { property: function outline(_rule, property, options) { var values = property.value; if (!options.level[OptimizationLevel.One].optimizeOutline) { return; } if (values.length == 1 && values[0][1] == "none") { values[0][1] = "0"; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers/padding.js var require_padding = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers/padding.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; function isNegative(value) { return value && value[1][0] == "-" && parseFloat(value[1]) < 0; } var plugin = { level1: { property: function padding(_rule, property, options) { var values = property.value; if (values.length == 4 && values[0][1] === "0" && values[1][1] === "0" && values[2][1] === "0" && values[3][1] === "0") { property.value.splice(1); property.dirty = true; } if (options.level[OptimizationLevel.One].removeNegativePaddings && (isNegative(property.value[0]) || isNegative(property.value[1]) || isNegative(property.value[2]) || isNegative(property.value[3]))) { property.unused = true; } } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/property-optimizers.js var require_property_optimizers = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/property-optimizers.js"(exports, module2) { module2.exports = { background: require_background().level1.property, boxShadow: require_box_shadow().level1.property, borderRadius: require_border_radius().level1.property, filter: require_filter().level1.property, fontWeight: require_font_weight().level1.property, margin: require_margin().level1.property, outline: require_outline().level1.property, padding: require_padding().level1.property }; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-hex.js var require_shorten_hex = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-hex.js"(exports, module2) { var COLORS = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#0ff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000", blanchedalmond: "#ffebcd", blue: "#00f", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#0ff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#f0f", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", gold: "#ffd700", goldenrod: "#daa520", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavender: "#e6e6fa", lavenderblush: "#fff0f5", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#0f0", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#f00", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#fff", whitesmoke: "#f5f5f5", yellow: "#ff0", yellowgreen: "#9acd32" }; var toHex = {}; var toName = {}; for (name in COLORS) { hex = COLORS[name]; if (name.length < hex.length) { toName[hex] = name; } else { toHex[name] = hex; } } var hex; var name; var toHexPattern = new RegExp("(^| |,|\\))(" + Object.keys(toHex).join("|") + ")( |,|\\)|$)", "ig"); var toNamePattern = new RegExp("(" + Object.keys(toName).join("|") + ")([^a-f0-9]|$)", "ig"); function hexConverter(match, prefix, colorValue, suffix) { return prefix + toHex[colorValue.toLowerCase()] + suffix; } function nameConverter(match, colorValue, suffix) { return toName[colorValue.toLowerCase()] + suffix; } function shortenHex(value) { var hasHex = value.indexOf("#") > -1; var shortened = value.replace(toHexPattern, hexConverter); if (shortened != value) { shortened = shortened.replace(toHexPattern, hexConverter); } return hasHex ? shortened.replace(toNamePattern, nameConverter) : shortened; } module2.exports = shortenHex; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-hsl.js var require_shorten_hsl = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-hsl.js"(exports, module2) { function hslToRgb(h, s, l) { var r, g, b; h %= 360; if (h < 0) { h += 360; } h = ~~h / 360; if (s < 0) { s = 0; } else if (s > 100) { s = 100; } s = ~~s / 100; if (l < 0) { l = 0; } else if (l > 100) { l = 100; } l = ~~l / 100; if (s === 0) { r = g = b = l; } else { var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hueToRgb(p, q, h + 1 / 3); g = hueToRgb(p, q, h); b = hueToRgb(p, q, h - 1 / 3); } return [~~(r * 255), ~~(g * 255), ~~(b * 255)]; } function hueToRgb(p, q, t) { if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1 / 6) { return p + (q - p) * 6 * t; } if (t < 1 / 2) { return q; } if (t < 2 / 3) { return p + (q - p) * (2 / 3 - t) * 6; } return p; } function shortenHsl(hue, saturation, lightness) { var asRgb = hslToRgb(hue, saturation, lightness); var redAsHex = asRgb[0].toString(16); var greenAsHex = asRgb[1].toString(16); var blueAsHex = asRgb[2].toString(16); return "#" + ((redAsHex.length == 1 ? "0" : "") + redAsHex) + ((greenAsHex.length == 1 ? "0" : "") + greenAsHex) + ((blueAsHex.length == 1 ? "0" : "") + blueAsHex); } module2.exports = shortenHsl; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-rgb.js var require_shorten_rgb = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color/shorten-rgb.js"(exports, module2) { function shortenRgb(red, green, blue) { var normalizedRed = Math.max(0, Math.min(parseInt(red), 255)); var normalizedGreen = Math.max(0, Math.min(parseInt(green), 255)); var normalizedBlue = Math.max(0, Math.min(parseInt(blue), 255)); return "#" + ("00000" + (normalizedRed << 16 | normalizedGreen << 8 | normalizedBlue).toString(16)).slice(-6); } module2.exports = shortenRgb; } }); // node_modules/clean-css/lib/utils/split.js var require_split = __commonJS({ "node_modules/clean-css/lib/utils/split.js"(exports, module2) { var Marker = require_marker(); function is(value, separator, isSeparatorRegex) { return isSeparatorRegex ? separator.test(value) : value === separator; } function split(value, separator) { var openLevel = Marker.OPEN_ROUND_BRACKET; var closeLevel = Marker.CLOSE_ROUND_BRACKET; var level = 0; var cursor = 0; var lastStart = 0; var lastValue; var lastCharacter; var len = value.length; var parts = []; var isSeparatorRegex = typeof separator == "object" && "exec" in separator; if (!isSeparatorRegex && value.indexOf(separator) == -1) { return [value]; } if (value.indexOf(openLevel) == -1) { return value.split(separator); } while (cursor < len) { if (value[cursor] == openLevel) { level++; } else if (value[cursor] == closeLevel) { level--; } if (level === 0 && cursor > 0 && cursor + 1 < len && is(value[cursor], separator, isSeparatorRegex)) { parts.push(value.substring(lastStart, cursor)); if (isSeparatorRegex && separator.exec(value[cursor]).length > 1) { parts.push(value[cursor]); } lastStart = cursor + 1; } cursor++; } if (lastStart < cursor + 1) { lastValue = value.substring(lastStart); lastCharacter = lastValue[lastValue.length - 1]; if (is(lastCharacter, separator, isSeparatorRegex)) { lastValue = lastValue.substring(0, lastValue.length - 1); } parts.push(lastValue); } return parts; } module2.exports = split; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color.js var require_color = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/color.js"(exports, module2) { var shortenHex = require_shorten_hex(); var shortenHsl = require_shorten_hsl(); var shortenRgb = require_shorten_rgb(); var split = require_split(); var ANY_COLOR_FUNCTION_PATTERN = /(rgb|rgba|hsl|hsla)\(([^()]+)\)/gi; var COLOR_PREFIX_PATTERN = /#|rgb|hsl/gi; var HEX_LONG_PATTERN = /(^|[^='"])#([0-9a-f]{6})/gi; var HEX_SHORT_PATTERN = /(^|[^='"])#([0-9a-f]{3})/gi; var HEX_VALUE_PATTERN = /[0-9a-f]/i; var HSL_PATTERN = /hsl\((-?\d+),(-?\d+)%?,(-?\d+)%?\)/gi; var RGBA_HSLA_PATTERN = /(rgb|hsl)a?\((-?\d+),(-?\d+%?),(-?\d+%?),(0*[1-9]+[0-9]*(\.?\d*)?)\)/gi; var RGB_PATTERN = /rgb\((-?\d+),(-?\d+),(-?\d+)\)/gi; var TRANSPARENT_FUNCTION_PATTERN = /(?:rgba|hsla)\(0,0%?,0%?,0\)/g; var plugin = { level1: { value: function color(name, value, options) { if (!options.compatibility.properties.colors) { return value; } if (!value.match(COLOR_PREFIX_PATTERN)) { return shortenHex(value); } value = value.replace(RGBA_HSLA_PATTERN, function(match, colorFn, p1, p2, p3, alpha) { return parseInt(alpha) >= 1 ? colorFn + "(" + [p1, p2, p3].join(",") + ")" : match; }).replace(RGB_PATTERN, function(match, red, green, blue) { return shortenRgb(red, green, blue); }).replace(HSL_PATTERN, function(match, hue, saturation, lightness) { return shortenHsl(hue, saturation, lightness); }).replace(HEX_LONG_PATTERN, function(match, prefix, color2, at, inputValue) { var suffix = inputValue[at + match.length]; if (suffix && HEX_VALUE_PATTERN.test(suffix)) { return match; } if (color2[0] == color2[1] && color2[2] == color2[3] && color2[4] == color2[5]) { return (prefix + "#" + color2[0] + color2[2] + color2[4]).toLowerCase(); } return (prefix + "#" + color2).toLowerCase(); }).replace(HEX_SHORT_PATTERN, function(match, prefix, color2) { return prefix + "#" + color2.toLowerCase(); }).replace(ANY_COLOR_FUNCTION_PATTERN, function(match, colorFunction, colorDef) { var tokens = colorDef.split(","); var colorFnLowercase = colorFunction && colorFunction.toLowerCase(); var applies = colorFnLowercase == "hsl" && tokens.length == 3 || colorFnLowercase == "hsla" && tokens.length == 4 || colorFnLowercase == "rgb" && tokens.length === 3 && colorDef.indexOf("%") > 0 || colorFnLowercase == "rgba" && tokens.length == 4 && tokens[0].indexOf("%") > 0; if (!applies) { return match; } if (tokens[1].indexOf("%") == -1) { tokens[1] += "%"; } if (tokens[2].indexOf("%") == -1) { tokens[2] += "%"; } return colorFunction + "(" + tokens.join(",") + ")"; }); if (options.compatibility.colors.opacity && name.indexOf("background") == -1) { value = value.replace(TRANSPARENT_FUNCTION_PATTERN, function(match) { if (split(value, ",").pop().indexOf("gradient(") > -1) { return match; } return "transparent"; }); } return shortenHex(value); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/degrees.js var require_degrees = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/degrees.js"(exports, module2) { var ZERO_DEG_PATTERN = /\(0deg\)/g; var plugin = { level1: { value: function degrees(_name, value, options) { if (!options.compatibility.properties.zeroUnits) { return value; } if (value.indexOf("0deg") == -1) { return value; } return value.replace(ZERO_DEG_PATTERN, "(0)"); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/starts-as-url.js var require_starts_as_url = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/starts-as-url.js"(exports, module2) { var URL_PREFIX_PATTERN = /^url\(/i; function startsAsUrl(value) { return URL_PREFIX_PATTERN.test(value); } module2.exports = startsAsUrl; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/fraction.js var require_fraction = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/fraction.js"(exports, module2) { var split = require_split(); var startsAsUrl = require_starts_as_url(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var EXPRESSION_PATTERN = /^expression\(.*\)$/; var ANY_FUNCTION_PATTERN = /^(-(?:moz|ms|o|webkit)-[a-z-]+|[a-z-]+)\((.+)\)$/; var TOKEN_SEPARATOR_PATTERN = /([\s,/])/; var DOT_ZERO_PATTERN = /(^|\D)\.0+(\D|$)/g; var FRACTION_PATTERN = /\.([1-9]*)0+(\D|$)/g; var LEADING_ZERO_FRACTION_PATTERN = /(^|\D)0\.(\d)/g; var MINUS_ZERO_FRACTION_PATTERN = /([^\w\d-]|^)-0([^.]|$)/g; var ZERO_PREFIXED_UNIT_PATTERN = /(^|\s)0+([1-9])/g; function optimizeRecursively(value) { var functionTokens; var tokens; if (startsAsUrl(value)) { return value; } if (EXPRESSION_PATTERN.test(value)) { return value; } functionTokens = ANY_FUNCTION_PATTERN.exec(value); if (!functionTokens) { return optimizeFractions(value); } tokens = split(functionTokens[2], TOKEN_SEPARATOR_PATTERN).map(function(token) { return optimizeRecursively(token); }); return functionTokens[1] + "(" + tokens.join("") + ")"; } function optimizeFractions(value) { if (value.indexOf("0") == -1) { return value; } if (value.indexOf("-") > -1) { value = value.replace(MINUS_ZERO_FRACTION_PATTERN, "$10$2").replace(MINUS_ZERO_FRACTION_PATTERN, "$10$2"); } return value.replace(ZERO_PREFIXED_UNIT_PATTERN, "$1$2").replace(DOT_ZERO_PATTERN, "$10$2").replace(FRACTION_PATTERN, function(match, nonZeroPart, suffix) { return (nonZeroPart.length > 0 ? "." : "") + nonZeroPart + suffix; }).replace(LEADING_ZERO_FRACTION_PATTERN, "$1.$2"); } var plugin = { level1: { value: function fraction(name, value, options) { if (!options.level[OptimizationLevel.One].replaceZeroUnits) { return value; } return optimizeRecursively(value); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/precision.js var require_precision = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/precision.js"(exports, module2) { var plugin = { level1: { value: function precision(_name, value, options) { if (!options.precision.enabled || value.indexOf(".") === -1) { return value; } return value.replace(options.precision.decimalPointMatcher, "$1$2$3").replace(options.precision.zeroMatcher, function(match, integerPart, fractionPart, unit) { var multiplier = options.precision.units[unit].multiplier; var parsedInteger = parseInt(integerPart); var integer = Number.isNaN(parsedInteger) ? 0 : parsedInteger; var fraction = parseFloat(fractionPart); return Math.round((integer + fraction) * multiplier) / multiplier + unit; }); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/text-quotes.js var require_text_quotes = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/text-quotes.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var LOCAL_PREFIX_PATTERN = /^local\(/i; var QUOTED_PATTERN = /^('.*'|".*")$/; var QUOTED_BUT_SAFE_PATTERN = /^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/; var GENERIC_FONT_FAMILY_PATTERN = /^['"](?:cursive|default|emoji|fangsong|fantasy|inherit|initial|math|monospace|revert|revert-layer|sans-serif|serif|system-ui|ui-monospace|ui-rounded|ui-sans-serif|ui-serif|unset)['"]$/; var plugin = { level1: { value: function textQuotes(name, value, options) { if ((name == "font-family" || name == "font") && GENERIC_FONT_FAMILY_PATTERN.test(value)) { return value; } if (!options.level[OptimizationLevel.One].removeQuotes) { return value; } if (!QUOTED_PATTERN.test(value) && !LOCAL_PREFIX_PATTERN.test(value)) { return value; } return QUOTED_BUT_SAFE_PATTERN.test(value) ? value.substring(1, value.length - 1) : value; } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/time.js var require_time = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/time.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var TIME_VALUE = /^(-?[\d.]+)(m?s)$/; var plugin = { level1: { value: function time(name, value, options) { if (!options.level[OptimizationLevel.One].replaceTimeUnits) { return value; } if (!TIME_VALUE.test(value)) { return value; } return value.replace(TIME_VALUE, function(match, val, unit) { var newValue; if (unit == "ms") { newValue = parseInt(val) / 1e3 + "s"; } else if (unit == "s") { newValue = parseFloat(val) * 1e3 + "ms"; } return newValue.length < match.length ? newValue : match; }); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js var require_unit = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/unit.js"(exports, module2) { var WHOLE_PIXEL_VALUE = /(?:^|\s|\()(-?\d+)px/; var plugin = { level1: { value: function unit(_name, value, options) { if (!WHOLE_PIXEL_VALUE.test(value)) { return value; } return value.replace(WHOLE_PIXEL_VALUE, function(match, val) { var newValue; var intVal = parseInt(val); if (intVal === 0) { return match; } if (options.compatibility.properties.shorterLengthUnits && options.compatibility.units.pt && intVal * 3 % 4 === 0) { newValue = intVal * 3 / 4 + "pt"; } if (options.compatibility.properties.shorterLengthUnits && options.compatibility.units.pc && intVal % 16 === 0) { newValue = intVal / 16 + "pc"; } if (options.compatibility.properties.shorterLengthUnits && options.compatibility.units.in && intVal % 96 === 0) { newValue = intVal / 96 + "in"; } if (newValue) { newValue = match.substring(0, match.indexOf(val)) + newValue; } return newValue && newValue.length < match.length ? newValue : match; }); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-prefix.js var require_url_prefix = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-prefix.js"(exports, module2) { var startsAsUrl = require_starts_as_url(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var URL_PREFIX_PATTERN = /^url\(/i; var plugin = { level1: { value: function urlPrefix(_name, value, options) { if (!options.level[OptimizationLevel.One].normalizeUrls) { return value; } if (!startsAsUrl(value)) { return value; } return value.replace(URL_PREFIX_PATTERN, "url("); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-quotes.js var require_url_quotes = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-quotes.js"(exports, module2) { var QUOTED_URL_PATTERN = /^url\(['"].+['"]\)$/; var QUOTED_URL_WITH_WHITESPACE_PATTERN = /^url\(['"].*[*\s()'"].*['"]\)$/; var QUOTES_PATTERN = /["']/g; var URL_DATA_PATTERN = /^url\(['"]data:[^;]+;charset/; var plugin = { level1: { value: function urlQuotes(_name, value, options) { if (options.compatibility.properties.urlQuotes) { return value; } return QUOTED_URL_PATTERN.test(value) && !QUOTED_URL_WITH_WHITESPACE_PATTERN.test(value) && !URL_DATA_PATTERN.test(value) ? value.replace(QUOTES_PATTERN, "") : value; } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-whitespace.js var require_url_whitespace = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-whitespace.js"(exports, module2) { var startsAsUrl = require_starts_as_url(); var WHITESPACE_PATTERN = /\\?\n|\\?\r\n/g; var WHITESPACE_PREFIX_PATTERN = /(\()\s+/g; var WHITESPACE_SUFFIX_PATTERN = /\s+(\))/g; var plugin = { level1: { value: function urlWhitespace(_name, value) { if (!startsAsUrl(value)) { return value; } return value.replace(WHITESPACE_PATTERN, "").replace(WHITESPACE_PREFIX_PATTERN, "$1").replace(WHITESPACE_SUFFIX_PATTERN, "$1"); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/whitespace.js var require_whitespace = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/whitespace.js"(exports, module2) { var OptimizationLevel = require_optimization_level().OptimizationLevel; var Marker = require_marker(); var CALC_DIVISION_WHITESPACE_PATTERN = /\) ?\/ ?/g; var COMMA_AND_SPACE_PATTERN = /, /g; var LINE_BREAK_PATTERN = /\r?\n/g; var MULTI_WHITESPACE_PATTERN = /\s+/g; var FUNCTION_CLOSING_BRACE_WHITESPACE_PATTERN = /\s+(;?\))/g; var FUNCTION_OPENING_BRACE_WHITESPACE_PATTERN = /(\(;?)\s+/g; var VARIABLE_NAME_PATTERN = /^--\S+$/; var VARIABLE_VALUE_PATTERN = /^var\(\s*--\S+\s*\)$/; var plugin = { level1: { value: function whitespace(name, value, options) { if (!options.level[OptimizationLevel.One].removeWhitespace) { return value; } if (VARIABLE_NAME_PATTERN.test(name) && !VARIABLE_VALUE_PATTERN.test(value)) { return value; } if (value.indexOf(" ") == -1 && value.indexOf("\n") == -1 || value.indexOf("expression") === 0) { return value; } if (value.indexOf(Marker.SINGLE_QUOTE) > -1 || value.indexOf(Marker.DOUBLE_QUOTE) > -1) { return value; } value = value.replace(LINE_BREAK_PATTERN, ""); value = value.replace(MULTI_WHITESPACE_PATTERN, " "); if (value.indexOf("calc") > -1) { value = value.replace(CALC_DIVISION_WHITESPACE_PATTERN, ")/ "); } return value.replace(FUNCTION_OPENING_BRACE_WHITESPACE_PATTERN, "$1").replace(FUNCTION_CLOSING_BRACE_WHITESPACE_PATTERN, "$1").replace(COMMA_AND_SPACE_PATTERN, ","); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers/zero.js var require_zero = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers/zero.js"(exports, module2) { var split = require_split(); var ANY_FUNCTION_PATTERN = /^(-(?:moz|ms|o|webkit)-[a-z-]+|[a-z-]+)\((.+)\)$/; var SKIP_FUNCTION_PATTERN = /^(?:-moz-calc|-webkit-calc|calc|rgb|hsl|rgba|hsla|min|max|clamp|expression)\(/; var TOKEN_SEPARATOR_PATTERN = /([\s,/])/; function removeRecursively(value, options) { var functionTokens; var tokens; if (SKIP_FUNCTION_PATTERN.test(value)) { return value; } functionTokens = ANY_FUNCTION_PATTERN.exec(value); if (!functionTokens) { return removeZeros(value, options); } tokens = split(functionTokens[2], TOKEN_SEPARATOR_PATTERN).map(function(token) { return removeRecursively(token, options); }); return functionTokens[1] + "(" + tokens.join("") + ")"; } function removeZeros(value, options) { return value.replace(options.unitsRegexp, "$10$2").replace(options.unitsRegexp, "$10$2"); } var plugin = { level1: { value: function zero(name, value, options) { if (!options.compatibility.properties.zeroUnits) { return value; } if (value.indexOf("%") > 0 && (name == "height" || name == "max-height" || name == "width" || name == "max-width")) { return value; } return removeRecursively(value, options); } } }; module2.exports = plugin; } }); // node_modules/clean-css/lib/optimizer/level-1/value-optimizers.js var require_value_optimizers = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/value-optimizers.js"(exports, module2) { module2.exports = { color: require_color().level1.value, degrees: require_degrees().level1.value, fraction: require_fraction().level1.value, precision: require_precision().level1.value, textQuotes: require_text_quotes().level1.value, time: require_time().level1.value, unit: require_unit().level1.value, urlPrefix: require_url_prefix().level1.value, urlQuotes: require_url_quotes().level1.value, urlWhiteSpace: require_url_whitespace().level1.value, whiteSpace: require_whitespace().level1.value, zero: require_zero().level1.value }; } }); // node_modules/clean-css/lib/optimizer/configuration.js var require_configuration = __commonJS({ "node_modules/clean-css/lib/optimizer/configuration.js"(exports, module2) { var breakUp = require_break_up(); var canOverride = require_can_override(); var restore = require_restore(); var propertyOptimizers = require_property_optimizers(); var valueOptimizers = require_value_optimizers(); var override = require_override(); var configuration = { animation: { canOverride: canOverride.generic.components([ canOverride.generic.time, canOverride.generic.timingFunction, canOverride.generic.time, canOverride.property.animationIterationCount, canOverride.property.animationDirection, canOverride.property.animationFillMode, canOverride.property.animationPlayState, canOverride.property.animationName ]), components: [ "animation-duration", "animation-timing-function", "animation-delay", "animation-iteration-count", "animation-direction", "animation-fill-mode", "animation-play-state", "animation-name" ], breakUp: breakUp.multiplex(breakUp.animation), defaultValue: "none", restore: restore.multiplex(restore.withoutDefaults), shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.textQuotes, valueOptimizers.time, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-delay": { canOverride: canOverride.generic.time, componentOf: [ "animation" ], defaultValue: "0s", intoMultiplexMode: "real", valueOptimizers: [ valueOptimizers.time, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-direction": { canOverride: canOverride.property.animationDirection, componentOf: [ "animation" ], defaultValue: "normal", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-duration": { canOverride: canOverride.generic.time, componentOf: [ "animation" ], defaultValue: "0s", intoMultiplexMode: "real", keepUnlessDefault: "animation-delay", valueOptimizers: [ valueOptimizers.time, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-fill-mode": { canOverride: canOverride.property.animationFillMode, componentOf: [ "animation" ], defaultValue: "none", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-iteration-count": { canOverride: canOverride.property.animationIterationCount, componentOf: [ "animation" ], defaultValue: "1", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-name": { canOverride: canOverride.property.animationName, componentOf: [ "animation" ], defaultValue: "none", intoMultiplexMode: "real", valueOptimizers: [ valueOptimizers.textQuotes ], vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-play-state": { canOverride: canOverride.property.animationPlayState, componentOf: [ "animation" ], defaultValue: "running", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, "animation-timing-function": { canOverride: canOverride.generic.timingFunction, componentOf: [ "animation" ], defaultValue: "ease", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-o-", "-webkit-" ] }, background: { canOverride: canOverride.generic.components([ canOverride.generic.image, canOverride.property.backgroundPosition, canOverride.property.backgroundSize, canOverride.property.backgroundRepeat, canOverride.property.backgroundAttachment, canOverride.property.backgroundOrigin, canOverride.property.backgroundClip, canOverride.generic.color ]), components: [ "background-image", "background-position", "background-size", "background-repeat", "background-attachment", "background-origin", "background-clip", "background-color" ], breakUp: breakUp.multiplex(breakUp.background), defaultValue: "0 0", propertyOptimizer: propertyOptimizers.background, restore: restore.multiplex(restore.background), shortestValue: "0", shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.urlWhiteSpace, valueOptimizers.fraction, valueOptimizers.zero, valueOptimizers.color, valueOptimizers.urlPrefix, valueOptimizers.urlQuotes ] }, "background-attachment": { canOverride: canOverride.property.backgroundAttachment, componentOf: [ "background" ], defaultValue: "scroll", intoMultiplexMode: "real" }, "background-clip": { canOverride: canOverride.property.backgroundClip, componentOf: [ "background" ], defaultValue: "border-box", intoMultiplexMode: "real", shortestValue: "border-box" }, "background-color": { canOverride: canOverride.generic.color, componentOf: [ "background" ], defaultValue: "transparent", intoMultiplexMode: "real", multiplexLastOnly: true, nonMergeableValue: "none", shortestValue: "red", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "background-image": { canOverride: canOverride.generic.image, componentOf: [ "background" ], defaultValue: "none", intoMultiplexMode: "default", valueOptimizers: [ valueOptimizers.urlWhiteSpace, valueOptimizers.urlPrefix, valueOptimizers.urlQuotes, valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero, valueOptimizers.color ] }, "background-origin": { canOverride: canOverride.property.backgroundOrigin, componentOf: [ "background" ], defaultValue: "padding-box", intoMultiplexMode: "real", shortestValue: "border-box" }, "background-position": { canOverride: canOverride.property.backgroundPosition, componentOf: [ "background" ], defaultValue: ["0", "0"], doubleValues: true, intoMultiplexMode: "real", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "background-repeat": { canOverride: canOverride.property.backgroundRepeat, componentOf: [ "background" ], defaultValue: ["repeat"], doubleValues: true, intoMultiplexMode: "real" }, "background-size": { canOverride: canOverride.property.backgroundSize, componentOf: [ "background" ], defaultValue: ["auto"], doubleValues: true, intoMultiplexMode: "real", shortestValue: "0 0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, bottom: { canOverride: canOverride.property.bottom, defaultValue: "auto", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, border: { breakUp: breakUp.border, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.property.borderStyle, canOverride.generic.color ]), components: [ "border-width", "border-style", "border-color" ], defaultValue: "none", overridesShorthands: [ "border-bottom", "border-left", "border-right", "border-top" ], restore: restore.withoutDefaults, shorthand: true, shorthandComponents: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.zero, valueOptimizers.color ] }, "border-bottom": { breakUp: breakUp.border, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.property.borderStyle, canOverride.generic.color ]), components: [ "border-bottom-width", "border-bottom-style", "border-bottom-color" ], defaultValue: "none", restore: restore.withoutDefaults, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.zero, valueOptimizers.color ] }, "border-bottom-color": { canOverride: canOverride.generic.color, componentOf: [ "border-bottom", "border-color" ], defaultValue: "none", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-bottom-left-radius": { canOverride: canOverride.generic.unit, componentOf: [ "border-radius" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.borderRadius, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-" ] }, "border-bottom-right-radius": { canOverride: canOverride.generic.unit, componentOf: [ "border-radius" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.borderRadius, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-" ] }, "border-bottom-style": { canOverride: canOverride.property.borderStyle, componentOf: [ "border-bottom", "border-style" ], defaultValue: "none" }, "border-bottom-width": { canOverride: canOverride.generic.unit, componentOf: [ "border-bottom", "border-width" ], defaultValue: "medium", oppositeTo: "border-top-width", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "border-collapse": { canOverride: canOverride.property.borderCollapse, defaultValue: "separate" }, "border-color": { breakUp: breakUp.fourValues, canOverride: canOverride.generic.components([ canOverride.generic.color, canOverride.generic.color, canOverride.generic.color, canOverride.generic.color ]), componentOf: [ "border" ], components: [ "border-top-color", "border-right-color", "border-bottom-color", "border-left-color" ], defaultValue: "none", restore: restore.fourValues, shortestValue: "red", shorthand: true, singleTypeComponents: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-left": { breakUp: breakUp.border, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.property.borderStyle, canOverride.generic.color ]), components: [ "border-left-width", "border-left-style", "border-left-color" ], defaultValue: "none", restore: restore.withoutDefaults, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.zero, valueOptimizers.color ] }, "border-left-color": { canOverride: canOverride.generic.color, componentOf: [ "border-color", "border-left" ], defaultValue: "none", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-left-style": { canOverride: canOverride.property.borderStyle, componentOf: [ "border-left", "border-style" ], defaultValue: "none" }, "border-left-width": { canOverride: canOverride.generic.unit, componentOf: [ "border-left", "border-width" ], defaultValue: "medium", oppositeTo: "border-right-width", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "border-radius": { breakUp: breakUp.borderRadius, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit ]), components: [ "border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.borderRadius, restore: restore.borderRadius, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-" ] }, "border-right": { breakUp: breakUp.border, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.property.borderStyle, canOverride.generic.color ]), components: [ "border-right-width", "border-right-style", "border-right-color" ], defaultValue: "none", restore: restore.withoutDefaults, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-right-color": { canOverride: canOverride.generic.color, componentOf: [ "border-color", "border-right" ], defaultValue: "none", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-right-style": { canOverride: canOverride.property.borderStyle, componentOf: [ "border-right", "border-style" ], defaultValue: "none" }, "border-right-width": { canOverride: canOverride.generic.unit, componentOf: [ "border-right", "border-width" ], defaultValue: "medium", oppositeTo: "border-left-width", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "border-style": { breakUp: breakUp.fourValues, canOverride: canOverride.generic.components([ canOverride.property.borderStyle, canOverride.property.borderStyle, canOverride.property.borderStyle, canOverride.property.borderStyle ]), componentOf: [ "border" ], components: [ "border-top-style", "border-right-style", "border-bottom-style", "border-left-style" ], defaultValue: "none", restore: restore.fourValues, shorthand: true, singleTypeComponents: true }, "border-top": { breakUp: breakUp.border, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.property.borderStyle, canOverride.generic.color ]), components: [ "border-top-width", "border-top-style", "border-top-color" ], defaultValue: "none", restore: restore.withoutDefaults, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.zero, valueOptimizers.color, valueOptimizers.unit ] }, "border-top-color": { canOverride: canOverride.generic.color, componentOf: [ "border-color", "border-top" ], defaultValue: "none", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "border-top-left-radius": { canOverride: canOverride.generic.unit, componentOf: [ "border-radius" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.borderRadius, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-" ] }, "border-top-right-radius": { canOverride: canOverride.generic.unit, componentOf: [ "border-radius" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.borderRadius, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-o-" ] }, "border-top-style": { canOverride: canOverride.property.borderStyle, componentOf: [ "border-style", "border-top" ], defaultValue: "none" }, "border-top-width": { canOverride: canOverride.generic.unit, componentOf: [ "border-top", "border-width" ], defaultValue: "medium", oppositeTo: "border-bottom-width", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "border-width": { breakUp: breakUp.fourValues, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit ]), componentOf: [ "border" ], components: [ "border-top-width", "border-right-width", "border-bottom-width", "border-left-width" ], defaultValue: "medium", restore: restore.fourValues, shortestValue: "0", shorthand: true, singleTypeComponents: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "box-shadow": { propertyOptimizer: propertyOptimizers.boxShadow, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero, valueOptimizers.color ], vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, clear: { canOverride: canOverride.property.clear, defaultValue: "none" }, clip: { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, color: { canOverride: canOverride.generic.color, defaultValue: "transparent", shortestValue: "red", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "column-gap": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, cursor: { canOverride: canOverride.property.cursor, defaultValue: "auto" }, display: { canOverride: canOverride.property.display }, filter: { propertyOptimizer: propertyOptimizers.filter, valueOptimizers: [ valueOptimizers.fraction ] }, float: { canOverride: canOverride.property.float, defaultValue: "none" }, font: { breakUp: breakUp.font, canOverride: canOverride.generic.components([ canOverride.property.fontStyle, canOverride.property.fontVariant, canOverride.property.fontWeight, canOverride.property.fontStretch, canOverride.generic.unit, canOverride.generic.unit, canOverride.property.fontFamily ]), components: [ "font-style", "font-variant", "font-weight", "font-stretch", "font-size", "line-height", "font-family" ], restore: restore.font, shorthand: true, valueOptimizers: [ valueOptimizers.textQuotes ] }, "font-family": { canOverride: canOverride.property.fontFamily, defaultValue: "user|agent|specific", valueOptimizers: [ valueOptimizers.textQuotes ] }, "font-size": { canOverride: canOverride.generic.unit, defaultValue: "medium", shortestValue: "0", valueOptimizers: [ valueOptimizers.fraction ] }, "font-stretch": { canOverride: canOverride.property.fontStretch, defaultValue: "normal" }, "font-style": { canOverride: canOverride.property.fontStyle, defaultValue: "normal" }, "font-variant": { canOverride: canOverride.property.fontVariant, defaultValue: "normal" }, "font-weight": { canOverride: canOverride.property.fontWeight, defaultValue: "normal", propertyOptimizer: propertyOptimizers.fontWeight, shortestValue: "400" }, gap: { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, height: { canOverride: canOverride.generic.unit, defaultValue: "auto", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, left: { canOverride: canOverride.property.left, defaultValue: "auto", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "letter-spacing": { valueOptimizers: [ valueOptimizers.fraction, valueOptimizers.zero ] }, "line-height": { canOverride: canOverride.generic.unitOrNumber, defaultValue: "normal", shortestValue: "0", valueOptimizers: [ valueOptimizers.fraction, valueOptimizers.zero ] }, "list-style": { canOverride: canOverride.generic.components([ canOverride.property.listStyleType, canOverride.property.listStylePosition, canOverride.property.listStyleImage ]), components: [ "list-style-type", "list-style-position", "list-style-image" ], breakUp: breakUp.listStyle, restore: restore.withoutDefaults, defaultValue: "outside", shortestValue: "none", shorthand: true }, "list-style-image": { canOverride: canOverride.generic.image, componentOf: [ "list-style" ], defaultValue: "none" }, "list-style-position": { canOverride: canOverride.property.listStylePosition, componentOf: [ "list-style" ], defaultValue: "outside", shortestValue: "inside" }, "list-style-type": { canOverride: canOverride.property.listStyleType, componentOf: [ "list-style" ], defaultValue: "decimal|disc", shortestValue: "none" }, margin: { breakUp: breakUp.fourValues, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit ]), components: [ "margin-top", "margin-right", "margin-bottom", "margin-left" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.margin, restore: restore.fourValues, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-bottom": { canOverride: canOverride.generic.unit, componentOf: [ "margin" ], defaultValue: "0", oppositeTo: "margin-top", propertyOptimizer: propertyOptimizers.margin, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-inline-end": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-inline-start": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-left": { canOverride: canOverride.generic.unit, componentOf: [ "margin" ], defaultValue: "0", oppositeTo: "margin-right", propertyOptimizer: propertyOptimizers.margin, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-right": { canOverride: canOverride.generic.unit, componentOf: [ "margin" ], defaultValue: "0", oppositeTo: "margin-left", propertyOptimizer: propertyOptimizers.margin, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "margin-top": { canOverride: canOverride.generic.unit, componentOf: [ "margin" ], defaultValue: "0", oppositeTo: "margin-bottom", propertyOptimizer: propertyOptimizers.margin, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "max-height": { canOverride: canOverride.generic.unit, defaultValue: "none", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "max-width": { canOverride: canOverride.generic.unit, defaultValue: "none", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "min-height": { canOverride: canOverride.generic.unit, defaultValue: "0", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "min-width": { canOverride: canOverride.generic.unit, defaultValue: "0", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, opacity: { valueOptimizers: [ valueOptimizers.fraction, valueOptimizers.precision ] }, outline: { canOverride: canOverride.generic.components([ canOverride.generic.color, canOverride.property.outlineStyle, canOverride.generic.unit ]), components: [ "outline-color", "outline-style", "outline-width" ], breakUp: breakUp.outline, restore: restore.withoutDefaults, defaultValue: "0", propertyOptimizer: propertyOptimizers.outline, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "outline-color": { canOverride: canOverride.generic.color, componentOf: [ "outline" ], defaultValue: "invert", shortestValue: "red", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.color ] }, "outline-style": { canOverride: canOverride.property.outlineStyle, componentOf: [ "outline" ], defaultValue: "none" }, "outline-width": { canOverride: canOverride.generic.unit, componentOf: [ "outline" ], defaultValue: "medium", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, overflow: { canOverride: canOverride.property.overflow, defaultValue: "visible" }, "overflow-x": { canOverride: canOverride.property.overflow, defaultValue: "visible" }, "overflow-y": { canOverride: canOverride.property.overflow, defaultValue: "visible" }, padding: { breakUp: breakUp.fourValues, canOverride: canOverride.generic.components([ canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit, canOverride.generic.unit ]), components: [ "padding-top", "padding-right", "padding-bottom", "padding-left" ], defaultValue: "0", propertyOptimizer: propertyOptimizers.padding, restore: restore.fourValues, shorthand: true, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "padding-bottom": { canOverride: canOverride.generic.unit, componentOf: [ "padding" ], defaultValue: "0", oppositeTo: "padding-top", propertyOptimizer: propertyOptimizers.padding, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "padding-left": { canOverride: canOverride.generic.unit, componentOf: [ "padding" ], defaultValue: "0", oppositeTo: "padding-right", propertyOptimizer: propertyOptimizers.padding, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "padding-right": { canOverride: canOverride.generic.unit, componentOf: [ "padding" ], defaultValue: "0", oppositeTo: "padding-left", propertyOptimizer: propertyOptimizers.padding, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "padding-top": { canOverride: canOverride.generic.unit, componentOf: [ "padding" ], defaultValue: "0", oppositeTo: "padding-bottom", propertyOptimizer: propertyOptimizers.padding, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, position: { canOverride: canOverride.property.position, defaultValue: "static" }, right: { canOverride: canOverride.property.right, defaultValue: "auto", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "row-gap": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, src: { valueOptimizers: [ valueOptimizers.urlWhiteSpace, valueOptimizers.urlPrefix, valueOptimizers.urlQuotes ] }, "stroke-width": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "text-align": { canOverride: canOverride.property.textAlign, defaultValue: "left|right" }, "text-decoration": { canOverride: canOverride.property.textDecoration, defaultValue: "none" }, "text-indent": { canOverride: canOverride.property.textOverflow, defaultValue: "none", valueOptimizers: [ valueOptimizers.fraction, valueOptimizers.zero ] }, "text-overflow": { canOverride: canOverride.property.textOverflow, defaultValue: "none" }, "text-shadow": { canOverride: canOverride.property.textShadow, defaultValue: "none", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.zero, valueOptimizers.color ] }, top: { canOverride: canOverride.property.top, defaultValue: "auto", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, transform: { canOverride: canOverride.property.transform, valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.degrees, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ], vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, transition: { breakUp: breakUp.multiplex(breakUp.transition), canOverride: canOverride.generic.components([ canOverride.property.transitionProperty, canOverride.generic.time, canOverride.generic.timingFunction, canOverride.generic.time ]), components: [ "transition-property", "transition-duration", "transition-timing-function", "transition-delay" ], defaultValue: "none", restore: restore.multiplex(restore.withoutDefaults), shorthand: true, valueOptimizers: [ valueOptimizers.time, valueOptimizers.fraction ], vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, "transition-delay": { canOverride: canOverride.generic.time, componentOf: [ "transition" ], defaultValue: "0s", intoMultiplexMode: "real", valueOptimizers: [ valueOptimizers.time ], vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, "transition-duration": { canOverride: canOverride.generic.time, componentOf: [ "transition" ], defaultValue: "0s", intoMultiplexMode: "real", keepUnlessDefault: "transition-delay", valueOptimizers: [ valueOptimizers.time, valueOptimizers.fraction ], vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, "transition-property": { canOverride: canOverride.generic.propertyName, componentOf: [ "transition" ], defaultValue: "all", intoMultiplexMode: "placeholder", placeholderValue: "_", vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, "transition-timing-function": { canOverride: canOverride.generic.timingFunction, componentOf: [ "transition" ], defaultValue: "ease", intoMultiplexMode: "real", vendorPrefixes: [ "-moz-", "-ms-", "-o-", "-webkit-" ] }, "vertical-align": { canOverride: canOverride.property.verticalAlign, defaultValue: "baseline", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, visibility: { canOverride: canOverride.property.visibility, defaultValue: "visible" }, "-webkit-tap-highlight-color": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.color ] }, "-webkit-margin-end": { valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "white-space": { canOverride: canOverride.property.whiteSpace, defaultValue: "normal" }, width: { canOverride: canOverride.generic.unit, defaultValue: "auto", shortestValue: "0", valueOptimizers: [ valueOptimizers.whiteSpace, valueOptimizers.fraction, valueOptimizers.precision, valueOptimizers.unit, valueOptimizers.zero ] }, "z-index": { canOverride: canOverride.property.zIndex, defaultValue: "auto" } }; var vendorPrefixedConfiguration = {}; function cloneDescriptor(propertyName2, prefix2) { var clonedDescriptor2 = override(configuration[propertyName2], {}); if ("componentOf" in clonedDescriptor2) { clonedDescriptor2.componentOf = clonedDescriptor2.componentOf.map(function(shorthandName) { return prefix2 + shorthandName; }); } if ("components" in clonedDescriptor2) { clonedDescriptor2.components = clonedDescriptor2.components.map(function(longhandName) { return prefix2 + longhandName; }); } if ("keepUnlessDefault" in clonedDescriptor2) { clonedDescriptor2.keepUnlessDefault = prefix2 + clonedDescriptor2.keepUnlessDefault; } return clonedDescriptor2; } for (propertyName in configuration) { descriptor = configuration[propertyName]; if (!("vendorPrefixes" in descriptor)) { continue; } for (i = 0; i < descriptor.vendorPrefixes.length; i++) { prefix = descriptor.vendorPrefixes[i]; clonedDescriptor = cloneDescriptor(propertyName, prefix); delete clonedDescriptor.vendorPrefixes; vendorPrefixedConfiguration[prefix + propertyName] = clonedDescriptor; } delete descriptor.vendorPrefixes; } var descriptor; var prefix; var clonedDescriptor; var i; var propertyName; module2.exports = override(configuration, vendorPrefixedConfiguration); } }); // node_modules/clean-css/lib/writer/helpers.js var require_helpers = __commonJS({ "node_modules/clean-css/lib/writer/helpers.js"(exports, module2) { var emptyCharacter = ""; var Breaks = require_format().Breaks; var Spaces = require_format().Spaces; var Marker = require_marker(); var Token = require_token(); function supportsAfterClosingBrace(token) { return token[1][1] == "background" || token[1][1] == "transform" || token[1][1] == "src"; } function afterClosingBrace(token, valueIndex) { return token[valueIndex][1][token[valueIndex][1].length - 1] == Marker.CLOSE_ROUND_BRACKET; } function afterComma(token, valueIndex) { return token[valueIndex][1] == Marker.COMMA; } function afterSlash(token, valueIndex) { return token[valueIndex][1] == Marker.FORWARD_SLASH; } function beforeComma(token, valueIndex) { return token[valueIndex + 1] && token[valueIndex + 1][1] == Marker.COMMA; } function beforeSlash(token, valueIndex) { return token[valueIndex + 1] && token[valueIndex + 1][1] == Marker.FORWARD_SLASH; } function inFilter(token) { return token[1][1] == "filter" || token[1][1] == "-ms-filter"; } function disallowsSpace(context, token, valueIndex) { return !context.spaceAfterClosingBrace && supportsAfterClosingBrace(token) && afterClosingBrace(token, valueIndex) || beforeSlash(token, valueIndex) || afterSlash(token, valueIndex) || beforeComma(token, valueIndex) || afterComma(token, valueIndex); } function rules(context, tokens) { var store = context.store; for (var i = 0, l = tokens.length; i < l; i++) { store(context, tokens[i]); if (i < l - 1) { store(context, comma(context)); } } } function body(context, tokens) { var lastPropertyAt = lastPropertyIndex(tokens); for (var i = 0, l = tokens.length; i < l; i++) { property(context, tokens, i, lastPropertyAt); } } function lastPropertyIndex(tokens) { var index = tokens.length - 1; for (; index >= 0; index--) { if (tokens[index][0] != Token.COMMENT) { break; } } return index; } function property(context, tokens, position, lastPropertyAt) { var store = context.store; var token = tokens[position]; var propertyValue = token[2]; var isPropertyBlock = propertyValue && propertyValue[0] === Token.PROPERTY_BLOCK; var needsSemicolon; if (context.format) { if (context.format.semicolonAfterLastProperty || isPropertyBlock) { needsSemicolon = true; } else if (position < lastPropertyAt) { needsSemicolon = true; } else { needsSemicolon = false; } } else { needsSemicolon = position < lastPropertyAt || isPropertyBlock; } var isLast = position === lastPropertyAt; switch (token[0]) { case Token.AT_RULE: store(context, token); store(context, semicolon(context, Breaks.AfterProperty, false)); break; case Token.AT_RULE_BLOCK: rules(context, token[1]); store(context, openBrace(context, Breaks.AfterRuleBegins, true)); body(context, token[2]); store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast)); break; case Token.COMMENT: store(context, token); store(context, breakFor(context, Breaks.AfterComment) + context.indentWith); break; case Token.PROPERTY: store(context, token[1]); store(context, colon(context)); if (propertyValue) { value(context, token); } store(context, needsSemicolon ? semicolon(context, Breaks.AfterProperty, isLast) : emptyCharacter); break; case Token.RAW: store(context, token); } } function value(context, token) { var store = context.store; var j, m; if (token[2][0] == Token.PROPERTY_BLOCK) { store(context, openBrace(context, Breaks.AfterBlockBegins, false)); body(context, token[2][1]); store(context, closeBrace(context, Breaks.AfterBlockEnds, false, true)); } else { for (j = 2, m = token.length; j < m; j++) { store(context, token[j]); if (j < m - 1 && (inFilter(token) || !disallowsSpace(context, token, j))) { store(context, Marker.SPACE); } } } } function breakFor(context, where) { return context.format ? context.format.breaks[where] : emptyCharacter; } function allowsSpace(context, where) { return context.format && context.format.spaces[where]; } function openBrace(context, where, needsPrefixSpace) { if (context.format) { context.indentBy += context.format.indentBy; context.indentWith = context.format.indentWith.repeat(context.indentBy); return (needsPrefixSpace && allowsSpace(context, Spaces.BeforeBlockBegins) ? Marker.SPACE : emptyCharacter) + Marker.OPEN_CURLY_BRACKET + breakFor(context, where) + context.indentWith; } return Marker.OPEN_CURLY_BRACKET; } function closeBrace(context, where, beforeBlockEnd, isLast) { if (context.format) { context.indentBy -= context.format.indentBy; context.indentWith = context.format.indentWith.repeat(context.indentBy); return (beforeBlockEnd ? breakFor(context, Breaks.BeforeBlockEnds) : breakFor(context, Breaks.AfterProperty)) + context.indentWith + Marker.CLOSE_CURLY_BRACKET + (isLast ? emptyCharacter : breakFor(context, where) + context.indentWith); } return Marker.CLOSE_CURLY_BRACKET; } function colon(context) { return context.format ? Marker.COLON + (allowsSpace(context, Spaces.BeforeValue) ? Marker.SPACE : emptyCharacter) : Marker.COLON; } function semicolon(context, where, isLast) { return context.format ? Marker.SEMICOLON + (isLast ? emptyCharacter : breakFor(context, where) + context.indentWith) : Marker.SEMICOLON; } function comma(context) { return context.format ? Marker.COMMA + breakFor(context, Breaks.BetweenSelectors) + context.indentWith : Marker.COMMA; } function all(context, tokens) { var store = context.store; var token; var isLast; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; isLast = i == l - 1; switch (token[0]) { case Token.AT_RULE: store(context, token); store(context, semicolon(context, Breaks.AfterAtRule, isLast)); break; case Token.AT_RULE_BLOCK: rules(context, token[1]); store(context, openBrace(context, Breaks.AfterRuleBegins, true)); body(context, token[2]); store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast)); break; case Token.NESTED_BLOCK: rules(context, token[1]); store(context, openBrace(context, Breaks.AfterBlockBegins, true)); all(context, token[2]); store(context, closeBrace(context, Breaks.AfterBlockEnds, true, isLast)); break; case Token.COMMENT: store(context, token); store(context, breakFor(context, Breaks.AfterComment) + context.indentWith); break; case Token.RAW: store(context, token); break; case Token.RULE: rules(context, token[1]); store(context, openBrace(context, Breaks.AfterRuleBegins, true)); body(context, token[2]); store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast)); break; } } } module2.exports = { all, body, property, rules, value }; } }); // node_modules/clean-css/lib/writer/one-time.js var require_one_time = __commonJS({ "node_modules/clean-css/lib/writer/one-time.js"(exports, module2) { var helpers = require_helpers(); function store(serializeContext, token) { serializeContext.output.push(typeof token == "string" ? token : token[1]); } function context() { var newContext = { output: [], store }; return newContext; } function all(tokens) { var oneTimeContext = context(); helpers.all(oneTimeContext, tokens); return oneTimeContext.output.join(""); } function body(tokens) { var oneTimeContext = context(); helpers.body(oneTimeContext, tokens); return oneTimeContext.output.join(""); } function property(tokens, position) { var oneTimeContext = context(); helpers.property(oneTimeContext, tokens, position, true); return oneTimeContext.output.join(""); } function rules(tokens) { var oneTimeContext = context(); helpers.rules(oneTimeContext, tokens); return oneTimeContext.output.join(""); } function value(tokens) { var oneTimeContext = context(); helpers.value(oneTimeContext, tokens); return oneTimeContext.output.join(""); } module2.exports = { all, body, property, rules, value }; } }); // node_modules/clean-css/lib/optimizer/level-1/optimize.js var require_optimize2 = __commonJS({ "node_modules/clean-css/lib/optimizer/level-1/optimize.js"(exports, module2) { var sortSelectors = require_sort_selectors(); var tidyRules = require_tidy_rules(); var tidyBlock = require_tidy_block(); var tidyAtRule = require_tidy_at_rule(); var Hack = require_hack(); var removeUnused = require_remove_unused(); var restoreFromOptimizing = require_restore_from_optimizing(); var wrapForOptimizing = require_wrap_for_optimizing().all; var configuration = require_configuration(); var optimizers = require_value_optimizers(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var Token = require_token(); var Marker = require_marker(); var formatPosition = require_format_position(); var serializeRules = require_one_time().rules; var CHARSET_TOKEN = "@charset"; var CHARSET_REGEXP = new RegExp("^" + CHARSET_TOKEN, "i"); var DEFAULT_ROUNDING_PRECISION = require_rounding_precision().DEFAULT; var VARIABLE_PROPERTY_NAME_PATTERN = /^--\S+$/; var PROPERTY_NAME_PATTERN = /^(?:-chrome-|-[\w-]+\w|\w[\w-]+\w|\w{1,})$/; var IMPORT_PREFIX_PATTERN = /^@import/i; var URL_PREFIX_PATTERN = /^url\(/i; function startsAsUrl(value) { return URL_PREFIX_PATTERN.test(value); } function isImport(token) { return IMPORT_PREFIX_PATTERN.test(token[1]); } function isLegacyFilter(property) { var value; if (property.name == "filter" || property.name == "-ms-filter") { value = property.value[0][1]; return value.indexOf("progid") > -1 || value.indexOf("alpha") === 0 || value.indexOf("chroma") === 0; } return false; } function noop() { } function noopValueOptimizer(_name, value, _options) { return value; } function optimizeBody(rule, properties, context) { var options = context.options; var valueOptimizers; var property, name, type, value; var propertyToken; var propertyOptimizer; var serializedRule = serializeRules(rule); var _properties = wrapForOptimizing(properties); var pluginValueOptimizers = context.options.plugins.level1Value; var pluginPropertyOptimizers = context.options.plugins.level1Property; var isVariable; var i, l; for (i = 0, l = _properties.length; i < l; i++) { var j, k, m, n; property = _properties[i]; name = property.name; propertyOptimizer = configuration[name] && configuration[name].propertyOptimizer || noop; valueOptimizers = configuration[name] && configuration[name].valueOptimizers || [optimizers.whiteSpace]; isVariable = VARIABLE_PROPERTY_NAME_PATTERN.test(name); if (isVariable) { valueOptimizers = options.variableOptimizers.length > 0 ? options.variableOptimizers : [optimizers.whiteSpace]; } if (!isVariable && !PROPERTY_NAME_PATTERN.test(name)) { propertyToken = property.all[property.position]; context.warnings.push("Invalid property name '" + name + "' at " + formatPosition(propertyToken[1][2][0]) + ". Ignoring."); property.unused = true; continue; } if (property.value.length === 0) { propertyToken = property.all[property.position]; context.warnings.push("Empty property '" + name + "' at " + formatPosition(propertyToken[1][2][0]) + ". Ignoring."); property.unused = true; continue; } if (property.hack && ((property.hack[0] == Hack.ASTERISK || property.hack[0] == Hack.UNDERSCORE) && !options.compatibility.properties.iePrefixHack || property.hack[0] == Hack.BACKSLASH && !options.compatibility.properties.ieSuffixHack || property.hack[0] == Hack.BANG && !options.compatibility.properties.ieBangHack)) { property.unused = true; continue; } if (!options.compatibility.properties.ieFilters && isLegacyFilter(property)) { property.unused = true; continue; } if (property.block) { optimizeBody(rule, property.value[0][1], context); continue; } for (j = 0, m = property.value.length; j < m; j++) { type = property.value[j][0]; value = property.value[j][1]; if (type == Token.PROPERTY_BLOCK) { property.unused = true; context.warnings.push("Invalid value token at " + formatPosition(value[0][1][2][0]) + ". Ignoring."); break; } if (startsAsUrl(value) && !context.validator.isUrl(value)) { property.unused = true; context.warnings.push("Broken URL '" + value + "' at " + formatPosition(property.value[j][2][0]) + ". Ignoring."); break; } for (k = 0, n = valueOptimizers.length; k < n; k++) { value = valueOptimizers[k](name, value, options); } for (k = 0, n = pluginValueOptimizers.length; k < n; k++) { value = pluginValueOptimizers[k](name, value, options); } property.value[j][1] = value; } propertyOptimizer(serializedRule, property, options); for (j = 0, m = pluginPropertyOptimizers.length; j < m; j++) { pluginPropertyOptimizers[j](serializedRule, property, options); } } restoreFromOptimizing(_properties); removeUnused(_properties); removeComments(properties, options); } function removeComments(tokens, options) { var token; var i; for (i = 0; i < tokens.length; i++) { token = tokens[i]; if (token[0] != Token.COMMENT) { continue; } optimizeComment(token, options); if (token[1].length === 0) { tokens.splice(i, 1); i--; } } } function optimizeComment(token, options) { if (token[1][2] == Marker.EXCLAMATION && (options.level[OptimizationLevel.One].specialComments == "all" || options.commentsKept < options.level[OptimizationLevel.One].specialComments)) { options.commentsKept++; return; } token[1] = []; } function cleanupCharsets(tokens) { var hasCharset = false; for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; if (token[0] != Token.AT_RULE) { continue; } if (!CHARSET_REGEXP.test(token[1])) { continue; } if (hasCharset || token[1].indexOf(CHARSET_TOKEN) == -1) { tokens.splice(i, 1); i--; l--; } else { hasCharset = true; tokens.splice(i, 1); tokens.unshift([Token.AT_RULE, token[1].replace(CHARSET_REGEXP, CHARSET_TOKEN)]); } } } function buildUnitRegexp(options) { var units = ["px", "em", "ex", "cm", "mm", "in", "pt", "pc", "%"]; var otherUnits = ["ch", "rem", "vh", "vm", "vmax", "vmin", "vw"]; otherUnits.forEach(function(unit) { if (options.compatibility.units[unit]) { units.push(unit); } }); return new RegExp("(^|\\s|\\(|,)0(?:" + units.join("|") + ")(\\W|$)", "g"); } function buildPrecisionOptions(roundingPrecision) { var precisionOptions = { matcher: null, units: {} }; var optimizable = []; var unit; var value; for (unit in roundingPrecision) { value = roundingPrecision[unit]; if (value != DEFAULT_ROUNDING_PRECISION) { precisionOptions.units[unit] = {}; precisionOptions.units[unit].value = value; precisionOptions.units[unit].multiplier = 10 ** value; optimizable.push(unit); } } if (optimizable.length > 0) { precisionOptions.enabled = true; precisionOptions.decimalPointMatcher = new RegExp("(\\d)\\.($|" + optimizable.join("|") + ")($|\\W)", "g"); precisionOptions.zeroMatcher = new RegExp("(\\d*)(\\.\\d+)(" + optimizable.join("|") + ")", "g"); } return precisionOptions; } function buildVariableOptimizers(options) { return options.level[OptimizationLevel.One].variableValueOptimizers.map(function(optimizer) { if (typeof optimizer == "string") { return optimizers[optimizer] || noopValueOptimizer; } return optimizer; }); } function level1Optimize(tokens, context) { var options = context.options; var levelOptions = options.level[OptimizationLevel.One]; var ie7Hack = options.compatibility.selectors.ie7Hack; var adjacentSpace = options.compatibility.selectors.adjacentSpace; var spaceAfterClosingBrace = options.compatibility.properties.spaceAfterClosingBrace; var format = options.format; var mayHaveCharset = false; var afterRules = false; options.unitsRegexp = options.unitsRegexp || buildUnitRegexp(options); options.precision = options.precision || buildPrecisionOptions(levelOptions.roundingPrecision); options.commentsKept = options.commentsKept || 0; options.variableOptimizers = options.variableOptimizers || buildVariableOptimizers(options); for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; switch (token[0]) { case Token.AT_RULE: token[1] = isImport(token) && afterRules ? "" : token[1]; token[1] = levelOptions.tidyAtRules ? tidyAtRule(token[1]) : token[1]; mayHaveCharset = true; break; case Token.AT_RULE_BLOCK: optimizeBody(token[1], token[2], context); afterRules = true; break; case Token.NESTED_BLOCK: token[1] = levelOptions.tidyBlockScopes ? tidyBlock(token[1], spaceAfterClosingBrace) : token[1]; level1Optimize(token[2], context); afterRules = true; break; case Token.COMMENT: optimizeComment(token, options); break; case Token.RULE: token[1] = levelOptions.tidySelectors ? tidyRules(token[1], !ie7Hack, adjacentSpace, format, context.warnings) : token[1]; token[1] = token[1].length > 1 ? sortSelectors(token[1], levelOptions.selectorsSortingMethod) : token[1]; optimizeBody(token[1], token[2], context); afterRules = true; break; } if (token[0] == Token.COMMENT && token[1].length === 0 || levelOptions.removeEmpty && (token[1].length === 0 || token[2] && token[2].length === 0)) { tokens.splice(i, 1); i--; l--; } } if (levelOptions.cleanupCharsets && mayHaveCharset) { cleanupCharsets(tokens); } return tokens; } module2.exports = level1Optimize; } }); // node_modules/clean-css/lib/optimizer/level-2/is-mergeable.js var require_is_mergeable = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/is-mergeable.js"(exports, module2) { var Marker = require_marker(); var split = require_split(); var DEEP_SELECTOR_PATTERN = /\/deep\//; var DOUBLE_COLON_PATTERN = /^::/; var VENDOR_PREFIXED_PATTERN = /:(-moz-|-ms-|-o-|-webkit-)/; var NOT_PSEUDO = ":not"; var PSEUDO_CLASSES_WITH_ARGUMENTS = [ ":dir", ":lang", ":not", ":nth-child", ":nth-last-child", ":nth-last-of-type", ":nth-of-type" ]; var RELATION_PATTERN = /[>+~]/; var UNMIXABLE_PSEUDO_CLASSES = [ ":after", ":before", ":first-letter", ":first-line", ":lang" ]; var UNMIXABLE_PSEUDO_ELEMENTS = [ "::after", "::before", "::first-letter", "::first-line" ]; var Level = { DOUBLE_QUOTE: "double-quote", SINGLE_QUOTE: "single-quote", ROOT: "root" }; function isMergeable(selector, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) { var singleSelectors = split(selector, Marker.COMMA); var singleSelector; var i, l; for (i = 0, l = singleSelectors.length; i < l; i++) { singleSelector = singleSelectors[i]; if (singleSelector.length === 0 || isDeepSelector(singleSelector) || isVendorPrefixed(singleSelector) || singleSelector.indexOf(Marker.COLON) > -1 && !areMergeable(singleSelector, extractPseudoFrom(singleSelector), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) { return false; } } return true; } function isDeepSelector(selector) { return DEEP_SELECTOR_PATTERN.test(selector); } function isVendorPrefixed(selector) { return VENDOR_PREFIXED_PATTERN.test(selector); } function extractPseudoFrom(selector) { var list = []; var character; var buffer = []; var level = Level.ROOT; var roundBracketLevel = 0; var isQuoted; var isEscaped; var isPseudo = false; var isRelation; var wasColon = false; var index; var len; for (index = 0, len = selector.length; index < len; index++) { character = selector[index]; isRelation = !isEscaped && RELATION_PATTERN.test(character); isQuoted = level == Level.DOUBLE_QUOTE || level == Level.SINGLE_QUOTE; if (isEscaped) { buffer.push(character); } else if (character == Marker.DOUBLE_QUOTE && level == Level.ROOT) { buffer.push(character); level = Level.DOUBLE_QUOTE; } else if (character == Marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) { buffer.push(character); level = Level.ROOT; } else if (character == Marker.SINGLE_QUOTE && level == Level.ROOT) { buffer.push(character); level = Level.SINGLE_QUOTE; } else if (character == Marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) { buffer.push(character); level = Level.ROOT; } else if (isQuoted) { buffer.push(character); } else if (character == Marker.OPEN_ROUND_BRACKET) { buffer.push(character); roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && roundBracketLevel == 1 && isPseudo) { buffer.push(character); list.push(buffer.join("")); roundBracketLevel--; buffer = []; isPseudo = false; } else if (character == Marker.CLOSE_ROUND_BRACKET) { buffer.push(character); roundBracketLevel--; } else if (character == Marker.COLON && roundBracketLevel === 0 && isPseudo && !wasColon) { list.push(buffer.join("")); buffer = []; buffer.push(character); } else if (character == Marker.COLON && roundBracketLevel === 0 && !wasColon) { buffer = []; buffer.push(character); isPseudo = true; } else if (character == Marker.SPACE && roundBracketLevel === 0 && isPseudo) { list.push(buffer.join("")); buffer = []; isPseudo = false; } else if (isRelation && roundBracketLevel === 0 && isPseudo) { list.push(buffer.join("")); buffer = []; isPseudo = false; } else { buffer.push(character); } isEscaped = character == Marker.BACK_SLASH; wasColon = character == Marker.COLON; } if (buffer.length > 0 && isPseudo) { list.push(buffer.join("")); } return list; } function areMergeable(selector, matches, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) { return areAllowed(matches, mergeablePseudoClasses, mergeablePseudoElements) && needArguments(matches) && (matches.length < 2 || !someIncorrectlyChained(selector, matches)) && (matches.length < 2 || multiplePseudoMerging && allMixable(matches)); } function areAllowed(matches, mergeablePseudoClasses, mergeablePseudoElements) { var match; var name; var i, l; for (i = 0, l = matches.length; i < l; i++) { match = matches[i]; name = match.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ? match.substring(0, match.indexOf(Marker.OPEN_ROUND_BRACKET)) : match; if (mergeablePseudoClasses.indexOf(name) === -1 && mergeablePseudoElements.indexOf(name) === -1) { return false; } } return true; } function needArguments(matches) { var match; var name; var bracketOpensAt; var hasArguments; var i, l; for (i = 0, l = matches.length; i < l; i++) { match = matches[i]; bracketOpensAt = match.indexOf(Marker.OPEN_ROUND_BRACKET); hasArguments = bracketOpensAt > -1; name = hasArguments ? match.substring(0, bracketOpensAt) : match; if (hasArguments && PSEUDO_CLASSES_WITH_ARGUMENTS.indexOf(name) == -1) { return false; } if (!hasArguments && PSEUDO_CLASSES_WITH_ARGUMENTS.indexOf(name) > -1) { return false; } } return true; } function someIncorrectlyChained(selector, matches) { var positionInSelector = 0; var match; var matchAt; var nextMatch; var nextMatchAt; var name; var nextName; var areChained; var i, l; for (i = 0, l = matches.length; i < l; i++) { match = matches[i]; nextMatch = matches[i + 1]; if (!nextMatch) { break; } matchAt = selector.indexOf(match, positionInSelector); nextMatchAt = selector.indexOf(match, matchAt + 1); positionInSelector = nextMatchAt; areChained = matchAt + match.length == nextMatchAt; if (areChained) { name = match.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ? match.substring(0, match.indexOf(Marker.OPEN_ROUND_BRACKET)) : match; nextName = nextMatch.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ? nextMatch.substring(0, nextMatch.indexOf(Marker.OPEN_ROUND_BRACKET)) : nextMatch; if (name != NOT_PSEUDO || nextName != NOT_PSEUDO) { return true; } } } return false; } function allMixable(matches) { var unmixableMatches = 0; var match; var i, l; for (i = 0, l = matches.length; i < l; i++) { match = matches[i]; if (isPseudoElement(match)) { unmixableMatches += UNMIXABLE_PSEUDO_ELEMENTS.indexOf(match) > -1 ? 1 : 0; } else { unmixableMatches += UNMIXABLE_PSEUDO_CLASSES.indexOf(match) > -1 ? 1 : 0; } if (unmixableMatches > 1) { return false; } } return true; } function isPseudoElement(pseudo) { return DOUBLE_COLON_PATTERN.test(pseudo); } module2.exports = isMergeable; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/every-values-pair.js var require_every_values_pair = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/every-values-pair.js"(exports, module2) { var Marker = require_marker(); function everyValuesPair(fn, left, right) { var leftSize = left.value.length; var rightSize = right.value.length; var total = Math.max(leftSize, rightSize); var lowerBound = Math.min(leftSize, rightSize) - 1; var leftValue; var rightValue; var position; for (position = 0; position < total; position++) { leftValue = left.value[position] && left.value[position][1] || leftValue; rightValue = right.value[position] && right.value[position][1] || rightValue; if (leftValue == Marker.COMMA || rightValue == Marker.COMMA) { continue; } if (!fn(leftValue, rightValue, position, position <= lowerBound)) { return false; } } return true; } module2.exports = everyValuesPair; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/has-inherit.js var require_has_inherit = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/has-inherit.js"(exports, module2) { function hasInherit(property) { for (var i = property.value.length - 1; i >= 0; i--) { if (property.value[i][1] == "inherit") { return true; } } return false; } module2.exports = hasInherit; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/has-same-values.js var require_has_same_values = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/has-same-values.js"(exports, module2) { function hasSameValues(property) { var firstValue = property.value[0][1]; var i, l; for (i = 1, l = property.value.length; i < l; i++) { if (property.value[i][1] != firstValue) { return false; } } return true; } module2.exports = hasSameValues; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/populate-components.js var require_populate_components = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/populate-components.js"(exports, module2) { var configuration = require_configuration(); var InvalidPropertyError = require_invalid_property_error(); function populateComponents(properties, validator, warnings) { var component; var j, m; for (var i = properties.length - 1; i >= 0; i--) { var property = properties[i]; var descriptor = configuration[property.name]; if (!property.dynamic && descriptor && descriptor.shorthand) { if (onlyValueIsVariable(property, validator) || moreThanOneValueIsVariable(property, validator)) { property.optimizable = false; continue; } property.shorthand = true; property.dirty = true; try { property.components = descriptor.breakUp(property, configuration, validator); if (descriptor.shorthandComponents) { for (j = 0, m = property.components.length; j < m; j++) { component = property.components[j]; component.components = configuration[component.name].breakUp(component, configuration, validator); } } } catch (e) { if (e instanceof InvalidPropertyError) { property.components = []; warnings.push(e.message); } else { throw e; } } if (property.components.length > 0) { property.multiplex = property.components[0].multiplex; } else { property.unused = true; } } } } function onlyValueIsVariable(property, validator) { return property.value.length == 1 && validator.isVariable(property.value[0][1]); } function moreThanOneValueIsVariable(property, validator) { return property.value.length > 1 && property.value.filter(function(value) { return validator.isVariable(value[1]); }).length > 1; } module2.exports = populateComponents; } }); // node_modules/clean-css/lib/optimizer/level-2/restore-with-components.js var require_restore_with_components = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/restore-with-components.js"(exports, module2) { var configuration = require_configuration(); function restoreWithComponents(property) { var descriptor = configuration[property.name]; if (descriptor && descriptor.shorthand) { return descriptor.restore(property, configuration); } return property.value; } module2.exports = restoreWithComponents; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/merge-into-shorthands.js var require_merge_into_shorthands = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/merge-into-shorthands.js"(exports, module2) { var everyValuesPair = require_every_values_pair(); var hasInherit = require_has_inherit(); var hasSameValues = require_has_same_values(); var populateComponents = require_populate_components(); var configuration = require_configuration(); var deepClone = require_clone().deep; var restoreWithComponents = require_restore_with_components(); var restoreFromOptimizing = require_restore_from_optimizing(); var wrapSingle = require_wrap_for_optimizing().single; var serializeBody = require_one_time().body; var Token = require_token(); function mergeIntoShorthands(properties, validator) { var candidates = {}; var descriptor; var componentOf; var property; var i, l; var j, m; if (properties.length < 3) { return; } for (i = 0, l = properties.length; i < l; i++) { property = properties[i]; descriptor = configuration[property.name]; if (property.dynamic) { continue; } if (property.unused) { continue; } if (property.hack) { continue; } if (property.block) { continue; } if (descriptor && descriptor.singleTypeComponents && !hasSameValues(property)) { continue; } invalidateOrCompact(properties, i, candidates, validator); if (descriptor && descriptor.componentOf) { for (j = 0, m = descriptor.componentOf.length; j < m; j++) { componentOf = descriptor.componentOf[j]; candidates[componentOf] = candidates[componentOf] || {}; candidates[componentOf][property.name] = property; } } } invalidateOrCompact(properties, i, candidates, validator); } function invalidateOrCompact(properties, position, candidates, validator) { var invalidatedBy = properties[position]; var shorthandName; var shorthandDescriptor; var candidateComponents; var replacedCandidates = []; var i; for (shorthandName in candidates) { if (invalidatedBy !== void 0 && shorthandName == invalidatedBy.name) { continue; } shorthandDescriptor = configuration[shorthandName]; candidateComponents = candidates[shorthandName]; if (invalidatedBy && invalidates(candidates, shorthandName, invalidatedBy)) { delete candidates[shorthandName]; continue; } if (shorthandDescriptor.components.length > Object.keys(candidateComponents).length) { continue; } if (mixedImportance(candidateComponents)) { continue; } if (!overridable(candidateComponents, shorthandName, validator)) { continue; } if (!mergeable(candidateComponents)) { continue; } if (mixedInherit(candidateComponents)) { replaceWithInheritBestFit(properties, candidateComponents, shorthandName, validator); } else { replaceWithShorthand(properties, candidateComponents, shorthandName, validator); } replacedCandidates.push(shorthandName); } for (i = replacedCandidates.length - 1; i >= 0; i--) { delete candidates[replacedCandidates[i]]; } } function invalidates(candidates, shorthandName, invalidatedBy) { var shorthandDescriptor = configuration[shorthandName]; var invalidatedByDescriptor = configuration[invalidatedBy.name]; var componentName; if ("overridesShorthands" in shorthandDescriptor && shorthandDescriptor.overridesShorthands.indexOf(invalidatedBy.name) > -1) { return true; } if (invalidatedByDescriptor && "componentOf" in invalidatedByDescriptor) { for (componentName in candidates[shorthandName]) { if (invalidatedByDescriptor.componentOf.indexOf(componentName) > -1) { return true; } } } return false; } function mixedImportance(components) { var important; var componentName; for (componentName in components) { if (important !== void 0 && components[componentName].important != important) { return true; } important = components[componentName].important; } return false; } function overridable(components, shorthandName, validator) { var descriptor = configuration[shorthandName]; var newValuePlaceholder = [ Token.PROPERTY, [Token.PROPERTY_NAME, shorthandName], [Token.PROPERTY_VALUE, descriptor.defaultValue] ]; var newProperty = wrapSingle(newValuePlaceholder); var component; var mayOverride; var i, l; populateComponents([newProperty], validator, []); for (i = 0, l = descriptor.components.length; i < l; i++) { component = components[descriptor.components[i]]; mayOverride = configuration[component.name].canOverride || sameValue; if (!everyValuesPair(mayOverride.bind(null, validator), newProperty.components[i], component)) { return false; } } return true; } function sameValue(_validator, value1, value2) { return value1 === value2; } function mergeable(components) { var lastCount = null; var currentCount; var componentName; var component; var descriptor; var values; for (componentName in components) { component = components[componentName]; descriptor = configuration[componentName]; if (!("restore" in descriptor)) { continue; } restoreFromOptimizing([component.all[component.position]], restoreWithComponents); values = descriptor.restore(component, configuration); currentCount = values.length; if (lastCount !== null && currentCount !== lastCount) { return false; } lastCount = currentCount; } return true; } function mixedInherit(components) { var componentName; var lastValue = null; var currentValue; for (componentName in components) { currentValue = hasInherit(components[componentName]); if (lastValue !== null && lastValue !== currentValue) { return true; } lastValue = currentValue; } return false; } function replaceWithInheritBestFit(properties, candidateComponents, shorthandName, validator) { var viaLonghands = buildSequenceWithInheritLonghands(candidateComponents, shorthandName, validator); var viaShorthand = buildSequenceWithInheritShorthand(candidateComponents, shorthandName, validator); var longhandTokensSequence = viaLonghands[0]; var shorthandTokensSequence = viaShorthand[0]; var isLonghandsShorter = serializeBody(longhandTokensSequence).length < serializeBody(shorthandTokensSequence).length; var newTokensSequence = isLonghandsShorter ? longhandTokensSequence : shorthandTokensSequence; var newProperty = isLonghandsShorter ? viaLonghands[1] : viaShorthand[1]; var newComponents = isLonghandsShorter ? viaLonghands[2] : viaShorthand[2]; var lastComponent = candidateComponents[Object.keys(candidateComponents).pop()]; var all = lastComponent.all; var insertAt = lastComponent.position; var componentName; var oldComponent; var newComponent; var newToken; newProperty.position = insertAt; newProperty.shorthand = true; newProperty.important = lastComponent.important; newProperty.multiplex = false; newProperty.dirty = true; newProperty.all = all; newProperty.all[insertAt] = newTokensSequence[0]; properties.splice(insertAt, 1, newProperty); for (componentName in candidateComponents) { oldComponent = candidateComponents[componentName]; oldComponent.unused = true; newProperty.multiplex = newProperty.multiplex || oldComponent.multiplex; if (oldComponent.name in newComponents) { newComponent = newComponents[oldComponent.name]; newToken = findTokenIn(newTokensSequence, componentName); newComponent.position = all.length; newComponent.all = all; newComponent.all.push(newToken); properties.push(newComponent); } } } function buildSequenceWithInheritLonghands(components, shorthandName, validator) { var tokensSequence = []; var inheritComponents = {}; var nonInheritComponents = {}; var descriptor = configuration[shorthandName]; var shorthandToken = [ Token.PROPERTY, [Token.PROPERTY_NAME, shorthandName], [Token.PROPERTY_VALUE, descriptor.defaultValue] ]; var newProperty = wrapSingle(shorthandToken); var component; var longhandToken; var newComponent; var nameMetadata; var i, l; populateComponents([newProperty], validator, []); for (i = 0, l = descriptor.components.length; i < l; i++) { component = components[descriptor.components[i]]; if (hasInherit(component)) { longhandToken = component.all[component.position].slice(0, 2); Array.prototype.push.apply(longhandToken, component.value); tokensSequence.push(longhandToken); newComponent = deepClone(component); newComponent.value = inferComponentValue(components, newComponent.name); newProperty.components[i] = newComponent; inheritComponents[component.name] = deepClone(component); } else { newComponent = deepClone(component); newComponent.all = component.all; newProperty.components[i] = newComponent; nonInheritComponents[component.name] = component; } } newProperty.important = components[Object.keys(components).pop()].important; nameMetadata = joinMetadata(nonInheritComponents, 1); shorthandToken[1].push(nameMetadata); restoreFromOptimizing([newProperty], restoreWithComponents); shorthandToken = shorthandToken.slice(0, 2); Array.prototype.push.apply(shorthandToken, newProperty.value); tokensSequence.unshift(shorthandToken); return [tokensSequence, newProperty, inheritComponents]; } function inferComponentValue(components, propertyName) { var descriptor = configuration[propertyName]; if ("oppositeTo" in descriptor) { return components[descriptor.oppositeTo].value; } return [[Token.PROPERTY_VALUE, descriptor.defaultValue]]; } function joinMetadata(components, at) { var metadata = []; var component; var originalValue; var componentMetadata; var componentName; for (componentName in components) { component = components[componentName]; originalValue = component.all[component.position]; componentMetadata = originalValue[at][originalValue[at].length - 1]; Array.prototype.push.apply(metadata, componentMetadata); } return metadata.sort(metadataSorter); } function metadataSorter(metadata1, metadata2) { var line1 = metadata1[0]; var line2 = metadata2[0]; var column1 = metadata1[1]; var column2 = metadata2[1]; if (line1 < line2) { return -1; } if (line1 === line2) { return column1 < column2 ? -1 : 1; } return 1; } function buildSequenceWithInheritShorthand(components, shorthandName, validator) { var tokensSequence = []; var inheritComponents = {}; var nonInheritComponents = {}; var descriptor = configuration[shorthandName]; var shorthandToken = [ Token.PROPERTY, [Token.PROPERTY_NAME, shorthandName], [Token.PROPERTY_VALUE, "inherit"] ]; var newProperty = wrapSingle(shorthandToken); var component; var longhandToken; var nameMetadata; var valueMetadata; var i, l; populateComponents([newProperty], validator, []); for (i = 0, l = descriptor.components.length; i < l; i++) { component = components[descriptor.components[i]]; if (hasInherit(component)) { inheritComponents[component.name] = component; } else { longhandToken = component.all[component.position].slice(0, 2); Array.prototype.push.apply(longhandToken, component.value); tokensSequence.push(longhandToken); nonInheritComponents[component.name] = deepClone(component); } } nameMetadata = joinMetadata(inheritComponents, 1); shorthandToken[1].push(nameMetadata); valueMetadata = joinMetadata(inheritComponents, 2); shorthandToken[2].push(valueMetadata); tokensSequence.unshift(shorthandToken); return [tokensSequence, newProperty, nonInheritComponents]; } function findTokenIn(tokens, componentName) { var i, l; for (i = 0, l = tokens.length; i < l; i++) { if (tokens[i][1][1] == componentName) { return tokens[i]; } } } function replaceWithShorthand(properties, candidateComponents, shorthandName, validator) { var descriptor = configuration[shorthandName]; var nameMetadata; var valueMetadata; var newValuePlaceholder = [ Token.PROPERTY, [Token.PROPERTY_NAME, shorthandName], [Token.PROPERTY_VALUE, descriptor.defaultValue] ]; var all; var insertAt = inferInsertAtFrom(properties, candidateComponents, shorthandName); var newProperty = wrapSingle(newValuePlaceholder); newProperty.shorthand = true; newProperty.dirty = true; newProperty.multiplex = false; populateComponents([newProperty], validator, []); for (var i = 0, l = descriptor.components.length; i < l; i++) { var component = candidateComponents[descriptor.components[i]]; newProperty.components[i] = deepClone(component); newProperty.important = component.important; newProperty.multiplex = newProperty.multiplex || component.multiplex; all = component.all; } for (var componentName in candidateComponents) { candidateComponents[componentName].unused = true; } nameMetadata = joinMetadata(candidateComponents, 1); newValuePlaceholder[1].push(nameMetadata); valueMetadata = joinMetadata(candidateComponents, 2); newValuePlaceholder[2].push(valueMetadata); newProperty.position = insertAt; newProperty.all = all; newProperty.all[insertAt] = newValuePlaceholder; properties.splice(insertAt, 1, newProperty); } function inferInsertAtFrom(properties, candidateComponents, shorthandName) { var candidateComponentNames = Object.keys(candidateComponents); var firstCandidatePosition = candidateComponents[candidateComponentNames[0]].position; var lastCandidatePosition = candidateComponents[candidateComponentNames[candidateComponentNames.length - 1]].position; if (shorthandName == "border" && traversesVia(properties.slice(firstCandidatePosition, lastCandidatePosition), "border-image")) { return firstCandidatePosition; } return lastCandidatePosition; } function traversesVia(properties, propertyName) { for (var i = properties.length - 1; i >= 0; i--) { if (properties[i].name == propertyName) { return true; } } return false; } module2.exports = mergeIntoShorthands; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/has-unset.js var require_has_unset = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/has-unset.js"(exports, module2) { function hasUnset(property) { for (var i = property.value.length - 1; i >= 0; i--) { if (property.value[i][1] == "unset") { return true; } } return false; } module2.exports = hasUnset; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/find-component-in.js var require_find_component_in = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/find-component-in.js"(exports, module2) { var configuration = require_configuration(); function findComponentIn(shorthand, longhand) { var comparator = nameComparator(longhand); return findInDirectComponents(shorthand, comparator) || findInSubComponents(shorthand, comparator); } function nameComparator(to) { return function(property) { return to.name === property.name; }; } function findInDirectComponents(shorthand, comparator) { return shorthand.components.filter(comparator)[0]; } function findInSubComponents(shorthand, comparator) { var shorthandComponent; var longhandMatch; var i, l; if (!configuration[shorthand.name].shorthandComponents) { return; } for (i = 0, l = shorthand.components.length; i < l; i++) { shorthandComponent = shorthand.components[i]; longhandMatch = findInDirectComponents(shorthandComponent, comparator); if (longhandMatch) { return longhandMatch; } } } module2.exports = findComponentIn; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/is-component-of.js var require_is_component_of = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/is-component-of.js"(exports, module2) { var configuration = require_configuration(); function isComponentOf(property1, property2, shallow) { return isDirectComponentOf(property1, property2) || !shallow && !!configuration[property1.name].shorthandComponents && isSubComponentOf(property1, property2); } function isDirectComponentOf(property1, property2) { var descriptor = configuration[property1.name]; return "components" in descriptor && descriptor.components.indexOf(property2.name) > -1; } function isSubComponentOf(property1, property2) { return property1.components.some(function(component) { return isDirectComponentOf(component, property2); }); } module2.exports = isComponentOf; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/is-mergeable-shorthand.js var require_is_mergeable_shorthand = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/is-mergeable-shorthand.js"(exports, module2) { var Marker = require_marker(); function isMergeableShorthand(shorthand) { if (shorthand.name != "font") { return true; } return shorthand.value[0][1].indexOf(Marker.INTERNAL) == -1; } module2.exports = isMergeableShorthand; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/overrides-non-component-shorthand.js var require_overrides_non_component_shorthand = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/overrides-non-component-shorthand.js"(exports, module2) { var configuration = require_configuration(); function overridesNonComponentShorthand(property1, property2) { return property1.name in configuration && "overridesShorthands" in configuration[property1.name] && configuration[property1.name].overridesShorthands.indexOf(property2.name) > -1; } module2.exports = overridesNonComponentShorthand; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/override-properties.js var require_override_properties = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/override-properties.js"(exports, module2) { var hasInherit = require_has_inherit(); var hasUnset = require_has_unset(); var everyValuesPair = require_every_values_pair(); var findComponentIn = require_find_component_in(); var isComponentOf = require_is_component_of(); var isMergeableShorthand = require_is_mergeable_shorthand(); var overridesNonComponentShorthand = require_overrides_non_component_shorthand(); var sameVendorPrefixesIn = require_vendor_prefixes().same; var configuration = require_configuration(); var deepClone = require_clone().deep; var restoreWithComponents = require_restore_with_components(); var shallowClone = require_clone().shallow; var restoreFromOptimizing = require_restore_from_optimizing(); var Token = require_token(); var Marker = require_marker(); var serializeProperty = require_one_time().property; function sameValue(_validator, value1, value2) { return value1 === value2; } function wouldBreakCompatibility(property, validator) { for (var i = 0; i < property.components.length; i++) { var component = property.components[i]; var descriptor = configuration[component.name]; var canOverride = descriptor && descriptor.canOverride || sameValue; var _component = shallowClone(component); _component.value = [[Token.PROPERTY_VALUE, descriptor.defaultValue]]; if (!everyValuesPair(canOverride.bind(null, validator), _component, component)) { return true; } } return false; } function overrideIntoMultiplex(property, by) { by.unused = true; turnIntoMultiplex(by, multiplexSize(property)); property.value = by.value; } function overrideByMultiplex(property, by) { by.unused = true; property.multiplex = true; property.value = by.value; } function overrideSimple(property, by) { by.unused = true; property.value = by.value; } function override(property, by) { if (by.multiplex) { overrideByMultiplex(property, by); } else if (property.multiplex) { overrideIntoMultiplex(property, by); } else { overrideSimple(property, by); } } function overrideShorthand(property, by) { by.unused = true; for (var i = 0, l = property.components.length; i < l; i++) { override(property.components[i], by.components[i]); } } function turnIntoMultiplex(property, size) { property.multiplex = true; if (configuration[property.name].shorthand) { turnShorthandValueIntoMultiplex(property, size); } else { turnLonghandValueIntoMultiplex(property, size); } } function turnShorthandValueIntoMultiplex(property, size) { var component; var i, l; for (i = 0, l = property.components.length; i < l; i++) { component = property.components[i]; if (!component.multiplex) { turnLonghandValueIntoMultiplex(component, size); } } } function turnLonghandValueIntoMultiplex(property, size) { var descriptor = configuration[property.name]; var withRealValue = descriptor.intoMultiplexMode == "real"; var withValue = descriptor.intoMultiplexMode == "real" ? property.value.slice(0) : descriptor.intoMultiplexMode == "placeholder" ? descriptor.placeholderValue : descriptor.defaultValue; var i = multiplexSize(property); var j; var m = withValue.length; for (; i < size; i++) { property.value.push([Token.PROPERTY_VALUE, Marker.COMMA]); if (Array.isArray(withValue)) { for (j = 0; j < m; j++) { property.value.push(withRealValue ? withValue[j] : [Token.PROPERTY_VALUE, withValue[j]]); } } else { property.value.push(withRealValue ? withValue : [Token.PROPERTY_VALUE, withValue]); } } } function multiplexSize(component) { var size = 0; for (var i = 0, l = component.value.length; i < l; i++) { if (component.value[i][1] == Marker.COMMA) { size++; } } return size + 1; } function lengthOf(property) { var fakeAsArray = [ Token.PROPERTY, [Token.PROPERTY_NAME, property.name] ].concat(property.value); return serializeProperty([fakeAsArray], 0).length; } function moreSameShorthands(properties, startAt, name) { var count = 0; for (var i = startAt; i >= 0; i--) { if (properties[i].name == name && !properties[i].unused) { count++; } if (count > 1) { break; } } return count > 1; } function overridingFunction(shorthand, validator) { for (var i = 0, l = shorthand.components.length; i < l; i++) { if (!anyValue(validator.isUrl, shorthand.components[i]) && anyValue(validator.isFunction, shorthand.components[i])) { return true; } } return false; } function anyValue(fn, property) { for (var i = 0, l = property.value.length; i < l; i++) { if (property.value[i][1] == Marker.COMMA) { continue; } if (fn(property.value[i][1])) { return true; } } return false; } function wouldResultInLongerValue(left, right) { if (!left.multiplex && !right.multiplex || left.multiplex && right.multiplex) { return false; } var multiplex = left.multiplex ? left : right; var simple = left.multiplex ? right : left; var component; var multiplexClone = deepClone(multiplex); restoreFromOptimizing([multiplexClone], restoreWithComponents); var simpleClone = deepClone(simple); restoreFromOptimizing([simpleClone], restoreWithComponents); var lengthBefore = lengthOf(multiplexClone) + 1 + lengthOf(simpleClone); if (left.multiplex) { component = findComponentIn(multiplexClone, simpleClone); overrideIntoMultiplex(component, simpleClone); } else { component = findComponentIn(simpleClone, multiplexClone); turnIntoMultiplex(simpleClone, multiplexSize(multiplexClone)); overrideByMultiplex(component, multiplexClone); } restoreFromOptimizing([simpleClone], restoreWithComponents); var lengthAfter = lengthOf(simpleClone); return lengthBefore <= lengthAfter; } function isCompactable(property) { return property.name in configuration; } function noneOverrideHack(left, right) { return !left.multiplex && (left.name == "background" || left.name == "background-image") && right.multiplex && (right.name == "background" || right.name == "background-image") && anyLayerIsNone(right.value); } function anyLayerIsNone(values) { var layers = intoLayers(values); for (var i = 0, l = layers.length; i < l; i++) { if (layers[i].length == 1 && layers[i][0][1] == "none") { return true; } } return false; } function intoLayers(values) { var layers = []; for (var i = 0, layer = [], l = values.length; i < l; i++) { var value = values[i]; if (value[1] == Marker.COMMA) { layers.push(layer); layer = []; } else { layer.push(value); } } layers.push(layer); return layers; } function overrideProperties(properties, withMerging, compatibility, validator) { var mayOverride, right, left, component; var overriddenComponents; var overriddenComponent; var overridingComponent; var overridable; var i, j, k; propertyLoop: for (i = properties.length - 1; i >= 0; i--) { right = properties[i]; if (!isCompactable(right)) { continue; } if (right.block) { continue; } mayOverride = configuration[right.name].canOverride || sameValue; traverseLoop: for (j = i - 1; j >= 0; j--) { left = properties[j]; if (!isCompactable(left)) { continue; } if (left.block) { continue; } if (left.dynamic || right.dynamic) { continue; } if (left.unused || right.unused) { continue; } if (left.hack && !right.hack && !right.important || !left.hack && !left.important && right.hack) { continue; } if (left.important == right.important && left.hack[0] != right.hack[0]) { continue; } if (left.important == right.important && (left.hack[0] != right.hack[0] || left.hack[1] && left.hack[1] != right.hack[1])) { continue; } if (hasInherit(right)) { continue; } if (noneOverrideHack(left, right)) { continue; } if (right.shorthand && isComponentOf(right, left)) { if (!right.important && left.important) { continue; } if (!sameVendorPrefixesIn([left], right.components)) { continue; } if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator)) { continue; } if (!isMergeableShorthand(right)) { left.unused = true; continue; } component = findComponentIn(right, left); mayOverride = configuration[left.name].canOverride || sameValue; if (everyValuesPair(mayOverride.bind(null, validator), left, component)) { left.unused = true; } } else if (right.shorthand && overridesNonComponentShorthand(right, left)) { if (!right.important && left.important) { continue; } if (!sameVendorPrefixesIn([left], right.components)) { continue; } if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator)) { continue; } overriddenComponents = left.shorthand ? left.components : [left]; for (k = overriddenComponents.length - 1; k >= 0; k--) { overriddenComponent = overriddenComponents[k]; overridingComponent = findComponentIn(right, overriddenComponent); mayOverride = configuration[overriddenComponent.name].canOverride || sameValue; if (!everyValuesPair(mayOverride.bind(null, validator), left, overridingComponent)) { continue traverseLoop; } } left.unused = true; } else if (withMerging && left.shorthand && !right.shorthand && isComponentOf(left, right, true)) { if (right.important && !left.important) { continue; } if (!right.important && left.important) { right.unused = true; continue; } if (moreSameShorthands(properties, i - 1, left.name)) { continue; } if (overridingFunction(left, validator)) { continue; } if (!isMergeableShorthand(left)) { continue; } if (hasUnset(left) || hasUnset(right)) { continue; } component = findComponentIn(left, right); if (everyValuesPair(mayOverride.bind(null, validator), component, right)) { var disabledBackgroundMerging = !compatibility.properties.backgroundClipMerging && component.name.indexOf("background-clip") > -1 || !compatibility.properties.backgroundOriginMerging && component.name.indexOf("background-origin") > -1 || !compatibility.properties.backgroundSizeMerging && component.name.indexOf("background-size") > -1; var nonMergeableValue = configuration[right.name].nonMergeableValue === right.value[0][1]; if (disabledBackgroundMerging || nonMergeableValue) { continue; } if (!compatibility.properties.merging && wouldBreakCompatibility(left, validator)) { continue; } if (component.value[0][1] != right.value[0][1] && (hasInherit(left) || hasInherit(right))) { continue; } if (wouldResultInLongerValue(left, right)) { continue; } if (!left.multiplex && right.multiplex) { turnIntoMultiplex(left, multiplexSize(right)); } override(component, right); left.dirty = true; } } else if (withMerging && left.shorthand && right.shorthand && left.name == right.name) { if (!left.multiplex && right.multiplex) { continue; } if (!right.important && left.important) { right.unused = true; continue propertyLoop; } if (right.important && !left.important) { left.unused = true; continue; } if (!isMergeableShorthand(right)) { left.unused = true; continue; } for (k = left.components.length - 1; k >= 0; k--) { var leftComponent = left.components[k]; var rightComponent = right.components[k]; mayOverride = configuration[leftComponent.name].canOverride || sameValue; if (!everyValuesPair(mayOverride.bind(null, validator), leftComponent, rightComponent)) { continue propertyLoop; } } overrideShorthand(left, right); left.dirty = true; } else if (withMerging && left.shorthand && right.shorthand && isComponentOf(left, right)) { if (!left.important && right.important) { continue; } component = findComponentIn(left, right); mayOverride = configuration[right.name].canOverride || sameValue; if (!everyValuesPair(mayOverride.bind(null, validator), component, right)) { continue; } if (left.important && !right.important) { right.unused = true; continue; } var rightRestored = configuration[right.name].restore(right, configuration); if (rightRestored.length > 1) { continue; } component = findComponentIn(left, right); override(component, right); right.dirty = true; } else if (left.name == right.name) { overridable = true; if (right.shorthand) { for (k = right.components.length - 1; k >= 0 && overridable; k--) { overriddenComponent = left.components[k]; overridingComponent = right.components[k]; mayOverride = configuration[overridingComponent.name].canOverride || sameValue; overridable = everyValuesPair(mayOverride.bind(null, validator), overriddenComponent, overridingComponent); } } else { mayOverride = configuration[right.name].canOverride || sameValue; overridable = everyValuesPair(mayOverride.bind(null, validator), left, right); } if (left.important && !right.important && overridable) { right.unused = true; continue; } if (!left.important && right.important && overridable) { left.unused = true; continue; } if (!overridable) { continue; } left.unused = true; } } } } module2.exports = overrideProperties; } }); // node_modules/clean-css/lib/optimizer/level-2/properties/optimize.js var require_optimize3 = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/properties/optimize.js"(exports, module2) { var mergeIntoShorthands = require_merge_into_shorthands(); var overrideProperties = require_override_properties(); var populateComponents = require_populate_components(); var restoreWithComponents = require_restore_with_components(); var wrapForOptimizing = require_wrap_for_optimizing().all; var removeUnused = require_remove_unused(); var restoreFromOptimizing = require_restore_from_optimizing(); var OptimizationLevel = require_optimization_level().OptimizationLevel; function optimizeProperties(properties, withOverriding, withMerging, context) { var levelOptions = context.options.level[OptimizationLevel.Two]; var _properties = wrapForOptimizing(properties, levelOptions.skipProperties); var _property; var i, l; populateComponents(_properties, context.validator, context.warnings); for (i = 0, l = _properties.length; i < l; i++) { _property = _properties[i]; if (_property.block) { optimizeProperties(_property.value[0][1], withOverriding, withMerging, context); } } if (withMerging && levelOptions.mergeIntoShorthands) { mergeIntoShorthands(_properties, context.validator); } if (withOverriding && levelOptions.overrideProperties) { overrideProperties(_properties, withMerging, context.options.compatibility, context.validator); } restoreFromOptimizing(_properties, restoreWithComponents); removeUnused(_properties); } module2.exports = optimizeProperties; } }); // node_modules/clean-css/lib/optimizer/level-2/merge-adjacent.js var require_merge_adjacent = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/merge-adjacent.js"(exports, module2) { var isMergeable = require_is_mergeable(); var optimizeProperties = require_optimize3(); var sortSelectors = require_sort_selectors(); var tidyRules = require_tidy_rules(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var serializeBody = require_one_time().body; var serializeRules = require_one_time().rules; var Token = require_token(); function mergeAdjacent(tokens, context) { var lastToken = [null, [], []]; var options = context.options; var adjacentSpace = options.compatibility.selectors.adjacentSpace; var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod; var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var mergeLimit = options.compatibility.selectors.mergeLimit; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; if (token[0] != Token.RULE) { lastToken = [null, [], []]; continue; } if (lastToken[0] == Token.RULE && serializeRules(token[1]) == serializeRules(lastToken[1])) { Array.prototype.push.apply(lastToken[2], token[2]); optimizeProperties(lastToken[2], true, true, context); token[2] = []; } else if (lastToken[0] == Token.RULE && serializeBody(token[2]) == serializeBody(lastToken[2]) && isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) && isMergeable(serializeRules(lastToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) && lastToken[1].length < mergeLimit) { lastToken[1] = tidyRules(lastToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings); lastToken[1] = lastToken.length > 1 ? sortSelectors(lastToken[1], selectorsSortingMethod) : lastToken[1]; token[2] = []; } else { lastToken = token; } } } module2.exports = mergeAdjacent; } }); // node_modules/clean-css/lib/optimizer/level-2/rules-overlap.js var require_rules_overlap = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/rules-overlap.js"(exports, module2) { var MODIFIER_PATTERN = /--.+$/; function rulesOverlap(rule1, rule2, bemMode) { var scope1; var scope2; var i, l; var j, m; for (i = 0, l = rule1.length; i < l; i++) { scope1 = rule1[i][1]; for (j = 0, m = rule2.length; j < m; j++) { scope2 = rule2[j][1]; if (scope1 == scope2) { return true; } if (bemMode && withoutModifiers(scope1) == withoutModifiers(scope2)) { return true; } } } return false; } function withoutModifiers(scope) { return scope.replace(MODIFIER_PATTERN, ""); } module2.exports = rulesOverlap; } }); // node_modules/clean-css/lib/optimizer/level-2/specificity.js var require_specificity = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/specificity.js"(exports, module2) { var Marker = require_marker(); var Selector = { ADJACENT_SIBLING: "+", DESCENDANT: ">", DOT: ".", HASH: "#", NON_ADJACENT_SIBLING: "~", PSEUDO: ":" }; var LETTER_PATTERN = /[a-zA-Z]/; var NOT_PREFIX = ":not("; var SEPARATOR_PATTERN = /[\s,(>~+]/; function specificity(selector) { var result = [0, 0, 0]; var character; var isEscaped; var isSingleQuoted; var isDoubleQuoted; var roundBracketLevel = 0; var couldIntroduceNewTypeSelector; var withinNotPseudoClass = false; var wasPseudoClass = false; var i, l; for (i = 0, l = selector.length; i < l; i++) { character = selector[i]; if (isEscaped) { } else if (character == Marker.SINGLE_QUOTE && !isDoubleQuoted && !isSingleQuoted) { isSingleQuoted = true; } else if (character == Marker.SINGLE_QUOTE && !isDoubleQuoted && isSingleQuoted) { isSingleQuoted = false; } else if (character == Marker.DOUBLE_QUOTE && !isDoubleQuoted && !isSingleQuoted) { isDoubleQuoted = true; } else if (character == Marker.DOUBLE_QUOTE && isDoubleQuoted && !isSingleQuoted) { isDoubleQuoted = false; } else if (isSingleQuoted || isDoubleQuoted) { continue; } else if (roundBracketLevel > 0 && !withinNotPseudoClass) { } else if (character == Marker.OPEN_ROUND_BRACKET) { roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && roundBracketLevel == 1) { roundBracketLevel--; withinNotPseudoClass = false; } else if (character == Marker.CLOSE_ROUND_BRACKET) { roundBracketLevel--; } else if (character == Selector.HASH) { result[0]++; } else if (character == Selector.DOT || character == Marker.OPEN_SQUARE_BRACKET) { result[1]++; } else if (character == Selector.PSEUDO && !wasPseudoClass && !isNotPseudoClass(selector, i)) { result[1]++; withinNotPseudoClass = false; } else if (character == Selector.PSEUDO) { withinNotPseudoClass = true; } else if ((i === 0 || couldIntroduceNewTypeSelector) && LETTER_PATTERN.test(character)) { result[2]++; } isEscaped = character == Marker.BACK_SLASH; wasPseudoClass = character == Selector.PSEUDO; couldIntroduceNewTypeSelector = !isEscaped && SEPARATOR_PATTERN.test(character); } return result; } function isNotPseudoClass(selector, index) { return selector.indexOf(NOT_PREFIX, index) === index; } module2.exports = specificity; } }); // node_modules/clean-css/lib/optimizer/level-2/specificities-overlap.js var require_specificities_overlap = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/specificities-overlap.js"(exports, module2) { var specificity = require_specificity(); function specificitiesOverlap(selector1, selector2, cache) { var specificity1; var specificity2; var i, l; var j, m; for (i = 0, l = selector1.length; i < l; i++) { specificity1 = findSpecificity(selector1[i][1], cache); for (j = 0, m = selector2.length; j < m; j++) { specificity2 = findSpecificity(selector2[j][1], cache); if (specificity1[0] === specificity2[0] && specificity1[1] === specificity2[1] && specificity1[2] === specificity2[2]) { return true; } } } return false; } function findSpecificity(selector, cache) { var value; if (!(selector in cache)) { cache[selector] = value = specificity(selector); } return value || cache[selector]; } module2.exports = specificitiesOverlap; } }); // node_modules/clean-css/lib/optimizer/level-2/reorderable.js var require_reorderable = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/reorderable.js"(exports, module2) { var rulesOverlap = require_rules_overlap(); var specificitiesOverlap = require_specificities_overlap(); var FLEX_PROPERTIES = /align-items|box-align|box-pack|flex|justify/; var BORDER_PROPERTIES = /^border-(top|right|bottom|left|color|style|width|radius)/; function canReorder(left, right, cache) { for (var i = right.length - 1; i >= 0; i--) { for (var j = left.length - 1; j >= 0; j--) { if (!canReorderSingle(left[j], right[i], cache)) { return false; } } } return true; } function canReorderSingle(left, right, cache) { var leftName = left[0]; var leftValue = left[1]; var leftNameRoot = left[2]; var leftSelector = left[5]; var leftInSpecificSelector = left[6]; var rightName = right[0]; var rightValue = right[1]; var rightNameRoot = right[2]; var rightSelector = right[5]; var rightInSpecificSelector = right[6]; if (leftName == "font" && rightName == "line-height" || rightName == "font" && leftName == "line-height") { return false; } if (FLEX_PROPERTIES.test(leftName) && FLEX_PROPERTIES.test(rightName)) { return false; } if (leftNameRoot == rightNameRoot && unprefixed(leftName) == unprefixed(rightName) && vendorPrefixed(leftName) ^ vendorPrefixed(rightName)) { return false; } if (leftNameRoot == "border" && BORDER_PROPERTIES.test(rightNameRoot) && (leftName == "border" || leftName == rightNameRoot || leftValue != rightValue && sameBorderComponent(leftName, rightName))) { return false; } if (rightNameRoot == "border" && BORDER_PROPERTIES.test(leftNameRoot) && (rightName == "border" || rightName == leftNameRoot || leftValue != rightValue && sameBorderComponent(leftName, rightName))) { return false; } if (leftNameRoot == "border" && rightNameRoot == "border" && leftName != rightName && (isSideBorder(leftName) && isStyleBorder(rightName) || isStyleBorder(leftName) && isSideBorder(rightName))) { return false; } if (leftNameRoot != rightNameRoot) { return true; } if (leftName == rightName && leftNameRoot == rightNameRoot && (leftValue == rightValue || withDifferentVendorPrefix(leftValue, rightValue))) { return true; } if (leftName != rightName && leftNameRoot == rightNameRoot && leftName != leftNameRoot && rightName != rightNameRoot) { return true; } if (leftName != rightName && leftNameRoot == rightNameRoot && leftValue == rightValue) { return true; } if (rightInSpecificSelector && leftInSpecificSelector && !inheritable(leftNameRoot) && !inheritable(rightNameRoot) && !rulesOverlap(rightSelector, leftSelector, false)) { return true; } if (!specificitiesOverlap(leftSelector, rightSelector, cache)) { return true; } return false; } function vendorPrefixed(name) { return /^-(?:moz|webkit|ms|o)-/.test(name); } function unprefixed(name) { return name.replace(/^-(?:moz|webkit|ms|o)-/, ""); } function sameBorderComponent(name1, name2) { return name1.split("-").pop() == name2.split("-").pop(); } function isSideBorder(name) { return name == "border-top" || name == "border-right" || name == "border-bottom" || name == "border-left"; } function isStyleBorder(name) { return name == "border-color" || name == "border-style" || name == "border-width"; } function withDifferentVendorPrefix(value1, value2) { return vendorPrefixed(value1) && vendorPrefixed(value2) && value1.split("-")[1] != value2.split("-")[2]; } function inheritable(name) { return name == "font" || name == "line-height" || name == "list-style"; } module2.exports = { canReorder, canReorderSingle }; } }); // node_modules/clean-css/lib/optimizer/level-2/extract-properties.js var require_extract_properties = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/extract-properties.js"(exports, module2) { var Token = require_token(); var serializeRules = require_one_time().rules; var serializeValue = require_one_time().value; function extractProperties(token) { var properties = []; var inSpecificSelector; var property; var name; var value; var i, l; if (token[0] == Token.RULE) { inSpecificSelector = !/[.+>~]/.test(serializeRules(token[1])); for (i = 0, l = token[2].length; i < l; i++) { property = token[2][i]; if (property[0] != Token.PROPERTY) { continue; } name = property[1][1]; if (name.length === 0) { continue; } value = serializeValue(property, i); properties.push([ name, value, findNameRoot(name), token[2][i], name + ":" + value, token[1], inSpecificSelector ]); } } else if (token[0] == Token.NESTED_BLOCK) { for (i = 0, l = token[2].length; i < l; i++) { properties = properties.concat(extractProperties(token[2][i])); } } return properties; } function findNameRoot(name) { if (name == "list-style") { return name; } if (name.indexOf("-radius") > 0) { return "border-radius"; } if (name == "border-collapse" || name == "border-spacing" || name == "border-image") { return name; } if (name.indexOf("border-") === 0 && /^border-\w+-\w+$/.test(name)) { return name.match(/border-\w+/)[0]; } if (name.indexOf("border-") === 0 && /^border-\w+$/.test(name)) { return "border"; } if (name.indexOf("text-") === 0) { return name; } if (name == "-chrome-") { return name; } return name.replace(/^-\w+-/, "").match(/([a-zA-Z]+)/)[0].toLowerCase(); } module2.exports = extractProperties; } }); // node_modules/clean-css/lib/optimizer/level-2/merge-media-queries.js var require_merge_media_queries = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/merge-media-queries.js"(exports, module2) { var canReorder = require_reorderable().canReorder; var canReorderSingle = require_reorderable().canReorderSingle; var extractProperties = require_extract_properties(); var rulesOverlap = require_rules_overlap(); var serializeRules = require_one_time().rules; var OptimizationLevel = require_optimization_level().OptimizationLevel; var Token = require_token(); function mergeMediaQueries(tokens, context) { var mergeSemantically = context.options.level[OptimizationLevel.Two].mergeSemantically; var specificityCache = context.cache.specificity; var candidates = {}; var reduced = []; for (var i = tokens.length - 1; i >= 0; i--) { var token = tokens[i]; if (token[0] != Token.NESTED_BLOCK) { continue; } var key = serializeRules(token[1]); var candidate = candidates[key]; if (!candidate) { candidate = []; candidates[key] = candidate; } candidate.push(i); } for (var name in candidates) { var positions = candidates[name]; positionLoop: for (var j = positions.length - 1; j > 0; j--) { var positionOne = positions[j]; var tokenOne = tokens[positionOne]; var positionTwo = positions[j - 1]; var tokenTwo = tokens[positionTwo]; directionLoop: for (var direction = 1; direction >= -1; direction -= 2) { var topToBottom = direction == 1; var from = topToBottom ? positionOne + 1 : positionTwo - 1; var to = topToBottom ? positionTwo : positionOne; var delta = topToBottom ? 1 : -1; var source = topToBottom ? tokenOne : tokenTwo; var target = topToBottom ? tokenTwo : tokenOne; var movedProperties = extractProperties(source); while (from != to) { var traversedProperties = extractProperties(tokens[from]); from += delta; if (mergeSemantically && allSameRulePropertiesCanBeReordered(movedProperties, traversedProperties, specificityCache)) { continue; } if (!canReorder(movedProperties, traversedProperties, specificityCache)) { continue directionLoop; } } target[2] = topToBottom ? source[2].concat(target[2]) : target[2].concat(source[2]); source[2] = []; reduced.push(target); continue positionLoop; } } } return reduced; } function allSameRulePropertiesCanBeReordered(movedProperties, traversedProperties, specificityCache) { var movedProperty; var movedRule; var traversedProperty; var traversedRule; var i, l; var j, m; for (i = 0, l = movedProperties.length; i < l; i++) { movedProperty = movedProperties[i]; movedRule = movedProperty[5]; for (j = 0, m = traversedProperties.length; j < m; j++) { traversedProperty = traversedProperties[j]; traversedRule = traversedProperty[5]; if (rulesOverlap(movedRule, traversedRule, true) && !canReorderSingle(movedProperty, traversedProperty, specificityCache)) { return false; } } } return true; } module2.exports = mergeMediaQueries; } }); // node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-body.js var require_merge_non_adjacent_by_body = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-body.js"(exports, module2) { var isMergeable = require_is_mergeable(); var sortSelectors = require_sort_selectors(); var tidyRules = require_tidy_rules(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var serializeBody = require_one_time().body; var serializeRules = require_one_time().rules; var Token = require_token(); function unsafeSelector(value) { return /\.|\*| :/.test(value); } function isBemElement(token) { var asString = serializeRules(token[1]); return asString.indexOf("__") > -1 || asString.indexOf("--") > -1; } function withoutModifier(selector) { return selector.replace(/--[^ ,>+~:]+/g, ""); } function removeAnyUnsafeElements(left, candidates) { var leftSelector = withoutModifier(serializeRules(left[1])); for (var body in candidates) { var right = candidates[body]; var rightSelector = withoutModifier(serializeRules(right[1])); if (rightSelector.indexOf(leftSelector) > -1 || leftSelector.indexOf(rightSelector) > -1) { delete candidates[body]; } } } function mergeNonAdjacentByBody(tokens, context) { var options = context.options; var mergeSemantically = options.level[OptimizationLevel.Two].mergeSemantically; var adjacentSpace = options.compatibility.selectors.adjacentSpace; var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod; var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; var candidates = {}; for (var i = tokens.length - 1; i >= 0; i--) { var token = tokens[i]; if (token[0] != Token.RULE) { continue; } if (token[2].length > 0 && (!mergeSemantically && unsafeSelector(serializeRules(token[1])))) { candidates = {}; } if (token[2].length > 0 && mergeSemantically && isBemElement(token)) { removeAnyUnsafeElements(token, candidates); } var candidateBody = serializeBody(token[2]); var oldToken = candidates[candidateBody]; if (oldToken && isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) && isMergeable(serializeRules(oldToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) { if (token[2].length > 0) { token[1] = tidyRules(oldToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings); token[1] = token[1].length > 1 ? sortSelectors(token[1], selectorsSortingMethod) : token[1]; } else { token[1] = oldToken[1].concat(token[1]); } oldToken[2] = []; candidates[candidateBody] = null; } candidates[serializeBody(token[2])] = token; } } module2.exports = mergeNonAdjacentByBody; } }); // node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-selector.js var require_merge_non_adjacent_by_selector = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-selector.js"(exports, module2) { var canReorder = require_reorderable().canReorder; var extractProperties = require_extract_properties(); var optimizeProperties = require_optimize3(); var serializeRules = require_one_time().rules; var Token = require_token(); function mergeNonAdjacentBySelector(tokens, context) { var specificityCache = context.cache.specificity; var allSelectors = {}; var repeatedSelectors = []; var i; for (i = tokens.length - 1; i >= 0; i--) { if (tokens[i][0] != Token.RULE) { continue; } if (tokens[i][2].length === 0) { continue; } var selector = serializeRules(tokens[i][1]); allSelectors[selector] = [i].concat(allSelectors[selector] || []); if (allSelectors[selector].length == 2) { repeatedSelectors.push(selector); } } for (i = repeatedSelectors.length - 1; i >= 0; i--) { var positions = allSelectors[repeatedSelectors[i]]; selectorIterator: for (var j = positions.length - 1; j > 0; j--) { var positionOne = positions[j - 1]; var tokenOne = tokens[positionOne]; var positionTwo = positions[j]; var tokenTwo = tokens[positionTwo]; directionIterator: for (var direction = 1; direction >= -1; direction -= 2) { var topToBottom = direction == 1; var from = topToBottom ? positionOne + 1 : positionTwo - 1; var to = topToBottom ? positionTwo : positionOne; var delta = topToBottom ? 1 : -1; var moved = topToBottom ? tokenOne : tokenTwo; var target = topToBottom ? tokenTwo : tokenOne; var movedProperties = extractProperties(moved); while (from != to) { var traversedProperties = extractProperties(tokens[from]); from += delta; var reorderable = topToBottom ? canReorder(movedProperties, traversedProperties, specificityCache) : canReorder(traversedProperties, movedProperties, specificityCache); if (!reorderable && !topToBottom) { continue selectorIterator; } if (!reorderable && topToBottom) { continue directionIterator; } } if (topToBottom) { Array.prototype.push.apply(moved[2], target[2]); target[2] = moved[2]; } else { Array.prototype.push.apply(target[2], moved[2]); } optimizeProperties(target[2], true, true, context); moved[2] = []; } } } } module2.exports = mergeNonAdjacentBySelector; } }); // node_modules/clean-css/lib/utils/clone-array.js var require_clone_array = __commonJS({ "node_modules/clean-css/lib/utils/clone-array.js"(exports, module2) { function cloneArray(array) { var cloned = array.slice(0); for (var i = 0, l = cloned.length; i < l; i++) { if (Array.isArray(cloned[i])) { cloned[i] = cloneArray(cloned[i]); } } return cloned; } module2.exports = cloneArray; } }); // node_modules/clean-css/lib/optimizer/level-2/reduce-non-adjacent.js var require_reduce_non_adjacent = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/reduce-non-adjacent.js"(exports, module2) { var isMergeable = require_is_mergeable(); var optimizeProperties = require_optimize3(); var cloneArray = require_clone_array(); var Token = require_token(); var serializeBody = require_one_time().body; var serializeRules = require_one_time().rules; function reduceNonAdjacent(tokens, context) { var options = context.options; var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; var candidates = {}; var repeated = []; for (var i = tokens.length - 1; i >= 0; i--) { var token = tokens[i]; if (token[0] != Token.RULE) { continue; } else if (token[2].length === 0) { continue; } var selectorAsString = serializeRules(token[1]); var isComplexAndNotSpecial = token[1].length > 1 && isMergeable(selectorAsString, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging); var wrappedSelectors = wrappedSelectorsFrom(token[1]); var selectors = isComplexAndNotSpecial ? [selectorAsString].concat(wrappedSelectors) : [selectorAsString]; for (var j = 0, m = selectors.length; j < m; j++) { var selector = selectors[j]; if (!candidates[selector]) { candidates[selector] = []; } else { repeated.push(selector); } candidates[selector].push({ where: i, list: wrappedSelectors, isPartial: isComplexAndNotSpecial && j > 0, isComplex: isComplexAndNotSpecial && j === 0 }); } } reduceSimpleNonAdjacentCases(tokens, repeated, candidates, options, context); reduceComplexNonAdjacentCases(tokens, candidates, options, context); } function wrappedSelectorsFrom(list) { var wrapped = []; for (var i = 0; i < list.length; i++) { wrapped.push([list[i][1]]); } return wrapped; } function reduceSimpleNonAdjacentCases(tokens, repeated, candidates, options, context) { function filterOut(idx, bodies) { return data[idx].isPartial && bodies.length === 0; } function reduceBody(token, newBody, processedCount, tokenIdx) { if (!data[processedCount - tokenIdx - 1].isPartial) { token[2] = newBody; } } for (var i = 0, l = repeated.length; i < l; i++) { var selector = repeated[i]; var data = candidates[selector]; reduceSelector(tokens, data, { filterOut, callback: reduceBody }, options, context); } } function reduceComplexNonAdjacentCases(tokens, candidates, options, context) { var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; var localContext = {}; function filterOut(idx) { return localContext.data[idx].where < localContext.intoPosition; } function collectReducedBodies(token, newBody, processedCount, tokenIdx) { if (tokenIdx === 0) { localContext.reducedBodies.push(newBody); } } allSelectors: for (var complexSelector in candidates) { var into = candidates[complexSelector]; if (!into[0].isComplex) { continue; } var intoPosition = into[into.length - 1].where; var intoToken = tokens[intoPosition]; var reducedBodies = []; var selectors = isMergeable(complexSelector, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) ? into[0].list : [complexSelector]; localContext.intoPosition = intoPosition; localContext.reducedBodies = reducedBodies; for (var j = 0, m = selectors.length; j < m; j++) { var selector = selectors[j]; var data = candidates[selector]; if (data.length < 2) { continue allSelectors; } localContext.data = data; reduceSelector(tokens, data, { filterOut, callback: collectReducedBodies }, options, context); if (serializeBody(reducedBodies[reducedBodies.length - 1]) != serializeBody(reducedBodies[0])) { continue allSelectors; } } intoToken[2] = reducedBodies[0]; } } function reduceSelector(tokens, data, context, options, outerContext) { var bodies = []; var bodiesAsList = []; var processedTokens = []; for (var j = data.length - 1; j >= 0; j--) { if (context.filterOut(j, bodies)) { continue; } var where = data[j].where; var token = tokens[where]; var clonedBody = cloneArray(token[2]); bodies = bodies.concat(clonedBody); bodiesAsList.push(clonedBody); processedTokens.push(where); } optimizeProperties(bodies, true, false, outerContext); var processedCount = processedTokens.length; var propertyIdx = bodies.length - 1; var tokenIdx = processedCount - 1; while (tokenIdx >= 0) { if ((tokenIdx === 0 || bodies[propertyIdx] && bodiesAsList[tokenIdx].indexOf(bodies[propertyIdx]) > -1) && propertyIdx > -1) { propertyIdx--; continue; } var newBody = bodies.splice(propertyIdx + 1); context.callback(tokens[processedTokens[tokenIdx]], newBody, processedCount, tokenIdx); tokenIdx--; } } module2.exports = reduceNonAdjacent; } }); // node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-font-at-rules.js var require_remove_duplicate_font_at_rules = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-font-at-rules.js"(exports, module2) { var Token = require_token(); var serializeAll = require_one_time().all; var FONT_FACE_SCOPE = "@font-face"; function removeDuplicateFontAtRules(tokens) { var fontAtRules = []; var token; var key; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; if (token[0] != Token.AT_RULE_BLOCK && token[1][0][1] != FONT_FACE_SCOPE) { continue; } key = serializeAll([token]); if (fontAtRules.indexOf(key) > -1) { token[2] = []; } else { fontAtRules.push(key); } } } module2.exports = removeDuplicateFontAtRules; } }); // node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-media-queries.js var require_remove_duplicate_media_queries = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-media-queries.js"(exports, module2) { var Token = require_token(); var serializeAll = require_one_time().all; var serializeRules = require_one_time().rules; function removeDuplicateMediaQueries(tokens) { var candidates = {}; var candidate; var token; var key; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; if (token[0] != Token.NESTED_BLOCK) { continue; } key = serializeRules(token[1]) + "%" + serializeAll(token[2]); candidate = candidates[key]; if (candidate) { candidate[2] = []; } candidates[key] = token; } } module2.exports = removeDuplicateMediaQueries; } }); // node_modules/clean-css/lib/optimizer/level-2/remove-duplicates.js var require_remove_duplicates = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/remove-duplicates.js"(exports, module2) { var Token = require_token(); var serializeBody = require_one_time().body; var serializeRules = require_one_time().rules; function removeDuplicates(tokens) { var matched = {}; var moreThanOnce = []; var id, token; var body, bodies; for (var i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; if (token[0] != Token.RULE) { continue; } id = serializeRules(token[1]); if (matched[id] && matched[id].length == 1) { moreThanOnce.push(id); } else { matched[id] = matched[id] || []; } matched[id].push(i); } for (i = 0, l = moreThanOnce.length; i < l; i++) { id = moreThanOnce[i]; bodies = []; for (var j = matched[id].length - 1; j >= 0; j--) { token = tokens[matched[id][j]]; body = serializeBody(token[2]); if (bodies.indexOf(body) > -1) { token[2] = []; } else { bodies.push(body); } } } } module2.exports = removeDuplicates; } }); // node_modules/clean-css/lib/optimizer/level-2/remove-unused-at-rules.js var require_remove_unused_at_rules = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/remove-unused-at-rules.js"(exports, module2) { var populateComponents = require_populate_components(); var wrapForOptimizing = require_wrap_for_optimizing().single; var restoreFromOptimizing = require_restore_from_optimizing(); var Token = require_token(); var animationNameRegex = /^(-moz-|-o-|-webkit-)?animation-name$/; var animationRegex = /^(-moz-|-o-|-webkit-)?animation$/; var keyframeRegex = /^@(-moz-|-o-|-webkit-)?keyframes /; var importantRegex = /\s{0,31}!important$/; var optionalMatchingQuotesRegex = /^(['"]?)(.*)\1$/; function normalize(value) { return value.replace(optionalMatchingQuotesRegex, "$2").replace(importantRegex, ""); } function removeUnusedAtRules(tokens, context) { removeUnusedAtRule(tokens, matchCounterStyle, markCounterStylesAsUsed, context); removeUnusedAtRule(tokens, matchFontFace, markFontFacesAsUsed, context); removeUnusedAtRule(tokens, matchKeyframe, markKeyframesAsUsed, context); removeUnusedAtRule(tokens, matchNamespace, markNamespacesAsUsed, context); } function removeUnusedAtRule(tokens, matchCallback, markCallback, context) { var atRules = {}; var atRule; var atRuleTokens; var atRuleToken; var zeroAt; var i, l; for (i = 0, l = tokens.length; i < l; i++) { matchCallback(tokens[i], atRules); } if (Object.keys(atRules).length === 0) { return; } markUsedAtRules(tokens, markCallback, atRules, context); for (atRule in atRules) { atRuleTokens = atRules[atRule]; for (i = 0, l = atRuleTokens.length; i < l; i++) { atRuleToken = atRuleTokens[i]; zeroAt = atRuleToken[0] == Token.AT_RULE ? 1 : 2; atRuleToken[zeroAt] = []; } } } function markUsedAtRules(tokens, markCallback, atRules, context) { var boundMarkCallback = markCallback(atRules); var i, l; for (i = 0, l = tokens.length; i < l; i++) { switch (tokens[i][0]) { case Token.RULE: boundMarkCallback(tokens[i], context); break; case Token.NESTED_BLOCK: markUsedAtRules(tokens[i][2], markCallback, atRules, context); } } } function matchCounterStyle(token, atRules) { var match; if (token[0] == Token.AT_RULE_BLOCK && token[1][0][1].indexOf("@counter-style") === 0) { match = token[1][0][1].split(" ")[1]; atRules[match] = atRules[match] || []; atRules[match].push(token); } } function markCounterStylesAsUsed(atRules) { return function(token, context) { var property; var wrappedProperty; var i, l; for (i = 0, l = token[2].length; i < l; i++) { property = token[2][i]; if (property[1][1] == "list-style") { wrappedProperty = wrapForOptimizing(property); populateComponents([wrappedProperty], context.validator, context.warnings); if (wrappedProperty.components[0].value[0][1] in atRules) { delete atRules[property[2][1]]; } restoreFromOptimizing([wrappedProperty]); } if (property[1][1] == "list-style-type" && property[2][1] in atRules) { delete atRules[property[2][1]]; } } }; } function matchFontFace(token, atRules) { var property; var match; var i, l; if (token[0] == Token.AT_RULE_BLOCK && token[1][0][1] == "@font-face") { for (i = 0, l = token[2].length; i < l; i++) { property = token[2][i]; if (property[1][1] == "font-family") { match = normalize(property[2][1].toLowerCase()); atRules[match] = atRules[match] || []; atRules[match].push(token); break; } } } } function markFontFacesAsUsed(atRules) { return function(token, context) { var property; var wrappedProperty; var component; var normalizedMatch; var i, l; var j, m; for (i = 0, l = token[2].length; i < l; i++) { property = token[2][i]; if (property[1][1] == "font") { wrappedProperty = wrapForOptimizing(property); populateComponents([wrappedProperty], context.validator, context.warnings); component = wrappedProperty.components[6]; for (j = 0, m = component.value.length; j < m; j++) { normalizedMatch = normalize(component.value[j][1].toLowerCase()); if (normalizedMatch in atRules) { delete atRules[normalizedMatch]; } } restoreFromOptimizing([wrappedProperty]); } if (property[1][1] == "font-family") { for (j = 2, m = property.length; j < m; j++) { normalizedMatch = normalize(property[j][1].toLowerCase()); if (normalizedMatch in atRules) { delete atRules[normalizedMatch]; } } } } }; } function matchKeyframe(token, atRules) { var match; if (token[0] == Token.NESTED_BLOCK && keyframeRegex.test(token[1][0][1])) { match = token[1][0][1].split(" ")[1]; atRules[match] = atRules[match] || []; atRules[match].push(token); } } function markKeyframesAsUsed(atRules) { return function(token, context) { var property; var wrappedProperty; var component; var i, l; var j, m; for (i = 0, l = token[2].length; i < l; i++) { property = token[2][i]; if (animationRegex.test(property[1][1])) { wrappedProperty = wrapForOptimizing(property); populateComponents([wrappedProperty], context.validator, context.warnings); component = wrappedProperty.components[7]; for (j = 0, m = component.value.length; j < m; j++) { if (component.value[j][1] in atRules) { delete atRules[component.value[j][1]]; } } restoreFromOptimizing([wrappedProperty]); } if (animationNameRegex.test(property[1][1])) { for (j = 2, m = property.length; j < m; j++) { if (property[j][1] in atRules) { delete atRules[property[j][1]]; } } } } }; } function matchNamespace(token, atRules) { var match; if (token[0] == Token.AT_RULE && token[1].indexOf("@namespace") === 0) { match = token[1].split(" ")[1]; atRules[match] = atRules[match] || []; atRules[match].push(token); } } function markNamespacesAsUsed(atRules) { var namespaceRegex = new RegExp(Object.keys(atRules).join("\\||") + "\\|", "g"); return function(token) { var match; var scope; var normalizedMatch; var i, l; var j, m; for (i = 0, l = token[1].length; i < l; i++) { scope = token[1][i]; match = scope[1].match(namespaceRegex); for (j = 0, m = match.length; j < m; j++) { normalizedMatch = match[j].substring(0, match[j].length - 1); if (normalizedMatch in atRules) { delete atRules[normalizedMatch]; } } } }; } module2.exports = removeUnusedAtRules; } }); // node_modules/clean-css/lib/optimizer/level-2/tidy-rule-duplicates.js var require_tidy_rule_duplicates = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/tidy-rule-duplicates.js"(exports, module2) { function ruleSorter(s1, s2) { return s1[1] > s2[1] ? 1 : -1; } function tidyRuleDuplicates(rules) { var list = []; var repeated = []; for (var i = 0, l = rules.length; i < l; i++) { var rule = rules[i]; if (repeated.indexOf(rule[1]) == -1) { repeated.push(rule[1]); list.push(rule); } } return list.sort(ruleSorter); } module2.exports = tidyRuleDuplicates; } }); // node_modules/clean-css/lib/optimizer/level-2/restructure.js var require_restructure = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/restructure.js"(exports, module2) { var canReorderSingle = require_reorderable().canReorderSingle; var extractProperties = require_extract_properties(); var isMergeable = require_is_mergeable(); var tidyRuleDuplicates = require_tidy_rule_duplicates(); var Token = require_token(); var cloneArray = require_clone_array(); var serializeBody = require_one_time().body; var serializeRules = require_one_time().rules; function naturalSorter(a, b) { return a > b ? 1 : -1; } function cloneAndMergeSelectors(propertyA, propertyB) { var cloned = cloneArray(propertyA); cloned[5] = cloned[5].concat(propertyB[5]); return cloned; } function restructure(tokens, context) { var options = context.options; var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var mergeLimit = options.compatibility.selectors.mergeLimit; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; var specificityCache = context.cache.specificity; var movableTokens = {}; var movedProperties = []; var multiPropertyMoveCache = {}; var movedToBeDropped = []; var maxCombinationsLevel = 2; var ID_JOIN_CHARACTER = "%"; function sendToMultiPropertyMoveCache(position2, movedProperty2, allFits) { for (var i2 = allFits.length - 1; i2 >= 0; i2--) { var fit = allFits[i2][0]; var id = addToCache(movedProperty2, fit); if (multiPropertyMoveCache[id].length > 1 && processMultiPropertyMove(position2, multiPropertyMoveCache[id])) { removeAllMatchingFromCache(id); break; } } } function addToCache(movedProperty2, fit) { var id = cacheId(fit); multiPropertyMoveCache[id] = multiPropertyMoveCache[id] || []; multiPropertyMoveCache[id].push([movedProperty2, fit]); return id; } function removeAllMatchingFromCache(matchId) { var matchSelectors = matchId.split(ID_JOIN_CHARACTER); var forRemoval = []; var i2; for (var id in multiPropertyMoveCache) { var selectors = id.split(ID_JOIN_CHARACTER); for (i2 = selectors.length - 1; i2 >= 0; i2--) { if (matchSelectors.indexOf(selectors[i2]) > -1) { forRemoval.push(id); break; } } } for (i2 = forRemoval.length - 1; i2 >= 0; i2--) { delete multiPropertyMoveCache[forRemoval[i2]]; } } function cacheId(cachedTokens) { var id = []; for (var i2 = 0, l = cachedTokens.length; i2 < l; i2++) { id.push(serializeRules(cachedTokens[i2][1])); } return id.join(ID_JOIN_CHARACTER); } function tokensToMerge(sourceTokens) { var uniqueTokensWithBody = []; var mergeableTokens = []; for (var i2 = sourceTokens.length - 1; i2 >= 0; i2--) { if (!isMergeable(serializeRules(sourceTokens[i2][1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) { continue; } mergeableTokens.unshift(sourceTokens[i2]); if (sourceTokens[i2][2].length > 0 && uniqueTokensWithBody.indexOf(sourceTokens[i2]) == -1) { uniqueTokensWithBody.push(sourceTokens[i2]); } } return uniqueTokensWithBody.length > 1 ? mergeableTokens : []; } function shortenIfPossible(position2, movedProperty2) { var name = movedProperty2[0]; var value = movedProperty2[1]; var key2 = movedProperty2[4]; var valueSize = name.length + value.length + 1; var allSelectors = []; var qualifiedTokens = []; var mergeableTokens = tokensToMerge(movableTokens[key2]); if (mergeableTokens.length < 2) { return; } var allFits = findAllFits(mergeableTokens, valueSize, 1); var bestFit = allFits[0]; if (bestFit[1] > 0) { return sendToMultiPropertyMoveCache(position2, movedProperty2, allFits); } for (var i2 = bestFit[0].length - 1; i2 >= 0; i2--) { allSelectors = bestFit[0][i2][1].concat(allSelectors); qualifiedTokens.unshift(bestFit[0][i2]); } allSelectors = tidyRuleDuplicates(allSelectors); dropAsNewTokenAt(position2, [movedProperty2], allSelectors, qualifiedTokens); } function fitSorter(fit1, fit2) { return fit1[1] > fit2[1] ? 1 : fit1[1] == fit2[1] ? 0 : -1; } function findAllFits(mergeableTokens, propertySize, propertiesCount) { var combinations = allCombinations(mergeableTokens, propertySize, propertiesCount, maxCombinationsLevel - 1); return combinations.sort(fitSorter); } function allCombinations(tokensVariant, propertySize, propertiesCount, level) { var differenceVariants = [[tokensVariant, sizeDifference(tokensVariant, propertySize, propertiesCount)]]; if (tokensVariant.length > 2 && level > 0) { for (var i2 = tokensVariant.length - 1; i2 >= 0; i2--) { var subVariant = Array.prototype.slice.call(tokensVariant, 0); subVariant.splice(i2, 1); differenceVariants = differenceVariants.concat(allCombinations(subVariant, propertySize, propertiesCount, level - 1)); } } return differenceVariants; } function sizeDifference(tokensVariant, propertySize, propertiesCount) { var allSelectorsSize = 0; for (var i2 = tokensVariant.length - 1; i2 >= 0; i2--) { allSelectorsSize += tokensVariant[i2][2].length > propertiesCount ? serializeRules(tokensVariant[i2][1]).length : -1; } return allSelectorsSize - (tokensVariant.length - 1) * propertySize + 1; } function dropAsNewTokenAt(position2, properties2, allSelectors, mergeableTokens) { var i2, j2, k2, m2; var allProperties = []; for (i2 = mergeableTokens.length - 1; i2 >= 0; i2--) { var mergeableToken = mergeableTokens[i2]; for (j2 = mergeableToken[2].length - 1; j2 >= 0; j2--) { var mergeableProperty = mergeableToken[2][j2]; for (k2 = 0, m2 = properties2.length; k2 < m2; k2++) { var property2 = properties2[k2]; var mergeablePropertyName = mergeableProperty[1][1]; var propertyName = property2[0]; var propertyBody = property2[4]; if (mergeablePropertyName == propertyName && serializeBody([mergeableProperty]) == propertyBody) { mergeableToken[2].splice(j2, 1); break; } } } } for (i2 = properties2.length - 1; i2 >= 0; i2--) { allProperties.unshift(properties2[i2][3]); } var newToken = [Token.RULE, allSelectors, allProperties]; tokens.splice(position2, 0, newToken); } function dropPropertiesAt(position2, movedProperty2) { var key2 = movedProperty2[4]; var toMove = movableTokens[key2]; if (toMove && toMove.length > 1) { if (!shortenMultiMovesIfPossible(position2, movedProperty2)) { shortenIfPossible(position2, movedProperty2); } } } function shortenMultiMovesIfPossible(position2, movedProperty2) { var candidates = []; var propertiesAndMergableTokens = []; var key2 = movedProperty2[4]; var j2, k2; var mergeableTokens = tokensToMerge(movableTokens[key2]); if (mergeableTokens.length < 2) { return; } movableLoop: for (var value in movableTokens) { var tokensList = movableTokens[value]; for (j2 = mergeableTokens.length - 1; j2 >= 0; j2--) { if (tokensList.indexOf(mergeableTokens[j2]) == -1) { continue movableLoop; } } candidates.push(value); } if (candidates.length < 2) { return false; } for (j2 = candidates.length - 1; j2 >= 0; j2--) { for (k2 = movedProperties.length - 1; k2 >= 0; k2--) { if (movedProperties[k2][4] == candidates[j2]) { propertiesAndMergableTokens.unshift([movedProperties[k2], mergeableTokens]); break; } } } return processMultiPropertyMove(position2, propertiesAndMergableTokens); } function processMultiPropertyMove(position2, propertiesAndMergableTokens) { var valueSize = 0; var properties2 = []; var property2; for (var i2 = propertiesAndMergableTokens.length - 1; i2 >= 0; i2--) { property2 = propertiesAndMergableTokens[i2][0]; var fullValue = property2[4]; valueSize += fullValue.length + (i2 > 0 ? 1 : 0); properties2.push(property2); } var mergeableTokens = propertiesAndMergableTokens[0][1]; var bestFit = findAllFits(mergeableTokens, valueSize, properties2.length)[0]; if (bestFit[1] > 0) { return false; } var allSelectors = []; var qualifiedTokens = []; for (i2 = bestFit[0].length - 1; i2 >= 0; i2--) { allSelectors = bestFit[0][i2][1].concat(allSelectors); qualifiedTokens.unshift(bestFit[0][i2]); } allSelectors = tidyRuleDuplicates(allSelectors); dropAsNewTokenAt(position2, properties2, allSelectors, qualifiedTokens); for (i2 = properties2.length - 1; i2 >= 0; i2--) { property2 = properties2[i2]; var index = movedProperties.indexOf(property2); delete movableTokens[property2[4]]; if (index > -1 && movedToBeDropped.indexOf(index) == -1) { movedToBeDropped.push(index); } } return true; } function boundToAnotherPropertyInCurrrentToken(property2, movedProperty2, token2) { var propertyName = property2[0]; var movedPropertyName = movedProperty2[0]; if (propertyName != movedPropertyName) { return false; } var key2 = movedProperty2[4]; var toMove = movableTokens[key2]; return toMove && toMove.indexOf(token2) > -1; } for (var i = tokens.length - 1; i >= 0; i--) { var token = tokens[i]; var isRule; var j, k, m; var samePropertyAt; if (token[0] == Token.RULE) { isRule = true; } else if (token[0] == Token.NESTED_BLOCK) { isRule = false; } else { continue; } var movedCount = movedProperties.length; var properties = extractProperties(token); movedToBeDropped = []; var unmovableInCurrentToken = []; for (j = properties.length - 1; j >= 0; j--) { for (k = j - 1; k >= 0; k--) { if (!canReorderSingle(properties[j], properties[k], specificityCache)) { unmovableInCurrentToken.push(j); break; } } } for (j = properties.length - 1; j >= 0; j--) { var property = properties[j]; var movedSameProperty = false; for (k = 0; k < movedCount; k++) { var movedProperty = movedProperties[k]; if (movedToBeDropped.indexOf(k) == -1 && (!canReorderSingle(property, movedProperty, specificityCache) && !boundToAnotherPropertyInCurrrentToken(property, movedProperty, token) || movableTokens[movedProperty[4]] && movableTokens[movedProperty[4]].length === mergeLimit)) { dropPropertiesAt(i + 1, movedProperty); if (movedToBeDropped.indexOf(k) == -1) { movedToBeDropped.push(k); delete movableTokens[movedProperty[4]]; } } if (!movedSameProperty) { movedSameProperty = property[0] == movedProperty[0] && property[1] == movedProperty[1]; if (movedSameProperty) { samePropertyAt = k; } } } if (!isRule || unmovableInCurrentToken.indexOf(j) > -1) { continue; } var key = property[4]; if (movedSameProperty && movedProperties[samePropertyAt][5].length + property[5].length > mergeLimit) { dropPropertiesAt(i + 1, movedProperties[samePropertyAt]); movedProperties.splice(samePropertyAt, 1); movableTokens[key] = [token]; movedSameProperty = false; } else { movableTokens[key] = movableTokens[key] || []; movableTokens[key].push(token); } if (movedSameProperty) { movedProperties[samePropertyAt] = cloneAndMergeSelectors(movedProperties[samePropertyAt], property); } else { movedProperties.push(property); } } movedToBeDropped = movedToBeDropped.sort(naturalSorter); for (j = 0, m = movedToBeDropped.length; j < m; j++) { var dropAt = movedToBeDropped[j] - j; movedProperties.splice(dropAt, 1); } } var position = tokens[0] && tokens[0][0] == Token.AT_RULE && tokens[0][1].indexOf("@charset") === 0 ? 1 : 0; for (; position < tokens.length - 1; position++) { var isImportRule = tokens[position][0] === Token.AT_RULE && tokens[position][1].indexOf("@import") === 0; var isComment = tokens[position][0] === Token.COMMENT; if (!(isImportRule || isComment)) { break; } } for (i = 0; i < movedProperties.length; i++) { dropPropertiesAt(position, movedProperties[i]); } } module2.exports = restructure; } }); // node_modules/clean-css/lib/optimizer/level-2/optimize.js var require_optimize4 = __commonJS({ "node_modules/clean-css/lib/optimizer/level-2/optimize.js"(exports, module2) { var mergeAdjacent = require_merge_adjacent(); var mergeMediaQueries = require_merge_media_queries(); var mergeNonAdjacentByBody = require_merge_non_adjacent_by_body(); var mergeNonAdjacentBySelector = require_merge_non_adjacent_by_selector(); var reduceNonAdjacent = require_reduce_non_adjacent(); var removeDuplicateFontAtRules = require_remove_duplicate_font_at_rules(); var removeDuplicateMediaQueries = require_remove_duplicate_media_queries(); var removeDuplicates = require_remove_duplicates(); var removeUnusedAtRules = require_remove_unused_at_rules(); var restructure = require_restructure(); var optimizeProperties = require_optimize3(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var Token = require_token(); function removeEmpty(tokens) { for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; var isEmpty = false; switch (token[0]) { case Token.RULE: isEmpty = token[1].length === 0 || token[2].length === 0; break; case Token.NESTED_BLOCK: removeEmpty(token[2]); isEmpty = token[2].length === 0; break; case Token.AT_RULE: isEmpty = token[1].length === 0; break; case Token.AT_RULE_BLOCK: isEmpty = token[2].length === 0; } if (isEmpty) { tokens.splice(i, 1); i--; l--; } } } function recursivelyOptimizeBlocks(tokens, context) { for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; if (token[0] == Token.NESTED_BLOCK) { var isKeyframes = /@(-moz-|-o-|-webkit-)?keyframes/.test(token[1][0][1]); level2Optimize(token[2], context, !isKeyframes); } } } function recursivelyOptimizeProperties(tokens, context) { for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; switch (token[0]) { case Token.RULE: optimizeProperties(token[2], true, true, context); break; case Token.NESTED_BLOCK: recursivelyOptimizeProperties(token[2], context); } } } function level2Optimize(tokens, context, withRestructuring) { var levelOptions = context.options.level[OptimizationLevel.Two]; var level2Plugins = context.options.plugins.level2Block; var reduced; var i; recursivelyOptimizeBlocks(tokens, context); recursivelyOptimizeProperties(tokens, context); if (levelOptions.removeDuplicateRules) { removeDuplicates(tokens, context); } if (levelOptions.mergeAdjacentRules) { mergeAdjacent(tokens, context); } if (levelOptions.reduceNonAdjacentRules) { reduceNonAdjacent(tokens, context); } if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != "body") { mergeNonAdjacentBySelector(tokens, context); } if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != "selector") { mergeNonAdjacentByBody(tokens, context); } if (levelOptions.restructureRules && levelOptions.mergeAdjacentRules && withRestructuring) { restructure(tokens, context); mergeAdjacent(tokens, context); } if (levelOptions.restructureRules && !levelOptions.mergeAdjacentRules && withRestructuring) { restructure(tokens, context); } if (levelOptions.removeDuplicateFontRules) { removeDuplicateFontAtRules(tokens, context); } if (levelOptions.removeDuplicateMediaBlocks) { removeDuplicateMediaQueries(tokens, context); } if (levelOptions.removeUnusedAtRules) { removeUnusedAtRules(tokens, context); } if (levelOptions.mergeMedia) { reduced = mergeMediaQueries(tokens, context); for (i = reduced.length - 1; i >= 0; i--) { level2Optimize(reduced[i][2], context, false); } } for (i = 0; i < level2Plugins.length; i++) { level2Plugins[i](tokens); } if (levelOptions.removeEmpty) { removeEmpty(tokens); } return tokens; } module2.exports = level2Optimize; } }); // node_modules/clean-css/lib/optimizer/validator.js var require_validator = __commonJS({ "node_modules/clean-css/lib/optimizer/validator.js"(exports, module2) { var functionNoVendorRegexStr = "[A-Z]+(\\-|[A-Z]|[0-9])+\\(.*?\\)"; var functionVendorRegexStr = "\\-(\\-|[A-Z]|[0-9])+\\(.*?\\)"; var variableRegexStr = "var\\(\\-\\-[^\\)]+\\)"; var functionAnyRegexStr = "(" + variableRegexStr + "|" + functionNoVendorRegexStr + "|" + functionVendorRegexStr + ")"; var calcRegex = new RegExp("^(\\-moz\\-|\\-webkit\\-)?calc\\([^\\)]+\\)$", "i"); var decimalRegex = /[0-9]/; var functionAnyRegex = new RegExp("^" + functionAnyRegexStr + "$", "i"); var hexAlphaColorRegex = /^#(?:[0-9a-f]{4}|[0-9a-f]{8})$/i; var hslColorRegex = /^hsl\(\s{0,31}[-.]?\d+\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31}\)|hsla\(\s{0,31}[-.]?\d+\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\.?\d+\s{0,31}\)$/; var hslColorWithSpacesRegex = /^hsl\(\s{0,31}[-.]?\d+(deg)?\s{1,31}\d*\.?\d+%\s{1,31}\d*\.?\d+%\s{0,31}\)|hsla\(\s{0,31}[-.]?\d+(deg)?\s{1,31}\d*\.?\d+%\s{1,31}\d*\.?\d+%\s{1,31}\/\s{1,31}\d*\.?\d+%?\s{0,31}\)$/; var identifierRegex = /^(-[a-z0-9_][a-z0-9\-_]*|[a-z_][a-z0-9\-_]*)$/i; var namedEntityRegex = /^[a-z]+$/i; var prefixRegex = /^-([a-z0-9]|-)*$/i; var quotedTextRegex = /^("[^"]*"|'[^']*')$/i; var rgbColorRegex = /^rgb\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31}\)|rgba\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[.\d]+\s{0,31}\)$/i; var rgbColorWithSpacesRegex = /^rgb\(\s{0,31}[\d]{1,3}\s{1,31}[\d]{1,3}\s{1,31}[\d]{1,3}\s{0,31}\)|rgba\(\s{0,31}[\d]{1,3}\s{1,31}[\d]{1,3}\s{1,31}[\d]{1,3}\s{1,31}\/\s{1,31}[\d]*\.?[.\d]+%?\s{0,31}\)$/i; var timeUnitPattern = /\d+(s|ms)/; var timingFunctionRegex = /^(cubic-bezier|steps)\([^)]+\)$/; var validTimeUnits = ["ms", "s"]; var urlRegex = /^url\([\s\S]+\)$/i; var variableRegex = new RegExp("^" + variableRegexStr + "$", "i"); var eightValueColorRegex = /^#[0-9a-f]{8}$/i; var fourValueColorRegex = /^#[0-9a-f]{4}$/i; var sixValueColorRegex = /^#[0-9a-f]{6}$/i; var threeValueColorRegex = /^#[0-9a-f]{3}$/i; var DECIMAL_DOT = "."; var MINUS_SIGN = "-"; var PLUS_SIGN = "+"; var Keywords = { "^": [ "inherit", "initial", "unset" ], "*-style": [ "auto", "dashed", "dotted", "double", "groove", "hidden", "inset", "none", "outset", "ridge", "solid" ], "*-timing-function": [ "ease", "ease-in", "ease-in-out", "ease-out", "linear", "step-end", "step-start" ], "animation-direction": [ "alternate", "alternate-reverse", "normal", "reverse" ], "animation-fill-mode": [ "backwards", "both", "forwards", "none" ], "animation-iteration-count": [ "infinite" ], "animation-name": [ "none" ], "animation-play-state": [ "paused", "running" ], "background-attachment": [ "fixed", "inherit", "local", "scroll" ], "background-clip": [ "border-box", "content-box", "inherit", "padding-box", "text" ], "background-origin": [ "border-box", "content-box", "inherit", "padding-box" ], "background-position": [ "bottom", "center", "left", "right", "top" ], "background-repeat": [ "no-repeat", "inherit", "repeat", "repeat-x", "repeat-y", "round", "space" ], "background-size": [ "auto", "cover", "contain" ], "border-collapse": [ "collapse", "inherit", "separate" ], bottom: [ "auto" ], clear: [ "both", "left", "none", "right" ], color: [ "transparent" ], cursor: [ "all-scroll", "auto", "col-resize", "crosshair", "default", "e-resize", "help", "move", "n-resize", "ne-resize", "no-drop", "not-allowed", "nw-resize", "pointer", "progress", "row-resize", "s-resize", "se-resize", "sw-resize", "text", "vertical-text", "w-resize", "wait" ], display: [ "block", "inline", "inline-block", "inline-table", "list-item", "none", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group" ], float: [ "left", "none", "right" ], left: [ "auto" ], font: [ "caption", "icon", "menu", "message-box", "small-caption", "status-bar", "unset" ], "font-size": [ "large", "larger", "medium", "small", "smaller", "x-large", "x-small", "xx-large", "xx-small" ], "font-stretch": [ "condensed", "expanded", "extra-condensed", "extra-expanded", "normal", "semi-condensed", "semi-expanded", "ultra-condensed", "ultra-expanded" ], "font-style": [ "italic", "normal", "oblique" ], "font-variant": [ "normal", "small-caps" ], "font-weight": [ "100", "200", "300", "400", "500", "600", "700", "800", "900", "bold", "bolder", "lighter", "normal" ], "line-height": [ "normal" ], "list-style-position": [ "inside", "outside" ], "list-style-type": [ "armenian", "circle", "decimal", "decimal-leading-zero", "disc", "decimal|disc", "georgian", "lower-alpha", "lower-greek", "lower-latin", "lower-roman", "none", "square", "upper-alpha", "upper-latin", "upper-roman" ], overflow: [ "auto", "hidden", "scroll", "visible" ], position: [ "absolute", "fixed", "relative", "static" ], right: [ "auto" ], "text-align": [ "center", "justify", "left", "left|right", "right" ], "text-decoration": [ "line-through", "none", "overline", "underline" ], "text-overflow": [ "clip", "ellipsis" ], top: [ "auto" ], "vertical-align": [ "baseline", "bottom", "middle", "sub", "super", "text-bottom", "text-top", "top" ], visibility: [ "collapse", "hidden", "visible" ], "white-space": [ "normal", "nowrap", "pre" ], width: [ "inherit", "initial", "medium", "thick", "thin" ] }; var Units = [ "%", "ch", "cm", "em", "ex", "in", "mm", "pc", "pt", "px", "rem", "vh", "vm", "vmax", "vmin", "vw" ]; function isColor(value) { return value != "auto" && (isKeyword("color")(value) || isHexColor(value) || isColorFunction(value) || isNamedEntity(value)); } function isColorFunction(value) { return isRgbColor(value) || isHslColor(value); } function isDynamicUnit(value) { return calcRegex.test(value); } function isFunction(value) { return functionAnyRegex.test(value); } function isHexColor(value) { return threeValueColorRegex.test(value) || fourValueColorRegex.test(value) || sixValueColorRegex.test(value) || eightValueColorRegex.test(value); } function isHslColor(value) { return hslColorRegex.test(value) || hslColorWithSpacesRegex.test(value); } function isHexAlphaColor(value) { return hexAlphaColorRegex.test(value); } function isIdentifier(value) { return identifierRegex.test(value); } function isQuotedText(value) { return quotedTextRegex.test(value); } function isImage(value) { return value == "none" || value == "inherit" || isUrl(value); } function isKeyword(propertyName) { return function(value) { return Keywords[propertyName].indexOf(value) > -1; }; } function isNamedEntity(value) { return namedEntityRegex.test(value); } function isNumber(value) { return scanForNumber(value) == value.length; } function isRgbColor(value) { return rgbColorRegex.test(value) || rgbColorWithSpacesRegex.test(value); } function isPrefixed(value) { return prefixRegex.test(value); } function isPositiveNumber(value) { return isNumber(value) && parseFloat(value) >= 0; } function isVariable(value) { return variableRegex.test(value); } function isTime(value) { var numberUpTo = scanForNumber(value); return numberUpTo == value.length && parseInt(value) === 0 || numberUpTo > -1 && validTimeUnits.indexOf(value.slice(numberUpTo + 1)) > -1 || isCalculatedTime(value); } function isCalculatedTime(value) { return isFunction(value) && timeUnitPattern.test(value); } function isTimingFunction() { var isTimingFunctionKeyword = isKeyword("*-timing-function"); return function(value) { return isTimingFunctionKeyword(value) || timingFunctionRegex.test(value); }; } function isUnit(validUnits, value) { var numberUpTo = scanForNumber(value); return numberUpTo == value.length && parseInt(value) === 0 || numberUpTo > -1 && validUnits.indexOf(value.slice(numberUpTo + 1).toLowerCase()) > -1 || value == "auto" || value == "inherit"; } function isUrl(value) { return urlRegex.test(value); } function isZIndex(value) { return value == "auto" || isNumber(value) || isKeyword("^")(value); } function scanForNumber(value) { var hasDot = false; var hasSign = false; var character; var i, l; for (i = 0, l = value.length; i < l; i++) { character = value[i]; if (i === 0 && (character == PLUS_SIGN || character == MINUS_SIGN)) { hasSign = true; } else if (i > 0 && hasSign && (character == PLUS_SIGN || character == MINUS_SIGN)) { return i - 1; } else if (character == DECIMAL_DOT && !hasDot) { hasDot = true; } else if (character == DECIMAL_DOT && hasDot) { return i - 1; } else if (decimalRegex.test(character)) { continue; } else { return i - 1; } } return i; } function validator(compatibility) { var validUnits = Units.slice(0).filter(function(value) { return !(value in compatibility.units) || compatibility.units[value] === true; }); if (compatibility.customUnits.rpx) { validUnits.push("rpx"); } return { colorOpacity: compatibility.colors.opacity, colorHexAlpha: compatibility.colors.hexAlpha, isAnimationDirectionKeyword: isKeyword("animation-direction"), isAnimationFillModeKeyword: isKeyword("animation-fill-mode"), isAnimationIterationCountKeyword: isKeyword("animation-iteration-count"), isAnimationNameKeyword: isKeyword("animation-name"), isAnimationPlayStateKeyword: isKeyword("animation-play-state"), isTimingFunction: isTimingFunction(), isBackgroundAttachmentKeyword: isKeyword("background-attachment"), isBackgroundClipKeyword: isKeyword("background-clip"), isBackgroundOriginKeyword: isKeyword("background-origin"), isBackgroundPositionKeyword: isKeyword("background-position"), isBackgroundRepeatKeyword: isKeyword("background-repeat"), isBackgroundSizeKeyword: isKeyword("background-size"), isColor, isColorFunction, isDynamicUnit, isFontKeyword: isKeyword("font"), isFontSizeKeyword: isKeyword("font-size"), isFontStretchKeyword: isKeyword("font-stretch"), isFontStyleKeyword: isKeyword("font-style"), isFontVariantKeyword: isKeyword("font-variant"), isFontWeightKeyword: isKeyword("font-weight"), isFunction, isGlobal: isKeyword("^"), isHexAlphaColor, isHslColor, isIdentifier, isImage, isKeyword, isLineHeightKeyword: isKeyword("line-height"), isListStylePositionKeyword: isKeyword("list-style-position"), isListStyleTypeKeyword: isKeyword("list-style-type"), isNumber, isPrefixed, isPositiveNumber, isQuotedText, isRgbColor, isStyleKeyword: isKeyword("*-style"), isTime, isUnit: isUnit.bind(null, validUnits), isUrl, isVariable, isWidth: isKeyword("width"), isZIndex }; } module2.exports = validator; } }); // node_modules/clean-css/lib/options/compatibility.js var require_compatibility = __commonJS({ "node_modules/clean-css/lib/options/compatibility.js"(exports, module2) { var DEFAULTS = { "*": { colors: { hexAlpha: false, opacity: true }, customUnits: { rpx: false }, properties: { backgroundClipMerging: true, backgroundOriginMerging: true, backgroundSizeMerging: true, colors: true, ieBangHack: false, ieFilters: false, iePrefixHack: false, ieSuffixHack: false, merging: true, shorterLengthUnits: false, spaceAfterClosingBrace: true, urlQuotes: true, zeroUnits: true }, selectors: { adjacentSpace: false, ie7Hack: false, mergeablePseudoClasses: [ ":active", ":after", ":before", ":empty", ":checked", ":disabled", ":empty", ":enabled", ":first-child", ":first-letter", ":first-line", ":first-of-type", ":focus", ":hover", ":lang", ":last-child", ":last-of-type", ":link", ":not", ":nth-child", ":nth-last-child", ":nth-last-of-type", ":nth-of-type", ":only-child", ":only-of-type", ":root", ":target", ":visited" ], mergeablePseudoElements: [ "::after", "::before", "::first-letter", "::first-line" ], mergeLimit: 8191, multiplePseudoMerging: true }, units: { ch: true, in: true, pc: true, pt: true, rem: true, vh: true, vm: true, vmax: true, vmin: true, vw: true } } }; DEFAULTS.ie11 = merge2(DEFAULTS["*"], { properties: { ieSuffixHack: true } }); DEFAULTS.ie10 = merge2(DEFAULTS["*"], { properties: { ieSuffixHack: true } }); DEFAULTS.ie9 = merge2(DEFAULTS["*"], { properties: { ieFilters: true, ieSuffixHack: true } }); DEFAULTS.ie8 = merge2(DEFAULTS.ie9, { colors: { opacity: false }, properties: { backgroundClipMerging: false, backgroundOriginMerging: false, backgroundSizeMerging: false, iePrefixHack: true, merging: false }, selectors: { mergeablePseudoClasses: [ ":after", ":before", ":first-child", ":first-letter", ":focus", ":hover", ":visited" ], mergeablePseudoElements: [] }, units: { ch: false, rem: false, vh: false, vm: false, vmax: false, vmin: false, vw: false } }); DEFAULTS.ie7 = merge2(DEFAULTS.ie8, { properties: { ieBangHack: true }, selectors: { ie7Hack: true, mergeablePseudoClasses: [ ":first-child", ":first-letter", ":hover", ":visited" ] } }); function compatibilityFrom(source) { return merge2(DEFAULTS["*"], calculateSource(source)); } function merge2(source, target) { for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(target, key) && typeof value === "object" && !Array.isArray(value)) { target[key] = merge2(value, target[key] || {}); } else { target[key] = key in target ? target[key] : value; } } } return target; } function calculateSource(source) { if (typeof source == "object") { return source; } if (!/[,+-]/.test(source)) { return DEFAULTS[source] || DEFAULTS["*"]; } var parts = source.split(","); var template = parts[0] in DEFAULTS ? DEFAULTS[parts.shift()] : DEFAULTS["*"]; source = {}; parts.forEach(function(part) { var isAdd = part[0] == "+"; var key = part.substring(1).split("."); var group = key[0]; var option = key[1]; source[group] = source[group] || {}; source[group][option] = isAdd; }); return merge2(template, source); } module2.exports = compatibilityFrom; } }); // node_modules/clean-css/lib/utils/is-http-resource.js var require_is_http_resource = __commonJS({ "node_modules/clean-css/lib/utils/is-http-resource.js"(exports, module2) { var HTTP_RESOURCE_PATTERN = /^http:\/\//; function isHttpResource(uri) { return HTTP_RESOURCE_PATTERN.test(uri); } module2.exports = isHttpResource; } }); // node_modules/clean-css/lib/utils/is-https-resource.js var require_is_https_resource = __commonJS({ "node_modules/clean-css/lib/utils/is-https-resource.js"(exports, module2) { var HTTPS_RESOURCE_PATTERN = /^https:\/\//; function isHttpsResource(uri) { return HTTPS_RESOURCE_PATTERN.test(uri); } module2.exports = isHttpsResource; } }); // node_modules/clean-css/lib/reader/load-remote-resource.js var require_load_remote_resource = __commonJS({ "node_modules/clean-css/lib/reader/load-remote-resource.js"(exports, module2) { var http = require("http"); var https = require("https"); var url = require("url"); var isHttpResource = require_is_http_resource(); var isHttpsResource = require_is_https_resource(); var override = require_override(); var HTTP_PROTOCOL = "http:"; function loadRemoteResource(uri, inlineRequest, inlineTimeout, callback) { var proxyProtocol = inlineRequest.protocol || inlineRequest.hostname; var errorHandled = false; var requestOptions; var fetch2; requestOptions = override(url.parse(uri), inlineRequest || {}); if (inlineRequest.hostname !== void 0) { requestOptions.protocol = inlineRequest.protocol || HTTP_PROTOCOL; requestOptions.path = requestOptions.href; } fetch2 = proxyProtocol && !isHttpsResource(proxyProtocol) || isHttpResource(uri) ? http.get : https.get; fetch2(requestOptions, function(res) { var chunks = []; var movedUri; if (errorHandled) { return; } if (res.statusCode < 200 || res.statusCode > 399) { return callback(res.statusCode, null); } if (res.statusCode > 299) { movedUri = url.resolve(uri, res.headers.location); return loadRemoteResource(movedUri, inlineRequest, inlineTimeout, callback); } res.on("data", function(chunk) { chunks.push(chunk.toString()); }); res.on("end", function() { var body = chunks.join(""); callback(null, body); }); }).on("error", function(res) { if (errorHandled) { return; } errorHandled = true; callback(res.message, null); }).on("timeout", function() { if (errorHandled) { return; } errorHandled = true; callback("timeout", null); }).setTimeout(inlineTimeout); } module2.exports = loadRemoteResource; } }); // node_modules/clean-css/lib/options/fetch.js var require_fetch = __commonJS({ "node_modules/clean-css/lib/options/fetch.js"(exports, module2) { var loadRemoteResource = require_load_remote_resource(); function fetchFrom(callback) { return callback || loadRemoteResource; } module2.exports = fetchFrom; } }); // node_modules/clean-css/lib/options/inline.js var require_inline = __commonJS({ "node_modules/clean-css/lib/options/inline.js"(exports, module2) { function inlineOptionsFrom(rules) { if (Array.isArray(rules)) { return rules; } if (rules === false) { return ["none"]; } return rules === void 0 ? ["local"] : rules.split(","); } module2.exports = inlineOptionsFrom; } }); // node_modules/clean-css/lib/options/inline-request.js var require_inline_request = __commonJS({ "node_modules/clean-css/lib/options/inline-request.js"(exports, module2) { var url = require("url"); var override = require_override(); function inlineRequestFrom(option) { return override(proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy), option || {}); } function proxyOptionsFrom(httpProxy) { return httpProxy ? { hostname: url.parse(httpProxy).hostname, port: parseInt(url.parse(httpProxy).port) } : {}; } module2.exports = inlineRequestFrom; } }); // node_modules/clean-css/lib/options/inline-timeout.js var require_inline_timeout = __commonJS({ "node_modules/clean-css/lib/options/inline-timeout.js"(exports, module2) { var DEFAULT_TIMEOUT = 5e3; function inlineTimeoutFrom(option) { return option || DEFAULT_TIMEOUT; } module2.exports = inlineTimeoutFrom; } }); // node_modules/clean-css/lib/options/plugins.js var require_plugins = __commonJS({ "node_modules/clean-css/lib/options/plugins.js"(exports, module2) { function pluginsFrom(plugins) { var flatPlugins = { level1Value: [], level1Property: [], level2Block: [] }; plugins = plugins || []; flatPlugins.level1Value = plugins.map(function(plugin) { return plugin.level1 && plugin.level1.value; }).filter(function(plugin) { return plugin != null; }); flatPlugins.level1Property = plugins.map(function(plugin) { return plugin.level1 && plugin.level1.property; }).filter(function(plugin) { return plugin != null; }); flatPlugins.level2Block = plugins.map(function(plugin) { return plugin.level2 && plugin.level2.block; }).filter(function(plugin) { return plugin != null; }); return flatPlugins; } module2.exports = pluginsFrom; } }); // node_modules/clean-css/lib/options/rebase.js var require_rebase = __commonJS({ "node_modules/clean-css/lib/options/rebase.js"(exports, module2) { function rebaseFrom(rebaseOption, rebaseToOption) { if (rebaseToOption !== void 0) { return true; } if (rebaseOption === void 0) { return false; } return !!rebaseOption; } module2.exports = rebaseFrom; } }); // node_modules/clean-css/lib/options/rebase-to.js var require_rebase_to = __commonJS({ "node_modules/clean-css/lib/options/rebase-to.js"(exports, module2) { var path = require("path"); function rebaseToFrom(option) { return option ? path.resolve(option) : process.cwd(); } module2.exports = rebaseToFrom; } }); // node_modules/source-map/lib/base64.js var require_base64 = __commonJS({ "node_modules/source-map/lib/base64.js"(exports) { var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); exports.encode = function(number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; exports.decode = function(charCode) { var bigA = 65; var bigZ = 90; var littleA = 97; var littleZ = 122; var zero = 48; var nine = 57; var plus = 43; var slash = 47; var littleOffset = 26; var numberOffset = 52; if (bigA <= charCode && charCode <= bigZ) { return charCode - bigA; } if (littleA <= charCode && charCode <= littleZ) { return charCode - littleA + littleOffset; } if (zero <= charCode && charCode <= nine) { return charCode - zero + numberOffset; } if (charCode == plus) { return 62; } if (charCode == slash) { return 63; } return -1; }; } }); // node_modules/source-map/lib/base64-vlq.js var require_base64_vlq = __commonJS({ "node_modules/source-map/lib/base64-vlq.js"(exports) { var base64 = require_base64(); var VLQ_BASE_SHIFT = 5; var VLQ_BASE = 1 << VLQ_BASE_SHIFT; var VLQ_BASE_MASK = VLQ_BASE - 1; var VLQ_CONTINUATION_BIT = VLQ_BASE; function toVLQSigned(aValue) { return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; } function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); aOutParam.value = fromVLQSigned(result); aOutParam.rest = aIndex; }; } }); // node_modules/source-map/lib/util.js var require_util = __commonJS({ "node_modules/source-map/lib/util.js"(exports) { function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports.getArg = getArg; var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; var dataUrlRegexp = /^data:.+\,.+$/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[2], host: match[3], port: match[4], path: match[5] }; } exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = ""; if (aParsedUrl.scheme) { url += aParsedUrl.scheme + ":"; } url += "//"; if (aParsedUrl.auth) { url += aParsedUrl.auth + "@"; } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port; } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports.urlGenerate = urlGenerate; function normalize(aPath) { var path = aPath; var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } path = url.path; } var isAbsolute = exports.isAbsolute(path); var parts = path.split(/\/+/); for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { part = parts[i]; if (part === ".") { parts.splice(i, 1); } else if (part === "..") { up++; } else if (up > 0) { if (part === "") { parts.splice(i + 1, up); up = 0; } else { parts.splice(i, 2); up--; } } } path = parts.join("/"); if (path === "") { path = isAbsolute ? "/" : "."; } if (url) { url.path = path; return urlGenerate(url); } return path; } exports.normalize = normalize; function join(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } if (aPath === "") { aPath = "."; } var aPathUrl = urlParse(aPath); var aRootUrl = urlParse(aRoot); if (aRootUrl) { aRoot = aRootUrl.path || "/"; } if (aPathUrl && !aPathUrl.scheme) { if (aRootUrl) { aPathUrl.scheme = aRootUrl.scheme; } return urlGenerate(aPathUrl); } if (aPathUrl || aPath.match(dataUrlRegexp)) { return aPath; } if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { aRootUrl.host = aPath; return urlGenerate(aRootUrl); } var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath); if (aRootUrl) { aRootUrl.path = joined; return urlGenerate(aRootUrl); } return joined; } exports.join = join; exports.isAbsolute = function(aPath) { return aPath.charAt(0) === "/" || urlRegexp.test(aPath); }; function relative(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } aRoot = aRoot.replace(/\/$/, ""); var level = 0; while (aPath.indexOf(aRoot + "/") !== 0) { var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } aRoot = aRoot.slice(0, index); if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { return aPath; } ++level; } return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } exports.relative = relative; var supportsNullProto = function() { var obj = /* @__PURE__ */ Object.create(null); return !("__proto__" in obj); }(); function identity(s) { return s; } function toSetString(aStr) { if (isProtoString(aStr)) { return "$" + aStr; } return aStr; } exports.toSetString = supportsNullProto ? identity : toSetString; function fromSetString(aStr) { if (isProtoString(aStr)) { return aStr.slice(1); } return aStr; } exports.fromSetString = supportsNullProto ? identity : fromSetString; function isProtoString(s) { if (!s) { return false; } var length = s.length; if (length < 9) { return false; } if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) { return false; } for (var i = length - 10; i >= 0; i--) { if (s.charCodeAt(i) !== 36) { return false; } } return true; } function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0 || onlyCompareOriginal) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByOriginalPositions = compareByOriginalPositions; function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0 || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; function strcmp(aStr1, aStr2) { if (aStr1 === aStr2) { return 0; } if (aStr1 === null) { return 1; } if (aStr2 === null) { return -1; } if (aStr1 > aStr2) { return 1; } return -1; } function compareByGeneratedPositionsInflated(mappingA, mappingB) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; function parseSourceMapInput(str) { return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); } exports.parseSourceMapInput = parseSourceMapInput; function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { sourceURL = sourceURL || ""; if (sourceRoot) { if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") { sourceRoot += "/"; } sourceURL = sourceRoot + sourceURL; } if (sourceMapURL) { var parsed = urlParse(sourceMapURL); if (!parsed) { throw new Error("sourceMapURL could not be parsed"); } if (parsed.path) { var index = parsed.path.lastIndexOf("/"); if (index >= 0) { parsed.path = parsed.path.substring(0, index + 1); } } sourceURL = join(urlGenerate(parsed), sourceURL); } return normalize(sourceURL); } exports.computeSourceURL = computeSourceURL; } }); // node_modules/source-map/lib/array-set.js var require_array_set = __commonJS({ "node_modules/source-map/lib/array-set.js"(exports) { var util = require_util(); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; function ArraySet() { this._array = []; this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null); } ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; ArraySet.prototype.size = function ArraySet_size() { return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var sStr = hasNativeMap ? aStr : util.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { if (hasNativeMap) { this._set.set(aStr, idx); } else { this._set[sStr] = idx; } } }; ArraySet.prototype.has = function ArraySet_has(aStr) { if (hasNativeMap) { return this._set.has(aStr); } else { var sStr = util.toSetString(aStr); return has.call(this._set, sStr); } }; ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (hasNativeMap) { var idx = this._set.get(aStr); if (idx >= 0) { return idx; } } else { var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } } throw new Error('"' + aStr + '" is not in the set.'); }; ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error("No element indexed by " + aIdx); }; ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; } }); // node_modules/source-map/lib/mapping-list.js var require_mapping_list = __commonJS({ "node_modules/source-map/lib/mapping-list.js"(exports) { var util = require_util(); function generatedPositionAfter(mappingA, mappingB) { var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } function MappingList() { this._array = []; this._sorted = true; this._last = { generatedLine: -1, generatedColumn: 0 }; } MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { this._array.forEach(aCallback, aThisArg); }; MappingList.prototype.add = function MappingList_add(aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.push(aMapping); } else { this._sorted = false; this._array.push(aMapping); } }; MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }; exports.MappingList = MappingList; } }); // node_modules/source-map/lib/source-map-generator.js var require_source_map_generator = __commonJS({ "node_modules/source-map/lib/source-map-generator.js"(exports) { var base64VLQ = require_base64_vlq(); var util = require_util(); var ArraySet = require_array_set().ArraySet; var MappingList = require_mapping_list().MappingList; function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } this._file = util.getArg(aArgs, "file", null); this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); this._skipValidation = util.getArg(aArgs, "skipValidation", false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot }); aSourceMapConsumer.eachMapping(function(mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name != null) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function(sourceFile) { var sourceRelative = sourceFile; if (sourceRoot !== null) { sourceRelative = util.relative(sourceRoot, sourceFile); } if (!generator._sources.has(sourceRelative)) { generator._sources.add(sourceRelative); } var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; }; SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, "generated"); var original = util.getArg(aArgs, "original", null); var source = util.getArg(aArgs, "source", null); var name = util.getArg(aArgs, "name", null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } if (source != null) { source = String(source); if (!this._sources.has(source)) { this._sources.add(source); } } if (name != null) { name = String(name); if (!this._names.has(name)) { this._names.add(name); } } this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source, name }); }; SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { if (!this._sourcesContents) { this._sourcesContents = /* @__PURE__ */ Object.create(null); } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { var sourceFile = aSourceFile; if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`); } sourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } var newSources = new ArraySet(); var newNames = new ArraySet(); this._mappings.unsortedForEach(function(mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source != null) { mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = util.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name != null) { mapping.name = original.name; } } } var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; aSourceMapConsumer.sources.forEach(function(sourceFile2) { var content = aSourceMapConsumer.sourceContentFor(sourceFile2); if (content != null) { if (aSourceMapPath != null) { sourceFile2 = util.join(aSourceMapPath, sourceFile2); } if (sourceRoot != null) { sourceFile2 = util.relative(sourceRoot, sourceFile2); } this.setSourceContent(sourceFile2, content); } }, this); }; SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."); } if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { return; } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { return; } else { throw new Error("Invalid mapping: " + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName })); } }; SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ""; var next; var mapping; var nameIdx; var sourceIdx; var mappings = this._mappings.toArray(); for (var i = 0, len = mappings.length; i < len; i++) { mapping = mappings[i]; next = ""; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { next += ";"; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ","; } } next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source != null) { sourceIdx = this._sources.indexOf(mapping.source); next += base64VLQ.encode(sourceIdx - previousSource); previousSource = sourceIdx; next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name != null) { nameIdx = this._names.indexOf(mapping.name); next += base64VLQ.encode(nameIdx - previousName); previousName = nameIdx; } } result += next; } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function(source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._file != null) { map.file = this._file; } if (this._sourceRoot != null) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); }; exports.SourceMapGenerator = SourceMapGenerator; } }); // node_modules/source-map/lib/binary-search.js var require_binary_search = __commonJS({ "node_modules/source-map/lib/binary-search.js"(exports) { exports.GREATEST_LOWER_BOUND = 1; exports.LEAST_UPPER_BOUND = 2; function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { return mid; } else if (cmp > 0) { if (aHigh - mid > 1) { return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); } if (aBias == exports.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; } else { return mid; } } else { if (mid - aLow > 1) { return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); } if (aBias == exports.LEAST_UPPER_BOUND) { return mid; } else { return aLow < 0 ? -1 : aLow; } } } exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { if (aHaystack.length === 0) { return -1; } var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); if (index < 0) { return -1; } while (index - 1 >= 0) { if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { break; } --index; } return index; }; } }); // node_modules/source-map/lib/quick-sort.js var require_quick_sort = __commonJS({ "node_modules/source-map/lib/quick-sort.js"(exports) { function swap(ary, x, y) { var temp = ary[x]; ary[x] = ary[y]; ary[y] = temp; } function randomIntInRange(low, high) { return Math.round(low + Math.random() * (high - low)); } function doQuickSort(ary, comparator, p, r) { if (p < r) { var pivotIndex = randomIntInRange(p, r); var i = p - 1; swap(ary, pivotIndex, r); var pivot = ary[r]; for (var j = p; j < r; j++) { if (comparator(ary[j], pivot) <= 0) { i += 1; swap(ary, i, j); } } swap(ary, i + 1, j); var q = i + 1; doQuickSort(ary, comparator, p, q - 1); doQuickSort(ary, comparator, q + 1, r); } } exports.quickSort = function(ary, comparator) { doQuickSort(ary, comparator, 0, ary.length - 1); }; } }); // node_modules/source-map/lib/source-map-consumer.js var require_source_map_consumer = __commonJS({ "node_modules/source-map/lib/source-map-consumer.js"(exports) { var util = require_util(); var binarySearch = require_binary_search(); var ArraySet = require_array_set().ArraySet; var base64VLQ = require_base64_vlq(); var quickSort = require_quick_sort().quickSort; function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); }; SourceMapConsumer.prototype._version = 3; SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", { configurable: true, enumerable: true, get: function() { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", { configurable: true, enumerable: true, get: function() { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c = aStr.charAt(index); return c === ";" || c === ","; }; SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function(mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); return { source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : this._names.at(mapping.name) }; }, this).forEach(aCallback, context); }; SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, "line"); var needle = { source: util.getArg(aArgs, "source"), originalLine: line, originalColumn: util.getArg(aArgs, "column", 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { return []; } var mappings = []; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === void 0) { var originalLine = mapping.originalLine; while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports.SourceMapConsumer = SourceMapConsumer; function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, "version"); var sources = util.getArg(sourceMap, "sources"); var names = util.getArg(sourceMap, "names", []); var sourceRoot = util.getArg(sourceMap, "sourceRoot", null); var sourcesContent = util.getArg(sourceMap, "sourcesContent", null); var mappings = util.getArg(sourceMap, "mappings"); var file = util.getArg(sourceMap, "file", null); if (version != this._version) { throw new Error("Unsupported version: " + version); } if (sourceRoot) { sourceRoot = util.normalize(sourceRoot); } sources = sources.map(String).map(util.normalize).map(function(source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function(s) { return util.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this._sourceMapURL = aSourceMapURL; this.file = file; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); } var i; for (i = 0; i < this._absoluteSources.length; ++i) { if (this._absoluteSources[i] == aSource) { return i; } } return -1; }; BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function(s) { return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i = 0, length = generatedMappings.length; i < length; i++) { var srcMapping = generatedMappings[i]; var destMapping = new Mapping(); destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; BasicSourceMapConsumer.prototype._version = 3; Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() { return this._absoluteSources.slice(); } }); function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; while (index < length) { if (aStr.charAt(index) === ";") { generatedLine++; index++; previousGeneratedColumn = 0; } else if (aStr.charAt(index) === ",") { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = cachedSegments[str]; if (segment) { index += str.length; } else { segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error("Found a source, but no line and column"); } if (segment.length === 3) { throw new Error("Found a source and line, but no column"); } cachedSegments[str] = segment; } mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { mapping.source = previousSource + segment[1]; previousSource += segment[1]; mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; mapping.originalLine += 1; mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === "number") { originalMappings.push(mapping); } } } quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { if (aNeedle[aLineName] <= 0) { throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } mapping.lastGeneratedColumn = Infinity; } }; BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, "line"), generatedColumn: util.getArg(aArgs, "column") }; var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, "source", null); if (source !== null) { source = this._sources.at(source); source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } var name = util.getArg(mapping, "name", null); if (name !== null) { name = this._names.at(name); } return { source, line: util.getArg(mapping, "originalLine", null), column: util.getArg(mapping, "originalColumn", null), name }; } } return { source: null, line: null, column: null, name: null }; }; BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) { return sc == null; }); }; BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } var index = this._findSourceIndex(aSource); if (index >= 0) { return this.sourcesContent[index]; } var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; } if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; } } if (nullOnMissing) { return null; } else { throw new Error('"' + relativeSource + '" is not in the SourceMap.'); } }; BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, "source"); source = this._findSourceIndex(source); if (source < 0) { return { line: null, column: null, lastColumn: null }; } var needle = { source, originalLine: util.getArg(aArgs, "line"), originalColumn: util.getArg(aArgs, "column") }; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }; } } return { line: null, column: null, lastColumn: null }; }; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, "version"); var sections = util.getArg(sourceMap, "sections"); if (version != this._version) { throw new Error("Unsupported version: " + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function(s) { if (s.url) { throw new Error("Support for url field in sections not implemented."); } var offset = util.getArg(s, "offset"); var offsetLine = util.getArg(offset, "line"); var offsetColumn = util.getArg(offset, "column"); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { throw new Error("Section offsets must be ordered and non-overlapping."); } lastOffset = offset; return { generatedOffset: { generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL) }; }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; IndexedSourceMapConsumer.prototype._version = 3; Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() { var sources = []; for (var i = 0; i < this._sections.length; i++) { for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } }); IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, "line"), generatedColumn: util.getArg(aArgs, "column") }; var sectionIndex = binarySearch.search(needle, this._sections, function(needle2, section2) { var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine; if (cmp) { return cmp; } return needle2.generatedColumn - section2.generatedOffset.generatedColumn; }); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function(s) { return s.consumer.hasContentsOfAllSources(); }); }; IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var sectionMappings = section.consumer._generatedMappings; for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); var name = null; if (mapping.name) { name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); } var adjustedMapping = { source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === "number") { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; } }); // node_modules/source-map/lib/source-node.js var require_source_node = __commonJS({ "node_modules/source-map/lib/source-node.js"(exports) { var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; var util = require_util(); var REGEX_NEWLINE = /(\r?\n)/; var NEWLINE_CODE = 10; var isSourceNode = "$$$isSourceNode$$$"; function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine == null ? null : aLine; this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { var node = new SourceNode(); var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); var remainingLinesIndex = 0; var shiftNextLine = function() { var lineContents = getNextLine(); var newLine = getNextLine() || ""; return lineContents + newLine; function getNextLine() { return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0; } }; var lastGeneratedLine = 1, lastGeneratedColumn = 0; var lastMapping = null; aSourceMapConsumer.eachMapping(function(mapping) { if (lastMapping !== null) { if (lastGeneratedLine < mapping.generatedLine) { addMappingWithCode(lastMapping, shiftNextLine()); lastGeneratedLine++; lastGeneratedColumn = 0; } else { var nextLine = remainingLines[remainingLinesIndex] || ""; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); lastMapping = mapping; return; } } while (lastGeneratedLine < mapping.generatedLine) { node.add(shiftNextLine()); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[remainingLinesIndex] || ""; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); if (remainingLinesIndex < remainingLines.length) { if (lastMapping) { addMappingWithCode(lastMapping, shiftNextLine()); } node.add(remainingLines.splice(remainingLinesIndex).join("")); } aSourceMapConsumer.sources.forEach(function(sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === void 0) { node.add(code); } else { var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); } } }; SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function(chunk) { this.add(chunk); }, this); } else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); } return this; }; SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length - 1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); } return this; }; SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk[isSourceNode]) { chunk.walk(aFn); } else { if (chunk !== "") { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len - 1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === "string") { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push("".replace(aPattern, aReplacement)); } return this; }; SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function(chunk) { str += chunk; }); return str; }; SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function(chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } for (var idx = 0, length = chunk.length; idx < length; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } } else { generated.column++; } } }); this.walkSourceContents(function(sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map }; }; exports.SourceNode = SourceNode; } }); // node_modules/source-map/source-map.js var require_source_map = __commonJS({ "node_modules/source-map/source-map.js"(exports) { exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator; exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer; exports.SourceNode = require_source_node().SourceNode; } }); // node_modules/clean-css/lib/reader/input-source-map-tracker.js var require_input_source_map_tracker = __commonJS({ "node_modules/clean-css/lib/reader/input-source-map-tracker.js"(exports, module2) { var SourceMapConsumer = require_source_map().SourceMapConsumer; function inputSourceMapTracker() { var maps = {}; return { all: all.bind(null, maps), isTracking: isTracking.bind(null, maps), originalPositionFor: originalPositionFor.bind(null, maps), track: track.bind(null, maps) }; } function all(maps) { return maps; } function isTracking(maps, source) { return source in maps; } function originalPositionFor(maps, metadata, range, selectorFallbacks) { var line = metadata[0]; var column = metadata[1]; var source = metadata[2]; var position = { line, column: column + range }; var originalPosition; while (!originalPosition && position.column > column) { position.column--; originalPosition = maps[source].originalPositionFor(position); } if (!originalPosition || originalPosition.column < 0) { return metadata; } if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) { return originalPositionFor(maps, [line - 1, column, source], range, selectorFallbacks - 1); } return originalPosition.line !== null ? toMetadata(originalPosition) : metadata; } function toMetadata(asHash) { return [asHash.line, asHash.column, asHash.source]; } function track(maps, source, data) { maps[source] = new SourceMapConsumer(data); } module2.exports = inputSourceMapTracker; } }); // node_modules/clean-css/lib/utils/is-remote-resource.js var require_is_remote_resource = __commonJS({ "node_modules/clean-css/lib/utils/is-remote-resource.js"(exports, module2) { var REMOTE_RESOURCE_PATTERN = /^(\w+:\/\/|\/\/)/; var FILE_RESOURCE_PATTERN = /^file:\/\//; function isRemoteResource(uri) { return REMOTE_RESOURCE_PATTERN.test(uri) && !FILE_RESOURCE_PATTERN.test(uri); } module2.exports = isRemoteResource; } }); // node_modules/clean-css/lib/utils/has-protocol.js var require_has_protocol = __commonJS({ "node_modules/clean-css/lib/utils/has-protocol.js"(exports, module2) { var NO_PROTOCOL_RESOURCE_PATTERN = /^\/\//; function hasProtocol(uri) { return !NO_PROTOCOL_RESOURCE_PATTERN.test(uri); } module2.exports = hasProtocol; } }); // node_modules/clean-css/lib/reader/is-allowed-resource.js var require_is_allowed_resource = __commonJS({ "node_modules/clean-css/lib/reader/is-allowed-resource.js"(exports, module2) { var path = require("path"); var url = require("url"); var isRemoteResource = require_is_remote_resource(); var hasProtocol = require_has_protocol(); var HTTP_PROTOCOL = "http:"; function isAllowedResource(uri, isRemote, rules) { var match; var absoluteUri; var allowed = !isRemote; var rule; var isNegated; var normalizedRule; var i; if (rules.length === 0) { return false; } if (isRemote && !hasProtocol(uri)) { uri = HTTP_PROTOCOL + uri; } match = isRemote ? url.parse(uri).host : uri; absoluteUri = isRemote ? uri : path.resolve(uri); for (i = 0; i < rules.length; i++) { rule = rules[i]; isNegated = rule[0] == "!"; normalizedRule = rule.substring(1); if (isNegated && isRemote && isRemoteRule(normalizedRule)) { allowed = allowed && !isAllowedResource(uri, true, [normalizedRule]); } else if (isNegated && !isRemote && !isRemoteRule(normalizedRule)) { allowed = allowed && !isAllowedResource(uri, false, [normalizedRule]); } else if (isNegated) { allowed = allowed && true; } else if (rule == "all") { allowed = true; } else if (isRemote && rule == "local") { allowed = allowed || false; } else if (isRemote && rule == "remote") { allowed = true; } else if (!isRemote && rule == "remote") { allowed = false; } else if (!isRemote && rule == "local") { allowed = true; } else if (rule === match) { allowed = true; } else if (rule === uri) { allowed = true; } else if (isRemote && absoluteUri.indexOf(rule) === 0) { allowed = true; } else if (!isRemote && absoluteUri.indexOf(path.resolve(rule)) === 0) { allowed = true; } else if (isRemote != isRemoteRule(normalizedRule)) { allowed = allowed && true; } else { allowed = false; } } return allowed; } function isRemoteRule(rule) { return isRemoteResource(rule) || url.parse(HTTP_PROTOCOL + "//" + rule).host == rule; } module2.exports = isAllowedResource; } }); // node_modules/clean-css/lib/reader/match-data-uri.js var require_match_data_uri = __commonJS({ "node_modules/clean-css/lib/reader/match-data-uri.js"(exports, module2) { var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=(?:(?!;charset=)[^;])+)?(;[^,]+?)?,(.+)/; function matchDataUri(uri) { return DATA_URI_PATTERN.exec(uri); } module2.exports = matchDataUri; } }); // node_modules/clean-css/lib/reader/rebase-local-map.js var require_rebase_local_map = __commonJS({ "node_modules/clean-css/lib/reader/rebase-local-map.js"(exports, module2) { var path = require("path"); function rebaseLocalMap(sourceMap, sourceUri, rebaseTo) { var currentPath = path.resolve(""); var absoluteUri = path.resolve(currentPath, sourceUri); var absoluteUriDirectory = path.dirname(absoluteUri); sourceMap.sources = sourceMap.sources.map(function(source) { return path.relative(rebaseTo, path.resolve(absoluteUriDirectory, source)); }); return sourceMap; } module2.exports = rebaseLocalMap; } }); // node_modules/clean-css/lib/reader/rebase-remote-map.js var require_rebase_remote_map = __commonJS({ "node_modules/clean-css/lib/reader/rebase-remote-map.js"(exports, module2) { var path = require("path"); var url = require("url"); function rebaseRemoteMap(sourceMap, sourceUri) { var sourceDirectory = path.dirname(sourceUri); sourceMap.sources = sourceMap.sources.map(function(source) { return url.resolve(sourceDirectory, source); }); return sourceMap; } module2.exports = rebaseRemoteMap; } }); // node_modules/clean-css/lib/utils/is-data-uri-resource.js var require_is_data_uri_resource = __commonJS({ "node_modules/clean-css/lib/utils/is-data-uri-resource.js"(exports, module2) { var DATA_URI_PATTERN = /^data:(\S{0,31}?)?(;charset=(?:(?!;charset=)[^;])+)?(;[^,]+?)?,(.+)/; function isDataUriResource(uri) { return DATA_URI_PATTERN.test(uri); } module2.exports = isDataUriResource; } }); // node_modules/clean-css/lib/reader/apply-source-maps.js var require_apply_source_maps = __commonJS({ "node_modules/clean-css/lib/reader/apply-source-maps.js"(exports, module2) { var fs2 = require("fs"); var path = require("path"); var isAllowedResource = require_is_allowed_resource(); var matchDataUri = require_match_data_uri(); var rebaseLocalMap = require_rebase_local_map(); var rebaseRemoteMap = require_rebase_remote_map(); var Token = require_token(); var hasProtocol = require_has_protocol(); var isDataUriResource = require_is_data_uri_resource(); var isRemoteResource = require_is_remote_resource(); var MAP_MARKER_PATTERN = /^\/\*# sourceMappingURL=(\S+) \*\/$/; function applySourceMaps(tokens, context, callback) { var applyContext = { callback, fetch: context.options.fetch, index: 0, inline: context.options.inline, inlineRequest: context.options.inlineRequest, inlineTimeout: context.options.inlineTimeout, inputSourceMapTracker: context.inputSourceMapTracker, localOnly: context.localOnly, processedTokens: [], rebaseTo: context.options.rebaseTo, sourceTokens: tokens, warnings: context.warnings }; return context.options.sourceMap && tokens.length > 0 ? doApplySourceMaps(applyContext) : callback(tokens); } function doApplySourceMaps(applyContext) { var singleSourceTokens = []; var lastSource = findTokenSource(applyContext.sourceTokens[0]); var source; var token; var l; for (l = applyContext.sourceTokens.length; applyContext.index < l; applyContext.index++) { token = applyContext.sourceTokens[applyContext.index]; source = findTokenSource(token); if (source != lastSource) { singleSourceTokens = []; lastSource = source; } singleSourceTokens.push(token); applyContext.processedTokens.push(token); if (token[0] == Token.COMMENT && MAP_MARKER_PATTERN.test(token[1])) { return fetchAndApplySourceMap(token[1], source, singleSourceTokens, applyContext); } } return applyContext.callback(applyContext.processedTokens); } function findTokenSource(token) { var scope; var metadata; if (token[0] == Token.AT_RULE || token[0] == Token.COMMENT || token[0] == Token.RAW) { metadata = token[2][0]; } else { scope = token[1][0]; metadata = scope[2][0]; } return metadata[2]; } function fetchAndApplySourceMap(sourceMapComment, source, singleSourceTokens, applyContext) { return extractInputSourceMapFrom(sourceMapComment, applyContext, function(inputSourceMap) { if (inputSourceMap) { applyContext.inputSourceMapTracker.track(source, inputSourceMap); applySourceMapRecursively(singleSourceTokens, applyContext.inputSourceMapTracker); } applyContext.index++; return doApplySourceMaps(applyContext); }); } function extractInputSourceMapFrom(sourceMapComment, applyContext, whenSourceMapReady) { var uri = MAP_MARKER_PATTERN.exec(sourceMapComment)[1]; var absoluteUri; var sourceMap; var rebasedMap; if (isDataUriResource(uri)) { sourceMap = extractInputSourceMapFromDataUri(uri); return whenSourceMapReady(sourceMap); } if (isRemoteResource(uri)) { return loadInputSourceMapFromRemoteUri(uri, applyContext, function(sourceMap2) { var parsedMap; if (sourceMap2) { parsedMap = JSON.parse(sourceMap2); rebasedMap = rebaseRemoteMap(parsedMap, uri); whenSourceMapReady(rebasedMap); } else { whenSourceMapReady(null); } }); } absoluteUri = path.resolve(applyContext.rebaseTo, uri); sourceMap = loadInputSourceMapFromLocalUri(absoluteUri, applyContext); if (sourceMap) { rebasedMap = rebaseLocalMap(sourceMap, absoluteUri, applyContext.rebaseTo); return whenSourceMapReady(rebasedMap); } return whenSourceMapReady(null); } function extractInputSourceMapFromDataUri(uri) { var dataUriMatch = matchDataUri(uri); var charset = dataUriMatch[2] ? dataUriMatch[2].split(/[=;]/)[2] : "us-ascii"; var encoding = dataUriMatch[3] ? dataUriMatch[3].split(";")[1] : "utf8"; var data = encoding == "utf8" ? global.unescape(dataUriMatch[4]) : dataUriMatch[4]; var buffer = Buffer.from(data, encoding); buffer.charset = charset; return JSON.parse(buffer.toString()); } function loadInputSourceMapFromRemoteUri(uri, applyContext, whenLoaded) { var isAllowed = isAllowedResource(uri, true, applyContext.inline); var isRuntimeResource = !hasProtocol(uri); if (applyContext.localOnly) { applyContext.warnings.push('Cannot fetch remote resource from "' + uri + '" as no callback given.'); return whenLoaded(null); } if (isRuntimeResource) { applyContext.warnings.push('Cannot fetch "' + uri + '" as no protocol given.'); return whenLoaded(null); } if (!isAllowed) { applyContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.'); return whenLoaded(null); } applyContext.fetch(uri, applyContext.inlineRequest, applyContext.inlineTimeout, function(error, body) { if (error) { applyContext.warnings.push('Missing source map at "' + uri + '" - ' + error); return whenLoaded(null); } whenLoaded(body); }); } function loadInputSourceMapFromLocalUri(uri, applyContext) { var isAllowed = isAllowedResource(uri, false, applyContext.inline); var sourceMap; if (!fs2.existsSync(uri) || !fs2.statSync(uri).isFile()) { applyContext.warnings.push('Ignoring local source map at "' + uri + '" as resource is missing.'); return null; } if (!isAllowed) { applyContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.'); return null; } if (!fs2.statSync(uri).size) { applyContext.warnings.push('Cannot fetch "' + uri + '" as resource is empty.'); return null; } sourceMap = fs2.readFileSync(uri, "utf-8"); return JSON.parse(sourceMap); } function applySourceMapRecursively(tokens, inputSourceMapTracker) { var token; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; switch (token[0]) { case Token.AT_RULE: applySourceMapTo(token, inputSourceMapTracker); break; case Token.AT_RULE_BLOCK: applySourceMapRecursively(token[1], inputSourceMapTracker); applySourceMapRecursively(token[2], inputSourceMapTracker); break; case Token.AT_RULE_BLOCK_SCOPE: applySourceMapTo(token, inputSourceMapTracker); break; case Token.NESTED_BLOCK: applySourceMapRecursively(token[1], inputSourceMapTracker); applySourceMapRecursively(token[2], inputSourceMapTracker); break; case Token.NESTED_BLOCK_SCOPE: applySourceMapTo(token, inputSourceMapTracker); break; case Token.COMMENT: applySourceMapTo(token, inputSourceMapTracker); break; case Token.PROPERTY: applySourceMapRecursively(token, inputSourceMapTracker); break; case Token.PROPERTY_BLOCK: applySourceMapRecursively(token[1], inputSourceMapTracker); break; case Token.PROPERTY_NAME: applySourceMapTo(token, inputSourceMapTracker); break; case Token.PROPERTY_VALUE: applySourceMapTo(token, inputSourceMapTracker); break; case Token.RULE: applySourceMapRecursively(token[1], inputSourceMapTracker); applySourceMapRecursively(token[2], inputSourceMapTracker); break; case Token.RULE_SCOPE: applySourceMapTo(token, inputSourceMapTracker); } } return tokens; } function applySourceMapTo(token, inputSourceMapTracker) { var value = token[1]; var metadata = token[2]; var newMetadata = []; var i, l; for (i = 0, l = metadata.length; i < l; i++) { newMetadata.push(inputSourceMapTracker.originalPositionFor(metadata[i], value.length)); } token[2] = newMetadata; } module2.exports = applySourceMaps; } }); // node_modules/clean-css/lib/reader/extract-import-url-and-media.js var require_extract_import_url_and_media = __commonJS({ "node_modules/clean-css/lib/reader/extract-import-url-and-media.js"(exports, module2) { var split = require_split(); var BRACE_PREFIX = /^\(/; var BRACE_SUFFIX = /\)$/; var IMPORT_PREFIX_PATTERN = /^@import/i; var QUOTE_PREFIX_PATTERN = /['"]\s{0,31}/; var QUOTE_SUFFIX_PATTERN = /\s{0,31}['"]/; var URL_PREFIX_PATTERN = /^url\(\s{0,31}/i; var URL_SUFFIX_PATTERN = /\s{0,31}\)/i; function extractImportUrlAndMedia(atRuleValue) { var uri; var mediaQuery; var normalized; var parts; normalized = atRuleValue.replace(IMPORT_PREFIX_PATTERN, "").trim().replace(URL_PREFIX_PATTERN, "(").replace(URL_SUFFIX_PATTERN, ") ").replace(QUOTE_PREFIX_PATTERN, "").replace(QUOTE_SUFFIX_PATTERN, ""); parts = split(normalized, " "); uri = parts[0].replace(BRACE_PREFIX, "").replace(BRACE_SUFFIX, ""); mediaQuery = parts.slice(1).join(" "); return [uri, mediaQuery]; } module2.exports = extractImportUrlAndMedia; } }); // node_modules/clean-css/lib/reader/load-original-sources.js var require_load_original_sources = __commonJS({ "node_modules/clean-css/lib/reader/load-original-sources.js"(exports, module2) { var fs2 = require("fs"); var path = require("path"); var isAllowedResource = require_is_allowed_resource(); var hasProtocol = require_has_protocol(); var isRemoteResource = require_is_remote_resource(); function loadOriginalSources(context, callback) { var loadContext = { callback, fetch: context.options.fetch, index: 0, inline: context.options.inline, inlineRequest: context.options.inlineRequest, inlineTimeout: context.options.inlineTimeout, localOnly: context.localOnly, rebaseTo: context.options.rebaseTo, sourcesContent: context.sourcesContent, uriToSource: uriToSourceMapping(context.inputSourceMapTracker.all()), warnings: context.warnings }; return context.options.sourceMap && context.options.sourceMapInlineSources ? doLoadOriginalSources(loadContext) : callback(); } function uriToSourceMapping(allSourceMapConsumers) { var mapping = {}; var consumer; var uri; var source; var i, l; for (source in allSourceMapConsumers) { consumer = allSourceMapConsumers[source]; for (i = 0, l = consumer.sources.length; i < l; i++) { uri = consumer.sources[i]; source = consumer.sourceContentFor(uri, true); mapping[uri] = source; } } return mapping; } function doLoadOriginalSources(loadContext) { var uris = Object.keys(loadContext.uriToSource); var uri; var source; var total; for (total = uris.length; loadContext.index < total; loadContext.index++) { uri = uris[loadContext.index]; source = loadContext.uriToSource[uri]; if (source) { loadContext.sourcesContent[uri] = source; } else { return loadOriginalSource(uri, loadContext); } } return loadContext.callback(); } function loadOriginalSource(uri, loadContext) { var content; if (isRemoteResource(uri)) { return loadOriginalSourceFromRemoteUri(uri, loadContext, function(content2) { loadContext.index++; loadContext.sourcesContent[uri] = content2; return doLoadOriginalSources(loadContext); }); } content = loadOriginalSourceFromLocalUri(uri, loadContext); loadContext.index++; loadContext.sourcesContent[uri] = content; return doLoadOriginalSources(loadContext); } function loadOriginalSourceFromRemoteUri(uri, loadContext, whenLoaded) { var isAllowed = isAllowedResource(uri, true, loadContext.inline); var isRuntimeResource = !hasProtocol(uri); if (loadContext.localOnly) { loadContext.warnings.push('Cannot fetch remote resource from "' + uri + '" as no callback given.'); return whenLoaded(null); } if (isRuntimeResource) { loadContext.warnings.push('Cannot fetch "' + uri + '" as no protocol given.'); return whenLoaded(null); } if (!isAllowed) { loadContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.'); return whenLoaded(null); } loadContext.fetch(uri, loadContext.inlineRequest, loadContext.inlineTimeout, function(error, content) { if (error) { loadContext.warnings.push('Missing original source at "' + uri + '" - ' + error); } whenLoaded(content); }); } function loadOriginalSourceFromLocalUri(relativeUri, loadContext) { var isAllowed = isAllowedResource(relativeUri, false, loadContext.inline); var absoluteUri = path.resolve(loadContext.rebaseTo, relativeUri); if (!fs2.existsSync(absoluteUri) || !fs2.statSync(absoluteUri).isFile()) { loadContext.warnings.push('Ignoring local source map at "' + absoluteUri + '" as resource is missing.'); return null; } if (!isAllowed) { loadContext.warnings.push('Cannot fetch "' + absoluteUri + '" as resource is not allowed.'); return null; } var result = fs2.readFileSync(absoluteUri, "utf8"); if (result.charCodeAt(0) === 65279) { result = result.substring(1); } return result; } module2.exports = loadOriginalSources; } }); // node_modules/clean-css/lib/reader/normalize-path.js var require_normalize_path = __commonJS({ "node_modules/clean-css/lib/reader/normalize-path.js"(exports, module2) { var UNIX_SEPARATOR = "/"; var WINDOWS_SEPARATOR_PATTERN = /\\/g; function normalizePath(path) { return path.replace(WINDOWS_SEPARATOR_PATTERN, UNIX_SEPARATOR); } module2.exports = normalizePath; } }); // node_modules/clean-css/lib/reader/restore-import.js var require_restore_import = __commonJS({ "node_modules/clean-css/lib/reader/restore-import.js"(exports, module2) { function restoreImport(uri, mediaQuery) { return ("@import " + uri + " " + mediaQuery).trim(); } module2.exports = restoreImport; } }); // node_modules/clean-css/lib/reader/rewrite-url.js var require_rewrite_url = __commonJS({ "node_modules/clean-css/lib/reader/rewrite-url.js"(exports, module2) { var path = require("path"); var url = require("url"); var isDataUriResource = require_is_data_uri_resource(); var DOUBLE_QUOTE = '"'; var SINGLE_QUOTE = "'"; var URL_PREFIX = "url("; var URL_SUFFIX = ")"; var PROTOCOL_LESS_PREFIX_PATTERN = /^[^\w\d]*\/\//; var QUOTE_PREFIX_PATTERN = /^["']/; var QUOTE_SUFFIX_PATTERN = /["']$/; var ROUND_BRACKETS_PATTERN = /[()]/; var URL_PREFIX_PATTERN = /^url\(/i; var URL_SUFFIX_PATTERN = /\)$/; var WHITESPACE_PATTERN = /\s/; var isWindows = process.platform == "win32"; function rebase(uri, rebaseConfig) { if (!rebaseConfig) { return uri; } if (isAbsolute(uri) && !isRemote(rebaseConfig.toBase)) { return uri; } if (isRemote(uri) || isSVGMarker(uri) || isInternal(uri) || isDataUriResource(uri)) { return uri; } if (isRemote(rebaseConfig.toBase)) { return url.resolve(rebaseConfig.toBase, uri); } return rebaseConfig.absolute ? normalize(absolute(uri, rebaseConfig)) : normalize(relative(uri, rebaseConfig)); } function isAbsolute(uri) { return path.isAbsolute(uri); } function isSVGMarker(uri) { return uri[0] == "#"; } function isInternal(uri) { return /^\w+:\w+/.test(uri); } function isRemote(uri) { return /^[^:]+?:\/\//.test(uri) || PROTOCOL_LESS_PREFIX_PATTERN.test(uri); } function absolute(uri, rebaseConfig) { return path.resolve(path.join(rebaseConfig.fromBase || "", uri)).replace(rebaseConfig.toBase, ""); } function relative(uri, rebaseConfig) { return path.relative(rebaseConfig.toBase, path.join(rebaseConfig.fromBase || "", uri)); } function normalize(uri) { return isWindows ? uri.replace(/\\/g, "/") : uri; } function quoteFor(unquotedUrl) { if (unquotedUrl.indexOf(SINGLE_QUOTE) > -1) { return DOUBLE_QUOTE; } if (unquotedUrl.indexOf(DOUBLE_QUOTE) > -1) { return SINGLE_QUOTE; } if (hasWhitespace(unquotedUrl) || hasRoundBrackets(unquotedUrl)) { return SINGLE_QUOTE; } return ""; } function hasWhitespace(url2) { return WHITESPACE_PATTERN.test(url2); } function hasRoundBrackets(url2) { return ROUND_BRACKETS_PATTERN.test(url2); } function rewriteUrl(originalUrl, rebaseConfig, pathOnly) { var strippedUrl = originalUrl.replace(URL_PREFIX_PATTERN, "").replace(URL_SUFFIX_PATTERN, "").trim(); var unquotedUrl = strippedUrl.replace(QUOTE_PREFIX_PATTERN, "").replace(QUOTE_SUFFIX_PATTERN, "").trim(); var quote = strippedUrl[0] == SINGLE_QUOTE || strippedUrl[0] == DOUBLE_QUOTE ? strippedUrl[0] : quoteFor(unquotedUrl); return pathOnly ? rebase(unquotedUrl, rebaseConfig) : URL_PREFIX + quote + rebase(unquotedUrl, rebaseConfig) + quote + URL_SUFFIX; } module2.exports = rewriteUrl; } }); // node_modules/clean-css/lib/utils/is-import.js var require_is_import = __commonJS({ "node_modules/clean-css/lib/utils/is-import.js"(exports, module2) { var IMPORT_PREFIX_PATTERN = /^@import/i; function isImport(value) { return IMPORT_PREFIX_PATTERN.test(value); } module2.exports = isImport; } }); // node_modules/clean-css/lib/reader/rebase.js var require_rebase2 = __commonJS({ "node_modules/clean-css/lib/reader/rebase.js"(exports, module2) { var extractImportUrlAndMedia = require_extract_import_url_and_media(); var restoreImport = require_restore_import(); var rewriteUrl = require_rewrite_url(); var Token = require_token(); var isImport = require_is_import(); var SOURCE_MAP_COMMENT_PATTERN = /^\/\*# sourceMappingURL=(\S+) \*\/$/; function rebase(tokens, rebaseAll, validator, rebaseConfig) { return rebaseAll ? rebaseEverything(tokens, validator, rebaseConfig) : rebaseAtRules(tokens, validator, rebaseConfig); } function rebaseEverything(tokens, validator, rebaseConfig) { var token; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; switch (token[0]) { case Token.AT_RULE: rebaseAtRule(token, validator, rebaseConfig); break; case Token.AT_RULE_BLOCK: rebaseProperties(token[2], validator, rebaseConfig); break; case Token.COMMENT: rebaseSourceMapComment(token, rebaseConfig); break; case Token.NESTED_BLOCK: rebaseEverything(token[2], validator, rebaseConfig); break; case Token.RULE: rebaseProperties(token[2], validator, rebaseConfig); break; } } return tokens; } function rebaseAtRules(tokens, validator, rebaseConfig) { var token; var i, l; for (i = 0, l = tokens.length; i < l; i++) { token = tokens[i]; switch (token[0]) { case Token.AT_RULE: rebaseAtRule(token, validator, rebaseConfig); break; } } return tokens; } function rebaseAtRule(token, validator, rebaseConfig) { if (!isImport(token[1])) { return; } var uriAndMediaQuery = extractImportUrlAndMedia(token[1]); var newUrl = rewriteUrl(uriAndMediaQuery[0], rebaseConfig); var mediaQuery = uriAndMediaQuery[1]; token[1] = restoreImport(newUrl, mediaQuery); } function rebaseSourceMapComment(token, rebaseConfig) { var matches = SOURCE_MAP_COMMENT_PATTERN.exec(token[1]); if (matches && matches[1].indexOf("data:") === -1) { token[1] = token[1].replace(matches[1], rewriteUrl(matches[1], rebaseConfig, true)); } } function rebaseProperties(properties, validator, rebaseConfig) { var property; var value; var i, l; var j, m; for (i = 0, l = properties.length; i < l; i++) { property = properties[i]; for (j = 2, m = property.length; j < m; j++) { value = property[j][1]; if (validator.isUrl(value)) { property[j][1] = rewriteUrl(value, rebaseConfig); } } } } module2.exports = rebase; } }); // node_modules/clean-css/lib/tokenizer/tokenize.js var require_tokenize = __commonJS({ "node_modules/clean-css/lib/tokenizer/tokenize.js"(exports, module2) { var Marker = require_marker(); var Token = require_token(); var formatPosition = require_format_position(); var Level = { BLOCK: "block", COMMENT: "comment", DOUBLE_QUOTE: "double-quote", RULE: "rule", SINGLE_QUOTE: "single-quote" }; var AT_RULES = [ "@charset", "@import" ]; var BLOCK_RULES = [ "@-moz-document", "@document", "@-moz-keyframes", "@-ms-keyframes", "@-o-keyframes", "@-webkit-keyframes", "@keyframes", "@media", "@supports", "@container", "@layer" ]; var IGNORE_END_COMMENT_PATTERN = /\/\* clean-css ignore:end \*\/$/; var IGNORE_START_COMMENT_PATTERN = /^\/\* clean-css ignore:start \*\//; var PAGE_MARGIN_BOXES = [ "@bottom-center", "@bottom-left", "@bottom-left-corner", "@bottom-right", "@bottom-right-corner", "@left-bottom", "@left-middle", "@left-top", "@right-bottom", "@right-middle", "@right-top", "@top-center", "@top-left", "@top-left-corner", "@top-right", "@top-right-corner" ]; var EXTRA_PAGE_BOXES = [ "@footnote", "@footnotes", "@left", "@page-float-bottom", "@page-float-top", "@right" ]; var REPEAT_PATTERN = /^\[\s{0,31}\d+\s{0,31}\]$/; var TAIL_BROKEN_VALUE_PATTERN = /([^}])\}*$/; var RULE_WORD_SEPARATOR_PATTERN = /[\s(]/; function tokenize(source, externalContext) { var internalContext = { level: Level.BLOCK, position: { source: externalContext.source || void 0, line: 1, column: 0, index: 0 } }; return intoTokens(source, externalContext, internalContext, false); } function intoTokens(source, externalContext, internalContext, isNested) { var allTokens = []; var newTokens = allTokens; var lastToken; var ruleToken; var ruleTokens = []; var propertyToken; var metadata; var metadatas = []; var level = internalContext.level; var levels = []; var buffer = []; var buffers = []; var isBufferEmpty = true; var serializedBuffer; var serializedBufferPart; var roundBracketLevel = 0; var isQuoted; var isSpace; var isNewLineNix; var isNewLineWin; var isCarriageReturn; var isCommentStart; var wasCommentStart = false; var isCommentEnd; var wasCommentEnd = false; var isCommentEndMarker; var isEscaped; var wasEscaped = false; var characterWithNoSpecialMeaning; var isPreviousDash = false; var isVariable = false; var isRaw = false; var seekingValue = false; var seekingPropertyBlockClosing = false; var position = internalContext.position; var lastCommentStartAt; for (; position.index < source.length; position.index++) { var character = source[position.index]; isQuoted = level == Level.SINGLE_QUOTE || level == Level.DOUBLE_QUOTE; isSpace = character == Marker.SPACE || character == Marker.TAB; isNewLineNix = character == Marker.NEW_LINE_NIX; isNewLineWin = character == Marker.NEW_LINE_NIX && source[position.index - 1] == Marker.CARRIAGE_RETURN; isCarriageReturn = character == Marker.CARRIAGE_RETURN && source[position.index + 1] && source[position.index + 1] != Marker.NEW_LINE_NIX; isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == Marker.ASTERISK && source[position.index - 1] == Marker.FORWARD_SLASH; isCommentEndMarker = !wasCommentStart && !isQuoted && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK; isCommentEnd = level == Level.COMMENT && isCommentEndMarker; characterWithNoSpecialMeaning = !isSpace && !isCarriageReturn && (character >= "A" && character <= "Z" || character >= "a" && character <= "z" || character >= "0" && character <= "9" || character == "-"); isVariable = isVariable || level != Level.COMMENT && !seekingValue && isPreviousDash && character === "-" && buffer.length === 1; isPreviousDash = character === "-"; roundBracketLevel = Math.max(roundBracketLevel, 0); metadata = isBufferEmpty ? [position.line, position.column, position.source] : metadata; if (isEscaped) { buffer.push(character); isBufferEmpty = false; } else if (characterWithNoSpecialMeaning) { buffer.push(character); isBufferEmpty = false; } else if ((isSpace || isNewLineNix && !isNewLineWin) && (isQuoted || level == Level.COMMENT)) { buffer.push(character); isBufferEmpty = false; } else if ((isSpace || isNewLineNix && !isNewLineWin) && isBufferEmpty) { } else if (!isCommentEnd && level == Level.COMMENT) { buffer.push(character); isBufferEmpty = false; } else if (!isCommentStart && !isCommentEnd && isRaw) { buffer.push(character); isBufferEmpty = false; } else if (isCommentStart && isVariable && (level == Level.BLOCK || level == Level.RULE) && buffer.length > 1) { buffer.push(character); isBufferEmpty = false; levels.push(level); level = Level.COMMENT; } else if (isCommentStart && (level == Level.BLOCK || level == Level.RULE) && buffer.length > 1) { metadatas.push(metadata); buffer.push(character); buffers.push(buffer.slice(0, -2)); isBufferEmpty = false; buffer = buffer.slice(-2); metadata = [position.line, position.column - 1, position.source]; levels.push(level); level = Level.COMMENT; } else if (isCommentStart) { levels.push(level); level = Level.COMMENT; buffer.push(character); isBufferEmpty = false; } else if (isCommentEnd && isVariable) { buffer.push(character); level = levels.pop(); } else if (isCommentEnd && isIgnoreStartComment(buffer)) { serializedBuffer = buffer.join("").trim() + character; lastToken = [ Token.COMMENT, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]; newTokens.push(lastToken); isRaw = true; metadata = metadatas.pop() || null; buffer = buffers.pop() || []; isBufferEmpty = buffer.length === 0; } else if (isCommentEnd && isIgnoreEndComment(buffer)) { serializedBuffer = buffer.join("") + character; lastCommentStartAt = serializedBuffer.lastIndexOf(Marker.FORWARD_SLASH + Marker.ASTERISK); serializedBufferPart = serializedBuffer.substring(0, lastCommentStartAt); lastToken = [ Token.RAW, serializedBufferPart, [originalMetadata(metadata, serializedBufferPart, externalContext)] ]; newTokens.push(lastToken); serializedBufferPart = serializedBuffer.substring(lastCommentStartAt); metadata = [position.line, position.column - serializedBufferPart.length + 1, position.source]; lastToken = [ Token.COMMENT, serializedBufferPart, [originalMetadata(metadata, serializedBufferPart, externalContext)] ]; newTokens.push(lastToken); isRaw = false; level = levels.pop(); metadata = metadatas.pop() || null; buffer = buffers.pop() || []; isBufferEmpty = buffer.length === 0; } else if (isCommentEnd) { serializedBuffer = buffer.join("").trim() + character; lastToken = [ Token.COMMENT, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]; newTokens.push(lastToken); level = levels.pop(); metadata = metadatas.pop() || null; buffer = buffers.pop() || []; isBufferEmpty = buffer.length === 0; } else if (isCommentEndMarker && source[position.index + 1] != Marker.ASTERISK) { externalContext.warnings.push("Unexpected '*/' at " + formatPosition([position.line, position.column, position.source]) + "."); buffer = []; isBufferEmpty = true; } else if (character == Marker.SINGLE_QUOTE && !isQuoted) { levels.push(level); level = Level.SINGLE_QUOTE; buffer.push(character); isBufferEmpty = false; } else if (character == Marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) { level = levels.pop(); buffer.push(character); isBufferEmpty = false; } else if (character == Marker.DOUBLE_QUOTE && !isQuoted) { levels.push(level); level = Level.DOUBLE_QUOTE; buffer.push(character); isBufferEmpty = false; } else if (character == Marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) { level = levels.pop(); buffer.push(character); isBufferEmpty = false; } else if (character != Marker.CLOSE_ROUND_BRACKET && character != Marker.OPEN_ROUND_BRACKET && level != Level.COMMENT && !isQuoted && roundBracketLevel > 0) { buffer.push(character); isBufferEmpty = false; } else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) { buffer.push(character); isBufferEmpty = false; roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) { buffer.push(character); isBufferEmpty = false; roundBracketLevel--; } else if (character == Marker.SEMICOLON && level == Level.BLOCK && buffer[0] == Marker.AT) { serializedBuffer = buffer.join("").trim(); allTokens.push([ Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.COMMA && level == Level.BLOCK && ruleToken) { serializedBuffer = buffer.join("").trim(); ruleToken[1].push([ tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.COMMA && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.AT_RULE) { buffer.push(character); isBufferEmpty = false; } else if (character == Marker.COMMA && level == Level.BLOCK) { ruleToken = [tokenTypeFrom(buffer), [], []]; serializedBuffer = buffer.join("").trim(); ruleToken[1].push([ tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, 0)] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && ruleToken && ruleToken[0] == Token.NESTED_BLOCK) { serializedBuffer = buffer.join("").trim(); ruleToken[1].push([ Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); allTokens.push(ruleToken); levels.push(level); position.column++; position.index++; buffer = []; isBufferEmpty = true; ruleToken[2] = intoTokens(source, externalContext, internalContext, true); ruleToken = null; } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.NESTED_BLOCK) { serializedBuffer = buffer.join("").trim(); ruleToken = ruleToken || [Token.NESTED_BLOCK, [], []]; ruleToken[1].push([ Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); allTokens.push(ruleToken); levels.push(level); position.column++; position.index++; buffer = []; isBufferEmpty = true; isVariable = false; ruleToken[2] = intoTokens(source, externalContext, internalContext, true); ruleToken = null; } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK) { serializedBuffer = buffer.join("").trim(); ruleToken = ruleToken || [tokenTypeFrom(buffer), [], []]; ruleToken[1].push([ tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)] ]); newTokens = ruleToken[2]; allTokens.push(ruleToken); levels.push(level); level = Level.RULE; buffer = []; isBufferEmpty = true; } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.RULE && seekingValue) { ruleTokens.push(ruleToken); ruleToken = [Token.PROPERTY_BLOCK, []]; propertyToken.push(ruleToken); newTokens = ruleToken[1]; levels.push(level); level = Level.RULE; seekingValue = false; } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.RULE && isPageMarginBox(buffer)) { serializedBuffer = buffer.join("").trim(); ruleTokens.push(ruleToken); ruleToken = [Token.AT_RULE_BLOCK, [], []]; ruleToken[1].push([ Token.AT_RULE_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); newTokens.push(ruleToken); newTokens = ruleToken[2]; levels.push(level); level = Level.RULE; buffer = []; isBufferEmpty = true; } else if (character == Marker.COLON && level == Level.RULE && !seekingValue) { serializedBuffer = buffer.join("").trim(); propertyToken = [ Token.PROPERTY, [ Token.PROPERTY_NAME, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ] ]; newTokens.push(propertyToken); seekingValue = true; buffer = []; isBufferEmpty = true; } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && ruleTokens.length > 0 && !isBufferEmpty && buffer[0] == Marker.AT) { serializedBuffer = buffer.join("").trim(); ruleToken[1].push([ Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && !isBufferEmpty) { serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken = null; seekingValue = false; buffer = []; isBufferEmpty = true; isVariable = false; } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && isBufferEmpty && isVariable && !propertyToken[2]) { propertyToken.push([Token.PROPERTY_VALUE, " ", [originalMetadata(metadata, " ", externalContext)]]); isVariable = false; propertyToken = null; seekingValue = false; } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && isBufferEmpty) { propertyToken = null; seekingValue = false; } else if (character == Marker.SEMICOLON && level == Level.RULE && !isBufferEmpty && buffer[0] == Marker.AT) { serializedBuffer = buffer.join(""); newTokens.push([ Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); seekingValue = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.SEMICOLON && level == Level.RULE && seekingPropertyBlockClosing) { seekingPropertyBlockClosing = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.SEMICOLON && level == Level.RULE && isBufferEmpty) { } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && seekingValue && !isBufferEmpty && ruleTokens.length > 0) { serializedBuffer = buffer.join(""); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken = null; ruleToken = ruleTokens.pop(); newTokens = ruleToken[2]; level = levels.pop(); seekingValue = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && !isBufferEmpty && buffer[0] == Marker.AT && ruleTokens.length > 0) { serializedBuffer = buffer.join(""); ruleToken[1].push([ Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken = null; ruleToken = ruleTokens.pop(); newTokens = ruleToken[2]; level = levels.pop(); seekingValue = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && ruleTokens.length > 0) { propertyToken = null; ruleToken = ruleTokens.pop(); newTokens = ruleToken[2]; level = levels.pop(); seekingValue = false; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && !isBufferEmpty) { serializedBuffer = buffer.join(""); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken = null; ruleToken = ruleTokens.pop(); newTokens = allTokens; level = levels.pop(); seekingValue = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && !isBufferEmpty && buffer[0] == Marker.AT) { propertyToken = null; ruleToken = null; serializedBuffer = buffer.join("").trim(); newTokens.push([ Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); newTokens = allTokens; level = levels.pop(); seekingValue = false; buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && levels[levels.length - 1] == Level.RULE) { propertyToken = null; ruleToken = ruleTokens.pop(); newTokens = ruleToken[2]; level = levels.pop(); seekingValue = false; seekingPropertyBlockClosing = true; buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && isVariable && propertyToken && !propertyToken[2]) { propertyToken.push([Token.PROPERTY_VALUE, " ", [originalMetadata(metadata, " ", externalContext)]]); isVariable = false; propertyToken = null; ruleToken = null; newTokens = allTokens; level = levels.pop(); seekingValue = false; isVariable = false; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE) { propertyToken = null; ruleToken = null; newTokens = allTokens; level = levels.pop(); seekingValue = false; isVariable = false; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK && !isNested && position.index <= source.length - 1) { externalContext.warnings.push("Unexpected '}' at " + formatPosition([position.line, position.column, position.source]) + "."); buffer.push(character); isBufferEmpty = false; } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK) { break; } else if (character == Marker.OPEN_ROUND_BRACKET && level == Level.RULE && seekingValue) { buffer.push(character); isBufferEmpty = false; roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue && roundBracketLevel == 1) { buffer.push(character); isBufferEmpty = false; serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); roundBracketLevel--; buffer = []; isBufferEmpty = true; isVariable = false; } else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue) { buffer.push(character); isBufferEmpty = false; isVariable = false; roundBracketLevel--; } else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue && !isBufferEmpty) { serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken.push([ Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue) { propertyToken.push([ Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.COMMA && level == Level.RULE && seekingValue && !isBufferEmpty) { serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); propertyToken.push([ Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.COMMA && level == Level.RULE && seekingValue) { propertyToken.push([ Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]] ]); buffer = []; isBufferEmpty = true; } else if (character == Marker.CLOSE_SQUARE_BRACKET && propertyToken && propertyToken.length > 1 && !isBufferEmpty && isRepeatToken(buffer)) { buffer.push(character); serializedBuffer = buffer.join("").trim(); propertyToken[propertyToken.length - 1][1] += serializedBuffer; buffer = []; isBufferEmpty = true; } else if ((isSpace || isNewLineNix && !isNewLineWin) && level == Level.RULE && seekingValue && propertyToken && !isBufferEmpty) { serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); buffer = []; isBufferEmpty = true; } else if (isNewLineWin && level == Level.RULE && seekingValue && propertyToken && buffer.length > 1) { serializedBuffer = buffer.join("").trim(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); buffer = []; isBufferEmpty = true; } else if (isNewLineWin && level == Level.RULE && seekingValue) { buffer = []; isBufferEmpty = true; } else if (isNewLineWin && buffer.length == 1) { buffer.pop(); isBufferEmpty = buffer.length === 0; } else if (!isBufferEmpty || !isSpace && !isNewLineNix && !isNewLineWin && !isCarriageReturn) { buffer.push(character); isBufferEmpty = false; } wasEscaped = isEscaped; isEscaped = !wasEscaped && character == Marker.BACK_SLASH; wasCommentStart = isCommentStart; wasCommentEnd = isCommentEnd; position.line = isNewLineWin || isNewLineNix || isCarriageReturn ? position.line + 1 : position.line; position.column = isNewLineWin || isNewLineNix || isCarriageReturn ? 0 : position.column + 1; } if (seekingValue) { externalContext.warnings.push("Missing '}' at " + formatPosition([position.line, position.column, position.source]) + "."); } if (seekingValue && buffer.length > 0) { serializedBuffer = buffer.join("").trimRight().replace(TAIL_BROKEN_VALUE_PATTERN, "$1").trimRight(); propertyToken.push([ Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)] ]); buffer = []; } if (buffer.length > 0) { externalContext.warnings.push("Invalid character(s) '" + buffer.join("") + "' at " + formatPosition(metadata) + ". Ignoring."); } return allTokens; } function isIgnoreStartComment(buffer) { return IGNORE_START_COMMENT_PATTERN.test(buffer.join("") + Marker.FORWARD_SLASH); } function isIgnoreEndComment(buffer) { return IGNORE_END_COMMENT_PATTERN.test(buffer.join("") + Marker.FORWARD_SLASH); } function originalMetadata(metadata, value, externalContext, selectorFallbacks) { var source = metadata[2]; return externalContext.inputSourceMapTracker.isTracking(source) ? externalContext.inputSourceMapTracker.originalPositionFor(metadata, value.length, selectorFallbacks) : metadata; } function tokenTypeFrom(buffer) { var isAtRule = buffer[0] == Marker.AT || buffer[0] == Marker.UNDERSCORE; var ruleWord = buffer.join("").split(RULE_WORD_SEPARATOR_PATTERN)[0]; if (isAtRule && BLOCK_RULES.indexOf(ruleWord) > -1) { return Token.NESTED_BLOCK; } if (isAtRule && AT_RULES.indexOf(ruleWord) > -1) { return Token.AT_RULE; } if (isAtRule) { return Token.AT_RULE_BLOCK; } return Token.RULE; } function tokenScopeFrom(tokenType) { if (tokenType == Token.RULE) { return Token.RULE_SCOPE; } if (tokenType == Token.NESTED_BLOCK) { return Token.NESTED_BLOCK_SCOPE; } if (tokenType == Token.AT_RULE_BLOCK) { return Token.AT_RULE_BLOCK_SCOPE; } } function isPageMarginBox(buffer) { var serializedBuffer = buffer.join("").trim(); return PAGE_MARGIN_BOXES.indexOf(serializedBuffer) > -1 || EXTRA_PAGE_BOXES.indexOf(serializedBuffer) > -1; } function isRepeatToken(buffer) { return REPEAT_PATTERN.test(buffer.join("") + Marker.CLOSE_SQUARE_BRACKET); } module2.exports = tokenize; } }); // node_modules/clean-css/lib/reader/read-sources.js var require_read_sources = __commonJS({ "node_modules/clean-css/lib/reader/read-sources.js"(exports, module2) { var fs2 = require("fs"); var path = require("path"); var applySourceMaps = require_apply_source_maps(); var extractImportUrlAndMedia = require_extract_import_url_and_media(); var isAllowedResource = require_is_allowed_resource(); var loadOriginalSources = require_load_original_sources(); var normalizePath = require_normalize_path(); var rebase = require_rebase2(); var rebaseLocalMap = require_rebase_local_map(); var rebaseRemoteMap = require_rebase_remote_map(); var restoreImport = require_restore_import(); var tokenize = require_tokenize(); var Token = require_token(); var Marker = require_marker(); var hasProtocol = require_has_protocol(); var isImport = require_is_import(); var isRemoteResource = require_is_remote_resource(); var UNKNOWN_URI = "uri:unknown"; var FILE_RESOURCE_PROTOCOL = "file://"; function readSources(input, context, callback) { return doReadSources(input, context, function(tokens) { return applySourceMaps(tokens, context, function() { return loadOriginalSources(context, function() { return callback(tokens); }); }); }); } function doReadSources(input, context, callback) { if (typeof input == "string") { return fromString(input, context, callback); } if (Buffer.isBuffer(input)) { return fromString(input.toString(), context, callback); } if (Array.isArray(input)) { return fromArray(input, context, callback); } if (typeof input == "object") { return fromHash(input, context, callback); } } function fromString(input, context, callback) { context.source = void 0; context.sourcesContent[void 0] = input; context.stats.originalSize += input.length; return fromStyles(input, context, { inline: context.options.inline }, callback); } function fromArray(input, context, callback) { var inputAsImports = input.reduce(function(accumulator, uriOrHash) { if (typeof uriOrHash === "string") { return addStringSource(uriOrHash, accumulator); } return addHashSource(uriOrHash, context, accumulator); }, []); return fromStyles(inputAsImports.join(""), context, { inline: ["all"] }, callback); } function fromHash(input, context, callback) { var inputAsImports = addHashSource(input, context, []); return fromStyles(inputAsImports.join(""), context, { inline: ["all"] }, callback); } function addStringSource(input, imports) { imports.push(restoreAsImport(normalizeUri(input))); return imports; } function addHashSource(input, context, imports) { var uri; var normalizedUri; var source; for (uri in input) { source = input[uri]; normalizedUri = normalizeUri(uri); imports.push(restoreAsImport(normalizedUri)); context.sourcesContent[normalizedUri] = source.styles; if (source.sourceMap) { trackSourceMap(source.sourceMap, normalizedUri, context); } } return imports; } function normalizeUri(uri) { var currentPath = path.resolve(""); var absoluteUri; var relativeToCurrentPath; var normalizedUri; if (isRemoteResource(uri)) { return uri; } absoluteUri = path.isAbsolute(uri) ? uri : path.resolve(uri); relativeToCurrentPath = path.relative(currentPath, absoluteUri); normalizedUri = normalizePath(relativeToCurrentPath); return normalizedUri; } function trackSourceMap(sourceMap, uri, context) { var parsedMap = typeof sourceMap == "string" ? JSON.parse(sourceMap) : sourceMap; var rebasedMap = isRemoteResource(uri) ? rebaseRemoteMap(parsedMap, uri) : rebaseLocalMap(parsedMap, uri || UNKNOWN_URI, context.options.rebaseTo); context.inputSourceMapTracker.track(uri, rebasedMap); } function restoreAsImport(uri) { return restoreImport("url(" + uri + ")", "") + Marker.SEMICOLON; } function fromStyles(styles, context, parentInlinerContext, callback) { var tokens; var rebaseConfig = {}; if (!context.source) { rebaseConfig.fromBase = path.resolve(""); rebaseConfig.toBase = context.options.rebaseTo; } else if (isRemoteResource(context.source)) { rebaseConfig.fromBase = context.source; rebaseConfig.toBase = context.source; } else if (path.isAbsolute(context.source)) { rebaseConfig.fromBase = path.dirname(context.source); rebaseConfig.toBase = context.options.rebaseTo; } else { rebaseConfig.fromBase = path.dirname(path.resolve(context.source)); rebaseConfig.toBase = context.options.rebaseTo; } tokens = tokenize(styles, context); tokens = rebase(tokens, context.options.rebase, context.validator, rebaseConfig); return allowsAnyImports(parentInlinerContext.inline) ? inline(tokens, context, parentInlinerContext, callback) : callback(tokens); } function allowsAnyImports(inline2) { return !(inline2.length == 1 && inline2[0] == "none"); } function inline(tokens, externalContext, parentInlinerContext, callback) { var inlinerContext = { afterContent: false, callback, errors: externalContext.errors, externalContext, fetch: externalContext.options.fetch, inlinedStylesheets: parentInlinerContext.inlinedStylesheets || externalContext.inlinedStylesheets, inline: parentInlinerContext.inline, inlineRequest: externalContext.options.inlineRequest, inlineTimeout: externalContext.options.inlineTimeout, isRemote: parentInlinerContext.isRemote || false, localOnly: externalContext.localOnly, outputTokens: [], rebaseTo: externalContext.options.rebaseTo, sourceTokens: tokens, warnings: externalContext.warnings }; return doInlineImports(inlinerContext); } function doInlineImports(inlinerContext) { var token; var i, l; for (i = 0, l = inlinerContext.sourceTokens.length; i < l; i++) { token = inlinerContext.sourceTokens[i]; if (token[0] == Token.AT_RULE && isImport(token[1])) { inlinerContext.sourceTokens.splice(0, i); return inlineStylesheet(token, inlinerContext); } if (token[0] == Token.AT_RULE || token[0] == Token.COMMENT) { inlinerContext.outputTokens.push(token); } else { inlinerContext.outputTokens.push(token); inlinerContext.afterContent = true; } } inlinerContext.sourceTokens = []; return inlinerContext.callback(inlinerContext.outputTokens); } function inlineStylesheet(token, inlinerContext) { var uriAndMediaQuery = extractImportUrlAndMedia(token[1]); var uri = uriAndMediaQuery[0]; var mediaQuery = uriAndMediaQuery[1]; var metadata = token[2]; return isRemoteResource(uri) ? inlineRemoteStylesheet(uri, mediaQuery, metadata, inlinerContext) : inlineLocalStylesheet(uri, mediaQuery, metadata, inlinerContext); } function inlineRemoteStylesheet(uri, mediaQuery, metadata, inlinerContext) { var isAllowed = isAllowedResource(uri, true, inlinerContext.inline); var originalUri = uri; var isLoaded = uri in inlinerContext.externalContext.sourcesContent; var isRuntimeResource = !hasProtocol(uri); if (inlinerContext.inlinedStylesheets.indexOf(uri) > -1) { inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as it has already been imported.'); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } if (inlinerContext.localOnly && inlinerContext.afterContent) { inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as no callback given and after other content.'); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } if (isRuntimeResource) { inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as no protocol given.'); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1)); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } if (inlinerContext.localOnly && !isLoaded) { inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as no callback given.'); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1)); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } if (!isAllowed && inlinerContext.afterContent) { inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as resource is not allowed and after other content.'); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } if (!isAllowed) { inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as resource is not allowed.'); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1)); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } inlinerContext.inlinedStylesheets.push(uri); function whenLoaded(error, importedStyles) { if (error) { inlinerContext.errors.push('Broken @import declaration of "' + uri + '" - ' + error); return process.nextTick(function() { inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1)); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); doInlineImports(inlinerContext); }); } inlinerContext.inline = inlinerContext.externalContext.options.inline; inlinerContext.isRemote = true; inlinerContext.externalContext.source = originalUri; inlinerContext.externalContext.sourcesContent[uri] = importedStyles; inlinerContext.externalContext.stats.originalSize += importedStyles.length; return fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function(importedTokens) { importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); }); } return isLoaded ? whenLoaded(null, inlinerContext.externalContext.sourcesContent[uri]) : inlinerContext.fetch(uri, inlinerContext.inlineRequest, inlinerContext.inlineTimeout, whenLoaded); } function inlineLocalStylesheet(uri, mediaQuery, metadata, inlinerContext) { var protocolLessUri = uri.replace(FILE_RESOURCE_PROTOCOL, ""); var currentPath = path.resolve(""); var absoluteUri = path.isAbsolute(protocolLessUri) ? path.resolve(currentPath, protocolLessUri[0] == "/" ? protocolLessUri.substring(1) : protocolLessUri) : path.resolve(inlinerContext.rebaseTo, protocolLessUri); var relativeToCurrentPath = path.relative(currentPath, absoluteUri); var importedStyles; var isAllowed = isAllowedResource(protocolLessUri, false, inlinerContext.inline); var normalizedPath = normalizePath(relativeToCurrentPath); var isLoaded = normalizedPath in inlinerContext.externalContext.sourcesContent; if (inlinerContext.inlinedStylesheets.indexOf(absoluteUri) > -1) { inlinerContext.warnings.push('Ignoring local @import of "' + protocolLessUri + '" as it has already been imported.'); } else if (isAllowed && !isLoaded && (!fs2.existsSync(absoluteUri) || !fs2.statSync(absoluteUri).isFile())) { inlinerContext.errors.push('Ignoring local @import of "' + protocolLessUri + '" as resource is missing.'); } else if (!isAllowed && inlinerContext.afterContent) { inlinerContext.warnings.push('Ignoring local @import of "' + protocolLessUri + '" as resource is not allowed and after other content.'); } else if (inlinerContext.afterContent) { inlinerContext.warnings.push('Ignoring local @import of "' + protocolLessUri + '" as after other content.'); } else if (!isAllowed) { inlinerContext.warnings.push('Skipping local @import of "' + protocolLessUri + '" as resource is not allowed.'); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1)); } else { importedStyles = isLoaded ? inlinerContext.externalContext.sourcesContent[normalizedPath] : fs2.readFileSync(absoluteUri, "utf-8"); if (importedStyles.charCodeAt(0) === 65279) { importedStyles = importedStyles.substring(1); } inlinerContext.inlinedStylesheets.push(absoluteUri); inlinerContext.inline = inlinerContext.externalContext.options.inline; inlinerContext.externalContext.source = normalizedPath; inlinerContext.externalContext.sourcesContent[normalizedPath] = importedStyles; inlinerContext.externalContext.stats.originalSize += importedStyles.length; return fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function(importedTokens) { importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata); inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens); inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); }); } inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1); return doInlineImports(inlinerContext); } function wrapInMedia(tokens, mediaQuery, metadata) { if (mediaQuery) { return [[Token.NESTED_BLOCK, [[Token.NESTED_BLOCK_SCOPE, "@media " + mediaQuery, metadata]], tokens]]; } return tokens; } module2.exports = readSources; } }); // node_modules/clean-css/lib/writer/simple.js var require_simple = __commonJS({ "node_modules/clean-css/lib/writer/simple.js"(exports, module2) { var all = require_helpers().all; function store(serializeContext, token) { var value = typeof token == "string" ? token : token[1]; var wrap2 = serializeContext.wrap; wrap2(serializeContext, value); track(serializeContext, value); serializeContext.output.push(value); } function wrap(serializeContext, value) { if (serializeContext.column + value.length > serializeContext.format.wrapAt) { track(serializeContext, serializeContext.format.breakWith); serializeContext.output.push(serializeContext.format.breakWith); } } function track(serializeContext, value) { var parts = value.split("\n"); serializeContext.line += parts.length - 1; serializeContext.column = parts.length > 1 ? 0 : serializeContext.column + parts.pop().length; } function serializeStyles(tokens, context) { var serializeContext = { column: 0, format: context.options.format, indentBy: 0, indentWith: "", line: 1, output: [], spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace, store, wrap: context.options.format.wrapAt ? wrap : function() { } }; all(serializeContext, tokens); return { styles: serializeContext.output.join("") }; } module2.exports = serializeStyles; } }); // node_modules/clean-css/lib/writer/source-maps.js var require_source_maps = __commonJS({ "node_modules/clean-css/lib/writer/source-maps.js"(exports, module2) { var SourceMapGenerator = require_source_map().SourceMapGenerator; var all = require_helpers().all; var isRemoteResource = require_is_remote_resource(); var isWindows = process.platform == "win32"; var NIX_SEPARATOR_PATTERN = /\//g; var UNKNOWN_SOURCE = "$stdin"; var WINDOWS_SEPARATOR = "\\"; function store(serializeContext, element) { var fromString = typeof element == "string"; var value = fromString ? element : element[1]; var mappings = fromString ? null : element[2]; var wrap2 = serializeContext.wrap; wrap2(serializeContext, value); track(serializeContext, value, mappings); serializeContext.output.push(value); } function wrap(serializeContext, value) { if (serializeContext.column + value.length > serializeContext.format.wrapAt) { track(serializeContext, serializeContext.format.breakWith, false); serializeContext.output.push(serializeContext.format.breakWith); } } function track(serializeContext, value, mappings) { var parts = value.split("\n"); if (mappings) { trackAllMappings(serializeContext, mappings); } serializeContext.line += parts.length - 1; serializeContext.column = parts.length > 1 ? 0 : serializeContext.column + parts.pop().length; } function trackAllMappings(serializeContext, mappings) { for (var i = 0, l = mappings.length; i < l; i++) { trackMapping(serializeContext, mappings[i]); } } function trackMapping(serializeContext, mapping) { var line = mapping[0]; var column = mapping[1]; var originalSource = mapping[2]; var source = originalSource; var storedSource = source || UNKNOWN_SOURCE; if (isWindows && source && !isRemoteResource(source)) { storedSource = source.replace(NIX_SEPARATOR_PATTERN, WINDOWS_SEPARATOR); } serializeContext.outputMap.addMapping({ generated: { line: serializeContext.line, column: serializeContext.column }, source: storedSource, original: { line, column } }); if (serializeContext.inlineSources && originalSource in serializeContext.sourcesContent) { serializeContext.outputMap.setSourceContent(storedSource, serializeContext.sourcesContent[originalSource]); } } function serializeStylesAndSourceMap(tokens, context) { var serializeContext = { column: 0, format: context.options.format, indentBy: 0, indentWith: "", inlineSources: context.options.sourceMapInlineSources, line: 1, output: [], outputMap: new SourceMapGenerator(), sourcesContent: context.sourcesContent, spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace, store, wrap: context.options.format.wrapAt ? wrap : function() { } }; all(serializeContext, tokens); return { sourceMap: serializeContext.outputMap, styles: serializeContext.output.join("") }; } module2.exports = serializeStylesAndSourceMap; } }); // node_modules/clean-css/lib/clean.js var require_clean = __commonJS({ "node_modules/clean-css/lib/clean.js"(exports, module2) { var level0Optimize = require_optimize(); var level1Optimize = require_optimize2(); var level2Optimize = require_optimize4(); var validator = require_validator(); var compatibilityFrom = require_compatibility(); var fetchFrom = require_fetch(); var formatFrom = require_format().formatFrom; var inlineFrom = require_inline(); var inlineRequestFrom = require_inline_request(); var inlineTimeoutFrom = require_inline_timeout(); var OptimizationLevel = require_optimization_level().OptimizationLevel; var optimizationLevelFrom = require_optimization_level().optimizationLevelFrom; var pluginsFrom = require_plugins(); var rebaseFrom = require_rebase(); var rebaseToFrom = require_rebase_to(); var inputSourceMapTracker = require_input_source_map_tracker(); var readSources = require_read_sources(); var serializeStyles = require_simple(); var serializeStylesAndSourceMap = require_source_maps(); var CleanCSS = module2.exports = function CleanCSS2(options) { options = options || {}; this.options = { batch: !!options.batch, compatibility: compatibilityFrom(options.compatibility), explicitRebaseTo: "rebaseTo" in options, fetch: fetchFrom(options.fetch), format: formatFrom(options.format), inline: inlineFrom(options.inline), inlineRequest: inlineRequestFrom(options.inlineRequest), inlineTimeout: inlineTimeoutFrom(options.inlineTimeout), level: optimizationLevelFrom(options.level), plugins: pluginsFrom(options.plugins), rebase: rebaseFrom(options.rebase, options.rebaseTo), rebaseTo: rebaseToFrom(options.rebaseTo), returnPromise: !!options.returnPromise, sourceMap: !!options.sourceMap, sourceMapInlineSources: !!options.sourceMapInlineSources }; }; CleanCSS.process = function(input, opts) { var cleanCss; var optsTo = opts.to; delete opts.to; cleanCss = new CleanCSS(Object.assign({ returnPromise: true, rebaseTo: optsTo }, opts)); return cleanCss.minify(input).then(function(output) { return { css: output.styles }; }); }; CleanCSS.prototype.minify = function(input, maybeSourceMap, maybeCallback) { var options = this.options; if (options.returnPromise) { return new Promise(function(resolve, reject) { minifyAll(input, options, maybeSourceMap, function(errors, output) { return errors ? reject(errors) : resolve(output); }); }); } return minifyAll(input, options, maybeSourceMap, maybeCallback); }; function minifyAll(input, options, maybeSourceMap, maybeCallback) { if (options.batch && Array.isArray(input)) { return minifyInBatchesFromArray(input, options, maybeSourceMap, maybeCallback); } if (options.batch && typeof input == "object") { return minifyInBatchesFromHash(input, options, maybeSourceMap, maybeCallback); } return minify2(input, options, maybeSourceMap, maybeCallback); } function minifyInBatchesFromArray(input, options, maybeSourceMap, maybeCallback) { var callback = typeof maybeCallback == "function" ? maybeCallback : typeof maybeSourceMap == "function" ? maybeSourceMap : null; var errors = []; var outputAsHash = {}; var inputValue; var i, l; function whenHashBatchDone(innerErrors, output) { outputAsHash = Object.assign(outputAsHash, output); if (innerErrors !== null) { errors = errors.concat(innerErrors); } } for (i = 0, l = input.length; i < l; i++) { if (typeof input[i] == "object") { minifyInBatchesFromHash(input[i], options, whenHashBatchDone); } else { inputValue = input[i]; outputAsHash[inputValue] = minify2([inputValue], options); errors = errors.concat(outputAsHash[inputValue].errors); } } return callback ? callback(errors.length > 0 ? errors : null, outputAsHash) : outputAsHash; } function minifyInBatchesFromHash(input, options, maybeSourceMap, maybeCallback) { var callback = typeof maybeCallback == "function" ? maybeCallback : typeof maybeSourceMap == "function" ? maybeSourceMap : null; var errors = []; var outputAsHash = {}; var inputKey; var inputValue; for (inputKey in input) { inputValue = input[inputKey]; outputAsHash[inputKey] = minify2(inputValue.styles, options, inputValue.sourceMap); errors = errors.concat(outputAsHash[inputKey].errors); } return callback ? callback(errors.length > 0 ? errors : null, outputAsHash) : outputAsHash; } function minify2(input, options, maybeSourceMap, maybeCallback) { var sourceMap = typeof maybeSourceMap != "function" ? maybeSourceMap : null; var callback = typeof maybeCallback == "function" ? maybeCallback : typeof maybeSourceMap == "function" ? maybeSourceMap : null; var context = { stats: { efficiency: 0, minifiedSize: 0, originalSize: 0, startedAt: Date.now(), timeSpent: 0 }, cache: { specificity: {} }, errors: [], inlinedStylesheets: [], inputSourceMapTracker: inputSourceMapTracker(), localOnly: !callback, options, source: null, sourcesContent: {}, validator: validator(options.compatibility), warnings: [] }; var implicitRebaseToWarning; if (sourceMap) { context.inputSourceMapTracker.track(void 0, sourceMap); } if (options.rebase && !options.explicitRebaseTo) { implicitRebaseToWarning = "You have set `rebase: true` without giving `rebaseTo` option, which, in this case, defaults to the current working directory. You are then warned this can lead to unexpected URL rebasing (aka here be dragons)! If you are OK with the clean-css output, then you can get rid of this warning by giving clean-css a `rebaseTo: process.cwd()` option."; context.warnings.push(implicitRebaseToWarning); } return runner(context.localOnly)(function() { return readSources(input, context, function(tokens) { var serialize = context.options.sourceMap ? serializeStylesAndSourceMap : serializeStyles; var optimizedTokens = optimize(tokens, context); var optimizedStyles = serialize(optimizedTokens, context); var output = withMetadata(optimizedStyles, context); return callback ? callback(context.errors.length > 0 ? context.errors : null, output) : output; }); }); } function runner(localOnly) { return localOnly ? function(callback) { return callback(); } : process.nextTick; } function optimize(tokens, context) { var optimized = level0Optimize(tokens, context); optimized = OptimizationLevel.One in context.options.level ? level1Optimize(tokens, context) : tokens; optimized = OptimizationLevel.Two in context.options.level ? level2Optimize(tokens, context, true) : optimized; return optimized; } function withMetadata(output, context) { output.stats = calculateStatsFrom(output.styles, context); output.errors = context.errors; output.inlinedStylesheets = context.inlinedStylesheets; output.warnings = context.warnings; return output; } function calculateStatsFrom(styles, context) { var finishedAt = Date.now(); var timeSpent = finishedAt - context.stats.startedAt; delete context.stats.startedAt; context.stats.timeSpent = timeSpent; context.stats.efficiency = 1 - styles.length / context.stats.originalSize; context.stats.minifiedSize = styles.length; return context.stats; } } }); // node_modules/clean-css/index.js var require_clean_css = __commonJS({ "node_modules/clean-css/index.js"(exports, module2) { module2.exports = require_clean(); } }); // node_modules/entities/lib/generated/decode-data-html.js var require_decode_data_html = __commonJS({ "node_modules/entities/lib/generated/decode-data-html.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(function(c) { return c.charCodeAt(0); })); } }); // node_modules/entities/lib/generated/decode-data-xml.js var require_decode_data_xml = __commonJS({ "node_modules/entities/lib/generated/decode-data-xml.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(function(c) { return c.charCodeAt(0); })); } }); // node_modules/entities/lib/decode_codepoint.js var require_decode_codepoint = __commonJS({ "node_modules/entities/lib/decode_codepoint.js"(exports) { "use strict"; var _a2; Object.defineProperty(exports, "__esModule", { value: true }); exports.replaceCodePoint = exports.fromCodePoint = void 0; var decodeMap = /* @__PURE__ */ new Map([ [0, 65533], [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376] ]); exports.fromCodePoint = (_a2 = String.fromCodePoint) !== null && _a2 !== void 0 ? _a2 : function(codePoint) { var output = ""; if (codePoint > 65535) { codePoint -= 65536; output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296); codePoint = 56320 | codePoint & 1023; } output += String.fromCharCode(codePoint); return output; }; function replaceCodePoint(codePoint) { var _a3; if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) { return 65533; } return (_a3 = decodeMap.get(codePoint)) !== null && _a3 !== void 0 ? _a3 : codePoint; } exports.replaceCodePoint = replaceCodePoint; function decodeCodePoint(codePoint) { return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); } exports.default = decodeCodePoint; } }); // node_modules/entities/lib/decode.js var require_decode = __commonJS({ "node_modules/entities/lib/decode.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; }); var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); } : function(o, v) { o["default"] = v; }); var __importStar = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); } __setModuleDefault(result, mod); return result; }; var __importDefault = exports && exports.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; var decode_data_html_js_1 = __importDefault(require_decode_data_html()); exports.htmlDecodeTree = decode_data_html_js_1.default; var decode_data_xml_js_1 = __importDefault(require_decode_data_xml()); exports.xmlDecodeTree = decode_data_xml_js_1.default; var decode_codepoint_js_1 = __importStar(require_decode_codepoint()); exports.decodeCodePoint = decode_codepoint_js_1.default; var decode_codepoint_js_2 = require_decode_codepoint(); Object.defineProperty(exports, "replaceCodePoint", { enumerable: true, get: function() { return decode_codepoint_js_2.replaceCodePoint; } }); Object.defineProperty(exports, "fromCodePoint", { enumerable: true, get: function() { return decode_codepoint_js_2.fromCodePoint; } }); var CharCodes; (function(CharCodes2) { CharCodes2[CharCodes2["NUM"] = 35] = "NUM"; CharCodes2[CharCodes2["SEMI"] = 59] = "SEMI"; CharCodes2[CharCodes2["EQUALS"] = 61] = "EQUALS"; CharCodes2[CharCodes2["ZERO"] = 48] = "ZERO"; CharCodes2[CharCodes2["NINE"] = 57] = "NINE"; CharCodes2[CharCodes2["LOWER_A"] = 97] = "LOWER_A"; CharCodes2[CharCodes2["LOWER_F"] = 102] = "LOWER_F"; CharCodes2[CharCodes2["LOWER_X"] = 120] = "LOWER_X"; CharCodes2[CharCodes2["LOWER_Z"] = 122] = "LOWER_Z"; CharCodes2[CharCodes2["UPPER_A"] = 65] = "UPPER_A"; CharCodes2[CharCodes2["UPPER_F"] = 70] = "UPPER_F"; CharCodes2[CharCodes2["UPPER_Z"] = 90] = "UPPER_Z"; })(CharCodes || (CharCodes = {})); var TO_LOWER_BIT = 32; var BinTrieFlags; (function(BinTrieFlags2) { BinTrieFlags2[BinTrieFlags2["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE"; })(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); function isNumber(code) { return code >= CharCodes.ZERO && code <= CharCodes.NINE; } function isHexadecimalCharacter(code) { return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F; } function isAsciiAlphaNumeric(code) { return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code); } function isEntityInAttributeInvalidEnd(code) { return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); } var EntityDecoderState; (function(EntityDecoderState2) { EntityDecoderState2[EntityDecoderState2["EntityStart"] = 0] = "EntityStart"; EntityDecoderState2[EntityDecoderState2["NumericStart"] = 1] = "NumericStart"; EntityDecoderState2[EntityDecoderState2["NumericDecimal"] = 2] = "NumericDecimal"; EntityDecoderState2[EntityDecoderState2["NumericHex"] = 3] = "NumericHex"; EntityDecoderState2[EntityDecoderState2["NamedEntity"] = 4] = "NamedEntity"; })(EntityDecoderState || (EntityDecoderState = {})); var DecodingMode; (function(DecodingMode2) { DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy"; DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict"; DecodingMode2[DecodingMode2["Attribute"] = 2] = "Attribute"; })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); var EntityDecoder = function() { function EntityDecoder2(decodeTree, emitCodePoint, errors) { this.decodeTree = decodeTree; this.emitCodePoint = emitCodePoint; this.errors = errors; this.state = EntityDecoderState.EntityStart; this.consumed = 1; this.result = 0; this.treeIndex = 0; this.excess = 1; this.decodeMode = DecodingMode.Strict; } EntityDecoder2.prototype.startEntity = function(decodeMode) { this.decodeMode = decodeMode; this.state = EntityDecoderState.EntityStart; this.result = 0; this.treeIndex = 0; this.excess = 1; this.consumed = 1; }; EntityDecoder2.prototype.write = function(str, offset) { switch (this.state) { case EntityDecoderState.EntityStart: { if (str.charCodeAt(offset) === CharCodes.NUM) { this.state = EntityDecoderState.NumericStart; this.consumed += 1; return this.stateNumericStart(str, offset + 1); } this.state = EntityDecoderState.NamedEntity; return this.stateNamedEntity(str, offset); } case EntityDecoderState.NumericStart: { return this.stateNumericStart(str, offset); } case EntityDecoderState.NumericDecimal: { return this.stateNumericDecimal(str, offset); } case EntityDecoderState.NumericHex: { return this.stateNumericHex(str, offset); } case EntityDecoderState.NamedEntity: { return this.stateNamedEntity(str, offset); } } }; EntityDecoder2.prototype.stateNumericStart = function(str, offset) { if (offset >= str.length) { return -1; } if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { this.state = EntityDecoderState.NumericHex; this.consumed += 1; return this.stateNumericHex(str, offset + 1); } this.state = EntityDecoderState.NumericDecimal; return this.stateNumericDecimal(str, offset); }; EntityDecoder2.prototype.addToNumericResult = function(str, start, end, base) { if (start !== end) { var digitCount = end - start; this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base); this.consumed += digitCount; } }; EntityDecoder2.prototype.stateNumericHex = function(str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char) || isHexadecimalCharacter(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 16); return this.emitNumericEntity(char, 3); } } this.addToNumericResult(str, startIdx, offset, 16); return -1; }; EntityDecoder2.prototype.stateNumericDecimal = function(str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 10); return this.emitNumericEntity(char, 2); } } this.addToNumericResult(str, startIdx, offset, 10); return -1; }; EntityDecoder2.prototype.emitNumericEntity = function(lastCp, expectedLength) { var _a2; if (this.consumed <= expectedLength) { (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } if (lastCp === CharCodes.SEMI) { this.consumed += 1; } else if (this.decodeMode === DecodingMode.Strict) { return 0; } this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); if (this.errors) { if (lastCp !== CharCodes.SEMI) { this.errors.missingSemicolonAfterCharacterReference(); } this.errors.validateNumericCharacterReference(this.result); } return this.consumed; }; EntityDecoder2.prototype.stateNamedEntity = function(str, offset) { var decodeTree = this.decodeTree; var current = decodeTree[this.treeIndex]; var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; for (; offset < str.length; offset++, this.excess++) { var char = str.charCodeAt(offset); this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); if (this.treeIndex < 0) { return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity(); } current = decodeTree[this.treeIndex]; valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; if (valueLength !== 0) { if (char === CharCodes.SEMI) { return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); } if (this.decodeMode !== DecodingMode.Strict) { this.result = this.treeIndex; this.consumed += this.excess; this.excess = 0; } } } return -1; }; EntityDecoder2.prototype.emitNotTerminatedNamedEntity = function() { var _a2; var _b = this, result = _b.result, decodeTree = _b.decodeTree; var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; this.emitNamedEntityData(result, valueLength, this.consumed); (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.missingSemicolonAfterCharacterReference(); return this.consumed; }; EntityDecoder2.prototype.emitNamedEntityData = function(result, valueLength, consumed) { var decodeTree = this.decodeTree; this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed); if (valueLength === 3) { this.emitCodePoint(decodeTree[result + 2], consumed); } return consumed; }; EntityDecoder2.prototype.end = function() { var _a2; switch (this.state) { case EntityDecoderState.NamedEntity: { return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; } case EntityDecoderState.NumericDecimal: { return this.emitNumericEntity(0, 2); } case EntityDecoderState.NumericHex: { return this.emitNumericEntity(0, 3); } case EntityDecoderState.NumericStart: { (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } case EntityDecoderState.EntityStart: { return 0; } } }; return EntityDecoder2; }(); exports.EntityDecoder = EntityDecoder; function getDecoder(decodeTree) { var ret = ""; var decoder = new EntityDecoder(decodeTree, function(str) { return ret += (0, decode_codepoint_js_1.fromCodePoint)(str); }); return function decodeWithTrie(str, decodeMode) { var lastIndex = 0; var offset = 0; while ((offset = str.indexOf("&", offset)) >= 0) { ret += str.slice(lastIndex, offset); decoder.startEntity(decodeMode); var len = decoder.write(str, offset + 1); if (len < 0) { lastIndex = offset + decoder.end(); break; } lastIndex = offset + len; offset = len === 0 ? lastIndex + 1 : lastIndex; } var result = ret + str.slice(lastIndex); ret = ""; return result; }; } function determineBranch(decodeTree, current, nodeIdx, char) { var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; var jumpOffset = current & BinTrieFlags.JUMP_TABLE; if (branchCount === 0) { return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; } if (jumpOffset) { var value = char - jumpOffset; return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1; } var lo = nodeIdx; var hi = lo + branchCount - 1; while (lo <= hi) { var mid = lo + hi >>> 1; var midVal = decodeTree[mid]; if (midVal < char) { lo = mid + 1; } else if (midVal > char) { hi = mid - 1; } else { return decodeTree[mid + branchCount]; } } return -1; } exports.determineBranch = determineBranch; var htmlDecoder = getDecoder(decode_data_html_js_1.default); var xmlDecoder = getDecoder(decode_data_xml_js_1.default); function decodeHTML(str, mode) { if (mode === void 0) { mode = DecodingMode.Legacy; } return htmlDecoder(str, mode); } exports.decodeHTML = decodeHTML; function decodeHTMLAttribute(str) { return htmlDecoder(str, DecodingMode.Attribute); } exports.decodeHTMLAttribute = decodeHTMLAttribute; function decodeHTMLStrict(str) { return htmlDecoder(str, DecodingMode.Strict); } exports.decodeHTMLStrict = decodeHTMLStrict; function decodeXML(str) { return xmlDecoder(str, DecodingMode.Strict); } exports.decodeXML = decodeXML; } }); // node_modules/entities/lib/generated/encode-html.js var require_encode_html = __commonJS({ "node_modules/entities/lib/generated/encode-html.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function restoreDiff(arr) { for (var i = 1; i < arr.length; i++) { arr[i][0] += arr[i - 1][0] + 1; } return arr; } exports.default = new Map(/* @__PURE__ */ restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* @__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); } }); // node_modules/entities/lib/escape.js var require_escape = __commonJS({ "node_modules/entities/lib/escape.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0; exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g; var xmlCodeMap = /* @__PURE__ */ new Map([ [34, """], [38, "&"], [39, "'"], [60, "<"], [62, ">"] ]); exports.getCodePoint = String.prototype.codePointAt != null ? function(str, index) { return str.codePointAt(index); } : function(c, index) { return (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index); }; function encodeXML(str) { var ret = ""; var lastIdx = 0; var match; while ((match = exports.xmlReplacer.exec(str)) !== null) { var i = match.index; var char = str.charCodeAt(i); var next = xmlCodeMap.get(char); if (next !== void 0) { ret += str.substring(lastIdx, i) + next; lastIdx = i + 1; } else { ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";"); lastIdx = exports.xmlReplacer.lastIndex += Number((char & 64512) === 55296); } } return ret + str.substr(lastIdx); } exports.encodeXML = encodeXML; exports.escape = encodeXML; function getEscaper(regex, map) { return function escape2(data) { var match; var lastIdx = 0; var result = ""; while (match = regex.exec(data)) { if (lastIdx !== match.index) { result += data.substring(lastIdx, match.index); } result += map.get(match[0].charCodeAt(0)); lastIdx = match.index + 1; } return result + data.substring(lastIdx); }; } exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); exports.escapeAttribute = getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([ [34, """], [38, "&"], [160, " "] ])); exports.escapeText = getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([ [38, "&"], [60, "<"], [62, ">"], [160, " "] ])); } }); // node_modules/entities/lib/encode.js var require_encode = __commonJS({ "node_modules/entities/lib/encode.js"(exports) { "use strict"; var __importDefault = exports && exports.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.encodeNonAsciiHTML = exports.encodeHTML = void 0; var encode_html_js_1 = __importDefault(require_encode_html()); var escape_js_1 = require_escape(); var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; function encodeHTML(data) { return encodeHTMLTrieRe(htmlReplacer, data); } exports.encodeHTML = encodeHTML; function encodeNonAsciiHTML(data) { return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data); } exports.encodeNonAsciiHTML = encodeNonAsciiHTML; function encodeHTMLTrieRe(regExp, str) { var ret = ""; var lastIdx = 0; var match; while ((match = regExp.exec(str)) !== null) { var i = match.index; ret += str.substring(lastIdx, i); var char = str.charCodeAt(i); var next = encode_html_js_1.default.get(char); if (typeof next === "object") { if (i + 1 < str.length) { var nextChar = str.charCodeAt(i + 1); var value = typeof next.n === "number" ? next.n === nextChar ? next.o : void 0 : next.n.get(nextChar); if (value !== void 0) { ret += value; lastIdx = regExp.lastIndex += 1; continue; } } next = next.v; } if (next !== void 0) { ret += next; lastIdx = i + 1; } else { var cp = (0, escape_js_1.getCodePoint)(str, i); ret += "&#x".concat(cp.toString(16), ";"); lastIdx = regExp.lastIndex += Number(cp !== char); } } return ret + str.substr(lastIdx); } } }); // node_modules/entities/lib/index.js var require_lib = __commonJS({ "node_modules/entities/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0; var decode_js_1 = require_decode(); var encode_js_1 = require_encode(); var escape_js_1 = require_escape(); var EntityLevel; (function(EntityLevel2) { EntityLevel2[EntityLevel2["XML"] = 0] = "XML"; EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML"; })(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {})); var EncodingMode; (function(EncodingMode2) { EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8"; EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII"; EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive"; EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute"; EncodingMode2[EncodingMode2["Text"] = 4] = "Text"; })(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {})); function decode(data, options) { if (options === void 0) { options = EntityLevel.XML; } var level = typeof options === "number" ? options : options.level; if (level === EntityLevel.HTML) { var mode = typeof options === "object" ? options.mode : void 0; return (0, decode_js_1.decodeHTML)(data, mode); } return (0, decode_js_1.decodeXML)(data); } exports.decode = decode; function decodeStrict(data, options) { var _a2; if (options === void 0) { options = EntityLevel.XML; } var opts = typeof options === "number" ? { level: options } : options; (_a2 = opts.mode) !== null && _a2 !== void 0 ? _a2 : opts.mode = decode_js_1.DecodingMode.Strict; return decode(data, opts); } exports.decodeStrict = decodeStrict; function encode(data, options) { if (options === void 0) { options = EntityLevel.XML; } var opts = typeof options === "number" ? { level: options } : options; if (opts.mode === EncodingMode.UTF8) return (0, escape_js_1.escapeUTF8)(data); if (opts.mode === EncodingMode.Attribute) return (0, escape_js_1.escapeAttribute)(data); if (opts.mode === EncodingMode.Text) return (0, escape_js_1.escapeText)(data); if (opts.level === EntityLevel.HTML) { if (opts.mode === EncodingMode.ASCII) { return (0, encode_js_1.encodeNonAsciiHTML)(data); } return (0, encode_js_1.encodeHTML)(data); } return (0, escape_js_1.encodeXML)(data); } exports.encode = encode; var escape_js_2 = require_escape(); Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function() { return escape_js_2.encodeXML; } }); Object.defineProperty(exports, "escape", { enumerable: true, get: function() { return escape_js_2.escape; } }); Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function() { return escape_js_2.escapeUTF8; } }); Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function() { return escape_js_2.escapeAttribute; } }); Object.defineProperty(exports, "escapeText", { enumerable: true, get: function() { return escape_js_2.escapeText; } }); var encode_js_2 = require_encode(); Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function() { return encode_js_2.encodeHTML; } }); Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function() { return encode_js_2.encodeNonAsciiHTML; } }); Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function() { return encode_js_2.encodeHTML; } }); Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function() { return encode_js_2.encodeHTML; } }); var decode_js_2 = require_decode(); Object.defineProperty(exports, "EntityDecoder", { enumerable: true, get: function() { return decode_js_2.EntityDecoder; } }); Object.defineProperty(exports, "DecodingMode", { enumerable: true, get: function() { return decode_js_2.DecodingMode; } }); Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function() { return decode_js_2.decodeXML; } }); Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function() { return decode_js_2.decodeHTML; } }); Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function() { return decode_js_2.decodeHTMLStrict; } }); Object.defineProperty(exports, "decodeHTMLAttribute", { enumerable: true, get: function() { return decode_js_2.decodeHTMLAttribute; } }); Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function() { return decode_js_2.decodeHTML; } }); Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function() { return decode_js_2.decodeHTML; } }); Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function() { return decode_js_2.decodeHTMLStrict; } }); Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function() { return decode_js_2.decodeHTMLStrict; } }); Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function() { return decode_js_2.decodeXML; } }); } }); // node_modules/relateurl/lib/constants.js var require_constants = __commonJS({ "node_modules/relateurl/lib/constants.js"(exports, module2) { "use strict"; module2.exports = { ABSOLUTE: "absolute", PATH_RELATIVE: "pathRelative", ROOT_RELATIVE: "rootRelative", SHORTEST: "shortest" }; } }); // node_modules/relateurl/lib/format.js var require_format2 = __commonJS({ "node_modules/relateurl/lib/format.js"(exports, module2) { "use strict"; var constants = require_constants(); function formatAuth(urlObj, options) { if (urlObj.auth && !options.removeAuth && (urlObj.extra.relation.maximumHost || options.output === constants.ABSOLUTE)) { return urlObj.auth + "@"; } return ""; } function formatHash(urlObj, options) { return urlObj.hash ? urlObj.hash : ""; } function formatHost(urlObj, options) { if (urlObj.host.full && (urlObj.extra.relation.maximumAuth || options.output === constants.ABSOLUTE)) { return urlObj.host.full; } return ""; } function formatPath(urlObj, options) { var str = ""; var absolutePath = urlObj.path.absolute.string; var relativePath = urlObj.path.relative.string; var resource = showResource(urlObj, options); if (urlObj.extra.relation.maximumHost || options.output === constants.ABSOLUTE || options.output === constants.ROOT_RELATIVE) { str = absolutePath; } else if (relativePath.length <= absolutePath.length && options.output === constants.SHORTEST || options.output === constants.PATH_RELATIVE) { str = relativePath; if (str === "") { var query = showQuery(urlObj, options) && !!getQuery(urlObj, options); if (urlObj.extra.relation.maximumPath && !resource) { str = "./"; } else if (urlObj.extra.relation.overridesQuery && !resource && !query) { str = "./"; } } } else { str = absolutePath; } if (str === "/" && !resource && options.removeRootTrailingSlash && (!urlObj.extra.relation.minimumPort || options.output === constants.ABSOLUTE)) { str = ""; } return str; } function formatPort(urlObj, options) { if (urlObj.port && !urlObj.extra.portIsDefault && urlObj.extra.relation.maximumHost) { return ":" + urlObj.port; } return ""; } function formatQuery(urlObj, options) { return showQuery(urlObj, options) ? getQuery(urlObj, options) : ""; } function formatResource(urlObj, options) { return showResource(urlObj, options) ? urlObj.resource : ""; } function formatScheme(urlObj, options) { var str = ""; if (urlObj.extra.relation.maximumHost || options.output === constants.ABSOLUTE) { if (!urlObj.extra.relation.minimumScheme || !options.schemeRelative || options.output === constants.ABSOLUTE) { str += urlObj.scheme + "://"; } else { str += "//"; } } return str; } function formatUrl(urlObj, options) { var url = ""; url += formatScheme(urlObj, options); url += formatAuth(urlObj, options); url += formatHost(urlObj, options); url += formatPort(urlObj, options); url += formatPath(urlObj, options); url += formatResource(urlObj, options); url += formatQuery(urlObj, options); url += formatHash(urlObj, options); return url; } function getQuery(urlObj, options) { var stripQuery = options.removeEmptyQueries && urlObj.extra.relation.minimumPort; return urlObj.query.string[stripQuery ? "stripped" : "full"]; } function showQuery(urlObj, options) { return !urlObj.extra.relation.minimumQuery || options.output === constants.ABSOLUTE || options.output === constants.ROOT_RELATIVE; } function showResource(urlObj, options) { var removeIndex = options.removeDirectoryIndexes && urlObj.extra.resourceIsIndex; var removeMatchingResource = urlObj.extra.relation.minimumResource && options.output !== constants.ABSOLUTE && options.output !== constants.ROOT_RELATIVE; return !!urlObj.resource && !removeMatchingResource && !removeIndex; } module2.exports = formatUrl; } }); // node_modules/relateurl/lib/util/object.js var require_object = __commonJS({ "node_modules/relateurl/lib/util/object.js"(exports, module2) { "use strict"; function clone(obj) { if (obj instanceof Object) { var clonedObj = obj instanceof Array ? [] : {}; for (var i in obj) { if (obj.hasOwnProperty(i)) { clonedObj[i] = clone(obj[i]); } } return clonedObj; } return obj; } function isPlainObject(obj) { return !!obj && typeof obj === "object" && obj.constructor === Object; } function shallowMerge(target, source) { if (target instanceof Object && source instanceof Object) { for (var i in source) { if (source.hasOwnProperty(i)) { target[i] = source[i]; } } } return target; } module2.exports = { clone, isPlainObject, shallowMerge }; } }); // node_modules/relateurl/lib/options.js var require_options = __commonJS({ "node_modules/relateurl/lib/options.js"(exports, module2) { "use strict"; var objUtils = require_object(); function getOptions(options, defaults) { if (objUtils.isPlainObject(options)) { var newOptions = {}; for (var i in defaults) { if (defaults.hasOwnProperty(i)) { if (options[i] !== void 0) { newOptions[i] = mergeOption(options[i], defaults[i]); } else { newOptions[i] = defaults[i]; } } } return newOptions; } else { return defaults; } } function mergeOption(newValues, defaultValues) { if (defaultValues instanceof Object && newValues instanceof Object) { if (defaultValues instanceof Array && newValues instanceof Array) { return defaultValues.concat(newValues); } else { return objUtils.shallowMerge(newValues, defaultValues); } } return newValues; } module2.exports = getOptions; } }); // node_modules/relateurl/lib/parse/hrefInfo.js var require_hrefInfo = __commonJS({ "node_modules/relateurl/lib/parse/hrefInfo.js"(exports, module2) { "use strict"; function hrefInfo(urlObj) { var minimumPathOnly = !urlObj.scheme && !urlObj.auth && !urlObj.host.full && !urlObj.port; var minimumResourceOnly = minimumPathOnly && !urlObj.path.absolute.string; var minimumQueryOnly = minimumResourceOnly && !urlObj.resource; var minimumHashOnly = minimumQueryOnly && !urlObj.query.string.full.length; var empty = minimumHashOnly && !urlObj.hash; urlObj.extra.hrefInfo.minimumPathOnly = minimumPathOnly; urlObj.extra.hrefInfo.minimumResourceOnly = minimumResourceOnly; urlObj.extra.hrefInfo.minimumQueryOnly = minimumQueryOnly; urlObj.extra.hrefInfo.minimumHashOnly = minimumHashOnly; urlObj.extra.hrefInfo.empty = empty; } module2.exports = hrefInfo; } }); // node_modules/relateurl/lib/parse/host.js var require_host = __commonJS({ "node_modules/relateurl/lib/parse/host.js"(exports, module2) { "use strict"; function parseHost(urlObj, options) { if (options.ignore_www) { var host = urlObj.host.full; if (host) { var stripped = host; if (host.indexOf("www.") === 0) { stripped = host.substr(4); } urlObj.host.stripped = stripped; } } } module2.exports = parseHost; } }); // node_modules/relateurl/lib/parse/path.js var require_path = __commonJS({ "node_modules/relateurl/lib/parse/path.js"(exports, module2) { "use strict"; function isDirectoryIndex(resource, options) { var verdict = false; options.directoryIndexes.every(function(index) { if (index === resource) { verdict = true; return false; } return true; }); return verdict; } function parsePath(urlObj, options) { var path = urlObj.path.absolute.string; if (path) { var lastSlash = path.lastIndexOf("/"); if (lastSlash > -1) { if (++lastSlash < path.length) { var resource = path.substr(lastSlash); if (resource !== "." && resource !== "..") { urlObj.resource = resource; path = path.substr(0, lastSlash); } else { path += "/"; } } urlObj.path.absolute.string = path; urlObj.path.absolute.array = splitPath(path); } else if (path === "." || path === "..") { path += "/"; urlObj.path.absolute.string = path; urlObj.path.absolute.array = splitPath(path); } else { urlObj.resource = path; urlObj.path.absolute.string = null; } urlObj.extra.resourceIsIndex = isDirectoryIndex(urlObj.resource, options); } } function splitPath(path) { if (path !== "/") { var cleaned = []; path.split("/").forEach(function(dir) { if (dir !== "") { cleaned.push(dir); } }); return cleaned; } else { return []; } } module2.exports = parsePath; } }); // node_modules/relateurl/lib/parse/port.js var require_port = __commonJS({ "node_modules/relateurl/lib/parse/port.js"(exports, module2) { "use strict"; function parsePort(urlObj, options) { var defaultPort = -1; for (var i in options.defaultPorts) { if (i === urlObj.scheme && options.defaultPorts.hasOwnProperty(i)) { defaultPort = options.defaultPorts[i]; break; } } if (defaultPort > -1) { defaultPort = defaultPort.toString(); if (urlObj.port === null) { urlObj.port = defaultPort; } urlObj.extra.portIsDefault = urlObj.port === defaultPort; } } module2.exports = parsePort; } }); // node_modules/relateurl/lib/parse/query.js var require_query = __commonJS({ "node_modules/relateurl/lib/parse/query.js"(exports, module2) { "use strict"; var hasOwnProperty = Object.prototype.hasOwnProperty; function parseQuery(urlObj, options) { urlObj.query.string.full = stringify(urlObj.query.object, false); if (options.removeEmptyQueries) { urlObj.query.string.stripped = stringify(urlObj.query.object, true); } } function stringify(queryObj, removeEmptyQueries) { var count = 0; var str = ""; for (var i in queryObj) { if (i !== "" && hasOwnProperty.call(queryObj, i) === true) { var value = queryObj[i]; if (value !== "" || !removeEmptyQueries) { str += ++count === 1 ? "?" : "&"; i = encodeURIComponent(i); if (value !== "") { str += i + "=" + encodeURIComponent(value).replace(/%20/g, "+"); } else { str += i; } } } } return str; } module2.exports = parseQuery; } }); // node_modules/relateurl/lib/parse/urlstring.js var require_urlstring = __commonJS({ "node_modules/relateurl/lib/parse/urlstring.js"(exports, module2) { "use strict"; var _parseUrl = require("url").parse; function clean(urlObj) { var scheme = urlObj.protocol; if (scheme) { if (scheme.indexOf(":") === scheme.length - 1) { scheme = scheme.substr(0, scheme.length - 1); } } urlObj.host = { full: urlObj.hostname, stripped: null }; urlObj.path = { absolute: { array: null, string: urlObj.pathname }, relative: { array: null, string: null } }; urlObj.query = { object: urlObj.query, string: { full: null, stripped: null } }; urlObj.extra = { hrefInfo: { minimumPathOnly: null, minimumResourceOnly: null, minimumQueryOnly: null, minimumHashOnly: null, empty: null, separatorOnlyQuery: urlObj.search === "?" }, portIsDefault: null, relation: { maximumScheme: null, maximumAuth: null, maximumHost: null, maximumPort: null, maximumPath: null, maximumResource: null, maximumQuery: null, maximumHash: null, minimumScheme: null, minimumAuth: null, minimumHost: null, minimumPort: null, minimumPath: null, minimumResource: null, minimumQuery: null, minimumHash: null, overridesQuery: null }, resourceIsIndex: null, slashes: urlObj.slashes }; urlObj.resource = null; urlObj.scheme = scheme; delete urlObj.hostname; delete urlObj.pathname; delete urlObj.protocol; delete urlObj.search; delete urlObj.slashes; return urlObj; } function validScheme(url, options) { var valid = true; options.rejectedSchemes.every(function(rejectedScheme) { valid = !(url.indexOf(rejectedScheme + ":") === 0); return valid; }); return valid; } function parseUrlString(url, options) { if (validScheme(url, options)) { return clean(_parseUrl(url, true, options.slashesDenoteHost)); } else { return { href: url, valid: false }; } } module2.exports = parseUrlString; } }); // node_modules/relateurl/lib/util/path.js var require_path2 = __commonJS({ "node_modules/relateurl/lib/util/path.js"(exports, module2) { "use strict"; function joinPath(pathArray) { if (pathArray.length > 0) { return pathArray.join("/") + "/"; } else { return ""; } } function resolveDotSegments(pathArray) { var pathAbsolute = []; pathArray.forEach(function(dir) { if (dir !== "..") { if (dir !== ".") { pathAbsolute.push(dir); } } else { if (pathAbsolute.length > 0) { pathAbsolute.splice(pathAbsolute.length - 1, 1); } } }); return pathAbsolute; } module2.exports = { join: joinPath, resolveDotSegments }; } }); // node_modules/relateurl/lib/parse/index.js var require_parse = __commonJS({ "node_modules/relateurl/lib/parse/index.js"(exports, module2) { "use strict"; var hrefInfo = require_hrefInfo(); var parseHost = require_host(); var parsePath = require_path(); var parsePort = require_port(); var parseQuery = require_query(); var parseUrlString = require_urlstring(); var pathUtils = require_path2(); function parseFromUrl(url, options, fallback) { if (url) { var urlObj = parseUrl(url, options); var pathArray = pathUtils.resolveDotSegments(urlObj.path.absolute.array); urlObj.path.absolute.array = pathArray; urlObj.path.absolute.string = "/" + pathUtils.join(pathArray); return urlObj; } else { return fallback; } } function parseUrl(url, options) { var urlObj = parseUrlString(url, options); if (urlObj.valid === false) return urlObj; parseHost(urlObj, options); parsePort(urlObj, options); parsePath(urlObj, options); parseQuery(urlObj, options); hrefInfo(urlObj); return urlObj; } module2.exports = { from: parseFromUrl, to: parseUrl }; } }); // node_modules/relateurl/lib/relate/findRelation.js var require_findRelation = __commonJS({ "node_modules/relateurl/lib/relate/findRelation.js"(exports, module2) { "use strict"; function findRelation_upToPath(urlObj, siteUrlObj, options) { var pathOnly = urlObj.extra.hrefInfo.minimumPathOnly; var minimumScheme = urlObj.scheme === siteUrlObj.scheme || !urlObj.scheme; var minimumAuth = minimumScheme && (urlObj.auth === siteUrlObj.auth || options.removeAuth || pathOnly); var www = options.ignore_www ? "stripped" : "full"; var minimumHost = minimumAuth && (urlObj.host[www] === siteUrlObj.host[www] || pathOnly); var minimumPort = minimumHost && (urlObj.port === siteUrlObj.port || pathOnly); urlObj.extra.relation.minimumScheme = minimumScheme; urlObj.extra.relation.minimumAuth = minimumAuth; urlObj.extra.relation.minimumHost = minimumHost; urlObj.extra.relation.minimumPort = minimumPort; urlObj.extra.relation.maximumScheme = !minimumScheme || minimumScheme && !minimumAuth; urlObj.extra.relation.maximumAuth = !minimumScheme || minimumScheme && !minimumHost; urlObj.extra.relation.maximumHost = !minimumScheme || minimumScheme && !minimumPort; } function findRelation_pathOn(urlObj, siteUrlObj, options) { var queryOnly = urlObj.extra.hrefInfo.minimumQueryOnly; var hashOnly = urlObj.extra.hrefInfo.minimumHashOnly; var empty = urlObj.extra.hrefInfo.empty; var minimumPort = urlObj.extra.relation.minimumPort; var minimumScheme = urlObj.extra.relation.minimumScheme; var minimumPath = minimumPort && urlObj.path.absolute.string === siteUrlObj.path.absolute.string; var matchingResource = urlObj.resource === siteUrlObj.resource || !urlObj.resource && siteUrlObj.extra.resourceIsIndex || options.removeDirectoryIndexes && urlObj.extra.resourceIsIndex && !siteUrlObj.resource; var minimumResource = minimumPath && (matchingResource || queryOnly || hashOnly || empty); var query = options.removeEmptyQueries ? "stripped" : "full"; var urlQuery = urlObj.query.string[query]; var siteUrlQuery = siteUrlObj.query.string[query]; var minimumQuery = minimumResource && !!urlQuery && urlQuery === siteUrlQuery || (hashOnly || empty) && !urlObj.extra.hrefInfo.separatorOnlyQuery; var minimumHash = minimumQuery && urlObj.hash === siteUrlObj.hash; urlObj.extra.relation.minimumPath = minimumPath; urlObj.extra.relation.minimumResource = minimumResource; urlObj.extra.relation.minimumQuery = minimumQuery; urlObj.extra.relation.minimumHash = minimumHash; urlObj.extra.relation.maximumPort = !minimumScheme || minimumScheme && !minimumPath; urlObj.extra.relation.maximumPath = !minimumScheme || minimumScheme && !minimumResource; urlObj.extra.relation.maximumResource = !minimumScheme || minimumScheme && !minimumQuery; urlObj.extra.relation.maximumQuery = !minimumScheme || minimumScheme && !minimumHash; urlObj.extra.relation.maximumHash = !minimumScheme || minimumScheme && !minimumHash; urlObj.extra.relation.overridesQuery = minimumPath && urlObj.extra.relation.maximumResource && !minimumQuery && !!siteUrlQuery; } module2.exports = { pathOn: findRelation_pathOn, upToPath: findRelation_upToPath }; } }); // node_modules/relateurl/lib/relate/absolutize.js var require_absolutize = __commonJS({ "node_modules/relateurl/lib/relate/absolutize.js"(exports, module2) { "use strict"; var findRelation = require_findRelation(); var objUtils = require_object(); var pathUtils = require_path2(); function absolutize(urlObj, siteUrlObj, options) { findRelation.upToPath(urlObj, siteUrlObj, options); if (urlObj.extra.relation.minimumScheme) urlObj.scheme = siteUrlObj.scheme; if (urlObj.extra.relation.minimumAuth) urlObj.auth = siteUrlObj.auth; if (urlObj.extra.relation.minimumHost) urlObj.host = objUtils.clone(siteUrlObj.host); if (urlObj.extra.relation.minimumPort) copyPort(urlObj, siteUrlObj); if (urlObj.extra.relation.minimumScheme) copyPath(urlObj, siteUrlObj); findRelation.pathOn(urlObj, siteUrlObj, options); if (urlObj.extra.relation.minimumResource) copyResource(urlObj, siteUrlObj); if (urlObj.extra.relation.minimumQuery) urlObj.query = objUtils.clone(siteUrlObj.query); if (urlObj.extra.relation.minimumHash) urlObj.hash = siteUrlObj.hash; } function copyPath(urlObj, siteUrlObj) { if (urlObj.extra.relation.maximumHost || !urlObj.extra.hrefInfo.minimumResourceOnly) { var pathArray = urlObj.path.absolute.array; var pathString = "/"; if (pathArray) { if (urlObj.extra.hrefInfo.minimumPathOnly && urlObj.path.absolute.string.indexOf("/") !== 0) { pathArray = siteUrlObj.path.absolute.array.concat(pathArray); } pathArray = pathUtils.resolveDotSegments(pathArray); pathString += pathUtils.join(pathArray); } else { pathArray = []; } urlObj.path.absolute.array = pathArray; urlObj.path.absolute.string = pathString; } else { urlObj.path = objUtils.clone(siteUrlObj.path); } } function copyPort(urlObj, siteUrlObj) { urlObj.port = siteUrlObj.port; urlObj.extra.portIsDefault = siteUrlObj.extra.portIsDefault; } function copyResource(urlObj, siteUrlObj) { urlObj.resource = siteUrlObj.resource; urlObj.extra.resourceIsIndex = siteUrlObj.extra.resourceIsIndex; } module2.exports = absolutize; } }); // node_modules/relateurl/lib/relate/relativize.js var require_relativize = __commonJS({ "node_modules/relateurl/lib/relate/relativize.js"(exports, module2) { "use strict"; var pathUtils = require_path2(); function relatePath(absolutePath, siteAbsolutePath) { var relativePath = []; var related = true; var parentIndex = -1; siteAbsolutePath.forEach(function(siteAbsoluteDir, i) { if (related) { if (absolutePath[i] !== siteAbsoluteDir) { related = false; } else { parentIndex = i; } } if (!related) { relativePath.push(".."); } }); absolutePath.forEach(function(dir, i) { if (i > parentIndex) { relativePath.push(dir); } }); return relativePath; } function relativize(urlObj, siteUrlObj, options) { if (urlObj.extra.relation.minimumScheme) { var pathArray = relatePath(urlObj.path.absolute.array, siteUrlObj.path.absolute.array); urlObj.path.relative.array = pathArray; urlObj.path.relative.string = pathUtils.join(pathArray); } } module2.exports = relativize; } }); // node_modules/relateurl/lib/relate/index.js var require_relate = __commonJS({ "node_modules/relateurl/lib/relate/index.js"(exports, module2) { "use strict"; var absolutize = require_absolutize(); var relativize = require_relativize(); function relateUrl(siteUrlObj, urlObj, options) { absolutize(urlObj, siteUrlObj, options); relativize(urlObj, siteUrlObj, options); return urlObj; } module2.exports = relateUrl; } }); // node_modules/relateurl/lib/index.js var require_lib2 = __commonJS({ "node_modules/relateurl/lib/index.js"(exports, module2) { "use strict"; var constants = require_constants(); var formatUrl = require_format2(); var getOptions = require_options(); var objUtils = require_object(); var parseUrl = require_parse(); var relateUrl = require_relate(); function RelateUrl(from, options) { this.options = getOptions(options, { defaultPorts: { ftp: 21, http: 80, https: 443 }, directoryIndexes: ["index.html"], ignore_www: false, output: RelateUrl.SHORTEST, rejectedSchemes: ["data", "javascript", "mailto"], removeAuth: false, removeDirectoryIndexes: true, removeEmptyQueries: false, removeRootTrailingSlash: true, schemeRelative: true, site: void 0, slashesDenoteHost: true }); this.from = parseUrl.from(from, this.options, null); } RelateUrl.prototype.relate = function(from, to, options) { if (objUtils.isPlainObject(to)) { options = to; to = from; from = null; } else if (!to) { to = from; from = null; } options = getOptions(options, this.options); from = from || options.site; from = parseUrl.from(from, options, this.from); if (!from || !from.href) { throw new Error("from value not defined."); } else if (from.extra.hrefInfo.minimumPathOnly) { throw new Error("from value supplied is not absolute: " + from.href); } to = parseUrl.to(to, options); if (to.valid === false) return to.href; to = relateUrl(from, to, options); to = formatUrl(to, options); return to; }; RelateUrl.relate = function(from, to, options) { return new RelateUrl().relate(from, to, options); }; objUtils.shallowMerge(RelateUrl, constants); module2.exports = RelateUrl; } }); // node_modules/@jridgewell/source-map/dist/source-map.umd.js var require_source_map_umd = __commonJS({ "node_modules/@jridgewell/source-map/dist/source-map.umd.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sourceMap = {})); })(exports, function(exports2) { "use strict"; const comma = ",".charCodeAt(0); const semicolon = ";".charCodeAt(0); const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const intToChar = new Uint8Array(64); const charToInteger = new Uint8Array(128); for (let i = 0; i < chars.length; i++) { const c = chars.charCodeAt(i); charToInteger[c] = i; intToChar[i] = c; } const td = typeof TextDecoder !== "undefined" ? new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) { const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); return out.toString(); } } : { decode(buf) { let out = ""; for (let i = 0; i < buf.length; i++) { out += String.fromCharCode(buf[i]); } return out; } }; function decode(mappings) { const state = new Int32Array(5); const decoded = []; let line = []; let sorted = true; let lastCol = 0; for (let i = 0; i < mappings.length; ) { const c = mappings.charCodeAt(i); if (c === comma) { i++; } else if (c === semicolon) { state[0] = lastCol = 0; if (!sorted) sort(line); sorted = true; decoded.push(line); line = []; i++; } else { i = decodeInteger(mappings, i, state, 0); const col = state[0]; if (col < lastCol) sorted = false; lastCol = col; if (!hasMoreSegments(mappings, i)) { line.push([col]); continue; } i = decodeInteger(mappings, i, state, 1); i = decodeInteger(mappings, i, state, 2); i = decodeInteger(mappings, i, state, 3); if (!hasMoreSegments(mappings, i)) { line.push([col, state[1], state[2], state[3]]); continue; } i = decodeInteger(mappings, i, state, 4); line.push([col, state[1], state[2], state[3], state[4]]); } } if (!sorted) sort(line); decoded.push(line); return decoded; } function decodeInteger(mappings, pos, state, j) { let value = 0; let shift = 0; let integer = 0; do { const c = mappings.charCodeAt(pos++); integer = charToInteger[c]; value |= (integer & 31) << shift; shift += 5; } while (integer & 32); const shouldNegate = value & 1; value >>>= 1; if (shouldNegate) { value = -2147483648 | -value; } state[j] += value; return pos; } function hasMoreSegments(mappings, i) { if (i >= mappings.length) return false; const c = mappings.charCodeAt(i); if (c === comma || c === semicolon) return false; return true; } function sort(line) { line.sort(sortComparator$1); } function sortComparator$1(a, b) { return a[0] - b[0]; } function encode(decoded) { const state = new Int32Array(5); let buf = new Uint8Array(1024); let pos = 0; for (let i = 0; i < decoded.length; i++) { const line = decoded[i]; if (i > 0) { buf = reserve(buf, pos, 1); buf[pos++] = semicolon; } if (line.length === 0) continue; state[0] = 0; for (let j = 0; j < line.length; j++) { const segment = line[j]; buf = reserve(buf, pos, 36); if (j > 0) buf[pos++] = comma; pos = encodeInteger(buf, pos, state, segment, 0); if (segment.length === 1) continue; pos = encodeInteger(buf, pos, state, segment, 1); pos = encodeInteger(buf, pos, state, segment, 2); pos = encodeInteger(buf, pos, state, segment, 3); if (segment.length === 4) continue; pos = encodeInteger(buf, pos, state, segment, 4); } } return td.decode(buf.subarray(0, pos)); } function reserve(buf, pos, count) { if (buf.length > pos + count) return buf; const swap = new Uint8Array(buf.length * 2); swap.set(buf); return swap; } function encodeInteger(buf, pos, state, segment, j) { const next = segment[j]; let num = next - state[j]; state[j] = next; num = num < 0 ? -num << 1 | 1 : num << 1; do { let clamped = num & 31; num >>>= 5; if (num > 0) clamped |= 32; buf[pos++] = intToChar[clamped]; } while (num > 0); return pos; } const schemeRegex = /^[\w+.-]+:\/\//; const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/; const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i; function isAbsoluteUrl(input) { return schemeRegex.test(input); } function isSchemeRelativeUrl(input) { return input.startsWith("//"); } function isAbsolutePath(input) { return input.startsWith("/"); } function isFileUrl(input) { return input.startsWith("file:"); } function parseAbsoluteUrl(input) { const match = urlRegex.exec(input); return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/"); } function parseFileUrl(input) { const match = fileRegex.exec(input); const path = match[2]; return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path); } function makeUrl(scheme, user, host, port, path) { return { scheme, user, host, port, path, relativePath: false }; } function parseUrl(input) { if (isSchemeRelativeUrl(input)) { const url2 = parseAbsoluteUrl("http:" + input); url2.scheme = ""; return url2; } if (isAbsolutePath(input)) { const url2 = parseAbsoluteUrl("http://foo.com" + input); url2.scheme = ""; url2.host = ""; return url2; } if (isFileUrl(input)) return parseFileUrl(input); if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input); const url = parseAbsoluteUrl("http://foo.com/" + input); url.scheme = ""; url.host = ""; url.relativePath = true; return url; } function stripPathFilename(path) { if (path.endsWith("/..")) return path; const index = path.lastIndexOf("/"); return path.slice(0, index + 1); } function mergePaths(url, base) { if (!url.relativePath) return; normalizePath(base); if (url.path === "/") { url.path = base.path; } else { url.path = stripPathFilename(base.path) + url.path; } url.relativePath = base.relativePath; } function normalizePath(url) { const { relativePath } = url; const pieces = url.path.split("/"); let pointer = 1; let positive = 0; let addTrailingSlash = false; for (let i = 1; i < pieces.length; i++) { const piece = pieces[i]; if (!piece) { addTrailingSlash = true; continue; } addTrailingSlash = false; if (piece === ".") continue; if (piece === "..") { if (positive) { addTrailingSlash = true; positive--; pointer--; } else if (relativePath) { pieces[pointer++] = piece; } continue; } pieces[pointer++] = piece; positive++; } let path = ""; for (let i = 1; i < pointer; i++) { path += "/" + pieces[i]; } if (!path || addTrailingSlash && !path.endsWith("/..")) { path += "/"; } url.path = path; } function resolve$1(input, base) { if (!input && !base) return ""; const url = parseUrl(input); if (base && !url.scheme) { const baseUrl = parseUrl(base); url.scheme = baseUrl.scheme; if (!url.host) { url.user = baseUrl.user; url.host = baseUrl.host; url.port = baseUrl.port; } mergePaths(url, baseUrl); } normalizePath(url); if (url.relativePath) { const path = url.path.slice(1); if (!path) return "."; const keepRelative = (base || input).startsWith("."); return !keepRelative || path.startsWith(".") ? path : "./" + path; } if (!url.scheme && !url.host) return url.path; return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`; } function resolve(input, base) { if (base && !base.endsWith("/")) base += "/"; return resolve$1(input, base); } function stripFilename(path) { if (!path) return ""; const index = path.lastIndexOf("/"); return path.slice(0, index + 1); } const COLUMN$1 = 0; const SOURCES_INDEX$1 = 1; const SOURCE_LINE$1 = 2; const SOURCE_COLUMN$1 = 3; const NAMES_INDEX$1 = 4; function maybeSort(mappings, owned) { const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); if (unsortedIndex === mappings.length) return mappings; if (!owned) mappings = mappings.slice(); for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { mappings[i] = sortSegments(mappings[i], owned); } return mappings; } function nextUnsortedSegmentLine(mappings, start) { for (let i = start; i < mappings.length; i++) { if (!isSorted(mappings[i])) return i; } return mappings.length; } function isSorted(line) { for (let j = 1; j < line.length; j++) { if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { return false; } } return true; } function sortSegments(line, owned) { if (!owned) line = line.slice(); return line.sort(sortComparator); } function sortComparator(a, b) { return a[COLUMN$1] - b[COLUMN$1]; } let found = false; function binarySearch(haystack, needle, low, high) { while (low <= high) { const mid = low + (high - low >> 1); const cmp = haystack[mid][COLUMN$1] - needle; if (cmp === 0) { found = true; return mid; } if (cmp < 0) { low = mid + 1; } else { high = mid - 1; } } found = false; return low - 1; } function upperBound(haystack, needle, index) { for (let i = index + 1; i < haystack.length; i++, index++) { if (haystack[i][COLUMN$1] !== needle) break; } return index; } function lowerBound(haystack, needle, index) { for (let i = index - 1; i >= 0; i--, index--) { if (haystack[i][COLUMN$1] !== needle) break; } return index; } function memoizedState() { return { lastKey: -1, lastNeedle: -1, lastIndex: -1 }; } function memoizedBinarySearch(haystack, needle, state, key) { const { lastKey, lastNeedle, lastIndex } = state; let low = 0; let high = haystack.length - 1; if (key === lastKey) { if (needle === lastNeedle) { found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; return lastIndex; } if (needle >= lastNeedle) { low = lastIndex === -1 ? 0 : lastIndex; } else { high = lastIndex; } } state.lastKey = key; state.lastNeedle = needle; return state.lastIndex = binarySearch(haystack, needle, low, high); } const AnyMap = function(map, mapUrl) { const parsed = typeof map === "string" ? JSON.parse(map) : map; if (!("sections" in parsed)) return new TraceMap(parsed, mapUrl); const mappings = []; const sources = []; const sourcesContent = []; const names = []; const { sections } = parsed; let i = 0; for (; i < sections.length - 1; i++) { const no = sections[i + 1].offset; addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); } if (sections.length > 0) { addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); } const joined = { version: 3, file: parsed.file, names, sources, sourcesContent, mappings }; return presortedDecodedMap(joined); }; function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { const map = AnyMap(section.map, mapUrl); const { line: lineOffset, column: columnOffset } = section.offset; const sourcesOffset = sources.length; const namesOffset = names.length; const decoded = decodedMappings(map); const { resolvedSources } = map; append(sources, resolvedSources); append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); append(names, map.names); for (let i = mappings.length; i <= lineOffset; i++) mappings.push([]); const stopI = stopLine - lineOffset; const len = Math.min(decoded.length, stopI + 1); for (let i = 0; i < len; i++) { const line = decoded[i]; const out = i === 0 ? mappings[lineOffset] : mappings[lineOffset + i] = []; const cOffset = i === 0 ? columnOffset : 0; for (let j = 0; j < line.length; j++) { const seg = line[j]; const column = cOffset + seg[COLUMN$1]; if (i === stopI && column >= stopColumn) break; if (seg.length === 1) { out.push([column]); continue; } const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1]; const sourceLine = seg[SOURCE_LINE$1]; const sourceColumn = seg[SOURCE_COLUMN$1]; if (seg.length === 4) { out.push([column, sourcesIndex, sourceLine, sourceColumn]); continue; } out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]); } } } function append(arr, other) { for (let i = 0; i < other.length; i++) arr.push(other[i]); } function fillSourcesContent(len) { const sourcesContent = []; for (let i = 0; i < len; i++) sourcesContent[i] = null; return sourcesContent; } const INVALID_ORIGINAL_MAPPING = Object.freeze({ source: null, line: null, column: null, name: null }); Object.freeze({ line: null, column: null }); const LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; const COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; const LEAST_UPPER_BOUND = -1; const GREATEST_LOWER_BOUND = 1; let decodedMappings; let originalPositionFor; let presortedDecodedMap; class TraceMap { constructor(map, mapUrl) { this._decodedMemo = memoizedState(); this._bySources = void 0; this._bySourceMemos = void 0; const isString = typeof map === "string"; if (!isString && map.constructor === TraceMap) return map; const parsed = isString ? JSON.parse(map) : map; const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; this.version = version; this.file = file; this.names = names; this.sourceRoot = sourceRoot; this.sources = sources; this.sourcesContent = sourcesContent; if (sourceRoot || mapUrl) { const from = resolve(sourceRoot || "", stripFilename(mapUrl)); this.resolvedSources = sources.map((s) => resolve(s || "", from)); } else { this.resolvedSources = sources.map((s) => s || ""); } const { mappings } = parsed; if (typeof mappings === "string") { this._encoded = mappings; this._decoded = void 0; } else { this._encoded = void 0; this._decoded = maybeSort(mappings, isString); } } } (() => { decodedMappings = (map) => { return map._decoded || (map._decoded = decode(map._encoded)); }; originalPositionFor = (map, { line, column, bias }) => { line--; if (line < 0) throw new Error(LINE_GTR_ZERO); if (column < 0) throw new Error(COL_GTR_EQ_ZERO); const decoded = decodedMappings(map); if (line >= decoded.length) return INVALID_ORIGINAL_MAPPING; const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); if (segment == null) return INVALID_ORIGINAL_MAPPING; if (segment.length == 1) return INVALID_ORIGINAL_MAPPING; const { names, resolvedSources } = map; return { source: resolvedSources[segment[SOURCES_INDEX$1]], line: segment[SOURCE_LINE$1] + 1, column: segment[SOURCE_COLUMN$1], name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null }; }; presortedDecodedMap = (map, mapUrl) => { const clone = Object.assign({}, map); clone.mappings = []; const tracer = new TraceMap(clone, mapUrl); tracer._decoded = map.mappings; return tracer; }; })(); function traceSegmentInternal(segments, memo, line, column, bias) { let index = memoizedBinarySearch(segments, column, memo, line); if (found) { index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); } else if (bias === LEAST_UPPER_BOUND) index++; if (index === -1 || index === segments.length) return null; return segments[index]; } let get; let put; class SetArray { constructor() { this._indexes = { __proto__: null }; this.array = []; } } (() => { get = (strarr, key) => strarr._indexes[key]; put = (strarr, key) => { const index = get(strarr, key); if (index !== void 0) return index; const { array, _indexes: indexes } = strarr; return indexes[key] = array.push(key) - 1; }; })(); const COLUMN = 0; const SOURCES_INDEX = 1; const SOURCE_LINE = 2; const SOURCE_COLUMN = 3; const NAMES_INDEX = 4; const NO_NAME = -1; let maybeAddMapping; let setSourceContent; let toDecodedMap; let toEncodedMap; let addSegmentInternal; class GenMapping { constructor({ file, sourceRoot } = {}) { this._names = new SetArray(); this._sources = new SetArray(); this._sourcesContent = []; this._mappings = []; this.file = file; this.sourceRoot = sourceRoot; } } (() => { maybeAddMapping = (map, mapping) => { return addMappingInternal(true, map, mapping); }; setSourceContent = (map, source, content) => { const { _sources: sources, _sourcesContent: sourcesContent } = map; sourcesContent[put(sources, source)] = content; }; toDecodedMap = (map) => { const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = map; removeEmptyFinalLines(mappings); return { version: 3, file: file || void 0, names: names.array, sourceRoot: sourceRoot || void 0, sources: sources.array, sourcesContent, mappings }; }; toEncodedMap = (map) => { const decoded = toDecodedMap(map); return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); }; addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = map; const line = getLine(mappings, genLine); const index = getColumnIndex(line, genColumn); if (!source) { if (skipable && skipSourceless(line, index)) return; return insert(line, index, [genColumn]); } const sourcesIndex = put(sources, source); const namesIndex = name ? put(names, name) : NO_NAME; if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = null; if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { return; } return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]); }; })(); function getLine(mappings, index) { for (let i = mappings.length; i <= index; i++) { mappings[i] = []; } return mappings[index]; } function getColumnIndex(line, genColumn) { let index = line.length; for (let i = index - 1; i >= 0; index = i--) { const current = line[i]; if (genColumn >= current[COLUMN]) break; } return index; } function insert(array, index, value) { for (let i = array.length; i > index; i--) { array[i] = array[i - 1]; } array[index] = value; } function removeEmptyFinalLines(mappings) { const { length } = mappings; let len = length; for (let i = len - 1; i >= 0; len = i, i--) { if (mappings[i].length > 0) break; } if (len < length) mappings.length = len; } function skipSourceless(line, index) { if (index === 0) return true; const prev = line[index - 1]; return prev.length === 1; } function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { if (index === 0) return false; const prev = line[index - 1]; if (prev.length === 1) return false; return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); } function addMappingInternal(skipable, map, mapping) { const { generated, source, original, name } = mapping; if (!source) { return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null); } const s = source; return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name); } class SourceMapConsumer { constructor(map, mapUrl) { const trace = this._map = new AnyMap(map, mapUrl); this.file = trace.file; this.names = trace.names; this.sourceRoot = trace.sourceRoot; this.sources = trace.resolvedSources; this.sourcesContent = trace.sourcesContent; } originalPositionFor(needle) { return originalPositionFor(this._map, needle); } destroy() { } } class SourceMapGenerator { constructor(opts) { this._map = new GenMapping(opts); } addMapping(mapping) { maybeAddMapping(this._map, mapping); } setSourceContent(source, content) { setSourceContent(this._map, source, content); } toJSON() { return toEncodedMap(this._map); } toDecodedMap() { return toDecodedMap(this._map); } } exports2.SourceMapConsumer = SourceMapConsumer; exports2.SourceMapGenerator = SourceMapGenerator; Object.defineProperty(exports2, "__esModule", { value: true }); }); } }); // node_modules/acorn/dist/acorn.js var require_acorn = __commonJS({ "node_modules/acorn/dist/acorn.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.acorn = {})); })(exports, function(exports2) { "use strict"; 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, 370, 1, 81, 2, 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, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 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, 406, 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, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 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, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; 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, 68, 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, 349, 41, 7, 1, 79, 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, 159, 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, 264, 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, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 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, 757, 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, 3104, 541, 1507, 4938, 6, 4191]; 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\u0898-\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\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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"; 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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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"; 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" }; 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)?$/; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); function isInAstralSet(code, set) { var pos = 65536; for (var i2 = 0; i2 < set.length; i2 += 2) { pos += set[i2]; if (pos > code) { return false; } pos += set[i2 + 1]; if (pos >= code) { return true; } } return false; } 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 <= 65535) { return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); } if (astral === false) { return false; } return isInAstralSet(code, astralIdentifierStartCodes); } 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 <= 65535) { return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); } if (astral === false) { return false; } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } var TokenType = function TokenType2(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 }; var keywords = {}; 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"), 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 }), 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), _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 }) }; var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { return code === 10 || code === 13 || code === 8232 || code === 8233; } function nextLineBreak(code, from, end) { if (end === void 0) end = code.length; for (var i2 = from; i2 < end; i2++) { var next = code.charCodeAt(i2); if (isNewLine(next)) { return i2 < end - 1 && next === 13 && code.charCodeAt(i2 + 1) === 10 ? i2 + 2 : i2 + 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]"; }; function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); } function codePointToString(code) { if (code <= 65535) { return String.fromCharCode(code); } code -= 65536; return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); } var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; var Position = function Position2(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 SourceLocation2(p, start, end) { this.start = start; this.end = end; if (p.sourceFile !== null) { this.source = p.sourceFile; } }; 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; } } var defaultOptions2 = { ecmaVersion: null, sourceType: "script", onInsertedSemicolon: null, onTrailingComma: null, allowReserved: null, allowReturnOutsideFunction: false, allowImportExportEverywhere: false, allowAwaitOutsideFunction: null, allowSuperOutsideMethod: null, allowHashBang: false, checkPrivateFields: true, locations: false, onToken: null, onComment: null, ranges: false, program: null, sourceFile: null, directSourceFile: null, preserveParens: false }; var warnedAboutEcmaVersion = false; function getOptions(opts) { var options = {}; for (var opt in defaultOptions2) { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions2[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, end }; if (options.locations) { comment.loc = new SourceLocation(this, startLoc, endLoc); } if (options.ranges) { comment.range = [start, end]; } array.push(comment); }; } 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); } var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5; var Parser = function Parser2(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); this.containsEsc = false; 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; } this.type = types$1.eof; this.value = null; this.start = this.end = this.pos; this.startLoc = this.endLoc = this.curPosition(); this.lastTokEndLoc = this.lastTokStartLoc = null; this.lastTokStart = this.lastTokEnd = this.pos; this.context = this.initialContext(); this.exprAllowed = true; this.inModule = options.sourceType === "module"; this.strict = this.inModule || this.strictDirective(this.pos); this.potentialArrowAt = -1; this.potentialArrowInForAwait = false; this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; this.labels = []; this.undefinedExports = /* @__PURE__ */ Object.create(null); if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { this.skipLineComment(2); } this.scopeStack = []; this.enterScope(SCOPE_TOP); this.regexpState = null; 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 parse2() { 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 i2 = this.scopeStack.length - 1; i2 >= 0; i2--) { var scope = this.scopeStack[i2]; 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 ref2 = this.currentThisScope(); var flags = ref2.flags; var inClassFieldInit = ref2.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 ref2 = this.currentThisScope(); var flags = ref2.flags; var inClassFieldInit = ref2.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 i2 = 0; i2 < plugins.length; i2++) { cls = plugins[i2](cls); } return cls; }; Parser.parse = function parse2(input, options) { return new this(options, input).parse(); }; Parser.parseExpressionAt = function parseExpressionAt2(input, pos, options) { var parser = new this(options, input, pos); parser.nextToken(); return parser.parseExpression(); }; Parser.tokenizer = function tokenizer2(input, options) { return new this(options, input); }; Object.defineProperties(Parser.prototype, prototypeAccessors); var pp$9 = Parser.prototype; var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; pp$9.strictDirective = function(start) { if (this.options.ecmaVersion < 5) { return false; } for (; ; ) { 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; skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this.input)[0].length; if (this.input[start] === ";") { start++; } } }; pp$9.eat = function(type) { if (this.type === type) { this.next(); return true; } else { return false; } }; pp$9.isContextual = function(name) { return this.type === types$1.name && this.value === name && !this.containsEsc; }; pp$9.eatContextual = function(name) { if (!this.isContextual(name)) { return false; } this.next(); return true; }; pp$9.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; 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; } }; 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; } }; pp$9.expect = function(type) { this.eat(type) || this.unexpected(); }; pp$9.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; var DestructuringErrors = function DestructuringErrors2() { 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; pp$8.parseTopLevel = function(node) { var exports3 = /* @__PURE__ */ Object.create(null); if (!node.body) { node.body = []; } while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports3); node.body.push(stmt); } if (this.inModule) { for (var i2 = 0, list2 = Object.keys(this.undefinedExports); i2 < list2.length; i2 += 1) { var name = list2[i2]; 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); if (nextCh === 91 || nextCh === 92) { return true; } if (context) { return false; } if (nextCh === 123 || nextCh > 55295 && nextCh < 56320) { return true; } if (isIdentifierStart(nextCh, true)) { var pos = next + 1; while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { return true; } var ident = this.input.slice(next, pos); if (!keywordRelationalOperator.test(ident)) { return true; } } return false; }; 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 > 55295 && after < 56320)); }; pp$8.parseStatement = function(context, topLevel, exports3) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { starttype = types$1._var; kind = "let"; } 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: 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) { 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, exports3); 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(); } var i2 = 0; for (; i2 < this.labels.length; ++i2) { var lab = this.labels[i2]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) { break; } if (node.label && isBreak) { break; } } } if (i2 === 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"); }; 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 refDestructuringErrors = new DestructuringErrors(); var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } 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(); 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(); 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); 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(); 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"); }; 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, list2 = this.labels; i$1 < list2.length; i$1 += 1) { var label = list2[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 i2 = this.labels.length - 1; i2 >= 0; i2--) { var label$1 = this.labels[i2]; if (label$1.statementStart === node.start) { label$1.statementStart = this.start; label$1.kind = kind; } else { break; } } this.labels.push({ name: maybeName, 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"); }; 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"); }; 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"); }; 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"); }; 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; 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)) { 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(); }; pp$8.parseClass = function(node, isStatement) { this.next(); 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 ecmaVersion2 = 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")) { if (ecmaVersion2 >= 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 && ecmaVersion2 >= 8 && this.eatContextual("async")) { if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { isAsync = true; } else { keyName = "async"; } } if (!keyName && (ecmaVersion2 >= 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; } } } if (keyName) { node.computed = false; node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); node.key.name = keyName; this.finishNode(node.key, "Identifier"); } else { this.parseClassElementName(node); } if (ecmaVersion2 < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { var isConstructor = !node.static && checkKeyName(node, "constructor"); var allowsDirectSuper = isConstructor && constructorAllowsSuper; 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) { 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"); } var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); 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)) { 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: /* @__PURE__ */ Object.create(null), used: [] }; this.privateNameStack.push(element); return element.declared; }; pp$8.exitClassBody = function() { var ref2 = this.privateNameStack.pop(); var declared = ref2.declared; var used = ref2.used; if (!this.options.checkPrivateFields) { return; } var len = this.privateNameStack.length; var parent = len === 0 ? null : this.privateNameStack[len - 1]; for (var i2 = 0; i2 < used.length; ++i2) { var id = used[i2]; 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; } 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); } pp$8.parseExportAllDeclaration = function(node, exports3) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { node.exported = this.parseModuleExportName(); this.checkExport(exports3, node.exported, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration"); }; pp$8.parseExport = function(node, exports3) { this.next(); if (this.eat(types$1.star)) { return this.parseExportAllDeclaration(node, exports3); } if (this.eat(types$1._default)) { this.checkExport(exports3, "default", this.lastTokStart); node.declaration = this.parseExportDefaultDeclaration(); return this.finishNode(node, "ExportDefaultDeclaration"); } if (this.shouldParseExportStatement()) { node.declaration = this.parseExportDeclaration(node); if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports3, node.declaration.declarations); } else { this.checkExport(exports3, node.declaration.id, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports3); if (this.eatContextual("from")) { if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i2 = 0, list2 = node.specifiers; i2 < list2.length; i2 += 1) { var spec = list2[i2]; this.checkUnreserved(spec.local); 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(exports3, name, pos) { if (!exports3) { return; } if (typeof name !== "string") { name = name.type === "Identifier" ? name.name : name.value; } if (hasOwn(exports3, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports3[name] = true; }; pp$8.checkPatternExport = function(exports3, pat) { var type = pat.type; if (type === "Identifier") { this.checkExport(exports3, pat, pat.start); } else if (type === "ObjectPattern") { for (var i2 = 0, list2 = pat.properties; i2 < list2.length; i2 += 1) { var prop = list2[i2]; this.checkPatternExport(exports3, 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(exports3, elt); } } } else if (type === "Property") { this.checkPatternExport(exports3, pat.value); } else if (type === "AssignmentPattern") { this.checkPatternExport(exports3, pat.left); } else if (type === "RestElement") { this.checkPatternExport(exports3, pat.argument); } else if (type === "ParenthesizedExpression") { this.checkPatternExport(exports3, pat.expression); } }; pp$8.checkVariableExport = function(exports3, decls) { if (!exports3) { return; } for (var i2 = 0, list2 = decls; i2 < list2.length; i2 += 1) { var decl = list2[i2]; this.checkPatternExport(exports3, 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(); }; pp$8.parseExportSpecifier = function(exports3) { var node = this.startNode(); node.local = this.parseModuleExportName(); node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; this.checkExport(exports3, node.exported, node.exported.start); return this.finishNode(node, "ExportSpecifier"); }; pp$8.parseExportSpecifiers = function(exports3) { var nodes = [], first = true; 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(exports3)); } return nodes; }; pp$8.parseImport = function(node) { this.next(); 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(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration"); }; 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() { 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.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); }; pp$8.adaptDirectivePrologue = function(statements) { for (var i2 = 0; i2 < statements.length && this.isDirectiveCandidate(statements[i2]); ++i2) { statements[i2].directive = statements[i2].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" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); }; var pp$7 = Parser.prototype; 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 i2 = 0, list2 = node.properties; i2 < list2.length; i2 += 1) { var prop = list2[i2]; this.toAssignable(prop, isBinding); if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { this.raise(prop.argument.start, "Unexpected token"); } } break; case "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; }; pp$7.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i2 = 0; i2 < end; i2++) { var elt = exprList[i2]; if (elt) { this.toAssignable(elt, isBinding); } } if (end) { var last2 = exprList[end - 1]; if (this.options.ecmaVersion === 6 && isBinding && last2 && last2.type === "RestElement" && last2.argument.type !== "Identifier") { this.unexpected(last2.argument.start); } } return exprList; }; 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(); if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); }; 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; }; 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"); }; 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 i2 = 0, list2 = expr.properties; i2 < list2.length; i2 += 1) { var prop = list2[i2]; 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": 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); } }; var TokContext = function TokContext2(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; } 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 i2 = this.context.length - 1; i2 >= 1; i2--) { var context = this.context[i2]; 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; } }; pp$6.overrideContext = function(tokenCtx) { if (this.curContext() !== tokenCtx) { this.context[this.context.length - 1] = tokenCtx; } }; 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() { }; 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.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; }; var pp$5 = Parser.prototype; 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; }; 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; }; pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(forInit); } 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; } 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; }; 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; }; 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); }; 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) { 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"); }; 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" && node.argument.type === "Identifier") { 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(); 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 isPrivateFieldAccess(node) { return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); } 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; }; pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) { 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"); } 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(); if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } var meta = this.parseIdent(true); if (this.type === types$1.parenL && !forNew) { return this.parseDynamicImport(node); } else if (this.type === types$1.dot) { node.meta = meta; return this.parseImportMeta(node); } else { this.unexpected(); } }; pp$5.parseDynamicImport = function(node) { this.next(); node.source = this.parseMaybeAssign(); 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(); 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; 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); }; var empty = []; pp$5.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; 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"); }; pp$5.parseTemplateElement = function(ref2) { var isTagged = ref2.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, 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(ref2) { if (ref2 === void 0) ref2 = {}; var isTagged = ref2.isTagged; if (isTagged === void 0) isTagged = false; var node = this.startNode(); this.next(); node.expressions = []; var curElt = this.parseTemplateElement({ 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 })); } 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)); }; 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"); } prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } 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"); }; 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; } }; 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"); }; 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"); }; 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 (useStrict && nonSimple) { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } } var oldLabels = this.labels; this.labels = []; if (useStrict) { this.strict = true; } this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); node.expression = false; this.adaptDirectivePrologue(node.body.body); this.labels = oldLabels; } this.exitScope(); }; pp$5.isSimpleParamList = function(params) { for (var i2 = 0, list2 = params; i2 < list2.length; i2 += 1) { var param = list2[i2]; if (param.type !== "Identifier") { return false; } } return true; }; pp$5.checkParams = function(node, allowDuplicates) { var nameHash = /* @__PURE__ */ Object.create(null); for (var i2 = 0, list2 = node.params; i2 < list2.length; i2 += 1) { var param = list2[i2]; this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; 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(ref2) { var start = ref2.start; var end = ref2.end; var name = ref2.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"); } }; 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; if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { this.context.pop(); } } 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"); 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; }; 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; 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 Scope2(flags) { this.flags = flags; this.var = []; this.lexical = []; this.functions = []; this.inClassFieldInit = false; }; pp$3.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; pp$3.exitScope = function() { this.scopeStack.pop(); }; 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 i2 = this.scopeStack.length - 1; i2 >= 0; --i2) { var scope$3 = this.scopeStack[i2]; 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) { 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 i2 = this.scopeStack.length - 1; ; i2--) { var scope = this.scopeStack[i2]; if (scope.flags & SCOPE_VAR) { return scope; } } }; pp$3.currentThisScope = function() { for (var i2 = this.scopeStack.length - 1; ; i2--) { var scope = this.scopeStack[i2]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope; } } }; var Node2 = function Node3(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]; } }; var pp$2 = Parser.prototype; pp$2.startNode = function() { return new Node2(this, this.start, this.startLoc); }; pp$2.startNodeAt = function(pos, loc) { return new Node2(this, pos, loc); }; 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); }; pp$2.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc); }; pp$2.copyNode = function(node) { var newNode = new Node2(this, node.start, this.startLoc); for (var prop in node) { newNode[prop] = node[prop]; } return newNode; }; 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 }; 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 }; 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"; 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 + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, 12: ecma12ScriptValues, 13: ecma13ScriptValues, 14: ecma14ScriptValues }; var data = {}; function buildUnicodeData(ecmaVersion2) { var d = data[ecmaVersion2] = { binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion2] + " " + unicodeGeneralCategoryValues), binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion2]), nonBinary: { General_Category: wordsRegexp(unicodeGeneralCategoryValues), Script: wordsRegexp(unicodeScriptValues[ecmaVersion2]) } }; 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; var RegExpValidationState = function RegExpValidationState2(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 = []; this.backReferenceNames = []; }; 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); }; RegExpValidationState.prototype.at = function at(i2, forceU) { if (forceU === void 0) forceU = false; var s = this.source; var l = s.length; if (i2 >= l) { return -1; } var c = s.charCodeAt(i2); if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l) { return c; } var next = s.charCodeAt(i2 + 1); return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; }; RegExpValidationState.prototype.nextIndex = function nextIndex(i2, forceU) { if (forceU === void 0) forceU = false; var s = this.source; var l = s.length; if (i2 >= l) { return l; } var c = s.charCodeAt(i2), next; if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l || (next = s.charCodeAt(i2 + 1)) < 56320 || next > 57343) { return i2 + 1; } return i2 + 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 i2 = 0, list2 = chs; i2 < list2.length; i2 += 1) { var ch = list2[i2]; var current = this.at(pos, forceU); if (current === -1 || current !== ch) { return false; } pos = this.nextIndex(pos, forceU); } this.pos = pos; return true; }; pp$1.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; var u = false; var v = false; for (var i2 = 0; i2 < flags.length; i2++) { var flag = flags.charAt(i2); if (validFlags.indexOf(flag) === -1) { this.raise(state.start, "Invalid regular expression flag"); } if (flags.indexOf(flag, i2 + 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"); } }; pp$1.validateRegExpPattern = function(state) { this.regexp_pattern(state); if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { state.switchN = true; this.regexp_pattern(state); } }; 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.length = 0; state.backReferenceNames.length = 0; this.regexp_disjunction(state); if (state.pos !== state.source.length) { if (state.eat(41)) { state.raise("Unmatched ')'"); } if (state.eat(93) || state.eat(125)) { state.raise("Lone quantifier brackets"); } } if (state.maxBackReference > state.numCapturingParens) { state.raise("Invalid escape"); } for (var i2 = 0, list2 = state.backReferenceNames; i2 < list2.length; i2 += 1) { var name = list2[i2]; if (state.groupNames.indexOf(name) === -1) { state.raise("Invalid named capture referenced"); } } }; pp$1.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(124)) { this.regexp_alternative(state); } if (this.regexp_eatQuantifier(state, true)) { state.raise("Nothing to repeat"); } if (state.eat(123)) { state.raise("Lone quantifier brackets"); } }; pp$1.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; pp$1.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { 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; }; pp$1.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; if (state.eat(94) || state.eat(36)) { return true; } if (state.eat(92)) { if (state.eat(66) || state.eat(98)) { return true; } state.pos = start; } if (state.eat(40) && state.eat(63)) { var lookbehind = false; if (this.options.ecmaVersion >= 9) { lookbehind = state.eat(60); } if (state.eat(61) || state.eat(33)) { this.regexp_disjunction(state); if (!state.eat(41)) { state.raise("Unterminated group"); } state.lastAssertionIsQuantifiable = !lookbehind; return true; } } state.pos = start; return false; }; pp$1.regexp_eatQuantifier = function(state, noError) { if (noError === void 0) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { state.eat(63); return true; } return false; }; pp$1.regexp_eatQuantifierPrefix = function(state, noError) { return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); }; pp$1.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(123)) { var min = 0, max = -1; if (this.regexp_eatDecimalDigits(state)) { min = state.lastIntValue; if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { max = state.lastIntValue; } if (state.eat(125)) { 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; }; pp$1.regexp_eatAtom = function(state) { return this.regexp_eatPatternCharacters(state) || state.eat(46) || 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(92)) { 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(40)) { if (state.eat(63) && state.eat(58)) { this.regexp_disjunction(state); if (state.eat(41)) { return true; } state.raise("Unterminated group"); } state.pos = start; } return false; }; pp$1.regexp_eatCapturingGroup = function(state) { if (state.eat(40)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); } else if (state.current() === 63) { state.raise("Invalid group"); } this.regexp_disjunction(state); if (state.eat(41)) { state.numCapturingParens += 1; return true; } state.raise("Unterminated group"); } return false; }; pp$1.regexp_eatExtendedAtom = function(state) { return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); }; pp$1.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } return false; }; 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 === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; } 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; }; pp$1.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { state.advance(); return true; } return false; }; pp$1.regexp_groupSpecifier = function(state) { if (state.eat(63)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { state.raise("Duplicate capture group name"); } state.groupNames.push(state.lastStringValue); return; } state.raise("Invalid group"); } }; pp$1.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(60)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { return true; } state.raise("Invalid capture group name"); } return false; }; 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; }; 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 === 92 && 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 === 36 || ch === 95; } 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 === 92 && 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 === 36 || ch === 95 || ch === 8204 || ch === 8205; } 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) { if (state.current() === 99) { 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) { 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(107)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); return true; } state.raise("Invalid named reference"); } return false; }; 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(99)) { if (this.regexp_eatControlLetter(state)) { return true; } state.pos = start; } return false; }; pp$1.regexp_eatZero = function(state) { if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); return true; } return false; }; pp$1.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 116) { state.lastIntValue = 9; state.advance(); return true; } if (ch === 110) { state.lastIntValue = 10; state.advance(); return true; } if (ch === 118) { state.lastIntValue = 11; state.advance(); return true; } if (ch === 102) { state.lastIntValue = 12; state.advance(); return true; } if (ch === 114) { state.lastIntValue = 13; state.advance(); return true; } return false; }; pp$1.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 32; state.advance(); return true; } return false; }; function isControlLetter(ch) { return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; } 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(117)) { if (this.regexp_eatFixedHexDigits(state, 4)) { var lead = state.lastIntValue; if (switchU && lead >= 55296 && lead <= 56319) { var leadSurrogateEnd = state.pos; if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { var trail = state.lastIntValue; if (trail >= 56320 && trail <= 57343) { state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; return true; } } state.pos = leadSurrogateEnd; state.lastIntValue = lead; } return true; } if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode(state.lastIntValue)) { return true; } if (switchU) { state.raise("Invalid unicode escape"); } state.pos = start; } return false; }; function isValidUnicode(ch) { return ch >= 0 && ch <= 1114111; } pp$1.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true; } if (state.eat(47)) { state.lastIntValue = 47; return true; } return false; } var ch = state.current(); if (ch !== 99 && (!state.switchN || ch !== 107)) { state.lastIntValue = ch; state.advance(); return true; } return false; }; pp$1.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 49 && ch <= 57) { do { state.lastIntValue = 10 * state.lastIntValue + (ch - 48); state.advance(); } while ((ch = state.current()) >= 48 && ch <= 57); return true; } return false; }; var CharSetNone = 0; var CharSetOk = 1; var CharSetString = 2; 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 === 80) || ch === 112)) { state.lastIntValue = -1; state.advance(); var result; if (state.eat(123) && (result = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat(125)) { if (negate && result === CharSetString) { state.raise("Invalid property name"); } return result; } state.raise("Invalid property name"); } return CharSetNone; }; function isCharacterClassEscape(ch) { return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; } pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { var name = state.lastStringValue; if (this.regexp_eatUnicodePropertyValue(state)) { var value = state.lastStringValue; this.regexp_validateUnicodePropertyNameAndValue(state, name, value); return CharSetOk; } } state.pos = start; 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"); }; 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 === 95; } 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); } pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state); }; pp$1.regexp_eatCharacterClass = function(state) { if (state.eat(91)) { var negate = state.eat(94); var result = this.regexp_classContents(state); if (!state.eat(93)) { state.raise("Unterminated character class"); } if (negate && result === CharSetString) { state.raise("Negated character class may contain strings"); } return true; } return false; }; pp$1.regexp_classContents = function(state) { if (state.current() === 93) { return CharSetOk; } if (state.switchV) { return this.regexp_classSetExpression(state); } this.regexp_nonEmptyClassRanges(state); return CharSetOk; }; pp$1.regexp_nonEmptyClassRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(45) && 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"); } } } }; pp$1.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(92)) { if (this.regexp_eatClassEscape(state)) { return true; } if (state.switchU) { var ch$1 = state.current(); if (ch$1 === 99 || isOctalDigit(ch$1)) { state.raise("Invalid class escape"); } state.raise("Invalid escape"); } state.pos = start; } var ch = state.current(); if (ch !== 93) { state.lastIntValue = ch; state.advance(); return true; } return false; }; pp$1.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(98)) { state.lastIntValue = 8; return true; } if (state.switchU && state.eat(45)) { state.lastIntValue = 45; return true; } if (!state.switchU && state.eat(99)) { if (this.regexp_eatClassControlLetter(state)) { return true; } state.pos = start; } return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); }; 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; } var start = state.pos; while (state.eatChars([38, 38])) { if (state.current() !== 38 && (subResult = this.regexp_eatClassSetOperand(state))) { if (subResult !== CharSetString) { result = CharSetOk; } continue; } state.raise("Invalid character in character class"); } if (start !== state.pos) { return result; } while (state.eatChars([45, 45])) { 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"); } for (; ; ) { if (this.regexp_eatClassSetRange(state)) { continue; } subResult = this.regexp_eatClassSetOperand(state); if (!subResult) { return result; } if (subResult === CharSetString) { result = CharSetString; } } }; pp$1.regexp_eatClassSetRange = function(state) { var start = state.pos; if (this.regexp_eatClassSetCharacter(state)) { var left = state.lastIntValue; if (state.eat(45) && 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; }; pp$1.regexp_eatClassSetOperand = function(state) { if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk; } return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state); }; pp$1.regexp_eatNestedClass = function(state) { var start = state.pos; if (state.eat(91)) { var negate = state.eat(94); var result = this.regexp_classContents(state); if (state.eat(93)) { if (negate && result === CharSetString) { state.raise("Negated character class may contain strings"); } return result; } state.pos = start; } if (state.eat(92)) { var result$1 = this.regexp_eatCharacterClassEscape(state); if (result$1) { return result$1; } state.pos = start; } return null; }; pp$1.regexp_eatClassStringDisjunction = function(state) { var start = state.pos; if (state.eatChars([92, 113])) { if (state.eat(123)) { var result = this.regexp_classStringDisjunctionContents(state); if (state.eat(125)) { return result; } } else { state.raise("Invalid escape"); } state.pos = start; } return null; }; pp$1.regexp_classStringDisjunctionContents = function(state) { var result = this.regexp_classString(state); while (state.eat(124)) { if (this.regexp_classString(state) === CharSetString) { result = CharSetString; } } return result; }; pp$1.regexp_classString = function(state) { var count = 0; while (this.regexp_eatClassSetCharacter(state)) { count++; } return count === 1 ? CharSetOk : CharSetString; }; pp$1.regexp_eatClassSetCharacter = function(state) { var start = state.pos; if (state.eat(92)) { if (this.regexp_eatCharacterEscape(state) || this.regexp_eatClassSetReservedPunctuator(state)) { return true; } if (state.eat(98)) { state.lastIntValue = 8; 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; }; function isClassSetReservedDoublePunctuatorCharacter(ch) { return ch === 33 || ch >= 35 && ch <= 38 || ch >= 42 && ch <= 44 || ch === 46 || ch >= 58 && ch <= 64 || ch === 94 || ch === 96 || ch === 126; } function isClassSetSyntaxCharacter(ch) { return ch === 40 || ch === 41 || ch === 45 || ch === 47 || ch >= 91 && ch <= 93 || ch >= 123 && ch <= 125; } pp$1.regexp_eatClassSetReservedPunctuator = function(state) { var ch = state.current(); if (isClassSetReservedPunctuator(ch)) { state.lastIntValue = ch; state.advance(); return true; } return false; }; function isClassSetReservedPunctuator(ch) { return ch === 33 || ch === 35 || ch === 37 || ch === 38 || ch === 44 || ch === 45 || ch >= 58 && ch <= 62 || ch === 64 || ch === 96 || ch === 126; } pp$1.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 95) { state.lastIntValue = ch % 32; state.advance(); return true; } return false; }; pp$1.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(120)) { if (this.regexp_eatFixedHexDigits(state, 2)) { return true; } if (state.switchU) { state.raise("Invalid escape"); } state.pos = start; } return false; }; 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 - 48); state.advance(); } return state.pos !== start; }; function isDecimalDigit(ch) { return ch >= 48 && ch <= 57; } 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 >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; } function hexToInt(ch) { if (ch >= 65 && ch <= 70) { return 10 + (ch - 65); } if (ch >= 97 && ch <= 102) { return 10 + (ch - 97); } return ch - 48; } 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; }; pp$1.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 48; state.advance(); return true; } state.lastIntValue = 0; return false; }; function isOctalDigit(ch) { return ch >= 48 && ch <= 55; } pp$1.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i2 = 0; i2 < length; ++i2) { var ch = state.current(); if (!isHexDigit(ch)) { state.pos = start; return false; } state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } return true; }; var Token = function Token2(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]; } }; var pp = Parser.prototype; 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 (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 }; } }; }; } 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) { 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 <= 55295 || code >= 56320) { return code; } var next = this.input.charCodeAt(this.pos + 1); return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; }; 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()); } }; 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; } } } }; 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); }; 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) { 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; 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)))) { 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) { 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 ecmaVersion2 = this.options.ecmaVersion; if (ecmaVersion2 >= 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 (ecmaVersion2 >= 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 ecmaVersion2 = this.options.ecmaVersion; var code = 35; if (ecmaVersion2 >= 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) { case 46: return this.readToken_dot(); 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: var next = this.input.charCodeAt(this.pos + 1); if (next === 120 || next === 88) { return this.readRadixNumber(16); } if (this.options.ecmaVersion >= 6) { if (next === 111 || next === 79) { return this.readRadixNumber(8); } if (next === 98 || next === 66) { return this.readRadixNumber(2); } } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: return this.readNumber(false); case 34: case 39: return this.readString(code); 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); } var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); state.reset(start, pattern, flags); this.validateRegExpFlags(state); this.validateRegExpPattern(state); var value = null; try { value = new RegExp(pattern, flags); } catch (e) { } return this.finishToken(types$1.regexp, { pattern, flags, value }); }; pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; var start = this.pos, total = 0, lastCode = 0; for (var i2 = 0, e = len == null ? Infinity : len; i2 < e; ++i2, ++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 (i2 === 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; } else if (code >= 65) { val = code - 65 + 10; } else if (code >= 48 && code <= 57) { val = code - 48; } 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); } return parseFloat(str.replace(/_/g, "")); } function stringToBigInt(str) { if (typeof BigInt !== "function") { return null; } return BigInt(str.replace(/_/g, "")); } pp.readRadixNumber = function(radix) { var start = this.pos; this.pos += 2; 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); }; pp.readNumber = function(startsWithDot) { var start = this.pos; if (!startsWithDot && this.readInt(10, void 0, 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) { 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); }; 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 > 1114111) { 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 === 8232 || ch === 8233) { 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); }; 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; } } }; 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; } case "`": return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); } } this.raise(this.start, "Unterminated template"); }; pp.readEscapedChar = function(inTemplate) { var ch = this.input.charCodeAt(++this.pos); ++this.pos; switch (ch) { case 110: return "\n"; case 114: return "\r"; case 120: return String.fromCharCode(this.readHexChar(2)); case 117: return codePointToString(this.readCodePoint()); case 116: return " "; case 98: return "\b"; case 118: return "\v"; case 102: return "\f"; case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } case 10: 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)) { return ""; } return String.fromCharCode(ch); } }; 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; }; 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 <= 65535 ? 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) { 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); }; 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); }; var version = "8.10.0"; Parser.acorn = { Parser, version, defaultOptions: defaultOptions2, Position, SourceLocation, getLineInfo, Node: Node2, TokenType, tokTypes: types$1, keywordTypes: keywords, TokContext, tokContexts: types, isIdentifierChar, isIdentifierStart, Token, isNewLine, lineBreak, lineBreakG, nonASCIIwhitespace }; function parse(input, options) { return Parser.parse(input, options); } function parseExpressionAt(input, pos, options) { return Parser.parseExpressionAt(input, pos, options); } function tokenizer(input, options) { return Parser.tokenizer(input, options); } exports2.Node = Node2; exports2.Parser = Parser; exports2.Position = Position; exports2.SourceLocation = SourceLocation; exports2.TokContext = TokContext; exports2.Token = Token; exports2.TokenType = TokenType; exports2.defaultOptions = defaultOptions2; exports2.getLineInfo = getLineInfo; exports2.isIdentifierChar = isIdentifierChar; exports2.isIdentifierStart = isIdentifierStart; exports2.isNewLine = isNewLine; exports2.keywordTypes = keywords; exports2.lineBreak = lineBreak; exports2.lineBreakG = lineBreakG; exports2.nonASCIIwhitespace = nonASCIIwhitespace; exports2.parse = parse; exports2.parseExpressionAt = parseExpressionAt; exports2.tokContexts = types; exports2.tokTypes = types$1; exports2.tokenizer = tokenizer; exports2.version = version; }); } }); // node_modules/terser/dist/bundle.min.js var require_bundle_min = __commonJS({ "node_modules/terser/dist/bundle.min.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports, require_source_map_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/source-map"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.Terser = {}, global2.sourceMap)); })(exports, function(exports2, sourceMap) { "use strict"; function characters(str) { return str.split(""); } function member(name, array) { return array.includes(name); } class DefaultsError extends Error { constructor(msg, defs) { super(); this.name = "DefaultsError"; this.message = msg; this.defs = defs; } } function defaults(args, defs, croak) { if (args === true) { args = {}; } else if (args != null && typeof args === "object") { args = { ...args }; } const ret = args || {}; if (croak) { for (const i in ret) if (HOP(ret, i) && !HOP(defs, i)) { throw new DefaultsError("`" + i + "` is not a supported option", defs); } } for (const i in defs) if (HOP(defs, i)) { if (!args || !HOP(args, i)) { ret[i] = defs[i]; } else if (i === "ecma") { let ecma = args[i] | 0; if (ecma > 5 && ecma < 2015) ecma += 2009; ret[i] = ecma; } else { ret[i] = args && HOP(args, i) ? args[i] : defs[i]; } } return ret; } function noop() { } function return_false() { return false; } function return_true() { return true; } function return_this() { return this; } function return_null() { return null; } var MAP = function() { function MAP2(a, tw, allow_splicing = true) { const new_a = []; for (let i = 0; i < a.length; ++i) { let item = a[i]; let ret = item.transform(tw, allow_splicing); if (ret instanceof AST_Node) { new_a.push(ret); } else if (ret instanceof Splice) { new_a.push(...ret.v); } } return new_a; } MAP2.splice = function(val) { return new Splice(val); }; MAP2.skip = {}; function Splice(val) { this.v = val; } return MAP2; }(); function make_node(ctor, orig, props) { if (!props) props = {}; if (orig) { if (!props.start) props.start = orig.start; if (!props.end) props.end = orig.end; } return new ctor(props); } function push_uniq(array, el) { if (!array.includes(el)) array.push(el); } function string_template(text, props) { return text.replace(/{(.+?)}/g, function(str, p) { return props && props[p]; }); } function remove2(array, el) { for (var i = array.length; --i >= 0; ) { if (array[i] === el) array.splice(i, 1); } } function mergeSort(array, cmp) { if (array.length < 2) return array.slice(); function merge2(a, b) { var r = [], ai = 0, bi = 0, i = 0; while (ai < a.length && bi < b.length) { cmp(a[ai], b[bi]) <= 0 ? r[i++] = a[ai++] : r[i++] = b[bi++]; } if (ai < a.length) r.push.apply(r, a.slice(ai)); if (bi < b.length) r.push.apply(r, b.slice(bi)); return r; } function _ms(a) { if (a.length <= 1) return a; var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); left = _ms(left); right = _ms(right); return merge2(left, right); } return _ms(array); } function makePredicate(words) { if (!Array.isArray(words)) words = words.split(" "); return new Set(words.sort()); } function map_add(map, key, value) { if (map.has(key)) { map.get(key).push(value); } else { map.set(key, [value]); } } function map_from_object(obj) { var map = /* @__PURE__ */ new Map(); for (var key in obj) { if (HOP(obj, key) && key.charAt(0) === "$") { map.set(key.substr(1), obj[key]); } } return map; } function map_to_object(map) { var obj = /* @__PURE__ */ Object.create(null); map.forEach(function(value, key) { obj["$" + key] = value; }); return obj; } function HOP(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } function keep_name(keep_setting, name) { return keep_setting === true || keep_setting instanceof RegExp && keep_setting.test(name); } var lineTerminatorEscape = { "\0": "0", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }; function regexp_source_fix(source) { return source.replace(/[\0\n\r\u2028\u2029]/g, function(match, offset) { var escaped = source[offset - 1] == "\\" && (source[offset - 2] != "\\" || /(?:^|[^\\])(?:\\{2})*$/.test(source.slice(0, offset - 1))); return (escaped ? "" : "\\") + lineTerminatorEscape[match]; }); } const re_safe_regexp = /^[\\/|\0\s\w^$.[\]()]*$/; const regexp_is_safe = (source) => re_safe_regexp.test(source); const all_flags = "dgimsuyv"; function sort_regexp_flags(flags) { const existing_flags = new Set(flags.split("")); let out = ""; for (const flag of all_flags) { if (existing_flags.has(flag)) { out += flag; existing_flags.delete(flag); } } if (existing_flags.size) { existing_flags.forEach((flag) => { out += flag; }); } return out; } function has_annotation(node, annotation) { return node._annotations & annotation; } function set_annotation(node, annotation) { node._annotations |= annotation; } function clear_annotation(node, annotation) { node._annotations &= ~annotation; } var LATEST_RAW = ""; var TEMPLATE_RAWS = /* @__PURE__ */ new Map(); var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; var KEYWORDS_ATOM = "false null true"; var RESERVED_WORDS = "enum import super this " + KEYWORDS_ATOM + " " + KEYWORDS; var ALL_RESERVED_WORDS = "implements interface package private protected public static " + RESERVED_WORDS; var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case yield await"; KEYWORDS = makePredicate(KEYWORDS); RESERVED_WORDS = makePredicate(RESERVED_WORDS); KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); ALL_RESERVED_WORDS = makePredicate(ALL_RESERVED_WORDS); var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); var RE_NUM_LITERAL = /[0-9a-f]/i; var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; var RE_OCT_NUMBER = /^0[0-7]+$/; var RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i; var RE_BIN_NUMBER = /^0b[01]+$/i; var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; var RE_BIG_INT = /^(0[xob])?[0-9a-f]+n$/i; var OPERATORS = makePredicate([ "in", "instanceof", "typeof", "new", "void", "delete", "++", "--", "+", "-", "!", "~", "&", "|", "^", "*", "**", "/", "%", ">>", "<<", ">>>", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "?", "=", "+=", "-=", "||=", "&&=", "??=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=", "&&", "??", "||" ]); var WHITESPACE_CHARS = makePredicate(characters(" \xA0\n\r \f\v\u200B\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF")); var NEWLINE_CHARS = makePredicate(characters("\n\r\u2028\u2029")); var PUNC_AFTER_EXPRESSION = makePredicate(characters(";]),:")); var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,;:")); var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); var UNICODE = { ID_Start: /[$A-Z_a-z\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\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\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\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\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-\uA7AD\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\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[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\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]|\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]|\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]/, ID_Continue: /(?:[$0-9A-Z_a-z\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\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\u0C81-\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\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\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\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\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\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[\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]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\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]|\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]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\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])+/ }; try { UNICODE = { ID_Start: new RegExp("[_$\\p{ID_Start}]", "u"), ID_Continue: new RegExp("[$\\u200C\\u200D\\p{ID_Continue}]+", "u") }; } catch (e) { } function get_full_char(str, pos) { if (is_surrogate_pair_head(str.charCodeAt(pos))) { if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) { return str.charAt(pos) + str.charAt(pos + 1); } } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) { if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) { return str.charAt(pos - 1) + str.charAt(pos); } } return str.charAt(pos); } function get_full_char_code(str, pos) { if (is_surrogate_pair_head(str.charCodeAt(pos))) { return 65536 + (str.charCodeAt(pos) - 55296 << 10) + str.charCodeAt(pos + 1) - 56320; } return str.charCodeAt(pos); } function get_full_char_length(str) { var surrogates = 0; for (var i = 0; i < str.length; i++) { if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) { surrogates++; i++; } } return str.length - surrogates; } function from_char_code(code) { if (code > 65535) { code -= 65536; return String.fromCharCode((code >> 10) + 55296) + String.fromCharCode(code % 1024 + 56320); } return String.fromCharCode(code); } function is_surrogate_pair_head(code) { return code >= 55296 && code <= 56319; } function is_surrogate_pair_tail(code) { return code >= 56320 && code <= 57343; } function is_digit(code) { return code >= 48 && code <= 57; } function is_identifier_start(ch) { return UNICODE.ID_Start.test(ch); } function is_identifier_char(ch) { return UNICODE.ID_Continue.test(ch); } const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; function is_basic_identifier_string(str) { return BASIC_IDENT.test(str); } function is_identifier_string(str, allow_surrogates) { if (BASIC_IDENT.test(str)) { return true; } if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { return false; } var match = UNICODE.ID_Start.exec(str); if (!match || match.index !== 0) { return false; } str = str.slice(match[0].length); if (!str) { return true; } match = UNICODE.ID_Continue.exec(str); return !!match && match[0].length === str.length; } function parse_js_number(num, allow_e = true) { if (!allow_e && num.includes("e")) { return NaN; } if (RE_HEX_NUMBER.test(num)) { return parseInt(num.substr(2), 16); } else if (RE_OCT_NUMBER.test(num)) { return parseInt(num.substr(1), 8); } else if (RE_ES6_OCT_NUMBER.test(num)) { return parseInt(num.substr(2), 8); } else if (RE_BIN_NUMBER.test(num)) { return parseInt(num.substr(2), 2); } else if (RE_DEC_NUMBER.test(num)) { return parseFloat(num); } else { var val = parseFloat(num); if (val == num) return val; } } class JS_Parse_Error extends Error { constructor(message, filename, line, col, pos) { super(); this.name = "SyntaxError"; this.message = message; this.filename = filename; this.line = line; this.col = col; this.pos = pos; } } function js_error(message, filename, line, col, pos) { throw new JS_Parse_Error(message, filename, line, col, pos); } function is_token(token, type, val) { return token.type == type && (val == null || token.value == val); } var EX_EOF = {}; function tokenizer($TEXT, filename, html5_comments, shebang) { var S = { text: $TEXT, filename, pos: 0, tokpos: 0, line: 1, tokline: 0, col: 0, tokcol: 0, newline_before: false, regex_allowed: false, brace_counter: 0, template_braces: [], comments_before: [], directives: {}, directive_stack: [] }; function peek() { return get_full_char(S.text, S.pos); } function is_option_chain_op() { const must_be_dot = S.text.charCodeAt(S.pos + 1) === 46; if (!must_be_dot) return false; const cannot_be_digit = S.text.charCodeAt(S.pos + 2); return cannot_be_digit < 48 || cannot_be_digit > 57; } function next(signal_eof, in_string) { var ch = get_full_char(S.text, S.pos++); if (signal_eof && !ch) throw EX_EOF; if (NEWLINE_CHARS.has(ch)) { S.newline_before = S.newline_before || !in_string; ++S.line; S.col = 0; if (ch == "\r" && peek() == "\n") { ++S.pos; ch = "\n"; } } else { if (ch.length > 1) { ++S.pos; ++S.col; } ++S.col; } return ch; } function forward(i) { while (i--) next(); } function looking_at(str) { return S.text.substr(S.pos, str.length) == str; } function find_eol() { var text = S.text; for (var i = S.pos, n = S.text.length; i < n; ++i) { var ch = text[i]; if (NEWLINE_CHARS.has(ch)) return i; } return -1; } function find(what, signal_eof) { var pos = S.text.indexOf(what, S.pos); if (signal_eof && pos == -1) throw EX_EOF; return pos; } function start_token() { S.tokline = S.line; S.tokcol = S.col; S.tokpos = S.pos; } var prev_was_dot = false; var previous_token = null; function token(type, value, is_comment) { S.regex_allowed = type == "operator" && !UNARY_POSTFIX.has(value) || type == "keyword" && KEYWORDS_BEFORE_EXPRESSION.has(value) || type == "punc" && PUNC_BEFORE_EXPRESSION.has(value) || type == "arrow"; if (type == "punc" && (value == "." || value == "?.")) { prev_was_dot = true; } else if (!is_comment) { prev_was_dot = false; } const line = S.tokline; const col = S.tokcol; const pos = S.tokpos; const nlb = S.newline_before; const file = filename; let comments_before = []; let comments_after = []; if (!is_comment) { comments_before = S.comments_before; comments_after = S.comments_before = []; } S.newline_before = false; const tok = new AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); if (!is_comment) previous_token = tok; return tok; } function skip_whitespace() { while (WHITESPACE_CHARS.has(peek())) next(); } function read_while(pred) { var ret = "", ch, i = 0; while ((ch = peek()) && pred(ch, i++)) ret += next(); return ret; } function parse_error(err) { js_error(err, filename, S.tokline, S.tokcol, S.tokpos); } function read_num(prefix) { var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".", is_big_int = false, numeric_separator = false; var num = read_while(function(ch, i) { if (is_big_int) return false; var code = ch.charCodeAt(0); switch (code) { case 95: return numeric_separator = true; case 98: case 66: return has_x = true; case 111: case 79: case 120: case 88: return has_x ? false : has_x = true; case 101: case 69: return has_x ? true : has_e ? false : has_e = after_e = true; case 45: return after_e || i == 0 && !prefix; case 43: return after_e; case (after_e = false, 46): return !has_dot && !has_x && !has_e ? has_dot = true : false; } if (ch === "n") { is_big_int = true; return true; } return RE_NUM_LITERAL.test(ch); }); if (prefix) num = prefix + num; LATEST_RAW = num; if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { parse_error("Legacy octal literals are not allowed in strict mode"); } if (numeric_separator) { if (num.endsWith("_")) { parse_error("Numeric separators are not allowed at the end of numeric literals"); } else if (num.includes("__")) { parse_error("Only one underscore is allowed as numeric separator"); } num = num.replace(/_/g, ""); } if (num.endsWith("n")) { const without_n = num.slice(0, -1); const allow_e = RE_HEX_NUMBER.test(without_n); const valid2 = parse_js_number(without_n, allow_e); if (!has_dot && RE_BIG_INT.test(num) && !isNaN(valid2)) return token("big_int", without_n); parse_error("Invalid or unexpected token"); } var valid = parse_js_number(num); if (!isNaN(valid)) { return token("num", valid); } else { parse_error("Invalid syntax: " + num); } } function is_octal(ch) { return ch >= "0" && ch <= "7"; } function read_escaped_char(in_string, strict_hex, template_string) { var ch = next(true, in_string); switch (ch.charCodeAt(0)) { case 110: return "\n"; case 114: return "\r"; case 116: return " "; case 98: return "\b"; case 118: return "\v"; case 102: return "\f"; case 120: return String.fromCharCode(hex_bytes(2, strict_hex)); case 117: if (peek() == "{") { next(true); if (peek() === "}") parse_error("Expecting hex-character between {}"); while (peek() == "0") next(true); var result, length = find("}", true) - S.pos; if (length > 6 || (result = hex_bytes(length, strict_hex)) > 1114111) { parse_error("Unicode reference out of bounds"); } next(true); return from_char_code(result); } return String.fromCharCode(hex_bytes(4, strict_hex)); case 10: return ""; case 13: if (peek() == "\n") { next(true, in_string); return ""; } } if (is_octal(ch)) { if (template_string && strict_hex) { const represents_null_character = ch === "0" && !is_octal(peek()); if (!represents_null_character) { parse_error("Octal escape sequences are not allowed in template strings"); } } return read_octal_escape_sequence(ch, strict_hex); } return ch; } function read_octal_escape_sequence(ch, strict_octal) { var p = peek(); if (p >= "0" && p <= "7") { ch += next(true); if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") ch += next(true); } if (ch === "0") return "\0"; if (ch.length > 0 && next_token.has_directive("use strict") && strict_octal) parse_error("Legacy octal escape sequences are not allowed in strict mode"); return String.fromCharCode(parseInt(ch, 8)); } function hex_bytes(n, strict_hex) { var num = 0; for (; n > 0; --n) { if (!strict_hex && isNaN(parseInt(peek(), 16))) { return parseInt(num, 16) || ""; } var digit = next(true); if (isNaN(parseInt(digit, 16))) parse_error("Invalid hex-character pattern in string"); num += digit; } return parseInt(num, 16); } var read_string = with_eof_error("Unterminated string constant", function() { const start_pos = S.pos; var quote = next(), ret = []; for (; ; ) { var ch = next(true, true); if (ch == "\\") ch = read_escaped_char(true, true); else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); else if (ch == quote) break; ret.push(ch); } var tok = token("string", ret.join("")); LATEST_RAW = S.text.slice(start_pos, S.pos); tok.quote = quote; return tok; }); var read_template_characters = with_eof_error("Unterminated template", function(begin) { if (begin) { S.template_braces.push(S.brace_counter); } var content = "", raw = "", ch, tok; next(true, true); while ((ch = next(true, true)) != "`") { if (ch == "\r") { if (peek() == "\n") ++S.pos; ch = "\n"; } else if (ch == "$" && peek() == "{") { next(true, true); S.brace_counter++; tok = token(begin ? "template_head" : "template_substitution", content); TEMPLATE_RAWS.set(tok, raw); tok.template_end = false; return tok; } raw += ch; if (ch == "\\") { var tmp = S.pos; var prev_is_tag = previous_token && (previous_token.type === "name" || previous_token.type === "punc" && (previous_token.value === ")" || previous_token.value === "]")); ch = read_escaped_char(true, !prev_is_tag, true); raw += S.text.substr(tmp, S.pos - tmp); } content += ch; } S.template_braces.pop(); tok = token(begin ? "template_head" : "template_substitution", content); TEMPLATE_RAWS.set(tok, raw); tok.template_end = true; return tok; }); function skip_line_comment(type) { var regex_allowed = S.regex_allowed; var i = find_eol(), ret; if (i == -1) { ret = S.text.substr(S.pos); S.pos = S.text.length; } else { ret = S.text.substring(S.pos, i); S.pos = i; } S.col = S.tokcol + (S.pos - S.tokpos); S.comments_before.push(token(type, ret, true)); S.regex_allowed = regex_allowed; return next_token; } var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { var regex_allowed = S.regex_allowed; var i = find("*/", true); var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); forward(get_full_char_length(text) + 2); S.comments_before.push(token("comment2", text, true)); S.newline_before = S.newline_before || text.includes("\n"); S.regex_allowed = regex_allowed; return next_token; }); var read_name = with_eof_error("Unterminated identifier name", function() { var name = [], ch, escaped = false; var read_escaped_identifier_char = function() { escaped = true; next(); if (peek() !== "u") { parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"); } return read_escaped_char(false, true); }; if ((ch = peek()) === "\\") { ch = read_escaped_identifier_char(); if (!is_identifier_start(ch)) { parse_error("First identifier char is an invalid identifier char"); } } else if (is_identifier_start(ch)) { next(); } else { return ""; } name.push(ch); while ((ch = peek()) != null) { if ((ch = peek()) === "\\") { ch = read_escaped_identifier_char(); if (!is_identifier_char(ch)) { parse_error("Invalid escaped identifier char"); } } else { if (!is_identifier_char(ch)) { break; } next(); } name.push(ch); } const name_str = name.join(""); if (RESERVED_WORDS.has(name_str) && escaped) { parse_error("Escaped characters are not allowed in keywords"); } return name_str; }); var read_regexp = with_eof_error("Unterminated regular expression", function(source) { var prev_backslash = false, ch, in_class = false; while (ch = next(true)) if (NEWLINE_CHARS.has(ch)) { parse_error("Unexpected line terminator"); } else if (prev_backslash) { source += "\\" + ch; prev_backslash = false; } else if (ch == "[") { in_class = true; source += ch; } else if (ch == "]" && in_class) { in_class = false; source += ch; } else if (ch == "/" && !in_class) { break; } else if (ch == "\\") { prev_backslash = true; } else { source += ch; } const flags = read_name(); return token("regexp", "/" + source + "/" + flags); }); function read_operator(prefix) { function grow(op) { if (!peek()) return op; var bigger = op + peek(); if (OPERATORS.has(bigger)) { next(); return grow(bigger); } else { return op; } } return token("operator", grow(prefix || next())); } function handle_slash() { next(); switch (peek()) { case "/": next(); return skip_line_comment("comment1"); case "*": next(); return skip_multiline_comment(); } return S.regex_allowed ? read_regexp("") : read_operator("/"); } function handle_eq_sign() { next(); if (peek() === ">") { next(); return token("arrow", "=>"); } else { return read_operator("="); } } function handle_dot() { next(); if (is_digit(peek().charCodeAt(0))) { return read_num("."); } if (peek() === ".") { next(); next(); return token("expand", "..."); } return token("punc", "."); } function read_word() { var word = read_name(); if (prev_was_dot) return token("name", word); return KEYWORDS_ATOM.has(word) ? token("atom", word) : !KEYWORDS.has(word) ? token("name", word) : OPERATORS.has(word) ? token("operator", word) : token("keyword", word); } function read_private_word() { next(); return token("privatename", read_name()); } function with_eof_error(eof_error, cont) { return function(x) { try { return cont(x); } catch (ex) { if (ex === EX_EOF) parse_error(eof_error); else throw ex; } }; } function next_token(force_regexp) { if (force_regexp != null) return read_regexp(force_regexp); if (shebang && S.pos == 0 && looking_at("#!")) { start_token(); forward(2); skip_line_comment("comment5"); } for (; ; ) { skip_whitespace(); start_token(); if (html5_comments) { if (looking_at("") && S.newline_before) { forward(3); skip_line_comment("comment4"); continue; } } var ch = peek(); if (!ch) return token("eof"); var code = ch.charCodeAt(0); switch (code) { case 34: case 39: return read_string(); case 46: return handle_dot(); case 47: { var tok = handle_slash(); if (tok === next_token) continue; return tok; } case 61: return handle_eq_sign(); case 63: { if (!is_option_chain_op()) break; next(); next(); return token("punc", "?."); } case 96: return read_template_characters(true); case 123: S.brace_counter++; break; case 125: S.brace_counter--; if (S.template_braces.length > 0 && S.template_braces[S.template_braces.length - 1] === S.brace_counter) return read_template_characters(false); break; } if (is_digit(code)) return read_num(); if (PUNC_CHARS.has(ch)) return token("punc", next()); if (OPERATOR_CHARS.has(ch)) return read_operator(); if (code == 92 || is_identifier_start(ch)) return read_word(); if (code == 35) return read_private_word(); break; } parse_error("Unexpected character '" + ch + "'"); } next_token.next = next; next_token.peek = peek; next_token.context = function(nc) { if (nc) S = nc; return S; }; next_token.add_directive = function(directive) { S.directive_stack[S.directive_stack.length - 1].push(directive); if (S.directives[directive] === void 0) { S.directives[directive] = 1; } else { S.directives[directive]++; } }; next_token.push_directives_stack = function() { S.directive_stack.push([]); }; next_token.pop_directives_stack = function() { var directives2 = S.directive_stack[S.directive_stack.length - 1]; for (var i = 0; i < directives2.length; i++) { S.directives[directives2[i]]--; } S.directive_stack.pop(); }; next_token.has_directive = function(directive) { return S.directives[directive] > 0; }; return next_token; } var UNARY_PREFIX = makePredicate([ "typeof", "void", "delete", "--", "++", "!", "~", "-", "+" ]); var UNARY_POSTFIX = makePredicate(["--", "++"]); var ASSIGNMENT = makePredicate(["=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="]); var LOGICAL_ASSIGNMENT = makePredicate(["??=", "&&=", "||="]); var PRECEDENCE = function(a, ret) { for (var i = 0; i < a.length; ++i) { var b = a[i]; for (var j = 0; j < b.length; ++j) { ret[b[j]] = i + 1; } } return ret; }([ ["||"], ["??"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"] ], {}); var ATOMIC_START_TOKEN = makePredicate(["atom", "num", "big_int", "string", "regexp", "name"]); function parse($TEXT, options) { const outer_comments_before_counts = /* @__PURE__ */ new WeakMap(); options = defaults(options, { bare_returns: false, ecma: null, expression: false, filename: null, html5_comments: true, module: false, shebang: true, strict: false, toplevel: null }, true); var S = { input: typeof $TEXT == "string" ? tokenizer($TEXT, options.filename, options.html5_comments, options.shebang) : $TEXT, token: null, prev: null, peeked: null, in_function: 0, in_async: -1, in_generator: -1, in_directives: true, in_loop: 0, labels: [] }; S.token = next(); function is(type, value) { return is_token(S.token, type, value); } function peek() { return S.peeked || (S.peeked = S.input()); } function next() { S.prev = S.token; if (!S.peeked) peek(); S.token = S.peeked; S.peeked = null; S.in_directives = S.in_directives && (S.token.type == "string" || is("punc", ";")); return S.token; } function prev() { return S.prev; } function croak(msg, line, col, pos) { var ctx = S.input.context(); js_error(msg, ctx.filename, line != null ? line : ctx.tokline, col != null ? col : ctx.tokcol, pos != null ? pos : ctx.tokpos); } function token_error(token, msg) { croak(msg, token.line, token.col); } function unexpected(token) { if (token == null) token = S.token; token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); } function expect_token(type, val) { if (is(type, val)) { return next(); } token_error(S.token, "Unexpected token " + S.token.type + " \xAB" + S.token.value + "\xBB, expected " + type + " \xAB" + val + "\xBB"); } function expect(punc) { return expect_token("punc", punc); } function has_newline_before(token) { return token.nlb || !token.comments_before.every((comment) => !comment.nlb); } function can_insert_semicolon() { return !options.strict && (is("eof") || is("punc", "}") || has_newline_before(S.token)); } function is_in_generator() { return S.in_generator === S.in_function; } function is_in_async() { return S.in_async === S.in_function; } function can_await() { return S.in_async === S.in_function || S.in_function === 0 && S.input.has_directive("use strict"); } function semicolon(optional) { if (is("punc", ";")) next(); else if (!optional && !can_insert_semicolon()) unexpected(); } function parenthesised() { expect("("); var exp = expression(true); expect(")"); return exp; } function embed_tokens(parser) { return function _embed_tokens_wrapper(...args) { const start = S.token; const expr = parser(...args); expr.start = start; expr.end = prev(); return expr; }; } function handle_regexp() { if (is("operator", "/") || is("operator", "/=")) { S.peeked = null; S.token = S.input(S.token.value.substr(1)); } } var statement = embed_tokens(function statement2(is_export_default, is_for_body, is_if_body) { handle_regexp(); switch (S.token.type) { case "string": if (S.in_directives) { var token = peek(); if (!LATEST_RAW.includes("\\") && (is_token(token, "punc", ";") || is_token(token, "punc", "}") || has_newline_before(token) || is_token(token, "eof"))) { S.input.add_directive(S.token.value); } else { S.in_directives = false; } } var dir = S.in_directives, stat = simple_statement(); return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; case "template_head": case "num": case "big_int": case "regexp": case "operator": case "atom": return simple_statement(); case "name": case "privatename": if (is("privatename") && !S.in_class) croak("Private field must be used in an enclosing class"); if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { next(); next(); if (is_for_body) { croak("functions are not allowed as the body of a loop"); } return function_(AST_Defun, false, true, is_export_default); } if (S.token.value == "import" && !is_token(peek(), "punc", "(") && !is_token(peek(), "punc", ".")) { next(); var node = import_statement(); semicolon(); return node; } return is_token(peek(), "punc", ":") ? labeled_statement() : simple_statement(); case "punc": switch (S.token.value) { case "{": return new AST_BlockStatement({ start: S.token, body: block_(), end: prev() }); case "[": case "(": return simple_statement(); case ";": S.in_directives = false; next(); return new AST_EmptyStatement(); default: unexpected(); } case "keyword": switch (S.token.value) { case "break": next(); return break_cont(AST_Break); case "continue": next(); return break_cont(AST_Continue); case "debugger": next(); semicolon(); return new AST_Debugger(); case "do": next(); var body = in_loop(statement2); expect_token("keyword", "while"); var condition = parenthesised(); semicolon(true); return new AST_Do({ body, condition }); case "while": next(); return new AST_While({ condition: parenthesised(), body: in_loop(function() { return statement2(false, true); }) }); case "for": next(); return for_(); case "class": next(); if (is_for_body) { croak("classes are not allowed as the body of a loop"); } if (is_if_body) { croak("classes are not allowed as the body of an if"); } return class_(AST_DefClass, is_export_default); case "function": next(); if (is_for_body) { croak("functions are not allowed as the body of a loop"); } return function_(AST_Defun, false, false, is_export_default); case "if": next(); return if_(); case "return": if (S.in_function == 0 && !options.bare_returns) croak("'return' outside of function"); next(); var value = null; if (is("punc", ";")) { next(); } else if (!can_insert_semicolon()) { value = expression(true); semicolon(); } return new AST_Return({ value }); case "switch": next(); return new AST_Switch({ expression: parenthesised(), body: in_loop(switch_body_) }); case "throw": next(); if (has_newline_before(S.token)) croak("Illegal newline after 'throw'"); var value = expression(true); semicolon(); return new AST_Throw({ value }); case "try": next(); return try_(); case "var": next(); var node = var_(); semicolon(); return node; case "let": next(); var node = let_(); semicolon(); return node; case "const": next(); var node = const_(); semicolon(); return node; case "with": if (S.input.has_directive("use strict")) { croak("Strict mode may not include a with statement"); } next(); return new AST_With({ expression: parenthesised(), body: statement2() }); case "export": if (!is_token(peek(), "punc", "(")) { next(); var node = export_statement(); if (is("punc", ";")) semicolon(); return node; } } } unexpected(); }); function labeled_statement() { var label = as_symbol(AST_Label); if (label.name === "await" && is_in_async()) { token_error(S.prev, "await cannot be used as label inside async function"); } if (S.labels.some((l) => l.name === label.name)) { croak("Label " + label.name + " defined twice"); } expect(":"); S.labels.push(label); var stat = statement(); S.labels.pop(); if (!(stat instanceof AST_IterationStatement)) { label.references.forEach(function(ref) { if (ref instanceof AST_Continue) { ref = ref.label.start; croak("Continue label `" + label.name + "` refers to non-IterationStatement.", ref.line, ref.col, ref.pos); } }); } return new AST_LabeledStatement({ body: stat, label }); } function simple_statement(tmp) { return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); } function break_cont(type) { var label = null, ldef; if (!can_insert_semicolon()) { label = as_symbol(AST_LabelRef, true); } if (label != null) { ldef = S.labels.find((l) => l.name === label.name); if (!ldef) croak("Undefined label " + label.name); label.thedef = ldef; } else if (S.in_loop == 0) croak(type.TYPE + " not inside a loop or switch"); semicolon(); var stat = new type({ label }); if (ldef) ldef.references.push(stat); return stat; } function for_() { var for_await_error = "`for await` invalid in this context"; var await_tok = S.token; if (await_tok.type == "name" && await_tok.value == "await") { if (!can_await()) { token_error(await_tok, for_await_error); } next(); } else { await_tok = false; } expect("("); var init = null; if (!is("punc", ";")) { init = is("keyword", "var") ? (next(), var_(true)) : is("keyword", "let") ? (next(), let_(true)) : is("keyword", "const") ? (next(), const_(true)) : expression(true, true); var is_in = is("operator", "in"); var is_of = is("name", "of"); if (await_tok && !is_of) { token_error(await_tok, for_await_error); } if (is_in || is_of) { if (init instanceof AST_Definitions) { if (init.definitions.length > 1) token_error(init.start, "Only one variable declaration allowed in for..in loop"); } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { token_error(init.start, "Invalid left-hand side in for..in loop"); } next(); if (is_in) { return for_in(init); } else { return for_of(init, !!await_tok); } } } else if (await_tok) { token_error(await_tok, for_await_error); } return regular_for(init); } function regular_for(init) { expect(";"); var test = is("punc", ";") ? null : expression(true); expect(";"); var step = is("punc", ")") ? null : expression(true); expect(")"); return new AST_For({ init, condition: test, step, body: in_loop(function() { return statement(false, true); }) }); } function for_of(init, is_await) { var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; var obj = expression(true); expect(")"); return new AST_ForOf({ await: is_await, init, name: lhs, object: obj, body: in_loop(function() { return statement(false, true); }) }); } function for_in(init) { var obj = expression(true); expect(")"); return new AST_ForIn({ init, object: obj, body: in_loop(function() { return statement(false, true); }) }); } var arrow_function = function(start, argnames, is_async) { if (has_newline_before(S.token)) { croak("Unexpected newline before arrow (=>)"); } expect_token("arrow", "=>"); var body = _function_body(is("punc", "{"), false, is_async); var end = body instanceof Array && body.length ? body[body.length - 1].end : body instanceof Array ? start : body.end; return new AST_Arrow({ start, end, async: is_async, argnames, body }); }; var function_ = function(ctor, is_generator_property, is_async, is_export_default) { var in_statement = ctor === AST_Defun; var is_generator = is("operator", "*"); if (is_generator) { next(); } var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; if (in_statement && !name) { if (is_export_default) { ctor = AST_Function; } else { unexpected(); } } if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) unexpected(prev()); var args = []; var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); return new ctor({ start: args.start, end: body.end, is_generator, async: is_async, name, argnames: args, body }); }; class UsedParametersTracker { constructor(is_parameter, strict, duplicates_ok = false) { this.is_parameter = is_parameter; this.duplicates_ok = duplicates_ok; this.parameters = /* @__PURE__ */ new Set(); this.duplicate = null; this.default_assignment = false; this.spread = false; this.strict_mode = !!strict; } add_parameter(token) { if (this.parameters.has(token.value)) { if (this.duplicate === null) { this.duplicate = token; } this.check_strict(); } else { this.parameters.add(token.value); if (this.is_parameter) { switch (token.value) { case "arguments": case "eval": case "yield": if (this.strict_mode) { token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); } break; default: if (RESERVED_WORDS.has(token.value)) { unexpected(); } } } } } mark_default_assignment(token) { if (this.default_assignment === false) { this.default_assignment = token; } } mark_spread(token) { if (this.spread === false) { this.spread = token; } } mark_strict_mode() { this.strict_mode = true; } is_strict() { return this.default_assignment !== false || this.spread !== false || this.strict_mode; } check_strict() { if (this.is_strict() && this.duplicate !== null && !this.duplicates_ok) { token_error(this.duplicate, "Parameter " + this.duplicate.value + " was used already"); } } } function parameters(params) { var used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); expect("("); while (!is("punc", ")")) { var param = parameter(used_parameters); params.push(param); if (!is("punc", ")")) { expect(","); } if (param instanceof AST_Expansion) { break; } } next(); } function parameter(used_parameters, symbol_type) { var param; var expand = false; if (used_parameters === void 0) { used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); } if (is("expand", "...")) { expand = S.token; used_parameters.mark_spread(S.token); next(); } param = binding_element(used_parameters, symbol_type); if (is("operator", "=") && expand === false) { used_parameters.mark_default_assignment(S.token); next(); param = new AST_DefaultAssign({ start: param.start, left: param, operator: "=", right: expression(false), end: S.token }); } if (expand !== false) { if (!is("punc", ")")) { unexpected(); } param = new AST_Expansion({ start: expand, expression: param, end: expand }); } used_parameters.check_strict(); return param; } function binding_element(used_parameters, symbol_type) { var elements = []; var first = true; var is_expand = false; var expand_token; var first_token = S.token; if (used_parameters === void 0) { const strict = S.input.has_directive("use strict"); const duplicates_ok = symbol_type === AST_SymbolVar; used_parameters = new UsedParametersTracker(false, strict, duplicates_ok); } symbol_type = symbol_type === void 0 ? AST_SymbolFunarg : symbol_type; if (is("punc", "[")) { next(); while (!is("punc", "]")) { if (first) { first = false; } else { expect(","); } if (is("expand", "...")) { is_expand = true; expand_token = S.token; used_parameters.mark_spread(S.token); next(); } if (is("punc")) { switch (S.token.value) { case ",": elements.push(new AST_Hole({ start: S.token, end: S.token })); continue; case "]": break; case "[": case "{": elements.push(binding_element(used_parameters, symbol_type)); break; default: unexpected(); } } else if (is("name")) { used_parameters.add_parameter(S.token); elements.push(as_symbol(symbol_type)); } else { croak("Invalid function parameter"); } if (is("operator", "=") && is_expand === false) { used_parameters.mark_default_assignment(S.token); next(); elements[elements.length - 1] = new AST_DefaultAssign({ start: elements[elements.length - 1].start, left: elements[elements.length - 1], operator: "=", right: expression(false), end: S.token }); } if (is_expand) { if (!is("punc", "]")) { croak("Rest element must be last element"); } elements[elements.length - 1] = new AST_Expansion({ start: expand_token, expression: elements[elements.length - 1], end: expand_token }); } } expect("]"); used_parameters.check_strict(); return new AST_Destructuring({ start: first_token, names: elements, is_array: true, end: prev() }); } else if (is("punc", "{")) { next(); while (!is("punc", "}")) { if (first) { first = false; } else { expect(","); } if (is("expand", "...")) { is_expand = true; expand_token = S.token; used_parameters.mark_spread(S.token); next(); } if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].includes(peek().value)) { used_parameters.add_parameter(S.token); var start = prev(); var value = as_symbol(symbol_type); if (is_expand) { elements.push(new AST_Expansion({ start: expand_token, expression: value, end: value.end })); } else { elements.push(new AST_ObjectKeyVal({ start, key: value.name, value, end: value.end })); } } else if (is("punc", "}")) { continue; } else { var property_token = S.token; var property = as_property_name(); if (property === null) { unexpected(prev()); } else if (prev().type === "name" && !is("punc", ":")) { elements.push(new AST_ObjectKeyVal({ start: prev(), key: property, value: new symbol_type({ start: prev(), name: property, end: prev() }), end: prev() })); } else { expect(":"); elements.push(new AST_ObjectKeyVal({ start: property_token, quote: property_token.quote, key: property, value: binding_element(used_parameters, symbol_type), end: prev() })); } } if (is_expand) { if (!is("punc", "}")) { croak("Rest element must be last element"); } } else if (is("operator", "=")) { used_parameters.mark_default_assignment(S.token); next(); elements[elements.length - 1].value = new AST_DefaultAssign({ start: elements[elements.length - 1].value.start, left: elements[elements.length - 1].value, operator: "=", right: expression(false), end: S.token }); } } expect("}"); used_parameters.check_strict(); return new AST_Destructuring({ start: first_token, names: elements, is_array: false, end: prev() }); } else if (is("name")) { used_parameters.add_parameter(S.token); return as_symbol(symbol_type); } else { croak("Invalid function parameter"); } } function params_or_seq_(allow_arrows, maybe_sequence) { var spread_token; var invalid_sequence; var trailing_comma; var a = []; expect("("); while (!is("punc", ")")) { if (spread_token) unexpected(spread_token); if (is("expand", "...")) { spread_token = S.token; if (maybe_sequence) invalid_sequence = S.token; next(); a.push(new AST_Expansion({ start: prev(), expression: expression(), end: S.token })); } else { a.push(expression()); } if (!is("punc", ")")) { expect(","); if (is("punc", ")")) { trailing_comma = prev(); if (maybe_sequence) invalid_sequence = trailing_comma; } } } expect(")"); if (allow_arrows && is("arrow", "=>")) { if (spread_token && trailing_comma) unexpected(trailing_comma); } else if (invalid_sequence) { unexpected(invalid_sequence); } return a; } function _function_body(block, generator, is_async, name, args) { var loop = S.in_loop; var labels = S.labels; var current_generator = S.in_generator; var current_async = S.in_async; ++S.in_function; if (generator) S.in_generator = S.in_function; if (is_async) S.in_async = S.in_function; if (args) parameters(args); if (block) S.in_directives = true; S.in_loop = 0; S.labels = []; if (block) { S.input.push_directives_stack(); var a = block_(); if (name) _verify_symbol(name); if (args) args.forEach(_verify_symbol); S.input.pop_directives_stack(); } else { var a = [new AST_Return({ start: S.token, value: expression(false), end: S.token })]; } --S.in_function; S.in_loop = loop; S.labels = labels; S.in_generator = current_generator; S.in_async = current_async; return a; } function _await_expression() { if (!can_await()) { croak("Unexpected await expression outside async function", S.prev.line, S.prev.col, S.prev.pos); } return new AST_Await({ start: prev(), end: S.token, expression: maybe_unary(true) }); } function _yield_expression() { if (!is_in_generator()) { croak("Unexpected yield expression outside generator function", S.prev.line, S.prev.col, S.prev.pos); } var start = S.token; var star = false; var has_expression = true; if (can_insert_semicolon() || is("punc") && PUNC_AFTER_EXPRESSION.has(S.token.value)) { has_expression = false; } else if (is("operator", "*")) { star = true; next(); } return new AST_Yield({ start, is_star: star, expression: has_expression ? expression() : null, end: prev() }); } function if_() { var cond = parenthesised(), body = statement(false, false, true), belse = null; if (is("keyword", "else")) { next(); belse = statement(false, false, true); } return new AST_If({ condition: cond, body, alternative: belse }); } function block_() { expect("{"); var a = []; while (!is("punc", "}")) { if (is("eof")) unexpected(); a.push(statement()); } next(); return a; } function switch_body_() { expect("{"); var a = [], cur = null, branch = null, tmp; while (!is("punc", "}")) { if (is("eof")) unexpected(); if (is("keyword", "case")) { if (branch) branch.end = prev(); cur = []; branch = new AST_Case({ start: (tmp = S.token, next(), tmp), expression: expression(true), body: cur }); a.push(branch); expect(":"); } else if (is("keyword", "default")) { if (branch) branch.end = prev(); cur = []; branch = new AST_Default({ start: (tmp = S.token, next(), expect(":"), tmp), body: cur }); a.push(branch); } else { if (!cur) unexpected(); cur.push(statement()); } } if (branch) branch.end = prev(); next(); return a; } function try_() { var body, bcatch = null, bfinally = null; body = new AST_TryBlock({ start: S.token, body: block_(), end: prev() }); if (is("keyword", "catch")) { var start = S.token; next(); if (is("punc", "{")) { var name = null; } else { expect("("); var name = parameter(void 0, AST_SymbolCatch); expect(")"); } bcatch = new AST_Catch({ start, argname: name, body: block_(), end: prev() }); } if (is("keyword", "finally")) { var start = S.token; next(); bfinally = new AST_Finally({ start, body: block_(), end: prev() }); } if (!bcatch && !bfinally) croak("Missing catch/finally blocks"); return new AST_Try({ body, bcatch, bfinally }); } function vardefs(no_in, kind) { var var_defs = []; var def; for (; ; ) { var sym_type = kind === "var" ? AST_SymbolVar : kind === "const" ? AST_SymbolConst : kind === "let" ? AST_SymbolLet : null; if (is("punc", "{") || is("punc", "[")) { def = new AST_VarDef({ start: S.token, name: binding_element(void 0, sym_type), value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, end: prev() }); } else { def = new AST_VarDef({ start: S.token, name: as_symbol(sym_type), value: is("operator", "=") ? (next(), expression(false, no_in)) : !no_in && kind === "const" ? croak("Missing initializer in const declaration") : null, end: prev() }); if (def.name.name == "import") croak("Unexpected token: import"); } var_defs.push(def); if (!is("punc", ",")) break; next(); } return var_defs; } var var_ = function(no_in) { return new AST_Var({ start: prev(), definitions: vardefs(no_in, "var"), end: prev() }); }; var let_ = function(no_in) { return new AST_Let({ start: prev(), definitions: vardefs(no_in, "let"), end: prev() }); }; var const_ = function(no_in) { return new AST_Const({ start: prev(), definitions: vardefs(no_in, "const"), end: prev() }); }; var new_ = function(allow_calls) { var start = S.token; expect_token("operator", "new"); if (is("punc", ".")) { next(); expect_token("name", "target"); return subscripts(new AST_NewTarget({ start, end: prev() }), allow_calls); } var newexp = expr_atom(false), args; if (is("punc", "(")) { next(); args = expr_list(")", true); } else { args = []; } var call = new AST_New({ start, expression: newexp, args, end: prev() }); annotate(call); return subscripts(call, allow_calls); }; function as_atom_node() { var tok = S.token, ret; switch (tok.type) { case "name": ret = _make_symbol(AST_SymbolRef); break; case "num": ret = new AST_Number({ start: tok, end: tok, value: tok.value, raw: LATEST_RAW }); break; case "big_int": ret = new AST_BigInt({ start: tok, end: tok, value: tok.value }); break; case "string": ret = new AST_String({ start: tok, end: tok, value: tok.value, quote: tok.quote }); annotate(ret); break; case "regexp": const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); ret = new AST_RegExp({ start: tok, end: tok, value: { source, flags } }); break; case "atom": switch (tok.value) { case "false": ret = new AST_False({ start: tok, end: tok }); break; case "true": ret = new AST_True({ start: tok, end: tok }); break; case "null": ret = new AST_Null({ start: tok, end: tok }); break; } break; } next(); return ret; } function to_fun_args(ex, default_seen_above) { var insert_default = function(ex2, default_value) { if (default_value) { return new AST_DefaultAssign({ start: ex2.start, left: ex2, operator: "=", right: default_value, end: default_value.end }); } return ex2; }; if (ex instanceof AST_Object) { return insert_default(new AST_Destructuring({ start: ex.start, end: ex.end, is_array: false, names: ex.properties.map((prop) => to_fun_args(prop)) }), default_seen_above); } else if (ex instanceof AST_ObjectKeyVal) { ex.value = to_fun_args(ex.value); return insert_default(ex, default_seen_above); } else if (ex instanceof AST_Hole) { return ex; } else if (ex instanceof AST_Destructuring) { ex.names = ex.names.map((name) => to_fun_args(name)); return insert_default(ex, default_seen_above); } else if (ex instanceof AST_SymbolRef) { return insert_default(new AST_SymbolFunarg({ name: ex.name, start: ex.start, end: ex.end }), default_seen_above); } else if (ex instanceof AST_Expansion) { ex.expression = to_fun_args(ex.expression); return insert_default(ex, default_seen_above); } else if (ex instanceof AST_Array) { return insert_default(new AST_Destructuring({ start: ex.start, end: ex.end, is_array: true, names: ex.elements.map((elm) => to_fun_args(elm)) }), default_seen_above); } else if (ex instanceof AST_Assign) { return insert_default(to_fun_args(ex.left, ex.right), default_seen_above); } else if (ex instanceof AST_DefaultAssign) { ex.left = to_fun_args(ex.left); return ex; } else { croak("Invalid function parameter", ex.start.line, ex.start.col); } } var expr_atom = function(allow_calls, allow_arrows) { if (is("operator", "new")) { return new_(allow_calls); } if (is("name", "import") && is_token(peek(), "punc", ".")) { return import_meta(allow_calls); } var start = S.token; var peeked; var async = is("name", "async") && (peeked = peek()).value != "[" && peeked.type != "arrow" && as_atom_node(); if (is("punc")) { switch (S.token.value) { case "(": if (async && !allow_calls) break; var exprs = params_or_seq_(allow_arrows, !async); if (allow_arrows && is("arrow", "=>")) { return arrow_function(start, exprs.map((e) => to_fun_args(e)), !!async); } var ex = async ? new AST_Call({ expression: async, args: exprs }) : to_expr_or_sequence(start, exprs); if (ex.start) { const outer_comments_before = start.comments_before.length; outer_comments_before_counts.set(start, outer_comments_before); ex.start.comments_before.unshift(...start.comments_before); start.comments_before = ex.start.comments_before; if (outer_comments_before == 0 && start.comments_before.length > 0) { var comment = start.comments_before[0]; if (!comment.nlb) { comment.nlb = start.nlb; start.nlb = false; } } start.comments_after = ex.start.comments_after; } ex.start = start; var end = prev(); if (ex.end) { end.comments_before = ex.end.comments_before; ex.end.comments_after.push(...end.comments_after); end.comments_after = ex.end.comments_after; } ex.end = end; if (ex instanceof AST_Call) annotate(ex); return subscripts(ex, allow_calls); case "[": return subscripts(array_(), allow_calls); case "{": return subscripts(object_or_destructuring_(), allow_calls); } if (!async) unexpected(); } if (allow_arrows && is("name") && is_token(peek(), "arrow")) { var param = new AST_SymbolFunarg({ name: S.token.value, start, end: start }); next(); return arrow_function(start, [param], !!async); } if (is("keyword", "function")) { next(); var func = function_(AST_Function, false, !!async); func.start = start; func.end = prev(); return subscripts(func, allow_calls); } if (async) return subscripts(async, allow_calls); if (is("keyword", "class")) { next(); var cls = class_(AST_ClassExpression); cls.start = start; cls.end = prev(); return subscripts(cls, allow_calls); } if (is("template_head")) { return subscripts(template_string(), allow_calls); } if (is("privatename")) { if (!S.in_class) { croak("Private field must be used in an enclosing class"); } const start2 = S.token; const key = new AST_SymbolPrivateProperty({ start: start2, name: start2.value, end: start2 }); next(); expect_token("operator", "in"); const private_in = new AST_PrivateIn({ start: start2, key, value: subscripts(as_atom_node(), allow_calls), end: prev() }); return subscripts(private_in, allow_calls); } if (ATOMIC_START_TOKEN.has(S.token.type)) { return subscripts(as_atom_node(), allow_calls); } unexpected(); }; function template_string() { var segments = [], start = S.token; segments.push(new AST_TemplateSegment({ start: S.token, raw: TEMPLATE_RAWS.get(S.token), value: S.token.value, end: S.token })); while (!S.token.template_end) { next(); handle_regexp(); segments.push(expression(true)); segments.push(new AST_TemplateSegment({ start: S.token, raw: TEMPLATE_RAWS.get(S.token), value: S.token.value, end: S.token })); } next(); return new AST_TemplateString({ start, segments, end: S.token }); } function expr_list(closing, allow_trailing_comma, allow_empty) { var first = true, a = []; while (!is("punc", closing)) { if (first) first = false; else expect(","); if (allow_trailing_comma && is("punc", closing)) break; if (is("punc", ",") && allow_empty) { a.push(new AST_Hole({ start: S.token, end: S.token })); } else if (is("expand", "...")) { next(); a.push(new AST_Expansion({ start: prev(), expression: expression(), end: S.token })); } else { a.push(expression(false)); } } next(); return a; } var array_ = embed_tokens(function() { expect("["); return new AST_Array({ elements: expr_list("]", !options.strict, true) }); }); var create_accessor = embed_tokens((is_generator, is_async) => { return function_(AST_Accessor, is_generator, is_async); }); var object_or_destructuring_ = embed_tokens(function object_or_destructuring_2() { var start = S.token, first = true, a = []; expect("{"); while (!is("punc", "}")) { if (first) first = false; else expect(","); if (!options.strict && is("punc", "}")) break; start = S.token; if (start.type == "expand") { next(); a.push(new AST_Expansion({ start, expression: expression(false), end: prev() })); continue; } if (is("privatename")) { croak("private fields are not allowed in an object"); } var name = as_property_name(); var value; if (!is("punc", ":")) { var concise = concise_method_or_getset(name, start); if (concise) { a.push(concise); continue; } value = new AST_SymbolRef({ start: prev(), name, end: prev() }); } else if (name === null) { unexpected(prev()); } else { next(); value = expression(false); } if (is("operator", "=")) { next(); value = new AST_Assign({ start, left: value, operator: "=", right: expression(false), logical: false, end: prev() }); } const kv = new AST_ObjectKeyVal({ start, quote: start.quote, key: name instanceof AST_Node ? name : "" + name, value, end: prev() }); a.push(annotate(kv)); } next(); return new AST_Object({ properties: a }); }); function class_(KindOfClass, is_export_default) { var start, method, class_name, extends_, a = []; S.input.push_directives_stack(); S.input.add_directive("use strict"); if (S.token.type == "name" && S.token.value != "extends") { class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); } if (KindOfClass === AST_DefClass && !class_name) { if (is_export_default) { KindOfClass = AST_ClassExpression; } else { unexpected(); } } if (S.token.value == "extends") { next(); extends_ = expression(true); } expect("{"); const save_in_class = S.in_class; S.in_class = true; while (is("punc", ";")) { next(); } while (!is("punc", "}")) { start = S.token; method = concise_method_or_getset(as_property_name(), start, true); if (!method) { unexpected(); } a.push(method); while (is("punc", ";")) { next(); } } S.in_class = save_in_class; S.input.pop_directives_stack(); next(); return new KindOfClass({ start, name: class_name, extends: extends_, properties: a, end: prev() }); } function concise_method_or_getset(name, start, is_class) { const get_symbol_ast = (name2, SymbolClass = AST_SymbolMethod) => { if (typeof name2 === "string" || typeof name2 === "number") { return new SymbolClass({ start, name: "" + name2, end: prev() }); } else if (name2 === null) { unexpected(); } return name2; }; const is_not_method_start = () => !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "="); var is_async = false; var is_static = false; var is_generator = false; var is_private = false; var accessor_type = null; if (is_class && name === "static" && is_not_method_start()) { const static_block = class_static_block(); if (static_block != null) { return static_block; } is_static = true; name = as_property_name(); } if (name === "async" && is_not_method_start()) { is_async = true; name = as_property_name(); } if (prev().type === "operator" && prev().value === "*") { is_generator = true; name = as_property_name(); } if ((name === "get" || name === "set") && is_not_method_start()) { accessor_type = name; name = as_property_name(); } if (prev().type === "privatename") { is_private = true; } const property_token = prev(); if (accessor_type != null) { if (!is_private) { const AccessorClass = accessor_type === "get" ? AST_ObjectGetter : AST_ObjectSetter; name = get_symbol_ast(name); return annotate(new AccessorClass({ start, static: is_static, key: name, quote: name instanceof AST_SymbolMethod ? property_token.quote : void 0, value: create_accessor(), end: prev() })); } else { const AccessorClass = accessor_type === "get" ? AST_PrivateGetter : AST_PrivateSetter; return annotate(new AccessorClass({ start, static: is_static, key: get_symbol_ast(name), value: create_accessor(), end: prev() })); } } if (is("punc", "(")) { name = get_symbol_ast(name); const AST_MethodVariant = is_private ? AST_PrivateMethod : AST_ConciseMethod; var node = new AST_MethodVariant({ start, static: is_static, is_generator, async: is_async, key: name, quote: name instanceof AST_SymbolMethod ? property_token.quote : void 0, value: create_accessor(is_generator, is_async), end: prev() }); return annotate(node); } if (is_class) { const key = get_symbol_ast(name, AST_SymbolClassProperty); const quote = key instanceof AST_SymbolClassProperty ? property_token.quote : void 0; const AST_ClassPropertyVariant = is_private ? AST_ClassPrivateProperty : AST_ClassProperty; if (is("operator", "=")) { next(); return annotate(new AST_ClassPropertyVariant({ start, static: is_static, quote, key, value: expression(false), end: prev() })); } else if (is("name") || is("privatename") || is("operator", "*") || is("punc", ";") || is("punc", "}")) { return annotate(new AST_ClassPropertyVariant({ start, static: is_static, quote, key, end: prev() })); } } } function class_static_block() { if (!is("punc", "{")) { return null; } const start = S.token; const body = []; next(); while (!is("punc", "}")) { body.push(statement()); } next(); return new AST_ClassStaticBlock({ start, body, end: prev() }); } function maybe_import_assertion() { if (is("name", "assert") && !has_newline_before(S.token)) { next(); return object_or_destructuring_(); } return null; } function import_statement() { var start = prev(); var imported_name; var imported_names; if (is("name")) { imported_name = as_symbol(AST_SymbolImport); } if (is("punc", ",")) { next(); } imported_names = map_names(true); if (imported_names || imported_name) { expect_token("name", "from"); } var mod_str = S.token; if (mod_str.type !== "string") { unexpected(); } next(); const assert_clause = maybe_import_assertion(); return new AST_Import({ start, imported_name, imported_names, module_name: new AST_String({ start: mod_str, value: mod_str.value, quote: mod_str.quote, end: mod_str }), assert_clause, end: S.token }); } function import_meta(allow_calls) { var start = S.token; expect_token("name", "import"); expect_token("punc", "."); expect_token("name", "meta"); return subscripts(new AST_ImportMeta({ start, end: prev() }), allow_calls); } function map_name(is_import) { function make_symbol(type2, quote) { return new type2({ name: as_property_name(), quote: quote || void 0, start: prev(), end: prev() }); } var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; var type = is_import ? AST_SymbolImport : AST_SymbolExport; var start = S.token; var foreign_name; var name; if (is_import) { foreign_name = make_symbol(foreign_type, start.quote); } else { name = make_symbol(type, start.quote); } if (is("name", "as")) { next(); if (is_import) { name = make_symbol(type); } else { foreign_name = make_symbol(foreign_type, S.token.quote); } } else if (is_import) { name = new type(foreign_name); } else { foreign_name = new foreign_type(name); } return new AST_NameMapping({ start, foreign_name, name, end: prev() }); } function map_nameAsterisk(is_import, import_or_export_foreign_name) { var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; var type = is_import ? AST_SymbolImport : AST_SymbolExport; var start = S.token; var name, foreign_name; var end = prev(); if (is_import) { name = import_or_export_foreign_name; } else { foreign_name = import_or_export_foreign_name; } name = name || new type({ start, name: "*", end }); foreign_name = foreign_name || new foreign_type({ start, name: "*", end }); return new AST_NameMapping({ start, foreign_name, name, end }); } function map_names(is_import) { var names; if (is("punc", "{")) { next(); names = []; while (!is("punc", "}")) { names.push(map_name(is_import)); if (is("punc", ",")) { next(); } } next(); } else if (is("operator", "*")) { var name; next(); if (is("name", "as")) { next(); name = is_import ? as_symbol(AST_SymbolImport) : as_symbol_or_string(AST_SymbolExportForeign); } names = [map_nameAsterisk(is_import, name)]; } return names; } function export_statement() { var start = S.token; var is_default; var exported_names; if (is("keyword", "default")) { is_default = true; next(); } else if (exported_names = map_names(false)) { if (is("name", "from")) { next(); var mod_str = S.token; if (mod_str.type !== "string") { unexpected(); } next(); const assert_clause = maybe_import_assertion(); return new AST_Export({ start, is_default, exported_names, module_name: new AST_String({ start: mod_str, value: mod_str.value, quote: mod_str.quote, end: mod_str }), end: prev(), assert_clause }); } else { return new AST_Export({ start, is_default, exported_names, end: prev() }); } } var node; var exported_value; var exported_definition; if (is("punc", "{") || is_default && (is("keyword", "class") || is("keyword", "function")) && is_token(peek(), "punc")) { exported_value = expression(false); semicolon(); } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { unexpected(node.start); } else if (node instanceof AST_Definitions || node instanceof AST_Defun || node instanceof AST_DefClass) { exported_definition = node; } else if (node instanceof AST_ClassExpression || node instanceof AST_Function) { exported_value = node; } else if (node instanceof AST_SimpleStatement) { exported_value = node.body; } else { unexpected(node.start); } return new AST_Export({ start, is_default, exported_value, exported_definition, end: prev(), assert_clause: null }); } function as_property_name() { var tmp = S.token; switch (tmp.type) { case "punc": if (tmp.value === "[") { next(); var ex = expression(false); expect("]"); return ex; } else unexpected(tmp); case "operator": if (tmp.value === "*") { next(); return null; } if (!["delete", "in", "instanceof", "new", "typeof", "void"].includes(tmp.value)) { unexpected(tmp); } case "name": case "privatename": case "string": case "num": case "big_int": case "keyword": case "atom": next(); return tmp.value; default: unexpected(tmp); } } function as_name() { var tmp = S.token; if (tmp.type != "name" && tmp.type != "privatename") unexpected(); next(); return tmp.value; } function _make_symbol(type) { var name = S.token.value; return new (name == "this" ? AST_This : name == "super" ? AST_Super : type)({ name: String(name), start: S.token, end: S.token }); } function _verify_symbol(sym) { var name = sym.name; if (is_in_generator() && name == "yield") { token_error(sym.start, "Yield cannot be used as identifier inside generators"); } if (S.input.has_directive("use strict")) { if (name == "yield") { token_error(sym.start, "Unexpected yield identifier inside strict mode"); } if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { token_error(sym.start, "Unexpected " + name + " in strict mode"); } } } function as_symbol(type, noerror) { if (!is("name")) { if (!noerror) croak("Name expected"); return null; } var sym = _make_symbol(type); _verify_symbol(sym); next(); return sym; } function as_symbol_or_string(type) { if (!is("name")) { if (!is("string")) { croak("Name or string expected"); } var tok = S.token; var ret = new type({ start: tok, end: tok, name: tok.value, quote: tok.quote }); next(); return ret; } var sym = _make_symbol(type); _verify_symbol(sym); next(); return sym; } function annotate(node, before_token = node.start) { var comments = before_token.comments_before; const comments_outside_parens = outer_comments_before_counts.get(before_token); var i = comments_outside_parens != null ? comments_outside_parens : comments.length; while (--i >= 0) { var comment = comments[i]; if (/[@#]__/.test(comment.value)) { if (/[@#]__PURE__/.test(comment.value)) { set_annotation(node, _PURE); break; } if (/[@#]__INLINE__/.test(comment.value)) { set_annotation(node, _INLINE); break; } if (/[@#]__NOINLINE__/.test(comment.value)) { set_annotation(node, _NOINLINE); break; } if (/[@#]__KEY__/.test(comment.value)) { set_annotation(node, _KEY); break; } if (/[@#]__MANGLE_PROP__/.test(comment.value)) { set_annotation(node, _MANGLEPROP); break; } } } return node; } var subscripts = function(expr, allow_calls, is_chain) { var start = expr.start; if (is("punc", ".")) { next(); if (is("privatename") && !S.in_class) croak("Private field must be used in an enclosing class"); const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; return annotate(subscripts(new AST_DotVariant({ start, expression: expr, optional: false, property: as_name(), end: prev() }), allow_calls, is_chain)); } if (is("punc", "[")) { next(); var prop = expression(true); expect("]"); return annotate(subscripts(new AST_Sub({ start, expression: expr, optional: false, property: prop, end: prev() }), allow_calls, is_chain)); } if (allow_calls && is("punc", "(")) { next(); var call = new AST_Call({ start, expression: expr, optional: false, args: call_args(), end: prev() }); annotate(call); return subscripts(call, true, is_chain); } if (is("punc", "?.")) { next(); let chain_contents; if (allow_calls && is("punc", "(")) { next(); const call2 = new AST_Call({ start, optional: true, expression: expr, args: call_args(), end: prev() }); annotate(call2); chain_contents = subscripts(call2, true, true); } else if (is("name") || is("privatename")) { if (is("privatename") && !S.in_class) croak("Private field must be used in an enclosing class"); const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; chain_contents = annotate(subscripts(new AST_DotVariant({ start, expression: expr, optional: true, property: as_name(), end: prev() }), allow_calls, true)); } else if (is("punc", "[")) { next(); const property = expression(true); expect("]"); chain_contents = annotate(subscripts(new AST_Sub({ start, expression: expr, optional: true, property, end: prev() }), allow_calls, true)); } if (!chain_contents) unexpected(); if (chain_contents instanceof AST_Chain) return chain_contents; return new AST_Chain({ start, expression: chain_contents, end: prev() }); } if (is("template_head")) { if (is_chain) { unexpected(); } return subscripts(new AST_PrefixedTemplateString({ start, prefix: expr, template_string: template_string(), end: prev() }), allow_calls); } return expr; }; function call_args() { var args = []; while (!is("punc", ")")) { if (is("expand", "...")) { next(); args.push(new AST_Expansion({ start: prev(), expression: expression(false), end: prev() })); } else { args.push(expression(false)); } if (!is("punc", ")")) { expect(","); } } next(); return args; } var maybe_unary = function(allow_calls, allow_arrows) { var start = S.token; if (start.type == "name" && start.value == "await" && can_await()) { next(); return _await_expression(); } if (is("operator") && UNARY_PREFIX.has(start.value)) { next(); handle_regexp(); var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); ex.start = start; ex.end = prev(); return ex; } var val = expr_atom(allow_calls, allow_arrows); while (is("operator") && UNARY_POSTFIX.has(S.token.value) && !has_newline_before(S.token)) { if (val instanceof AST_Arrow) unexpected(); val = make_unary(AST_UnaryPostfix, S.token, val); val.start = start; val.end = S.token; next(); } return val; }; function make_unary(ctor, token, expr) { var op = token.value; switch (op) { case "++": case "--": if (!is_assignable(expr)) croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); break; case "delete": if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); break; } return new ctor({ operator: op, expression: expr }); } var expr_op = function(left, min_prec, no_in) { var op = is("operator") ? S.token.value : null; if (op == "in" && no_in) op = null; if (op == "**" && left instanceof AST_UnaryPrefix && !is_token(left.start, "punc", "(") && left.operator !== "--" && left.operator !== "++") unexpected(left.start); var prec = op != null ? PRECEDENCE[op] : null; if (prec != null && (prec > min_prec || op === "**" && min_prec === prec)) { next(); var right = expr_op(maybe_unary(true), prec, no_in); return expr_op(new AST_Binary({ start: left.start, left, operator: op, right, end: right.end }), min_prec, no_in); } return left; }; function expr_ops(no_in) { return expr_op(maybe_unary(true, true), 0, no_in); } var maybe_conditional = function(no_in) { var start = S.token; var expr = expr_ops(no_in); if (is("operator", "?")) { next(); var yes = expression(false); expect(":"); return new AST_Conditional({ start, condition: expr, consequent: yes, alternative: expression(false, no_in), end: prev() }); } return expr; }; function is_assignable(expr) { return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; } function to_destructuring(node) { if (node instanceof AST_Object) { node = new AST_Destructuring({ start: node.start, names: node.properties.map(to_destructuring), is_array: false, end: node.end }); } else if (node instanceof AST_Array) { var names = []; for (var i = 0; i < node.elements.length; i++) { if (node.elements[i] instanceof AST_Expansion) { if (i + 1 !== node.elements.length) { token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); } node.elements[i].expression = to_destructuring(node.elements[i].expression); } names.push(to_destructuring(node.elements[i])); } node = new AST_Destructuring({ start: node.start, names, is_array: true, end: node.end }); } else if (node instanceof AST_ObjectProperty) { node.value = to_destructuring(node.value); } else if (node instanceof AST_Assign) { node = new AST_DefaultAssign({ start: node.start, left: node.left, operator: "=", right: node.right, end: node.end }); } return node; } var maybe_assign = function(no_in) { handle_regexp(); var start = S.token; if (start.type == "name" && start.value == "yield") { if (is_in_generator()) { next(); return _yield_expression(); } else if (S.input.has_directive("use strict")) { token_error(S.token, "Unexpected yield identifier inside strict mode"); } } var left = maybe_conditional(no_in); var val = S.token.value; if (is("operator") && ASSIGNMENT.has(val)) { if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { next(); return new AST_Assign({ start, left, operator: val, right: maybe_assign(no_in), logical: LOGICAL_ASSIGNMENT.has(val), end: prev() }); } croak("Invalid assignment"); } return left; }; var to_expr_or_sequence = function(start, exprs) { if (exprs.length === 1) { return exprs[0]; } else if (exprs.length > 1) { return new AST_Sequence({ start, expressions: exprs, end: peek() }); } else { croak("Invalid parenthesized expression"); } }; var expression = function(commas, no_in) { var start = S.token; var exprs = []; while (true) { exprs.push(maybe_assign(no_in)); if (!commas || !is("punc", ",")) break; next(); commas = true; } return to_expr_or_sequence(start, exprs); }; function in_loop(cont) { ++S.in_loop; var ret = cont(); --S.in_loop; return ret; } if (options.expression) { return expression(true); } return function parse_toplevel() { var start = S.token; var body = []; S.input.push_directives_stack(); if (options.module) S.input.add_directive("use strict"); while (!is("eof")) { body.push(statement()); } S.input.pop_directives_stack(); var end = prev(); var toplevel = options.toplevel; if (toplevel) { toplevel.body = toplevel.body.concat(body); toplevel.end = end; } else { toplevel = new AST_Toplevel({ start, body, end }); } TEMPLATE_RAWS = /* @__PURE__ */ new Map(); return toplevel; }(); } function DEFNODE(type, props, ctor, methods, base = AST_Node) { if (!props) props = []; else props = props.split(/\s+/); var self_props = props; if (base && base.PROPS) props = props.concat(base.PROPS); const proto = base && Object.create(base.prototype); if (proto) { ctor.prototype = proto; ctor.BASE = base; } if (base) base.SUBCLASSES.push(ctor); ctor.prototype.CTOR = ctor; ctor.prototype.constructor = ctor; ctor.PROPS = props || null; ctor.SELF_PROPS = self_props; ctor.SUBCLASSES = []; if (type) { ctor.prototype.TYPE = ctor.TYPE = type; } if (methods) { for (let i in methods) if (HOP(methods, i)) { if (i[0] === "$") { ctor[i.substr(1)] = methods[i]; } else { ctor.prototype[i] = methods[i]; } } } ctor.DEFMETHOD = function(name, method) { this.prototype[name] = method; }; return ctor; } const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); const set_tok_flag = (tok, flag, truth) => { if (truth) { tok.flags |= flag; } else { tok.flags &= ~flag; } }; const TOK_FLAG_NLB = 1; const TOK_FLAG_QUOTE_SINGLE = 2; const TOK_FLAG_QUOTE_EXISTS = 4; const TOK_FLAG_TEMPLATE_END = 8; class AST_Token { constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { this.flags = nlb ? 1 : 0; this.type = type; this.value = value; this.line = line; this.col = col; this.pos = pos; this.comments_before = comments_before; this.comments_after = comments_after; this.file = file; Object.seal(this); } [Symbol.for("nodejs.util.inspect.custom")](_depth, options) { const special = (str) => options.stylize(str, "special"); const quote = typeof this.value === "string" && this.value.includes("`") ? "'" : "`"; const value = `${quote}${this.value}${quote}`; return `${special("[AST_Token")} ${value} at ${this.line}:${this.col}${special("]")}`; } get nlb() { return has_tok_flag(this, TOK_FLAG_NLB); } set nlb(new_nlb) { set_tok_flag(this, TOK_FLAG_NLB, new_nlb); } get quote() { return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) ? "" : has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'; } set quote(quote_type) { set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); } get template_end() { return has_tok_flag(this, TOK_FLAG_TEMPLATE_END); } set template_end(new_template_end) { set_tok_flag(this, TOK_FLAG_TEMPLATE_END, new_template_end); } } var AST_Node = DEFNODE("Node", "start end", function AST_Node2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { _clone: function(deep) { if (deep) { var self2 = this.clone(); return self2.transform(new TreeTransformer(function(node) { if (node !== self2) { return node.clone(true); } })); } return new this.CTOR(this); }, clone: function(deep) { return this._clone(deep); }, $documentation: "Base class of all AST nodes", $propdoc: { start: "[AST_Token] The first token of this node", end: "[AST_Token] The last token of this node" }, _walk: function(visitor) { return visitor._visit(this); }, walk: function(visitor) { return this._walk(visitor); }, _children_backwards: () => { } }, null); var AST_Statement = DEFNODE("Statement", null, function AST_Statement2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class of all statements" }); var AST_Debugger = DEFNODE("Debugger", null, function AST_Debugger2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Represents a debugger statement" }, AST_Statement); var AST_Directive = DEFNODE("Directive", "value quote", function AST_Directive2(props) { if (props) { this.value = props.value; this.quote = props.quote; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: 'Represents a directive, like "use strict";', $propdoc: { value: "[string] The value of this directive as a plain string (it's not an AST_String!)", quote: "[string] the original quote character" } }, AST_Statement); var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", function AST_SimpleStatement2(props) { if (props) { this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", $propdoc: { body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" }, _walk: function(visitor) { return visitor._visit(this, function() { this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); } }, AST_Statement); function walk_body(node, visitor) { const body = node.body; for (var i = 0, len = body.length; i < len; i++) { body[i]._walk(visitor); } } function clone_block_scope(deep) { var clone = this._clone(deep); if (this.block_scope) { clone.block_scope = this.block_scope.clone(); } return clone; } var AST_Block = DEFNODE("Block", "body block_scope", function AST_Block2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A body of statements (usually braced)", $propdoc: { body: "[AST_Statement*] an array of statements", block_scope: "[AST_Scope] the block scope" }, _walk: function(visitor) { return visitor._visit(this, function() { walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); }, clone: clone_block_scope }, AST_Statement); var AST_BlockStatement = DEFNODE("BlockStatement", null, function AST_BlockStatement2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A block statement" }, AST_Block); var AST_EmptyStatement = DEFNODE("EmptyStatement", null, function AST_EmptyStatement2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The empty statement (empty block or simply a semicolon)" }, AST_Statement); var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", function AST_StatementWithBody2(props) { if (props) { this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", $propdoc: { body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" } }, AST_Statement); var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", function AST_LabeledStatement2(props) { if (props) { this.label = props.label; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Statement with a label", $propdoc: { label: "[AST_Label] a label definition" }, _walk: function(visitor) { return visitor._visit(this, function() { this.label._walk(visitor); this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); push2(this.label); }, clone: function(deep) { var node = this._clone(deep); if (deep) { var label = node.label; var def = this.label; node.walk(new TreeWalker(function(node2) { if (node2 instanceof AST_LoopControl && node2.label && node2.label.thedef === def) { node2.label.thedef = label; label.references.push(node2); } })); } return node; } }, AST_StatementWithBody); var AST_IterationStatement = DEFNODE("IterationStatement", "block_scope", function AST_IterationStatement2(props) { if (props) { this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Internal class. All loops inherit from it.", $propdoc: { block_scope: "[AST_Scope] the block scope for this iteration statement." }, clone: clone_block_scope }, AST_StatementWithBody); var AST_DWLoop = DEFNODE("DWLoop", "condition", function AST_DWLoop2(props) { if (props) { this.condition = props.condition; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for do/while statements", $propdoc: { condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" } }, AST_IterationStatement); var AST_Do = DEFNODE("Do", null, function AST_Do2(props) { if (props) { this.condition = props.condition; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `do` statement", _walk: function(visitor) { return visitor._visit(this, function() { this.body._walk(visitor); this.condition._walk(visitor); }); }, _children_backwards(push2) { push2(this.condition); push2(this.body); } }, AST_DWLoop); var AST_While = DEFNODE("While", null, function AST_While2(props) { if (props) { this.condition = props.condition; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `while` statement", _walk: function(visitor) { return visitor._visit(this, function() { this.condition._walk(visitor); this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); push2(this.condition); } }, AST_DWLoop); var AST_For = DEFNODE("For", "init condition step", function AST_For2(props) { if (props) { this.init = props.init; this.condition = props.condition; this.step = props.step; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `for` statement", $propdoc: { init: "[AST_Node?] the `for` initialization code, or null if empty", condition: "[AST_Node?] the `for` termination clause, or null if empty", step: "[AST_Node?] the `for` update clause, or null if empty" }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.init) this.init._walk(visitor); if (this.condition) this.condition._walk(visitor); if (this.step) this.step._walk(visitor); this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); if (this.step) push2(this.step); if (this.condition) push2(this.condition); if (this.init) push2(this.init); } }, AST_IterationStatement); var AST_ForIn = DEFNODE("ForIn", "init object", function AST_ForIn2(props) { if (props) { this.init = props.init; this.object = props.object; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `for ... in` statement", $propdoc: { init: "[AST_Node] the `for/in` initialization code", object: "[AST_Node] the object that we're looping through" }, _walk: function(visitor) { return visitor._visit(this, function() { this.init._walk(visitor); this.object._walk(visitor); this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); if (this.object) push2(this.object); if (this.init) push2(this.init); } }, AST_IterationStatement); var AST_ForOf = DEFNODE("ForOf", "await", function AST_ForOf2(props) { if (props) { this.await = props.await; this.init = props.init; this.object = props.object; this.block_scope = props.block_scope; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `for ... of` statement" }, AST_ForIn); var AST_With = DEFNODE("With", "expression", function AST_With2(props) { if (props) { this.expression = props.expression; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `with` statement", $propdoc: { expression: "[AST_Node] the `with` expression" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); this.body._walk(visitor); }); }, _children_backwards(push2) { push2(this.body); push2(this.expression); } }, AST_StatementWithBody); var AST_Scope = DEFNODE("Scope", "variables uses_with uses_eval parent_scope enclosed cname", function AST_Scope2(props) { if (props) { this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for all statements introducing a lexical scope", $propdoc: { variables: "[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope", uses_with: "[boolean/S] tells whether this scope uses the `with` statement", uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", parent_scope: "[AST_Scope?/S] link to the parent scope", enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", cname: "[integer/S] current index for mangling variables (used internally by the mangler)" }, get_defun_scope: function() { var self2 = this; while (self2.is_block_scope()) { self2 = self2.parent_scope; } return self2; }, clone: function(deep, toplevel) { var node = this._clone(deep); if (deep && this.variables && toplevel && !this._block_scope) { node.figure_out_scope({}, { toplevel, parent_scope: this.parent_scope }); } else { if (this.variables) node.variables = new Map(this.variables); if (this.enclosed) node.enclosed = this.enclosed.slice(); if (this._block_scope) node._block_scope = this._block_scope; } return node; }, pinned: function() { return this.uses_eval || this.uses_with; } }, AST_Block); var AST_Toplevel = DEFNODE("Toplevel", "globals", function AST_Toplevel2(props) { if (props) { this.globals = props.globals; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The toplevel scope", $propdoc: { globals: "[Map/S] a map of name -> SymbolDef for all undeclared names" }, wrap_commonjs: function(name) { var body = this.body; var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; wrapped_tl = parse(wrapped_tl); wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { if (node instanceof AST_Directive && node.value == "$ORIG") { return MAP.splice(body); } })); return wrapped_tl; }, wrap_enclose: function(args_values) { if (typeof args_values != "string") args_values = ""; var index = args_values.indexOf(":"); if (index < 0) index = args_values.length; var body = this.body; return parse([ "(function(", args_values.slice(0, index), '){"$ORIG"})(', args_values.slice(index + 1), ")" ].join("")).transform(new TreeTransformer(function(node) { if (node instanceof AST_Directive && node.value == "$ORIG") { return MAP.splice(body); } })); } }, AST_Scope); var AST_Expansion = DEFNODE("Expansion", "expression", function AST_Expansion2(props) { if (props) { this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", $propdoc: { expression: "[AST_Node] the thing to be expanded" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression.walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }); var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments is_generator async", function AST_Lambda2(props) { if (props) { this.name = props.name; this.argnames = props.argnames; this.uses_arguments = props.uses_arguments; this.is_generator = props.is_generator; this.async = props.async; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for functions", $propdoc: { name: "[AST_SymbolDeclaration?] the name of this function", argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", is_generator: "[boolean] is this a generator method", async: "[boolean] is this method async" }, args_as_names: function() { var out = []; for (var i = 0; i < this.argnames.length; i++) { if (this.argnames[i] instanceof AST_Destructuring) { out.push(...this.argnames[i].all_symbols()); } else { out.push(this.argnames[i]); } } return out; }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.name) this.name._walk(visitor); var argnames = this.argnames; for (var i = 0, len = argnames.length; i < len; i++) { argnames[i]._walk(visitor); } walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); i = this.argnames.length; while (i--) push2(this.argnames[i]); if (this.name) push2(this.name); }, is_braceless() { return this.body[0] instanceof AST_Return && this.body[0].value; }, length_property() { let length = 0; for (const arg of this.argnames) { if (arg instanceof AST_SymbolFunarg || arg instanceof AST_Destructuring) { length++; } } return length; } }, AST_Scope); var AST_Accessor = DEFNODE("Accessor", null, function AST_Accessor2(props) { if (props) { this.name = props.name; this.argnames = props.argnames; this.uses_arguments = props.uses_arguments; this.is_generator = props.is_generator; this.async = props.async; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A setter/getter function. The `name` property is always null." }, AST_Lambda); var AST_Function = DEFNODE("Function", null, function AST_Function2(props) { if (props) { this.name = props.name; this.argnames = props.argnames; this.uses_arguments = props.uses_arguments; this.is_generator = props.is_generator; this.async = props.async; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A function expression" }, AST_Lambda); var AST_Arrow = DEFNODE("Arrow", null, function AST_Arrow2(props) { if (props) { this.name = props.name; this.argnames = props.argnames; this.uses_arguments = props.uses_arguments; this.is_generator = props.is_generator; this.async = props.async; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An ES6 Arrow function ((a) => b)" }, AST_Lambda); var AST_Defun = DEFNODE("Defun", null, function AST_Defun2(props) { if (props) { this.name = props.name; this.argnames = props.argnames; this.uses_arguments = props.uses_arguments; this.is_generator = props.is_generator; this.async = props.async; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A function definition" }, AST_Lambda); var AST_Destructuring = DEFNODE("Destructuring", "names is_array", function AST_Destructuring2(props) { if (props) { this.names = props.names; this.is_array = props.is_array; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", $propdoc: { "names": "[AST_Node*] Array of properties or elements", "is_array": "[Boolean] Whether the destructuring represents an object or array" }, _walk: function(visitor) { return visitor._visit(this, function() { this.names.forEach(function(name) { name._walk(visitor); }); }); }, _children_backwards(push2) { let i = this.names.length; while (i--) push2(this.names[i]); }, all_symbols: function() { var out = []; walk(this, (node) => { if (node instanceof AST_SymbolDeclaration) { out.push(node); } if (node instanceof AST_Lambda) { return true; } }); return out; } }); var AST_PrefixedTemplateString = DEFNODE("PrefixedTemplateString", "template_string prefix", function AST_PrefixedTemplateString2(props) { if (props) { this.template_string = props.template_string; this.prefix = props.prefix; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", $propdoc: { template_string: "[AST_TemplateString] The template string", prefix: "[AST_Node] The prefix, which will get called." }, _walk: function(visitor) { return visitor._visit(this, function() { this.prefix._walk(visitor); this.template_string._walk(visitor); }); }, _children_backwards(push2) { push2(this.template_string); push2(this.prefix); } }); var AST_TemplateString = DEFNODE("TemplateString", "segments", function AST_TemplateString2(props) { if (props) { this.segments = props.segments; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A template string literal", $propdoc: { segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." }, _walk: function(visitor) { return visitor._visit(this, function() { this.segments.forEach(function(seg) { seg._walk(visitor); }); }); }, _children_backwards(push2) { let i = this.segments.length; while (i--) push2(this.segments[i]); } }); var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", function AST_TemplateSegment2(props) { if (props) { this.value = props.value; this.raw = props.raw; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A segment of a template string literal", $propdoc: { value: "Content of the segment", raw: "Raw source of the segment" } }); var AST_Jump = DEFNODE("Jump", null, function AST_Jump2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for \u201Cjumps\u201D (for now that's `return`, `throw`, `break` and `continue`)" }, AST_Statement); var AST_Exit = DEFNODE("Exit", "value", function AST_Exit2(props) { if (props) { this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for \u201Cexits\u201D (`return` and `throw`)", $propdoc: { value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" }, _walk: function(visitor) { return visitor._visit(this, this.value && function() { this.value._walk(visitor); }); }, _children_backwards(push2) { if (this.value) push2(this.value); } }, AST_Jump); var AST_Return = DEFNODE("Return", null, function AST_Return2(props) { if (props) { this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `return` statement" }, AST_Exit); var AST_Throw = DEFNODE("Throw", null, function AST_Throw2(props) { if (props) { this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `throw` statement" }, AST_Exit); var AST_LoopControl = DEFNODE("LoopControl", "label", function AST_LoopControl2(props) { if (props) { this.label = props.label; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for loop control statements (`break` and `continue`)", $propdoc: { label: "[AST_LabelRef?] the label, or null if none" }, _walk: function(visitor) { return visitor._visit(this, this.label && function() { this.label._walk(visitor); }); }, _children_backwards(push2) { if (this.label) push2(this.label); } }, AST_Jump); var AST_Break = DEFNODE("Break", null, function AST_Break2(props) { if (props) { this.label = props.label; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `break` statement" }, AST_LoopControl); var AST_Continue = DEFNODE("Continue", null, function AST_Continue2(props) { if (props) { this.label = props.label; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `continue` statement" }, AST_LoopControl); var AST_Await = DEFNODE("Await", "expression", function AST_Await2(props) { if (props) { this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An `await` statement", $propdoc: { expression: "[AST_Node] the mandatory expression being awaited" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }); var AST_Yield = DEFNODE("Yield", "expression is_star", function AST_Yield2(props) { if (props) { this.expression = props.expression; this.is_star = props.is_star; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `yield` statement", $propdoc: { expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", is_star: "[Boolean] Whether this is a yield or yield* statement" }, _walk: function(visitor) { return visitor._visit(this, this.expression && function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { if (this.expression) push2(this.expression); } }); var AST_If = DEFNODE("If", "condition alternative", function AST_If2(props) { if (props) { this.condition = props.condition; this.alternative = props.alternative; this.body = props.body; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `if` statement", $propdoc: { condition: "[AST_Node] the `if` condition", alternative: "[AST_Statement?] the `else` part, or null if not present" }, _walk: function(visitor) { return visitor._visit(this, function() { this.condition._walk(visitor); this.body._walk(visitor); if (this.alternative) this.alternative._walk(visitor); }); }, _children_backwards(push2) { if (this.alternative) { push2(this.alternative); } push2(this.body); push2(this.condition); } }, AST_StatementWithBody); var AST_Switch = DEFNODE("Switch", "expression", function AST_Switch2(props) { if (props) { this.expression = props.expression; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `switch` statement", $propdoc: { expression: "[AST_Node] the `switch` \u201Cdiscriminant\u201D" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); push2(this.expression); } }, AST_Block); var AST_SwitchBranch = DEFNODE("SwitchBranch", null, function AST_SwitchBranch2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for `switch` branches" }, AST_Block); var AST_Default = DEFNODE("Default", null, function AST_Default2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `default` switch branch" }, AST_SwitchBranch); var AST_Case = DEFNODE("Case", "expression", function AST_Case2(props) { if (props) { this.expression = props.expression; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `case` switch branch", $propdoc: { expression: "[AST_Node] the `case` expression" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); push2(this.expression); } }, AST_SwitchBranch); var AST_Try = DEFNODE("Try", "body bcatch bfinally", function AST_Try2(props) { if (props) { this.body = props.body; this.bcatch = props.bcatch; this.bfinally = props.bfinally; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `try` statement", $propdoc: { body: "[AST_TryBlock] the try block", bcatch: "[AST_Catch?] the catch block, or null if not present", bfinally: "[AST_Finally?] the finally block, or null if not present" }, _walk: function(visitor) { return visitor._visit(this, function() { this.body._walk(visitor); if (this.bcatch) this.bcatch._walk(visitor); if (this.bfinally) this.bfinally._walk(visitor); }); }, _children_backwards(push2) { if (this.bfinally) push2(this.bfinally); if (this.bcatch) push2(this.bcatch); push2(this.body); } }, AST_Statement); var AST_TryBlock = DEFNODE("TryBlock", null, function AST_TryBlock2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `try` block of a try statement" }, AST_Block); var AST_Catch = DEFNODE("Catch", "argname", function AST_Catch2(props) { if (props) { this.argname = props.argname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `catch` node; only makes sense as part of a `try` statement", $propdoc: { argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.argname) this.argname._walk(visitor); walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); if (this.argname) push2(this.argname); } }, AST_Block); var AST_Finally = DEFNODE("Finally", null, function AST_Finally2(props) { if (props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `finally` node; only makes sense as part of a `try` statement" }, AST_Block); var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definitions2(props) { if (props) { this.definitions = props.definitions; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", $propdoc: { definitions: "[AST_VarDef*] array of variable definitions" }, _walk: function(visitor) { return visitor._visit(this, function() { var definitions = this.definitions; for (var i = 0, len = definitions.length; i < len; i++) { definitions[i]._walk(visitor); } }); }, _children_backwards(push2) { let i = this.definitions.length; while (i--) push2(this.definitions[i]); } }, AST_Statement); var AST_Var = DEFNODE("Var", null, function AST_Var2(props) { if (props) { this.definitions = props.definitions; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `var` statement" }, AST_Definitions); var AST_Let = DEFNODE("Let", null, function AST_Let2(props) { if (props) { this.definitions = props.definitions; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `let` statement" }, AST_Definitions); var AST_Const = DEFNODE("Const", null, function AST_Const2(props) { if (props) { this.definitions = props.definitions; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A `const` statement" }, AST_Definitions); var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef2(props) { if (props) { this.name = props.name; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A variable declaration; only appears in a AST_Definitions node", $propdoc: { name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", value: "[AST_Node?] initializer, or null of there's no initializer" }, _walk: function(visitor) { return visitor._visit(this, function() { this.name._walk(visitor); if (this.value) this.value._walk(visitor); }); }, _children_backwards(push2) { if (this.value) push2(this.value); push2(this.name); }, declarations_as_names() { if (this.name instanceof AST_SymbolDeclaration) { return [this]; } else { return this.name.all_symbols(); } } }); var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_NameMapping2(props) { if (props) { this.foreign_name = props.foreign_name; this.name = props.name; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The part of the export/import statement that declare names from a module.", $propdoc: { foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." }, _walk: function(visitor) { return visitor._visit(this, function() { this.foreign_name._walk(visitor); this.name._walk(visitor); }); }, _children_backwards(push2) { push2(this.name); push2(this.foreign_name); } }); var AST_Import = DEFNODE("Import", "imported_name imported_names module_name assert_clause", function AST_Import2(props) { if (props) { this.imported_name = props.imported_name; this.imported_names = props.imported_names; this.module_name = props.module_name; this.assert_clause = props.assert_clause; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An `import` statement", $propdoc: { imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", imported_names: "[AST_NameMapping*] The names of non-default imported variables", module_name: "[AST_String] String literal describing where this module came from", assert_clause: "[AST_Object?] The import assertion" }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.imported_name) { this.imported_name._walk(visitor); } if (this.imported_names) { this.imported_names.forEach(function(name_import) { name_import._walk(visitor); }); } this.module_name._walk(visitor); }); }, _children_backwards(push2) { push2(this.module_name); if (this.imported_names) { let i = this.imported_names.length; while (i--) push2(this.imported_names[i]); } if (this.imported_name) push2(this.imported_name); } }); var AST_ImportMeta = DEFNODE("ImportMeta", null, function AST_ImportMeta2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A reference to import.meta" }); var AST_Export = DEFNODE("Export", "exported_definition exported_value is_default exported_names module_name assert_clause", function AST_Export2(props) { if (props) { this.exported_definition = props.exported_definition; this.exported_value = props.exported_value; this.is_default = props.is_default; this.exported_names = props.exported_names; this.module_name = props.module_name; this.assert_clause = props.assert_clause; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An `export` statement", $propdoc: { exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", exported_value: "[AST_Node?] An exported value", exported_names: "[AST_NameMapping*?] List of exported names", module_name: "[AST_String?] Name of the file to load exports from", is_default: "[Boolean] Whether this is the default exported value of this module", assert_clause: "[AST_Object?] The import assertion" }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.exported_definition) { this.exported_definition._walk(visitor); } if (this.exported_value) { this.exported_value._walk(visitor); } if (this.exported_names) { this.exported_names.forEach(function(name_export) { name_export._walk(visitor); }); } if (this.module_name) { this.module_name._walk(visitor); } }); }, _children_backwards(push2) { if (this.module_name) push2(this.module_name); if (this.exported_names) { let i = this.exported_names.length; while (i--) push2(this.exported_names[i]); } if (this.exported_value) push2(this.exported_value); if (this.exported_definition) push2(this.exported_definition); } }, AST_Statement); var AST_Call = DEFNODE("Call", "expression args optional _annotations", function AST_Call2(props) { if (props) { this.expression = props.expression; this.args = props.args; this.optional = props.optional; this._annotations = props._annotations; this.start = props.start; this.end = props.end; this.initialize(); } this.flags = 0; }, { $documentation: "A function call expression", $propdoc: { expression: "[AST_Node] expression to invoke as function", args: "[AST_Node*] array of arguments", optional: "[boolean] whether this is an optional call (IE ?.() )", _annotations: "[number] bitfield containing information about the call" }, initialize() { if (this._annotations == null) this._annotations = 0; }, _walk(visitor) { return visitor._visit(this, function() { var args = this.args; for (var i = 0, len = args.length; i < len; i++) { args[i]._walk(visitor); } this.expression._walk(visitor); }); }, _children_backwards(push2) { let i = this.args.length; while (i--) push2(this.args[i]); push2(this.expression); } }); var AST_New = DEFNODE("New", null, function AST_New2(props) { if (props) { this.expression = props.expression; this.args = props.args; this.optional = props.optional; this._annotations = props._annotations; this.start = props.start; this.end = props.end; this.initialize(); } this.flags = 0; }, { $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" }, AST_Call); var AST_Sequence = DEFNODE("Sequence", "expressions", function AST_Sequence2(props) { if (props) { this.expressions = props.expressions; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A sequence expression (comma-separated expressions)", $propdoc: { expressions: "[AST_Node*] array of expressions (at least two)" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expressions.forEach(function(node) { node._walk(visitor); }); }); }, _children_backwards(push2) { let i = this.expressions.length; while (i--) push2(this.expressions[i]); } }); var AST_PropAccess = DEFNODE("PropAccess", "expression property optional", function AST_PropAccess2(props) { if (props) { this.expression = props.expression; this.property = props.property; this.optional = props.optional; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: 'Base class for property access expressions, i.e. `a.foo` or `a["foo"]`', $propdoc: { expression: "[AST_Node] the \u201Ccontainer\u201D expression", property: "[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node", optional: "[boolean] whether this is an optional property access (IE ?.)" } }); var AST_Dot = DEFNODE("Dot", "quote", function AST_Dot2(props) { if (props) { this.quote = props.quote; this.expression = props.expression; this.property = props.property; this.optional = props.optional; this._annotations = props._annotations; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A dotted property access expression", $propdoc: { quote: "[string] the original quote character when transformed from AST_Sub" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }, AST_PropAccess); var AST_DotHash = DEFNODE("DotHash", "", function AST_DotHash2(props) { if (props) { this.expression = props.expression; this.property = props.property; this.optional = props.optional; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A dotted property access to a private property", _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }, AST_PropAccess); var AST_Sub = DEFNODE("Sub", null, function AST_Sub2(props) { if (props) { this.expression = props.expression; this.property = props.property; this.optional = props.optional; this._annotations = props._annotations; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: 'Index-style property access, i.e. `a["foo"]`', _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); this.property._walk(visitor); }); }, _children_backwards(push2) { push2(this.property); push2(this.expression); } }, AST_PropAccess); var AST_Chain = DEFNODE("Chain", "expression", function AST_Chain2(props) { if (props) { this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A chain expression like a?.b?.(c)?.[d]", $propdoc: { expression: "[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element." }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }); var AST_Unary = DEFNODE("Unary", "operator expression", function AST_Unary2(props) { if (props) { this.operator = props.operator; this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for unary expressions", $propdoc: { operator: "[string] the operator", expression: "[AST_Node] expression that this unary operator applies to" }, _walk: function(visitor) { return visitor._visit(this, function() { this.expression._walk(visitor); }); }, _children_backwards(push2) { push2(this.expression); } }); var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, function AST_UnaryPrefix2(props) { if (props) { this.operator = props.operator; this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" }, AST_Unary); var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, function AST_UnaryPostfix2(props) { if (props) { this.operator = props.operator; this.expression = props.expression; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Unary postfix expression, i.e. `i++`" }, AST_Unary); var AST_Binary = DEFNODE("Binary", "operator left right", function AST_Binary2(props) { if (props) { this.operator = props.operator; this.left = props.left; this.right = props.right; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Binary expression, i.e. `a + b`", $propdoc: { left: "[AST_Node] left-hand side expression", operator: "[string] the operator", right: "[AST_Node] right-hand side expression" }, _walk: function(visitor) { return visitor._visit(this, function() { this.left._walk(visitor); this.right._walk(visitor); }); }, _children_backwards(push2) { push2(this.right); push2(this.left); } }); var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", function AST_Conditional2(props) { if (props) { this.condition = props.condition; this.consequent = props.consequent; this.alternative = props.alternative; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", $propdoc: { condition: "[AST_Node]", consequent: "[AST_Node]", alternative: "[AST_Node]" }, _walk: function(visitor) { return visitor._visit(this, function() { this.condition._walk(visitor); this.consequent._walk(visitor); this.alternative._walk(visitor); }); }, _children_backwards(push2) { push2(this.alternative); push2(this.consequent); push2(this.condition); } }); var AST_Assign = DEFNODE("Assign", "logical", function AST_Assign2(props) { if (props) { this.logical = props.logical; this.operator = props.operator; this.left = props.left; this.right = props.right; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An assignment expression \u2014 `a = b + 5`", $propdoc: { logical: "Whether it's a logical assignment" } }, AST_Binary); var AST_DefaultAssign = DEFNODE("DefaultAssign", null, function AST_DefaultAssign2(props) { if (props) { this.operator = props.operator; this.left = props.left; this.right = props.right; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A default assignment expression like in `(a = 3) => a`" }, AST_Binary); var AST_Array = DEFNODE("Array", "elements", function AST_Array2(props) { if (props) { this.elements = props.elements; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An array literal", $propdoc: { elements: "[AST_Node*] array of elements" }, _walk: function(visitor) { return visitor._visit(this, function() { var elements = this.elements; for (var i = 0, len = elements.length; i < len; i++) { elements[i]._walk(visitor); } }); }, _children_backwards(push2) { let i = this.elements.length; while (i--) push2(this.elements[i]); } }); var AST_Object = DEFNODE("Object", "properties", function AST_Object2(props) { if (props) { this.properties = props.properties; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An object literal", $propdoc: { properties: "[AST_ObjectProperty*] array of properties" }, _walk: function(visitor) { return visitor._visit(this, function() { var properties = this.properties; for (var i = 0, len = properties.length; i < len; i++) { properties[i]._walk(visitor); } }); }, _children_backwards(push2) { let i = this.properties.length; while (i--) push2(this.properties[i]); } }); var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", function AST_ObjectProperty2(props) { if (props) { this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $documentation: "Base class for literal object properties", $propdoc: { key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", value: "[AST_Node] property value. For getters and setters this is an AST_Accessor." }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.key instanceof AST_Node) this.key._walk(visitor); this.value._walk(visitor); }); }, _children_backwards(push2) { push2(this.value); if (this.key instanceof AST_Node) push2(this.key); } }); var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", function AST_ObjectKeyVal2(props) { if (props) { this.quote = props.quote; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $documentation: "A key: value object property", $propdoc: { quote: "[string] the original quote character" }, computed_key() { return this.key instanceof AST_Node; } }, AST_ObjectProperty); var AST_PrivateSetter = DEFNODE("PrivateSetter", "static", function AST_PrivateSetter2(props) { if (props) { this.static = props.static; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $propdoc: { static: "[boolean] whether this is a static private setter" }, $documentation: "A private setter property", computed_key() { return false; } }, AST_ObjectProperty); var AST_PrivateGetter = DEFNODE("PrivateGetter", "static", function AST_PrivateGetter2(props) { if (props) { this.static = props.static; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $propdoc: { static: "[boolean] whether this is a static private getter" }, $documentation: "A private getter property", computed_key() { return false; } }, AST_ObjectProperty); var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", function AST_ObjectSetter2(props) { if (props) { this.quote = props.quote; this.static = props.static; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $propdoc: { quote: "[string|undefined] the original quote character, if any", static: "[boolean] whether this is a static setter (classes only)" }, $documentation: "An object setter property", computed_key() { return !(this.key instanceof AST_SymbolMethod); } }, AST_ObjectProperty); var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", function AST_ObjectGetter2(props) { if (props) { this.quote = props.quote; this.static = props.static; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $propdoc: { quote: "[string|undefined] the original quote character, if any", static: "[boolean] whether this is a static getter (classes only)" }, $documentation: "An object getter property", computed_key() { return !(this.key instanceof AST_SymbolMethod); } }, AST_ObjectProperty); var AST_ConciseMethod = DEFNODE("ConciseMethod", "quote static is_generator async", function AST_ConciseMethod2(props) { if (props) { this.quote = props.quote; this.static = props.static; this.is_generator = props.is_generator; this.async = props.async; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $propdoc: { quote: "[string|undefined] the original quote character, if any", static: "[boolean] is this method static (classes only)", is_generator: "[boolean] is this a generator method", async: "[boolean] is this method async" }, $documentation: "An ES6 concise method inside an object or class", computed_key() { return !(this.key instanceof AST_SymbolMethod); } }, AST_ObjectProperty); var AST_PrivateMethod = DEFNODE("PrivateMethod", "", function AST_PrivateMethod2(props) { if (props) { this.quote = props.quote; this.static = props.static; this.is_generator = props.is_generator; this.async = props.async; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A private class method inside a class" }, AST_ConciseMethod); var AST_Class = DEFNODE("Class", "name extends properties", function AST_Class2(props) { if (props) { this.name = props.name; this.extends = props.extends; this.properties = props.properties; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $propdoc: { name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", extends: "[AST_Node]? optional parent class", properties: "[AST_ObjectProperty*] array of properties" }, $documentation: "An ES6 class", _walk: function(visitor) { return visitor._visit(this, function() { if (this.name) { this.name._walk(visitor); } if (this.extends) { this.extends._walk(visitor); } this.properties.forEach((prop) => prop._walk(visitor)); }); }, _children_backwards(push2) { let i = this.properties.length; while (i--) push2(this.properties[i]); if (this.extends) push2(this.extends); if (this.name) push2(this.name); }, visit_nondeferred_class_parts(visitor) { if (this.extends) { this.extends._walk(visitor); } this.properties.forEach((prop) => { if (prop instanceof AST_ClassStaticBlock) { prop._walk(visitor); return; } if (prop.computed_key()) { visitor.push(prop); prop.key._walk(visitor); visitor.pop(); } if ((prop instanceof AST_ClassPrivateProperty || prop instanceof AST_ClassProperty) && prop.static && prop.value) { visitor.push(prop); prop.value._walk(visitor); visitor.pop(); } }); }, visit_deferred_class_parts(visitor) { this.properties.forEach((prop) => { if (prop instanceof AST_ConciseMethod) { prop.walk(visitor); } else if (prop instanceof AST_ClassProperty && !prop.static && prop.value) { visitor.push(prop); prop.value._walk(visitor); visitor.pop(); } }); } }, AST_Scope); var AST_ClassProperty = DEFNODE("ClassProperty", "static quote", function AST_ClassProperty2(props) { if (props) { this.static = props.static; this.quote = props.quote; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $documentation: "A class property", $propdoc: { static: "[boolean] whether this is a static key", quote: "[string] which quote is being used" }, _walk: function(visitor) { return visitor._visit(this, function() { if (this.key instanceof AST_Node) this.key._walk(visitor); if (this.value instanceof AST_Node) this.value._walk(visitor); }); }, _children_backwards(push2) { if (this.value instanceof AST_Node) push2(this.value); if (this.key instanceof AST_Node) push2(this.key); }, computed_key() { return !(this.key instanceof AST_SymbolClassProperty); } }, AST_ObjectProperty); var AST_ClassPrivateProperty = DEFNODE("ClassPrivateProperty", "", function AST_ClassPrivateProperty2(props) { if (props) { this.static = props.static; this.quote = props.quote; this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A class property for a private property" }, AST_ClassProperty); var AST_PrivateIn = DEFNODE("PrivateIn", "key value", function AST_PrivateIn2(props) { if (props) { this.key = props.key; this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "An `in` binop when the key is private, eg #x in this", _walk: function(visitor) { return visitor._visit(this, function() { this.key._walk(visitor); this.value._walk(visitor); }); }, _children_backwards(push2) { push2(this.value); push2(this.key); } }); var AST_DefClass = DEFNODE("DefClass", null, function AST_DefClass2(props) { if (props) { this.name = props.name; this.extends = props.extends; this.properties = props.properties; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A class definition" }, AST_Class); var AST_ClassStaticBlock = DEFNODE("ClassStaticBlock", "body block_scope", function AST_ClassStaticBlock2(props) { this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; }, { $documentation: "A block containing statements to be executed in the context of the class", $propdoc: { body: "[AST_Statement*] an array of statements" }, _walk: function(visitor) { return visitor._visit(this, function() { walk_body(this, visitor); }); }, _children_backwards(push2) { let i = this.body.length; while (i--) push2(this.body[i]); }, clone: clone_block_scope, computed_key: () => false }, AST_Scope); var AST_ClassExpression = DEFNODE("ClassExpression", null, function AST_ClassExpression2(props) { if (props) { this.name = props.name; this.extends = props.extends; this.properties = props.properties; this.variables = props.variables; this.uses_with = props.uses_with; this.uses_eval = props.uses_eval; this.parent_scope = props.parent_scope; this.enclosed = props.enclosed; this.cname = props.cname; this.body = props.body; this.block_scope = props.block_scope; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A class expression." }, AST_Class); var AST_Symbol = DEFNODE("Symbol", "scope name thedef", function AST_Symbol2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $propdoc: { name: "[string] name of this symbol", scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", thedef: "[SymbolDef/S] the definition of this symbol" }, $documentation: "Base class for all symbols" }); var AST_NewTarget = DEFNODE("NewTarget", null, function AST_NewTarget2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A reference to new.target" }); var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", function AST_SymbolDeclaration2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)" }, AST_Symbol); var AST_SymbolVar = DEFNODE("SymbolVar", null, function AST_SymbolVar2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol defining a variable" }, AST_SymbolDeclaration); var AST_SymbolBlockDeclaration = DEFNODE("SymbolBlockDeclaration", null, function AST_SymbolBlockDeclaration2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for block-scoped declaration symbols" }, AST_SymbolDeclaration); var AST_SymbolConst = DEFNODE("SymbolConst", null, function AST_SymbolConst2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A constant declaration" }, AST_SymbolBlockDeclaration); var AST_SymbolLet = DEFNODE("SymbolLet", null, function AST_SymbolLet2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A block-scoped `let` declaration" }, AST_SymbolBlockDeclaration); var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, function AST_SymbolFunarg2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol naming a function argument" }, AST_SymbolVar); var AST_SymbolDefun = DEFNODE("SymbolDefun", null, function AST_SymbolDefun2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol defining a function" }, AST_SymbolDeclaration); var AST_SymbolMethod = DEFNODE("SymbolMethod", null, function AST_SymbolMethod2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol in an object defining a method" }, AST_Symbol); var AST_SymbolClassProperty = DEFNODE("SymbolClassProperty", null, function AST_SymbolClassProperty2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol for a class property" }, AST_Symbol); var AST_SymbolLambda = DEFNODE("SymbolLambda", null, function AST_SymbolLambda2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol naming a function expression" }, AST_SymbolDeclaration); var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, function AST_SymbolDefClass2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." }, AST_SymbolBlockDeclaration); var AST_SymbolClass = DEFNODE("SymbolClass", null, function AST_SymbolClass2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol naming a class's name. Lexically scoped to the class." }, AST_SymbolDeclaration); var AST_SymbolCatch = DEFNODE("SymbolCatch", null, function AST_SymbolCatch2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol naming the exception in catch" }, AST_SymbolBlockDeclaration); var AST_SymbolImport = DEFNODE("SymbolImport", null, function AST_SymbolImport2(props) { if (props) { this.init = props.init; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol referring to an imported name" }, AST_SymbolBlockDeclaration); var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", null, function AST_SymbolImportForeign2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.quote = props.quote; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes" }, AST_Symbol); var AST_Label = DEFNODE("Label", "references", function AST_Label2(props) { if (props) { this.references = props.references; this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; this.initialize(); } this.flags = 0; }, { $documentation: "Symbol naming a label (declaration)", $propdoc: { references: "[AST_LoopControl*] a list of nodes referring to this label" }, initialize: function() { this.references = []; this.thedef = this; } }, AST_Symbol); var AST_SymbolRef = DEFNODE("SymbolRef", null, function AST_SymbolRef2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Reference to some symbol (not definition/declaration)" }, AST_Symbol); var AST_SymbolExport = DEFNODE("SymbolExport", null, function AST_SymbolExport2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.quote = props.quote; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Symbol referring to a name to export" }, AST_SymbolRef); var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", null, function AST_SymbolExportForeign2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.quote = props.quote; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes" }, AST_Symbol); var AST_LabelRef = DEFNODE("LabelRef", null, function AST_LabelRef2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Reference to a label symbol" }, AST_Symbol); var AST_SymbolPrivateProperty = DEFNODE("SymbolPrivateProperty", null, function AST_SymbolPrivateProperty2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A symbol that refers to a private property" }, AST_Symbol); var AST_This = DEFNODE("This", null, function AST_This2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `this` symbol" }, AST_Symbol); var AST_Super = DEFNODE("Super", null, function AST_Super2(props) { if (props) { this.scope = props.scope; this.name = props.name; this.thedef = props.thedef; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `super` symbol" }, AST_This); var AST_Constant = DEFNODE("Constant", null, function AST_Constant2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for all constants", getValue: function() { return this.value; } }); var AST_String = DEFNODE("String", "value quote", function AST_String2(props) { if (props) { this.value = props.value; this.quote = props.quote; this.start = props.start; this.end = props.end; this._annotations = props._annotations; } this.flags = 0; }, { $documentation: "A string literal", $propdoc: { value: "[string] the contents of this string", quote: "[string] the original quote character" } }, AST_Constant); var AST_Number = DEFNODE("Number", "value raw", function AST_Number2(props) { if (props) { this.value = props.value; this.raw = props.raw; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A number literal", $propdoc: { value: "[number] the numeric value", raw: "[string] numeric value as string" } }, AST_Constant); var AST_BigInt = DEFNODE("BigInt", "value", function AST_BigInt2(props) { if (props) { this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A big int literal", $propdoc: { value: "[string] big int value" } }, AST_Constant); var AST_RegExp = DEFNODE("RegExp", "value", function AST_RegExp2(props) { if (props) { this.value = props.value; this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A regexp literal", $propdoc: { value: "[RegExp] the actual regexp" } }, AST_Constant); var AST_Atom = DEFNODE("Atom", null, function AST_Atom2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for atoms" }, AST_Constant); var AST_Null = DEFNODE("Null", null, function AST_Null2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `null` atom", value: null }, AST_Atom); var AST_NaN = DEFNODE("NaN", null, function AST_NaN2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The impossible value", value: 0 / 0 }, AST_Atom); var AST_Undefined = DEFNODE("Undefined", null, function AST_Undefined2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `undefined` value", value: function() { }() }, AST_Atom); var AST_Hole = DEFNODE("Hole", null, function AST_Hole2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "A hole in an array", value: function() { }() }, AST_Atom); var AST_Infinity = DEFNODE("Infinity", null, function AST_Infinity2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `Infinity` value", value: 1 / 0 }, AST_Atom); var AST_Boolean = DEFNODE("Boolean", null, function AST_Boolean2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "Base class for booleans" }, AST_Atom); var AST_False = DEFNODE("False", null, function AST_False2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `false` atom", value: false }, AST_Boolean); var AST_True = DEFNODE("True", null, function AST_True2(props) { if (props) { this.start = props.start; this.end = props.end; } this.flags = 0; }, { $documentation: "The `true` atom", value: true }, AST_Boolean); function walk(node, cb, to_visit = [node]) { const push2 = to_visit.push.bind(to_visit); while (to_visit.length) { const node2 = to_visit.pop(); const ret = cb(node2, to_visit); if (ret) { if (ret === walk_abort) return true; continue; } node2._children_backwards(push2); } return false; } function walk_parent(node, cb, initial_stack) { const to_visit = [node]; const push2 = to_visit.push.bind(to_visit); const stack = initial_stack ? initial_stack.slice() : []; const parent_pop_indices = []; let current; const info = { parent: (n = 0) => { if (n === -1) { return current; } if (initial_stack && n >= stack.length) { n -= stack.length; return initial_stack[initial_stack.length - (n + 1)]; } return stack[stack.length - (1 + n)]; } }; while (to_visit.length) { current = to_visit.pop(); while (parent_pop_indices.length && to_visit.length == parent_pop_indices[parent_pop_indices.length - 1]) { stack.pop(); parent_pop_indices.pop(); } const ret = cb(current, info); if (ret) { if (ret === walk_abort) return true; continue; } const visit_length = to_visit.length; current._children_backwards(push2); if (to_visit.length > visit_length) { stack.push(current); parent_pop_indices.push(visit_length - 1); } } return false; } const walk_abort = Symbol("abort walk"); class TreeWalker { constructor(callback) { this.visit = callback; this.stack = []; this.directives = /* @__PURE__ */ Object.create(null); } _visit(node, descend) { this.push(node); var ret = this.visit(node, descend ? function() { descend.call(node); } : noop); if (!ret && descend) { descend.call(node); } this.pop(); return ret; } parent(n) { return this.stack[this.stack.length - 2 - (n || 0)]; } push(node) { if (node instanceof AST_Lambda) { this.directives = Object.create(this.directives); } else if (node instanceof AST_Directive && !this.directives[node.value]) { this.directives[node.value] = node; } else if (node instanceof AST_Class) { this.directives = Object.create(this.directives); if (!this.directives["use strict"]) { this.directives["use strict"] = node; } } this.stack.push(node); } pop() { var node = this.stack.pop(); if (node instanceof AST_Lambda || node instanceof AST_Class) { this.directives = Object.getPrototypeOf(this.directives); } } self() { return this.stack[this.stack.length - 1]; } find_parent(type) { var stack = this.stack; for (var i = stack.length; --i >= 0; ) { var x = stack[i]; if (x instanceof type) return x; } } find_scope() { var stack = this.stack; for (var i = stack.length; --i >= 0; ) { const p = stack[i]; if (p instanceof AST_Toplevel) return p; if (p instanceof AST_Lambda) return p; if (p.block_scope) return p.block_scope; } } has_directive(type) { var dir = this.directives[type]; if (dir) return dir; var node = this.stack[this.stack.length - 1]; if (node instanceof AST_Scope && node.body) { for (var i = 0; i < node.body.length; ++i) { var st = node.body[i]; if (!(st instanceof AST_Directive)) break; if (st.value == type) return st; } } } loopcontrol_target(node) { var stack = this.stack; if (node.label) for (var i = stack.length; --i >= 0; ) { var x = stack[i]; if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) return x.body; } else for (var i = stack.length; --i >= 0; ) { var x = stack[i]; if (x instanceof AST_IterationStatement || node instanceof AST_Break && x instanceof AST_Switch) return x; } } } class TreeTransformer extends TreeWalker { constructor(before, after) { super(); this.before = before; this.after = after; } } const _PURE = 1; const _INLINE = 2; const _NOINLINE = 4; const _KEY = 8; const _MANGLEPROP = 16; function def_transform(node, descend) { node.DEFMETHOD("transform", function(tw, in_list) { let transformed = void 0; tw.push(this); if (tw.before) transformed = tw.before(this, descend, in_list); if (transformed === void 0) { transformed = this; descend(transformed, tw); if (tw.after) { const after_ret = tw.after(transformed, in_list); if (after_ret !== void 0) transformed = after_ret; } } tw.pop(); return transformed; }); } def_transform(AST_Node, noop); def_transform(AST_LabeledStatement, function(self2, tw) { self2.label = self2.label.transform(tw); self2.body = self2.body.transform(tw); }); def_transform(AST_SimpleStatement, function(self2, tw) { self2.body = self2.body.transform(tw); }); def_transform(AST_Block, function(self2, tw) { self2.body = MAP(self2.body, tw); }); def_transform(AST_Do, function(self2, tw) { self2.body = self2.body.transform(tw); self2.condition = self2.condition.transform(tw); }); def_transform(AST_While, function(self2, tw) { self2.condition = self2.condition.transform(tw); self2.body = self2.body.transform(tw); }); def_transform(AST_For, function(self2, tw) { if (self2.init) self2.init = self2.init.transform(tw); if (self2.condition) self2.condition = self2.condition.transform(tw); if (self2.step) self2.step = self2.step.transform(tw); self2.body = self2.body.transform(tw); }); def_transform(AST_ForIn, function(self2, tw) { self2.init = self2.init.transform(tw); self2.object = self2.object.transform(tw); self2.body = self2.body.transform(tw); }); def_transform(AST_With, function(self2, tw) { self2.expression = self2.expression.transform(tw); self2.body = self2.body.transform(tw); }); def_transform(AST_Exit, function(self2, tw) { if (self2.value) self2.value = self2.value.transform(tw); }); def_transform(AST_LoopControl, function(self2, tw) { if (self2.label) self2.label = self2.label.transform(tw); }); def_transform(AST_If, function(self2, tw) { self2.condition = self2.condition.transform(tw); self2.body = self2.body.transform(tw); if (self2.alternative) self2.alternative = self2.alternative.transform(tw); }); def_transform(AST_Switch, function(self2, tw) { self2.expression = self2.expression.transform(tw); self2.body = MAP(self2.body, tw); }); def_transform(AST_Case, function(self2, tw) { self2.expression = self2.expression.transform(tw); self2.body = MAP(self2.body, tw); }); def_transform(AST_Try, function(self2, tw) { self2.body = self2.body.transform(tw); if (self2.bcatch) self2.bcatch = self2.bcatch.transform(tw); if (self2.bfinally) self2.bfinally = self2.bfinally.transform(tw); }); def_transform(AST_Catch, function(self2, tw) { if (self2.argname) self2.argname = self2.argname.transform(tw); self2.body = MAP(self2.body, tw); }); def_transform(AST_Definitions, function(self2, tw) { self2.definitions = MAP(self2.definitions, tw); }); def_transform(AST_VarDef, function(self2, tw) { self2.name = self2.name.transform(tw); if (self2.value) self2.value = self2.value.transform(tw); }); def_transform(AST_Destructuring, function(self2, tw) { self2.names = MAP(self2.names, tw); }); def_transform(AST_Lambda, function(self2, tw) { if (self2.name) self2.name = self2.name.transform(tw); self2.argnames = MAP(self2.argnames, tw, false); if (self2.body instanceof AST_Node) { self2.body = self2.body.transform(tw); } else { self2.body = MAP(self2.body, tw); } }); def_transform(AST_Call, function(self2, tw) { self2.expression = self2.expression.transform(tw); self2.args = MAP(self2.args, tw, false); }); def_transform(AST_Sequence, function(self2, tw) { const result = MAP(self2.expressions, tw); self2.expressions = result.length ? result : [new AST_Number({ value: 0 })]; }); def_transform(AST_PropAccess, function(self2, tw) { self2.expression = self2.expression.transform(tw); }); def_transform(AST_Sub, function(self2, tw) { self2.expression = self2.expression.transform(tw); self2.property = self2.property.transform(tw); }); def_transform(AST_Chain, function(self2, tw) { self2.expression = self2.expression.transform(tw); }); def_transform(AST_Yield, function(self2, tw) { if (self2.expression) self2.expression = self2.expression.transform(tw); }); def_transform(AST_Await, function(self2, tw) { self2.expression = self2.expression.transform(tw); }); def_transform(AST_Unary, function(self2, tw) { self2.expression = self2.expression.transform(tw); }); def_transform(AST_Binary, function(self2, tw) { self2.left = self2.left.transform(tw); self2.right = self2.right.transform(tw); }); def_transform(AST_PrivateIn, function(self2, tw) { self2.key = self2.key.transform(tw); self2.value = self2.value.transform(tw); }); def_transform(AST_Conditional, function(self2, tw) { self2.condition = self2.condition.transform(tw); self2.consequent = self2.consequent.transform(tw); self2.alternative = self2.alternative.transform(tw); }); def_transform(AST_Array, function(self2, tw) { self2.elements = MAP(self2.elements, tw); }); def_transform(AST_Object, function(self2, tw) { self2.properties = MAP(self2.properties, tw); }); def_transform(AST_ObjectProperty, function(self2, tw) { if (self2.key instanceof AST_Node) { self2.key = self2.key.transform(tw); } if (self2.value) self2.value = self2.value.transform(tw); }); def_transform(AST_Class, function(self2, tw) { if (self2.name) self2.name = self2.name.transform(tw); if (self2.extends) self2.extends = self2.extends.transform(tw); self2.properties = MAP(self2.properties, tw); }); def_transform(AST_ClassStaticBlock, function(self2, tw) { self2.body = MAP(self2.body, tw); }); def_transform(AST_Expansion, function(self2, tw) { self2.expression = self2.expression.transform(tw); }); def_transform(AST_NameMapping, function(self2, tw) { self2.foreign_name = self2.foreign_name.transform(tw); self2.name = self2.name.transform(tw); }); def_transform(AST_Import, function(self2, tw) { if (self2.imported_name) self2.imported_name = self2.imported_name.transform(tw); if (self2.imported_names) MAP(self2.imported_names, tw); self2.module_name = self2.module_name.transform(tw); }); def_transform(AST_Export, function(self2, tw) { if (self2.exported_definition) self2.exported_definition = self2.exported_definition.transform(tw); if (self2.exported_value) self2.exported_value = self2.exported_value.transform(tw); if (self2.exported_names) MAP(self2.exported_names, tw); if (self2.module_name) self2.module_name = self2.module_name.transform(tw); }); def_transform(AST_TemplateString, function(self2, tw) { self2.segments = MAP(self2.segments, tw); }); def_transform(AST_PrefixedTemplateString, function(self2, tw) { self2.prefix = self2.prefix.transform(tw); self2.template_string = self2.template_string.transform(tw); }); (function() { var normalize_directives = function(body) { for (var i = 0; i < body.length; i++) { if (body[i] instanceof AST_Statement && body[i].body instanceof AST_String) { body[i] = new AST_Directive({ start: body[i].start, end: body[i].end, value: body[i].body.value }); } else { return body; } } return body; }; const assert_clause_from_moz = (assertions) => { if (assertions && assertions.length > 0) { return new AST_Object({ start: my_start_token(assertions), end: my_end_token(assertions), properties: assertions.map((assertion_kv) => new AST_ObjectKeyVal({ start: my_start_token(assertion_kv), end: my_end_token(assertion_kv), key: assertion_kv.key.name || assertion_kv.key.value, value: from_moz(assertion_kv.value) })) }); } return null; }; var MOZ_TO_ME = { Program: function(M) { return new AST_Toplevel({ start: my_start_token(M), end: my_end_token(M), body: normalize_directives(M.body.map(from_moz)) }); }, ArrayPattern: function(M) { return new AST_Destructuring({ start: my_start_token(M), end: my_end_token(M), names: M.elements.map(function(elm) { if (elm === null) { return new AST_Hole(); } return from_moz(elm); }), is_array: true }); }, ObjectPattern: function(M) { return new AST_Destructuring({ start: my_start_token(M), end: my_end_token(M), names: M.properties.map(from_moz), is_array: false }); }, AssignmentPattern: function(M) { return new AST_DefaultAssign({ start: my_start_token(M), end: my_end_token(M), left: from_moz(M.left), operator: "=", right: from_moz(M.right) }); }, SpreadElement: function(M) { return new AST_Expansion({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.argument) }); }, RestElement: function(M) { return new AST_Expansion({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.argument) }); }, TemplateElement: function(M) { return new AST_TemplateSegment({ start: my_start_token(M), end: my_end_token(M), value: M.value.cooked, raw: M.value.raw }); }, TemplateLiteral: function(M) { var segments = []; for (var i = 0; i < M.quasis.length; i++) { segments.push(from_moz(M.quasis[i])); if (M.expressions[i]) { segments.push(from_moz(M.expressions[i])); } } return new AST_TemplateString({ start: my_start_token(M), end: my_end_token(M), segments }); }, TaggedTemplateExpression: function(M) { return new AST_PrefixedTemplateString({ start: my_start_token(M), end: my_end_token(M), template_string: from_moz(M.quasi), prefix: from_moz(M.tag) }); }, FunctionDeclaration: function(M) { return new AST_Defun({ start: my_start_token(M), end: my_end_token(M), name: from_moz(M.id), argnames: M.params.map(from_moz), is_generator: M.generator, async: M.async, body: normalize_directives(from_moz(M.body).body) }); }, FunctionExpression: function(M) { return new AST_Function({ start: my_start_token(M), end: my_end_token(M), name: from_moz(M.id), argnames: M.params.map(from_moz), is_generator: M.generator, async: M.async, body: normalize_directives(from_moz(M.body).body) }); }, ArrowFunctionExpression: function(M) { const body = M.body.type === "BlockStatement" ? from_moz(M.body).body : [make_node(AST_Return, {}, { value: from_moz(M.body) })]; return new AST_Arrow({ start: my_start_token(M), end: my_end_token(M), argnames: M.params.map(from_moz), body, async: M.async }); }, ExpressionStatement: function(M) { return new AST_SimpleStatement({ start: my_start_token(M), end: my_end_token(M), body: from_moz(M.expression) }); }, TryStatement: function(M) { var handlers = M.handlers || [M.handler]; if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { throw new Error("Multiple catch clauses are not supported."); } return new AST_Try({ start: my_start_token(M), end: my_end_token(M), body: new AST_TryBlock(from_moz(M.block)), bcatch: from_moz(handlers[0]), bfinally: M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null }); }, Property: function(M) { var key = M.key; var args = { start: my_start_token(key || M.value), end: my_end_token(M.value), key: key.type == "Identifier" ? key.name : key.value, value: from_moz(M.value) }; if (M.computed) { args.key = from_moz(M.key); } if (M.method) { args.is_generator = M.value.generator; args.async = M.value.async; if (!M.computed) { args.key = new AST_SymbolMethod({ name: args.key }); } else { args.key = from_moz(M.key); } return new AST_ConciseMethod(args); } if (M.kind == "init") { if (key.type != "Identifier" && key.type != "Literal") { args.key = from_moz(key); } return new AST_ObjectKeyVal(args); } if (typeof args.key === "string" || typeof args.key === "number") { args.key = new AST_SymbolMethod({ name: args.key }); } args.value = new AST_Accessor(args.value); if (M.kind == "get") return new AST_ObjectGetter(args); if (M.kind == "set") return new AST_ObjectSetter(args); if (M.kind == "method") { args.async = M.value.async; args.is_generator = M.value.generator; args.quote = M.computed ? '"' : null; return new AST_ConciseMethod(args); } }, MethodDefinition: function(M) { const is_private = M.key.type === "PrivateIdentifier"; const key = M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }); var args = { start: my_start_token(M), end: my_end_token(M), key, value: from_moz(M.value), static: M.static }; if (M.kind == "get") { return new (is_private ? AST_PrivateGetter : AST_ObjectGetter)(args); } if (M.kind == "set") { return new (is_private ? AST_PrivateSetter : AST_ObjectSetter)(args); } args.is_generator = M.value.generator; args.async = M.value.async; return new (is_private ? AST_PrivateMethod : AST_ConciseMethod)(args); }, FieldDefinition: function(M) { let key; if (M.computed) { key = from_moz(M.key); } else { if (M.key.type !== "Identifier") throw new Error("Non-Identifier key in FieldDefinition"); key = from_moz(M.key); } return new AST_ClassProperty({ start: my_start_token(M), end: my_end_token(M), key, value: from_moz(M.value), static: M.static }); }, PropertyDefinition: function(M) { let key; if (M.computed) { key = from_moz(M.key); } else if (M.key.type === "PrivateIdentifier") { return new AST_ClassPrivateProperty({ start: my_start_token(M), end: my_end_token(M), key: from_moz(M.key), value: from_moz(M.value), static: M.static }); } else { if (M.key.type !== "Identifier") { throw new Error("Non-Identifier key in PropertyDefinition"); } key = from_moz(M.key); } return new AST_ClassProperty({ start: my_start_token(M), end: my_end_token(M), key, value: from_moz(M.value), static: M.static }); }, PrivateIdentifier: function(M) { return new AST_SymbolPrivateProperty({ start: my_start_token(M), end: my_end_token(M), name: M.name }); }, StaticBlock: function(M) { return new AST_ClassStaticBlock({ start: my_start_token(M), end: my_end_token(M), body: M.body.map(from_moz) }); }, ArrayExpression: function(M) { return new AST_Array({ start: my_start_token(M), end: my_end_token(M), elements: M.elements.map(function(elem) { return elem === null ? new AST_Hole() : from_moz(elem); }) }); }, ObjectExpression: function(M) { return new AST_Object({ start: my_start_token(M), end: my_end_token(M), properties: M.properties.map(function(prop) { if (prop.type === "SpreadElement") { return from_moz(prop); } prop.type = "Property"; return from_moz(prop); }) }); }, SequenceExpression: function(M) { return new AST_Sequence({ start: my_start_token(M), end: my_end_token(M), expressions: M.expressions.map(from_moz) }); }, MemberExpression: function(M) { if (M.property.type === "PrivateIdentifier") { return new AST_DotHash({ start: my_start_token(M), end: my_end_token(M), property: M.property.name, expression: from_moz(M.object), optional: M.optional || false }); } return new (M.computed ? AST_Sub : AST_Dot)({ start: my_start_token(M), end: my_end_token(M), property: M.computed ? from_moz(M.property) : M.property.name, expression: from_moz(M.object), optional: M.optional || false }); }, ChainExpression: function(M) { return new AST_Chain({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.expression) }); }, SwitchCase: function(M) { return new (M.test ? AST_Case : AST_Default)({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.test), body: M.consequent.map(from_moz) }); }, VariableDeclaration: function(M) { return new (M.kind === "const" ? AST_Const : M.kind === "let" ? AST_Let : AST_Var)({ start: my_start_token(M), end: my_end_token(M), definitions: M.declarations.map(from_moz) }); }, ImportDeclaration: function(M) { var imported_name = null; var imported_names = null; M.specifiers.forEach(function(specifier) { if (specifier.type === "ImportSpecifier" || specifier.type === "ImportNamespaceSpecifier") { if (!imported_names) { imported_names = []; } imported_names.push(from_moz(specifier)); } else if (specifier.type === "ImportDefaultSpecifier") { imported_name = from_moz(specifier); } }); return new AST_Import({ start: my_start_token(M), end: my_end_token(M), imported_name, imported_names, module_name: from_moz(M.source), assert_clause: assert_clause_from_moz(M.assertions) }); }, ImportSpecifier: function(M) { return new AST_NameMapping({ start: my_start_token(M), end: my_end_token(M), foreign_name: from_moz(M.imported), name: from_moz(M.local) }); }, ImportDefaultSpecifier: function(M) { return from_moz(M.local); }, ImportNamespaceSpecifier: function(M) { return new AST_NameMapping({ start: my_start_token(M), end: my_end_token(M), foreign_name: new AST_SymbolImportForeign({ name: "*" }), name: from_moz(M.local) }); }, ExportAllDeclaration: function(M) { var foreign_name = M.exported == null ? new AST_SymbolExportForeign({ name: "*" }) : from_moz(M.exported); return new AST_Export({ start: my_start_token(M), end: my_end_token(M), exported_names: [ new AST_NameMapping({ name: new AST_SymbolExportForeign({ name: "*" }), foreign_name }) ], module_name: from_moz(M.source), assert_clause: assert_clause_from_moz(M.assertions) }); }, ExportNamedDeclaration: function(M) { return new AST_Export({ start: my_start_token(M), end: my_end_token(M), exported_definition: from_moz(M.declaration), exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function(specifier) { return from_moz(specifier); }) : null, module_name: from_moz(M.source), assert_clause: assert_clause_from_moz(M.assertions) }); }, ExportDefaultDeclaration: function(M) { return new AST_Export({ start: my_start_token(M), end: my_end_token(M), exported_value: from_moz(M.declaration), is_default: true }); }, ExportSpecifier: function(M) { return new AST_NameMapping({ foreign_name: from_moz(M.exported), name: from_moz(M.local) }); }, Literal: function(M) { var val = M.value, args = { start: my_start_token(M), end: my_end_token(M) }; var rx = M.regex; if (rx && rx.pattern) { args.value = { source: rx.pattern, flags: rx.flags }; return new AST_RegExp(args); } else if (rx) { const rx_source = M.raw || val; const match = rx_source.match(/^\/(.*)\/(\w*)$/); if (!match) throw new Error("Invalid regex source " + rx_source); const [_, source, flags] = match; args.value = { source, flags }; return new AST_RegExp(args); } if (val === null) return new AST_Null(args); switch (typeof val) { case "string": args.quote = '"'; var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; if (p.type == "ImportSpecifier") { args.name = val; return new AST_SymbolImportForeign(args); } else if (p.type == "ExportSpecifier") { args.name = val; if (M == p.exported) { return new AST_SymbolExportForeign(args); } else { return new AST_SymbolExport(args); } } else if (p.type == "ExportAllDeclaration" && M == p.exported) { args.name = val; return new AST_SymbolExportForeign(args); } args.value = val; return new AST_String(args); case "number": args.value = val; args.raw = M.raw || val.toString(); return new AST_Number(args); case "boolean": return new (val ? AST_True : AST_False)(args); } }, MetaProperty: function(M) { if (M.meta.name === "new" && M.property.name === "target") { return new AST_NewTarget({ start: my_start_token(M), end: my_end_token(M) }); } else if (M.meta.name === "import" && M.property.name === "meta") { return new AST_ImportMeta({ start: my_start_token(M), end: my_end_token(M) }); } }, Identifier: function(M) { var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; return new (p.type == "LabeledStatement" ? AST_Label : p.type == "VariableDeclarator" && p.id === M ? p.kind == "const" ? AST_SymbolConst : p.kind == "let" ? AST_SymbolLet : AST_SymbolVar : /Import.*Specifier/.test(p.type) ? p.local === M ? AST_SymbolImport : AST_SymbolImportForeign : p.type == "ExportSpecifier" ? p.local === M ? AST_SymbolExport : AST_SymbolExportForeign : p.type == "FunctionExpression" ? p.id === M ? AST_SymbolLambda : AST_SymbolFunarg : p.type == "FunctionDeclaration" ? p.id === M ? AST_SymbolDefun : AST_SymbolFunarg : p.type == "ArrowFunctionExpression" ? p.params.includes(M) ? AST_SymbolFunarg : AST_SymbolRef : p.type == "ClassExpression" ? p.id === M ? AST_SymbolClass : AST_SymbolRef : p.type == "Property" ? p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod : p.type == "PropertyDefinition" || p.type === "FieldDefinition" ? p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolClassProperty : p.type == "ClassDeclaration" ? p.id === M ? AST_SymbolDefClass : AST_SymbolRef : p.type == "MethodDefinition" ? p.computed ? AST_SymbolRef : AST_SymbolMethod : p.type == "CatchClause" ? AST_SymbolCatch : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef : AST_SymbolRef)({ start: my_start_token(M), end: my_end_token(M), name: M.name }); }, BigIntLiteral(M) { return new AST_BigInt({ start: my_start_token(M), end: my_end_token(M), value: M.value }); }, EmptyStatement: function(M) { return new AST_EmptyStatement({ start: my_start_token(M), end: my_end_token(M) }); }, BlockStatement: function(M) { return new AST_BlockStatement({ start: my_start_token(M), end: my_end_token(M), body: M.body.map(from_moz) }); }, IfStatement: function(M) { return new AST_If({ start: my_start_token(M), end: my_end_token(M), condition: from_moz(M.test), body: from_moz(M.consequent), alternative: from_moz(M.alternate) }); }, LabeledStatement: function(M) { return new AST_LabeledStatement({ start: my_start_token(M), end: my_end_token(M), label: from_moz(M.label), body: from_moz(M.body) }); }, BreakStatement: function(M) { return new AST_Break({ start: my_start_token(M), end: my_end_token(M), label: from_moz(M.label) }); }, ContinueStatement: function(M) { return new AST_Continue({ start: my_start_token(M), end: my_end_token(M), label: from_moz(M.label) }); }, WithStatement: function(M) { return new AST_With({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.object), body: from_moz(M.body) }); }, SwitchStatement: function(M) { return new AST_Switch({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.discriminant), body: M.cases.map(from_moz) }); }, ReturnStatement: function(M) { return new AST_Return({ start: my_start_token(M), end: my_end_token(M), value: from_moz(M.argument) }); }, ThrowStatement: function(M) { return new AST_Throw({ start: my_start_token(M), end: my_end_token(M), value: from_moz(M.argument) }); }, WhileStatement: function(M) { return new AST_While({ start: my_start_token(M), end: my_end_token(M), condition: from_moz(M.test), body: from_moz(M.body) }); }, DoWhileStatement: function(M) { return new AST_Do({ start: my_start_token(M), end: my_end_token(M), condition: from_moz(M.test), body: from_moz(M.body) }); }, ForStatement: function(M) { return new AST_For({ start: my_start_token(M), end: my_end_token(M), init: from_moz(M.init), condition: from_moz(M.test), step: from_moz(M.update), body: from_moz(M.body) }); }, ForInStatement: function(M) { return new AST_ForIn({ start: my_start_token(M), end: my_end_token(M), init: from_moz(M.left), object: from_moz(M.right), body: from_moz(M.body) }); }, ForOfStatement: function(M) { return new AST_ForOf({ start: my_start_token(M), end: my_end_token(M), init: from_moz(M.left), object: from_moz(M.right), body: from_moz(M.body), await: M.await }); }, AwaitExpression: function(M) { return new AST_Await({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.argument) }); }, YieldExpression: function(M) { return new AST_Yield({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.argument), is_star: M.delegate }); }, DebuggerStatement: function(M) { return new AST_Debugger({ start: my_start_token(M), end: my_end_token(M) }); }, VariableDeclarator: function(M) { return new AST_VarDef({ start: my_start_token(M), end: my_end_token(M), name: from_moz(M.id), value: from_moz(M.init) }); }, CatchClause: function(M) { return new AST_Catch({ start: my_start_token(M), end: my_end_token(M), argname: from_moz(M.param), body: from_moz(M.body).body }); }, ThisExpression: function(M) { return new AST_This({ start: my_start_token(M), end: my_end_token(M) }); }, Super: function(M) { return new AST_Super({ start: my_start_token(M), end: my_end_token(M) }); }, BinaryExpression: function(M) { if (M.left.type === "PrivateIdentifier") { return new AST_PrivateIn({ start: my_start_token(M), end: my_end_token(M), key: new AST_SymbolPrivateProperty({ start: my_start_token(M.left), end: my_end_token(M.left), name: M.left.name }), value: from_moz(M.right) }); } return new AST_Binary({ start: my_start_token(M), end: my_end_token(M), operator: M.operator, left: from_moz(M.left), right: from_moz(M.right) }); }, LogicalExpression: function(M) { return new AST_Binary({ start: my_start_token(M), end: my_end_token(M), operator: M.operator, left: from_moz(M.left), right: from_moz(M.right) }); }, AssignmentExpression: function(M) { return new AST_Assign({ start: my_start_token(M), end: my_end_token(M), operator: M.operator, left: from_moz(M.left), right: from_moz(M.right) }); }, ConditionalExpression: function(M) { return new AST_Conditional({ start: my_start_token(M), end: my_end_token(M), condition: from_moz(M.test), consequent: from_moz(M.consequent), alternative: from_moz(M.alternate) }); }, NewExpression: function(M) { return new AST_New({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.callee), args: M.arguments.map(from_moz) }); }, CallExpression: function(M) { return new AST_Call({ start: my_start_token(M), end: my_end_token(M), expression: from_moz(M.callee), optional: M.optional, args: M.arguments.map(from_moz) }); } }; MOZ_TO_ME.UpdateExpression = MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { var prefix = "prefix" in M ? M.prefix : M.type == "UnaryExpression" ? true : false; return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ start: my_start_token(M), end: my_end_token(M), operator: M.operator, expression: from_moz(M.argument) }); }; MOZ_TO_ME.ClassDeclaration = MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { return new (M.type === "ClassDeclaration" ? AST_DefClass : AST_ClassExpression)({ start: my_start_token(M), end: my_end_token(M), name: from_moz(M.id), extends: from_moz(M.superClass), properties: M.body.body.map(from_moz) }); }; def_to_moz(AST_EmptyStatement, function To_Moz_EmptyStatement() { return { type: "EmptyStatement" }; }); def_to_moz(AST_BlockStatement, function To_Moz_BlockStatement(M) { return { type: "BlockStatement", body: M.body.map(to_moz) }; }); def_to_moz(AST_If, function To_Moz_IfStatement(M) { return { type: "IfStatement", test: to_moz(M.condition), consequent: to_moz(M.body), alternate: to_moz(M.alternative) }; }); def_to_moz(AST_LabeledStatement, function To_Moz_LabeledStatement(M) { return { type: "LabeledStatement", label: to_moz(M.label), body: to_moz(M.body) }; }); def_to_moz(AST_Break, function To_Moz_BreakStatement(M) { return { type: "BreakStatement", label: to_moz(M.label) }; }); def_to_moz(AST_Continue, function To_Moz_ContinueStatement(M) { return { type: "ContinueStatement", label: to_moz(M.label) }; }); def_to_moz(AST_With, function To_Moz_WithStatement(M) { return { type: "WithStatement", object: to_moz(M.expression), body: to_moz(M.body) }; }); def_to_moz(AST_Switch, function To_Moz_SwitchStatement(M) { return { type: "SwitchStatement", discriminant: to_moz(M.expression), cases: M.body.map(to_moz) }; }); def_to_moz(AST_Return, function To_Moz_ReturnStatement(M) { return { type: "ReturnStatement", argument: to_moz(M.value) }; }); def_to_moz(AST_Throw, function To_Moz_ThrowStatement(M) { return { type: "ThrowStatement", argument: to_moz(M.value) }; }); def_to_moz(AST_While, function To_Moz_WhileStatement(M) { return { type: "WhileStatement", test: to_moz(M.condition), body: to_moz(M.body) }; }); def_to_moz(AST_Do, function To_Moz_DoWhileStatement(M) { return { type: "DoWhileStatement", test: to_moz(M.condition), body: to_moz(M.body) }; }); def_to_moz(AST_For, function To_Moz_ForStatement(M) { return { type: "ForStatement", init: to_moz(M.init), test: to_moz(M.condition), update: to_moz(M.step), body: to_moz(M.body) }; }); def_to_moz(AST_ForIn, function To_Moz_ForInStatement(M) { return { type: "ForInStatement", left: to_moz(M.init), right: to_moz(M.object), body: to_moz(M.body) }; }); def_to_moz(AST_ForOf, function To_Moz_ForOfStatement(M) { return { type: "ForOfStatement", left: to_moz(M.init), right: to_moz(M.object), body: to_moz(M.body), await: M.await }; }); def_to_moz(AST_Await, function To_Moz_AwaitExpression(M) { return { type: "AwaitExpression", argument: to_moz(M.expression) }; }); def_to_moz(AST_Yield, function To_Moz_YieldExpression(M) { return { type: "YieldExpression", argument: to_moz(M.expression), delegate: M.is_star }; }); def_to_moz(AST_Debugger, function To_Moz_DebuggerStatement() { return { type: "DebuggerStatement" }; }); def_to_moz(AST_VarDef, function To_Moz_VariableDeclarator(M) { return { type: "VariableDeclarator", id: to_moz(M.name), init: to_moz(M.value) }; }); def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { return { type: "CatchClause", param: to_moz(M.argname), body: to_moz_block(M) }; }); def_to_moz(AST_This, function To_Moz_ThisExpression() { return { type: "ThisExpression" }; }); def_to_moz(AST_Super, function To_Moz_Super() { return { type: "Super" }; }); def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { return { type: "BinaryExpression", operator: M.operator, left: to_moz(M.left), right: to_moz(M.right) }; }); def_to_moz(AST_Binary, function To_Moz_LogicalExpression(M) { return { type: "LogicalExpression", operator: M.operator, left: to_moz(M.left), right: to_moz(M.right) }; }); def_to_moz(AST_Assign, function To_Moz_AssignmentExpression(M) { return { type: "AssignmentExpression", operator: M.operator, left: to_moz(M.left), right: to_moz(M.right) }; }); def_to_moz(AST_Conditional, function To_Moz_ConditionalExpression(M) { return { type: "ConditionalExpression", test: to_moz(M.condition), consequent: to_moz(M.consequent), alternate: to_moz(M.alternative) }; }); def_to_moz(AST_New, function To_Moz_NewExpression(M) { return { type: "NewExpression", callee: to_moz(M.expression), arguments: M.args.map(to_moz) }; }); def_to_moz(AST_Call, function To_Moz_CallExpression(M) { return { type: "CallExpression", callee: to_moz(M.expression), optional: M.optional, arguments: M.args.map(to_moz) }; }); def_to_moz(AST_Toplevel, function To_Moz_Program(M) { return to_moz_scope("Program", M); }); def_to_moz(AST_Expansion, function To_Moz_Spread(M) { return { type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", argument: to_moz(M.expression) }; }); def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { return { type: "TaggedTemplateExpression", tag: to_moz(M.prefix), quasi: to_moz(M.template_string) }; }); def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) { var quasis = []; var expressions = []; for (var i = 0; i < M.segments.length; i++) { if (i % 2 !== 0) { expressions.push(to_moz(M.segments[i])); } else { quasis.push({ type: "TemplateElement", value: { raw: M.segments[i].raw, cooked: M.segments[i].value }, tail: i === M.segments.length - 1 }); } } return { type: "TemplateLiteral", quasis, expressions }; }); def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) { return { type: "FunctionDeclaration", id: to_moz(M.name), params: M.argnames.map(to_moz), generator: M.is_generator, async: M.async, body: to_moz_scope("BlockStatement", M) }; }); def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) { var is_generator = parent.is_generator !== void 0 ? parent.is_generator : M.is_generator; return { type: "FunctionExpression", id: to_moz(M.name), params: M.argnames.map(to_moz), generator: is_generator, async: M.async, body: to_moz_scope("BlockStatement", M) }; }); def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { var body = { type: "BlockStatement", body: M.body.map(to_moz) }; return { type: "ArrowFunctionExpression", params: M.argnames.map(to_moz), async: M.async, body }; }); def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) { if (M.is_array) { return { type: "ArrayPattern", elements: M.names.map(to_moz) }; } return { type: "ObjectPattern", properties: M.names.map(to_moz) }; }); def_to_moz(AST_Directive, function To_Moz_Directive(M) { return { type: "ExpressionStatement", expression: { type: "Literal", value: M.value, raw: M.print_to_string() }, directive: M.value }; }); def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { return { type: "ExpressionStatement", expression: to_moz(M.body) }; }); def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { return { type: "SwitchCase", test: to_moz(M.expression), consequent: M.body.map(to_moz) }; }); def_to_moz(AST_Try, function To_Moz_TryStatement(M) { return { type: "TryStatement", block: to_moz_block(M.body), handler: to_moz(M.bcatch), guardedHandlers: [], finalizer: to_moz(M.bfinally) }; }); def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { return { type: "CatchClause", param: to_moz(M.argname), guard: null, body: to_moz_block(M) }; }); def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { return { type: "VariableDeclaration", kind: M instanceof AST_Const ? "const" : M instanceof AST_Let ? "let" : "var", declarations: M.definitions.map(to_moz) }; }); const assert_clause_to_moz = (assert_clause) => { const assertions = []; if (assert_clause) { for (const { key, value } of assert_clause.properties) { const key_moz = is_basic_identifier_string(key) ? { type: "Identifier", name: key } : { type: "Literal", value: key, raw: JSON.stringify(key) }; assertions.push({ type: "ImportAttribute", key: key_moz, value: to_moz(value) }); } } return assertions; }; def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) { if (M.exported_names) { var first_exported = M.exported_names[0]; var first_exported_name = first_exported.name; if (first_exported_name.name === "*" && !first_exported_name.quote) { var foreign_name = first_exported.foreign_name; var exported = foreign_name.name === "*" && !foreign_name.quote ? null : to_moz(foreign_name); return { type: "ExportAllDeclaration", source: to_moz(M.module_name), exported, assertions: assert_clause_to_moz(M.assert_clause) }; } return { type: "ExportNamedDeclaration", specifiers: M.exported_names.map(function(name_mapping) { return { type: "ExportSpecifier", exported: to_moz(name_mapping.foreign_name), local: to_moz(name_mapping.name) }; }), declaration: to_moz(M.exported_definition), source: to_moz(M.module_name), assertions: assert_clause_to_moz(M.assert_clause) }; } return { type: M.is_default ? "ExportDefaultDeclaration" : "ExportNamedDeclaration", declaration: to_moz(M.exported_value || M.exported_definition) }; }); def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { var specifiers = []; if (M.imported_name) { specifiers.push({ type: "ImportDefaultSpecifier", local: to_moz(M.imported_name) }); } if (M.imported_names) { var first_imported_foreign_name = M.imported_names[0].foreign_name; if (first_imported_foreign_name.name === "*" && !first_imported_foreign_name.quote) { specifiers.push({ type: "ImportNamespaceSpecifier", local: to_moz(M.imported_names[0].name) }); } else { M.imported_names.forEach(function(name_mapping) { specifiers.push({ type: "ImportSpecifier", local: to_moz(name_mapping.name), imported: to_moz(name_mapping.foreign_name) }); }); } } return { type: "ImportDeclaration", specifiers, source: to_moz(M.module_name), assertions: assert_clause_to_moz(M.assert_clause) }; }); def_to_moz(AST_ImportMeta, function To_Moz_MetaProperty() { return { type: "MetaProperty", meta: { type: "Identifier", name: "import" }, property: { type: "Identifier", name: "meta" } }; }); def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) { return { type: "SequenceExpression", expressions: M.expressions.map(to_moz) }; }); def_to_moz(AST_DotHash, function To_Moz_PrivateMemberExpression(M) { return { type: "MemberExpression", object: to_moz(M.expression), computed: false, property: { type: "PrivateIdentifier", name: M.property }, optional: M.optional }; }); def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { var isComputed = M instanceof AST_Sub; return { type: "MemberExpression", object: to_moz(M.expression), computed: isComputed, property: isComputed ? to_moz(M.property) : { type: "Identifier", name: M.property }, optional: M.optional }; }); def_to_moz(AST_Chain, function To_Moz_ChainExpression(M) { return { type: "ChainExpression", expression: to_moz(M.expression) }; }); def_to_moz(AST_Unary, function To_Moz_Unary(M) { return { type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", operator: M.operator, prefix: M instanceof AST_UnaryPrefix, argument: to_moz(M.expression) }; }); def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { if (M.operator == "=" && to_moz_in_destructuring()) { return { type: "AssignmentPattern", left: to_moz(M.left), right: to_moz(M.right) }; } const type = M.operator == "&&" || M.operator == "||" || M.operator === "??" ? "LogicalExpression" : "BinaryExpression"; return { type, left: to_moz(M.left), operator: M.operator, right: to_moz(M.right) }; }); def_to_moz(AST_PrivateIn, function To_Moz_BinaryExpression_PrivateIn(M) { return { type: "BinaryExpression", left: { type: "PrivateIdentifier", name: M.key.name }, operator: "in", right: to_moz(M.value) }; }); def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { return { type: "ArrayExpression", elements: M.elements.map(to_moz) }; }); def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) { return { type: "ObjectExpression", properties: M.properties.map(to_moz) }; }); def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) { var key = M.key instanceof AST_Node ? to_moz(M.key) : { type: "Identifier", value: M.key }; if (typeof M.key === "number") { key = { type: "Literal", value: Number(M.key) }; } if (typeof M.key === "string") { key = { type: "Identifier", name: M.key }; } var kind; var string_or_num = typeof M.key === "string" || typeof M.key === "number"; var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef; if (M instanceof AST_ObjectKeyVal) { kind = "init"; computed = !string_or_num; } else if (M instanceof AST_ObjectGetter) { kind = "get"; } else if (M instanceof AST_ObjectSetter) { kind = "set"; } if (M instanceof AST_PrivateGetter || M instanceof AST_PrivateSetter) { const kind2 = M instanceof AST_PrivateGetter ? "get" : "set"; return { type: "MethodDefinition", computed: false, kind: kind2, static: M.static, key: { type: "PrivateIdentifier", name: M.key.name }, value: to_moz(M.value) }; } if (M instanceof AST_ClassPrivateProperty) { return { type: "PropertyDefinition", key: { type: "PrivateIdentifier", name: M.key.name }, value: to_moz(M.value), computed: false, static: M.static }; } if (M instanceof AST_ClassProperty) { return { type: "PropertyDefinition", key, value: to_moz(M.value), computed, static: M.static }; } if (parent instanceof AST_Class) { return { type: "MethodDefinition", computed, kind, static: M.static, key: to_moz(M.key), value: to_moz(M.value) }; } return { type: "Property", computed, kind, key, value: to_moz(M.value) }; }); def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { if (parent instanceof AST_Object) { return { type: "Property", computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, kind: "init", method: true, shorthand: false, key: to_moz(M.key), value: to_moz(M.value) }; } const key = M instanceof AST_PrivateMethod ? { type: "PrivateIdentifier", name: M.key.name } : to_moz(M.key); return { type: "MethodDefinition", kind: M.key === "constructor" ? "constructor" : "method", key, value: to_moz(M.value), computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, static: M.static }; }); def_to_moz(AST_Class, function To_Moz_Class(M) { var type = M instanceof AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; return { type, superClass: to_moz(M.extends), id: M.name ? to_moz(M.name) : null, body: { type: "ClassBody", body: M.properties.map(to_moz) } }; }); def_to_moz(AST_ClassStaticBlock, function To_Moz_StaticBlock(M) { return { type: "StaticBlock", body: M.body.map(to_moz) }; }); def_to_moz(AST_NewTarget, function To_Moz_MetaProperty() { return { type: "MetaProperty", meta: { type: "Identifier", name: "new" }, property: { type: "Identifier", name: "target" } }; }); def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) { if (M instanceof AST_SymbolMethod && parent.quote || (M instanceof AST_SymbolImportForeign || M instanceof AST_SymbolExportForeign || M instanceof AST_SymbolExport) && M.quote) { return { type: "Literal", value: M.name }; } var def = M.definition(); return { type: "Identifier", name: def ? def.mangled_name || def.name : M.name }; }); def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { const pattern = M.value.source; const flags = M.value.flags; return { type: "Literal", value: null, raw: M.print_to_string(), regex: { pattern, flags } }; }); def_to_moz(AST_Constant, function To_Moz_Literal(M) { var value = M.value; return { type: "Literal", value, raw: M.raw || M.print_to_string() }; }); def_to_moz(AST_Atom, function To_Moz_Atom(M) { return { type: "Identifier", name: String(M.value) }; }); def_to_moz(AST_BigInt, (M) => ({ type: "BigIntLiteral", value: M.value })); AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast); function my_start_token(moznode) { var loc = moznode.loc, start = loc && loc.start; var range = moznode.range; return new AST_Token("", "", start && start.line || 0, start && start.column || 0, range ? range[0] : moznode.start, false, [], [], loc && loc.source); } function my_end_token(moznode) { var loc = moznode.loc, end = loc && loc.end; var range = moznode.range; return new AST_Token("", "", end && end.line || 0, end && end.column || 0, range ? range[0] : moznode.end, false, [], [], loc && loc.source); } var FROM_MOZ_STACK = null; function from_moz(node) { FROM_MOZ_STACK.push(node); var ret = node != null ? MOZ_TO_ME[node.type](node) : null; FROM_MOZ_STACK.pop(); return ret; } AST_Node.from_mozilla_ast = function(node) { var save_stack = FROM_MOZ_STACK; FROM_MOZ_STACK = []; var ast = from_moz(node); FROM_MOZ_STACK = save_stack; return ast; }; function set_moz_loc(mynode, moznode) { var start = mynode.start; var end = mynode.end; if (!(start && end)) { return moznode; } if (start.pos != null && end.endpos != null) { moznode.range = [start.pos, end.endpos]; } if (start.line) { moznode.loc = { start: { line: start.line, column: start.col }, end: end.endline ? { line: end.endline, column: end.endcol } : null }; if (start.file) { moznode.loc.source = start.file; } } return moznode; } function def_to_moz(mytype, handler) { mytype.DEFMETHOD("to_mozilla_ast", function(parent) { return set_moz_loc(this, handler(this, parent)); }); } var TO_MOZ_STACK = null; function to_moz(node) { if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } TO_MOZ_STACK.push(node); var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; TO_MOZ_STACK.pop(); if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } return ast; } function to_moz_in_destructuring() { var i = TO_MOZ_STACK.length; while (i--) { if (TO_MOZ_STACK[i] instanceof AST_Destructuring) { return true; } } return false; } function to_moz_block(node) { return { type: "BlockStatement", body: node.body.map(to_moz) }; } function to_moz_scope(type, node) { var body = node.body.map(to_moz); if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); } return { type, body }; } })(); function first_in_statement(stack) { let node = stack.parent(-1); for (let i = 0, p; p = stack.parent(i); i++) { if (p instanceof AST_Statement && p.body === node) return true; if (p instanceof AST_Sequence && p.expressions[0] === node || p.TYPE === "Call" && p.expression === node || p instanceof AST_PrefixedTemplateString && p.prefix === node || p instanceof AST_Dot && p.expression === node || p instanceof AST_Sub && p.expression === node || p instanceof AST_Chain && p.expression === node || p instanceof AST_Conditional && p.condition === node || p instanceof AST_Binary && p.left === node || p instanceof AST_UnaryPostfix && p.expression === node) { node = p; } else { return false; } } } function left_is_object(node) { if (node instanceof AST_Object) return true; if (node instanceof AST_Sequence) return left_is_object(node.expressions[0]); if (node.TYPE === "Call") return left_is_object(node.expression); if (node instanceof AST_PrefixedTemplateString) return left_is_object(node.prefix); if (node instanceof AST_Dot || node instanceof AST_Sub) return left_is_object(node.expression); if (node instanceof AST_Chain) return left_is_object(node.expression); if (node instanceof AST_Conditional) return left_is_object(node.condition); if (node instanceof AST_Binary) return left_is_object(node.left); if (node instanceof AST_UnaryPostfix) return left_is_object(node.expression); return false; } const CODE_LINE_BREAK = 10; const CODE_SPACE = 32; const r_annotation = /[@#]__(PURE|INLINE|NOINLINE)__/; function is_some_comments(comment) { return (comment.type === "comment2" || comment.type === "comment1") && /@preserve|@copyright|@lic|@cc_on|^\**!/i.test(comment.value); } const ROPE_COMMIT_WHEN = 8 * 1e3; class Rope { constructor() { this.committed = ""; this.current = ""; } append(str) { if (this.current.length > ROPE_COMMIT_WHEN) { this.committed += this.current + str; this.current = ""; } else { this.current += str; } } insertAt(char, index) { const { committed, current } = this; if (index < committed.length) { this.committed = committed.slice(0, index) + char + committed.slice(index); } else if (index === committed.length) { this.committed += char; } else { index -= committed.length; this.committed += current.slice(0, index) + char; this.current = current.slice(index); } } charAt(index) { const { committed } = this; if (index < committed.length) return committed[index]; return this.current[index - committed.length]; } charCodeAt(index) { const { committed } = this; if (index < committed.length) return committed.charCodeAt(index); return this.current.charCodeAt(index - committed.length); } length() { return this.committed.length + this.current.length; } expectDirective() { let ch, n = this.length(); if (n <= 0) return true; while ((ch = this.charCodeAt(--n)) && (ch == CODE_SPACE || ch == CODE_LINE_BREAK)) ; return !ch || ch === 59 || ch === 123; } hasNLB() { let n = this.length() - 1; while (n >= 0) { const code = this.charCodeAt(n--); if (code === CODE_LINE_BREAK) return true; if (code !== CODE_SPACE) return false; } return true; } toString() { return this.committed + this.current; } } function OutputStream(options) { var readonly = !options; options = defaults(options, { ascii_only: false, beautify: false, braces: false, comments: "some", ecma: 5, ie8: false, indent_level: 4, indent_start: 0, inline_script: true, keep_numbers: false, keep_quoted_props: false, max_line_len: false, preamble: null, preserve_annotations: false, quote_keys: false, quote_style: 0, safari10: false, semicolons: true, shebang: true, shorthand: void 0, source_map: null, webkit: false, width: 80, wrap_iife: false, wrap_func_args: true, _destroy_ast: false }, true); if (options.shorthand === void 0) options.shorthand = options.ecma > 5; var comment_filter = return_false; if (options.comments) { let comments = options.comments; if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { var regex_pos = options.comments.lastIndexOf("/"); comments = new RegExp(options.comments.substr(1, regex_pos - 1), options.comments.substr(regex_pos + 1)); } if (comments instanceof RegExp) { comment_filter = function(comment) { return comment.type != "comment5" && comments.test(comment.value); }; } else if (typeof comments === "function") { comment_filter = function(comment) { return comment.type != "comment5" && comments(this, comment); }; } else if (comments === "some") { comment_filter = is_some_comments; } else { comment_filter = return_true; } } if (options.preserve_annotations) { let prev_comment_filter = comment_filter; comment_filter = function(comment) { return r_annotation.test(comment.value) || prev_comment_filter.apply(this, arguments); }; } var indentation = 0; var current_col = 0; var current_line = 1; var current_pos = 0; var OUTPUT = new Rope(); let printed_comments = /* @__PURE__ */ new Set(); var to_utf8 = options.ascii_only ? function(str, identifier = false, regexp = false) { if (options.ecma >= 2015 && !options.safari10 && !regexp) { str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { var code = get_full_char_code(ch, 0).toString(16); return "\\u{" + code + "}"; }); } return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { var code = ch.charCodeAt(0).toString(16); if (code.length <= 2 && !identifier) { while (code.length < 2) code = "0" + code; return "\\x" + code; } else { while (code.length < 4) code = "0" + code; return "\\u" + code; } }); } : function(str) { return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) { if (lone) { return "\\u" + lone.charCodeAt(0).toString(16); } return match; }); }; function make_string(str, quote) { var dq = 0, sq = 0; str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, function(s, i) { switch (s) { case '"': ++dq; return '"'; case "'": ++sq; return "'"; case "\\": return "\\\\"; case "\n": return "\\n"; case "\r": return "\\r"; case " ": return "\\t"; case "\b": return "\\b"; case "\f": return "\\f"; case "\v": return options.ie8 ? "\\x0B" : "\\v"; case "\u2028": return "\\u2028"; case "\u2029": return "\\u2029"; case "\uFEFF": return "\\ufeff"; case "\0": return /[0-9]/.test(get_full_char(str, i + 1)) ? "\\x00" : "\\0"; } return s; }); function quote_single() { return "'" + str.replace(/\x27/g, "\\'") + "'"; } function quote_double() { return '"' + str.replace(/\x22/g, '\\"') + '"'; } function quote_template() { return "`" + str.replace(/`/g, "\\`") + "`"; } str = to_utf8(str); if (quote === "`") return quote_template(); switch (options.quote_style) { case 1: return quote_single(); case 2: return quote_double(); case 3: return quote == "'" ? quote_single() : quote_double(); default: return dq > sq ? quote_single() : quote_double(); } } function encode_string(str, quote) { var ret = make_string(str, quote); if (options.inline_script) { ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); ret = ret.replace(/\x3c!--/g, "\\x3c!--"); ret = ret.replace(/--\x3e/g, "--\\x3e"); } return ret; } function make_name(name) { name = name.toString(); name = to_utf8(name, true); return name; } function make_indent(back) { return " ".repeat(options.indent_start + indentation - back * options.indent_level); } var has_parens = false; var might_need_space = false; var might_need_semicolon = false; var might_add_newline = 0; var need_newline_indented = false; var need_space = false; var newline_insert = -1; var last2 = ""; var mapping_token, mapping_name, mappings = options.source_map && []; var do_add_mapping = mappings ? function() { mappings.forEach(function(mapping) { try { let { name, token } = mapping; if (name !== false) { if (token.type == "name" || token.type === "privatename") { name = token.value; } else if (name instanceof AST_Symbol) { name = token.type === "string" ? token.value : name.name; } } options.source_map.add(mapping.token.file, mapping.line, mapping.col, mapping.token.line, mapping.token.col, is_basic_identifier_string(name) ? name : void 0); } catch (ex) { } }); mappings = []; } : noop; var ensure_line_len = options.max_line_len ? function() { if (current_col > options.max_line_len) { if (might_add_newline) { OUTPUT.insertAt("\n", might_add_newline); const len_after_newline = OUTPUT.length() - might_add_newline - 1; if (mappings) { var delta = len_after_newline - current_col; mappings.forEach(function(mapping) { mapping.line++; mapping.col += delta; }); } current_line++; current_pos++; current_col = len_after_newline; } } if (might_add_newline) { might_add_newline = 0; do_add_mapping(); } } : noop; var requireSemicolonChars = makePredicate("( [ + * / - , . `"); function print(str) { str = String(str); var ch = get_full_char(str, 0); if (need_newline_indented && ch) { need_newline_indented = false; if (ch !== "\n") { print("\n"); indent(); } } if (need_space && ch) { need_space = false; if (!/[\s;})]/.test(ch)) { space(); } } newline_insert = -1; var prev = last2.charAt(last2.length - 1); if (might_need_semicolon) { might_need_semicolon = false; if (prev === ":" && ch === "}" || (!ch || !";}".includes(ch)) && prev !== ";") { if (options.semicolons || requireSemicolonChars.has(ch)) { OUTPUT.append(";"); current_col++; current_pos++; } else { ensure_line_len(); if (current_col > 0) { OUTPUT.append("\n"); current_pos++; current_line++; current_col = 0; } if (/^\s+$/.test(str)) { might_need_semicolon = true; } } if (!options.beautify) might_need_space = false; } } if (might_need_space) { if (is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\") || ch == "/" && ch == prev || (ch == "+" || ch == "-") && ch == last2) { OUTPUT.append(" "); current_col++; current_pos++; } might_need_space = false; } if (mapping_token) { mappings.push({ token: mapping_token, name: mapping_name, line: current_line, col: current_col }); mapping_token = false; if (!might_add_newline) do_add_mapping(); } OUTPUT.append(str); has_parens = str[str.length - 1] == "("; current_pos += str.length; var a = str.split(/\r?\n/), n = a.length - 1; current_line += n; current_col += a[0].length; if (n > 0) { ensure_line_len(); current_col = a[n].length; } last2 = str; } var star = function() { print("*"); }; var space = options.beautify ? function() { print(" "); } : function() { might_need_space = true; }; var indent = options.beautify ? function(half) { if (options.beautify) { print(make_indent(half ? 0.5 : 0)); } } : noop; var with_indent = options.beautify ? function(col, cont) { if (col === true) col = next_indent(); var save_indentation = indentation; indentation = col; var ret = cont(); indentation = save_indentation; return ret; } : function(col, cont) { return cont(); }; var newline = options.beautify ? function() { if (newline_insert < 0) return print("\n"); if (OUTPUT.charAt(newline_insert) != "\n") { OUTPUT.insertAt("\n", newline_insert); current_pos++; current_line++; } newline_insert++; } : options.max_line_len ? function() { ensure_line_len(); might_add_newline = OUTPUT.length(); } : noop; var semicolon = options.beautify ? function() { print(";"); } : function() { might_need_semicolon = true; }; function force_semicolon() { might_need_semicolon = false; print(";"); } function next_indent() { return indentation + options.indent_level; } function with_block(cont) { var ret; print("{"); newline(); with_indent(next_indent(), function() { ret = cont(); }); indent(); print("}"); return ret; } function with_parens(cont) { print("("); var ret = cont(); print(")"); return ret; } function with_square(cont) { print("["); var ret = cont(); print("]"); return ret; } function comma() { print(","); space(); } function colon() { print(":"); space(); } var add_mapping = mappings ? function(token, name) { mapping_token = token; mapping_name = name; } : noop; function get() { if (might_add_newline) { ensure_line_len(); } return OUTPUT.toString(); } function filter_comment(comment) { if (!options.preserve_annotations) { comment = comment.replace(r_annotation, " "); } if (/^\s*$/.test(comment)) { return ""; } return comment.replace(/(<\s*\/\s*)(script)/i, "<\\/$2"); } function prepend_comments(node) { var self2 = this; var start = node.start; if (!start) return; var printed_comments2 = self2.printed_comments; const keyword_with_value = node instanceof AST_Exit && node.value || (node instanceof AST_Await || node instanceof AST_Yield) && node.expression; if (start.comments_before && printed_comments2.has(start.comments_before)) { if (keyword_with_value) { start.comments_before = []; } else { return; } } var comments = start.comments_before; if (!comments) { comments = start.comments_before = []; } printed_comments2.add(comments); if (keyword_with_value) { var tw = new TreeWalker(function(node2) { var parent = tw.parent(); if (parent instanceof AST_Exit || parent instanceof AST_Await || parent instanceof AST_Yield || parent instanceof AST_Binary && parent.left === node2 || parent.TYPE == "Call" && parent.expression === node2 || parent instanceof AST_Conditional && parent.condition === node2 || parent instanceof AST_Dot && parent.expression === node2 || parent instanceof AST_Sequence && parent.expressions[0] === node2 || parent instanceof AST_Sub && parent.expression === node2 || parent instanceof AST_UnaryPostfix) { if (!node2.start) return; var text = node2.start.comments_before; if (text && !printed_comments2.has(text)) { printed_comments2.add(text); comments = comments.concat(text); } } else { return true; } }); tw.push(node); keyword_with_value.walk(tw); } if (current_pos == 0) { if (comments.length > 0 && options.shebang && comments[0].type === "comment5" && !printed_comments2.has(comments[0])) { print("#!" + comments.shift().value + "\n"); indent(); } var preamble = options.preamble; if (preamble) { print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); } } comments = comments.filter(comment_filter, node).filter((c) => !printed_comments2.has(c)); if (comments.length == 0) return; var last_nlb = OUTPUT.hasNLB(); comments.forEach(function(c, i) { printed_comments2.add(c); if (!last_nlb) { if (c.nlb) { print("\n"); indent(); last_nlb = true; } else if (i > 0) { space(); } } if (/comment[134]/.test(c.type)) { var value = filter_comment(c.value); if (value) { print("//" + value + "\n"); indent(); } last_nlb = true; } else if (c.type == "comment2") { var value = filter_comment(c.value); if (value) { print("/*" + value + "*/"); } last_nlb = false; } }); if (!last_nlb) { if (start.nlb) { print("\n"); indent(); } else { space(); } } } function append_comments(node, tail) { var self2 = this; var token = node.end; if (!token) return; var printed_comments2 = self2.printed_comments; var comments = token[tail ? "comments_before" : "comments_after"]; if (!comments || printed_comments2.has(comments)) return; if (!(node instanceof AST_Statement || comments.every((c) => !/comment[134]/.test(c.type)))) return; printed_comments2.add(comments); var insert = OUTPUT.length(); comments.filter(comment_filter, node).forEach(function(c, i) { if (printed_comments2.has(c)) return; printed_comments2.add(c); need_space = false; if (need_newline_indented) { print("\n"); indent(); need_newline_indented = false; } else if (c.nlb && (i > 0 || !OUTPUT.hasNLB())) { print("\n"); indent(); } else if (i > 0 || !tail) { space(); } if (/comment[134]/.test(c.type)) { const value = filter_comment(c.value); if (value) { print("//" + value); } need_newline_indented = true; } else if (c.type == "comment2") { const value = filter_comment(c.value); if (value) { print("/*" + value + "*/"); } need_space = true; } }); if (OUTPUT.length() > insert) newline_insert = insert; } const gc_scope = options["_destroy_ast"] ? function gc_scope2(scope) { scope.body.length = 0; scope.argnames.length = 0; } : noop; var stack = []; return { get, toString: get, indent, in_directive: false, use_asm: null, active_scope: null, indentation: function() { return indentation; }, current_width: function() { return current_col - indentation; }, should_break: function() { return options.width && this.current_width() >= options.width; }, has_parens: function() { return has_parens; }, newline, print, star, space, comma, colon, last: function() { return last2; }, semicolon, force_semicolon, to_utf8, print_name: function(name) { print(make_name(name)); }, print_string: function(str, quote, escape_directive) { var encoded = encode_string(str, quote); if (escape_directive === true && !encoded.includes("\\")) { if (!OUTPUT.expectDirective()) { force_semicolon(); } force_semicolon(); } print(encoded); }, print_template_string_chars: function(str) { var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); return print(encoded.substr(1, encoded.length - 2)); }, encode_string, next_indent, with_indent, with_block, with_parens, with_square, add_mapping, option: function(opt) { return options[opt]; }, gc_scope, printed_comments, prepend_comments: readonly ? noop : prepend_comments, append_comments: readonly || comment_filter === return_false ? noop : append_comments, line: function() { return current_line; }, col: function() { return current_col; }, pos: function() { return current_pos; }, push_node: function(node) { stack.push(node); }, pop_node: function() { return stack.pop(); }, parent: function(n) { return stack[stack.length - 2 - (n || 0)]; } }; } (function() { function DEFPRINT(nodetype, generator) { nodetype.DEFMETHOD("_codegen", generator); } AST_Node.DEFMETHOD("print", function(output, force_parens) { var self2 = this, generator = self2._codegen; if (self2 instanceof AST_Scope) { output.active_scope = self2; } else if (!output.use_asm && self2 instanceof AST_Directive && self2.value == "use asm") { output.use_asm = output.active_scope; } function doit() { output.prepend_comments(self2); self2.add_source_map(output); generator(self2, output); output.append_comments(self2); } output.push_node(self2); if (force_parens || self2.needs_parens(output)) { output.with_parens(doit); } else { doit(); } output.pop_node(); if (self2 === output.use_asm) { output.use_asm = null; } }); AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); AST_Node.DEFMETHOD("print_to_string", function(options) { var output = OutputStream(options); this.print(output); return output.get(); }); function PARENS(nodetype, func) { if (Array.isArray(nodetype)) { nodetype.forEach(function(nodetype2) { PARENS(nodetype2, func); }); } else { nodetype.DEFMETHOD("needs_parens", func); } } PARENS(AST_Node, return_false); PARENS(AST_Function, function(output) { if (!output.has_parens() && first_in_statement(output)) { return true; } if (output.option("webkit")) { var p = output.parent(); if (p instanceof AST_PropAccess && p.expression === this) { return true; } } if (output.option("wrap_iife")) { var p = output.parent(); if (p instanceof AST_Call && p.expression === this) { return true; } } if (output.option("wrap_func_args")) { var p = output.parent(); if (p instanceof AST_Call && p.args.includes(this)) { return true; } } return false; }); PARENS(AST_Arrow, function(output) { var p = output.parent(); if (output.option("wrap_func_args") && p instanceof AST_Call && p.args.includes(this)) { return true; } return p instanceof AST_PropAccess && p.expression === this || p instanceof AST_Conditional && p.condition === this; }); PARENS(AST_Object, function(output) { return !output.has_parens() && first_in_statement(output); }); PARENS(AST_ClassExpression, first_in_statement); PARENS(AST_Unary, function(output) { var p = output.parent(); return p instanceof AST_PropAccess && p.expression === this || p instanceof AST_Call && p.expression === this || p instanceof AST_Binary && p.operator === "**" && this instanceof AST_UnaryPrefix && p.left === this && this.operator !== "++" && this.operator !== "--"; }); PARENS(AST_Await, function(output) { var p = output.parent(); return p instanceof AST_PropAccess && p.expression === this || p instanceof AST_Call && p.expression === this || p instanceof AST_Binary && p.operator === "**" && p.left === this || output.option("safari10") && p instanceof AST_UnaryPrefix; }); PARENS(AST_Sequence, function(output) { var p = output.parent(); return p instanceof AST_Call || p instanceof AST_Unary || p instanceof AST_Binary || p instanceof AST_VarDef || p instanceof AST_PropAccess || p instanceof AST_Array || p instanceof AST_ObjectProperty || p instanceof AST_Conditional || p instanceof AST_Arrow || p instanceof AST_DefaultAssign || p instanceof AST_Expansion || p instanceof AST_ForOf && this === p.object || p instanceof AST_Yield || p instanceof AST_Export; }); PARENS(AST_Binary, function(output) { var p = output.parent(); if (p instanceof AST_Call && p.expression === this) return true; if (p instanceof AST_Unary) return true; if (p instanceof AST_PropAccess && p.expression === this) return true; if (p instanceof AST_Binary) { const po = p.operator; const so = this.operator; if (so === "??" && (po === "||" || po === "&&")) { return true; } if (po === "??" && (so === "||" || so === "&&")) { return true; } const pp = PRECEDENCE[po]; const sp = PRECEDENCE[so]; if (pp > sp || pp == sp && (this === p.right || po == "**")) { return true; } } }); PARENS(AST_Yield, function(output) { var p = output.parent(); if (p instanceof AST_Binary && p.operator !== "=") return true; if (p instanceof AST_Call && p.expression === this) return true; if (p instanceof AST_Conditional && p.condition === this) return true; if (p instanceof AST_Unary) return true; if (p instanceof AST_PropAccess && p.expression === this) return true; }); PARENS(AST_Chain, function(output) { var p = output.parent(); if (!(p instanceof AST_Call || p instanceof AST_PropAccess)) return false; return p.expression === this; }); PARENS(AST_PropAccess, function(output) { var p = output.parent(); if (p instanceof AST_New && p.expression === this) { return walk(this, (node) => { if (node instanceof AST_Scope) return true; if (node instanceof AST_Call) { return walk_abort; } }); } }); PARENS(AST_Call, function(output) { var p = output.parent(), p1; if (p instanceof AST_New && p.expression === this || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) return true; return this.expression instanceof AST_Function && p instanceof AST_PropAccess && p.expression === this && (p1 = output.parent(1)) instanceof AST_Assign && p1.left === p; }); PARENS(AST_New, function(output) { var p = output.parent(); if (this.args.length === 0 && (p instanceof AST_PropAccess || p instanceof AST_Call && p.expression === this || p instanceof AST_PrefixedTemplateString && p.prefix === this)) return true; }); PARENS(AST_Number, function(output) { var p = output.parent(); if (p instanceof AST_PropAccess && p.expression === this) { var value = this.getValue(); if (value < 0 || /^0/.test(make_num(value))) { return true; } } }); PARENS(AST_BigInt, function(output) { var p = output.parent(); if (p instanceof AST_PropAccess && p.expression === this) { var value = this.getValue(); if (value.startsWith("-")) { return true; } } }); PARENS([AST_Assign, AST_Conditional], function(output) { var p = output.parent(); if (p instanceof AST_Unary) return true; if (p instanceof AST_Binary && !(p instanceof AST_Assign)) return true; if (p instanceof AST_Call && p.expression === this) return true; if (p instanceof AST_Conditional && p.condition === this) return true; if (p instanceof AST_PropAccess && p.expression === this) return true; if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) return true; }); DEFPRINT(AST_Directive, function(self2, output) { output.print_string(self2.value, self2.quote); output.semicolon(); }); DEFPRINT(AST_Expansion, function(self2, output) { output.print("..."); self2.expression.print(output); }); DEFPRINT(AST_Destructuring, function(self2, output) { output.print(self2.is_array ? "[" : "{"); var len = self2.names.length; self2.names.forEach(function(name, i) { if (i > 0) output.comma(); name.print(output); if (i == len - 1 && name instanceof AST_Hole) output.comma(); }); output.print(self2.is_array ? "]" : "}"); }); DEFPRINT(AST_Debugger, function(self2, output) { output.print("debugger"); output.semicolon(); }); function display_body(body, is_toplevel, output, allow_directives) { var last2 = body.length - 1; output.in_directive = allow_directives; body.forEach(function(stmt, i) { if (output.in_directive === true && !(stmt instanceof AST_Directive || stmt instanceof AST_EmptyStatement || stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String)) { output.in_directive = false; } if (!(stmt instanceof AST_EmptyStatement)) { output.indent(); stmt.print(output); if (!(i == last2 && is_toplevel)) { output.newline(); if (is_toplevel) output.newline(); } } if (output.in_directive === true && stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) { output.in_directive = false; } }); output.in_directive = false; } AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { print_maybe_braced_body(this.body, output); }); DEFPRINT(AST_Statement, function(self2, output) { self2.body.print(output); output.semicolon(); }); DEFPRINT(AST_Toplevel, function(self2, output) { display_body(self2.body, true, output, true); output.print(""); }); DEFPRINT(AST_LabeledStatement, function(self2, output) { self2.label.print(output); output.colon(); self2.body.print(output); }); DEFPRINT(AST_SimpleStatement, function(self2, output) { self2.body.print(output); output.semicolon(); }); function print_braced_empty(self2, output) { output.print("{"); output.with_indent(output.next_indent(), function() { output.append_comments(self2, true); }); output.add_mapping(self2.end); output.print("}"); } function print_braced(self2, output, allow_directives) { if (self2.body.length > 0) { output.with_block(function() { display_body(self2.body, false, output, allow_directives); output.add_mapping(self2.end); }); } else print_braced_empty(self2, output); } DEFPRINT(AST_BlockStatement, function(self2, output) { print_braced(self2, output); }); DEFPRINT(AST_EmptyStatement, function(self2, output) { output.semicolon(); }); DEFPRINT(AST_Do, function(self2, output) { output.print("do"); output.space(); make_block(self2.body, output); output.space(); output.print("while"); output.space(); output.with_parens(function() { self2.condition.print(output); }); output.semicolon(); }); DEFPRINT(AST_While, function(self2, output) { output.print("while"); output.space(); output.with_parens(function() { self2.condition.print(output); }); output.space(); self2._do_print_body(output); }); DEFPRINT(AST_For, function(self2, output) { output.print("for"); output.space(); output.with_parens(function() { if (self2.init) { if (self2.init instanceof AST_Definitions) { self2.init.print(output); } else { parenthesize_for_noin(self2.init, output, true); } output.print(";"); output.space(); } else { output.print(";"); } if (self2.condition) { self2.condition.print(output); output.print(";"); output.space(); } else { output.print(";"); } if (self2.step) { self2.step.print(output); } }); output.space(); self2._do_print_body(output); }); DEFPRINT(AST_ForIn, function(self2, output) { output.print("for"); if (self2.await) { output.space(); output.print("await"); } output.space(); output.with_parens(function() { self2.init.print(output); output.space(); output.print(self2 instanceof AST_ForOf ? "of" : "in"); output.space(); self2.object.print(output); }); output.space(); self2._do_print_body(output); }); DEFPRINT(AST_With, function(self2, output) { output.print("with"); output.space(); output.with_parens(function() { self2.expression.print(output); }); output.space(); self2._do_print_body(output); }); AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { var self2 = this; if (!nokeyword) { if (self2.async) { output.print("async"); output.space(); } output.print("function"); if (self2.is_generator) { output.star(); } if (self2.name) { output.space(); } } if (self2.name instanceof AST_Symbol) { self2.name.print(output); } else if (nokeyword && self2.name instanceof AST_Node) { output.with_square(function() { self2.name.print(output); }); } output.with_parens(function() { self2.argnames.forEach(function(arg, i) { if (i) output.comma(); arg.print(output); }); }); output.space(); print_braced(self2, output, true); }); DEFPRINT(AST_Lambda, function(self2, output) { self2._do_print(output); output.gc_scope(self2); }); DEFPRINT(AST_PrefixedTemplateString, function(self2, output) { var tag = self2.prefix; var parenthesize_tag = tag instanceof AST_Lambda || tag instanceof AST_Binary || tag instanceof AST_Conditional || tag instanceof AST_Sequence || tag instanceof AST_Unary || tag instanceof AST_Dot && tag.expression instanceof AST_Object; if (parenthesize_tag) output.print("("); self2.prefix.print(output); if (parenthesize_tag) output.print(")"); self2.template_string.print(output); }); DEFPRINT(AST_TemplateString, function(self2, output) { var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; output.print("`"); for (var i = 0; i < self2.segments.length; i++) { if (!(self2.segments[i] instanceof AST_TemplateSegment)) { output.print("${"); self2.segments[i].print(output); output.print("}"); } else if (is_tagged) { output.print(self2.segments[i].raw); } else { output.print_template_string_chars(self2.segments[i].value); } } output.print("`"); }); DEFPRINT(AST_TemplateSegment, function(self2, output) { output.print_template_string_chars(self2.value); }); AST_Arrow.DEFMETHOD("_do_print", function(output) { var self2 = this; var parent = output.parent(); var needs_parens = parent instanceof AST_Binary && !(parent instanceof AST_Assign) || parent instanceof AST_Unary || parent instanceof AST_Call && self2 === parent.expression; if (needs_parens) { output.print("("); } if (self2.async) { output.print("async"); output.space(); } if (self2.argnames.length === 1 && self2.argnames[0] instanceof AST_Symbol) { self2.argnames[0].print(output); } else { output.with_parens(function() { self2.argnames.forEach(function(arg, i) { if (i) output.comma(); arg.print(output); }); }); } output.space(); output.print("=>"); output.space(); const first_statement = self2.body[0]; if (self2.body.length === 1 && first_statement instanceof AST_Return) { const returned = first_statement.value; if (!returned) { output.print("{}"); } else if (left_is_object(returned)) { output.print("("); returned.print(output); output.print(")"); } else { returned.print(output); } } else { print_braced(self2, output); } if (needs_parens) { output.print(")"); } output.gc_scope(self2); }); AST_Exit.DEFMETHOD("_do_print", function(output, kind) { output.print(kind); if (this.value) { output.space(); const comments = this.value.start.comments_before; if (comments && comments.length && !output.printed_comments.has(comments)) { output.print("("); this.value.print(output); output.print(")"); } else { this.value.print(output); } } output.semicolon(); }); DEFPRINT(AST_Return, function(self2, output) { self2._do_print(output, "return"); }); DEFPRINT(AST_Throw, function(self2, output) { self2._do_print(output, "throw"); }); DEFPRINT(AST_Yield, function(self2, output) { var star = self2.is_star ? "*" : ""; output.print("yield" + star); if (self2.expression) { output.space(); self2.expression.print(output); } }); DEFPRINT(AST_Await, function(self2, output) { output.print("await"); output.space(); var e = self2.expression; var parens = !(e instanceof AST_Call || e instanceof AST_SymbolRef || e instanceof AST_PropAccess || e instanceof AST_Unary || e instanceof AST_Constant || e instanceof AST_Await || e instanceof AST_Object); if (parens) output.print("("); self2.expression.print(output); if (parens) output.print(")"); }); AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { output.print(kind); if (this.label) { output.space(); this.label.print(output); } output.semicolon(); }); DEFPRINT(AST_Break, function(self2, output) { self2._do_print(output, "break"); }); DEFPRINT(AST_Continue, function(self2, output) { self2._do_print(output, "continue"); }); function make_then(self2, output) { var b = self2.body; if (output.option("braces") || output.option("ie8") && b instanceof AST_Do) return make_block(b, output); if (!b) return output.force_semicolon(); while (true) { if (b instanceof AST_If) { if (!b.alternative) { make_block(self2.body, output); return; } b = b.alternative; } else if (b instanceof AST_StatementWithBody) { b = b.body; } else break; } print_maybe_braced_body(self2.body, output); } DEFPRINT(AST_If, function(self2, output) { output.print("if"); output.space(); output.with_parens(function() { self2.condition.print(output); }); output.space(); if (self2.alternative) { make_then(self2, output); output.space(); output.print("else"); output.space(); if (self2.alternative instanceof AST_If) self2.alternative.print(output); else print_maybe_braced_body(self2.alternative, output); } else { self2._do_print_body(output); } }); DEFPRINT(AST_Switch, function(self2, output) { output.print("switch"); output.space(); output.with_parens(function() { self2.expression.print(output); }); output.space(); var last2 = self2.body.length - 1; if (last2 < 0) print_braced_empty(self2, output); else output.with_block(function() { self2.body.forEach(function(branch, i) { output.indent(true); branch.print(output); if (i < last2 && branch.body.length > 0) output.newline(); }); }); }); AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { output.newline(); this.body.forEach(function(stmt) { output.indent(); stmt.print(output); output.newline(); }); }); DEFPRINT(AST_Default, function(self2, output) { output.print("default:"); self2._do_print_body(output); }); DEFPRINT(AST_Case, function(self2, output) { output.print("case"); output.space(); self2.expression.print(output); output.print(":"); self2._do_print_body(output); }); DEFPRINT(AST_Try, function(self2, output) { output.print("try"); output.space(); self2.body.print(output); if (self2.bcatch) { output.space(); self2.bcatch.print(output); } if (self2.bfinally) { output.space(); self2.bfinally.print(output); } }); DEFPRINT(AST_TryBlock, function(self2, output) { print_braced(self2, output); }); DEFPRINT(AST_Catch, function(self2, output) { output.print("catch"); if (self2.argname) { output.space(); output.with_parens(function() { self2.argname.print(output); }); } output.space(); print_braced(self2, output); }); DEFPRINT(AST_Finally, function(self2, output) { output.print("finally"); output.space(); print_braced(self2, output); }); AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { output.print(kind); output.space(); this.definitions.forEach(function(def, i) { if (i) output.comma(); def.print(output); }); var p = output.parent(); var in_for = p instanceof AST_For || p instanceof AST_ForIn; var output_semicolon = !in_for || p && p.init !== this; if (output_semicolon) output.semicolon(); }); DEFPRINT(AST_Let, function(self2, output) { self2._do_print(output, "let"); }); DEFPRINT(AST_Var, function(self2, output) { self2._do_print(output, "var"); }); DEFPRINT(AST_Const, function(self2, output) { self2._do_print(output, "const"); }); DEFPRINT(AST_Import, function(self2, output) { output.print("import"); output.space(); if (self2.imported_name) { self2.imported_name.print(output); } if (self2.imported_name && self2.imported_names) { output.print(","); output.space(); } if (self2.imported_names) { if (self2.imported_names.length === 1 && self2.imported_names[0].foreign_name.name === "*" && !self2.imported_names[0].foreign_name.quote) { self2.imported_names[0].print(output); } else { output.print("{"); self2.imported_names.forEach(function(name_import, i) { output.space(); name_import.print(output); if (i < self2.imported_names.length - 1) { output.print(","); } }); output.space(); output.print("}"); } } if (self2.imported_name || self2.imported_names) { output.space(); output.print("from"); output.space(); } self2.module_name.print(output); if (self2.assert_clause) { output.print("assert"); self2.assert_clause.print(output); } output.semicolon(); }); DEFPRINT(AST_ImportMeta, function(self2, output) { output.print("import.meta"); }); DEFPRINT(AST_NameMapping, function(self2, output) { var is_import = output.parent() instanceof AST_Import; var definition = self2.name.definition(); var foreign_name = self2.foreign_name; var names_are_different = (definition && definition.mangled_name || self2.name.name) !== foreign_name.name; if (!names_are_different && foreign_name.name === "*" && foreign_name.quote != self2.name.quote) { names_are_different = true; } var foreign_name_is_name = foreign_name.quote == null; if (names_are_different) { if (is_import) { if (foreign_name_is_name) { output.print(foreign_name.name); } else { output.print_string(foreign_name.name, foreign_name.quote); } } else { if (self2.name.quote == null) { self2.name.print(output); } else { output.print_string(self2.name.name, self2.name.quote); } } output.space(); output.print("as"); output.space(); if (is_import) { self2.name.print(output); } else { if (foreign_name_is_name) { output.print(foreign_name.name); } else { output.print_string(foreign_name.name, foreign_name.quote); } } } else { if (self2.name.quote == null) { self2.name.print(output); } else { output.print_string(self2.name.name, self2.name.quote); } } }); DEFPRINT(AST_Export, function(self2, output) { output.print("export"); output.space(); if (self2.is_default) { output.print("default"); output.space(); } if (self2.exported_names) { if (self2.exported_names.length === 1 && self2.exported_names[0].name.name === "*" && !self2.exported_names[0].name.quote) { self2.exported_names[0].print(output); } else { output.print("{"); self2.exported_names.forEach(function(name_export, i) { output.space(); name_export.print(output); if (i < self2.exported_names.length - 1) { output.print(","); } }); output.space(); output.print("}"); } } else if (self2.exported_value) { self2.exported_value.print(output); } else if (self2.exported_definition) { self2.exported_definition.print(output); if (self2.exported_definition instanceof AST_Definitions) return; } if (self2.module_name) { output.space(); output.print("from"); output.space(); self2.module_name.print(output); } if (self2.assert_clause) { output.print("assert"); self2.assert_clause.print(output); } if (self2.exported_value && !(self2.exported_value instanceof AST_Defun || self2.exported_value instanceof AST_Function || self2.exported_value instanceof AST_Class) || self2.module_name || self2.exported_names) { output.semicolon(); } }); function parenthesize_for_noin(node, output, noin) { var parens = false; if (noin) { parens = walk(node, (node2) => { if (node2 instanceof AST_Scope && !(node2 instanceof AST_Arrow)) { return true; } if (node2 instanceof AST_Binary && node2.operator == "in" || node2 instanceof AST_PrivateIn) { return walk_abort; } }); } node.print(output, parens); } DEFPRINT(AST_VarDef, function(self2, output) { self2.name.print(output); if (self2.value) { output.space(); output.print("="); output.space(); var p = output.parent(1); var noin = p instanceof AST_For || p instanceof AST_ForIn; parenthesize_for_noin(self2.value, output, noin); } }); DEFPRINT(AST_Call, function(self2, output) { self2.expression.print(output); if (self2 instanceof AST_New && self2.args.length === 0) return; if (self2.expression instanceof AST_Call || self2.expression instanceof AST_Lambda) { output.add_mapping(self2.start); } if (self2.optional) output.print("?."); output.with_parens(function() { self2.args.forEach(function(expr, i) { if (i) output.comma(); expr.print(output); }); }); }); DEFPRINT(AST_New, function(self2, output) { output.print("new"); output.space(); AST_Call.prototype._codegen(self2, output); }); AST_Sequence.DEFMETHOD("_do_print", function(output) { this.expressions.forEach(function(node, index) { if (index > 0) { output.comma(); if (output.should_break()) { output.newline(); output.indent(); } } node.print(output); }); }); DEFPRINT(AST_Sequence, function(self2, output) { self2._do_print(output); }); DEFPRINT(AST_Dot, function(self2, output) { var expr = self2.expression; expr.print(output); var prop = self2.property; var print_computed = ALL_RESERVED_WORDS.has(prop) ? output.option("ie8") : !is_identifier_string(prop, output.option("ecma") >= 2015 && !output.option("safari10")); if (self2.optional) output.print("?."); if (print_computed) { output.print("["); output.add_mapping(self2.end); output.print_string(prop); output.print("]"); } else { if (expr instanceof AST_Number && expr.getValue() >= 0) { if (!/[xa-f.)]/i.test(output.last())) { output.print("."); } } if (!self2.optional) output.print("."); output.add_mapping(self2.end); output.print_name(prop); } }); DEFPRINT(AST_DotHash, function(self2, output) { var expr = self2.expression; expr.print(output); var prop = self2.property; if (self2.optional) output.print("?"); output.print(".#"); output.add_mapping(self2.end); output.print_name(prop); }); DEFPRINT(AST_Sub, function(self2, output) { self2.expression.print(output); if (self2.optional) output.print("?."); output.print("["); self2.property.print(output); output.print("]"); }); DEFPRINT(AST_Chain, function(self2, output) { self2.expression.print(output); }); DEFPRINT(AST_UnaryPrefix, function(self2, output) { var op = self2.operator; if (op === "--" && output.last().endsWith("!")) { output.print(" "); } output.print(op); if (/^[a-z]/i.test(op) || /[+-]$/.test(op) && self2.expression instanceof AST_UnaryPrefix && /^[+-]/.test(self2.expression.operator)) { output.space(); } self2.expression.print(output); }); DEFPRINT(AST_UnaryPostfix, function(self2, output) { self2.expression.print(output); output.print(self2.operator); }); DEFPRINT(AST_Binary, function(self2, output) { var op = self2.operator; self2.left.print(output); if (op[0] == ">" && output.last().endsWith("--")) { output.print(" "); } else { output.space(); } output.print(op); output.space(); self2.right.print(output); }); DEFPRINT(AST_Conditional, function(self2, output) { self2.condition.print(output); output.space(); output.print("?"); output.space(); self2.consequent.print(output); output.space(); output.colon(); self2.alternative.print(output); }); DEFPRINT(AST_Array, function(self2, output) { output.with_square(function() { var a = self2.elements, len = a.length; if (len > 0) output.space(); a.forEach(function(exp, i) { if (i) output.comma(); exp.print(output); if (i === len - 1 && exp instanceof AST_Hole) output.comma(); }); if (len > 0) output.space(); }); }); DEFPRINT(AST_Object, function(self2, output) { if (self2.properties.length > 0) output.with_block(function() { self2.properties.forEach(function(prop, i) { if (i) { output.print(","); output.newline(); } output.indent(); prop.print(output); }); output.newline(); }); else print_braced_empty(self2, output); }); DEFPRINT(AST_Class, function(self2, output) { output.print("class"); output.space(); if (self2.name) { self2.name.print(output); output.space(); } if (self2.extends) { var parens = !(self2.extends instanceof AST_SymbolRef) && !(self2.extends instanceof AST_PropAccess) && !(self2.extends instanceof AST_ClassExpression) && !(self2.extends instanceof AST_Function); output.print("extends"); if (parens) { output.print("("); } else { output.space(); } self2.extends.print(output); if (parens) { output.print(")"); } else { output.space(); } } if (self2.properties.length > 0) output.with_block(function() { self2.properties.forEach(function(prop, i) { if (i) { output.newline(); } output.indent(); prop.print(output); }); output.newline(); }); else output.print("{}"); }); DEFPRINT(AST_NewTarget, function(self2, output) { output.print("new.target"); }); function print_property_name(key, quote, output) { if (output.option("quote_keys")) { output.print_string(key); return false; } if ("" + +key == key && key >= 0) { if (output.option("keep_numbers")) { output.print(key); return false; } output.print(make_num(key)); return false; } var print_string = ALL_RESERVED_WORDS.has(key) ? output.option("ie8") : output.option("ecma") < 2015 || output.option("safari10") ? !is_basic_identifier_string(key) : !is_identifier_string(key, true); if (print_string || quote && output.option("keep_quoted_props")) { output.print_string(key, quote); return false; } output.print_name(key); return true; } DEFPRINT(AST_ObjectKeyVal, function(self2, output) { function get_name(self3) { var def = self3.definition(); return def ? def.mangled_name || def.name : self3.name; } const try_shorthand = output.option("shorthand") && !(self2.key instanceof AST_Node); if (try_shorthand && self2.value instanceof AST_Symbol && get_name(self2.value) === self2.key && !ALL_RESERVED_WORDS.has(self2.key)) { const was_shorthand = print_property_name(self2.key, self2.quote, output); if (!was_shorthand) { output.colon(); self2.value.print(output); } } else if (try_shorthand && self2.value instanceof AST_DefaultAssign && self2.value.left instanceof AST_Symbol && get_name(self2.value.left) === self2.key) { const was_shorthand = print_property_name(self2.key, self2.quote, output); if (!was_shorthand) { output.colon(); self2.value.left.print(output); } output.space(); output.print("="); output.space(); self2.value.right.print(output); } else { if (!(self2.key instanceof AST_Node)) { print_property_name(self2.key, self2.quote, output); } else { output.with_square(function() { self2.key.print(output); }); } output.colon(); self2.value.print(output); } }); DEFPRINT(AST_ClassPrivateProperty, (self2, output) => { if (self2.static) { output.print("static"); output.space(); } output.print("#"); print_property_name(self2.key.name, self2.quote, output); if (self2.value) { output.print("="); self2.value.print(output); } output.semicolon(); }); DEFPRINT(AST_ClassProperty, (self2, output) => { if (self2.static) { output.print("static"); output.space(); } if (self2.key instanceof AST_SymbolClassProperty) { print_property_name(self2.key.name, self2.quote, output); } else { output.print("["); self2.key.print(output); output.print("]"); } if (self2.value) { output.print("="); self2.value.print(output); } output.semicolon(); }); AST_ObjectProperty.DEFMETHOD("_print_getter_setter", function(type, is_private, output) { var self2 = this; if (self2.static) { output.print("static"); output.space(); } if (type) { output.print(type); output.space(); } if (self2.key instanceof AST_SymbolMethod) { if (is_private) output.print("#"); print_property_name(self2.key.name, self2.quote, output); self2.key.add_source_map(output); } else { output.with_square(function() { self2.key.print(output); }); } self2.value._do_print(output, true); }); DEFPRINT(AST_ObjectSetter, function(self2, output) { self2._print_getter_setter("set", false, output); }); DEFPRINT(AST_ObjectGetter, function(self2, output) { self2._print_getter_setter("get", false, output); }); DEFPRINT(AST_PrivateSetter, function(self2, output) { self2._print_getter_setter("set", true, output); }); DEFPRINT(AST_PrivateGetter, function(self2, output) { self2._print_getter_setter("get", true, output); }); DEFPRINT(AST_PrivateMethod, function(self2, output) { var type; if (self2.is_generator && self2.async) { type = "async*"; } else if (self2.is_generator) { type = "*"; } else if (self2.async) { type = "async"; } self2._print_getter_setter(type, true, output); }); DEFPRINT(AST_PrivateIn, function(self2, output) { self2.key.print(output); output.space(); output.print("in"); output.space(); self2.value.print(output); }); DEFPRINT(AST_SymbolPrivateProperty, function(self2, output) { output.print("#" + self2.name); }); DEFPRINT(AST_ConciseMethod, function(self2, output) { var type; if (self2.is_generator && self2.async) { type = "async*"; } else if (self2.is_generator) { type = "*"; } else if (self2.async) { type = "async"; } self2._print_getter_setter(type, false, output); }); DEFPRINT(AST_ClassStaticBlock, function(self2, output) { output.print("static"); output.space(); print_braced(self2, output); }); AST_Symbol.DEFMETHOD("_do_print", function(output) { var def = this.definition(); output.print_name(def ? def.mangled_name || def.name : this.name); }); DEFPRINT(AST_Symbol, function(self2, output) { self2._do_print(output); }); DEFPRINT(AST_Hole, noop); DEFPRINT(AST_This, function(self2, output) { output.print("this"); }); DEFPRINT(AST_Super, function(self2, output) { output.print("super"); }); DEFPRINT(AST_Constant, function(self2, output) { output.print(self2.getValue()); }); DEFPRINT(AST_String, function(self2, output) { output.print_string(self2.getValue(), self2.quote, output.in_directive); }); DEFPRINT(AST_Number, function(self2, output) { if ((output.option("keep_numbers") || output.use_asm) && self2.raw) { output.print(self2.raw); } else { output.print(make_num(self2.getValue())); } }); DEFPRINT(AST_BigInt, function(self2, output) { output.print(self2.getValue() + "n"); }); const r_slash_script = /(<\s*\/\s*script)/i; const r_starts_with_script = /^\s*script/i; const slash_script_replace = (_, $1) => $1.replace("/", "\\/"); DEFPRINT(AST_RegExp, function(self2, output) { let { source, flags } = self2.getValue(); source = regexp_source_fix(source); flags = flags ? sort_regexp_flags(flags) : ""; source = source.replace(r_slash_script, slash_script_replace); if (r_starts_with_script.test(source) && output.last().endsWith("<")) { output.print(" "); } output.print(output.to_utf8(`/${source}/${flags}`, false, true)); const parent = output.parent(); if (parent instanceof AST_Binary && /^\w/.test(parent.operator) && parent.left === self2) { output.print(" "); } }); function print_maybe_braced_body(stat, output) { if (output.option("braces")) { make_block(stat, output); } else { if (!stat || stat instanceof AST_EmptyStatement) output.force_semicolon(); else if (stat instanceof AST_Let || stat instanceof AST_Const || stat instanceof AST_Class) make_block(stat, output); else stat.print(output); } } function best_of2(a) { var best = a[0], len = best.length; for (var i = 1; i < a.length; ++i) { if (a[i].length < len) { best = a[i]; len = best.length; } } return best; } function make_num(num) { var str = num.toString(10).replace(/^0\./, ".").replace("e+", "e"); var candidates = [str]; if (Math.floor(num) === num) { if (num < 0) { candidates.push("-0x" + (-num).toString(16).toLowerCase()); } else { candidates.push("0x" + num.toString(16).toLowerCase()); } } var match, len, digits; if (match = /^\.0+/.exec(str)) { len = match[0].length; digits = str.slice(len); candidates.push(digits + "e-" + (digits.length + len - 1)); } else if (match = /0+$/.exec(str)) { len = match[0].length; candidates.push(str.slice(0, -len) + "e" + len); } else if (match = /^(\d)\.(\d+)e(-?\d+)$/.exec(str)) { candidates.push(match[1] + match[2] + "e" + (match[3] - match[2].length)); } return best_of2(candidates); } function make_block(stmt, output) { if (!stmt || stmt instanceof AST_EmptyStatement) output.print("{}"); else if (stmt instanceof AST_BlockStatement) stmt.print(output); else output.with_block(function() { output.indent(); stmt.print(output); output.newline(); }); } function DEFMAP(nodetype, generator) { nodetype.forEach(function(nodetype2) { nodetype2.DEFMETHOD("add_source_map", generator); }); } DEFMAP([ AST_Node, AST_LabeledStatement, AST_Toplevel ], noop); DEFMAP([ AST_Array, AST_BlockStatement, AST_Catch, AST_Class, AST_Constant, AST_Debugger, AST_Definitions, AST_Directive, AST_Finally, AST_Jump, AST_Lambda, AST_New, AST_Object, AST_StatementWithBody, AST_Symbol, AST_Switch, AST_SwitchBranch, AST_TemplateString, AST_TemplateSegment, AST_Try ], function(output) { output.add_mapping(this.start); }); DEFMAP([ AST_ObjectGetter, AST_ObjectSetter, AST_PrivateGetter, AST_PrivateSetter, AST_ConciseMethod, AST_PrivateMethod ], function(output) { output.add_mapping(this.start, false); }); DEFMAP([ AST_SymbolMethod, AST_SymbolPrivateProperty ], function(output) { const tok_type = this.end && this.end.type; if (tok_type === "name" || tok_type === "privatename") { output.add_mapping(this.end, this.name); } else { output.add_mapping(this.end); } }); DEFMAP([AST_ObjectProperty], function(output) { output.add_mapping(this.start, this.key); }); })(); const shallow_cmp = (node1, node2) => { return node1 === null && node2 === null || node1.TYPE === node2.TYPE && node1.shallow_cmp(node2); }; const equivalent_to = (tree1, tree2) => { if (!shallow_cmp(tree1, tree2)) return false; const walk_1_state = [tree1]; const walk_2_state = [tree2]; const walk_1_push = walk_1_state.push.bind(walk_1_state); const walk_2_push = walk_2_state.push.bind(walk_2_state); while (walk_1_state.length && walk_2_state.length) { const node_1 = walk_1_state.pop(); const node_2 = walk_2_state.pop(); if (!shallow_cmp(node_1, node_2)) return false; node_1._children_backwards(walk_1_push); node_2._children_backwards(walk_2_push); if (walk_1_state.length !== walk_2_state.length) { return false; } } return walk_1_state.length == 0 && walk_2_state.length == 0; }; const pass_through = () => true; AST_Node.prototype.shallow_cmp = function() { throw new Error("did not find a shallow_cmp function for " + this.constructor.name); }; AST_Debugger.prototype.shallow_cmp = pass_through; AST_Directive.prototype.shallow_cmp = function(other) { return this.value === other.value; }; AST_SimpleStatement.prototype.shallow_cmp = pass_through; AST_Block.prototype.shallow_cmp = pass_through; AST_EmptyStatement.prototype.shallow_cmp = pass_through; AST_LabeledStatement.prototype.shallow_cmp = function(other) { return this.label.name === other.label.name; }; AST_Do.prototype.shallow_cmp = pass_through; AST_While.prototype.shallow_cmp = pass_through; AST_For.prototype.shallow_cmp = function(other) { return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step); }; AST_ForIn.prototype.shallow_cmp = pass_through; AST_ForOf.prototype.shallow_cmp = pass_through; AST_With.prototype.shallow_cmp = pass_through; AST_Toplevel.prototype.shallow_cmp = pass_through; AST_Expansion.prototype.shallow_cmp = pass_through; AST_Lambda.prototype.shallow_cmp = function(other) { return this.is_generator === other.is_generator && this.async === other.async; }; AST_Destructuring.prototype.shallow_cmp = function(other) { return this.is_array === other.is_array; }; AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through; AST_TemplateString.prototype.shallow_cmp = pass_through; AST_TemplateSegment.prototype.shallow_cmp = function(other) { return this.value === other.value; }; AST_Jump.prototype.shallow_cmp = pass_through; AST_LoopControl.prototype.shallow_cmp = pass_through; AST_Await.prototype.shallow_cmp = pass_through; AST_Yield.prototype.shallow_cmp = function(other) { return this.is_star === other.is_star; }; AST_If.prototype.shallow_cmp = function(other) { return this.alternative == null ? other.alternative == null : this.alternative === other.alternative; }; AST_Switch.prototype.shallow_cmp = pass_through; AST_SwitchBranch.prototype.shallow_cmp = pass_through; AST_Try.prototype.shallow_cmp = function(other) { return this.body === other.body && (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally); }; AST_Catch.prototype.shallow_cmp = function(other) { return this.argname == null ? other.argname == null : this.argname === other.argname; }; AST_Finally.prototype.shallow_cmp = pass_through; AST_Definitions.prototype.shallow_cmp = pass_through; AST_VarDef.prototype.shallow_cmp = function(other) { return this.value == null ? other.value == null : this.value === other.value; }; AST_NameMapping.prototype.shallow_cmp = pass_through; AST_Import.prototype.shallow_cmp = function(other) { return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names); }; AST_ImportMeta.prototype.shallow_cmp = pass_through; AST_Export.prototype.shallow_cmp = function(other) { return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && this.module_name === other.module_name && this.is_default === other.is_default; }; AST_Call.prototype.shallow_cmp = pass_through; AST_Sequence.prototype.shallow_cmp = pass_through; AST_PropAccess.prototype.shallow_cmp = pass_through; AST_Chain.prototype.shallow_cmp = pass_through; AST_Dot.prototype.shallow_cmp = function(other) { return this.property === other.property; }; AST_DotHash.prototype.shallow_cmp = function(other) { return this.property === other.property; }; AST_Unary.prototype.shallow_cmp = function(other) { return this.operator === other.operator; }; AST_Binary.prototype.shallow_cmp = function(other) { return this.operator === other.operator; }; AST_Conditional.prototype.shallow_cmp = pass_through; AST_Array.prototype.shallow_cmp = pass_through; AST_Object.prototype.shallow_cmp = pass_through; AST_ObjectProperty.prototype.shallow_cmp = pass_through; AST_ObjectKeyVal.prototype.shallow_cmp = function(other) { return this.key === other.key; }; AST_ObjectSetter.prototype.shallow_cmp = function(other) { return this.static === other.static; }; AST_ObjectGetter.prototype.shallow_cmp = function(other) { return this.static === other.static; }; AST_ConciseMethod.prototype.shallow_cmp = function(other) { return this.static === other.static && this.is_generator === other.is_generator && this.async === other.async; }; AST_Class.prototype.shallow_cmp = function(other) { return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends); }; AST_ClassProperty.prototype.shallow_cmp = function(other) { return this.static === other.static; }; AST_Symbol.prototype.shallow_cmp = function(other) { return this.name === other.name; }; AST_NewTarget.prototype.shallow_cmp = pass_through; AST_This.prototype.shallow_cmp = pass_through; AST_Super.prototype.shallow_cmp = pass_through; AST_String.prototype.shallow_cmp = function(other) { return this.value === other.value; }; AST_Number.prototype.shallow_cmp = function(other) { return this.value === other.value; }; AST_BigInt.prototype.shallow_cmp = function(other) { return this.value === other.value; }; AST_RegExp.prototype.shallow_cmp = function(other) { return this.value.flags === other.value.flags && this.value.source === other.value.source; }; AST_Atom.prototype.shallow_cmp = pass_through; const MASK_EXPORT_DONT_MANGLE = 1 << 0; const MASK_EXPORT_WANT_MANGLE = 1 << 1; let function_defs = null; let unmangleable_names = null; let scopes_with_block_defuns = null; class SymbolDef { constructor(scope, orig, init) { this.name = orig.name; this.orig = [orig]; this.init = init; this.eliminated = 0; this.assignments = 0; this.scope = scope; this.replaced = 0; this.global = false; this.export = 0; this.mangled_name = null; this.undeclared = false; this.id = SymbolDef.next_id++; this.chained = false; this.direct_access = false; this.escaped = 0; this.recursive_refs = 0; this.references = []; this.should_replace = void 0; this.single_use = false; this.fixed = false; Object.seal(this); } fixed_value() { if (!this.fixed || this.fixed instanceof AST_Node) return this.fixed; return this.fixed(); } unmangleable(options) { if (!options) options = {}; if (function_defs && function_defs.has(this.id) && keep_name(options.keep_fnames, this.orig[0].name)) return true; return this.global && !options.toplevel || this.export & MASK_EXPORT_DONT_MANGLE || this.undeclared || !options.eval && this.scope.pinned() || (this.orig[0] instanceof AST_SymbolLambda || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) || this.orig[0] instanceof AST_SymbolMethod || (this.orig[0] instanceof AST_SymbolClass || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); } mangle(options) { const cache = options.cache && options.cache.props; if (this.global && cache && cache.has(this.name)) { this.mangled_name = cache.get(this.name); } else if (!this.mangled_name && !this.unmangleable(options)) { var s = this.scope; var sym = this.orig[0]; if (options.ie8 && sym instanceof AST_SymbolLambda) s = s.parent_scope; const redefinition = redefined_catch_def(this); this.mangled_name = redefinition ? redefinition.mangled_name || redefinition.name : s.next_mangled(options, this); if (this.global && cache) { cache.set(this.name, this.mangled_name); } } } } SymbolDef.next_id = 1; function redefined_catch_def(def) { if (def.orig[0] instanceof AST_SymbolCatch && def.scope.is_block_scope()) { return def.scope.get_defun_scope().variables.get(def.name); } } AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = null, toplevel = this } = {}) { options = defaults(options, { cache: null, ie8: false, safari10: false, module: false }); if (!(toplevel instanceof AST_Toplevel)) { throw new Error("Invalid toplevel scope"); } var scope = this.parent_scope = parent_scope; var labels = /* @__PURE__ */ new Map(); var defun = null; var in_destructuring = null; var for_scopes = []; var tw = new TreeWalker((node, descend) => { if (node.is_block_scope()) { const save_scope2 = scope; node.block_scope = scope = new AST_Scope(node); scope._block_scope = true; scope.init_scope_vars(save_scope2); scope.uses_with = save_scope2.uses_with; scope.uses_eval = save_scope2.uses_eval; if (options.safari10) { if (node instanceof AST_For || node instanceof AST_ForIn || node instanceof AST_ForOf) { for_scopes.push(scope); } } if (node instanceof AST_Switch) { const the_block_scope = scope; scope = save_scope2; node.expression.walk(tw); scope = the_block_scope; for (let i = 0; i < node.body.length; i++) { node.body[i].walk(tw); } } else { descend(); } scope = save_scope2; return true; } if (node instanceof AST_Destructuring) { const save_destructuring = in_destructuring; in_destructuring = node; descend(); in_destructuring = save_destructuring; return true; } if (node instanceof AST_Scope) { node.init_scope_vars(scope); var save_scope = scope; var save_defun = defun; var save_labels = labels; defun = scope = node; labels = /* @__PURE__ */ new Map(); descend(); scope = save_scope; defun = save_defun; labels = save_labels; return true; } if (node instanceof AST_LabeledStatement) { var l = node.label; if (labels.has(l.name)) { throw new Error(string_template("Label {name} defined twice", l)); } labels.set(l.name, l); descend(); labels.delete(l.name); return true; } if (node instanceof AST_With) { for (var s = scope; s; s = s.parent_scope) s.uses_with = true; return; } if (node instanceof AST_Symbol) { node.scope = scope; } if (node instanceof AST_Label) { node.thedef = node; node.references = []; } if (node instanceof AST_SymbolLambda) { defun.def_function(node, node.name == "arguments" ? void 0 : defun); } else if (node instanceof AST_SymbolDefun) { const closest_scope = defun.parent_scope; node.scope = tw.directives["use strict"] ? closest_scope : closest_scope.get_defun_scope(); mark_export(node.scope.def_function(node, defun), 1); } else if (node instanceof AST_SymbolClass) { mark_export(defun.def_variable(node, defun), 1); } else if (node instanceof AST_SymbolImport) { scope.def_variable(node); } else if (node instanceof AST_SymbolDefClass) { mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); } else if (node instanceof AST_SymbolVar || node instanceof AST_SymbolLet || node instanceof AST_SymbolConst || node instanceof AST_SymbolCatch) { var def; if (node instanceof AST_SymbolBlockDeclaration) { def = scope.def_variable(node, null); } else { def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : void 0); } if (!def.orig.every((sym2) => { if (sym2 === node) return true; if (node instanceof AST_SymbolBlockDeclaration) { return sym2 instanceof AST_SymbolLambda; } return !(sym2 instanceof AST_SymbolLet || sym2 instanceof AST_SymbolConst); })) { js_error(`"${node.name}" is redeclared`, node.start.file, node.start.line, node.start.col, node.start.pos); } if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); if (defun !== scope) { node.mark_enclosed(); var def = scope.find_variable(node); if (node.thedef !== def) { node.thedef = def; node.reference(); } } } else if (node instanceof AST_LabelRef) { var sym = labels.get(node.name); if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { name: node.name, line: node.start.line, col: node.start.col })); node.thedef = sym; } if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { js_error(`"${node.TYPE}" statement may only appear at the top level`, node.start.file, node.start.line, node.start.col, node.start.pos); } }); if (options.module) { tw.directives["use strict"] = true; } this.walk(tw); function mark_export(def, level) { if (in_destructuring) { var i = 0; do { level++; } while (tw.parent(i++) !== in_destructuring); } var node = tw.parent(level); if (def.export = node instanceof AST_Export ? MASK_EXPORT_DONT_MANGLE : 0) { var exported = node.exported_definition; if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { def.export = MASK_EXPORT_WANT_MANGLE; } } } const is_toplevel = this instanceof AST_Toplevel; if (is_toplevel) { this.globals = /* @__PURE__ */ new Map(); } var tw = new TreeWalker((node) => { if (node instanceof AST_LoopControl && node.label) { node.label.thedef.references.push(node); return true; } if (node instanceof AST_SymbolRef) { var name = node.name; if (name == "eval" && tw.parent() instanceof AST_Call) { for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { s.uses_eval = true; } } var sym; if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name || !(sym = node.scope.find_variable(name))) { sym = toplevel.def_global(node); if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; } else if (sym.scope instanceof AST_Lambda && name == "arguments") { sym.scope.get_defun_scope().uses_arguments = true; } node.thedef = sym; node.reference(); if (node.scope.is_block_scope() && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { node.scope = node.scope.get_defun_scope(); } return true; } var def; if (node instanceof AST_SymbolCatch && (def = redefined_catch_def(node.definition()))) { var s = node.scope; while (s) { push_uniq(s.enclosed, def); if (s === def.scope) break; s = s.parent_scope; } } }); this.walk(tw); if (options.ie8 || options.safari10) { walk(this, (node) => { if (node instanceof AST_SymbolCatch) { var name = node.name; var refs = node.thedef.references; var scope2 = node.scope.get_defun_scope(); var def = scope2.find_variable(name) || toplevel.globals.get(name) || scope2.def_variable(node); refs.forEach(function(ref) { ref.thedef = def; ref.reference(); }); node.thedef = def; node.reference(); return true; } }); } if (options.safari10) { for (const scope2 of for_scopes) { scope2.parent_scope.variables.forEach(function(def) { push_uniq(scope2.enclosed, def); }); } } }); AST_Toplevel.DEFMETHOD("def_global", function(node) { var globals = this.globals, name = node.name; if (globals.has(name)) { return globals.get(name); } else { var g = new SymbolDef(this, node); g.undeclared = true; g.global = true; globals.set(name, g); return g; } }); AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { this.variables = /* @__PURE__ */ new Map(); this.uses_with = false; this.uses_eval = false; this.parent_scope = parent_scope; this.enclosed = []; this.cname = -1; }); AST_Scope.DEFMETHOD("conflicting_def", function(name) { return this.enclosed.find((def) => def.name === name) || this.variables.has(name) || this.parent_scope && this.parent_scope.conflicting_def(name); }); AST_Scope.DEFMETHOD("conflicting_def_shallow", function(name) { return this.enclosed.find((def) => def.name === name) || this.variables.has(name); }); AST_Scope.DEFMETHOD("add_child_scope", function(scope) { if (scope.parent_scope === this) return; scope.parent_scope = this; if (scope instanceof AST_Arrow && !this.uses_arguments) { this.uses_arguments = walk(scope, (node) => { if (node instanceof AST_SymbolRef && node.scope instanceof AST_Lambda && node.name === "arguments") { return walk_abort; } if (node instanceof AST_Lambda && !(node instanceof AST_Arrow)) { return true; } }); } this.uses_with = this.uses_with || scope.uses_with; this.uses_eval = this.uses_eval || scope.uses_eval; const scope_ancestry = (() => { const ancestry = []; let cur = this; do { ancestry.push(cur); } while (cur = cur.parent_scope); ancestry.reverse(); return ancestry; })(); const new_scope_enclosed_set = new Set(scope.enclosed); const to_enclose = []; for (const scope_topdown of scope_ancestry) { to_enclose.forEach((e) => push_uniq(scope_topdown.enclosed, e)); for (const def of scope_topdown.variables.values()) { if (new_scope_enclosed_set.has(def)) { push_uniq(to_enclose, def); push_uniq(scope_topdown.enclosed, def); } } } }); function find_scopes_visible_from(scopes) { const found_scopes = /* @__PURE__ */ new Set(); for (const scope of new Set(scopes)) { (function bubble_up(scope2) { if (scope2 == null || found_scopes.has(scope2)) return; found_scopes.add(scope2); bubble_up(scope2.parent_scope); })(scope); } return [...found_scopes]; } AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { source, tentative_name, scope, conflict_scopes = [scope], init = null } = {}) { let symbol_name; conflict_scopes = find_scopes_visible_from(conflict_scopes); if (tentative_name) { tentative_name = symbol_name = tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); let i = 0; while (conflict_scopes.find((s) => s.conflicting_def_shallow(symbol_name))) { symbol_name = tentative_name + "$" + i++; } } if (!symbol_name) { throw new Error("No symbol name could be generated in create_symbol()"); } const symbol = make_node(SymClass, source, { name: symbol_name, scope }); this.def_variable(symbol, init || null); symbol.mark_enclosed(); return symbol; }); AST_Node.DEFMETHOD("is_block_scope", return_false); AST_Class.DEFMETHOD("is_block_scope", return_false); AST_Lambda.DEFMETHOD("is_block_scope", return_false); AST_Toplevel.DEFMETHOD("is_block_scope", return_false); AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); AST_Block.DEFMETHOD("is_block_scope", return_true); AST_Scope.DEFMETHOD("is_block_scope", function() { return this._block_scope || false; }); AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); AST_Lambda.DEFMETHOD("init_scope_vars", function() { AST_Scope.prototype.init_scope_vars.apply(this, arguments); this.uses_arguments = false; this.def_variable(new AST_SymbolFunarg({ name: "arguments", start: this.start, end: this.end })); }); AST_Arrow.DEFMETHOD("init_scope_vars", function() { AST_Scope.prototype.init_scope_vars.apply(this, arguments); this.uses_arguments = false; }); AST_Symbol.DEFMETHOD("mark_enclosed", function() { var def = this.definition(); var s = this.scope; while (s) { push_uniq(s.enclosed, def); if (s === def.scope) break; s = s.parent_scope; } }); AST_Symbol.DEFMETHOD("reference", function() { this.definition().references.push(this); this.mark_enclosed(); }); AST_Scope.DEFMETHOD("find_variable", function(name) { if (name instanceof AST_Symbol) name = name.name; return this.variables.get(name) || this.parent_scope && this.parent_scope.find_variable(name); }); AST_Scope.DEFMETHOD("def_function", function(symbol, init) { var def = this.def_variable(symbol, init); if (!def.init || def.init instanceof AST_Defun) def.init = init; return def; }); AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { var def = this.variables.get(symbol.name); if (def) { def.orig.push(symbol); if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { def.init = init; } } else { def = new SymbolDef(this, symbol, init); this.variables.set(symbol.name, def); def.global = !this.parent_scope; } return symbol.thedef = def; }); function next_mangled(scope, options) { let defun_scope; if (scopes_with_block_defuns && (defun_scope = scope.get_defun_scope()) && scopes_with_block_defuns.has(defun_scope)) { scope = defun_scope; } var ext = scope.enclosed; var nth_identifier = options.nth_identifier; out: while (true) { var m = nth_identifier.get(++scope.cname); if (ALL_RESERVED_WORDS.has(m)) continue; if (options.reserved.has(m)) continue; if (unmangleable_names && unmangleable_names.has(m)) continue out; for (let i = ext.length; --i >= 0; ) { const def = ext[i]; const name = def.mangled_name || def.unmangleable(options) && def.name; if (m == name) continue out; } return m; } } AST_Scope.DEFMETHOD("next_mangled", function(options) { return next_mangled(this, options); }); AST_Toplevel.DEFMETHOD("next_mangled", function(options) { let name; const mangled_names = this.mangled_names; do { name = next_mangled(this, options); } while (mangled_names.has(name)); return name; }); AST_Function.DEFMETHOD("next_mangled", function(options, def) { var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; while (true) { var name = next_mangled(this, options); if (!tricky_name || tricky_name != name) return name; } }); AST_Symbol.DEFMETHOD("unmangleable", function(options) { var def = this.definition(); return !def || def.unmangleable(options); }); AST_Label.DEFMETHOD("unmangleable", return_false); AST_Symbol.DEFMETHOD("unreferenced", function() { return !this.definition().references.length && !this.scope.pinned(); }); AST_Symbol.DEFMETHOD("definition", function() { return this.thedef; }); AST_Symbol.DEFMETHOD("global", function() { return this.thedef.global; }); function format_mangler_options(options) { options = defaults(options, { eval: false, nth_identifier: base54, ie8: false, keep_classnames: false, keep_fnames: false, module: false, reserved: [], toplevel: false }); if (options.module) options.toplevel = true; if (!Array.isArray(options.reserved) && !(options.reserved instanceof Set)) { options.reserved = []; } options.reserved = new Set(options.reserved); options.reserved.add("arguments"); return options; } AST_Toplevel.DEFMETHOD("mangle_names", function(options) { options = format_mangler_options(options); var nth_identifier = options.nth_identifier; var lname = -1; var to_mangle = []; if (options.keep_fnames) { function_defs = /* @__PURE__ */ new Set(); } const mangled_names = this.mangled_names = /* @__PURE__ */ new Set(); unmangleable_names = /* @__PURE__ */ new Set(); if (options.cache) { this.globals.forEach(collect); if (options.cache.props) { options.cache.props.forEach(function(mangled_name) { mangled_names.add(mangled_name); }); } } var tw = new TreeWalker(function(node, descend) { if (node instanceof AST_LabeledStatement) { var save_nesting = lname; descend(); lname = save_nesting; return true; } if (node instanceof AST_Defun && !(tw.parent() instanceof AST_Scope)) { scopes_with_block_defuns = scopes_with_block_defuns || /* @__PURE__ */ new Set(); scopes_with_block_defuns.add(node.parent_scope.get_defun_scope()); } if (node instanceof AST_Scope) { node.variables.forEach(collect); return; } if (node.is_block_scope()) { node.block_scope.variables.forEach(collect); return; } if (function_defs && node instanceof AST_VarDef && node.value instanceof AST_Lambda && !node.value.name && keep_name(options.keep_fnames, node.name.name)) { function_defs.add(node.name.definition().id); return; } if (node instanceof AST_Label) { let name; do { name = nth_identifier.get(++lname); } while (ALL_RESERVED_WORDS.has(name)); node.mangled_name = name; return true; } if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { to_mangle.push(node.definition()); return; } }); this.walk(tw); if (options.keep_fnames || options.keep_classnames) { to_mangle.forEach((def) => { if (def.name.length < 6 && def.unmangleable(options)) { unmangleable_names.add(def.name); } }); } to_mangle.forEach((def) => { def.mangle(options); }); function_defs = null; unmangleable_names = null; scopes_with_block_defuns = null; function collect(symbol) { if (symbol.export & MASK_EXPORT_DONT_MANGLE) { unmangleable_names.add(symbol.name); } else if (!options.reserved.has(symbol.name)) { to_mangle.push(symbol); } } }); AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { const cache = options.cache && options.cache.props; const avoid = /* @__PURE__ */ new Set(); options.reserved.forEach(to_avoid); this.globals.forEach(add_def); this.walk(new TreeWalker(function(node) { if (node instanceof AST_Scope) node.variables.forEach(add_def); if (node instanceof AST_SymbolCatch) add_def(node.definition()); })); return avoid; function to_avoid(name) { avoid.add(name); } function add_def(def) { var name = def.name; if (def.global && cache && cache.has(name)) name = cache.get(name); else if (!def.unmangleable(options)) return; to_avoid(name); } }); AST_Toplevel.DEFMETHOD("expand_names", function(options) { options = format_mangler_options(options); var nth_identifier = options.nth_identifier; if (nth_identifier.reset && nth_identifier.sort) { nth_identifier.reset(); nth_identifier.sort(); } var avoid = this.find_colliding_names(options); var cname = 0; this.globals.forEach(rename); this.walk(new TreeWalker(function(node) { if (node instanceof AST_Scope) node.variables.forEach(rename); if (node instanceof AST_SymbolCatch) rename(node.definition()); })); function next_name() { var name; do { name = nth_identifier.get(cname++); } while (avoid.has(name) || ALL_RESERVED_WORDS.has(name)); return name; } function rename(def) { if (def.global && options.cache) return; if (def.unmangleable(options)) return; if (options.reserved.has(def.name)) return; const redefinition = redefined_catch_def(def); const name = def.name = redefinition ? redefinition.name : next_name(); def.orig.forEach(function(sym) { sym.name = name; }); def.references.forEach(function(sym) { sym.name = name; }); } }); AST_Node.DEFMETHOD("tail_node", return_this); AST_Sequence.DEFMETHOD("tail_node", function() { return this.expressions[this.expressions.length - 1]; }); AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { options = format_mangler_options(options); var nth_identifier = options.nth_identifier; if (!nth_identifier.reset || !nth_identifier.consider || !nth_identifier.sort) { return; } nth_identifier.reset(); try { AST_Node.prototype.print = function(stream, force_parens) { this._print(stream, force_parens); if (this instanceof AST_Symbol && !this.unmangleable(options)) { nth_identifier.consider(this.name, -1); } else if (options.properties) { if (this instanceof AST_DotHash) { nth_identifier.consider("#" + this.property, -1); } else if (this instanceof AST_Dot) { nth_identifier.consider(this.property, -1); } else if (this instanceof AST_Sub) { skip_string(this.property); } } }; nth_identifier.consider(this.print_to_string(), 1); } finally { AST_Node.prototype.print = AST_Node.prototype._print; } nth_identifier.sort(); function skip_string(node) { if (node instanceof AST_String) { nth_identifier.consider(node.value, -1); } else if (node instanceof AST_Conditional) { skip_string(node.consequent); skip_string(node.alternative); } else if (node instanceof AST_Sequence) { skip_string(node.tail_node()); } } }); const base54 = (() => { const leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); const digits = "0123456789".split(""); let chars; let frequency; function reset() { frequency = /* @__PURE__ */ new Map(); leading.forEach(function(ch) { frequency.set(ch, 0); }); digits.forEach(function(ch) { frequency.set(ch, 0); }); } function consider(str, delta) { for (var i = str.length; --i >= 0; ) { frequency.set(str[i], frequency.get(str[i]) + delta); } } function compare(a, b) { return frequency.get(b) - frequency.get(a); } function sort() { chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); } reset(); sort(); function base542(num) { var ret = "", base = 54; num++; do { num--; ret += chars[num % base]; num = Math.floor(num / base); base = 64; } while (num > 0); return ret; } return { get: base542, consider, reset, sort }; })(); let mangle_options = void 0; AST_Node.prototype.size = function(compressor, stack) { mangle_options = compressor && compressor._mangle_options; let size = 0; walk_parent(this, (node, info) => { size += node._size(info); if (node instanceof AST_Arrow && node.is_braceless()) { size += node.body[0].value._size(info); return true; } }, stack || compressor && compressor.stack); mangle_options = void 0; return size; }; AST_Node.prototype._size = () => 0; AST_Debugger.prototype._size = () => 8; AST_Directive.prototype._size = function() { return 2 + this.value.length; }; const list_overhead = (array) => array.length && array.length - 1; AST_Block.prototype._size = function() { return 2 + list_overhead(this.body); }; AST_Toplevel.prototype._size = function() { return list_overhead(this.body); }; AST_EmptyStatement.prototype._size = () => 1; AST_LabeledStatement.prototype._size = () => 2; AST_Do.prototype._size = () => 9; AST_While.prototype._size = () => 7; AST_For.prototype._size = () => 8; AST_ForIn.prototype._size = () => 8; AST_With.prototype._size = () => 6; AST_Expansion.prototype._size = () => 3; const lambda_modifiers = (func) => (func.is_generator ? 1 : 0) + (func.async ? 6 : 0); AST_Accessor.prototype._size = function() { return lambda_modifiers(this) + 4 + list_overhead(this.argnames) + list_overhead(this.body); }; AST_Function.prototype._size = function(info) { const first = !!first_in_statement(info); return first * 2 + lambda_modifiers(this) + 12 + list_overhead(this.argnames) + list_overhead(this.body); }; AST_Defun.prototype._size = function() { return lambda_modifiers(this) + 13 + list_overhead(this.argnames) + list_overhead(this.body); }; AST_Arrow.prototype._size = function() { let args_and_arrow = 2 + list_overhead(this.argnames); if (!(this.argnames.length === 1 && this.argnames[0] instanceof AST_Symbol)) { args_and_arrow += 2; } const body_overhead = this.is_braceless() ? 0 : list_overhead(this.body) + 2; return lambda_modifiers(this) + args_and_arrow + body_overhead; }; AST_Destructuring.prototype._size = () => 2; AST_TemplateString.prototype._size = function() { return 2 + Math.floor(this.segments.length / 2) * 3; }; AST_TemplateSegment.prototype._size = function() { return this.value.length; }; AST_Return.prototype._size = function() { return this.value ? 7 : 6; }; AST_Throw.prototype._size = () => 6; AST_Break.prototype._size = function() { return this.label ? 6 : 5; }; AST_Continue.prototype._size = function() { return this.label ? 9 : 8; }; AST_If.prototype._size = () => 4; AST_Switch.prototype._size = function() { return 8 + list_overhead(this.body); }; AST_Case.prototype._size = function() { return 5 + list_overhead(this.body); }; AST_Default.prototype._size = function() { return 8 + list_overhead(this.body); }; AST_Try.prototype._size = () => 3; AST_Catch.prototype._size = function() { let size = 7 + list_overhead(this.body); if (this.argname) { size += 2; } return size; }; AST_Finally.prototype._size = function() { return 7 + list_overhead(this.body); }; AST_Var.prototype._size = function() { return 4 + list_overhead(this.definitions); }; AST_Let.prototype._size = function() { return 4 + list_overhead(this.definitions); }; AST_Const.prototype._size = function() { return 6 + list_overhead(this.definitions); }; AST_VarDef.prototype._size = function() { return this.value ? 1 : 0; }; AST_NameMapping.prototype._size = function() { return this.name ? 4 : 0; }; AST_Import.prototype._size = function() { let size = 6; if (this.imported_name) size += 1; if (this.imported_name || this.imported_names) size += 5; if (this.imported_names) { size += 2 + list_overhead(this.imported_names); } return size; }; AST_ImportMeta.prototype._size = () => 11; AST_Export.prototype._size = function() { let size = 7 + (this.is_default ? 8 : 0); if (this.exported_value) { size += this.exported_value._size(); } if (this.exported_names) { size += 2 + list_overhead(this.exported_names); } if (this.module_name) { size += 5; } return size; }; AST_Call.prototype._size = function() { if (this.optional) { return 4 + list_overhead(this.args); } return 2 + list_overhead(this.args); }; AST_New.prototype._size = function() { return 6 + list_overhead(this.args); }; AST_Sequence.prototype._size = function() { return list_overhead(this.expressions); }; AST_Dot.prototype._size = function() { if (this.optional) { return this.property.length + 2; } return this.property.length + 1; }; AST_DotHash.prototype._size = function() { if (this.optional) { return this.property.length + 3; } return this.property.length + 2; }; AST_Sub.prototype._size = function() { return this.optional ? 4 : 2; }; AST_Unary.prototype._size = function() { if (this.operator === "typeof") return 7; if (this.operator === "void") return 5; return this.operator.length; }; AST_Binary.prototype._size = function(info) { if (this.operator === "in") return 4; let size = this.operator.length; if ((this.operator === "+" || this.operator === "-") && this.right instanceof AST_Unary && this.right.operator === this.operator) { size += 1; } if (this.needs_parens(info)) { size += 2; } return size; }; AST_Conditional.prototype._size = () => 3; AST_Array.prototype._size = function() { return 2 + list_overhead(this.elements); }; AST_Object.prototype._size = function(info) { let base = 2; if (first_in_statement(info)) { base += 2; } return base + list_overhead(this.properties); }; const key_size = (key) => typeof key === "string" ? key.length : 0; AST_ObjectKeyVal.prototype._size = function() { return key_size(this.key) + 1; }; const static_size = (is_static) => is_static ? 7 : 0; AST_ObjectGetter.prototype._size = function() { return 5 + static_size(this.static) + key_size(this.key); }; AST_ObjectSetter.prototype._size = function() { return 5 + static_size(this.static) + key_size(this.key); }; AST_ConciseMethod.prototype._size = function() { return static_size(this.static) + key_size(this.key) + lambda_modifiers(this); }; AST_PrivateMethod.prototype._size = function() { return AST_ConciseMethod.prototype._size.call(this) + 1; }; AST_PrivateGetter.prototype._size = AST_PrivateSetter.prototype._size = function() { return AST_ConciseMethod.prototype._size.call(this) + 4; }; AST_PrivateIn.prototype._size = function() { return 5; }; AST_Class.prototype._size = function() { return (this.name ? 8 : 7) + (this.extends ? 8 : 0); }; AST_ClassStaticBlock.prototype._size = function() { return 7 + list_overhead(this.body); }; AST_ClassProperty.prototype._size = function() { return static_size(this.static) + (typeof this.key === "string" ? this.key.length + 2 : 0) + (this.value ? 1 : 0); }; AST_ClassPrivateProperty.prototype._size = function() { return AST_ClassProperty.prototype._size.call(this) + 1; }; AST_Symbol.prototype._size = function() { if (!(mangle_options && this.thedef && !this.thedef.unmangleable(mangle_options))) { return this.name.length; } else { return 1; } }; AST_SymbolClassProperty.prototype._size = function() { return this.name.length; }; AST_SymbolRef.prototype._size = AST_SymbolDeclaration.prototype._size = function() { if (this.name === "arguments") return 9; return AST_Symbol.prototype._size.call(this); }; AST_NewTarget.prototype._size = () => 10; AST_SymbolImportForeign.prototype._size = function() { return this.name.length; }; AST_SymbolExportForeign.prototype._size = function() { return this.name.length; }; AST_This.prototype._size = () => 4; AST_Super.prototype._size = () => 5; AST_String.prototype._size = function() { return this.value.length + 2; }; AST_Number.prototype._size = function() { const { value } = this; if (value === 0) return 1; if (value > 0 && Math.floor(value) === value) { return Math.floor(Math.log10(value) + 1); } return value.toString().length; }; AST_BigInt.prototype._size = function() { return this.value.length; }; AST_RegExp.prototype._size = function() { return this.value.toString().length; }; AST_Null.prototype._size = () => 4; AST_NaN.prototype._size = () => 3; AST_Undefined.prototype._size = () => 6; AST_Hole.prototype._size = () => 0; AST_Infinity.prototype._size = () => 8; AST_True.prototype._size = () => 4; AST_False.prototype._size = () => 5; AST_Await.prototype._size = () => 6; AST_Yield.prototype._size = () => 6; const UNUSED = 1; const TRUTHY = 2; const FALSY = 4; const UNDEFINED = 8; const INLINED = 16; const WRITE_ONLY = 32; const SQUEEZED = 256; const OPTIMIZED = 512; const TOP = 1024; const CLEAR_BETWEEN_PASSES = SQUEEZED | OPTIMIZED | TOP; const has_flag = (node, flag) => node.flags & flag; const set_flag = (node, flag) => { node.flags |= flag; }; const clear_flag = (node, flag) => { node.flags &= ~flag; }; function merge_sequence(array, node) { if (node instanceof AST_Sequence) { array.push(...node.expressions); } else { array.push(node); } return array; } function make_sequence(orig, expressions) { if (expressions.length == 1) return expressions[0]; if (expressions.length == 0) throw new Error("trying to create a sequence with length zero!"); return make_node(AST_Sequence, orig, { expressions: expressions.reduce(merge_sequence, []) }); } function make_node_from_constant(val, orig) { switch (typeof val) { case "string": return make_node(AST_String, orig, { value: val }); case "number": if (isNaN(val)) return make_node(AST_NaN, orig); if (isFinite(val)) { return 1 / val < 0 ? make_node(AST_UnaryPrefix, orig, { operator: "-", expression: make_node(AST_Number, orig, { value: -val }) }) : make_node(AST_Number, orig, { value: val }); } return val < 0 ? make_node(AST_UnaryPrefix, orig, { operator: "-", expression: make_node(AST_Infinity, orig) }) : make_node(AST_Infinity, orig); case "boolean": return make_node(val ? AST_True : AST_False, orig); case "undefined": return make_node(AST_Undefined, orig); default: if (val === null) { return make_node(AST_Null, orig, { value: null }); } if (val instanceof RegExp) { return make_node(AST_RegExp, orig, { value: { source: regexp_source_fix(val.source), flags: val.flags } }); } throw new Error(string_template("Can't handle constant of type: {type}", { type: typeof val })); } } function best_of_expression(ast1, ast2) { return ast1.size() > ast2.size() ? ast2 : ast1; } function best_of_statement(ast1, ast2) { return best_of_expression(make_node(AST_SimpleStatement, ast1, { body: ast1 }), make_node(AST_SimpleStatement, ast2, { body: ast2 })).body; } function best_of(compressor, ast1, ast2) { if (first_in_statement(compressor)) { return best_of_statement(ast1, ast2); } else { return best_of_expression(ast1, ast2); } } function get_simple_key(key) { if (key instanceof AST_Constant) { return key.getValue(); } if (key instanceof AST_UnaryPrefix && key.operator == "void" && key.expression instanceof AST_Constant) { return; } return key; } function read_property(obj, key) { key = get_simple_key(key); if (key instanceof AST_Node) return; var value; if (obj instanceof AST_Array) { var elements = obj.elements; if (key == "length") return make_node_from_constant(elements.length, obj); if (typeof key == "number" && key in elements) value = elements[key]; } else if (obj instanceof AST_Object) { key = "" + key; var props = obj.properties; for (var i = props.length; --i >= 0; ) { var prop = props[i]; if (!(prop instanceof AST_ObjectKeyVal)) return; if (!value && props[i].key === key) value = props[i].value; } } return value instanceof AST_SymbolRef && value.fixed_value() || value; } function has_break_or_continue(loop, parent) { var found = false; var tw = new TreeWalker(function(node) { if (found || node instanceof AST_Scope) return true; if (node instanceof AST_LoopControl && tw.loopcontrol_target(node) === loop) { return found = true; } }); if (parent instanceof AST_LabeledStatement) tw.push(parent); tw.push(loop); loop.body.walk(tw); return found; } function maintain_this_binding(parent, orig, val) { if (parent instanceof AST_UnaryPrefix && parent.operator == "delete" || parent instanceof AST_Call && parent.expression === orig && (val instanceof AST_Chain || val instanceof AST_PropAccess || val instanceof AST_SymbolRef && val.name == "eval")) { const zero = make_node(AST_Number, orig, { value: 0 }); return make_sequence(orig, [zero, val]); } else { return val; } } function is_func_expr(node) { return node instanceof AST_Arrow || node instanceof AST_Function; } function is_iife_call(node) { if (node.TYPE != "Call") return false; return node.expression instanceof AST_Function || is_iife_call(node.expression); } function is_empty(thing) { if (thing === null) return true; if (thing instanceof AST_EmptyStatement) return true; if (thing instanceof AST_BlockStatement) return thing.body.length == 0; return false; } const identifier_atom = makePredicate("Infinity NaN undefined"); function is_identifier_atom(node) { return node instanceof AST_Infinity || node instanceof AST_NaN || node instanceof AST_Undefined; } function is_ref_of(ref, type) { if (!(ref instanceof AST_SymbolRef)) return false; var orig = ref.definition().orig; for (var i = orig.length; --i >= 0; ) { if (orig[i] instanceof type) return true; } } function can_be_evicted_from_block(node) { return !(node instanceof AST_DefClass || node instanceof AST_Defun || node instanceof AST_Let || node instanceof AST_Const || node instanceof AST_Export || node instanceof AST_Import); } function as_statement_array(thing) { if (thing === null) return []; if (thing instanceof AST_BlockStatement) return thing.body; if (thing instanceof AST_EmptyStatement) return []; if (thing instanceof AST_Statement) return [thing]; throw new Error("Can't convert thing to statement array"); } function is_reachable(scope_node, defs) { const find_ref = (node) => { if (node instanceof AST_SymbolRef && defs.includes(node.definition())) { return walk_abort; } }; return walk_parent(scope_node, (node, info) => { if (node instanceof AST_Scope && node !== scope_node) { var parent = info.parent(); if (parent instanceof AST_Call && parent.expression === node && !(node.async || node.is_generator)) { return; } if (walk(node, find_ref)) return walk_abort; return true; } }); } function is_recursive_ref(compressor, def) { var node; for (var i = 0; node = compressor.parent(i); i++) { if (node instanceof AST_Lambda || node instanceof AST_Class) { var name = node.name; if (name && name.definition() === def) { return true; } } } return false; } function retain_top_func(fn, compressor) { return compressor.top_retain && fn instanceof AST_Defun && has_flag(fn, TOP) && fn.name && compressor.top_retain(fn.name.definition()); } function make_nested_lookup(obj) { const out = /* @__PURE__ */ new Map(); for (var key of Object.keys(obj)) { out.set(key, makePredicate(obj[key])); } const does_have = (global_name, fname) => { const inner_map = out.get(global_name); return inner_map != null && inner_map.has(fname); }; return does_have; } const pure_prop_access_globals = /* @__PURE__ */ new Set([ "Number", "String", "Array", "Object", "Function", "Promise" ]); const object_methods = [ "constructor", "toString", "valueOf" ]; const is_pure_native_method = make_nested_lookup({ Array: [ "at", "flat", "includes", "indexOf", "join", "lastIndexOf", "slice", ...object_methods ], Boolean: object_methods, Function: object_methods, Number: [ "toExponential", "toFixed", "toPrecision", ...object_methods ], Object: object_methods, RegExp: [ "test", ...object_methods ], String: [ "at", "charAt", "charCodeAt", "charPointAt", "concat", "endsWith", "fromCharCode", "fromCodePoint", "includes", "indexOf", "italics", "lastIndexOf", "localeCompare", "match", "matchAll", "normalize", "padStart", "padEnd", "repeat", "replace", "replaceAll", "search", "slice", "split", "startsWith", "substr", "substring", "repeat", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toUpperCase", "trim", "trimEnd", "trimStart", ...object_methods ] }); const is_pure_native_fn = make_nested_lookup({ Array: [ "isArray" ], Math: [ "abs", "acos", "asin", "atan", "ceil", "cos", "exp", "floor", "log", "round", "sin", "sqrt", "tan", "atan2", "pow", "max", "min" ], Number: [ "isFinite", "isNaN" ], Object: [ "create", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getPrototypeOf", "isExtensible", "isFrozen", "isSealed", "hasOwn", "keys" ], String: [ "fromCharCode" ] }); const is_pure_native_value = make_nested_lookup({ Math: [ "E", "LN10", "LN2", "LOG2E", "LOG10E", "PI", "SQRT1_2", "SQRT2" ], Number: [ "MAX_VALUE", "MIN_VALUE", "NaN", "NEGATIVE_INFINITY", "POSITIVE_INFINITY" ] }); const is_undeclared_ref = (node) => node instanceof AST_SymbolRef && node.definition().undeclared; const lazy_op = makePredicate("&& || ??"); const unary_side_effects = makePredicate("delete ++ --"); (function(def_is_boolean) { const unary_bool = makePredicate("! delete"); const binary_bool = makePredicate("in instanceof == != === !== < <= >= >"); def_is_boolean(AST_Node, return_false); def_is_boolean(AST_UnaryPrefix, function() { return unary_bool.has(this.operator); }); def_is_boolean(AST_Binary, function() { return binary_bool.has(this.operator) || lazy_op.has(this.operator) && this.left.is_boolean() && this.right.is_boolean(); }); def_is_boolean(AST_Conditional, function() { return this.consequent.is_boolean() && this.alternative.is_boolean(); }); def_is_boolean(AST_Assign, function() { return this.operator == "=" && this.right.is_boolean(); }); def_is_boolean(AST_Sequence, function() { return this.tail_node().is_boolean(); }); def_is_boolean(AST_True, return_true); def_is_boolean(AST_False, return_true); })(function(node, func) { node.DEFMETHOD("is_boolean", func); }); (function(def_is_number) { def_is_number(AST_Node, return_false); def_is_number(AST_Number, return_true); const unary = makePredicate("+ - ~ ++ --"); def_is_number(AST_Unary, function() { return unary.has(this.operator) && !(this.expression instanceof AST_BigInt); }); const numeric_ops = makePredicate("- * / % & | ^ << >> >>>"); def_is_number(AST_Binary, function(compressor) { return numeric_ops.has(this.operator) || this.operator == "+" && this.left.is_number(compressor) && this.right.is_number(compressor); }); def_is_number(AST_Assign, function(compressor) { return numeric_ops.has(this.operator.slice(0, -1)) || this.operator == "=" && this.right.is_number(compressor); }); def_is_number(AST_Sequence, function(compressor) { return this.tail_node().is_number(compressor); }); def_is_number(AST_Conditional, function(compressor) { return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); }); })(function(node, func) { node.DEFMETHOD("is_number", func); }); (function(def_is_string) { def_is_string(AST_Node, return_false); def_is_string(AST_String, return_true); def_is_string(AST_TemplateString, return_true); def_is_string(AST_UnaryPrefix, function() { return this.operator == "typeof"; }); def_is_string(AST_Binary, function(compressor) { return this.operator == "+" && (this.left.is_string(compressor) || this.right.is_string(compressor)); }); def_is_string(AST_Assign, function(compressor) { return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); }); def_is_string(AST_Sequence, function(compressor) { return this.tail_node().is_string(compressor); }); def_is_string(AST_Conditional, function(compressor) { return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); }); })(function(node, func) { node.DEFMETHOD("is_string", func); }); function is_undefined(node, compressor) { return has_flag(node, UNDEFINED) || node instanceof AST_Undefined || node instanceof AST_UnaryPrefix && node.operator == "void" && !node.expression.has_side_effects(compressor); } function is_null_or_undefined(node, compressor) { let fixed; return node instanceof AST_Null || is_undefined(node, compressor) || node instanceof AST_SymbolRef && (fixed = node.definition().fixed) instanceof AST_Node && is_nullish(fixed, compressor); } function is_nullish_shortcircuited(node, compressor) { if (node instanceof AST_PropAccess || node instanceof AST_Call) { return node.optional && is_null_or_undefined(node.expression, compressor) || is_nullish_shortcircuited(node.expression, compressor); } if (node instanceof AST_Chain) return is_nullish_shortcircuited(node.expression, compressor); return false; } function is_nullish(node, compressor) { if (is_null_or_undefined(node, compressor)) return true; return is_nullish_shortcircuited(node, compressor); } (function(def_has_side_effects) { def_has_side_effects(AST_Node, return_true); def_has_side_effects(AST_EmptyStatement, return_false); def_has_side_effects(AST_Constant, return_false); def_has_side_effects(AST_This, return_false); function any(list, compressor) { for (var i = list.length; --i >= 0; ) if (list[i].has_side_effects(compressor)) return true; return false; } def_has_side_effects(AST_Block, function(compressor) { return any(this.body, compressor); }); def_has_side_effects(AST_Call, function(compressor) { if (!this.is_callee_pure(compressor) && (!this.expression.is_call_pure(compressor) || this.expression.has_side_effects(compressor))) { return true; } return any(this.args, compressor); }); def_has_side_effects(AST_Switch, function(compressor) { return this.expression.has_side_effects(compressor) || any(this.body, compressor); }); def_has_side_effects(AST_Case, function(compressor) { return this.expression.has_side_effects(compressor) || any(this.body, compressor); }); def_has_side_effects(AST_Try, function(compressor) { return this.body.has_side_effects(compressor) || this.bcatch && this.bcatch.has_side_effects(compressor) || this.bfinally && this.bfinally.has_side_effects(compressor); }); def_has_side_effects(AST_If, function(compressor) { return this.condition.has_side_effects(compressor) || this.body && this.body.has_side_effects(compressor) || this.alternative && this.alternative.has_side_effects(compressor); }); def_has_side_effects(AST_ImportMeta, return_false); def_has_side_effects(AST_LabeledStatement, function(compressor) { return this.body.has_side_effects(compressor); }); def_has_side_effects(AST_SimpleStatement, function(compressor) { return this.body.has_side_effects(compressor); }); def_has_side_effects(AST_Lambda, return_false); def_has_side_effects(AST_Class, function(compressor) { if (this.extends && this.extends.has_side_effects(compressor)) { return true; } return any(this.properties, compressor); }); def_has_side_effects(AST_ClassStaticBlock, function(compressor) { return any(this.body, compressor); }); def_has_side_effects(AST_Binary, function(compressor) { return this.left.has_side_effects(compressor) || this.right.has_side_effects(compressor); }); def_has_side_effects(AST_Assign, return_true); def_has_side_effects(AST_Conditional, function(compressor) { return this.condition.has_side_effects(compressor) || this.consequent.has_side_effects(compressor) || this.alternative.has_side_effects(compressor); }); def_has_side_effects(AST_Unary, function(compressor) { return unary_side_effects.has(this.operator) || this.expression.has_side_effects(compressor); }); def_has_side_effects(AST_SymbolRef, function(compressor) { return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); }); def_has_side_effects(AST_SymbolClassProperty, return_false); def_has_side_effects(AST_SymbolDeclaration, return_false); def_has_side_effects(AST_Object, function(compressor) { return any(this.properties, compressor); }); def_has_side_effects(AST_ObjectProperty, function(compressor) { return this.computed_key() && this.key.has_side_effects(compressor) || this.value && this.value.has_side_effects(compressor); }); def_has_side_effects(AST_ClassProperty, function(compressor) { return this.computed_key() && this.key.has_side_effects(compressor) || this.static && this.value && this.value.has_side_effects(compressor); }); def_has_side_effects(AST_ConciseMethod, function(compressor) { return this.computed_key() && this.key.has_side_effects(compressor); }); def_has_side_effects(AST_ObjectGetter, function(compressor) { return this.computed_key() && this.key.has_side_effects(compressor); }); def_has_side_effects(AST_ObjectSetter, function(compressor) { return this.computed_key() && this.key.has_side_effects(compressor); }); def_has_side_effects(AST_Array, function(compressor) { return any(this.elements, compressor); }); def_has_side_effects(AST_Dot, function(compressor) { if (is_nullish(this, compressor)) { return this.expression.has_side_effects(compressor); } if (!this.optional && this.expression.may_throw_on_access(compressor)) { return true; } return this.expression.has_side_effects(compressor); }); def_has_side_effects(AST_Sub, function(compressor) { if (is_nullish(this, compressor)) { return this.expression.has_side_effects(compressor); } if (!this.optional && this.expression.may_throw_on_access(compressor)) { return true; } var property = this.property.has_side_effects(compressor); if (property && this.optional) return true; return property || this.expression.has_side_effects(compressor); }); def_has_side_effects(AST_Chain, function(compressor) { return this.expression.has_side_effects(compressor); }); def_has_side_effects(AST_Sequence, function(compressor) { return any(this.expressions, compressor); }); def_has_side_effects(AST_Definitions, function(compressor) { return any(this.definitions, compressor); }); def_has_side_effects(AST_VarDef, function() { return this.value; }); def_has_side_effects(AST_TemplateSegment, return_false); def_has_side_effects(AST_TemplateString, function(compressor) { return any(this.segments, compressor); }); })(function(node, func) { node.DEFMETHOD("has_side_effects", func); }); (function(def_may_throw) { def_may_throw(AST_Node, return_true); def_may_throw(AST_Constant, return_false); def_may_throw(AST_EmptyStatement, return_false); def_may_throw(AST_Lambda, return_false); def_may_throw(AST_SymbolDeclaration, return_false); def_may_throw(AST_This, return_false); def_may_throw(AST_ImportMeta, return_false); function any(list, compressor) { for (var i = list.length; --i >= 0; ) if (list[i].may_throw(compressor)) return true; return false; } def_may_throw(AST_Class, function(compressor) { if (this.extends && this.extends.may_throw(compressor)) return true; return any(this.properties, compressor); }); def_may_throw(AST_ClassStaticBlock, function(compressor) { return any(this.body, compressor); }); def_may_throw(AST_Array, function(compressor) { return any(this.elements, compressor); }); def_may_throw(AST_Assign, function(compressor) { if (this.right.may_throw(compressor)) return true; if (!compressor.has_directive("use strict") && this.operator == "=" && this.left instanceof AST_SymbolRef) { return false; } return this.left.may_throw(compressor); }); def_may_throw(AST_Binary, function(compressor) { return this.left.may_throw(compressor) || this.right.may_throw(compressor); }); def_may_throw(AST_Block, function(compressor) { return any(this.body, compressor); }); def_may_throw(AST_Call, function(compressor) { if (is_nullish(this, compressor)) return false; if (any(this.args, compressor)) return true; if (this.is_callee_pure(compressor)) return false; if (this.expression.may_throw(compressor)) return true; return !(this.expression instanceof AST_Lambda) || any(this.expression.body, compressor); }); def_may_throw(AST_Case, function(compressor) { return this.expression.may_throw(compressor) || any(this.body, compressor); }); def_may_throw(AST_Conditional, function(compressor) { return this.condition.may_throw(compressor) || this.consequent.may_throw(compressor) || this.alternative.may_throw(compressor); }); def_may_throw(AST_Definitions, function(compressor) { return any(this.definitions, compressor); }); def_may_throw(AST_If, function(compressor) { return this.condition.may_throw(compressor) || this.body && this.body.may_throw(compressor) || this.alternative && this.alternative.may_throw(compressor); }); def_may_throw(AST_LabeledStatement, function(compressor) { return this.body.may_throw(compressor); }); def_may_throw(AST_Object, function(compressor) { return any(this.properties, compressor); }); def_may_throw(AST_ObjectProperty, function(compressor) { return this.value ? this.value.may_throw(compressor) : false; }); def_may_throw(AST_ClassProperty, function(compressor) { return this.computed_key() && this.key.may_throw(compressor) || this.static && this.value && this.value.may_throw(compressor); }); def_may_throw(AST_ConciseMethod, function(compressor) { return this.computed_key() && this.key.may_throw(compressor); }); def_may_throw(AST_ObjectGetter, function(compressor) { return this.computed_key() && this.key.may_throw(compressor); }); def_may_throw(AST_ObjectSetter, function(compressor) { return this.computed_key() && this.key.may_throw(compressor); }); def_may_throw(AST_Return, function(compressor) { return this.value && this.value.may_throw(compressor); }); def_may_throw(AST_Sequence, function(compressor) { return any(this.expressions, compressor); }); def_may_throw(AST_SimpleStatement, function(compressor) { return this.body.may_throw(compressor); }); def_may_throw(AST_Dot, function(compressor) { if (is_nullish(this, compressor)) return false; return !this.optional && this.expression.may_throw_on_access(compressor) || this.expression.may_throw(compressor); }); def_may_throw(AST_Sub, function(compressor) { if (is_nullish(this, compressor)) return false; return !this.optional && this.expression.may_throw_on_access(compressor) || this.expression.may_throw(compressor) || this.property.may_throw(compressor); }); def_may_throw(AST_Chain, function(compressor) { return this.expression.may_throw(compressor); }); def_may_throw(AST_Switch, function(compressor) { return this.expression.may_throw(compressor) || any(this.body, compressor); }); def_may_throw(AST_SymbolRef, function(compressor) { return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); }); def_may_throw(AST_SymbolClassProperty, return_false); def_may_throw(AST_Try, function(compressor) { return this.bcatch ? this.bcatch.may_throw(compressor) : this.body.may_throw(compressor) || this.bfinally && this.bfinally.may_throw(compressor); }); def_may_throw(AST_Unary, function(compressor) { if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) return false; return this.expression.may_throw(compressor); }); def_may_throw(AST_VarDef, function(compressor) { if (!this.value) return false; return this.value.may_throw(compressor); }); })(function(node, func) { node.DEFMETHOD("may_throw", func); }); (function(def_is_constant_expression) { function all_refs_local(scope) { let result = true; walk(this, (node) => { if (node instanceof AST_SymbolRef) { if (has_flag(this, INLINED)) { result = false; return walk_abort; } var def = node.definition(); if (member(def, this.enclosed) && !this.variables.has(def.name)) { if (scope) { var scope_def = scope.find_variable(node); if (def.undeclared ? !scope_def : scope_def === def) { result = "f"; return true; } } result = false; return walk_abort; } return true; } if (node instanceof AST_This && this instanceof AST_Arrow) { result = false; return walk_abort; } }); return result; } def_is_constant_expression(AST_Node, return_false); def_is_constant_expression(AST_Constant, return_true); def_is_constant_expression(AST_Class, function(scope) { if (this.extends && !this.extends.is_constant_expression(scope)) { return false; } for (const prop of this.properties) { if (prop.computed_key() && !prop.key.is_constant_expression(scope)) { return false; } if (prop.static && prop.value && !prop.value.is_constant_expression(scope)) { return false; } if (prop instanceof AST_ClassStaticBlock) { return false; } } return all_refs_local.call(this, scope); }); def_is_constant_expression(AST_Lambda, all_refs_local); def_is_constant_expression(AST_Unary, function() { return this.expression.is_constant_expression(); }); def_is_constant_expression(AST_Binary, function() { return this.left.is_constant_expression() && this.right.is_constant_expression(); }); def_is_constant_expression(AST_Array, function() { return this.elements.every((l) => l.is_constant_expression()); }); def_is_constant_expression(AST_Object, function() { return this.properties.every((l) => l.is_constant_expression()); }); def_is_constant_expression(AST_ObjectProperty, function() { return !!(!(this.key instanceof AST_Node) && this.value && this.value.is_constant_expression()); }); })(function(node, func) { node.DEFMETHOD("is_constant_expression", func); }); (function(def_may_throw_on_access) { AST_Node.DEFMETHOD("may_throw_on_access", function(compressor) { return !compressor.option("pure_getters") || this._dot_throw(compressor); }); function is_strict(compressor) { return /strict/.test(compressor.option("pure_getters")); } def_may_throw_on_access(AST_Node, is_strict); def_may_throw_on_access(AST_Null, return_true); def_may_throw_on_access(AST_Undefined, return_true); def_may_throw_on_access(AST_Constant, return_false); def_may_throw_on_access(AST_Array, return_false); def_may_throw_on_access(AST_Object, function(compressor) { if (!is_strict(compressor)) return false; for (var i = this.properties.length; --i >= 0; ) if (this.properties[i]._dot_throw(compressor)) return true; return false; }); def_may_throw_on_access(AST_Class, return_false); def_may_throw_on_access(AST_ObjectProperty, return_false); def_may_throw_on_access(AST_ObjectGetter, return_true); def_may_throw_on_access(AST_Expansion, function(compressor) { return this.expression._dot_throw(compressor); }); def_may_throw_on_access(AST_Function, return_false); def_may_throw_on_access(AST_Arrow, return_false); def_may_throw_on_access(AST_UnaryPostfix, return_false); def_may_throw_on_access(AST_UnaryPrefix, function() { return this.operator == "void"; }); def_may_throw_on_access(AST_Binary, function(compressor) { return (this.operator == "&&" || this.operator == "||" || this.operator == "??") && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); }); def_may_throw_on_access(AST_Assign, function(compressor) { if (this.logical) return true; return this.operator == "=" && this.right._dot_throw(compressor); }); def_may_throw_on_access(AST_Conditional, function(compressor) { return this.consequent._dot_throw(compressor) || this.alternative._dot_throw(compressor); }); def_may_throw_on_access(AST_Dot, function(compressor) { if (!is_strict(compressor)) return false; if (this.property == "prototype") { return !(this.expression instanceof AST_Function || this.expression instanceof AST_Class); } return true; }); def_may_throw_on_access(AST_Chain, function(compressor) { return this.expression._dot_throw(compressor); }); def_may_throw_on_access(AST_Sequence, function(compressor) { return this.tail_node()._dot_throw(compressor); }); def_may_throw_on_access(AST_SymbolRef, function(compressor) { if (this.name === "arguments" && this.scope instanceof AST_Lambda) return false; if (has_flag(this, UNDEFINED)) return true; if (!is_strict(compressor)) return false; if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; if (this.is_immutable()) return false; var fixed = this.fixed_value(); return !fixed || fixed._dot_throw(compressor); }); })(function(node, func) { node.DEFMETHOD("_dot_throw", func); }); function is_lhs(node, parent) { if (parent instanceof AST_Unary && unary_side_effects.has(parent.operator)) return parent.expression; if (parent instanceof AST_Assign && parent.left === node) return node; if (parent instanceof AST_ForIn && parent.init === node) return node; } (function(def_negate) { function basic_negation(exp) { return make_node(AST_UnaryPrefix, exp, { operator: "!", expression: exp }); } function best(orig, alt, first_in_statement2) { var negated = basic_negation(orig); if (first_in_statement2) { var stat = make_node(AST_SimpleStatement, alt, { body: alt }); return best_of_expression(negated, stat) === stat ? alt : negated; } return best_of_expression(negated, alt); } def_negate(AST_Node, function() { return basic_negation(this); }); def_negate(AST_Statement, function() { throw new Error("Cannot negate a statement"); }); def_negate(AST_Function, function() { return basic_negation(this); }); def_negate(AST_Class, function() { return basic_negation(this); }); def_negate(AST_Arrow, function() { return basic_negation(this); }); def_negate(AST_UnaryPrefix, function() { if (this.operator == "!") return this.expression; return basic_negation(this); }); def_negate(AST_Sequence, function(compressor) { var expressions = this.expressions.slice(); expressions.push(expressions.pop().negate(compressor)); return make_sequence(this, expressions); }); def_negate(AST_Conditional, function(compressor, first_in_statement2) { var self2 = this.clone(); self2.consequent = self2.consequent.negate(compressor); self2.alternative = self2.alternative.negate(compressor); return best(this, self2, first_in_statement2); }); def_negate(AST_Binary, function(compressor, first_in_statement2) { var self2 = this.clone(), op = this.operator; if (compressor.option("unsafe_comps")) { switch (op) { case "<=": self2.operator = ">"; return self2; case "<": self2.operator = ">="; return self2; case ">=": self2.operator = "<"; return self2; case ">": self2.operator = "<="; return self2; } } switch (op) { case "==": self2.operator = "!="; return self2; case "!=": self2.operator = "=="; return self2; case "===": self2.operator = "!=="; return self2; case "!==": self2.operator = "==="; return self2; case "&&": self2.operator = "||"; self2.left = self2.left.negate(compressor, first_in_statement2); self2.right = self2.right.negate(compressor); return best(this, self2, first_in_statement2); case "||": self2.operator = "&&"; self2.left = self2.left.negate(compressor, first_in_statement2); self2.right = self2.right.negate(compressor); return best(this, self2, first_in_statement2); } return basic_negation(this); }); })(function(node, func) { node.DEFMETHOD("negate", function(compressor, first_in_statement2) { return func.call(this, compressor, first_in_statement2); }); }); var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); AST_Call.DEFMETHOD("is_callee_pure", function(compressor) { if (compressor.option("unsafe")) { var expr = this.expression; var first_arg = this.args && this.args[0] && this.args[0].evaluate(compressor); if (expr.expression && expr.expression.name === "hasOwnProperty" && (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) { return false; } if (is_undeclared_ref(expr) && global_pure_fns.has(expr.name)) return true; if (expr instanceof AST_Dot && is_undeclared_ref(expr.expression) && is_pure_native_fn(expr.expression.name, expr.property)) { return true; } } if (this instanceof AST_New && compressor.option("pure_new")) { return true; } if (compressor.option("side_effects") && has_annotation(this, _PURE)) { return true; } return !compressor.pure_funcs(this); }); AST_Node.DEFMETHOD("is_call_pure", return_false); AST_Dot.DEFMETHOD("is_call_pure", function(compressor) { if (!compressor.option("unsafe")) return; const expr = this.expression; let native_obj; if (expr instanceof AST_Array) { native_obj = "Array"; } else if (expr.is_boolean()) { native_obj = "Boolean"; } else if (expr.is_number(compressor)) { native_obj = "Number"; } else if (expr instanceof AST_RegExp) { native_obj = "RegExp"; } else if (expr.is_string(compressor)) { native_obj = "String"; } else if (!this.may_throw_on_access(compressor)) { native_obj = "Object"; } return native_obj != null && is_pure_native_method(native_obj, this.property); }); const aborts = (thing) => thing && thing.aborts(); (function(def_aborts) { def_aborts(AST_Statement, return_null); def_aborts(AST_Jump, return_this); function block_aborts() { for (var i = 0; i < this.body.length; i++) { if (aborts(this.body[i])) { return this.body[i]; } } return null; } def_aborts(AST_Import, return_null); def_aborts(AST_BlockStatement, block_aborts); def_aborts(AST_SwitchBranch, block_aborts); def_aborts(AST_DefClass, function() { for (const prop of this.properties) { if (prop instanceof AST_ClassStaticBlock) { if (prop.aborts()) return prop; } } return null; }); def_aborts(AST_ClassStaticBlock, block_aborts); def_aborts(AST_If, function() { return this.alternative && aborts(this.body) && aborts(this.alternative) && this; }); })(function(node, func) { node.DEFMETHOD("aborts", func); }); AST_Node.DEFMETHOD("contains_this", function() { return walk(this, (node) => { if (node instanceof AST_This) return walk_abort; if (node !== this && node instanceof AST_Scope && !(node instanceof AST_Arrow)) { return true; } }); }); function is_modified(compressor, tw, node, value, level, immutable) { var parent = tw.parent(level); var lhs = is_lhs(node, parent); if (lhs) return lhs; if (!immutable && parent instanceof AST_Call && parent.expression === node && !(value instanceof AST_Arrow) && !(value instanceof AST_Class) && !parent.is_callee_pure(compressor) && (!(value instanceof AST_Function) || !(parent instanceof AST_New) && value.contains_this())) { return true; } if (parent instanceof AST_Array) { return is_modified(compressor, tw, parent, parent, level + 1); } if (parent instanceof AST_ObjectKeyVal && node === parent.value) { var obj = tw.parent(level + 1); return is_modified(compressor, tw, obj, obj, level + 2); } if (parent instanceof AST_PropAccess && parent.expression === node) { var prop = read_property(value, parent.property); return !immutable && is_modified(compressor, tw, parent, prop, level + 1); } } function def_eval(node, func) { node.DEFMETHOD("_eval", func); } const nullish = Symbol("This AST_Chain is nullish"); AST_Node.DEFMETHOD("evaluate", function(compressor) { if (!compressor.option("evaluate")) return this; var val = this._eval(compressor, 1); if (!val || val instanceof RegExp) return val; if (typeof val == "function" || typeof val == "object" || val == nullish) return this; if (typeof val === "string") { const unevaluated_size = this.size(compressor); if (val.length + 2 > unevaluated_size) return this; } return val; }); var unaryPrefix = makePredicate("! ~ - + void"); AST_Node.DEFMETHOD("is_constant", function() { if (this instanceof AST_Constant) { return !(this instanceof AST_RegExp); } else { return this instanceof AST_UnaryPrefix && this.expression instanceof AST_Constant && unaryPrefix.has(this.operator); } }); def_eval(AST_Statement, function() { throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); }); def_eval(AST_Lambda, return_this); def_eval(AST_Class, return_this); def_eval(AST_Node, return_this); def_eval(AST_Constant, function() { return this.getValue(); }); def_eval(AST_BigInt, return_this); def_eval(AST_RegExp, function(compressor) { let evaluated = compressor.evaluated_regexps.get(this.value); if (evaluated === void 0 && regexp_is_safe(this.value.source)) { try { const { source, flags } = this.value; evaluated = new RegExp(source, flags); } catch (e) { evaluated = null; } compressor.evaluated_regexps.set(this.value, evaluated); } return evaluated || this; }); def_eval(AST_TemplateString, function() { if (this.segments.length !== 1) return this; return this.segments[0].value; }); def_eval(AST_Function, function(compressor) { if (compressor.option("unsafe")) { var fn = function() { }; fn.node = this; fn.toString = () => this.print_to_string(); return fn; } return this; }); def_eval(AST_Array, function(compressor, depth) { if (compressor.option("unsafe")) { var elements = []; for (var i = 0, len = this.elements.length; i < len; i++) { var element = this.elements[i]; var value = element._eval(compressor, depth); if (element === value) return this; elements.push(value); } return elements; } return this; }); def_eval(AST_Object, function(compressor, depth) { if (compressor.option("unsafe")) { var val = {}; for (var i = 0, len = this.properties.length; i < len; i++) { var prop = this.properties[i]; if (prop instanceof AST_Expansion) return this; var key = prop.key; if (key instanceof AST_Symbol) { key = key.name; } else if (key instanceof AST_Node) { key = key._eval(compressor, depth); if (key === prop.key) return this; } if (typeof Object.prototype[key] === "function") { return this; } if (prop.value instanceof AST_Function) continue; val[key] = prop.value._eval(compressor, depth); if (val[key] === prop.value) return this; } return val; } return this; }); var non_converting_unary = makePredicate("! typeof void"); def_eval(AST_UnaryPrefix, function(compressor, depth) { var e = this.expression; if (compressor.option("typeofs") && this.operator == "typeof" && (e instanceof AST_Lambda || e instanceof AST_SymbolRef && e.fixed_value() instanceof AST_Lambda)) { return "function"; } if (!non_converting_unary.has(this.operator)) depth++; e = e._eval(compressor, depth); if (e === this.expression) return this; switch (this.operator) { case "!": return !e; case "typeof": if (e instanceof RegExp) return this; return typeof e; case "void": return void 0; case "~": return ~e; case "-": return -e; case "+": return +e; } return this; }); var non_converting_binary = makePredicate("&& || ?? === !=="); const identity_comparison = makePredicate("== != === !=="); const has_identity = (value) => typeof value === "object" || typeof value === "function" || typeof value === "symbol"; def_eval(AST_Binary, function(compressor, depth) { if (!non_converting_binary.has(this.operator)) depth++; var left = this.left._eval(compressor, depth); if (left === this.left) return this; var right = this.right._eval(compressor, depth); if (right === this.right) return this; var result; if (left != null && right != null && identity_comparison.has(this.operator) && has_identity(left) && has_identity(right) && typeof left === typeof right) { return this; } switch (this.operator) { case "&&": result = left && right; break; case "||": result = left || right; break; case "??": result = left != null ? left : right; break; case "|": result = left | right; break; case "&": result = left & right; break; case "^": result = left ^ right; break; case "+": result = left + right; break; case "*": result = left * right; break; case "**": result = Math.pow(left, right); break; case "/": result = left / right; break; case "%": result = left % right; break; case "-": result = left - right; break; case "<<": result = left << right; break; case ">>": result = left >> right; break; case ">>>": result = left >>> right; break; case "==": result = left == right; break; case "===": result = left === right; break; case "!=": result = left != right; break; case "!==": result = left !== right; break; case "<": result = left < right; break; case "<=": result = left <= right; break; case ">": result = left > right; break; case ">=": result = left >= right; break; default: return this; } if (isNaN(result) && compressor.find_parent(AST_With)) { return this; } return result; }); def_eval(AST_Conditional, function(compressor, depth) { var condition = this.condition._eval(compressor, depth); if (condition === this.condition) return this; var node = condition ? this.consequent : this.alternative; var value = node._eval(compressor, depth); return value === node ? this : value; }); const reentrant_ref_eval = /* @__PURE__ */ new Set(); def_eval(AST_SymbolRef, function(compressor, depth) { if (reentrant_ref_eval.has(this)) return this; var fixed = this.fixed_value(); if (!fixed) return this; reentrant_ref_eval.add(this); const value = fixed._eval(compressor, depth); reentrant_ref_eval.delete(this); if (value === fixed) return this; if (value && typeof value == "object") { var escaped = this.definition().escaped; if (escaped && depth > escaped) return this; } return value; }); const global_objs = { Array, Math, Number, Object, String }; const regexp_flags = /* @__PURE__ */ new Set([ "dotAll", "global", "ignoreCase", "multiline", "sticky", "unicode" ]); def_eval(AST_PropAccess, function(compressor, depth) { let obj = this.expression._eval(compressor, depth + 1); if (obj === nullish || this.optional && obj == null) return nullish; if (this.property === "length") { if (typeof obj === "string") { return obj.length; } const is_spreadless_array = obj instanceof AST_Array && obj.elements.every((el) => !(el instanceof AST_Expansion)); if (is_spreadless_array && obj.elements.every((el) => !el.has_side_effects(compressor))) { return obj.elements.length; } } if (compressor.option("unsafe")) { var key = this.property; if (key instanceof AST_Node) { key = key._eval(compressor, depth); if (key === this.property) return this; } var exp = this.expression; if (is_undeclared_ref(exp)) { var aa; var first_arg = exp.name === "hasOwnProperty" && key === "call" && (aa = compressor.parent() && compressor.parent().args) && (aa && aa[0] && aa[0].evaluate(compressor)); first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { return this.clone(); } if (!is_pure_native_value(exp.name, key)) return this; obj = global_objs[exp.name]; } else { if (obj instanceof RegExp) { if (key == "source") { return regexp_source_fix(obj.source); } else if (key == "flags" || regexp_flags.has(key)) { return obj[key]; } } if (!obj || obj === exp || !HOP(obj, key)) return this; if (typeof obj == "function") switch (key) { case "name": return obj.node.name ? obj.node.name.name : ""; case "length": return obj.node.length_property(); default: return this; } } return obj[key]; } return this; }); def_eval(AST_Chain, function(compressor, depth) { const evaluated = this.expression._eval(compressor, depth); return evaluated === nullish ? void 0 : evaluated === this.expression ? this : evaluated; }); def_eval(AST_Call, function(compressor, depth) { var exp = this.expression; const callee = exp._eval(compressor, depth); if (callee === nullish || this.optional && callee == null) return nullish; if (compressor.option("unsafe") && exp instanceof AST_PropAccess) { var key = exp.property; if (key instanceof AST_Node) { key = key._eval(compressor, depth); if (key === exp.property) return this; } var val; var e = exp.expression; if (is_undeclared_ref(e)) { var first_arg = e.name === "hasOwnProperty" && key === "call" && (this.args[0] && this.args[0].evaluate(compressor)); first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { return this.clone(); } if (!is_pure_native_fn(e.name, key)) return this; val = global_objs[e.name]; } else { val = e._eval(compressor, depth + 1); if (val === e || !val) return this; if (!is_pure_native_method(val.constructor.name, key)) return this; } var args = []; for (var i = 0, len = this.args.length; i < len; i++) { var arg = this.args[i]; var value = arg._eval(compressor, depth); if (arg === value) return this; if (arg instanceof AST_Lambda) return this; args.push(value); } try { return val[key].apply(val, args); } catch (ex) { } } return this; }); def_eval(AST_New, return_this); function def_drop_side_effect_free(node, func) { node.DEFMETHOD("drop_side_effect_free", func); } function trim(nodes, compressor, first_in_statement2) { var len = nodes.length; if (!len) return null; var ret = [], changed = false; for (var i = 0; i < len; i++) { var node = nodes[i].drop_side_effect_free(compressor, first_in_statement2); changed |= node !== nodes[i]; if (node) { ret.push(node); first_in_statement2 = false; } } return changed ? ret.length ? ret : null : nodes; } def_drop_side_effect_free(AST_Node, return_this); def_drop_side_effect_free(AST_Constant, return_null); def_drop_side_effect_free(AST_This, return_null); def_drop_side_effect_free(AST_Call, function(compressor, first_in_statement2) { if (is_nullish_shortcircuited(this, compressor)) { return this.expression.drop_side_effect_free(compressor, first_in_statement2); } if (!this.is_callee_pure(compressor)) { if (this.expression.is_call_pure(compressor)) { var exprs = this.args.slice(); exprs.unshift(this.expression.expression); exprs = trim(exprs, compressor, first_in_statement2); return exprs && make_sequence(this, exprs); } if (is_func_expr(this.expression) && (!this.expression.name || !this.expression.name.definition().references.length)) { var node = this.clone(); node.expression.process_expression(false, compressor); return node; } return this; } var args = trim(this.args, compressor, first_in_statement2); return args && make_sequence(this, args); }); def_drop_side_effect_free(AST_Accessor, return_null); def_drop_side_effect_free(AST_Function, return_null); def_drop_side_effect_free(AST_Arrow, return_null); def_drop_side_effect_free(AST_Class, function(compressor) { const with_effects = []; const trimmed_extends = this.extends && this.extends.drop_side_effect_free(compressor); if (trimmed_extends) with_effects.push(trimmed_extends); for (const prop of this.properties) { if (prop instanceof AST_ClassStaticBlock) { if (prop.has_side_effects(compressor)) { return this; } } else { const trimmed_prop = prop.drop_side_effect_free(compressor); if (trimmed_prop) { if (trimmed_prop.contains_this()) return this; with_effects.push(trimmed_prop); } } } if (!with_effects.length) return null; const exprs = make_sequence(this, with_effects); if (this instanceof AST_DefClass) { return make_node(AST_SimpleStatement, this, { body: exprs }); } else { return exprs; } }); def_drop_side_effect_free(AST_ClassProperty, function(compressor) { const key = this.computed_key() && this.key.drop_side_effect_free(compressor); const value = this.static && this.value && this.value.drop_side_effect_free(compressor); if (key && value) return make_sequence(this, [key, value]); return key || value || null; }); def_drop_side_effect_free(AST_Binary, function(compressor, first_in_statement2) { var right = this.right.drop_side_effect_free(compressor); if (!right) return this.left.drop_side_effect_free(compressor, first_in_statement2); if (lazy_op.has(this.operator)) { if (right === this.right) return this; var node = this.clone(); node.right = right; return node; } else { var left = this.left.drop_side_effect_free(compressor, first_in_statement2); if (!left) return this.right.drop_side_effect_free(compressor, first_in_statement2); return make_sequence(this, [left, right]); } }); def_drop_side_effect_free(AST_Assign, function(compressor) { if (this.logical) return this; var left = this.left; if (left.has_side_effects(compressor) || compressor.has_directive("use strict") && left instanceof AST_PropAccess && left.expression.is_constant()) { return this; } set_flag(this, WRITE_ONLY); while (left instanceof AST_PropAccess) { left = left.expression; } if (left.is_constant_expression(compressor.find_parent(AST_Scope))) { return this.right.drop_side_effect_free(compressor); } return this; }); def_drop_side_effect_free(AST_Conditional, function(compressor) { var consequent = this.consequent.drop_side_effect_free(compressor); var alternative = this.alternative.drop_side_effect_free(compressor); if (consequent === this.consequent && alternative === this.alternative) return this; if (!consequent) return alternative ? make_node(AST_Binary, this, { operator: "||", left: this.condition, right: alternative }) : this.condition.drop_side_effect_free(compressor); if (!alternative) return make_node(AST_Binary, this, { operator: "&&", left: this.condition, right: consequent }); var node = this.clone(); node.consequent = consequent; node.alternative = alternative; return node; }); def_drop_side_effect_free(AST_Unary, function(compressor, first_in_statement2) { if (unary_side_effects.has(this.operator)) { if (!this.expression.has_side_effects(compressor)) { set_flag(this, WRITE_ONLY); } else { clear_flag(this, WRITE_ONLY); } return this; } if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) return null; var expression = this.expression.drop_side_effect_free(compressor, first_in_statement2); if (first_in_statement2 && expression && is_iife_call(expression)) { if (expression === this.expression && this.operator == "!") return this; return expression.negate(compressor, first_in_statement2); } return expression; }); def_drop_side_effect_free(AST_SymbolRef, function(compressor) { const safe_access = this.is_declared(compressor) || pure_prop_access_globals.has(this.name); return safe_access ? null : this; }); def_drop_side_effect_free(AST_Object, function(compressor, first_in_statement2) { var values = trim(this.properties, compressor, first_in_statement2); return values && make_sequence(this, values); }); def_drop_side_effect_free(AST_ObjectProperty, function(compressor, first_in_statement2) { const computed_key = this instanceof AST_ObjectKeyVal && this.key instanceof AST_Node; const key = computed_key && this.key.drop_side_effect_free(compressor, first_in_statement2); const value = this.value && this.value.drop_side_effect_free(compressor, first_in_statement2); if (key && value) { return make_sequence(this, [key, value]); } return key || value; }); def_drop_side_effect_free(AST_ConciseMethod, function() { return this.computed_key() ? this.key : null; }); def_drop_side_effect_free(AST_ObjectGetter, function() { return this.computed_key() ? this.key : null; }); def_drop_side_effect_free(AST_ObjectSetter, function() { return this.computed_key() ? this.key : null; }); def_drop_side_effect_free(AST_Array, function(compressor, first_in_statement2) { var values = trim(this.elements, compressor, first_in_statement2); return values && make_sequence(this, values); }); def_drop_side_effect_free(AST_Dot, function(compressor, first_in_statement2) { if (is_nullish_shortcircuited(this, compressor)) { return this.expression.drop_side_effect_free(compressor, first_in_statement2); } if (!this.optional && this.expression.may_throw_on_access(compressor)) { return this; } return this.expression.drop_side_effect_free(compressor, first_in_statement2); }); def_drop_side_effect_free(AST_Sub, function(compressor, first_in_statement2) { if (is_nullish_shortcircuited(this, compressor)) { return this.expression.drop_side_effect_free(compressor, first_in_statement2); } if (!this.optional && this.expression.may_throw_on_access(compressor)) { return this; } var property = this.property.drop_side_effect_free(compressor); if (property && this.optional) return this; var expression = this.expression.drop_side_effect_free(compressor, first_in_statement2); if (expression && property) return make_sequence(this, [expression, property]); return expression || property; }); def_drop_side_effect_free(AST_Chain, function(compressor, first_in_statement2) { return this.expression.drop_side_effect_free(compressor, first_in_statement2); }); def_drop_side_effect_free(AST_Sequence, function(compressor) { var last2 = this.tail_node(); var expr = last2.drop_side_effect_free(compressor); if (expr === last2) return this; var expressions = this.expressions.slice(0, -1); if (expr) expressions.push(expr); if (!expressions.length) { return make_node(AST_Number, this, { value: 0 }); } return make_sequence(this, expressions); }); def_drop_side_effect_free(AST_Expansion, function(compressor, first_in_statement2) { return this.expression.drop_side_effect_free(compressor, first_in_statement2); }); def_drop_side_effect_free(AST_TemplateSegment, return_null); def_drop_side_effect_free(AST_TemplateString, function(compressor) { var values = trim(this.segments, compressor, first_in_statement); return values && make_sequence(this, values); }); const r_keep_assign = /keep_assign/; AST_Scope.DEFMETHOD("drop_unused", function(compressor) { if (!compressor.option("unused")) return; if (compressor.has_directive("use asm")) return; if (!this.variables) return; var self2 = this; if (self2.pinned()) return; var drop_funcs = !(self2 instanceof AST_Toplevel) || compressor.toplevel.funcs; var drop_vars = !(self2 instanceof AST_Toplevel) || compressor.toplevel.vars; const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? return_false : function(node) { if (node instanceof AST_Assign && !node.logical && (has_flag(node, WRITE_ONLY) || node.operator == "=")) { return node.left; } if (node instanceof AST_Unary && has_flag(node, WRITE_ONLY)) { return node.expression; } }; var in_use_ids = /* @__PURE__ */ new Map(); var fixed_ids = /* @__PURE__ */ new Map(); if (self2 instanceof AST_Toplevel && compressor.top_retain) { self2.variables.forEach(function(def) { if (compressor.top_retain(def)) { in_use_ids.set(def.id, def); } }); } var var_defs_by_id = /* @__PURE__ */ new Map(); var initializations = /* @__PURE__ */ new Map(); var scope = this; var tw = new TreeWalker(function(node, descend) { if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { node.argnames.forEach(function(argname) { if (!(argname instanceof AST_SymbolDeclaration)) return; var def = argname.definition(); in_use_ids.set(def.id, def); }); } if (node === self2) return; if (node instanceof AST_Class) { if (node.has_side_effects(compressor)) { node.visit_nondeferred_class_parts(tw); } } if (node instanceof AST_Defun || node instanceof AST_DefClass) { var node_def = node.name.definition(); const in_export = tw.parent() instanceof AST_Export; if (in_export || !drop_funcs && scope === self2) { if (node_def.global) { in_use_ids.set(node_def.id, node_def); } } map_add(initializations, node_def.id, node); return true; } const in_root_scope = scope === self2; if (node instanceof AST_SymbolFunarg && in_root_scope) { map_add(var_defs_by_id, node.definition().id, node); } if (node instanceof AST_Definitions && in_root_scope) { const in_export = tw.parent() instanceof AST_Export; node.definitions.forEach(function(def) { if (def.name instanceof AST_SymbolVar) { map_add(var_defs_by_id, def.name.definition().id, def); } if (in_export || !drop_vars) { walk(def.name, (node2) => { if (node2 instanceof AST_SymbolDeclaration) { const def2 = node2.definition(); if (def2.global) { in_use_ids.set(def2.id, def2); } } }); } if (def.name instanceof AST_Destructuring) { def.walk(tw); } if (def.name instanceof AST_SymbolDeclaration && def.value) { var node_def2 = def.name.definition(); map_add(initializations, node_def2.id, def.value); if (!node_def2.chained && def.name.fixed_value() === def.value) { fixed_ids.set(node_def2.id, def); } if (def.value.has_side_effects(compressor)) { def.value.walk(tw); } } }); return true; } return scan_ref_scoped(node, descend); }); self2.walk(tw); tw = new TreeWalker(scan_ref_scoped); in_use_ids.forEach(function(def) { var init = initializations.get(def.id); if (init) init.forEach(function(init2) { init2.walk(tw); }); }); var tt = new TreeTransformer(function before(node, descend, in_list) { var parent = tt.parent(); if (drop_vars) { const sym2 = assign_as_unused(node); if (sym2 instanceof AST_SymbolRef) { var def = sym2.definition(); var in_use = in_use_ids.has(def.id); if (node instanceof AST_Assign) { if (!in_use || fixed_ids.has(def.id) && fixed_ids.get(def.id) !== node) { return maintain_this_binding(parent, node, node.right.transform(tt)); } } else if (!in_use) { return in_list ? MAP.skip : make_node(AST_Number, node, { value: 0 }); } } } if (scope !== self2) return; var def; if (node.name && (node instanceof AST_ClassExpression && !keep_name(compressor.option("keep_classnames"), (def = node.name.definition()).name) || node instanceof AST_Function && !keep_name(compressor.option("keep_fnames"), (def = node.name.definition()).name))) { if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null; } if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) { var trim2 = !compressor.option("keep_fargs"); for (var a = node.argnames, i = a.length; --i >= 0; ) { var sym = a[i]; if (sym instanceof AST_Expansion) { sym = sym.expression; } if (sym instanceof AST_DefaultAssign) { sym = sym.left; } if (!(sym instanceof AST_Destructuring) && !in_use_ids.has(sym.definition().id)) { set_flag(sym, UNUSED); if (trim2) { a.pop(); } } else { trim2 = false; } } } if (node instanceof AST_DefClass && node !== self2) { const def2 = node.name.definition(); descend(node, this); const keep_class = def2.global && !drop_funcs || in_use_ids.has(def2.id); if (!keep_class) { const kept = node.drop_side_effect_free(compressor); if (kept == null) { def2.eliminated++; return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); } return kept; } return node; } if (node instanceof AST_Defun && node !== self2) { const def2 = node.name.definition(); const keep = def2.global && !drop_funcs || in_use_ids.has(def2.id); if (!keep) { def2.eliminated++; return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); } } if (node instanceof AST_Definitions && !(parent instanceof AST_ForIn && parent.init === node)) { var drop_block = !(parent instanceof AST_Toplevel) && !(node instanceof AST_Var); var body = [], head = [], tail = []; var side_effects = []; node.definitions.forEach(function(def2) { if (def2.value) def2.value = def2.value.transform(tt); var is_destructure = def2.name instanceof AST_Destructuring; var sym2 = is_destructure ? new SymbolDef(null, { name: "" }) : def2.name.definition(); if (drop_block && sym2.global) return tail.push(def2); if (!(drop_vars || drop_block) || is_destructure && (def2.name.names.length || def2.name.is_array || compressor.option("pure_getters") != true) || in_use_ids.has(sym2.id)) { if (def2.value && fixed_ids.has(sym2.id) && fixed_ids.get(sym2.id) !== def2) { def2.value = def2.value.drop_side_effect_free(compressor); } if (def2.name instanceof AST_SymbolVar) { var var_defs = var_defs_by_id.get(sym2.id); if (var_defs.length > 1 && (!def2.value || sym2.orig.indexOf(def2.name) > sym2.eliminated)) { if (def2.value) { var ref = make_node(AST_SymbolRef, def2.name, def2.name); sym2.references.push(ref); var assign = make_node(AST_Assign, def2, { operator: "=", logical: false, left: ref, right: def2.value }); if (fixed_ids.get(sym2.id) === def2) { fixed_ids.set(sym2.id, assign); } side_effects.push(assign.transform(tt)); } remove2(var_defs, def2); sym2.eliminated++; return; } } if (def2.value) { if (side_effects.length > 0) { if (tail.length > 0) { side_effects.push(def2.value); def2.value = make_sequence(def2.value, side_effects); } else { body.push(make_node(AST_SimpleStatement, node, { body: make_sequence(node, side_effects) })); } side_effects = []; } tail.push(def2); } else { head.push(def2); } } else if (sym2.orig[0] instanceof AST_SymbolCatch) { var value = def2.value && def2.value.drop_side_effect_free(compressor); if (value) side_effects.push(value); def2.value = null; head.push(def2); } else { var value = def2.value && def2.value.drop_side_effect_free(compressor); if (value) { side_effects.push(value); } sym2.eliminated++; } }); if (head.length > 0 || tail.length > 0) { node.definitions = head.concat(tail); body.push(node); } if (side_effects.length > 0) { body.push(make_node(AST_SimpleStatement, node, { body: make_sequence(node, side_effects) })); } switch (body.length) { case 0: return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); case 1: return body[0]; default: return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { body }); } } if (node instanceof AST_For) { descend(node, this); var block; if (node.init instanceof AST_BlockStatement) { block = node.init; node.init = block.body.pop(); block.body.push(node); } if (node.init instanceof AST_SimpleStatement) { node.init = node.init.body; } else if (is_empty(node.init)) { node.init = null; } return !block ? node : in_list ? MAP.splice(block.body) : block; } if (node instanceof AST_LabeledStatement && node.body instanceof AST_For) { descend(node, this); if (node.body instanceof AST_BlockStatement) { var block = node.body; node.body = block.body.pop(); block.body.push(node); return in_list ? MAP.splice(block.body) : block; } return node; } if (node instanceof AST_BlockStatement) { descend(node, this); if (in_list && node.body.every(can_be_evicted_from_block)) { return MAP.splice(node.body); } return node; } if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { const save_scope = scope; scope = node; descend(node, this); scope = save_scope; return node; } }); self2.transform(tt); function scan_ref_scoped(node, descend) { var node_def; const sym = assign_as_unused(node); if (sym instanceof AST_SymbolRef && !is_ref_of(node.left, AST_SymbolBlockDeclaration) && self2.variables.get(sym.name) === (node_def = sym.definition())) { if (node instanceof AST_Assign) { node.right.walk(tw); if (!node_def.chained && node.left.fixed_value() === node.right) { fixed_ids.set(node_def.id, node); } } return true; } if (node instanceof AST_SymbolRef) { node_def = node.definition(); if (!in_use_ids.has(node_def.id)) { in_use_ids.set(node_def.id, node_def); if (node_def.orig[0] instanceof AST_SymbolCatch) { const redef = node_def.scope.is_block_scope() && node_def.scope.get_defun_scope().variables.get(node_def.name); if (redef) in_use_ids.set(redef.id, redef); } } return true; } if (node instanceof AST_Class) { descend(); return true; } if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { var save_scope = scope; scope = node; descend(); scope = save_scope; return true; } } }); function def_reduce_vars(node, func) { node.DEFMETHOD("reduce_vars", func); } def_reduce_vars(AST_Node, noop); function reset_def(compressor, def) { def.assignments = 0; def.chained = false; def.direct_access = false; def.escaped = 0; def.recursive_refs = 0; def.references = []; def.single_use = void 0; if (def.scope.pinned() || def.orig[0] instanceof AST_SymbolFunarg && def.scope.uses_arguments) { def.fixed = false; } else if (def.orig[0] instanceof AST_SymbolConst || !compressor.exposed(def)) { def.fixed = def.init; } else { def.fixed = false; } } function reset_variables(tw, compressor, node) { node.variables.forEach(function(def) { reset_def(compressor, def); if (def.fixed === null) { tw.defs_to_safe_ids.set(def.id, tw.safe_ids); mark(tw, def, true); } else if (def.fixed) { tw.loop_ids.set(def.id, tw.in_loop); mark(tw, def, true); } }); } function reset_block_variables(compressor, node) { if (node.block_scope) node.block_scope.variables.forEach((def) => { reset_def(compressor, def); }); } function push(tw) { tw.safe_ids = Object.create(tw.safe_ids); } function pop(tw) { tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); } function mark(tw, def, safe) { tw.safe_ids[def.id] = safe; } function safe_to_read(tw, def) { if (def.single_use == "m") return false; if (tw.safe_ids[def.id]) { if (def.fixed == null) { var orig = def.orig[0]; if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false; def.fixed = make_node(AST_Undefined, orig); } return true; } return def.fixed instanceof AST_Defun; } function safe_to_assign(tw, def, scope, value) { if (def.fixed === void 0) return true; let def_safe_ids; if (def.fixed === null && (def_safe_ids = tw.defs_to_safe_ids.get(def.id))) { def_safe_ids[def.id] = false; tw.defs_to_safe_ids.delete(def.id); return true; } if (!HOP(tw.safe_ids, def.id)) return false; if (!safe_to_read(tw, def)) return false; if (def.fixed === false) return false; if (def.fixed != null && (!value || def.references.length > def.assignments)) return false; if (def.fixed instanceof AST_Defun) { return value instanceof AST_Node && def.fixed.parent_scope === scope; } return def.orig.every((sym) => { return !(sym instanceof AST_SymbolConst || sym instanceof AST_SymbolDefun || sym instanceof AST_SymbolLambda); }); } function ref_once(tw, compressor, def) { return compressor.option("unused") && !def.scope.pinned() && def.references.length - def.recursive_refs == 1 && tw.loop_ids.get(def.id) === tw.in_loop; } function is_immutable(value) { if (!value) return false; return value.is_constant() || value instanceof AST_Lambda || value instanceof AST_This; } function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { var parent = tw.parent(level); if (value) { if (value.is_constant()) return; if (value instanceof AST_ClassExpression) return; } if (parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope || parent instanceof AST_VarDef && node === parent.value || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope) { if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; if (!d.escaped || d.escaped > depth) d.escaped = depth; return; } else if (parent instanceof AST_Array || parent instanceof AST_Await || parent instanceof AST_Binary && lazy_op.has(parent.operator) || parent instanceof AST_Conditional && node !== parent.condition || parent instanceof AST_Expansion || parent instanceof AST_Sequence && node === parent.tail_node()) { mark_escaped(tw, d, scope, parent, parent, level + 1, depth); } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { var obj = tw.parent(level + 1); mark_escaped(tw, d, scope, obj, obj, level + 2, depth); } else if (parent instanceof AST_PropAccess && node === parent.expression) { value = read_property(value, parent.property); mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); if (value) return; } if (level > 0) return; if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; if (parent instanceof AST_SimpleStatement) return; d.direct_access = true; } const suppress = (node) => walk(node, (node2) => { if (!(node2 instanceof AST_Symbol)) return; var d = node2.definition(); if (!d) return; if (node2 instanceof AST_SymbolRef) d.references.push(node2); d.fixed = false; }); def_reduce_vars(AST_Accessor, function(tw, descend, compressor) { push(tw); reset_variables(tw, compressor, this); descend(); pop(tw); return true; }); def_reduce_vars(AST_Assign, function(tw, descend, compressor) { var node = this; if (node.left instanceof AST_Destructuring) { suppress(node.left); return; } const finish_walk = () => { if (node.logical) { node.left.walk(tw); push(tw); node.right.walk(tw); pop(tw); return true; } }; var sym = node.left; if (!(sym instanceof AST_SymbolRef)) return finish_walk(); var def = sym.definition(); var safe = safe_to_assign(tw, def, sym.scope, node.right); def.assignments++; if (!safe) return finish_walk(); var fixed = def.fixed; if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); var eq = node.operator == "="; var value = eq ? node.right : node; if (is_modified(compressor, tw, node, value, 0)) return finish_walk(); def.references.push(sym); if (!node.logical) { if (!eq) def.chained = true; def.fixed = eq ? function() { return node.right; } : function() { return make_node(AST_Binary, node, { operator: node.operator.slice(0, -1), left: fixed instanceof AST_Node ? fixed : fixed(), right: node.right }); }; } if (node.logical) { mark(tw, def, false); push(tw); node.right.walk(tw); pop(tw); return true; } mark(tw, def, false); node.right.walk(tw); mark(tw, def, true); mark_escaped(tw, def, sym.scope, node, value, 0, 1); return true; }); def_reduce_vars(AST_Binary, function(tw) { if (!lazy_op.has(this.operator)) return; this.left.walk(tw); push(tw); this.right.walk(tw); pop(tw); return true; }); def_reduce_vars(AST_Block, function(tw, descend, compressor) { reset_block_variables(compressor, this); }); def_reduce_vars(AST_Case, function(tw) { push(tw); this.expression.walk(tw); pop(tw); push(tw); walk_body(this, tw); pop(tw); return true; }); def_reduce_vars(AST_Class, function(tw, descend) { clear_flag(this, INLINED); push(tw); descend(); pop(tw); return true; }); def_reduce_vars(AST_ClassStaticBlock, function(tw, descend, compressor) { reset_block_variables(compressor, this); }); def_reduce_vars(AST_Conditional, function(tw) { this.condition.walk(tw); push(tw); this.consequent.walk(tw); pop(tw); push(tw); this.alternative.walk(tw); pop(tw); return true; }); def_reduce_vars(AST_Chain, function(tw, descend) { const safe_ids = tw.safe_ids; descend(); tw.safe_ids = safe_ids; return true; }); def_reduce_vars(AST_Call, function(tw) { this.expression.walk(tw); if (this.optional) { push(tw); } for (const arg of this.args) arg.walk(tw); return true; }); def_reduce_vars(AST_PropAccess, function(tw) { if (!this.optional) return; this.expression.walk(tw); push(tw); if (this.property instanceof AST_Node) this.property.walk(tw); return true; }); def_reduce_vars(AST_Default, function(tw, descend) { push(tw); descend(); pop(tw); return true; }); function mark_lambda(tw, descend, compressor) { clear_flag(this, INLINED); push(tw); reset_variables(tw, compressor, this); var iife; if (!this.name && !this.uses_arguments && !this.pinned() && (iife = tw.parent()) instanceof AST_Call && iife.expression === this && !iife.args.some((arg) => arg instanceof AST_Expansion) && this.argnames.every((arg_name) => arg_name instanceof AST_Symbol)) { this.argnames.forEach((arg, i) => { if (!arg.definition) return; var d = arg.definition(); if (d.orig.length > 1) return; if (d.fixed === void 0 && (!this.uses_arguments || tw.has_directive("use strict"))) { d.fixed = function() { return iife.args[i] || make_node(AST_Undefined, iife); }; tw.loop_ids.set(d.id, tw.in_loop); mark(tw, d, true); } else { d.fixed = false; } }); } descend(); pop(tw); handle_defined_after_hoist(this); return true; } function handle_defined_after_hoist(parent) { const defuns = []; walk(parent, (node) => { if (node === parent) return; if (node instanceof AST_Defun) defuns.push(node); if (node instanceof AST_Scope || node instanceof AST_SimpleStatement) return true; }); const symbols_of_interest = /* @__PURE__ */ new Set(); const defuns_of_interest = /* @__PURE__ */ new Set(); const potential_conflicts = []; for (const defun of defuns) { const fname_def = defun.name.definition(); const found_self_ref_in_other_defuns = defuns.some((d) => d !== defun && d.enclosed.indexOf(fname_def) !== -1); for (const def of defun.enclosed) { if (def.fixed === false || def === fname_def || def.scope.get_defun_scope() !== parent) { continue; } if (def.assignments === 0 && def.orig.length === 1 && def.orig[0] instanceof AST_SymbolDefun) { continue; } if (found_self_ref_in_other_defuns) { def.fixed = false; continue; } potential_conflicts.push({ defun, def, fname_def }); symbols_of_interest.add(def.id); symbols_of_interest.add(fname_def.id); defuns_of_interest.add(defun); } } if (potential_conflicts.length) { const found_symbols = []; const found_symbol_writes = /* @__PURE__ */ new Set(); const defun_ranges = /* @__PURE__ */ new Map(); let tw; parent.walk(tw = new TreeWalker((node, descend) => { if (node instanceof AST_Defun && defuns_of_interest.has(node)) { const start = found_symbols.length; descend(); const end = found_symbols.length; defun_ranges.set(node, { start, end }); return true; } if (node instanceof AST_Symbol && node.thedef) { const id = node.definition().id; if (symbols_of_interest.has(id)) { if (node instanceof AST_SymbolDeclaration || is_lhs(node, tw)) { found_symbol_writes.add(found_symbols.length); } found_symbols.push(id); } } })); for (const { def, defun, fname_def } of potential_conflicts) { const defun_range = defun_ranges.get(defun); const find = (sym_id, starting_at = 0, must_be_write = false) => { let index = starting_at; for (; ; ) { index = found_symbols.indexOf(sym_id, index); if (index === -1) { break; } else if (index >= defun_range.start && index < defun_range.end) { index = defun_range.end; continue; } else if (must_be_write && !found_symbol_writes.has(index)) { index++; continue; } else { break; } } return index; }; const read_defun_at = find(fname_def.id); const wrote_def_at = find(def.id, read_defun_at + 1, true); const wrote_def_after_reading_defun = read_defun_at != -1 && wrote_def_at != -1 && wrote_def_at > read_defun_at; if (wrote_def_after_reading_defun) { def.fixed = false; } } } } def_reduce_vars(AST_Lambda, mark_lambda); def_reduce_vars(AST_Do, function(tw, descend, compressor) { reset_block_variables(compressor, this); const saved_loop = tw.in_loop; tw.in_loop = this; push(tw); this.body.walk(tw); if (has_break_or_continue(this)) { pop(tw); push(tw); } this.condition.walk(tw); pop(tw); tw.in_loop = saved_loop; return true; }); def_reduce_vars(AST_For, function(tw, descend, compressor) { reset_block_variables(compressor, this); if (this.init) this.init.walk(tw); const saved_loop = tw.in_loop; tw.in_loop = this; push(tw); if (this.condition) this.condition.walk(tw); this.body.walk(tw); if (this.step) { if (has_break_or_continue(this)) { pop(tw); push(tw); } this.step.walk(tw); } pop(tw); tw.in_loop = saved_loop; return true; }); def_reduce_vars(AST_ForIn, function(tw, descend, compressor) { reset_block_variables(compressor, this); suppress(this.init); this.object.walk(tw); const saved_loop = tw.in_loop; tw.in_loop = this; push(tw); this.body.walk(tw); pop(tw); tw.in_loop = saved_loop; return true; }); def_reduce_vars(AST_If, function(tw) { this.condition.walk(tw); push(tw); this.body.walk(tw); pop(tw); if (this.alternative) { push(tw); this.alternative.walk(tw); pop(tw); } return true; }); def_reduce_vars(AST_LabeledStatement, function(tw) { push(tw); this.body.walk(tw); pop(tw); return true; }); def_reduce_vars(AST_SymbolCatch, function() { this.definition().fixed = false; }); def_reduce_vars(AST_SymbolRef, function(tw, descend, compressor) { var d = this.definition(); d.references.push(this); if (d.references.length == 1 && !d.fixed && d.orig[0] instanceof AST_SymbolDefun) { tw.loop_ids.set(d.id, tw.in_loop); } var fixed_value; if (d.fixed === void 0 || !safe_to_read(tw, d)) { d.fixed = false; } else if (d.fixed) { fixed_value = this.fixed_value(); if (fixed_value instanceof AST_Lambda && is_recursive_ref(tw, d)) { d.recursive_refs++; } else if (fixed_value && !compressor.exposed(d) && ref_once(tw, compressor, d)) { d.single_use = fixed_value instanceof AST_Lambda && !fixed_value.pinned() || fixed_value instanceof AST_Class || d.scope === this.scope && fixed_value.is_constant_expression(); } else { d.single_use = false; } if (is_modified(compressor, tw, this, fixed_value, 0, is_immutable(fixed_value))) { if (d.single_use) { d.single_use = "m"; } else { d.fixed = false; } } } mark_escaped(tw, d, this.scope, this, fixed_value, 0, 1); }); def_reduce_vars(AST_Toplevel, function(tw, descend, compressor) { this.globals.forEach(function(def) { reset_def(compressor, def); }); reset_variables(tw, compressor, this); descend(); handle_defined_after_hoist(this); return true; }); def_reduce_vars(AST_Try, function(tw, descend, compressor) { reset_block_variables(compressor, this); push(tw); this.body.walk(tw); pop(tw); if (this.bcatch) { push(tw); this.bcatch.walk(tw); pop(tw); } if (this.bfinally) this.bfinally.walk(tw); return true; }); def_reduce_vars(AST_Unary, function(tw) { var node = this; if (node.operator !== "++" && node.operator !== "--") return; var exp = node.expression; if (!(exp instanceof AST_SymbolRef)) return; var def = exp.definition(); var safe = safe_to_assign(tw, def, exp.scope, true); def.assignments++; if (!safe) return; var fixed = def.fixed; if (!fixed) return; def.references.push(exp); def.chained = true; def.fixed = function() { return make_node(AST_Binary, node, { operator: node.operator.slice(0, -1), left: make_node(AST_UnaryPrefix, node, { operator: "+", expression: fixed instanceof AST_Node ? fixed : fixed() }), right: make_node(AST_Number, node, { value: 1 }) }); }; mark(tw, def, true); return true; }); def_reduce_vars(AST_VarDef, function(tw, descend) { var node = this; if (node.name instanceof AST_Destructuring) { suppress(node.name); return; } var d = node.name.definition(); if (node.value) { if (safe_to_assign(tw, d, node.name.scope, node.value)) { d.fixed = function() { return node.value; }; tw.loop_ids.set(d.id, tw.in_loop); mark(tw, d, false); descend(); mark(tw, d, true); return true; } else { d.fixed = false; } } }); def_reduce_vars(AST_While, function(tw, descend, compressor) { reset_block_variables(compressor, this); const saved_loop = tw.in_loop; tw.in_loop = this; push(tw); descend(); pop(tw); tw.in_loop = saved_loop; return true; }); function loop_body(x) { if (x instanceof AST_IterationStatement) { return x.body instanceof AST_BlockStatement ? x.body : x; } return x; } function is_lhs_read_only(lhs) { if (lhs instanceof AST_This) return true; if (lhs instanceof AST_SymbolRef) return lhs.definition().orig[0] instanceof AST_SymbolLambda; if (lhs instanceof AST_PropAccess) { lhs = lhs.expression; if (lhs instanceof AST_SymbolRef) { if (lhs.is_immutable()) return false; lhs = lhs.fixed_value(); } if (!lhs) return true; if (lhs instanceof AST_RegExp) return false; if (lhs instanceof AST_Constant) return true; return is_lhs_read_only(lhs); } return false; } function remove_initializers(var_statement) { var decls = []; var_statement.definitions.forEach(function(def) { if (def.name instanceof AST_SymbolDeclaration) { def.value = null; decls.push(def); } else { def.declarations_as_names().forEach((name) => { decls.push(make_node(AST_VarDef, def, { name, value: null })); }); } }); return decls.length ? make_node(AST_Var, var_statement, { definitions: decls }) : null; } function trim_unreachable_code(compressor, stat, target) { walk(stat, (node) => { if (node instanceof AST_Var) { const no_initializers = remove_initializers(node); if (no_initializers) target.push(no_initializers); return true; } if (node instanceof AST_Defun && (node === stat || !compressor.has_directive("use strict"))) { target.push(node === stat ? node : make_node(AST_Var, node, { definitions: [ make_node(AST_VarDef, node, { name: make_node(AST_SymbolVar, node.name, node.name), value: null }) ] })); return true; } if (node instanceof AST_Export || node instanceof AST_Import) { target.push(node); return true; } if (node instanceof AST_Scope) { return true; } }); } function tighten_body(statements, compressor) { const nearest_scope = compressor.find_scope(); const defun_scope = nearest_scope.get_defun_scope(); const { in_loop, in_try } = find_loop_scope_try(); var CHANGED, max_iter = 10; do { CHANGED = false; eliminate_spurious_blocks(statements); if (compressor.option("dead_code")) { eliminate_dead_code(statements, compressor); } if (compressor.option("if_return")) { handle_if_return(statements, compressor); } if (compressor.sequences_limit > 0) { sequencesize(statements, compressor); sequencesize_2(statements, compressor); } if (compressor.option("join_vars")) { join_consecutive_vars(statements); } if (compressor.option("collapse_vars")) { collapse(statements, compressor); } } while (CHANGED && max_iter-- > 0); function find_loop_scope_try() { var node = compressor.self(), level = 0, in_loop2 = false, in_try2 = false; do { if (node instanceof AST_IterationStatement) { in_loop2 = true; } else if (node instanceof AST_Scope) { break; } else if (node instanceof AST_TryBlock) { in_try2 = true; } } while (node = compressor.parent(level++)); return { in_loop: in_loop2, in_try: in_try2 }; } function collapse(statements2, compressor2) { if (nearest_scope.pinned() || defun_scope.pinned()) return statements2; var args; var candidates = []; var stat_index = statements2.length; var scanner = new TreeTransformer(function(node) { if (abort) return node; if (!hit) { if (node !== hit_stack[hit_index]) return node; hit_index++; if (hit_index < hit_stack.length) return handle_custom_scan_order(node); hit = true; stop_after = find_stop(node, 0); if (stop_after === node) abort = true; return node; } var parent = scanner.parent(); if (node instanceof AST_Assign && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) || node instanceof AST_Await || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) || (node instanceof AST_Call || node instanceof AST_PropAccess) && node.optional || node instanceof AST_Debugger || node instanceof AST_Destructuring || node instanceof AST_Expansion && node.expression instanceof AST_Symbol && (node.expression instanceof AST_This || node.expression.definition().references.length > 1) || node instanceof AST_IterationStatement && !(node instanceof AST_For) || node instanceof AST_LoopControl || node instanceof AST_Try || node instanceof AST_With || node instanceof AST_Yield || node instanceof AST_Export || node instanceof AST_Class || parent instanceof AST_For && node !== parent.init || !replace_all && (node instanceof AST_SymbolRef && !node.is_declared(compressor2) && !pure_prop_access_globals.has(node)) || node instanceof AST_SymbolRef && parent instanceof AST_Call && has_annotation(parent, _NOINLINE)) { abort = true; return node; } if (!stop_if_hit && (!lhs_local || !replace_all) && (parent instanceof AST_Binary && lazy_op.has(parent.operator) && parent.left !== node || parent instanceof AST_Conditional && parent.condition !== node || parent instanceof AST_If && parent.condition !== node)) { stop_if_hit = parent; } if (can_replace && !(node instanceof AST_SymbolDeclaration) && lhs.equivalent_to(node) && !shadows(scanner.find_scope() || nearest_scope, lvalues)) { if (stop_if_hit) { abort = true; return node; } if (is_lhs(node, parent)) { if (value_def) replaced++; return node; } else { replaced++; if (value_def && candidate instanceof AST_VarDef) return node; } CHANGED = abort = true; if (candidate instanceof AST_UnaryPostfix) { return make_node(AST_UnaryPrefix, candidate, candidate); } if (candidate instanceof AST_VarDef) { var def2 = candidate.name.definition(); var value = candidate.value; if (def2.references.length - def2.replaced == 1 && !compressor2.exposed(def2)) { def2.replaced++; if (funarg && is_identifier_atom(value)) { return value.transform(compressor2); } else { return maintain_this_binding(parent, node, value); } } return make_node(AST_Assign, candidate, { operator: "=", logical: false, left: make_node(AST_SymbolRef, candidate.name, candidate.name), right: value }); } clear_flag(candidate, WRITE_ONLY); return candidate; } var sym; if (node instanceof AST_Call || node instanceof AST_Exit && (side_effects || lhs instanceof AST_PropAccess || may_modify(lhs)) || node instanceof AST_PropAccess && (side_effects || node.expression.may_throw_on_access(compressor2)) || node instanceof AST_SymbolRef && (lvalues.has(node.name) && lvalues.get(node.name).modified || side_effects && may_modify(node)) || node instanceof AST_VarDef && node.value && (lvalues.has(node.name.name) || side_effects && may_modify(node.name)) || (sym = is_lhs(node.left, node)) && (sym instanceof AST_PropAccess || lvalues.has(sym.name)) || may_throw && (in_try ? node.has_side_effects(compressor2) : side_effects_external(node))) { stop_after = node; if (node instanceof AST_Scope) abort = true; } return handle_custom_scan_order(node); }, function(node) { if (abort) return; if (stop_after === node) abort = true; if (stop_if_hit === node) stop_if_hit = null; }); var multi_replacer = new TreeTransformer(function(node) { if (abort) return node; if (!hit) { if (node !== hit_stack[hit_index]) return node; hit_index++; if (hit_index < hit_stack.length) return; hit = true; return node; } if (node instanceof AST_SymbolRef && node.name == def.name) { if (!--replaced) abort = true; if (is_lhs(node, multi_replacer.parent())) return node; def.replaced++; value_def.replaced--; return candidate.value; } if (node instanceof AST_Default || node instanceof AST_Scope) return node; }); while (--stat_index >= 0) { if (stat_index == 0 && compressor2.option("unused")) extract_args(); var hit_stack = []; extract_candidates(statements2[stat_index]); while (candidates.length > 0) { hit_stack = candidates.pop(); var hit_index = 0; var candidate = hit_stack[hit_stack.length - 1]; var value_def = null; var stop_after = null; var stop_if_hit = null; var lhs = get_lhs(candidate); if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor2)) continue; var lvalues = get_lvalues(candidate); var lhs_local = is_lhs_local(lhs); if (lhs instanceof AST_SymbolRef) { lvalues.set(lhs.name, { def: lhs.definition(), modified: false }); } var side_effects = value_has_side_effects(candidate); var replace_all = replace_all_symbols(); var may_throw = candidate.may_throw(compressor2); var funarg = candidate.name instanceof AST_SymbolFunarg; var hit = funarg; var abort = false, replaced = 0, can_replace = !args || !hit; if (!can_replace) { for (let j = compressor2.self().argnames.lastIndexOf(candidate.name) + 1; !abort && j < args.length; j++) { args[j].transform(scanner); } can_replace = true; } for (var i = stat_index; !abort && i < statements2.length; i++) { statements2[i].transform(scanner); } if (value_def) { var def = candidate.name.definition(); if (abort && def.references.length - def.replaced > replaced) replaced = false; else { abort = false; hit_index = 0; hit = funarg; for (var i = stat_index; !abort && i < statements2.length; i++) { statements2[i].transform(multi_replacer); } value_def.single_use = false; } } if (replaced && !remove_candidate(candidate)) statements2.splice(stat_index, 1); } } function handle_custom_scan_order(node) { if (node instanceof AST_Scope) return node; if (node instanceof AST_Switch) { node.expression = node.expression.transform(scanner); for (var i2 = 0, len = node.body.length; !abort && i2 < len; i2++) { var branch = node.body[i2]; if (branch instanceof AST_Case) { if (!hit) { if (branch !== hit_stack[hit_index]) continue; hit_index++; } branch.expression = branch.expression.transform(scanner); if (!replace_all) break; } } abort = true; return node; } } function redefined_within_scope(def2, scope) { if (def2.global) return false; let cur_scope = def2.scope; while (cur_scope && cur_scope !== scope) { if (cur_scope.variables.has(def2.name)) { return true; } cur_scope = cur_scope.parent_scope; } return false; } function has_overlapping_symbol(fn, arg, fn_strict) { var found = false, scan_this = !(fn instanceof AST_Arrow); arg.walk(new TreeWalker(function(node, descend) { if (found) return true; if (node instanceof AST_SymbolRef && (fn.variables.has(node.name) || redefined_within_scope(node.definition(), fn))) { var s = node.definition().scope; if (s !== defun_scope) while (s = s.parent_scope) { if (s === defun_scope) return true; } return found = true; } if ((fn_strict || scan_this) && node instanceof AST_This) { return found = true; } if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { var prev = scan_this; scan_this = false; descend(); scan_this = prev; return true; } })); return found; } function extract_args() { var iife, fn = compressor2.self(); if (is_func_expr(fn) && !fn.name && !fn.uses_arguments && !fn.pinned() && (iife = compressor2.parent()) instanceof AST_Call && iife.expression === fn && iife.args.every((arg2) => !(arg2 instanceof AST_Expansion))) { var fn_strict = compressor2.has_directive("use strict"); if (fn_strict && !member(fn_strict, fn.body)) fn_strict = false; var len = fn.argnames.length; args = iife.args.slice(len); var names = /* @__PURE__ */ new Set(); for (var i2 = len; --i2 >= 0; ) { var sym = fn.argnames[i2]; var arg = iife.args[i2]; const def2 = sym.definition && sym.definition(); const is_reassigned = def2 && def2.orig.length > 1; if (is_reassigned) continue; args.unshift(make_node(AST_VarDef, sym, { name: sym, value: arg })); if (names.has(sym.name)) continue; names.add(sym.name); if (sym instanceof AST_Expansion) { var elements = iife.args.slice(i2); if (elements.every((arg2) => !has_overlapping_symbol(fn, arg2, fn_strict))) { candidates.unshift([make_node(AST_VarDef, sym, { name: sym.expression, value: make_node(AST_Array, iife, { elements }) })]); } } else { if (!arg) { arg = make_node(AST_Undefined, sym).transform(compressor2); } else if (arg instanceof AST_Lambda && arg.pinned() || has_overlapping_symbol(fn, arg, fn_strict)) { arg = null; } if (arg) candidates.unshift([make_node(AST_VarDef, sym, { name: sym, value: arg })]); } } } } function extract_candidates(expr) { hit_stack.push(expr); if (expr instanceof AST_Assign) { if (!expr.left.has_side_effects(compressor2) && !(expr.right instanceof AST_Chain)) { candidates.push(hit_stack.slice()); } extract_candidates(expr.right); } else if (expr instanceof AST_Binary) { extract_candidates(expr.left); extract_candidates(expr.right); } else if (expr instanceof AST_Call && !has_annotation(expr, _NOINLINE)) { extract_candidates(expr.expression); expr.args.forEach(extract_candidates); } else if (expr instanceof AST_Case) { extract_candidates(expr.expression); } else if (expr instanceof AST_Conditional) { extract_candidates(expr.condition); extract_candidates(expr.consequent); extract_candidates(expr.alternative); } else if (expr instanceof AST_Definitions) { var len = expr.definitions.length; var i2 = len - 200; if (i2 < 0) i2 = 0; for (; i2 < len; i2++) { extract_candidates(expr.definitions[i2]); } } else if (expr instanceof AST_DWLoop) { extract_candidates(expr.condition); if (!(expr.body instanceof AST_Block)) { extract_candidates(expr.body); } } else if (expr instanceof AST_Exit) { if (expr.value) extract_candidates(expr.value); } else if (expr instanceof AST_For) { if (expr.init) extract_candidates(expr.init); if (expr.condition) extract_candidates(expr.condition); if (expr.step) extract_candidates(expr.step); if (!(expr.body instanceof AST_Block)) { extract_candidates(expr.body); } } else if (expr instanceof AST_ForIn) { extract_candidates(expr.object); if (!(expr.body instanceof AST_Block)) { extract_candidates(expr.body); } } else if (expr instanceof AST_If) { extract_candidates(expr.condition); if (!(expr.body instanceof AST_Block)) { extract_candidates(expr.body); } if (expr.alternative && !(expr.alternative instanceof AST_Block)) { extract_candidates(expr.alternative); } } else if (expr instanceof AST_Sequence) { expr.expressions.forEach(extract_candidates); } else if (expr instanceof AST_SimpleStatement) { extract_candidates(expr.body); } else if (expr instanceof AST_Switch) { extract_candidates(expr.expression); expr.body.forEach(extract_candidates); } else if (expr instanceof AST_Unary) { if (expr.operator == "++" || expr.operator == "--") { candidates.push(hit_stack.slice()); } } else if (expr instanceof AST_VarDef) { if (expr.value && !(expr.value instanceof AST_Chain)) { candidates.push(hit_stack.slice()); extract_candidates(expr.value); } } hit_stack.pop(); } function find_stop(node, level, write_only) { var parent = scanner.parent(level); if (parent instanceof AST_Assign) { if (write_only && !parent.logical && !(parent.left instanceof AST_PropAccess || lvalues.has(parent.left.name))) { return find_stop(parent, level + 1, write_only); } return node; } if (parent instanceof AST_Binary) { if (write_only && (!lazy_op.has(parent.operator) || parent.left === node)) { return find_stop(parent, level + 1, write_only); } return node; } if (parent instanceof AST_Call) return node; if (parent instanceof AST_Case) return node; if (parent instanceof AST_Conditional) { if (write_only && parent.condition === node) { return find_stop(parent, level + 1, write_only); } return node; } if (parent instanceof AST_Definitions) { return find_stop(parent, level + 1, true); } if (parent instanceof AST_Exit) { return write_only ? find_stop(parent, level + 1, write_only) : node; } if (parent instanceof AST_If) { if (write_only && parent.condition === node) { return find_stop(parent, level + 1, write_only); } return node; } if (parent instanceof AST_IterationStatement) return node; if (parent instanceof AST_Sequence) { return find_stop(parent, level + 1, parent.tail_node() !== node); } if (parent instanceof AST_SimpleStatement) { return find_stop(parent, level + 1, true); } if (parent instanceof AST_Switch) return node; if (parent instanceof AST_VarDef) return node; return null; } function mangleable_var(var_def) { var value = var_def.value; if (!(value instanceof AST_SymbolRef)) return; if (value.name == "arguments") return; var def2 = value.definition(); if (def2.undeclared) return; return value_def = def2; } function get_lhs(expr) { if (expr instanceof AST_Assign && expr.logical) { return false; } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { var def2 = expr.name.definition(); if (!member(expr.name, def2.orig)) return; var referenced = def2.references.length - def2.replaced; if (!referenced) return; var declared = def2.orig.length - def2.eliminated; if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg) || (referenced > 1 ? mangleable_var(expr) : !compressor2.exposed(def2))) { return make_node(AST_SymbolRef, expr.name, expr.name); } } else { const lhs2 = expr instanceof AST_Assign ? expr.left : expr.expression; return !is_ref_of(lhs2, AST_SymbolConst) && !is_ref_of(lhs2, AST_SymbolLet) && lhs2; } } function get_rvalue(expr) { if (expr instanceof AST_Assign) { return expr.right; } else { return expr.value; } } function get_lvalues(expr) { var lvalues2 = /* @__PURE__ */ new Map(); if (expr instanceof AST_Unary) return lvalues2; var tw = new TreeWalker(function(node) { var sym = node; while (sym instanceof AST_PropAccess) sym = sym.expression; if (sym instanceof AST_SymbolRef) { const prev = lvalues2.get(sym.name); if (!prev || !prev.modified) { lvalues2.set(sym.name, { def: sym.definition(), modified: is_modified(compressor2, tw, node, node, 0) }); } } }); get_rvalue(expr).walk(tw); return lvalues2; } function remove_candidate(expr) { if (expr.name instanceof AST_SymbolFunarg) { var iife = compressor2.parent(), argnames = compressor2.self().argnames; var index = argnames.indexOf(expr.name); if (index < 0) { iife.args.length = Math.min(iife.args.length, argnames.length - 1); } else { var args2 = iife.args; if (args2[index]) args2[index] = make_node(AST_Number, args2[index], { value: 0 }); } return true; } var found = false; return statements2[stat_index].transform(new TreeTransformer(function(node, descend, in_list) { if (found) return node; if (node === expr || node.body === expr) { found = true; if (node instanceof AST_VarDef) { node.value = node.name instanceof AST_SymbolConst ? make_node(AST_Undefined, node.value) : null; return node; } return in_list ? MAP.skip : null; } }, function(node) { if (node instanceof AST_Sequence) switch (node.expressions.length) { case 0: return null; case 1: return node.expressions[0]; } })); } function is_lhs_local(lhs2) { while (lhs2 instanceof AST_PropAccess) lhs2 = lhs2.expression; return lhs2 instanceof AST_SymbolRef && lhs2.definition().scope.get_defun_scope() === defun_scope && !(in_loop && (lvalues.has(lhs2.name) || candidate instanceof AST_Unary || candidate instanceof AST_Assign && !candidate.logical && candidate.operator != "=")); } function value_has_side_effects(expr) { if (expr instanceof AST_Unary) return unary_side_effects.has(expr.operator); return get_rvalue(expr).has_side_effects(compressor2); } function replace_all_symbols() { if (side_effects) return false; if (value_def) return true; if (lhs instanceof AST_SymbolRef) { var def2 = lhs.definition(); if (def2.references.length - def2.replaced == (candidate instanceof AST_VarDef ? 1 : 2)) { return true; } } return false; } function may_modify(sym) { if (!sym.definition) return true; var def2 = sym.definition(); if (def2.orig.length == 1 && def2.orig[0] instanceof AST_SymbolDefun) return false; if (def2.scope.get_defun_scope() !== defun_scope) return true; return def2.references.some((ref) => ref.scope.get_defun_scope() !== defun_scope); } function side_effects_external(node, lhs2) { if (node instanceof AST_Assign) return side_effects_external(node.left, true); if (node instanceof AST_Unary) return side_effects_external(node.expression, true); if (node instanceof AST_VarDef) return node.value && side_effects_external(node.value); if (lhs2) { if (node instanceof AST_Dot) return side_effects_external(node.expression, true); if (node instanceof AST_Sub) return side_effects_external(node.expression, true); if (node instanceof AST_SymbolRef) return node.definition().scope.get_defun_scope() !== defun_scope; } return false; } function shadows(my_scope, lvalues2) { for (const { def: def2 } of lvalues2.values()) { const looked_up = my_scope.find_variable(def2.name); if (looked_up) { if (looked_up === def2) continue; return true; } } return false; } } function eliminate_spurious_blocks(statements2) { var seen_dirs = []; for (var i = 0; i < statements2.length; ) { var stat = statements2[i]; if (stat instanceof AST_BlockStatement && stat.body.every(can_be_evicted_from_block)) { CHANGED = true; eliminate_spurious_blocks(stat.body); statements2.splice(i, 1, ...stat.body); i += stat.body.length; } else if (stat instanceof AST_EmptyStatement) { CHANGED = true; statements2.splice(i, 1); } else if (stat instanceof AST_Directive) { if (seen_dirs.indexOf(stat.value) < 0) { i++; seen_dirs.push(stat.value); } else { CHANGED = true; statements2.splice(i, 1); } } else i++; } } function handle_if_return(statements2, compressor2) { var self2 = compressor2.self(); var multiple_if_returns = has_multiple_if_returns(statements2); var in_lambda = self2 instanceof AST_Lambda; const iteration_start = Math.min(statements2.length, 500); for (var i = iteration_start; --i >= 0; ) { var stat = statements2[i]; var j = next_index(i); var next = statements2[j]; if (in_lambda && !next && stat instanceof AST_Return) { if (!stat.value) { CHANGED = true; statements2.splice(i, 1); continue; } if (stat.value instanceof AST_UnaryPrefix && stat.value.operator == "void") { CHANGED = true; statements2[i] = make_node(AST_SimpleStatement, stat, { body: stat.value.expression }); continue; } } if (stat instanceof AST_If) { let ab, new_else; ab = aborts(stat.body); if (can_merge_flow(ab) && (new_else = as_statement_array_with_return(stat.body, ab))) { if (ab.label) { remove2(ab.label.thedef.references, ab); } CHANGED = true; stat = stat.clone(); stat.condition = stat.condition.negate(compressor2); stat.body = make_node(AST_BlockStatement, stat, { body: as_statement_array(stat.alternative).concat(extract_functions()) }); stat.alternative = make_node(AST_BlockStatement, stat, { body: new_else }); statements2[i] = stat.transform(compressor2); continue; } ab = aborts(stat.alternative); if (can_merge_flow(ab) && (new_else = as_statement_array_with_return(stat.alternative, ab))) { if (ab.label) { remove2(ab.label.thedef.references, ab); } CHANGED = true; stat = stat.clone(); stat.body = make_node(AST_BlockStatement, stat.body, { body: as_statement_array(stat.body).concat(extract_functions()) }); stat.alternative = make_node(AST_BlockStatement, stat.alternative, { body: new_else }); statements2[i] = stat.transform(compressor2); continue; } } if (stat instanceof AST_If && stat.body instanceof AST_Return) { var value = stat.body.value; if (!value && !stat.alternative && (in_lambda && !next || next instanceof AST_Return && !next.value)) { CHANGED = true; statements2[i] = make_node(AST_SimpleStatement, stat.condition, { body: stat.condition }); continue; } if (value && !stat.alternative && next instanceof AST_Return && next.value) { CHANGED = true; stat = stat.clone(); stat.alternative = next; statements2[i] = stat.transform(compressor2); statements2.splice(j, 1); continue; } if (value && !stat.alternative && (!next && in_lambda && multiple_if_returns || next instanceof AST_Return)) { CHANGED = true; stat = stat.clone(); stat.alternative = next || make_node(AST_Return, stat, { value: null }); statements2[i] = stat.transform(compressor2); if (next) statements2.splice(j, 1); continue; } var prev = statements2[prev_index(i)]; if (compressor2.option("sequences") && in_lambda && !stat.alternative && prev instanceof AST_If && prev.body instanceof AST_Return && next_index(j) == statements2.length && next instanceof AST_SimpleStatement) { CHANGED = true; stat = stat.clone(); stat.alternative = make_node(AST_BlockStatement, next, { body: [ next, make_node(AST_Return, next, { value: null }) ] }); statements2[i] = stat.transform(compressor2); statements2.splice(j, 1); continue; } } } function has_multiple_if_returns(statements3) { var n = 0; for (var i2 = statements3.length; --i2 >= 0; ) { var stat2 = statements3[i2]; if (stat2 instanceof AST_If && stat2.body instanceof AST_Return) { if (++n > 1) return true; } } return false; } function is_return_void(value2) { return !value2 || value2 instanceof AST_UnaryPrefix && value2.operator == "void"; } function can_merge_flow(ab) { if (!ab) return false; for (var j2 = i + 1, len = statements2.length; j2 < len; j2++) { var stat2 = statements2[j2]; if (stat2 instanceof AST_Const || stat2 instanceof AST_Let) return false; } var lct = ab instanceof AST_LoopControl ? compressor2.loopcontrol_target(ab) : null; return ab instanceof AST_Return && in_lambda && is_return_void(ab.value) || ab instanceof AST_Continue && self2 === loop_body(lct) || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self2 === lct; } function extract_functions() { var tail = statements2.slice(i + 1); statements2.length = i + 1; return tail.filter(function(stat2) { if (stat2 instanceof AST_Defun) { statements2.push(stat2); return false; } return true; }); } function as_statement_array_with_return(node, ab) { var body = as_statement_array(node); if (ab !== body[body.length - 1]) { return void 0; } body = body.slice(0, -1); if (ab.value) { body.push(make_node(AST_SimpleStatement, ab.value, { body: ab.value.expression })); } return body; } function next_index(i2) { for (var j2 = i2 + 1, len = statements2.length; j2 < len; j2++) { var stat2 = statements2[j2]; if (!(stat2 instanceof AST_Var && declarations_only(stat2))) { break; } } return j2; } function prev_index(i2) { for (var j2 = i2; --j2 >= 0; ) { var stat2 = statements2[j2]; if (!(stat2 instanceof AST_Var && declarations_only(stat2))) { break; } } return j2; } } function eliminate_dead_code(statements2, compressor2) { var has_quit; var self2 = compressor2.self(); for (var i = 0, n = 0, len = statements2.length; i < len; i++) { var stat = statements2[i]; if (stat instanceof AST_LoopControl) { var lct = compressor2.loopcontrol_target(stat); if (stat instanceof AST_Break && !(lct instanceof AST_IterationStatement) && loop_body(lct) === self2 || stat instanceof AST_Continue && loop_body(lct) === self2) { if (stat.label) { remove2(stat.label.thedef.references, stat); } } else { statements2[n++] = stat; } } else { statements2[n++] = stat; } if (aborts(stat)) { has_quit = statements2.slice(i + 1); break; } } statements2.length = n; CHANGED = n != len; if (has_quit) has_quit.forEach(function(stat2) { trim_unreachable_code(compressor2, stat2, statements2); }); } function declarations_only(node) { return node.definitions.every((var_def) => !var_def.value); } function sequencesize(statements2, compressor2) { if (statements2.length < 2) return; var seq = [], n = 0; function push_seq() { if (!seq.length) return; var body2 = make_sequence(seq[0], seq); statements2[n++] = make_node(AST_SimpleStatement, body2, { body: body2 }); seq = []; } for (var i = 0, len = statements2.length; i < len; i++) { var stat = statements2[i]; if (stat instanceof AST_SimpleStatement) { if (seq.length >= compressor2.sequences_limit) push_seq(); var body = stat.body; if (seq.length > 0) body = body.drop_side_effect_free(compressor2); if (body) merge_sequence(seq, body); } else if (stat instanceof AST_Definitions && declarations_only(stat) || stat instanceof AST_Defun) { statements2[n++] = stat; } else { push_seq(); statements2[n++] = stat; } } push_seq(); statements2.length = n; if (n != len) CHANGED = true; } function to_simple_statement(block, decls) { if (!(block instanceof AST_BlockStatement)) return block; var stat = null; for (var i = 0, len = block.body.length; i < len; i++) { var line = block.body[i]; if (line instanceof AST_Var && declarations_only(line)) { decls.push(line); } else if (stat || line instanceof AST_Const || line instanceof AST_Let) { return false; } else { stat = line; } } return stat; } function sequencesize_2(statements2, compressor2) { function cons_seq(right) { n--; CHANGED = true; var left = prev.body; return make_sequence(left, [left, right]).transform(compressor2); } var n = 0, prev; for (var i = 0; i < statements2.length; i++) { var stat = statements2[i]; if (prev) { if (stat instanceof AST_Exit) { stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor2)); } else if (stat instanceof AST_For) { if (!(stat.init instanceof AST_Definitions)) { const abort = walk(prev.body, (node) => { if (node instanceof AST_Scope) return true; if (node instanceof AST_Binary && node.operator === "in") { return walk_abort; } }); if (!abort) { if (stat.init) stat.init = cons_seq(stat.init); else { stat.init = prev.body; n--; CHANGED = true; } } } } else if (stat instanceof AST_ForIn) { if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) { stat.object = cons_seq(stat.object); } } else if (stat instanceof AST_If) { stat.condition = cons_seq(stat.condition); } else if (stat instanceof AST_Switch) { stat.expression = cons_seq(stat.expression); } else if (stat instanceof AST_With) { stat.expression = cons_seq(stat.expression); } } if (compressor2.option("conditionals") && stat instanceof AST_If) { var decls = []; var body = to_simple_statement(stat.body, decls); var alt = to_simple_statement(stat.alternative, decls); if (body !== false && alt !== false && decls.length > 0) { var len = decls.length; decls.push(make_node(AST_If, stat, { condition: stat.condition, body: body || make_node(AST_EmptyStatement, stat.body), alternative: alt })); decls.unshift(n, 1); [].splice.apply(statements2, decls); i += len; n += len + 1; prev = null; CHANGED = true; continue; } } statements2[n++] = stat; prev = stat instanceof AST_SimpleStatement ? stat : null; } statements2.length = n; } function join_object_assignments(defn, body) { if (!(defn instanceof AST_Definitions)) return; var def = defn.definitions[defn.definitions.length - 1]; if (!(def.value instanceof AST_Object)) return; var exprs; if (body instanceof AST_Assign && !body.logical) { exprs = [body]; } else if (body instanceof AST_Sequence) { exprs = body.expressions.slice(); } if (!exprs) return; var trimmed = false; do { var node = exprs[0]; if (!(node instanceof AST_Assign)) break; if (node.operator != "=") break; if (!(node.left instanceof AST_PropAccess)) break; var sym = node.left.expression; if (!(sym instanceof AST_SymbolRef)) break; if (def.name.name != sym.name) break; if (!node.right.is_constant_expression(nearest_scope)) break; var prop = node.left.property; if (prop instanceof AST_Node) { prop = prop.evaluate(compressor); } if (prop instanceof AST_Node) break; prop = "" + prop; var diff = compressor.option("ecma") < 2015 && compressor.has_directive("use strict") ? function(node2) { return node2.key != prop && (node2.key && node2.key.name != prop); } : function(node2) { return node2.key && node2.key.name != prop; }; if (!def.value.properties.every(diff)) break; var p = def.value.properties.filter(function(p2) { return p2.key === prop; })[0]; if (!p) { def.value.properties.push(make_node(AST_ObjectKeyVal, node, { key: prop, value: node.right })); } else { p.value = new AST_Sequence({ start: p.start, expressions: [p.value.clone(), node.right.clone()], end: p.end }); } exprs.shift(); trimmed = true; } while (exprs.length); return trimmed && exprs; } function join_consecutive_vars(statements2) { var defs; for (var i = 0, j = -1, len = statements2.length; i < len; i++) { var stat = statements2[i]; var prev = statements2[j]; if (stat instanceof AST_Definitions) { if (prev && prev.TYPE == stat.TYPE) { prev.definitions = prev.definitions.concat(stat.definitions); CHANGED = true; } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { defs.definitions = defs.definitions.concat(stat.definitions); CHANGED = true; } else { statements2[++j] = stat; defs = stat; } } else if (stat instanceof AST_Exit) { stat.value = extract_object_assignments(stat.value); } else if (stat instanceof AST_For) { var exprs = join_object_assignments(prev, stat.init); if (exprs) { CHANGED = true; stat.init = exprs.length ? make_sequence(stat.init, exprs) : null; statements2[++j] = stat; } else if (prev instanceof AST_Var && (!stat.init || stat.init.TYPE == prev.TYPE)) { if (stat.init) { prev.definitions = prev.definitions.concat(stat.init.definitions); } stat.init = prev; statements2[j] = stat; CHANGED = true; } else if (defs instanceof AST_Var && stat.init instanceof AST_Var && declarations_only(stat.init)) { defs.definitions = defs.definitions.concat(stat.init.definitions); stat.init = null; statements2[++j] = stat; CHANGED = true; } else { statements2[++j] = stat; } } else if (stat instanceof AST_ForIn) { stat.object = extract_object_assignments(stat.object); } else if (stat instanceof AST_If) { stat.condition = extract_object_assignments(stat.condition); } else if (stat instanceof AST_SimpleStatement) { var exprs = join_object_assignments(prev, stat.body); if (exprs) { CHANGED = true; if (!exprs.length) continue; stat.body = make_sequence(stat.body, exprs); } statements2[++j] = stat; } else if (stat instanceof AST_Switch) { stat.expression = extract_object_assignments(stat.expression); } else if (stat instanceof AST_With) { stat.expression = extract_object_assignments(stat.expression); } else { statements2[++j] = stat; } } statements2.length = j + 1; function extract_object_assignments(value) { statements2[++j] = stat; var exprs2 = join_object_assignments(prev, value); if (exprs2) { CHANGED = true; if (exprs2.length) { return make_sequence(value, exprs2); } else if (value instanceof AST_Sequence) { return value.tail_node().left; } else { return value.left; } } return value; } } } function within_array_or_object_literal(compressor) { var node, level = 0; while (node = compressor.parent(level++)) { if (node instanceof AST_Statement) return false; if (node instanceof AST_Array || node instanceof AST_ObjectKeyVal || node instanceof AST_Object) { return true; } } return false; } function scope_encloses_variables_in_this_scope(scope, pulled_scope) { for (const enclosed of pulled_scope.enclosed) { if (pulled_scope.variables.has(enclosed.name)) { continue; } const looked_up = scope.find_variable(enclosed.name); if (looked_up) { if (looked_up === enclosed) continue; return true; } } return false; } function is_const_symbol_short_than_init_value(def, fixed_value) { if (def.orig.length === 1 && fixed_value) { const init_value_length = fixed_value.size(); const identifer_length = def.name.length; return init_value_length > identifer_length; } return true; } function inline_into_symbolref(self2, compressor) { const parent = compressor.parent(); const def = self2.definition(); const nearest_scope = compressor.find_scope(); let fixed = self2.fixed_value(); if (compressor.top_retain && def.global && compressor.top_retain(def) && is_const_symbol_short_than_init_value(def, fixed)) { def.fixed = false; def.single_use = false; return self2; } let single_use = def.single_use && !(parent instanceof AST_Call && parent.is_callee_pure(compressor) || has_annotation(parent, _NOINLINE)) && !(parent instanceof AST_Export && fixed instanceof AST_Lambda && fixed.name); if (single_use && fixed instanceof AST_Node) { single_use = !fixed.has_side_effects(compressor) && !fixed.may_throw(compressor); } if (fixed instanceof AST_Class && def.scope !== self2.scope) { return self2; } if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { if (retain_top_func(fixed, compressor)) { single_use = false; } else if (def.scope !== self2.scope && (def.escaped == 1 || has_flag(fixed, INLINED) || within_array_or_object_literal(compressor) || !compressor.option("reduce_funcs"))) { single_use = false; } else if (is_recursive_ref(compressor, def)) { single_use = false; } else if (def.scope !== self2.scope || def.orig[0] instanceof AST_SymbolFunarg) { single_use = fixed.is_constant_expression(self2.scope); if (single_use == "f") { var scope = self2.scope; do { if (scope instanceof AST_Defun || is_func_expr(scope)) { set_flag(scope, INLINED); } } while (scope = scope.parent_scope); } } } if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { single_use = def.scope === self2.scope && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) || parent instanceof AST_Call && parent.expression === self2 && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) && !(fixed.name && fixed.name.definition().recursive_refs > 0); } if (single_use && fixed) { if (fixed instanceof AST_DefClass) { set_flag(fixed, SQUEEZED); fixed = make_node(AST_ClassExpression, fixed, fixed); } if (fixed instanceof AST_Defun) { set_flag(fixed, SQUEEZED); fixed = make_node(AST_Function, fixed, fixed); } if (def.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) { const defun_def = fixed.name.definition(); let lambda_def = fixed.variables.get(fixed.name.name); let name = lambda_def && lambda_def.orig[0]; if (!(name instanceof AST_SymbolLambda)) { name = make_node(AST_SymbolLambda, fixed.name, fixed.name); name.scope = fixed; fixed.name = name; lambda_def = fixed.def_function(name); } walk(fixed, (node) => { if (node instanceof AST_SymbolRef && node.definition() === defun_def) { node.thedef = lambda_def; lambda_def.references.push(node); } }); } if ((fixed instanceof AST_Lambda || fixed instanceof AST_Class) && fixed.parent_scope !== nearest_scope) { fixed = fixed.clone(true, compressor.get_toplevel()); nearest_scope.add_child_scope(fixed); } return fixed.optimize(compressor); } if (fixed) { let replace; if (fixed instanceof AST_This) { if (!(def.orig[0] instanceof AST_SymbolFunarg) && def.references.every((ref) => def.scope === ref.scope)) { replace = fixed; } } else { var ev = fixed.evaluate(compressor); if (ev !== fixed && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp))) { replace = make_node_from_constant(ev, fixed); } } if (replace) { const name_length = self2.size(compressor); const replace_size = replace.size(compressor); let overhead = 0; if (compressor.option("unused") && !compressor.exposed(def)) { overhead = (name_length + 2 + replace_size) / (def.references.length - def.assignments); } if (replace_size <= name_length + overhead) { return replace; } } } return self2; } function inline_into_call(self2, compressor) { var exp = self2.expression; var fn = exp; var simple_args = self2.args.every((arg) => !(arg instanceof AST_Expansion)); if (compressor.option("reduce_vars") && fn instanceof AST_SymbolRef && !has_annotation(self2, _NOINLINE)) { const fixed = fn.fixed_value(); if (retain_top_func(fixed, compressor) || !compressor.toplevel.funcs && exp.definition().global) { return self2; } fn = fixed; } var is_func = fn instanceof AST_Lambda; var stat = is_func && fn.body[0]; var is_regular_func = is_func && !fn.is_generator && !fn.async; var can_inline = is_regular_func && compressor.option("inline") && !self2.is_callee_pure(compressor); if (can_inline && stat instanceof AST_Return) { let returned = stat.value; if (!returned || returned.is_constant_expression()) { if (returned) { returned = returned.clone(true); } else { returned = make_node(AST_Undefined, self2); } const args2 = self2.args.concat(returned); return make_sequence(self2, args2).optimize(compressor); } if (fn.argnames.length === 1 && fn.argnames[0] instanceof AST_SymbolFunarg && self2.args.length < 2 && !(self2.args[0] instanceof AST_Expansion) && returned instanceof AST_SymbolRef && returned.name === fn.argnames[0].name) { const replacement = (self2.args[0] || make_node(AST_Undefined)).optimize(compressor); let parent; if (replacement instanceof AST_PropAccess && (parent = compressor.parent()) instanceof AST_Call && parent.expression === self2) { return make_sequence(self2, [ make_node(AST_Number, self2, { value: 0 }), replacement ]); } return replacement; } } if (can_inline) { var scope, in_loop, level = -1; let def; let returned_value; let nearest_scope; if (simple_args && !fn.uses_arguments && !(compressor.parent() instanceof AST_Class) && !(fn.name && fn instanceof AST_Function) && (returned_value = can_flatten_body(stat)) && (exp === fn || has_annotation(self2, _INLINE) || compressor.option("unused") && (def = exp.definition()).references.length == 1 && !is_recursive_ref(compressor, def) && fn.is_constant_expression(exp.scope)) && !has_annotation(self2, _PURE | _NOINLINE) && !fn.contains_this() && can_inject_symbols() && (nearest_scope = compressor.find_scope()) && !scope_encloses_variables_in_this_scope(nearest_scope, fn) && !function in_default_assign() { let i = 0; let p; while (p = compressor.parent(i++)) { if (p instanceof AST_DefaultAssign) return true; if (p instanceof AST_Block) break; } return false; }() && !(scope instanceof AST_Class)) { set_flag(fn, SQUEEZED); nearest_scope.add_child_scope(fn); return make_sequence(self2, flatten_fn(returned_value)).optimize(compressor); } } if (can_inline && has_annotation(self2, _INLINE)) { set_flag(fn, SQUEEZED); fn = make_node(fn.CTOR === AST_Defun ? AST_Function : fn.CTOR, fn, fn); fn = fn.clone(true); fn.figure_out_scope({}, { parent_scope: compressor.find_scope(), toplevel: compressor.get_toplevel() }); return make_node(AST_Call, self2, { expression: fn, args: self2.args }).optimize(compressor); } const can_drop_this_call = is_regular_func && compressor.option("side_effects") && fn.body.every(is_empty); if (can_drop_this_call) { var args = self2.args.concat(make_node(AST_Undefined, self2)); return make_sequence(self2, args).optimize(compressor); } if (compressor.option("negate_iife") && compressor.parent() instanceof AST_SimpleStatement && is_iife_call(self2)) { return self2.negate(compressor, true); } var ev = self2.evaluate(compressor); if (ev !== self2) { ev = make_node_from_constant(ev, self2).optimize(compressor); return best_of(compressor, ev, self2); } return self2; function return_value(stat2) { if (!stat2) return make_node(AST_Undefined, self2); if (stat2 instanceof AST_Return) { if (!stat2.value) return make_node(AST_Undefined, self2); return stat2.value.clone(true); } if (stat2 instanceof AST_SimpleStatement) { return make_node(AST_UnaryPrefix, stat2, { operator: "void", expression: stat2.body.clone(true) }); } } function can_flatten_body(stat2) { var body = fn.body; var len = body.length; if (compressor.option("inline") < 3) { return len == 1 && return_value(stat2); } stat2 = null; for (var i = 0; i < len; i++) { var line = body[i]; if (line instanceof AST_Var) { if (stat2 && !line.definitions.every((var_def) => !var_def.value)) { return false; } } else if (stat2) { return false; } else if (!(line instanceof AST_EmptyStatement)) { stat2 = line; } } return return_value(stat2); } function can_inject_args(block_scoped, safe_to_inject) { for (var i = 0, len = fn.argnames.length; i < len; i++) { var arg = fn.argnames[i]; if (arg instanceof AST_DefaultAssign) { if (has_flag(arg.left, UNUSED)) continue; return false; } if (arg instanceof AST_Destructuring) return false; if (arg instanceof AST_Expansion) { if (has_flag(arg.expression, UNUSED)) continue; return false; } if (has_flag(arg, UNUSED)) continue; if (!safe_to_inject || block_scoped.has(arg.name) || identifier_atom.has(arg.name) || scope.conflicting_def(arg.name)) { return false; } if (in_loop) in_loop.push(arg.definition()); } return true; } function can_inject_vars(block_scoped, safe_to_inject) { var len = fn.body.length; for (var i = 0; i < len; i++) { var stat2 = fn.body[i]; if (!(stat2 instanceof AST_Var)) continue; if (!safe_to_inject) return false; for (var j = stat2.definitions.length; --j >= 0; ) { var name = stat2.definitions[j].name; if (name instanceof AST_Destructuring || block_scoped.has(name.name) || identifier_atom.has(name.name) || scope.conflicting_def(name.name)) { return false; } if (in_loop) in_loop.push(name.definition()); } } return true; } function can_inject_symbols() { var block_scoped = /* @__PURE__ */ new Set(); do { scope = compressor.parent(++level); if (scope.is_block_scope() && scope.block_scope) { scope.block_scope.variables.forEach(function(variable) { block_scoped.add(variable.name); }); } if (scope instanceof AST_Catch) { if (scope.argname) { block_scoped.add(scope.argname.name); } } else if (scope instanceof AST_IterationStatement) { in_loop = []; } else if (scope instanceof AST_SymbolRef) { if (scope.fixed_value() instanceof AST_Scope) return false; } } while (!(scope instanceof AST_Scope)); var safe_to_inject = !(scope instanceof AST_Toplevel) || compressor.toplevel.vars; var inline = compressor.option("inline"); if (!can_inject_vars(block_scoped, inline >= 3 && safe_to_inject)) return false; if (!can_inject_args(block_scoped, inline >= 2 && safe_to_inject)) return false; return !in_loop || in_loop.length == 0 || !is_reachable(fn, in_loop); } function append_var(decls, expressions, name, value) { var def = name.definition(); const already_appended = scope.variables.has(name.name); if (!already_appended) { scope.variables.set(name.name, def); scope.enclosed.push(def); decls.push(make_node(AST_VarDef, name, { name, value: null })); } var sym = make_node(AST_SymbolRef, name, name); def.references.push(sym); if (value) expressions.push(make_node(AST_Assign, self2, { operator: "=", logical: false, left: sym, right: value.clone() })); } function flatten_args(decls, expressions) { var len = fn.argnames.length; for (var i = self2.args.length; --i >= len; ) { expressions.push(self2.args[i]); } for (i = len; --i >= 0; ) { var name = fn.argnames[i]; var value = self2.args[i]; if (has_flag(name, UNUSED) || !name.name || scope.conflicting_def(name.name)) { if (value) expressions.push(value); } else { var symbol = make_node(AST_SymbolVar, name, name); name.definition().orig.push(symbol); if (!value && in_loop) value = make_node(AST_Undefined, self2); append_var(decls, expressions, symbol, value); } } decls.reverse(); expressions.reverse(); } function flatten_vars(decls, expressions) { var pos = expressions.length; for (var i = 0, lines = fn.body.length; i < lines; i++) { var stat2 = fn.body[i]; if (!(stat2 instanceof AST_Var)) continue; for (var j = 0, defs = stat2.definitions.length; j < defs; j++) { var var_def = stat2.definitions[j]; var name = var_def.name; append_var(decls, expressions, name, var_def.value); if (in_loop && fn.argnames.every((argname) => argname.name != name.name)) { var def = fn.variables.get(name.name); var sym = make_node(AST_SymbolRef, name, name); def.references.push(sym); expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { operator: "=", logical: false, left: sym, right: make_node(AST_Undefined, name) })); } } } } function flatten_fn(returned_value) { var decls = []; var expressions = []; flatten_args(decls, expressions); flatten_vars(decls, expressions); expressions.push(returned_value); if (decls.length) { const i = scope.body.indexOf(compressor.parent(level - 1)) + 1; scope.body.splice(i, 0, make_node(AST_Var, fn, { definitions: decls })); } return expressions.map((exp2) => exp2.clone(true)); } } (function(def_find_defs) { function to_node(value, orig) { if (value instanceof AST_Node) { if (!(value instanceof AST_Constant)) { value = value.clone(true); } return make_node(value.CTOR, orig, value); } if (Array.isArray(value)) return make_node(AST_Array, orig, { elements: value.map(function(value2) { return to_node(value2, orig); }) }); if (value && typeof value == "object") { var props = []; for (var key in value) if (HOP(value, key)) { props.push(make_node(AST_ObjectKeyVal, orig, { key, value: to_node(value[key], orig) })); } return make_node(AST_Object, orig, { properties: props }); } return make_node_from_constant(value, orig); } AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { if (!compressor.option("global_defs")) return this; this.figure_out_scope({ ie8: compressor.option("ie8") }); return this.transform(new TreeTransformer(function(node) { var def = node._find_defs(compressor, ""); if (!def) return; var level = 0, child = node, parent; while (parent = this.parent(level++)) { if (!(parent instanceof AST_PropAccess)) break; if (parent.expression !== child) break; child = parent; } if (is_lhs(child, parent)) { return; } return def; })); }); def_find_defs(AST_Node, noop); def_find_defs(AST_Chain, function(compressor, suffix) { return this.expression._find_defs(compressor, suffix); }); def_find_defs(AST_Dot, function(compressor, suffix) { return this.expression._find_defs(compressor, "." + this.property + suffix); }); def_find_defs(AST_SymbolDeclaration, function() { if (!this.global()) return; }); def_find_defs(AST_SymbolRef, function(compressor, suffix) { if (!this.global()) return; var defines = compressor.option("global_defs"); var name = this.name + suffix; if (HOP(defines, name)) return to_node(defines[name], this); }); def_find_defs(AST_ImportMeta, function(compressor, suffix) { var defines = compressor.option("global_defs"); var name = "import.meta" + suffix; if (HOP(defines, name)) return to_node(defines[name], this); }); })(function(node, func) { node.DEFMETHOD("_find_defs", func); }); class Compressor extends TreeWalker { constructor(options, { false_by_default = false, mangle_options: mangle_options2 = false }) { super(); if (options.defaults !== void 0 && !options.defaults) false_by_default = true; this.options = defaults(options, { arguments: false, arrows: !false_by_default, booleans: !false_by_default, booleans_as_integers: false, collapse_vars: !false_by_default, comparisons: !false_by_default, computed_props: !false_by_default, conditionals: !false_by_default, dead_code: !false_by_default, defaults: true, directives: !false_by_default, drop_console: false, drop_debugger: !false_by_default, ecma: 5, evaluate: !false_by_default, expression: false, global_defs: false, hoist_funs: false, hoist_props: !false_by_default, hoist_vars: false, ie8: false, if_return: !false_by_default, inline: !false_by_default, join_vars: !false_by_default, keep_classnames: false, keep_fargs: true, keep_fnames: false, keep_infinity: false, lhs_constants: !false_by_default, loops: !false_by_default, module: false, negate_iife: !false_by_default, passes: 1, properties: !false_by_default, pure_getters: !false_by_default && "strict", pure_funcs: null, pure_new: false, reduce_funcs: !false_by_default, reduce_vars: !false_by_default, sequences: !false_by_default, side_effects: !false_by_default, switches: !false_by_default, top_retain: null, toplevel: !!(options && options["top_retain"]), typeofs: !false_by_default, unsafe: false, unsafe_arrows: false, unsafe_comps: false, unsafe_Function: false, unsafe_math: false, unsafe_symbols: false, unsafe_methods: false, unsafe_proto: false, unsafe_regexp: false, unsafe_undefined: false, unused: !false_by_default, warnings: false }, true); var global_defs = this.options["global_defs"]; if (typeof global_defs == "object") for (var key in global_defs) { if (key[0] === "@" && HOP(global_defs, key)) { global_defs[key.slice(1)] = parse(global_defs[key], { expression: true }); } } if (this.options["inline"] === true) this.options["inline"] = 3; var pure_funcs = this.options["pure_funcs"]; if (typeof pure_funcs == "function") { this.pure_funcs = pure_funcs; } else { this.pure_funcs = pure_funcs ? function(node) { return !pure_funcs.includes(node.expression.print_to_string()); } : return_true; } var top_retain = this.options["top_retain"]; if (top_retain instanceof RegExp) { this.top_retain = function(def) { return top_retain.test(def.name); }; } else if (typeof top_retain == "function") { this.top_retain = top_retain; } else if (top_retain) { if (typeof top_retain == "string") { top_retain = top_retain.split(/,/); } this.top_retain = function(def) { return top_retain.includes(def.name); }; } if (this.options["module"]) { this.directives["use strict"] = true; this.options["toplevel"] = true; } var toplevel = this.options["toplevel"]; this.toplevel = typeof toplevel == "string" ? { funcs: /funcs/.test(toplevel), vars: /vars/.test(toplevel) } : { funcs: toplevel, vars: toplevel }; var sequences = this.options["sequences"]; this.sequences_limit = sequences == 1 ? 800 : sequences | 0; this.evaluated_regexps = /* @__PURE__ */ new Map(); this._toplevel = void 0; this._mangle_options = mangle_options2 ? format_mangler_options(mangle_options2) : mangle_options2; } mangle_options() { var nth_identifier = this._mangle_options && this._mangle_options.nth_identifier || base54; var module3 = this._mangle_options && this._mangle_options.module || this.option("module"); return { ie8: this.option("ie8"), nth_identifier, module: module3 }; } option(key) { return this.options[key]; } exposed(def) { if (def.export) return true; if (def.global) { for (var i = 0, len = def.orig.length; i < len; i++) if (!this.toplevel[def.orig[i] instanceof AST_SymbolDefun ? "funcs" : "vars"]) return true; } return false; } in_boolean_context() { if (!this.option("booleans")) return false; var self2 = this.self(); for (var i = 0, p; p = this.parent(i); i++) { if (p instanceof AST_SimpleStatement || p instanceof AST_Conditional && p.condition === self2 || p instanceof AST_DWLoop && p.condition === self2 || p instanceof AST_For && p.condition === self2 || p instanceof AST_If && p.condition === self2 || p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self2) { return true; } if (p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||" || p.operator == "??") || p instanceof AST_Conditional || p.tail_node() === self2) { self2 = p; } else { return false; } } } get_toplevel() { return this._toplevel; } compress(toplevel) { toplevel = toplevel.resolve_defines(this); this._toplevel = toplevel; if (this.option("expression")) { this._toplevel.process_expression(true); } var passes = +this.options.passes || 1; var min_count = 1 / 0; var stopping = false; var mangle = this.mangle_options(); for (var pass = 0; pass < passes; pass++) { this._toplevel.figure_out_scope(mangle); if (pass === 0 && this.option("drop_console")) { this._toplevel = this._toplevel.drop_console(this.option("drop_console")); } if (pass > 0 || this.option("reduce_vars")) { this._toplevel.reset_opt_flags(this); } this._toplevel = this._toplevel.transform(this); if (passes > 1) { let count = 0; walk(this._toplevel, () => { count++; }); if (count < min_count) { min_count = count; stopping = false; } else if (stopping) { break; } else { stopping = true; } } } if (this.option("expression")) { this._toplevel.process_expression(false); } toplevel = this._toplevel; this._toplevel = void 0; return toplevel; } before(node, descend) { if (has_flag(node, SQUEEZED)) return node; var was_scope = false; if (node instanceof AST_Scope) { node = node.hoist_properties(this); node = node.hoist_declarations(this); was_scope = true; } descend(node, this); descend(node, this); var opt = node.optimize(this); if (was_scope && opt instanceof AST_Scope) { opt.drop_unused(this); descend(opt, this); } if (opt === node) set_flag(opt, SQUEEZED); return opt; } is_lhs() { const self2 = this.stack[this.stack.length - 1]; const parent = this.stack[this.stack.length - 2]; return is_lhs(self2, parent); } } function def_optimize(node, optimizer) { node.DEFMETHOD("optimize", function(compressor) { var self2 = this; if (has_flag(self2, OPTIMIZED)) return self2; if (compressor.has_directive("use asm")) return self2; var opt = optimizer(self2, compressor); set_flag(opt, OPTIMIZED); return opt; }); } def_optimize(AST_Node, function(self2) { return self2; }); AST_Toplevel.DEFMETHOD("drop_console", function(options) { var isArray = Array.isArray(options); return this.transform(new TreeTransformer(function(self2) { if (self2.TYPE !== "Call") { return; } var exp = self2.expression; if (!(exp instanceof AST_PropAccess)) { return; } if (isArray && options.indexOf(exp.property) === -1) { return; } var name = exp.expression; while (name.expression) { name = name.expression; } if (is_undeclared_ref(name) && name.name == "console") { return make_node(AST_Undefined, self2); } })); }); AST_Node.DEFMETHOD("equivalent_to", function(node) { return equivalent_to(this, node); }); AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { var self2 = this; var tt = new TreeTransformer(function(node) { if (insert && node instanceof AST_SimpleStatement) { return make_node(AST_Return, node, { value: node.body }); } if (!insert && node instanceof AST_Return) { if (compressor) { var value = node.value && node.value.drop_side_effect_free(compressor, true); return value ? make_node(AST_SimpleStatement, node, { body: value }) : make_node(AST_EmptyStatement, node); } return make_node(AST_SimpleStatement, node, { body: node.value || make_node(AST_UnaryPrefix, node, { operator: "void", expression: make_node(AST_Number, node, { value: 0 }) }) }); } if (node instanceof AST_Class || node instanceof AST_Lambda && node !== self2) { return node; } if (node instanceof AST_Block) { var index = node.body.length - 1; if (index >= 0) { node.body[index] = node.body[index].transform(tt); } } else if (node instanceof AST_If) { node.body = node.body.transform(tt); if (node.alternative) { node.alternative = node.alternative.transform(tt); } } else if (node instanceof AST_With) { node.body = node.body.transform(tt); } return node; }); self2.transform(tt); }); AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { const self2 = this; const reduce_vars = compressor.option("reduce_vars"); const preparation = new TreeWalker(function(node, descend) { clear_flag(node, CLEAR_BETWEEN_PASSES); if (reduce_vars) { if (compressor.top_retain && node instanceof AST_Defun && preparation.parent() === self2) { set_flag(node, TOP); } return node.reduce_vars(preparation, descend, compressor); } }); preparation.safe_ids = /* @__PURE__ */ Object.create(null); preparation.in_loop = null; preparation.loop_ids = /* @__PURE__ */ new Map(); preparation.defs_to_safe_ids = /* @__PURE__ */ new Map(); self2.walk(preparation); }); AST_Symbol.DEFMETHOD("fixed_value", function() { var fixed = this.thedef.fixed; if (!fixed || fixed instanceof AST_Node) return fixed; return fixed(); }); AST_SymbolRef.DEFMETHOD("is_immutable", function() { var orig = this.definition().orig; return orig.length == 1 && orig[0] instanceof AST_SymbolLambda; }); function find_variable(compressor, name) { var scope, i = 0; while (scope = compressor.parent(i++)) { if (scope instanceof AST_Scope) break; if (scope instanceof AST_Catch && scope.argname) { scope = scope.argname.definition().scope; break; } } return scope.find_variable(name); } var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError"); AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { return !this.definition().undeclared || compressor.option("unsafe") && global_names.has(this.name); }); var directives = /* @__PURE__ */ new Set(["use asm", "use strict"]); def_optimize(AST_Directive, function(self2, compressor) { if (compressor.option("directives") && (!directives.has(self2.value) || compressor.has_directive(self2.value) !== self2)) { return make_node(AST_EmptyStatement, self2); } return self2; }); def_optimize(AST_Debugger, function(self2, compressor) { if (compressor.option("drop_debugger")) return make_node(AST_EmptyStatement, self2); return self2; }); def_optimize(AST_LabeledStatement, function(self2, compressor) { if (self2.body instanceof AST_Break && compressor.loopcontrol_target(self2.body) === self2.body) { return make_node(AST_EmptyStatement, self2); } return self2.label.references.length == 0 ? self2.body : self2; }); def_optimize(AST_Block, function(self2, compressor) { tighten_body(self2.body, compressor); return self2; }); function can_be_extracted_from_if_block(node) { return !(node instanceof AST_Const || node instanceof AST_Let || node instanceof AST_Class); } def_optimize(AST_BlockStatement, function(self2, compressor) { tighten_body(self2.body, compressor); switch (self2.body.length) { case 1: if (!compressor.has_directive("use strict") && compressor.parent() instanceof AST_If && can_be_extracted_from_if_block(self2.body[0]) || can_be_evicted_from_block(self2.body[0])) { return self2.body[0]; } break; case 0: return make_node(AST_EmptyStatement, self2); } return self2; }); function opt_AST_Lambda(self2, compressor) { tighten_body(self2.body, compressor); if (compressor.option("side_effects") && self2.body.length == 1 && self2.body[0] === compressor.has_directive("use strict")) { self2.body.length = 0; } return self2; } def_optimize(AST_Lambda, opt_AST_Lambda); AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { var self2 = this; if (compressor.has_directive("use asm")) return self2; var hoist_funs = compressor.option("hoist_funs"); var hoist_vars = compressor.option("hoist_vars"); if (hoist_funs || hoist_vars) { var dirs = []; var hoisted = []; var vars = /* @__PURE__ */ new Map(), vars_found = 0, var_decl = 0; walk(self2, (node) => { if (node instanceof AST_Scope && node !== self2) return true; if (node instanceof AST_Var) { ++var_decl; return true; } }); hoist_vars = hoist_vars && var_decl > 1; var tt = new TreeTransformer(function before(node) { if (node !== self2) { if (node instanceof AST_Directive) { dirs.push(node); return make_node(AST_EmptyStatement, node); } if (hoist_funs && node instanceof AST_Defun && !(tt.parent() instanceof AST_Export) && tt.parent() === self2) { hoisted.push(node); return make_node(AST_EmptyStatement, node); } if (hoist_vars && node instanceof AST_Var && !node.definitions.some((def3) => def3.name instanceof AST_Destructuring)) { node.definitions.forEach(function(def3) { vars.set(def3.name.name, def3); ++vars_found; }); var seq = node.to_assignments(compressor); var p = tt.parent(); if (p instanceof AST_ForIn && p.init === node) { if (seq == null) { var def2 = node.definitions[0].name; return make_node(AST_SymbolRef, def2, def2); } return seq; } if (p instanceof AST_For && p.init === node) { return seq; } if (!seq) return make_node(AST_EmptyStatement, node); return make_node(AST_SimpleStatement, node, { body: seq }); } if (node instanceof AST_Scope) return node; } }); self2 = self2.transform(tt); if (vars_found > 0) { var defs = []; const is_lambda = self2 instanceof AST_Lambda; const args_as_names = is_lambda ? self2.args_as_names() : null; vars.forEach((def2, name) => { if (is_lambda && args_as_names.some((x) => x.name === def2.name.name)) { vars.delete(name); } else { def2 = def2.clone(); def2.value = null; defs.push(def2); vars.set(name, def2); } }); if (defs.length > 0) { for (var i = 0; i < self2.body.length; ) { if (self2.body[i] instanceof AST_SimpleStatement) { var expr = self2.body[i].body, sym, assign; if (expr instanceof AST_Assign && expr.operator == "=" && (sym = expr.left) instanceof AST_Symbol && vars.has(sym.name)) { var def = vars.get(sym.name); if (def.value) break; def.value = expr.right; remove2(defs, def); defs.push(def); self2.body.splice(i, 1); continue; } if (expr instanceof AST_Sequence && (assign = expr.expressions[0]) instanceof AST_Assign && assign.operator == "=" && (sym = assign.left) instanceof AST_Symbol && vars.has(sym.name)) { var def = vars.get(sym.name); if (def.value) break; def.value = assign.right; remove2(defs, def); defs.push(def); self2.body[i].body = make_sequence(expr, expr.expressions.slice(1)); continue; } } if (self2.body[i] instanceof AST_EmptyStatement) { self2.body.splice(i, 1); continue; } if (self2.body[i] instanceof AST_BlockStatement) { self2.body.splice(i, 1, ...self2.body[i].body); continue; } break; } defs = make_node(AST_Var, self2, { definitions: defs }); hoisted.push(defs); } } self2.body = dirs.concat(hoisted, self2.body); } return self2; }); AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { var self2 = this; if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return self2; var top_retain = self2 instanceof AST_Toplevel && compressor.top_retain || return_false; var defs_by_id = /* @__PURE__ */ new Map(); var hoister = new TreeTransformer(function(node, descend) { if (node instanceof AST_VarDef) { const sym = node.name; let def; let value; if (sym.scope === self2 && (def = sym.definition()).escaped != 1 && !def.assignments && !def.direct_access && !def.single_use && !compressor.exposed(def) && !top_retain(def) && (value = sym.fixed_value()) === node.value && value instanceof AST_Object && !value.properties.some((prop) => prop instanceof AST_Expansion || prop.computed_key())) { descend(node, this); const defs = /* @__PURE__ */ new Map(); const assignments = []; value.properties.forEach(({ key, value: value2 }) => { const scope = hoister.find_scope(); const symbol = self2.create_symbol(sym.CTOR, { source: sym, scope, conflict_scopes: /* @__PURE__ */ new Set([ scope, ...sym.definition().references.map((ref) => ref.scope) ]), tentative_name: sym.name + "_" + key }); defs.set(String(key), symbol.definition()); assignments.push(make_node(AST_VarDef, node, { name: symbol, value: value2 })); }); defs_by_id.set(def.id, defs); return MAP.splice(assignments); } } else if (node instanceof AST_PropAccess && node.expression instanceof AST_SymbolRef) { const defs = defs_by_id.get(node.expression.definition().id); if (defs) { const def = defs.get(String(get_simple_key(node.property))); const sym = make_node(AST_SymbolRef, node, { name: def.name, scope: node.expression.scope, thedef: def }); sym.reference({}); return sym; } } }); return self2.transform(hoister); }); def_optimize(AST_SimpleStatement, function(self2, compressor) { if (compressor.option("side_effects")) { var body = self2.body; var node = body.drop_side_effect_free(compressor, true); if (!node) { return make_node(AST_EmptyStatement, self2); } if (node !== body) { return make_node(AST_SimpleStatement, self2, { body: node }); } } return self2; }); def_optimize(AST_While, function(self2, compressor) { return compressor.option("loops") ? make_node(AST_For, self2, self2).optimize(compressor) : self2; }); def_optimize(AST_Do, function(self2, compressor) { if (!compressor.option("loops")) return self2; var cond = self2.condition.tail_node().evaluate(compressor); if (!(cond instanceof AST_Node)) { if (cond) return make_node(AST_For, self2, { body: make_node(AST_BlockStatement, self2.body, { body: [ self2.body, make_node(AST_SimpleStatement, self2.condition, { body: self2.condition }) ] }) }).optimize(compressor); if (!has_break_or_continue(self2, compressor.parent())) { return make_node(AST_BlockStatement, self2.body, { body: [ self2.body, make_node(AST_SimpleStatement, self2.condition, { body: self2.condition }) ] }).optimize(compressor); } } return self2; }); function if_break_in_loop(self2, compressor) { var first = self2.body instanceof AST_BlockStatement ? self2.body.body[0] : self2.body; if (compressor.option("dead_code") && is_break(first)) { var body = []; if (self2.init instanceof AST_Statement) { body.push(self2.init); } else if (self2.init) { body.push(make_node(AST_SimpleStatement, self2.init, { body: self2.init })); } if (self2.condition) { body.push(make_node(AST_SimpleStatement, self2.condition, { body: self2.condition })); } trim_unreachable_code(compressor, self2.body, body); return make_node(AST_BlockStatement, self2, { body }); } if (first instanceof AST_If) { if (is_break(first.body)) { if (self2.condition) { self2.condition = make_node(AST_Binary, self2.condition, { left: self2.condition, operator: "&&", right: first.condition.negate(compressor) }); } else { self2.condition = first.condition.negate(compressor); } drop_it(first.alternative); } else if (is_break(first.alternative)) { if (self2.condition) { self2.condition = make_node(AST_Binary, self2.condition, { left: self2.condition, operator: "&&", right: first.condition }); } else { self2.condition = first.condition; } drop_it(first.body); } } return self2; function is_break(node) { return node instanceof AST_Break && compressor.loopcontrol_target(node) === compressor.self(); } function drop_it(rest) { rest = as_statement_array(rest); if (self2.body instanceof AST_BlockStatement) { self2.body = self2.body.clone(); self2.body.body = rest.concat(self2.body.body.slice(1)); self2.body = self2.body.transform(compressor); } else { self2.body = make_node(AST_BlockStatement, self2.body, { body: rest }).transform(compressor); } self2 = if_break_in_loop(self2, compressor); } } def_optimize(AST_For, function(self2, compressor) { if (!compressor.option("loops")) return self2; if (compressor.option("side_effects") && self2.init) { self2.init = self2.init.drop_side_effect_free(compressor); } if (self2.condition) { var cond = self2.condition.evaluate(compressor); if (!(cond instanceof AST_Node)) { if (cond) self2.condition = null; else if (!compressor.option("dead_code")) { var orig = self2.condition; self2.condition = make_node_from_constant(cond, self2.condition); self2.condition = best_of_expression(self2.condition.transform(compressor), orig); } } if (compressor.option("dead_code")) { if (cond instanceof AST_Node) cond = self2.condition.tail_node().evaluate(compressor); if (!cond) { var body = []; trim_unreachable_code(compressor, self2.body, body); if (self2.init instanceof AST_Statement) { body.push(self2.init); } else if (self2.init) { body.push(make_node(AST_SimpleStatement, self2.init, { body: self2.init })); } body.push(make_node(AST_SimpleStatement, self2.condition, { body: self2.condition })); return make_node(AST_BlockStatement, self2, { body }).optimize(compressor); } } } return if_break_in_loop(self2, compressor); }); def_optimize(AST_If, function(self2, compressor) { if (is_empty(self2.alternative)) self2.alternative = null; if (!compressor.option("conditionals")) return self2; var cond = self2.condition.evaluate(compressor); if (!compressor.option("dead_code") && !(cond instanceof AST_Node)) { var orig = self2.condition; self2.condition = make_node_from_constant(cond, orig); self2.condition = best_of_expression(self2.condition.transform(compressor), orig); } if (compressor.option("dead_code")) { if (cond instanceof AST_Node) cond = self2.condition.tail_node().evaluate(compressor); if (!cond) { var body = []; trim_unreachable_code(compressor, self2.body, body); body.push(make_node(AST_SimpleStatement, self2.condition, { body: self2.condition })); if (self2.alternative) body.push(self2.alternative); return make_node(AST_BlockStatement, self2, { body }).optimize(compressor); } else if (!(cond instanceof AST_Node)) { var body = []; body.push(make_node(AST_SimpleStatement, self2.condition, { body: self2.condition })); body.push(self2.body); if (self2.alternative) { trim_unreachable_code(compressor, self2.alternative, body); } return make_node(AST_BlockStatement, self2, { body }).optimize(compressor); } } var negated = self2.condition.negate(compressor); var self_condition_length = self2.condition.size(); var negated_length = negated.size(); var negated_is_best = negated_length < self_condition_length; if (self2.alternative && negated_is_best) { negated_is_best = false; self2.condition = negated; var tmp = self2.body; self2.body = self2.alternative || make_node(AST_EmptyStatement, self2); self2.alternative = tmp; } if (is_empty(self2.body) && is_empty(self2.alternative)) { return make_node(AST_SimpleStatement, self2.condition, { body: self2.condition.clone() }).optimize(compressor); } if (self2.body instanceof AST_SimpleStatement && self2.alternative instanceof AST_SimpleStatement) { return make_node(AST_SimpleStatement, self2, { body: make_node(AST_Conditional, self2, { condition: self2.condition, consequent: self2.body.body, alternative: self2.alternative.body }) }).optimize(compressor); } if (is_empty(self2.alternative) && self2.body instanceof AST_SimpleStatement) { if (self_condition_length === negated_length && !negated_is_best && self2.condition instanceof AST_Binary && self2.condition.operator == "||") { negated_is_best = true; } if (negated_is_best) return make_node(AST_SimpleStatement, self2, { body: make_node(AST_Binary, self2, { operator: "||", left: negated, right: self2.body.body }) }).optimize(compressor); return make_node(AST_SimpleStatement, self2, { body: make_node(AST_Binary, self2, { operator: "&&", left: self2.condition, right: self2.body.body }) }).optimize(compressor); } if (self2.body instanceof AST_EmptyStatement && self2.alternative instanceof AST_SimpleStatement) { return make_node(AST_SimpleStatement, self2, { body: make_node(AST_Binary, self2, { operator: "||", left: self2.condition, right: self2.alternative.body }) }).optimize(compressor); } if (self2.body instanceof AST_Exit && self2.alternative instanceof AST_Exit && self2.body.TYPE == self2.alternative.TYPE) { return make_node(self2.body.CTOR, self2, { value: make_node(AST_Conditional, self2, { condition: self2.condition, consequent: self2.body.value || make_node(AST_Undefined, self2.body), alternative: self2.alternative.value || make_node(AST_Undefined, self2.alternative) }).transform(compressor) }).optimize(compressor); } if (self2.body instanceof AST_If && !self2.body.alternative && !self2.alternative) { self2 = make_node(AST_If, self2, { condition: make_node(AST_Binary, self2.condition, { operator: "&&", left: self2.condition, right: self2.body.condition }), body: self2.body.body, alternative: null }); } if (aborts(self2.body)) { if (self2.alternative) { var alt = self2.alternative; self2.alternative = null; return make_node(AST_BlockStatement, self2, { body: [self2, alt] }).optimize(compressor); } } if (aborts(self2.alternative)) { var body = self2.body; self2.body = self2.alternative; self2.condition = negated_is_best ? negated : self2.condition.negate(compressor); self2.alternative = null; return make_node(AST_BlockStatement, self2, { body: [self2, body] }).optimize(compressor); } return self2; }); def_optimize(AST_Switch, function(self2, compressor) { if (!compressor.option("switches")) return self2; var branch; var value = self2.expression.evaluate(compressor); if (!(value instanceof AST_Node)) { var orig = self2.expression; self2.expression = make_node_from_constant(value, orig); self2.expression = best_of_expression(self2.expression.transform(compressor), orig); } if (!compressor.option("dead_code")) return self2; if (value instanceof AST_Node) { value = self2.expression.tail_node().evaluate(compressor); } var decl = []; var body = []; var default_branch; var exact_match; for (var i = 0, len = self2.body.length; i < len && !exact_match; i++) { branch = self2.body[i]; if (branch instanceof AST_Default) { if (!default_branch) { default_branch = branch; } else { eliminate_branch(branch, body[body.length - 1]); } } else if (!(value instanceof AST_Node)) { var exp = branch.expression.evaluate(compressor); if (!(exp instanceof AST_Node) && exp !== value) { eliminate_branch(branch, body[body.length - 1]); continue; } if (exp instanceof AST_Node) exp = branch.expression.tail_node().evaluate(compressor); if (exp === value) { exact_match = branch; if (default_branch) { var default_index = body.indexOf(default_branch); body.splice(default_index, 1); eliminate_branch(default_branch, body[default_index - 1]); default_branch = null; } } } body.push(branch); } while (i < len) eliminate_branch(self2.body[i++], body[body.length - 1]); self2.body = body; let default_or_exact = default_branch || exact_match; default_branch = null; exact_match = null; if (body.every((branch2, i2) => (branch2 === default_or_exact || branch2.expression instanceof AST_Constant) && (branch2.body.length === 0 || aborts(branch2) || body.length - 1 === i2))) { for (let i2 = 0; i2 < body.length; i2++) { const branch2 = body[i2]; for (let j = i2 + 1; j < body.length; j++) { const next = body[j]; if (next.body.length === 0) continue; const last_branch = j === body.length - 1; const equivalentBranch = branches_equivalent(next, branch2, false); if (equivalentBranch || last_branch && branches_equivalent(next, branch2, true)) { if (!equivalentBranch && last_branch) { next.body.push(make_node(AST_Break)); } let x = j - 1; let fallthroughDepth = 0; while (x > i2) { if (is_inert_body(body[x--])) { fallthroughDepth++; } else { break; } } const plucked = body.splice(j - fallthroughDepth, 1 + fallthroughDepth); body.splice(i2 + 1, 0, ...plucked); i2 += plucked.length; } } } } for (let i2 = 0; i2 < body.length; i2++) { let branch2 = body[i2]; if (branch2.body.length === 0) continue; if (!aborts(branch2)) continue; for (let j = i2 + 1; j < body.length; i2++, j++) { let next = body[j]; if (next.body.length === 0) continue; if (branches_equivalent(next, branch2, false) || j === body.length - 1 && branches_equivalent(next, branch2, true)) { branch2.body = []; branch2 = next; continue; } break; } } { let i2 = body.length - 1; for (; i2 >= 0; i2--) { let bbody = body[i2].body; if (is_break(bbody[bbody.length - 1], compressor)) bbody.pop(); if (!is_inert_body(body[i2])) break; } i2++; if (!default_or_exact || body.indexOf(default_or_exact) >= i2) { for (let j = body.length - 1; j >= i2; j--) { let branch2 = body[j]; if (branch2 === default_or_exact) { default_or_exact = null; body.pop(); } else if (!branch2.expression.has_side_effects(compressor)) { body.pop(); } else { break; } } } } DEFAULT: if (default_or_exact) { let default_index2 = body.indexOf(default_or_exact); let default_body_index = default_index2; for (; default_body_index < body.length - 1; default_body_index++) { if (!is_inert_body(body[default_body_index])) break; } if (default_body_index < body.length - 1) { break DEFAULT; } let side_effect_index = body.length - 1; for (; side_effect_index >= 0; side_effect_index--) { let branch2 = body[side_effect_index]; if (branch2 === default_or_exact) continue; if (branch2.expression.has_side_effects(compressor)) break; } if (default_body_index > side_effect_index) { let prev_body_index = default_index2 - 1; for (; prev_body_index >= 0; prev_body_index--) { if (!is_inert_body(body[prev_body_index])) break; } let before = Math.max(side_effect_index, prev_body_index) + 1; let after = default_index2; if (side_effect_index > default_index2) { after = side_effect_index; body[side_effect_index].body = body[default_body_index].body; } else { default_or_exact.body = body[default_body_index].body; } body.splice(after + 1, default_body_index - after); body.splice(before, default_index2 - before); } } DEFAULT: if (default_or_exact) { let i2 = body.findIndex((branch2) => !is_inert_body(branch2)); let caseBody; if (i2 === body.length - 1) { let branch2 = body[i2]; if (has_nested_break(self2)) break DEFAULT; caseBody = make_node(AST_BlockStatement, branch2, { body: branch2.body }); branch2.body = []; } else if (i2 !== -1) { break DEFAULT; } let sideEffect = body.find((branch2) => { return branch2 !== default_or_exact && branch2.expression.has_side_effects(compressor); }); if (!sideEffect) { return make_node(AST_BlockStatement, self2, { body: decl.concat(statement(self2.expression), default_or_exact.expression ? statement(default_or_exact.expression) : [], caseBody || []) }).optimize(compressor); } const default_index2 = body.indexOf(default_or_exact); body.splice(default_index2, 1); default_or_exact = null; if (caseBody) { return make_node(AST_BlockStatement, self2, { body: decl.concat(self2, caseBody) }).optimize(compressor); } } if (body.length > 0) { body[0].body = decl.concat(body[0].body); } if (body.length == 0) { return make_node(AST_BlockStatement, self2, { body: decl.concat(statement(self2.expression)) }).optimize(compressor); } if (body.length == 1 && !has_nested_break(self2)) { let branch2 = body[0]; return make_node(AST_If, self2, { condition: make_node(AST_Binary, self2, { operator: "===", left: self2.expression, right: branch2.expression }), body: make_node(AST_BlockStatement, branch2, { body: branch2.body }), alternative: null }).optimize(compressor); } if (body.length === 2 && default_or_exact && !has_nested_break(self2)) { let branch2 = body[0] === default_or_exact ? body[1] : body[0]; let exact_exp = default_or_exact.expression && statement(default_or_exact.expression); if (aborts(body[0])) { let first = body[0]; if (is_break(first.body[first.body.length - 1], compressor)) { first.body.pop(); } return make_node(AST_If, self2, { condition: make_node(AST_Binary, self2, { operator: "===", left: self2.expression, right: branch2.expression }), body: make_node(AST_BlockStatement, branch2, { body: branch2.body }), alternative: make_node(AST_BlockStatement, default_or_exact, { body: [].concat(exact_exp || [], default_or_exact.body) }) }).optimize(compressor); } let operator = "==="; let consequent = make_node(AST_BlockStatement, branch2, { body: branch2.body }); let always = make_node(AST_BlockStatement, default_or_exact, { body: [].concat(exact_exp || [], default_or_exact.body) }); if (body[0] === default_or_exact) { operator = "!=="; let tmp = always; always = consequent; consequent = tmp; } return make_node(AST_BlockStatement, self2, { body: [ make_node(AST_If, self2, { condition: make_node(AST_Binary, self2, { operator, left: self2.expression, right: branch2.expression }), body: consequent, alternative: null }) ].concat(always) }).optimize(compressor); } return self2; function eliminate_branch(branch2, prev) { if (prev && !aborts(prev)) { prev.body = prev.body.concat(branch2.body); } else { trim_unreachable_code(compressor, branch2, decl); } } function branches_equivalent(branch2, prev, insertBreak) { let bbody = branch2.body; let pbody = prev.body; if (insertBreak) { bbody = bbody.concat(make_node(AST_Break)); } if (bbody.length !== pbody.length) return false; let bblock = make_node(AST_BlockStatement, branch2, { body: bbody }); let pblock = make_node(AST_BlockStatement, prev, { body: pbody }); return bblock.equivalent_to(pblock); } function statement(expression) { return make_node(AST_SimpleStatement, expression, { body: expression }); } function has_nested_break(root) { let has_break = false; let tw = new TreeWalker((node) => { if (has_break) return true; if (node instanceof AST_Lambda) return true; if (node instanceof AST_SimpleStatement) return true; if (!is_break(node, tw)) return; let parent = tw.parent(); if (parent instanceof AST_SwitchBranch && parent.body[parent.body.length - 1] === node) { return; } has_break = true; }); root.walk(tw); return has_break; } function is_break(node, stack) { return node instanceof AST_Break && stack.loopcontrol_target(node) === self2; } function is_inert_body(branch2) { return !aborts(branch2) && !make_node(AST_BlockStatement, branch2, { body: branch2.body }).has_side_effects(compressor); } }); def_optimize(AST_Try, function(self2, compressor) { if (self2.bcatch && self2.bfinally && self2.bfinally.body.every(is_empty)) self2.bfinally = null; if (compressor.option("dead_code") && self2.body.body.every(is_empty)) { var body = []; if (self2.bcatch) { trim_unreachable_code(compressor, self2.bcatch, body); } if (self2.bfinally) body.push(...self2.bfinally.body); return make_node(AST_BlockStatement, self2, { body }).optimize(compressor); } return self2; }); AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { var reduce_vars = compressor.option("reduce_vars"); var assignments = []; for (const def of this.definitions) { if (def.value) { var name = make_node(AST_SymbolRef, def.name, def.name); assignments.push(make_node(AST_Assign, def, { operator: "=", logical: false, left: name, right: def.value })); if (reduce_vars) name.definition().fixed = false; } const thedef = def.name.definition(); thedef.eliminated++; thedef.replaced--; } if (assignments.length == 0) return null; return make_sequence(this, assignments); }); def_optimize(AST_Definitions, function(self2) { if (self2.definitions.length == 0) { return make_node(AST_EmptyStatement, self2); } return self2; }); def_optimize(AST_VarDef, function(self2, compressor) { if (self2.name instanceof AST_SymbolLet && self2.value != null && is_undefined(self2.value, compressor)) { self2.value = null; } return self2; }); def_optimize(AST_Import, function(self2) { return self2; }); def_optimize(AST_Call, function(self2, compressor) { var exp = self2.expression; var fn = exp; inline_array_like_spread(self2.args); var simple_args = self2.args.every((arg2) => !(arg2 instanceof AST_Expansion)); if (compressor.option("reduce_vars") && fn instanceof AST_SymbolRef) { fn = fn.fixed_value(); } var is_func = fn instanceof AST_Lambda; if (is_func && fn.pinned()) return self2; if (compressor.option("unused") && simple_args && is_func && !fn.uses_arguments) { var pos = 0, last2 = 0; for (var i = 0, len = self2.args.length; i < len; i++) { if (fn.argnames[i] instanceof AST_Expansion) { if (has_flag(fn.argnames[i].expression, UNUSED)) while (i < len) { var node = self2.args[i++].drop_side_effect_free(compressor); if (node) { self2.args[pos++] = node; } } else while (i < len) { self2.args[pos++] = self2.args[i++]; } last2 = pos; break; } var trim2 = i >= fn.argnames.length; if (trim2 || has_flag(fn.argnames[i], UNUSED)) { var node = self2.args[i].drop_side_effect_free(compressor); if (node) { self2.args[pos++] = node; } else if (!trim2) { self2.args[pos++] = make_node(AST_Number, self2.args[i], { value: 0 }); continue; } } else { self2.args[pos++] = self2.args[i]; } last2 = pos; } self2.args.length = last2; } if (compressor.option("unsafe") && !exp.contains_optional()) { if (exp instanceof AST_Dot && exp.start.value === "Array" && exp.property === "from" && self2.args.length === 1) { const [argument] = self2.args; if (argument instanceof AST_Array) { return make_node(AST_Array, argument, { elements: argument.elements }).optimize(compressor); } } if (is_undeclared_ref(exp)) switch (exp.name) { case "Array": if (self2.args.length != 1) { return make_node(AST_Array, self2, { elements: self2.args }).optimize(compressor); } else if (self2.args[0] instanceof AST_Number && self2.args[0].value <= 11) { const elements2 = []; for (let i2 = 0; i2 < self2.args[0].value; i2++) elements2.push(new AST_Hole()); return new AST_Array({ elements: elements2 }); } break; case "Object": if (self2.args.length == 0) { return make_node(AST_Object, self2, { properties: [] }); } break; case "String": if (self2.args.length == 0) return make_node(AST_String, self2, { value: "" }); if (self2.args.length <= 1) return make_node(AST_Binary, self2, { left: self2.args[0], operator: "+", right: make_node(AST_String, self2, { value: "" }) }).optimize(compressor); break; case "Number": if (self2.args.length == 0) return make_node(AST_Number, self2, { value: 0 }); if (self2.args.length == 1 && compressor.option("unsafe_math")) { return make_node(AST_UnaryPrefix, self2, { expression: self2.args[0], operator: "+" }).optimize(compressor); } break; case "Symbol": if (self2.args.length == 1 && self2.args[0] instanceof AST_String && compressor.option("unsafe_symbols")) self2.args.length = 0; break; case "Boolean": if (self2.args.length == 0) return make_node(AST_False, self2); if (self2.args.length == 1) return make_node(AST_UnaryPrefix, self2, { expression: make_node(AST_UnaryPrefix, self2, { expression: self2.args[0], operator: "!" }), operator: "!" }).optimize(compressor); break; case "RegExp": var params = []; if (self2.args.length >= 1 && self2.args.length <= 2 && self2.args.every((arg2) => { var value2 = arg2.evaluate(compressor); params.push(value2); return arg2 !== value2; }) && regexp_is_safe(params[0])) { let [source, flags] = params; source = regexp_source_fix(new RegExp(source).source); const rx = make_node(AST_RegExp, self2, { value: { source, flags } }); if (rx._eval(compressor) !== rx) { return rx; } } break; } else if (exp instanceof AST_Dot) switch (exp.property) { case "toString": if (self2.args.length == 0 && !exp.expression.may_throw_on_access(compressor)) { return make_node(AST_Binary, self2, { left: make_node(AST_String, self2, { value: "" }), operator: "+", right: exp.expression }).optimize(compressor); } break; case "join": if (exp.expression instanceof AST_Array) EXIT: { var separator; if (self2.args.length > 0) { separator = self2.args[0].evaluate(compressor); if (separator === self2.args[0]) break EXIT; } var elements = []; var consts = []; for (var i = 0, len = exp.expression.elements.length; i < len; i++) { var el = exp.expression.elements[i]; if (el instanceof AST_Expansion) break EXIT; var value = el.evaluate(compressor); if (value !== el) { consts.push(value); } else { if (consts.length > 0) { elements.push(make_node(AST_String, self2, { value: consts.join(separator) })); consts.length = 0; } elements.push(el); } } if (consts.length > 0) { elements.push(make_node(AST_String, self2, { value: consts.join(separator) })); } if (elements.length == 0) return make_node(AST_String, self2, { value: "" }); if (elements.length == 1) { if (elements[0].is_string(compressor)) { return elements[0]; } return make_node(AST_Binary, elements[0], { operator: "+", left: make_node(AST_String, self2, { value: "" }), right: elements[0] }); } if (separator == "") { var first; if (elements[0].is_string(compressor) || elements[1].is_string(compressor)) { first = elements.shift(); } else { first = make_node(AST_String, self2, { value: "" }); } return elements.reduce(function(prev, el2) { return make_node(AST_Binary, el2, { operator: "+", left: prev, right: el2 }); }, first).optimize(compressor); } var node = self2.clone(); node.expression = node.expression.clone(); node.expression.expression = node.expression.expression.clone(); node.expression.expression.elements = elements; return best_of(compressor, self2, node); } break; case "charAt": if (exp.expression.is_string(compressor)) { var arg = self2.args[0]; var index = arg ? arg.evaluate(compressor) : 0; if (index !== arg) { return make_node(AST_Sub, exp, { expression: exp.expression, property: make_node_from_constant(index | 0, arg || exp) }).optimize(compressor); } } break; case "apply": if (self2.args.length == 2 && self2.args[1] instanceof AST_Array) { var args = self2.args[1].elements.slice(); args.unshift(self2.args[0]); return make_node(AST_Call, self2, { expression: make_node(AST_Dot, exp, { expression: exp.expression, optional: false, property: "call" }), args }).optimize(compressor); } break; case "call": var func = exp.expression; if (func instanceof AST_SymbolRef) { func = func.fixed_value(); } if (func instanceof AST_Lambda && !func.contains_this()) { return (self2.args.length ? make_sequence(this, [ self2.args[0], make_node(AST_Call, self2, { expression: exp.expression, args: self2.args.slice(1) }) ]) : make_node(AST_Call, self2, { expression: exp.expression, args: [] })).optimize(compressor); } break; } } if (compressor.option("unsafe_Function") && is_undeclared_ref(exp) && exp.name == "Function") { if (self2.args.length == 0) return make_node(AST_Function, self2, { argnames: [], body: [] }).optimize(compressor); if (self2.args.every((x) => x instanceof AST_String)) { try { var code = "n(function(" + self2.args.slice(0, -1).map(function(arg2) { return arg2.value; }).join(",") + "){" + self2.args[self2.args.length - 1].value + "})"; var ast = parse(code); var mangle = compressor.mangle_options(); ast.figure_out_scope(mangle); var comp = new Compressor(compressor.options, { mangle_options: compressor._mangle_options }); ast = ast.transform(comp); ast.figure_out_scope(mangle); ast.compute_char_frequency(mangle); ast.mangle_names(mangle); var fun; walk(ast, (node2) => { if (is_func_expr(node2)) { fun = node2; return walk_abort; } }); var code = OutputStream(); AST_BlockStatement.prototype._codegen.call(fun, fun, code); self2.args = [ make_node(AST_String, self2, { value: fun.argnames.map(function(arg2) { return arg2.print_to_string(); }).join(",") }), make_node(AST_String, self2.args[self2.args.length - 1], { value: code.get().replace(/^{|}$/g, "") }) ]; return self2; } catch (ex) { if (!(ex instanceof JS_Parse_Error)) { throw ex; } } } } return inline_into_call(self2, compressor); }); AST_Node.DEFMETHOD("contains_optional", function() { if (this instanceof AST_PropAccess || this instanceof AST_Call || this instanceof AST_Chain) { if (this.optional) { return true; } else { return this.expression.contains_optional(); } } else { return false; } }); def_optimize(AST_New, function(self2, compressor) { if (compressor.option("unsafe") && is_undeclared_ref(self2.expression) && ["Object", "RegExp", "Function", "Error", "Array"].includes(self2.expression.name)) return make_node(AST_Call, self2, self2).transform(compressor); return self2; }); def_optimize(AST_Sequence, function(self2, compressor) { if (!compressor.option("side_effects")) return self2; var expressions = []; filter_for_side_effects(); var end = expressions.length - 1; trim_right_for_undefined(); if (end == 0) { self2 = maintain_this_binding(compressor.parent(), compressor.self(), expressions[0]); if (!(self2 instanceof AST_Sequence)) self2 = self2.optimize(compressor); return self2; } self2.expressions = expressions; return self2; function filter_for_side_effects() { var first = first_in_statement(compressor); var last2 = self2.expressions.length - 1; self2.expressions.forEach(function(expr, index) { if (index < last2) expr = expr.drop_side_effect_free(compressor, first); if (expr) { merge_sequence(expressions, expr); first = false; } }); } function trim_right_for_undefined() { while (end > 0 && is_undefined(expressions[end], compressor)) end--; if (end < expressions.length - 1) { expressions[end] = make_node(AST_UnaryPrefix, self2, { operator: "void", expression: expressions[end] }); expressions.length = end + 1; } } }); AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { if (compressor.option("sequences")) { if (this.expression instanceof AST_Sequence) { var x = this.expression.expressions.slice(); var e = this.clone(); e.expression = x.pop(); x.push(e); return make_sequence(this, x).optimize(compressor); } } return this; }); def_optimize(AST_UnaryPostfix, function(self2, compressor) { return self2.lift_sequences(compressor); }); def_optimize(AST_UnaryPrefix, function(self2, compressor) { var e = self2.expression; if (self2.operator == "delete" && !(e instanceof AST_SymbolRef || e instanceof AST_PropAccess || e instanceof AST_Chain || is_identifier_atom(e))) { return make_sequence(self2, [e, make_node(AST_True, self2)]).optimize(compressor); } var seq = self2.lift_sequences(compressor); if (seq !== self2) { return seq; } if (compressor.option("side_effects") && self2.operator == "void") { e = e.drop_side_effect_free(compressor); if (e) { self2.expression = e; return self2; } else { return make_node(AST_Undefined, self2).optimize(compressor); } } if (compressor.in_boolean_context()) { switch (self2.operator) { case "!": if (e instanceof AST_UnaryPrefix && e.operator == "!") { return e.expression; } if (e instanceof AST_Binary) { self2 = best_of(compressor, self2, e.negate(compressor, first_in_statement(compressor))); } break; case "typeof": return (e instanceof AST_SymbolRef ? make_node(AST_True, self2) : make_sequence(self2, [ e, make_node(AST_True, self2) ])).optimize(compressor); } } if (self2.operator == "-" && e instanceof AST_Infinity) { e = e.transform(compressor); } if (e instanceof AST_Binary && (self2.operator == "+" || self2.operator == "-") && (e.operator == "*" || e.operator == "/" || e.operator == "%")) { return make_node(AST_Binary, self2, { operator: e.operator, left: make_node(AST_UnaryPrefix, e.left, { operator: self2.operator, expression: e.left }), right: e.right }); } if (self2.operator != "-" || !(e instanceof AST_Number || e instanceof AST_Infinity || e instanceof AST_BigInt)) { var ev = self2.evaluate(compressor); if (ev !== self2) { ev = make_node_from_constant(ev, self2).optimize(compressor); return best_of(compressor, ev, self2); } } return self2; }); AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { if (compressor.option("sequences")) { if (this.left instanceof AST_Sequence) { var x = this.left.expressions.slice(); var e = this.clone(); e.left = x.pop(); x.push(e); return make_sequence(this, x).optimize(compressor); } if (this.right instanceof AST_Sequence && !this.left.has_side_effects(compressor)) { var assign = this.operator == "=" && this.left instanceof AST_SymbolRef; var x = this.right.expressions; var last2 = x.length - 1; for (var i = 0; i < last2; i++) { if (!assign && x[i].has_side_effects(compressor)) break; } if (i == last2) { x = x.slice(); var e = this.clone(); e.right = x.pop(); x.push(e); return make_sequence(this, x).optimize(compressor); } else if (i > 0) { var e = this.clone(); e.right = make_sequence(this.right, x.slice(i)); x = x.slice(0, i); x.push(e); return make_sequence(this, x).optimize(compressor); } } } return this; }); var commutativeOperators = makePredicate("== === != !== * & | ^"); function is_object(node) { return node instanceof AST_Array || node instanceof AST_Lambda || node instanceof AST_Object || node instanceof AST_Class; } def_optimize(AST_Binary, function(self2, compressor) { function reversible() { return self2.left.is_constant() || self2.right.is_constant() || !self2.left.has_side_effects(compressor) && !self2.right.has_side_effects(compressor); } function reverse(op) { if (reversible()) { if (op) self2.operator = op; var tmp = self2.left; self2.left = self2.right; self2.right = tmp; } } if (compressor.option("lhs_constants") && commutativeOperators.has(self2.operator)) { if (self2.right.is_constant() && !self2.left.is_constant()) { if (!(self2.left instanceof AST_Binary && PRECEDENCE[self2.left.operator] >= PRECEDENCE[self2.operator])) { reverse(); } } } self2 = self2.lift_sequences(compressor); if (compressor.option("comparisons")) switch (self2.operator) { case "===": case "!==": var is_strict_comparison = true; if (self2.left.is_string(compressor) && self2.right.is_string(compressor) || self2.left.is_number(compressor) && self2.right.is_number(compressor) || self2.left.is_boolean() && self2.right.is_boolean() || self2.left.equivalent_to(self2.right)) { self2.operator = self2.operator.substr(0, 2); } case "==": case "!=": if (!is_strict_comparison && is_undefined(self2.left, compressor)) { self2.left = make_node(AST_Null, self2.left); } else if (!is_strict_comparison && is_undefined(self2.right, compressor)) { self2.right = make_node(AST_Null, self2.right); } else if (compressor.option("typeofs") && self2.left instanceof AST_String && self2.left.value == "undefined" && self2.right instanceof AST_UnaryPrefix && self2.right.operator == "typeof") { var expr = self2.right.expression; if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { self2.right = expr; self2.left = make_node(AST_Undefined, self2.left).optimize(compressor); if (self2.operator.length == 2) self2.operator += "="; } } else if (compressor.option("typeofs") && self2.left instanceof AST_UnaryPrefix && self2.left.operator == "typeof" && self2.right instanceof AST_String && self2.right.value == "undefined") { var expr = self2.left.expression; if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { self2.left = expr; self2.right = make_node(AST_Undefined, self2.right).optimize(compressor); if (self2.operator.length == 2) self2.operator += "="; } } else if (self2.left instanceof AST_SymbolRef && self2.right instanceof AST_SymbolRef && self2.left.definition() === self2.right.definition() && is_object(self2.left.fixed_value())) { return make_node(self2.operator[0] == "=" ? AST_True : AST_False, self2); } break; case "&&": case "||": var lhs = self2.left; if (lhs.operator == self2.operator) { lhs = lhs.right; } if (lhs instanceof AST_Binary && lhs.operator == (self2.operator == "&&" ? "!==" : "===") && self2.right instanceof AST_Binary && lhs.operator == self2.right.operator && (is_undefined(lhs.left, compressor) && self2.right.left instanceof AST_Null || lhs.left instanceof AST_Null && is_undefined(self2.right.left, compressor)) && !lhs.right.has_side_effects(compressor) && lhs.right.equivalent_to(self2.right.right)) { var combined = make_node(AST_Binary, self2, { operator: lhs.operator.slice(0, -1), left: make_node(AST_Null, self2), right: lhs.right }); if (lhs !== self2.left) { combined = make_node(AST_Binary, self2, { operator: self2.operator, left: self2.left.left, right: combined }); } return combined; } break; } if (self2.operator == "+" && compressor.in_boolean_context()) { var ll = self2.left.evaluate(compressor); var rr = self2.right.evaluate(compressor); if (ll && typeof ll == "string") { return make_sequence(self2, [ self2.right, make_node(AST_True, self2) ]).optimize(compressor); } if (rr && typeof rr == "string") { return make_sequence(self2, [ self2.left, make_node(AST_True, self2) ]).optimize(compressor); } } if (compressor.option("comparisons") && self2.is_boolean()) { if (!(compressor.parent() instanceof AST_Binary) || compressor.parent() instanceof AST_Assign) { var negated = make_node(AST_UnaryPrefix, self2, { operator: "!", expression: self2.negate(compressor, first_in_statement(compressor)) }); self2 = best_of(compressor, self2, negated); } if (compressor.option("unsafe_comps")) { switch (self2.operator) { case "<": reverse(">"); break; case "<=": reverse(">="); break; } } } if (self2.operator == "+") { if (self2.right instanceof AST_String && self2.right.getValue() == "" && self2.left.is_string(compressor)) { return self2.left; } if (self2.left instanceof AST_String && self2.left.getValue() == "" && self2.right.is_string(compressor)) { return self2.right; } if (self2.left instanceof AST_Binary && self2.left.operator == "+" && self2.left.left instanceof AST_String && self2.left.left.getValue() == "" && self2.right.is_string(compressor)) { self2.left = self2.left.right; return self2; } } if (compressor.option("evaluate")) { switch (self2.operator) { case "&&": var ll = has_flag(self2.left, TRUTHY) ? true : has_flag(self2.left, FALSY) ? false : self2.left.evaluate(compressor); if (!ll) { return maintain_this_binding(compressor.parent(), compressor.self(), self2.left).optimize(compressor); } else if (!(ll instanceof AST_Node)) { return make_sequence(self2, [self2.left, self2.right]).optimize(compressor); } var rr = self2.right.evaluate(compressor); if (!rr) { if (compressor.in_boolean_context()) { return make_sequence(self2, [ self2.left, make_node(AST_False, self2) ]).optimize(compressor); } else { set_flag(self2, FALSY); } } else if (!(rr instanceof AST_Node)) { var parent = compressor.parent(); if (parent.operator == "&&" && parent.left === compressor.self() || compressor.in_boolean_context()) { return self2.left.optimize(compressor); } } if (self2.left.operator == "||") { var lr = self2.left.right.evaluate(compressor); if (!lr) return make_node(AST_Conditional, self2, { condition: self2.left.left, consequent: self2.right, alternative: self2.left.right }).optimize(compressor); } break; case "||": var ll = has_flag(self2.left, TRUTHY) ? true : has_flag(self2.left, FALSY) ? false : self2.left.evaluate(compressor); if (!ll) { return make_sequence(self2, [self2.left, self2.right]).optimize(compressor); } else if (!(ll instanceof AST_Node)) { return maintain_this_binding(compressor.parent(), compressor.self(), self2.left).optimize(compressor); } var rr = self2.right.evaluate(compressor); if (!rr) { var parent = compressor.parent(); if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { return self2.left.optimize(compressor); } } else if (!(rr instanceof AST_Node)) { if (compressor.in_boolean_context()) { return make_sequence(self2, [ self2.left, make_node(AST_True, self2) ]).optimize(compressor); } else { set_flag(self2, TRUTHY); } } if (self2.left.operator == "&&") { var lr = self2.left.right.evaluate(compressor); if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self2, { condition: self2.left.left, consequent: self2.left.right, alternative: self2.right }).optimize(compressor); } break; case "??": if (is_nullish(self2.left, compressor)) { return self2.right; } var ll = self2.left.evaluate(compressor); if (!(ll instanceof AST_Node)) { return ll == null ? self2.right : self2.left; } if (compressor.in_boolean_context()) { const rr2 = self2.right.evaluate(compressor); if (!(rr2 instanceof AST_Node) && !rr2) { return self2.left; } } } var associative = true; switch (self2.operator) { case "+": if (self2.right instanceof AST_Constant && self2.left instanceof AST_Binary && self2.left.operator == "+" && self2.left.is_string(compressor)) { var binary = make_node(AST_Binary, self2, { operator: "+", left: self2.left.right, right: self2.right }); var r = binary.optimize(compressor); if (binary !== r) { self2 = make_node(AST_Binary, self2, { operator: "+", left: self2.left.left, right: r }); } } if (self2.left instanceof AST_Binary && self2.left.operator == "+" && self2.left.is_string(compressor) && self2.right instanceof AST_Binary && self2.right.operator == "+" && self2.right.is_string(compressor)) { var binary = make_node(AST_Binary, self2, { operator: "+", left: self2.left.right, right: self2.right.left }); var m = binary.optimize(compressor); if (binary !== m) { self2 = make_node(AST_Binary, self2, { operator: "+", left: make_node(AST_Binary, self2.left, { operator: "+", left: self2.left.left, right: m }), right: self2.right.right }); } } if (self2.right instanceof AST_UnaryPrefix && self2.right.operator == "-" && self2.left.is_number(compressor)) { self2 = make_node(AST_Binary, self2, { operator: "-", left: self2.left, right: self2.right.expression }); break; } if (self2.left instanceof AST_UnaryPrefix && self2.left.operator == "-" && reversible() && self2.right.is_number(compressor)) { self2 = make_node(AST_Binary, self2, { operator: "-", left: self2.right, right: self2.left.expression }); break; } if (self2.left instanceof AST_TemplateString) { var l = self2.left; var r = self2.right.evaluate(compressor); if (r != self2.right) { l.segments[l.segments.length - 1].value += String(r); return l; } } if (self2.right instanceof AST_TemplateString) { var r = self2.right; var l = self2.left.evaluate(compressor); if (l != self2.left) { r.segments[0].value = String(l) + r.segments[0].value; return r; } } if (self2.left instanceof AST_TemplateString && self2.right instanceof AST_TemplateString) { var l = self2.left; var segments = l.segments; var r = self2.right; segments[segments.length - 1].value += r.segments[0].value; for (var i = 1; i < r.segments.length; i++) { segments.push(r.segments[i]); } return l; } case "*": associative = compressor.option("unsafe_math"); case "&": case "|": case "^": if (self2.left.is_number(compressor) && self2.right.is_number(compressor) && reversible() && !(self2.left instanceof AST_Binary && self2.left.operator != self2.operator && PRECEDENCE[self2.left.operator] >= PRECEDENCE[self2.operator])) { var reversed = make_node(AST_Binary, self2, { operator: self2.operator, left: self2.right, right: self2.left }); if (self2.right instanceof AST_Constant && !(self2.left instanceof AST_Constant)) { self2 = best_of(compressor, reversed, self2); } else { self2 = best_of(compressor, self2, reversed); } } if (associative && self2.is_number(compressor)) { if (self2.right instanceof AST_Binary && self2.right.operator == self2.operator) { self2 = make_node(AST_Binary, self2, { operator: self2.operator, left: make_node(AST_Binary, self2.left, { operator: self2.operator, left: self2.left, right: self2.right.left, start: self2.left.start, end: self2.right.left.end }), right: self2.right.right }); } if (self2.right instanceof AST_Constant && self2.left instanceof AST_Binary && self2.left.operator == self2.operator) { if (self2.left.left instanceof AST_Constant) { self2 = make_node(AST_Binary, self2, { operator: self2.operator, left: make_node(AST_Binary, self2.left, { operator: self2.operator, left: self2.left.left, right: self2.right, start: self2.left.left.start, end: self2.right.end }), right: self2.left.right }); } else if (self2.left.right instanceof AST_Constant) { self2 = make_node(AST_Binary, self2, { operator: self2.operator, left: make_node(AST_Binary, self2.left, { operator: self2.operator, left: self2.left.right, right: self2.right, start: self2.left.right.start, end: self2.right.end }), right: self2.left.left }); } } if (self2.left instanceof AST_Binary && self2.left.operator == self2.operator && self2.left.right instanceof AST_Constant && self2.right instanceof AST_Binary && self2.right.operator == self2.operator && self2.right.left instanceof AST_Constant) { self2 = make_node(AST_Binary, self2, { operator: self2.operator, left: make_node(AST_Binary, self2.left, { operator: self2.operator, left: make_node(AST_Binary, self2.left.left, { operator: self2.operator, left: self2.left.right, right: self2.right.left, start: self2.left.right.start, end: self2.right.left.end }), right: self2.left.left }), right: self2.right.right }); } } } } if (self2.right instanceof AST_Binary && self2.right.operator == self2.operator && (lazy_op.has(self2.operator) || self2.operator == "+" && (self2.right.left.is_string(compressor) || self2.left.is_string(compressor) && self2.right.right.is_string(compressor)))) { self2.left = make_node(AST_Binary, self2.left, { operator: self2.operator, left: self2.left.transform(compressor), right: self2.right.left.transform(compressor) }); self2.right = self2.right.right.transform(compressor); return self2.transform(compressor); } var ev = self2.evaluate(compressor); if (ev !== self2) { ev = make_node_from_constant(ev, self2).optimize(compressor); return best_of(compressor, ev, self2); } return self2; }); def_optimize(AST_SymbolExport, function(self2) { return self2; }); def_optimize(AST_SymbolRef, function(self2, compressor) { if (!compressor.option("ie8") && is_undeclared_ref(self2) && !compressor.find_parent(AST_With)) { switch (self2.name) { case "undefined": return make_node(AST_Undefined, self2).optimize(compressor); case "NaN": return make_node(AST_NaN, self2).optimize(compressor); case "Infinity": return make_node(AST_Infinity, self2).optimize(compressor); } } if (compressor.option("reduce_vars") && !compressor.is_lhs()) { return inline_into_symbolref(self2, compressor); } else { return self2; } }); function is_atomic(lhs, self2) { return lhs instanceof AST_SymbolRef || lhs.TYPE === self2.TYPE; } def_optimize(AST_Undefined, function(self2, compressor) { if (compressor.option("unsafe_undefined")) { var undef = find_variable(compressor, "undefined"); if (undef) { var ref = make_node(AST_SymbolRef, self2, { name: "undefined", scope: undef.scope, thedef: undef }); set_flag(ref, UNDEFINED); return ref; } } var lhs = compressor.is_lhs(); if (lhs && is_atomic(lhs, self2)) return self2; return make_node(AST_UnaryPrefix, self2, { operator: "void", expression: make_node(AST_Number, self2, { value: 0 }) }); }); def_optimize(AST_Infinity, function(self2, compressor) { var lhs = compressor.is_lhs(); if (lhs && is_atomic(lhs, self2)) return self2; if (compressor.option("keep_infinity") && !(lhs && !is_atomic(lhs, self2)) && !find_variable(compressor, "Infinity")) { return self2; } return make_node(AST_Binary, self2, { operator: "/", left: make_node(AST_Number, self2, { value: 1 }), right: make_node(AST_Number, self2, { value: 0 }) }); }); def_optimize(AST_NaN, function(self2, compressor) { var lhs = compressor.is_lhs(); if (lhs && !is_atomic(lhs, self2) || find_variable(compressor, "NaN")) { return make_node(AST_Binary, self2, { operator: "/", left: make_node(AST_Number, self2, { value: 0 }), right: make_node(AST_Number, self2, { value: 0 }) }); } return self2; }); const ASSIGN_OPS = makePredicate("+ - / * % >> << >>> | ^ &"); const ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); def_optimize(AST_Assign, function(self2, compressor) { if (self2.logical) { return self2.lift_sequences(compressor); } var def; if (self2.operator === "=" && self2.left instanceof AST_SymbolRef && self2.left.name !== "arguments" && !(def = self2.left.definition()).undeclared && self2.right.equivalent_to(self2.left)) { return self2.right; } if (compressor.option("dead_code") && self2.left instanceof AST_SymbolRef && (def = self2.left.definition()).scope === compressor.find_parent(AST_Lambda)) { var level = 0, node, parent = self2; do { node = parent; parent = compressor.parent(level++); if (parent instanceof AST_Exit) { if (in_try(level, parent)) break; if (is_reachable(def.scope, [def])) break; if (self2.operator == "=") return self2.right; def.fixed = false; return make_node(AST_Binary, self2, { operator: self2.operator.slice(0, -1), left: self2.left, right: self2.right }).optimize(compressor); } } while (parent instanceof AST_Binary && parent.right === node || parent instanceof AST_Sequence && parent.tail_node() === node); } self2 = self2.lift_sequences(compressor); if (self2.operator == "=" && self2.left instanceof AST_SymbolRef && self2.right instanceof AST_Binary) { if (self2.right.left instanceof AST_SymbolRef && self2.right.left.name == self2.left.name && ASSIGN_OPS.has(self2.right.operator)) { self2.operator = self2.right.operator + "="; self2.right = self2.right.right; } else if (self2.right.right instanceof AST_SymbolRef && self2.right.right.name == self2.left.name && ASSIGN_OPS_COMMUTATIVE.has(self2.right.operator) && !self2.right.left.has_side_effects(compressor)) { self2.operator = self2.right.operator + "="; self2.right = self2.right.left; } } return self2; function in_try(level2, node2) { function may_assignment_throw() { const right = self2.right; self2.right = make_node(AST_Null, right); const may_throw = node2.may_throw(compressor); self2.right = right; return may_throw; } var stop_at = self2.left.definition().scope.get_defun_scope(); var parent2; while ((parent2 = compressor.parent(level2++)) !== stop_at) { if (parent2 instanceof AST_Try) { if (parent2.bfinally) return true; if (parent2.bcatch && may_assignment_throw()) return true; } } } }); def_optimize(AST_DefaultAssign, function(self2, compressor) { if (!compressor.option("evaluate")) { return self2; } var evaluateRight = self2.right.evaluate(compressor); let lambda, iife; if (evaluateRight === void 0) { if ((lambda = compressor.parent()) instanceof AST_Lambda ? compressor.option("keep_fargs") === false || (iife = compressor.parent(1)).TYPE === "Call" && iife.expression === lambda : true) { self2 = self2.left; } } else if (evaluateRight !== self2.right) { evaluateRight = make_node_from_constant(evaluateRight, self2.right); self2.right = best_of_expression(evaluateRight, self2.right); } return self2; }); function is_nullish_check(check, check_subject, compressor) { if (check_subject.may_throw(compressor)) return false; let nullish_side; if (check instanceof AST_Binary && check.operator === "==" && ((nullish_side = is_nullish(check.left, compressor) && check.left) || (nullish_side = is_nullish(check.right, compressor) && check.right)) && (nullish_side === check.left ? check.right : check.left).equivalent_to(check_subject)) { return true; } if (check instanceof AST_Binary && check.operator === "||") { let null_cmp; let undefined_cmp; const find_comparison = (cmp) => { if (!(cmp instanceof AST_Binary && (cmp.operator === "===" || cmp.operator === "=="))) { return false; } let found = 0; let defined_side; if (cmp.left instanceof AST_Null) { found++; null_cmp = cmp; defined_side = cmp.right; } if (cmp.right instanceof AST_Null) { found++; null_cmp = cmp; defined_side = cmp.left; } if (is_undefined(cmp.left, compressor)) { found++; undefined_cmp = cmp; defined_side = cmp.right; } if (is_undefined(cmp.right, compressor)) { found++; undefined_cmp = cmp; defined_side = cmp.left; } if (found !== 1) { return false; } if (!defined_side.equivalent_to(check_subject)) { return false; } return true; }; if (!find_comparison(check.left)) return false; if (!find_comparison(check.right)) return false; if (null_cmp && undefined_cmp && null_cmp !== undefined_cmp) { return true; } } return false; } def_optimize(AST_Conditional, function(self2, compressor) { if (!compressor.option("conditionals")) return self2; if (self2.condition instanceof AST_Sequence) { var expressions = self2.condition.expressions.slice(); self2.condition = expressions.pop(); expressions.push(self2); return make_sequence(self2, expressions); } var cond = self2.condition.evaluate(compressor); if (cond !== self2.condition) { if (cond) { return maintain_this_binding(compressor.parent(), compressor.self(), self2.consequent); } else { return maintain_this_binding(compressor.parent(), compressor.self(), self2.alternative); } } var negated = cond.negate(compressor, first_in_statement(compressor)); if (best_of(compressor, cond, negated) === negated) { self2 = make_node(AST_Conditional, self2, { condition: negated, consequent: self2.alternative, alternative: self2.consequent }); } var condition = self2.condition; var consequent = self2.consequent; var alternative = self2.alternative; if (condition instanceof AST_SymbolRef && consequent instanceof AST_SymbolRef && condition.definition() === consequent.definition()) { return make_node(AST_Binary, self2, { operator: "||", left: condition, right: alternative }); } if (consequent instanceof AST_Assign && alternative instanceof AST_Assign && consequent.operator === alternative.operator && consequent.logical === alternative.logical && consequent.left.equivalent_to(alternative.left) && (!self2.condition.has_side_effects(compressor) || consequent.operator == "=" && !consequent.left.has_side_effects(compressor))) { return make_node(AST_Assign, self2, { operator: consequent.operator, left: consequent.left, logical: consequent.logical, right: make_node(AST_Conditional, self2, { condition: self2.condition, consequent: consequent.right, alternative: alternative.right }) }); } var arg_index; if (consequent instanceof AST_Call && alternative.TYPE === consequent.TYPE && consequent.args.length > 0 && consequent.args.length == alternative.args.length && consequent.expression.equivalent_to(alternative.expression) && !self2.condition.has_side_effects(compressor) && !consequent.expression.has_side_effects(compressor) && typeof (arg_index = single_arg_diff()) == "number") { var node = consequent.clone(); node.args[arg_index] = make_node(AST_Conditional, self2, { condition: self2.condition, consequent: consequent.args[arg_index], alternative: alternative.args[arg_index] }); return node; } if (alternative instanceof AST_Conditional && consequent.equivalent_to(alternative.consequent)) { return make_node(AST_Conditional, self2, { condition: make_node(AST_Binary, self2, { operator: "||", left: condition, right: alternative.condition }), consequent, alternative: alternative.alternative }).optimize(compressor); } if (compressor.option("ecma") >= 2020 && is_nullish_check(condition, alternative, compressor)) { return make_node(AST_Binary, self2, { operator: "??", left: alternative, right: consequent }).optimize(compressor); } if (alternative instanceof AST_Sequence && consequent.equivalent_to(alternative.expressions[alternative.expressions.length - 1])) { return make_sequence(self2, [ make_node(AST_Binary, self2, { operator: "||", left: condition, right: make_sequence(self2, alternative.expressions.slice(0, -1)) }), consequent ]).optimize(compressor); } if (alternative instanceof AST_Binary && alternative.operator == "&&" && consequent.equivalent_to(alternative.right)) { return make_node(AST_Binary, self2, { operator: "&&", left: make_node(AST_Binary, self2, { operator: "||", left: condition, right: alternative.left }), right: consequent }).optimize(compressor); } if (consequent instanceof AST_Conditional && consequent.alternative.equivalent_to(alternative)) { return make_node(AST_Conditional, self2, { condition: make_node(AST_Binary, self2, { left: self2.condition, operator: "&&", right: consequent.condition }), consequent: consequent.consequent, alternative }); } if (consequent.equivalent_to(alternative)) { return make_sequence(self2, [ self2.condition, consequent ]).optimize(compressor); } if (consequent instanceof AST_Binary && consequent.operator == "||" && consequent.right.equivalent_to(alternative)) { return make_node(AST_Binary, self2, { operator: "||", left: make_node(AST_Binary, self2, { operator: "&&", left: self2.condition, right: consequent.left }), right: alternative }).optimize(compressor); } const in_bool = compressor.in_boolean_context(); if (is_true(self2.consequent)) { if (is_false(self2.alternative)) { return booleanize(self2.condition); } return make_node(AST_Binary, self2, { operator: "||", left: booleanize(self2.condition), right: self2.alternative }); } if (is_false(self2.consequent)) { if (is_true(self2.alternative)) { return booleanize(self2.condition.negate(compressor)); } return make_node(AST_Binary, self2, { operator: "&&", left: booleanize(self2.condition.negate(compressor)), right: self2.alternative }); } if (is_true(self2.alternative)) { return make_node(AST_Binary, self2, { operator: "||", left: booleanize(self2.condition.negate(compressor)), right: self2.consequent }); } if (is_false(self2.alternative)) { return make_node(AST_Binary, self2, { operator: "&&", left: booleanize(self2.condition), right: self2.consequent }); } return self2; function booleanize(node2) { if (node2.is_boolean()) return node2; return make_node(AST_UnaryPrefix, node2, { operator: "!", expression: node2.negate(compressor) }); } function is_true(node2) { return node2 instanceof AST_True || in_bool && node2 instanceof AST_Constant && node2.getValue() || node2 instanceof AST_UnaryPrefix && node2.operator == "!" && node2.expression instanceof AST_Constant && !node2.expression.getValue(); } function is_false(node2) { return node2 instanceof AST_False || in_bool && node2 instanceof AST_Constant && !node2.getValue() || node2 instanceof AST_UnaryPrefix && node2.operator == "!" && node2.expression instanceof AST_Constant && node2.expression.getValue(); } function single_arg_diff() { var a = consequent.args; var b = alternative.args; for (var i = 0, len = a.length; i < len; i++) { if (a[i] instanceof AST_Expansion) return; if (!a[i].equivalent_to(b[i])) { if (b[i] instanceof AST_Expansion) return; for (var j = i + 1; j < len; j++) { if (a[j] instanceof AST_Expansion) return; if (!a[j].equivalent_to(b[j])) return; } return i; } } } }); def_optimize(AST_Boolean, function(self2, compressor) { if (compressor.in_boolean_context()) return make_node(AST_Number, self2, { value: +self2.value }); var p = compressor.parent(); if (compressor.option("booleans_as_integers")) { if (p instanceof AST_Binary && (p.operator == "===" || p.operator == "!==")) { p.operator = p.operator.replace(/=$/, ""); } return make_node(AST_Number, self2, { value: +self2.value }); } if (compressor.option("booleans")) { if (p instanceof AST_Binary && (p.operator == "==" || p.operator == "!=")) { return make_node(AST_Number, self2, { value: +self2.value }); } return make_node(AST_UnaryPrefix, self2, { operator: "!", expression: make_node(AST_Number, self2, { value: 1 - self2.value }) }); } return self2; }); function safe_to_flatten(value, compressor) { if (value instanceof AST_SymbolRef) { value = value.fixed_value(); } if (!value) return false; if (!(value instanceof AST_Lambda || value instanceof AST_Class)) return true; if (!(value instanceof AST_Lambda && value.contains_this())) return true; return compressor.parent() instanceof AST_New; } AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { if (!compressor.option("properties")) return; if (key === "__proto__") return; var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 2015; var expr = this.expression; if (expr instanceof AST_Object) { var props = expr.properties; for (var i = props.length; --i >= 0; ) { var prop = props[i]; if ("" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) { const all_props_flattenable = props.every((p) => (p instanceof AST_ObjectKeyVal || arrows && p instanceof AST_ConciseMethod && !p.is_generator) && !p.computed_key()); if (!all_props_flattenable) return; if (!safe_to_flatten(prop.value, compressor)) return; return make_node(AST_Sub, this, { expression: make_node(AST_Array, expr, { elements: props.map(function(prop2) { var v = prop2.value; if (v instanceof AST_Accessor) { v = make_node(AST_Function, v, v); } var k = prop2.key; if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) { return make_sequence(prop2, [k, v]); } return v; }) }), property: make_node(AST_Number, this, { value: i }) }); } } } }); def_optimize(AST_Sub, function(self2, compressor) { var expr = self2.expression; var prop = self2.property; if (compressor.option("properties")) { var key = prop.evaluate(compressor); if (key !== prop) { if (typeof key == "string") { if (key == "undefined") { key = void 0; } else { var value = parseFloat(key); if (value.toString() == key) { key = value; } } } prop = self2.property = best_of_expression(prop, make_node_from_constant(key, prop).transform(compressor)); var property = "" + key; if (is_basic_identifier_string(property) && property.length <= prop.size() + 1) { return make_node(AST_Dot, self2, { expression: expr, optional: self2.optional, property, quote: prop.quote }).optimize(compressor); } } } var fn; OPT_ARGUMENTS: if (compressor.option("arguments") && expr instanceof AST_SymbolRef && expr.name == "arguments" && expr.definition().orig.length == 1 && (fn = expr.scope) instanceof AST_Lambda && fn.uses_arguments && !(fn instanceof AST_Arrow) && prop instanceof AST_Number) { var index = prop.getValue(); var params = /* @__PURE__ */ new Set(); var argnames = fn.argnames; for (var n = 0; n < argnames.length; n++) { if (!(argnames[n] instanceof AST_SymbolFunarg)) { break OPT_ARGUMENTS; } var param = argnames[n].name; if (params.has(param)) { break OPT_ARGUMENTS; } params.add(param); } var argname = fn.argnames[index]; if (argname && compressor.has_directive("use strict")) { var def = argname.definition(); if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { argname = null; } } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { while (index >= fn.argnames.length) { argname = fn.create_symbol(AST_SymbolFunarg, { source: fn, scope: fn, tentative_name: "argument_" + fn.argnames.length }); fn.argnames.push(argname); } } if (argname) { var sym = make_node(AST_SymbolRef, self2, argname); sym.reference({}); clear_flag(argname, UNUSED); return sym; } } if (compressor.is_lhs()) return self2; if (key !== prop) { var sub = self2.flatten_object(property, compressor); if (sub) { expr = self2.expression = sub.expression; prop = self2.property = sub.property; } } if (compressor.option("properties") && compressor.option("side_effects") && prop instanceof AST_Number && expr instanceof AST_Array) { var index = prop.getValue(); var elements = expr.elements; var retValue = elements[index]; FLATTEN: if (safe_to_flatten(retValue, compressor)) { var flatten = true; var values = []; for (var i = elements.length; --i > index; ) { var value = elements[i].drop_side_effect_free(compressor); if (value) { values.unshift(value); if (flatten && value.has_side_effects(compressor)) flatten = false; } } if (retValue instanceof AST_Expansion) break FLATTEN; retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue; if (!flatten) values.unshift(retValue); while (--i >= 0) { var value = elements[i]; if (value instanceof AST_Expansion) break FLATTEN; value = value.drop_side_effect_free(compressor); if (value) values.unshift(value); else index--; } if (flatten) { values.push(retValue); return make_sequence(self2, values).optimize(compressor); } else return make_node(AST_Sub, self2, { expression: make_node(AST_Array, expr, { elements: values }), property: make_node(AST_Number, prop, { value: index }) }); } } var ev = self2.evaluate(compressor); if (ev !== self2) { ev = make_node_from_constant(ev, self2).optimize(compressor); return best_of(compressor, ev, self2); } return self2; }); def_optimize(AST_Chain, function(self2, compressor) { if (is_nullish(self2.expression, compressor)) { let parent = compressor.parent(); if (parent instanceof AST_UnaryPrefix && parent.operator === "delete") { return make_node_from_constant(0, self2); } return make_node(AST_Undefined, self2); } return self2; }); def_optimize(AST_Dot, function(self2, compressor) { const parent = compressor.parent(); if (compressor.is_lhs()) return self2; if (compressor.option("unsafe_proto") && self2.expression instanceof AST_Dot && self2.expression.property == "prototype") { var exp = self2.expression.expression; if (is_undeclared_ref(exp)) switch (exp.name) { case "Array": self2.expression = make_node(AST_Array, self2.expression, { elements: [] }); break; case "Function": self2.expression = make_node(AST_Function, self2.expression, { argnames: [], body: [] }); break; case "Number": self2.expression = make_node(AST_Number, self2.expression, { value: 0 }); break; case "Object": self2.expression = make_node(AST_Object, self2.expression, { properties: [] }); break; case "RegExp": self2.expression = make_node(AST_RegExp, self2.expression, { value: { source: "t", flags: "" } }); break; case "String": self2.expression = make_node(AST_String, self2.expression, { value: "" }); break; } } if (!(parent instanceof AST_Call) || !has_annotation(parent, _NOINLINE)) { const sub = self2.flatten_object(self2.property, compressor); if (sub) return sub.optimize(compressor); } if (self2.expression instanceof AST_PropAccess && parent instanceof AST_PropAccess) { return self2; } let ev = self2.evaluate(compressor); if (ev !== self2) { ev = make_node_from_constant(ev, self2).optimize(compressor); return best_of(compressor, ev, self2); } return self2; }); function literals_in_boolean_context(self2, compressor) { if (compressor.in_boolean_context()) { return best_of(compressor, self2, make_sequence(self2, [ self2, make_node(AST_True, self2) ]).optimize(compressor)); } return self2; } function inline_array_like_spread(elements) { for (var i = 0; i < elements.length; i++) { var el = elements[i]; if (el instanceof AST_Expansion) { var expr = el.expression; if (expr instanceof AST_Array && !expr.elements.some((elm) => elm instanceof AST_Hole)) { elements.splice(i, 1, ...expr.elements); i--; } } } } def_optimize(AST_Array, function(self2, compressor) { var optimized = literals_in_boolean_context(self2, compressor); if (optimized !== self2) { return optimized; } inline_array_like_spread(self2.elements); return self2; }); function inline_object_prop_spread(props, compressor) { for (var i = 0; i < props.length; i++) { var prop = props[i]; if (prop instanceof AST_Expansion) { const expr = prop.expression; if (expr instanceof AST_Object && expr.properties.every((prop2) => prop2 instanceof AST_ObjectKeyVal)) { props.splice(i, 1, ...expr.properties); i--; } else if (expr instanceof AST_Constant && !(expr instanceof AST_String)) { props.splice(i, 1); i--; } else if (is_nullish(expr, compressor)) { props.splice(i, 1); i--; } } } } def_optimize(AST_Object, function(self2, compressor) { var optimized = literals_in_boolean_context(self2, compressor); if (optimized !== self2) { return optimized; } inline_object_prop_spread(self2.properties, compressor); return self2; }); def_optimize(AST_RegExp, literals_in_boolean_context); def_optimize(AST_Return, function(self2, compressor) { if (self2.value && is_undefined(self2.value, compressor)) { self2.value = null; } return self2; }); def_optimize(AST_Arrow, opt_AST_Lambda); def_optimize(AST_Function, function(self2, compressor) { self2 = opt_AST_Lambda(self2, compressor); if (compressor.option("unsafe_arrows") && compressor.option("ecma") >= 2015 && !self2.name && !self2.is_generator && !self2.uses_arguments && !self2.pinned()) { const uses_this = walk(self2, (node) => { if (node instanceof AST_This) return walk_abort; }); if (!uses_this) return make_node(AST_Arrow, self2, self2).optimize(compressor); } return self2; }); def_optimize(AST_Class, function(self2) { for (let i = 0; i < self2.properties.length; i++) { const prop = self2.properties[i]; if (prop instanceof AST_ClassStaticBlock && prop.body.length == 0) { self2.properties.splice(i, 1); i--; } } return self2; }); def_optimize(AST_ClassStaticBlock, function(self2, compressor) { tighten_body(self2.body, compressor); return self2; }); def_optimize(AST_Yield, function(self2, compressor) { if (self2.expression && !self2.is_star && is_undefined(self2.expression, compressor)) { self2.expression = null; } return self2; }); def_optimize(AST_TemplateString, function(self2, compressor) { if (!compressor.option("evaluate") || compressor.parent() instanceof AST_PrefixedTemplateString) { return self2; } var segments = []; for (var i = 0; i < self2.segments.length; i++) { var segment = self2.segments[i]; if (segment instanceof AST_Node) { var result = segment.evaluate(compressor); if (result !== segment && (result + "").length <= segment.size() + "${}".length) { segments[segments.length - 1].value = segments[segments.length - 1].value + result + self2.segments[++i].value; continue; } if (segment instanceof AST_TemplateString) { var inners = segment.segments; segments[segments.length - 1].value += inners[0].value; for (var j = 1; j < inners.length; j++) { segment = inners[j]; segments.push(segment); } continue; } } segments.push(segment); } self2.segments = segments; if (segments.length == 1) { return make_node(AST_String, self2, segments[0]); } if (segments.length === 3 && segments[1] instanceof AST_Node && (segments[1].is_string(compressor) || segments[1].is_number(compressor) || is_nullish(segments[1], compressor) || compressor.option("unsafe"))) { if (segments[2].value === "") { return make_node(AST_Binary, self2, { operator: "+", left: make_node(AST_String, self2, { value: segments[0].value }), right: segments[1] }); } if (segments[0].value === "") { return make_node(AST_Binary, self2, { operator: "+", left: segments[1], right: make_node(AST_String, self2, { value: segments[2].value }) }); } } return self2; }); def_optimize(AST_PrefixedTemplateString, function(self2) { return self2; }); function lift_key(self2, compressor) { if (!compressor.option("computed_props")) return self2; if (!(self2.key instanceof AST_Constant)) return self2; if (self2.key instanceof AST_String || self2.key instanceof AST_Number) { if (self2.key.value === "__proto__") return self2; if (self2.key.value == "constructor" && compressor.parent() instanceof AST_Class) return self2; if (self2 instanceof AST_ObjectKeyVal) { self2.quote = self2.key.quote; self2.key = self2.key.value; } else if (self2 instanceof AST_ClassProperty) { self2.quote = self2.key.quote; self2.key = make_node(AST_SymbolClassProperty, self2.key, { name: self2.key.value }); } else { self2.quote = self2.key.quote; self2.key = make_node(AST_SymbolMethod, self2.key, { name: self2.key.value }); } } return self2; } def_optimize(AST_ObjectProperty, lift_key); def_optimize(AST_ConciseMethod, function(self2, compressor) { lift_key(self2, compressor); if (compressor.option("arrows") && compressor.parent() instanceof AST_Object && !self2.is_generator && !self2.value.uses_arguments && !self2.value.pinned() && self2.value.body.length == 1 && self2.value.body[0] instanceof AST_Return && self2.value.body[0].value && !self2.value.contains_this()) { var arrow = make_node(AST_Arrow, self2.value, self2.value); arrow.async = self2.async; arrow.is_generator = self2.is_generator; return make_node(AST_ObjectKeyVal, self2, { key: self2.key instanceof AST_SymbolMethod ? self2.key.name : self2.key, value: arrow, quote: self2.quote }); } return self2; }); def_optimize(AST_ObjectKeyVal, function(self2, compressor) { lift_key(self2, compressor); var unsafe_methods = compressor.option("unsafe_methods"); if (unsafe_methods && compressor.option("ecma") >= 2015 && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self2.key + ""))) { var key = self2.key; var value = self2.value; var is_arrow_with_block = value instanceof AST_Arrow && Array.isArray(value.body) && !value.contains_this(); if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) { return make_node(AST_ConciseMethod, self2, { async: value.async, is_generator: value.is_generator, key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self2, { name: key }), value: make_node(AST_Accessor, value, value), quote: self2.quote }); } } return self2; }); def_optimize(AST_Destructuring, function(self2, compressor) { if (compressor.option("pure_getters") == true && compressor.option("unused") && !self2.is_array && Array.isArray(self2.names) && !is_destructuring_export_decl(compressor) && !(self2.names[self2.names.length - 1] instanceof AST_Expansion)) { var keep = []; for (var i = 0; i < self2.names.length; i++) { var elem = self2.names[i]; if (!(elem instanceof AST_ObjectKeyVal && typeof elem.key == "string" && elem.value instanceof AST_SymbolDeclaration && !should_retain(compressor, elem.value.definition()))) { keep.push(elem); } } if (keep.length != self2.names.length) { self2.names = keep; } } return self2; function is_destructuring_export_decl(compressor2) { var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { var parent = compressor2.parent(p); if (!parent) return false; if (a === 0 && parent.TYPE == "Destructuring") continue; if (!ancestors[a].test(parent.TYPE)) { return false; } a++; } return true; } function should_retain(compressor2, def) { if (def.references.length) return true; if (!def.global) return false; if (compressor2.toplevel.vars) { if (compressor2.top_retain) { return compressor2.top_retain(def); } return false; } return true; } }); function* SourceMap(options) { options = defaults(options, { file: null, root: null, orig: null, files: {} }); var orig_map; var generator = new sourceMap.SourceMapGenerator({ file: options.file, sourceRoot: options.root }); let sourcesContent = { __proto__: null }; let files = options.files; for (var name in files) if (HOP(files, name)) { sourcesContent[name] = files[name]; } if (options.orig) { orig_map = yield new sourceMap.SourceMapConsumer(options.orig); if (orig_map.sourcesContent) { orig_map.sources.forEach(function(source, i) { var content = orig_map.sourcesContent[i]; if (content) { sourcesContent[source] = content; } }); } } function add(source, gen_line, gen_col, orig_line, orig_col, name2) { let generatedPos = { line: gen_line, column: gen_col }; if (orig_map) { var info = orig_map.originalPositionFor({ line: orig_line, column: orig_col }); if (info.source === null) { generator.addMapping({ generated: generatedPos, original: null, source: null, name: null }); return; } source = info.source; orig_line = info.line; orig_col = info.column; name2 = info.name || name2; } generator.addMapping({ generated: generatedPos, original: { line: orig_line, column: orig_col }, source, name: name2 }); generator.setSourceContent(source, sourcesContent[source]); } function clean(map) { const allNull = map.sourcesContent && map.sourcesContent.every((c) => c == null); if (allNull) delete map.sourcesContent; if (map.file === void 0) delete map.file; if (map.sourceRoot === void 0) delete map.sourceRoot; return map; } function getDecoded() { if (!generator.toDecodedMap) return null; return clean(generator.toDecodedMap()); } function getEncoded() { return clean(generator.toJSON()); } function destroy() { if (orig_map && orig_map.destroy) orig_map.destroy(); } return { add, getDecoded, getEncoded, destroy }; } var domprops = [ "$&", "$'", "$*", "$+", "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$_", "$`", "$input", "-moz-animation", "-moz-animation-delay", "-moz-animation-direction", "-moz-animation-duration", "-moz-animation-fill-mode", "-moz-animation-iteration-count", "-moz-animation-name", "-moz-animation-play-state", "-moz-animation-timing-function", "-moz-appearance", "-moz-backface-visibility", "-moz-border-end", "-moz-border-end-color", "-moz-border-end-style", "-moz-border-end-width", "-moz-border-image", "-moz-border-start", "-moz-border-start-color", "-moz-border-start-style", "-moz-border-start-width", "-moz-box-align", "-moz-box-direction", "-moz-box-flex", "-moz-box-ordinal-group", "-moz-box-orient", "-moz-box-pack", "-moz-box-sizing", "-moz-float-edge", "-moz-font-feature-settings", "-moz-font-language-override", "-moz-force-broken-image-icon", "-moz-hyphens", "-moz-image-region", "-moz-margin-end", "-moz-margin-start", "-moz-orient", "-moz-osx-font-smoothing", "-moz-outline-radius", "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright", "-moz-outline-radius-topleft", "-moz-outline-radius-topright", "-moz-padding-end", "-moz-padding-start", "-moz-perspective", "-moz-perspective-origin", "-moz-tab-size", "-moz-text-size-adjust", "-moz-transform", "-moz-transform-origin", "-moz-transform-style", "-moz-transition", "-moz-transition-delay", "-moz-transition-duration", "-moz-transition-property", "-moz-transition-timing-function", "-moz-user-focus", "-moz-user-input", "-moz-user-modify", "-moz-user-select", "-moz-window-dragging", "-webkit-align-content", "-webkit-align-items", "-webkit-align-self", "-webkit-animation", "-webkit-animation-delay", "-webkit-animation-direction", "-webkit-animation-duration", "-webkit-animation-fill-mode", "-webkit-animation-iteration-count", "-webkit-animation-name", "-webkit-animation-play-state", "-webkit-animation-timing-function", "-webkit-appearance", "-webkit-backface-visibility", "-webkit-background-clip", "-webkit-background-origin", "-webkit-background-size", "-webkit-border-bottom-left-radius", "-webkit-border-bottom-right-radius", "-webkit-border-image", "-webkit-border-radius", "-webkit-border-top-left-radius", "-webkit-border-top-right-radius", "-webkit-box-align", "-webkit-box-direction", "-webkit-box-flex", "-webkit-box-ordinal-group", "-webkit-box-orient", "-webkit-box-pack", "-webkit-box-shadow", "-webkit-box-sizing", "-webkit-filter", "-webkit-flex", "-webkit-flex-basis", "-webkit-flex-direction", "-webkit-flex-flow", "-webkit-flex-grow", "-webkit-flex-shrink", "-webkit-flex-wrap", "-webkit-justify-content", "-webkit-line-clamp", "-webkit-mask", "-webkit-mask-clip", "-webkit-mask-composite", "-webkit-mask-image", "-webkit-mask-origin", "-webkit-mask-position", "-webkit-mask-position-x", "-webkit-mask-position-y", "-webkit-mask-repeat", "-webkit-mask-size", "-webkit-order", "-webkit-perspective", "-webkit-perspective-origin", "-webkit-text-fill-color", "-webkit-text-size-adjust", "-webkit-text-stroke", "-webkit-text-stroke-color", "-webkit-text-stroke-width", "-webkit-transform", "-webkit-transform-origin", "-webkit-transform-style", "-webkit-transition", "-webkit-transition-delay", "-webkit-transition-duration", "-webkit-transition-property", "-webkit-transition-timing-function", "-webkit-user-select", "0", "1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", "20", "3", "4", "5", "6", "7", "8", "9", "@@iterator", "ABORT_ERR", "ACTIVE", "ACTIVE_ATTRIBUTES", "ACTIVE_TEXTURE", "ACTIVE_UNIFORMS", "ACTIVE_UNIFORM_BLOCKS", "ADDITION", "ALIASED_LINE_WIDTH_RANGE", "ALIASED_POINT_SIZE_RANGE", "ALL", "ALLOW_KEYBOARD_INPUT", "ALLPASS", "ALPHA", "ALPHA_BITS", "ALREADY_SIGNALED", "ALT_MASK", "ALWAYS", "ANY_SAMPLES_PASSED", "ANY_SAMPLES_PASSED_CONSERVATIVE", "ANY_TYPE", "ANY_UNORDERED_NODE_TYPE", "ARRAY_BUFFER", "ARRAY_BUFFER_BINDING", "ATTACHED_SHADERS", "ATTRIBUTE_NODE", "AT_TARGET", "AbortController", "AbortSignal", "AbsoluteOrientationSensor", "AbstractRange", "Accelerometer", "AddSearchProvider", "AggregateError", "AnalyserNode", "Animation", "AnimationEffect", "AnimationEvent", "AnimationPlaybackEvent", "AnimationTimeline", "AnonXMLHttpRequest", "Any", "ApplicationCache", "ApplicationCacheErrorEvent", "Array", "ArrayBuffer", "ArrayType", "Atomics", "Attr", "Audio", "AudioBuffer", "AudioBufferSourceNode", "AudioContext", "AudioDestinationNode", "AudioListener", "AudioNode", "AudioParam", "AudioParamMap", "AudioProcessingEvent", "AudioScheduledSourceNode", "AudioStreamTrack", "AudioWorklet", "AudioWorkletNode", "AuthenticatorAssertionResponse", "AuthenticatorAttestationResponse", "AuthenticatorResponse", "AutocompleteErrorEvent", "BACK", "BAD_BOUNDARYPOINTS_ERR", "BAD_REQUEST", "BANDPASS", "BLEND", "BLEND_COLOR", "BLEND_DST_ALPHA", "BLEND_DST_RGB", "BLEND_EQUATION", "BLEND_EQUATION_ALPHA", "BLEND_EQUATION_RGB", "BLEND_SRC_ALPHA", "BLEND_SRC_RGB", "BLUE", "BLUE_BITS", "BLUR", "BOOL", "BOOLEAN_TYPE", "BOOL_VEC2", "BOOL_VEC3", "BOOL_VEC4", "BOTH", "BROWSER_DEFAULT_WEBGL", "BUBBLING_PHASE", "BUFFER_SIZE", "BUFFER_USAGE", "BYTE", "BYTES_PER_ELEMENT", "BackgroundFetchManager", "BackgroundFetchRecord", "BackgroundFetchRegistration", "BarProp", "BarcodeDetector", "BaseAudioContext", "BaseHref", "BatteryManager", "BeforeInstallPromptEvent", "BeforeLoadEvent", "BeforeUnloadEvent", "BigInt", "BigInt64Array", "BigUint64Array", "BiquadFilterNode", "Blob", "BlobEvent", "Bluetooth", "BluetoothCharacteristicProperties", "BluetoothDevice", "BluetoothRemoteGATTCharacteristic", "BluetoothRemoteGATTDescriptor", "BluetoothRemoteGATTServer", "BluetoothRemoteGATTService", "BluetoothUUID", "Boolean", "BroadcastChannel", "ByteLengthQueuingStrategy", "CAPTURING_PHASE", "CCW", "CDATASection", "CDATA_SECTION_NODE", "CHANGE", "CHARSET_RULE", "CHECKING", "CLAMP_TO_EDGE", "CLICK", "CLOSED", "CLOSING", "COLOR", "COLOR_ATTACHMENT0", "COLOR_ATTACHMENT1", "COLOR_ATTACHMENT10", "COLOR_ATTACHMENT11", "COLOR_ATTACHMENT12", "COLOR_ATTACHMENT13", "COLOR_ATTACHMENT14", "COLOR_ATTACHMENT15", "COLOR_ATTACHMENT2", "COLOR_ATTACHMENT3", "COLOR_ATTACHMENT4", "COLOR_ATTACHMENT5", "COLOR_ATTACHMENT6", "COLOR_ATTACHMENT7", "COLOR_ATTACHMENT8", "COLOR_ATTACHMENT9", "COLOR_BUFFER_BIT", "COLOR_CLEAR_VALUE", "COLOR_WRITEMASK", "COMMENT_NODE", "COMPARE_REF_TO_TEXTURE", "COMPILE_STATUS", "COMPLETION_STATUS_KHR", "COMPRESSED_RGBA_S3TC_DXT1_EXT", "COMPRESSED_RGBA_S3TC_DXT3_EXT", "COMPRESSED_RGBA_S3TC_DXT5_EXT", "COMPRESSED_RGB_S3TC_DXT1_EXT", "COMPRESSED_TEXTURE_FORMATS", "COMPUTE", "CONDITION_SATISFIED", "CONFIGURATION_UNSUPPORTED", "CONNECTING", "CONSTANT_ALPHA", "CONSTANT_COLOR", "CONSTRAINT_ERR", "CONTEXT_LOST_WEBGL", "CONTROL_MASK", "COPY_DST", "COPY_READ_BUFFER", "COPY_READ_BUFFER_BINDING", "COPY_SRC", "COPY_WRITE_BUFFER", "COPY_WRITE_BUFFER_BINDING", "COUNTER_STYLE_RULE", "CSS", "CSS2Properties", "CSSAnimation", "CSSCharsetRule", "CSSConditionRule", "CSSCounterStyleRule", "CSSFontFaceRule", "CSSFontFeatureValuesRule", "CSSGroupingRule", "CSSImageValue", "CSSImportRule", "CSSKeyframeRule", "CSSKeyframesRule", "CSSKeywordValue", "CSSMathInvert", "CSSMathMax", "CSSMathMin", "CSSMathNegate", "CSSMathProduct", "CSSMathSum", "CSSMathValue", "CSSMatrixComponent", "CSSMediaRule", "CSSMozDocumentRule", "CSSNameSpaceRule", "CSSNamespaceRule", "CSSNumericArray", "CSSNumericValue", "CSSPageRule", "CSSPerspective", "CSSPositionValue", "CSSPrimitiveValue", "CSSRotate", "CSSRule", "CSSRuleList", "CSSScale", "CSSSkew", "CSSSkewX", "CSSSkewY", "CSSStyleDeclaration", "CSSStyleRule", "CSSStyleSheet", "CSSStyleValue", "CSSSupportsRule", "CSSTransformComponent", "CSSTransformValue", "CSSTransition", "CSSTranslate", "CSSUnitValue", "CSSUnknownRule", "CSSUnparsedValue", "CSSValue", "CSSValueList", "CSSVariableReferenceValue", "CSSVariablesDeclaration", "CSSVariablesRule", "CSSViewportRule", "CSS_ATTR", "CSS_CM", "CSS_COUNTER", "CSS_CUSTOM", "CSS_DEG", "CSS_DIMENSION", "CSS_EMS", "CSS_EXS", "CSS_FILTER_BLUR", "CSS_FILTER_BRIGHTNESS", "CSS_FILTER_CONTRAST", "CSS_FILTER_CUSTOM", "CSS_FILTER_DROP_SHADOW", "CSS_FILTER_GRAYSCALE", "CSS_FILTER_HUE_ROTATE", "CSS_FILTER_INVERT", "CSS_FILTER_OPACITY", "CSS_FILTER_REFERENCE", "CSS_FILTER_SATURATE", "CSS_FILTER_SEPIA", "CSS_GRAD", "CSS_HZ", "CSS_IDENT", "CSS_IN", "CSS_INHERIT", "CSS_KHZ", "CSS_MATRIX", "CSS_MATRIX3D", "CSS_MM", "CSS_MS", "CSS_NUMBER", "CSS_PC", "CSS_PERCENTAGE", "CSS_PERSPECTIVE", "CSS_PRIMITIVE_VALUE", "CSS_PT", "CSS_PX", "CSS_RAD", "CSS_RECT", "CSS_RGBCOLOR", "CSS_ROTATE", "CSS_ROTATE3D", "CSS_ROTATEX", "CSS_ROTATEY", "CSS_ROTATEZ", "CSS_S", "CSS_SCALE", "CSS_SCALE3D", "CSS_SCALEX", "CSS_SCALEY", "CSS_SCALEZ", "CSS_SKEW", "CSS_SKEWX", "CSS_SKEWY", "CSS_STRING", "CSS_TRANSLATE", "CSS_TRANSLATE3D", "CSS_TRANSLATEX", "CSS_TRANSLATEY", "CSS_TRANSLATEZ", "CSS_UNKNOWN", "CSS_URI", "CSS_VALUE_LIST", "CSS_VH", "CSS_VMAX", "CSS_VMIN", "CSS_VW", "CULL_FACE", "CULL_FACE_MODE", "CURRENT_PROGRAM", "CURRENT_QUERY", "CURRENT_VERTEX_ATTRIB", "CUSTOM", "CW", "Cache", "CacheStorage", "CanvasCaptureMediaStream", "CanvasCaptureMediaStreamTrack", "CanvasGradient", "CanvasPattern", "CanvasRenderingContext2D", "CaretPosition", "ChannelMergerNode", "ChannelSplitterNode", "CharacterData", "ClientRect", "ClientRectList", "Clipboard", "ClipboardEvent", "ClipboardItem", "CloseEvent", "Collator", "CommandEvent", "Comment", "CompileError", "CompositionEvent", "CompressionStream", "Console", "ConstantSourceNode", "Controllers", "ConvolverNode", "CountQueuingStrategy", "Counter", "Credential", "CredentialsContainer", "Crypto", "CryptoKey", "CustomElementRegistry", "CustomEvent", "DATABASE_ERR", "DATA_CLONE_ERR", "DATA_ERR", "DBLCLICK", "DECR", "DECR_WRAP", "DELETE_STATUS", "DEPTH", "DEPTH24_STENCIL8", "DEPTH32F_STENCIL8", "DEPTH_ATTACHMENT", "DEPTH_BITS", "DEPTH_BUFFER_BIT", "DEPTH_CLEAR_VALUE", "DEPTH_COMPONENT", "DEPTH_COMPONENT16", "DEPTH_COMPONENT24", "DEPTH_COMPONENT32F", "DEPTH_FUNC", "DEPTH_RANGE", "DEPTH_STENCIL", "DEPTH_STENCIL_ATTACHMENT", "DEPTH_TEST", "DEPTH_WRITEMASK", "DEVICE_INELIGIBLE", "DIRECTION_DOWN", "DIRECTION_LEFT", "DIRECTION_RIGHT", "DIRECTION_UP", "DISABLED", "DISPATCH_REQUEST_ERR", "DITHER", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", "DOCUMENT_POSITION_PRECEDING", "DOCUMENT_TYPE_NODE", "DOMCursor", "DOMError", "DOMException", "DOMImplementation", "DOMImplementationLS", "DOMMatrix", "DOMMatrixReadOnly", "DOMParser", "DOMPoint", "DOMPointReadOnly", "DOMQuad", "DOMRect", "DOMRectList", "DOMRectReadOnly", "DOMRequest", "DOMSTRING_SIZE_ERR", "DOMSettableTokenList", "DOMStringList", "DOMStringMap", "DOMTokenList", "DOMTransactionEvent", "DOM_DELTA_LINE", "DOM_DELTA_PAGE", "DOM_DELTA_PIXEL", "DOM_INPUT_METHOD_DROP", "DOM_INPUT_METHOD_HANDWRITING", "DOM_INPUT_METHOD_IME", "DOM_INPUT_METHOD_KEYBOARD", "DOM_INPUT_METHOD_MULTIMODAL", "DOM_INPUT_METHOD_OPTION", "DOM_INPUT_METHOD_PASTE", "DOM_INPUT_METHOD_SCRIPT", "DOM_INPUT_METHOD_UNKNOWN", "DOM_INPUT_METHOD_VOICE", "DOM_KEY_LOCATION_JOYSTICK", "DOM_KEY_LOCATION_LEFT", "DOM_KEY_LOCATION_MOBILE", "DOM_KEY_LOCATION_NUMPAD", "DOM_KEY_LOCATION_RIGHT", "DOM_KEY_LOCATION_STANDARD", "DOM_VK_0", "DOM_VK_1", "DOM_VK_2", "DOM_VK_3", "DOM_VK_4", "DOM_VK_5", "DOM_VK_6", "DOM_VK_7", "DOM_VK_8", "DOM_VK_9", "DOM_VK_A", "DOM_VK_ACCEPT", "DOM_VK_ADD", "DOM_VK_ALT", "DOM_VK_ALTGR", "DOM_VK_AMPERSAND", "DOM_VK_ASTERISK", "DOM_VK_AT", "DOM_VK_ATTN", "DOM_VK_B", "DOM_VK_BACKSPACE", "DOM_VK_BACK_QUOTE", "DOM_VK_BACK_SLASH", "DOM_VK_BACK_SPACE", "DOM_VK_C", "DOM_VK_CANCEL", "DOM_VK_CAPS_LOCK", "DOM_VK_CIRCUMFLEX", "DOM_VK_CLEAR", "DOM_VK_CLOSE_BRACKET", "DOM_VK_CLOSE_CURLY_BRACKET", "DOM_VK_CLOSE_PAREN", "DOM_VK_COLON", "DOM_VK_COMMA", "DOM_VK_CONTEXT_MENU", "DOM_VK_CONTROL", "DOM_VK_CONVERT", "DOM_VK_CRSEL", "DOM_VK_CTRL", "DOM_VK_D", "DOM_VK_DECIMAL", "DOM_VK_DELETE", "DOM_VK_DIVIDE", "DOM_VK_DOLLAR", "DOM_VK_DOUBLE_QUOTE", "DOM_VK_DOWN", "DOM_VK_E", "DOM_VK_EISU", "DOM_VK_END", "DOM_VK_ENTER", "DOM_VK_EQUALS", "DOM_VK_EREOF", "DOM_VK_ESCAPE", "DOM_VK_EXCLAMATION", "DOM_VK_EXECUTE", "DOM_VK_EXSEL", "DOM_VK_F", "DOM_VK_F1", "DOM_VK_F10", "DOM_VK_F11", "DOM_VK_F12", "DOM_VK_F13", "DOM_VK_F14", "DOM_VK_F15", "DOM_VK_F16", "DOM_VK_F17", "DOM_VK_F18", "DOM_VK_F19", "DOM_VK_F2", "DOM_VK_F20", "DOM_VK_F21", "DOM_VK_F22", "DOM_VK_F23", "DOM_VK_F24", "DOM_VK_F25", "DOM_VK_F26", "DOM_VK_F27", "DOM_VK_F28", "DOM_VK_F29", "DOM_VK_F3", "DOM_VK_F30", "DOM_VK_F31", "DOM_VK_F32", "DOM_VK_F33", "DOM_VK_F34", "DOM_VK_F35", "DOM_VK_F36", "DOM_VK_F4", "DOM_VK_F5", "DOM_VK_F6", "DOM_VK_F7", "DOM_VK_F8", "DOM_VK_F9", "DOM_VK_FINAL", "DOM_VK_FRONT", "DOM_VK_G", "DOM_VK_GREATER_THAN", "DOM_VK_H", "DOM_VK_HANGUL", "DOM_VK_HANJA", "DOM_VK_HASH", "DOM_VK_HELP", "DOM_VK_HK_TOGGLE", "DOM_VK_HOME", "DOM_VK_HYPHEN_MINUS", "DOM_VK_I", "DOM_VK_INSERT", "DOM_VK_J", "DOM_VK_JUNJA", "DOM_VK_K", "DOM_VK_KANA", "DOM_VK_KANJI", "DOM_VK_L", "DOM_VK_LEFT", "DOM_VK_LEFT_TAB", "DOM_VK_LESS_THAN", "DOM_VK_M", "DOM_VK_META", "DOM_VK_MODECHANGE", "DOM_VK_MULTIPLY", "DOM_VK_N", "DOM_VK_NONCONVERT", "DOM_VK_NUMPAD0", "DOM_VK_NUMPAD1", "DOM_VK_NUMPAD2", "DOM_VK_NUMPAD3", "DOM_VK_NUMPAD4", "DOM_VK_NUMPAD5", "DOM_VK_NUMPAD6", "DOM_VK_NUMPAD7", "DOM_VK_NUMPAD8", "DOM_VK_NUMPAD9", "DOM_VK_NUM_LOCK", "DOM_VK_O", "DOM_VK_OEM_1", "DOM_VK_OEM_102", "DOM_VK_OEM_2", "DOM_VK_OEM_3", "DOM_VK_OEM_4", "DOM_VK_OEM_5", "DOM_VK_OEM_6", "DOM_VK_OEM_7", "DOM_VK_OEM_8", "DOM_VK_OEM_COMMA", "DOM_VK_OEM_MINUS", "DOM_VK_OEM_PERIOD", "DOM_VK_OEM_PLUS", "DOM_VK_OPEN_BRACKET", "DOM_VK_OPEN_CURLY_BRACKET", "DOM_VK_OPEN_PAREN", "DOM_VK_P", "DOM_VK_PA1", "DOM_VK_PAGEDOWN", "DOM_VK_PAGEUP", "DOM_VK_PAGE_DOWN", "DOM_VK_PAGE_UP", "DOM_VK_PAUSE", "DOM_VK_PERCENT", "DOM_VK_PERIOD", "DOM_VK_PIPE", "DOM_VK_PLAY", "DOM_VK_PLUS", "DOM_VK_PRINT", "DOM_VK_PRINTSCREEN", "DOM_VK_PROCESSKEY", "DOM_VK_PROPERITES", "DOM_VK_Q", "DOM_VK_QUESTION_MARK", "DOM_VK_QUOTE", "DOM_VK_R", "DOM_VK_REDO", "DOM_VK_RETURN", "DOM_VK_RIGHT", "DOM_VK_S", "DOM_VK_SCROLL_LOCK", "DOM_VK_SELECT", "DOM_VK_SEMICOLON", "DOM_VK_SEPARATOR", "DOM_VK_SHIFT", "DOM_VK_SLASH", "DOM_VK_SLEEP", "DOM_VK_SPACE", "DOM_VK_SUBTRACT", "DOM_VK_T", "DOM_VK_TAB", "DOM_VK_TILDE", "DOM_VK_U", "DOM_VK_UNDERSCORE", "DOM_VK_UNDO", "DOM_VK_UNICODE", "DOM_VK_UP", "DOM_VK_V", "DOM_VK_VOLUME_DOWN", "DOM_VK_VOLUME_MUTE", "DOM_VK_VOLUME_UP", "DOM_VK_W", "DOM_VK_WIN", "DOM_VK_WINDOW", "DOM_VK_WIN_ICO_00", "DOM_VK_WIN_ICO_CLEAR", "DOM_VK_WIN_ICO_HELP", "DOM_VK_WIN_OEM_ATTN", "DOM_VK_WIN_OEM_AUTO", "DOM_VK_WIN_OEM_BACKTAB", "DOM_VK_WIN_OEM_CLEAR", "DOM_VK_WIN_OEM_COPY", "DOM_VK_WIN_OEM_CUSEL", "DOM_VK_WIN_OEM_ENLW", "DOM_VK_WIN_OEM_FINISH", "DOM_VK_WIN_OEM_FJ_JISHO", "DOM_VK_WIN_OEM_FJ_LOYA", "DOM_VK_WIN_OEM_FJ_MASSHOU", "DOM_VK_WIN_OEM_FJ_ROYA", "DOM_VK_WIN_OEM_FJ_TOUROKU", "DOM_VK_WIN_OEM_JUMP", "DOM_VK_WIN_OEM_PA1", "DOM_VK_WIN_OEM_PA2", "DOM_VK_WIN_OEM_PA3", "DOM_VK_WIN_OEM_RESET", "DOM_VK_WIN_OEM_WSCTRL", "DOM_VK_X", "DOM_VK_XF86XK_ADD_FAVORITE", "DOM_VK_XF86XK_APPLICATION_LEFT", "DOM_VK_XF86XK_APPLICATION_RIGHT", "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", "DOM_VK_XF86XK_AUDIO_FORWARD", "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", "DOM_VK_XF86XK_AUDIO_MEDIA", "DOM_VK_XF86XK_AUDIO_MUTE", "DOM_VK_XF86XK_AUDIO_NEXT", "DOM_VK_XF86XK_AUDIO_PAUSE", "DOM_VK_XF86XK_AUDIO_PLAY", "DOM_VK_XF86XK_AUDIO_PREV", "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", "DOM_VK_XF86XK_AUDIO_RECORD", "DOM_VK_XF86XK_AUDIO_REPEAT", "DOM_VK_XF86XK_AUDIO_REWIND", "DOM_VK_XF86XK_AUDIO_STOP", "DOM_VK_XF86XK_AWAY", "DOM_VK_XF86XK_BACK", "DOM_VK_XF86XK_BACK_FORWARD", "DOM_VK_XF86XK_BATTERY", "DOM_VK_XF86XK_BLUE", "DOM_VK_XF86XK_BLUETOOTH", "DOM_VK_XF86XK_BOOK", "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", "DOM_VK_XF86XK_CALCULATOR", "DOM_VK_XF86XK_CALENDAR", "DOM_VK_XF86XK_CD", "DOM_VK_XF86XK_CLOSE", "DOM_VK_XF86XK_COMMUNITY", "DOM_VK_XF86XK_CONTRAST_ADJUST", "DOM_VK_XF86XK_COPY", "DOM_VK_XF86XK_CUT", "DOM_VK_XF86XK_CYCLE_ANGLE", "DOM_VK_XF86XK_DISPLAY", "DOM_VK_XF86XK_DOCUMENTS", "DOM_VK_XF86XK_DOS", "DOM_VK_XF86XK_EJECT", "DOM_VK_XF86XK_EXCEL", "DOM_VK_XF86XK_EXPLORER", "DOM_VK_XF86XK_FAVORITES", "DOM_VK_XF86XK_FINANCE", "DOM_VK_XF86XK_FORWARD", "DOM_VK_XF86XK_FRAME_BACK", "DOM_VK_XF86XK_FRAME_FORWARD", "DOM_VK_XF86XK_GAME", "DOM_VK_XF86XK_GO", "DOM_VK_XF86XK_GREEN", "DOM_VK_XF86XK_HIBERNATE", "DOM_VK_XF86XK_HISTORY", "DOM_VK_XF86XK_HOME_PAGE", "DOM_VK_XF86XK_HOT_LINKS", "DOM_VK_XF86XK_I_TOUCH", "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", "DOM_VK_XF86XK_LAUNCH0", "DOM_VK_XF86XK_LAUNCH1", "DOM_VK_XF86XK_LAUNCH2", "DOM_VK_XF86XK_LAUNCH3", "DOM_VK_XF86XK_LAUNCH4", "DOM_VK_XF86XK_LAUNCH5", "DOM_VK_XF86XK_LAUNCH6", "DOM_VK_XF86XK_LAUNCH7", "DOM_VK_XF86XK_LAUNCH8", "DOM_VK_XF86XK_LAUNCH9", "DOM_VK_XF86XK_LAUNCH_A", "DOM_VK_XF86XK_LAUNCH_B", "DOM_VK_XF86XK_LAUNCH_C", "DOM_VK_XF86XK_LAUNCH_D", "DOM_VK_XF86XK_LAUNCH_E", "DOM_VK_XF86XK_LAUNCH_F", "DOM_VK_XF86XK_LIGHT_BULB", "DOM_VK_XF86XK_LOG_OFF", "DOM_VK_XF86XK_MAIL", "DOM_VK_XF86XK_MAIL_FORWARD", "DOM_VK_XF86XK_MARKET", "DOM_VK_XF86XK_MEETING", "DOM_VK_XF86XK_MEMO", "DOM_VK_XF86XK_MENU_KB", "DOM_VK_XF86XK_MENU_PB", "DOM_VK_XF86XK_MESSENGER", "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", "DOM_VK_XF86XK_MUSIC", "DOM_VK_XF86XK_MY_COMPUTER", "DOM_VK_XF86XK_MY_SITES", "DOM_VK_XF86XK_NEW", "DOM_VK_XF86XK_NEWS", "DOM_VK_XF86XK_OFFICE_HOME", "DOM_VK_XF86XK_OPEN", "DOM_VK_XF86XK_OPEN_URL", "DOM_VK_XF86XK_OPTION", "DOM_VK_XF86XK_PASTE", "DOM_VK_XF86XK_PHONE", "DOM_VK_XF86XK_PICTURES", "DOM_VK_XF86XK_POWER_DOWN", "DOM_VK_XF86XK_POWER_OFF", "DOM_VK_XF86XK_RED", "DOM_VK_XF86XK_REFRESH", "DOM_VK_XF86XK_RELOAD", "DOM_VK_XF86XK_REPLY", "DOM_VK_XF86XK_ROCKER_DOWN", "DOM_VK_XF86XK_ROCKER_ENTER", "DOM_VK_XF86XK_ROCKER_UP", "DOM_VK_XF86XK_ROTATE_WINDOWS", "DOM_VK_XF86XK_ROTATION_KB", "DOM_VK_XF86XK_ROTATION_PB", "DOM_VK_XF86XK_SAVE", "DOM_VK_XF86XK_SCREEN_SAVER", "DOM_VK_XF86XK_SCROLL_CLICK", "DOM_VK_XF86XK_SCROLL_DOWN", "DOM_VK_XF86XK_SCROLL_UP", "DOM_VK_XF86XK_SEARCH", "DOM_VK_XF86XK_SEND", "DOM_VK_XF86XK_SHOP", "DOM_VK_XF86XK_SPELL", "DOM_VK_XF86XK_SPLIT_SCREEN", "DOM_VK_XF86XK_STANDBY", "DOM_VK_XF86XK_START", "DOM_VK_XF86XK_STOP", "DOM_VK_XF86XK_SUBTITLE", "DOM_VK_XF86XK_SUPPORT", "DOM_VK_XF86XK_SUSPEND", "DOM_VK_XF86XK_TASK_PANE", "DOM_VK_XF86XK_TERMINAL", "DOM_VK_XF86XK_TIME", "DOM_VK_XF86XK_TOOLS", "DOM_VK_XF86XK_TOP_MENU", "DOM_VK_XF86XK_TO_DO_LIST", "DOM_VK_XF86XK_TRAVEL", "DOM_VK_XF86XK_USER1KB", "DOM_VK_XF86XK_USER2KB", "DOM_VK_XF86XK_USER_PB", "DOM_VK_XF86XK_UWB", "DOM_VK_XF86XK_VENDOR_HOME", "DOM_VK_XF86XK_VIDEO", "DOM_VK_XF86XK_VIEW", "DOM_VK_XF86XK_WAKE_UP", "DOM_VK_XF86XK_WEB_CAM", "DOM_VK_XF86XK_WHEEL_BUTTON", "DOM_VK_XF86XK_WLAN", "DOM_VK_XF86XK_WORD", "DOM_VK_XF86XK_WWW", "DOM_VK_XF86XK_XFER", "DOM_VK_XF86XK_YELLOW", "DOM_VK_XF86XK_ZOOM_IN", "DOM_VK_XF86XK_ZOOM_OUT", "DOM_VK_Y", "DOM_VK_Z", "DOM_VK_ZOOM", "DONE", "DONT_CARE", "DOWNLOADING", "DRAGDROP", "DRAW_BUFFER0", "DRAW_BUFFER1", "DRAW_BUFFER10", "DRAW_BUFFER11", "DRAW_BUFFER12", "DRAW_BUFFER13", "DRAW_BUFFER14", "DRAW_BUFFER15", "DRAW_BUFFER2", "DRAW_BUFFER3", "DRAW_BUFFER4", "DRAW_BUFFER5", "DRAW_BUFFER6", "DRAW_BUFFER7", "DRAW_BUFFER8", "DRAW_BUFFER9", "DRAW_FRAMEBUFFER", "DRAW_FRAMEBUFFER_BINDING", "DST_ALPHA", "DST_COLOR", "DYNAMIC_COPY", "DYNAMIC_DRAW", "DYNAMIC_READ", "DataChannel", "DataTransfer", "DataTransferItem", "DataTransferItemList", "DataView", "Date", "DateTimeFormat", "DecompressionStream", "DelayNode", "DeprecationReportBody", "DesktopNotification", "DesktopNotificationCenter", "DeviceLightEvent", "DeviceMotionEvent", "DeviceMotionEventAcceleration", "DeviceMotionEventRotationRate", "DeviceOrientationEvent", "DeviceProximityEvent", "DeviceStorage", "DeviceStorageChangeEvent", "Directory", "DisplayNames", "Document", "DocumentFragment", "DocumentTimeline", "DocumentType", "DragEvent", "DynamicsCompressorNode", "E", "ELEMENT_ARRAY_BUFFER", "ELEMENT_ARRAY_BUFFER_BINDING", "ELEMENT_NODE", "EMPTY", "ENCODING_ERR", "ENDED", "END_TO_END", "END_TO_START", "ENTITY_NODE", "ENTITY_REFERENCE_NODE", "EPSILON", "EQUAL", "EQUALPOWER", "ERROR", "EXPONENTIAL_DISTANCE", "Element", "ElementInternals", "ElementQuery", "EnterPictureInPictureEvent", "Entity", "EntityReference", "Error", "ErrorEvent", "EvalError", "Event", "EventException", "EventSource", "EventTarget", "External", "FASTEST", "FIDOSDK", "FILTER_ACCEPT", "FILTER_INTERRUPT", "FILTER_REJECT", "FILTER_SKIP", "FINISHED_STATE", "FIRST_ORDERED_NODE_TYPE", "FLOAT", "FLOAT_32_UNSIGNED_INT_24_8_REV", "FLOAT_MAT2", "FLOAT_MAT2x3", "FLOAT_MAT2x4", "FLOAT_MAT3", "FLOAT_MAT3x2", "FLOAT_MAT3x4", "FLOAT_MAT4", "FLOAT_MAT4x2", "FLOAT_MAT4x3", "FLOAT_VEC2", "FLOAT_VEC3", "FLOAT_VEC4", "FOCUS", "FONT_FACE_RULE", "FONT_FEATURE_VALUES_RULE", "FRAGMENT", "FRAGMENT_SHADER", "FRAGMENT_SHADER_DERIVATIVE_HINT", "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", "FRAMEBUFFER", "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", "FRAMEBUFFER_ATTACHMENT_RED_SIZE", "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", "FRAMEBUFFER_BINDING", "FRAMEBUFFER_COMPLETE", "FRAMEBUFFER_DEFAULT", "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", "FRAMEBUFFER_UNSUPPORTED", "FRONT", "FRONT_AND_BACK", "FRONT_FACE", "FUNC_ADD", "FUNC_REVERSE_SUBTRACT", "FUNC_SUBTRACT", "FeaturePolicy", "FeaturePolicyViolationReportBody", "FederatedCredential", "Feed", "FeedEntry", "File", "FileError", "FileList", "FileReader", "FileSystem", "FileSystemDirectoryEntry", "FileSystemDirectoryReader", "FileSystemEntry", "FileSystemFileEntry", "FinalizationRegistry", "FindInPage", "Float32Array", "Float64Array", "FocusEvent", "FontFace", "FontFaceSet", "FontFaceSetLoadEvent", "FormData", "FormDataEvent", "FragmentDirective", "Function", "GENERATE_MIPMAP_HINT", "GEQUAL", "GREATER", "GREEN", "GREEN_BITS", "GainNode", "Gamepad", "GamepadAxisMoveEvent", "GamepadButton", "GamepadButtonEvent", "GamepadEvent", "GamepadHapticActuator", "GamepadPose", "Geolocation", "GeolocationCoordinates", "GeolocationPosition", "GeolocationPositionError", "GestureEvent", "Global", "Gyroscope", "HALF_FLOAT", "HAVE_CURRENT_DATA", "HAVE_ENOUGH_DATA", "HAVE_FUTURE_DATA", "HAVE_METADATA", "HAVE_NOTHING", "HEADERS_RECEIVED", "HIDDEN", "HIERARCHY_REQUEST_ERR", "HIGHPASS", "HIGHSHELF", "HIGH_FLOAT", "HIGH_INT", "HORIZONTAL", "HORIZONTAL_AXIS", "HRTF", "HTMLAllCollection", "HTMLAnchorElement", "HTMLAppletElement", "HTMLAreaElement", "HTMLAudioElement", "HTMLBRElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBlockquoteElement", "HTMLBodyElement", "HTMLButtonElement", "HTMLCanvasElement", "HTMLCollection", "HTMLCommandElement", "HTMLContentElement", "HTMLDListElement", "HTMLDataElement", "HTMLDataListElement", "HTMLDetailsElement", "HTMLDialogElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDocument", "HTMLElement", "HTMLEmbedElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFormControlsCollection", "HTMLFormElement", "HTMLFrameElement", "HTMLFrameSetElement", "HTMLHRElement", "HTMLHeadElement", "HTMLHeadingElement", "HTMLHtmlElement", "HTMLIFrameElement", "HTMLImageElement", "HTMLInputElement", "HTMLIsIndexElement", "HTMLKeygenElement", "HTMLLIElement", "HTMLLabelElement", "HTMLLegendElement", "HTMLLinkElement", "HTMLMapElement", "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLMenuItemElement", "HTMLMetaElement", "HTMLMeterElement", "HTMLModElement", "HTMLOListElement", "HTMLObjectElement", "HTMLOptGroupElement", "HTMLOptionElement", "HTMLOptionsCollection", "HTMLOutputElement", "HTMLParagraphElement", "HTMLParamElement", "HTMLPictureElement", "HTMLPreElement", "HTMLProgressElement", "HTMLPropertiesCollection", "HTMLQuoteElement", "HTMLScriptElement", "HTMLSelectElement", "HTMLShadowElement", "HTMLSlotElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLStyleElement", "HTMLTableCaptionElement", "HTMLTableCellElement", "HTMLTableColElement", "HTMLTableElement", "HTMLTableRowElement", "HTMLTableSectionElement", "HTMLTemplateElement", "HTMLTextAreaElement", "HTMLTimeElement", "HTMLTitleElement", "HTMLTrackElement", "HTMLUListElement", "HTMLUnknownElement", "HTMLVideoElement", "HashChangeEvent", "Headers", "History", "Hz", "ICE_CHECKING", "ICE_CLOSED", "ICE_COMPLETED", "ICE_CONNECTED", "ICE_FAILED", "ICE_GATHERING", "ICE_WAITING", "IDBCursor", "IDBCursorWithValue", "IDBDatabase", "IDBDatabaseException", "IDBFactory", "IDBFileHandle", "IDBFileRequest", "IDBIndex", "IDBKeyRange", "IDBMutableFile", "IDBObjectStore", "IDBOpenDBRequest", "IDBRequest", "IDBTransaction", "IDBVersionChangeEvent", "IDLE", "IIRFilterNode", "IMPLEMENTATION_COLOR_READ_FORMAT", "IMPLEMENTATION_COLOR_READ_TYPE", "IMPORT_RULE", "INCR", "INCR_WRAP", "INDEX", "INDEX_SIZE_ERR", "INDIRECT", "INT", "INTERLEAVED_ATTRIBS", "INT_2_10_10_10_REV", "INT_SAMPLER_2D", "INT_SAMPLER_2D_ARRAY", "INT_SAMPLER_3D", "INT_SAMPLER_CUBE", "INT_VEC2", "INT_VEC3", "INT_VEC4", "INUSE_ATTRIBUTE_ERR", "INVALID_ACCESS_ERR", "INVALID_CHARACTER_ERR", "INVALID_ENUM", "INVALID_EXPRESSION_ERR", "INVALID_FRAMEBUFFER_OPERATION", "INVALID_INDEX", "INVALID_MODIFICATION_ERR", "INVALID_NODE_TYPE_ERR", "INVALID_OPERATION", "INVALID_STATE_ERR", "INVALID_VALUE", "INVERSE_DISTANCE", "INVERT", "IceCandidate", "IdleDeadline", "Image", "ImageBitmap", "ImageBitmapRenderingContext", "ImageCapture", "ImageData", "Infinity", "InputDeviceCapabilities", "InputDeviceInfo", "InputEvent", "InputMethodContext", "InstallTrigger", "InstallTriggerImpl", "Instance", "Int16Array", "Int32Array", "Int8Array", "Intent", "InternalError", "IntersectionObserver", "IntersectionObserverEntry", "Intl", "IsSearchProviderInstalled", "Iterator", "JSON", "KEEP", "KEYDOWN", "KEYFRAMES_RULE", "KEYFRAME_RULE", "KEYPRESS", "KEYUP", "KeyEvent", "Keyboard", "KeyboardEvent", "KeyboardLayoutMap", "KeyframeEffect", "LENGTHADJUST_SPACING", "LENGTHADJUST_SPACINGANDGLYPHS", "LENGTHADJUST_UNKNOWN", "LEQUAL", "LESS", "LINEAR", "LINEAR_DISTANCE", "LINEAR_MIPMAP_LINEAR", "LINEAR_MIPMAP_NEAREST", "LINES", "LINE_LOOP", "LINE_STRIP", "LINE_WIDTH", "LINK_STATUS", "LIVE", "LN10", "LN2", "LOADED", "LOADING", "LOG10E", "LOG2E", "LOWPASS", "LOWSHELF", "LOW_FLOAT", "LOW_INT", "LSException", "LSParserFilter", "LUMINANCE", "LUMINANCE_ALPHA", "LargestContentfulPaint", "LayoutShift", "LayoutShiftAttribution", "LinearAccelerationSensor", "LinkError", "ListFormat", "LocalMediaStream", "Locale", "Location", "Lock", "LockManager", "MAP_READ", "MAP_WRITE", "MAX", "MAX_3D_TEXTURE_SIZE", "MAX_ARRAY_TEXTURE_LAYERS", "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", "MAX_COLOR_ATTACHMENTS", "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "MAX_COMBINED_TEXTURE_IMAGE_UNITS", "MAX_COMBINED_UNIFORM_BLOCKS", "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "MAX_CUBE_MAP_TEXTURE_SIZE", "MAX_DRAW_BUFFERS", "MAX_ELEMENTS_INDICES", "MAX_ELEMENTS_VERTICES", "MAX_ELEMENT_INDEX", "MAX_FRAGMENT_INPUT_COMPONENTS", "MAX_FRAGMENT_UNIFORM_BLOCKS", "MAX_FRAGMENT_UNIFORM_COMPONENTS", "MAX_FRAGMENT_UNIFORM_VECTORS", "MAX_PROGRAM_TEXEL_OFFSET", "MAX_RENDERBUFFER_SIZE", "MAX_SAFE_INTEGER", "MAX_SAMPLES", "MAX_SERVER_WAIT_TIMEOUT", "MAX_TEXTURE_IMAGE_UNITS", "MAX_TEXTURE_LOD_BIAS", "MAX_TEXTURE_MAX_ANISOTROPY_EXT", "MAX_TEXTURE_SIZE", "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", "MAX_UNIFORM_BLOCK_SIZE", "MAX_UNIFORM_BUFFER_BINDINGS", "MAX_VALUE", "MAX_VARYING_COMPONENTS", "MAX_VARYING_VECTORS", "MAX_VERTEX_ATTRIBS", "MAX_VERTEX_OUTPUT_COMPONENTS", "MAX_VERTEX_TEXTURE_IMAGE_UNITS", "MAX_VERTEX_UNIFORM_BLOCKS", "MAX_VERTEX_UNIFORM_COMPONENTS", "MAX_VERTEX_UNIFORM_VECTORS", "MAX_VIEWPORT_DIMS", "MEDIA_ERR_ABORTED", "MEDIA_ERR_DECODE", "MEDIA_ERR_ENCRYPTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_KEYERR_CLIENT", "MEDIA_KEYERR_DOMAIN", "MEDIA_KEYERR_HARDWARECHANGE", "MEDIA_KEYERR_OUTPUT", "MEDIA_KEYERR_SERVICE", "MEDIA_KEYERR_UNKNOWN", "MEDIA_RULE", "MEDIUM_FLOAT", "MEDIUM_INT", "META_MASK", "MIDIAccess", "MIDIConnectionEvent", "MIDIInput", "MIDIInputMap", "MIDIMessageEvent", "MIDIOutput", "MIDIOutputMap", "MIDIPort", "MIN", "MIN_PROGRAM_TEXEL_OFFSET", "MIN_SAFE_INTEGER", "MIN_VALUE", "MIRRORED_REPEAT", "MODE_ASYNCHRONOUS", "MODE_SYNCHRONOUS", "MODIFICATION", "MOUSEDOWN", "MOUSEDRAG", "MOUSEMOVE", "MOUSEOUT", "MOUSEOVER", "MOUSEUP", "MOZ_KEYFRAMES_RULE", "MOZ_KEYFRAME_RULE", "MOZ_SOURCE_CURSOR", "MOZ_SOURCE_ERASER", "MOZ_SOURCE_KEYBOARD", "MOZ_SOURCE_MOUSE", "MOZ_SOURCE_PEN", "MOZ_SOURCE_TOUCH", "MOZ_SOURCE_UNKNOWN", "MSGESTURE_FLAG_BEGIN", "MSGESTURE_FLAG_CANCEL", "MSGESTURE_FLAG_END", "MSGESTURE_FLAG_INERTIA", "MSGESTURE_FLAG_NONE", "MSPOINTER_TYPE_MOUSE", "MSPOINTER_TYPE_PEN", "MSPOINTER_TYPE_TOUCH", "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", "MS_ASYNC_CALLBACK_STATUS_CANCEL", "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", "MS_ASYNC_CALLBACK_STATUS_ERROR", "MS_ASYNC_CALLBACK_STATUS_JOIN", "MS_ASYNC_OP_STATUS_CANCELED", "MS_ASYNC_OP_STATUS_ERROR", "MS_ASYNC_OP_STATUS_SUCCESS", "MS_MANIPULATION_STATE_ACTIVE", "MS_MANIPULATION_STATE_CANCELLED", "MS_MANIPULATION_STATE_COMMITTED", "MS_MANIPULATION_STATE_DRAGGING", "MS_MANIPULATION_STATE_INERTIA", "MS_MANIPULATION_STATE_PRESELECT", "MS_MANIPULATION_STATE_SELECTING", "MS_MANIPULATION_STATE_STOPPED", "MS_MEDIA_ERR_ENCRYPTED", "MS_MEDIA_KEYERR_CLIENT", "MS_MEDIA_KEYERR_DOMAIN", "MS_MEDIA_KEYERR_HARDWARECHANGE", "MS_MEDIA_KEYERR_OUTPUT", "MS_MEDIA_KEYERR_SERVICE", "MS_MEDIA_KEYERR_UNKNOWN", "Map", "Math", "MathMLElement", "MediaCapabilities", "MediaCapabilitiesInfo", "MediaController", "MediaDeviceInfo", "MediaDevices", "MediaElementAudioSourceNode", "MediaEncryptedEvent", "MediaError", "MediaKeyError", "MediaKeyEvent", "MediaKeyMessageEvent", "MediaKeyNeededEvent", "MediaKeySession", "MediaKeyStatusMap", "MediaKeySystemAccess", "MediaKeys", "MediaList", "MediaMetadata", "MediaQueryList", "MediaQueryListEvent", "MediaRecorder", "MediaRecorderErrorEvent", "MediaSession", "MediaSettingsRange", "MediaSource", "MediaStream", "MediaStreamAudioDestinationNode", "MediaStreamAudioSourceNode", "MediaStreamEvent", "MediaStreamTrack", "MediaStreamTrackAudioSourceNode", "MediaStreamTrackEvent", "Memory", "MessageChannel", "MessageEvent", "MessagePort", "Methods", "MimeType", "MimeTypeArray", "Module", "MouseEvent", "MouseScrollEvent", "MozAnimation", "MozAnimationDelay", "MozAnimationDirection", "MozAnimationDuration", "MozAnimationFillMode", "MozAnimationIterationCount", "MozAnimationName", "MozAnimationPlayState", "MozAnimationTimingFunction", "MozAppearance", "MozBackfaceVisibility", "MozBinding", "MozBorderBottomColors", "MozBorderEnd", "MozBorderEndColor", "MozBorderEndStyle", "MozBorderEndWidth", "MozBorderImage", "MozBorderLeftColors", "MozBorderRightColors", "MozBorderStart", "MozBorderStartColor", "MozBorderStartStyle", "MozBorderStartWidth", "MozBorderTopColors", "MozBoxAlign", "MozBoxDirection", "MozBoxFlex", "MozBoxOrdinalGroup", "MozBoxOrient", "MozBoxPack", "MozBoxSizing", "MozCSSKeyframeRule", "MozCSSKeyframesRule", "MozColumnCount", "MozColumnFill", "MozColumnGap", "MozColumnRule", "MozColumnRuleColor", "MozColumnRuleStyle", "MozColumnRuleWidth", "MozColumnWidth", "MozColumns", "MozContactChangeEvent", "MozFloatEdge", "MozFontFeatureSettings", "MozFontLanguageOverride", "MozForceBrokenImageIcon", "MozHyphens", "MozImageRegion", "MozMarginEnd", "MozMarginStart", "MozMmsEvent", "MozMmsMessage", "MozMobileMessageThread", "MozOSXFontSmoothing", "MozOrient", "MozOsxFontSmoothing", "MozOutlineRadius", "MozOutlineRadiusBottomleft", "MozOutlineRadiusBottomright", "MozOutlineRadiusTopleft", "MozOutlineRadiusTopright", "MozPaddingEnd", "MozPaddingStart", "MozPerspective", "MozPerspectiveOrigin", "MozPowerManager", "MozSettingsEvent", "MozSmsEvent", "MozSmsMessage", "MozStackSizing", "MozTabSize", "MozTextAlignLast", "MozTextDecorationColor", "MozTextDecorationLine", "MozTextDecorationStyle", "MozTextSizeAdjust", "MozTransform", "MozTransformOrigin", "MozTransformStyle", "MozTransition", "MozTransitionDelay", "MozTransitionDuration", "MozTransitionProperty", "MozTransitionTimingFunction", "MozUserFocus", "MozUserInput", "MozUserModify", "MozUserSelect", "MozWindowDragging", "MozWindowShadow", "MutationEvent", "MutationObserver", "MutationRecord", "NAMESPACE_ERR", "NAMESPACE_RULE", "NEAREST", "NEAREST_MIPMAP_LINEAR", "NEAREST_MIPMAP_NEAREST", "NEGATIVE_INFINITY", "NETWORK_EMPTY", "NETWORK_ERR", "NETWORK_IDLE", "NETWORK_LOADED", "NETWORK_LOADING", "NETWORK_NO_SOURCE", "NEVER", "NEW", "NEXT", "NEXT_NO_DUPLICATE", "NICEST", "NODE_AFTER", "NODE_BEFORE", "NODE_BEFORE_AND_AFTER", "NODE_INSIDE", "NONE", "NON_TRANSIENT_ERR", "NOTATION_NODE", "NOTCH", "NOTEQUAL", "NOT_ALLOWED_ERR", "NOT_FOUND_ERR", "NOT_READABLE_ERR", "NOT_SUPPORTED_ERR", "NO_DATA_ALLOWED_ERR", "NO_ERR", "NO_ERROR", "NO_MODIFICATION_ALLOWED_ERR", "NUMBER_TYPE", "NUM_COMPRESSED_TEXTURE_FORMATS", "NaN", "NamedNodeMap", "NavigationPreloadManager", "Navigator", "NearbyLinks", "NetworkInformation", "Node", "NodeFilter", "NodeIterator", "NodeList", "Notation", "Notification", "NotifyPaintEvent", "Number", "NumberFormat", "OBJECT_TYPE", "OBSOLETE", "OK", "ONE", "ONE_MINUS_CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_COLOR", "ONE_MINUS_DST_ALPHA", "ONE_MINUS_DST_COLOR", "ONE_MINUS_SRC_ALPHA", "ONE_MINUS_SRC_COLOR", "OPEN", "OPENED", "OPENING", "ORDERED_NODE_ITERATOR_TYPE", "ORDERED_NODE_SNAPSHOT_TYPE", "OTHER_ERROR", "OUT_OF_MEMORY", "Object", "OfflineAudioCompletionEvent", "OfflineAudioContext", "OfflineResourceList", "OffscreenCanvas", "OffscreenCanvasRenderingContext2D", "Option", "OrientationSensor", "OscillatorNode", "OverconstrainedError", "OverflowEvent", "PACK_ALIGNMENT", "PACK_ROW_LENGTH", "PACK_SKIP_PIXELS", "PACK_SKIP_ROWS", "PAGE_RULE", "PARSE_ERR", "PATHSEG_ARC_ABS", "PATHSEG_ARC_REL", "PATHSEG_CLOSEPATH", "PATHSEG_CURVETO_CUBIC_ABS", "PATHSEG_CURVETO_CUBIC_REL", "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", "PATHSEG_CURVETO_QUADRATIC_ABS", "PATHSEG_CURVETO_QUADRATIC_REL", "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", "PATHSEG_LINETO_ABS", "PATHSEG_LINETO_HORIZONTAL_ABS", "PATHSEG_LINETO_HORIZONTAL_REL", "PATHSEG_LINETO_REL", "PATHSEG_LINETO_VERTICAL_ABS", "PATHSEG_LINETO_VERTICAL_REL", "PATHSEG_MOVETO_ABS", "PATHSEG_MOVETO_REL", "PATHSEG_UNKNOWN", "PATH_EXISTS_ERR", "PEAKING", "PERMISSION_DENIED", "PERSISTENT", "PI", "PIXEL_PACK_BUFFER", "PIXEL_PACK_BUFFER_BINDING", "PIXEL_UNPACK_BUFFER", "PIXEL_UNPACK_BUFFER_BINDING", "PLAYING_STATE", "POINTS", "POLYGON_OFFSET_FACTOR", "POLYGON_OFFSET_FILL", "POLYGON_OFFSET_UNITS", "POSITION_UNAVAILABLE", "POSITIVE_INFINITY", "PREV", "PREV_NO_DUPLICATE", "PROCESSING_INSTRUCTION_NODE", "PageChangeEvent", "PageTransitionEvent", "PaintRequest", "PaintRequestList", "PannerNode", "PasswordCredential", "Path2D", "PaymentAddress", "PaymentInstruments", "PaymentManager", "PaymentMethodChangeEvent", "PaymentRequest", "PaymentRequestUpdateEvent", "PaymentResponse", "Performance", "PerformanceElementTiming", "PerformanceEntry", "PerformanceEventTiming", "PerformanceLongTaskTiming", "PerformanceMark", "PerformanceMeasure", "PerformanceNavigation", "PerformanceNavigationTiming", "PerformanceObserver", "PerformanceObserverEntryList", "PerformancePaintTiming", "PerformanceResourceTiming", "PerformanceServerTiming", "PerformanceTiming", "PeriodicSyncManager", "PeriodicWave", "PermissionStatus", "Permissions", "PhotoCapabilities", "PictureInPictureWindow", "Plugin", "PluginArray", "PluralRules", "PointerEvent", "PopStateEvent", "PopupBlockedEvent", "Presentation", "PresentationAvailability", "PresentationConnection", "PresentationConnectionAvailableEvent", "PresentationConnectionCloseEvent", "PresentationConnectionList", "PresentationReceiver", "PresentationRequest", "ProcessingInstruction", "ProgressEvent", "Promise", "PromiseRejectionEvent", "PropertyNodeList", "Proxy", "PublicKeyCredential", "PushManager", "PushSubscription", "PushSubscriptionOptions", "Q", "QUERY_RESOLVE", "QUERY_RESULT", "QUERY_RESULT_AVAILABLE", "QUOTA_ERR", "QUOTA_EXCEEDED_ERR", "QueryInterface", "R11F_G11F_B10F", "R16F", "R16I", "R16UI", "R32F", "R32I", "R32UI", "R8", "R8I", "R8UI", "R8_SNORM", "RASTERIZER_DISCARD", "READ", "READ_BUFFER", "READ_FRAMEBUFFER", "READ_FRAMEBUFFER_BINDING", "READ_ONLY", "READ_ONLY_ERR", "READ_WRITE", "RED", "RED_BITS", "RED_INTEGER", "REMOVAL", "RENDERBUFFER", "RENDERBUFFER_ALPHA_SIZE", "RENDERBUFFER_BINDING", "RENDERBUFFER_BLUE_SIZE", "RENDERBUFFER_DEPTH_SIZE", "RENDERBUFFER_GREEN_SIZE", "RENDERBUFFER_HEIGHT", "RENDERBUFFER_INTERNAL_FORMAT", "RENDERBUFFER_RED_SIZE", "RENDERBUFFER_SAMPLES", "RENDERBUFFER_STENCIL_SIZE", "RENDERBUFFER_WIDTH", "RENDERER", "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", "RENDERING_INTENT_AUTO", "RENDERING_INTENT_PERCEPTUAL", "RENDERING_INTENT_RELATIVE_COLORIMETRIC", "RENDERING_INTENT_SATURATION", "RENDERING_INTENT_UNKNOWN", "RENDER_ATTACHMENT", "REPEAT", "REPLACE", "RG", "RG16F", "RG16I", "RG16UI", "RG32F", "RG32I", "RG32UI", "RG8", "RG8I", "RG8UI", "RG8_SNORM", "RGB", "RGB10_A2", "RGB10_A2UI", "RGB16F", "RGB16I", "RGB16UI", "RGB32F", "RGB32I", "RGB32UI", "RGB565", "RGB5_A1", "RGB8", "RGB8I", "RGB8UI", "RGB8_SNORM", "RGB9_E5", "RGBA", "RGBA16F", "RGBA16I", "RGBA16UI", "RGBA32F", "RGBA32I", "RGBA32UI", "RGBA4", "RGBA8", "RGBA8I", "RGBA8UI", "RGBA8_SNORM", "RGBA_INTEGER", "RGBColor", "RGB_INTEGER", "RG_INTEGER", "ROTATION_CLOCKWISE", "ROTATION_COUNTERCLOCKWISE", "RTCCertificate", "RTCDTMFSender", "RTCDTMFToneChangeEvent", "RTCDataChannel", "RTCDataChannelEvent", "RTCDtlsTransport", "RTCError", "RTCErrorEvent", "RTCIceCandidate", "RTCIceTransport", "RTCPeerConnection", "RTCPeerConnectionIceErrorEvent", "RTCPeerConnectionIceEvent", "RTCRtpReceiver", "RTCRtpSender", "RTCRtpTransceiver", "RTCSctpTransport", "RTCSessionDescription", "RTCStatsReport", "RTCTrackEvent", "RadioNodeList", "Range", "RangeError", "RangeException", "ReadableStream", "ReadableStreamDefaultReader", "RecordErrorEvent", "Rect", "ReferenceError", "Reflect", "RegExp", "RelativeOrientationSensor", "RelativeTimeFormat", "RemotePlayback", "Report", "ReportBody", "ReportingObserver", "Request", "ResizeObserver", "ResizeObserverEntry", "ResizeObserverSize", "Response", "RuntimeError", "SAMPLER_2D", "SAMPLER_2D_ARRAY", "SAMPLER_2D_ARRAY_SHADOW", "SAMPLER_2D_SHADOW", "SAMPLER_3D", "SAMPLER_BINDING", "SAMPLER_CUBE", "SAMPLER_CUBE_SHADOW", "SAMPLES", "SAMPLE_ALPHA_TO_COVERAGE", "SAMPLE_BUFFERS", "SAMPLE_COVERAGE", "SAMPLE_COVERAGE_INVERT", "SAMPLE_COVERAGE_VALUE", "SAWTOOTH", "SCHEDULED_STATE", "SCISSOR_BOX", "SCISSOR_TEST", "SCROLL_PAGE_DOWN", "SCROLL_PAGE_UP", "SDP_ANSWER", "SDP_OFFER", "SDP_PRANSWER", "SECURITY_ERR", "SELECT", "SEPARATE_ATTRIBS", "SERIALIZE_ERR", "SEVERITY_ERROR", "SEVERITY_FATAL_ERROR", "SEVERITY_WARNING", "SHADER_COMPILER", "SHADER_TYPE", "SHADING_LANGUAGE_VERSION", "SHIFT_MASK", "SHORT", "SHOWING", "SHOW_ALL", "SHOW_ATTRIBUTE", "SHOW_CDATA_SECTION", "SHOW_COMMENT", "SHOW_DOCUMENT", "SHOW_DOCUMENT_FRAGMENT", "SHOW_DOCUMENT_TYPE", "SHOW_ELEMENT", "SHOW_ENTITY", "SHOW_ENTITY_REFERENCE", "SHOW_NOTATION", "SHOW_PROCESSING_INSTRUCTION", "SHOW_TEXT", "SIGNALED", "SIGNED_NORMALIZED", "SINE", "SOUNDFIELD", "SQLException", "SQRT1_2", "SQRT2", "SQUARE", "SRC_ALPHA", "SRC_ALPHA_SATURATE", "SRC_COLOR", "SRGB", "SRGB8", "SRGB8_ALPHA8", "START_TO_END", "START_TO_START", "STATIC_COPY", "STATIC_DRAW", "STATIC_READ", "STENCIL", "STENCIL_ATTACHMENT", "STENCIL_BACK_FAIL", "STENCIL_BACK_FUNC", "STENCIL_BACK_PASS_DEPTH_FAIL", "STENCIL_BACK_PASS_DEPTH_PASS", "STENCIL_BACK_REF", "STENCIL_BACK_VALUE_MASK", "STENCIL_BACK_WRITEMASK", "STENCIL_BITS", "STENCIL_BUFFER_BIT", "STENCIL_CLEAR_VALUE", "STENCIL_FAIL", "STENCIL_FUNC", "STENCIL_INDEX", "STENCIL_INDEX8", "STENCIL_PASS_DEPTH_FAIL", "STENCIL_PASS_DEPTH_PASS", "STENCIL_REF", "STENCIL_TEST", "STENCIL_VALUE_MASK", "STENCIL_WRITEMASK", "STORAGE", "STORAGE_BINDING", "STREAM_COPY", "STREAM_DRAW", "STREAM_READ", "STRING_TYPE", "STYLE_RULE", "SUBPIXEL_BITS", "SUPPORTS_RULE", "SVGAElement", "SVGAltGlyphDefElement", "SVGAltGlyphElement", "SVGAltGlyphItemElement", "SVGAngle", "SVGAnimateColorElement", "SVGAnimateElement", "SVGAnimateMotionElement", "SVGAnimateTransformElement", "SVGAnimatedAngle", "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGAnimationElement", "SVGCircleElement", "SVGClipPathElement", "SVGColor", "SVGComponentTransferFunctionElement", "SVGCursorElement", "SVGDefsElement", "SVGDescElement", "SVGDiscardElement", "SVGDocument", "SVGElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", "SVGFEBlendElement", "SVGFEColorMatrixElement", "SVGFEComponentTransferElement", "SVGFECompositeElement", "SVGFEConvolveMatrixElement", "SVGFEDiffuseLightingElement", "SVGFEDisplacementMapElement", "SVGFEDistantLightElement", "SVGFEDropShadowElement", "SVGFEFloodElement", "SVGFEFuncAElement", "SVGFEFuncBElement", "SVGFEFuncGElement", "SVGFEFuncRElement", "SVGFEGaussianBlurElement", "SVGFEImageElement", "SVGFEMergeElement", "SVGFEMergeNodeElement", "SVGFEMorphologyElement", "SVGFEOffsetElement", "SVGFEPointLightElement", "SVGFESpecularLightingElement", "SVGFESpotLightElement", "SVGFETileElement", "SVGFETurbulenceElement", "SVGFilterElement", "SVGFontElement", "SVGFontFaceElement", "SVGFontFaceFormatElement", "SVGFontFaceNameElement", "SVGFontFaceSrcElement", "SVGFontFaceUriElement", "SVGForeignObjectElement", "SVGGElement", "SVGGeometryElement", "SVGGlyphElement", "SVGGlyphRefElement", "SVGGradientElement", "SVGGraphicsElement", "SVGHKernElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLineElement", "SVGLinearGradientElement", "SVGMPathElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", "SVGMetadataElement", "SVGMissingGlyphElement", "SVGNumber", "SVGNumberList", "SVGPaint", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGRenderingIntent", "SVGSVGElement", "SVGScriptElement", "SVGSetElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTRefElement", "SVGTSpanElement", "SVGTextContentElement", "SVGTextElement", "SVGTextPathElement", "SVGTextPositioningElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGVKernElement", "SVGViewElement", "SVGViewSpec", "SVGZoomAndPan", "SVGZoomEvent", "SVG_ANGLETYPE_DEG", "SVG_ANGLETYPE_GRAD", "SVG_ANGLETYPE_RAD", "SVG_ANGLETYPE_UNKNOWN", "SVG_ANGLETYPE_UNSPECIFIED", "SVG_CHANNEL_A", "SVG_CHANNEL_B", "SVG_CHANNEL_G", "SVG_CHANNEL_R", "SVG_CHANNEL_UNKNOWN", "SVG_COLORTYPE_CURRENTCOLOR", "SVG_COLORTYPE_RGBCOLOR", "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", "SVG_COLORTYPE_UNKNOWN", "SVG_EDGEMODE_DUPLICATE", "SVG_EDGEMODE_NONE", "SVG_EDGEMODE_UNKNOWN", "SVG_EDGEMODE_WRAP", "SVG_FEBLEND_MODE_COLOR", "SVG_FEBLEND_MODE_COLOR_BURN", "SVG_FEBLEND_MODE_COLOR_DODGE", "SVG_FEBLEND_MODE_DARKEN", "SVG_FEBLEND_MODE_DIFFERENCE", "SVG_FEBLEND_MODE_EXCLUSION", "SVG_FEBLEND_MODE_HARD_LIGHT", "SVG_FEBLEND_MODE_HUE", "SVG_FEBLEND_MODE_LIGHTEN", "SVG_FEBLEND_MODE_LUMINOSITY", "SVG_FEBLEND_MODE_MULTIPLY", "SVG_FEBLEND_MODE_NORMAL", "SVG_FEBLEND_MODE_OVERLAY", "SVG_FEBLEND_MODE_SATURATION", "SVG_FEBLEND_MODE_SCREEN", "SVG_FEBLEND_MODE_SOFT_LIGHT", "SVG_FEBLEND_MODE_UNKNOWN", "SVG_FECOLORMATRIX_TYPE_HUEROTATE", "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", "SVG_FECOLORMATRIX_TYPE_MATRIX", "SVG_FECOLORMATRIX_TYPE_SATURATE", "SVG_FECOLORMATRIX_TYPE_UNKNOWN", "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", "SVG_FECOMPOSITE_OPERATOR_ATOP", "SVG_FECOMPOSITE_OPERATOR_IN", "SVG_FECOMPOSITE_OPERATOR_OUT", "SVG_FECOMPOSITE_OPERATOR_OVER", "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", "SVG_FECOMPOSITE_OPERATOR_XOR", "SVG_INVALID_VALUE_ERR", "SVG_LENGTHTYPE_CM", "SVG_LENGTHTYPE_EMS", "SVG_LENGTHTYPE_EXS", "SVG_LENGTHTYPE_IN", "SVG_LENGTHTYPE_MM", "SVG_LENGTHTYPE_NUMBER", "SVG_LENGTHTYPE_PC", "SVG_LENGTHTYPE_PERCENTAGE", "SVG_LENGTHTYPE_PT", "SVG_LENGTHTYPE_PX", "SVG_LENGTHTYPE_UNKNOWN", "SVG_MARKERUNITS_STROKEWIDTH", "SVG_MARKERUNITS_UNKNOWN", "SVG_MARKERUNITS_USERSPACEONUSE", "SVG_MARKER_ORIENT_ANGLE", "SVG_MARKER_ORIENT_AUTO", "SVG_MARKER_ORIENT_UNKNOWN", "SVG_MASKTYPE_ALPHA", "SVG_MASKTYPE_LUMINANCE", "SVG_MATRIX_NOT_INVERTABLE", "SVG_MEETORSLICE_MEET", "SVG_MEETORSLICE_SLICE", "SVG_MEETORSLICE_UNKNOWN", "SVG_MORPHOLOGY_OPERATOR_DILATE", "SVG_MORPHOLOGY_OPERATOR_ERODE", "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", "SVG_PAINTTYPE_CURRENTCOLOR", "SVG_PAINTTYPE_NONE", "SVG_PAINTTYPE_RGBCOLOR", "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", "SVG_PAINTTYPE_UNKNOWN", "SVG_PAINTTYPE_URI", "SVG_PAINTTYPE_URI_CURRENTCOLOR", "SVG_PAINTTYPE_URI_NONE", "SVG_PAINTTYPE_URI_RGBCOLOR", "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", "SVG_PRESERVEASPECTRATIO_NONE", "SVG_PRESERVEASPECTRATIO_UNKNOWN", "SVG_PRESERVEASPECTRATIO_XMAXYMAX", "SVG_PRESERVEASPECTRATIO_XMAXYMID", "SVG_PRESERVEASPECTRATIO_XMAXYMIN", "SVG_PRESERVEASPECTRATIO_XMIDYMAX", "SVG_PRESERVEASPECTRATIO_XMIDYMID", "SVG_PRESERVEASPECTRATIO_XMIDYMIN", "SVG_PRESERVEASPECTRATIO_XMINYMAX", "SVG_PRESERVEASPECTRATIO_XMINYMID", "SVG_PRESERVEASPECTRATIO_XMINYMIN", "SVG_SPREADMETHOD_PAD", "SVG_SPREADMETHOD_REFLECT", "SVG_SPREADMETHOD_REPEAT", "SVG_SPREADMETHOD_UNKNOWN", "SVG_STITCHTYPE_NOSTITCH", "SVG_STITCHTYPE_STITCH", "SVG_STITCHTYPE_UNKNOWN", "SVG_TRANSFORM_MATRIX", "SVG_TRANSFORM_ROTATE", "SVG_TRANSFORM_SCALE", "SVG_TRANSFORM_SKEWX", "SVG_TRANSFORM_SKEWY", "SVG_TRANSFORM_TRANSLATE", "SVG_TRANSFORM_UNKNOWN", "SVG_TURBULENCE_TYPE_FRACTALNOISE", "SVG_TURBULENCE_TYPE_TURBULENCE", "SVG_TURBULENCE_TYPE_UNKNOWN", "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", "SVG_UNIT_TYPE_UNKNOWN", "SVG_UNIT_TYPE_USERSPACEONUSE", "SVG_WRONG_TYPE_ERR", "SVG_ZOOMANDPAN_DISABLE", "SVG_ZOOMANDPAN_MAGNIFY", "SVG_ZOOMANDPAN_UNKNOWN", "SYNC_CONDITION", "SYNC_FENCE", "SYNC_FLAGS", "SYNC_FLUSH_COMMANDS_BIT", "SYNC_GPU_COMMANDS_COMPLETE", "SYNC_STATUS", "SYNTAX_ERR", "SavedPages", "Screen", "ScreenOrientation", "Script", "ScriptProcessorNode", "ScrollAreaEvent", "SecurityPolicyViolationEvent", "Selection", "Sensor", "SensorErrorEvent", "ServiceWorker", "ServiceWorkerContainer", "ServiceWorkerRegistration", "SessionDescription", "Set", "ShadowRoot", "SharedArrayBuffer", "SharedWorker", "SimpleGestureEvent", "SourceBuffer", "SourceBufferList", "SpeechSynthesis", "SpeechSynthesisErrorEvent", "SpeechSynthesisEvent", "SpeechSynthesisUtterance", "SpeechSynthesisVoice", "StaticRange", "StereoPannerNode", "StopIteration", "Storage", "StorageEvent", "StorageManager", "String", "StructType", "StylePropertyMap", "StylePropertyMapReadOnly", "StyleSheet", "StyleSheetList", "SubmitEvent", "SubtleCrypto", "Symbol", "SyncManager", "SyntaxError", "TEMPORARY", "TEXTPATH_METHODTYPE_ALIGN", "TEXTPATH_METHODTYPE_STRETCH", "TEXTPATH_METHODTYPE_UNKNOWN", "TEXTPATH_SPACINGTYPE_AUTO", "TEXTPATH_SPACINGTYPE_EXACT", "TEXTPATH_SPACINGTYPE_UNKNOWN", "TEXTURE", "TEXTURE0", "TEXTURE1", "TEXTURE10", "TEXTURE11", "TEXTURE12", "TEXTURE13", "TEXTURE14", "TEXTURE15", "TEXTURE16", "TEXTURE17", "TEXTURE18", "TEXTURE19", "TEXTURE2", "TEXTURE20", "TEXTURE21", "TEXTURE22", "TEXTURE23", "TEXTURE24", "TEXTURE25", "TEXTURE26", "TEXTURE27", "TEXTURE28", "TEXTURE29", "TEXTURE3", "TEXTURE30", "TEXTURE31", "TEXTURE4", "TEXTURE5", "TEXTURE6", "TEXTURE7", "TEXTURE8", "TEXTURE9", "TEXTURE_2D", "TEXTURE_2D_ARRAY", "TEXTURE_3D", "TEXTURE_BASE_LEVEL", "TEXTURE_BINDING", "TEXTURE_BINDING_2D", "TEXTURE_BINDING_2D_ARRAY", "TEXTURE_BINDING_3D", "TEXTURE_BINDING_CUBE_MAP", "TEXTURE_COMPARE_FUNC", "TEXTURE_COMPARE_MODE", "TEXTURE_CUBE_MAP", "TEXTURE_CUBE_MAP_NEGATIVE_X", "TEXTURE_CUBE_MAP_NEGATIVE_Y", "TEXTURE_CUBE_MAP_NEGATIVE_Z", "TEXTURE_CUBE_MAP_POSITIVE_X", "TEXTURE_CUBE_MAP_POSITIVE_Y", "TEXTURE_CUBE_MAP_POSITIVE_Z", "TEXTURE_IMMUTABLE_FORMAT", "TEXTURE_IMMUTABLE_LEVELS", "TEXTURE_MAG_FILTER", "TEXTURE_MAX_ANISOTROPY_EXT", "TEXTURE_MAX_LEVEL", "TEXTURE_MAX_LOD", "TEXTURE_MIN_FILTER", "TEXTURE_MIN_LOD", "TEXTURE_WRAP_R", "TEXTURE_WRAP_S", "TEXTURE_WRAP_T", "TEXT_NODE", "TIMEOUT", "TIMEOUT_ERR", "TIMEOUT_EXPIRED", "TIMEOUT_IGNORED", "TOO_LARGE_ERR", "TRANSACTION_INACTIVE_ERR", "TRANSFORM_FEEDBACK", "TRANSFORM_FEEDBACK_ACTIVE", "TRANSFORM_FEEDBACK_BINDING", "TRANSFORM_FEEDBACK_BUFFER", "TRANSFORM_FEEDBACK_BUFFER_BINDING", "TRANSFORM_FEEDBACK_BUFFER_MODE", "TRANSFORM_FEEDBACK_BUFFER_SIZE", "TRANSFORM_FEEDBACK_BUFFER_START", "TRANSFORM_FEEDBACK_PAUSED", "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", "TRANSFORM_FEEDBACK_VARYINGS", "TRIANGLE", "TRIANGLES", "TRIANGLE_FAN", "TRIANGLE_STRIP", "TYPE_BACK_FORWARD", "TYPE_ERR", "TYPE_MISMATCH_ERR", "TYPE_NAVIGATE", "TYPE_RELOAD", "TYPE_RESERVED", "Table", "TaskAttributionTiming", "Text", "TextDecoder", "TextDecoderStream", "TextEncoder", "TextEncoderStream", "TextEvent", "TextMetrics", "TextTrack", "TextTrackCue", "TextTrackCueList", "TextTrackList", "TimeEvent", "TimeRanges", "Touch", "TouchEvent", "TouchList", "TrackEvent", "TransformStream", "TransitionEvent", "TreeWalker", "TrustedHTML", "TrustedScript", "TrustedScriptURL", "TrustedTypePolicy", "TrustedTypePolicyFactory", "TypeError", "TypedObject", "U2F", "UIEvent", "UNCACHED", "UNIFORM", "UNIFORM_ARRAY_STRIDE", "UNIFORM_BLOCK_ACTIVE_UNIFORMS", "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", "UNIFORM_BLOCK_BINDING", "UNIFORM_BLOCK_DATA_SIZE", "UNIFORM_BLOCK_INDEX", "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", "UNIFORM_BUFFER", "UNIFORM_BUFFER_BINDING", "UNIFORM_BUFFER_OFFSET_ALIGNMENT", "UNIFORM_BUFFER_SIZE", "UNIFORM_BUFFER_START", "UNIFORM_IS_ROW_MAJOR", "UNIFORM_MATRIX_STRIDE", "UNIFORM_OFFSET", "UNIFORM_SIZE", "UNIFORM_TYPE", "UNKNOWN_ERR", "UNKNOWN_RULE", "UNMASKED_RENDERER_WEBGL", "UNMASKED_VENDOR_WEBGL", "UNORDERED_NODE_ITERATOR_TYPE", "UNORDERED_NODE_SNAPSHOT_TYPE", "UNPACK_ALIGNMENT", "UNPACK_COLORSPACE_CONVERSION_WEBGL", "UNPACK_FLIP_Y_WEBGL", "UNPACK_IMAGE_HEIGHT", "UNPACK_PREMULTIPLY_ALPHA_WEBGL", "UNPACK_ROW_LENGTH", "UNPACK_SKIP_IMAGES", "UNPACK_SKIP_PIXELS", "UNPACK_SKIP_ROWS", "UNSCHEDULED_STATE", "UNSENT", "UNSIGNALED", "UNSIGNED_BYTE", "UNSIGNED_INT", "UNSIGNED_INT_10F_11F_11F_REV", "UNSIGNED_INT_24_8", "UNSIGNED_INT_2_10_10_10_REV", "UNSIGNED_INT_5_9_9_9_REV", "UNSIGNED_INT_SAMPLER_2D", "UNSIGNED_INT_SAMPLER_2D_ARRAY", "UNSIGNED_INT_SAMPLER_3D", "UNSIGNED_INT_SAMPLER_CUBE", "UNSIGNED_INT_VEC2", "UNSIGNED_INT_VEC3", "UNSIGNED_INT_VEC4", "UNSIGNED_NORMALIZED", "UNSIGNED_SHORT", "UNSIGNED_SHORT_4_4_4_4", "UNSIGNED_SHORT_5_5_5_1", "UNSIGNED_SHORT_5_6_5", "UNSPECIFIED_EVENT_TYPE_ERR", "UPDATEREADY", "URIError", "URL", "URLSearchParams", "URLUnencoded", "URL_MISMATCH_ERR", "USB", "USBAlternateInterface", "USBConfiguration", "USBConnectionEvent", "USBDevice", "USBEndpoint", "USBInTransferResult", "USBInterface", "USBIsochronousInTransferPacket", "USBIsochronousInTransferResult", "USBIsochronousOutTransferPacket", "USBIsochronousOutTransferResult", "USBOutTransferResult", "UTC", "Uint16Array", "Uint32Array", "Uint8Array", "Uint8ClampedArray", "UserActivation", "UserMessageHandler", "UserMessageHandlersNamespace", "UserProximityEvent", "VALIDATE_STATUS", "VALIDATION_ERR", "VARIABLES_RULE", "VENDOR", "VERSION", "VERSION_CHANGE", "VERSION_ERR", "VERTEX", "VERTEX_ARRAY_BINDING", "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", "VERTEX_ATTRIB_ARRAY_DIVISOR", "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", "VERTEX_ATTRIB_ARRAY_ENABLED", "VERTEX_ATTRIB_ARRAY_INTEGER", "VERTEX_ATTRIB_ARRAY_NORMALIZED", "VERTEX_ATTRIB_ARRAY_POINTER", "VERTEX_ATTRIB_ARRAY_SIZE", "VERTEX_ATTRIB_ARRAY_STRIDE", "VERTEX_ATTRIB_ARRAY_TYPE", "VERTEX_SHADER", "VERTICAL", "VERTICAL_AXIS", "VER_ERR", "VIEWPORT", "VIEWPORT_RULE", "VRDisplay", "VRDisplayCapabilities", "VRDisplayEvent", "VREyeParameters", "VRFieldOfView", "VRFrameData", "VRPose", "VRStageParameters", "VTTCue", "VTTRegion", "ValidityState", "VideoPlaybackQuality", "VideoStreamTrack", "VisualViewport", "WAIT_FAILED", "WEBKIT_FILTER_RULE", "WEBKIT_KEYFRAMES_RULE", "WEBKIT_KEYFRAME_RULE", "WEBKIT_REGION_RULE", "WRITE", "WRONG_DOCUMENT_ERR", "WakeLock", "WakeLockSentinel", "WasmAnyRef", "WaveShaperNode", "WeakMap", "WeakRef", "WeakSet", "WebAssembly", "WebGL2RenderingContext", "WebGLActiveInfo", "WebGLBuffer", "WebGLContextEvent", "WebGLFramebuffer", "WebGLProgram", "WebGLQuery", "WebGLRenderbuffer", "WebGLRenderingContext", "WebGLSampler", "WebGLShader", "WebGLShaderPrecisionFormat", "WebGLSync", "WebGLTexture", "WebGLTransformFeedback", "WebGLUniformLocation", "WebGLVertexArray", "WebGLVertexArrayObject", "WebKitAnimationEvent", "WebKitBlobBuilder", "WebKitCSSFilterRule", "WebKitCSSFilterValue", "WebKitCSSKeyframeRule", "WebKitCSSKeyframesRule", "WebKitCSSMatrix", "WebKitCSSRegionRule", "WebKitCSSTransformValue", "WebKitDataCue", "WebKitGamepad", "WebKitMediaKeyError", "WebKitMediaKeyMessageEvent", "WebKitMediaKeySession", "WebKitMediaKeys", "WebKitMediaSource", "WebKitMutationObserver", "WebKitNamespace", "WebKitPlaybackTargetAvailabilityEvent", "WebKitPoint", "WebKitShadowRoot", "WebKitSourceBuffer", "WebKitSourceBufferList", "WebKitTransitionEvent", "WebSocket", "WebkitAlignContent", "WebkitAlignItems", "WebkitAlignSelf", "WebkitAnimation", "WebkitAnimationDelay", "WebkitAnimationDirection", "WebkitAnimationDuration", "WebkitAnimationFillMode", "WebkitAnimationIterationCount", "WebkitAnimationName", "WebkitAnimationPlayState", "WebkitAnimationTimingFunction", "WebkitAppearance", "WebkitBackfaceVisibility", "WebkitBackgroundClip", "WebkitBackgroundOrigin", "WebkitBackgroundSize", "WebkitBorderBottomLeftRadius", "WebkitBorderBottomRightRadius", "WebkitBorderImage", "WebkitBorderRadius", "WebkitBorderTopLeftRadius", "WebkitBorderTopRightRadius", "WebkitBoxAlign", "WebkitBoxDirection", "WebkitBoxFlex", "WebkitBoxOrdinalGroup", "WebkitBoxOrient", "WebkitBoxPack", "WebkitBoxShadow", "WebkitBoxSizing", "WebkitFilter", "WebkitFlex", "WebkitFlexBasis", "WebkitFlexDirection", "WebkitFlexFlow", "WebkitFlexGrow", "WebkitFlexShrink", "WebkitFlexWrap", "WebkitJustifyContent", "WebkitLineClamp", "WebkitMask", "WebkitMaskClip", "WebkitMaskComposite", "WebkitMaskImage", "WebkitMaskOrigin", "WebkitMaskPosition", "WebkitMaskPositionX", "WebkitMaskPositionY", "WebkitMaskRepeat", "WebkitMaskSize", "WebkitOrder", "WebkitPerspective", "WebkitPerspectiveOrigin", "WebkitTextFillColor", "WebkitTextSizeAdjust", "WebkitTextStroke", "WebkitTextStrokeColor", "WebkitTextStrokeWidth", "WebkitTransform", "WebkitTransformOrigin", "WebkitTransformStyle", "WebkitTransition", "WebkitTransitionDelay", "WebkitTransitionDuration", "WebkitTransitionProperty", "WebkitTransitionTimingFunction", "WebkitUserSelect", "WheelEvent", "Window", "Worker", "Worklet", "WritableStream", "WritableStreamDefaultWriter", "XMLDocument", "XMLHttpRequest", "XMLHttpRequestEventTarget", "XMLHttpRequestException", "XMLHttpRequestProgressEvent", "XMLHttpRequestUpload", "XMLSerializer", "XMLStylesheetProcessingInstruction", "XPathEvaluator", "XPathException", "XPathExpression", "XPathNSResolver", "XPathResult", "XRBoundedReferenceSpace", "XRDOMOverlayState", "XRFrame", "XRHitTestResult", "XRHitTestSource", "XRInputSource", "XRInputSourceArray", "XRInputSourceEvent", "XRInputSourcesChangeEvent", "XRLayer", "XRPose", "XRRay", "XRReferenceSpace", "XRReferenceSpaceEvent", "XRRenderState", "XRRigidTransform", "XRSession", "XRSessionEvent", "XRSpace", "XRSystem", "XRTransientInputHitTestResult", "XRTransientInputHitTestSource", "XRView", "XRViewerPose", "XRViewport", "XRWebGLLayer", "XSLTProcessor", "ZERO", "_XD0M_", "_YD0M_", "__brand", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__opera", "__proto__", "_browserjsran", "a", "aLink", "abbr", "abort", "aborted", "abs", "absolute", "acceleration", "accelerationIncludingGravity", "accelerator", "accept", "acceptCharset", "acceptNode", "access", "accessKey", "accessKeyLabel", "accuracy", "acos", "acosh", "action", "actionURL", "actions", "activated", "active", "activeCues", "activeElement", "activeSourceBuffers", "activeSourceCount", "activeTexture", "activeVRDisplays", "actualBoundingBoxAscent", "actualBoundingBoxDescent", "actualBoundingBoxLeft", "actualBoundingBoxRight", "add", "addAll", "addBehavior", "addCandidate", "addColorStop", "addCue", "addElement", "addEventListener", "addFilter", "addFromString", "addFromUri", "addIceCandidate", "addImport", "addListener", "addModule", "addNamed", "addPageRule", "addPath", "addPointer", "addRange", "addRegion", "addRule", "addSearchEngine", "addSourceBuffer", "addStream", "addTextTrack", "addTrack", "addTransceiver", "addWakeLockListener", "added", "addedNodes", "additionalName", "additiveSymbols", "addons", "address", "addressLine", "addressModeU", "addressModeV", "addressModeW", "adoptNode", "adoptedStyleSheets", "adr", "advance", "after", "album", "alert", "algorithm", "align", "align-content", "align-items", "align-self", "alignContent", "alignItems", "alignSelf", "alignmentBaseline", "alinkColor", "all", "allSettled", "allow", "allowFullscreen", "allowPaymentRequest", "allowedDirections", "allowedFeatures", "allowedToPlay", "allowsFeature", "alpha", "alphaMode", "alphaToCoverageEnabled", "alt", "altGraphKey", "altHtml", "altKey", "altLeft", "alternate", "alternateSetting", "alternates", "altitude", "altitudeAccuracy", "amplitude", "ancestorOrigins", "anchor", "anchorNode", "anchorOffset", "anchors", "and", "angle", "angularAcceleration", "angularVelocity", "animVal", "animate", "animatedInstanceRoot", "animatedNormalizedPathSegList", "animatedPathSegList", "animatedPoints", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationStartTime", "animationTimingFunction", "animationsPaused", "anniversary", "antialias", "anticipatedRemoval", "any", "app", "appCodeName", "appMinorVersion", "appName", "appNotifications", "appVersion", "appearance", "append", "appendBuffer", "appendChild", "appendData", "appendItem", "appendMedium", "appendNamed", "appendRule", "appendStream", "appendWindowEnd", "appendWindowStart", "applets", "applicationCache", "applicationServerKey", "apply", "applyConstraints", "applyElement", "arc", "arcTo", "architecture", "archive", "areas", "arguments", "ariaAtomic", "ariaAutoComplete", "ariaBusy", "ariaChecked", "ariaColCount", "ariaColIndex", "ariaColSpan", "ariaCurrent", "ariaDescription", "ariaDisabled", "ariaExpanded", "ariaHasPopup", "ariaHidden", "ariaKeyShortcuts", "ariaLabel", "ariaLevel", "ariaLive", "ariaModal", "ariaMultiLine", "ariaMultiSelectable", "ariaOrientation", "ariaPlaceholder", "ariaPosInSet", "ariaPressed", "ariaReadOnly", "ariaRelevant", "ariaRequired", "ariaRoleDescription", "ariaRowCount", "ariaRowIndex", "ariaRowSpan", "ariaSelected", "ariaSetSize", "ariaSort", "ariaValueMax", "ariaValueMin", "ariaValueNow", "ariaValueText", "arrayBuffer", "arrayLayerCount", "arrayStride", "artist", "artwork", "as", "asIntN", "asUintN", "asin", "asinh", "aspect", "assert", "assign", "assignedElements", "assignedNodes", "assignedSlot", "async", "asyncIterator", "atEnd", "atan", "atan2", "atanh", "atob", "attachEvent", "attachInternals", "attachShader", "attachShadow", "attachments", "attack", "attestationObject", "attrChange", "attrName", "attributeFilter", "attributeName", "attributeNamespace", "attributeOldValue", "attributeStyleMap", "attributes", "attribution", "audioBitsPerSecond", "audioTracks", "audioWorklet", "authenticatedSignedWrites", "authenticatorData", "autoIncrement", "autobuffer", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "automationRate", "autoplay", "availHeight", "availLeft", "availTop", "availWidth", "availability", "available", "aversion", "ax", "axes", "axis", "ay", "azimuth", "b", "back", "backface-visibility", "backfaceVisibility", "background", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "backgroundAttachment", "backgroundBlendMode", "backgroundClip", "backgroundColor", "backgroundFetch", "backgroundImage", "backgroundOrigin", "backgroundPosition", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize", "badInput", "badge", "balance", "baseArrayLayer", "baseFrequencyX", "baseFrequencyY", "baseLatency", "baseLayer", "baseMipLevel", "baseNode", "baseOffset", "baseURI", "baseVal", "baselineShift", "battery", "bday", "before", "beginComputePass", "beginElement", "beginElementAt", "beginOcclusionQuery", "beginPath", "beginQuery", "beginRenderPass", "beginTransformFeedback", "beginningOfPassWriteIndex", "behavior", "behaviorCookie", "behaviorPart", "behaviorUrns", "beta", "bezierCurveTo", "bgColor", "bgProperties", "bias", "big", "bigint64", "biguint64", "binaryType", "bind", "bindAttribLocation", "bindBuffer", "bindBufferBase", "bindBufferRange", "bindFramebuffer", "bindGroupLayouts", "bindRenderbuffer", "bindSampler", "bindTexture", "bindTransformFeedback", "bindVertexArray", "binding", "bitness", "blend", "blendColor", "blendEquation", "blendEquationSeparate", "blendFunc", "blendFuncSeparate", "blink", "blitFramebuffer", "blob", "block-size", "blockDirection", "blockSize", "blockedURI", "blue", "bluetooth", "blur", "body", "bodyUsed", "bold", "bookmarks", "booleanValue", "border", "border-block", "border-block-color", "border-block-end", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-block-start", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-style", "border-block-width", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-end-end-radius", "border-end-start-radius", "border-image", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width", "border-inline", "border-inline-color", "border-inline-end", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width", "border-inline-start", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-style", "border-inline-width", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-start-end-radius", "border-start-start-radius", "border-style", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "border-width", "borderBlock", "borderBlockColor", "borderBlockEnd", "borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth", "borderBlockStart", "borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth", "borderBlockStyle", "borderBlockWidth", "borderBottom", "borderBottomColor", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStyle", "borderBottomWidth", "borderBoxSize", "borderCollapse", "borderColor", "borderColorDark", "borderColorLight", "borderEndEndRadius", "borderEndStartRadius", "borderImage", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderInline", "borderInlineColor", "borderInlineEnd", "borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth", "borderInlineStart", "borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth", "borderInlineStyle", "borderInlineWidth", "borderLeft", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRadius", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderStyle", "borderTop", "borderTopColor", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStyle", "borderTopWidth", "borderWidth", "bottom", "bottomMargin", "bound", "boundElements", "boundingClientRect", "boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "bounds", "boundsGeometry", "box-decoration-break", "box-shadow", "box-sizing", "boxDecorationBreak", "boxShadow", "boxSizing", "brand", "brands", "break-after", "break-before", "break-inside", "breakAfter", "breakBefore", "breakInside", "broadcast", "browserLanguage", "btoa", "bubbles", "buffer", "bufferData", "bufferDepth", "bufferSize", "bufferSubData", "buffered", "bufferedAmount", "bufferedAmountLowThreshold", "buffers", "buildID", "buildNumber", "button", "buttonID", "buttons", "byteLength", "byteOffset", "bytesPerRow", "bytesWritten", "c", "cache", "caches", "call", "caller", "canBeFormatted", "canBeMounted", "canBeShared", "canHaveChildren", "canHaveHTML", "canInsertDTMF", "canMakePayment", "canPlayType", "canPresent", "canTrickleIceCandidates", "cancel", "cancelAndHoldAtTime", "cancelAnimationFrame", "cancelBubble", "cancelIdleCallback", "cancelScheduledValues", "cancelVideoFrameCallback", "cancelWatchAvailability", "cancelable", "candidate", "canonicalUUID", "canvas", "capabilities", "caption", "caption-side", "captionSide", "capture", "captureEvents", "captureStackTrace", "captureStream", "caret-color", "caretBidiLevel", "caretColor", "caretPositionFromPoint", "caretRangeFromPoint", "cast", "catch", "category", "cbrt", "cd", "ceil", "cellIndex", "cellPadding", "cellSpacing", "cells", "ch", "chOff", "chain", "challenge", "changeType", "changedTouches", "channel", "channelCount", "channelCountMode", "channelInterpretation", "char", "charAt", "charCode", "charCodeAt", "charIndex", "charLength", "characterData", "characterDataOldValue", "characterSet", "characteristic", "charging", "chargingTime", "charset", "check", "checkEnclosure", "checkFramebufferStatus", "checkIntersection", "checkValidity", "checked", "childElementCount", "childList", "childNodes", "children", "chrome", "ciphertext", "cite", "city", "claimInterface", "claimed", "classList", "className", "classid", "clear", "clearAppBadge", "clearAttributes", "clearBuffer", "clearBufferfi", "clearBufferfv", "clearBufferiv", "clearBufferuiv", "clearColor", "clearData", "clearDepth", "clearHalt", "clearImmediate", "clearInterval", "clearLiveSeekableRange", "clearMarks", "clearMaxGCPauseAccumulator", "clearMeasures", "clearParameters", "clearRect", "clearResourceTimings", "clearShadow", "clearStencil", "clearTimeout", "clearValue", "clearWatch", "click", "clickCount", "clientDataJSON", "clientHeight", "clientInformation", "clientLeft", "clientRect", "clientRects", "clientTop", "clientWaitSync", "clientWidth", "clientX", "clientY", "clip", "clip-path", "clip-rule", "clipBottom", "clipLeft", "clipPath", "clipPathUnits", "clipRight", "clipRule", "clipTop", "clipboard", "clipboardData", "clone", "cloneContents", "cloneNode", "cloneRange", "close", "closePath", "closed", "closest", "clz", "clz32", "cm", "cmp", "code", "codeBase", "codePointAt", "codeType", "colSpan", "collapse", "collapseToEnd", "collapseToStart", "collapsed", "collect", "colno", "color", "color-adjust", "color-interpolation", "color-interpolation-filters", "colorAdjust", "colorAttachments", "colorDepth", "colorFormats", "colorInterpolation", "colorInterpolationFilters", "colorMask", "colorSpace", "colorType", "cols", "column-count", "column-fill", "column-gap", "column-rule", "column-rule-color", "column-rule-style", "column-rule-width", "column-span", "column-width", "columnCount", "columnFill", "columnGap", "columnNumber", "columnRule", "columnRuleColor", "columnRuleStyle", "columnRuleWidth", "columnSpan", "columnWidth", "columns", "command", "commit", "commitPreferences", "commitStyles", "commonAncestorContainer", "compact", "compare", "compareBoundaryPoints", "compareDocumentPosition", "compareEndPoints", "compareExchange", "compareNode", "comparePoint", "compatMode", "compatible", "compile", "compileShader", "compileStreaming", "complete", "component", "componentFromPoint", "composed", "composedPath", "composite", "compositionEndOffset", "compositionStartOffset", "compressedTexImage2D", "compressedTexImage3D", "compressedTexSubImage2D", "compressedTexSubImage3D", "compute", "computedStyleMap", "concat", "conditionText", "coneInnerAngle", "coneOuterAngle", "coneOuterGain", "configurable", "configuration", "configurationName", "configurationValue", "configurations", "configure", "confirm", "confirmComposition", "confirmSiteSpecificTrackingException", "confirmWebWideTrackingException", "connect", "connectEnd", "connectShark", "connectStart", "connected", "connection", "connectionList", "connectionSpeed", "connectionState", "connections", "console", "consolidate", "constants", "constraint", "constrictionActive", "construct", "constructor", "contactID", "contain", "containerId", "containerName", "containerSrc", "containerType", "contains", "containsNode", "content", "contentBoxSize", "contentDocument", "contentEditable", "contentHint", "contentOverflow", "contentRect", "contentScriptType", "contentStyleType", "contentType", "contentWindow", "context", "contextMenu", "contextmenu", "continue", "continuePrimaryKey", "continuous", "control", "controlTransferIn", "controlTransferOut", "controller", "controls", "controlsList", "convertPointFromNode", "convertQuadFromNode", "convertRectFromNode", "convertToBlob", "convertToSpecifiedUnits", "cookie", "cookieEnabled", "coords", "copyBufferSubData", "copyBufferToBuffer", "copyBufferToTexture", "copyExternalImageToTexture", "copyFromChannel", "copyTexImage2D", "copyTexSubImage2D", "copyTexSubImage3D", "copyTextureToBuffer", "copyTextureToTexture", "copyToChannel", "copyWithin", "correspondingElement", "correspondingUseElement", "corruptedVideoFrames", "cos", "cosh", "count", "countReset", "counter-increment", "counter-reset", "counter-set", "counterIncrement", "counterReset", "counterSet", "country", "cpuClass", "cpuSleepAllowed", "create", "createAnalyser", "createAnswer", "createAttribute", "createAttributeNS", "createBindGroup", "createBindGroupLayout", "createBiquadFilter", "createBuffer", "createBufferSource", "createCDATASection", "createCSSStyleSheet", "createCaption", "createChannelMerger", "createChannelSplitter", "createCommandEncoder", "createComment", "createComputePipeline", "createComputePipelineAsync", "createConstantSource", "createContextualFragment", "createControlRange", "createConvolver", "createDTMFSender", "createDataChannel", "createDelay", "createDelayNode", "createDocument", "createDocumentFragment", "createDocumentType", "createDynamicsCompressor", "createElement", "createElementNS", "createEntityReference", "createEvent", "createEventObject", "createExpression", "createFramebuffer", "createFunction", "createGain", "createGainNode", "createHTML", "createHTMLDocument", "createIIRFilter", "createImageBitmap", "createImageData", "createIndex", "createJavaScriptNode", "createLinearGradient", "createMediaElementSource", "createMediaKeys", "createMediaStreamDestination", "createMediaStreamSource", "createMediaStreamTrackSource", "createMutableFile", "createNSResolver", "createNodeIterator", "createNotification", "createObjectStore", "createObjectURL", "createOffer", "createOscillator", "createPanner", "createPattern", "createPeriodicWave", "createPipelineLayout", "createPolicy", "createPopup", "createProcessingInstruction", "createProgram", "createQuery", "createQuerySet", "createRadialGradient", "createRange", "createRangeCollection", "createReader", "createRenderBundleEncoder", "createRenderPipeline", "createRenderPipelineAsync", "createRenderbuffer", "createSVGAngle", "createSVGLength", "createSVGMatrix", "createSVGNumber", "createSVGPathSegArcAbs", "createSVGPathSegArcRel", "createSVGPathSegClosePath", "createSVGPathSegCurvetoCubicAbs", "createSVGPathSegCurvetoCubicRel", "createSVGPathSegCurvetoCubicSmoothAbs", "createSVGPathSegCurvetoCubicSmoothRel", "createSVGPathSegCurvetoQuadraticAbs", "createSVGPathSegCurvetoQuadraticRel", "createSVGPathSegCurvetoQuadraticSmoothAbs", "createSVGPathSegCurvetoQuadraticSmoothRel", "createSVGPathSegLinetoAbs", "createSVGPathSegLinetoHorizontalAbs", "createSVGPathSegLinetoHorizontalRel", "createSVGPathSegLinetoRel", "createSVGPathSegLinetoVerticalAbs", "createSVGPathSegLinetoVerticalRel", "createSVGPathSegMovetoAbs", "createSVGPathSegMovetoRel", "createSVGPoint", "createSVGRect", "createSVGTransform", "createSVGTransformFromMatrix", "createSampler", "createScript", "createScriptProcessor", "createScriptURL", "createSession", "createShader", "createShaderModule", "createShadowRoot", "createStereoPanner", "createStyleSheet", "createTBody", "createTFoot", "createTHead", "createTextNode", "createTextRange", "createTexture", "createTouch", "createTouchList", "createTransformFeedback", "createTreeWalker", "createVertexArray", "createView", "createWaveShaper", "creationTime", "credentials", "crossOrigin", "crossOriginIsolated", "crypto", "csi", "csp", "cssFloat", "cssRules", "cssText", "cssValueType", "ctrlKey", "ctrlLeft", "cues", "cullFace", "cullMode", "currentDirection", "currentLocalDescription", "currentNode", "currentPage", "currentRect", "currentRemoteDescription", "currentScale", "currentScript", "currentSrc", "currentState", "currentStyle", "currentTarget", "currentTime", "currentTranslate", "currentView", "cursor", "curve", "customElements", "customError", "cx", "cy", "d", "data", "dataFld", "dataFormatAs", "dataLoss", "dataLossMessage", "dataPageSize", "dataSrc", "dataTransfer", "database", "databases", "dataset", "dateTime", "db", "debug", "debuggerEnabled", "declare", "decode", "decodeAudioData", "decodeURI", "decodeURIComponent", "decodedBodySize", "decoding", "decodingInfo", "decrypt", "default", "defaultCharset", "defaultChecked", "defaultMuted", "defaultPlaybackRate", "defaultPolicy", "defaultPrevented", "defaultQueue", "defaultRequest", "defaultSelected", "defaultStatus", "defaultURL", "defaultValue", "defaultView", "defaultstatus", "defer", "define", "defineMagicFunction", "defineMagicVariable", "defineProperties", "defineProperty", "deg", "delay", "delayTime", "delegatesFocus", "delete", "deleteBuffer", "deleteCaption", "deleteCell", "deleteContents", "deleteData", "deleteDatabase", "deleteFramebuffer", "deleteFromDocument", "deleteIndex", "deleteMedium", "deleteObjectStore", "deleteProgram", "deleteProperty", "deleteQuery", "deleteRenderbuffer", "deleteRow", "deleteRule", "deleteSampler", "deleteShader", "deleteSync", "deleteTFoot", "deleteTHead", "deleteTexture", "deleteTransformFeedback", "deleteVertexArray", "deliverChangeRecords", "delivery", "deliveryInfo", "deliveryStatus", "deliveryTimestamp", "delta", "deltaMode", "deltaX", "deltaY", "deltaZ", "dependentLocality", "depthBias", "depthBiasClamp", "depthBiasSlopeScale", "depthClearValue", "depthCompare", "depthFailOp", "depthFar", "depthFunc", "depthLoadOp", "depthMask", "depthNear", "depthOrArrayLayers", "depthRange", "depthReadOnly", "depthStencil", "depthStencilAttachment", "depthStencilFormat", "depthStoreOp", "depthWriteEnabled", "deref", "deriveBits", "deriveKey", "description", "deselectAll", "designMode", "desiredSize", "destination", "destinationURL", "destroy", "detach", "detachEvent", "detachShader", "detail", "details", "detect", "detune", "device", "deviceClass", "deviceId", "deviceMemory", "devicePixelContentBoxSize", "devicePixelRatio", "deviceProtocol", "deviceSubclass", "deviceVersionMajor", "deviceVersionMinor", "deviceVersionSubminor", "deviceXDPI", "deviceYDPI", "didTimeout", "diffuseConstant", "digest", "dimension", "dimensions", "dir", "dirName", "direction", "dirxml", "disable", "disablePictureInPicture", "disableRemotePlayback", "disableVertexAttribArray", "disabled", "dischargingTime", "disconnect", "disconnectShark", "dispatchEvent", "dispatchWorkgroups", "dispatchWorkgroupsIndirect", "display", "displayId", "displayName", "disposition", "distanceModel", "div", "divisor", "djsapi", "djsproxy", "doImport", "doNotTrack", "doScroll", "doctype", "document", "documentElement", "documentMode", "documentURI", "dolphin", "dolphinGameCenter", "dolphininfo", "dolphinmeta", "domComplete", "domContentLoadedEventEnd", "domContentLoadedEventStart", "domInteractive", "domLoading", "domOverlayState", "domain", "domainLookupEnd", "domainLookupStart", "dominant-baseline", "dominantBaseline", "done", "dopplerFactor", "dotAll", "downDegrees", "downlink", "download", "downloadTotal", "downloaded", "dpcm", "dpi", "dppx", "dragDrop", "draggable", "draw", "drawArrays", "drawArraysInstanced", "drawArraysInstancedANGLE", "drawBuffers", "drawCustomFocusRing", "drawElements", "drawElementsInstanced", "drawElementsInstancedANGLE", "drawFocusIfNeeded", "drawImage", "drawImageFromRect", "drawIndexed", "drawIndexedIndirect", "drawIndirect", "drawRangeElements", "drawSystemFocusRing", "drawingBufferHeight", "drawingBufferWidth", "dropEffect", "droppedVideoFrames", "dropzone", "dstFactor", "dtmf", "dump", "dumpProfile", "duplicate", "durability", "duration", "dvname", "dvnum", "dx", "dy", "dynsrc", "e", "edgeMode", "effect", "effectAllowed", "effectiveDirective", "effectiveType", "elapsedTime", "element", "elementFromPoint", "elementTiming", "elements", "elementsFromPoint", "elevation", "ellipse", "em", "email", "embeds", "emma", "empty", "empty-cells", "emptyCells", "emptyHTML", "emptyScript", "emulatedPosition", "enable", "enableBackground", "enableDelegations", "enableStyleSheetsForSet", "enableVertexAttribArray", "enabled", "enabledPlugin", "encode", "encodeInto", "encodeURI", "encodeURIComponent", "encodedBodySize", "encoding", "encodingInfo", "encrypt", "enctype", "end", "endContainer", "endElement", "endElementAt", "endOcclusionQuery", "endOfPassWriteIndex", "endOfStream", "endOffset", "endQuery", "endTime", "endTransformFeedback", "ended", "endpoint", "endpointNumber", "endpoints", "endsWith", "enterKeyHint", "entities", "entries", "entryPoint", "entryType", "enumerable", "enumerate", "enumerateDevices", "enumerateEditable", "environmentBlendMode", "equals", "error", "errorCode", "errorDetail", "errorText", "escape", "estimate", "eval", "evaluate", "event", "eventPhase", "every", "ex", "exception", "exchange", "exec", "execCommand", "execCommandShowHelp", "execScript", "executeBundles", "exitFullscreen", "exitPictureInPicture", "exitPointerLock", "exitPresent", "exp", "expand", "expandEntityReferences", "expando", "expansion", "expiration", "expirationTime", "expires", "expiryDate", "explicitOriginalTarget", "expm1", "exponent", "exponentialRampToValueAtTime", "exportKey", "exports", "extend", "extensions", "extentNode", "extentOffset", "external", "externalResourcesRequired", "externalTexture", "extractContents", "extractable", "eye", "f", "face", "factoryReset", "failOp", "failureReason", "fallback", "family", "familyName", "farthestViewportElement", "fastSeek", "fatal", "featureId", "featurePolicy", "featureSettings", "features", "fenceSync", "fetch", "fetchStart", "fftSize", "fgColor", "fieldOfView", "file", "fileCreatedDate", "fileHandle", "fileModifiedDate", "fileName", "fileSize", "fileUpdatedDate", "filename", "files", "filesystem", "fill", "fill-opacity", "fill-rule", "fillLightMode", "fillOpacity", "fillRect", "fillRule", "fillStyle", "fillText", "filter", "filterResX", "filterResY", "filterUnits", "filters", "finally", "find", "findIndex", "findRule", "findText", "finish", "finished", "fireEvent", "firesTouchEvents", "firstChild", "firstElementChild", "firstPage", "fixed", "flags", "flat", "flatMap", "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "flexBasis", "flexDirection", "flexFlow", "flexGrow", "flexShrink", "flexWrap", "flipX", "flipY", "float", "float32", "float64", "flood-color", "flood-opacity", "floodColor", "floodOpacity", "floor", "flush", "focus", "focusNode", "focusOffset", "font", "font-family", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-synthesis", "font-variant", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-variation-settings", "font-weight", "fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontOpticalSizing", "fontSize", "fontSizeAdjust", "fontSmoothingEnabled", "fontStretch", "fontStyle", "fontSynthesis", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontVariationSettings", "fontWeight", "fontcolor", "fontfaces", "fonts", "fontsize", "for", "forEach", "force", "forceFallbackAdapter", "forceRedraw", "form", "formAction", "formData", "formEnctype", "formMethod", "formNoValidate", "formTarget", "format", "formatToParts", "forms", "forward", "forwardX", "forwardY", "forwardZ", "foundation", "fr", "fragment", "fragmentDirective", "frame", "frameBorder", "frameElement", "frameSpacing", "framebuffer", "framebufferHeight", "framebufferRenderbuffer", "framebufferTexture2D", "framebufferTextureLayer", "framebufferWidth", "frames", "freeSpace", "freeze", "frequency", "frequencyBinCount", "from", "fromCharCode", "fromCodePoint", "fromElement", "fromEntries", "fromFloat32Array", "fromFloat64Array", "fromMatrix", "fromPoint", "fromQuad", "fromRect", "frontFace", "fround", "fullPath", "fullScreen", "fullVersionList", "fullscreen", "fullscreenElement", "fullscreenEnabled", "fx", "fy", "g", "gain", "gamepad", "gamma", "gap", "gatheringState", "gatt", "genderIdentity", "generateCertificate", "generateKey", "generateMipmap", "generateRequest", "geolocation", "gestureObject", "get", "getActiveAttrib", "getActiveUniform", "getActiveUniformBlockName", "getActiveUniformBlockParameter", "getActiveUniforms", "getAdjacentText", "getAll", "getAllKeys", "getAllResponseHeaders", "getAllowlistForFeature", "getAnimations", "getAsFile", "getAsString", "getAttachedShaders", "getAttribLocation", "getAttribute", "getAttributeNS", "getAttributeNames", "getAttributeNode", "getAttributeNodeNS", "getAttributeType", "getAudioTracks", "getAvailability", "getBBox", "getBattery", "getBigInt64", "getBigUint64", "getBindGroupLayout", "getBlob", "getBookmark", "getBoundingClientRect", "getBounds", "getBoxQuads", "getBufferParameter", "getBufferSubData", "getByteFrequencyData", "getByteTimeDomainData", "getCSSCanvasContext", "getCTM", "getCandidateWindowClientRect", "getCanonicalLocales", "getCapabilities", "getChannelData", "getCharNumAtPosition", "getCharacteristic", "getCharacteristics", "getClientExtensionResults", "getClientRect", "getClientRects", "getCoalescedEvents", "getCompilationInfo", "getCompositionAlternatives", "getComputedStyle", "getComputedTextLength", "getComputedTiming", "getConfiguration", "getConstraints", "getContext", "getContextAttributes", "getContributingSources", "getCounterValue", "getCueAsHTML", "getCueById", "getCurrentPosition", "getCurrentTexture", "getCurrentTime", "getData", "getDatabaseNames", "getDate", "getDay", "getDefaultComputedStyle", "getDescriptor", "getDescriptors", "getDestinationInsertionPoints", "getDevices", "getDirectory", "getDisplayMedia", "getDistributedNodes", "getEditable", "getElementById", "getElementsByClassName", "getElementsByName", "getElementsByTagName", "getElementsByTagNameNS", "getEnclosureList", "getEndPositionOfChar", "getEntries", "getEntriesByName", "getEntriesByType", "getError", "getExtension", "getExtentOfChar", "getEyeParameters", "getFeature", "getFile", "getFiles", "getFilesAndDirectories", "getFingerprints", "getFloat32", "getFloat64", "getFloatFrequencyData", "getFloatTimeDomainData", "getFloatValue", "getFragDataLocation", "getFrameData", "getFramebufferAttachmentParameter", "getFrequencyResponse", "getFullYear", "getGamepads", "getHighEntropyValues", "getHitTestResults", "getHitTestResultsForTransientInput", "getHours", "getIdentityAssertion", "getIds", "getImageData", "getIndexedParameter", "getInstalledRelatedApps", "getInt16", "getInt32", "getInt8", "getInternalformatParameter", "getIntersectionList", "getItem", "getItems", "getKey", "getKeyframes", "getLayers", "getLayoutMap", "getLineDash", "getLocalCandidates", "getLocalParameters", "getLocalStreams", "getMappedRange", "getMarks", "getMatchedCSSRules", "getMaxGCPauseSinceClear", "getMeasures", "getMetadata", "getMilliseconds", "getMinutes", "getModifierState", "getMonth", "getNamedItem", "getNamedItemNS", "getNativeFramebufferScaleFactor", "getNotifications", "getNotifier", "getNumberOfChars", "getOffsetReferenceSpace", "getOutputTimestamp", "getOverrideHistoryNavigationMode", "getOverrideStyle", "getOwnPropertyDescriptor", "getOwnPropertyDescriptors", "getOwnPropertyNames", "getOwnPropertySymbols", "getParameter", "getParameters", "getParent", "getPathSegAtLength", "getPhotoCapabilities", "getPhotoSettings", "getPointAtLength", "getPose", "getPredictedEvents", "getPreference", "getPreferenceDefault", "getPreferredCanvasFormat", "getPresentationAttribute", "getPreventDefault", "getPrimaryService", "getPrimaryServices", "getProgramInfoLog", "getProgramParameter", "getPropertyCSSValue", "getPropertyPriority", "getPropertyShorthand", "getPropertyType", "getPropertyValue", "getPrototypeOf", "getQuery", "getQueryParameter", "getRGBColorValue", "getRandomValues", "getRangeAt", "getReader", "getReceivers", "getRectValue", "getRegistration", "getRegistrations", "getRemoteCandidates", "getRemoteCertificates", "getRemoteParameters", "getRemoteStreams", "getRenderbufferParameter", "getResponseHeader", "getRoot", "getRootNode", "getRotationOfChar", "getSVGDocument", "getSamplerParameter", "getScreenCTM", "getSeconds", "getSelectedCandidatePair", "getSelection", "getSenders", "getService", "getSettings", "getShaderInfoLog", "getShaderParameter", "getShaderPrecisionFormat", "getShaderSource", "getSimpleDuration", "getSiteIcons", "getSources", "getSpeculativeParserUrls", "getStartPositionOfChar", "getStartTime", "getState", "getStats", "getStatusForPolicy", "getStorageUpdates", "getStreamById", "getStringValue", "getSubStringLength", "getSubscription", "getSupportedConstraints", "getSupportedExtensions", "getSupportedFormats", "getSyncParameter", "getSynchronizationSources", "getTags", "getTargetRanges", "getTexParameter", "getTime", "getTimezoneOffset", "getTiming", "getTotalLength", "getTrackById", "getTracks", "getTransceivers", "getTransform", "getTransformFeedbackVarying", "getTransformToElement", "getTransports", "getType", "getTypeMapping", "getUTCDate", "getUTCDay", "getUTCFullYear", "getUTCHours", "getUTCMilliseconds", "getUTCMinutes", "getUTCMonth", "getUTCSeconds", "getUint16", "getUint32", "getUint8", "getUniform", "getUniformBlockIndex", "getUniformIndices", "getUniformLocation", "getUserMedia", "getVRDisplays", "getValues", "getVarDate", "getVariableValue", "getVertexAttrib", "getVertexAttribOffset", "getVideoPlaybackQuality", "getVideoTracks", "getViewerPose", "getViewport", "getVoices", "getWakeLockState", "getWriter", "getYear", "givenName", "global", "globalAlpha", "globalCompositeOperation", "globalThis", "glyphOrientationHorizontal", "glyphOrientationVertical", "glyphRef", "go", "gpu", "grabFrame", "grad", "gradientTransform", "gradientUnits", "grammars", "green", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows", "gridArea", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridColumn", "gridColumnEnd", "gridColumnGap", "gridColumnStart", "gridGap", "gridRow", "gridRowEnd", "gridRowGap", "gridRowStart", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "gripSpace", "group", "groups", "groupCollapsed", "groupEnd", "groupId", "hadRecentInput", "hand", "handedness", "hapticActuators", "hardwareConcurrency", "has", "hasAttribute", "hasAttributeNS", "hasAttributes", "hasBeenActive", "hasChildNodes", "hasComposition", "hasDynamicOffset", "hasEnrolledInstrument", "hasExtension", "hasExternalDisplay", "hasFeature", "hasFocus", "hasInstance", "hasLayout", "hasOrientation", "hasOwnProperty", "hasPointerCapture", "hasPosition", "hasReading", "hasStorageAccess", "hash", "head", "headers", "heading", "height", "hidden", "hide", "hideFocus", "high", "highWaterMark", "hint", "hints", "history", "honorificPrefix", "honorificSuffix", "horizontalOverflow", "host", "hostCandidate", "hostname", "href", "hrefTranslate", "hreflang", "hspace", "html5TagCheckInerface", "htmlFor", "htmlText", "httpEquiv", "httpRequestStatusCode", "hwTimestamp", "hyphens", "hypot", "iccId", "iceConnectionState", "iceGatheringState", "iceTransport", "icon", "iconURL", "id", "identifier", "identity", "idpLoginUrl", "ignoreBOM", "ignoreCase", "ignoreDepthValues", "image-orientation", "image-rendering", "imageHeight", "imageOrientation", "imageRendering", "imageSizes", "imageSmoothingEnabled", "imageSmoothingQuality", "imageSrcset", "imageWidth", "images", "ime-mode", "imeMode", "implementation", "importExternalTexture", "importKey", "importNode", "importStylesheet", "imports", "impp", "imul", "in", "in1", "in2", "inBandMetadataTrackDispatchType", "inRange", "includes", "incremental", "indeterminate", "index", "indexNames", "indexOf", "indexedDB", "indicate", "indices", "inert", "inertiaDestinationX", "inertiaDestinationY", "info", "init", "initAnimationEvent", "initBeforeLoadEvent", "initClipboardEvent", "initCloseEvent", "initCommandEvent", "initCompositionEvent", "initCustomEvent", "initData", "initDataType", "initDeviceMotionEvent", "initDeviceOrientationEvent", "initDragEvent", "initErrorEvent", "initEvent", "initFocusEvent", "initGestureEvent", "initHashChangeEvent", "initKeyEvent", "initKeyboardEvent", "initMSManipulationEvent", "initMessageEvent", "initMouseEvent", "initMouseScrollEvent", "initMouseWheelEvent", "initMutationEvent", "initNSMouseEvent", "initOverflowEvent", "initPageEvent", "initPageTransitionEvent", "initPointerEvent", "initPopStateEvent", "initProgressEvent", "initScrollAreaEvent", "initSimpleGestureEvent", "initStorageEvent", "initTextEvent", "initTimeEvent", "initTouchEvent", "initTransitionEvent", "initUIEvent", "initWebKitAnimationEvent", "initWebKitTransitionEvent", "initWebKitWheelEvent", "initWheelEvent", "initialTime", "initialize", "initiatorType", "inline-size", "inlineSize", "inlineVerticalFieldOfView", "inner", "innerHTML", "innerHeight", "innerText", "innerWidth", "input", "inputBuffer", "inputEncoding", "inputMethod", "inputMode", "inputSource", "inputSources", "inputType", "inputs", "insertAdjacentElement", "insertAdjacentHTML", "insertAdjacentText", "insertBefore", "insertCell", "insertDTMF", "insertData", "insertDebugMarker", "insertItemBefore", "insertNode", "insertRow", "insertRule", "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline", "inset-inline-end", "inset-inline-start", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "installing", "instanceRoot", "instantiate", "instantiateStreaming", "instruments", "int16", "int32", "int8", "integrity", "interactionMode", "intercept", "interfaceClass", "interfaceName", "interfaceNumber", "interfaceProtocol", "interfaceSubclass", "interfaces", "interimResults", "internalSubset", "interpretation", "intersectionRatio", "intersectionRect", "intersectsNode", "interval", "invalidIteratorState", "invalidateFramebuffer", "invalidateSubFramebuffer", "inverse", "invertSelf", "is", "is2D", "isActive", "isAlternate", "isArray", "isBingCurrentSearchDefault", "isBuffer", "isCandidateWindowVisible", "isChar", "isCollapsed", "isComposing", "isConcatSpreadable", "isConnected", "isContentEditable", "isContentHandlerRegistered", "isContextLost", "isDefaultNamespace", "isDirectory", "isDisabled", "isEnabled", "isEqual", "isEqualNode", "isExtensible", "isExternalCTAP2SecurityKeySupported", "isFallbackAdapter", "isFile", "isFinite", "isFramebuffer", "isFrozen", "isGenerator", "isHTML", "isHistoryNavigation", "isId", "isIdentity", "isInjected", "isInteger", "isIntersecting", "isLockFree", "isMap", "isMultiLine", "isNaN", "isOpen", "isPointInFill", "isPointInPath", "isPointInRange", "isPointInStroke", "isPrefAlternate", "isPresenting", "isPrimary", "isProgram", "isPropertyImplicit", "isProtocolHandlerRegistered", "isPrototypeOf", "isQuery", "isRenderbuffer", "isSafeInteger", "isSameNode", "isSampler", "isScript", "isScriptURL", "isSealed", "isSecureContext", "isSessionSupported", "isShader", "isSupported", "isSync", "isTextEdit", "isTexture", "isTransformFeedback", "isTrusted", "isTypeSupported", "isUserVerifyingPlatformAuthenticatorAvailable", "isVertexArray", "isView", "isVisible", "isochronousTransferIn", "isochronousTransferOut", "isolation", "italics", "item", "itemId", "itemProp", "itemRef", "itemScope", "itemType", "itemValue", "items", "iterateNext", "iterationComposite", "iterator", "javaEnabled", "jobTitle", "join", "json", "justify-content", "justify-items", "justify-self", "justifyContent", "justifyItems", "justifySelf", "k1", "k2", "k3", "k4", "kHz", "keepalive", "kernelMatrix", "kernelUnitLengthX", "kernelUnitLengthY", "kerning", "key", "keyCode", "keyFor", "keyIdentifier", "keyLightEnabled", "keyLocation", "keyPath", "keyStatuses", "keySystem", "keyText", "keyUsage", "keyboard", "keys", "keytype", "kind", "knee", "label", "labels", "lang", "language", "languages", "largeArcFlag", "lastChild", "lastElementChild", "lastEventId", "lastIndex", "lastIndexOf", "lastInputTime", "lastMatch", "lastMessageSubject", "lastMessageType", "lastModified", "lastModifiedDate", "lastPage", "lastParen", "lastState", "lastStyleSheetSet", "latitude", "layerX", "layerY", "layout", "layoutFlow", "layoutGrid", "layoutGridChar", "layoutGridLine", "layoutGridMode", "layoutGridType", "lbound", "left", "leftContext", "leftDegrees", "leftMargin", "leftProjectionMatrix", "leftViewMatrix", "length", "lengthAdjust", "lengthComputable", "letter-spacing", "letterSpacing", "level", "lighting-color", "lightingColor", "limitingConeAngle", "limits", "line", "line-break", "line-height", "lineAlign", "lineBreak", "lineCap", "lineDashOffset", "lineHeight", "lineJoin", "lineNum", "lineNumber", "linePos", "lineTo", "lineWidth", "linearAcceleration", "linearRampToValueAtTime", "linearVelocity", "lineno", "lines", "link", "linkColor", "linkProgram", "links", "list", "list-style", "list-style-image", "list-style-position", "list-style-type", "listStyle", "listStyleImage", "listStylePosition", "listStyleType", "listener", "load", "loadEventEnd", "loadEventStart", "loadOp", "loadTime", "loadTimes", "loaded", "loading", "localDescription", "localName", "localService", "localStorage", "locale", "localeCompare", "location", "locationbar", "lock", "locked", "lockedFile", "locks", "lodMaxClamp", "lodMinClamp", "log", "log10", "log1p", "log2", "logicalXDPI", "logicalYDPI", "longDesc", "longitude", "lookupNamespaceURI", "lookupPrefix", "loop", "loopEnd", "loopStart", "looping", "lost", "low", "lower", "lowerBound", "lowerOpen", "lowsrc", "m11", "m12", "m13", "m14", "m21", "m22", "m23", "m24", "m31", "m32", "m33", "m34", "m41", "m42", "m43", "m44", "magFilter", "makeXRCompatible", "manifest", "manufacturer", "manufacturerName", "map", "mapAsync", "mapState", "mappedAtCreation", "mapping", "margin", "margin-block", "margin-block-end", "margin-block-start", "margin-bottom", "margin-inline", "margin-inline-end", "margin-inline-start", "margin-left", "margin-right", "margin-top", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginHeight", "marginInline", "marginInlineEnd", "marginInlineStart", "marginLeft", "marginRight", "marginTop", "marginWidth", "mark", "marker", "marker-end", "marker-mid", "marker-offset", "marker-start", "markerEnd", "markerHeight", "markerMid", "markerOffset", "markerStart", "markerUnits", "markerWidth", "marks", "mask", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-position-x", "mask-position-y", "mask-repeat", "mask-size", "mask-type", "maskClip", "maskComposite", "maskContentUnits", "maskImage", "maskMode", "maskOrigin", "maskPosition", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize", "maskType", "maskUnits", "match", "matchAll", "matchMedia", "matchMedium", "matches", "matrix", "matrixTransform", "max", "max-block-size", "max-height", "max-inline-size", "max-width", "maxActions", "maxAlternatives", "maxAnisotropy", "maxBindGroups", "maxBindGroupsPlusVertexBuffers", "maxBindingsPerBindGroup", "maxBlockSize", "maxBufferSize", "maxChannelCount", "maxChannels", "maxColorAttachmentBytesPerSample", "maxColorAttachments", "maxComputeInvocationsPerWorkgroup", "maxComputeWorkgroupSizeX", "maxComputeWorkgroupSizeY", "maxComputeWorkgroupSizeZ", "maxComputeWorkgroupStorageSize", "maxComputeWorkgroupsPerDimension", "maxConnectionsPerServer", "maxDecibels", "maxDistance", "maxDrawCount", "maxDynamicStorageBuffersPerPipelineLayout", "maxDynamicUniformBuffersPerPipelineLayout", "maxHeight", "maxInlineSize", "maxInterStageShaderComponents", "maxInterStageShaderVariables", "maxLayers", "maxLength", "maxMessageSize", "maxPacketLifeTime", "maxRetransmits", "maxSampledTexturesPerShaderStage", "maxSamplersPerShaderStage", "maxStorageBufferBindingSize", "maxStorageBuffersPerShaderStage", "maxStorageTexturesPerShaderStage", "maxTextureArrayLayers", "maxTextureDimension1D", "maxTextureDimension2D", "maxTextureDimension3D", "maxTouchPoints", "maxUniformBufferBindingSize", "maxUniformBuffersPerShaderStage", "maxValue", "maxVertexAttributes", "maxVertexBufferArrayStride", "maxVertexBuffers", "maxWidth", "measure", "measureText", "media", "mediaCapabilities", "mediaDevices", "mediaElement", "mediaGroup", "mediaKeys", "mediaSession", "mediaStream", "mediaText", "meetOrSlice", "memory", "menubar", "mergeAttributes", "message", "messageClass", "messageHandlers", "messageType", "messages", "metaKey", "metadata", "method", "methodDetails", "methodName", "mid", "mimeType", "mimeTypes", "min", "min-block-size", "min-height", "min-inline-size", "min-width", "minBindingSize", "minBlockSize", "minDecibels", "minFilter", "minHeight", "minInlineSize", "minLength", "minStorageBufferOffsetAlignment", "minUniformBufferOffsetAlignment", "minValue", "minWidth", "mipLevel", "mipLevelCount", "mipmapFilter", "miterLimit", "mix-blend-mode", "mixBlendMode", "mm", "mobile", "mode", "model", "modify", "module", "mount", "move", "moveBy", "moveEnd", "moveFirst", "moveFocusDown", "moveFocusLeft", "moveFocusRight", "moveFocusUp", "moveNext", "moveRow", "moveStart", "moveTo", "moveToBookmark", "moveToElementText", "moveToPoint", "movementX", "movementY", "mozAdd", "mozAnimationStartTime", "mozAnon", "mozApps", "mozAudioCaptured", "mozAudioChannelType", "mozAutoplayEnabled", "mozCancelAnimationFrame", "mozCancelFullScreen", "mozCancelRequestAnimationFrame", "mozCaptureStream", "mozCaptureStreamUntilEnded", "mozClearDataAt", "mozContact", "mozContacts", "mozCreateFileHandle", "mozCurrentTransform", "mozCurrentTransformInverse", "mozCursor", "mozDash", "mozDashOffset", "mozDecodedFrames", "mozExitPointerLock", "mozFillRule", "mozFragmentEnd", "mozFrameDelay", "mozFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozGetAll", "mozGetAllKeys", "mozGetAsFile", "mozGetDataAt", "mozGetMetadata", "mozGetUserMedia", "mozHasAudio", "mozHasItem", "mozHidden", "mozImageSmoothingEnabled", "mozIndexedDB", "mozInnerScreenX", "mozInnerScreenY", "mozInputSource", "mozIsTextField", "mozItem", "mozItemCount", "mozItems", "mozLength", "mozLockOrientation", "mozMatchesSelector", "mozMovementX", "mozMovementY", "mozOpaque", "mozOrientation", "mozPaintCount", "mozPaintedFrames", "mozParsedFrames", "mozPay", "mozPointerLockElement", "mozPresentedFrames", "mozPreservesPitch", "mozPressure", "mozPrintCallback", "mozRTCIceCandidate", "mozRTCPeerConnection", "mozRTCSessionDescription", "mozRemove", "mozRequestAnimationFrame", "mozRequestFullScreen", "mozRequestPointerLock", "mozSetDataAt", "mozSetImageElement", "mozSourceNode", "mozSrcObject", "mozSystem", "mozTCPSocket", "mozTextStyle", "mozTypesAt", "mozUnlockOrientation", "mozUserCancelled", "mozVisibilityState", "ms", "msAnimation", "msAnimationDelay", "msAnimationDirection", "msAnimationDuration", "msAnimationFillMode", "msAnimationIterationCount", "msAnimationName", "msAnimationPlayState", "msAnimationStartTime", "msAnimationTimingFunction", "msBackfaceVisibility", "msBlockProgression", "msCSSOMElementFloatMetrics", "msCaching", "msCachingEnabled", "msCancelRequestAnimationFrame", "msCapsLockWarningOff", "msClearImmediate", "msClose", "msContentZoomChaining", "msContentZoomFactor", "msContentZoomLimit", "msContentZoomLimitMax", "msContentZoomLimitMin", "msContentZoomSnap", "msContentZoomSnapPoints", "msContentZoomSnapType", "msContentZooming", "msConvertURL", "msCrypto", "msDoNotTrack", "msElementsFromPoint", "msElementsFromRect", "msExitFullscreen", "msExtendedCode", "msFillRule", "msFirstPaint", "msFlex", "msFlexAlign", "msFlexDirection", "msFlexFlow", "msFlexItemAlign", "msFlexLinePack", "msFlexNegative", "msFlexOrder", "msFlexPack", "msFlexPositive", "msFlexPreferredSize", "msFlexWrap", "msFlowFrom", "msFlowInto", "msFontFeatureSettings", "msFullscreenElement", "msFullscreenEnabled", "msGetInputContext", "msGetRegionContent", "msGetUntransformedBounds", "msGraphicsTrustStatus", "msGridColumn", "msGridColumnAlign", "msGridColumnSpan", "msGridColumns", "msGridRow", "msGridRowAlign", "msGridRowSpan", "msGridRows", "msHidden", "msHighContrastAdjust", "msHyphenateLimitChars", "msHyphenateLimitLines", "msHyphenateLimitZone", "msHyphens", "msImageSmoothingEnabled", "msImeAlign", "msIndexedDB", "msInterpolationMode", "msIsStaticHTML", "msKeySystem", "msKeys", "msLaunchUri", "msLockOrientation", "msManipulationViewsEnabled", "msMatchMedia", "msMatchesSelector", "msMaxTouchPoints", "msOrientation", "msOverflowStyle", "msPerspective", "msPerspectiveOrigin", "msPlayToDisabled", "msPlayToPreferredSourceUri", "msPlayToPrimary", "msPointerEnabled", "msRegionOverflow", "msReleasePointerCapture", "msRequestAnimationFrame", "msRequestFullscreen", "msSaveBlob", "msSaveOrOpenBlob", "msScrollChaining", "msScrollLimit", "msScrollLimitXMax", "msScrollLimitXMin", "msScrollLimitYMax", "msScrollLimitYMin", "msScrollRails", "msScrollSnapPointsX", "msScrollSnapPointsY", "msScrollSnapType", "msScrollSnapX", "msScrollSnapY", "msScrollTranslation", "msSetImmediate", "msSetMediaKeys", "msSetPointerCapture", "msTextCombineHorizontal", "msTextSizeAdjust", "msToBlob", "msTouchAction", "msTouchSelect", "msTraceAsyncCallbackCompleted", "msTraceAsyncCallbackStarting", "msTraceAsyncOperationCompleted", "msTraceAsyncOperationStarting", "msTransform", "msTransformOrigin", "msTransformStyle", "msTransition", "msTransitionDelay", "msTransitionDuration", "msTransitionProperty", "msTransitionTimingFunction", "msUnlockOrientation", "msUpdateAsyncCallbackRelation", "msUserSelect", "msVisibilityState", "msWrapFlow", "msWrapMargin", "msWrapThrough", "msWriteProfilerMark", "msZoom", "msZoomTo", "mt", "mul", "multiEntry", "multiSelectionObj", "multiline", "multiple", "multiply", "multiplySelf", "multisample", "multisampled", "mutableFile", "muted", "n", "name", "nameProp", "namedItem", "namedRecordset", "names", "namespaceURI", "namespaces", "naturalHeight", "naturalWidth", "navigate", "navigation", "navigationMode", "navigationPreload", "navigationStart", "navigator", "near", "nearestViewportElement", "negative", "negotiated", "netscape", "networkState", "newScale", "newTranslate", "newURL", "newValue", "newValueSpecifiedUnits", "newVersion", "newhome", "next", "nextElementSibling", "nextHopProtocol", "nextNode", "nextPage", "nextSibling", "nickname", "noHref", "noModule", "noResize", "noShade", "noValidate", "noWrap", "node", "nodeName", "nodeType", "nodeValue", "nonce", "normalize", "normalizedPathSegList", "notationName", "notations", "note", "noteGrainOn", "noteOff", "noteOn", "notify", "now", "numOctaves", "number", "numberOfChannels", "numberOfInputs", "numberOfItems", "numberOfOutputs", "numberValue", "oMatchesSelector", "object", "object-fit", "object-position", "objectFit", "objectPosition", "objectStore", "objectStoreNames", "objectType", "observe", "occlusionQuerySet", "of", "offscreenBuffering", "offset", "offset-anchor", "offset-distance", "offset-path", "offset-rotate", "offsetAnchor", "offsetDistance", "offsetHeight", "offsetLeft", "offsetNode", "offsetParent", "offsetPath", "offsetRotate", "offsetTop", "offsetWidth", "offsetX", "offsetY", "ok", "oldURL", "oldValue", "oldVersion", "olderShadowRoot", "onLine", "onSubmittedWorkDone", "onabort", "onabsolutedeviceorientation", "onactivate", "onactive", "onaddsourcebuffer", "onaddstream", "onaddtrack", "onafterprint", "onafterscriptexecute", "onafterupdate", "onanimationcancel", "onanimationend", "onanimationiteration", "onanimationstart", "onappinstalled", "onaudioend", "onaudioprocess", "onaudiostart", "onautocomplete", "onautocompleteerror", "onauxclick", "onbeforeactivate", "onbeforecopy", "onbeforecut", "onbeforedeactivate", "onbeforeeditfocus", "onbeforeinstallprompt", "onbeforepaste", "onbeforeprint", "onbeforescriptexecute", "onbeforeunload", "onbeforeupdate", "onbeforexrselect", "onbegin", "onblocked", "onblur", "onbounce", "onboundary", "onbufferedamountlow", "oncached", "oncancel", "oncandidatewindowhide", "oncandidatewindowshow", "oncandidatewindowupdate", "oncanplay", "oncanplaythrough", "once", "oncellchange", "onchange", "oncharacteristicvaluechanged", "onchargingchange", "onchargingtimechange", "onchecking", "onclick", "onclose", "onclosing", "oncompassneedscalibration", "oncomplete", "onconnect", "onconnecting", "onconnectionavailable", "onconnectionstatechange", "oncontextmenu", "oncontrollerchange", "oncontrolselect", "oncopy", "oncuechange", "oncut", "ondataavailable", "ondatachannel", "ondatasetchanged", "ondatasetcomplete", "ondblclick", "ondeactivate", "ondevicechange", "ondevicelight", "ondevicemotion", "ondeviceorientation", "ondeviceorientationabsolute", "ondeviceproximity", "ondischargingtimechange", "ondisconnect", "ondisplay", "ondownloading", "ondrag", "ondragend", "ondragenter", "ondragexit", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onencrypted", "onend", "onended", "onenter", "onenterpictureinpicture", "onerror", "onerrorupdate", "onexit", "onfilterchange", "onfinish", "onfocus", "onfocusin", "onfocusout", "onformdata", "onfreeze", "onfullscreenchange", "onfullscreenerror", "ongatheringstatechange", "ongattserverdisconnected", "ongesturechange", "ongestureend", "ongesturestart", "ongotpointercapture", "onhashchange", "onhelp", "onicecandidate", "onicecandidateerror", "oniceconnectionstatechange", "onicegatheringstatechange", "oninactive", "oninput", "oninputsourceschange", "oninvalid", "onkeydown", "onkeypress", "onkeystatuseschange", "onkeyup", "onlanguagechange", "onlayoutcomplete", "onleavepictureinpicture", "onlevelchange", "onload", "onloadeddata", "onloadedmetadata", "onloadend", "onloading", "onloadingdone", "onloadingerror", "onloadstart", "onlosecapture", "onlostpointercapture", "only", "onmark", "onmessage", "onmessageerror", "onmidimessage", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onmove", "onmoveend", "onmovestart", "onmozfullscreenchange", "onmozfullscreenerror", "onmozorientationchange", "onmozpointerlockchange", "onmozpointerlockerror", "onmscontentzoom", "onmsfullscreenchange", "onmsfullscreenerror", "onmsgesturechange", "onmsgesturedoubletap", "onmsgestureend", "onmsgesturehold", "onmsgesturestart", "onmsgesturetap", "onmsgotpointercapture", "onmsinertiastart", "onmslostpointercapture", "onmsmanipulationstatechanged", "onmsneedkey", "onmsorientationchange", "onmspointercancel", "onmspointerdown", "onmspointerenter", "onmspointerhover", "onmspointerleave", "onmspointermove", "onmspointerout", "onmspointerover", "onmspointerup", "onmssitemodejumplistitemremoved", "onmsthumbnailclick", "onmute", "onnegotiationneeded", "onnomatch", "onnoupdate", "onobsolete", "onoffline", "ononline", "onopen", "onorientationchange", "onpagechange", "onpagehide", "onpageshow", "onpaste", "onpause", "onpayerdetailchange", "onpaymentmethodchange", "onplay", "onplaying", "onpluginstreamstart", "onpointercancel", "onpointerdown", "onpointerenter", "onpointerleave", "onpointerlockchange", "onpointerlockerror", "onpointermove", "onpointerout", "onpointerover", "onpointerrawupdate", "onpointerup", "onpopstate", "onprocessorerror", "onprogress", "onpropertychange", "onratechange", "onreading", "onreadystatechange", "onrejectionhandled", "onrelease", "onremove", "onremovesourcebuffer", "onremovestream", "onremovetrack", "onrepeat", "onreset", "onresize", "onresizeend", "onresizestart", "onresourcetimingbufferfull", "onresult", "onresume", "onrowenter", "onrowexit", "onrowsdelete", "onrowsinserted", "onscroll", "onsearch", "onsecuritypolicyviolation", "onseeked", "onseeking", "onselect", "onselectedcandidatepairchange", "onselectend", "onselectionchange", "onselectstart", "onshippingaddresschange", "onshippingoptionchange", "onshow", "onsignalingstatechange", "onsoundend", "onsoundstart", "onsourceclose", "onsourceclosed", "onsourceended", "onsourceopen", "onspeechend", "onspeechstart", "onsqueeze", "onsqueezeend", "onsqueezestart", "onstalled", "onstart", "onstatechange", "onstop", "onstorage", "onstoragecommit", "onsubmit", "onsuccess", "onsuspend", "onterminate", "ontextinput", "ontimeout", "ontimeupdate", "ontoggle", "ontonechange", "ontouchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ontrack", "ontransitioncancel", "ontransitionend", "ontransitionrun", "ontransitionstart", "onuncapturederror", "onunhandledrejection", "onunload", "onunmute", "onupdate", "onupdateend", "onupdatefound", "onupdateready", "onupdatestart", "onupgradeneeded", "onuserproximity", "onversionchange", "onvisibilitychange", "onvoiceschanged", "onvolumechange", "onvrdisplayactivate", "onvrdisplayconnect", "onvrdisplaydeactivate", "onvrdisplaydisconnect", "onvrdisplaypresentchange", "onwaiting", "onwaitingforkey", "onwarning", "onwebkitanimationend", "onwebkitanimationiteration", "onwebkitanimationstart", "onwebkitcurrentplaybacktargetiswirelesschanged", "onwebkitfullscreenchange", "onwebkitfullscreenerror", "onwebkitkeyadded", "onwebkitkeyerror", "onwebkitkeymessage", "onwebkitneedkey", "onwebkitorientationchange", "onwebkitplaybacktargetavailabilitychanged", "onwebkitpointerlockchange", "onwebkitpointerlockerror", "onwebkitresourcetimingbufferfull", "onwebkittransitionend", "onwheel", "onzoom", "opacity", "open", "openCursor", "openDatabase", "openKeyCursor", "opened", "opener", "opera", "operation", "operationType", "operator", "opr", "optimum", "options", "or", "order", "orderX", "orderY", "ordered", "org", "organization", "orient", "orientAngle", "orientType", "orientation", "orientationX", "orientationY", "orientationZ", "origin", "originalPolicy", "originalTarget", "orphans", "oscpu", "outerHTML", "outerHeight", "outerText", "outerWidth", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "outputBuffer", "outputChannelCount", "outputLatency", "outputs", "overflow", "overflow-anchor", "overflow-block", "overflow-inline", "overflow-wrap", "overflow-x", "overflow-y", "overflowAnchor", "overflowBlock", "overflowInline", "overflowWrap", "overflowX", "overflowY", "overrideMimeType", "oversample", "overscroll-behavior", "overscroll-behavior-block", "overscroll-behavior-inline", "overscroll-behavior-x", "overscroll-behavior-y", "overscrollBehavior", "overscrollBehaviorBlock", "overscrollBehaviorInline", "overscrollBehaviorX", "overscrollBehaviorY", "ownKeys", "ownerDocument", "ownerElement", "ownerNode", "ownerRule", "ownerSVGElement", "owningElement", "p1", "p2", "p3", "p4", "packetSize", "packets", "pad", "padEnd", "padStart", "padding", "padding-block", "padding-block-end", "padding-block-start", "padding-bottom", "padding-inline", "padding-inline-end", "padding-inline-start", "padding-left", "padding-right", "padding-top", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingLeft", "paddingRight", "paddingTop", "page", "page-break-after", "page-break-before", "page-break-inside", "pageBreakAfter", "pageBreakBefore", "pageBreakInside", "pageCount", "pageLeft", "pageTop", "pageX", "pageXOffset", "pageY", "pageYOffset", "pages", "paint-order", "paintOrder", "paintRequests", "paintType", "paintWorklet", "palette", "pan", "panningModel", "parameterData", "parameters", "parent", "parentElement", "parentNode", "parentRule", "parentStyleSheet", "parentTextEdit", "parentWindow", "parse", "parseAll", "parseFloat", "parseFromString", "parseInt", "part", "participants", "passOp", "passive", "password", "pasteHTML", "path", "pathLength", "pathSegList", "pathSegType", "pathSegTypeAsLetter", "pathname", "pattern", "patternContentUnits", "patternMismatch", "patternTransform", "patternUnits", "pause", "pauseAnimations", "pauseOnExit", "pauseProfilers", "pauseTransformFeedback", "paused", "payerEmail", "payerName", "payerPhone", "paymentManager", "pc", "peerIdentity", "pending", "pendingLocalDescription", "pendingRemoteDescription", "percent", "performance", "periodicSync", "permission", "permissionState", "permissions", "persist", "persisted", "personalbar", "perspective", "perspective-origin", "perspectiveOrigin", "phone", "phoneticFamilyName", "phoneticGivenName", "photo", "pictureInPictureElement", "pictureInPictureEnabled", "pictureInPictureWindow", "ping", "pipeThrough", "pipeTo", "pitch", "pixelBottom", "pixelDepth", "pixelHeight", "pixelLeft", "pixelRight", "pixelStorei", "pixelTop", "pixelUnitToMillimeterX", "pixelUnitToMillimeterY", "pixelWidth", "place-content", "place-items", "place-self", "placeContent", "placeItems", "placeSelf", "placeholder", "platform", "platformVersion", "platforms", "play", "playEffect", "playState", "playbackRate", "playbackState", "playbackTime", "played", "playoutDelayHint", "playsInline", "plugins", "pluginspage", "pname", "pointer-events", "pointerBeforeReferenceNode", "pointerEnabled", "pointerEvents", "pointerId", "pointerLockElement", "pointerType", "points", "pointsAtX", "pointsAtY", "pointsAtZ", "polygonOffset", "pop", "popDebugGroup", "popErrorScope", "populateMatrix", "popupWindowFeatures", "popupWindowName", "popupWindowURI", "port", "port1", "port2", "ports", "posBottom", "posHeight", "posLeft", "posRight", "posTop", "posWidth", "pose", "position", "positionAlign", "positionX", "positionY", "positionZ", "postError", "postMessage", "postalCode", "poster", "pow", "powerEfficient", "powerOff", "powerPreference", "preMultiplySelf", "precision", "preferredStyleSheetSet", "preferredStylesheetSet", "prefix", "preload", "premultipliedAlpha", "prepend", "presentation", "preserveAlpha", "preserveAspectRatio", "preserveAspectRatioString", "pressed", "pressure", "prevValue", "preventDefault", "preventExtensions", "preventSilentAccess", "previousElementSibling", "previousNode", "previousPage", "previousRect", "previousScale", "previousSibling", "previousTranslate", "primaryKey", "primitive", "primitiveType", "primitiveUnits", "principals", "print", "priority", "privateKey", "probablySupportsContext", "process", "processIceMessage", "processingEnd", "processingStart", "processorOptions", "product", "productId", "productName", "productSub", "profile", "profileEnd", "profiles", "projectionMatrix", "promise", "prompt", "properties", "propertyIsEnumerable", "propertyName", "protocol", "protocolLong", "prototype", "provider", "pseudoClass", "pseudoElement", "pt", "publicId", "publicKey", "published", "pulse", "push", "pushDebugGroup", "pushErrorScope", "pushManager", "pushNotification", "pushState", "put", "putImageData", "px", "quadraticCurveTo", "qualifier", "quaternion", "query", "queryCommandEnabled", "queryCommandIndeterm", "queryCommandState", "queryCommandSupported", "queryCommandText", "queryCommandValue", "querySelector", "querySelectorAll", "querySet", "queue", "queueMicrotask", "quote", "quotes", "r", "r1", "r2", "race", "rad", "radiogroup", "radiusX", "radiusY", "random", "range", "rangeCount", "rangeMax", "rangeMin", "rangeOffset", "rangeOverflow", "rangeParent", "rangeUnderflow", "rate", "ratio", "raw", "rawId", "read", "readAsArrayBuffer", "readAsBinaryString", "readAsBlob", "readAsDataURL", "readAsText", "readBuffer", "readEntries", "readOnly", "readPixels", "readReportRequested", "readText", "readValue", "readable", "ready", "readyState", "reason", "reboot", "receivedAlert", "receiver", "receivers", "recipient", "reconnect", "recordNumber", "recordsAvailable", "recordset", "rect", "red", "redEyeReduction", "redirect", "redirectCount", "redirectEnd", "redirectStart", "redirected", "reduce", "reduceRight", "reduction", "refDistance", "refX", "refY", "referenceNode", "referenceSpace", "referrer", "referrerPolicy", "refresh", "region", "regionAnchorX", "regionAnchorY", "regionId", "regions", "register", "registerContentHandler", "registerElement", "registerProperty", "registerProtocolHandler", "reject", "rel", "relList", "relatedAddress", "relatedNode", "relatedPort", "relatedTarget", "release", "releaseCapture", "releaseEvents", "releaseInterface", "releaseLock", "releasePointerCapture", "releaseShaderCompiler", "reliable", "reliableWrite", "reload", "rem", "remainingSpace", "remote", "remoteDescription", "remove", "removeAllRanges", "removeAttribute", "removeAttributeNS", "removeAttributeNode", "removeBehavior", "removeChild", "removeCue", "removeEventListener", "removeFilter", "removeImport", "removeItem", "removeListener", "removeNamedItem", "removeNamedItemNS", "removeNode", "removeParameter", "removeProperty", "removeRange", "removeRegion", "removeRule", "removeSiteSpecificTrackingException", "removeSourceBuffer", "removeStream", "removeTrack", "removeVariable", "removeWakeLockListener", "removeWebWideTrackingException", "removed", "removedNodes", "renderHeight", "renderState", "renderTime", "renderWidth", "renderbufferStorage", "renderbufferStorageMultisample", "renderedBuffer", "renderingMode", "renotify", "repeat", "replace", "replaceAdjacentText", "replaceAll", "replaceChild", "replaceChildren", "replaceData", "replaceId", "replaceItem", "replaceNode", "replaceState", "replaceSync", "replaceTrack", "replaceWholeText", "replaceWith", "reportValidity", "request", "requestAdapter", "requestAdapterInfo", "requestAnimationFrame", "requestAutocomplete", "requestData", "requestDevice", "requestFrame", "requestFullscreen", "requestHitTestSource", "requestHitTestSourceForTransientInput", "requestId", "requestIdleCallback", "requestMIDIAccess", "requestMediaKeySystemAccess", "requestPermission", "requestPictureInPicture", "requestPointerLock", "requestPresent", "requestReferenceSpace", "requestSession", "requestStart", "requestStorageAccess", "requestSubmit", "requestVideoFrameCallback", "requestingWindow", "requireInteraction", "required", "requiredExtensions", "requiredFeatures", "requiredLimits", "reset", "resetPose", "resetTransform", "resize", "resizeBy", "resizeTo", "resolve", "resolveQuerySet", "resolveTarget", "resource", "response", "responseBody", "responseEnd", "responseReady", "responseStart", "responseText", "responseType", "responseURL", "responseXML", "restartIce", "restore", "result", "resultIndex", "resultType", "results", "resume", "resumeProfilers", "resumeTransformFeedback", "retry", "returnValue", "rev", "reverse", "reversed", "revocable", "revokeObjectURL", "rgbColor", "right", "rightContext", "rightDegrees", "rightMargin", "rightProjectionMatrix", "rightViewMatrix", "role", "rolloffFactor", "root", "rootBounds", "rootElement", "rootMargin", "rotate", "rotateAxisAngle", "rotateAxisAngleSelf", "rotateFromVector", "rotateFromVectorSelf", "rotateSelf", "rotation", "rotationAngle", "rotationRate", "round", "roundRect", "row-gap", "rowGap", "rowIndex", "rowSpan", "rows", "rowsPerImage", "rtcpTransport", "rtt", "ruby-align", "ruby-position", "rubyAlign", "rubyOverhang", "rubyPosition", "rules", "runtime", "runtimeStyle", "rx", "ry", "s", "safari", "sample", "sampleCount", "sampleCoverage", "sampleRate", "sampleType", "sampler", "samplerParameterf", "samplerParameteri", "sandbox", "save", "saveData", "scale", "scale3d", "scale3dSelf", "scaleNonUniform", "scaleNonUniformSelf", "scaleSelf", "scheme", "scissor", "scope", "scopeName", "scoped", "screen", "screenBrightness", "screenEnabled", "screenLeft", "screenPixelToMillimeterX", "screenPixelToMillimeterY", "screenTop", "screenX", "screenY", "scriptURL", "scripts", "scroll", "scroll-behavior", "scroll-margin", "scroll-margin-block", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom", "scroll-margin-inline", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right", "scroll-margin-top", "scroll-padding", "scroll-padding-block", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end", "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right", "scroll-padding-top", "scroll-snap-align", "scroll-snap-type", "scrollAmount", "scrollBehavior", "scrollBy", "scrollByLines", "scrollByPages", "scrollDelay", "scrollHeight", "scrollIntoView", "scrollIntoViewIfNeeded", "scrollLeft", "scrollLeftMax", "scrollMargin", "scrollMarginBlock", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInline", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollMaxX", "scrollMaxY", "scrollPadding", "scrollPaddingBlock", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInline", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollRestoration", "scrollSnapAlign", "scrollSnapType", "scrollTo", "scrollTop", "scrollTopMax", "scrollWidth", "scrollX", "scrollY", "scrollbar-color", "scrollbar-width", "scrollbar3dLightColor", "scrollbarArrowColor", "scrollbarBaseColor", "scrollbarColor", "scrollbarDarkShadowColor", "scrollbarFaceColor", "scrollbarHighlightColor", "scrollbarShadowColor", "scrollbarTrackColor", "scrollbarWidth", "scrollbars", "scrolling", "scrollingElement", "sctp", "sctpCauseCode", "sdp", "sdpLineNumber", "sdpMLineIndex", "sdpMid", "seal", "search", "searchBox", "searchBoxJavaBridge_", "searchParams", "sectionRowIndex", "secureConnectionStart", "security", "seed", "seekToNextFrame", "seekable", "seeking", "select", "selectAllChildren", "selectAlternateInterface", "selectConfiguration", "selectNode", "selectNodeContents", "selectNodes", "selectSingleNode", "selectSubString", "selected", "selectedIndex", "selectedOptions", "selectedStyleSheetSet", "selectedStylesheetSet", "selection", "selectionDirection", "selectionEnd", "selectionStart", "selector", "selectorText", "self", "send", "sendAsBinary", "sendBeacon", "sender", "sentAlert", "sentTimestamp", "separator", "serialNumber", "serializeToString", "serverTiming", "service", "serviceWorker", "session", "sessionId", "sessionStorage", "set", "setActionHandler", "setActive", "setAlpha", "setAppBadge", "setAttribute", "setAttributeNS", "setAttributeNode", "setAttributeNodeNS", "setBaseAndExtent", "setBigInt64", "setBigUint64", "setBindGroup", "setBingCurrentSearchDefault", "setBlendConstant", "setCapture", "setCodecPreferences", "setColor", "setCompositeOperation", "setConfiguration", "setCurrentTime", "setCustomValidity", "setData", "setDate", "setDragImage", "setEnd", "setEndAfter", "setEndBefore", "setEndPoint", "setFillColor", "setFilterRes", "setFloat32", "setFloat64", "setFloatValue", "setFormValue", "setFullYear", "setHeaderValue", "setHours", "setIdentityProvider", "setImmediate", "setIndexBuffer", "setInt16", "setInt32", "setInt8", "setInterval", "setItem", "setKeyframes", "setLineCap", "setLineDash", "setLineJoin", "setLineWidth", "setLiveSeekableRange", "setLocalDescription", "setMatrix", "setMatrixValue", "setMediaKeys", "setMilliseconds", "setMinutes", "setMiterLimit", "setMonth", "setNamedItem", "setNamedItemNS", "setNonUserCodeExceptions", "setOrientToAngle", "setOrientToAuto", "setOrientation", "setOverrideHistoryNavigationMode", "setPaint", "setParameter", "setParameters", "setPeriodicWave", "setPipeline", "setPointerCapture", "setPosition", "setPositionState", "setPreference", "setProperty", "setPrototypeOf", "setRGBColor", "setRGBColorICCColor", "setRadius", "setRangeText", "setRemoteDescription", "setRequestHeader", "setResizable", "setResourceTimingBufferSize", "setRotate", "setScale", "setScissorRect", "setSeconds", "setSelectionRange", "setServerCertificate", "setShadow", "setSinkId", "setSkewX", "setSkewY", "setStart", "setStartAfter", "setStartBefore", "setStdDeviation", "setStencilReference", "setStreams", "setStringValue", "setStrokeColor", "setSuggestResult", "setTargetAtTime", "setTargetValueAtTime", "setTime", "setTimeout", "setTransform", "setTranslate", "setUTCDate", "setUTCFullYear", "setUTCHours", "setUTCMilliseconds", "setUTCMinutes", "setUTCMonth", "setUTCSeconds", "setUint16", "setUint32", "setUint8", "setUri", "setValidity", "setValueAtTime", "setValueCurveAtTime", "setVariable", "setVelocity", "setVersion", "setVertexBuffer", "setViewport", "setYear", "settingName", "settingValue", "sex", "shaderLocation", "shaderSource", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "shadowRoot", "shape", "shape-image-threshold", "shape-margin", "shape-outside", "shape-rendering", "shapeImageThreshold", "shapeMargin", "shapeOutside", "shapeRendering", "sheet", "shift", "shiftKey", "shiftLeft", "shippingAddress", "shippingOption", "shippingType", "show", "showHelp", "showModal", "showModalDialog", "showModelessDialog", "showNotification", "sidebar", "sign", "signal", "signalingState", "signature", "silent", "sin", "singleNodeValue", "sinh", "sinkId", "sittingToStandingTransform", "size", "sizeToContent", "sizeX", "sizeZ", "sizes", "skewX", "skewXSelf", "skewY", "skewYSelf", "slice", "slope", "slot", "small", "smil", "smooth", "smoothingTimeConstant", "snapToLines", "snapshotItem", "snapshotLength", "some", "sort", "sortingCode", "source", "sourceBuffer", "sourceBuffers", "sourceCapabilities", "sourceFile", "sourceIndex", "sourceMap", "sources", "spacing", "span", "speak", "speakAs", "speaking", "species", "specified", "specularConstant", "specularExponent", "speechSynthesis", "speed", "speedOfSound", "spellcheck", "splice", "split", "splitText", "spreadMethod", "sqrt", "src", "srcElement", "srcFactor", "srcFilter", "srcObject", "srcUrn", "srcdoc", "srclang", "srcset", "stack", "stackTraceLimit", "stacktrace", "stageParameters", "standalone", "standby", "start", "startContainer", "startIce", "startMessages", "startNotifications", "startOffset", "startProfiling", "startRendering", "startShark", "startTime", "startsWith", "state", "status", "statusCode", "statusMessage", "statusText", "statusbar", "stdDeviationX", "stdDeviationY", "stencilBack", "stencilClearValue", "stencilFront", "stencilFunc", "stencilFuncSeparate", "stencilLoadOp", "stencilMask", "stencilMaskSeparate", "stencilOp", "stencilOpSeparate", "stencilReadMask", "stencilReadOnly", "stencilStoreOp", "stencilWriteMask", "step", "stepDown", "stepMismatch", "stepMode", "stepUp", "sticky", "stitchTiles", "stop", "stop-color", "stop-opacity", "stopColor", "stopImmediatePropagation", "stopNotifications", "stopOpacity", "stopProfiling", "stopPropagation", "stopShark", "stopped", "storage", "storageArea", "storageName", "storageStatus", "storageTexture", "store", "storeOp", "storeSiteSpecificTrackingException", "storeWebWideTrackingException", "stpVersion", "stream", "streams", "stretch", "strike", "string", "stringValue", "stringify", "stripIndexFormat", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeRect", "strokeStyle", "strokeText", "strokeWidth", "style", "styleFloat", "styleMap", "styleMedia", "styleSheet", "styleSheetSets", "styleSheets", "sub", "subarray", "subject", "submit", "submitFrame", "submitter", "subscribe", "substr", "substring", "substringData", "subtle", "subtree", "suffix", "suffixes", "summary", "sup", "supported", "supportedContentEncodings", "supportedEntryTypes", "supports", "supportsSession", "surfaceScale", "surroundContents", "suspend", "suspendRedraw", "swapCache", "swapNode", "sweepFlag", "symbols", "sync", "sysexEnabled", "system", "systemCode", "systemId", "systemLanguage", "systemXDPI", "systemYDPI", "tBodies", "tFoot", "tHead", "tabIndex", "table", "table-layout", "tableLayout", "tableValues", "tag", "tagName", "tagUrn", "tags", "taintEnabled", "takePhoto", "takeRecords", "tan", "tangentialPressure", "tanh", "target", "targetElement", "targetRayMode", "targetRaySpace", "targetTouches", "targetX", "targetY", "targets", "tcpType", "tee", "tel", "terminate", "test", "texImage2D", "texImage3D", "texParameterf", "texParameteri", "texStorage2D", "texStorage3D", "texSubImage2D", "texSubImage3D", "text", "text-align", "text-align-last", "text-anchor", "text-combine-upright", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip-ink", "text-decoration-style", "text-decoration-thickness", "text-emphasis", "text-emphasis-color", "text-emphasis-position", "text-emphasis-style", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-rendering", "text-shadow", "text-transform", "text-underline-offset", "text-underline-position", "textAlign", "textAlignLast", "textAnchor", "textAutospace", "textBaseline", "textCombineUpright", "textContent", "textDecoration", "textDecorationBlink", "textDecorationColor", "textDecorationLine", "textDecorationLineThrough", "textDecorationNone", "textDecorationOverline", "textDecorationSkipInk", "textDecorationStyle", "textDecorationThickness", "textDecorationUnderline", "textEmphasis", "textEmphasisColor", "textEmphasisPosition", "textEmphasisStyle", "textIndent", "textJustify", "textJustifyTrim", "textKashida", "textKashidaSpace", "textLength", "textOrientation", "textOverflow", "textRendering", "textShadow", "textTracks", "textTransform", "textUnderlineOffset", "textUnderlinePosition", "texture", "then", "threadId", "threshold", "thresholds", "tiltX", "tiltY", "time", "timeEnd", "timeLog", "timeOrigin", "timeRemaining", "timeStamp", "timecode", "timeline", "timelineTime", "timeout", "timestamp", "timestampOffset", "timestampWrites", "timing", "title", "to", "toArray", "toBlob", "toDataURL", "toDateString", "toElement", "toExponential", "toFixed", "toFloat32Array", "toFloat64Array", "toGMTString", "toISOString", "toJSON", "toLocaleDateString", "toLocaleFormat", "toLocaleLowerCase", "toLocaleString", "toLocaleTimeString", "toLocaleUpperCase", "toLowerCase", "toMatrix", "toMethod", "toPrecision", "toPrimitive", "toSdp", "toSource", "toStaticHTML", "toString", "toStringTag", "toSum", "toTimeString", "toUTCString", "toUpperCase", "toggle", "toggleAttribute", "toggleLongPressEnabled", "tone", "toneBuffer", "tooLong", "tooShort", "toolbar", "top", "topMargin", "topology", "total", "totalFrameDelay", "totalVideoFrames", "touch-action", "touchAction", "touched", "touches", "trace", "track", "trackVisibility", "transaction", "transactions", "transceiver", "transferControlToOffscreen", "transferFromImageBitmap", "transferImageBitmap", "transferIn", "transferOut", "transferSize", "transferToImageBitmap", "transform", "transform-box", "transform-origin", "transform-style", "transformBox", "transformFeedbackVaryings", "transformOrigin", "transformPoint", "transformString", "transformStyle", "transformToDocument", "transformToFragment", "transition", "transition-delay", "transition-duration", "transition-property", "transition-timing-function", "transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction", "translate", "translateSelf", "translationX", "translationY", "transport", "trim", "trimEnd", "trimLeft", "trimRight", "trimStart", "trueSpeed", "trunc", "truncate", "trustedTypes", "turn", "twist", "type", "typeDetail", "typeMismatch", "typeMustMatch", "types", "u2f", "ubound", "uint16", "uint32", "uint8", "uint8Clamped", "unclippedDepth", "unconfigure", "undefined", "unescape", "uneval", "unicode", "unicode-bidi", "unicodeBidi", "unicodeRange", "uniform1f", "uniform1fv", "uniform1i", "uniform1iv", "uniform1ui", "uniform1uiv", "uniform2f", "uniform2fv", "uniform2i", "uniform2iv", "uniform2ui", "uniform2uiv", "uniform3f", "uniform3fv", "uniform3i", "uniform3iv", "uniform3ui", "uniform3uiv", "uniform4f", "uniform4fv", "uniform4i", "uniform4iv", "uniform4ui", "uniform4uiv", "uniformBlockBinding", "uniformMatrix2fv", "uniformMatrix2x3fv", "uniformMatrix2x4fv", "uniformMatrix3fv", "uniformMatrix3x2fv", "uniformMatrix3x4fv", "uniformMatrix4fv", "uniformMatrix4x2fv", "uniformMatrix4x3fv", "unique", "uniqueID", "uniqueNumber", "unit", "unitType", "units", "unloadEventEnd", "unloadEventStart", "unlock", "unmap", "unmount", "unobserve", "unpause", "unpauseAnimations", "unreadCount", "unregister", "unregisterContentHandler", "unregisterProtocolHandler", "unscopables", "unselectable", "unshift", "unsubscribe", "unsuspendRedraw", "unsuspendRedrawAll", "unwatch", "unwrapKey", "upDegrees", "upX", "upY", "upZ", "update", "updateCommands", "updateIce", "updateInterval", "updatePlaybackRate", "updateRenderState", "updateSettings", "updateTiming", "updateViaCache", "updateWith", "updated", "updating", "upgrade", "upload", "uploadTotal", "uploaded", "upper", "upperBound", "upperOpen", "uri", "url", "urn", "urns", "usage", "usages", "usb", "usbVersionMajor", "usbVersionMinor", "usbVersionSubminor", "useCurrentView", "useMap", "useProgram", "usedSpace", "user-select", "userActivation", "userAgent", "userAgentData", "userChoice", "userHandle", "userHint", "userLanguage", "userSelect", "userVisibleOnly", "username", "usernameFragment", "utterance", "uuid", "v8BreakIterator", "vAlign", "vLink", "valid", "validate", "validateProgram", "validationMessage", "validity", "value", "valueAsDate", "valueAsNumber", "valueAsString", "valueInSpecifiedUnits", "valueMissing", "valueOf", "valueText", "valueType", "values", "variable", "variant", "variationSettings", "vector-effect", "vectorEffect", "velocityAngular", "velocityExpansion", "velocityX", "velocityY", "vendor", "vendorId", "vendorSub", "verify", "version", "vertex", "vertexAttrib1f", "vertexAttrib1fv", "vertexAttrib2f", "vertexAttrib2fv", "vertexAttrib3f", "vertexAttrib3fv", "vertexAttrib4f", "vertexAttrib4fv", "vertexAttribDivisor", "vertexAttribDivisorANGLE", "vertexAttribI4i", "vertexAttribI4iv", "vertexAttribI4ui", "vertexAttribI4uiv", "vertexAttribIPointer", "vertexAttribPointer", "vertical", "vertical-align", "verticalAlign", "verticalOverflow", "vh", "vibrate", "vibrationActuator", "videoBitsPerSecond", "videoHeight", "videoTracks", "videoWidth", "view", "viewBox", "viewBoxString", "viewDimension", "viewFormats", "viewTarget", "viewTargetString", "viewport", "viewportAnchorX", "viewportAnchorY", "viewportElement", "views", "violatedDirective", "visibility", "visibilityState", "visible", "visualViewport", "vlinkColor", "vmax", "vmin", "voice", "voiceURI", "volume", "vrml", "vspace", "vw", "w", "wait", "waitSync", "waiting", "wake", "wakeLock", "wand", "warn", "wasClean", "wasDiscarded", "watch", "watchAvailability", "watchPosition", "webdriver", "webkitAddKey", "webkitAlignContent", "webkitAlignItems", "webkitAlignSelf", "webkitAnimation", "webkitAnimationDelay", "webkitAnimationDirection", "webkitAnimationDuration", "webkitAnimationFillMode", "webkitAnimationIterationCount", "webkitAnimationName", "webkitAnimationPlayState", "webkitAnimationTimingFunction", "webkitAppearance", "webkitAudioContext", "webkitAudioDecodedByteCount", "webkitAudioPannerNode", "webkitBackfaceVisibility", "webkitBackground", "webkitBackgroundAttachment", "webkitBackgroundClip", "webkitBackgroundColor", "webkitBackgroundImage", "webkitBackgroundOrigin", "webkitBackgroundPosition", "webkitBackgroundPositionX", "webkitBackgroundPositionY", "webkitBackgroundRepeat", "webkitBackgroundSize", "webkitBackingStorePixelRatio", "webkitBorderBottomLeftRadius", "webkitBorderBottomRightRadius", "webkitBorderImage", "webkitBorderImageOutset", "webkitBorderImageRepeat", "webkitBorderImageSlice", "webkitBorderImageSource", "webkitBorderImageWidth", "webkitBorderRadius", "webkitBorderTopLeftRadius", "webkitBorderTopRightRadius", "webkitBoxAlign", "webkitBoxDirection", "webkitBoxFlex", "webkitBoxOrdinalGroup", "webkitBoxOrient", "webkitBoxPack", "webkitBoxShadow", "webkitBoxSizing", "webkitCancelAnimationFrame", "webkitCancelFullScreen", "webkitCancelKeyRequest", "webkitCancelRequestAnimationFrame", "webkitClearResourceTimings", "webkitClosedCaptionsVisible", "webkitConvertPointFromNodeToPage", "webkitConvertPointFromPageToNode", "webkitCreateShadowRoot", "webkitCurrentFullScreenElement", "webkitCurrentPlaybackTargetIsWireless", "webkitDecodedFrameCount", "webkitDirectionInvertedFromDevice", "webkitDisplayingFullscreen", "webkitDroppedFrameCount", "webkitEnterFullScreen", "webkitEnterFullscreen", "webkitEntries", "webkitExitFullScreen", "webkitExitFullscreen", "webkitExitPointerLock", "webkitFilter", "webkitFlex", "webkitFlexBasis", "webkitFlexDirection", "webkitFlexFlow", "webkitFlexGrow", "webkitFlexShrink", "webkitFlexWrap", "webkitFullScreenKeyboardInputAllowed", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitGenerateKeyRequest", "webkitGetAsEntry", "webkitGetDatabaseNames", "webkitGetEntries", "webkitGetEntriesByName", "webkitGetEntriesByType", "webkitGetFlowByName", "webkitGetGamepads", "webkitGetImageDataHD", "webkitGetNamedFlows", "webkitGetRegionFlowRanges", "webkitGetUserMedia", "webkitHasClosedCaptions", "webkitHidden", "webkitIDBCursor", "webkitIDBDatabase", "webkitIDBDatabaseError", "webkitIDBDatabaseException", "webkitIDBFactory", "webkitIDBIndex", "webkitIDBKeyRange", "webkitIDBObjectStore", "webkitIDBRequest", "webkitIDBTransaction", "webkitImageSmoothingEnabled", "webkitIndexedDB", "webkitInitMessageEvent", "webkitIsFullScreen", "webkitJustifyContent", "webkitKeys", "webkitLineClamp", "webkitLineDashOffset", "webkitLockOrientation", "webkitMask", "webkitMaskClip", "webkitMaskComposite", "webkitMaskImage", "webkitMaskOrigin", "webkitMaskPosition", "webkitMaskPositionX", "webkitMaskPositionY", "webkitMaskRepeat", "webkitMaskSize", "webkitMatchesSelector", "webkitMediaStream", "webkitNotifications", "webkitOfflineAudioContext", "webkitOrder", "webkitOrientation", "webkitPeerConnection00", "webkitPersistentStorage", "webkitPerspective", "webkitPerspectiveOrigin", "webkitPointerLockElement", "webkitPostMessage", "webkitPreservesPitch", "webkitPutImageDataHD", "webkitRTCPeerConnection", "webkitRegionOverset", "webkitRelativePath", "webkitRequestAnimationFrame", "webkitRequestFileSystem", "webkitRequestFullScreen", "webkitRequestFullscreen", "webkitRequestPointerLock", "webkitResolveLocalFileSystemURL", "webkitSetMediaKeys", "webkitSetResourceTimingBufferSize", "webkitShadowRoot", "webkitShowPlaybackTargetPicker", "webkitSlice", "webkitSpeechGrammar", "webkitSpeechGrammarList", "webkitSpeechRecognition", "webkitSpeechRecognitionError", "webkitSpeechRecognitionEvent", "webkitStorageInfo", "webkitSupportsFullscreen", "webkitTemporaryStorage", "webkitTextFillColor", "webkitTextSizeAdjust", "webkitTextStroke", "webkitTextStrokeColor", "webkitTextStrokeWidth", "webkitTransform", "webkitTransformOrigin", "webkitTransformStyle", "webkitTransition", "webkitTransitionDelay", "webkitTransitionDuration", "webkitTransitionProperty", "webkitTransitionTimingFunction", "webkitURL", "webkitUnlockOrientation", "webkitUserSelect", "webkitVideoDecodedByteCount", "webkitVisibilityState", "webkitWirelessVideoPlaybackDisabled", "webkitdirectory", "webkitdropzone", "webstore", "weight", "wgslLanguageFeatures", "whatToShow", "wheelDelta", "wheelDeltaX", "wheelDeltaY", "whenDefined", "which", "white-space", "whiteSpace", "wholeText", "widows", "width", "will-change", "willChange", "willValidate", "window", "withCredentials", "word-break", "word-spacing", "word-wrap", "wordBreak", "wordSpacing", "wordWrap", "workerStart", "wow64", "wrap", "wrapKey", "writable", "writableAuxiliaries", "write", "writeBuffer", "writeMask", "writeText", "writeTexture", "writeTimestamp", "writeValue", "writeWithoutResponse", "writeln", "writing-mode", "writingMode", "x", "x1", "x2", "xChannelSelector", "xmlEncoding", "xmlStandalone", "xmlVersion", "xmlbase", "xmllang", "xmlspace", "xor", "xr", "y", "y1", "y2", "yChannelSelector", "yandex", "z", "z-index", "zIndex", "zoom", "zoomAndPan", "zoomRectScreen" ]; function find_builtins(reserved) { domprops.forEach(add); var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; var objects = {}; var global_ref = typeof global === "object" ? global : self; new_globals.forEach(function(new_global) { objects[new_global] = global_ref[new_global] || function() { }; }); [ "null", "true", "false", "NaN", "Infinity", "-Infinity", "undefined" ].forEach(add); [ Object, Array, Function, Number, String, Boolean, Error, Math, Date, RegExp, objects.Symbol, ArrayBuffer, DataView, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, eval, EvalError, Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, URIError, objects.WeakMap, objects.WeakSet ].forEach(function(ctor) { Object.getOwnPropertyNames(ctor).map(add); if (ctor.prototype) { Object.getOwnPropertyNames(ctor.prototype).map(add); } }); function add(name) { reserved.add(name); } } function reserve_quoted_keys(ast, reserved) { function add(name) { push_uniq(reserved, name); } ast.walk(new TreeWalker(function(node) { if (node instanceof AST_ObjectKeyVal && node.quote) { add(node.key); } else if (node instanceof AST_ObjectProperty && node.quote) { add(node.key.name); } else if (node instanceof AST_Sub) { addStrings(node.property, add); } })); } function addStrings(node, add) { node.walk(new TreeWalker(function(node2) { if (node2 instanceof AST_Sequence) { addStrings(node2.tail_node(), add); } else if (node2 instanceof AST_String) { add(node2.value); } else if (node2 instanceof AST_Conditional) { addStrings(node2.consequent, add); addStrings(node2.alternative, add); } return true; })); } function mangle_private_properties(ast, options) { var cprivate = -1; var private_cache = /* @__PURE__ */ new Map(); var nth_identifier = options.nth_identifier || base54; ast = ast.transform(new TreeTransformer(function(node) { if (node instanceof AST_ClassPrivateProperty || node instanceof AST_PrivateMethod || node instanceof AST_PrivateGetter || node instanceof AST_PrivateSetter || node instanceof AST_PrivateIn) { node.key.name = mangle_private(node.key.name); } else if (node instanceof AST_DotHash) { node.property = mangle_private(node.property); } })); return ast; function mangle_private(name) { let mangled = private_cache.get(name); if (!mangled) { mangled = nth_identifier.get(++cprivate); private_cache.set(name, mangled); } return mangled; } } function find_annotated_props(ast) { var annotated_props = /* @__PURE__ */ new Set(); walk(ast, (node) => { if (node instanceof AST_ClassPrivateProperty || node instanceof AST_PrivateMethod || node instanceof AST_PrivateGetter || node instanceof AST_PrivateSetter || node instanceof AST_DotHash) ; else if (node instanceof AST_ObjectKeyVal) { if (typeof node.key == "string" && has_annotation(node, _MANGLEPROP)) { annotated_props.add(node.key); } } else if (node instanceof AST_ObjectProperty) { if (has_annotation(node, _MANGLEPROP)) { annotated_props.add(node.key.name); } } else if (node instanceof AST_Dot) { if (has_annotation(node, _MANGLEPROP)) { annotated_props.add(node.property); } } else if (node instanceof AST_Sub) { if (node.property instanceof AST_String && has_annotation(node, _MANGLEPROP)) { annotated_props.add(node.property.value); } } }); return annotated_props; } function mangle_properties(ast, options, annotated_props = find_annotated_props(ast)) { options = defaults(options, { builtins: false, cache: null, debug: false, keep_quoted: false, nth_identifier: base54, only_cache: false, regex: null, reserved: null, undeclared: false, only_annotated: false }, true); var nth_identifier = options.nth_identifier; var reserved_option = options.reserved; if (!Array.isArray(reserved_option)) reserved_option = [reserved_option]; var reserved = new Set(reserved_option); if (!options.builtins) find_builtins(reserved); var cname = -1; var cache; if (options.cache) { cache = options.cache.props; } else { cache = /* @__PURE__ */ new Map(); } var only_annotated = options.only_annotated; var regex = options.regex && new RegExp(options.regex); var debug = options.debug !== false; var debug_name_suffix; if (debug) { debug_name_suffix = options.debug === true ? "" : options.debug; } var names_to_mangle = /* @__PURE__ */ new Set(); var unmangleable = /* @__PURE__ */ new Set(); cache.forEach((mangled_name) => unmangleable.add(mangled_name)); var keep_quoted = !!options.keep_quoted; ast.walk(new TreeWalker(function(node) { if (node instanceof AST_ClassPrivateProperty || node instanceof AST_PrivateMethod || node instanceof AST_PrivateGetter || node instanceof AST_PrivateSetter || node instanceof AST_DotHash) ; else if (node instanceof AST_ObjectKeyVal) { if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { add(node.key); } } else if (node instanceof AST_ObjectProperty) { if (!keep_quoted || !node.quote) { add(node.key.name); } } else if (node instanceof AST_Dot) { var declared = !!options.undeclared; if (!declared) { var root = node; while (root.expression) { root = root.expression; } declared = !(root.thedef && root.thedef.undeclared); } if (declared && (!keep_quoted || !node.quote)) { add(node.property); } } else if (node instanceof AST_Sub) { if (!keep_quoted) { addStrings(node.property, add); } } else if (node instanceof AST_Call && node.expression.print_to_string() == "Object.defineProperty") { addStrings(node.args[1], add); } else if (node instanceof AST_Binary && node.operator === "in") { addStrings(node.left, add); } else if (node instanceof AST_String && has_annotation(node, _KEY)) { add(node.value); } })); return ast.transform(new TreeTransformer(function(node) { if (node instanceof AST_ClassPrivateProperty || node instanceof AST_PrivateMethod || node instanceof AST_PrivateGetter || node instanceof AST_PrivateSetter || node instanceof AST_DotHash) ; else if (node instanceof AST_ObjectKeyVal) { if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { node.key = mangle(node.key); } } else if (node instanceof AST_ObjectProperty) { if (!keep_quoted || !node.quote) { node.key.name = mangle(node.key.name); } } else if (node instanceof AST_Dot) { if (!keep_quoted || !node.quote) { node.property = mangle(node.property); } } else if (!keep_quoted && node instanceof AST_Sub) { node.property = mangleStrings(node.property); } else if (node instanceof AST_Call && node.expression.print_to_string() == "Object.defineProperty") { node.args[1] = mangleStrings(node.args[1]); } else if (node instanceof AST_Binary && node.operator === "in") { node.left = mangleStrings(node.left); } else if (node instanceof AST_String && has_annotation(node, _KEY)) { clear_annotation(node, _KEY); node.value = mangle(node.value); } })); function can_mangle(name) { if (unmangleable.has(name)) return false; if (reserved.has(name)) return false; if (options.only_cache) { return cache.has(name); } if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; return true; } function should_mangle(name) { if (only_annotated && !annotated_props.has(name)) return false; if (regex && !regex.test(name)) { return annotated_props.has(name); } if (reserved.has(name)) return false; return cache.has(name) || names_to_mangle.has(name); } function add(name) { if (can_mangle(name)) { names_to_mangle.add(name); } if (!should_mangle(name)) { unmangleable.add(name); } } function mangle(name) { if (!should_mangle(name)) { return name; } var mangled = cache.get(name); if (!mangled) { if (debug) { var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; if (can_mangle(debug_mangled)) { mangled = debug_mangled; } } if (!mangled) { do { mangled = nth_identifier.get(++cname); } while (!can_mangle(mangled)); } cache.set(name, mangled); } return mangled; } function mangleStrings(node) { return node.transform(new TreeTransformer(function(node2) { if (node2 instanceof AST_Sequence) { var last2 = node2.expressions.length - 1; node2.expressions[last2] = mangleStrings(node2.expressions[last2]); } else if (node2 instanceof AST_String) { clear_annotation(node2, _KEY); node2.value = mangle(node2.value); } else if (node2 instanceof AST_Conditional) { node2.consequent = mangleStrings(node2.consequent); node2.alternative = mangleStrings(node2.alternative); } return node2; })); } } var to_ascii = typeof Buffer !== "undefined" ? (b64) => Buffer.from(b64, "base64").toString() : (b64) => decodeURIComponent(escape(atob(b64))); var to_base64 = typeof Buffer !== "undefined" ? (str) => Buffer.from(str).toString("base64") : (str) => btoa(unescape(encodeURIComponent(str))); function read_source_map(code) { var match = /(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(code); if (!match) { console.warn("inline source map not found"); return null; } return to_ascii(match[2]); } function set_shorthand(name, options, keys) { if (options[name]) { keys.forEach(function(key) { if (options[key]) { if (typeof options[key] != "object") options[key] = {}; if (!(name in options[key])) options[key][name] = options[name]; } }); } } function init_cache(cache) { if (!cache) return; if (!("props" in cache)) { cache.props = /* @__PURE__ */ new Map(); } else if (!(cache.props instanceof Map)) { cache.props = map_from_object(cache.props); } } function cache_to_json(cache) { return { props: map_to_object(cache.props) }; } function log_input(files, options, fs2, debug_folder) { if (!(fs2 && fs2.writeFileSync && fs2.mkdirSync)) { return; } try { fs2.mkdirSync(debug_folder); } catch (e) { if (e.code !== "EEXIST") throw e; } const log_path = `${debug_folder}/terser-debug-${Math.random() * 9999999 | 0}.log`; options = options || {}; const options_str = JSON.stringify(options, (_key, thing) => { if (typeof thing === "function") return "[Function " + thing.toString() + "]"; if (thing instanceof RegExp) return "[RegExp " + thing.toString() + "]"; return thing; }, 4); const files_str = (file) => { if (typeof file === "object" && options.parse && options.parse.spidermonkey) { return JSON.stringify(file, null, 2); } else if (typeof file === "object") { return Object.keys(file).map((key) => key + ": " + files_str(file[key])).join("\n\n"); } else if (typeof file === "string") { return "```\n" + file + "\n```"; } else { return file; } }; fs2.writeFileSync(log_path, "Options: \n" + options_str + "\n\nInput files:\n\n" + files_str(files) + "\n"); } function* minify_sync_or_async(files, options, _fs_module) { if (_fs_module && typeof process === "object" && process.env && typeof process.env.TERSER_DEBUG_DIR === "string") { log_input(files, options, _fs_module, process.env.TERSER_DEBUG_DIR); } options = defaults(options, { compress: {}, ecma: void 0, enclose: false, ie8: false, keep_classnames: void 0, keep_fnames: false, mangle: {}, module: false, nameCache: null, output: null, format: null, parse: {}, rename: void 0, safari10: false, sourceMap: false, spidermonkey: false, timings: false, toplevel: false, warnings: false, wrap: false }, true); var timings = options.timings && { start: Date.now() }; if (options.keep_classnames === void 0) { options.keep_classnames = options.keep_fnames; } if (options.rename === void 0) { options.rename = options.compress && options.mangle; } if (options.output && options.format) { throw new Error("Please only specify either output or format option, preferrably format."); } options.format = options.format || options.output || {}; set_shorthand("ecma", options, ["parse", "compress", "format"]); set_shorthand("ie8", options, ["compress", "mangle", "format"]); set_shorthand("keep_classnames", options, ["compress", "mangle"]); set_shorthand("keep_fnames", options, ["compress", "mangle"]); set_shorthand("module", options, ["parse", "compress", "mangle"]); set_shorthand("safari10", options, ["mangle", "format"]); set_shorthand("toplevel", options, ["compress", "mangle"]); set_shorthand("warnings", options, ["compress"]); var quoted_props; if (options.mangle) { options.mangle = defaults(options.mangle, { cache: options.nameCache && (options.nameCache.vars || {}), eval: false, ie8: false, keep_classnames: false, keep_fnames: false, module: false, nth_identifier: base54, properties: false, reserved: [], safari10: false, toplevel: false }, true); if (options.mangle.properties) { if (typeof options.mangle.properties != "object") { options.mangle.properties = {}; } if (options.mangle.properties.keep_quoted) { quoted_props = options.mangle.properties.reserved; if (!Array.isArray(quoted_props)) quoted_props = []; options.mangle.properties.reserved = quoted_props; } if (options.nameCache && !("cache" in options.mangle.properties)) { options.mangle.properties.cache = options.nameCache.props || {}; } } init_cache(options.mangle.cache); init_cache(options.mangle.properties.cache); } if (options.sourceMap) { options.sourceMap = defaults(options.sourceMap, { asObject: false, content: null, filename: null, includeSources: false, root: null, url: null }, true); } if (timings) timings.parse = Date.now(); var toplevel; if (files instanceof AST_Toplevel) { toplevel = files; } else { if (typeof files == "string" || options.parse.spidermonkey && !Array.isArray(files)) { files = [files]; } options.parse = options.parse || {}; options.parse.toplevel = null; if (options.parse.spidermonkey) { options.parse.toplevel = AST_Node.from_mozilla_ast(Object.keys(files).reduce(function(toplevel2, name2) { if (!toplevel2) return files[name2]; toplevel2.body = toplevel2.body.concat(files[name2].body); return toplevel2; }, null)); } else { delete options.parse.spidermonkey; for (var name in files) if (HOP(files, name)) { options.parse.filename = name; options.parse.toplevel = parse(files[name], options.parse); if (options.sourceMap && options.sourceMap.content == "inline") { if (Object.keys(files).length > 1) throw new Error("inline source map only works with singular input"); options.sourceMap.content = read_source_map(files[name]); } } } if (options.parse.toplevel === null) { throw new Error("no source file given"); } toplevel = options.parse.toplevel; } if (quoted_props && options.mangle.properties.keep_quoted !== "strict") { reserve_quoted_keys(toplevel, quoted_props); } var annotated_props; if (options.mangle && options.mangle.properties) { annotated_props = find_annotated_props(toplevel); } if (options.wrap) { toplevel = toplevel.wrap_commonjs(options.wrap); } if (options.enclose) { toplevel = toplevel.wrap_enclose(options.enclose); } if (timings) timings.rename = Date.now(); if (timings) timings.compress = Date.now(); if (options.compress) { toplevel = new Compressor(options.compress, { mangle_options: options.mangle }).compress(toplevel); } if (timings) timings.scope = Date.now(); if (options.mangle) toplevel.figure_out_scope(options.mangle); if (timings) timings.mangle = Date.now(); if (options.mangle) { toplevel.compute_char_frequency(options.mangle); toplevel.mangle_names(options.mangle); toplevel = mangle_private_properties(toplevel, options.mangle); } if (timings) timings.properties = Date.now(); if (options.mangle && options.mangle.properties) { toplevel = mangle_properties(toplevel, options.mangle.properties, annotated_props); } if (timings) timings.format = Date.now(); var result = {}; if (options.format.ast) { result.ast = toplevel; } if (options.format.spidermonkey) { result.ast = toplevel.to_mozilla_ast(); } let format_options; if (!HOP(options.format, "code") || options.format.code) { format_options = { ...options.format }; if (!format_options.ast) { format_options._destroy_ast = true; walk(toplevel, (node) => { if (node instanceof AST_Scope) { node.variables = void 0; node.enclosed = void 0; node.parent_scope = void 0; } if (node.block_scope) { node.block_scope.variables = void 0; node.block_scope.enclosed = void 0; node.parent_scope = void 0; } }); } if (options.sourceMap) { if (options.sourceMap.includeSources && files instanceof AST_Toplevel) { throw new Error("original source content unavailable"); } format_options.source_map = yield* SourceMap({ file: options.sourceMap.filename, orig: options.sourceMap.content, root: options.sourceMap.root, files: options.sourceMap.includeSources ? files : null }); } delete format_options.ast; delete format_options.code; delete format_options.spidermonkey; var stream = OutputStream(format_options); toplevel.print(stream); result.code = stream.get(); if (options.sourceMap) { Object.defineProperty(result, "map", { configurable: true, enumerable: true, get() { const map = format_options.source_map.getEncoded(); return result.map = options.sourceMap.asObject ? map : JSON.stringify(map); }, set(value) { Object.defineProperty(result, "map", { value, writable: true }); } }); result.decoded_map = format_options.source_map.getDecoded(); if (options.sourceMap.url == "inline") { var sourceMap2 = typeof result.map === "object" ? JSON.stringify(result.map) : result.map; result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap2); } else if (options.sourceMap.url) { result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; } } } if (options.nameCache && options.mangle) { if (options.mangle.cache) options.nameCache.vars = cache_to_json(options.mangle.cache); if (options.mangle.properties && options.mangle.properties.cache) { options.nameCache.props = cache_to_json(options.mangle.properties.cache); } } if (format_options && format_options.source_map) { format_options.source_map.destroy(); } if (timings) { timings.end = Date.now(); result.timings = { parse: 1e-3 * (timings.rename - timings.parse), rename: 1e-3 * (timings.compress - timings.rename), compress: 1e-3 * (timings.scope - timings.compress), scope: 1e-3 * (timings.mangle - timings.scope), mangle: 1e-3 * (timings.properties - timings.mangle), properties: 1e-3 * (timings.format - timings.properties), format: 1e-3 * (timings.end - timings.format), total: 1e-3 * (timings.end - timings.start) }; } return result; } async function minify2(files, options, _fs_module) { const gen = minify_sync_or_async(files, options, _fs_module); let yielded; let val; do { val = gen.next(await yielded); yielded = val.value; } while (!val.done); return val.value; } function minify_sync(files, options, _fs_module) { const gen = minify_sync_or_async(files, options, _fs_module); let yielded; let val; do { if (yielded && typeof yielded.then === "function") { throw new Error("minify_sync cannot be used with the legacy source-map module"); } val = gen.next(yielded); yielded = val.value; } while (!val.done); return val.value; } async function run_cli({ program, packageJson, fs: fs2, path }) { const skip_keys = /* @__PURE__ */ new Set(["cname", "parent_scope", "scope", "uses_eval", "uses_with"]); var files = {}; var options = { compress: false, mangle: false }; const default_options = await _default_options(); program.version(packageJson.name + " " + packageJson.version); program.parseArgv = program.parse; program.parse = void 0; if (process.argv.includes("ast")) program.helpInformation = describe_ast; else if (process.argv.includes("options")) program.helpInformation = function() { var text = []; for (var option in default_options) { text.push("--" + (option === "sourceMap" ? "source-map" : option) + " options:"); text.push(format_object(default_options[option])); text.push(""); } return text.join("\n"); }; program.option("-p, --parse ", "Specify parser options.", parse_js()); program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js()); program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js()); program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js()); program.option("-f, --format [options]", "Format options.", parse_js()); program.option("-b, --beautify [options]", "Alias for --format.", parse_js()); program.option("-o, --output ", "Output file (default STDOUT)."); program.option("--comments [filter]", "Preserve copyright comments in the output."); program.option("--config-file ", "Read minify() options from JSON file."); program.option("-d, --define [=value]", "Global definitions.", parse_js("define")); program.option("--ecma ", "Specify ECMAScript release: 5, 2015, 2016 or 2017..."); program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values."); program.option("--ie8", "Support non-standard Internet Explorer 8."); program.option("--keep-classnames", "Do not mangle/drop class names."); program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); program.option("--module", "Input is an ES6 module"); program.option("--name-cache ", "File to hold mangled name mappings."); program.option("--rename", "Force symbol expansion."); program.option("--no-rename", "Disable symbol expansion."); program.option("--safari10", "Support non-standard Safari 10."); program.option("--source-map [options]", "Enable source map/specify source map options.", parse_js()); program.option("--timings", "Display operations run time on STDERR."); program.option("--toplevel", "Compress and/or mangle variables in toplevel scope."); program.option("--wrap ", "Embed everything as a function with \u201Cexports\u201D corresponding to \u201Cname\u201D globally."); program.arguments("[files...]").parseArgv(process.argv); if (program.configFile) { options = JSON.parse(read_file(program.configFile)); } if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { fatal("ERROR: cannot write source map to STDOUT"); } [ "compress", "enclose", "ie8", "mangle", "module", "safari10", "sourceMap", "toplevel", "wrap" ].forEach(function(name) { if (name in program) { options[name] = program[name]; } }); if ("ecma" in program) { if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer"); const ecma = program.ecma | 0; if (ecma > 5 && ecma < 2015) options.ecma = ecma + 2009; else options.ecma = ecma; } if (program.format || program.beautify) { const chosenOption = program.format || program.beautify; options.format = typeof chosenOption === "object" ? chosenOption : {}; } if (program.comments) { if (typeof options.format != "object") options.format = {}; options.format.comments = typeof program.comments == "string" ? program.comments == "false" ? false : program.comments : "some"; } if (program.define) { if (typeof options.compress != "object") options.compress = {}; if (typeof options.compress.global_defs != "object") options.compress.global_defs = {}; for (var expr in program.define) { options.compress.global_defs[expr] = program.define[expr]; } } if (program.keepClassnames) { options.keep_classnames = true; } if (program.keepFnames) { options.keep_fnames = true; } if (program.mangleProps) { if (program.mangleProps.domprops) { delete program.mangleProps.domprops; } else { if (typeof program.mangleProps != "object") program.mangleProps = {}; if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = []; } if (typeof options.mangle != "object") options.mangle = {}; options.mangle.properties = program.mangleProps; } if (program.nameCache) { options.nameCache = JSON.parse(read_file(program.nameCache, "{}")); } if (program.output == "ast") { options.format = { ast: true, code: false }; } if (program.parse) { if (!program.parse.acorn && !program.parse.spidermonkey) { options.parse = program.parse; } else if (program.sourceMap && program.sourceMap.content == "inline") { fatal("ERROR: inline source map only works with built-in parser"); } } if (~program.rawArgs.indexOf("--rename")) { options.rename = true; } else if (!program.rename) { options.rename = false; } let convert_path = (name) => name; if (typeof program.sourceMap == "object" && "base" in program.sourceMap) { convert_path = function() { var base = program.sourceMap.base; delete options.sourceMap.base; return function(name) { return path.relative(base, name); }; }(); } let filesList; if (options.files && options.files.length) { filesList = options.files; delete options.files; } else if (program.args.length) { filesList = program.args; } if (filesList) { simple_glob(filesList).forEach(function(name) { files[convert_path(name)] = read_file(name); }); } else { await new Promise((resolve) => { var chunks = []; process.stdin.setEncoding("utf8"); process.stdin.on("data", function(chunk) { chunks.push(chunk); }).on("end", function() { files = [chunks.join("")]; resolve(); }); process.stdin.resume(); }); } await run_cli2(); function convert_ast(fn) { return AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); } async function run_cli2() { var content = program.sourceMap && program.sourceMap.content; if (content && content !== "inline") { options.sourceMap.content = read_file(content, content); } if (program.timings) options.timings = true; try { if (program.parse) { if (program.parse.acorn) { files = convert_ast(function(toplevel, name) { return require_acorn().parse(files[name], { ecmaVersion: 2018, locations: true, program: toplevel, sourceFile: name, sourceType: options.module || program.parse.module ? "module" : "script" }); }); } else if (program.parse.spidermonkey) { files = convert_ast(function(toplevel, name) { var obj = JSON.parse(files[name]); if (!toplevel) return obj; toplevel.body = toplevel.body.concat(obj.body); return toplevel; }); } } } catch (ex) { fatal(ex); } let result; try { result = await minify2(files, options, fs2); } catch (ex) { if (ex.name == "SyntaxError") { print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); var col = ex.col; var lines = files[ex.filename].split(/\r?\n/); var line = lines[ex.line - 1]; if (!line && !col) { line = lines[ex.line - 2]; col = line.length; } if (line) { var limit = 70; if (col > limit) { line = line.slice(col - limit); col = limit; } print_error(line.slice(0, 80)); print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); } } if (ex.defs) { print_error("Supported options:"); print_error(format_object(ex.defs)); } fatal(ex); return; } if (program.output == "ast") { if (!options.compress && !options.mangle) { result.ast.figure_out_scope({}); } console.log(JSON.stringify(result.ast, function(key, value) { if (value) switch (key) { case "thedef": return symdef(value); case "enclosed": return value.length ? value.map(symdef) : void 0; case "variables": case "globals": return value.size ? collect_from_map(value, symdef) : void 0; } if (skip_keys.has(key)) return; if (value instanceof AST_Token) return; if (value instanceof Map) return; if (value instanceof AST_Node) { var result2 = { _class: "AST_" + value.TYPE }; if (value.block_scope) { result2.variables = value.block_scope.variables; result2.enclosed = value.block_scope.enclosed; } value.CTOR.PROPS.forEach(function(prop) { if (prop !== "block_scope") { result2[prop] = value[prop]; } }); return result2; } return value; }, 2)); } else if (program.output == "spidermonkey") { try { const minified = await minify2(result.code, { compress: false, mangle: false, format: { ast: true, code: false } }, fs2); console.log(JSON.stringify(minified.ast.to_mozilla_ast(), null, 2)); } catch (ex) { fatal(ex); return; } } else if (program.output) { fs2.writeFileSync(program.output, result.code); if (options.sourceMap && options.sourceMap.url !== "inline" && result.map) { fs2.writeFileSync(program.output + ".map", result.map); } } else { console.log(result.code); } if (program.nameCache) { fs2.writeFileSync(program.nameCache, JSON.stringify(options.nameCache)); } if (result.timings) for (var phase in result.timings) { print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); } } function fatal(message) { if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:"); print_error(message); process.exit(1); } function simple_glob(glob) { if (Array.isArray(glob)) { return [].concat.apply([], glob.map(simple_glob)); } if (glob && glob.match(/[*?]/)) { var dir = path.dirname(glob); try { var entries = fs2.readdirSync(dir); } catch (ex) { } if (entries) { var pattern = "^" + path.basename(glob).replace(/[.+^$[\]\\(){}]/g, "\\$&").replace(/\*/g, "[^/\\\\]*").replace(/\?/g, "[^/\\\\]") + "$"; var mod = process.platform === "win32" ? "i" : ""; var rx = new RegExp(pattern, mod); var results = entries.filter(function(name) { return rx.test(name); }).map(function(name) { return path.join(dir, name); }); if (results.length) return results; } } return [glob]; } function read_file(path2, default_value) { try { return fs2.readFileSync(path2, "utf8"); } catch (ex) { if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value; fatal(ex); } } function parse_js(flag) { return function(value, options2) { options2 = options2 || {}; try { walk(parse(value, { expression: true }), (node) => { if (node instanceof AST_Assign) { var name = node.left.print_to_string(); var value2 = node.right; if (flag) { options2[name] = value2; } else if (value2 instanceof AST_Array) { options2[name] = value2.elements.map(to_string); } else if (value2 instanceof AST_RegExp) { value2 = value2.value; options2[name] = new RegExp(value2.source, value2.flags); } else { options2[name] = to_string(value2); } return true; } if (node instanceof AST_Symbol || node instanceof AST_PropAccess) { var name = node.print_to_string(); options2[name] = true; return true; } if (!(node instanceof AST_Sequence)) throw node; function to_string(value3) { return value3 instanceof AST_Constant ? value3.getValue() : value3.print_to_string({ quote_keys: true }); } }); } catch (ex) { if (flag) { fatal("Error parsing arguments for '" + flag + "': " + value); } else { options2[value] = null; } } return options2; }; } function symdef(def) { var ret = 1e6 + def.id + " " + def.name; if (def.mangled_name) ret += " " + def.mangled_name; return ret; } function collect_from_map(map, callback) { var result = []; map.forEach(function(def) { result.push(callback(def)); }); return result; } function format_object(obj) { var lines = []; var padding = ""; Object.keys(obj).map(function(name) { if (padding.length < name.length) padding = Array(name.length + 1).join(" "); return [name, JSON.stringify(obj[name])]; }).forEach(function(tokens) { lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); }); return lines.join("\n"); } function print_error(msg) { process.stderr.write(msg); process.stderr.write("\n"); } function describe_ast() { var out = OutputStream({ beautify: true }); function doitem(ctor) { out.print("AST_" + ctor.TYPE); const props = ctor.SELF_PROPS.filter((prop) => !/^\$/.test(prop)); if (props.length > 0) { out.space(); out.with_parens(function() { props.forEach(function(prop, i) { if (i) out.space(); out.print(prop); }); }); } if (ctor.documentation) { out.space(); out.print_string(ctor.documentation); } if (ctor.SUBCLASSES.length > 0) { out.space(); out.with_block(function() { ctor.SUBCLASSES.forEach(function(ctor2) { out.indent(); doitem(ctor2); out.newline(); }); }); } } doitem(AST_Node); return out + "\n"; } } async function _default_options() { const defs = {}; Object.keys(infer_options({ 0: 0 })).forEach((component) => { const options = infer_options({ [component]: { 0: 0 } }); if (options) defs[component] = options; }); return defs; } async function infer_options(options) { try { await minify2("", options); } catch (error) { return error.defs; } } exports2._default_options = _default_options; exports2._run_cli = run_cli; exports2.minify = minify2; exports2.minify_sync = minify_sync; }); } }); // node_modules/html-minifier-terser/dist/htmlminifier.cjs var require_htmlminifier = __commonJS({ "node_modules/html-minifier-terser/dist/htmlminifier.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var CleanCSS = require_clean_css(); var entities = require_lib(); var RelateURL = require_lib2(); var terser = require_bundle_min(); async function replaceAsync(str, regex, asyncFn) { const promises = []; str.replace(regex, (match, ...args) => { const promise = asyncFn(match, ...args); promises.push(promise); }); const data = await Promise.all(promises); return str.replace(regex, () => data.shift()); } var CaseInsensitiveSet = class extends Set { has(str) { return super.has(str.toLowerCase()); } }; var singleAttrIdentifier = /([^\s"'<>/=]+)/; var singleAttrAssigns = [/=/]; var singleAttrValues = [ /"([^"]*)"+/.source, /'([^']*)'+/.source, /([^ \t\n\f\r"'`=<>]+)/.source ]; var qnameCapture = function() { const combiningChar = "\\u0300-\\u0345\\u0360\\u0361\\u0483-\\u0486\\u0591-\\u05A1\\u05A3-\\u05B9\\u05BB-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u064B-\\u0652\\u0670\\u06D6-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0901-\\u0903\\u093C\\u093E-\\u094D\\u0951-\\u0954\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A02\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A70\\u0A71\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B43\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B82\\u0B83\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C82\\u0C83\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D43\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86-\\u0F8B\\u0F90-\\u0F95\\u0F97\\u0F99-\\u0FAD\\u0FB1-\\u0FB7\\u0FB9\\u20D0-\\u20DC\\u20E1\\u302A-\\u302F\\u3099\\u309A"; const digit = "0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE7-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29"; const extender = "\\xB7\\u02D0\\u02D1\\u0387\\u0640\\u0E46\\u0EC6\\u3005\\u3031-\\u3035\\u309D\\u309E\\u30FC-\\u30FE"; const letter = "A-Za-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7\\u04C8\\u04CB\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\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-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD\\u0EAE\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102\\u1103\\u1105-\\u1107\\u1109\\u110B\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D\\u116E\\u1172\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE\\u11AF\\u11B7\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\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\\u2126\\u212A\\u212B\\u212E\\u2180-\\u2182\\u3007\\u3021-\\u3029\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\u4E00-\\u9FA5\\uAC00-\\uD7A3"; const ncname = "[" + letter + "_][" + letter + digit + "\\.\\-_" + combiningChar + extender + "]*"; return "((?:" + ncname + "\\:)?" + ncname + ")"; }(); var startTagOpen = new RegExp("^<" + qnameCapture); var startTagClose = /^\s*(\/?)>/; var endTag = new RegExp("^<\\/" + qnameCapture + "[^>]*>"); var doctype = /^]+>/i; var IS_REGEX_CAPTURING_BROKEN = false; "x".replace(/x(.)?/g, function(m, g) { IS_REGEX_CAPTURING_BROKEN = g === ""; }); var empty = new CaseInsensitiveSet(["area", "base", "basefont", "br", "col", "embed", "frame", "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source", "track", "wbr"]); var inline = new CaseInsensitiveSet(["a", "abbr", "acronym", "applet", "b", "basefont", "bdo", "big", "br", "button", "cite", "code", "del", "dfn", "em", "font", "i", "iframe", "img", "input", "ins", "kbd", "label", "map", "noscript", "object", "q", "s", "samp", "script", "select", "small", "span", "strike", "strong", "sub", "sup", "svg", "textarea", "tt", "u", "var"]); var closeSelf = new CaseInsensitiveSet(["colgroup", "dd", "dt", "li", "option", "p", "td", "tfoot", "th", "thead", "tr", "source"]); var fillAttrs = new CaseInsensitiveSet(["checked", "compact", "declare", "defer", "disabled", "ismap", "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly", "selected"]); var special = new CaseInsensitiveSet(["script", "style"]); var nonPhrasing = new CaseInsensitiveSet(["address", "article", "aside", "base", "blockquote", "body", "caption", "col", "colgroup", "dd", "details", "dialog", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "legend", "li", "menuitem", "meta", "ol", "optgroup", "option", "param", "rp", "rt", "source", "style", "summary", "tbody", "td", "tfoot", "th", "thead", "title", "tr", "track", "ul"]); var reCache = {}; function attrForHandler(handler) { let pattern = singleAttrIdentifier.source + "(?:\\s*(" + joinSingleAttrAssigns(handler) + ")[ \\t\\n\\f\\r]*(?:" + singleAttrValues.join("|") + "))?"; if (handler.customAttrSurround) { const attrClauses = []; for (let i = handler.customAttrSurround.length - 1; i >= 0; i--) { attrClauses[i] = "(?:(" + handler.customAttrSurround[i][0].source + ")\\s*" + pattern + "\\s*(" + handler.customAttrSurround[i][1].source + "))"; } attrClauses.push("(?:" + pattern + ")"); pattern = "(?:" + attrClauses.join("|") + ")"; } return new RegExp("^\\s*" + pattern); } function joinSingleAttrAssigns(handler) { return singleAttrAssigns.concat(handler.customAttrAssign || []).map(function(assign) { return "(?:" + assign.source + ")"; }).join("|"); } var HTMLParser = class { constructor(html, handler) { this.html = html; this.handler = handler; } async parse() { let html = this.html; const handler = this.handler; const stack = []; let lastTag; const attribute = attrForHandler(handler); let last2, prevTag, nextTag; while (html) { last2 = html; if (!lastTag || !special.has(lastTag)) { let textEnd = html.indexOf("<"); if (textEnd === 0) { if (/^"); if (commentEnd >= 0) { if (handler.comment) { await handler.comment(html.substring(4, commentEnd)); } html = html.substring(commentEnd + 3); prevTag = ""; continue; } } if (/^"); if (conditionalEnd >= 0) { if (handler.comment) { await handler.comment(html.substring(2, conditionalEnd + 1), true); } html = html.substring(conditionalEnd + 2); prevTag = ""; continue; } } const doctypeMatch = html.match(doctype); if (doctypeMatch) { if (handler.doctype) { handler.doctype(doctypeMatch[0]); } html = html.substring(doctypeMatch[0].length); prevTag = ""; continue; } const endTagMatch = html.match(endTag); if (endTagMatch) { html = html.substring(endTagMatch[0].length); await replaceAsync(endTagMatch[0], endTag, parseEndTag); prevTag = "/" + endTagMatch[1].toLowerCase(); continue; } const startTagMatch = parseStartTag(html); if (startTagMatch) { html = startTagMatch.rest; await handleStartTag(startTagMatch); prevTag = startTagMatch.tagName.toLowerCase(); continue; } if (handler.continueOnParseError) { textEnd = html.indexOf("<", 1); } } let text; if (textEnd >= 0) { text = html.substring(0, textEnd); html = html.substring(textEnd); } else { text = html; html = ""; } let nextTagMatch = parseStartTag(html); if (nextTagMatch) { nextTag = nextTagMatch.tagName; } else { nextTagMatch = html.match(endTag); if (nextTagMatch) { nextTag = "/" + nextTagMatch[1]; } else { nextTag = ""; } } if (handler.chars) { await handler.chars(text, prevTag, nextTag); } prevTag = ""; } else { const stackedTag = lastTag.toLowerCase(); const reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp("([\\s\\S]*?)]*>", "i")); html = await replaceAsync(html, reStackedTag, async (_, text) => { if (stackedTag !== "script" && stackedTag !== "style" && stackedTag !== "noscript") { text = text.replace(//g, "$1").replace(//g, "$1"); } if (handler.chars) { await handler.chars(text); } return ""; }); await parseEndTag("", stackedTag); } if (html === last2) { throw new Error("Parse Error: " + html); } } if (!handler.partialMarkup) { await parseEndTag(); } function parseStartTag(input) { const start = input.match(startTagOpen); if (start) { const match = { tagName: start[1], attrs: [] }; input = input.slice(start[0].length); let end, attr; while (!(end = input.match(startTagClose)) && (attr = input.match(attribute))) { input = input.slice(attr[0].length); match.attrs.push(attr); } if (end) { match.unarySlash = end[1]; match.rest = input.slice(end[0].length); return match; } } } async function closeIfFound(tagName) { if (findTag(tagName) >= 0) { await parseEndTag("", tagName); return true; } } async function handleStartTag(match) { const tagName = match.tagName; let unarySlash = match.unarySlash; if (handler.html5) { if (lastTag === "p" && nonPhrasing.has(tagName)) { await parseEndTag("", lastTag); } else if (tagName === "tbody") { await closeIfFound("thead"); } else if (tagName === "tfoot") { if (!await closeIfFound("tbody")) { await closeIfFound("thead"); } } if (tagName === "col" && findTag("colgroup") < 0) { lastTag = "colgroup"; stack.push({ tag: lastTag, attrs: [] }); if (handler.start) { await handler.start(lastTag, [], false, ""); } } } if (!handler.html5 && !inline.has(tagName)) { while (lastTag && inline.has(lastTag)) { await parseEndTag("", lastTag); } } if (closeSelf.has(tagName) && lastTag === tagName) { await parseEndTag("", tagName); } const unary = empty.has(tagName) || tagName === "html" && lastTag === "head" || !!unarySlash; const attrs = match.attrs.map(function(args) { let name, value, customOpen, customClose, customAssign, quote; const ncp = 7; if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) { if (args[3] === "") { delete args[3]; } if (args[4] === "") { delete args[4]; } if (args[5] === "") { delete args[5]; } } function populate(index) { customAssign = args[index]; value = args[index + 1]; if (typeof value !== "undefined") { return '"'; } value = args[index + 2]; if (typeof value !== "undefined") { return "'"; } value = args[index + 3]; if (typeof value === "undefined" && fillAttrs.has(name)) { value = name; } return ""; } let j = 1; if (handler.customAttrSurround) { for (let i = 0, l = handler.customAttrSurround.length; i < l; i++, j += ncp) { name = args[j + 1]; if (name) { quote = populate(j + 2); customOpen = args[j]; customClose = args[j + 6]; break; } } } if (!name && (name = args[j])) { quote = populate(j + 1); } return { name, value, customAssign: customAssign || "=", customOpen: customOpen || "", customClose: customClose || "", quote: quote || "" }; }); if (!unary) { stack.push({ tag: tagName, attrs }); lastTag = tagName; unarySlash = ""; } if (handler.start) { await handler.start(tagName, attrs, unary, unarySlash); } } function findTag(tagName) { let pos; const needle = tagName.toLowerCase(); for (pos = stack.length - 1; pos >= 0; pos--) { if (stack[pos].tag.toLowerCase() === needle) { break; } } return pos; } async function parseEndTag(tag, tagName) { let pos; if (tagName) { pos = findTag(tagName); } else { pos = 0; } if (pos >= 0) { for (let i = stack.length - 1; i >= pos; i--) { if (handler.end) { handler.end(stack[i].tag, stack[i].attrs, i > pos || !tag); } } stack.length = pos; lastTag = pos && stack[pos - 1].tag; } else if (tagName.toLowerCase() === "br") { if (handler.start) { await handler.start(tagName, [], true, ""); } } else if (tagName.toLowerCase() === "p") { if (handler.start) { await handler.start(tagName, [], false, "", true); } if (handler.end) { handler.end(tagName, []); } } } } }; var Sorter = class { sort(tokens, fromIndex = 0) { for (let i = 0, len = this.keys.length; i < len; i++) { const key = this.keys[i]; const token = key.slice(1); let index = tokens.indexOf(token, fromIndex); if (index !== -1) { do { if (index !== fromIndex) { tokens.splice(index, 1); tokens.splice(fromIndex, 0, token); } fromIndex++; } while ((index = tokens.indexOf(token, fromIndex)) !== -1); return this[key].sort(tokens, fromIndex); } } return tokens; } }; var TokenChain = class { add(tokens) { tokens.forEach((token) => { const key = "$" + token; if (!this[key]) { this[key] = []; this[key].processed = 0; } this[key].push(tokens); }); } createSorter() { const sorter = new Sorter(); sorter.keys = Object.keys(this).sort((j, k) => { const m = this[j].length; const n = this[k].length; return m < n ? 1 : m > n ? -1 : j < k ? -1 : j > k ? 1 : 0; }).filter((key) => { if (this[key].processed < this[key].length) { const token = key.slice(1); const chain = new TokenChain(); this[key].forEach((tokens) => { let index; while ((index = tokens.indexOf(token)) !== -1) { tokens.splice(index, 1); } tokens.forEach((token2) => { this["$" + token2].processed++; }); chain.add(tokens.slice(0)); }); sorter[key] = chain.createSorter(); return true; } return false; }); return sorter; } }; function trimWhitespace(str) { return str && str.replace(/^[ \n\r\t\f]+/, "").replace(/[ \n\r\t\f]+$/, ""); } function collapseWhitespaceAll(str) { return str && str.replace(/[ \n\r\t\f\xA0]+/g, function(spaces) { return spaces === " " ? " " : spaces.replace(/(^|\xA0+)[^\xA0]+/g, "$1 "); }); } function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) { let lineBreakBefore = ""; let lineBreakAfter = ""; if (options.preserveLineBreaks) { str = str.replace(/^[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*/, function() { lineBreakBefore = "\n"; return ""; }).replace(/[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*$/, function() { lineBreakAfter = "\n"; return ""; }); } if (trimLeft) { str = str.replace(/^[ \n\r\t\f\xA0]+/, function(spaces) { const conservative = !lineBreakBefore && options.conservativeCollapse; if (conservative && spaces === " ") { return " "; } return spaces.replace(/^[^\xA0]+/, "").replace(/(\xA0+)[^\xA0]+/g, "$1 ") || (conservative ? " " : ""); }); } if (trimRight) { str = str.replace(/[ \n\r\t\f\xA0]+$/, function(spaces) { const conservative = !lineBreakAfter && options.conservativeCollapse; if (conservative && spaces === " ") { return " "; } return spaces.replace(/[^\xA0]+(\xA0+)/g, " $1").replace(/[^\xA0]+$/, "") || (conservative ? " " : ""); }); } if (collapseAll) { str = collapseWhitespaceAll(str); } return lineBreakBefore + str + lineBreakAfter; } var inlineTags = /* @__PURE__ */ new Set(["a", "abbr", "acronym", "b", "bdi", "bdo", "big", "button", "cite", "code", "del", "dfn", "em", "font", "i", "ins", "kbd", "label", "mark", "math", "nobr", "object", "q", "rp", "rt", "rtc", "ruby", "s", "samp", "select", "small", "span", "strike", "strong", "sub", "sup", "svg", "textarea", "time", "tt", "u", "var"]); var inlineTextTags = /* @__PURE__ */ new Set(["a", "abbr", "acronym", "b", "big", "del", "em", "font", "i", "ins", "kbd", "mark", "nobr", "rp", "s", "samp", "small", "span", "strike", "strong", "sub", "sup", "time", "tt", "u", "var"]); var selfClosingInlineTags = /* @__PURE__ */ new Set(["comment", "img", "input", "wbr"]); function collapseWhitespaceSmart(str, prevTag, nextTag, options) { let trimLeft = prevTag && !selfClosingInlineTags.has(prevTag); if (trimLeft && !options.collapseInlineTagWhitespace) { trimLeft = prevTag.charAt(0) === "/" ? !inlineTags.has(prevTag.slice(1)) : !inlineTextTags.has(prevTag); } let trimRight = nextTag && !selfClosingInlineTags.has(nextTag); if (trimRight && !options.collapseInlineTagWhitespace) { trimRight = nextTag.charAt(0) === "/" ? !inlineTextTags.has(nextTag.slice(1)) : !inlineTags.has(nextTag); } return collapseWhitespace(str, options, trimLeft, trimRight, prevTag && nextTag); } function isConditionalComment(text) { return /^\[if\s[^\]]+]|\[endif]$/.test(text); } function isIgnoredComment(text, options) { for (let i = 0, len = options.ignoreCustomComments.length; i < len; i++) { if (options.ignoreCustomComments[i].test(text)) { return true; } } return false; } function isEventAttribute(attrName, options) { const patterns = options.customEventAttributes; if (patterns) { for (let i = patterns.length; i--; ) { if (patterns[i].test(attrName)) { return true; } } return false; } return /^on[a-z]{3,}$/.test(attrName); } function canRemoveAttributeQuotes(value) { return /^[^ \t\n\f\r"'`=<>]+$/.test(value); } function attributesInclude(attributes, attribute) { for (let i = attributes.length; i--; ) { if (attributes[i].name.toLowerCase() === attribute) { return true; } } return false; } function isAttributeRedundant(tag, attrName, attrValue, attrs) { attrValue = attrValue ? trimWhitespace(attrValue.toLowerCase()) : ""; return tag === "script" && attrName === "language" && attrValue === "javascript" || tag === "form" && attrName === "method" && attrValue === "get" || tag === "input" && attrName === "type" && attrValue === "text" || tag === "script" && attrName === "charset" && !attributesInclude(attrs, "src") || tag === "a" && attrName === "name" && attributesInclude(attrs, "id") || tag === "area" && attrName === "shape" && attrValue === "rect"; } var executableScriptsMimetypes = /* @__PURE__ */ new Set([ "text/javascript", "text/ecmascript", "text/jscript", "application/javascript", "application/x-javascript", "application/ecmascript", "module" ]); var keepScriptsMimetypes = /* @__PURE__ */ new Set([ "module" ]); function isScriptTypeAttribute(attrValue = "") { attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase(); return attrValue === "" || executableScriptsMimetypes.has(attrValue); } function keepScriptTypeAttribute(attrValue = "") { attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase(); return keepScriptsMimetypes.has(attrValue); } function isExecutableScript(tag, attrs) { if (tag !== "script") { return false; } for (let i = 0, len = attrs.length; i < len; i++) { const attrName = attrs[i].name.toLowerCase(); if (attrName === "type") { return isScriptTypeAttribute(attrs[i].value); } } return true; } function isStyleLinkTypeAttribute(attrValue = "") { attrValue = trimWhitespace(attrValue).toLowerCase(); return attrValue === "" || attrValue === "text/css"; } function isStyleSheet(tag, attrs) { if (tag !== "style") { return false; } for (let i = 0, len = attrs.length; i < len; i++) { const attrName = attrs[i].name.toLowerCase(); if (attrName === "type") { return isStyleLinkTypeAttribute(attrs[i].value); } } return true; } var isSimpleBoolean = /* @__PURE__ */ new Set(["allowfullscreen", "async", "autofocus", "autoplay", "checked", "compact", "controls", "declare", "default", "defaultchecked", "defaultmuted", "defaultselected", "defer", "disabled", "enabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "itemscope", "loop", "multiple", "muted", "nohref", "noresize", "noshade", "novalidate", "nowrap", "open", "pauseonexit", "readonly", "required", "reversed", "scoped", "seamless", "selected", "sortable", "truespeed", "typemustmatch", "visible"]); var isBooleanValue = /* @__PURE__ */ new Set(["true", "false"]); function isBooleanAttribute(attrName, attrValue) { return isSimpleBoolean.has(attrName) || attrName === "draggable" && !isBooleanValue.has(attrValue); } function isUriTypeAttribute(attrName, tag) { return /^(?:a|area|link|base)$/.test(tag) && attrName === "href" || tag === "img" && /^(?:src|longdesc|usemap)$/.test(attrName) || tag === "object" && /^(?:classid|codebase|data|usemap)$/.test(attrName) || tag === "q" && attrName === "cite" || tag === "blockquote" && attrName === "cite" || (tag === "ins" || tag === "del") && attrName === "cite" || tag === "form" && attrName === "action" || tag === "input" && (attrName === "src" || attrName === "usemap") || tag === "head" && attrName === "profile" || tag === "script" && (attrName === "src" || attrName === "for"); } function isNumberTypeAttribute(attrName, tag) { return /^(?:a|area|object|button)$/.test(tag) && attrName === "tabindex" || tag === "input" && (attrName === "maxlength" || attrName === "tabindex") || tag === "select" && (attrName === "size" || attrName === "tabindex") || tag === "textarea" && /^(?:rows|cols|tabindex)$/.test(attrName) || tag === "colgroup" && attrName === "span" || tag === "col" && attrName === "span" || (tag === "th" || tag === "td") && (attrName === "rowspan" || attrName === "colspan"); } function isLinkType(tag, attrs, value) { if (tag !== "link") { return false; } for (let i = 0, len = attrs.length; i < len; i++) { if (attrs[i].name === "rel" && attrs[i].value === value) { return true; } } } function isMediaQuery(tag, attrs, attrName) { return attrName === "media" && (isLinkType(tag, attrs, "stylesheet") || isStyleSheet(tag, attrs)); } var srcsetTags = /* @__PURE__ */ new Set(["img", "source"]); function isSrcset(attrName, tag) { return attrName === "srcset" && srcsetTags.has(tag); } async function cleanAttributeValue(tag, attrName, attrValue, options, attrs) { if (isEventAttribute(attrName, options)) { attrValue = trimWhitespace(attrValue).replace(/^javascript:\s*/i, ""); return options.minifyJS(attrValue, true); } else if (attrName === "class") { attrValue = trimWhitespace(attrValue); if (options.sortClassName) { attrValue = options.sortClassName(attrValue); } else { attrValue = collapseWhitespaceAll(attrValue); } return attrValue; } else if (isUriTypeAttribute(attrName, tag)) { attrValue = trimWhitespace(attrValue); return isLinkType(tag, attrs, "canonical") ? attrValue : options.minifyURLs(attrValue); } else if (isNumberTypeAttribute(attrName, tag)) { return trimWhitespace(attrValue); } else if (attrName === "style") { attrValue = trimWhitespace(attrValue); if (attrValue) { if (/;$/.test(attrValue) && !/&#?[0-9a-zA-Z]+;$/.test(attrValue)) { attrValue = attrValue.replace(/\s*;$/, ";"); } attrValue = await options.minifyCSS(attrValue, "inline"); } return attrValue; } else if (isSrcset(attrName, tag)) { attrValue = trimWhitespace(attrValue).split(/\s+,\s*|\s*,\s+/).map(function(candidate) { let url = candidate; let descriptor = ""; const match = candidate.match(/\s+([1-9][0-9]*w|[0-9]+(?:\.[0-9]+)?x)$/); if (match) { url = url.slice(0, -match[0].length); const num = +match[1].slice(0, -1); const suffix = match[1].slice(-1); if (num !== 1 || suffix !== "x") { descriptor = " " + num + suffix; } } return options.minifyURLs(url) + descriptor; }).join(", "); } else if (isMetaViewport(tag, attrs) && attrName === "content") { attrValue = attrValue.replace(/\s+/g, "").replace(/[0-9]+\.[0-9]+/g, function(numString) { return (+numString).toString(); }); } else if (isContentSecurityPolicy(tag, attrs) && attrName.toLowerCase() === "content") { return collapseWhitespaceAll(attrValue); } else if (options.customAttrCollapse && options.customAttrCollapse.test(attrName)) { attrValue = trimWhitespace(attrValue.replace(/ ?[\n\r]+ ?/g, "").replace(/\s{2,}/g, options.conservativeCollapse ? " " : "")); } else if (tag === "script" && attrName === "type") { attrValue = trimWhitespace(attrValue.replace(/\s*;\s*/g, ";")); } else if (isMediaQuery(tag, attrs, attrName)) { attrValue = trimWhitespace(attrValue); return options.minifyCSS(attrValue, "media"); } return attrValue; } function isMetaViewport(tag, attrs) { if (tag !== "meta") { return false; } for (let i = 0, len = attrs.length; i < len; i++) { if (attrs[i].name === "name" && attrs[i].value === "viewport") { return true; } } } function isContentSecurityPolicy(tag, attrs) { if (tag !== "meta") { return false; } for (let i = 0, len = attrs.length; i < len; i++) { if (attrs[i].name.toLowerCase() === "http-equiv" && attrs[i].value.toLowerCase() === "content-security-policy") { return true; } } } function ignoreCSS(id) { return "/* clean-css ignore:start */" + id + "/* clean-css ignore:end */"; } function wrapCSS(text, type) { switch (type) { case "inline": return "*{" + text + "}"; case "media": return "@media " + text + "{a{top:0}}"; default: return text; } } function unwrapCSS(text, type) { let matches; switch (type) { case "inline": matches = text.match(/^\*\{([\s\S]*)\}$/); break; case "media": matches = text.match(/^@media ([\s\S]*?)\s*{[\s\S]*}$/); break; } return matches ? matches[1] : text; } async function cleanConditionalComment(comment, options) { return options.processConditionalComments ? await replaceAsync(comment, /^(\[if\s[^\]]+]>)([\s\S]*?)( -1) { return await minifyHTML(text, options); } } return text; } var optionalStartTags = /* @__PURE__ */ new Set(["html", "head", "body", "colgroup", "tbody"]); var optionalEndTags = /* @__PURE__ */ new Set(["html", "head", "body", "li", "dt", "dd", "p", "rb", "rt", "rtc", "rp", "optgroup", "option", "colgroup", "caption", "thead", "tbody", "tfoot", "tr", "td", "th"]); var headerTags = /* @__PURE__ */ new Set(["meta", "link", "script", "style", "template", "noscript"]); var descriptionTags = /* @__PURE__ */ new Set(["dt", "dd"]); var pBlockTags = /* @__PURE__ */ new Set(["address", "article", "aside", "blockquote", "details", "div", "dl", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "main", "menu", "nav", "ol", "p", "pre", "section", "table", "ul"]); var pInlineTags = /* @__PURE__ */ new Set(["a", "audio", "del", "ins", "map", "noscript", "video"]); var rubyTags = /* @__PURE__ */ new Set(["rb", "rt", "rtc", "rp"]); var rtcTag = /* @__PURE__ */ new Set(["rb", "rtc", "rp"]); var optionTag = /* @__PURE__ */ new Set(["option", "optgroup"]); var tableContentTags = /* @__PURE__ */ new Set(["tbody", "tfoot"]); var tableSectionTags = /* @__PURE__ */ new Set(["thead", "tbody", "tfoot"]); var cellTags = /* @__PURE__ */ new Set(["td", "th"]); var topLevelTags = /* @__PURE__ */ new Set(["html", "head", "body"]); var compactTags = /* @__PURE__ */ new Set(["html", "body"]); var looseTags = /* @__PURE__ */ new Set(["head", "colgroup", "caption"]); var trailingTags = /* @__PURE__ */ new Set(["dt", "thead"]); var htmlTags = /* @__PURE__ */ new Set(["a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "command", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "isindex", "kbd", "keygen", "label", "legend", "li", "link", "listing", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "multicol", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp"]); function canRemoveParentTag(optionalStartTag, tag) { switch (optionalStartTag) { case "html": case "head": return true; case "body": return !headerTags.has(tag); case "colgroup": return tag === "col"; case "tbody": return tag === "tr"; } return false; } function isStartTagMandatory(optionalEndTag, tag) { switch (tag) { case "colgroup": return optionalEndTag === "colgroup"; case "tbody": return tableSectionTags.has(optionalEndTag); } return false; } function canRemovePrecedingTag(optionalEndTag, tag) { switch (optionalEndTag) { case "html": case "head": case "body": case "colgroup": case "caption": return true; case "li": case "optgroup": case "tr": return tag === optionalEndTag; case "dt": case "dd": return descriptionTags.has(tag); case "p": return pBlockTags.has(tag); case "rb": case "rt": case "rp": return rubyTags.has(tag); case "rtc": return rtcTag.has(tag); case "option": return optionTag.has(tag); case "thead": case "tbody": return tableContentTags.has(tag); case "tfoot": return tag === "tbody"; case "td": case "th": return cellTags.has(tag); } return false; } var reEmptyAttribute = new RegExp("^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(?:down|up|over|move|out)|key(?:press|down|up)))$"); function canDeleteEmptyAttribute(tag, attrName, attrValue, options) { const isValueEmpty = !attrValue || /^\s*$/.test(attrValue); if (!isValueEmpty) { return false; } if (typeof options.removeEmptyAttributes === "function") { return options.removeEmptyAttributes(attrName, tag); } return tag === "input" && attrName === "value" || reEmptyAttribute.test(attrName); } function hasAttrName(name, attrs) { for (let i = attrs.length - 1; i >= 0; i--) { if (attrs[i].name === name) { return true; } } return false; } function canRemoveElement(tag, attrs) { switch (tag) { case "textarea": return false; case "audio": case "script": case "video": if (hasAttrName("src", attrs)) { return false; } break; case "iframe": if (hasAttrName("src", attrs) || hasAttrName("srcdoc", attrs)) { return false; } break; case "object": if (hasAttrName("data", attrs)) { return false; } break; case "applet": if (hasAttrName("code", attrs)) { return false; } break; } return true; } function canCollapseWhitespace(tag) { return !/^(?:script|style|pre|textarea)$/.test(tag); } function canTrimWhitespace(tag) { return !/^(?:pre|textarea)$/.test(tag); } async function normalizeAttr(attr, attrs, tag, options) { const attrName = options.name(attr.name); let attrValue = attr.value; if (options.decodeEntities && attrValue) { attrValue = entities.decodeHTMLStrict(attrValue); } if (options.removeRedundantAttributes && isAttributeRedundant(tag, attrName, attrValue, attrs) || options.removeScriptTypeAttributes && tag === "script" && attrName === "type" && isScriptTypeAttribute(attrValue) && !keepScriptTypeAttribute(attrValue) || options.removeStyleLinkTypeAttributes && (tag === "style" || tag === "link") && attrName === "type" && isStyleLinkTypeAttribute(attrValue)) { return; } if (attrValue) { attrValue = await cleanAttributeValue(tag, attrName, attrValue, options, attrs); } if (options.removeEmptyAttributes && canDeleteEmptyAttribute(tag, attrName, attrValue, options)) { return; } if (options.decodeEntities && attrValue) { attrValue = attrValue.replace(/&(#?[0-9a-zA-Z]+;)/g, "&$1"); } return { attr, name: attrName, value: attrValue }; } function buildAttr(normalized, hasUnarySlash, options, isLast, uidAttr) { const attrName = normalized.name; let attrValue = normalized.value; const attr = normalized.attr; let attrQuote = attr.quote; let attrFragment; let emittedAttrValue; if (typeof attrValue !== "undefined" && (!options.removeAttributeQuotes || ~attrValue.indexOf(uidAttr) || !canRemoveAttributeQuotes(attrValue))) { if (!options.preventAttributesEscaping) { if (typeof options.quoteCharacter === "undefined") { const apos = (attrValue.match(/'/g) || []).length; const quot = (attrValue.match(/"/g) || []).length; attrQuote = apos < quot ? "'" : '"'; } else { attrQuote = options.quoteCharacter === "'" ? "'" : '"'; } if (attrQuote === '"') { attrValue = attrValue.replace(/"/g, """); } else { attrValue = attrValue.replace(/'/g, "'"); } } emittedAttrValue = attrQuote + attrValue + attrQuote; if (!isLast && !options.removeTagWhitespace) { emittedAttrValue += " "; } } else if (isLast && !hasUnarySlash && !/\/$/.test(attrValue)) { emittedAttrValue = attrValue; } else { emittedAttrValue = attrValue + " "; } if (typeof attrValue === "undefined" || options.collapseBooleanAttributes && isBooleanAttribute(attrName.toLowerCase(), attrValue.toLowerCase())) { attrFragment = attrName; if (!isLast) { attrFragment += " "; } } else { attrFragment = attrName + attr.customAssign + emittedAttrValue; } return attr.customOpen + attrFragment + attr.customClose; } function identity(value) { return value; } function identityAsync(value) { return Promise.resolve(value); } var processOptions = (inputOptions) => { const options = { name: function(name) { return name.toLowerCase(); }, canCollapseWhitespace, canTrimWhitespace, html5: true, ignoreCustomComments: [ /^!/, /^\s*#/ ], ignoreCustomFragments: [ /<%[\s\S]*?%>/, /<\?[\s\S]*?\?>/ ], includeAutoGeneratedTags: true, log: identity, minifyCSS: identityAsync, minifyJS: identity, minifyURLs: identity }; Object.keys(inputOptions).forEach(function(key) { const option = inputOptions[key]; if (key === "caseSensitive") { if (option) { options.name = identity; } } else if (key === "log") { if (typeof option === "function") { options.log = option; } } else if (key === "minifyCSS" && typeof option !== "function") { if (!option) { return; } const cleanCssOptions = typeof option === "object" ? option : {}; options.minifyCSS = async function(text, type) { text = text.replace(/(url\s*\(\s*)("|'|)(.*?)\2(\s*\))/ig, function(match, prefix, quote, url, suffix) { return prefix + quote + options.minifyURLs(url) + quote + suffix; }); const inputCSS = wrapCSS(text, type); return new Promise((resolve) => { new CleanCSS(cleanCssOptions).minify(inputCSS, (_err, output) => { if (output.errors.length > 0) { output.errors.forEach(options.log); resolve(text); } const outputCSS = unwrapCSS(output.styles, type); resolve(outputCSS); }); }); }; } else if (key === "minifyJS" && typeof option !== "function") { if (!option) { return; } const terserOptions = typeof option === "object" ? option : {}; terserOptions.parse = { ...terserOptions.parse, bare_returns: false }; options.minifyJS = async function(text, inline2) { const start = text.match(/^\s*\s*$/, "") : text; terserOptions.parse.bare_returns = inline2; try { const result = await terser.minify(code, terserOptions); return result.code.replace(/;$/, ""); } catch (error) { options.log(error); return text; } }; } else if (key === "minifyURLs" && typeof option !== "function") { if (!option) { return; } let relateUrlOptions = option; if (typeof option === "string") { relateUrlOptions = { site: option }; } else if (typeof option !== "object") { relateUrlOptions = {}; } options.minifyURLs = function(text) { try { return RelateURL.relate(text, relateUrlOptions); } catch (err) { options.log(err); return text; } }; } else { options[key] = option; } }); return options; }; function uniqueId(value) { let id; do { id = Math.random().toString(36).replace(/^0\.[0-9]*/, ""); } while (~value.indexOf(id)); return id; } var specialContentTags = /* @__PURE__ */ new Set(["script", "style"]); async function createSortFns(value, options, uidIgnore, uidAttr) { const attrChains = options.sortAttributes && /* @__PURE__ */ Object.create(null); const classChain = options.sortClassName && new TokenChain(); function attrNames(attrs) { return attrs.map(function(attr) { return options.name(attr.name); }); } function shouldSkipUID(token, uid) { return !uid || token.indexOf(uid) === -1; } function shouldSkipUIDs(token) { return shouldSkipUID(token, uidIgnore) && shouldSkipUID(token, uidAttr); } async function scan(input) { let currentTag, currentType; const parser = new HTMLParser(input, { start: function(tag, attrs) { if (attrChains) { if (!attrChains[tag]) { attrChains[tag] = new TokenChain(); } attrChains[tag].add(attrNames(attrs).filter(shouldSkipUIDs)); } for (let i = 0, len = attrs.length; i < len; i++) { const attr = attrs[i]; if (classChain && attr.value && options.name(attr.name) === "class") { classChain.add(trimWhitespace(attr.value).split(/[ \t\n\f\r]+/).filter(shouldSkipUIDs)); } else if (options.processScripts && attr.name.toLowerCase() === "type") { currentTag = tag; currentType = attr.value; } } }, end: function() { currentTag = ""; }, chars: async function(text) { if (options.processScripts && specialContentTags.has(currentTag) && options.processScripts.indexOf(currentType) > -1) { await scan(text); } } }); await parser.parse(); } const log = options.log; options.log = identity; options.sortAttributes = false; options.sortClassName = false; await scan(await minifyHTML(value, options)); options.log = log; if (attrChains) { const attrSorters = /* @__PURE__ */ Object.create(null); for (const tag in attrChains) { attrSorters[tag] = attrChains[tag].createSorter(); } options.sortAttributes = function(tag, attrs) { const sorter = attrSorters[tag]; if (sorter) { const attrMap = /* @__PURE__ */ Object.create(null); const names = attrNames(attrs); names.forEach(function(name, index) { (attrMap[name] || (attrMap[name] = [])).push(attrs[index]); }); sorter.sort(names).forEach(function(name, index) { attrs[index] = attrMap[name].shift(); }); } }; } if (classChain) { const sorter = classChain.createSorter(); options.sortClassName = function(value2) { return sorter.sort(value2.split(/[ \n\f\r]+/)).join(" "); }; } } async function minifyHTML(value, options, partialMarkup) { if (options.collapseWhitespace) { value = collapseWhitespace(value, options, true, true); } const buffer = []; let charsPrevTag; let currentChars = ""; let hasChars; let currentTag = ""; let currentAttrs = []; const stackNoTrimWhitespace = []; const stackNoCollapseWhitespace = []; let optionalStartTag = ""; let optionalEndTag = ""; const ignoredMarkupChunks = []; const ignoredCustomMarkupChunks = []; let uidIgnore; let uidAttr; let uidPattern; value = value.replace(/([\s\S]*?)/g, function(match, group1) { if (!uidIgnore) { uidIgnore = uniqueId(value); const pattern = new RegExp("^" + uidIgnore + "([0-9]+)$"); if (options.ignoreCustomComments) { options.ignoreCustomComments = options.ignoreCustomComments.slice(); } else { options.ignoreCustomComments = []; } options.ignoreCustomComments.push(pattern); } const token = ""; ignoredMarkupChunks.push(group1); return token; }); const customFragments = options.ignoreCustomFragments.map(function(re) { return re.source; }); if (customFragments.length) { const reCustomIgnore = new RegExp("\\s*(?:" + customFragments.join("|") + ")+\\s*", "g"); value = value.replace(reCustomIgnore, function(match) { if (!uidAttr) { uidAttr = uniqueId(value); uidPattern = new RegExp("(\\s*)" + uidAttr + "([0-9]+)" + uidAttr + "(\\s*)", "g"); if (options.minifyCSS) { options.minifyCSS = function(fn) { return function(text, type) { text = text.replace(uidPattern, function(match2, prefix, index) { const chunks = ignoredCustomMarkupChunks[+index]; return chunks[1] + uidAttr + index + uidAttr + chunks[2]; }); const ids = []; new CleanCSS().minify(wrapCSS(text, type)).warnings.forEach(function(warning) { const match2 = uidPattern.exec(warning); if (match2) { const id = uidAttr + match2[2] + uidAttr; text = text.replace(id, ignoreCSS(id)); ids.push(id); } }); return fn(text, type).then((chunk) => { ids.forEach(function(id) { chunk = chunk.replace(ignoreCSS(id), id); }); return chunk; }); }; }(options.minifyCSS); } if (options.minifyJS) { options.minifyJS = function(fn) { return function(text, type) { return fn(text.replace(uidPattern, function(match2, prefix, index) { const chunks = ignoredCustomMarkupChunks[+index]; return chunks[1] + uidAttr + index + uidAttr + chunks[2]; }), type); }; }(options.minifyJS); } } const token = uidAttr + ignoredCustomMarkupChunks.length + uidAttr; ignoredCustomMarkupChunks.push(/^(\s*)[\s\S]*?(\s*)$/.exec(match)); return " " + token + " "; }); } if (options.sortAttributes && typeof options.sortAttributes !== "function" || options.sortClassName && typeof options.sortClassName !== "function") { await createSortFns(value, options, uidIgnore, uidAttr); } function _canCollapseWhitespace(tag, attrs) { return options.canCollapseWhitespace(tag, attrs, canCollapseWhitespace); } function _canTrimWhitespace(tag, attrs) { return options.canTrimWhitespace(tag, attrs, canTrimWhitespace); } function removeStartTag() { let index = buffer.length - 1; while (index > 0 && !/^<[^/!]/.test(buffer[index])) { index--; } buffer.length = Math.max(0, index); } function removeEndTag() { let index = buffer.length - 1; while (index > 0 && !/^<\//.test(buffer[index])) { index--; } buffer.length = Math.max(0, index); } function trimTrailingWhitespace(index, nextTag) { for (let endTag2 = null; index >= 0 && _canTrimWhitespace(endTag2); index--) { const str = buffer[index]; const match = str.match(/^<\/([\w:-]+)>$/); if (match) { endTag2 = match[1]; } else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) { break; } } } function squashTrailingWhitespace(nextTag) { let charsIndex = buffer.length - 1; if (buffer.length > 1) { const item = buffer[buffer.length - 1]; if (/^(?:= 0; ) { const normalized = await normalizeAttr(attrs[i], attrs, tag, options); if (normalized) { parts.unshift(buildAttr(normalized, hasUnarySlash, options, isLast, uidAttr)); isLast = false; } } if (parts.length > 0) { buffer.push(" "); buffer.push.apply(buffer, parts); } else if (optional && optionalStartTags.has(tag)) { optionalStartTag = tag; } buffer.push(buffer.pop() + (hasUnarySlash ? "/" : "") + ">"); if (autoGenerated && !options.includeAutoGeneratedTags) { removeStartTag(); optionalStartTag = ""; } }, end: function(tag, attrs, autoGenerated) { if (tag.toLowerCase() === "svg") { options = Object.getPrototypeOf(options); } tag = options.name(tag); if (options.collapseWhitespace) { if (stackNoTrimWhitespace.length) { if (tag === stackNoTrimWhitespace[stackNoTrimWhitespace.length - 1]) { stackNoTrimWhitespace.pop(); } } else { squashTrailingWhitespace("/" + tag); } if (stackNoCollapseWhitespace.length && tag === stackNoCollapseWhitespace[stackNoCollapseWhitespace.length - 1]) { stackNoCollapseWhitespace.pop(); } } let isElementEmpty = false; if (tag === currentTag) { currentTag = ""; isElementEmpty = !hasChars; } if (options.removeOptionalTags) { if (isElementEmpty && topLevelTags.has(optionalStartTag)) { removeStartTag(); } optionalStartTag = ""; if (htmlTags.has(tag) && optionalEndTag && !trailingTags.has(optionalEndTag) && (optionalEndTag !== "p" || !pInlineTags.has(tag))) { removeEndTag(); } optionalEndTag = optionalEndTags.has(tag) ? tag : ""; } if (options.removeEmptyElements && isElementEmpty && canRemoveElement(tag, attrs)) { removeStartTag(); optionalStartTag = ""; optionalEndTag = ""; } else { if (autoGenerated && !options.includeAutoGeneratedTags) { optionalEndTag = ""; } else { buffer.push(""); } charsPrevTag = "/" + tag; if (!inlineTags.has(tag)) { currentChars = ""; } else if (isElementEmpty) { currentChars += "|"; } } }, chars: async function(text, prevTag, nextTag) { prevTag = prevTag === "" ? "comment" : prevTag; nextTag = nextTag === "" ? "comment" : nextTag; if (options.decodeEntities && text && !specialContentTags.has(currentTag)) { text = entities.decodeHTML(text); } if (options.collapseWhitespace) { if (!stackNoTrimWhitespace.length) { if (prevTag === "comment") { const prevComment = buffer[buffer.length - 1]; if (prevComment.indexOf(uidIgnore) === -1) { if (!prevComment) { prevTag = charsPrevTag; } if (buffer.length > 1 && (!prevComment || !options.conservativeCollapse && / $/.test(currentChars))) { const charsIndex = buffer.length - 2; buffer[charsIndex] = buffer[charsIndex].replace(/\s+$/, function(trailingSpaces) { text = trailingSpaces + text; return ""; }); } } } if (prevTag) { if (prevTag === "/nobr" || prevTag === "wbr") { if (/^\s/.test(text)) { let tagIndex = buffer.length - 1; while (tagIndex > 0 && buffer[tagIndex].lastIndexOf("<" + prevTag) !== 0) { tagIndex--; } trimTrailingWhitespace(tagIndex - 1, "br"); } } else if (inlineTextTags.has(prevTag.charAt(0) === "/" ? prevTag.slice(1) : prevTag)) { text = collapseWhitespace(text, options, /(?:^|\s)$/.test(currentChars)); } } if (prevTag || nextTag) { text = collapseWhitespaceSmart(text, prevTag, nextTag, options); } else { text = collapseWhitespace(text, options, true, true); } if (!text && /\s$/.test(currentChars) && prevTag && prevTag.charAt(0) === "/") { trimTrailingWhitespace(buffer.length - 1, nextTag); } } if (!stackNoCollapseWhitespace.length && nextTag !== "html" && !(prevTag && nextTag)) { text = collapseWhitespace(text, options, false, false, true); } } if (options.processScripts && specialContentTags.has(currentTag)) { text = await processScript(text, options, currentAttrs); } if (isExecutableScript(currentTag, currentAttrs)) { text = await options.minifyJS(text); } if (isStyleSheet(currentTag, currentAttrs)) { text = await options.minifyCSS(text); } if (options.removeOptionalTags && text) { if (optionalStartTag === "html" || optionalStartTag === "body" && !/^\s/.test(text)) { removeStartTag(); } optionalStartTag = ""; if (compactTags.has(optionalEndTag) || looseTags.has(optionalEndTag) && !/^\s/.test(text)) { removeEndTag(); } optionalEndTag = ""; } charsPrevTag = /^\s*$/.test(text) ? prevTag : "comment"; if (options.decodeEntities && text && !specialContentTags.has(currentTag)) { text = text.replace(/&((?:Iacute|aacute|uacute|plusmn|Otilde|otilde|agrave|Agrave|Yacute|yacute|Oslash|oslash|atilde|Atilde|brvbar|ccedil|Ccedil|Ograve|curren|divide|eacute|Eacute|ograve|Oacute|egrave|Egrave|Ugrave|frac12|frac14|frac34|ugrave|oacute|iacute|Ntilde|ntilde|Uacute|middot|igrave|Igrave|iquest|Aacute|cedil|laquo|micro|iexcl|Icirc|icirc|acirc|Ucirc|Ecirc|ocirc|Ocirc|ecirc|ucirc|Aring|aring|AElig|aelig|acute|pound|raquo|Acirc|times|THORN|szlig|thorn|COPY|auml|ordf|ordm|Uuml|macr|uuml|Auml|ouml|Ouml|para|nbsp|euml|quot|QUOT|Euml|yuml|cent|sect|copy|sup1|sup2|sup3|iuml|Iuml|ETH|shy|reg|not|yen|amp|AMP|REG|uml|eth|deg|gt|GT|LT|lt)(?!;)|(?:#?[0-9a-zA-Z]+;))/g, "&$1").replace(/" : "-->"; if (isConditionalComment(text)) { text = prefix + await cleanConditionalComment(text, options) + suffix; } else if (options.removeComments) { if (isIgnoredComment(text, options)) { text = ""; } else { text = ""; } } else { text = prefix + text + suffix; } if (options.removeOptionalTags && text) { optionalStartTag = ""; optionalEndTag = ""; } buffer.push(text); }, doctype: function(doctype2) { buffer.push(options.useShortDoctype ? "" : collapseWhitespaceAll(doctype2)); } }); await parser.parse(); if (options.removeOptionalTags) { if (topLevelTags.has(optionalStartTag)) { removeStartTag(); } if (optionalEndTag && !trailingTags.has(optionalEndTag)) { removeEndTag(); } } if (options.collapseWhitespace) { squashTrailingWhitespace("br"); } return joinResultSegments(buffer, options, uidPattern ? function(str) { return str.replace(uidPattern, function(match, prefix, index, suffix) { let chunk = ignoredCustomMarkupChunks[+index][0]; if (options.collapseWhitespace) { if (prefix !== " ") { chunk = prefix + chunk; } if (suffix !== " ") { chunk += suffix; } return collapseWhitespace(chunk, { preserveLineBreaks: options.preserveLineBreaks, conservativeCollapse: !options.trimCustomFragments }, /^[ \n\r\t\f]/.test(chunk), /[ \n\r\t\f]$/.test(chunk)); } return chunk; }); } : identity, uidIgnore ? function(str) { return str.replace(new RegExp("", "g"), function(match, index) { return ignoredMarkupChunks[+index]; }); } : identity); } function joinResultSegments(results, options, restoreCustom, restoreIgnore) { let str; const maxLineLength = options.maxLineLength; const noNewlinesBeforeTagClose = options.noNewlinesBeforeTagClose; if (maxLineLength) { let line = ""; const lines = []; while (results.length) { const len = line.length; const end = results[0].indexOf("\n"); const isClosingTag = Boolean(results[0].match(endTag)); const shouldKeepSameLine = noNewlinesBeforeTagClose && isClosingTag; if (end < 0) { line += restoreIgnore(restoreCustom(results.shift())); } else { line += restoreIgnore(restoreCustom(results[0].slice(0, end))); results[0] = results[0].slice(end + 1); } if (len > 0 && line.length > maxLineLength && !shouldKeepSameLine) { lines.push(line.slice(0, len)); line = line.slice(len); } else if (end >= 0) { lines.push(line); line = ""; } } if (line) { lines.push(line); } str = lines.join("\n"); } else { str = restoreIgnore(restoreCustom(results.join(""))); } return options.collapseWhitespace ? collapseWhitespace(str, options, true, true) : str; } var minify2 = async function(value, options) { const start = Date.now(); options = processOptions(options || {}); const result = await minifyHTML(value, options); options.log("minified in: " + (Date.now() - start) + "ms"); return result; }; var htmlminifier = { minify: minify2 }; exports.default = htmlminifier; exports.minify = minify2; } }); // node_modules/mime/Mime.js var require_Mime = __commonJS({ "node_modules/mime/Mime.js"(exports, module2) { "use strict"; function Mime() { this._types = /* @__PURE__ */ Object.create(null); this._extensions = /* @__PURE__ */ Object.create(null); for (let i = 0; i < arguments.length; i++) { this.define(arguments[i]); } this.define = this.define.bind(this); this.getType = this.getType.bind(this); this.getExtension = this.getExtension.bind(this); } Mime.prototype.define = function(typeMap, force) { for (let type in typeMap) { let extensions2 = typeMap[type].map(function(t) { return t.toLowerCase(); }); type = type.toLowerCase(); for (let i = 0; i < extensions2.length; i++) { const ext = extensions2[i]; if (ext[0] === "*") { continue; } if (!force && ext in this._types) { throw new Error('Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".'); } this._types[ext] = type; } if (force || !this._extensions[type]) { const ext = extensions2[0]; this._extensions[type] = ext[0] !== "*" ? ext : ext.substr(1); } } }; Mime.prototype.getType = function(path) { path = String(path); let last2 = path.replace(/^.*[/\\]/, "").toLowerCase(); let ext = last2.replace(/^.*\./, "").toLowerCase(); let hasPath = last2.length < path.length; let hasDot = ext.length < last2.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; Mime.prototype.getExtension = function(type) { type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; return type && this._extensions[type.toLowerCase()] || null; }; module2.exports = Mime; } }); // node_modules/mime/types/standard.js var require_standard = __commonJS({ "node_modules/mime/types/standard.js"(exports, module2) { module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; } }); // node_modules/mime/types/other.js var require_other = __commonJS({ "node_modules/mime/types/other.js"(exports, module2) { module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] }; } }); // node_modules/mime/index.js var require_mime = __commonJS({ "node_modules/mime/index.js"(exports, module2) { "use strict"; var Mime = require_Mime(); module2.exports = new Mime(require_standard(), require_other()); } }); // node_modules/mime-db/db.json var require_db = __commonJS({ "node_modules/mime-db/db.json"(exports, module2) { module2.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana" }, "application/3gpp-ims+xml": { source: "iana" }, "application/a2l": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/alto-costmap+json": { source: "iana", compressible: true }, "application/alto-costmapfilter+json": { source: "iana", compressible: true }, "application/alto-directory+json": { source: "iana", compressible: true }, "application/alto-endpointcost+json": { source: "iana", compressible: true }, "application/alto-endpointcostparams+json": { source: "iana", compressible: true }, "application/alto-endpointprop+json": { source: "iana", compressible: true }, "application/alto-endpointpropparams+json": { source: "iana", compressible: true }, "application/alto-error+json": { source: "iana", compressible: true }, "application/alto-networkmap+json": { source: "iana", compressible: true }, "application/alto-networkmapfilter+json": { source: "iana", compressible: true }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: true, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana" }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", extensions: ["atomsvc"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana" }, "application/bacnet-xdd+zip": { source: "iana" }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: false, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana" }, "application/calendar+json": { source: "iana", compressible: true }, "application/calendar+xml": { source: "iana" }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/cbor": { source: "iana" }, "application/ccmp+xml": { source: "iana" }, "application/ccxml+xml": { source: "iana", extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana" }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana" }, "application/cellml+xml": { source: "iana" }, "application/cfw": { source: "iana" }, "application/clue_info+xml": { source: "iana" }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana" }, "application/coap-group+json": { source: "iana", compressible: true }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana" }, "application/cpl+xml": { source: "iana" }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana" }, "application/cstadata+xml": { source: "iana" }, "application/csvm+json": { source: "iana", compressible: true }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: true }, "application/dash+xml": { source: "iana", extensions: ["mpd"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana" }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: true }, "application/dicom+xml": { source: "iana" }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/docbook+xml": { source: "apache", extensions: ["dbk"] }, "application/dskpp+xml": { source: "iana" }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: true, extensions: ["ecma"] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: false }, "application/edifact": { source: "iana", compressible: false }, "application/efi": { source: "iana" }, "application/emergencycalldata.comment+xml": { source: "iana" }, "application/emergencycalldata.deviceinfo+xml": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana" }, "application/emergencycalldata.serviceinfo+xml": { source: "iana" }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana" }, "application/emma+xml": { source: "iana", extensions: ["emma"] }, "application/emotionml+xml": { source: "iana" }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana" }, "application/epub+zip": { source: "iana", extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana" }, "application/fits": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: false, extensions: ["woff"] }, "application/font-woff2": { compressible: false, extensions: ["woff2"] }, "application/framework-attributes+xml": { source: "iana" }, "application/geo+json": { source: "iana", compressible: true }, "application/gml+xml": { source: "apache", extensions: ["gml"] }, "application/gpx+xml": { source: "apache", extensions: ["gpx"] }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: false }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana" }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana" }, "application/ibe-pkg-reply+xml": { source: "iana" }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana" }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana" }, "application/java-archive": { source: "apache", compressible: false, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: false, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: false, extensions: ["class"] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["js"] }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: true }, "application/jrd+json": { source: "iana", compressible: true }, "application/json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: true }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: true, extensions: ["jsonml"] }, "application/jwk+json": { source: "iana", compressible: true }, "application/jwk-set+json": { source: "iana", compressible: true }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana" }, "application/kpml-response+xml": { source: "iana" }, "application/ld+json": { source: "iana", compressible: true, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana" }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana" }, "application/lost+xml": { source: "iana", extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana" }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", extensions: ["mads"] }, "application/manifest+json": { charset: "UTF-8", compressible: true, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana" }, "application/mathml-presentation+xml": { source: "iana" }, "application/mbms-associated-procedure-description+xml": { source: "iana" }, "application/mbms-deregister+xml": { source: "iana" }, "application/mbms-envelope+xml": { source: "iana" }, "application/mbms-msk+xml": { source: "iana" }, "application/mbms-msk-response+xml": { source: "iana" }, "application/mbms-protection-description+xml": { source: "iana" }, "application/mbms-reception-report+xml": { source: "iana" }, "application/mbms-register+xml": { source: "iana" }, "application/mbms-register-response+xml": { source: "iana" }, "application/mbms-schedule+xml": { source: "iana" }, "application/mbms-user-service-description+xml": { source: "iana" }, "application/mbox": { source: "iana", extensions: ["mbox"] }, "application/media-policy-dataset+xml": { source: "iana" }, "application/media_control+xml": { source: "iana" }, "application/mediaservercontrol+xml": { source: "iana", extensions: ["mscml"] }, "application/merge-patch+json": { source: "iana", compressible: true }, "application/metalink+xml": { source: "apache", extensions: ["metalink"] }, "application/metalink4+xml": { source: "iana", extensions: ["meta4"] }, "application/mets+xml": { source: "iana", extensions: ["mets"] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mods+xml": { source: "iana", extensions: ["mods"] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: ["m21", "mp21"] }, "application/mp4": { source: "iana", extensions: ["mp4s", "m4p"] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana" }, "application/mrb-publish+xml": { source: "iana" }, "application/msc-ivr+xml": { source: "iana" }, "application/msc-mixer+xml": { source: "iana" }, "application/msword": { source: "iana", compressible: false, extensions: ["doc", "dot"] }, "application/mxf": { source: "iana", extensions: ["mxf"] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana" }, "application/news-groupinfo": { source: "iana" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana" }, "application/nss": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: false, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] }, "application/oda": { source: "iana", extensions: ["oda"] }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", extensions: ["opf"] }, "application/ogg": { source: "iana", compressible: false, extensions: ["ogx"] }, "application/omdoc+xml": { source: "apache", extensions: ["omdoc"] }, "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] }, "application/oxps": { source: "iana", extensions: ["oxps"] }, "application/p2p-overlay+xml": { source: "iana" }, "application/parityfec": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", extensions: ["xer"] }, "application/pdf": { source: "iana", compressible: false, extensions: ["pdf"] }, "application/pdx": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: false, extensions: ["pgp"] }, "application/pgp-keys": { source: "iana" }, "application/pgp-signature": { source: "iana", extensions: ["asc", "sig"] }, "application/pics-rules": { source: "apache", extensions: ["prf"] }, "application/pidf+xml": { source: "iana" }, "application/pidf-diff+xml": { source: "iana" }, "application/pkcs10": { source: "iana", extensions: ["p10"] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] }, "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] }, "application/pkcs8": { source: "iana", extensions: ["p8"] }, "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] }, "application/pkix-cert": { source: "iana", extensions: ["cer"] }, "application/pkix-crl": { source: "iana", extensions: ["crl"] }, "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] }, "application/pkixcmp": { source: "iana", extensions: ["pki"] }, "application/pls+xml": { source: "iana", extensions: ["pls"] }, "application/poc-settings+xml": { source: "iana" }, "application/postscript": { source: "iana", compressible: true, extensions: ["ai", "eps", "ps"] }, "application/ppsp-tracker+json": { source: "iana", compressible: true }, "application/problem+json": { source: "iana", compressible: true }, "application/problem+xml": { source: "iana" }, "application/provenance+xml": { source: "iana" }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: ["cww"] }, "application/prs.hpub+zip": { source: "iana" }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.xsf+xml": { source: "iana" }, "application/pskc+xml": { source: "iana", extensions: ["pskcxml"] }, "application/qsig": { source: "iana" }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: true }, "application/rdf+xml": { source: "iana", compressible: true, extensions: ["rdf"] }, "application/reginfo+xml": { source: "iana", extensions: ["rif"] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] }, "application/remote-printing": { source: "iana" }, "application/reputon+json": { source: "iana", compressible: true }, "application/resource-lists+xml": { source: "iana", extensions: ["rl"] }, "application/resource-lists-diff+xml": { source: "iana", extensions: ["rld"] }, "application/rfc+xml": { source: "iana" }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana" }, "application/rls-services+xml": { source: "iana", extensions: ["rs"] }, "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] }, "application/rpki-manifest": { source: "iana", extensions: ["mft"] }, "application/rpki-roa": { source: "iana", extensions: ["roa"] }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", extensions: ["rsd"] }, "application/rss+xml": { source: "apache", compressible: true, extensions: ["rss"] }, "application/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana" }, "application/samlmetadata+xml": { source: "iana" }, "application/sbml+xml": { source: "iana", extensions: ["sbml"] }, "application/scaip+xml": { source: "iana" }, "application/scim+json": { source: "iana", compressible: true }, "application/scvp-cv-request": { source: "iana", extensions: ["scq"] }, "application/scvp-cv-response": { source: "iana", extensions: ["scs"] }, "application/scvp-vp-request": { source: "iana", extensions: ["spq"] }, "application/scvp-vp-response": { source: "iana", extensions: ["spp"] }, "application/sdp": { source: "iana", extensions: ["sdp"] }, "application/sep+xml": { source: "iana" }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", extensions: ["shf"] }, "application/sieve": { source: "iana" }, "application/simple-filter+xml": { source: "iana" }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "iana" }, "application/smil+xml": { source: "iana", extensions: ["smi", "smil"] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: true }, "application/sparql-query": { source: "iana", extensions: ["rq"] }, "application/sparql-results+xml": { source: "iana", extensions: ["srx"] }, "application/spirits-event+xml": { source: "iana" }, "application/sql": { source: "iana" }, "application/srgs": { source: "iana", extensions: ["gram"] }, "application/srgs+xml": { source: "iana", extensions: ["grxml"] }, "application/sru+xml": { source: "iana", extensions: ["sru"] }, "application/ssdl+xml": { source: "apache", extensions: ["ssdl"] }, "application/ssml+xml": { source: "iana", extensions: ["ssml"] }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: true }, "application/tei+xml": { source: "iana", extensions: ["tei", "teicorpus"] }, "application/thraud+xml": { source: "iana", extensions: ["tfi"] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: ["tsd"] }, "application/ttml+xml": { source: "iana" }, "application/tve-trigger": { source: "iana" }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana" }, "application/urc-ressheet+xml": { source: "iana" }, "application/urc-targetdesc+xml": { source: "iana" }, "application/urc-uisocketdesc+xml": { source: "iana" }, "application/vcard+json": { source: "iana", compressible: true }, "application/vcard+xml": { source: "iana" }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.3gpp-prose+xml": { source: "iana" }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana" }, "application/vnd.3gpp.bsf+xml": { source: "iana" }, "application/vnd.3gpp.mid-call+xml": { source: "iana" }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana" }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana" }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana" }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana" }, "application/vnd.3gpp.ussd+xml": { source: "iana" }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana" }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] }, "application/vnd.acucobol": { source: "iana", extensions: ["acu"] }, "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", extensions: ["air"] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] }, "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", extensions: ["xdp"] }, "application/vnd.adobe.xfdf": { source: "iana", extensions: ["xfdf"] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.ah-barcode": { source: "iana" }, "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] }, "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] }, "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] }, "application/vnd.amundsen.maze+xml": { source: "iana" }, "application/vnd.android.package-archive": { source: "apache", compressible: false, extensions: ["apk"] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] }, "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: true }, "application/vnd.apple.installer+xml": { source: "iana", extensions: ["mpkg"] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] }, "application/vnd.apple.pkpass": { compressible: false, extensions: ["pkpass"] }, "application/vnd.arastra.swi": { source: "iana" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] }, "application/vnd.audiograph": { source: "iana", extensions: ["aep"] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avistar+xml": { source: "iana" }, "application/vnd.balsamiq.bmml+xml": { source: "iana" }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: true }, "application/vnd.biopax.rdf+xml": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: ["bmi"] }, "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", extensions: ["cdxml"] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] }, "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana" }, "application/vnd.claymore": { source: "iana", extensions: ["cla"] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] }, "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: true }, "application/vnd.collection.doc+json": { source: "iana", compressible: true }, "application/vnd.collection.next+json": { source: "iana", compressible: true }, "application/vnd.comicbook+zip": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: ["csp"] }, "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: true }, "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] }, "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", extensions: ["wbs"] }, "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] }, "application/vnd.ctct.ws+xml": { source: "iana" }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: ["car"] }, "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { source: "iana" }, "application/vnd.cybank": { source: "iana" }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana" }, "application/vnd.dart": { source: "iana", compressible: true, extensions: ["dart"] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] }, "application/vnd.dece.ttml+xml": { source: "iana", extensions: ["uvt", "uvvt"] }, "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] }, "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] }, "application/vnd.desmume-movie": { source: "iana" }, "application/vnd.desmume.movie": { source: "apache" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana" }, "application/vnd.dna": { source: "iana", extensions: ["dna"] }, "application/vnd.document+json": { source: "iana", compressible: true }, "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] }, "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] }, "application/vnd.drive+json": { source: "iana", compressible: true }, "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana" }, "application/vnd.dvb.notif-container+xml": { source: "iana" }, "application/vnd.dvb.notif-generic+xml": { source: "iana" }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana" }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana" }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana" }, "application/vnd.dvb.notif-init+xml": { source: "iana" }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: ["geo"] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.emclient.accessrequest+xml": { source: "iana" }, "application/vnd.enliven": { source: "iana", extensions: ["nml"] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana" }, "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] }, "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] }, "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] }, "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] }, "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana" }, "application/vnd.eszigno3+xml": { source: "iana", extensions: ["es3", "et3"] }, "application/vnd.etsi.aoc+xml": { source: "iana" }, "application/vnd.etsi.asic-e+zip": { source: "iana" }, "application/vnd.etsi.asic-s+zip": { source: "iana" }, "application/vnd.etsi.cug+xml": { source: "iana" }, "application/vnd.etsi.iptvcommand+xml": { source: "iana" }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana" }, "application/vnd.etsi.iptvprofile+xml": { source: "iana" }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana" }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana" }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana" }, "application/vnd.etsi.iptvservice+xml": { source: "iana" }, "application/vnd.etsi.iptvsync+xml": { source: "iana" }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana" }, "application/vnd.etsi.mcid+xml": { source: "iana" }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana" }, "application/vnd.etsi.pstn+xml": { source: "iana" }, "application/vnd.etsi.sci+xml": { source: "iana" }, "application/vnd.etsi.simservs+xml": { source: "iana" }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana" }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] }, "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "iana", extensions: ["fdf"] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] }, "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: ["gph"] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] }, "application/vnd.frogans.fnc": { source: "iana", extensions: ["fnc"] }, "application/vnd.frogans.ltf": { source: "iana", extensions: ["ltf"] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] }, "application/vnd.geo+json": { source: "iana", compressible: true }, "application/vnd.geocube+xml": { source: "iana" }, "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] }, "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] }, "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] }, "application/vnd.geonext": { source: "iana", extensions: ["gxt"] }, "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] }, "application/vnd.geospace": { source: "iana", extensions: ["g3w"] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: ["gmx"] }, "application/vnd.google-apps.document": { compressible: false, extensions: ["gdoc"] }, "application/vnd.google-apps.presentation": { compressible: false, extensions: ["gslides"] }, "application/vnd.google-apps.spreadsheet": { compressible: false, extensions: ["gsheet"] }, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: true, extensions: ["kml"] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: false, extensions: ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { source: "iana" }, "application/vnd.gov.sk.e-form+zip": { source: "iana" }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana" }, "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: ["gac"] }, "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] }, "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] }, "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] }, "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] }, "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] }, "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] }, "application/vnd.hal+json": { source: "iana", compressible: true }, "application/vnd.hal+xml": { source: "iana", extensions: ["hal"] }, "application/vnd.handheld-entertainment+xml": { source: "iana", extensions: ["zmm"] }, "application/vnd.hbci": { source: "iana", extensions: ["hbci"] }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: true }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] }, "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] }, "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] }, "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] }, "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] }, "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] }, "application/vnd.hyperdrive+json": { source: "iana", compressible: true }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "iana" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] }, "application/vnd.ibm.modcap": { source: "iana", extensions: ["afp", "listafp", "list3820"] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] }, "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: ["igl"] }, "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] }, "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: true }, "application/vnd.informedcontrol.rms+xml": { source: "iana" }, "application/vnd.informix-visionary": { source: "iana" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana" }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] }, "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] }, "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] }, "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana" }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana" }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana" }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana" }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana" }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana" }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana" }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] }, "application/vnd.irepository.package+xml": { source: "iana", extensions: ["irp"] }, "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] }, "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] }, "application/vnd.jam": { source: "iana", extensions: ["jam"] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] }, "application/vnd.jisp": { source: "iana", extensions: ["jisp"] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] }, "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] }, "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] }, "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] }, "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] }, "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] }, "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] }, "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] }, "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] }, "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] }, "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] }, "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] }, "application/vnd.las.las+xml": { source: "iana", extensions: ["lasxml"] }, "application/vnd.liberty-request+xml": { source: "iana" }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", extensions: ["lbe"] }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] }, "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] }, "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] }, "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] }, "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] }, "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] }, "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] }, "application/vnd.mapbox-vector-tile": { source: "iana" }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana" }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana" }, "application/vnd.marlin.drm.license+xml": { source: "iana" }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: true }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: ["mcd"] }, "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: ["mwf"] }, "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] }, "application/vnd.micro+json": { source: "iana", compressible: true }, "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] }, "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: true }, "application/vnd.mif": { source: "iana", extensions: ["mif"] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] }, "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] }, "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] }, "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] }, "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] }, "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] }, "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] }, "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] }, "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: true, extensions: ["xul"] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: false, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] }, "application/vnd.ms-fontobject": { source: "iana", compressible: true, extensions: ["eot"] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] }, "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] }, "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] }, "application/vnd.ms-office.activex+xml": { source: "iana" }, "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] }, "application/vnd.ms-opentype": { source: "apache", compressible: true }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] }, "application/vnd.ms-playready.initiator+xml": { source: "iana" }, "application/vnd.ms-powerpoint": { source: "iana", compressible: false, extensions: ["ppt", "pps", "pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana" }, "application/vnd.ms-printing.printticket+xml": { source: "apache" }, "application/vnd.ms-printschematicket+xml": { source: "iana" }, "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] }, "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] }, "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: false, extensions: ["xps"] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: ["mseq"] }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: ["mus"] }, "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] }, "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: true }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] }, "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] }, "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana" }, "application/vnd.nokia.iptv.config+xml": { source: "iana" }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana" }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana" }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana" }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: ["n-gage"] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana" }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] }, "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] }, "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] }, "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] }, "application/vnd.oasis.opendocument.database": { source: "iana", extensions: ["odb"] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: false, extensions: ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: false, extensions: ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: false, extensions: ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: false, extensions: ["odt"] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] }, "application/vnd.obn": { source: "iana" }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: true }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana" }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana" }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana" }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana" }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana" }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana" }, "application/vnd.oipf.spdlist+xml": { source: "iana" }, "application/vnd.oipf.ueprofile+xml": { source: "iana" }, "application/vnd.oipf.userprofile+xml": { source: "iana" }, "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana" }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana" }, "application/vnd.oma.bcast.imd+xml": { source: "iana" }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana" }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana" }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana" }, "application/vnd.oma.bcast.sprov+xml": { source: "iana" }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana" }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana" }, "application/vnd.oma.cab-pcc+xml": { source: "iana" }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana" }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana" }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", extensions: ["dd2"] }, "application/vnd.oma.drm.risd+xml": { source: "iana" }, "application/vnd.oma.group-usage-list+xml": { source: "iana" }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: true }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana" }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana" }, "application/vnd.oma.poc.final-report+xml": { source: "iana" }, "application/vnd.oma.poc.groups+xml": { source: "iana" }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana" }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana" }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana" }, "application/vnd.oma.xcap-directory+xml": { source: "iana" }, "application/vnd.omads-email+xml": { source: "iana" }, "application/vnd.omads-file+xml": { source: "iana" }, "application/vnd.omads-folder+xml": { source: "iana" }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana" }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] }, "application/vnd.openstreetmap.data+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml-template": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: false, extensions: ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "apache", extensions: ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: false, extensions: ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "apache", extensions: ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: false, extensions: ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "apache", extensions: ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana" }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana" }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana" }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana" }, "application/vnd.oracle.resource+json": { source: "iana", compressible: true }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] }, "application/vnd.otps.ct-kip+xml": { source: "iana" }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: true }, "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos+xml": { source: "iana" }, "application/vnd.paos.xml": { source: "apache" }, "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: ["str"] }, "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: ["efif"] }, "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] }, "application/vnd.poc.group-advertisement+xml": { source: "iana" }, "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] }, "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] }, "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana" }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana" }, "application/vnd.radisys.msml+xml": { source: "iana" }, "application/vnd.radisys.msml-audit+xml": { source: "iana" }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana" }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana" }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana" }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana" }, "application/vnd.radisys.msml-conf+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana" }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana" }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana" }, "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] }, "application/vnd.recordare.musicxml+xml": { source: "iana", extensions: ["musicxml"] }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] }, "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] }, "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] }, "application/vnd.route66.link66+xml": { source: "iana", extensions: ["link66"] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: ["see"] }, "application/vnd.sema": { source: "iana", extensions: ["sema"] }, "application/vnd.semd": { source: "iana", extensions: ["semd"] }, "application/vnd.semf": { source: "iana", extensions: ["semf"] }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] }, "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] }, "application/vnd.siren+json": { source: "iana", compressible: true }, "application/vnd.smaf": { source: "iana", extensions: ["mmf"] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] }, "application/vnd.software602.filler.form+xml": { source: "iana" }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", extensions: ["sdkm", "sdkd"] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] }, "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] }, "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] }, "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] }, "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] }, "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana" }, "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] }, "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] }, "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] }, "application/vnd.svd": { source: "iana", extensions: ["svd"] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] }, "application/vnd.syncml+xml": { source: "iana", extensions: ["xsm"] }, "application/vnd.syncml.dm+wbxml": { source: "iana", extensions: ["bdm"] }, "application/vnd.syncml.dm+xml": { source: "iana", extensions: ["xdm"] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana" }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana" }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana" }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] }, "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] }, "application/vnd.trueapp": { source: "iana", extensions: ["tra"] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] }, "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] }, "application/vnd.umajin": { source: "iana", extensions: ["umj"] }, "application/vnd.unity": { source: "iana", extensions: ["unityweb"] }, "application/vnd.uoml+xml": { source: "iana", extensions: ["uoml"] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: ["vcx"] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: true }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw"] }, "application/vnd.visionary": { source: "iana", extensions: ["vis"] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: ["vsf"] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", extensions: ["wbxml"] }, "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] }, "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] }, "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] }, "application/vnd.wqd": { source: "iana", extensions: ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana" }, "application/vnd.wv.ssp+xml": { source: "iana" }, "application/vnd.xacml+json": { source: "iana", compressible: true }, "application/vnd.xara": { source: "iana", extensions: ["xar"] }, "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana" }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", extensions: ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] }, "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] }, "application/vnd.zzazz.deck+xml": { source: "iana", extensions: ["zaz"] }, "application/voicexml+xml": { source: "iana", extensions: ["vxml"] }, "application/vq-rtcpxr": { source: "iana" }, "application/watcherinfo+xml": { source: "iana" }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: ["wgt"] }, "application/winhlp": { source: "apache", extensions: ["hlp"] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", extensions: ["wsdl"] }, "application/wspolicy+xml": { source: "iana", extensions: ["wspolicy"] }, "application/x-7z-compressed": { source: "apache", compressible: false, extensions: ["7z"] }, "application/x-abiword": { source: "apache", extensions: ["abw"] }, "application/x-ace-compressed": { source: "apache", extensions: ["ace"] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] }, "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] }, "application/x-authorware-map": { source: "apache", extensions: ["aam"] }, "application/x-authorware-seg": { source: "apache", extensions: ["aas"] }, "application/x-bcpio": { source: "apache", extensions: ["bcpio"] }, "application/x-bdoc": { compressible: false, extensions: ["bdoc"] }, "application/x-bittorrent": { source: "apache", extensions: ["torrent"] }, "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] }, "application/x-bzip": { source: "apache", compressible: false, extensions: ["bz"] }, "application/x-bzip2": { source: "apache", compressible: false, extensions: ["bz2", "boz"] }, "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] }, "application/x-cdlink": { source: "apache", extensions: ["vcd"] }, "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] }, "application/x-chat": { source: "apache", extensions: ["chat"] }, "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] }, "application/x-chrome-extension": { extensions: ["crx"] }, "application/x-cocoa": { source: "nginx", extensions: ["cco"] }, "application/x-compress": { source: "apache" }, "application/x-conference": { source: "apache", extensions: ["nsc"] }, "application/x-cpio": { source: "apache", extensions: ["cpio"] }, "application/x-csh": { source: "apache", extensions: ["csh"] }, "application/x-deb": { compressible: false }, "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] }, "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] }, "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] }, "application/x-doom": { source: "apache", extensions: ["wad"] }, "application/x-dtbncx+xml": { source: "apache", extensions: ["ncx"] }, "application/x-dtbook+xml": { source: "apache", extensions: ["dtb"] }, "application/x-dtbresource+xml": { source: "apache", extensions: ["res"] }, "application/x-dvi": { source: "apache", compressible: false, extensions: ["dvi"] }, "application/x-envoy": { source: "apache", extensions: ["evy"] }, "application/x-eva": { source: "apache", extensions: ["eva"] }, "application/x-font-bdf": { source: "apache", extensions: ["bdf"] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] }, "application/x-font-otf": { source: "apache", compressible: true, extensions: ["otf"] }, "application/x-font-pcf": { source: "apache", extensions: ["pcf"] }, "application/x-font-snf": { source: "apache", extensions: ["snf"] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-ttf": { source: "apache", compressible: true, extensions: ["ttf", "ttc"] }, "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: ["arc"] }, "application/x-futuresplash": { source: "apache", extensions: ["spl"] }, "application/x-gca-compressed": { source: "apache", extensions: ["gca"] }, "application/x-glulx": { source: "apache", extensions: ["ulx"] }, "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] }, "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] }, "application/x-gtar": { source: "apache", extensions: ["gtar"] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: ["hdf"] }, "application/x-httpd-php": { compressible: true, extensions: ["php"] }, "application/x-install-instructions": { source: "apache", extensions: ["install"] }, "application/x-iso9660-image": { source: "apache", extensions: ["iso"] }, "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] }, "application/x-java-jnlp-file": { source: "apache", compressible: false, extensions: ["jnlp"] }, "application/x-javascript": { compressible: true }, "application/x-latex": { source: "apache", compressible: false, extensions: ["latex"] }, "application/x-lua-bytecode": { extensions: ["luac"] }, "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] }, "application/x-makeself": { source: "nginx", extensions: ["run"] }, "application/x-mie": { source: "apache", extensions: ["mie"] }, "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] }, "application/x-mpegurl": { compressible: false }, "application/x-ms-application": { source: "apache", extensions: ["application"] }, "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] }, "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] }, "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] }, "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] }, "application/x-msaccess": { source: "apache", extensions: ["mdb"] }, "application/x-msbinder": { source: "apache", extensions: ["obd"] }, "application/x-mscardfile": { source: "apache", extensions: ["crd"] }, "application/x-msclip": { source: "apache", extensions: ["clp"] }, "application/x-msdos-program": { extensions: ["exe"] }, "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] }, "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] }, "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] }, "application/x-msmoney": { source: "apache", extensions: ["mny"] }, "application/x-mspublisher": { source: "apache", extensions: ["pub"] }, "application/x-msschedule": { source: "apache", extensions: ["scd"] }, "application/x-msterminal": { source: "apache", extensions: ["trm"] }, "application/x-mswrite": { source: "apache", extensions: ["wri"] }, "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] }, "application/x-ns-proxy-autoconfig": { compressible: true, extensions: ["pac"] }, "application/x-nzb": { source: "apache", extensions: ["nzb"] }, "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] }, "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] }, "application/x-pkcs12": { source: "apache", compressible: false, extensions: ["p12", "pfx"] }, "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] }, "application/x-rar-compressed": { source: "apache", compressible: false, extensions: ["rar"] }, "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] }, "application/x-research-info-systems": { source: "apache", extensions: ["ris"] }, "application/x-sea": { source: "nginx", extensions: ["sea"] }, "application/x-sh": { source: "apache", compressible: true, extensions: ["sh"] }, "application/x-shar": { source: "apache", extensions: ["shar"] }, "application/x-shockwave-flash": { source: "apache", compressible: false, extensions: ["swf"] }, "application/x-silverlight-app": { source: "apache", extensions: ["xap"] }, "application/x-sql": { source: "apache", extensions: ["sql"] }, "application/x-stuffit": { source: "apache", compressible: false, extensions: ["sit"] }, "application/x-stuffitx": { source: "apache", extensions: ["sitx"] }, "application/x-subrip": { source: "apache", extensions: ["srt"] }, "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] }, "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] }, "application/x-t3vm-image": { source: "apache", extensions: ["t3"] }, "application/x-tads": { source: "apache", extensions: ["gam"] }, "application/x-tar": { source: "apache", compressible: true, extensions: ["tar"] }, "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] }, "application/x-tex": { source: "apache", extensions: ["tex"] }, "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] }, "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] }, "application/x-tgif": { source: "apache", extensions: ["obj"] }, "application/x-ustar": { source: "apache", extensions: ["ustar"] }, "application/x-wais-source": { source: "apache", extensions: ["src"] }, "application/x-web-app-manifest+json": { compressible: true, extensions: ["webapp"] }, "application/x-www-form-urlencoded": { source: "iana", compressible: true }, "application/x-x509-ca-cert": { source: "apache", extensions: ["der", "crt", "pem"] }, "application/x-xfig": { source: "apache", extensions: ["fig"] }, "application/x-xliff+xml": { source: "apache", extensions: ["xlf"] }, "application/x-xpinstall": { source: "apache", compressible: false, extensions: ["xpi"] }, "application/x-xz": { source: "apache", extensions: ["xz"] }, "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana" }, "application/xaml+xml": { source: "apache", extensions: ["xaml"] }, "application/xcap-att+xml": { source: "iana" }, "application/xcap-caps+xml": { source: "iana" }, "application/xcap-diff+xml": { source: "iana", extensions: ["xdf"] }, "application/xcap-el+xml": { source: "iana" }, "application/xcap-error+xml": { source: "iana" }, "application/xcap-ns+xml": { source: "iana" }, "application/xcon-conference-info+xml": { source: "iana" }, "application/xcon-conference-info-diff+xml": { source: "iana" }, "application/xenc+xml": { source: "iana", extensions: ["xenc"] }, "application/xhtml+xml": { source: "iana", compressible: true, extensions: ["xhtml", "xht"] }, "application/xhtml-voice+xml": { source: "apache" }, "application/xml": { source: "iana", compressible: true, extensions: ["xml", "xsl", "xsd", "rng"] }, "application/xml-dtd": { source: "iana", compressible: true, extensions: ["dtd"] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana" }, "application/xmpp+xml": { source: "iana" }, "application/xop+xml": { source: "iana", compressible: true, extensions: ["xop"] }, "application/xproc+xml": { source: "apache", extensions: ["xpl"] }, "application/xslt+xml": { source: "iana", extensions: ["xslt"] }, "application/xspf+xml": { source: "apache", extensions: ["xspf"] }, "application/xv+xml": { source: "iana", extensions: ["mxml", "xhvml", "xvml", "xvm"] }, "application/yang": { source: "iana", extensions: ["yang"] }, "application/yang-data+json": { source: "iana", compressible: true }, "application/yang-data+xml": { source: "iana" }, "application/yin+xml": { source: "iana", extensions: ["yin"] }, "application/zip": { source: "iana", compressible: false, extensions: ["zip"] }, "application/zlib": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: false, extensions: ["3gpp"] }, "audio/3gpp2": { source: "iana" }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: ["adp"] }, "audio/amr": { source: "iana" }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: false, extensions: ["au", "snd"] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: false }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] }, "audio/mobile-xmf": { source: "iana" }, "audio/mp3": { compressible: false, extensions: ["mp3"] }, "audio/mp4": { source: "iana", compressible: false, extensions: ["m4a", "mp4a"] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: false, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: false, extensions: ["oga", "ogg", "spx"] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: ["s3m"] }, "audio/silk": { source: "apache", extensions: ["sil"] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] }, "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: ["dra"] }, "audio/vnd.dts": { source: "iana", extensions: ["dts"] }, "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.qcelp": { source: "iana" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: ["rip"] }, "audio/vnd.rn-realaudio": { compressible: false }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: false }, "audio/vorbis": { source: "iana", compressible: false }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: false, extensions: ["wav"] }, "audio/wave": { compressible: false, extensions: ["wav"] }, "audio/webm": { source: "apache", compressible: false, extensions: ["weba"] }, "audio/x-aac": { source: "apache", compressible: false, extensions: ["aac"] }, "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] }, "audio/x-caf": { source: "apache", compressible: false, extensions: ["caf"] }, "audio/x-flac": { source: "apache", extensions: ["flac"] }, "audio/x-m4a": { source: "nginx", extensions: ["m4a"] }, "audio/x-matroska": { source: "apache", extensions: ["mka"] }, "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] }, "audio/x-ms-wax": { source: "apache", extensions: ["wax"] }, "audio/x-ms-wma": { source: "apache", extensions: ["wma"] }, "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] }, "audio/x-realaudio": { source: "nginx", extensions: ["ra"] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: ["wav"] }, "audio/xm": { source: "apache", extensions: ["xm"] }, "chemical/x-cdx": { source: "apache", extensions: ["cdx"] }, "chemical/x-cif": { source: "apache", extensions: ["cif"] }, "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] }, "chemical/x-cml": { source: "apache", extensions: ["cml"] }, "chemical/x-csml": { source: "apache", extensions: ["csml"] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: ["xyz"] }, "font/opentype": { compressible: true, extensions: ["otf"] }, "image/bmp": { source: "iana", compressible: true, extensions: ["bmp"] }, "image/cgm": { source: "iana", extensions: ["cgm"] }, "image/dicom-rle": { source: "iana" }, "image/emf": { source: "iana" }, "image/fits": { source: "iana" }, "image/g3fax": { source: "iana", extensions: ["g3"] }, "image/gif": { source: "iana", compressible: false, extensions: ["gif"] }, "image/ief": { source: "iana", extensions: ["ief"] }, "image/jls": { source: "iana" }, "image/jp2": { source: "iana" }, "image/jpeg": { source: "iana", compressible: false, extensions: ["jpeg", "jpg", "jpe"] }, "image/jpm": { source: "iana" }, "image/jpx": { source: "iana" }, "image/ktx": { source: "iana", extensions: ["ktx"] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: false }, "image/png": { source: "iana", compressible: false, extensions: ["png"] }, "image/prs.btif": { source: "iana", extensions: ["btif"] }, "image/prs.pti": { source: "iana" }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: ["sgi"] }, "image/svg+xml": { source: "iana", compressible: true, extensions: ["svg", "svgz"] }, "image/t38": { source: "iana" }, "image/tiff": { source: "iana", compressible: false, extensions: ["tiff", "tif"] }, "image/tiff-fx": { source: "iana" }, "image/vnd.adobe.photoshop": { source: "iana", compressible: true, extensions: ["psd"] }, "image/vnd.airzip.accelerator.azv": { source: "iana" }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] }, "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "image/vnd.dwg": { source: "iana", extensions: ["dwg"] }, "image/vnd.dxf": { source: "iana", extensions: ["dxf"] }, "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] }, "image/vnd.fpx": { source: "iana", extensions: ["fpx"] }, "image/vnd.fst": { source: "iana", extensions: ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana" }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] }, "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] }, "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana" }, "image/vnd.valve.source.texture": { source: "iana" }, "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] }, "image/vnd.xiff": { source: "iana", extensions: ["xif"] }, "image/vnd.zbrush.pcx": { source: "iana" }, "image/webp": { source: "apache", extensions: ["webp"] }, "image/wmf": { source: "iana" }, "image/x-3ds": { source: "apache", extensions: ["3ds"] }, "image/x-cmu-raster": { source: "apache", extensions: ["ras"] }, "image/x-cmx": { source: "apache", extensions: ["cmx"] }, "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] }, "image/x-icon": { source: "apache", compressible: true, extensions: ["ico"] }, "image/x-jng": { source: "nginx", extensions: ["jng"] }, "image/x-mrsid-image": { source: "apache", extensions: ["sid"] }, "image/x-ms-bmp": { source: "nginx", compressible: true, extensions: ["bmp"] }, "image/x-pcx": { source: "apache", extensions: ["pcx"] }, "image/x-pict": { source: "apache", extensions: ["pic", "pct"] }, "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] }, "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] }, "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] }, "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] }, "image/x-rgb": { source: "apache", extensions: ["rgb"] }, "image/x-tga": { source: "apache", extensions: ["tga"] }, "image/x-xbitmap": { source: "apache", extensions: ["xbm"] }, "image/x-xcf": { compressible: false }, "image/x-xpixmap": { source: "apache", extensions: ["xpm"] }, "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana" }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana" }, "message/global-delivery-status": { source: "iana" }, "message/global-disposition-notification": { source: "iana" }, "message/global-headers": { source: "iana" }, "message/http": { source: "iana", compressible: false }, "message/imdn+xml": { source: "iana", compressible: true }, "message/news": { source: "iana" }, "message/partial": { source: "iana", compressible: false }, "message/rfc822": { source: "iana", compressible: true, extensions: ["eml", "mime"] }, "message/s-http": { source: "iana" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "iana" }, "message/vnd.wfa.wsc": { source: "iana" }, "model/gltf+json": { source: "iana", compressible: true }, "model/iges": { source: "iana", compressible: false, extensions: ["igs", "iges"] }, "model/mesh": { source: "iana", compressible: false, extensions: ["msh", "mesh", "silo"] }, "model/vnd.collada+xml": { source: "iana", extensions: ["dae"] }, "model/vnd.dwf": { source: "iana", extensions: ["dwf"] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: ["gdl"] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: ["gtw"] }, "model/vnd.moml+xml": { source: "iana" }, "model/vnd.mts": { source: "iana", extensions: ["mts"] }, "model/vnd.opengex": { source: "iana" }, "model/vnd.parasolid.transmit.binary": { source: "iana" }, "model/vnd.parasolid.transmit.text": { source: "iana" }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.valve.source.compiled-map": { source: "iana" }, "model/vnd.vtu": { source: "iana", extensions: ["vtu"] }, "model/vrml": { source: "iana", compressible: false, extensions: ["wrl", "vrml"] }, "model/x3d+binary": { source: "apache", compressible: false, extensions: ["x3db", "x3dbz"] }, "model/x3d+fastinfoset": { source: "iana" }, "model/x3d+vrml": { source: "apache", compressible: false, extensions: ["x3dv", "x3dvz"] }, "model/x3d+xml": { source: "iana", compressible: true, extensions: ["x3d", "x3dz"] }, "model/x3d-vrml": { source: "iana" }, "multipart/alternative": { source: "iana", compressible: false }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: false }, "multipart/form-data": { source: "iana", compressible: false }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana", compressible: false }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: false }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: false }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: true, extensions: ["appcache", "manifest"] }, "text/calendar": { source: "iana", extensions: ["ics", "ifb"] }, "text/calender": { compressible: true }, "text/cmd": { compressible: true }, "text/coffeescript": { extensions: ["coffee", "litcoffee"] }, "text/css": { source: "iana", compressible: true, extensions: ["css"] }, "text/csv": { source: "iana", compressible: true, extensions: ["csv"] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "iana" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/hjson": { extensions: ["hjson"] }, "text/html": { source: "iana", compressible: true, extensions: ["html", "htm", "shtml"] }, "text/jade": { extensions: ["jade"] }, "text/javascript": { source: "iana", compressible: true }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: true, extensions: ["jsx"] }, "text/less": { extensions: ["less"] }, "text/markdown": { source: "iana" }, "text/mathml": { source: "nginx", extensions: ["mml"] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", compressible: true, extensions: ["n3"] }, "text/parameters": { source: "iana" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: true, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] }, "text/provenance-notation": { source: "iana" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] }, "text/prs.prop.logic": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: true, extensions: ["rtx"] }, "text/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] }, "text/slim": { extensions: ["slim", "slm"] }, "text/stylus": { extensions: ["stylus", "styl"] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: true, extensions: ["tsv"] }, "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] }, "text/turtle": { source: "iana", extensions: ["ttl"] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: true, extensions: ["uri", "uris", "urls"] }, "text/vcard": { source: "iana", compressible: true, extensions: ["vcard"] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: ["curl"] }, "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] }, "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] }, "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] }, "text/vnd.debian.copyright": { source: "iana" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "text/vnd.esmertec.theme-descriptor": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: ["fly"] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] }, "text/vnd.graphviz": { source: "iana", extensions: ["gv"] }, "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] }, "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", extensions: ["jad"] }, "text/vnd.trolltech.linguist": { source: "iana" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] }, "text/vtt": { charset: "UTF-8", compressible: true, extensions: ["vtt"] }, "text/x-asm": { source: "apache", extensions: ["s", "asm"] }, "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] }, "text/x-component": { source: "nginx", extensions: ["htc"] }, "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] }, "text/x-gwt-rpc": { compressible: true }, "text/x-handlebars-template": { extensions: ["hbs"] }, "text/x-java-source": { source: "apache", extensions: ["java"] }, "text/x-jquery-tmpl": { compressible: true }, "text/x-lua": { extensions: ["lua"] }, "text/x-markdown": { compressible: true, extensions: ["markdown", "md", "mkd"] }, "text/x-nfo": { source: "apache", extensions: ["nfo"] }, "text/x-opml": { source: "apache", extensions: ["opml"] }, "text/x-pascal": { source: "apache", extensions: ["p", "pas"] }, "text/x-processing": { compressible: true, extensions: ["pde"] }, "text/x-sass": { extensions: ["sass"] }, "text/x-scss": { extensions: ["scss"] }, "text/x-setext": { source: "apache", extensions: ["etx"] }, "text/x-sfv": { source: "apache", extensions: ["sfv"] }, "text/x-suse-ymp": { compressible: true, extensions: ["ymp"] }, "text/x-uuencode": { source: "apache", extensions: ["uu"] }, "text/x-vcalendar": { source: "apache", extensions: ["vcs"] }, "text/x-vcard": { source: "apache", extensions: ["vcf"] }, "text/xml": { source: "iana", compressible: true, extensions: ["xml"] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { extensions: ["yaml", "yml"] }, "video/1d-interleaved-parityfec": { source: "apache" }, "video/3gpp": { source: "apache", extensions: ["3gp", "3gpp"] }, "video/3gpp-tt": { source: "apache" }, "video/3gpp2": { source: "apache", extensions: ["3g2"] }, "video/bmpeg": { source: "apache" }, "video/bt656": { source: "apache" }, "video/celb": { source: "apache" }, "video/dv": { source: "apache" }, "video/encaprtp": { source: "apache" }, "video/h261": { source: "apache", extensions: ["h261"] }, "video/h263": { source: "apache", extensions: ["h263"] }, "video/h263-1998": { source: "apache" }, "video/h263-2000": { source: "apache" }, "video/h264": { source: "apache", extensions: ["h264"] }, "video/h264-rcdo": { source: "apache" }, "video/h264-svc": { source: "apache" }, "video/h265": { source: "apache" }, "video/iso.segment": { source: "apache" }, "video/jpeg": { source: "apache", extensions: ["jpgv"] }, "video/jpeg2000": { source: "apache" }, "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] }, "video/mj2": { source: "apache", extensions: ["mj2", "mjp2"] }, "video/mp1s": { source: "apache" }, "video/mp2p": { source: "apache" }, "video/mp2t": { source: "apache", extensions: ["ts"] }, "video/mp4": { source: "apache", compressible: false, extensions: ["mp4", "mp4v", "mpg4"] }, "video/mp4v-es": { source: "apache" }, "video/mpeg": { source: "apache", compressible: false, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] }, "video/mpeg4-generic": { source: "apache" }, "video/mpv": { source: "apache" }, "video/nv": { source: "apache" }, "video/ogg": { source: "apache", compressible: false, extensions: ["ogv"] }, "video/parityfec": { source: "apache" }, "video/pointer": { source: "apache" }, "video/quicktime": { source: "apache", compressible: false, extensions: ["qt", "mov"] }, "video/raptorfec": { source: "apache" }, "video/raw": { source: "apache" }, "video/rtp-enc-aescm128": { source: "apache" }, "video/rtploopback": { source: "apache" }, "video/rtx": { source: "apache" }, "video/smpte292m": { source: "apache" }, "video/ulpfec": { source: "apache" }, "video/vc1": { source: "apache" }, "video/vnd.cctv": { source: "apache" }, "video/vnd.dece.hd": { source: "apache", extensions: ["uvh", "uvvh"] }, "video/vnd.dece.mobile": { source: "apache", extensions: ["uvm", "uvvm"] }, "video/vnd.dece.mp4": { source: "apache" }, "video/vnd.dece.pd": { source: "apache", extensions: ["uvp", "uvvp"] }, "video/vnd.dece.sd": { source: "apache", extensions: ["uvs", "uvvs"] }, "video/vnd.dece.video": { source: "apache", extensions: ["uvv", "uvvv"] }, "video/vnd.directv.mpeg": { source: "apache" }, "video/vnd.directv.mpeg-tts": { source: "apache" }, "video/vnd.dlna.mpeg-tts": { source: "apache" }, "video/vnd.dvb.file": { source: "apache", extensions: ["dvb"] }, "video/vnd.fvt": { source: "apache", extensions: ["fvt"] }, "video/vnd.hns.video": { source: "apache" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "apache" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "apache" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "apache" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "apache" }, "video/vnd.iptvforum.ttsavc": { source: "apache" }, "video/vnd.iptvforum.ttsmpeg2": { source: "apache" }, "video/vnd.motorola.video": { source: "apache" }, "video/vnd.motorola.videop": { source: "apache" }, "video/vnd.mpegurl": { source: "apache", extensions: ["mxu", "m4u"] }, "video/vnd.ms-playready.media.pyv": { source: "apache", extensions: ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { source: "apache" }, "video/vnd.nokia.videovoip": { source: "apache" }, "video/vnd.objectvideo": { source: "apache" }, "video/vnd.radgamettools.bink": { source: "apache" }, "video/vnd.radgamettools.smacker": { source: "apache" }, "video/vnd.sealed.mpeg1": { source: "apache" }, "video/vnd.sealed.mpeg4": { source: "apache" }, "video/vnd.sealed.swf": { source: "apache" }, "video/vnd.sealedmedia.softseal.mov": { source: "apache" }, "video/vnd.uvvu.mp4": { source: "apache", extensions: ["uvu", "uvvu"] }, "video/vnd.vivo": { source: "apache", extensions: ["viv"] }, "video/vp8": { source: "apache" }, "video/webm": { source: "apache", compressible: false, extensions: ["webm"] }, "video/x-f4v": { source: "apache", extensions: ["f4v"] }, "video/x-fli": { source: "apache", extensions: ["fli"] }, "video/x-flv": { source: "apache", compressible: false, extensions: ["flv"] }, "video/x-m4v": { source: "apache", extensions: ["m4v"] }, "video/x-matroska": { source: "apache", compressible: false, extensions: ["mkv", "mk3d", "mks"] }, "video/x-mng": { source: "apache", extensions: ["mng"] }, "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] }, "video/x-ms-vob": { source: "apache", extensions: ["vob"] }, "video/x-ms-wm": { source: "apache", extensions: ["wm"] }, "video/x-ms-wmv": { source: "apache", compressible: false, extensions: ["wmv"] }, "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] }, "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] }, "video/x-msvideo": { source: "apache", extensions: ["avi"] }, "video/x-sgi-movie": { source: "apache", extensions: ["movie"] }, "video/x-smv": { source: "apache", extensions: ["smv"] }, "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] }, "x-shader/x-fragment": { compressible: true }, "x-shader/x-vertex": { compressible: true } }; } }); // node_modules/mime-db/index.js var require_mime_db = __commonJS({ "node_modules/mime-db/index.js"(exports, module2) { module2.exports = require_db(); } }); // node_modules/mime-types/index.js var require_mime_types = __commonJS({ "node_modules/mime-types/index.js"(exports) { "use strict"; var db = require_mime_db(); var extname = require("path").extname; var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/; var textTypeRegExp = /^text\//i; exports.charset = charset; exports.charsets = { lookup: charset }; exports.contentType = contentType; exports.extension = extension; exports.extensions = /* @__PURE__ */ Object.create(null); exports.lookup = lookup2; exports.types = /* @__PURE__ */ Object.create(null); populateMaps(exports.extensions, exports.types); function charset(type) { if (!type || typeof type !== "string") { return false; } var match = extractTypeRegExp.exec(type); var mime3 = match && db[match[1].toLowerCase()]; if (mime3 && mime3.charset) { return mime3.charset; } if (match && textTypeRegExp.test(match[1])) { return "UTF-8"; } return false; } function contentType(str) { if (!str || typeof str !== "string") { return false; } var mime3 = str.indexOf("/") === -1 ? exports.lookup(str) : str; if (!mime3) { return false; } if (mime3.indexOf("charset") === -1) { var charset2 = exports.charset(mime3); if (charset2) mime3 += "; charset=" + charset2.toLowerCase(); } return mime3; } function extension(type) { if (!type || typeof type !== "string") { return false; } var match = extractTypeRegExp.exec(type); var exts = match && exports.extensions[match[1].toLowerCase()]; if (!exts || !exts.length) { return false; } return exts[0]; } function lookup2(path) { if (!path || typeof path !== "string") { return false; } var extension2 = extname("x." + path).toLowerCase().substr(1); if (!extension2) { return false; } return exports.types[extension2] || false; } function populateMaps(extensions2, types) { var preference = ["nginx", "apache", void 0, "iana"]; Object.keys(db).forEach(function forEachMimeType(type) { var mime3 = db[type]; var exts = mime3.extensions; if (!exts || !exts.length) { return; } extensions2[type] = exts; for (var i = 0; i < exts.length; i++) { var extension2 = exts[i]; if (types[extension2]) { var from = preference.indexOf(db[types[extension2]].source); var to = preference.indexOf(mime3.source); if (types[extension2] !== "application/octet-stream" && from > to || from === to && types[extension2].substr(0, 12) === "application/") { continue; } } types[extension2] = type; } }); } } }); // node_modules/xml/lib/escapeForXML.js var require_escapeForXML = __commonJS({ "node_modules/xml/lib/escapeForXML.js"(exports, module2) { var XML_CHARACTER_MAP = { "&": "&", '"': """, "'": "'", "<": "<", ">": ">" }; function escapeForXML(string) { return string && string.replace ? string.replace(/([&"<>'])/g, function(str, item) { return XML_CHARACTER_MAP[item]; }) : string; } module2.exports = escapeForXML; } }); // node_modules/xml/lib/xml.js var require_xml = __commonJS({ "node_modules/xml/lib/xml.js"(exports, module2) { var escapeForXML = require_escapeForXML(); var Stream = require("stream").Stream; var DEFAULT_INDENT = " "; function xml(input, options) { if (typeof options !== "object") { options = { indent: options }; } var stream = options.stream ? new Stream() : null, output = "", interrupted = false, indent = !options.indent ? "" : options.indent === true ? DEFAULT_INDENT : options.indent, instant = true; function delay(func) { if (!instant) { func(); } else { process.nextTick(func); } } function append(interrupt, out) { if (out !== void 0) { output += out; } if (interrupt && !interrupted) { stream = stream || new Stream(); interrupted = true; } if (interrupt && interrupted) { var data = output; delay(function() { stream.emit("data", data); }); output = ""; } } function add(value, last2) { format(append, resolve(value, indent, indent ? 1 : 0), last2); } function end() { if (stream) { var data = output; delay(function() { stream.emit("data", data); stream.emit("end"); stream.readable = false; stream.emit("close"); }); } } function addXmlDeclaration(declaration) { var encoding = declaration.encoding || "UTF-8", attr = { version: "1.0", encoding }; if (declaration.standalone) { attr.standalone = declaration.standalone; } add({ "?xml": { _attr: attr } }); output = output.replace("/>", "?>"); } delay(function() { instant = false; }); if (options.declaration) { addXmlDeclaration(options.declaration); } if (input && input.forEach) { input.forEach(function(value, i) { var last2; if (i + 1 === input.length) last2 = end; add(value, last2); }); } else { add(input, end); } if (stream) { stream.readable = true; return stream; } return output; } function element() { var input = Array.prototype.slice.call(arguments), self2 = { _elem: resolve(input) }; self2.push = function(input2) { if (!this.append) { throw new Error("not assigned to a parent!"); } var that = this; var indent = this._elem.indent; format(this.append, resolve(input2, indent, this._elem.icount + (indent ? 1 : 0)), function() { that.append(true); }); }; self2.close = function(input2) { if (input2 !== void 0) { this.push(input2); } if (this.end) { this.end(); } }; return self2; } function create_indent(character, count) { return new Array(count || 0).join(character || ""); } function resolve(data, indent, indent_count) { indent_count = indent_count || 0; var indent_spaces = create_indent(indent, indent_count); var name; var values = data; var interrupt = false; if (typeof data === "object") { var keys = Object.keys(data); name = keys[0]; values = data[name]; if (values && values._elem) { values._elem.name = name; values._elem.icount = indent_count; values._elem.indent = indent; values._elem.indents = indent_spaces; values._elem.interrupt = values; return values._elem; } } var attributes = [], content = []; var isStringContent; function get_attributes(obj) { var keys2 = Object.keys(obj); keys2.forEach(function(key) { attributes.push(attribute(key, obj[key])); }); } switch (typeof values) { case "object": if (values === null) break; if (values._attr) { get_attributes(values._attr); } if (values._cdata) { content.push(("/g, "]]]]>") + "]]>"); } if (values.forEach) { isStringContent = false; content.push(""); values.forEach(function(value) { if (typeof value == "object") { var _name = Object.keys(value)[0]; if (_name == "_attr") { get_attributes(value._attr); } else { content.push(resolve(value, indent, indent_count + 1)); } } else { content.pop(); isStringContent = true; content.push(escapeForXML(value)); } }); if (!isStringContent) { content.push(""); } } break; default: content.push(escapeForXML(values)); } return { name, interrupt, attributes, content, icount: indent_count, indents: indent_spaces, indent }; } function format(append, elem, end) { if (typeof elem != "object") { return append(false, elem); } var len = elem.interrupt ? 1 : elem.content.length; function proceed() { while (elem.content.length) { var value = elem.content.shift(); if (value === void 0) continue; if (interrupt(value)) return; format(append, value); } append(false, (len > 1 ? elem.indents : "") + (elem.name ? "" : "") + (elem.indent && !end ? "\n" : "")); if (end) { end(); } } function interrupt(value) { if (value.interrupt) { value.interrupt.append = append; value.interrupt.end = proceed; value.interrupt = false; append(true); return true; } return false; } append(false, elem.indents + (elem.name ? "<" + elem.name : "") + (elem.attributes.length ? " " + elem.attributes.join(" ") : "") + (len ? elem.name ? ">" : "" : elem.name ? "/>" : "") + (elem.indent && len > 1 ? "\n" : "")); if (!len) { return append(false, elem.indent ? "\n" : ""); } if (!interrupt(elem)) { proceed(); } } function attribute(key, value) { return key + '="' + escapeForXML(value) + '"'; } module2.exports = xml; module2.exports.element = module2.exports.Element = element; } }); // node_modules/rss/lib/index.js var require_lib3 = __commonJS({ "node_modules/rss/lib/index.js"(exports, module2) { "use strict"; var mime3 = require_mime_types(); var xml = require_xml(); var fs2 = require("fs"); function ifTruePush(bool, array, data) { if (bool) { array.push(data); } } function ifTruePushArray(bool, array, dataArray) { if (!bool) { return; } dataArray.forEach(function(item) { ifTruePush(item, array, item); }); } function getSize(filename) { if (typeof fs2 === "undefined") { return 0; } return fs2.statSync(filename).size; } function generateXML(data) { var channel = []; channel.push({ title: { _cdata: data.title } }); channel.push({ description: { _cdata: data.description || data.title } }); channel.push({ link: data.site_url || "http://github.com/dylang/node-rss" }); if (data.image_url) { channel.push({ image: [{ url: data.image_url }, { title: data.title }, { link: data.site_url }] }); } channel.push({ generator: data.generator }); channel.push({ lastBuildDate: new Date().toUTCString() }); ifTruePush(data.feed_url, channel, { "atom:link": { _attr: { href: data.feed_url, rel: "self", type: "application/rss+xml" } } }); ifTruePush(data.author, channel, { "author": { _cdata: data.author } }); ifTruePush(data.pubDate, channel, { "pubDate": new Date(data.pubDate).toGMTString() }); ifTruePush(data.copyright, channel, { "copyright": { _cdata: data.copyright } }); ifTruePush(data.language, channel, { "language": { _cdata: data.language } }); ifTruePush(data.managingEditor, channel, { "managingEditor": { _cdata: data.managingEditor } }); ifTruePush(data.webMaster, channel, { "webMaster": { _cdata: data.webMaster } }); ifTruePush(data.docs, channel, { "docs": data.docs }); ifTruePush(data.ttl, channel, { "ttl": data.ttl }); ifTruePush(data.hub, channel, { "atom:link": { _attr: { href: data.hub, rel: "hub" } } }); if (data.categories) { data.categories.forEach(function(category) { ifTruePush(category, channel, { category: { _cdata: category } }); }); } ifTruePushArray(data.custom_elements, channel, data.custom_elements); data.items.forEach(function(item) { var item_values = [ { title: { _cdata: item.title } } ]; ifTruePush(item.description, item_values, { description: { _cdata: item.description } }); ifTruePush(item.url, item_values, { link: item.url }); ifTruePush(item.link || item.guid || item.title, item_values, { guid: [{ _attr: { isPermaLink: !item.guid && !!item.url } }, item.guid || item.url || item.title] }); item.categories.forEach(function(category) { ifTruePush(category, item_values, { category: { _cdata: category } }); }); ifTruePush(item.author || data.author, item_values, { "dc:creator": { _cdata: item.author || data.author } }); ifTruePush(item.date, item_values, { pubDate: new Date(item.date).toGMTString() }); data.geoRSS = data.geoRSS || item.lat && item.long; ifTruePush(item.lat, item_values, { "geo:lat": item.lat }); ifTruePush(item.long, item_values, { "geo:long": item.long }); if (item.enclosure && item.enclosure.url) { if (item.enclosure.file) { item_values.push({ enclosure: { _attr: { url: item.enclosure.url, length: item.enclosure.size || getSize(item.enclosure.file), type: item.enclosure.type || mime3.lookup(item.enclosure.file) } } }); } else { item_values.push({ enclosure: { _attr: { url: item.enclosure.url, length: item.enclosure.size || 0, type: item.enclosure.type || mime3.lookup(item.enclosure.url) } } }); } } ifTruePushArray(item.custom_elements, item_values, item.custom_elements); channel.push({ item: item_values }); }); var _attr = { "xmlns:dc": "http://purl.org/dc/elements/1.1/", "xmlns:content": "http://purl.org/rss/1.0/modules/content/", "xmlns:atom": "http://www.w3.org/2005/Atom", version: "2.0" }; Object.keys(data.custom_namespaces).forEach(function(name) { _attr["xmlns:" + name] = data.custom_namespaces[name]; }); if (data.geoRSS) { _attr["xmlns:geo"] = "http://www.w3.org/2003/01/geo/wgs84_pos#"; } return { rss: [ { _attr }, { channel } ] }; } function RSS2(options, items) { options = options || {}; this.title = options.title || "Untitled RSS Feed"; this.description = options.description || ""; this.generator = options.generator || "RSS for Node"; this.feed_url = options.feed_url; this.site_url = options.site_url; this.image_url = options.image_url; this.author = options.author; this.categories = options.categories; this.pubDate = options.pubDate; this.hub = options.hub; this.docs = options.docs; this.copyright = options.copyright; this.language = options.language; this.managingEditor = options.managingEditor; this.webMaster = options.webMaster; this.ttl = options.ttl; this.geoRSS = options.geoRSS || false; this.custom_namespaces = options.custom_namespaces || {}; this.custom_elements = options.custom_elements || []; this.items = items || []; this.item = function(options2) { options2 = options2 || {}; var item = { title: options2.title || "No title", description: options2.description || "", url: options2.url, guid: options2.guid, categories: options2.categories || [], author: options2.author, date: options2.date, lat: options2.lat, long: options2.long, enclosure: options2.enclosure || false, custom_elements: options2.custom_elements || [] }; this.items.push(item); return this; }; this.xml = function(indent) { return '' + xml(generateXML(this), indent); }; } module2.exports = RSS2; } }); // node_modules/upath/build/code/upath.js var require_upath = __commonJS({ "node_modules/upath/build/code/upath.js"(exports) { var VERSION = "2.0.1"; var extraFn; var extraFunctions; var isFunction; var isString; var isValidExt; var name; var path; var propName; var propValue; var toUnix; var upath; var slice = [].slice; var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; var hasProp = {}.hasOwnProperty; path = require("path"); isFunction = function(val) { return typeof val === "function"; }; isString = function(val) { return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]"; }; upath = exports; upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION"; toUnix = function(p) { p = p.replace(/\\/g, "/"); p = p.replace(/(? 0) { p0 = toUnix(p[0]); if (p0.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) { result = "./" + result; } else if (p0.startsWith("//") && !result.startsWith("//")) { if (p0.startsWith("//./")) { result = "//." + result; } else { result = "/" + result; } } } return result; }, addExt: function(file, ext) { if (!ext) { return file; } else { if (ext[0] !== ".") { ext = "." + ext; } return file + (file.endsWith(ext) ? "" : ext); } }, trimExt: function(filename, ignoreExts, maxSize) { var oldExt; if (maxSize == null) { maxSize = 7; } oldExt = upath.extname(filename); if (isValidExt(oldExt, ignoreExts, maxSize)) { return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9e9); } else { return filename; } }, removeExt: function(filename, ext) { if (!ext) { return filename; } else { ext = ext[0] === "." ? ext : "." + ext; if (upath.extname(filename) === ext) { return upath.trimExt(filename, [], ext.length); } else { return filename; } } }, changeExt: function(filename, ext, ignoreExts, maxSize) { if (maxSize == null) { maxSize = 7; } return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? "" : ext[0] === "." ? ext : "." + ext); }, defaultExt: function(filename, ext, ignoreExts, maxSize) { var oldExt; if (maxSize == null) { maxSize = 7; } oldExt = upath.extname(filename); if (isValidExt(oldExt, ignoreExts, maxSize)) { return filename; } else { return upath.addExt(filename, ext); } } }; isValidExt = function(ext, ignoreExts, maxSize) { if (ignoreExts == null) { ignoreExts = []; } return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map(function(e) { return (e && e[0] !== "." ? "." : "") + e; }), ext) < 0; }; for (name in extraFunctions) { if (!hasProp.call(extraFunctions, name)) continue; extraFn = extraFunctions[name]; if (upath[name] !== void 0) { throw new Error("path." + name + " already exists."); } else { upath[name] = extraFn; } } } }); // node_modules/readable-stream/lib/internal/streams/stream-browser.js var require_stream_browser = __commonJS({ "node_modules/readable-stream/lib/internal/streams/stream-browser.js"(exports, module2) { module2.exports = require("events").EventEmitter; } }); // node_modules/readable-stream/lib/internal/streams/buffer_list.js var require_buffer_list = __commonJS({ "node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module2) { "use strict"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var _require = require("buffer"); var Buffer5 = _require.Buffer; var _require2 = require("util"); var inspect = _require2.inspect; var custom = inspect && inspect.custom || "inspect"; function copyBuffer(src, target, offset) { Buffer5.prototype.copy.call(src, target, offset); } module2.exports = /* @__PURE__ */ function() { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry; else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; while (p = p.next) ret += s + p.data; return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer5.alloc(0); var ret = Buffer5.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { ret = this.shift(); } else { ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str; else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next; else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer5.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next; else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread(_objectSpread({}, options), {}, { depth: 0, customInspect: false })); } }]); return BufferList; }(); } }); // node_modules/readable-stream/lib/internal/streams/destroy.js var require_destroy = __commonJS({ "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module2) { "use strict"; function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } if (this._readableState) { this._readableState.destroyed = true; } if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function(err2) { if (!cb && err2) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err2); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err2); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err2); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self2, err) { emitErrorNT(self2, err); emitCloseNT(self2); } function emitCloseNT(self2) { if (self2._writableState && !self2._writableState.emitClose) return; if (self2._readableState && !self2._readableState.emitClose) return; self2.emit("close"); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self2, err) { self2.emit("error", err); } function errorOrDestroy(stream, err) { var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); else stream.emit("error", err); } module2.exports = { destroy, undestroy, errorOrDestroy }; } }); // node_modules/readable-stream/errors-browser.js var require_errors_browser = __commonJS({ "node_modules/readable-stream/errors-browser.js"(exports, module2) { "use strict"; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === "string") { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /* @__PURE__ */ function(_Base) { _inheritsLoose(NodeError2, _Base); function NodeError2(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError2; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function(i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } function endsWith(str, search, this_len) { if (this_len === void 0 || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } function includes(str, search, start) { if (typeof start !== "number") { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }, TypeError); createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { var determiner; if (typeof expected === "string" && startsWith(expected, "not ")) { determiner = "must not be"; expected = expected.replace(/^not /, ""); } else { determiner = "must be"; } var msg; if (endsWith(name, " argument")) { msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type")); } else { var type = includes(name, ".") ? "property" : "argument"; msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type")); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { return "The " + name + " method is not implemented"; }); createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); createErrorType("ERR_STREAM_DESTROYED", function(name) { return "Cannot call " + name + " after a stream was destroyed"; }); createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { return "Unknown encoding: " + arg; }, TypeError); createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); module2.exports.codes = codes; } }); // node_modules/readable-stream/lib/internal/streams/state.js var require_state = __commonJS({ "node_modules/readable-stream/lib/internal/streams/state.js"(exports, module2) { "use strict"; var ERR_INVALID_OPT_VALUE = require_errors_browser().codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : "highWaterMark"; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } return state.objectMode ? 16 : 16 * 1024; } module2.exports = { getHighWaterMark }; } }); // node_modules/inherits/inherits_browser.js var require_inherits_browser = __commonJS({ "node_modules/inherits/inherits_browser.js"(exports, module2) { if (typeof Object.create === "function") { module2.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } }; } else { module2.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; } }; } } }); // node_modules/util-deprecate/browser.js var require_browser = __commonJS({ "node_modules/util-deprecate/browser.js"(exports, module2) { module2.exports = deprecate; function deprecate(fn, msg) { if (config("noDeprecation")) { return fn; } var warned = false; function deprecated() { if (!warned) { if (config("throwDeprecation")) { throw new Error(msg); } else if (config("traceDeprecation")) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; } function config(name) { try { if (!global.localStorage) return false; } catch (_) { return false; } var val = global.localStorage[name]; if (val == null) return false; return String(val).toLowerCase() === "true"; } } }); // node_modules/readable-stream/lib/_stream_writable.js var require_stream_writable = __commonJS({ "node_modules/readable-stream/lib/_stream_writable.js"(exports, module2) { "use strict"; module2.exports = Writable; function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function() { onCorkedFinish(_this, state); }; } var Duplex; Writable.WritableState = WritableState; var internalUtil = { deprecate: require_browser() }; var Stream = require_stream_browser(); var Buffer5 = require("buffer").Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer5.from(chunk); } function _isUint8Array(obj) { return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require_destroy(); var _require = require_state(); var getHighWaterMark = _require.getHighWaterMark; var _require$codes = require_errors_browser().codes; var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; require_inherits_browser()(Writable, Stream); function nop() { } function WritableState(options, stream, isDuplex) { Duplex = Duplex || require_stream_duplex(); options = options || {}; if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); this.finalCalled = false; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; this.destroyed = false; var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; this.defaultEncoding = options.defaultEncoding || "utf8"; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(er) { onwrite(stream, er); }; this.writecb = null; this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; this.emitClose = options.emitClose !== false; this.autoDestroy = !!options.autoDestroy; this.bufferedRequestCount = 0; this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) { } })(); var realHasInstance; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance2(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require_stream_duplex(); var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); this.writable = true; if (options) { if (typeof options.write === "function") this._write = options.write; if (typeof options.writev === "function") this._writev = options.writev; if (typeof options.destroy === "function") this._destroy = options.destroy; if (typeof options.final === "function") this._final = options.final; } Stream.call(this); } Writable.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); errorOrDestroy(stream, er); process.nextTick(cb, er); } function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== "string" && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer5.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === "function") { cb = encoding; encoding = null; } if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== "function") cb = nop; if (state.ending) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function() { this._writableState.corked++; }; Writable.prototype.uncork = function() { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = encoding.toLowerCase(); if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, "writableBuffer", { enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { chunk = Buffer5.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, "writableHighWaterMark", { enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = "buffer"; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last2 = state.lastBufferedRequest; state.lastBufferedRequest = { chunk, encoding, isBuf, callback: cb, next: null }; if (last2) { last2.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); else if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { process.nextTick(cb, er); process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb); else { var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit("drain"); } } function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, "", holder.finish); state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === "function") { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === "function") { cb = encoding; encoding = null; } if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); if (state.corked) { state.corked = 1; this.uncork(); } if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, "writableLength", { enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function(err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit("prefinish"); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === "function" && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit("prefinish"); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit("finish"); if (state.autoDestroy) { var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb); else stream.once("finish", cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, "destroyed", { enumerable: false, get: function get() { if (this._writableState === void 0) { return false; } return this._writableState.destroyed; }, set: function set(value) { if (!this._writableState) { return; } this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function(err, cb) { cb(err); }; } }); // node_modules/readable-stream/lib/_stream_duplex.js var require_stream_duplex = __commonJS({ "node_modules/readable-stream/lib/_stream_duplex.js"(exports, module2) { "use strict"; var objectKeys = Object.keys || function(obj) { var keys2 = []; for (var key in obj) keys2.push(key); return keys2; }; module2.exports = Duplex; var Readable = require_stream_readable(); var Writable = require_stream_writable(); require_inherits_browser()(Duplex, Readable); { keys = objectKeys(Writable.prototype); for (v = 0; v < keys.length; v++) { method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } var keys; var method; var v; function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once("end", onend); } } } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, "writableBuffer", { enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, "writableLength", { enumerable: false, get: function get() { return this._writableState.length; } }); function onend() { if (this._writableState.ended) return; process.nextTick(onEndNT, this); } function onEndNT(self2) { self2.end(); } Object.defineProperty(Duplex.prototype, "destroyed", { enumerable: false, get: function get() { if (this._readableState === void 0 || this._writableState === void 0) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { if (this._readableState === void 0 || this._writableState === void 0) { return; } this._readableState.destroyed = value; this._writableState.destroyed = value; } }); } }); // node_modules/readable-stream/lib/internal/streams/end-of-stream.js var require_end_of_stream = __commonJS({ "node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module2) { "use strict"; var ERR_STREAM_PREMATURE_CLOSE = require_errors_browser().codes.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function() { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() { } function isRequest(stream) { return stream.setHeader && typeof stream.abort === "function"; } function eos(stream, opts, callback) { if (typeof opts === "function") return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish2() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish2() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend2() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror2(err) { callback.call(stream, err); }; var onclose = function onclose2() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest2() { stream.req.on("finish", onfinish); }; if (isRequest(stream)) { stream.on("complete", onfinish); stream.on("abort", onclose); if (stream.req) onrequest(); else stream.on("request", onrequest); } else if (writable && !stream._writableState) { stream.on("end", onlegacyfinish); stream.on("close", onlegacyfinish); } stream.on("end", onend); stream.on("finish", onfinish); if (opts.error !== false) stream.on("error", onerror); stream.on("close", onclose); return function() { stream.removeListener("complete", onfinish); stream.removeListener("abort", onclose); stream.removeListener("request", onrequest); if (stream.req) stream.req.removeListener("finish", onfinish); stream.removeListener("end", onlegacyfinish); stream.removeListener("close", onlegacyfinish); stream.removeListener("finish", onfinish); stream.removeListener("end", onend); stream.removeListener("error", onerror); stream.removeListener("close", onclose); }; } module2.exports = eos; } }); // node_modules/readable-stream/lib/internal/streams/async_iterator.js var require_async_iterator = __commonJS({ "node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) { "use strict"; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var finished = require_end_of_stream(); var kLastResolve = Symbol("lastResolve"); var kLastReject = Symbol("lastReject"); var kError = Symbol("error"); var kEnded = Symbol("ended"); var kLastPromise = Symbol("lastPromise"); var kHandlePromise = Symbol("handlePromise"); var kStream = Symbol("stream"); function createIterResult(value, done) { return { value, done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function(resolve, reject) { lastPromise.then(function() { if (iter[kEnded]) { resolve(createIterResult(void 0, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function() { }); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(void 0, true)); } if (this[kStream].destroyed) { return new Promise(function(resolve, reject) { process.nextTick(function() { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(void 0, true)); } }); }); } var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; return new Promise(function(resolve, reject) { _this2[kStream].destroy(null, function(err) { if (err) { reject(err); return; } resolve(createIterResult(void 0, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function(err) { if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { var reject = iterator[kLastReject]; if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(void 0, true)); } iterator[kEnded] = true; }); stream.on("readable", onReadable.bind(null, iterator)); return iterator; }; module2.exports = createReadableStreamAsyncIterator; } }); // node_modules/readable-stream/lib/internal/streams/from-browser.js var require_from_browser = __commonJS({ "node_modules/readable-stream/lib/internal/streams/from-browser.js"(exports, module2) { module2.exports = function() { throw new Error("Readable.from is not available in the browser"); }; } }); // node_modules/readable-stream/lib/_stream_readable.js var require_stream_readable = __commonJS({ "node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) { "use strict"; module2.exports = Readable; var Duplex; Readable.ReadableState = ReadableState; var EE = require("events").EventEmitter; var EElistenerCount = function EElistenerCount2(emitter, type) { return emitter.listeners(type).length; }; var Stream = require_stream_browser(); var Buffer5 = require("buffer").Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer5.from(chunk); } function _isUint8Array(obj) { return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array; } var debugUtil = require("util"); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog("stream"); } else { debug = function debug2() { }; } var BufferList = require_buffer_list(); var destroyImpl = require_destroy(); var _require = require_state(); var getHighWaterMark = _require.getHighWaterMark; var _require$codes = require_errors_browser().codes; var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; var StringDecoder; var createReadableStreamAsyncIterator; var from; require_inherits_browser()(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || require_stream_duplex(); options = options || {}; if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; this.emitClose = options.emitClose !== false; this.autoDestroy = !!options.autoDestroy; this.destroyed = false; this.defaultEncoding = options.defaultEncoding || "utf8"; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require_stream_duplex(); if (!(this instanceof Readable)) return new Readable(options); var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); this.readable = true; if (options) { if (typeof options.read === "function") this._read = options.read; if (typeof options.destroy === "function") this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, "destroyed", { enumerable: false, get: function get() { if (this._readableState === void 0) { return false; } return this._readableState.destroyed; }, set: function set(value) { if (!this._readableState) { return; } this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function(err, cb) { cb(err); }; Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === "string") { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer5.from(chunk, encoding); encoding = ""; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug("readableAddChunk", chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer5.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit("data", chunk); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); } return er; } Readable.prototype.isPaused = function() { return this._readableState.flowing === false; }; Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; var p = this._readableState.buffer.head; var content = ""; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== "") this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; var MAX_HWM = 1073741824; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length; } if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; if (!state.ended) { state.needReadable = true; return 0; } return state.length; } Readable.prototype.read = function(n) { debug("read", n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug("read: emitReadable", state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this); return null; } n = howMuchToRead(n, state); if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } var doRead = state.needReadable; debug("need readable", doRead); if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug("length less than watermark", doRead); } if (state.ended || state.reading) { doRead = false; debug("reading or ended", doRead); } else if (doRead) { debug("do read"); state.reading = true; state.sync = true; if (state.length === 0) state.needReadable = true; this._read(state.highWaterMark); state.sync = false; if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state); else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { if (!state.ended) state.needReadable = true; if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit("data", ret); return ret; }; function onEofChunk(stream, state) { debug("onEofChunk"); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { emitReadable(stream); } else { state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } function emitReadable(stream) { var state = stream._readableState; debug("emitReadable", state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug("emitReadable", state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug("emitReadable_", state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit("readable"); state.emittedReadable = false; } state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug("maybeReadMore read 0"); stream.read(0); if (len === state.length) break; } state.readingMore = false; } Readable.prototype._read = function(n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); }; Readable.prototype.pipe = function(dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn); else src.once("end", endFn); dest.on("unpipe", onunpipe); function onunpipe(readable, unpipeInfo) { debug("onunpipe"); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup2(); } } } function onend() { debug("onend"); dest.end(); } var ondrain = pipeOnDrain(src); dest.on("drain", ondrain); var cleanedUp = false; function cleanup2() { debug("cleanup"); dest.removeListener("close", onclose); dest.removeListener("finish", onfinish); dest.removeListener("drain", ondrain); dest.removeListener("error", onerror); dest.removeListener("unpipe", onunpipe); src.removeListener("end", onend); src.removeListener("end", unpipe); src.removeListener("data", ondata); cleanedUp = true; if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on("data", ondata); function ondata(chunk) { debug("ondata"); var ret = dest.write(chunk); debug("dest.write", ret); if (ret === false) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug("false write response, pause", state.awaitDrain); state.awaitDrain++; } src.pause(); } } function onerror(er) { debug("onerror", er); unpipe(); dest.removeListener("error", onerror); if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); } prependListener(dest, "error", onerror); function onclose() { dest.removeListener("finish", onfinish); unpipe(); } dest.once("close", onclose); function onfinish() { debug("onfinish"); dest.removeListener("close", onclose); unpipe(); } dest.once("finish", onfinish); function unpipe() { debug("unpipe"); src.unpipe(dest); } dest.emit("pipe", src); if (!state.flowing) { debug("pipe resume"); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function(dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; if (state.pipesCount === 0) return this; if (state.pipesCount === 1) { if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit("unpipe", this, unpipeInfo); return this; } if (!dest) { var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false }); return this; } var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit("unpipe", this, unpipeInfo); return this; }; Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === "data") { state.readableListening = this.listenerCount("readable") > 0; if (state.flowing !== false) this.resume(); } else if (ev === "readable") { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug("on readable", state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function(ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function(ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self2) { var state = self2._readableState; state.readableListening = self2.listenerCount("readable") > 0; if (state.resumeScheduled && !state.paused) { state.flowing = true; } else if (self2.listenerCount("data") > 0) { self2.resume(); } } function nReadingNextTick(self2) { debug("readable nexttick read 0"); self2.read(0); } Readable.prototype.resume = function() { var state = this._readableState; if (!state.flowing) { debug("resume"); state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug("resume", state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit("resume"); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function() { debug("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug("pause"); this._readableState.flowing = false; this.emit("pause"); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug("flow", state.flowing); while (state.flowing && stream.read() !== null) ; } Readable.prototype.wrap = function(stream) { var _this = this; var state = this._readableState; var paused = false; stream.on("end", function() { debug("wrapped end"); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on("data", function(chunk) { debug("wrapped data"); if (state.decoder) chunk = state.decoder.write(chunk); if (state.objectMode && (chunk === null || chunk === void 0)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); for (var i in stream) { if (this[i] === void 0 && typeof stream[i] === "function") { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } this._read = function(n2) { debug("wrapped _read", n2); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === "function") { Readable.prototype[Symbol.asyncIterator] = function() { if (createReadableStreamAsyncIterator === void 0) { createReadableStreamAsyncIterator = require_async_iterator(); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, "readableHighWaterMark", { enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, "readableBuffer", { enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, "readableFlowing", { enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); Readable._fromList = fromList; Object.defineProperty(Readable.prototype, "readableLength", { enumerable: false, get: function get() { return this._readableState.length; } }); function fromList(n, state) { if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) { if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.first(); else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug("endReadable", state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug("endReadableNT", state.endEmitted, state.length); if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit("end"); if (state.autoDestroy) { var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === "function") { Readable.from = function(iterable, opts) { if (from === void 0) { from = require_from_browser(); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } } }); // node_modules/readable-stream/lib/_stream_transform.js var require_stream_transform = __commonJS({ "node_modules/readable-stream/lib/_stream_transform.js"(exports, module2) { "use strict"; module2.exports = Transform; var _require$codes = require_errors_browser().codes; var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = require_stream_duplex(); require_inherits_browser()(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit("error", new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; this._readableState.needReadable = true; this._readableState.sync = false; if (options) { if (typeof options.transform === "function") this._transform = options.transform; if (typeof options.flush === "function") this._flush = options.flush; } this.on("prefinish", prefinish); } function prefinish() { var _this = this; if (typeof this._flush === "function" && !this._readableState.destroyed) { this._flush(function(er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; Transform.prototype._transform = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); }; Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; Transform.prototype._read = function(n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { ts.needTransform = true; } }; Transform.prototype._destroy = function(err, cb) { Duplex.prototype._destroy.call(this, err, function(err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit("error", er); if (data != null) stream.push(data); if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } } }); // node_modules/readable-stream/lib/_stream_passthrough.js var require_stream_passthrough = __commonJS({ "node_modules/readable-stream/lib/_stream_passthrough.js"(exports, module2) { "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); require_inherits_browser()(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; } }); // node_modules/readable-stream/lib/internal/streams/pipeline.js var require_pipeline = __commonJS({ "node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports, module2) { "use strict"; var eos; function once(callback) { var called = false; return function() { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = require_errors_browser().codes; var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === "function"; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on("close", function() { closed = true; }); if (eos === void 0) eos = require_end_of_stream(); eos(stream, { readable: reading, writable: writing }, function(err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function(err) { if (closed) return; if (destroyed) return; destroyed = true; if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === "function") return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED("pipe")); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== "function") return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS("streams"); } var error; var destroys = streams.map(function(stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function(err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module2.exports = pipeline; } }); // node_modules/readable-stream/readable-browser.js var require_readable_browser = __commonJS({ "node_modules/readable-stream/readable-browser.js"(exports, module2) { exports = module2.exports = require_stream_readable(); exports.Stream = exports; exports.Readable = exports; exports.Writable = require_stream_writable(); exports.Duplex = require_stream_duplex(); exports.Transform = require_stream_transform(); exports.PassThrough = require_stream_passthrough(); exports.finished = require_end_of_stream(); exports.pipeline = require_pipeline(); } }); // node_modules/readable-web-to-node-stream/lib/index.js var require_lib4 = __commonJS({ "node_modules/readable-web-to-node-stream/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReadableWebToNodeStream = void 0; var readable_stream_1 = require_readable_browser(); var ReadableWebToNodeStream2 = class extends readable_stream_1.Readable { constructor(stream) { super(); this.bytesRead = 0; this.released = false; this.reader = stream.getReader(); } async _read() { if (this.released) { this.push(null); return; } this.pendingRead = this.reader.read(); const data = await this.pendingRead; delete this.pendingRead; if (data.done || this.released) { this.push(null); } else { this.bytesRead += data.value.length; this.push(data.value); } } async waitForReadToComplete() { if (this.pendingRead) { await this.pendingRead; } } async close() { await this.syncAndRelease(); } async syncAndRelease() { this.released = true; await this.waitForReadToComplete(); await this.reader.releaseLock(); } }; exports.ReadableWebToNodeStream = ReadableWebToNodeStream2; } }); // node_modules/ieee754/index.js var require_ieee754 = __commonJS({ "node_modules/ieee754/index.js"(exports) { exports.read = function(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); }; exports.write = function(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 & 255, i += d, m /= 256, mLen -= 8) { } e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { } buffer[offset + i - d] |= s * 128; }; } }); // scripts/main.ts var main_exports = {}; __export(main_exports, { default: () => HTMLExportPlugin }); module.exports = __toCommonJS(main_exports); var import_obsidian13 = require("obsidian"); // assets/graph-view.txt.js var graph_view_txt_default = `// -------------------------- GRAPH VIEW -------------------------- var running = false; let batchFraction = 1; // how much of the graph to update per frame let minBatchFraction = 0.3; // batch fraction is updated dynamically, but never goes below this value let dt = 1; let targetFPS = 40; let startingCameraRect = {minX: -1, minY: -1, maxX: 1, maxY: 1}; let mouseWorldPos = { x: undefined, y: undefined }; let scrollVelocity = 0; let averageFPS = targetFPS * 2; let pixiApp = undefined; let graphRenderer = undefined; class GraphAssembly { static nodeCount = 0; static linkCount = 0; static hoveredNode = -1; static #positionsPtr = 0; static #positionsByteLength = 0; static #radiiPtr = 0; static #linkSourcesPtr = 0; static #linkTargetsPtr = 0; static linkSources = new Int32Array(0); static linkTargets = new Int32Array(0); static radii = new Float32Array(0); static maxRadius = 0; static averageRadius = 0; static minRadius = 0; /** * @param {{graphOptions: {attractionForce: number, linkLength: number, repulsionForce: number, centralForce: number, edgePruning: number, minNodeRadius: number, maxNodeRadius: number}, nodeCount: number, linkCount:number, radii: number[], labels: string[], paths: string[], linkSources: number[], linkTargets: number[], linkCounts: number[]}} graphData */ static init(graphData) { GraphAssembly.nodeCount = graphData.nodeCount; GraphAssembly.linkCount = graphData.linkCount; // create arrays for the data let positions = new Float32Array(GraphAssembly.nodeCount * 2); GraphAssembly.radii = new Float32Array(graphData.radii); GraphAssembly.linkSources = new Int32Array(graphData.linkSources); GraphAssembly.linkTargets = new Int32Array(graphData.linkTargets); // allocate memory on the heap GraphAssembly.#positionsPtr = Module._malloc(positions.byteLength); GraphAssembly.#positionsByteLength = positions.byteLength; GraphAssembly.#radiiPtr = Module._malloc(GraphAssembly.radii.byteLength); GraphAssembly.#linkSourcesPtr = Module._malloc(GraphAssembly.linkSources.byteLength); GraphAssembly.#linkTargetsPtr = Module._malloc(GraphAssembly.linkTargets.byteLength); GraphAssembly.maxRadius = GraphAssembly.radii.reduce((a, b) => Math.max(a, b)); GraphAssembly.averageRadius = GraphAssembly.radii.reduce((a, b) => a + b) / GraphAssembly.radii.length; GraphAssembly.minRadius = GraphAssembly.radii.reduce((a, b) => Math.min(a, b)); positions = this.loadState(); // copy the data to the heap Module.HEAP32.set(new Int32Array(positions.buffer), GraphAssembly.#positionsPtr / positions.BYTES_PER_ELEMENT); Module.HEAP32.set(new Int32Array(GraphAssembly.radii.buffer), GraphAssembly.#radiiPtr / GraphAssembly.radii.BYTES_PER_ELEMENT); Module.HEAP32.set(new Int32Array(GraphAssembly.linkSources.buffer), GraphAssembly.#linkSourcesPtr / GraphAssembly.linkSources.BYTES_PER_ELEMENT); Module.HEAP32.set(new Int32Array(GraphAssembly.linkTargets.buffer), GraphAssembly.#linkTargetsPtr / GraphAssembly.linkTargets.BYTES_PER_ELEMENT); Module._Init( GraphAssembly.#positionsPtr, GraphAssembly.#radiiPtr, GraphAssembly.#linkSourcesPtr, GraphAssembly.#linkTargetsPtr, GraphAssembly.nodeCount, GraphAssembly.linkCount, batchFraction, dt, graphData.graphOptions.attractionForce, graphData.graphOptions.linkLength, graphData.graphOptions.repulsionForce, graphData.graphOptions.centralForce, ); } /** * @returns {Float32Array} */ static get positions() { return Module.HEAP32.buffer.slice(GraphAssembly.#positionsPtr, GraphAssembly.#positionsPtr + GraphAssembly.#positionsByteLength); } /** * @param {GraphRenderWorker} renderWorker * */ static saveState(renderWorker) { // save all rounded to int localStorage.setItem("positions", JSON.stringify(new Float32Array(GraphAssembly.positions).map(x => Math.round(x)))); } /** * @returns {Float32Array} * */ static loadState() { let positionsLoad = localStorage.getItem("positions"); let positions = null; if(positionsLoad) positions = new Float32Array(Object.values(JSON.parse(positionsLoad))); if (!positions || !positionsLoad || positions.length != GraphAssembly.nodeCount * 2) { positions = new Float32Array(GraphAssembly.nodeCount * 2); let spawnRadius = (GraphAssembly.averageRadius * Math.sqrt(GraphAssembly.nodeCount)) * 2; for (let i = 0; i < GraphAssembly.nodeCount; i++) { let distance = (1 - GraphAssembly.radii[i] / GraphAssembly.maxRadius) * spawnRadius; positions[i * 2] = Math.cos(i/GraphAssembly.nodeCount * 7.41 * 2 * Math.PI) * distance; positions[i * 2 + 1] = Math.sin(i/GraphAssembly.nodeCount * 7.41 * 2 * Math.PI) * distance; } } // fit view to positions let minX = Infinity; let maxX = -Infinity; let minY = Infinity; let maxY = -Infinity; for (let i = 0; i < GraphAssembly.nodeCount-1; i+=2) { let pos = { x: positions[i], y: positions[i + 1] }; minX = Math.min(minX, pos.x); maxX = Math.max(maxX, pos.x); minY = Math.min(minY, pos.y); maxY = Math.max(maxY, pos.y); } let margin = 50; startingCameraRect = { minX: minX - margin, minY: minY - margin, maxX: maxX + margin, maxY: maxY + margin }; return positions; } /** * @param {{x: number, y: number}} mousePosition * @param {number} grabbedNode */ static update(mousePosition, grabbedNode, cameraScale) { GraphAssembly.hoveredNode = Module._Update(mousePosition.x, mousePosition.y, grabbedNode, cameraScale); } static free() { Module._free(GraphAssembly.#positionsPtr); Module._free(GraphAssembly.#radiiPtr); Module._free(GraphAssembly.#linkSourcesPtr); Module._free(GraphAssembly.#linkTargetsPtr); Module._FreeMemory(); } /** * @param {number} value */ static set batchFraction(value) { Module._SetBatchFractionSize(value); } /** * @param {number} value */ static set attractionForce(value) { Module._SetAttractionForce(value); } /** * @param {number} value */ static set repulsionForce(value) { Module._SetRepulsionForce(value); } /** * @param {number} value */ static set centralForce(value) { Module._SetCentralForce(value); } /** * @param {number} value */ static set linkLength(value) { Module._SetLinkLength(value); } /** * @param {number} value */ static set dt(value) { Module._SetDt(value); } } class GraphRenderWorker { #cameraOffset; #cameraScale; #hoveredNode; #grabbedNode; #colors; #width; #height; constructor() { this.canvas = document.querySelector("#graph-canvas"); this.canvasSidebar = undefined; try { this.canvasSidebar = document.querySelector(".sidebar:has(#graph-canvas)"); } catch(e) { console.log("Error: " + e + "\\n\\n Using fallback."); let rightSidebar = document.querySelector(".sidebar-right"); let leftSidebar = document.querySelector(".sidebar-left"); this.canvasSidebar = rightSidebar.querySelector("#graph-canvas") ? rightSidebar : leftSidebar; } this.view = this.canvas.transferControlToOffscreen(); this.worker = new Worker(new URL("./graph-render-worker.js", import.meta.url)); this.#cameraOffset = {x: 0, y: 0}; this.#cameraScale = 1; this.#hoveredNode = -1; this.#grabbedNode = -1; this.#colors = { background: 0x000000, link: 0x000000, node: 0x000000, outline: 0x000000, text: 0x000000, accent: 0x000000, } this.#width = 0; this.#height = 0; this.cameraOffset = {x: this.canvas.width / 2, y: this.canvas.height / 2}; this.cameraScale = 1; this.hoveredNode = -1; this.grabbedNode = -1; this.resampleColors(); this.#pixiInit(); this.width = this.canvas.width; this.height = this.canvas.height; this.autoResizeCanvas(); this.fitToRect(startingCameraRect); } #pixiInit() { let { width, height } = this.view; this.worker.postMessage( { type: 'init', linkCount: GraphAssembly.linkCount, linkSources: GraphAssembly.linkSources, linkTargets: GraphAssembly.linkTargets, nodeCount: GraphAssembly.nodeCount, radii: GraphAssembly.radii, labels: graphData.labels, linkLength: graphData.graphOptions.linkLength, edgePruning: graphData.graphOptions.edgePruning, options: { width: width, height: height, view: this.view }, }, [this.view]); } fitToRect(rect) // {minX, minY, maxX, maxY} { let min = {x: rect.minX, y: rect.minY}; let max = {x: rect.maxX, y: rect.maxY}; let width = max.x - min.x; let height = max.y - min.y; let scale = 1/Math.min(width/this.width, height / this.height); this.cameraScale = scale; this.cameraOffset = { x: (this.width / 2) - ((rect.minX + width / 2) * scale), y: (this.height / 2) - ((rect.minY + height / 2) * scale) }; } fitToNodes() { this.fitToRect(startingCameraRect); } sampleColor(variable) { let testEl = document.createElement('div'); document.body.appendChild(testEl); testEl.style.setProperty('display', 'none'); testEl.style.setProperty('color', 'var(' + variable + ')'); let col = getComputedStyle(testEl).color; let opacity = getComputedStyle(testEl).opacity; testEl.remove(); function toColorObject(str) { var match = str.match(/rgb?\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/); return match ? { red: parseInt(match[1]), green: parseInt(match[2]), blue: parseInt(match[3]), alpha: 1 } : null } let color = toColorObject(col); let alpha = parseFloat(opacity); let result = { a: (alpha * color?.alpha ?? 1) ?? 1, rgb: (color?.red << 16 | color?.green << 8 | color?.blue) ?? 0x888888 }; return result; }; resampleColors() { this.colors = { background: this.sampleColor('--background-secondary').rgb, link: this.sampleColor('--graph-line').rgb, node: this.sampleColor('--graph-node').rgb, outline: this.sampleColor('--graph-line').rgb, text: this.sampleColor('--graph-text').rgb, accent: this.sampleColor('--interactive-accent').rgb, }; } draw(_positions) { this.worker.postMessage( { type: 'draw', positions: _positions, }, [_positions]); } resizeCanvas(width, height) { this.worker.postMessage( { type: "resize", width: width, height: height, }); this.#width = width; this.#height = height; } autoResizeCanvas() { if (this.width != this.canvas.offsetWidth || this.height != this.canvas.offsetHeight) { this.centerCamera(); this.resizeCanvas(this.canvas.offsetWidth, this.canvas.offsetHeight); } } centerCamera() { this.cameraOffset = { x: this.width / 2, y: this.height / 2 }; } #pixiSetInteraction(hoveredNodeIndex, grabbedNodeIndex) { let obj = { type: "update_interaction", hoveredNode: hoveredNodeIndex, grabbedNode: grabbedNodeIndex, } this.worker.postMessage(obj); } #pixiSetCamera(cameraOffset, cameraScale) { this.worker.postMessage( { type: "update_camera", cameraOffset: cameraOffset, cameraScale: cameraScale, }); } #pixiSetColors(colors) { this.worker.postMessage( { type: "update_colors", colors: colors, }); } set cameraOffset(offset) { this.#cameraOffset = offset; this.#pixiSetCamera(offset, this.cameraScale); } set cameraScale(scale) { this.#cameraScale = scale; this.#pixiSetCamera(this.cameraOffset, scale); } get cameraOffset() { return this.#cameraOffset; } get cameraScale() { return this.#cameraScale; } /** * @param {number} node */ set hoveredNode(node) { this.#hoveredNode = node; this.#pixiSetInteraction(node, this.#grabbedNode); } /** * @param {number} node */ set grabbedNode(node) { this.#grabbedNode = node; this.#pixiSetInteraction(this.#hoveredNode, node); } /** * @param {number} node */ set activeNode(node) { this.worker.postMessage( { type: 'set_active', active: node, }); } get hoveredNode() { return this.#hoveredNode; } get grabbedNode() { return this.#grabbedNode; } /** * @param {{ background: number; link: number; node: number; outline: number; text: number; accent: number; }} colors */ set colors(colors) { this.#colors = colors; this.#pixiSetColors(colors); } get colors() { return this.#colors; } set width(width) { this.#width = width; this.resizeCanvas(width, this.#height); } set height(height) { this.#height = height; this.resizeCanvas(this.#width, height); } get height() { return this.#height; } get width() { return this.#width; } /** * @param {number} x * @param {number} y * @param {boolean} floor * @returns {{x: number; y: number;}} */ toScreenSpace(x, y, floor = true) { if (floor) { return {x: Math.floor((x * this.cameraScale) + this.cameraOffset.x), y: Math.floor((y * this.cameraScale) + this.cameraOffset.y)}; } else { return {x: (x * this.cameraScale) + this.cameraOffset.x, y: (y * this.cameraScale) + this.cameraOffset.y}; } } /** * @param {{x: number; y: number;}} vector * @param {boolean} floor * @returns {{x: number; y: number;}} */ vecToScreenSpace(vector, floor = true) { return this.toScreenSpace(vector.x, vector.y, floor); } /** * @param {number} x * @param {number} y * @returns {{x: number; y: number;}} */ toWorldspace(x, y) { return {x: (x - this.cameraOffset.x) / this.cameraScale, y: (y - this.cameraOffset.y) / this.cameraScale}; } /** * @param {{x: number; y: number;}} vector * @returns {{x: number; y: number;}} */ vecToWorldspace(vector) { return this.toWorldspace(vector.x, vector.y); } setCameraCenterWorldspace({x, y}) { this.cameraOffset = {x: (this.width / 2) - (x * this.cameraScale), y: (this.height / 2) - (y * this.cameraScale)}; } getCameraCenterWorldspace() { return this.toWorldspace(this.width / 2, this.height / 2); } } async function initializeGraphView() { if(running) return; running = true; graphData.graphOptions.repulsionForce /= batchFraction; // compensate for batch fraction pixiApp = new PIXI.Application(); console.log("Module Ready"); GraphAssembly.init(graphData); // graphData is a global variable set in another script graphRenderer = new GraphRenderWorker(); window.graphRenderer = graphRenderer; initializeGraphEvents(); pixiApp.ticker.maxFPS = targetFPS; pixiApp.ticker.add(updateGraph); setActiveDocument(new URL(window.location.href), false, false); setInterval(() => { function isHidden(el) { var style = window.getComputedStyle(el); return (style.display === 'none') } try { var hidden = (graphRenderer.canvasSidebar.classList.contains("is-collapsed")); } catch(e) { return; } if(running && hidden) { running = false; } else if (!running && !hidden) { running = true; graphRenderer.autoResizeCanvas(); graphRenderer.centerCamera(); } }, 1000); } let firstUpdate = true; function updateGraph() { if(!running) return; if (graphRenderer.canvasSidebar.classList.contains("is-collapsed")) return; if (firstUpdate) { setTimeout(() => graphRenderer?.canvas?.classList.remove("hide"), 500); firstUpdate = false; } GraphAssembly.update(mouseWorldPos, graphRenderer.grabbedNode, graphRenderer.cameraScale); if (GraphAssembly.hoveredNode != graphRenderer.hoveredNode) { graphRenderer.hoveredNode = GraphAssembly.hoveredNode; graphRenderer.canvas.style.cursor = GraphAssembly.hoveredNode == -1 ? "default" : "pointer"; } graphRenderer.autoResizeCanvas(); graphRenderer.draw(GraphAssembly.positions); averageFPS = averageFPS * 0.95 + pixiApp.ticker.FPS * 0.05; if (averageFPS < targetFPS * 0.8 && batchFraction > minBatchFraction) { batchFraction = Math.max(batchFraction - 0.5 * 1/targetFPS, minBatchFraction); GraphAssembly.batchFraction = batchFraction; GraphAssembly.repulsionForce = graphData.graphOptions.repulsionForce / batchFraction; } if (averageFPS > targetFPS * 1.2 && batchFraction < 1) { batchFraction = Math.min(batchFraction + 0.5 * 1/targetFPS, 1); GraphAssembly.batchFraction = batchFraction; GraphAssembly.repulsionForce = graphData.graphOptions.repulsionForce / batchFraction; } if (scrollVelocity != 0) { let cameraCenter = graphRenderer.getCameraCenterWorldspace(); if (Math.abs(scrollVelocity) < 0.001) { scrollVelocity = 0; } zoomGraphViewAroundPoint(mouseWorldPos, scrollVelocity); scrollVelocity *= 0.65; } } function zoomGraphViewAroundPoint(point, zoom, minScale = 0.15, maxScale = 15.0) { let cameraCenter = graphRenderer.getCameraCenterWorldspace(); graphRenderer.cameraScale = Math.max(Math.min(graphRenderer.cameraScale + zoom * graphRenderer.cameraScale, maxScale), minScale); if(graphRenderer.cameraScale != minScale && graphRenderer.cameraScale != maxScale && scrollVelocity > 0 && mouseWorldPos.x != undefined && mouseWorldPos.y != undefined) { let aroundDiff = {x: point.x - cameraCenter.x, y: point.y - cameraCenter.y}; let movePos = {x: cameraCenter.x + aroundDiff.x * zoom, y: cameraCenter.y + aroundDiff.y * zoom}; graphRenderer.setCameraCenterWorldspace(movePos); } else graphRenderer.setCameraCenterWorldspace(cameraCenter); } function scaleGraphViewAroundPoint(point, scale, minScale = 0.15, maxScale = 15.0) { let cameraCenter = graphRenderer.getCameraCenterWorldspace(); let scaleBefore = graphRenderer.cameraScale; graphRenderer.cameraScale = Math.max(Math.min(scale * graphRenderer.cameraScale, maxScale), minScale); let diff = (scaleBefore - graphRenderer.cameraScale) / scaleBefore; if(graphRenderer.cameraScale != minScale && graphRenderer.cameraScale != maxScale && scale != 0) { let aroundDiff = {x: point.x - cameraCenter.x, y: point.y - cameraCenter.y}; let movePos = {x: cameraCenter.x - aroundDiff.x * diff, y: cameraCenter.y - aroundDiff.y * diff}; graphRenderer.setCameraCenterWorldspace(movePos); } else graphRenderer.setCameraCenterWorldspace(cameraCenter); } function initializeGraphEvents() { window.addEventListener('beforeunload', () => { running = false; GraphAssembly.free(); }); let graphExpanded = false; let lastCanvasWidth = graphRenderer.canvas.width; window.addEventListener('resize', () => { if(graphExpanded) { graphRenderer.autoResizeCanvas(); graphRenderer.centerCamera(); } else { if (graphRenderer.canvas.width != lastCanvasWidth) { graphRenderer.autoResizeCanvas(); graphRenderer.centerCamera(); } } }); let container = document.querySelector(".graph-view-container"); function handleOutsideClick(event) { if (event.composedPath().includes(container)) { return; } toggleExpandedGraph(); } function toggleExpandedGraph() { let initialWidth = container.clientWidth; let initialHeight = container.clientHeight; // scale and fade out animation: container.classList.add("scale-down"); let fadeOutAnimation = container.animate({ opacity: 0 }, {duration: 100, easing: "ease-in", fill: "forwards"}); fadeOutAnimation.addEventListener("finish", function() { container.classList.toggle("expanded"); graphRenderer.autoResizeCanvas(); graphRenderer.centerCamera(); let finalWidth = container.clientWidth; let finalHeight = container.clientHeight; graphRenderer.cameraScale *= ((finalWidth / initialWidth) + (finalHeight / initialHeight)) / 2; container.classList.remove("scale-down"); container.classList.add("scale-up"); updateGraph(); let fadeInAnimation = container.animate({ opacity: 1 }, {duration: 200, easing: "ease-out", fill: "forwards"}); fadeInAnimation.addEventListener("finish", function() { container.classList.remove("scale-up"); }); }); graphExpanded = !graphExpanded; if (graphExpanded) document.addEventListener("pointerdown", handleOutsideClick); else document.removeEventListener("pointerdown", handleOutsideClick); } async function navigateToNode(nodeIndex) { if (!graphExpanded) GraphAssembly.saveState(graphRenderer); else toggleExpandedGraph(); let url = graphData.paths[nodeIndex]; if(window.location.pathname.endsWith(graphData.paths[nodeIndex])) return; await loadDocument(url, true, true); } // Get the mouse position relative to the canvas. function getPointerPosOnCanvas(event) { var rect = graphRenderer.canvas.getBoundingClientRect(); let pos = getPointerPosition(event); return { x: pos.x - rect.left, y: pos.y - rect.top }; } let startPointerPos = { x: 0, y: 0 }; let pointerPos = { x: 0, y: 0 }; let lastPointerPos = { x: 0, y: 0 }; let pointerDelta = { x: 0, y: 0 }; let dragDisplacement = { x: 0, y: 0 }; let startDragTime = 0; let pointerDown = false; let middleDown = false; let pointerInside = false; let graphContainer = document.querySelector(".graph-view-container"); let firstPointerDownId = -1; function handlePointerEnter(enter) { let lastDistance = 0; let startZoom = false; function handleMouseMove(move) { pointerPos = getPointerPosOnCanvas(move); mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); pointerDelta = { x: pointerPos.x - lastPointerPos.x, y: pointerPos.y - lastPointerPos.y }; lastPointerPos = pointerPos; if (graphRenderer.grabbedNode != -1) dragDisplacement = { x: pointerPos.x - startPointerPos.x, y: pointerPos.y - startPointerPos.y }; if (pointerDown && graphRenderer.hoveredNode != -1 && graphRenderer.grabbedNode == -1 && graphRenderer.hoveredNode != graphRenderer.grabbedNode) { graphRenderer.grabbedNode = graphRenderer.hoveredNode; } if ((pointerDown && graphRenderer.hoveredNode == -1 && graphRenderer.grabbedNode == -1) || middleDown) { graphRenderer.cameraOffset = { x: graphRenderer.cameraOffset.x + pointerDelta.x, y: graphRenderer.cameraOffset.y + pointerDelta.y }; } else { if (graphRenderer.hoveredNode != -1) graphRenderer.canvas.style.cursor = "pointer"; else graphRenderer.canvas.style.cursor = "default"; } } function handleTouchMove(move) { if (move.touches?.length == 1) { if(startZoom) { lastPointerPos = getPointerPosOnCanvas(move); startZoom = false; } handleMouseMove(move); return; } // pinch zoom if (move.touches?.length == 2) { let touch1 = getTouchPosition(move.touches[0]); let touch2 = getTouchPosition(move.touches[1]); pointerPos = getPointerPosOnCanvas(move); pointerDelta = { x: pointerPos.x - lastPointerPos.x, y: pointerPos.y - lastPointerPos.y }; lastPointerPos = pointerPos; let distance = Math.sqrt(Math.pow(touch1.x - touch2.x, 2) + Math.pow(touch1.y - touch2.y, 2)); if (!startZoom) { startZoom = true; lastDistance = distance; pointerDelta = { x: 0, y: 0 }; mouseWorldPos = { x: undefined, y: undefined}; graphRenderer.grabbedNode = -1; graphRenderer.hoveredNode = -1; } let distanceDelta = distance - lastDistance; let scaleDelta = distanceDelta / lastDistance; scaleGraphViewAroundPoint(graphRenderer.vecToWorldspace(pointerPos), 1 + scaleDelta, 0.15, 15.0); graphRenderer.cameraOffset = { x: graphRenderer.cameraOffset.x + pointerDelta.x, y: graphRenderer.cameraOffset.y + pointerDelta.y }; lastDistance = distance; } } function handlePointerUp(up) { document.removeEventListener("pointerup", handlePointerUp); let pointerUpTime = Date.now(); setTimeout(() => { if (pointerDown && graphRenderer.hoveredNode != -1 && Math.abs(dragDisplacement.x) <= 4 && Math.abs(dragDisplacement.y) <= 4 && pointerUpTime - startDragTime < 300) { navigateToNode(graphRenderer.hoveredNode); } if (pointerDown && graphRenderer.grabbedNode != -1) { graphRenderer.grabbedNode = -1; } if (up.button == 0) pointerDown = false; if (up.pointerType == "touch" && firstPointerDownId == up.pointerId) { firstPointerDownId = -1; pointerDown = false; } if (up.button == 1) middleDown = false; if (!pointerInside) { document.removeEventListener("mousemove", handleMouseMove); document.removeEventListener("touchmove", handleTouchMove); } }, 0); } function handlePointerDown(down) { document.addEventListener("pointerup", handlePointerUp); mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); dragDisplacement = { x: 0, y: 0 }; if (down.button == 0) pointerDown = true; if (down.pointerType == "touch" && firstPointerDownId == -1) { firstPointerDownId = down.pointerId; pointerDown = true; } if (down.button == 1) middleDown = true; startPointerPos = pointerPos; startDragTime = Date.now(); if (pointerDown && graphRenderer.hoveredNode != -1) { graphRenderer.grabbedNode = graphRenderer.hoveredNode; } } function handlePointerLeave(leave) { setTimeout(() => { pointerInside = false; if (!pointerDown) { document.removeEventListener("mousemove", handleMouseMove); document.removeEventListener("touchmove", handleTouchMove); mouseWorldPos = { x: undefined, y: undefined }; } graphContainer.removeEventListener("pointerdown", handlePointerDown); graphContainer.removeEventListener("pointerleave", handlePointerLeave); }, 1); } pointerPos = getPointerPosOnCanvas(enter); mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); lastPointerPos = getPointerPosOnCanvas(enter); pointerInside = true; document.addEventListener("mousemove", handleMouseMove); document.addEventListener("touchmove", handleTouchMove); graphContainer.addEventListener("pointerdown", handlePointerDown); graphContainer.addEventListener("pointerleave", handlePointerLeave); } graphContainer.addEventListener("pointerenter", handlePointerEnter); document.querySelector(".graph-expand.graph-icon")?.addEventListener("click", event => { event.stopPropagation(); toggleExpandedGraph(); }); graphContainer.addEventListener("wheel", function(e) { let startingScrollVelocity = 0.09; let delta = e.deltaY; if (delta > 0) { if(scrollVelocity >= -startingScrollVelocity) { scrollVelocity = -startingScrollVelocity; } scrollVelocity *= 1.4; } else { if(scrollVelocity <= startingScrollVelocity) { scrollVelocity = startingScrollVelocity; } scrollVelocity *= 1.4; } }); // recenter the graph on double click graphContainer.addEventListener("dblclick", function(e) { graphRenderer.fitToNodes(); }); document.querySelector(".theme-toggle-input")?.addEventListener("change", event => { setTimeout(() => graphRenderer.resampleColors(), 0); }); } window.addEventListener("load", () => { waitLoadScripts(["pixi", "graph-data", "graph-render-worker", "graph-wasm"], () => { Module['onRuntimeInitialized'] = initializeGraphView; setTimeout(() => Module['onRuntimeInitialized'](), 300); }); }); `; // assets/graph-wasm.txt.js var graph_wasm_txt_default = ` // Wasm glue var Module = typeof Module != "undefined" ? Module : {}; var moduleOverrides = Object.assign({}, Module); var arguments_ = []; var thisProgram = "./this.program"; var quit_ = (status,toThrow)=>{ throw toThrow } ; var ENVIRONMENT_IS_WEB = typeof window == "object"; var ENVIRONMENT_IS_WORKER = typeof importScripts == "function"; var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string"; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory) } return scriptDirectory + path } var read_, readAsync, readBinary, setWindowTitle; if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); var nodePath = require("path"); if (ENVIRONMENT_IS_WORKER) { scriptDirectory = nodePath.dirname(scriptDirectory) + "/" } else { scriptDirectory = __dirname + "/" } read_ = (filename,binary)=>{ filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); return fs.readFileSync(filename, binary ? undefined : "utf8") } ; readBinary = filename=>{ var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret) } return ret } ; readAsync = (filename,onload,onerror)=>{ filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); fs.readFile(filename, function(err, data) { if (err) onerror(err); else onload(data.buffer) }) } ; if (!Module["thisProgram"] && process.argv.length > 1) { thisProgram = process.argv[1].replace(/\\\\/g, "/") } arguments_ = process.argv.slice(2); if (typeof module != "undefined") { module["exports"] = Module } process.on("uncaughtException", function(ex) { if (ex !== "unwind" && !(ex instanceof ExitStatus) && !(ex.context instanceof ExitStatus)) { throw ex } }); var nodeMajor = process.versions.node.split(".")[0]; if (nodeMajor < 15) { process.on("unhandledRejection", function(reason) { throw reason }) } quit_ = (status,toThrow)=>{ process.exitCode = status; throw toThrow } ; Module["inspect"] = function() { return "[Emscripten Module object]" } } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { if (ENVIRONMENT_IS_WORKER) { scriptDirectory = self.location.href } else if (typeof document != "undefined" && document.currentScript) { scriptDirectory = document.currentScript.src } if (scriptDirectory.indexOf("blob:") !== 0) { scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1) } else { scriptDirectory = "" } { read_ = url=>{ var xhr = new XMLHttpRequest; xhr.open("GET", url, false); xhr.send(null); return xhr.responseText } ; if (ENVIRONMENT_IS_WORKER) { readBinary = url=>{ var xhr = new XMLHttpRequest; xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response) } } readAsync = (url,onload,onerror)=>{ var xhr = new XMLHttpRequest; xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = ()=>{ if (xhr.status == 200 || xhr.status == 0 && xhr.response) { onload(xhr.response); return } onerror() } ; xhr.onerror = onerror; xhr.send(null) } } setWindowTitle = title=>document.title = title } else {} var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.warn.bind(console); Object.assign(Module, moduleOverrides); moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; if (Module["quit"]) quit_ = Module["quit"]; var wasmBinary; if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; var noExitRuntime = Module["noExitRuntime"] || true; if (typeof WebAssembly != "object") { abort("no native wasm support detected") } var wasmMemory; var ABORT = false; var EXITSTATUS; var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateMemoryViews() { var b = wasmMemory.buffer; Module["HEAP8"] = HEAP8 = new Int8Array(b); Module["HEAP16"] = HEAP16 = new Int16Array(b); Module["HEAP32"] = HEAP32 = new Int32Array(b); Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); Module["HEAPF32"] = HEAPF32 = new Float32Array(b); Module["HEAPF64"] = HEAPF64 = new Float64Array(b) } var wasmTable; var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATPOSTRUN__ = []; var runtimeInitialized = false; function preRun() { if (Module["preRun"]) { if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; while (Module["preRun"].length) { addOnPreRun(Module["preRun"].shift()) } } callRuntimeCallbacks(__ATPRERUN__) } function initRuntime() { runtimeInitialized = true; callRuntimeCallbacks(__ATINIT__) } function postRun() { if (Module["postRun"]) { if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; while (Module["postRun"].length) { addOnPostRun(Module["postRun"].shift()) } } callRuntimeCallbacks(__ATPOSTRUN__) } function addOnPreRun(cb) { __ATPRERUN__.unshift(cb) } function addOnInit(cb) { __ATINIT__.unshift(cb) } function addOnPostRun(cb) { __ATPOSTRUN__.unshift(cb) } var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies) } } function removeRunDependency(id) { runDependencies--; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies) } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); runDependencyWatcher = null } if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback() } } } function abort(what) { if (Module["onAbort"]) { Module["onAbort"](what) } what = "Aborted(" + what + ")"; err(what); ABORT = true; EXITSTATUS = 1; what += ". Build with -sASSERTIONS for more info."; var e = new WebAssembly.RuntimeError(what); throw e } var dataURIPrefix = "data:application/octet-stream;base64,"; function isDataURI(filename) { return filename.startsWith(dataURIPrefix) } function isFileURI(filename) { return filename.startsWith("file://") } var wasmBinaryFile; wasmBinaryFile = "graph-wasm.wasm"; if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile) } function getBinary(file) { try { if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary) } if (readBinary) { return readBinary(file) } throw "both async and sync fetching of the wasm failed" } catch (err) { abort(err) } } function getBinaryPromise(binaryFile) { if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) { if (typeof fetch == "function" && !isFileURI(binaryFile)) { return fetch(binaryFile, { credentials: "same-origin" }).then(function(response) { if (!response["ok"]) { throw "failed to load wasm binary file at '" + binaryFile + "'" } return response["arrayBuffer"]() }).catch(function() { return getBinary(binaryFile) }) } else { if (readAsync) { return new Promise(function(resolve, reject) { readAsync(binaryFile, function(response) { resolve(new Uint8Array(response)) }, reject) } ) } } } return Promise.resolve().then(function() { return getBinary(binaryFile) }) } function instantiateArrayBuffer(binaryFile, imports, receiver) { return getBinaryPromise(binaryFile).then(function(binary) { return WebAssembly.instantiate(binary, imports) }).then(function(instance) { return instance }).then(receiver, function(reason) { err("failed to asynchronously prepare wasm: " + reason); abort(reason) }) } function instantiateAsync(binary, binaryFile, imports, callback) { if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE && typeof fetch == "function") { return fetch(binaryFile, { credentials: "same-origin" }).then(function(response) { let responseClone = new Response(response.body, { headers: new Headers({"Content-Type": "application/wasm"}) }); var result = WebAssembly.instantiateStreaming(responseClone, imports); return result.then(callback, function(reason) { err("wasm streaming compile failed: " + reason); err("falling back to ArrayBuffer instantiation"); return instantiateArrayBuffer(binaryFile, imports, callback) }) }) } else { return instantiateArrayBuffer(binaryFile, imports, callback) } } function createWasm() { var info = { "a": wasmImports }; function receiveInstance(instance, module) { var exports = instance.exports; Module["asm"] = exports; wasmMemory = Module["asm"]["f"]; updateMemoryViews(); wasmTable = Module["asm"]["r"]; addOnInit(Module["asm"]["g"]); removeRunDependency("wasm-instantiate"); return exports } addRunDependency("wasm-instantiate"); function receiveInstantiationResult(result) { receiveInstance(result["instance"]) } if (Module["instantiateWasm"]) { try { return Module["instantiateWasm"](info, receiveInstance) } catch (e) { err("Module.instantiateWasm callback failed with error: " + e); return false } } instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult); return {} } var tempDouble; var tempI64; var ASM_CONSTS = { 2304: $0=>{ console.log(UTF8ToString($0)) } }; function ExitStatus(status) { this.name = "ExitStatus"; this.message = "Program terminated with exit(" + status + ")"; this.status = status } function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { callbacks.shift()(Module) } } function getValue(ptr, type="i8") { if (type.endsWith("*")) type = "*"; switch (type) { case "i1": return HEAP8[ptr >> 0]; case "i8": return HEAP8[ptr >> 0]; case "i16": return HEAP16[ptr >> 1]; case "i32": return HEAP32[ptr >> 2]; case "i64": return HEAP32[ptr >> 2]; case "float": return HEAPF32[ptr >> 2]; case "double": return HEAPF64[ptr >> 3]; case "*": return HEAPU32[ptr >> 2]; default: abort("invalid type for getValue: " + type) } } function setValue(ptr, value, type="i8") { if (type.endsWith("*")) type = "*"; switch (type) { case "i1": HEAP8[ptr >> 0] = value; break; case "i8": HEAP8[ptr >> 0] = value; break; case "i16": HEAP16[ptr >> 1] = value; break; case "i32": HEAP32[ptr >> 2] = value; break; case "i64": tempI64 = [value >>> 0, (tempDouble = value, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[ptr >> 2] = tempI64[0], HEAP32[ptr + 4 >> 2] = tempI64[1]; break; case "float": HEAPF32[ptr >> 2] = value; break; case "double": HEAPF64[ptr >> 3] = value; break; case "*": HEAPU32[ptr >> 2] = value; break; default: abort("invalid type for setValue: " + type) } } function _abort() { abort("") } var readEmAsmArgsArray = []; function readEmAsmArgs(sigPtr, buf) { readEmAsmArgsArray.length = 0; var ch; buf >>= 2; while (ch = HEAPU8[sigPtr++]) { buf += ch != 105 & buf; readEmAsmArgsArray.push(ch == 105 ? HEAP32[buf] : HEAPF64[buf++ >> 1]); ++buf } return readEmAsmArgsArray } function runEmAsmFunction(code, sigPtr, argbuf) { var args = readEmAsmArgs(sigPtr, argbuf); return ASM_CONSTS[code].apply(null, args) } function _emscripten_asm_const_int(code, sigPtr, argbuf) { return runEmAsmFunction(code, sigPtr, argbuf) } function _emscripten_date_now() { return Date.now() } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest, src, src + num) } function getHeapMax() { return 2147483648 } function emscripten_realloc_buffer(size) { var b = wasmMemory.buffer; try { wasmMemory.grow(size - b.byteLength + 65535 >>> 16); updateMemoryViews(); return 1 } catch (e) {} } function _emscripten_resize_heap(requestedSize) { var oldSize = HEAPU8.length; requestedSize = requestedSize >>> 0; var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { return false } let alignUp = (x,multiple)=>x + (multiple - x % multiple) % multiple; for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { var overGrownHeapSize = oldSize * (1 + .2 / cutDown); overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)); var replacement = emscripten_realloc_buffer(newSize); if (replacement) { return true } } return false } function getCFunc(ident) { var func = Module["_" + ident]; return func } function writeArrayToMemory(array, buffer) { HEAP8.set(array, buffer) } function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var c = str.charCodeAt(i); if (c <= 127) { len++ } else if (c <= 2047) { len += 2 } else if (c >= 55296 && c <= 57343) { len += 4; ++i } else { len += 3 } } return len } function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { if (!(maxBytesToWrite > 0)) return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; for (var i = 0; i < str.length; ++i) { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) { var u1 = str.charCodeAt(++i); u = 65536 + ((u & 1023) << 10) | u1 & 1023 } if (u <= 127) { if (outIdx >= endIdx) break; heap[outIdx++] = u } else if (u <= 2047) { if (outIdx + 1 >= endIdx) break; heap[outIdx++] = 192 | u >> 6; heap[outIdx++] = 128 | u & 63 } else if (u <= 65535) { if (outIdx + 2 >= endIdx) break; heap[outIdx++] = 224 | u >> 12; heap[outIdx++] = 128 | u >> 6 & 63; heap[outIdx++] = 128 | u & 63 } else { if (outIdx + 3 >= endIdx) break; heap[outIdx++] = 240 | u >> 18; heap[outIdx++] = 128 | u >> 12 & 63; heap[outIdx++] = 128 | u >> 6 & 63; heap[outIdx++] = 128 | u & 63 } } heap[outIdx] = 0; return outIdx - startIdx } function stringToUTF8(str, outPtr, maxBytesToWrite) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) } function stringToUTF8OnStack(str) { var size = lengthBytesUTF8(str) + 1; var ret = stackAlloc(size); stringToUTF8(str, ret, size); return ret } var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) { var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)) } var str = ""; while (idx < endPtr) { var u0 = heapOrArray[idx++]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue } var u1 = heapOrArray[idx++] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue } var u2 = heapOrArray[idx++] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2 } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63 } if (u0 < 65536) { str += String.fromCharCode(u0) } else { var ch = u0 - 65536; str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) } } return str } function UTF8ToString(ptr, maxBytesToRead) { return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" } function ccall(ident, returnType, argTypes, args, opts) { var toC = { "string": str=>{ var ret = 0; if (str !== null && str !== undefined && str !== 0) { ret = stringToUTF8OnStack(str) } return ret } , "array": arr=>{ var ret = stackAlloc(arr.length); writeArrayToMemory(arr, ret); return ret } }; function convertReturnValue(ret) { if (returnType === "string") { return UTF8ToString(ret) } if (returnType === "boolean") return Boolean(ret); return ret } var func = getCFunc(ident); var cArgs = []; var stack = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]) } else { cArgs[i] = args[i] } } } var ret = func.apply(null, cArgs); function onDone(ret) { if (stack !== 0) stackRestore(stack); return convertReturnValue(ret) } ret = onDone(ret); return ret } function cwrap(ident, returnType, argTypes, opts) { var numericArgs = !argTypes || argTypes.every(type=>type === "number" || type === "boolean"); var numericRet = returnType !== "string"; if (numericRet && numericArgs && !opts) { return getCFunc(ident) } return function() { return ccall(ident, returnType, argTypes, arguments, opts) } } var wasmImports = { "b": _abort, "e": _emscripten_asm_const_int, "d": _emscripten_date_now, "c": _emscripten_memcpy_big, "a": _emscripten_resize_heap }; var asm = createWasm(); var ___wasm_call_ctors = function() { return (___wasm_call_ctors = Module["asm"]["g"]).apply(null, arguments) }; var _SetBatchFractionSize = Module["_SetBatchFractionSize"] = function() { return (_SetBatchFractionSize = Module["_SetBatchFractionSize"] = Module["asm"]["h"]).apply(null, arguments) } ; var _SetAttractionForce = Module["_SetAttractionForce"] = function() { return (_SetAttractionForce = Module["_SetAttractionForce"] = Module["asm"]["i"]).apply(null, arguments) } ; var _SetLinkLength = Module["_SetLinkLength"] = function() { return (_SetLinkLength = Module["_SetLinkLength"] = Module["asm"]["j"]).apply(null, arguments) } ; var _SetRepulsionForce = Module["_SetRepulsionForce"] = function() { return (_SetRepulsionForce = Module["_SetRepulsionForce"] = Module["asm"]["k"]).apply(null, arguments) } ; var _SetCentralForce = Module["_SetCentralForce"] = function() { return (_SetCentralForce = Module["_SetCentralForce"] = Module["asm"]["l"]).apply(null, arguments) } ; var _SetDt = Module["_SetDt"] = function() { return (_SetDt = Module["_SetDt"] = Module["asm"]["m"]).apply(null, arguments) } ; var _Init = Module["_Init"] = function() { return (_Init = Module["_Init"] = Module["asm"]["n"]).apply(null, arguments) } ; var _Update = Module["_Update"] = function() { return (_Update = Module["_Update"] = Module["asm"]["o"]).apply(null, arguments) } ; var _SetPosition = Module["_SetPosition"] = function() { return (_SetPosition = Module["_SetPosition"] = Module["asm"]["p"]).apply(null, arguments) } ; var _FreeMemory = Module["_FreeMemory"] = function() { return (_FreeMemory = Module["_FreeMemory"] = Module["asm"]["q"]).apply(null, arguments) } ; var ___errno_location = function() { return (___errno_location = Module["asm"]["__errno_location"]).apply(null, arguments) }; var _malloc = Module["_malloc"] = function() { return (_malloc = Module["_malloc"] = Module["asm"]["s"]).apply(null, arguments) } ; var _free = Module["_free"] = function() { return (_free = Module["_free"] = Module["asm"]["t"]).apply(null, arguments) } ; var stackSave = function() { return (stackSave = Module["asm"]["u"]).apply(null, arguments) }; var stackRestore = function() { return (stackRestore = Module["asm"]["v"]).apply(null, arguments) }; var stackAlloc = function() { return (stackAlloc = Module["asm"]["w"]).apply(null, arguments) }; var ___cxa_is_pointer_type = function() { return (___cxa_is_pointer_type = Module["asm"]["__cxa_is_pointer_type"]).apply(null, arguments) }; Module["cwrap"] = cwrap; Module["setValue"] = setValue; Module["getValue"] = getValue; var calledRun; dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller } ; function run() { if (runDependencies > 0) { return } preRun(); if (runDependencies > 0) { return } function doRun() { if (calledRun) return; calledRun = true; Module["calledRun"] = true; if (ABORT) return; initRuntime(); if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); postRun() } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(function() { setTimeout(function() { Module["setStatus"]("") }, 1); doRun() }, 1) } else { doRun() } } if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()() } } try { run(); } catch(e) { console.error(e); } `; // assets/graph-render-worker.txt.js var graph_render_worker_txt_default = `// Import Pixi.js library if( 'function' === typeof importScripts) { importScripts('https://d157l7jdn8e5sf.cloudfront.net/v7.2.0/webworker.js', './tinycolor.js'); addEventListener('message', onMessage); let app; let container; let graphics; isDrawing = false; let linkCount = 0; let linkSources = []; let linkTargets = []; let nodeCount = 0; let radii = []; let labels = []; let labelFade = []; let labelWidths = []; let pixiLabels = []; let cameraOffset = {x: 0, y: 0}; let positions = new Float32Array(0); let linkLength = 0; let edgePruning = 0; let colors = { background: 0x232323, link: 0xAAAAAA, node: 0xCCCCCC, outline: 0xAAAAAA, text: 0xFFFFFF, accent: 0x4023AA } let hoveredNode = -1; let lastHoveredNode = -1; let grabbedNode = -1; let updateAttached = false; let attachedToGrabbed = []; let activeNode = -1; let attachedToActive = []; let cameraScale = 1; let cameraScaleRoot = 1; function toScreenSpace(x, y, floor = true) { if (floor) { return {x: Math.floor((x * cameraScale) + cameraOffset.x), y: Math.floor((y * cameraScale) + cameraOffset.y)}; } else { return {x: (x * cameraScale) + cameraOffset.x, y: (y * cameraScale) + cameraOffset.y}; } } function vecToScreenSpace({x, y}, floor = true) { return toScreenSpace(x, y, floor); } function toWorldspace(x, y) { return {x: (x - cameraOffset.x) / cameraScale, y: (y - cameraOffset.y) / cameraScale}; } function vecToWorldspace({x, y}) { return toWorldspace(x, y); } function setCameraCenterWorldspace({x, y}) { cameraOffset.x = (canvas.width / 2) - (x * cameraScale); cameraOffset.y = (canvas.height / 2) - (y * cameraScale); } function getCameraCenterWorldspace() { return toWorldspace(canvas.width / 2, canvas.height / 2); } function getNodeScreenRadius(radius) { return radius * cameraScaleRoot; } function getNodeWorldspaceRadius(radius) { return radius / cameraScaleRoot; } function getPosition(index) { return {x: positions[index * 2], y: positions[index * 2 + 1]}; } function mixColors(hexStart, hexEnd, factor) { return tinycolor.mix(tinycolor(hexStart.toString(16)), tinycolor(hexEnd.toString(16)), factor).toHexNumber() } function darkenColor(hexColor, factor) { return tinycolor(hexColor.toString(16)).darken(factor).toHexNumber(); } function lightenColor(hexColor, factor) { return tinycolor(hexColor.toString(16)).lighten(factor).toHexNumber(); } function invertColor(hex, bw) { hex = hex.toString(16); // force conversion // fill extra space up to 6 characters with 0 while (hex.length < 6) hex = "0" + hex; if (hex.indexOf('#') === 0) { hex = hex.slice(1); } // convert 3-digit hex to 6-digits. if (hex.length === 3) { hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } if (hex.length !== 6) { throw new Error('Invalid HEX color:' + hex); } var r = parseInt(hex.slice(0, 2), 16), g = parseInt(hex.slice(2, 4), 16), b = parseInt(hex.slice(4, 6), 16); if (bw) { // https://stackoverflow.com/a/3943023/112731 return (r * 0.299 + g * 0.587 + b * 0.114) > 186 ? '#000000' : '#FFFFFF'; } // invert color components r = (255 - r).toString(16); g = (255 - g).toString(16); b = (255 - b).toString(16); // pad each with zeros and return return "#" + padZero(r) + padZero(g) + padZero(b); } function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } function lerp(a, b, t) { return a + (b - a) * t; } let hoverFade = 0; let hoverFadeSpeed = 0.2; let hoverFontSize = 15; let normalFontSize = 12; let fontRatio = hoverFontSize / normalFontSize; function showLabel(index, fade, hovered = false) { let label = pixiLabels[index]; if (!label) return; labelFade[index] = fade; if(fade > 0.01) label.visible = true; else { hideLabel(index); return; } if (hovered) label.style.fontSize = hoverFontSize; else label.style.fontSize = normalFontSize; let nodePos = vecToScreenSpace(getPosition(index)); let width = (labelWidths[index] * (hovered ? fontRatio : 1)) / 2; label.x = nodePos.x - width; label.y = nodePos.y + getNodeScreenRadius(radii[index]) + 9; label.alpha = fade; } function hideLabel(index) { let label = pixiLabels[index]; label.visible = false; } function draw() { graphics.clear(); let topLines = []; if (updateAttached) { attachedToGrabbed = []; // hoverFade = 0; } if (hoveredNode != -1 || grabbedNode != -1) { hoverFade = Math.min(1, hoverFade + hoverFadeSpeed); } else { hoverFade = Math.max(0, hoverFade - hoverFadeSpeed); } graphics.lineStyle(1, mixColors(colors.link, colors.background, hoverFade * 50), 0.7); for (let i = 0; i < linkCount; i++) { let target = linkTargets[i]; let source = linkSources[i]; if (hoveredNode == source || hoveredNode == target || ((lastHoveredNode == source || lastHoveredNode == target) && hoverFade != 0)) { if (updateAttached && hoveredNode == source) attachedToGrabbed.push(target); else if (updateAttached && hoveredNode == target) attachedToGrabbed.push(source); topLines.push(i); } let startWorld = getPosition(source); let endWorld = getPosition(target); let start = vecToScreenSpace(startWorld); let end = vecToScreenSpace(endWorld); let dist = Math.sqrt(Math.pow(startWorld.x - endWorld.x, 2) + Math.pow(startWorld.y - endWorld.y, 2)); if (dist < (radii[source] + radii[target]) * edgePruning) { graphics.moveTo(start.x, start.y); graphics.lineTo(end.x, end.y); } } let opacity = 1 - (hoverFade * 0.5); graphics.beginFill(mixColors(colors.node, colors.background, hoverFade * 50), opacity); graphics.lineStyle(0, 0xffffff); for (let i = 0; i < nodeCount; i++) { let screenRadius = getNodeScreenRadius(radii[i]); if (hoveredNode != i) { if (screenRadius > 2) { let labelFade = lerp(0, (screenRadius - 4) / 8 - (1/cameraScaleRoot)/6 * 0.9, Math.max(1 - hoverFade, 0.2)); showLabel(i, labelFade); } else { hideLabel(i); } } if (hoveredNode == i || (lastHoveredNode == i && hoverFade != 0) || (hoveredNode != -1 && attachedToGrabbed.includes(i))) continue; let pos = vecToScreenSpace(getPosition(i)); graphics.drawCircle(pos.x, pos.y, screenRadius); } graphics.endFill(); opacity = hoverFade * 0.7; graphics.lineStyle(1, mixColors(mixColors(colors.link, colors.accent, hoverFade * 100), colors.background, 20), opacity); for (let i = 0; i < topLines.length; i++) { let target = linkTargets[topLines[i]]; let source = linkSources[topLines[i]]; // draw lines on top when hovered let start = vecToScreenSpace(getPosition(source)); let end = vecToScreenSpace(getPosition(target)); graphics.moveTo(start.x, start.y); graphics.lineTo(end.x, end.y); } if(hoveredNode != -1 || (lastHoveredNode != -1 && hoverFade != 0)) { graphics.beginFill(mixColors(colors.node, colors.accent, hoverFade * 20), 0.9); graphics.lineStyle(0, 0xffffff); for (let i = 0; i < attachedToGrabbed.length; i++) { let point = attachedToGrabbed[i]; let pos = vecToScreenSpace(getPosition(point)); graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[point])); showLabel(point, Math.max(hoverFade * 0.6, labelFade[point])); } graphics.endFill(); let index = hoveredNode != -1 ? hoveredNode : lastHoveredNode; let pos = vecToScreenSpace(getPosition(index)); graphics.beginFill(mixColors(colors.node, colors.accent, hoverFade * 100), 1); graphics.lineStyle(hoverFade, mixColors(invertColor(colors.background, true), colors.accent, 50)); graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[index])); graphics.endFill(); showLabel(index, Math.max(hoverFade, labelFade[index]), true); } updateAttached = false; graphics.lineStyle(2, colors.accent); // draw the active node if (activeNode != -1) { let pos = vecToScreenSpace(getPosition(activeNode)); graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[activeNode]) + 4); } } function onMessage(event) { if(event.data.type == "draw") { positions = new Float32Array(event.data.positions); draw(); } else if(event.data.type == "update_camera") { cameraOffset = event.data.cameraOffset; cameraScale = event.data.cameraScale; cameraScaleRoot = Math.sqrt(cameraScale); } else if(event.data.type == "update_interaction") { if(hoveredNode != event.data.hoveredNode && event.data.hoveredNode != -1) updateAttached = true; if(grabbedNode != event.data.grabbedNode && event.data.hoveredNode != -1) updateAttached = true; if(event.data.hoveredNode == -1) lastHoveredNode = hoveredNode; else lastHoveredNode = -1; hoveredNode = event.data.hoveredNode; grabbedNode = event.data.grabbedNode; } else if(event.data.type == "resize") { app.renderer.resize(event.data.width, event.data.height); } else if(event.data.type == "set_active") { activeNode = event.data.active; } else if(event.data.type == "update_colors") { colors = event.data.colors; for (let label of pixiLabels) { label.style.fill = invertColor(colors.background, true); } } else if(event.data.type == "init") { // Extract data from message linkCount = event.data.linkCount; linkSources = event.data.linkSources; linkTargets = event.data.linkTargets; nodeCount = event.data.nodeCount; radii = event.data.radii; labels = event.data.labels; linkLength = event.data.linkLength; edgePruning = event.data.edgePruning; app = new PIXI.Application({... event.data.options, antialias: true, resolution: 2, backgroundAlpha: 0, transparent: true}); container = new PIXI.Container(); graphics = new PIXI.Graphics(); app.stage.addChild(container); container.addChild(graphics); pixiLabels = []; for (let i = 0; i < nodeCount; i++) { let label = new PIXI.Text(labels[i], {fontFamily : 'Arial', fontSize: 12, fontWeight: "normal", fill : invertColor(colors.background, true), align : 'center', anchor: 0.5}); pixiLabels.push(label); labelWidths.push(label.width); labelFade.push(0); app.stage.addChild(label); } } else { console.log("Unknown message type sent to graph worker: " + event.data.type); } } } `; // assets/graph-wasm.wasm var graph_wasm_default = __toBinary("AGFzbQEAAAABexNgAX8Bf2ADf39/AX9gAX8AYAF9AGADf39/AGAFf39/f38AYAR/f39/AGAGf39/f39/AGAAAGACf38Bf2AAAXxgAn5/AX9gBX9/f39/AX9gAnx/AXxgAn9/AGAAAX9gA399fQBgBH19f30Bf2AMf39/f39/fX19fX19AAIfBQFhAWEAAAFhAWIACAFhAWMABAFhAWQACgFhAWUAAQMxMAIEBQEACwEABAIIAAYEAgkEAAwNDgACAgIPBwcFBQYGCQEAAQgQERIDAwMDAwMCAAQFAXABDw8FBwEBgAKAgAIGCAF/AUHwmAQLB0kSAWYCAAFnAA8BaAAyAWkAMQFqADABawAvAWwALgFtAC0BbgAsAW8AKwFwACoBcQApAXIBAAFzABABdAAFAXUAHgF2AB0BdwA0CRQBAEEBCw4zKCcTHBwmHyEkEyAiIwqIqwEwywsBB38CQCAARQ0AIABBCGsiAiAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAIgAigCACIBayICQbgSKAIASQ0BIAAgAWohAEG8EigCACACRwRAIAFB/wFNBEAgAUEDdiEBIAIoAgwiAyACKAIIIgRGBEBBqBJBqBIoAgBBfiABd3E2AgAMAwsgBCADNgIMIAMgBDYCCAwCCyACKAIYIQYCQCACIAIoAgwiAUcEQCACKAIIIgMgATYCDCABIAM2AggMAQsCQCACQRRqIgQoAgAiAw0AIAJBEGoiBCgCACIDDQBBACEBDAELA0AgBCEHIAMiAUEUaiIEKAIAIgMNACABQRBqIQQgASgCECIDDQALIAdBADYCAAsgBkUNAQJAIAIoAhwiBEECdEHYFGoiAygCACACRgRAIAMgATYCACABDQFBrBJBrBIoAgBBfiAEd3E2AgAMAwsgBkEQQRQgBigCECACRhtqIAE2AgAgAUUNAgsgASAGNgIYIAIoAhAiAwRAIAEgAzYCECADIAE2AhgLIAIoAhQiA0UNASABIAM2AhQgAyABNgIYDAELIAUoAgQiAUEDcUEDRw0AQbASIAA2AgAgBSABQX5xNgIEIAIgAEEBcjYCBCAAIAJqIAA2AgAPCyACIAVPDQAgBSgCBCIBQQFxRQ0AAkAgAUECcUUEQEHAEigCACAFRgRAQcASIAI2AgBBtBJBtBIoAgAgAGoiADYCACACIABBAXI2AgQgAkG8EigCAEcNA0GwEkEANgIAQbwSQQA2AgAPC0G8EigCACAFRgRAQbwSIAI2AgBBsBJBsBIoAgAgAGoiADYCACACIABBAXI2AgQgACACaiAANgIADwsgAUF4cSAAaiEAAkAgAUH/AU0EQCABQQN2IQEgBSgCDCIDIAUoAggiBEYEQEGoEkGoEigCAEF+IAF3cTYCAAwCCyAEIAM2AgwgAyAENgIIDAELIAUoAhghBgJAIAUgBSgCDCIBRwRAQbgSKAIAGiAFKAIIIgMgATYCDCABIAM2AggMAQsCQCAFQRRqIgQoAgAiAw0AIAVBEGoiBCgCACIDDQBBACEBDAELA0AgBCEHIAMiAUEUaiIEKAIAIgMNACABQRBqIQQgASgCECIDDQALIAdBADYCAAsgBkUNAAJAIAUoAhwiBEECdEHYFGoiAygCACAFRgRAIAMgATYCACABDQFBrBJBrBIoAgBBfiAEd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAE2AgAgAUUNAQsgASAGNgIYIAUoAhAiAwRAIAEgAzYCECADIAE2AhgLIAUoAhQiA0UNACABIAM2AhQgAyABNgIYCyACIABBAXI2AgQgACACaiAANgIAIAJBvBIoAgBHDQFBsBIgADYCAA8LIAUgAUF+cTYCBCACIABBAXI2AgQgACACaiAANgIACyAAQf8BTQRAIABBeHFB0BJqIQECf0GoEigCACIDQQEgAEEDdnQiAHFFBEBBqBIgACADcjYCACABDAELIAEoAggLIQAgASACNgIIIAAgAjYCDCACIAE2AgwgAiAANgIIDwtBHyEEIABB////B00EQCAAQSYgAEEIdmciAWt2QQFxIAFBAXRrQT5qIQQLIAIgBDYCHCACQgA3AhAgBEECdEHYFGohBwJAAkACQEGsEigCACIDQQEgBHQiAXFFBEBBrBIgASADcjYCACAHIAI2AgAgAiAHNgIYDAELIABBGSAEQQF2a0EAIARBH0cbdCEEIAcoAgAhAQNAIAEiAygCBEF4cSAARg0CIARBHXYhASAEQQF0IQQgAyABQQRxaiIHQRBqKAIAIgENAAsgByACNgIQIAIgAzYCGAsgAiACNgIMIAIgAjYCCAwBCyADKAIIIgAgAjYCDCADIAI2AgggAkEANgIYIAIgAzYCDCACIAA2AggLQcgSQcgSKAIAQQFrIgBBfyAAGzYCAAsLvQEBA38gAC0AAEEgcUUEQAJAIAEhAwJAIAIgACIBKAIQIgAEfyAABSABEBoNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAQAaDAILAkAgASgCUEEASA0AIAIhAANAIAAiBEUNASADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEBACAESQ0BIAMgBGohAyACIARrIQIgASgCFCEFCyAFIAMgAhANIAEgASgCFCACajYCFAsLCwtvAQF/IwBBgAJrIgUkAAJAIAIgA0wNACAEQYDABHENACAFIAFB/wFxIAIgA2siA0GAAiADQYACSSIBGxALGiABRQRAA0AgACAFQYACEAYgA0GAAmsiA0H/AUsNAAsLIAAgBSADEAYLIAVBgAJqJAALdAEBfyACRQRAIAAoAgQgASgCBEYPCyAAIAFGBEBBAQ8LIAEoAgQiAi0AACEBAkAgACgCBCIDLQAAIgBFDQAgACABRw0AA0AgAi0AASEBIAMtAAEiAEUNASACQQFqIQIgA0EBaiEDIAAgAUYNAAsLIAAgAUYLTwECf0HsESgCACIBIABBB2pBeHEiAmohAAJAIAJBACAAIAFNGw0AIAA/AEEQdEsEQCAAEABFDQELQewRIAA2AgAgAQ8LQaAXQTA2AgBBfwuDAQIDfwF+AkAgAEKAgICAEFQEQCAAIQUMAQsDQCABQQFrIgEgACAAQgqAIgVCCn59p0EwcjoAACAAQv////+fAVYhAiAFIQAgAg0ACwsgBaciAgRAA0AgAUEBayIBIAIgAkEKbiIDQQpsa0EwcjoAACACQQlLIQQgAyECIAQNAAsLIAEL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa1CgYCAgBB+IQUgAyAEaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLIAALOAEBf0EBIAAgAEEBTRshAAJAA0AgABAQIgFFBEBB7BgoAgAiAUUNAiABEQgADAELCyABDwsQAQAL/AMBAn8gAkGABE8EQCAAIAEgAhACDwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIAQcAASQ0AIAIgAEFAaiIESw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBE0NAAsLIAAgAk0NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIABJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsLwAMBB38jAEGgCGsiAyQAIANBADYCnAgjAEGgAWsiASQAIAEgA0EQaiIHNgKUASABQf7///8HNgKYASABQQBBkAEQCyIBQX82AkwgAUECNgIkIAFBfzYCUCABIAFBnwFqNgIsIAEgAUGUAWo2AlQgA0EAOgAQIwBB0AFrIgIkACACQQA2AswBIAJBoAFqIgVBAEEoEAsaIAIgAigCzAE2AsgBAkBBACAAIAJByAFqIAJB0ABqIAUQF0EASA0AIAEoAkxBAE4hBSABKAIAIQYgASgCSEEATARAIAEgBkFfcTYCAAsCfwJAAkAgASgCMEUEQCABQdAANgIwIAFBADYCHCABQgA3AxAgASgCLCEEIAEgAjYCLAwBCyABKAIQDQELQX8gARAaDQEaCyABIAAgAkHIAWogAkHQAGogAkGgAWoQFwshACAEBH8gAUEAQQAgASgCJBEBABogAUEANgIwIAEgBDYCLCABQQA2AhwgASgCFBogAUIANwMQQQAFIAALGiABIAEoAgAgBkEgcXI2AgAgBUUNAAsgAkHQAWokACABQaABaiQAIAMgBzYCAEGAEkGgCiADEAQaIANBoAhqJAALUwBB9BZCADcCAEHsFkIANwIAQYAXQgA3AgBB/BZBgICA/AM2AgBBiBdCADcCAEGQF0GAgID8AzYCAEGcF0EANgIAQcgYQdAXNgIAQYAYQSo2AgALlSgBC38jAEEQayILJAACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGoEigCACIGQRAgAEELakF4cSAAQQtJGyIFQQN2IgB2IgFBA3EEQAJAIAFBf3NBAXEgAGoiAkEDdCIBQdASaiIAIAFB2BJqKAIAIgEoAggiBEYEQEGoEiAGQX4gAndxNgIADAELIAQgADYCDCAAIAQ2AggLIAFBCGohACABIAJBA3QiAkEDcjYCBCABIAJqIgEgASgCBEEBcjYCBAwKCyAFQbASKAIAIgdNDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxIgBBACAAa3FoIgFBA3QiAEHQEmoiAiAAQdgSaigCACIAKAIIIgRGBEBBqBIgBkF+IAF3cSIGNgIADAELIAQgAjYCDCACIAQ2AggLIAAgBUEDcjYCBCAAIAVqIgggAUEDdCIBIAVrIgRBAXI2AgQgACABaiAENgIAIAcEQCAHQXhxQdASaiEBQbwSKAIAIQICfyAGQQEgB0EDdnQiA3FFBEBBqBIgAyAGcjYCACABDAELIAEoAggLIQMgASACNgIIIAMgAjYCDCACIAE2AgwgAiADNgIICyAAQQhqIQBBvBIgCDYCAEGwEiAENgIADAoLQawSKAIAIgpFDQEgCkEAIAprcWhBAnRB2BRqKAIAIgIoAgRBeHEgBWshAyACIQEDQAJAIAEoAhAiAEUEQCABKAIUIgBFDQELIAAoAgRBeHEgBWsiASADIAEgA0kiARshAyAAIAIgARshAiAAIQEMAQsLIAIoAhghCSACIAIoAgwiBEcEQEG4EigCABogAigCCCIAIAQ2AgwgBCAANgIIDAkLIAJBFGoiASgCACIARQRAIAIoAhAiAEUNAyACQRBqIQELA0AgASEIIAAiBEEUaiIBKAIAIgANACAEQRBqIQEgBCgCECIADQALIAhBADYCAAwIC0F/IQUgAEG/f0sNACAAQQtqIgBBeHEhBUGsEigCACIIRQ0AQQAgBWshAwJAAkACQAJ/QQAgBUGAAkkNABpBHyAFQf///wdLDQAaIAVBJiAAQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgdBAnRB2BRqKAIAIgFFBEBBACEADAELQQAhACAFQRkgB0EBdmtBACAHQR9HG3QhAgNAAkAgASgCBEF4cSAFayIGIANPDQAgASEEIAYiAw0AQQAhAyABIQAMAwsgACABKAIUIgYgBiABIAJBHXZBBHFqKAIQIgFGGyAAIAYbIQAgAkEBdCECIAENAAsLIAAgBHJFBEBBACEEQQIgB3QiAEEAIABrciAIcSIARQ0DIABBACAAa3FoQQJ0QdgUaigCACEACyAARQ0BCwNAIAAoAgRBeHEgBWsiAiADSSEBIAIgAyABGyEDIAAgBCABGyEEIAAoAhAiAQR/IAEFIAAoAhQLIgANAAsLIARFDQAgA0GwEigCACAFa08NACAEKAIYIQcgBCAEKAIMIgJHBEBBuBIoAgAaIAQoAggiACACNgIMIAIgADYCCAwHCyAEQRRqIgEoAgAiAEUEQCAEKAIQIgBFDQMgBEEQaiEBCwNAIAEhBiAAIgJBFGoiASgCACIADQAgAkEQaiEBIAIoAhAiAA0ACyAGQQA2AgAMBgsgBUGwEigCACIETQRAQbwSKAIAIQACQCAEIAVrIgFBEE8EQCAAIAVqIgIgAUEBcjYCBCAAIARqIAE2AgAgACAFQQNyNgIEDAELIAAgBEEDcjYCBCAAIARqIgEgASgCBEEBcjYCBEEAIQJBACEBC0GwEiABNgIAQbwSIAI2AgAgAEEIaiEADAgLIAVBtBIoAgAiAkkEQEG0EiACIAVrIgE2AgBBwBJBwBIoAgAiACAFaiICNgIAIAIgAUEBcjYCBCAAIAVBA3I2AgQgAEEIaiEADAgLQQAhACAFQS9qIgMCf0GAFigCAARAQYgWKAIADAELQYwWQn83AgBBhBZCgKCAgICABDcCAEGAFiALQQxqQXBxQdiq1aoFczYCAEGUFkEANgIAQeQVQQA2AgBBgCALIgFqIgZBACABayIIcSIBIAVNDQdB4BUoAgAiBARAQdgVKAIAIgcgAWoiCSAHTQ0IIAQgCUkNCAsCQEHkFS0AAEEEcUUEQAJAAkACQAJAQcASKAIAIgQEQEHoFSEAA0AgBCAAKAIAIgdPBEAgByAAKAIEaiAESw0DCyAAKAIIIgANAAsLQQAQCSICQX9GDQMgASEGQYQWKAIAIgBBAWsiBCACcQRAIAEgAmsgAiAEakEAIABrcWohBgsgBSAGTw0DQeAVKAIAIgAEQEHYFSgCACIEIAZqIgggBE0NBCAAIAhJDQQLIAYQCSIAIAJHDQEMBQsgBiACayAIcSIGEAkiAiAAKAIAIAAoAgRqRg0BIAIhAAsgAEF/Rg0BIAYgBUEwak8EQCAAIQIMBAtBiBYoAgAiAiADIAZrakEAIAJrcSICEAlBf0YNASACIAZqIQYgACECDAMLIAJBf0cNAgtB5BVB5BUoAgBBBHI2AgALIAEQCSECQQAQCSEAIAJBf0YNBSAAQX9GDQUgACACTQ0FIAAgAmsiBiAFQShqTQ0FC0HYFUHYFSgCACAGaiIANgIAQdwVKAIAIABJBEBB3BUgADYCAAsCQEHAEigCACIDBEBB6BUhAANAIAIgACgCACIBIAAoAgQiBGpGDQIgACgCCCIADQALDAQLQbgSKAIAIgBBACAAIAJNG0UEQEG4EiACNgIAC0EAIQBB7BUgBjYCAEHoFSACNgIAQcgSQX82AgBBzBJBgBYoAgA2AgBB9BVBADYCAANAIABBA3QiAUHYEmogAUHQEmoiBDYCACABQdwSaiAENgIAIABBAWoiAEEgRw0AC0G0EiAGQShrIgBBeCACa0EHcUEAIAJBCGpBB3EbIgFrIgQ2AgBBwBIgASACaiIBNgIAIAEgBEEBcjYCBCAAIAJqQSg2AgRBxBJBkBYoAgA2AgAMBAsgAC0ADEEIcQ0CIAEgA0sNAiACIANNDQIgACAEIAZqNgIEQcASIANBeCADa0EHcUEAIANBCGpBB3EbIgBqIgE2AgBBtBJBtBIoAgAgBmoiAiAAayIANgIAIAEgAEEBcjYCBCACIANqQSg2AgRBxBJBkBYoAgA2AgAMAwtBACEEDAULQQAhAgwDC0G4EigCACACSwRAQbgSIAI2AgALIAIgBmohAUHoFSEAAkACQAJAAkACQAJAA0AgASAAKAIARwRAIAAoAggiAA0BDAILCyAALQAMQQhxRQ0BC0HoFSEAA0AgAyAAKAIAIgFPBEAgASAAKAIEaiIEIANLDQMLIAAoAgghAAwACwALIAAgAjYCACAAIAAoAgQgBmo2AgQgAkF4IAJrQQdxQQAgAkEIakEHcRtqIgcgBUEDcjYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiBiAFIAdqIgVrIQAgAyAGRgRAQcASIAU2AgBBtBJBtBIoAgAgAGoiADYCACAFIABBAXI2AgQMAwtBvBIoAgAgBkYEQEG8EiAFNgIAQbASQbASKAIAIABqIgA2AgAgBSAAQQFyNgIEIAAgBWogADYCAAwDCyAGKAIEIgNBA3FBAUYEQCADQXhxIQkCQCADQf8BTQRAIAYoAgwiASAGKAIIIgJGBEBBqBJBqBIoAgBBfiADQQN2d3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAGKAIYIQgCQCAGIAYoAgwiAkcEQCAGKAIIIgEgAjYCDCACIAE2AggMAQsCQCAGQRRqIgMoAgAiAQ0AIAZBEGoiAygCACIBDQBBACECDAELA0AgAyEEIAEiAkEUaiIDKAIAIgENACACQRBqIQMgAigCECIBDQALIARBADYCAAsgCEUNAAJAIAYoAhwiAUECdEHYFGoiBCgCACAGRgRAIAQgAjYCACACDQFBrBJBrBIoAgBBfiABd3E2AgAMAgsgCEEQQRQgCCgCECAGRhtqIAI2AgAgAkUNAQsgAiAINgIYIAYoAhAiAQRAIAIgATYCECABIAI2AhgLIAYoAhQiAUUNACACIAE2AhQgASACNgIYCyAGIAlqIgYoAgQhAyAAIAlqIQALIAYgA0F+cTYCBCAFIABBAXI2AgQgACAFaiAANgIAIABB/wFNBEAgAEF4cUHQEmohAQJ/QagSKAIAIgJBASAAQQN2dCIAcUUEQEGoEiAAIAJyNgIAIAEMAQsgASgCCAshACABIAU2AgggACAFNgIMIAUgATYCDCAFIAA2AggMAwtBHyEDIABB////B00EQCAAQSYgAEEIdmciAWt2QQFxIAFBAXRrQT5qIQMLIAUgAzYCHCAFQgA3AhAgA0ECdEHYFGohAQJAQawSKAIAIgJBASADdCIEcUUEQEGsEiACIARyNgIAIAEgBTYCAAwBCyAAQRkgA0EBdmtBACADQR9HG3QhAyABKAIAIQIDQCACIgEoAgRBeHEgAEYNAyADQR12IQIgA0EBdCEDIAEgAkEEcWoiBCgCECICDQALIAQgBTYCEAsgBSABNgIYIAUgBTYCDCAFIAU2AggMAgtBtBIgBkEoayIAQXggAmtBB3FBACACQQhqQQdxGyIBayIINgIAQcASIAEgAmoiATYCACABIAhBAXI2AgQgACACakEoNgIEQcQSQZAWKAIANgIAIAMgBEEnIARrQQdxQQAgBEEna0EHcRtqQS9rIgAgACADQRBqSRsiAUEbNgIEIAFB8BUpAgA3AhAgAUHoFSkCADcCCEHwFSABQQhqNgIAQewVIAY2AgBB6BUgAjYCAEH0FUEANgIAIAFBGGohAANAIABBBzYCBCAAQQhqIQIgAEEEaiEAIAIgBEkNAAsgASADRg0DIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgAgAkH/AU0EQCACQXhxQdASaiEAAn9BqBIoAgAiAUEBIAJBA3Z0IgJxRQRAQagSIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgAzYCCCABIAM2AgwgAyAANgIMIAMgATYCCAwEC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QdgUaiEBAkBBrBIoAgAiBEEBIAB0IgZxRQRAQawSIAQgBnI2AgAgASADNgIADAELIAJBGSAAQQF2a0EAIABBH0cbdCEAIAEoAgAhBANAIAQiASgCBEF4cSACRg0EIABBHXYhBCAAQQF0IQAgASAEQQRxaiIGKAIQIgQNAAsgBiADNgIQCyADIAE2AhggAyADNgIMIAMgAzYCCAwDCyABKAIIIgAgBTYCDCABIAU2AgggBUEANgIYIAUgATYCDCAFIAA2AggLIAdBCGohAAwFCyABKAIIIgAgAzYCDCABIAM2AgggA0EANgIYIAMgATYCDCADIAA2AggLQbQSKAIAIgAgBU0NAEG0EiAAIAVrIgE2AgBBwBJBwBIoAgAiACAFaiICNgIAIAIgAUEBcjYCBCAAIAVBA3I2AgQgAEEIaiEADAMLQaAXQTA2AgBBACEADAILAkAgB0UNAAJAIAQoAhwiAEECdEHYFGoiASgCACAERgRAIAEgAjYCACACDQFBrBIgCEF+IAB3cSIINgIADAILIAdBEEEUIAcoAhAgBEYbaiACNgIAIAJFDQELIAIgBzYCGCAEKAIQIgAEQCACIAA2AhAgACACNgIYCyAEKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsCQCADQQ9NBEAgBCADIAVqIgBBA3I2AgQgACAEaiIAIAAoAgRBAXI2AgQMAQsgBCAFQQNyNgIEIAQgBWoiAiADQQFyNgIEIAIgA2ogAzYCACADQf8BTQRAIANBeHFB0BJqIQACf0GoEigCACIBQQEgA0EDdnQiA3FFBEBBqBIgASADcjYCACAADAELIAAoAggLIQEgACACNgIIIAEgAjYCDCACIAA2AgwgAiABNgIIDAELQR8hACADQf///wdNBEAgA0EmIANBCHZnIgBrdkEBcSAAQQF0a0E+aiEACyACIAA2AhwgAkIANwIQIABBAnRB2BRqIQECQAJAIAhBASAAdCIGcUUEQEGsEiAGIAhyNgIAIAEgAjYCAAwBCyADQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQUDQCAFIgEoAgRBeHEgA0YNAiAAQR12IQYgAEEBdCEAIAEgBkEEcWoiBigCECIFDQALIAYgAjYCEAsgAiABNgIYIAIgAjYCDCACIAI2AggMAQsgASgCCCIAIAI2AgwgASACNgIIIAJBADYCGCACIAE2AgwgAiAANgIICyAEQQhqIQAMAQsCQCAJRQ0AAkAgAigCHCIAQQJ0QdgUaiIBKAIAIAJGBEAgASAENgIAIAQNAUGsEiAKQX4gAHdxNgIADAILIAlBEEEUIAkoAhAgAkYbaiAENgIAIARFDQELIAQgCTYCGCACKAIQIgAEQCAEIAA2AhAgACAENgIYCyACKAIUIgBFDQAgBCAANgIUIAAgBDYCGAsCQCADQQ9NBEAgAiADIAVqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAFQQNyNgIEIAIgBWoiBCADQQFyNgIEIAMgBGogAzYCACAHBEAgB0F4cUHQEmohAEG8EigCACEBAn9BASAHQQN2dCIFIAZxRQRAQagSIAUgBnI2AgAgAAwBCyAAKAIICyEGIAAgATYCCCAGIAE2AgwgASAANgIMIAEgBjYCCAtBvBIgBDYCAEGwEiADNgIACyACQQhqIQALIAtBEGokACAAC5oBACAAQQE6ADUCQCAAKAIEIAJHDQAgAEEBOgA0AkAgACgCECICRQRAIABBATYCJCAAIAM2AhggACABNgIQIANBAUcNAiAAKAIwQQFGDQEMAgsgASACRgRAIAAoAhgiAkECRgRAIAAgAzYCGCADIQILIAAoAjBBAUcNAiACQQFGDQEMAgsgACAAKAIkQQFqNgIkCyAAQQE6ADYLC10BAX8gACgCECIDRQRAIABBATYCJCAAIAI2AhggACABNgIQDwsCQCABIANGBEAgACgCGEECRw0BIAAgAjYCGA8LIABBAToANiAAQQI2AhggACAAKAIkQQFqNgIkCwsGACAAEAULlwIAIABFBEBBAA8LAn8CQCAABH8gAUH/AE0NAQJAQcgYKAIAKAIARQRAIAFBgH9xQYC/A0YNAwwBCyABQf8PTQRAIAAgAUE/cUGAAXI6AAEgACABQQZ2QcABcjoAAEECDAQLIAFBgEBxQYDAA0cgAUGAsANPcUUEQCAAIAFBP3FBgAFyOgACIAAgAUEMdkHgAXI6AAAgACABQQZ2QT9xQYABcjoAAUEDDAQLIAFBgIAEa0H//z9NBEAgACABQT9xQYABcjoAAyAAIAFBEnZB8AFyOgAAIAAgAUEGdkE/cUGAAXI6AAIgACABQQx2QT9xQYABcjoAAUEEDAQLC0GgF0EZNgIAQX8FQQELDAELIAAgAToAAEEBCwu7BwIGfgF/AkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACAkKCAkBAgMECgkKCggJBQYHCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCyACIAIoAgAiAUEEajYCACAAIAEyAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEzAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEwAAA3AwAPCyACIAIoAgAiAUEEajYCACAAIAExAAA3AwAPCyACIAIoAgBBB2pBeHEiAUEIajYCACAAIAErAwA5AwAPCyACIAIoAgBBB2pBeHEiAUEQajYCACAAIQkgASkDACEEIAEpAwghByMAQSBrIgIkAAJAIAdC////////////AIMiBUKAgICAgIDAgDx9IAVCgICAgICAwP/DAH1UBEAgB0IEhiAEQjyIhCEFIARC//////////8PgyIEQoGAgICAgICACFoEQCAFQoGAgICAgICAwAB8IQMMAgsgBUKAgICAgICAgEB9IQMgBEKAgICAgICAgAhSDQEgAyAFQgGDfCEDDAELIARQIAVCgICAgICAwP//AFQgBUKAgICAgIDA//8AURtFBEAgB0IEhiAEQjyIhEL/////////A4NCgICAgICAgPz/AIQhAwwBC0KAgICAgICA+P8AIQMgBUL///////+//8MAVg0AQgAhAyAFQjCIpyIAQZH3AEkNACAEIQMgB0L///////8/g0KAgICAgIDAAIQiBiEIAkAgAEGB9wBrIgFBwABxBEAgAyABQUBqrYYhCEIAIQMMAQsgAUUNACAIIAGtIgWGIANBwAAgAWutiIQhCCADIAWGIQMLIAIgAzcDECACIAg3AxgCQEGB+AAgAGsiAEHAAHEEQCAGIABBQGqtiCEEQgAhBgwBCyAARQ0AIAZBwAAgAGuthiAEIACtIgOIhCEEIAYgA4ghBgsgAiAENwMAIAIgBjcDCCACKQMIQgSGIAIpAwAiBEI8iIQhAyACKQMQIAIpAxiEQgBSrSAEQv//////////D4OEIgRCgYCAgICAgIAIWgRAIANCAXwhAwwBCyAEQoCAgICAgICACFINACADQgGDIAN8IQMLIAJBIGokACAJIAMgB0KAgICAgICAgIB/g4S/OQMACw8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAAtyAQN/IAAoAgAsAABBMGtBCk8EQEEADwsDQCAAKAIAIQNBfyEBIAJBzJmz5gBNBEBBfyADLAAAQTBrIgEgAkEKbCICaiABIAJB/////wdzShshAQsgACADQQFqNgIAIAEhAiADLAABQTBrQQpJDQALIAILlywDHH8CfAJ+IwBB0ABrIgwkACAMIAE2AkwgDEE3aiEeIAxBOGohGAJAAkACQAJAA0AgASEGIAUgE0H/////B3NKDQEgBSATaiETAkACQAJAIAYiBS0AACILBEADQAJAAkAgC0H/AXEiAUUEQCAFIQEMAQsgAUElRw0BIAUhCwNAIAstAAFBJUcEQCALIQEMAgsgBUEBaiEFIAstAAIhCCALQQJqIgEhCyAIQSVGDQALCyAFIAZrIgUgE0H/////B3MiDkoNByAABEAgACAGIAUQBgsgBQ0GIAwgATYCTCABQQFqIQVBfyEPAkAgASwAAUEwa0EKTw0AIAEtAAJBJEcNACABQQNqIQUgASwAAUEwayEPQQEhGQsgDCAFNgJMQQAhCAJAIAUsAAAiCUEgayIBQR9LBEAgBSELDAELIAUhC0EBIAF0IgFBidEEcUUNAANAIAwgBUEBaiILNgJMIAEgCHIhCCAFLAABIglBIGsiAUEgTw0BIAshBUEBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAssAAFBMGtBCk8NACALLQACQSRHDQAgCywAAUECdCAEakHAAWtBCjYCACALQQNqIQlBASEZIAssAAFBA3QgA2pBgANrKAIADAELIBkNBiALQQFqIQkgAEUEQCAMIAk2AkxBACEZQQAhEAwDCyACIAIoAgAiAUEEajYCAEEAIRkgASgCAAshECAMIAk2AkwgEEEATg0BQQAgEGshECAIQYDAAHIhCAwBCyAMQcwAahAWIhBBAEgNCCAMKAJMIQkLQQAhBUF/IQcCfyAJLQAAQS5HBEAgCSEBQQAMAQsgCS0AAUEqRgRAAn8CQCAJLAACQTBrQQpPDQAgCS0AA0EkRw0AIAksAAJBAnQgBGpBwAFrQQo2AgAgCUEEaiEBIAksAAJBA3QgA2pBgANrKAIADAELIBkNBiAJQQJqIQFBACAARQ0AGiACIAIoAgAiC0EEajYCACALKAIACyEHIAwgATYCTCAHQX9zQR92DAELIAwgCUEBajYCTCAMQcwAahAWIQcgDCgCTCEBQQELIREDQCAFIQpBHCELIAEiEiwAACIFQfsAa0FGSQ0JIBJBAWohASAFIApBOmxqQe8Kai0AACIFQQFrQQhJDQALIAwgATYCTAJAAkAgBUEbRwRAIAVFDQsgD0EATgRAIAQgD0ECdGogBTYCACAMIAMgD0EDdGopAwA3A0AMAgsgAEUNCCAMQUBrIAUgAhAVDAILIA9BAE4NCgtBACEFIABFDQcLIAhB//97cSIJIAggCEGAwABxGyEIQQAhD0GiCiENIBghCwJAAkAgAEEgIBACfwJ/AkACQAJAAkACfwJAAkACQAJAAkACQAJAIBIsAAAiBUFfcSAFIAVBD3FBA0YbIAUgChsiBUHYAGsOIQQUFBQUFBQUFA4UDwYODg4UBhQUFBQCBQMUFAkUARQUBAALAkAgBUHBAGsOBw4UCxQODg4ACyAFQdMARg0JDBMLIAwpA0AhI0GiCgwFC0EAIQUCQAJAAkACQAJAAkACQCAKQf8BcQ4IAAECAwQaBQYaCyAMKAJAIBM2AgAMGQsgDCgCQCATNgIADBgLIAwoAkAgE6w3AwAMFwsgDCgCQCATOwEADBYLIAwoAkAgEzoAAAwVCyAMKAJAIBM2AgAMFAsgDCgCQCATrDcDAAwTC0EIIAcgB0EITRshByAIQQhyIQhB+AAhBQsgGCEGIAwpA0AiIyIkQgBSBEAgBUEgcSEJA0AgBkEBayIGICSnQQ9xQYAPai0AACAJcjoAACAkQg9WIQogJEIEiCEkIAoNAAsLICNQDQMgCEEIcUUNAyAFQQR2QaIKaiENQQIhDwwDCyAYIQUgDCkDQCIjIiRCAFIEQANAIAVBAWsiBSAkp0EHcUEwcjoAACAkQgdWIQYgJEIDiCEkIAYNAAsLIAUhBiAIQQhxRQ0CIAcgGCAGayIFQQFqIAUgB0gbIQcMAgsgDCkDQCIjQgBTBEAgDEIAICN9IiM3A0BBASEPQaIKDAELIAhBgBBxBEBBASEPQaMKDAELQaQKQaIKIAhBAXEiDxsLIQ0gIyAYEAohBgsgEUEAIAdBAEgbDQ4gCEH//3txIAggERshCAJAICNCAFINACAHDQAgGCEGQQAhBwwMCyAHICNQIBggBmtqIgUgBSAHSBshBwwLCwJ/Qf////8HIAcgB0H/////B08bIgoiCEEARyELAkACQAJAIAwoAkAiBUGiCyAFGyIGIgVBA3FFDQAgCEUNAANAIAUtAABFDQIgCEEBayIIQQBHIQsgBUEBaiIFQQNxRQ0BIAgNAAsLIAtFDQECQCAFLQAARQ0AIAhBBEkNAANAIAUoAgAiC0F/cyALQYGChAhrcUGAgYKEeHENAiAFQQRqIQUgCEEEayIIQQNLDQALCyAIRQ0BCwNAIAUgBS0AAEUNAhogBUEBaiEFIAhBAWsiCA0ACwtBAAsiBSAGayAKIAUbIgUgBmohCyAHQQBOBEAgCSEIIAUhBwwLCyAJIQggBSEHIAstAAANDQwKCyAHBEAgDCgCQAwCCyAAQSAgEEEAIAgQB0EADAILIAxBADYCDCAMIAwpA0A+AgggDCAMQQhqIgU2AkBBfyEHIAULIQZBACEFIAYhCwJAA0AgCygCACIJRQ0BAkAgDEEEaiAJEBQiCUEASCIKDQAgCSAHIAVrSw0AIAtBBGohCyAHIAUgCWoiBUsNAQwCCwsgCg0NC0E9IQsgBUEASA0LIABBICAQIAUgCBAHQQAiCyAFRQ0AGgNAAkAgBigCACIHRQ0AIAxBBGogBxAUIgcgC2oiCyAFSw0AIAAgDEEEaiAHEAYgBkEEaiEGIAUgC0sNAQsLIAULIgUgCEGAwABzEAcgECAFIAUgEEgbIQUMCAsgEUEAIAdBAEgbDQhBPSELIAwrA0AhISAIIQ8gBSERQQAhFUEAIRwjAEGwBGsiDiQAIA5BADYCLAJAICG9IiNCAFMEQEEBIRZBrAohGiAhmiIhvSEjDAELIA9BgBBxBEBBASEWQa8KIRoMAQtBsgpBrQogD0EBcSIWGyEaIBZFIRwLAkAgI0KAgICAgICA+P8Ag0KAgICAgICA+P8AUQRAIABBICAQIBZBA2oiBSAPQf//e3EQByAAIBogFhAGIABBhAtBmAsgEUEgcSIGG0GIC0GcCyAGGyAhICFiG0EDEAYgAEEgIBAgBSAPQYDAAHMQByAFIBAgBSAQShshDQwBCyAOQRBqIRcCQAJ/AkAgISAOQSxqEBgiISAhoCIhRAAAAAAAAAAAYgRAIA4gDigCLCIFQQFrNgIsIBFBIHIiFEHhAEcNAQwDCyARQSByIhRB4QBGDQIgDigCLCEKQQYgByAHQQBIGwwBCyAOIAVBHWsiCjYCLCAhRAAAAAAAALBBoiEhQQYgByAHQQBIGwshCSAOQTBqQaACQQAgCkEAThtqIhIhBgNAIAYCfyAhRAAAAAAAAPBBYyAhRAAAAAAAAAAAZnEEQCAhqwwBC0EACyIFNgIAIAZBBGohBiAhIAW4oUQAAAAAZc3NQaIiIUQAAAAAAAAAAGINAAsCQCAKQQBMBEAgCiEHIAYhBSASIQgMAQsgEiEIIAohBwNAQR0gByAHQR1OGyEHAkAgBkEEayIFIAhJDQAgB60hJEIAISMDQCAFICNC/////w+DIAU1AgAgJIZ8IiMgI0KAlOvcA4AiI0KAlOvcA359PgIAIAVBBGsiBSAITw0ACyAjpyIFRQ0AIAhBBGsiCCAFNgIACwNAIAggBiIFSQRAIAVBBGsiBigCAEUNAQsLIA4gDigCLCAHayIHNgIsIAUhBiAHQQBKDQALCyAHQQBIBEAgCUEZakEJbkEBaiEVIBRB5gBGIRsDQEEJQQAgB2siBiAGQQlOGyENAkAgBSAITQRAIAgoAgAhBgwBC0GAlOvcAyANdiEdQX8gDXRBf3MhH0EAIQcgCCEGA0AgBiAHIAYoAgAiICANdmo2AgAgHyAgcSAdbCEHIAZBBGoiBiAFSQ0ACyAIKAIAIQYgB0UNACAFIAc2AgAgBUEEaiEFCyAOIA4oAiwgDWoiBzYCLCASIAggBkVBAnRqIgggGxsiBiAVQQJ0aiAFIAUgBmtBAnUgFUobIQUgB0EASA0ACwtBACEHAkAgBSAITQ0AIBIgCGtBAnVBCWwhB0EKIQYgCCgCACINQQpJDQADQCAHQQFqIQcgDSAGQQpsIgZPDQALCyAJIAdBACAUQeYARxtrIBRB5wBGIAlBAEdxayIGIAUgEmtBAnVBCWxBCWtIBEBBBEGkAiAKQQBIGyAOaiAGQYDIAGoiDUEJbSIVQQJ0akHQH2shCkEKIQYgDSAVQQlsayINQQdMBEADQCAGQQpsIQYgDUEBaiINQQhHDQALCwJAIAooAgAiGyAbIAZuIhUgBmxrIg1FIApBBGoiHSAFRnENAAJAIBVBAXFFBEBEAAAAAAAAQEMhISAGQYCU69wDRw0BIAggCk8NASAKQQRrLQAAQQFxRQ0BC0QBAAAAAABAQyEhC0QAAAAAAADgP0QAAAAAAADwP0QAAAAAAAD4PyAFIB1GG0QAAAAAAAD4PyANIAZBAXYiHUYbIA0gHUkbISICQCAcDQAgGi0AAEEtRw0AICKaISIgIZohIQsgCiAbIA1rIg02AgAgISAioCAhYQ0AIAogBiANaiIGNgIAIAZBgJTr3ANPBEADQCAKQQA2AgAgCCAKQQRrIgpLBEAgCEEEayIIQQA2AgALIAogCigCAEEBaiIGNgIAIAZB/5Pr3ANLDQALCyASIAhrQQJ1QQlsIQdBCiEGIAgoAgAiDUEKSQ0AA0AgB0EBaiEHIA0gBkEKbCIGTw0ACwsgCkEEaiIGIAUgBSAGSxshBQsDQCAFIgYgCE0iDUUEQCAGQQRrIgUoAgBFDQELCwJAIBRB5wBHBEAgD0EIcSEKDAELIAdBf3NBfyAJQQEgCRsiBSAHSiAHQXtKcSIKGyAFaiEJQX9BfiAKGyARaiERIA9BCHEiCg0AAn9BdyANDQAaQXcgBkEEaygCACIURQ0AGkEKIQ1BACIFIBRBCnANABoDQCAFIgpBAWohBSAUIA1BCmwiDXBFDQALIApBf3MLIQUgBiASa0ECdUEJbEEJayENIBFBX3FBxgBGBEBBACEKIAkgBSANaiIFQQAgBUEAShsiBSAFIAlKGyEJDAELQQAhCiAJIAcgDWogBWoiBUEAIAVBAEobIgUgBSAJShshCQtBfyENIAlB/f///wdB/v///wcgCSAKciIcG0oNASAJIBxBAEdqQQFqIRQCQCARQV9xIhtBxgBGBEAgByAUQf////8Hc0oNAyAHQQAgB0EAShshBQwBCyAXIAcgB0EfdSIFcyAFa60gFxAKIgVrQQFMBEADQCAFQQFrIgVBMDoAACAXIAVrQQJIDQALCyAFQQJrIhUgEToAACAFQQFrQS1BKyAHQQBIGzoAACAXIBVrIgUgFEH/////B3NKDQILIAUgFGoiBSAWQf////8Hc0oNASAAQSAgECAFIBZqIhEgDxAHIAAgGiAWEAYgAEEwIBAgESAPQYCABHMQBwJAAkACQCAbQcYARgRAIA5BEGoiBUEIciEHIAVBCXIhCiASIAggCCASSxsiDSEIA0AgCDUCACAKEAohBQJAIAggDUcEQCAFIA5BEGpNDQEDQCAFQQFrIgVBMDoAACAFIA5BEGpLDQALDAELIAUgCkcNACAOQTA6ABggByEFCyAAIAUgCiAFaxAGIAhBBGoiCCASTQ0ACyAcBEAgAEGgC0EBEAYLIAYgCE0NASAJQQBMDQEDQCAINQIAIAoQCiIFIA5BEGpLBEADQCAFQQFrIgVBMDoAACAFIA5BEGpLDQALCyAAIAVBCSAJIAlBCU4bEAYgCUEJayEFIAhBBGoiCCAGTw0DIAlBCUohByAFIQkgBw0ACwwCCwJAIAlBAEgNACAGIAhBBGogBiAISxshDSAOQRBqIgVBCHIhByAFQQlyIRIgCCEGA0AgEiAGNQIAIBIQCiIFRgRAIA5BMDoAGCAHIQULAkAgBiAIRwRAIAUgDkEQak0NAQNAIAVBAWsiBUEwOgAAIAUgDkEQaksNAAsMAQsgACAFQQEQBiAFQQFqIQUgCSAKckUNACAAQaALQQEQBgsgACAFIAkgEiAFayIFIAUgCUobEAYgCSAFayEJIAZBBGoiBiANTw0BIAlBAE4NAAsLIABBMCAJQRJqQRJBABAHIAAgFSAXIBVrEAYMAgsgCSEFCyAAQTAgBUEJakEJQQAQBwsgAEEgIBAgESAPQYDAAHMQByARIBAgECARSBshDQwBCyAaIBFBGnRBH3VBCXFqIQgCQCAHQQtLDQBBDCAHayEFRAAAAAAAADBAISIDQCAiRAAAAAAAADBAoiEiIAVBAWsiBQ0ACyAILQAAQS1GBEAgIiAhmiAioaCaISEMAQsgISAioCAioSEhCyAXIA4oAiwiBSAFQR91IgVzIAVrrSAXEAoiBUYEQCAOQTA6AA8gDkEPaiEFCyAWQQJyIQkgEUEgcSESIA4oAiwhBiAFQQJrIgogEUEPajoAACAFQQFrQS1BKyAGQQBIGzoAACAPQQhxIREgDkEQaiEGA0AgBiIFAn8gIZlEAAAAAAAA4EFjBEAgIaoMAQtBgICAgHgLIgZBgA9qLQAAIBJyOgAAICEgBrehRAAAAAAAADBAoiEhAkAgBUEBaiIGIA5BEGprQQFHDQACQCARDQAgB0EASg0AICFEAAAAAAAAAABhDQELIAVBLjoAASAFQQJqIQYLICFEAAAAAAAAAABiDQALQX8hDUH9////ByAXIAprIhIgCWoiEWsgB0gNACAAQSAgECARIAdBAmogBiAOQRBqIg1rIgUgBUECayAHSBsgBSAHGyIHaiIGIA8QByAAIAggCRAGIABBMCAQIAYgD0GAgARzEAcgACANIAUQBiAAQTAgByAFa0EAQQAQByAAIAogEhAGIABBICAQIAYgD0GAwABzEAcgBiAQIAYgEEobIQ0LIA5BsARqJAAgDSIFQQBODQcMCQsgDCAMKQNAPAA3QQEhByAeIQYgCSEIDAQLIAUtAAEhCyAFQQFqIQUMAAsACyAADQcgGUUNAkEBIQUDQCAEIAVBAnRqKAIAIgAEQCADIAVBA3RqIAAgAhAVQQEhEyAFQQFqIgVBCkcNAQwJCwtBASETIAVBCk8NBwNAIAQgBUECdGooAgANASAFQQFqIgVBCkcNAAsMBwtBHCELDAQLIAcgCyAGayIJIAcgCUobIgogD0H/////B3NKDQJBPSELIBAgCiAPaiIHIAcgEEgbIgUgDkoNAyAAQSAgBSAHIAgQByAAIA0gDxAGIABBMCAFIAcgCEGAgARzEAcgAEEwIAogCUEAEAcgACAGIAkQBiAAQSAgBSAHIAhBgMAAcxAHDAELC0EAIRMMAwtBPSELC0GgFyALNgIAC0F/IRMLIAxB0ABqJAAgEwt+AgF/AX4gAL0iA0I0iKdB/w9xIgJB/w9HBHwgAkUEQCABIABEAAAAAAAAAABhBH9BAAUgAEQAAAAAAADwQ6IgARAYIQAgASgCAEFAags2AgAgAA8LIAEgAkH+B2s2AgAgA0L/////////h4B/g0KAgICAgICA8D+EvwUgAAsLzAMBBX8gACgCDARAIAAoAggiBQRAA0AgBSgCACEDIAUoAhQiAgRAA0AgAigCACEEIAIQBSAEIgINAAsLIAUoAgwhBCAFQQA2AgwgBARAIAQQBQsgBRAFIAMiBQ0ACwtBACECIABBADYCCAJAIAAoAgQiBkUNACAGQQRPBEAgBkF8cSEEQQAhBQNAIAJBAnQiAyAAKAIAakEANgIAIAAoAgAgA0EEcmpBADYCACAAKAIAIANBCHJqQQA2AgAgACgCACADQQxyakEANgIAIAJBBGohAiAFQQRqIgUgBEcNAAsLIAZBA3EiBEUNAEEAIQMDQCAAKAIAIAJBAnRqQQA2AgAgAkEBaiECIANBAWoiAyAERw0ACwsgAEEANgIMCyABKAIAIQQgAUEANgIAIAAoAgAhAyAAIAQ2AgAgAwRAIAMQBQsgACABKAIENgIEIAFBADYCBCAAIAEoAgwiAzYCDCAAIAEqAhA4AhAgACABKAIIIgQ2AgggAwRAIABBCGohAyAEKAIEIQICQCAAKAIEIgUgBUEBayIEcUUEQCACIARxIQIMAQsgAiAFSQ0AIAIgBXAhAgsgACgCACACQQJ0aiADNgIAIAFCADcCCAsLWQEBfyAAIAAoAkgiAUEBayABcjYCSCAAKAIAIgFBCHEEQCAAIAFBIHI2AgBBfw8LIABCADcCBCAAIAAoAiwiATYCHCAAIAE2AhQgACABIAAoAjBqNgIQQQAL2AEBBH8gACgCHCIBBEADQCABKAIAIQMgASgCFCICBEADQCACKAIAIQQgAhAFIAQiAg0ACwsgASgCDCECIAFBADYCDCACBEAgAhAFCyABEAUgAyIBDQALCyAAKAIUIQEgAEEANgIUIAEEQCABEAULIAAoAggiAQRAA0AgASgCACEDIAEoAhQiAgRAA0AgAigCACEEIAIQBSAEIgINAAsLIAEoAgwhAiABQQA2AgwgAgRAIAIQBQsgARAFIAMiAQ0ACwsgACgCACEBIABBADYCACABBEAgARAFCwsDAAELBgAgACQACwQAIwALGgAgACABKAIIIAUQCARAIAEgAiADIAQQEQsLNwAgACABKAIIIAUQCARAIAEgAiADIAQQEQ8LIAAoAggiACABIAIgAyAEIAUgACgCACgCFBEHAAunAQAgACABKAIIIAQQCARAAkAgASgCBCACRw0AIAEoAhxBAUYNACABIAM2AhwLDwsCQCAAIAEoAgAgBBAIRQ0AAkAgAiABKAIQRwRAIAEoAhQgAkcNAQsgA0EBRw0BIAFBATYCIA8LIAEgAjYCFCABIAM2AiAgASABKAIoQQFqNgIoAkAgASgCJEEBRw0AIAEoAhhBAkcNACABQQE6ADYLIAFBBDYCLAsLiAIAIAAgASgCCCAEEAgEQAJAIAEoAgQgAkcNACABKAIcQQFGDQAgASADNgIcCw8LAkAgACABKAIAIAQQCARAAkAgAiABKAIQRwRAIAEoAhQgAkcNAQsgA0EBRw0CIAFBATYCIA8LIAEgAzYCIAJAIAEoAixBBEYNACABQQA7ATQgACgCCCIAIAEgAiACQQEgBCAAKAIAKAIUEQcAIAEtADUEQCABQQM2AiwgAS0ANEUNAQwDCyABQQQ2AiwLIAEgAjYCFCABIAEoAihBAWo2AiggASgCJEEBRw0BIAEoAhhBAkcNASABQQE6ADYPCyAAKAIIIgAgASACIAMgBCAAKAIAKAIYEQUACwsxACAAIAEoAghBABAIBEAgASACIAMQEg8LIAAoAggiACABIAIgAyAAKAIAKAIcEQYACxgAIAAgASgCCEEAEAgEQCABIAIgAxASCwu5AgEEfyMAQUBqIgIkACAAKAIAIgNBBGsoAgAhBCADQQhrKAIAIQUgAkIANwIcIAJCADcCJCACQgA3AiwgAkIANwI0QQAhAyACQQA2ADsgAkIANwIUIAJBtA82AhAgAiAANgIMIAIgATYCCCAAIAVqIQACQCAEIAFBABAIBEAgAkEBNgI4IAQgAkEIaiAAIABBAUEAIAQoAgAoAhQRBwAgAEEAIAIoAiBBAUYbIQMMAQsgBCACQQhqIABBAUEAIAQoAgAoAhgRBQACQAJAIAIoAiwOAgABAgsgAigCHEEAIAIoAihBAUYbQQAgAigCJEEBRhtBACACKAIwQQFGGyEDDAELIAIoAiBBAUcEQCACKAIwDQEgAigCJEEBRw0BIAIoAihBAUcNAQsgAigCGCEDCyACQUBrJAAgAwucAQEBfyMAQUBqIgMkAAJ/QQEgACABQQAQCA0AGkEAIAFFDQAaQQAgAUHkDxAlIgFFDQAaIANBDGpBAEE0EAsaIANBATYCOCADQX82AhQgAyAANgIQIAMgATYCCCABIANBCGogAigCAEEBIAEoAgAoAhwRBgAgAygCICIAQQFGBEAgAiADKAIYNgIACyAAQQFGCyEAIANBQGskACAACwQAIAALpgEBBX8gACgCVCIDKAIAIQUgAygCBCIEIAAoAhQgACgCHCIHayIGIAQgBkkbIgYEQCAFIAcgBhANIAMgAygCACAGaiIFNgIAIAMgAygCBCAGayIENgIECyAEIAIgAiAESxsiBARAIAUgASAEEA0gAyADKAIAIARqIgU2AgAgAyADKAIEIARrNgIECyAFQQA6AAAgACAAKAIsIgE2AhwgACABNgIUIAILTwEBf0GkFigCACIABEAgABAFC0G8FigCACIABEAgABAFC0HAFigCACIABEAgABAFC0GcFigCACIABEAgABAFC0GgFigCACIABEAgABAFCwscAEGYFigCACAAQQN0aiIAIAI4AgQgACABOAIAC/YUBAp/DX0CfAJ+AkAgAkF/Rg0AQfwRQYCAgPwDNgIAIAJBxBYoAgBIBEBBmBYoAgAgAkEDdGoiBCABOAIEIAQgADgCAAwBC0G/ChAOC0GcFigCACEHQZwWQaAWKAIAIgQ2AgBBoBYgBzYCAAJAQcQWKAIAIghBAEwNAEGkFigCACEHIAhBBE8EQCAIQXxxIQkDQCAEIAZBA3QiBWpCADcCACAFIAdqQgA3AgAgBCAFQQhyIgxqQgA3AgAgByAMakIANwIAIAQgBUEQciIMakIANwIAIAcgDGpCADcCACAEIAVBGHIiBWpCADcCACAFIAdqQgA3AgAgBkEEaiEGIA1BBGoiDSAJRw0ACwsgCEEDcSIFRQ0AA0AgBCAGQQN0IghqQgA3AgAgByAIakIANwIAIAZBAWohBiAKQQFqIgogBUcNAAsLQcwWKgIAIRZByBYoAgBBAEoEQEMAAIA/QdAWKgIAIg4gDkMAAIA/XhshEQNAAkAgC0ECdCIHQbgWKAIAaigCACIEQbQWKAIAIAdqKAIAIgdGDQBBxBYoAgAiBiAESiAGIAdKcUUEQEHdChAODAELQZgWKAIAIgUgB0EDdCIGaiIIKgIEIRQgCCoCACETIAUgBEEDdCIKaiIJKgIEIRggCSoCACEXQZwWKAIAIgwgBmoiBSAFKgIAIAkpAgAiHae+IAgpAgAiHqe+kyIOkjgCACAFIB1CIIinviAeQiCIp76TIg8gBSoCBJI4AgQgCiAMaiIFIAUqAgAgDpM4AgAgBSAFKgIEIA+TOAIEQbAWKAIAIgggBEECdCIFaioCACESIAggB0ECdCIHaioCACEQAn8gDiAOlCAPIA+UkpEiFUMAAIA/XwRAQagXQagXKQMAQq3+1eTUhf2o2AB+QgF8Ih03AwBBqBdBqBcpAwBCrf7V5NSF/ajYAH5CAXwiHjcDAEGYFigCACAGaiIEIAQqAgAgHUIhiKeyQwAAADCUu0QAAAAAAADgv6AgECASkrsiG6K2kjgCACAeQiGIp7JDAAAAMJS7RAAAAAAAAOC/oCAborYhDiAEKgIEIQ8gBEEEagwBC0HAFigCACIIIAdqKgIAIRkgCkGkFigCACIJaiIEIBAgBSAIaioCAJUiGiARIBcgDiAVlSAVIBCTIBKTQdQWKgIAkyIOlCIQkyAXk5SUIAVBvBYoAgAiCGooAgCyIheVIAQqAgCSOAIAIAQgGiARIBggDyAVlSAOlCIOkyAYk5SUIBeVIAQqAgSSOAIEIAYgCWoiBCAEKgIAIBIgGZUiDyARIBMgEJIgE5OUlCAHIAhqKAIAsiISlZI4AgAgDyARIBQgDpIgFJOUlCASlSEPIAQqAgQhDiAEQQRqCyAOIA+SOAIACyALQQFqIgtByBYoAgBIDQALC0EAIQlBqBcCfhADRAAAAAAAQI9AoyIbmUQAAAAAAADgQ2MEQCAbsAwBC0KAgICAgICAgIB/C6dBAWutNwMAAn8CfUMAAAAAQfwRKgIAIg5DAABIQpQiD7wiBEGAgID8A0YNABoCQCAEQYCAgPwHa0H///+HeE0EQCAEQQF0IgdFBEAjAEEQayIEQwAAgL84AgwgBCoCDEMAAAAAlQwDCyAEQYCAgPwHRg0BIAdBgICAeEkgBEEATnFFBEAgDyAPkyIPIA+VDAMLIA9DAAAAS5S8QYCAgNwAayEEC0GICisDACAEIARBgIDM+QNrIgRBgICAfHFrvrsgBEEPdkHwAXEiB0GACGorAwCiRAAAAAAAAPC/oCIbIBuiIhyiQZAKKwMAIBuiQZgKKwMAoKAgHKIgBEEXdbdBgAorAwCiIAdBiAhqKwMAoCAboKC2IQ8LIA8LQ5qZ2T+VQeAWKAIAspSNIg+LQwAAAE9dBEAgD6gMAQtBgICAgHgLIQdDAAAAACEVQeQWKAIAIgRBxBYoAgAiBSAEQQEgByAHQQFMG2oiByAFIAdIGyIMSARAIBYgFpQhFkGYFigCACELIAORIRdBASEKA0BB6BYgBEEBaiIHIAVvNgIAQbAWKAIAIARBAnRqKgIAIQMgCyAEQQN0IghqIgYqAgQhDyAGKgIAIRECQCAFQQBMBEBDAAAAACESQwAAAAAhEAwBCyADIAMgA5SUIRlDAAAAACEQQQAhBkMAAAAAIRIDQCAKQQFxBEACfyAJRQRAQQAgCyAGQQN0aiIJKgIAIACTIg4gDpQgCSoCBCABkyIOIA6UkpFBsBYoAgAgBkECdGoqAgAgF5VdRQ0BGkH4ESAGNgIAC0EBCyEJQagWIAsgBkEDdGoiDSoCAEGoFioCAJI4AgBBrBYgDSoCBEGsFioCAJI4AgALAkAgBCAGRg0AQbAWKAIAIAZBAnRqKgIAIQ4gESALIAZBA3RqIg0qAgCTIhQgFJQgDyANKgIEkyITIBOUkiIYQwAAgD9fBEBBqBdBqBcpAwBCrf7V5NSF/ajYAH5CAXwiHTcDAEGoF0GoFykDAEKt/tXk1IX9qNgAfkIBfCIeNwMAQZgWKAIAIgsgCGoiBSAFKgIAIB1CIYinskMAAAAwlLtEAAAAAAAA4L+gIAMgDpK7IhuitpI4AgAgBSAFKgIEIB5CIYinskMAAAAwlLtEAAAAAAAA4L+gIBuitpI4AgRBxBYoAgAhBQwBCyAQIBNB2BYqAgAgA0HMFioCACIQlUOkcH0/IBiRIAMgDpIiEyATkpUiEyATlEMAAIA/kpVDCtcjPJIgDiAOIA6UlCAQIBAgEJSUIg6VlCAZIA6VlZIgGJWUIg6UkiEQIBIgFCAOlJIhEgsgBkEBaiIGIAVIDQALCyAWQfwRKgIAIhNB9BEqAgBDAAAAP5QiFCASIBEgA0HMFioCAJUiAyADIBEgEZQgDyAPlJKRQdwWKgIAlEMAAHpElZSUIgOUk5RDAACAPyAUkyIRQaQWKAIAIAhqIgYqAgCUkpQiDiAOlCATIBQgECAPIAOUk5QgESAGKgIElJKUIg8gD5SSkSIDXQRAIBYgDyADlZQhDyAWIA4gA5WUIQ4LIAYgD0NmZmY/lDgCBCAGIA5DZmZmP5QiAzgCACAIIAtqIgogA0HwESoCACIDlCAKKgIAkjgCACAKIAMgBioCBJQgCioCBJI4AgQgAiAERgRAIAsgAkEDdGoiBCABOAIEIAQgADgCAAtBnBYoAgAgCGoiBCoCACIOQaAWKAIAIAhqIgYqAgAiD5MiAyADlCAEKgIEIgMgBioCBCIRkyISIBKUkiESIA4gDpQgAyADlJIiEEMAAAAAXgRAIAMgEJEiEJUhAyAOIBCVIQ4LIA8gD5QgESARlJIiEEMAAAAAXgRAIBEgEJEiEJUhESAPIBCVIQ8LIBUgEpEgAyARkyIDIAOUIA4gD5MiAyADlJKRkkMAAAA/lJIhFUEAIQogByIEIAxHDQALQfwRKgIAIQ4LQeQWQegWKAIANgIAQfwRIA5DMzNzP5RDzMxMPSAVIAWylSIDQwrXIzyUIANDAACgQF4bkjgCACACQX9HBEBBmBYoAgAgAkEDdGoiBCABOAIEIAQgADgCACACDwtB+BEoAgBBfyAJGwuYBgEJfyMAQUBqIgwkAEGMCxAOQcgWIAU2AgBBxBYgBDYCAEH0ESAGOAIAQfARIAc4AgBB0BYgCDgCAEHUFiAJOAIAQdgWIAo4AgBB3BYgCzgCAEGYFiAANgIAQaQWQX8gBEEDdCAEQf////8BSxsiABAMNgIAQZwWIAAQDDYCACAAEAwhAEGwFiABNgIAQaAWIAA2AgBBtBYgAjYCAEG4FiADNgIAQbwWQX8gBEECdCIAIARB/////wNLGyIPEAwiEDYCAEHAFiAPEAwiDzYCAEHMFkEANgIAAkAgBEEATARAQwAAAAAhBwwBCyAPQQAgABALGiAEQQNxIQ4CQCAEQQRJBEBDAAAAACEHQQAhAAwBCyAEQXxxIRJDAAAAACEHQQAhAANAIAEgAEECdCINQQxyaioCACIIIAEgDUEIcmoqAgAiCSABIA1BBHJqKgIAIgogASANaioCACILIAcgByALXRsiByAHIApdGyIHIAcgCV0bIgcgByAIXRshByAAQQRqIQAgE0EEaiITIBJHDQALCyAOBEADQCABIABBAnRqKgIAIgggByAHIAhdGyEHIABBAWohACAUQQFqIhQgDkcNAAsLQcwWIAc4AgALIAVBAEoEQANAIBAgAiARQQJ0Ig1qKAIAQQJ0IgBqIg4gDigCAEEBajYCACAQIAMgDWooAgBBAnQiDWoiDiAOKAIAQQFqNgIAIAAgD2oiDiABIA1qKgIAIgggDioCACIJIAggCV4bOAIAIA0gD2oiDSAAIAFqKgIAIgggDSoCACIJIAggCV4bOAIAIBFBAWoiESAFRw0ACwtB9BEgBjgCAEHgFiAEQTICfyAEsiAGlCIGi0MAAABPXQRAIAaoDAELQYCAgIB4CyIAIABBMkwbIgAgACAEShs2AgAgDEIANwMQIAxCADcCJCAMIAc4AjggDEGAgID8AzYCLCAMQgA3AwggDEIANwIcIAxBgICA/AM2AhhB7BYgDEEIaiIAEBlBgBcgDEEcahAZQZwXIAwoAjg2AgBBlBcgDCkDMDcCACAAEBsgDEFAayQACwoAQfARIAA4AgALCgBB3BYgADgCAAsKAEHYFiAAOAIACwoAQdQWIAA4AgALCgBB0BYgADgCAAtOAQJ/QfQRIAA4AgACf0HEFigCACICsiAAlCIAi0MAAABPXQRAIACoDAELQYCAgIB4CyEBQeAWIAJBMiABIAFBMkwbIgEgASACShs2AgALBwBB7BYQGwsQACMAIABrQXBxIgAkACAACwvuCA4AQYAIC/EDvvP4eexh9j/eqoyA93vVvz2Ir0rtcfU/223Ap/C+0r+wEPDwOZX0P2c6UX+uHtC/hQO4sJXJ8z/pJIKm2DHLv6VkiAwZDfM/WHfACk9Xxr+gjgt7Il7yPwCBnMcrqsG/PzQaSkq78T9eDozOdk66v7rlivBYI/E/zBxhWjyXsb+nAJlBP5XwPx4M4Tj0UqK/AAAAAAAA8D8AAAAAAAAAAKxHmv2MYO4/hFnyXaqlqj+gagIfs6TsP7QuNqpTXrw/5vxqVzYg6z8I2yB35SbFPy2qoWPRwuk/cEciDYbCyz/tQXgD5oboP+F+oMiLBdE/YkhT9dxn5z8J7rZXMATUP+85+v5CLuY/NIO4SKMO0L9qC+ALW1fVPyNBCvL+/9+/aQAtKyAgIDBYMHgALTBYKzBYIDBYLTB4KzB4IDB4AEdyYWJiZWQgbm9kZSBpcyBvdXQgb2YgYm91bmRzAExpbmsgdGFyZ2V0IG9yIHNvdXJjZSBpcyBvdXQgb2YgYm91bmRzAG5hbgBpbmYASW5pdCBjYWxsZWQATkFOAElORgAuAChudWxsKQAAAAAAAAAAGQAKABkZGQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAAZABEKGRkZAwoHAAEACQsYAAAJBgsAAAsABhkAAAAZGRkAQYEMCyEOAAAAAAAAAAAZAAoNGRkZAA0AAAIACQ4AAAAJAA4AAA4AQbsMCwEMAEHHDAsVEwAAAAATAAAAAAkMAAAAAAAMAAAMAEH1DAsBEABBgQ0LFQ8AAAAEDwAAAAAJEAAAAAAAEAAAEABBrw0LARIAQbsNCx4RAAAAABEAAAAACRIAAAAAABIAABIAABoAAAAaGhoAQfINCw4aAAAAGhoaAAAAAAAACQBBow4LARQAQa8OCxUXAAAAABcAAAAACRQAAAAAABQAABQAQd0OCwEWAEHpDguBAxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRk4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAAAAAIAIAACQBwAA5AgAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAIAIAADABwAAtAcAAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQAAAIAIAADwBwAAtAcAAE4xMF9fY3h4YWJpdjExOV9fcG9pbnRlcl90eXBlX2luZm9FAIAIAAAgCAAAFAgAAAAAAADkBwAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAAAAAAAyAgAAAMAAAALAAAABQAAAAYAAAAHAAAADAAAAA0AAAAOAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAIAIAACgCAAA5AcAAFN0OXR5cGVfaW5mbwAAAABYCAAA1AgAQewRCxRwDAEACtcjPAAAgD//////AACAPw=="); // assets/website.txt.js var website_txt_default = `//#region ----------------- Initializations ----------------- let loadedURL = new URL(window.location.href); let absoluteBasePath = undefined; let relativeBasePath = undefined; let relativePathname = undefined; let webpageContainer; let documentContainer; let viewContent; let leftSidebar; let rightSidebar; let sidebarCollapseIcons; let sidebarGutters; let sidebars; let sidebarDefaultWidth; let sidebarTargetWidth; let contentTargetWidth; let themeToggle; let searchInput; let fileTree; let outlineTree; let fileTreeItems; let outlineTreeItems; let canvasWrapper; let canvas; let canvasNodes; let canvasBackground; let canvasBackgroundPattern; let focusedCanvasNode; let loadingIcon; let isOffline = false; let collapseIconUp = ["m7 15 5 5 5-5", "m7 9 5-5 5 5"]; // path 1, path 2 - svg paths let collapseIconDown = ["m7 20 5-5 5 5", "m7 4 5 5 5-5"]; // path 1, path 2 - svg paths let isTouchDevice = isTouchCapable(); let documentType; // "markdown" | "canvas" | "embed" | "custom" | "none" let embedType; // "img" | "video" | "audio" | "embed" | "none" let customType; // "kanban" | "excalidraw" | "none" let deviceSize; // "large-screen" | "small screen" | "tablet" | "phone" let fullyInitialized = false; async function initGlobalObjects() { if(window.location.protocol != "file:") { await loadIncludes(); } loadingIcon = document.createElement("div"); loadingIcon.classList.add("loading-icon"); document.body.appendChild(loadingIcon); loadingIcon.innerHTML = \`
\`; webpageContainer = document.querySelector(".webpage-container"); documentContainer = document.querySelector(".document-container"); leftSidebar = document.querySelector(".sidebar-left"); rightSidebar = document.querySelector(".sidebar-right"); fileTree = document.querySelector(".file-tree"); outlineTree = document.querySelector(".outline-tree"); fileTreeItems = Array.from(document.querySelectorAll(".tree-container.file-tree .tree-item")); sidebars = [] sidebarGutters = [] sidebarCollapseIcons = [] if (leftSidebar && rightSidebar) { sidebarCollapseIcons = Array.from(document.querySelectorAll(".sidebar-collapse-icon")); sidebarGutters = [sidebarCollapseIcons[0].parentElement, sidebarCollapseIcons[1].parentElement]; sidebars = [sidebarGutters[0].parentElement, sidebarGutters[1].parentElement]; } themeToggle = document.querySelector(".theme-toggle-input"); } async function initializePage() { focusedCanvasNode = null; canvasWrapper = document.querySelector(".canvas-wrapper") ?? canvasWrapper; canvas = document.querySelector(".canvas") ?? canvas; let canvasNodesTemp = document.querySelectorAll(".canvas-node"); canvasNodes = canvasNodesTemp.length > 0 ? canvasNodesTemp : canvasNodes; canvasBackground = document.querySelector(".canvas-background") ?? canvasBackground; canvasBackgroundPattern = document.querySelector(".canvas-background pattern") ?? canvasBackgroundPattern; viewContent = document.querySelector(".document-container > .view-content") ?? document.querySelector(".document-container > .markdown-preview-view") ?? viewContent; outlineTreeItems = Array.from(document.querySelectorAll(".tree-container.outline-tree .tree-item")); if(!fullyInitialized) { if (window.location.protocol == "file:") initializeForFileProtocol(); await initGlobalObjects(); initializeDocumentTypes(document); setupSidebars(); setupThemeToggle(); await setupSearch(); setupRootPath(document); sidebarDefaultWidth = await getComputedPixelValue("--sidebar-width"); contentTargetWidth = await getComputedPixelValue("--line-width") * 0.9; window.addEventListener('resize', () => onResize()); onResize(); } setTimeout(() => documentContainer.classList.remove("hide")); // hide the right sidebar when viewing specific file types if (rightSidebar && (embedType == "video" || embedType == "embed" || customType == "excalidraw" || customType == "kanban" || documentType == "canvas")) { if(!rightSidebar.collapsed) { rightSidebar.temporaryCollapse(); } } else { // if the right sidebar was temporarily collapsed and it is still collapsed, uncollapse it if (rightSidebar && rightSidebar.temporarilyCollapsed && rightSidebar.collapsed) { rightSidebar.collapse(false); rightSidebar.temporarilyCollapsed = false; } } parseURLParams(); relativePathname = getVaultRelativePath(loadedURL.href); } function initializePageEvents(setupOnNode) { if (!setupOnNode) return; setupHeaders(setupOnNode); setupTrees(setupOnNode); setupLists(setupOnNode); setupCallouts(setupOnNode); setupCheckboxes(setupOnNode); setupCanvas(setupOnNode); setupCodeblocks(setupOnNode); setupLinks(setupOnNode); setupScroll(setupOnNode); } function initializeDocumentTypes(fromDocument) { if (fromDocument.querySelector(".document-container > .markdown-preview-view")) documentType = "markdown"; else if (fromDocument.querySelector(".canvas-wrapper")) documentType = "canvas"; else { documentType = "custom"; if (fromDocument.querySelector(".kanban-plugin")) customType = "kanban"; else if (fromDocument.querySelector(".excalidraw-plugin")) customType = "excalidraw"; } } function initializeForFileProtocol() { let graphEl = document.querySelector(".graph-view-placeholder"); if(graphEl) { console.log("Running locally, skipping graph view initialization and hiding graph."); graphEl.style.display = "none"; graphEl.previousElementSibling.style.display = "none"; // hide the graph's header } } window.onload = async function() { await initializePage(); initializePageEvents(document); setActiveDocument(loadedURL, true, false, false); fullyInitialized = true; }; window.onpopstate = function(event) { event.preventDefault(); event.stopPropagation(); if (document.body.classList.contains("floating-sidebars") && (!leftSidebar.collapsed || !rightSidebar.collapsed)) { leftSidebar.collapse(true); rightSidebar.collapse(true); return; } loadDocument(getURLPath(), false, true); console.log("Popped state: " + getURLPath()); } //#endregion //#region ----------------- Resize ----------------- function onEndResize() { document.body.classList.toggle("resizing", false); } function onStartResize() { document.body.classList.toggle("resizing", true); } let lastScreenWidth = undefined; let isResizing = false; let checkStillResizingTimeout = undefined; function onResize(isInitial = false) { if (!isResizing) { onStartResize(); isResizing = true; } function widthNowInRange(low, high) { let w = window.innerWidth; return (w > low && w < high && lastScreenWidth == undefined) || ((w > low && w < high) && (lastScreenWidth <= low || lastScreenWidth >= high)); } function widthNowGreaterThan(value) { let w = window.innerWidth; return (w > value && lastScreenWidth == undefined) || (w > value && lastScreenWidth < value); } function widthNowLessThan(value) { let w = window.innerWidth; return (w < value && lastScreenWidth == undefined) || (w < value && lastScreenWidth > value); } if (widthNowGreaterThan(contentTargetWidth + sidebarDefaultWidth * 2) || widthNowGreaterThan(1025)) { deviceSize = "large-screen"; document.body.classList.toggle("floating-sidebars", false); document.body.classList.toggle("is-large-screen", true); document.body.classList.toggle("is-small-screen", false); document.body.classList.toggle("is-tablet", false); document.body.classList.toggle("is-phone", false); sidebars.forEach(function (sidebar) { sidebar.collapse(false) }); sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); } else if (widthNowInRange((contentTargetWidth + sidebarDefaultWidth) * 1, contentTargetWidth + sidebarDefaultWidth * 2) || widthNowInRange(769, 1024)) { deviceSize = "small screen"; document.body.classList.toggle("floating-sidebars", false); document.body.classList.toggle("is-large-screen", false); document.body.classList.toggle("is-small-screen", true); document.body.classList.toggle("is-tablet", false); document.body.classList.toggle("is-phone", false); sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); if (leftSidebar && rightSidebar && !leftSidebar.collapsed) { rightSidebar.collapse(true); } } else if (widthNowInRange(sidebarDefaultWidth * 2, (contentTargetWidth + sidebarDefaultWidth) * 1) || widthNowInRange(481, 768)) { deviceSize = "tablet"; document.body.classList.toggle("floating-sidebars", true); document.body.classList.toggle("is-large-screen", false); document.body.classList.toggle("is-small-screen", false); document.body.classList.toggle("is-tablet", true); document.body.classList.toggle("is-phone", false); sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); if (leftSidebar && rightSidebar && !leftSidebar.collapsed) { rightSidebar.collapse(true); } if(leftSidebar && !fullyInitialized) leftSidebar.collapse(true); } else if (widthNowLessThan(sidebarDefaultWidth * 2) || widthNowLessThan(480)) { deviceSize = "phone"; document.body.classList.toggle("floating-sidebars", true); document.body.classList.toggle("is-large-screen", false); document.body.classList.toggle("is-small-screen", false); document.body.classList.toggle("is-tablet", false); document.body.classList.toggle("is-phone", true); sidebars.forEach(function (sidebar) { sidebar.collapse(true) }); sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); } lastScreenWidth = window.innerWidth; if (checkStillResizingTimeout != undefined) clearTimeout(checkStillResizingTimeout); // wait a little bit of time and if the width is still the same then we are done resizing let screenWidthSnapshot = window.innerWidth; checkStillResizingTimeout = setTimeout(function () { if (window.innerWidth == screenWidthSnapshot) { checkStillResizingTimeout = undefined; isResizing = false; onEndResize(); } }, 200); } // #endregion //#region ----------------- Helper Functions ----------------- function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } async function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function waitUntil(condition, interval = 100, timeout = 2000) { return new Promise(resolve => { let intervalId = 0; let timeoutId = setTimeout(() => { clearInterval(intervalId); resolve(); }, timeout); intervalId = setInterval(() => { if (condition()) { clearInterval(intervalId); clearTimeout(timeoutId); resolve(); } }, interval); }); } /**Gets the bounding rect of a given element*/ function getElBounds(El) { let elRect = El.getBoundingClientRect(); let x = elRect.x; let y = elRect.y; let width = elRect.width; let height = elRect.height; let centerX = elRect.x + elRect.width / 2; let centerY = elRect.y + elRect.height / 2; return { x: x, y: y, width: width, height: height, minX: x, minY: y, maxX: x + width, maxY: y + height, centerX: centerX, centerY: centerY }; } async function getComputedPixelValue(variableName) { const tempElement = document.createElement('div'); document.body.appendChild(tempElement); tempElement.style.position = 'absolute'; tempElement.style.width = \`var(\${variableName})\`; await new Promise(resolve => setTimeout(resolve, 10)); const computedWidth = window.getComputedStyle(tempElement).width; tempElement.remove(); return parseFloat(computedWidth); } function getPointerPosition(event) { let touches = event.touches ? Array.from(event.touches) : []; let x = touches.length > 0 ? (touches.reduce((acc, cur) => acc + cur.clientX, 0) / event.touches.length) : event.clientX; let y = touches.length > 0 ? (touches.reduce((acc, cur) => acc + cur.clientY, 0) / event.touches.length) : event.clientY; return {x: x, y: y}; } function getTouchPosition(touch) { return {x: touch.clientX, y: touch.clientY}; } function getAllChildrenRecursive(element) { let children = []; for (let i = 0; i < element.children.length; i++) { const child = element.children[i]; children.push(child); children = children.concat(getAllChildrenRecursive(child)); } return children; } function isMobile() { let check = false; (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; } function isTouchCapable() { return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); } function downloadBlob(blob, name = 'file.txt') { if ( window.navigator && window.navigator.msSaveOrOpenBlob ) return window.navigator.msSaveOrOpenBlob(blob); // For other browsers: // Create a link pointing to the ObjectURL containing the blob. const data = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = data; link.download = name; // this is necessary as link.click() does not work on the latest firefox link.dispatchEvent( new MouseEvent('click', { bubbles: true, cancelable: true, view: window }) ); setTimeout(() => { // For Firefox it is necessary to delay revoking the ObjectURL window.URL.revokeObjectURL(data); link.remove(); }, 100); } function extentionToTag(extention) { if (["png", "jpg", "jpeg", "svg", "gif", "bmp", "ico"].includes(extention)) return "img"; if (["mp4", "mov", "avi", "webm", "mpeg"].includes(extention)) return "video"; if (["mp3", "wav", "ogg", "aac"].includes(extention)) return "audio"; if (["pdf"].includes(extention)) return "embed"; return; } let slideUp = (target, duration=500) => { target.style.transitionProperty = 'height, margin, padding'; target.style.transitionDuration = duration + 'ms'; target.style.boxSizing = 'border-box'; target.style.height = target.offsetHeight + 'px'; target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; window.setTimeout(async () => { target.style.display = 'none'; target.style.removeProperty('height'); target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }, duration); } let slideUpAll = (targets, duration=500) => { targets.forEach(async target => { if (!target) return; target.style.transitionProperty = 'height, margin, padding'; target.style.transitionDuration = duration + 'ms'; target.style.boxSizing = 'border-box'; target.style.height = target.offsetHeight + 'px'; target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; }); window.setTimeout(async () => { targets.forEach(async target => { if (!target) return; target.style.display = 'none'; target.style.removeProperty('height'); target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }); }, duration); } let slideDown = (target, duration=500) => { target.style.removeProperty('display'); let display = window.getComputedStyle(target).display; if (display === 'none') display = 'block'; target.style.display = display; let height = target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; target.offsetHeight; target.style.boxSizing = 'border-box'; target.style.transitionProperty = "height, margin, padding"; target.style.transitionDuration = duration + 'ms'; target.style.height = height + 'px'; target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); window.setTimeout(async () => { target.style.removeProperty('height'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }, duration); } let slideDownAll = (targets, duration=500) => { targets.forEach(async target => { if (!target) return; target.style.removeProperty('display'); let display = window.getComputedStyle(target).display; if (display === 'none') display = 'block'; target.style.display = display; let height = target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; target.offsetHeight; target.style.boxSizing = 'border-box'; target.style.transitionProperty = "height, margin, padding"; target.style.transitionDuration = duration + 'ms'; target.style.height = height + 'px'; target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); }); window.setTimeout( async () => { targets.forEach(async target => { if (!target) return; target.style.removeProperty('height'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }); }, duration); } var slideToggle = (target, duration = 500) => { if (window.getComputedStyle(target).display === 'none') { return slideDown(target, duration); } else { return slideUp(target, duration); } } var slideToggleAll = (targets, duration = 500) => { if (window.getComputedStyle(targets[0]).display === 'none') { return slideDownAll(targets, duration); } else { return slideUpAll(targets, duration); } } function getURLExtention(url) { return url.split(".").pop().split("?")[0].split("#")[0].toLowerCase().trim(); } //#endregion //#region ----------------- Loading & Paths ----------------- let transferDocument = document.implementation.createHTMLDocument(); let loading = false; async function loadDocument(url, changeURL, showInTree) { url = decodeURI(url); if (loading) { console.log("Already loading document."); return; } loading = true; let newLoadedURL = new URL(url, absoluteBasePath); relativePathname = getVaultRelativePath(newLoadedURL.href); console.log("Loading document: ", newLoadedURL.pathname); if (newLoadedURL.pathname == loadedURL?.pathname ?? "") { console.log("Document already loaded."); loadedURL = newLoadedURL; setActiveDocument(loadedURL, false, false); await initializePage(); loading = false; return; } loadedURL = newLoadedURL; let pathname = loadedURL.pathname; await showLoading(true); let response; try { response = await fetch(pathname); } catch (error) { window.location.assign(pathname); loading = false; return; } if (response.ok) { setActiveDocument(loadedURL, showInTree, changeURL); let extention = getURLExtention(url); if (extention == "/") extention = "html"; // if no extention assume it is html documentType = "none"; embedType = "none"; customType = "none"; if(extention == "html") { let html = (await response.text()).replaceAll("", "").replaceAll("", "").replaceAll("", ""); transferDocument.write(html); setupRootPath(transferDocument); initializeDocumentTypes(transferDocument); // copy document content into DOM let newDocumentEl = transferDocument.querySelector(".document-container"); documentContainer.innerHTML = newDocumentEl.innerHTML; // copy the outline tree into the DOM let newOutline = transferDocument.querySelector(".outline-tree"); if (outlineTree && newOutline) outlineTree.innerHTML = newOutline.innerHTML; document.title = transferDocument.title; transferDocument.close(); } else { documentType = "embed"; embedType = extentionToTag(extention); if(embedType != undefined) { let media = document.createElement(embedType); media.controls = true; media.src = url; media.style.maxWidth = "100%"; if(embedType == "embed") { media.style.width = "100%"; media.style.height = "100%"; } media.style.objectFit = "contain"; viewContent.innerHTML = ""; viewContent.setAttribute("class", "view-content embed"); viewContent.appendChild(media); if (document.querySelector(".outline-tree")) document.querySelector(".outline-tree").innerHTML = ""; document.title = url.split("/").pop(); } else // just download the file { let blob = await response.blob(); downloadBlob(blob, url.split("/").pop()); } } await initializePage(); initializePageEvents(documentContainer); initializePageEvents(outlineTree); } else { pageNotFound(viewContent); } await showLoading(false); loading = false; return; } function setActiveDocument(url, showInTree, changeURL, animate = true) { let relativePath = getVaultRelativePath(url.href); let decodedRelativePath = decodeURI(relativePath); let searchlessHeaderlessPath = decodedRelativePath.split("#")[0].split("?")[0].replace("\\"", "\\\\\\"").replace("\\'", "\\\\\\'"); if (searchlessHeaderlessPath == "/" || searchlessHeaderlessPath == "") searchlessHeaderlessPath = "index.html"; // switch active file in file tree let oldActiveTreeItem = document.querySelector(".file-tree .tree-item.mod-active"); let newActiveTreeItem = document.querySelector(\`.file-tree .tree-item:has(>.tree-link[href^="\${searchlessHeaderlessPath}"])\`); if(newActiveTreeItem && !newActiveTreeItem.isEqualNode(oldActiveTreeItem)) { oldActiveTreeItem?.classList.remove("mod-active"); newActiveTreeItem.classList.add("mod-active"); if(showInTree) scrollIntoView(newActiveTreeItem, {block: "center", inline: "nearest"}, animate); } // set the active file in the graph view if(typeof graphData != 'undefined' && window.graphRenderer) { let activeNode = graphData?.paths.findIndex(function(item) { return item.endsWith(searchlessHeaderlessPath); }) ?? -1; if(activeNode >= 0) { window.graphRenderer.activeNode = activeNode; } } console.log("Active document: " + changeURL); if(changeURL && window.location.protocol != "file:") { window.history.pushState({ path: relativePath }, '', relativePath); console.log("Pushed state: " + relativePath); } } function parseURLParams() { const highlightParam = loadedURL.searchParams.get('mark'); const searchParam = loadedURL.searchParams.get('query'); const hashParam = decodeURI(loadedURL.hash); if (highlightParam) { searchCurrentDocument(highlightParam); } if (searchParam) { search(searchParam); } if (hashParam) { const headingTarget = document.getElementById(hashParam.substring(1)); if (headingTarget) { scrollIntoView(headingTarget, { behavior: "smooth", block: "start"}); } else { console.log("Heading not found: " + hashParam); } } } async function showLoading(loading) { documentContainer.style.transitionDuration = ""; loadingIcon.classList.toggle("show", loading); documentContainer.classList.toggle("hide", loading); if(loading) { // position loading icon in the center of the screen let viewBounds = getViewBounds(); loadingIcon.style.left = (viewBounds.centerX - loadingIcon.offsetWidth / 2) + "px"; loadingIcon.style.top = (viewBounds.centerY - loadingIcon.offsetHeight / 2) + "px"; // hide the left sidebar if on phone if (deviceSize == "phone") leftSidebar.collapse(true); } await delay(200); } function pageNotFound(viewContent) { viewContent.innerHTML = \`

Page Not Found

\`; if (document.querySelector(".outline-tree")) document.querySelector(".outline-tree").innerHTML = ""; console.log("Page not found: " + absoluteBasePath + loadedURL.pathname); let newRootPath = getURLRootPath(absoluteBasePath + loadedURL.pathname); relativeBasePath = newRootPath; document.querySelector("base").href = newRootPath; document.title = "Page Not Found"; } function setupRootPath(fromDocument) { let rootEl = fromDocument.getElementById("root-path"); if (!rootEl) return; let basePath = rootEl.getAttribute("root-path"); let newBase = document.createElement("base"); newBase.href = basePath; console.log("Setting root path: " + basePath); document.querySelector("base").replaceWith(newBase); document.querySelector("#root-path").setAttribute("root-path", basePath); relativeBasePath = basePath; absoluteBasePath = new URL(basePath, window.location.href).href; } function getURLPath(url = window.location.pathname) { if (absoluteBasePath == undefined) setupRootPath(document); let pathname = url.replace(absoluteBasePath, ""); return pathname; } function getURLRootPath(url = window.location.pathname) { let path = getURLPath(url); let splitPath = path.split("/"); let rootPath = ""; for (let i = 0; i < splitPath.length - 1; i++) { rootPath += "../"; } return rootPath; } function getVaultRelativePath(absolutePath) { return absolutePath.replace(absoluteBasePath, "") } //#endregion //#region ----------------- Headers ----------------- function setupHeaders(setupOnNode) { setupOnNode.querySelectorAll(".heading-collapse-indicator").forEach(function (element) { element.addEventListener("click", function () { toggleTreeHeaderOpen(element.parentElement.parentElement, true); }); }); setupOnNode.querySelectorAll(".heading-wrapper").forEach(function (element) { element.collapsed = false; element.childrenContainer = element.querySelector(".heading-children"); element.parentHeader = element.parentElement.parentElement; element.headerElement = element.querySelector(".heading"); element.markdownPreviewSizer = getHeaderSizerEl(element); element.collapse = function (collapse, openParents = true, instant = false) { collapseHeader(element, collapse, openParents, instant) }; element.toggleCollapse = function (openParents = true) { toggleTreeHeaderOpen(element, openParents) }; element.hide = function () { hideHeader(element) }; element.show = function (parents = false, children = false, forceStay = false) { showHeader(element, parents, children, forceStay) }; }); setupOnNode.querySelectorAll(".heading").forEach(function (element) { element.headingWrapper = element.parentElement; }); } function isHeadingWrapper(headingWrapper) { if (!headingWrapper) return false; return headingWrapper.classList.contains("heading-wrapper"); } function getHeaderSizerEl(headingWrapper) { // go up the tree until we find a markdown-preview-sizer let parent = headingWrapper; while (parent && !parent.classList.contains("markdown-preview-sizer")) parent = parent.parentElement; if (parent) return parent; else return; } async function collapseHeader(headingWrapper, collapse, openParents = true, instant = false) { let collapseContainer = headingWrapper.childrenContainer; if (openParents && !collapse) { let parent = headingWrapper.parentHeader; if (isHeadingWrapper(parent)) parent.collapse(false, true, instant); } let needsChange = headingWrapper.classList.contains("is-collapsed") != collapse; if (!needsChange) { // if opening show the header if (!collapse && documentType == "canvas") headingWrapper.show(true); return; } if (headingWrapper.timeout) { clearTimeout(headingWrapper.timeout); collapseContainer.style.transitionDuration = ""; collapseContainer.style.height = ""; headingWrapper.classList.toggle("is-animating", false); } if (collapse) { headingWrapper.collapseHeight = collapseContainer.offsetHeight + parseFloat(collapseContainer.lastChild?.marginBottom || 0); // show all sibling headers after this one // this is so that when the header slides down you aren't left with a blank space let next = headingWrapper.nextElementSibling; while (next && documentType == "canvas") { let localNext = next; // force show the sibling header for 500ms while this one is collapsing if (isHeadingWrapper(localNext)) localNext.show(false, true, true); setTimeout(function() { localNext.forceShown = false; }, 500); next = next.nextElementSibling; } } let height = headingWrapper.collapseHeight; collapseContainer.style.height = height + "px"; // if opening show the header if (!collapse && documentType == "canvas") headingWrapper.show(true); headingWrapper.collapsed = collapse; function adjustSizerHeight(customHeight = undefined) { if (customHeight != undefined) headingWrapper.markdownPreviewSizer.style.minHeight = customHeight + "px"; else { let newTotalHeight = Array.from(headingWrapper.markdownPreviewSizer.children).reduce((acc, cur) => acc + cur.offsetHeight, 0); headingWrapper.markdownPreviewSizer.style.minHeight = newTotalHeight + "px"; } } if (instant) { collapseContainer.style.transitionDuration = "0s"; headingWrapper.classList.toggle("is-collapsed", collapse); collapseContainer.style.height = ""; collapseContainer.style.transitionDuration = ""; adjustSizerHeight() return; } // get the length of the height transition on heading container and wait for that time before not displaying the contents let transitionDuration = getComputedStyle(collapseContainer).transitionDuration; if (transitionDuration.endsWith("s")) transitionDuration = parseFloat(transitionDuration); else if (transitionDuration.endsWith("ms")) transitionDuration = parseFloat(transitionDuration) / 1000; else transitionDuration = 0; // multiply the duration by the height so that the transition is the same speed regardless of the height of the header let transitionDurationMod = Math.min(transitionDuration * Math.sqrt(height) / 16, 0.5); // longest transition is 0.5s collapseContainer.style.transitionDuration = \`\${transitionDurationMod}s\`; if (collapse) collapseContainer.style.height = "0px"; else collapseContainer.style.height = height + "px"; headingWrapper.classList.toggle("is-animating", true); headingWrapper.classList.toggle("is-collapsed", collapse); if (headingWrapper.markdownPreviewSizer.closest(".markdown-embed")) // dont change the size of transcluded docments { adjustSizerHeight(collapse ? 0 : undefined); } setTimeout(function() { collapseContainer.style.transitionDuration = ""; if(!collapse) collapseContainer.style.height = ""; headingWrapper.classList.toggle("is-animating", false); adjustSizerHeight() }, transitionDurationMod * 1000); } function toggleTreeHeaderOpen(headingWrapper, openParents = true) { headingWrapper.collapse(!headingWrapper.collapsed, openParents); } /**Hides everything in a header and then makes the header div take up the same space as the header element */ function hideHeader(headingWrapper) { if(headingWrapper.forceShown) return; if(headingWrapper.classList.contains("is-hidden") || headingWrapper.classList.contains("is-collapsed")) return; if(getComputedStyle(headingWrapper).display == "none") return; let height = headingWrapper.offsetHeight; headingWrapper.classList.toggle("is-hidden", true); if (height != 0) headingWrapper.style.height = height + "px"; headingWrapper.style.visibility = "hidden"; } /**Restores a hidden header back to it's normal function */ function showHeader(headingWrapper, showParents = true, showChildren = false, forceStayShown = false) { if (forceStayShown) headingWrapper.forceShown = true; if (showParents) { let parent = headingWrapper.parentHeader; if (isHeadingWrapper(parent)) parent.show(true, false, forceStayShown); } if (showChildren) { let children = headingWrapper.querySelectorAll(".heading-wrapper"); children.forEach(function(child) { child.show(false, true, forceStayShown); }); } if(!headingWrapper.classList.contains("is-hidden") || headingWrapper.classList.contains("is-collapsed")) return; headingWrapper.classList.toggle("is-hidden", false); headingWrapper.style.height = ""; headingWrapper.style.visibility = ""; } //#endregion //#region ----------------- Trees ----------------- function setupTrees(setupOnNode) { setupOnNode.querySelectorAll(".collapse-tree-button").forEach(function(button) { button.treeRoot = button.closest(".tree-container"); button.icon = button.firstChild; button.icon.innerHTML = ""; button.setIcon = function(collapse) { button.icon.children[0].setAttribute("d", collapse ? collapseIconUp[0] : collapseIconDown[0]); button.icon.children[1].setAttribute("d", collapse ? collapseIconUp[1] : collapseIconDown[1]); } button.collapse = function(collapse) { let treeItems = button.treeRoot.classList.contains("file-tree") ? fileTreeItems : outlineTreeItems; setTreeCollapsedAll(treeItems, collapse); button.setIcon(collapse); button.collapsed = collapse; }; button.toggleCollapse = function() { button.collapse(!button.collapsed); }; button.toggleState = function(state) { if (state === undefined) state = !button.collapsed; button.collapsed = state; button.setIcon(state); }; button.addEventListener("click", function(event) { event.preventDefault(); event.stopPropagation(); button.toggleCollapse(); return false; }); // if any outline items are unncollapsed, toggle collapse all button state let treeItems = button.treeRoot.classList.contains("file-tree") ? fileTreeItems : outlineTreeItems; if (treeItems.some(item => !item.classList.contains("is-collapsed") && item.classList.contains("mod-collapsible"))) { button.toggleState(false); } }); let fileTreeClick = Array.from(setupOnNode.querySelectorAll(".tree-container.file-tree .tree-item:has(.collapse-icon) > .tree-link")); let outlineTreeClick = Array.from(setupOnNode.querySelectorAll(".tree-container.outline-tree .tree-item:has(.collapse-icon) > .tree-link .collapse-icon")); let collapsable = Array.from(fileTreeClick).concat(Array.from(outlineTreeClick)); for (let item of collapsable) { let closestItem = item?.closest(".tree-item"); if (closestItem && item) item?.addEventListener("click", function(event) { event.preventDefault(); event.stopPropagation(); toggleTreeCollapsed(closestItem); }); } } async function setTreeCollapsed(element, collapsed, animate = true, openParents = true) { if (!element.classList.contains("mod-collapsible")) element = element.closest(".mod-collapsible"); if (!element || !element.classList.contains("mod-collapsible")) { return; } if (element.classList.contains("is-collapsed") == collapsed) { return; } if (openParents) { let parent = element.parentElement.closest(".mod-collapsible"); if (parent) await setTreeCollapsed(parent, false, animate, openParents); } let children = element.querySelector(".tree-item-children"); if (collapsed) { element.classList.add("is-collapsed"); if(animate) slideUp(children, 100); else children.style.display = "none"; } else { element.classList.remove("is-collapsed"); if(animate) slideDown(children, 100); else children.style.display = ""; // make close all button collapse the tree instead of opening it if it's already open let treeContainer = element.closest(".tree-container"); if (treeContainer) { let collapseButton = treeContainer.querySelector(".collapse-tree-button"); if (collapseButton) collapseButton.toggleState(false); } } } async function setTreeCollapsedAll(elements, collapsed, animate = true) { let childrenList = []; elements.forEach(async element => { if (!element || !element.classList.contains("mod-collapsible")) return; let children = element.querySelector(".tree-item-children"); if (collapsed) { element.classList.add("is-collapsed"); } else { element.classList.remove("is-collapsed"); } childrenList.push(children); }); if (collapsed) { if(animate) slideUpAll(childrenList, 100); else childrenList.forEach(async (children) => { if(children) children.style.display = "none"; }); } else { if(animate) slideDownAll(childrenList, 100); else childrenList.forEach(async (children) => { if(children) children.style.display = ""; }); } } function toggleTreeCollapsed(element) { element = element.closest(".tree-item"); if (!element) return; setTreeCollapsed(element, !element.classList.contains("is-collapsed")); } function toggleTreeCollapsedAll(elements) { if (!elements) return; setTreeCollapsedAll(elements, !elements[0].classList.contains("is-collapsed")); } function getFileTreeItemFromPath(path) { return document.querySelector(\`.file-tree .tree-item:has(> .tree-link[href^="\${path}"])\`); } // hide all files and folder except the ones in the list (show parents of shown files) async function filterFileTree(showPathList, hintLabelLists, query, openFileTree = true) { if (openFileTree) await setTreeCollapsedAll(fileTreeItems, false, false); // hide all files and folders let allItems = Array.from(document.querySelectorAll(".file-tree .tree-item:not(.filtered-out)")); for await (let item of allItems) { item.classList.add("filtered-out"); } await removeTreeHintLabels(); for (let i = 0; i < showPathList.length; i++) { let path = showPathList[i]; let hintLabels = hintLabelLists[i]; let treeItem = getFileTreeItemFromPath(path); if (treeItem) { // show the file and it's parent tree items treeItem.classList.remove("filtered-out"); let itemLink = treeItem.querySelector(".tree-link"); if(itemLink) itemLink.href = path + "?mark=" + query; let parent = treeItem.parentElement.closest(".tree-item"); while (parent) { parent.classList.remove("filtered-out"); parent = parent.parentElement.closest(".tree-item"); } if (hintLabels.length > 0) { let treeLink = treeItem.querySelector(".tree-link"); let hintContainer = treeLink.appendChild(document.createElement("div")); hintContainer.classList.add("tree-hint-container"); function createHintLabel(text, link) { text = text.trim(); if (text == "") return; let hintLabelEl = document.createElement("a"); hintLabelEl.classList.add("tree-hint-label"); hintLabelEl.classList.add("internal-link"); hintLabelEl.textContent = text; hintLabelEl.href = decodeURI(link).replaceAll(" ", "_"); hintContainer.appendChild(hintLabelEl); } // create the hint labels for (let label of hintLabels) { createHintLabel(label, path + "#" + label); } setupLinks(hintContainer); } } } } async function clearFileTreeFilter(closeFileTree = true) { await removeTreeHintLabels(); let filteredItems = document.querySelectorAll(".file-tree .filtered-out"); for await (let item of filteredItems) { item.classList.remove("filtered-out"); } let markItems = document.querySelectorAll(".file-tree .tree-link[href*='?mark=']"); for await (let item of markItems) { let href = item.href.split("?")[0]; href = getVaultRelativePath(href); item.href = href; } if (closeFileTree) await setTreeCollapsedAll(fileTreeItems, true, false); } async function removeTreeHintLabels() { let hintLabels = document.querySelectorAll(".tree-hint-container"); for await (let item of hintLabels) { item.remove(); } } function sortFileTreeDocuments(sortByFunction) { let treeItems = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)")); treeItems.sort(sortByFunction); // sort the files within their parent folders for (let i = 1; i < treeItems.length; i++) { let item = treeItems[i]; let lastItem = treeItems[i - 1]; if (item.parentElement == lastItem.parentElement) { lastItem.after(item); } } // sort the folders using their contents let folders = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)")); folders.sort(function (a, b) { let aFirst = a.querySelector(".tree-item.mod-tree-file:not(.filtered-out)"); let bFirst = b.querySelector(".tree-item.mod-tree-file:not(.filtered-out)"); return treeItems.indexOf(aFirst) - treeItems.indexOf(bFirst); }); // sort the folders within their parent folders for (let i = 1; i < folders.length; i++) { let item = folders[i]; let foundPlace = false; // iterate backwards until we find an item with the same parent for (let j = i - 1; j >= 0; j--) { let lastItem = folders[j]; if (item.parentElement == lastItem.parentElement) { lastItem.after(item); foundPlace = true; break; } } // if we didn't find an item with the same parent, move it to the top if (!foundPlace) { item.parentElement.prepend(item); } } } function sortFileTree(sortByFunction) { let treeItems = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)")); treeItems.sort(sortByFunction); // sort the files within their parent folders for (let i = 1; i < treeItems.length; i++) { let item = treeItems[i]; let lastItem = treeItems[i - 1]; if (item.parentElement == lastItem.parentElement) { lastItem.after(item); } } // sort the folders using their contents let folders = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)")); folders.sort(sortByFunction); // sort the folders within their parent folders for (let i = 1; i < folders.length; i++) { let item = folders[i]; let foundPlace = false; // iterate backwards until we find an item with the same parent for (let j = i - 1; j >= 0; j--) { let lastItem = folders[j]; if (item.parentElement == lastItem.parentElement) { lastItem.after(item); foundPlace = true; break; } } // if we didn't find an item with the same parent, move it to the top if (!foundPlace) { item.parentElement.prepend(item); } } } function sortFileTreeAlphabetically(reverse = false) { sortFileTree(function (a, b) { const aTitle = a.querySelector(".tree-item-title"); const bTitle = b.querySelector(".tree-item-title"); if (!aTitle || !bTitle) return 0; const aName = aTitle.textContent.toLowerCase(); const bName = bTitle.textContent.toLowerCase(); return aName.localeCompare(bName, undefined, { numeric: true }) * (reverse ? -1 : 1); }); } //#endregion //#region ----------------- Lists ----------------- function setupLists(setupOnNode) { let listCollpaseIcons = Array.from(setupOnNode.querySelectorAll(".list-collapse-indicator")); for (let i = 0; i < listCollpaseIcons.length; i++) { let icon = listCollpaseIcons[i]; icon.addEventListener("click", function (event) { let listItem = icon.closest("li"); if (listItem) { listItem.classList.toggle("is-collapsed"); icon.classList.toggle("is-collapsed"); } }); } } //#endregion //#region ----------------- Canvas ----------------- function setupCanvas(setupOnNode) { if(documentType != "canvas" || !setupOnNode.querySelector(".canvas-wrapper")) return; // initialize canvas tranformations setupOnNode.querySelector(".canvas")?.setAttribute("style", "translate: 0px 1px; scale: 1;"); let nodeBounds = getNodesBounds(); setViewCenter(nodeBounds.centerX, nodeBounds.centerY); // let nodes be focused when hovered over setupOnNode.querySelectorAll(".canvas-node-container").forEach(function (element) { var parent = element.parentElement; function onEnter(event) { parent.classList.toggle("is-focused"); if (focusedCanvasNode != null && focusedCanvasNode != parent) { focusedCanvasNode.classList.remove("is-focused"); focusedCanvasNode.querySelector(".canvas-node-container").style.display = ""; } focusedCanvasNode = parent; parent.addEventListener("mouseleave", onLeave); parent.addEventListener("touchend", onLeave); } function onLeave(event) { if (focusedCanvasNode) { focusedCanvasNode.classList.remove("is-focused"); focusedCanvasNode = null; } parent.removeEventListener("mouseleave", onLeave); parent.removeEventListener("touchend", onLeave); } element.addEventListener("mouseenter", onEnter); element.addEventListener("touchstart", onEnter); }); // make nodes fit to view when double clicked setupOnNode.querySelectorAll(".canvas-node").forEach(function (element) { element.addEventListener("dblclick", function (event) { fitViewToNode(element); }); }); // make whole canvas fit to view when double clicked on background setupOnNode.querySelectorAll(".canvas-background").forEach(function (element) { element.addEventListener("dblclick", function (event) { fitViewToCanvas(); }); }); // make canvas draggable / panable canvasWrapper.addEventListener("mousedown", canvasWrapperMouseDownHandler); canvasWrapper.addEventListener("touchstart", canvasWrapperMouseDownHandler); let scrollInterferance = false; function canvasWrapperMouseDownHandler(mouseDownEv) { let touchesDown = mouseDownEv.touches ?? []; scrollInterferance = false; // if there is already one tough down we don't want to start another mouse down event // extra fingers are already being handled in the move event below if (touchesDown.length > 1) return; if (mouseDownEv.button == 1 || mouseDownEv.button == 0 || touchesDown.length > 0) { let lastPointerPos = getPointerPosition(mouseDownEv); let startZoom = false; let lastDistance = 0; let lastTouchCount = touchesDown.length; let mouseMoveHandler = function (mouseMoveEv) { let touchesMove = mouseMoveEv.touches ?? []; let pointer = getPointerPosition(mouseMoveEv); if (lastTouchCount != touchesMove.length) { lastPointerPos = pointer; lastTouchCount = touchesMove.length; } let deltaX = pointer.x - lastPointerPos.x; let deltaY = pointer.y - lastPointerPos.y; if ((mouseDownEv.button == 1 || touchesMove.length == 1) && focusedCanvasNode) { let mouseHoriz = Math.abs(deltaX) > Math.abs(deltaY * 1.5); let mouseVert = Math.abs(deltaY) > Math.abs(deltaX * 1.5); // only skip if the focused node can be scrolled in the direction of mouse movement let sizer = focusedCanvasNode.querySelector(".markdown-preview-sizer"); if(sizer) { let scrollableVert = sizer.scrollHeight > sizer.parentElement.clientHeight + 1; let scrollableHoriz = sizer.scrollWidth > sizer.parentElement.clientWidth + 1; if (((mouseHoriz && scrollableHoriz) || (mouseVert && scrollableVert)) && (window?.navigator?.platform?.startsWith("Win") ?? true)) { scrollInterferance = true; } else { scrollInterferance = false; } } } if (mouseDownEv.button == 0 && focusedCanvasNode) { if (focusedCanvasNode.querySelector(".canvas-node-content").textContent.trim() != "") { scrollInterferance = true; } } if (!scrollInterferance) { translateCanvas(deltaX, deltaY); lastPointerPos = pointer; } if (touchesMove.length == 2) { let touchCenter = getPointerPosition(mouseMoveEv, false); let touch1 = getTouchPosition(mouseMoveEv.touches[0]); let touch2 = getTouchPosition(mouseMoveEv.touches[1]); let distance = Math.sqrt(Math.pow(touch1.x - touch2.x, 2) + Math.pow(touch1.y - touch2.y, 2)); if (!startZoom) { startZoom = true; lastDistance = distance; } let distanceDelta = distance - lastDistance; let scaleDelta = distanceDelta / lastDistance; scaleCanvasAroundPoint(1 + scaleDelta, touchCenter.x, touchCenter.y); lastDistance = distance; } }; let mouseUpHandler = function (mouseUpEv) { document.body.removeEventListener("mousemove", mouseMoveHandler); document.body.removeEventListener("mouseup", mouseUpHandler); document.body.removeEventListener("mouseenter", mouseEnterHandler); document.body.removeEventListener("touchmove", mouseMoveHandler); document.body.removeEventListener("touchend", mouseUpHandler); document.body.removeEventListener("touchcancel", mouseUpHandler); scrollInterferance = false; }; let mouseEnterHandler = function (mouseEnterEv) { if (mouseEnterEv.buttons == 1 || mouseEnterEv.buttons == 4) return; mouseUpHandler(mouseEnterEv); } document.body.addEventListener("mousemove", mouseMoveHandler); document.body.addEventListener("mouseup", mouseUpHandler); document.body.addEventListener("mouseenter", mouseEnterHandler); document.body.addEventListener("touchmove", mouseMoveHandler); document.body.addEventListener("touchend", mouseUpHandler); document.body.addEventListener("touchcancel", mouseUpHandler); } } // get mouse position on the canvas let mouseX = 0; let mouseY = 0; canvasWrapper.addEventListener("mousemove", function (event) { let pointer = getPointerPosition(event); mouseX = pointer.x; mouseY = pointer.y; }); let scale = 1; let speed = 0; let instant = false; // make canvas zoomable canvasWrapper.addEventListener("wheel", function (event) { if (focusedCanvasNode) { // only skip if the focused node can be scrolled let sizer = focusedCanvasNode.querySelector(".markdown-preview-sizer"); if(sizer && sizer.scrollHeight > sizer.parentElement.clientHeight) return; } event.preventDefault(); event.stopPropagation(); if(instant) { let scale = 1; scale -= event.deltaY / 700 * scale; scale = clamp(scale, 0.1, 10); let viewBounds = getViewBounds(); scaleCanvasAroundPoint(scale, viewBounds.centerX, viewBounds.centerY); } else { let isFirstFrame = speed == 0; speed -= (event.deltaY / 200); const maxSpeed = 0.14 * scale; speed = clamp(speed, -maxSpeed, maxSpeed); if (isFirstFrame) requestAnimationFrame(scrollAnimation); } }); let dt = 0; let lastTime = 0; let averageDt = 0; function scrollAnimation(currentTime) { dt = currentTime - lastTime; if (lastTime == 0) dt = 30; lastTime = currentTime; averageDt = dt * 0.05 + averageDt * 0.95; if (averageDt > 50) { console.log("Scrolling too slow, turning on instant scroll"); instant = true; return; } let oldScale = scale; scale += speed * (dt / 1000) * 30; scale = clamp(scale, 0.1, 10); let viewBounds = getViewBounds(); scaleCanvasAroundPoint(scale / oldScale, mouseX, mouseY); speed *= 0.4; if (Math.abs(speed) < 0.01) { speed = 0; lastTime = 0; } else requestAnimationFrame(scrollAnimation); } // fit all nodes to view on initialization after centering the camera // after any animations have possibly played setTimeout(fitViewToCanvas, 300); } /**Gets the bounding rect of the voew-content or markdown-preview-sizer*/ function getViewBounds() { let viewContentRect = viewContent.getBoundingClientRect(); let minX = viewContentRect.x; let minY = viewContentRect.y; let maxX = viewContentRect.x + viewContentRect.width; let maxY = viewContentRect.y + viewContentRect.height; let centerX = viewContentRect.x + viewContentRect.width / 2; let centerY = viewContentRect.y + viewContentRect.height / 2; return { x: minX, y: minY, width: maxX - minX, height: maxY - minY, minX: minX, minY: minY, maxX: maxX, maxY: maxY, centerX: centerX, centerY: centerY }; } /**Gets the bounding rect of all nodes in the canvas*/ function getNodesBounds() { let minX = Infinity; let minY = Infinity; let maxX = -Infinity; let maxY = -Infinity; canvasNodes.forEach(function (node) { let nodeRect = node.getBoundingClientRect(); if (nodeRect.x < minX) minX = nodeRect.x; if (nodeRect.y < minY) minY = nodeRect.y; if (nodeRect.x + nodeRect.width > maxX) maxX = nodeRect.x + nodeRect.width; if (nodeRect.y + nodeRect.height > maxY) maxY = nodeRect.y + nodeRect.height; }); let x = minX; let y = minY; let width = maxX - minX; let height = maxY - minY; let centerX = minX + width / 2; let centerY = minY + height / 2; return { x: x, y: y, width: width, height: height, minX: minX, minY: minY, maxX: maxX, maxY: maxY, centerX: centerX, centerY: centerY }; } function getCanvasBounds() { let canvasRect = canvas.getBoundingClientRect(); let x = canvasRect.x; let y = canvasRect.y; let width = canvasRect.width; let height = canvasRect.height; let centerX = canvasRect.x + canvasRect.width / 2; let centerY = canvasRect.y + canvasRect.height / 2; return { x: x, y: y, width: width, height: height, minX: x, minY: y, maxX: x + width, maxY: y + height, centerX: centerX, centerY: centerY }; } /**Sets the relative scale of the canvas around a point*/ function scaleCanvasAroundPoint(scaleBy, aroundPointX, aroundPointY) { let canvasBounds = getCanvasBounds(); let xCenterToTarget = aroundPointX - canvasBounds.x; let yCenterToTarget = aroundPointY - canvasBounds.y; let xCenterPin = canvasBounds.x + xCenterToTarget * scaleBy; let yCenterPin = canvasBounds.y + yCenterToTarget * scaleBy; let offsetX = aroundPointX - xCenterPin; let offsetY = aroundPointY - yCenterPin; scaleCanvas(scaleBy); translateCanvas(offsetX, offsetY); return { x: offsetX, y: offsetY }; } /**Sets the relative scale of the canvas*/ function scaleCanvas(scaleBy) { let newScale = Math.max(scaleBy * canvas.style.scale, 0.001); canvas.style.scale = newScale; canvasWrapper.style.setProperty("--zoom-multiplier", (1/(Math.sqrt(newScale))) ); } /**Sets the relative translation of the canvas*/ function translateCanvas(x, y) { let translate = canvas.style.translate; let split = translate.split(" "); let translateX = split.length > 0 ? parseFloat(translate.split(" ")[0].trim()) : 0; let translateY = split.length > 1 ? parseFloat(translate.split(" ")[1].trim()) : translateX; canvas.style.translate = \`\${translateX + x}px \${translateY + y}px\`; } /**Sets the absolute center of the view*/ function setViewCenter(x, y) { let viewContentRect = getViewBounds(); let deltaX = viewContentRect.centerX - x; let deltaY = viewContentRect.centerY - y; translateCanvas(deltaX, deltaY); } function getCanvasTranslation() { let translate = canvas.style.translate; let split = translate.split(" "); let translateX = split.length > 0 ? parseFloat(translate.split(" ")[0].trim()) : 0; let translateY = split.length > 1 ? parseFloat(translate.split(" ")[1].trim()) : translateX; return { x: translateX, y: translateY }; } /**Sets the absolute scale of the canvas background pattern*/ function scaleCanvasBackground(scaleBy) { let scaleX = scaleBy * canvasBackgroundPattern.getAttribute("width"); let scaleY = scaleBy * canvasBackgroundPattern.getAttribute("height"); canvasBackgroundPattern.setAttribute("width", scaleX); canvasBackgroundPattern.setAttribute("height", scaleY); } /**Sets the absolute translation of the canvas background pattern*/ function translateCanvasBackground(x, y) { canvasBackgroundPattern.setAttribute("x", x + canvasBackgroundPattern.getAttribute("x")); canvasBackgroundPattern.setAttribute("y", y + canvasBackgroundPattern.getAttribute("y")); } /**Fits the view to contain the given node*/ function fitViewToNode(node) { let nodeRect = getElBounds(node); let viewContentRect = getViewBounds(); let canvasBounds = getCanvasBounds(); let scale = 0.8 * Math.min(viewContentRect.width/nodeRect.width, viewContentRect.height/nodeRect.height); let canvasX = canvasBounds.x; let canvasY = canvasBounds.y; let canvToNodeX = (nodeRect.centerX - canvasX) * scale; let canvToNodeY = (nodeRect.centerY - canvasY) * scale; let newNodeX = canvasX + canvToNodeX; let newNodeY = canvasY + canvToNodeY; let deltaX = viewContentRect.centerX - newNodeX; let deltaY = viewContentRect.centerY - newNodeY; nodeRect = getElBounds(node); canvas.style.transition = "scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)"; scaleCanvas(scale); translateCanvas(deltaX, deltaY); setTimeout(function() { canvas.style.transition = ""; }, 550); } /**Fits the view to contain all nodes in the graph*/ function fitViewToCanvas() { let nodesRect = getNodesBounds(); let viewContentRect = getViewBounds(); let canvasBounds = getCanvasBounds(); let scale = 0.8 * Math.min(viewContentRect.width/nodesRect.width, viewContentRect.height/nodesRect.height); let canvasX = canvasBounds.x; let canvasY = canvasBounds.y; let canvToNodeX = (nodesRect.centerX - canvasX) * scale; let canvToNodeY = (nodesRect.centerY - canvasY) * scale; let newNodeX = canvasX + canvToNodeX; let newNodeY = canvasY + canvToNodeY; let deltaX = viewContentRect.centerX - newNodeX; let deltaY = viewContentRect.centerY - newNodeY; canvas.style.transition = "scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)"; scaleCanvas(scale); translateCanvas(deltaX, deltaY); setTimeout(function() { canvas.style.transition = ""; }, 550); } //#endregion //#region ----------------- Callouts ----------------- function setupCallouts(setupOnNode) { // MAKE CALLOUTS COLLAPSIBLE // if the callout title is clicked, toggle the display of .callout-content setupOnNode.querySelectorAll(".callout.is-collapsible .callout-title").forEach(function (element) { element.addEventListener("click", function () { var parent = this.parentElement; parent.classList.toggle("is-collapsed"); element.querySelector(".callout-fold").classList.toggle("is-collapsed"); slideToggle(parent.querySelector(".callout-content"), 100); }); }); } //#endregion //#region ----------------- Checkboxes ----------------- function setupCheckboxes(setupOnNode) { // Fix checkboxed toggling .is-checked setupOnNode.querySelectorAll(".task-list-item-checkbox").forEach(function (element) { element.addEventListener("click", function () { var parent = this.parentElement; parent.classList.toggle("is-checked"); parent.setAttribute("data-task", parent.classList.contains("is-checked") ? "x" : " "); }); }); setupOnNode.querySelectorAll(\`.plugin-tasks-list-item input[type="checkbox"]\`).forEach(function(checkbox) { checkbox.checked = checkbox.parentElement.classList.contains("is-checked"); }); setupOnNode.querySelectorAll('.kanban-plugin__item.is-complete').forEach(function(checkbox) { checkbox.querySelector('input[type="checkbox"]').checked = true; }); } //#endregion //#region ----------------- Code Blocks ----------------- function setupCodeblocks(setupOnNode) { // make code snippet block copy button copy the code to the clipboard setupOnNode.querySelectorAll(".copy-code-button").forEach(function (element) { element.addEventListener("click", function () { var code = this.parentElement.querySelector("code").textContent; navigator.clipboard.writeText(code); this.textContent = "Copied!"; // set a timeout to change the text back setTimeout(function () { setupOnNode.querySelectorAll(".copy-code-button").forEach(function (button) { button.textContent = "Copy"; }); }, 2000); }); }); } //#endregion //#region ----------------- Links ----------------- function setupLinks(setupOnNode) { setupOnNode.querySelectorAll(".internal-link, a.tag, .tree-link, .footnote-link").forEach(function(link) { link.addEventListener("click", function(event) { let target = link.getAttribute("href"); event.preventDefault(); event.stopPropagation(); if(!target) { console.log("No target found for link"); return; } let relativePathnameStrip = relativePathname.split("#")[0].split("?")[0]; if(target.startsWith("#") || target.startsWith("?")) target = relativePathnameStrip + target; loadDocument(target, true, !link.classList.contains("tree-link")); }); }); } //#endregion //#region ----------------- Sidebars ----------------- function setupSidebars() { if (!rightSidebar || !leftSidebar) return; //#region sidebar object references sidebarCollapseIcons[0].otherIcon = sidebarCollapseIcons[1]; sidebarCollapseIcons[1].otherIcon = sidebarCollapseIcons[0]; sidebarCollapseIcons[0].gutter = sidebarGutters[0]; sidebarCollapseIcons[1].gutter = sidebarGutters[1]; sidebarCollapseIcons[0].sidebar = sidebars[0]; sidebarCollapseIcons[1].sidebar = sidebars[1]; sidebarGutters[0].otherGutter = sidebarGutters[1]; sidebarGutters[1].otherGutter = sidebarGutters[0]; sidebarGutters[0].collapseIcon = sidebarCollapseIcons[0]; sidebarGutters[1].collapseIcon = sidebarCollapseIcons[1]; sidebars[0].otherSidebar = sidebars[1]; sidebars[1].otherSidebar = sidebars[0]; sidebars[0].gutter = sidebarGutters[0]; sidebars[1].gutter = sidebarGutters[1]; //#endregion sidebars.forEach(function (sidebar) { sidebar.collapsed = sidebar.classList.contains("is-collapsed"); sidebar.collapse = function (collapsed = true) { if (!collapsed && this.temporarilyCollapsed && deviceSize == "large-screen") this.gutter.collapse(true); if (!collapsed && document.body.classList.contains("floating-sidebars")) { function clickOutsideCollapse(event) { // don't allow bubbling into sidebar if (event.target.closest(".sidebar")) return; sidebar.collapse(true); document.body.removeEventListener("click", clickOutsideCollapse); } document.body.addEventListener("click", clickOutsideCollapse); } // if there isn't enough space for both sidebars then close the other one if (deviceSize == "phone") { if (!collapsed) sidebar.otherSidebar.fullCollapse(true, true); if (collapsed) sidebar.gutter.otherGutter.collapse(false, true); } if (deviceSize == "tablet") { if (!collapsed) sidebar.otherSidebar.collapse(true); } this.classList.toggle("is-collapsed", collapsed); this.collapsed = collapsed; } sidebar.temporaryCollapse = function (collapsed = true) { this.temporarilyCollapsed = true; this.collapse(true); this.gutter.collapse(false); this.collapsed = collapsed; } sidebar.fullCollapse = function (collapsed = true, force = false) { this.collapse(collapsed); this.gutter.collapse(true, force); this.collapsed = collapsed; } sidebar.toggleCollapse = function () { this.collapse(!this.collapsed); } sidebar.toggleFullCollapse = function () { this.fullCollapse(!this.collapsed); } }); sidebarGutters.forEach(function (gutter) { gutter.collapsed = gutter.classList.contains("is-collapsed"); gutter.collapse = function (collapsed, force = false) { if(!force) return; this.classList.toggle("is-collapsed", collapsed); this.collapsed = collapsed; } gutter.toggleCollapse = function () { this.collapse(!this.collapsed); } }); sidebarCollapseIcons.forEach(function (icon) { icon.addEventListener("click", function (event) { event.stopPropagation(); icon.sidebar.toggleCollapse(); }); }); if (!isMobile()) setupSidebarResize(); } function setupSidebarResize() { let leftHandle = document.querySelector('.sidebar-left .sidebar-handle'); let rightHandle = document.querySelector('.sidebar-right .sidebar-handle'); if (!leftHandle || !rightHandle) return; let resizingSidebar = null; let minResizeWidth = parseFloat(getComputedStyle(leftHandle.parentElement).fontSize) * 15; let collapseWidth = minResizeWidth / 4.0; let rightWidth = localStorage.getItem('sidebar-right-width'); let leftWidth = localStorage.getItem('sidebar-left-width'); if (rightWidth) document.querySelector('.sidebar-right').style.setProperty('--sidebar-width', rightWidth); if (leftWidth) document.querySelector('.sidebar-left').style.setProperty('--sidebar-width', leftWidth); function resizeMove(e) { if (!resizingSidebar) return; let isLeft = resizingSidebar.classList.contains("sidebar-left"); var distance = isLeft ? e.clientX : window.innerWidth - e.clientX; var newWidth = \`min(max(\${distance}px, 15em), 40vw)\`; // 15em is minResizeWidth if (distance < collapseWidth) { resizingSidebar.collapse(true); resizingSidebar.style.removeProperty('transition-duration'); } else { resizingSidebar.collapse(false); resizingSidebar.style.setProperty('--sidebar-width', newWidth); if (distance > minResizeWidth) resizingSidebar.style.transitionDuration = "0s"; } } function handleClick(e) { resizingSidebar = e.target.closest('.sidebar'); resizingSidebar.classList.add('is-resizing'); document.addEventListener('pointermove', resizeMove); document.addEventListener('pointerup', function () { document.removeEventListener('pointermove', resizeMove); var finalWidth = getComputedStyle(resizingSidebar).getPropertyValue('--sidebar-width'); let isLeft = resizingSidebar.classList.contains("sidebar-left"); localStorage.setItem(isLeft ? 'sidebar-left-width' : 'sidebar-right-width', finalWidth); resizingSidebar.classList.remove('is-resizing'); resizingSidebar.style.removeProperty('transition-duration'); }); } leftHandle.addEventListener('pointerdown', handleClick); rightHandle.addEventListener('pointerdown', handleClick); // reset sidebar width on double click function resetSidebarEvent(e) { let sidebar = e.target.closest('.sidebar'); if (sidebar) { sidebar.style.removeProperty('transition-duration'); sidebar.style.removeProperty('--sidebar-width'); let isLeft = sidebar.classList.contains("sidebar-left"); localStorage.removeItem(isLeft ? 'sidebar-left-width' : 'sidebar-right-width'); } } leftHandle.addEventListener('dblclick', resetSidebarEvent); rightHandle.addEventListener('dblclick', resetSidebarEvent); } /**Get the computed target sidebar width in px*/ function getSidebarWidthProp() { return getComputedPixelValue("--sidebar-width"); } //#endregion //#region ----------------- Theme ----------------- function setupThemeToggle() { if (!themeToggle) return; if (localStorage.getItem("theme") != null) { setThemeToggle(localStorage.getItem("theme") == "light"); } // set initial toggle state based on body theme class if (document.body.classList.contains("theme-light")) { setThemeToggle(true); } else { setThemeToggle(false); } function setThemeToggle(state, instant = false) { themeToggle.checked = state; if (instant) { var oldTransition = document.body.style.transition; document.body.style.transition = "none"; } if(!themeToggle.classList.contains("is-checked") && state) { themeToggle.classList.add("is-checked"); } else if (themeToggle.classList.contains("is-checked") && !state) { themeToggle.classList.remove("is-checked"); } if(!state) { if (document.body.classList.contains("theme-light")) { document.body.classList.remove("theme-light"); } if (!document.body.classList.contains("theme-dark")) { document.body.classList.add("theme-dark"); } } else { if (document.body.classList.contains("theme-dark")) { document.body.classList.remove("theme-dark"); } if (!document.body.classList.contains("theme-light")) { document.body.classList.add("theme-light"); } } if (instant) { setTimeout(function() { document.body.style.transition = oldTransition; }, 100); } localStorage.setItem("theme", state ? "light" : "dark"); } document.querySelector(".theme-toggle-input")?.addEventListener("change", event => { let newVal = !(localStorage.getItem("theme") == "light"); console.log("Theme toggle changed to: " + newVal); setThemeToggle(newVal); }); } //#endregion //#region ----------------- Scroll ----------------- let flashElement = null; let flashAnimation = null; function scrollIntoView(element, options, animate = true) { setTreeCollapsed(element, false, animate); const flashTiming = { duration: 1500, iterations: 1, delay: 300, }; const flashAnimationData = [ { opacity: 0 }, { opacity: 0.8 }, { opacity: 0.8 }, { opacity: 0.8 }, { opacity: 0.8 }, { opacity: 0.8 }, { opacity: 0 }, ]; if(flashElement) { flashElement.remove(); flashAnimation.cancel(); } flashElement = document.createElement("div"); flashElement.classList.add("scroll-highlight"); element.appendChild(flashElement); if(options) flashElement.scrollIntoView({ behavior: animate ? "smooth" : "auto", ...options }); else flashElement.scrollIntoView({ behavior: animate ? "smooth" : "auto" }); var savePos = element.style.position; element.style.position = "relative"; flashAnimation = flashElement.animate(flashAnimationData, flashTiming); flashAnimation.onfinish = function() { flashElement.remove(); element.style.position = savePos; } } function setupScroll(setupOnNode) { // hide elements clipped by scrollable areas in markdown-preview-view elements if(documentType != "canvas") return; let markdownViews = Array.from(setupOnNode.querySelectorAll(".markdown-preview-view")); let nextMarkdownViewId = 0; let marginMultiplier = 0.1; let maxMargin = 150; let margin = 0; markdownViews.forEach(async function (view) { console.log("Setting up markdown view"); let headers = Array.from(view.querySelectorAll(".heading-wrapper")); view.updateVisibleWindowMarkdown = function updateVisibleWindowMarkdown(allowVirtualization = true, allowDevirtualization = true) { let scrollBounds = view.getBoundingClientRect(); margin = Math.min(scrollBounds.height * marginMultiplier, maxMargin); let scrollBoundsTop = scrollBounds.top - margin; let scrollBoundsBottom = scrollBounds.bottom + margin; async function updateHeader(header) { let bounds = header?.getBoundingClientRect(); if (!bounds) return; let isClipped = (bounds.top < scrollBoundsTop && bounds.bottom < scrollBoundsTop) || (bounds.top > scrollBoundsBottom && bounds.bottom > scrollBoundsBottom); if (isClipped && allowVirtualization) { header.hide(); } else if (!isClipped && allowDevirtualization) { header.show(); } } for (let i = 0; i < headers.length; i++) { let h = headers[i]; if(h) updateHeader(h); } } let lastScrollTop = 0; view.addEventListener("scroll", function() { if (Math.abs(view.scrollTop - lastScrollTop) > margin / 3) { view.updateVisibleWindowMarkdown(false, true); } lastScrollTop = view.scrollTop; }); }); async function periodicUpdate() { if(markdownViews.length > 0) { markdownViews[nextMarkdownViewId].updateVisibleWindowMarkdown(); nextMarkdownViewId = (nextMarkdownViewId + 1) % markdownViews.length; } } setInterval(periodicUpdate, 200); } //#endregion //#region ----------------- Plugins ----------------- // Excalidraw function setupExcalidraw(setupOnNode) { setupOnNode.querySelectorAll(".excalidraw-svg svg").forEach(function (svg) { let isLight = svg.querySelector("rect").getAttribute("fill") > "#7F7F7F"; svg.classList.add(isLight ? "light" : "dark"); }); } //#endregion //#region ----------------- Search ----------------- // search box let index; let searchResults; async function setupSearch() { if (isFileProtocol) return; searchInput = document.querySelector('input[type="search"]'); if (!searchInput) return; const indexResp = await fetch('lib/search-index.json'); const indexJSON = await indexResp.text(); index = MiniSearch.loadJSON(indexJSON, { fields: ['title', 'path', 'tags', 'headers'] }); const inputClear = document.querySelector('.search-input-clear-button'); inputClear.addEventListener('click', (event) => { search(""); }); searchInput.addEventListener('input', (event) => { const query = event.target.value ?? ""; if (startsWithAny(query, ["#", "tag:", "title:", "name:", "header:", "H:"])) { searchInput.style.color = "var(--text-accent)"; } else { searchInput.style.color = ""; } search(query); }); searchResults = document.createElement('div'); searchResults.setAttribute('id', 'search-results'); } async function search(query) { searchInput.value = query; // parse special query filters let searchFields = ['title', 'content', 'tags', 'headers', 'path']; if (query.startsWith("#")) searchFields = ['tags', 'headers']; if (query.startsWith("tag:")) { query = query.substring(query.indexOf(":") + 1); searchFields = ['tags']; } if (startsWithAny(query, ["title:", "name:"])) { query = query.substring(query.indexOf(":") + 1); searchFields = ['title']; } if (startsWithAny(query, ["header:", "H:"])) { query = query.substring(query.indexOf(":") + 1); searchFields = ['headers']; } if (startsWithAny(query, ["path:"])) { query = query.substring(query.indexOf(":") + 1); searchFields = ['path']; } if (query.length >= 1) { const results = index.search(query, { prefix: true, fuzzy: 0.3, boost: { title: 4, headers: 3, tags: 2, path: 1 }, fields: searchFields }); // search through the file tree and hide documents that don't match the search let showPaths = []; let hintLabels = []; for (let result of results) { // only show the most relevant results if (((result.score < results[0].score * 0.33 || showPaths.length > 12) && showPaths.length > 3) || result.score < results[0].score * 0.1) break; showPaths.push(result.path); let hints = []; let breakEarly = false; for (match in result.match) { if (result.match[match].includes("headers")) { for (let header of result.headers) { if (header.toLowerCase().includes(match.toLowerCase())) { hints.push(header); if (query.toLowerCase() != match.toLowerCase()) { breakEarly = true; break; } } } } if (breakEarly) break; } hintLabels.push(hints); } let fileTree = document.querySelector(".file-tree"); if (fileTree) { // filter the file tree and sort it by the order of the search results filterFileTree(showPaths, hintLabels, query).then(() => sortFileTreeDocuments((a, b) => { if (!a || !b) return 0; let aPath = getVaultRelativePath(a.firstChild.href); let bPath = getVaultRelativePath(b.firstChild.href); return showPaths.findIndex((path) => aPath.startsWith(path)) - showPaths.findIndex((path) => bPath.startsWith(path)); })); } else { const list = document.createElement('div'); results.slice(0, 10).forEach(result => { const item = document.createElement('div'); item.classList.add('search-result'); const link = document.createElement('a'); link.classList.add('tree-link'); const searchURL = result.path + '?mark=' + encodeURIComponent(query); link.setAttribute('href', searchURL); link.appendChild(document.createTextNode(result.title)); item.appendChild(link); list.append(item); }); searchResults.replaceChildren(list); searchInput.parentElement.after(searchResults); initializePageEvents(searchResults); } } else { if (searchResults && searchResults.parentElement) searchResults.parentNode.removeChild(searchResults); clearCurrentDocumentSearch(); if (fileTree) clearFileTreeFilter().then(() => sortFileTreeAlphabetically()); } } function startsWithAny(string, prefixes) { for (let i = 0; i < prefixes.length; i++) { if (string.startsWith(prefixes[i])) return true; } return false; } async function searchCurrentDocument(query) { clearCurrentDocumentSearch(); const textNodes = getTextNodes(document.querySelector(".markdown-preview-sizer") ?? documentContainer); textNodes.forEach(async node => { const content = node.nodeValue; const newContent = content.replace(new RegExp(query, 'gi'), match => \`\${match}\`); if (newContent !== content) { const tempDiv = document.createElement('div'); tempDiv.innerHTML = newContent; const newNodes = Array.from(tempDiv.childNodes); newNodes.forEach(newNode => { if (newNode.nodeType != Node.TEXT_NODE) { newNode.setAttribute('class', 'search-mark'); } node.parentNode.insertBefore(newNode, node); }); node.parentNode.removeChild(node); } }); let firstMark = document.querySelector(".search-mark"); // wait for page to fade in setTimeout(() => { if(firstMark) scrollIntoView(firstMark, { behavior: "smooth", block: "start" }); }, 500); } function clearCurrentDocumentSearch() { document.querySelectorAll(".search-mark").forEach(node => { node.outerHTML = node.innerHTML; }); } function getTextNodes(element) { const textNodes = []; const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null, false); let node; while (node = walker.nextNode()) { textNodes.push(node); } return textNodes; } //#endregion `; // assets/plugin-styles.txt.css var plugin_styles_txt_default = `/*#region Variables */ body { --color-fade-speed: 0.2s; } /*#endregion */ /*#region Tree */ /* Base tree */ .tree-container { position: relative; height: 100%; width: auto; margin-top: 3em; margin-bottom: 0; } .tree-container .tree-header { display: flex; flex-direction: row; align-items: center; position: absolute; top: -3em; } .tree-container .tree-header .sidebar-section-header { margin-block: 1em; white-space: nowrap; } .tree-container:has(.tree-scroll-area:empty) { display: none; } body .webpage-container .tree-container .tree-scroll-area { width: 100%; height: 100%; max-height: 100%; overflow-y: auto; border-radius: 0; position: absolute; margin: 0; background-color: transparent; } .tree-container .tree-item { display: flex; flex-direction: column; align-items: flex-start; padding: 0; padding-block: 1px; overflow: hidden !important; flex: none; } .tree-container .tree-item-children { padding: 0; margin: 0; border-left: none; width: 100%; } .tree-item-title > * { padding: 0; margin: 0; overflow: hidden; display: inline; text-overflow: ellipsis; } .tree-container .tree-item-icon * { color: var(--text-muted); font-family: emoji; } .tree-container .tree-item-icon :is(svg,img) { -webkit-mask-image-repeat: no-repeat; -webkit-mask-image-position: center; max-width: 1.3em; height: 100%; } /* Skip outer wrappers around icons */ .tree-container .tree-item-icon *:has(svg) { display: contents !important; } .tree-container .tree-item-icon { min-width: 1.6em; max-width: 1.6em; margin-left: 2px; display: flex; align-items: center; justify-content: flex-start; } .tree-container .tree-item.mod-active > .tree-link > .tree-item-contents { color: var(--interactive-accent); } .tree-container .tree-link { position: relative; display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; border-radius: var(--radius-s); color: var(--nav-item-color); text-decoration-line: none; width: -webkit-fill-available; width: -moz-available; width: fill-available; margin-left: var(--tree-horizontal-spacing); } .tree-container .tree-link:active { color: var(--nav-item-color-active); } .tree-container .tree-item-contents { width: 100%; height: 100%; margin: 0 !important; padding: 0 !important; font-size: unset !important; padding-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)) !important; border-radius: var(--radius-s); display: flex !important; flex-direction: row !important; align-items: center !important; color: var(--nav-item-color); transition: background-color .1s; } .tree-container .tree-item-title { overflow: hidden; text-overflow: ellipsis !important; text-wrap: nowrap !important; white-space: nowrap !important; position: relative !important; border: none !important; width: 100%; width: -webkit-fill-available; width: -moz-available; width: fill-available; background-color: transparent !important; padding-top: calc(var(--tree-vertical-spacing)/ 2) !important; padding-bottom: calc(var(--tree-vertical-spacing)/ 2) !important; margin: 0 !important; left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important; } .tree-container .tree-item-title::after { right: 0; position: absolute !important; margin-right: 0.5em !important; } /* Find tree contents in folders with no other folders in them */ .tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file > .tree-link > .tree-item-contents { padding-left: calc(var(--tree-horizontal-spacing) * 2) !important; } .tree-container .collapse-icon { translate: calc(0px - var(--collapse-arrow-size) - var(--tree-horizontal-spacing) * 2) 0; position: absolute; height: 100%; padding: var(--tree-horizontal-spacing); } .tree-container .tree-item.mod-tree-folder > .tree-link > .collapse-icon { width: 100%; } .collapse-icon:hover { color: var(--nav-item-color-hover); } .tree-container .clickable-icon { width: 3.2em; height: 2.2em; } .tree-container .tree-item.is-collapsed > .tree-link > .tree-item-contents > .collapse-icon > svg { transition: transform 0.1s ease-in-out; transform: rotate(-90deg); } .tree-container .tree-item-contents:hover { color: var(--nav-item-color-hover); } .filtered-out { display: none !important; } /* Indentation guide */ .tree-container > .tree-scroll-area > * .tree-item { margin-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)/2); } .tree-container > .tree-scroll-area > * .tree-item { border-left: var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color); } .tree-container .tree-scroll-area > * > * > .tree-item { margin-left: calc(var(--tree-horizontal-spacing) + var(--collapse-arrow-size)/2); } .tree-container:not(.mod-nav-indicator) .tree-scroll-area .tree-item { border-color: transparent !important; } .tree-container .tree-item.mod-active { border-color: var(--interactive-accent) !important; box-shadow: 2px 0px 0px 0px var(--interactive-accent) inset; transition: box-shadow 0.4s ease-in-out; } .tree-container .tree-item:hover:not(.mod-active):not(.mod-collapsible):not(:has(.tree-item:hover)):not(.mod-root > * > *) /* Hover */ { border-left: var(--nav-indentation-guide-width) solid var(--nav-item-color-hover); } .tree-container .tree-link:hover, .tree-container .mod-active > .tree-link { background-color: var(--nav-item-background-hover); cursor: pointer; } .webpage-container .tree-container .tree-item:not(.mod-collapsible) > .tree-item-children > .tree-item > .tree-link, .webpage-container .tree-container > .tree-scroll-area > .tree-item > .tree-link { margin-left: 0 !important; } /* Special */ .tree-container.outline-tree .tree-item[data-depth='1'] > .tree-link > .tree-item-contents { font-weight: 900; font-size: 1.1em; margin-left: 0; padding-left: 1em; } .nav-folder.mod-root .nav-folder>.nav-folder-children { padding: 0 !important; margin: 0 !important; border: none !important; } .nav-file { border-radius: 0 !important; } .nav-folder.mod-root .nav-folder > .nav-folder-children { border-radius: var(--radius-s) !important;; } .webpage-container .nav-file-tag { margin-right: 1em; } .nav-file-title-content, .nav-folder-title-content { margin-bottom: unset !important; display: unset !important; border-radius: unset !important; cursor: unset !important; font-size: unset !important; font-weight: unset !important; line-height: unset !important; padding: unset !important; } /*#endregion */ /*#region Headers */ #webpage-icon :is(svg, img) { width: 100%; height: 100%; box-shadow: none !important; border: none !important; border-radius: 0 !important; stroke: currentColor; } #webpage-icon *:has(:is(svg, img)) { display: contents !important; } #webpage-icon:has(:is(svg, img)) { font-size: 40px; width: 40px; height: 40px; } #webpage-icon { font-size: 40px; margin-bottom: 8px; font-family: emoji; width: fit-content; } body.show-inline-title .page-title { font-weight: var(--inline-title-weight); font-size: var(--inline-title-size); font-style: var(--inline-title-style); font-variant: var(--inline-title-variant); font-family: var(--inline-title-font); letter-spacing: -0.015em; color: var(--inline-title-color); } .heading { position: relative; } .heading-wrapper.is-collapsed > .heading::after { content: "..." !important; display: inline-block !important; position: absolute !important; margin: 0 !important; padding: 0 !important; margin-left: 0.3em !important; color: var(--text-muted); } .heading-wrapper { transition: height ease-in-out, margin-bottom ease-in-out; transition-duration: 0.2s; display: flex; flex-direction: column; position: relative; } /* high specificity in order to override other style */ html > body > .webpage-container > .document-container > .markdown-preview-view > .markdown-preview-sizer > div { margin-inline: 0 !important; margin: 0 !important; padding: 0 !important; width: 100%; max-width: 100%; } .markdown-rendered .heading-wrapper:has(> .heading-children > div:last-child > :is(p,pre,table,ul,ol)) + .heading-wrapper > .heading:first-child { margin-top: var(--heading-spacing); } .heading-children { transition: height ease-in-out, margin-bottom ease-in-out; transition-duration: 0.2s; display: flow; position: relative; contain: inline-size; } .heading-children.is-collapsed { padding-top: 0em; } .heading-wrapper.is-collapsed > .heading-children, .heading-wrapper.is-animating > .heading-children { overflow: hidden; overflow: clip; } .heading-wrapper > .heading > .heading-after { display: none; } .heading-wrapper.is-collapsed > .heading > .heading-after { display: inline-block; margin-left: 0.3em; opacity: 0.4; font-size: 1em; cursor: auto; user-select: none; } .heading-wrapper.is-hidden > * { display: none; } .heading-wrapper.is-hidden { visibility: hidden; } .collapse-icon:not(.list-collapse-indicator) svg.svg-icon { color: var(--nav-collapse-icon-color); width: var(--collapse-arrow-size); height: var(--collapse-arrow-size); transition: transform 100ms ease-in-out 0s; stroke-width: 4px; min-width: 10px; min-height: 10px; } div.is-collapsed > * > .heading-collapse-indicator.collapse-icon > svg { transition: transform 0.1s ease-in-out; transform: rotate(-90deg); } .heading-wrapper .heading-collapse-indicator { opacity: 0; transition: opacity 0.15s ease-in-out; position: absolute; z-index: 1; padding: 0 !important; padding-left: 40px !important; padding-right: 40px !important; left: -40px !important; } .heading:hover > .heading-collapse-indicator, .heading-wrapper .heading-collapse-indicator:hover { opacity: 1; } .heading-wrapper-span { position: absolute; width: 200vw; height: calc(100% + var(--p-spacing) * 2); top: calc(0px - var(--p-spacing)); left: -100vw; z-index: -1; } .markdown-embed .markdown-embed-content .markdown-preview-view .heading-wrapper-span { width: 100%; } /*#endregion */ /*#region Theme Toggle */ .theme-toggle-container { --toggle-width: 3.5em; --toggle-height: 1.75em; --border-radius: calc(var(--toggle-height) / 2); --handle-width: calc(var(--toggle-height) * 0.65); --handle-radius: calc(var(--handle-width) / 2); --handle-margin: calc((var(--toggle-height) / 2.0) - var(--handle-radius)); --handle-translation: calc(var(--toggle-width) - var(--handle-width) - (var(--handle-margin) * 2)); display: inline-block; cursor: pointer; } .sidebar-section-header, .clickable-icon { transition: color var(--color-fade-speed) ease-in-out; } /* animation to expand width, move handle, then contract width */ @keyframes toggle-slide-right { 0% { width: var(--handle-width); transform: translateX(0); } 50% { width: calc(var(--toggle-width) * 0.5); } 90% { width: var(--handle-width); } 100% { transform: translateX(var(--handle-translation)); } } @keyframes toggle-slide-left { 0% { width: var(--handle-width); transform: translateX(calc(var(--handle-translation) - ((var(--toggle-width) * 0.33) - var(--handle-width)))); } 70% { width: calc(var(--toggle-width) * 0.5); } 100% { width: var(--handle-width); transform: translateX(0); } } /* just exapnd and contract */ @keyframes toggle-expand-right { 0% { width: var(--handle-width); } 100% { width: calc(var(--toggle-width) * 0.33); } } @keyframes toggle-expand-left { 0% { width: var(--handle-width); transform: translateX(var(--handle-translation)); } 100% { width: calc(var(--toggle-width) * 0.33); transform: translateX(calc(var(--handle-translation) - ((var(--toggle-width) * 0.33) - var(--handle-width)))); } } @keyframes toggle-contract { 0% { width: calc(var(--toggle-width) * 0.33); } 100% { width: var(--handle-width); } } .theme-toggle-input { display: none; z-index: 1000; } /* Fill in dark mode / default */ .toggle-background { position: relative; width: var(--toggle-width); height: var(--toggle-height); border-radius: var(--border-radius); background-color: var(--background-modifier-border); transition: background-color var(--color-fade-speed); z-index: 1000; animation-duration: 0.2s; } /* Handle default */ .toggle-background::before { content: ""; position: absolute; left: var(--handle-margin); top: var(--handle-margin); height: var(--handle-width); width: var(--handle-width); border-radius: var(--handle-radius); background-color: var(--text-normal); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); animation: toggle-slide-left ease-in-out normal both; animation-duration: inherit; z-index: 1000; } /* handle light*/ .theme-toggle-input:checked ~ .toggle-background::before { animation: toggle-slide-right ease-in-out normal both; animation-duration: inherit; } .theme-toggle-input:active ~ .toggle-background::before { animation: toggle-expand-right ease-in-out normal both; animation-duration: inherit; } .theme-toggle-input:active:checked ~ .toggle-background::before { animation: toggle-expand-left ease-in-out normal both; animation-duration: inherit; } /* sun moon icon icon default */ .toggle-background::after { content: ""; position: absolute; right: var(--handle-margin); top: calc(var(--handle-margin)); height: var(--handle-width); width: var(--handle-width); transition: transform 0.3s; background: url('data:image/svg+xml,') no-repeat center center; transform: scale(0.9); } /* sun moon icon icon light */ .theme-toggle-input:checked ~ .toggle-background::after { transform: translateX(calc(var(--handle-translation) * -1)) scale(0.9); background: url('data:image/svg+xml,') no-repeat center center; } /*#endregion */ /*#region Graph View */ .graph-view-wrapper { --graph-view-max-height: 35vh; } #graph-canvas { width: 100%; height: 100%; aspect-ratio: 1; transition: opacity 0.2s ease-in-out; } .graph-view-container.expanded { position: fixed; width: 90%; height: 90%; max-height: unset; right: 5%; top: 5%; background-color: var(--background-secondary); z-index: 100; } body:is(.is-phone, .is-tablet) .graph-view-container.expanded { width: 95%; height: 95%; right: 2.5%; top: 2.5%; } .graph-view-container { position: relative; width: 100%; aspect-ratio: 1; max-height: var(--graph-view-max-height); display: flex; transition: background-color var(--color-fade-speed) ease-in-out; touch-action: none; border: 1px solid var(--modal-border-color); border-radius: var(--modal-radius); overflow: hidden; } .graph-icon { cursor: pointer; color: var(--text-muted); } .graph-view-container .graph-icon>svg { width: 24px; height: 24px; background-color: var(--color-base-00); outline-width: 6px; outline-color: var(--color-base-00); outline-offset: -1px; outline-style: solid; border-radius: 100px; margin: 10px; transition: outline-color, background-color; transition-timing-function: ease-in-out; transition-duration: var(--color-fade-speed); } .graph-view-placeholder { padding: 0; width: 100%; aspect-ratio: 1; max-height: var(--graph-view-max-height); position: relative; flex: none; } .graph-view-placeholder:has(.expanded) { border-radius: var(--modal-radius); border: 1px solid var(--modal-border-color); } .scale-down { transition: transform 0.2s ease-in-out; transform: scale(0.9); } .scale-up { transition: transform 0.2s ease-in-out; transform: scale(1); } .graph-expand { position: absolute; top: 5px; right: 5px; } /*#endregion */ /*#region Canvas */ body :is(.canvas-node-container, .canvas-wrapper) { cursor: unset !important; } .canvas { translate: 0 0; scale: 1 1; will-change: translate, scale; } .canvas-controls { display: none; cursor: default !important; } .canvas-card-menu { display: none; cursor: default !important; } .canvas-node-content-blocker { pointer-events: none; } /*#endregion */ /*#region Phone */ body.is-phone .sidebar { font-size: 1.15em; --tree-vertical-spacing: 0.9em; --sidebar-width: 85vw !important; } body.is-phone { --collapse-arrow-size: 13px; --tree-vertical-spacing: 0.8em; --tree-horizontal-spacing: 0.5em; } body.is-phone .heading-wrapper .heading-collapse-indicator { transition: transform 0.2s ease-in-out 0.2s; } /*#endregion */ /*#region Loading */ .loading-icon { --width: 80px; --height: 80px; display: inline-block; position: fixed; left: calc(50% - var(--width) / 2); top: calc(50% - var(--height) / 2); width: var(--width); height: var(--height); opacity: 0; transition: opacity 0.5s ease-in-out; pointer-events: none; } .loading-icon.show { opacity: 1; } .loading-icon div { position: absolute; top: 33px; width: 13px; height: 13px; border-radius: 50%; background: var(--interactive-accent); animation-timing-function: cubic-bezier(0, 1, 1, 0); } .loading-icon div:nth-child(1) { left: 8px; animation: lds-ellipsis1 0.6s infinite; } .loading-icon div:nth-child(2) { left: 8px; animation: lds-ellipsis2 0.6s infinite; } .loading-icon div:nth-child(3) { left: 32px; animation: lds-ellipsis2 0.6s infinite; } .loading-icon div:nth-child(4) { left: 56px; animation: lds-ellipsis3 0.6s infinite; } .loading-icon:not(.show) div { animation-play-state: paused; } @keyframes lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } } @keyframes lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } } @keyframes lds-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } } /*#endregion */ /*#region Media Queries */ @media print { body .webpage-container .document-container * { overflow: visible !important; overflow-y: visible !important; overflow-x: visible !important; } html body.publish :is(.sidebar, script, style, include) { display: none !important; } :root, html body.publish > :is(.webpage-container, .document-container, .markdown-preview-view):not(script, style, include) { display: contents !important; } :root, html body.publish .document-container > .markdown-preview-view { background-color: transparent !important; } body { display: inline !important; background: var(--background-primary); } .document-container > .markdown-preview-view > .markdown-preview-sizer { padding: 0 !important; margin: 0 !important; padding: var(--file-margins) !important; padding-bottom: 0 !important; } html body.publish :is(.document-container, .markdown-preview-view) { margin: 0 !important; padding: 0 !important; } } /*#endregion */ /*#region Search */ .tree-hint-label { font-size: var(--font-smallest); color: var(--text-accent); width: 100%; width: -webkit-fill-available; width: -moz-available; width: fill-available; white-space: pre-wrap; text-decoration-line: none; } .tree-hint-label:hover { text-decoration-line: underline; } .tree-hint-container { width: 100%; padding-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)); padding-bottom: calc(var(--tree-vertical-spacing) / 2); display: flex; flex-direction: column; } /* find hints inside folders with no other folders in them */ .tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file > .tree-link > .tree-hint-container { padding-left: calc(var(--tree-horizontal-spacing) * 2); } .tree-item-contents:has(.tree-item-icon) + .tree-hint-container { margin-left: calc(1.6em + 2px); } a.tree-hint-label:hover { text-decoration-line: underline; } .search-mark { margin: 0 !important; padding: 0 !important; scroll-margin: 2em !important; } .search-input-container:has(+ #search-results) > input[type="search"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } input[type=search] { box-shadow: none!important; height: 2.5em; font-size: 1em; transition: background, background-color, border; transition-duration: var(--color-fade-speed); transition-timing-function: ease-in-out; } .search-input-container { width: 100% !important; } .search-input-container::before { mask-image: url("data:image/svg+xml,"); mask-repeat: no-repeat; top: 50%; transform: translateY(-50%); } /*#endregion */ /*#region Sidebar Resize */ .sidebar .sidebar-handle:hover ~ .sidebar-content, .sidebar.is-resizing .sidebar-content { box-shadow: 0 0 0 var(--divider-width-hover) var(--divider-color-hover); } .sidebar-handle { width: min(max(calc(var(--sidebar-margin) / 2.0), 3px), 12px); height: calc(100vh - 2 * var(--radius-l)); margin-top: var(--radius-l); margin-bottom: var(--radius-l); top: 0; position: absolute; cursor: ew-resize; z-index: 1; transition: background-color .2s ease-in-out; } .sidebar-left .sidebar-handle { right: 0; } .sidebar-right .sidebar-handle { left: 0; } /*#endregion */ /* Themes */ /*#region General */ .nav-folder-children .nav-folder-title-content::before { margin-right: 0.5em; } .tree-item::before { margin-left: calc(var(--tree-horizontal-spacing) - 0.3em); } .tree-item-contents:has(.tree-item-icon) .tree-item-title::before, .tree-item-contents:has(.tree-item-icon)::before, .tree-item:has(.tree-item-contents > .tree-item-icon)::before { display: none !important; } /*#endregion */ /*#region AnuPpuccin */ /* AnuPpuccin rainbow indent support */ .anp-simple-rainbow-color-toggle.anp-simple-rainbow-indentation-toggle .tree-container.file-tree .tree-item { border-color: rgba(var(--rainbow-folder-color), 0.5); } /* AnuPpuccin folder icon support */ .anp-collapse-folders .tree-container .tree-item .collapse-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; background-color: currentColor; display: flex; flex-basis: 100%; height: 16px; width: 17px; } .anp-collapse-folders .tree-container .tree-item.is-collapsed .collapse-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A"); } .anp-file-icons .nav-file .nav-file-title::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; background-color: currentColor; content: ""; display: flex; flex-shrink: 0; height: var(--size-4-4); margin-left: calc(-1 * var(--size-4-5)); opacity: var(--icon-opacity); position: absolute; width: var(--size-4-4); } .anp-collapse-folders .tree-container .tree-item .collapse-icon:hover { color: currentColor; } .anp-collapse-folders .tree-container .tree-item .collapse-icon svg { display: none; } /*#endregion */ /* Plugins: */ /*#region Kanban */ .document-container .kanban-plugin { position: absolute; padding: 0; margin: 0; height: 100%; } .document-container .kanban-plugin { font-family: var(--font-text, var(--default-font)); font-size: .875rem; line-height: var(--line-height-tight); width: unset; overflow-y: unset; overflow-wrap: unset; color: unset; user-select: unset; -webkit-user-select: unset; } .document-container .kanban-plugin__item-button-wrapper, .kanban-plugin__lane-grip, .kanban-plugin__lane-settings-button.clickable-icon, .kanban-plugin__item-postfix-button.clickable-icon { display: none; } /*#endregion */ /*#region Excalidraw */ .excalidraw-svg rect, .excalidraw-plugin rect { fill: transparent; } body.theme-dark .excalidraw-svg svg.dark, body.theme-dark .excalidraw-plugin svg.dark, body.theme-light .excalidraw-svg svg.light, body.theme-light .excalidraw-plugin svg.light { filter: invert(93%) hue-rotate(180deg); } .excalidraw-plugin > svg { width: 100%; height: 100%; } .excalidraw-plugin { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; padding: 10px; } /*#endregion */ /*#region Obsidian Columns Plugin */ .columnParent { display: flex; padding: 15px 20px; flex-wrap: wrap; gap: 20px; } .columnParent { white-space: normal; } .columnChild { flex-grow: 1; flex-basis: 0px; } /*#endregion */ /*#region Banners */ .obsidian-banner .lock-button { display: none; } .markdown-preview-view:has(.obsidian-banner-wrapper) { padding-top: 0 !important; } /*#endregion */ /*#region Mind Map */ .view-content:has(.mm-mindmap) { overflow-y: none; } .view-content .mm-mindmap { transform: scale(1); translate: -4000px -4000px; top: 70%; left: 50%; position: absolute; overflow: hidden; width: 100vw; } /*#endregion */ `; // assets/deferred.txt.js var deferred_txt_default = `async function loadIncludes() { if (location.protocol != "file:") { // replace include tags with the contents of the file let includeTags = document.querySelectorAll("include"); for (let i = 0; i < includeTags.length; i++) { let includeTag = includeTags[i]; let includePath = includeTag.getAttribute("src"); try { const request = await fetch(includePath); if (!request.ok) { console.log("Could not include file: " + includePath); includeTag?.remove(); continue; } let includeText = await request.text(); let docFrag = document.createRange().createContextualFragment(includeText); let includeChildren = Array.from(docFrag.children); for (let child of includeChildren) { child.classList.add("hide"); child.style.transition = "opacity 0.5s ease-in-out"; setTimeout(() => { child.classList.remove("hide"); }, 10); }; includeTag.before(docFrag); includeTag.remove(); console.log("Included file: " + includePath); } catch (e) { includeTag?.remove(); console.log("Could not include file: " + includePath, e); continue; } } } else { let e = document.querySelectorAll("include"); if (e.length > 0) { var error = document.createElement("div"); error.id = "error"; error.textContent = "Web server exports must be hosted on an http / web server to be viewed correctly."; error.style.position = "fixed"; error.style.top = "50%"; error.style.left = "50%"; error.style.transform = "translate(-50%, -50%)"; error.style.fontSize = "1.5em"; error.style.fontWeight = "bold"; error.style.textAlign = "center"; document.body.appendChild(error); document.querySelector(".document-container")?.classList.remove("hide"); } } } document.addEventListener("DOMContentLoaded", () => { loadIncludes(); }); let isFileProtocol = location.protocol == "file:"; function waitLoadScripts(scriptNames, callback) { let scripts = scriptNames.map(name => document.getElementById(name + "-script")); let index = 0; function loadNext() { let script = scripts[index]; index++; if (!script || script.getAttribute('loaded') == "true") // if already loaded { if (index < scripts.length) loadNext(); } if (index < scripts.length) script.addEventListener("load", loadNext); else callback(); } loadNext(); } `; // assets/deferred.txt.css var deferred_txt_default2 = "/* Define default values for variables */\nbody\n{\n --line-width: 40em;\n --line-width-adaptive: 40em;\n --file-line-width: 40em;\n --sidebar-width: min(20em, 80vw);\n --collapse-arrow-size: 11px;\n --tree-horizontal-spacing: 0.6em;\n --tree-vertical-spacing: 0.6em;\n --sidebar-margin: 12px;\n}\n\n/*#region Sidebars */\n\n.sidebar {\n height: 100%;\n min-width: calc(var(--sidebar-width) + var(--divider-width-hover));\n max-width: calc(var(--sidebar-width) + var(--divider-width-hover));\n font-size: 14px;\n z-index: 10;\n\n position: relative;\n overflow: hidden;\n /* overflow: clip; */\n \n transition: min-width ease-in-out, max-width ease-in-out;\n transition-duration: .2s;\n contain: size;\n}\n\n.sidebar-left {\n left: 0;\n}\n\n.sidebar-right {\n right: 0;\n}\n\n.sidebar.is-collapsed {\n min-width: 0;\n max-width: 0;\n}\n\nbody.floating-sidebars .sidebar {\n position: absolute;\n}\n\n.sidebar-content {\n height: 100%;\n min-width: calc(var(--sidebar-width) - var(--divider-width-hover));\n top: 0;\n padding: var(--sidebar-margin);\n padding-top: 4em;\n line-height: var(--line-height-tight);\n background-color: var(--background-secondary);\n transition: background-color,border-right,border-left,box-shadow;\n transition-duration: var(--color-fade-speed);\n transition-timing-function: ease-in-out;\n position: absolute;\n display: flex;\n flex-direction: column;\n}\n\n/* If the sidebar isn't collapsed the content should have the same width as it */\n.sidebar:not(.is-collapsed) .sidebar-content {\n min-width: calc(max(100%,var(--sidebar-width)) - 3px);\n max-width: calc(max(100%,var(--sidebar-width)) - 3px);\n}\n\n.sidebar-left .sidebar-content\n{\n left: 0;\n border-top-right-radius: var(--radius-l);\n border-bottom-right-radius: var(--radius-l);\n}\n\n.sidebar-right .sidebar-content \n{\n right: 0;\n border-top-left-radius: var(--radius-l);\n border-bottom-left-radius: var(--radius-l);\n}\n\n/* Hide empty sidebars */\n.sidebar:has(.sidebar-content:empty):has(.topbar-content:empty)\n{\n display: none;\n}\n\n.sidebar-topbar {\n height: 2em;\n width: var(--sidebar-width);\n top: var(--sidebar-margin);\n padding-inline: var(--sidebar-margin);\n z-index: 1;\n\n position: fixed;\n display: flex;\n align-items: center;\n\n transition: width ease-in-out;\n transition-duration: inherit;\n}\n\n.sidebar.is-collapsed .sidebar-topbar {\n width: calc(2.3em + var(--sidebar-margin) * 2);\n}\n\n.sidebar .sidebar-topbar.is-collapsed\n{\n width: 0;\n}\n\n.sidebar-left .sidebar-topbar {\n left: 0;\n}\n\n.sidebar-right .sidebar-topbar {\n right: 0;\n}\n\n.topbar-content {\n overflow: hidden;\n overflow: clip;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n transition: inherit;\n}\n\n.sidebar.is-collapsed .topbar-content {\n width: 0;\n transition: inherit;\n}\n\n.clickable-icon.sidebar-collapse-icon {\n background-color: transparent;\n color: var(--icon-color-focused);\n padding: 0!important;\n margin: 0!important;\n height: 100%!important;\n width: 2.3em !important;\n margin-inline: 0.14em!important;\n position: absolute;\n}\n\n.sidebar-left .clickable-icon.sidebar-collapse-icon {\n transform: rotateY(180deg);\n right: var(--sidebar-margin);\n}\n\n.sidebar-right .clickable-icon.sidebar-collapse-icon {\n transform: rotateY(180deg);\n left: var(--sidebar-margin);\n}\n\n.clickable-icon.sidebar-collapse-icon svg.svg-icon {\n width: 100%;\n height: 100%;\n}\n\n.sidebar-section-header\n{\n margin: 0 0 1em 0;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n font-weight: 600;\n}\n\n/*#endregion */\n\n/*#region Content / Markdown Preview View */\n\nbody\n{\n transition: background-color var(--color-fade-speed) ease-in-out;\n}\n\n.webpage-container {\n display: flex;\n flex-direction: row;\n height: 100%;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n}\n\n.document-container \n{\n opacity: 1;\n flex-basis: 100%;\n max-width: 100%;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n transition: opacity 0.2s ease-in-out;\n contain: inline-size;\n}\n\n.hide\n{\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n}\n\n.document-container > .markdown-preview-view \n{\n margin: var(--sidebar-margin);\n margin-bottom: 0;\n width: 100%;\n width: -webkit-fill-available;\n width: -moz-available;\n width: fill-available;\n background-color: var(--background-primary);\n transition: background-color var(--color-fade-speed) ease-in-out;\n border-top-right-radius: var(--window-radius, var(--radius-m));\n border-top-left-radius: var(--window-radius, var(--radius-m));\n overflow-x: hidden !important;\n overflow-y: auto !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n contain: inline-size;\n}\n\n.document-container>.markdown-preview-view>.markdown-preview-sizer \n{\n padding-bottom: 80vh !important;\n width: 100% !important;\n max-width: var(--line-width) !important;\n flex-basis: var(--line-width) !important;\n transition: background-color var(--color-fade-speed) ease-in-out;\n contain: inline-size;\n}\n\n.view-content img:not([width]), .markdown-rendered img:not([width]) \n{\n max-width: 100%;\n outline: none;\n}\n\n/* If the markdown view is displaying a raw file or embed then increase it's size to make everything as large as possible */\n.document-container > .view-content.embed {\n display: flex;\n padding: 1em;\n height: 100%;\n width: 100%;\n align-items: center;\n justify-content: center;\n}\n\n.document-container > .view-content.embed > *\n{\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n}\n\n*:has(> :is(.math, table)) {\n overflow-x: auto !important;\n}\n\n/* For custom view exports */\n.document-container > .view-content\n{\n overflow-x: auto;\n contain: content;\n padding: 0;\n margin: 0;\n height: 100%;\n}\n\n/*#endregion */\n\n/*#region Loading */\n\n.scroll-highlight \n{\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n z-index: 1000;\n background-color: hsla(var(--color-accent-hsl),.25);\n opacity: 0;\n padding: 1em;\n inset: 50%;\n translate: -50% -50%;\n border-radius: var(--radius-s);\n}\n\n/*#endregion */\n"; // assets/theme-load.txt.js var theme_load_txt_default = 'let theme = localStorage.getItem("theme") || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");\nif (theme == "dark")\n{\n document.body.classList.add("theme-dark");\n document.body.classList.remove("theme-light");\n}\nelse\n{\n document.body.classList.add("theme-light");\n document.body.classList.remove("theme-dark");\n}\n\nif (window.innerWidth < 480) document.body.classList.add("is-phone");\nelse if (window.innerWidth < 768) document.body.classList.add("is-tablet");\nelse if (window.innerWidth < 1024) document.body.classList.add("is-small-screen");\nelse document.body.classList.add("is-large-screen");\n'; // assets/tinycolor.txt.js var tinycolor_txt_default = 'function w3color(t, e) { return this instanceof w3color ? "object" == typeof t ? t : void (this.attachValues(toColorObject(t)), e && (e.style.backgroundColor = this.toRgbString())) : new w3color(t, e) } function toColorObject(t) { var e, r, n, $, a, s, o, f, h, u, l, c = [], b = [], d = []; if (e = (t = w3trim(t.toLowerCase())).substr(0, 1).toUpperCase(), r = t.substr(1), f = 1, "R" != e && "Y" != e && "G" != e && "C" != e && "B" != e && "M" != e && "W" != e || isNaN(r) || (6 != t.length || -1 != t.indexOf(",")) && (t = "ncol(" + t + ")"), 3 == t.length || 6 == t.length || isNaN(t) || (t = "ncol(" + t + ")"), t.indexOf(",") > 0 && -1 == t.indexOf("(") && (t = "ncol(" + t + ")"), "rgb" == t.substr(0, 3) || "hsl" == t.substr(0, 3) || "hwb" == t.substr(0, 3) || "ncol" == t.substr(0, 4) || "cmyk" == t.substr(0, 4)) { if ("ncol" == t.substr(0, 4) ? (4 == t.split(",").length && -1 == t.indexOf("ncola") && (t = t.replace("ncol", "ncola")), n = "ncol", t = t.substr(4)) : "cmyk" == t.substr(0, 4) ? (n = "cmyk", t = t.substr(4)) : (n = t.substr(0, 3), t = t.substr(3)), $ = 3, s = !1, "a" == t.substr(0, 1).toLowerCase() ? ($ = 4, s = !0, t = t.substr(1)) : "cmyk" == n && ($ = 4, 5 == t.split(",").length && ($ = 5, s = !0)), c = (t = (t = t.replace("(", "")).replace(")", "")).split(","), "rgb" == n) { if (c.length != $) return emptyObject(); for (a = 0; a < $; a++) { if (("" == c[a] || " " == c[a]) && (c[a] = "0"), c[a].indexOf("%") > -1 && (c[a] = c[a].replace("%", ""), c[a] = Number(c[a] / 100), a < 3 && (c[a] = Math.round(255 * c[a]))), isNaN(c[a])) return emptyObject(); parseInt(c[a]) > 255 && (c[a] = 255), a < 3 && (c[a] = parseInt(c[a])), 3 == a && Number(c[a]) > 1 && (c[a] = 1) } l = { r: c[0], g: c[1], b: c[2] }, !0 == s && (f = Number(c[3])) } if ("hsl" == n || "hwb" == n || "ncol" == n) { for (; c.length < $;)c.push("0"); for (("hsl" == n || "hwb" == n) && parseInt(c[0]) >= 360 && (c[0] = 0), a = 1; a < $; a++) { if (c[a].indexOf("%") > -1) { if (c[a] = c[a].replace("%", ""), c[a] = Number(c[a]), isNaN(c[a])) return emptyObject(); c[a] = c[a] / 100 } else c[a] = Number(c[a]); Number(c[a]) > 1 && (c[a] = 1), 0 > Number(c[a]) && (c[a] = 0) } "hsl" == n && (l = hslToRgb(c[0], c[1], c[2]), h = Number(c[0]), u = Number(c[1])), "hwb" == n && (l = hwbToRgb(c[0], c[1], c[2])), "ncol" == n && (l = ncolToRgb(c[0], c[1], c[2])), !0 == s && (f = Number(c[3])) } if ("cmyk" == n) { for (; c.length < $;)c.push("0"); for (a = 0; a < $; a++) { if (c[a].indexOf("%") > -1) { if (c[a] = c[a].replace("%", ""), c[a] = Number(c[a]), isNaN(c[a])) return emptyObject(); c[a] = c[a] / 100 } else c[a] = Number(c[a]); Number(c[a]) > 1 && (c[a] = 1), 0 > Number(c[a]) && (c[a] = 0) } l = cmykToRgb(c[0], c[1], c[2], c[3]), !0 == s && (f = Number(c[4])) } } else if ("ncs" == t.substr(0, 3)) l = ncsToRgb(t); else { for (a = 0, o = !1, b = getColorArr("names"); a < b.length; a++)if (t.toLowerCase() == b[a].toLowerCase()) { d = getColorArr("hexs"), o = !0, l = { r: parseInt(d[a].substr(0, 2), 16), g: parseInt(d[a].substr(2, 2), 16), b: parseInt(d[a].substr(4, 2), 16) }; break } if (!1 == o) { for (3 == (t = t.replace("#", "")).length && (t = t.substr(0, 1) + t.substr(0, 1) + t.substr(1, 1) + t.substr(1, 1) + t.substr(2, 1) + t.substr(2, 1)), a = 0; a < t.length; a++)if (!isHex(t.substr(a, 1))) return emptyObject(); for (a = 0, c[0] = parseInt(t.substr(0, 2), 16), c[1] = parseInt(t.substr(2, 2), 16), c[2] = parseInt(t.substr(4, 2), 16); a < 3; a++)if (isNaN(c[a])) return emptyObject(); l = { r: c[0], g: c[1], b: c[2] } } } return colorObject(l, f, h, u) } function colorObject(t, e, r, n) { var $, a, s, o, f, h, u; return t ? (null === e && (e = 1), $ = rgbToHsl(t.r, t.g, t.b), a = rgbToHwb(t.r, t.g, t.b), s = rgbToCmyk(t.r, t.g, t.b), h = r || $.h, u = n || $.s, o = hueToNcol(h), f = roundDecimals(f = { red: t.r, green: t.g, blue: t.b, hue: h, sat: u, lightness: $.l, whiteness: a.w, blackness: a.b, cyan: s.c, magenta: s.m, yellow: s.y, black: s.k, ncol: o, opacity: e, valid: !0 })) : emptyObject() } function emptyObject() { return { red: 0, green: 0, blue: 0, hue: 0, sat: 0, lightness: 0, whiteness: 0, blackness: 0, cyan: 0, magenta: 0, yellow: 0, black: 0, ncol: "R", opacity: 1, valid: !1 } } function getColorArr(t) { return "names" == t ? ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenRod", "DarkGray", "DarkGrey", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Grey", "Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGray", "LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "RebeccaPurple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "SlateGrey", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"] : "hexs" == t ? ["f0f8ff", "faebd7", "00ffff", "7fffd4", "f0ffff", "f5f5dc", "ffe4c4", "000000", "ffebcd", "0000ff", "8a2be2", "a52a2a", "deb887", "5f9ea0", "7fff00", "d2691e", "ff7f50", "6495ed", "fff8dc", "dc143c", "00ffff", "00008b", "008b8b", "b8860b", "a9a9a9", "a9a9a9", "006400", "bdb76b", "8b008b", "556b2f", "ff8c00", "9932cc", "8b0000", "e9967a", "8fbc8f", "483d8b", "2f4f4f", "2f4f4f", "00ced1", "9400d3", "ff1493", "00bfff", "696969", "696969", "1e90ff", "b22222", "fffaf0", "228b22", "ff00ff", "dcdcdc", "f8f8ff", "ffd700", "daa520", "808080", "808080", "008000", "adff2f", "f0fff0", "ff69b4", "cd5c5c", "4b0082", "fffff0", "f0e68c", "e6e6fa", "fff0f5", "7cfc00", "fffacd", "add8e6", "f08080", "e0ffff", "fafad2", "d3d3d3", "d3d3d3", "90ee90", "ffb6c1", "ffa07a", "20b2aa", "87cefa", "778899", "778899", "b0c4de", "ffffe0", "00ff00", "32cd32", "faf0e6", "ff00ff", "800000", "66cdaa", "0000cd", "ba55d3", "9370db", "3cb371", "7b68ee", "00fa9a", "48d1cc", "c71585", "191970", "f5fffa", "ffe4e1", "ffe4b5", "ffdead", "000080", "fdf5e6", "808000", "6b8e23", "ffa500", "ff4500", "da70d6", "eee8aa", "98fb98", "afeeee", "db7093", "ffefd5", "ffdab9", "cd853f", "ffc0cb", "dda0dd", "b0e0e6", "800080", "663399", "ff0000", "bc8f8f", "4169e1", "8b4513", "fa8072", "f4a460", "2e8b57", "fff5ee", "a0522d", "c0c0c0", "87ceeb", "6a5acd", "708090", "708090", "fffafa", "00ff7f", "4682b4", "d2b48c", "008080", "d8bfd8", "ff6347", "40e0d0", "ee82ee", "f5deb3", "ffffff", "f5f5f5", "ffff00", "9acd32"] : void 0 } function roundDecimals(t) { return t.red = Number(t.red.toFixed(0)), t.green = Number(t.green.toFixed(0)), t.blue = Number(t.blue.toFixed(0)), t.hue = Number(t.hue.toFixed(0)), t.sat = Number(t.sat.toFixed(2)), t.lightness = Number(t.lightness.toFixed(2)), t.whiteness = Number(t.whiteness.toFixed(2)), t.blackness = Number(t.blackness.toFixed(2)), t.cyan = Number(t.cyan.toFixed(2)), t.magenta = Number(t.magenta.toFixed(2)), t.yellow = Number(t.yellow.toFixed(2)), t.black = Number(t.black.toFixed(2)), t.ncol = t.ncol.substr(0, 1) + Math.round(Number(t.ncol.substr(1))), t.opacity = Number(t.opacity.toFixed(2)), t } function hslToRgb(t, e, r) { var n, $, a, s, o; return t /= 60, $ = r <= .5 ? r * (e + 1) : r + e - r * e, a = 255 * hueToRgb(n = 2 * r - $, $, t + 2), { r: a, g: s = 255 * hueToRgb(n, $, t), b: o = 255 * hueToRgb(n, $, t - 2) } } function hueToRgb(t, e, r) { return (r < 0 && (r += 6), r >= 6 && (r -= 6), r < 1) ? (e - t) * r + t : r < 3 ? e : r < 4 ? (e - t) * (4 - r) + t : t } function hwbToRgb(t, e, r) { var n, $, a, s = []; for ($ = hslToRgb(t, 1, .5), s[0] = $.r / 255, s[1] = $.g / 255, s[2] = $.b / 255, (a = e + r) > 1 && (e = Number((e / a).toFixed(2)), r = Number((r / a).toFixed(2))), n = 0; n < 3; n++)s[n] *= 1 - e - r, s[n] += e, s[n] = Number(255 * s[n]); return { r: s[0], g: s[1], b: s[2] } } function cmykToRgb(t, e, r, n) { var $, a, s; return $ = 255 - 255 * Math.min(1, t * (1 - n) + n), { r: $, g: a = 255 - 255 * Math.min(1, e * (1 - n) + n), b: s = 255 - 255 * Math.min(1, r * (1 - n) + n) } } function ncolToRgb(t, e, r) { var n, $, a; if (a = t, isNaN(t.substr(0, 1))) { if (n = t.substr(0, 1).toUpperCase(), "" == ($ = t.substr(1)) && ($ = 0), isNaN($ = Number($))) return !1; "R" == n && (a = 0 + .6 * $), "Y" == n && (a = 60 + .6 * $), "G" == n && (a = 120 + .6 * $), "C" == n && (a = 180 + .6 * $), "B" == n && (a = 240 + .6 * $), "M" == n && (a = 300 + .6 * $), "W" == n && (a = 0, e = 1 - $ / 100, r = $ / 100) } return hwbToRgb(a, e, r) } function hueToNcol(t) { for (; t >= 360;)t -= 360; return t < 60 ? "R" + t / .6 : t < 120 ? "Y" + (t - 60) / .6 : t < 180 ? "G" + (t - 120) / .6 : t < 240 ? "C" + (t - 180) / .6 : t < 300 ? "B" + (t - 240) / .6 : t < 360 ? "M" + (t - 300) / .6 : void 0 } function ncsToRgb(t) { var e, r, n, $, a, s, o, f, h, u, l, c, b, d, g, _, m, p; return -1 == (t = (t = (t = (t = (t = w3trim(t).toUpperCase()).replace("(", "")).replace(")", "")).replace("NCS", "NCS ")).replace(/ /g, " ")).indexOf("NCS") && (t = "NCS " + t), null !== (t = t.match(/^(?:NCS|NCS\\sS)\\s(\\d{2})(\\d{2})-(N|[A-Z])(\\d{2})?([A-Z])?$/)) && (e = parseInt(t[1], 10), r = parseInt(t[2], 10), ("N" == (n = t[3]) || "Y" == n || "R" == n || "B" == n || "G" == n) && ($ = parseInt(t[4], 10) || 0, "N" !== n ? (a = 1.05 * e - 5.25, s = r, "Y" === n && $ <= 60 ? o = 1 : "Y" === n && $ > 60 || "R" === n && $ <= 80 ? o = (Math.sqrt(14884 - Math.pow(f = "Y" === n ? $ - 60 : $ + 40, 2)) - 22) / 100 : "R" === n && $ > 80 || "B" === n ? o = 0 : "G" === n && (o = (Math.sqrt(33800 - Math.pow(f = $ - 170, 2)) - 70) / 100), "Y" === n && $ <= 80 ? h = 0 : "Y" === n && $ > 80 || "R" === n && $ <= 60 ? h = (104 - Math.sqrt(11236 - Math.pow(f = "Y" === n ? $ - 80 + 20.5 : $ + 20 + 20.5, 2))) / 100 : "R" === n && $ > 60 || "B" === n && $ <= 80 ? h = (Math.sqrt(1e4 - Math.pow(f = "R" === n ? $ - 60 - 60 : $ + 40 - 60, 2)) - 10) / 100 : "B" === n && $ > 80 || "G" === n && $ <= 40 ? h = (122 - Math.sqrt(19881 - Math.pow(f = "B" === n ? $ - 80 - 131 : $ + 20 - 131, 2))) / 100 : "G" === n && $ > 40 && (h = 0), "Y" === n ? green1 = (85 - .85 * $) / 100 : "R" === n && $ <= 60 ? green1 = 0 : "R" === n && $ > 60 ? green1 = (67.5 - Math.sqrt(5776 - Math.pow(f = $ - 60 + 35, 2))) / 100 : "B" === n && $ <= 60 ? green1 = (6.5 + Math.sqrt(7044.5 - Math.pow(f = 1 * $ - 68.5, 2))) / 100 : "B" === n && $ > 60 || "G" === n && $ <= 60 ? green1 = .9 : "G" === n && $ > 60 && (green1 = (90 - 1 / 8 * (f = $ - 60)) / 100), u = ((f = (o + green1 + h) / 3) - o) * (100 - s) / 100 + o, l = (f - green1) * (100 - s) / 100 + green1, c = (f - h) * (100 - s) / 100 + h, d = 1 / (b = u > l && u > c ? u : l > u && l > c ? l : c > u && c > l ? c : (u + l + c) / 3), _ = parseInt(u * d * (100 - a) / 100 * 255, 10), m = parseInt(l * d * (100 - a) / 100 * 255, 10), p = parseInt(c * d * (100 - a) / 100 * 255, 10), _ > 255 && (_ = 255), m > 255 && (m = 255), p > 255 && (p = 255), _ < 0 && (_ = 0), m < 0 && (m = 0), p < 0 && (p = 0)) : ((g = parseInt((1 - e / 100) * 255, 10)) > 255 && (g = 255), g < 0 && (g = 0), _ = g, m = g, p = g), { r: _, g: m, b: p })) } function rgbToHsl(t, e, r) { var n, $, a, s, o, f, h, u = []; for (a = 0, u[0] = t / 255, u[1] = e / 255, u[2] = r / 255, n = u[0], $ = u[0], f = 0; a < u.length - 1; a++)u[a + 1] <= n && (n = u[a + 1]), u[a + 1] >= $ && ($ = u[a + 1], f = a + 1); return 0 == f && (h = (u[1] - u[2]) / ($ - n)), 1 == f && (h = 2 + (u[2] - u[0]) / ($ - n)), 2 == f && (h = 4 + (u[0] - u[1]) / ($ - n)), isNaN(h) && (h = 0), (h *= 60) < 0 && (h += 360), s = (n + $) / 2, { h: h, s: o = n == $ ? 0 : s < .5 ? ($ - n) / ($ + n) : ($ - n) / (2 - $ - n), l: s } } function rgbToHwb(t, e, r) { var n, $, a; return t /= 255, e /= 255, r /= 255, n = 0 == (chroma = (max = Math.max(t, e, r)) - (min = Math.min(t, e, r))) ? 0 : t == max ? (e - r) / chroma % 6 * 360 : e == max ? ((r - t) / chroma + 2) % 6 * 360 : ((t - e) / chroma + 4) % 6 * 360, { h: n, w: $ = min, b: a = 1 - max } } function rgbToCmyk(t, e, r) { var n, $, a, s; return t /= 255, e /= 255, r /= 255, 1 == (s = 1 - (max = Math.max(t, e, r))) ? (n = 0, $ = 0, a = 0) : (n = (1 - t - s) / (1 - s), $ = (1 - e - s) / (1 - s), a = (1 - r - s) / (1 - s)), { c: n, m: $, y: a, k: s } } function toHex(t) { for (var e = t.toString(16); e.length < 2;)e = "0" + e; return e } function cl(t) { console.log(t) } function w3trim(t) { return t.replace(/^\\s+|\\s+$/g, "") } function isHex(t) { return "0123456789ABCDEFabcdef".indexOf(t) > -1 } function w3SetColorsByAttribute() { var t, e, r; for (e = 0, t = document.getElementsByTagName("*"); e < t.length; e++)(r = t[e].getAttribute("data-w3-color")) && (t[e].style.backgroundColor = w3color(r).toRgbString()) } !function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).tinycolor = e() }(this, function () { "use strict"; function t(e) { return (t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(e) } var e = /^\\s+/, r = /\\s+$/; function n($, a) { if (a = a || {}, ($ = $ || "") instanceof n) return $; if (!(this instanceof n)) return new n($, a); var s, o, f, h, u, l, c, b, d, g, _, m, p, y, v, S, R, H, B, T, O, L, M, q = (s = $, o = { r: 0, g: 0, b: 0 }, f = 1, h = null, u = null, l = null, c = !1, b = !1, "string" == typeof s && (s = function t(n) { n = n.replace(e, "").replace(r, "").toLowerCase(); var $, a = !1; if (k[n]) n = k[n], a = !0; else if ("transparent" == n) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; return ($ = F.rgb.exec(n)) ? { r: $[1], g: $[2], b: $[3] } : ($ = F.rgba.exec(n)) ? { r: $[1], g: $[2], b: $[3], a: $[4] } : ($ = F.hsl.exec(n)) ? { h: $[1], s: $[2], l: $[3] } : ($ = F.hsla.exec(n)) ? { h: $[1], s: $[2], l: $[3], a: $[4] } : ($ = F.hsv.exec(n)) ? { h: $[1], s: $[2], v: $[3] } : ($ = F.hsva.exec(n)) ? { h: $[1], s: $[2], v: $[3], a: $[4] } : ($ = F.hex8.exec(n)) ? { r: A($[1]), g: A($[2]), b: A($[3]), a: G($[4]), format: a ? "name" : "hex8" } : ($ = F.hex6.exec(n)) ? { r: A($[1]), g: A($[2]), b: A($[3]), format: a ? "name" : "hex" } : ($ = F.hex4.exec(n)) ? { r: A($[1] + "" + $[1]), g: A($[2] + "" + $[2]), b: A($[3] + "" + $[3]), a: G($[4] + "" + $[4]), format: a ? "name" : "hex8" } : !!($ = F.hex3.exec(n)) && { r: A($[1] + "" + $[1]), g: A($[2] + "" + $[2]), b: A($[3] + "" + $[3]), format: a ? "name" : "hex" } }(s)), "object" == t(s) && (D(s.r) && D(s.g) && D(s.b) ? (o = (d = s.r, g = s.g, _ = s.b, { r: 255 * x(d, 255), g: 255 * x(g, 255), b: 255 * x(_, 255) }), c = !0, b = "%" === String(s.r).substr(-1) ? "prgb" : "rgb") : D(s.h) && D(s.s) && D(s.v) ? (h = C(s.s), u = C(s.v), o = (m = s.h, p = h, y = u, m = 6 * x(m, 360), p = x(p, 100), y = x(y, 100), v = Math.floor(m), S = m - v, R = y * (1 - p), H = y * (1 - S * p), B = y * (1 - (1 - S) * p), T = v % 6, O = [y, H, R, R, B, y][T], L = [B, y, y, H, R, R][T], M = [R, R, B, y, y, H][T], { r: 255 * O, g: 255 * L, b: 255 * M }), c = !0, b = "hsv") : D(s.h) && D(s.s) && D(s.l) && (h = C(s.s), l = C(s.l), o = function t(e, r, n) { var $, a, s; function o(t, e, r) { return (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6) ? t + (e - t) * 6 * r : r < .5 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t } if (e = x(e, 360), r = x(r, 100), n = x(n, 100), 0 === r) $ = a = s = n; else { var f = n < .5 ? n * (1 + r) : n + r - n * r, h = 2 * n - f; $ = o(h, f, e + 1 / 3), a = o(h, f, e), s = o(h, f, e - 1 / 3) } return { r: 255 * $, g: 255 * a, b: 255 * s } }(s.h, h, l), c = !0, b = "hsl"), s.hasOwnProperty("a") && (f = s.a)), f = w(f), { ok: c, format: s.format || b, r: Math.min(255, Math.max(o.r, 0)), g: Math.min(255, Math.max(o.g, 0)), b: Math.min(255, Math.max(o.b, 0)), a: f }); this._originalInput = $, this._r = q.r, this._g = q.g, this._b = q.b, this._a = q.a, this._roundA = Math.round(100 * this._a) / 100, this._format = a.format || q.format, this._gradientType = a.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = q.ok } function $(t, e, r) { t = x(t, 255), e = x(e, 255), r = x(r, 255); var n, $, a = Math.max(t, e, r), s = Math.min(t, e, r), o = (a + s) / 2; if (a == s) n = $ = 0; else { var f = a - s; switch ($ = o > .5 ? f / (2 - a - s) : f / (a + s), a) { case t: n = (e - r) / f + (e < r ? 6 : 0); break; case e: n = (r - t) / f + 2; break; case r: n = (t - e) / f + 4 }n /= 6 } return { h: n, s: $, l: o } } function a(t, e, r) { t = x(t, 255), e = x(e, 255), r = x(r, 255); var n, $, a = Math.max(t, e, r), s = Math.min(t, e, r), o = a - s; if ($ = 0 === a ? 0 : o / a, a == s) n = 0; else { switch (a) { case t: n = (e - r) / o + (e < r ? 6 : 0); break; case e: n = (r - t) / o + 2; break; case r: n = (t - e) / o + 4 }n /= 6 } return { h: n, s: $, v: a } } function s(t, e, r, n) { var $ = [R(Math.round(t).toString(16)), R(Math.round(e).toString(16)), R(Math.round(r).toString(16))]; return n && $[0].charAt(0) == $[0].charAt(1) && $[1].charAt(0) == $[1].charAt(1) && $[2].charAt(0) == $[2].charAt(1) ? $[0].charAt(0) + $[1].charAt(0) + $[2].charAt(0) : $.join("") } function o(t, e, r, n) { return [R(H(n)), R(Math.round(t).toString(16)), R(Math.round(e).toString(16)), R(Math.round(r).toString(16))].join("") } function f(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.s -= e / 100, r.s = S(r.s), n(r) } function h(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.s += e / 100, r.s = S(r.s), n(r) } function u(t) { return n(t).desaturate(100) } function l(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.l += e / 100, r.l = S(r.l), n(r) } function c(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(-(255 * (e / 100))))), r.g = Math.max(0, Math.min(255, r.g - Math.round(-(255 * (e / 100))))), r.b = Math.max(0, Math.min(255, r.b - Math.round(-(255 * (e / 100))))), n(r) } function b(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.l -= e / 100, r.l = S(r.l), n(r) } function d(t, e) { var r = n(t).toHsl(), $ = (r.h + e) % 360; return r.h = $ < 0 ? 360 + $ : $, n(r) } function g(t) { var e = n(t).toHsl(); return e.h = (e.h + 180) % 360, n(e) } function _(t, e) { if (isNaN(e) || e <= 0) throw Error("Argument to polyad must be a positive number"); for (var r = n(t).toHsl(), $ = [n(t)], a = 360 / e, s = 1; s < e; s++)$.push(n({ h: (r.h + s * a) % 360, s: r.s, l: r.l })); return $ } function m(t) { var e = n(t).toHsl(), r = e.h; return [n(t), n({ h: (r + 72) % 360, s: e.s, l: e.l }), n({ h: (r + 216) % 360, s: e.s, l: e.l })] } function p(t, e, r) { e = e || 6, r = r || 30; var $ = n(t).toHsl(), a = 360 / r, s = [n(t)]; for ($.h = ($.h - (a * e >> 1) + 720) % 360; --e;)$.h = ($.h + a) % 360, s.push(n($)); return s } function y(t, e) { e = e || 6; for (var r = n(t).toHsv(), $ = r.h, a = r.s, s = r.v, o = [], f = 1 / e; e--;)o.push(n({ h: $, s: a, v: s })), s = (s + f) % 1; return o } n.prototype = { isDark: function t() { return 128 > this.getBrightness() }, isLight: function t() { return !this.isDark() }, isValid: function t() { return this._ok }, getOriginalInput: function t() { return this._originalInput }, getFormat: function t() { return this._format }, getAlpha: function t() { return this._a }, getBrightness: function t() { var e = this.toRgb(); return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 }, getLuminance: function t() { var e, r, n, $, a, s, o = this.toRgb(); return e = o.r / 255, r = o.g / 255, n = o.b / 255, $ = e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4), .2126 * $ + .7152 * (a = r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4)) + .0722 * (s = n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4)) }, setAlpha: function t(e) { return this._a = w(e), this._roundA = Math.round(100 * this._a) / 100, this }, toHsv: function t() { var e = a(this._r, this._g, this._b); return { h: 360 * e.h, s: e.s, v: e.v, a: this._a } }, toHsvString: function t() { var e = a(this._r, this._g, this._b), r = Math.round(360 * e.h), n = Math.round(100 * e.s), $ = Math.round(100 * e.v); return 1 == this._a ? "hsv(" + r + ", " + n + "%, " + $ + "%)" : "hsva(" + r + ", " + n + "%, " + $ + "%, " + this._roundA + ")" }, toHsl: function t() { var e = $(this._r, this._g, this._b); return { h: 360 * e.h, s: e.s, l: e.l, a: this._a } }, toHslString: function t() { var e = $(this._r, this._g, this._b), r = Math.round(360 * e.h), n = Math.round(100 * e.s), a = Math.round(100 * e.l); return 1 == this._a ? "hsl(" + r + ", " + n + "%, " + a + "%)" : "hsla(" + r + ", " + n + "%, " + a + "%, " + this._roundA + ")" }, toHex: function t(e) { return s(this._r, this._g, this._b, e) }, toHexString: function t(e) { return "#" + this.toHex(e) }, toHexNumber: function t() { return Number("0x" + this.toHex()) }, toHex8: function t(e) { var r, n, $, a, s, o; return r = this._r, n = this._g, $ = this._b, a = this._a, s = e, o = [R(Math.round(r).toString(16)), R(Math.round(n).toString(16)), R(Math.round($).toString(16)), R(H(a))], s && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) == o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) && o[3].charAt(0) == o[3].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("") }, toHex8String: function t(e) { return "#" + this.toHex8(e) }, toRgb: function t() { return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a } }, toRgbString: function t() { return 1 == this._a ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")" }, toPercentageRgb: function t() { return { r: Math.round(100 * x(this._r, 255)) + "%", g: Math.round(100 * x(this._g, 255)) + "%", b: Math.round(100 * x(this._b, 255)) + "%", a: this._a } }, toPercentageRgbString: function t() { return 1 == this._a ? "rgb(" + Math.round(100 * x(this._r, 255)) + "%, " + Math.round(100 * x(this._g, 255)) + "%, " + Math.round(100 * x(this._b, 255)) + "%)" : "rgba(" + Math.round(100 * x(this._r, 255)) + "%, " + Math.round(100 * x(this._g, 255)) + "%, " + Math.round(100 * x(this._b, 255)) + "%, " + this._roundA + ")" }, toName: function t() { return 0 === this._a ? "transparent" : !(this._a < 1) && !!v[s(this._r, this._g, this._b, !0)] }, toFilter: function t(e) { var r = "#" + o(this._r, this._g, this._b, this._a), $ = r, a = this._gradientType ? "GradientType = 1, " : ""; if (e) { var s = n(e); $ = "#" + o(s._r, s._g, s._b, s._a) } return "progid:DXImageTransform.Microsoft.gradient(" + a + "startColorstr=" + r + ",endColorstr=" + $ + ")" }, toString: function t(e) { var r = !!e; e = e || this._format; var n = !1, $ = this._a < 1 && this._a >= 0; return !r && $ && ("hex" === e || "hex6" === e || "hex3" === e || "hex4" === e || "hex8" === e || "name" === e) ? "name" === e && 0 === this._a ? this.toName() : this.toRgbString() : ("rgb" === e && (n = this.toRgbString()), "prgb" === e && (n = this.toPercentageRgbString()), ("hex" === e || "hex6" === e) && (n = this.toHexString()), "hex3" === e && (n = this.toHexString(!0)), "hex4" === e && (n = this.toHex8String(!0)), "hex8" === e && (n = this.toHex8String()), "name" === e && (n = this.toName()), "hsl" === e && (n = this.toHslString()), "hsv" === e && (n = this.toHsvString()), n || this.toHexString()) }, clone: function t() { return n(this.toString()) }, _applyModification: function t(e, r) { var n = e.apply(null, [this].concat([].slice.call(r))); return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this }, lighten: function t() { return this._applyModification(l, arguments) }, brighten: function t() { return this._applyModification(c, arguments) }, darken: function t() { return this._applyModification(b, arguments) }, desaturate: function t() { return this._applyModification(f, arguments) }, saturate: function t() { return this._applyModification(h, arguments) }, greyscale: function t() { return this._applyModification(u, arguments) }, spin: function t() { return this._applyModification(d, arguments) }, _applyCombination: function t(e, r) { return e.apply(null, [this].concat([].slice.call(r))) }, analogous: function t() { return this._applyCombination(p, arguments) }, complement: function t() { return this._applyCombination(g, arguments) }, monochromatic: function t() { return this._applyCombination(y, arguments) }, splitcomplement: function t() { return this._applyCombination(m, arguments) }, triad: function t() { return this._applyCombination(_, [3]) }, tetrad: function t() { return this._applyCombination(_, [4]) } }, n.fromRatio = function (e, r) { if ("object" == t(e)) { var $ = {}; for (var a in e) e.hasOwnProperty(a) && ("a" === a ? $[a] = e[a] : $[a] = C(e[a])); e = $ } return n(e, r) }, n.equals = function (t, e) { return !!t && !!e && n(t).toRgbString() == n(e).toRgbString() }, n.random = function () { return n.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }) }, n.mix = function (t, e, r) { r = 0 === r ? 0 : r || 50; var $ = n(t).toRgb(), a = n(e).toRgb(), s = r / 100; return n({ r: (a.r - $.r) * s + $.r, g: (a.g - $.g) * s + $.g, b: (a.b - $.b) * s + $.b, a: (a.a - $.a) * s + $.a }) }, n.readability = function (t, e) { var r = n(t), $ = n(e); return (Math.max(r.getLuminance(), $.getLuminance()) + .05) / (Math.min(r.getLuminance(), $.getLuminance()) + .05) }, n.isReadable = function (t, e, r) { var $, a, s, o, f, h = n.readability(t, e); switch (a = !1, ($ = (s = r, o = ((s = s || { level: "AA", size: "small" }).level || "AA").toUpperCase(), f = (s.size || "small").toLowerCase(), "AA" !== o && "AAA" !== o && (o = "AA"), "small" !== f && "large" !== f && (f = "small"), { level: o, size: f })).level + $.size) { case "AAsmall": case "AAAlarge": a = h >= 4.5; break; case "AAlarge": a = h >= 3; break; case "AAAsmall": a = h >= 7 }return a }, n.mostReadable = function (t, e, r) { var $, a, s, o, f = null, h = 0; a = (r = r || {}).includeFallbackColors, s = r.level, o = r.size; for (var u = 0; u < e.length; u++)($ = n.readability(t, e[u])) > h && (h = $, f = n(e[u])); return n.isReadable(t, f, { level: s, size: o }) || !a ? f : (r.includeFallbackColors = !1, n.mostReadable(t, ["#fff", "#000"], r)) }; var k = n.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, v = n.hexNames = function t(e) { var r = {}; for (var n in e) e.hasOwnProperty(n) && (r[e[n]] = n); return r }(k); function w(t) { return (isNaN(t = parseFloat(t)) || t < 0 || t > 1) && (t = 1), t } function x(t, e) { r = t, "string" == typeof r && -1 != r.indexOf(".") && 1 === parseFloat(r) && (t = "100%"); var r, n, $ = (n = t, "string" == typeof n && -1 != n.indexOf("%")); return (t = Math.min(e, Math.max(0, parseFloat(t))), $ && (t = parseInt(t * e, 10) / 100), 1e-6 > Math.abs(t - e)) ? 1 : t % e / parseFloat(e) } function S(t) { return Math.min(1, Math.max(0, t)) } function A(t) { return parseInt(t, 16) } function R(t) { return 1 == t.length ? "0" + t : "" + t } function C(t) { return t <= 1 && (t = 100 * t + "%"), t } function H(t) { return Math.round(255 * parseFloat(t)).toString(16) } function G(t) { return A(t) / 255 } var B, T, O, F = (T = "[\\\\s|\\\\(]+(" + (B = "(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)") + ")[,|\\\\s]+(" + B + ")[,|\\\\s]+(" + B + ")\\\\s*\\\\)?", O = "[\\\\s|\\\\(]+(" + B + ")[,|\\\\s]+(" + B + ")[,|\\\\s]+(" + B + ")[,|\\\\s]+(" + B + ")\\\\s*\\\\)?", { CSS_UNIT: RegExp(B), rgb: RegExp("rgb" + T), rgba: RegExp("rgba" + O), hsl: RegExp("hsl" + T), hsla: RegExp("hsla" + O), hsv: RegExp("hsv" + T), hsva: RegExp("hsva" + O), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }); function D(t) { return !!F.CSS_UNIT.exec(t) } return n }), w3color.prototype = { toRgbString: function () { return "rgb(" + this.red + ", " + this.green + ", " + this.blue + ")" }, toRgbaString: function () { return "rgba(" + this.red + ", " + this.green + ", " + this.blue + ", " + this.opacity + ")" }, toHwbString: function () { return "hwb(" + this.hue + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%)" }, toHwbStringDecimal: function () { return "hwb(" + this.hue + ", " + this.whiteness + ", " + this.blackness + ")" }, toHwbaString: function () { return "hwba(" + this.hue + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%, " + this.opacity + ")" }, toHslString: function () { return "hsl(" + this.hue + ", " + Math.round(100 * this.sat) + "%, " + Math.round(100 * this.lightness) + "%)" }, toHslStringDecimal: function () { return "hsl(" + this.hue + ", " + this.sat + ", " + this.lightness + ")" }, toHslaString: function () { return "hsla(" + this.hue + ", " + Math.round(100 * this.sat) + "%, " + Math.round(100 * this.lightness) + "%, " + this.opacity + ")" }, toCmykString: function () { return "cmyk(" + Math.round(100 * this.cyan) + "%, " + Math.round(100 * this.magenta) + "%, " + Math.round(100 * this.yellow) + "%, " + Math.round(100 * this.black) + "%)" }, toCmykStringDecimal: function () { return "cmyk(" + this.cyan + ", " + this.magenta + ", " + this.yellow + ", " + this.black + ")" }, toNcolString: function () { return this.ncol + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%" }, toNcolStringDecimal: function () { return this.ncol + ", " + this.whiteness + ", " + this.blackness }, toNcolaString: function () { return this.ncol + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%, " + this.opacity }, toName: function () { var t, e, r, n = getColorArr("hexs"); for (i = 0; i < n.length; i++)if (t = parseInt(n[i].substr(0, 2), 16), e = parseInt(n[i].substr(2, 2), 16), r = parseInt(n[i].substr(4, 2), 16), this.red == t && this.green == e && this.blue == r) return getColorArr("names")[i]; return "" }, toHexString: function () { var t = toHex(this.red), e = toHex(this.green), r = toHex(this.blue); return "#" + t + e + r }, toRgb: function () { return { r: this.red, g: this.green, b: this.blue, a: this.opacity } }, toHsl: function () { return { h: this.hue, s: this.sat, l: this.lightness, a: this.opacity } }, toHwb: function () { return { h: this.hue, w: this.whiteness, b: this.blackness, a: this.opacity } }, toCmyk: function () { return { c: this.cyan, m: this.magenta, y: this.yellow, k: this.black, a: this.opacity } }, toNcol: function () { return { ncol: this.ncol, w: this.whiteness, b: this.blackness, a: this.opacity } }, isDark: function (t) { return (299 * this.red + 587 * this.green + 114 * this.blue) / 1e3 < (t || 128) }, saturate: function (t) { var e, r, n; e = t / 100 || .1, this.sat += e, this.sat > 1 && (this.sat = 1), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, desaturate: function (t) { var e, r, n; e = t / 100 || .1, this.sat -= e, this.sat < 0 && (this.sat = 0), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, lighter: function (t) { var e, r, n; e = t / 100 || .1, this.lightness += e, this.lightness > 1 && (this.lightness = 1), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, darker: function (t) { var e, r, n; e = t / 100 || .1, this.lightness -= e, this.lightness < 0 && (this.lightness = 0), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, attachValues: function (t) { this.red = t.red, this.green = t.green, this.blue = t.blue, this.hue = t.hue, this.sat = t.sat, this.lightness = t.lightness, this.whiteness = t.whiteness, this.blackness = t.blackness, this.cyan = t.cyan, this.magenta = t.magenta, this.yellow = t.yellow, this.black = t.black, this.ncol = t.ncol, this.opacity = t.opacity, this.valid = t.valid } };\n'; // assets/pixi.txt.js var pixi_txt_default = 'var qd=Object.defineProperty,Kd=Object.defineProperties;var Zd=Object.getOwnPropertyDescriptors;var ir=Object.getOwnPropertySymbols;var $h=Object.prototype.hasOwnProperty,jh=Object.prototype.propertyIsEnumerable;var Wh=(m,et,pt)=>et in m?qd(m,et,{enumerable:!0,configurable:!0,writable:!0,value:pt}):m[et]=pt,bt=(m,et)=>{for(var pt in et||(et={}))$h.call(et,pt)&&Wh(m,pt,et[pt]);if(ir)for(var pt of ir(et))jh.call(et,pt)&&Wh(m,pt,et[pt]);return m},Qi=(m,et)=>Kd(m,Zd(et));var zn=(m,et)=>{var pt={};for(var Rt in m)$h.call(m,Rt)&&et.indexOf(Rt)<0&&(pt[Rt]=m[Rt]);if(m!=null&&ir)for(var Rt of ir(m))et.indexOf(Rt)<0&&jh.call(m,Rt)&&(pt[Rt]=m[Rt]);return pt};/*!\n * pixi.js - v7.2.4\n * Compiled Thu, 06 Apr 2023 19:36:45 UTC\n *\n * pixi.js is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */var PIXI=function(m){var zh;"use strict";var et=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))(et||{}),pt=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(pt||{}),Rt=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Rt||{}),G=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR",e))(G||{}),zt=(e=>(e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e))(zt||{}),C=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(C||{}),Re=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(Re||{}),k=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(k||{}),ts=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(ts||{}),ee=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(ee||{}),ie=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(ie||{}),Wt=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(Wt||{}),Nt=(e=>(e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",e))(Nt||{}),$t=(e=>(e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT",e))($t||{}),es=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(es||{}),Pt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Pt||{}),ct=(e=>(e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE",e[e.COLOR=4]="COLOR",e))(ct||{}),Wn=(e=>(e[e.RED=1]="RED",e[e.GREEN=2]="GREEN",e[e.BLUE=4]="BLUE",e[e.ALPHA=8]="ALPHA",e))(Wn||{}),ht=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(ht||{}),jt=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(jt||{});const $n={createCanvas:(e,t)=>{const i=document.createElement("canvas");return i.width=e,i.height=t,i},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>{var e;return(e=document.baseURI)!=null?e:window.location.href},getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")},P={ADAPTER:$n,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var sr=/iPhone/i,jn=/iPod/i,Yn=/iPad/i,qn=/\\biOS-universal(?:.+)Mac\\b/i,rr=/\\bAndroid(?:.+)Mobile\\b/i,Kn=/Android/i,Xe=/(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i,is=/Silk/i,ce=/Windows Phone/i,Zn=/\\bWindows(?:.+)ARM\\b/i,Jn=/BlackBerry/i,Qn=/BB10/i,to=/Opera Mini/i,eo=/\\b(CriOS|Chrome)(?:.+)Mobile/i,io=/Mobile(?:.+)Firefox\\b/i,so=function(e){return typeof e!="undefined"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream=="undefined"};function Yh(e){return function(t){return t.test(e)}}function ro(e){var t={userAgent:"",platform:"",maxTouchPoints:0};!e&&typeof navigator!="undefined"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e=="string"?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var i=t.userAgent,s=i.split("[FBAN");typeof s[1]!="undefined"&&(i=s[0]),s=i.split("Twitter"),typeof s[1]!="undefined"&&(i=s[0]);var r=Yh(i),n={apple:{phone:r(sr)&&!r(ce),ipod:r(jn),tablet:!r(sr)&&(r(Yn)||so(t))&&!r(ce),universal:r(qn),device:(r(sr)||r(jn)||r(Yn)||r(qn)||so(t))&&!r(ce)},amazon:{phone:r(Xe),tablet:!r(Xe)&&r(is),device:r(Xe)||r(is)},android:{phone:!r(ce)&&r(Xe)||!r(ce)&&r(rr),tablet:!r(ce)&&!r(Xe)&&!r(rr)&&(r(is)||r(Kn)),device:!r(ce)&&(r(Xe)||r(is)||r(rr)||r(Kn))||r(/\\bokhttp\\b/i)},windows:{phone:r(ce),tablet:r(Zn),device:r(ce)||r(Zn)},other:{blackberry:r(Jn),blackberry10:r(Qn),opera:r(to),firefox:r(io),chrome:r(eo),device:r(Jn)||r(Qn)||r(to)||r(io)||r(eo)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const Yt=((zh=ro.default)!=null?zh:ro)(globalThis.navigator);P.RETINA_PREFIX=/@([0-9\\.]+)x/,P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var nr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function or(e,t,i){return i={path:t,exports:{},require:function(s,r){return qh(s,r==null?i.path:r)}},e(i,i.exports),i.exports}function tf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ef(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}function sf(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),t}function qh(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ve=or(function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,u||h,d),p=i?i+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(i?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=i?i+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*i){a=l=e[0],h=c=e[1];for(var p=i;pl&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return li(n,o,i,a,h,f,0),o}function no(e,t,i,s,r){var n,o;if(r===cr(e,t,i,s)>0)for(n=t;n=t;n-=s)o=ho(n,e[n],e[n+1],o);return o&&rs(o,o.next)&&(ui(o),o=o.next),o}function Ce(e,t){if(!e)return e;t||(t=e);var i=e,s;do if(s=!1,!i.steiner&&(rs(i,i.next)||nt(i.prev,i,i.next)===0)){if(ui(i),i=t=i.prev,i===i.next)break;s=!0}else i=i.next;while(s||i!==t);return t}function li(e,t,i,s,r,n,o){if(!!e){!o&&n&&ol(e,s,r,n);for(var a=e,h,l;e.prev!==e.next;){if(h=e.prev,l=e.next,n?Jh(e,s,r,n):Zh(e)){t.push(h.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),ui(e),e=l.next,a=l.next;continue}if(e=l,e===a){o?o===1?(e=Qh(Ce(e),t,i),li(e,t,i,s,r,n,2)):o===2&&tl(e,t,i,s,r,n):li(Ce(e),t,i,s,r,n,1);break}}}}function Zh(e){var t=e.prev,i=e,s=e.next;if(nt(t,i,s)>=0)return!1;for(var r=t.x,n=i.x,o=s.x,a=t.y,h=i.y,l=s.y,c=rn?r>o?r:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,p=s.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&ze(r,a,n,h,o,l,p.x,p.y)&&nt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Jh(e,t,i,s){var r=e.prev,n=e,o=e.next;if(nt(r,n,o)>=0)return!1;for(var a=r.x,h=n.x,l=o.x,c=r.y,u=n.y,d=o.y,f=ah?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,v=hr(f,p,t,i,s),b=hr(_,g,t,i,s),y=e.prevZ,x=e.nextZ;y&&y.z>=v&&x&&x.z<=b;){if(y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==o&&ze(a,c,h,u,l,d,y.x,y.y)&&nt(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=f&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&ze(a,c,h,u,l,d,x.x,x.y)&&nt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==o&&ze(a,c,h,u,l,d,y.x,y.y)&&nt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=b;){if(x.x>=f&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&ze(a,c,h,u,l,d,x.x,x.y)&&nt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Qh(e,t,i){var s=e;do{var r=s.prev,n=s.next.next;!rs(r,n)&&oo(r,s,s.next,n)&&ci(r,n)&&ci(n,r)&&(t.push(r.i/i|0),t.push(s.i/i|0),t.push(n.i/i|0),ui(s),ui(s.next),s=e=n),s=s.next}while(s!==e);return Ce(s)}function tl(e,t,i,s,r,n){var o=e;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ll(o,a)){var h=ao(o,a);o=Ce(o,o.next),h=Ce(h,h.next),li(o,t,i,s,r,n,0),li(h,t,i,s,r,n,0);return}a=a.next}o=o.next}while(o!==e)}function el(e,t,i,s){var r=[],n,o,a,h,l;for(n=0,o=t.length;n=i.next.y&&i.next.y!==i.y){var a=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=s&&a>n&&(n=a,o=i.x=i.x&&i.x>=l&&s!==i.x&&ze(ro.x||i.x===o.x&&nl(o,i)))&&(o=i,u=d)),i=i.next;while(i!==h);return o}function nl(e,t){return nt(e.prev,e,t.prev)<0&&nt(t.next,e,e.next)<0}function ol(e,t,i,s){var r=e;do r.z===0&&(r.z=hr(r.x,r.y,t,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,al(r)}function al(e){var t,i,s,r,n,o,a,h,l=1;do{for(i=e,e=null,n=null,o=0;i;){for(o++,s=i,a=0,t=0;t0||h>0&&s;)a!==0&&(h===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:e=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1);return e}function hr(e,t,i,s,r){return e=(e-i)*r|0,t=(t-s)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function hl(e){var t=e,i=e;do(t.x=(e-o)*(n-a)&&(e-o)*(s-a)>=(i-o)*(t-a)&&(i-o)*(n-a)>=(r-o)*(s-a)}function ll(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!cl(e,t)&&(ci(e,t)&&ci(t,e)&&ul(e,t)&&(nt(e.prev,e,t.prev)||nt(e,t.prev,t))||rs(e,t)&&nt(e.prev,e,e.next)>0&&nt(t.prev,t,t.next)>0)}function nt(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function rs(e,t){return e.x===t.x&&e.y===t.y}function oo(e,t,i,s){var r=os(nt(e,t,i)),n=os(nt(e,t,s)),o=os(nt(i,s,e)),a=os(nt(i,s,t));return!!(r!==n&&o!==a||r===0&&ns(e,i,t)||n===0&&ns(e,s,t)||o===0&&ns(i,e,s)||a===0&&ns(i,t,s))}function ns(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function os(e){return e>0?1:e<0?-1:0}function cl(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&oo(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function ci(e,t){return nt(e.prev,e,e.next)<0?nt(e,t,e.next)>=0&&nt(e,e.prev,t)>=0:nt(e,t,e.prev)<0||nt(e,e.next,t)<0}function ul(e,t){var i=e,s=!1,r=(e.x+t.x)/2,n=(e.y+t.y)/2;do i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next;while(i!==e);return s}function ao(e,t){var i=new lr(e.i,e.x,e.y),s=new lr(t.i,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function ho(e,t,i,s){var r=new lr(e,t,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function ui(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function lr(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ss.deviation=function(e,t,i,s){var r=t&&t.length,n=r?t[0]*i:e.length,o=Math.abs(cr(e,0,n,i));if(r)for(var a=0,h=t.length;a0&&(s+=e[r-1].length,i.holes.push(s))}return i},ar.default=Kh;var dl=or(function(e,t){/*! https://mths.be/punycode v1.3.2 by @mathias */(function(i){var s=t&&!t.nodeType&&t,r=e&&!e.nodeType&&e,n=typeof nr=="object"&&nr;(n.global===n||n.window===n||n.self===n)&&(i=n);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,_="-",g=/^xn--/,v=/[^\\x20-\\x7E]/,b=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,A=Math.floor,D=String.fromCharCode,R;function E(S){throw RangeError(y[S])}function O(S,X){for(var K=S.length,J=[];K--;)J[K]=X(S[K]);return J}function H(S,X){var K=S.split("@"),J="";K.length>1&&(J=K[0]+"@",S=K[1]),S=S.replace(b,".");var Q=S.split("."),vt=O(Q,X).join(".");return J+vt}function I(S){for(var X=[],K=0,J=S.length,Q,vt;K=55296&&Q<=56319&&K65535&&(X-=65536,K+=D(X>>>10&1023|55296),X=56320|X&1023),K+=D(X),K}).join("")}function w(S){return S-48<10?S-22:S-65<26?S-65:S-97<26?S-97:h}function T(S,X){return S+22+75*(S<26)-((X!=0)<<5)}function W(S,X,K){var J=0;for(S=K?A(S/d):S>>1,S+=A(S/X);S>x*c>>1;J+=h)S=A(S/x);return A(J+(x+1)*S/(S+u))}function q(S){var X=[],K=S.length,J,Q=0,vt=p,ut=f,xt,wt,Ft,Et,rt,dt,ft,he,le;for(xt=S.lastIndexOf(_),xt<0&&(xt=0),wt=0;wt=128&&E("not-basic"),X.push(S.charCodeAt(wt));for(Ft=xt>0?xt+1:0;Ft=K&&E("invalid-input"),ft=w(S.charCodeAt(Ft++)),(ft>=h||ft>A((a-Q)/rt))&&E("overflow"),Q+=ft*rt,he=dt<=ut?l:dt>=ut+c?c:dt-ut,!(ftA(a/le)&&E("overflow"),rt*=le;J=X.length+1,ut=W(Q-Et,J,Et==0),A(Q/J)>a-vt&&E("overflow"),vt+=A(Q/J),Q%=J,X.splice(Q++,0,vt)}return N(X)}function F(S){var X,K,J,Q,vt,ut,xt,wt,Ft,Et,rt,dt=[],ft,he,le,Ji;for(S=I(S),ft=S.length,X=p,K=0,vt=f,ut=0;ut=X&&rtA((a-K)/he)&&E("overflow"),K+=(xt-X)*he,X=xt,ut=0;uta&&E("overflow"),rt==X){for(wt=K,Ft=h;Et=Ft<=vt?l:Ft>=vt+c?c:Ft-vt,!(wt0&&a>o&&(a=o);for(var h=0;h=0?(u=l.substr(0,c),d=l.substr(c+1)):(u=l,d=""),f=decodeURIComponent(u),p=decodeURIComponent(d),fl(r,f)?Array.isArray(r[f])?r[f].push(p):r[f]=[r[f],p]:r[f]=p}return r},di=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},ml=function(e,t,i,s){return t=t||"&",i=i||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(r){var n=encodeURIComponent(di(r))+i;return Array.isArray(e[r])?e[r].map(function(o){return n+encodeURIComponent(di(o))}).join(t):n+encodeURIComponent(di(e[r]))}).join(t):s?encodeURIComponent(di(s))+i+encodeURIComponent(di(e)):""},ur=or(function(e,t){"use strict";t.decode=t.parse=pl,t.encode=t.stringify=ml}),lo=fi,co=Rl,_l=Cl,uo=Al,gl=Lt;function Lt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var yl=/^([a-z0-9.+-]+:)/i,vl=/:[0-9]*$/,xl=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,bl=["<",">",\'"\',"`"," ","\\r",`\n`," "],Tl=["{","}","|","\\\\","^","`"].concat(bl),dr=["\'"].concat(Tl),fo=["%","/","?",";","#"].concat(dr),po=["/","?","#"],El=255,mo=/^[+a-z0-9A-Z_-]{0,63}$/,wl=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Sl={javascript:!0,"javascript:":!0},fr={javascript:!0,"javascript:":!0},We={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function fi(e,t,i){if(e&&se.isObject(e)&&e instanceof Lt)return e;var s=new Lt;return s.parse(e,t,i),s}Lt.prototype.parse=function(e,t,i){if(!se.isString(e))throw new TypeError("Parameter \'url\' must be a string, not "+typeof e);var s=e.indexOf("?"),r=s!==-1&&s127?A+="x":A+=x[D];if(!A.match(mo)){var E=b.slice(0,f),O=b.slice(f+1),H=x.match(wl);H&&(E.push(H[1]),O.unshift(H[2])),O.length&&(a="/"+O.join(".")+a),this.hostname=E.join(".");break}}}this.hostname.length>El?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=dl.toASCII(this.hostname));var I=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+I,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Sl[c])for(var f=0,y=dr.length;f0?i.host.split("@"):!1;A&&(i.auth=A.shift(),i.host=i.hostname=A.shift())}return i.search=e.search,i.query=e.query,(!se.isNull(i.pathname)||!se.isNull(i.search))&&(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!b.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var D=b.slice(-1)[0],R=(i.host||e.host||b.length>1)&&(D==="."||D==="..")||D==="",E=0,O=b.length;O>=0;O--)D=b[O],D==="."?b.splice(O,1):D===".."?(b.splice(O,1),E++):E&&(b.splice(O,1),E--);if(!g&&!v)for(;E--;E)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),R&&b.join("/").substr(-1)!=="/"&&b.push("");var H=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(x){i.hostname=i.host=H?"":b.length?b.shift():"";var A=i.host&&i.host.indexOf("@")>0?i.host.split("@"):!1;A&&(i.auth=A.shift(),i.host=i.hostname=A.shift())}return g=g||i.host&&b.length,g&&!H&&b.unshift(""),b.length?i.pathname=b.join("/"):(i.pathname=null,i.path=null),(!se.isNull(i.pathname)||!se.isNull(i.search))&&(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},Lt.prototype.parseHost=function(){var e=this.host,t=vl.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var rf={parse:lo,resolve:co,resolveObject:_l,format:uo,Url:gl};const _o={parse:lo,format:uo,resolve:co};function qt(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function pi(e){return e.split("?")[0].split("#")[0]}function Il(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Pl(e,t,i){return e.replace(new RegExp(Il(t),"g"),i)}function Ml(e,t){let i="",s=0,r=-1,n=0,o=-1;for(let a=0;a<=e.length;++a){if(a2){const h=i.lastIndexOf("/");if(h!==i.length-1){h===-1?(i="",s=0):(i=i.slice(0,h),s=i.length-1-i.lastIndexOf("/")),r=a,n=0;continue}}else if(i.length===2||i.length===1){i="",s=0,r=a,n=0;continue}}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+=`/${e.slice(r+1,a)}`:i=e.slice(r+1,a),s=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return i}const Tt={toPosix(e){return Pl(e,"\\\\","/")},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&\',()*+;=\\-._~:@\\/?%\\s<>]*?)$/i.test(e)},hasProtocol(e){return/^[^/:]+:\\//.test(this.toPosix(e))},getProtocol(e){qt(e),e=this.toPosix(e);let t="";const i=/^file:\\/\\/\\//.exec(e),s=/^[^/:]+:\\/\\//.exec(e),r=/^[^/:]+:\\//.exec(e);if(i||s||r){const n=(i==null?void 0:i[0])||(s==null?void 0:s[0])||(r==null?void 0:r[0]);t=n,e=e.slice(n.length)}return t},toAbsolute(e,t,i){if(this.isDataUrl(e))return e;const s=pi(this.toPosix(t!=null?t:P.ADAPTER.getBaseUrl())),r=pi(this.toPosix(i!=null?i:this.rootname(s)));return qt(e),e=this.toPosix(e),e.startsWith("/")?Tt.join(r,e.slice(1)):this.isAbsolute(e)?e:this.join(s,e)},normalize(e){if(e=this.toPosix(e),qt(e),e.length===0)return".";let t="";const i=e.startsWith("/");this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));const s=e.endsWith("/");return e=Ml(e,!1),e.length>0&&s&&(e+="/"),i?`/${e}`:t+e},isAbsolute(e){return qt(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith("/")},join(...e){var i;if(e.length===0)return".";let t;for(let s=0;s0)if(t===void 0)t=r;else{const n=(i=e[s-1])!=null?i:"";this.extname(n)?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?".":this.normalize(t)},dirname(e){if(qt(e),e.length===0)return".";e=this.toPosix(e);let t=e.charCodeAt(0);const i=t===47;let s=-1,r=!0;const n=this.getProtocol(e),o=e;e=e.slice(n.length);for(let a=e.length-1;a>=1;--a)if(t=e.charCodeAt(a),t===47){if(!r){s=a;break}}else r=!1;return s===-1?i?"/":this.isUrl(o)?n+e:n:i&&s===1?"//":n+e.slice(0,s)},rootname(e){qt(e),e=this.toPosix(e);let t="";if(e.startsWith("/")?t="/":t=this.getProtocol(e),this.isUrl(e)){const i=e.indexOf("/",t.length);i!==-1?t=e.slice(0,i):t=e,t.endsWith("/")||(t+="/")}return t},basename(e,t){qt(e),t&&qt(t),e=pi(this.toPosix(e));let i=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let o=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const h=e.charCodeAt(n);if(h===47){if(!r){i=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return i===s?s=a:s===-1&&(s=e.length),e.slice(i,s)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!r){i=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":e.slice(i,s)},extname(e){qt(e),e=pi(this.toPosix(e));let t=-1,i=0,s=-1,r=!0,n=0;for(let o=e.length-1;o>=0;--o){const a=e.charCodeAt(o);if(a===47){if(!r){i=o+1;break}continue}s===-1&&(r=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===i+1?"":e.slice(t,s)},parse(e){qt(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;e=pi(this.toPosix(e));let i=e.charCodeAt(0);const s=this.isAbsolute(e);let r;const n="";t.root=this.rootname(e),s||this.hasProtocol(e)?r=1:r=0;let o=-1,a=0,h=-1,l=!0,c=e.length-1,u=0;for(;c>=r;--c){if(i=e.charCodeAt(c),i===47){if(!l){a=c+1;break}continue}h===-1&&(l=!1,h=c+1),i===46?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return o===-1||h===-1||u===0||u===1&&o===h-1&&o===a+1?h!==-1&&(a===0&&s?t.base=t.name=e.slice(1,h):t.base=t.name=e.slice(a,h)):(a===0&&s?(t.name=e.slice(1,o),t.base=e.slice(1,h)):(t.name=e.slice(a,o),t.base=e.slice(a,h)),t.ext=e.slice(o,h)),t.dir=this.dirname(e),n&&(t.dir=n+t.dir),t},sep:"/",delimiter:":"},go={};function z(e,t,i=3){if(go[t])return;let s=new Error().stack;typeof s=="undefined"?console.warn("PixiJS Deprecation Warning: ",`${t}\nDeprecated since v${e}`):(s=s.split(`\n`).splice(i).join(`\n`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}\nDeprecated since v${e}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}\nDeprecated since v${e}`),console.warn(s))),go[t]=!0}function Bl(){z("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function Dl(){z("7.0.0",`sayHello is deprecated, please use Renderer\'s "hello" option`)}let pr;function yo(){return typeof pr=="undefined"&&(pr=function(){var i;const t={stencil:!0,failIfMajorPerformanceCaveat:P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!P.ADAPTER.getWebGLRenderingContext())return!1;const s=P.ADAPTER.createCanvas();let r=s.getContext("webgl",t)||s.getContext("experimental-webgl",t);const n=!!((i=r==null?void 0:r.getContextAttributes())!=null&&i.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch(s){return!1}}()),pr}var Fl={grad:.9,turn:360,rad:360/(2*Math.PI)},ue=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},mt=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=Math.pow(10,t)),Math.round(i*e)/i+0},Ot=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=1),e>i?i:e>t?e:t},vo=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},xo=function(e){return{r:Ot(e.r,0,255),g:Ot(e.g,0,255),b:Ot(e.b,0,255),a:Ot(e.a)}},mr=function(e){return{r:mt(e.r),g:mt(e.g),b:mt(e.b),a:mt(e.a,3)}},Nl=/^#([0-9a-f]{3,8})$/i,as=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},bo=function(e){var t=e.r,i=e.g,s=e.b,r=e.a,n=Math.max(t,i,s),o=n-Math.min(t,i,s),a=o?n===t?(i-s)/o:n===i?2+(s-t)/o:4+(t-i)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},To=function(e){var t=e.h,i=e.s,s=e.v,r=e.a;t=t/360*6,i/=100,s/=100;var n=Math.floor(t),o=s*(1-i),a=s*(1-(t-n)*i),h=s*(1-(1-t+n)*i),l=n%6;return{r:255*[s,a,o,o,h,s][l],g:255*[h,s,s,a,o,o][l],b:255*[o,o,h,s,s,a][l],a:r}},Eo=function(e){return{h:vo(e.h),s:Ot(e.s,0,100),l:Ot(e.l,0,100),a:Ot(e.a)}},wo=function(e){return{h:mt(e.h),s:mt(e.s),l:mt(e.l),a:mt(e.a,3)}},So=function(e){return To((i=(t=e).s,{h:t.h,s:(i*=((s=t.l)<50?s:100-s)/100)>0?2*i/(s+i)*100:0,v:s+i,a:t.a}));var t,i,s},mi=function(e){return{h:(t=bo(e)).h,s:(r=(200-(i=t.s))*(s=t.v)/100)>0&&r<200?i*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,i,s,r},Ll=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,Ol=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,Ul=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,kl=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,_r={string:[[function(e){var t=Nl.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?mt(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?mt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Ul.exec(e)||kl.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:xo({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Ll.exec(e)||Ol.exec(e);if(!t)return null;var i,s,r=Eo({h:(i=t[1],s=t[2],s===void 0&&(s="deg"),Number(i)*(Fl[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return So(r)},"hsl"]],object:[[function(e){var t=e.r,i=e.g,s=e.b,r=e.a,n=r===void 0?1:r;return ue(t)&&ue(i)&&ue(s)?xo({r:Number(t),g:Number(i),b:Number(s),a:Number(n)}):null},"rgb"],[function(e){var t=e.h,i=e.s,s=e.l,r=e.a,n=r===void 0?1:r;if(!ue(t)||!ue(i)||!ue(s))return null;var o=Eo({h:Number(t),s:Number(i),l:Number(s),a:Number(n)});return So(o)},"hsl"],[function(e){var t=e.h,i=e.s,s=e.v,r=e.a,n=r===void 0?1:r;if(!ue(t)||!ue(i)||!ue(s))return null;var o=function(a){return{h:vo(a.h),s:Ot(a.s,0,100),v:Ot(a.v,0,100),a:Ot(a.a)}}({h:Number(t),s:Number(i),v:Number(s),a:Number(n)});return To(o)},"hsv"]]},Ao=function(e,t){for(var i=0;i=.5},e.prototype.toHex=function(){return t=mr(this.rgba),i=t.r,s=t.g,r=t.b,o=(n=t.a)<1?as(mt(255*n)):"","#"+as(i)+as(s)+as(r)+o;var t,i,s,r,n,o},e.prototype.toRgb=function(){return mr(this.rgba)},e.prototype.toRgbString=function(){return t=mr(this.rgba),i=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+i+", "+s+", "+r+", "+n+")":"rgb("+i+", "+s+", "+r+")";var t,i,s,r,n},e.prototype.toHsl=function(){return wo(mi(this.rgba))},e.prototype.toHslString=function(){return t=wo(mi(this.rgba)),i=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+i+", "+s+"%, "+r+"%, "+n+")":"hsl("+i+", "+s+"%, "+r+"%)";var t,i,s,r,n},e.prototype.toHsv=function(){return t=bo(this.rgba),{h:mt(t.h),s:mt(t.s),v:mt(t.v),a:mt(t.a,3)};var t},e.prototype.invert=function(){return re({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),re(gr(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),re(gr(this.rgba,-t))},e.prototype.grayscale=function(){return re(gr(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),re(Co(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),re(Co(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?re({r:(i=this.rgba).r,g:i.g,b:i.b,a:t}):mt(this.rgba.a,3);var i},e.prototype.hue=function(t){var i=mi(this.rgba);return typeof t=="number"?re({h:t,s:i.s,l:i.l,a:i.a}):mt(i.h)},e.prototype.isEqual=function(t){return this.toHex()===re(t).toHex()},e}(),re=function(e){return e instanceof hs?e:new hs(e)},Io=[],Gl=function(e){e.forEach(function(t){Io.indexOf(t)<0&&(t(hs,_r),Io.push(t))})},of=function(){return new hs({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};function Hl(e,t){var i={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in i)s[i[r]]=r;var n={};e.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=s[this.toHex()];if(l)return l;if(o!=null&&o.closest){var c=this.toRgb(),u=1/0,d="black";if(!n.length)for(var f in i)n[f]=new e(i[f]).toRgb();for(var p in i){var _=(a=c,h=n[p],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));_r===t[n]);if(e!==null&&t!==null){const r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,s]=this._components;return{r:e,g:t,b:i,a:s}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,s]=this._components;return e=e!=null?e:[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toRgbArray(e){e=e!=null?e:[];const[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,s,r]=$e.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,s]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(s*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e!=null?e:[];const[t,i,s,r]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e}normalize(e){let t,i,s,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const n=e;t=(n>>16&255)/255,i=(n>>8&255)/255,s=(n&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,r=255]=e,t/=255,i/=255,s/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const o=$e.HEX_PATTERN.exec(e);o&&(e=`#${o[2]}`)}const n=re(e);n.isValid()&&({r:t,g:i,b:s,a:r}=n.rgba,t/=255,i/=255,s/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,r)=>{e[r]=Math.min(Math.max(s,t),i)}),e)}};let j=$e;j.shared=new $e,j.temp=new $e,j.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function Xl(e,t=[]){return z("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),j.shared.setValue(e).toRgbArray(t)}function Po(e){return z("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),j.shared.setValue(e).toHex()}function Vl(e){return z("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),j.shared.setValue(e).toNumber()}function Mo(e){return z("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),j.shared.setValue(e).toNumber()}function zl(){const e=[],t=[];for(let s=0;s<32;s++)e[s]=s,t[s]=s;e[G.NORMAL_NPM]=G.NORMAL,e[G.ADD_NPM]=G.ADD,e[G.SCREEN_NPM]=G.SCREEN,t[G.NORMAL]=G.NORMAL_NPM,t[G.ADD]=G.ADD_NPM,t[G.SCREEN]=G.SCREEN_NPM;const i=[];return i.push(t),i.push(e),i}const vr=zl();function xr(e,t){return vr[t?1:0][e]}function Wl(e,t,i,s=!0){return z("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),j.shared.setValue(e).premultiply(t,s).toArray(i!=null?i:new Float32Array(4))}function $l(e,t){return z("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),j.shared.setValue(e).toPremultiplied(t)}function jl(e,t,i,s=!0){return z("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),j.shared.setValue(e).premultiply(t,s).toArray(i!=null?i:new Float32Array(4))}const Bo=/^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;function Do(e,t=null){const i=e*6;if(t=t||new Uint16Array(i),t.length!==i)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${i}`);for(let s=0,r=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function br(e){return!(e&e-1)&&!!e}function Tr(e){let t=(e>65535?1:0)<<4;e>>>=t;let i=(e>255?1:0)<<3;return e>>>=i,t|=i,i=(e>15?1:0)<<2,e>>>=i,t|=i,i=(e>3?1:0)<<1,e>>>=i,t|=i,t|e>>1}function Ie(e,t,i){const s=e.length;let r;if(t>=s||i===0)return;i=t+i>s?s-t:i;const n=s-i;for(r=t;r(e.Renderer="renderer",e.Application="application",e.RendererSystem="renderer-webgl-system",e.RendererPlugin="renderer-webgl-plugin",e.CanvasRendererSystem="renderer-canvas-system",e.CanvasRendererPlugin="renderer-canvas-plugin",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e))(M||{});const wr=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");const t=typeof e.extension!="object"?{type:e.extension}:e.extension;e=Qi(bt({},t),{ref:e})}if(typeof e=="object")e=bt({},e);else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},Ho=(e,t)=>{var i;return(i=wr(e).priority)!=null?i:t},U={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(wr).forEach(t=>{t.type.forEach(i=>{var s,r;return(r=(s=this._removeHandlers)[i])==null?void 0:r.call(s,t)})}),this},add(...e){return e.map(wr).forEach(t=>{t.type.forEach(i=>{const s=this._addHandlers,r=this._queue;s[i]?s[i](t):(r[i]=r[i]||[],r[i].push(t))})}),this},handle(e,t,i){const s=this._addHandlers,r=this._removeHandlers;if(s[e]||r[e])throw new Error(`Extension type ${e} already has a handler`);s[e]=t,r[e]=i;const n=this._queue;return n[e]&&(n[e].forEach(o=>t(o)),delete n[e]),this},handleByMap(e,t){return this.handle(e,i=>{t[i.name]=i.ref},i=>{delete t[i.name]})},handleByList(e,t,i=-1){return this.handle(e,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>Ho(n,i)-Ho(r,i)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};class ds{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn\'t a valid view type`)}}}const ec=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`\n`);function ic(e){let t="";for(let i=0;i0&&(t+=`\nelse `),i=0;--s){const r=fs[s];if(r.test&&r.test(e,i))return new r(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class Bt{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,i,s,r,n,o,a,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const i=this.items.indexOf(t);return i!==-1&&(this.ensureNonAliasedItems(),this.items.splice(i,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Bt.prototype,{dispatch:{value:Bt.prototype.emit},run:{value:Bt.prototype.emit}});class je{constructor(t=0,i=0){this._width=t,this._height=i,this.destroyed=!1,this.internal=!1,this.onResize=new Bt("setRealSize"),this.onUpdate=new Bt("update"),this.onError=new Bt("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,i){(t!==this._width||i!==this._height)&&(this._width=t,this._height=i,this.onResize.emit(t,i))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,i,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,i){return!1}}class Ye extends je{constructor(t,i){const{width:s,height:r}=i||{};if(!s||!r)throw new Error("BufferResource width or height invalid");super(s,r),this.data=t}upload(t,i,s){const r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===Nt.UNPACK);const n=i.realWidth,o=i.realHeight;return s.width===n&&s.height===o?r.texSubImage2D(i.target,0,0,0,n,o,i.format,s.type,this.data):(s.width=n,s.height=o,r.texImage2D(i.target,0,s.internalFormat,n,o,0,i.format,s.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const sc={scaleMode:ee.NEAREST,format:C.RGBA,alphaMode:Nt.NPM},qe=class extends Ve{constructor(e=null,t=null){super(),t=Object.assign({},qe.defaultOptions,t);const{alphaMode:i,mipmap:s,anisotropicLevel:r,scaleMode:n,width:o,height:a,wrapMode:h,format:l,type:c,target:u,resolution:d,resourceOptions:f}=t;e&&!(e instanceof je)&&(e=Mr(e,f),e.internal=!0),this.resolution=d||P.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((a||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=r,this._wrapMode=h,this._scaleMode=n,this.format=l,this.type=c,this.target=u,this.alphaMode=i,this.uid=xe(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=br(this.realWidth)&&br(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Mt[this.cacheId],delete St[this.cacheId],this.cacheId=null),this.dispose(),qe.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=P.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let r=null;if(s)r=e;else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${xe()}`}r=e._pixiId}let n=Mt[r];if(s&&i&&!n)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return n||(n=new qe(e,t),n.cacheId=r,qe.addToCache(n,r)),n}static fromBuffer(e,t,i,s){e=e||new Float32Array(t*i*4);const r=new Ye(e,{width:t,height:i}),n=e instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new qe(r,Object.assign({},sc,{type:n},s))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Mt[t]&&Mt[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Mt[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Mt[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete Mt[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(e[e.POLY=0]="POLY",e[e.RECT=1]="RECT",e[e.CIRC=2]="CIRC",e[e.ELIP=3]="ELIP",e[e.RREC=4]="RREC",e))(_t||{});class Y{constructor(t=0,i=0){this.x=0,this.y=0,this.x=t,this.y=i}clone(){return new Y(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,i=t){return this.x=t,this.y=i,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const ms=[new Y,new Y,new Y,new Y];class ${constructor(t=0,i=0,s=0,r=0){this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(r),this.type=_t.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new $(0,0,0,0)}clone(){return new $(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,i){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&it.right?t.right:this.right)<=E)return!1;const H=this.yt.bottom?t.bottom:this.bottom)>H}const s=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=s||o<=n)return!1;const a=ms[0].set(t.left,t.top),h=ms[1].set(t.left,t.bottom),l=ms[2].set(t.right,t.top),c=ms[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(i.a*i.d-i.b*i.c);if(u===0||(i.apply(a,a),i.apply(h,h),i.apply(l,l),i.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=s||Math.min(a.x,h.x,l.x,c.x)>=r||Math.max(a.y,h.y,l.y,c.y)<=n||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const d=u*(h.y-a.y),f=u*(a.x-h.x),p=d*s+f*n,_=d*r+f*n,g=d*s+f*o,v=d*r+f*o;if(Math.max(p,_,g,v)<=d*a.x+f*a.y||Math.min(p,_,g,v)>=d*c.x+f*c.y)return!1;const b=u*(a.y-l.y),y=u*(l.x-a.x),x=b*s+y*n,A=b*r+y*n,D=b*s+y*o,R=b*r+y*o;return!(Math.max(x,A,D,R)<=b*a.x+y*a.y||Math.min(x,A,D,R)>=b*c.x+y*c.y)}pad(t=0,i=t){return this.x-=t,this.y-=i,this.width+=t*2,this.height+=i*2,this}fit(t){const i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,i=.001){const s=Math.ceil((this.x+this.width-i)*t)/t,r=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=r-this.y,this}enlarge(t){const i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=r,this.height=n-r,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class _s{constructor(t=0,i=0,s=0){this.x=t,this.y=i,this.radius=s,this.type=_t.CIRC}clone(){return new _s(this.x,this.y,this.radius)}contains(t,i){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-i;return r*=r,n*=n,r+n<=s}getBounds(){return new $(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class gs{constructor(t=0,i=0,s=0,r=0){this.x=t,this.y=i,this.width=s,this.height=r,this.type=_t.ELIP}clone(){return new gs(this.x,this.y,this.width,this.height)}contains(t,i){if(this.width<=0||this.height<=0)return!1;let s=(t-this.x)/this.width,r=(i-this.y)/this.height;return s*=s,r*=r,s+r<=1}getBounds(){return new $(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Pe{constructor(...t){let i=Array.isArray(t[0])?t[0]:t;if(typeof i[0]!="number"){const s=[];for(let r=0,n=i.length;ri!=c>i&&t<(l-a)*((i-h)/(c-h))+a&&(s=!s)}return s}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,i)=>`${t}, ${i}`,"")}]`}}class ys{constructor(t=0,i=0,s=0,r=0,n=20){this.x=t,this.y=i,this.width=s,this.height=r,this.radius=n,this.type=_t.RREC}clone(){return new ys(this.x,this.y,this.width,this.height,this.radius)}contains(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),n=i-(this.y+s);const o=s*s;if(r*r+n*n<=o||(r=t-(this.x+this.width-s),r*r+n*n<=o)||(n=i-(this.y+this.height-s),r*r+n*n<=o)||(r=t-(this.x+s),r*r+n*n<=o))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}class tt{constructor(t=1,i=0,s=0,r=1,n=0,o=0){this.array=null,this.a=t,this.b=i,this.c=s,this.d=r,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,i,s,r,n,o){return this.a=t,this.b=i,this.c=s,this.d=r,this.tx=n,this.ty=o,this}toArray(t,i){this.array||(this.array=new Float32Array(9));const s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,i){i=i||new Y;const s=t.x,r=t.y;return i.x=this.a*s+this.c*r+this.tx,i.y=this.b*s+this.d*r+this.ty,i}applyInverse(t,i){i=i||new Y;const s=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return i.x=this.d*s*r+-this.c*s*n+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*n+-this.b*s*r+(-this.ty*this.a+this.tx*this.b)*s,i}translate(t,i){return this.tx+=t,this.ty+=i,this}scale(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this}rotate(t){const i=Math.cos(t),s=Math.sin(t),r=this.a,n=this.c,o=this.tx;return this.a=r*i-this.b*s,this.b=r*s+this.b*i,this.c=n*i-this.d*s,this.d=n*s+this.d*i,this.tx=o*i-this.ty*s,this.ty=o*s+this.ty*i,this}append(t){const i=this.a,s=this.b,r=this.c,n=this.d;return this.a=t.a*i+t.b*r,this.b=t.a*s+t.b*n,this.c=t.c*i+t.d*r,this.d=t.c*s+t.d*n,this.tx=t.tx*i+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}setTransform(t,i,s,r,n,o,a,h,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(s*this.a+r*this.c),this.ty=i-(s*this.b+r*this.d),this}prepend(t){const i=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this}decompose(t){const i=this.a,s=this.b,r=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-r,n),h=Math.atan2(s,i),l=Math.abs(a+h);return l<1e-5||Math.abs(yi-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(o.x*i+o.y*r),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){const t=this.a,i=this.b,s=this.c,r=this.d,n=this.tx,o=t*r-i*s;return this.a=r/o,this.b=-i/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-r*n)/o,this.ty=-(t*this.ty-i*n)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new tt;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new tt}static get TEMP_MATRIX(){return new tt}}const Me=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Be=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],De=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Fe=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Dr=[],$o=[],vs=Math.sign;function lc(){for(let e=0;e<16;e++){const t=[];Dr.push(t);for(let i=0;i<16;i++){const s=vs(Me[e]*Me[i]+De[e]*Be[i]),r=vs(Be[e]*Me[i]+Fe[e]*Be[i]),n=vs(Me[e]*De[i]+De[e]*Fe[i]),o=vs(Be[e]*De[i]+Fe[e]*Fe[i]);for(let a=0;a<16;a++)if(Me[a]===s&&Be[a]===r&&De[a]===n&&Fe[a]===o){t.push(a);break}}}for(let e=0;e<16;e++){const t=new tt;t.set(Me[e],Be[e],De[e],Fe[e],0,0),$o.push(t)}}lc();const it={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>Me[e],uY:e=>Be[e],vX:e=>De[e],vY:e=>Fe[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Dr[e][t],sub:(e,t)=>Dr[e][it.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?it.S:it.N:Math.abs(t)*2<=Math.abs(e)?e>0?it.E:it.W:t>0?e>0?it.SE:it.SW:e>0?it.NE:it.NW,matrixAppendRotationInv:(e,t,i=0,s=0)=>{const r=$o[it.inv(t)];r.tx=i,r.ty=s,e.append(r)}};class me{constructor(t,i,s=0,r=0){this._x=s,this._y=r,this.cb=t,this.scope=i}clone(t=this.cb,i=this.scope){return new me(t,i,this._x,this._y)}set(t=0,i=t){return(this._x!==t||this._y!==i)&&(this._x=t,this._y=i,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=${0} y=${0} scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const jo=class{constructor(){this.worldTransform=new tt,this.localTransform=new tt,this.position=new me(this.onChange,this,0,0),this.scale=new me(this.onChange,this,1,1),this.pivot=new me(this.onChange,this,0,0),this.skew=new me(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){const i=e.worldTransform,s=this.worldTransform;s.a=t.a*i.a+t.b*i.c,s.b=t.a*i.b+t.b*i.d,s.c=t.c*i.a+t.d*i.c,s.d=t.c*i.b+t.d*i.d,s.tx=t.tx*i.a+t.ty*i.c+i.tx,s.ty=t.tx*i.b+t.ty*i.d+i.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};let vi=jo;vi.IDENTITY=new jo;var cc=`varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}`,uc=`attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n`;function Yo(e,t,i){const s=e.createShader(t);return e.shaderSource(s,i),e.compileShader(s),s}function Fr(e){const t=new Array(e);for(let i=0;ie.type==="float"&&e.size===1&&!e.isArray,code:e=>`\n if(uv["${e}"] !== ud["${e}"].value)\n {\n ud["${e}"].value = uv["${e}"]\n gl.uniform1f(ud["${e}"].location, uv["${e}"])\n }\n `},{test:(e,t)=>(e.type==="sampler2D"||e.type==="samplerCube"||e.type==="sampler2DArray")&&e.size===1&&!e.isArray&&(t==null||t.castToBaseTexture!==void 0),code:e=>`t = syncData.textureCount++;\n\n renderer.texture.bind(uv["${e}"], t);\n\n if(ud["${e}"].value !== t)\n {\n ud["${e}"].value = t;\n gl.uniform1i(ud["${e}"].location, t);\n; // eslint-disable-line max-len\n }`},{test:(e,t)=>e.type==="mat3"&&e.size===1&&!e.isArray&&t.a!==void 0,code:e=>`\n gl.uniformMatrix3fv(ud["${e}"].location, false, uv["${e}"].toArray(true));\n `,codeUbo:e=>`\n var ${e}_matrix = uv.${e}.toArray(true);\n\n data[offset] = ${e}_matrix[0];\n data[offset+1] = ${e}_matrix[1];\n data[offset+2] = ${e}_matrix[2];\n \n data[offset + 4] = ${e}_matrix[3];\n data[offset + 5] = ${e}_matrix[4];\n data[offset + 6] = ${e}_matrix[5];\n \n data[offset + 8] = ${e}_matrix[6];\n data[offset + 9] = ${e}_matrix[7];\n data[offset + 10] = ${e}_matrix[8];\n `},{test:(e,t)=>e.type==="vec2"&&e.size===1&&!e.isArray&&t.x!==void 0,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["${e}"].location, v.x, v.y);\n }`,codeUbo:e=>`\n v = uv.${e};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n `},{test:e=>e.type==="vec2"&&e.size===1&&!e.isArray,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["${e}"].location, v[0], v[1]);\n }\n `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.width!==void 0,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["${e}"].location, v.x, v.y, v.width, v.height)\n }`,codeUbo:e=>`\n v = uv.${e};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud["${e}"].location, v.red, v.green, v.blue, v.alpha)\n }`,codeUbo:e=>`\n v = uv.${e};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n `},{test:(e,t)=>e.type==="vec3"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n \n gl.uniform3f(ud["${e}"].location, v.red, v.green, v.blue)\n }`,codeUbo:e=>`\n v = uv.${e};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n `},{test:e=>e.type==="vec4"&&e.size===1&&!e.isArray,code:e=>`\n cv = ud["${e}"].value;\n v = uv["${e}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3])\n }`}],dc={float:`\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }`,vec2:`\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }`,vec3:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }`,vec4:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }`,int:`\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }`,ivec2:`\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }`,ivec3:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,ivec4:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,uint:`\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }`,uvec2:`\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }`,uvec3:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }`,uvec4:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }`,bool:`\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }`,bvec2:`\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }`,bvec3:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,bvec4:`\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }`,samplerCube:`\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }`,sampler2DArray:`\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }`},fc={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function pc(e,t){var s;const i=[`\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n `];for(const r in e.uniforms){const n=t[r];if(!n){(s=e.uniforms[r])!=null&&s.group&&(e.uniforms[r].ubo?i.push(`\n renderer.shader.syncUniformBufferGroup(uv.${r}, \'${r}\');\n `):i.push(`\n renderer.shader.syncUniformGroup(uv.${r}, syncData);\n `));continue}const o=e.uniforms[r];let a=!1;for(let h=0;h=et.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Ke=t}return Ke}let xs;function mc(){if(!xs){xs=Pt.MEDIUM;const e=Zo();e&&e.getShaderPrecisionFormat&&(xs=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Pt.HIGH:Pt.MEDIUM)}return xs}function Jo(e,t){const i=e.getShaderSource(t).split(`\n`).map((l,c)=>`${c}: ${l}`),s=e.getShaderInfoLog(t),r=s.split(`\n`),n={},o=r.map(l=>parseFloat(l.replace(/^ERROR\\: 0\\:([\\d]+)\\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=!0,!0):!1),a=[""];o.forEach(l=>{i[l-1]=`%c${i[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=i.join(`\n`);a[0]=h,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function _c(e,t,i,s){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(i,e.COMPILE_STATUS)||Jo(e,i),e.getShaderParameter(s,e.COMPILE_STATUS)||Jo(e,s),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const gc={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Qo(e){return gc[e]}let bs=null;const ta={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function ea(e,t){if(!bs){const i=Object.keys(ta);bs={};for(let s=0;s0&&(i+=`\nelse `),sthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=Zt._textureArrayPool,s=this.renderer.batch,r=this._tempBoundTextures,n=this.renderer.textureGC.count;let o=++V._globalBatch,a=0,h=i[0],l=0;s.copyBoundTextures(r,t);for(let c=0;c=t&&(s.boundArray(h,r,o,t),this.buildDrawCalls(h,l,c),l=c,h=i[++a],++o),u._batchEnabled=o,u.touched=n,h.elements[h.count++]=u)}h.count>0&&(s.boundArray(h,r,o,t),this.buildDrawCalls(h,l,this._bufferSize),++a,++o);for(let c=0;c0);for(let p=0;p=0;--r)t[r]=s[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,i,s,r){const{elements:n,ids:o,count:a}=t;let h=0;for(let l=0;l=0&&u=et.WEBGL2&&(s=t.getContext("webgl2",i)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=t.getContext("webgl",i)||t.getContext("experimental-webgl",i),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,i={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,i,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,i,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const i=t.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),i&&!i.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=s||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}wi.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},wi.extension={type:M.RendererSystem,name:"context"},U.add(wi);class Ac extends Ye{upload(t,i,s){const r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===Nt.UNPACK);const n=i.realWidth,o=i.realHeight;return s.width===n&&s.height===o?r.texSubImage2D(i.target,0,0,0,n,o,i.format,s.type,this.data):(s.width=n,s.height=o,r.texImage2D(i.target,0,s.internalFormat,n,o,0,i.format,s.type,this.data)),!0}}class ws{constructor(t,i){this.width=Math.round(t||100),this.height=Math.round(i||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bt("disposeFramebuffer"),this.multisample=ht.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,i){return this.colorTextures[t]=i||new V(null,{scaleMode:ee.NEAREST,resolution:1,mipmap:Wt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new V(new Ac(null,{width:this.width,height:this.height}),{scaleMode:ee.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Wt.OFF,format:C.DEPTH_COMPONENT,type:k.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,i){if(t=Math.round(t),i=Math.round(i),!(t===this.width&&i===this.height)){this.width=t,this.height=i,this.dirtyId++,this.dirtySize++;for(let s=0;s{const r=this.source;this.url=r.src;const n=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.resize(r.width,r.height),this._load=null,this.createBitmap?i(this.process()):i(this))};r.complete&&r.src?n():(r.onload=n,r.onerror=o=>{s(o),this.onError.emit(o)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const i=globalThis.createImageBitmap,s=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:s?"cors":"no-cors"}).then(r=>r.blob()).then(r=>i(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Nt.UNPACK?"premultiply":"none"})).then(r=>this.destroyed?Promise.reject():(this.bitmap=r,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,i,s){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,i,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,i,s,this.bitmap),!this.preserveBitmap){let r=!0;const n=i._glTextures;for(const o in n){const a=n[o];if(a!==s&&a.dirtyId!==i.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement!="undefined"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Ur{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,i,s){const r=i.width,n=i.height;if(s){const o=t.width/2/r,a=t.height/2/n,h=t.x/r+o,l=t.y/n+a;s=it.add(s,it.NW),this.x0=h+o*it.uX(s),this.y0=l+a*it.uY(s),s=it.add(s,2),this.x1=h+o*it.uX(s),this.y1=l+a*it.uY(s),s=it.add(s,2),this.x2=h+o*it.uX(s),this.y2=l+a*it.uY(s),s=it.add(s,2),this.x3=h+o*it.uX(s),this.y3=l+a*it.uY(s)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const oa=new Ur;function Ss(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class B extends Ve{constructor(t,i,s,r,n,o,a){if(super(),this.noFrame=!1,i||(this.noFrame=!0,i=new $(0,0,1,1)),t instanceof B&&(t=t.baseTexture),this.baseTexture=t,this._frame=i,this.trim=r,this.valid=!1,this._uvs=oa,this.uvMatrix=null,this.orig=s||i,this._rotate=Number(n||0),n===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Y(o.x,o.y):new Y(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=i:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:i}=this.baseTexture;(i==null?void 0:i.url)&&St[i.url]&&B.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,B.removeFromCache(this),this.textureCacheIds=null}clone(){var r;const t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),s=new B(this.baseTexture,!this.noFrame&&t,i,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=t),s}updateUvs(){this._uvs===oa&&(this._uvs=new Ur),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,i={},s=P.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof V){if(!t.cacheId){const a=(i==null?void 0:i.pixiIdPrefix)||"pixiid";t.cacheId=`${a}-${xe()}`,V.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const a=(i==null?void 0:i.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${xe()}`}n=t._pixiId}let o=St[n];if(r&&s&&!o)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!o&&!(t instanceof V)?(i.resolution||(i.resolution=fe(t)),o=new B(new V(t,i)),o.baseTexture.cacheId=n,V.addToCache(o.baseTexture,n),B.addToCache(o,n)):!o&&t instanceof V&&(o=new B(t),B.addToCache(o,n)),o}static fromURL(t,i){const s=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),r=B.from(t,Object.assign({resourceOptions:s},i),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,i,s,r){return new B(V.fromBuffer(t,i,s,r))}static fromLoader(t,i,s,r){const n=new V(t,Object.assign({scaleMode:V.defaultOptions.scaleMode,resolution:fe(i)},r)),{resource:o}=n;o instanceof Or&&(o.url=i);const a=new B(n);return s||(s=i),V.addToCache(a.baseTexture,s),B.addToCache(a,s),s!==i&&(V.addToCache(a.baseTexture,i),B.addToCache(a,i)),a.baseTexture.valid?Promise.resolve(a):new Promise(h=>{a.baseTexture.once("loaded",()=>h(a))})}static addToCache(t,i){i&&(t.textureCacheIds.includes(i)||t.textureCacheIds.push(i),St[i]&&St[i]!==t&&console.warn(`Texture added to the cache with an id [${i}] that already had an entry`),St[i]=t)}static removeFromCache(t){if(typeof t=="string"){const i=St[t];if(i){const s=i.textureCacheIds.indexOf(t);return s>-1&&i.textureCacheIds.splice(s,1),delete St[t],i}}else if(t!=null&&t.textureCacheIds){for(let i=0;ithis.baseTexture.width,a=s+n>this.baseTexture.height;if(o||a){const h=o&&a?"and":"or",l=`X: ${i} + ${r} = ${i+r} > ${this.baseTexture.width}`,c=`Y: ${s} + ${n} = ${s+n} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=r&&n&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return B._EMPTY||(B._EMPTY=new B(new V),Ss(B._EMPTY),Ss(B._EMPTY.baseTexture)),B._EMPTY}static get WHITE(){if(!B._WHITE){const t=P.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),B._WHITE=new B(V.from(t)),Ss(B._WHITE),Ss(B._WHITE.baseTexture)}return B._WHITE}}class be extends B{constructor(t,i){super(t,i),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,i,s=!0){const r=this.baseTexture.resolution,n=Math.round(t*r)/r,o=Math.round(i*r)/r;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,s&&this.baseTexture.resize(n,o),this.updateUvs()}setResolution(t){const{baseTexture:i}=this;i.resolution!==t&&(i.setResolution(t),this.resize(i.width,i.height,!1))}static create(t){return new be(new Lr(t))}}class kr{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,i,s=ht.NONE){const r=new Lr(Object.assign({width:t,height:i,resolution:1,multisample:s},this.textureOptions));return new be(r)}getOptimalTexture(t,i,s=1,r=ht.NONE){let n;t=Math.ceil(t*s-1e-6),i=Math.ceil(i*s-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||i!==this._pixelsHeight?(t=_i(t),i=_i(i),n=((t&65535)<<16|i&65535)>>>0,r>1&&(n+=r*4294967296)):n=r>1?-r:-1,this.texturePool[n]||(this.texturePool[n]=[]);let o=this.texturePool[n].pop();return o||(o=this.createTexture(t,i,r)),o.filterPoolKey=n,o.setResolution(s),o}getFilterTexture(t,i,s){const r=this.getOptimalTexture(t.width,t.height,i||t.resolution,s||ht.NONE);return r.filterFrame=t.filterFrame,r}returnTexture(t){const i=t.filterPoolKey;t.filterFrame=null,this.texturePool[i].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const i in this.texturePool){const s=this.texturePool[i];if(s)for(let r=0;r0&&t.height>0;for(const i in this.texturePool){if(!(Number(i)<0))continue;const s=this.texturePool[i];if(s)for(let r=0;r1&&(c=this.getOptimalFilterTexture(l.width,l.height,i.resolution),c.filterFrame=l.filterFrame),s[u].apply(this,l,c,$t.CLEAR,i);const d=l;l=c,c=d}s[u].apply(this,l,h.renderTexture,$t.BLEND,i),u>1&&i.multisample>1&&this.returnFilterTexture(i.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}i.clear(),this.statePool.push(i)}bindAndClear(t,i=$t.CLEAR){const{renderTexture:s,state:r}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t!=null&&t.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,s.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(i===$t.CLEAR||i===$t.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,i,s,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(s,r),t.uniforms.uSampler=i,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(i._frame,i.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(zt.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(zt.TRIANGLE_STRIP))}calculateSpriteMatrix(t,i){const{sourceFrame:s,destinationFrame:r}=this.activeState,{orig:n}=i._texture,o=t.set(r.width,0,0,r.height,s.x,s.y),a=i.worldTransform.copyTo(tt.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/n.width,1/n.height),o.translate(i.anchor.x,i.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,i,s=1,r=ht.NONE){return this.texturePool.getOptimalTexture(t,i,s,r)}getFilterTexture(t,i,s){if(typeof t=="number"){const n=t;t=i,i=n}t=t||this.activeState.renderTexture;const r=this.texturePool.getOptimalTexture(t.width,t.height,i||t.resolution,s||ht.NONE);return r.filterFrame=t.filterFrame,r}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,i){const s=As[0],r=As[1],n=As[2],o=As[3];s.set(i.left,i.top),r.set(i.left,i.bottom),n.set(i.right,i.top),o.set(i.right,i.bottom),t.apply(s,s),t.apply(r,r),t.apply(n,n),t.apply(o,o);const a=Math.min(s.x,r.x,n.x,o.x),h=Math.min(s.y,r.y,n.y,o.y),l=Math.max(s.x,r.x,n.x,o.x),c=Math.max(s.y,r.y,n.y,o.y);i.x=a,i.y=h,i.width=l-a,i.height=c-h}roundFrame(t,i,s,r,n){if(!(t.width<=0||t.height<=0||s.width<=0||s.height<=0)){if(n){const{a:o,b:a,c:h,d:l}=n;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}n=n?Hr.copyFrom(n):Hr.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(i),this.transformAABB(n.invert(),t)}}}Xr.extension={type:M.RendererSystem,name:"filter"},U.add(Xr);class la{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ht.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Rc=new $;class Vr{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ws(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new $,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let i=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;P.PREFER_ENV===et.WEBGL_LEGACY&&(i=null,s=null),i?t.drawBuffers=r=>i.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,i,s=0){const{gl:r}=this;if(t){const n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==s&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=s),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,s)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let o=0;o>s,a=i.height>>s,h=o/i.width;this.setViewport(i.x*h,i.y*h,o,a)}else{const o=t.width>>s,a=t.height>>s;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),i?this.setViewport(i.x,i.y,i.width,i.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,i,s,r){const n=this.viewport;t=Math.round(t),i=Math.round(i),s=Math.round(s),r=Math.round(r),(n.width!==s||n.height!==r||n.x!==t||n.y!==i)&&(n.x=t,n.y=i,n.width=s,n.height=r,this.gl.viewport(t,i,s,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,i,s,r,n=Rt.COLOR|Rt.DEPTH){const{gl:o}=this;o.clearColor(t,i,s,r),o.clear(n)}initFramebuffer(t){const{gl:i}=this,s=new la(i.createFramebuffer());return s.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(t),t.disposeRunner.add(this),s}resizeFramebuffer(t){const{gl:i}=this,s=t.glFramebuffers[this.CONTEXT_UID];s.stencil&&(i.bindRenderbuffer(i.RENDERBUFFER,s.stencil),s.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height));const r=t.colorTextures;let n=r.length;i.drawBuffers||(n=Math.min(n,1));for(let o=0;o1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||s.createRenderbuffer():r.msaaBuffer&&(s.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));const a=[];for(let h=0;h1&&s.drawBuffers(a),t.depthTexture&&this.writeDepthTexture){const l=t.depthTexture;this.renderer.texture.bind(l,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,i)}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(r.stencil=r.stencil||s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,r.stencil),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,t.width,t.height):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,r.stencil)):r.stencil&&(s.deleteRenderbuffer(r.stencil),r.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:i}=this;let s=ht.NONE;if(t<=1||i===null)return s;for(let r=0;r=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),i||(r.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&r.deleteRenderbuffer(s.msaaBuffer),s.stencil&&r.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,i)}disposeAll(t){const i=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;ss.createVertexArrayOES(),t.bindVertexArray=r=>s.bindVertexArrayOES(r),t.deleteVertexArray=r=>s.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(i.webGLVersion!==2){const s=t.getExtension("ANGLE_instanced_arrays");s?(t.vertexAttribDivisor=(r,n)=>s.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,o,a,h)=>s.drawElementsInstancedANGLE(r,n,o,a,h),t.drawArraysInstanced=(r,n,o,a)=>s.drawArraysInstancedANGLE(r,n,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=i.webGLVersion===2||!!i.extensions.uint32ElementIndex}bind(t,i){i=i||this.renderer.shader.shader;const{gl:s}=this;let r=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},n=!0);const o=r[i.program.id]||this.initGeometryVao(t,i,n);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?s.bindVertexArray(o):this.activateVao(t,i.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,i=this.renderer.buffer;for(let s=0;s0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==i&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}$r.extension={type:M.RendererSystem,name:"mask"},U.add($r);class fa{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:i}=this.renderer,s=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==s&&(r===0?i.disable(this.glConst):(i.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const pa=new tt,ma=[],Cs=class extends fa{constructor(e){super(e),this.glConst=P.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){var o;if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:s}=this,r=s.renderTexture,n=i.getBounds(!0,(o=ma.pop())!=null?o:new $);this.roundFrameToPixels(n,r.current?r.current.resolution:s.resolution,r.sourceFrame,r.destinationFrame,s.projection.transform),t&&n.fit(t),e._scissorRectLocal=n}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:s,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Cs.isMatrixRotated(t.worldTransform)||Cs.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,s,r){Cs.isMatrixRotated(r)||(r=r?pa.copyFrom(r):pa.identity(),r.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(r,e),e.fit(s),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&ma.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};let jr=Cs;jr.extension={type:M.RendererSystem,name:"scissor"},U.add(jr);class Yr extends fa{constructor(t){super(t),this.glConst=P.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const i=t.maskObject,{gl:s}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,r,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,n!==0&&(t._colorMask=n,s.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}pop(t){const i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=s?s._colorMask:15;r!==0&&(s._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(s._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Yr.extension={type:M.RendererSystem,name:"stencil"},U.add(Yr);class qr{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const i in t)this.plugins[i]=new t[i](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}qr.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"_plugin"},U.add(qr);class Kr{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new tt,this.transform=null}update(t,i,s,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=i||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,r),this.transform&&this.projectionMatrix.append(this.transform);const n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)}calculateProjection(t,i,s,r){const n=this.projectionMatrix,o=r?-1:1;n.identity(),n.a=1/i.width*2,n.d=o*(1/i.height*2),n.tx=-1-i.x*n.a,n.ty=-o-i.y*n.d}setTransform(t){}destroy(){this.renderer=null}}Kr.extension={type:M.RendererSystem,name:"projection"},U.add(Kr);const Pc=new vi;class Zr{constructor(t){this.renderer=t,this._tempMatrix=new tt}generateTexture(t,i){const h=i||{},{region:s}=h,r=zn(h,["region"]),n=s||t.getLocalBounds(null,!0);n.width===0&&(n.width=1),n.height===0&&(n.height=1);const o=be.create(bt({width:n.width,height:n.height},r));this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const a=t.transform;return t.transform=Pc,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}Zr.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"textureGenerator"},U.add(Zr);const Le=new $,Si=new $;class Jr{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new $,this.destinationFrame=new $,this.viewportFrame=new $}contextChange(){var i;const t=(i=this.renderer)==null?void 0:i.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,i,s){const r=this.renderer;this.current=t;let n,o,a;t?(n=t.baseTexture,a=n.resolution,i||(Le.width=t.frame.width,Le.height=t.frame.height,i=Le),s||(Si.x=t.frame.x,Si.y=t.frame.y,Si.width=i.width,Si.height=i.height,s=Si),o=n.framebuffer):(a=r.resolution,i||(Le.width=r._view.screen.width,Le.height=r._view.screen.height,i=Le),s||(s=Le,s.width=i.width,s.height=i.height));const h=this.viewportFrame;h.x=s.x*a,h.y=s.y*a,h.width=s.width*a,h.height=s.height*a,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(s,i,a,!o),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(i),this.destinationFrame.copyFrom(s)}clear(t,i){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=j.shared.setValue(t||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);const n=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=n.width!==o.width||n.height!==o.height;if(a){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,i),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Jr.extension={type:M.RendererSystem,name:"renderTexture"},U.add(Jr);class Mc{}class _a{constructor(t,i){this.program=t,this.uniformData=i,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Bc(e,t){const i={},s=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;rc>u?1:-1);for(let c=0;c({data:n,offset:0,dataLen:0,dirty:0}));let i=0,s=0,r=0;for(let n=0;n1&&(i=Math.max(i,16)*o.data.size),o.dataLen=i,s%i!==0&&s<16){const a=s%i%16;s+=a,r+=a}s+i>16?(r=Math.ceil(r/16)*16,o.offset=r,r+=i,s=i):(o.offset=r,s+=i,r+=i)}return r=Math.ceil(r/16)*16,{uboElements:t,size:r}}function xa(e,t){const i=[];for(const s in e)t[s]&&i.push(t[s]);return i.sort((s,r)=>s.index-r.index),i}function ba(e,t){if(!e.autoManage)return{size:0,syncFunc:Fc};const i=xa(e.uniforms,t),{uboElements:s,size:r}=va(i),n=[`\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n `];for(let o=0;o1){const u=Qo(a.data.type),d=Math.max(ya[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;n.push(`\n cv = ud.${l}.value;\n v = uv.${l};\n offset = ${a.offset/4};\n\n t = 0;\n\n for(var i=0; i < ${a.data.size*d}; i++)\n {\n for(var j = 0; j < ${f}; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ${p};\n }\n\n `)}else{const u=Nc[a.data.type];n.push(`\n cv = ud.${l}.value;\n v = uv.${l};\n offset = ${a.offset/4};\n ${u};\n `)}}return n.push(`\n renderer.buffer.update(buffer);\n `),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(`\n`))}}let Lc=0;const Is={textureCount:0,uboCount:0};class Qr{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Lc++}systemCheck(){if(!sa())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,i){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const s=t.program,r=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==s&&(this.program=s,this.gl.useProgram(r.program)),i||(Is.textureCount=0,Is.uboCount=0,this.syncUniformGroup(t.uniformGroup,Is)),r}setUniforms(t){const i=this.shader.program,s=i.glPrograms[this.renderer.CONTEXT_UID];i.syncUniforms(s.uniformData,t,this.renderer)}syncUniformGroup(t,i){const s=this.getGlProgram();(!t.static||t.dirtyId!==s.uniformDirtyGroups[t.id])&&(s.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,s,i))}syncUniforms(t,i,s){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(i.uniformData,t.uniforms,this.renderer,s)}createSyncGroups(t){const i=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[i]||(this.cache[i]=pc(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[i],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,i){const s=this.getGlProgram();if(!t.static||t.dirtyId!==0||!s.uniformGroups[t.id]){t.dirtyId=0;const r=s.uniformGroups[t.id]||this.createSyncBufferGroup(t,s,i);t.buffer.update(),r(s.uniformData,t.uniforms,this.renderer,Is,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,s.uniformBufferBindings[i])}createSyncBufferGroup(t,i,s){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(i.program,s);i.uniformBufferBindings[s]=this.shader.uniformBindCount,r.uniformBlockBinding(i.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=ba(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(a.size/4);t.buffer.update(h)}return i.uniformGroups[t.id]=a.syncFunc,i.uniformGroups[t.id]}getSignature(t,i,s){const r=t.uniforms,n=[`${s}-`];for(const o in r)n.push(o),i[o]&&n.push(i[o].type);return n.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const i=this.gl,s=t.program,r=ga(i,s);return s.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Qr.extension={type:M.RendererSystem,name:"shader"},U.add(Qr);class Ai{constructor(t){this.renderer=t}run(t){const{renderer:i}=this;i.runners.init.emit(i.options),t.hello&&console.log(`PixiJS 7.2.4 - ${i.rendererLogId} - https://pixijs.com`),i.resize(i.screen.width,i.screen.height)}destroy(){}}Ai.defaultOptions={hello:!1},Ai.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"startup"},U.add(Ai);function Oc(e,t=[]){return t[G.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.ADD]=[e.ONE,e.ONE],t[G.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.NONE]=[0,0],t[G.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[G.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[G.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[G.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[G.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[G.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[G.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[G.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[G.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[G.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const Uc=0,kc=1,Gc=2,Hc=3,Xc=4,Vc=5,tn=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=G.NONE,this._blendEq=!1,this.map=[],this.map[Uc]=this.setBlend,this.map[kc]=this.setOffset,this.map[Gc]=this.setCullFace,this.map[Hc]=this.setDepthTest,this.map[Xc]=this.setFrontFace,this.map[Vc]=this.setDepthMask,this.checks=[],this.defaultState=new ne,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=Oc(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;tt.systems[n]),s=[...i,...Object.keys(t.systems).filter(n=>!i.includes(n))];for(const n of s)this.addSystem(t.systems[n],n)}addRunners(...t){t.forEach(i=>{this.runners[i]=new Bt(i)})}addSystem(t,i){const s=new t(this);if(this[i])throw new Error(`Whoops! The name "${i}" is already in use`);this[i]=s,this._systemsHash[i]=s;for(const r in this.runners)this.runners[r].add(s);return this}emitWithCustomOptions(t,i){const s=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=s.find(o=>this._systemsHash[o]===r);r[t.name](i[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const Ps=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Ps.defaultMaxIdle,this.checkCountMax=Ps.defaultCheckCountMax,this.mode=Ps.defaultMode}postrender(){!this.renderer.objectRenderer.renderingToScreen||(this.count++,this.mode!==es.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let s=0;sthis.maxIdle&&(e.destroyTexture(r,!0),t[s]=null,i=!0)}if(i){let s=0;for(let r=0;r=0;s--)this.unload(e.children[s])}destroy(){this.renderer=null}};let Ht=Ps;Ht.defaultMode=es.AUTO,Ht.defaultMaxIdle=3600,Ht.defaultCheckCountMax=600,Ht.extension={type:M.RendererSystem,name:"textureGC"},U.add(Ht);class Ms{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=k.UNSIGNED_BYTE,this.internalFormat=C.RGBA,this.samplerType=0}}function zc(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[k.UNSIGNED_BYTE]:{[C.RGBA]:e.RGBA8,[C.RGB]:e.RGB8,[C.RG]:e.RG8,[C.RED]:e.R8,[C.RGBA_INTEGER]:e.RGBA8UI,[C.RGB_INTEGER]:e.RGB8UI,[C.RG_INTEGER]:e.RG8UI,[C.RED_INTEGER]:e.R8UI,[C.ALPHA]:e.ALPHA,[C.LUMINANCE]:e.LUMINANCE,[C.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[k.BYTE]:{[C.RGBA]:e.RGBA8_SNORM,[C.RGB]:e.RGB8_SNORM,[C.RG]:e.RG8_SNORM,[C.RED]:e.R8_SNORM,[C.RGBA_INTEGER]:e.RGBA8I,[C.RGB_INTEGER]:e.RGB8I,[C.RG_INTEGER]:e.RG8I,[C.RED_INTEGER]:e.R8I},[k.UNSIGNED_SHORT]:{[C.RGBA_INTEGER]:e.RGBA16UI,[C.RGB_INTEGER]:e.RGB16UI,[C.RG_INTEGER]:e.RG16UI,[C.RED_INTEGER]:e.R16UI,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[k.SHORT]:{[C.RGBA_INTEGER]:e.RGBA16I,[C.RGB_INTEGER]:e.RGB16I,[C.RG_INTEGER]:e.RG16I,[C.RED_INTEGER]:e.R16I},[k.UNSIGNED_INT]:{[C.RGBA_INTEGER]:e.RGBA32UI,[C.RGB_INTEGER]:e.RGB32UI,[C.RG_INTEGER]:e.RG32UI,[C.RED_INTEGER]:e.R32UI,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[k.INT]:{[C.RGBA_INTEGER]:e.RGBA32I,[C.RGB_INTEGER]:e.RGB32I,[C.RG_INTEGER]:e.RG32I,[C.RED_INTEGER]:e.R32I},[k.FLOAT]:{[C.RGBA]:e.RGBA32F,[C.RGB]:e.RGB32F,[C.RG]:e.RG32F,[C.RED]:e.R32F,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[k.HALF_FLOAT]:{[C.RGBA]:e.RGBA16F,[C.RGB]:e.RGB16F,[C.RG]:e.RG16F,[C.RED]:e.R16F},[k.UNSIGNED_SHORT_5_6_5]:{[C.RGB]:e.RGB565},[k.UNSIGNED_SHORT_4_4_4_4]:{[C.RGBA]:e.RGBA4},[k.UNSIGNED_SHORT_5_5_5_1]:{[C.RGBA]:e.RGB5_A1},[k.UNSIGNED_INT_2_10_10_10_REV]:{[C.RGBA]:e.RGB10_A2,[C.RGBA_INTEGER]:e.RGB10_A2UI},[k.UNSIGNED_INT_10F_11F_11F_REV]:{[C.RGB]:e.R11F_G11F_B10F},[k.UNSIGNED_INT_5_9_9_9_REV]:{[C.RGB]:e.RGB9_E5},[k.UNSIGNED_INT_24_8]:{[C.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[k.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[C.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[k.UNSIGNED_BYTE]:{[C.RGBA]:e.RGBA,[C.RGB]:e.RGB,[C.ALPHA]:e.ALPHA,[C.LUMINANCE]:e.LUMINANCE,[C.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[k.UNSIGNED_SHORT_5_6_5]:{[C.RGB]:e.RGB},[k.UNSIGNED_SHORT_4_4_4_4]:{[C.RGBA]:e.RGBA},[k.UNSIGNED_SHORT_5_5_5_1]:{[C.RGBA]:e.RGBA}},t}class sn{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new V,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=zc(t);const i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=i;for(let r=0;r=0;--n){const o=i[n];o&&o._glTextures[r].samplerType!==ts.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(t){const i=new Ms(this.gl.createTexture());return i.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=i,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),i}initTextureType(t,i){var s,r;i.internalFormat=(r=(s=this.internalFormats[t.type])==null?void 0:s[t.format])!=null?r:t.format,this.webGLVersion===2&&t.type===k.HALF_FLOAT?i.type=this.gl.HALF_FLOAT:i.type=t.type}updateTexture(t){var r;const i=t._glTextures[this.CONTEXT_UID];if(!i)return;const s=this.renderer;if(this.initTextureType(t,i),(r=t.resource)!=null&&r.upload(s,t,i))i.samplerType!==ts.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,o=t.realHeight,a=s.gl;(i.width!==n||i.height!==o||i.dirtyId<0)&&(i.width=n,i.height=o,a.texImage2D(t.target,0,i.internalFormat,n,o,0,t.format,i.type,null))}t.dirtyStyleId!==i.dirtyStyleId&&this.updateTextureStyle(t),i.dirtyId=t.dirtyId}destroyTexture(t,i){const{gl:s}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),s.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!i)){const r=this.managedTextures.indexOf(t);r!==-1&&Ie(this.managedTextures,r,1)}}updateTextureStyle(t){var s;const i=t._glTextures[this.CONTEXT_UID];!i||((t.mipmap===Wt.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?i.mipmap=!1:i.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?i.wrapMode=ie.CLAMP:i.wrapMode=t.wrapMode,(s=t.resource)!=null&&s.style(this.renderer,t,i)||this.setStyle(t,i),i.dirtyStyleId=t.dirtyStyleId)}setStyle(t,i){const s=this.gl;if(i.mipmap&&t.mipmap!==Wt.ON_MANUAL&&s.generateMipmap(t.target),s.texParameteri(t.target,s.TEXTURE_WRAP_S,i.wrapMode),s.texParameteri(t.target,s.TEXTURE_WRAP_T,i.wrapMode),i.mipmap){s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===ee.LINEAR){const n=Math.min(t.anisotropicLevel,s.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(t.target,s.TEXTURE_MAG_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}sn.extension={type:M.RendererSystem,name:"texture"},U.add(sn);class rn{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glTransformFeedbacks[s]||this.createGLTransformFeedback(t);i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,r)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,i){const{gl:s,renderer:r}=this;i&&r.shader.bind(i),s.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:i,renderer:s,CONTEXT_UID:r}=this,n=i.createTransformFeedback();t._glTransformFeedbacks[r]=n,i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,n);for(let o=0;o(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(ge||{});class nn{constructor(t,i=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=i,this.priority=s,this.once=r}match(t,i=null){return this.fn===t&&this.context===i}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const i=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),i}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const i=this.next;return this.next=t?null:i,this.previous=null,i}}const Dt=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new nn(null,null,1/0),this.deltaMS=1/Dt.targetFPMS,this.elapsedMS=1/Dt.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=ge.NORMAL){return this._addListener(new nn(e,t,i))}addOnce(e,t,i=ge.NORMAL){return this._addListener(new nn(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?lt.shared:new lt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}on.extension=M.Application,U.add(on);const Ea=[];U.handleByList(M.Renderer,Ea);function wa(e){for(const t of Ea)if(t.test(e))return new t(e);throw new Error("Unable to auto-detect a suitable renderer.")}var Wc=`attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}`,$c=`attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n`;const Sa=Wc,an=$c;class hn{constructor(t){this.renderer=t}contextChange(t){let i;if(this.renderer.context.webGLVersion===1){const s=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,s)}else{const s=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,s)}i>=ht.HIGH?this.multisample=ht.HIGH:i>=ht.MEDIUM?this.multisample=ht.MEDIUM:i>=ht.LOW?this.multisample=ht.LOW:this.multisample=ht.NONE}destroy(){}}hn.extension={type:M.RendererSystem,name:"_multisample"},U.add(hn);class jc{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class ln{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);i.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:i}=this;i.bindBuffer(t,null)}bindBufferBase(t,i){const{gl:s,CONTEXT_UID:r}=this;if(this.boundBufferBases[i]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[i]=t,s.bindBufferBase(s.UNIFORM_BUFFER,i,n.buffer)}}bindBufferRange(t,i,s){const{gl:r,CONTEXT_UID:n}=this;s=s||0;const o=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,i||0,o.buffer,s*256,256)}update(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);if(t._updateID!==r.updateID)if(r.updateID=t._updateID,i.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{const n=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,n)}}dispose(t,i){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const s=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),s&&(i||r.deleteBuffer(s.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const i=Object.keys(this.managedBuffers);for(let s=0;ss.resource).filter(s=>s).map(s=>s.load());return this._load=Promise.all(i).then(()=>{const{realWidth:s,realHeight:r}=this.items[0];return this.resize(s,r),Promise.resolve(this)}),this._load}}class Aa extends dn{constructor(t,i){const{width:s,height:r}=i||{};let n,o;Array.isArray(t)?(n=t,o=t.length):o=t,super(o,{width:s,height:r}),n&&this.initFromArray(n,i)}addBaseTextureAt(t,i){if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Re.TEXTURE_2D_ARRAY}upload(t,i,s){const{length:r,itemDirtyIds:n,items:o}=this,{gl:a}=t;s.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,r,0,i.format,s.type,null);for(let h=0;h0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Re.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const s=this.itemDirtyIds;for(let r=0;r{if(this.url===null){t(this);return}try{const s=await P.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await s.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Nt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=n,this.update(),t(this)}catch(s){if(this.destroyed)return;i(s),this.onError.emit(s)}}),this._load)}upload(t,i,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),super.upload(t,i,s)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap!="undefined"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){var t;return Ue._EMPTY=(t=Ue._EMPTY)!=null?t:P.ADAPTER.createCanvas(0,0),Ue._EMPTY}}const Bs=class extends _e{constructor(e,t){t=t||{},super(P.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),e(this)},Bs.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn\'t support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;_e.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{!this._resolve||(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let s=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(s=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),s=Math.round(s),r=Math.round(r);const n=this.source;n.width=s,n.height=r,n._pixiId=`canvas_${xe()}`,n.getContext("2d").drawImage(e,0,0,t,i,0,0,s,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Bs.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Bs.SVG_XML.test(e)}};let Je=Bs;Je.SVG_XML=/^(<\\?xml[^?]+\\?>)?\\s*()]*-->)?\\s*\\]*(?:\\s(width|height)=(\'|")(\\d*(?:\\.\\d+)?)(?:px)?(\'|"))[^>]*(?:\\s(width|height)=(\'|")(\\d*(?:\\.\\d+)?)(?:px)?(\'|"))[^>]*>/i;const pn=class extends _e{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");i.setAttribute("preload","auto"),i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);const s=e[0].src||e[0];_e.crossOrigin(i,s,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._isConnectedToTicker&&(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1);const e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e)}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||pn.TYPES.includes(t)}};let Ds=pn;Ds.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ds.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},fs.push(Ue,Or,Ra,Ds,Je,Ye,fn,Aa);class Yc{constructor(){this._glTransformFeedbacks={},this.buffers=[],this.disposeRunner=new Bt("disposeTransformFeedback")}bindBuffer(t,i){this.buffers[t]=i}destroy(){this.disposeRunner.emit(this,!1)}}const qc="7.2.4";class Ii{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?$.EMPTY:(t=t||new $(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,i){const{a:s,b:r,c:n,d:o,tx:a,ty:h}=t,l=s*i.x+n*i.y+a,c=r*i.x+o*i.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let i=this.minX,s=this.minY,r=this.maxX,n=this.maxY,o=t[0],a=t[1];i=or?o:r,n=a>n?a:n,o=t[2],a=t[3],i=or?o:r,n=a>n?a:n,o=t[4],a=t[5],i=or?o:r,n=a>n?a:n,o=t[6],a=t[7],i=or?o:r,n=a>n?a:n,this.minX=i,this.minY=s,this.maxX=r,this.maxY=n}addFrame(t,i,s,r,n){this.addFrameMatrix(t.worldTransform,i,s,r,n)}addFrameMatrix(t,i,s,r,n){const o=t.a,a=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,p=this.maxX,_=this.maxY,g=o*i+h*s+c,v=a*i+l*s+u;d=gp?g:p,_=v>_?v:_,g=o*r+h*s+c,v=a*r+l*s+u,d=gp?g:p,_=v>_?v:_,g=o*i+h*n+c,v=a*i+l*n+u,d=gp?g:p,_=v>_?v:_,g=o*r+h*n+c,v=a*r+l*n+u,d=gp?g:p,_=v>_?v:_,this.minX=d,this.minY=f,this.maxX=p,this.maxY=_}addVertexData(t,i,s){let r=this.minX,n=this.minY,o=this.maxX,a=this.maxY;for(let h=i;ho?l:o,a=c>a?c:a}this.minX=r,this.minY=n,this.maxX=o,this.maxY=a}addVertices(t,i,s,r){this.addVerticesMatrix(t.worldTransform,i,s,r)}addVerticesMatrix(t,i,s,r,n=0,o=n){const a=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,p=this.minY,_=this.maxX,g=this.maxY;for(let v=s;vr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,i){const s=t.minX>i.minX?t.minX:i.minX,r=t.minY>i.minY?t.minY:i.minY,n=t.maxXl?n:l,this.maxY=o>c?o:c}}addBoundsMatrix(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,i){const s=t.minX>i.x?t.minX:i.x,r=t.minY>i.y?t.minY:i.y,n=t.maxXl?n:l,this.maxY=o>c?o:c}}pad(t=0,i=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)}addFramePad(t,i,s,r,n,o){t-=n,i-=o,s+=n,r+=o,this.minX=this.minXs?this.maxX:s,this.minY=this.minYr?this.maxY:r}}class st extends Ve{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new vi,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ii,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const i=Object.keys(t);for(let s=0;s1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),s=this.getChildIndex(t);this.children[i]=t,this.children[s]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Ie(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=s){n=this.children.splice(i,r);for(let o=0;o1&&this.children.sort(Zc),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==mn.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(s?(s=Kc.copyFrom(s),s.prepend(r)):s=r),i&&t.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let n=0,o=this.children.length;n=r&&Pi.x=n&&Pi.y=i&&(o=e-a-1),h=h.replace("%value%",t[o].toString()),r+=h,r+=`\n`}return s=s.replace("%blur%",r),s=s.replace("%size%",e.toString()),s}const ru=`\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }`;function nu(e,t){const i=Math.ceil(e/2);let s=ru,r="",n;t?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n`;class Ns extends gt{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(an,ou,t),this.alpha=1}_loadMatrix(t,i=!1){let s=t;i&&(this._multiply(s,this.uniforms.m,t),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(t,i,s){return t[0]=i[0]*s[0]+i[1]*s[5]+i[2]*s[10]+i[3]*s[15],t[1]=i[0]*s[1]+i[1]*s[6]+i[2]*s[11]+i[3]*s[16],t[2]=i[0]*s[2]+i[1]*s[7]+i[2]*s[12]+i[3]*s[17],t[3]=i[0]*s[3]+i[1]*s[8]+i[2]*s[13]+i[3]*s[18],t[4]=i[0]*s[4]+i[1]*s[9]+i[2]*s[14]+i[3]*s[19]+i[4],t[5]=i[5]*s[0]+i[6]*s[5]+i[7]*s[10]+i[8]*s[15],t[6]=i[5]*s[1]+i[6]*s[6]+i[7]*s[11]+i[8]*s[16],t[7]=i[5]*s[2]+i[6]*s[7]+i[7]*s[12]+i[8]*s[17],t[8]=i[5]*s[3]+i[6]*s[8]+i[7]*s[13]+i[8]*s[18],t[9]=i[5]*s[4]+i[6]*s[9]+i[7]*s[14]+i[8]*s[19]+i[9],t[10]=i[10]*s[0]+i[11]*s[5]+i[12]*s[10]+i[13]*s[15],t[11]=i[10]*s[1]+i[11]*s[6]+i[12]*s[11]+i[13]*s[16],t[12]=i[10]*s[2]+i[11]*s[7]+i[12]*s[12]+i[13]*s[17],t[13]=i[10]*s[3]+i[11]*s[8]+i[12]*s[13]+i[13]*s[18],t[14]=i[10]*s[4]+i[11]*s[9]+i[12]*s[14]+i[13]*s[19]+i[14],t[15]=i[15]*s[0]+i[16]*s[5]+i[17]*s[10]+i[18]*s[15],t[16]=i[15]*s[1]+i[16]*s[6]+i[17]*s[11]+i[18]*s[16],t[17]=i[15]*s[2]+i[16]*s[7]+i[17]*s[12]+i[18]*s[17],t[18]=i[15]*s[3]+i[16]*s[8]+i[17]*s[13]+i[18]*s[18],t[19]=i[15]*s[4]+i[16]*s[9]+i[17]*s[14]+i[18]*s[19]+i[19],t}_colorMatrix(t){const i=new Float32Array(t);return i[4]/=255,i[9]/=255,i[14]/=255,i[19]/=255,i}brightness(t,i){const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,i)}tint(t,i){const[s,r,n]=j.shared.setValue(t).toArray(),o=[s,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,i)}greyscale(t,i){const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,i)}blackAndWhite(t){const i=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(i,t)}hue(t,i){t=(t||0)/180*Math.PI;const s=Math.cos(t),r=Math.sin(t),n=Math.sqrt,o=1/3,a=n(o),h=s+(1-s)*o,l=o*(1-s)-a*r,c=o*(1-s)+a*r,u=o*(1-s)+a*r,d=s+o*(1-s),f=o*(1-s)-a*r,p=o*(1-s)-a*r,_=o*(1-s)+a*r,g=s+o*(1-s),v=[h,l,c,0,0,u,d,f,0,0,p,_,g,0,0,0,0,0,1,0];this._loadMatrix(v,i)}contrast(t,i){const s=(t||0)+1,r=-.5*(s-1),n=[s,0,0,0,r,0,s,0,0,r,0,0,s,0,r,0,0,0,1,0];this._loadMatrix(n,i)}saturate(t=0,i){const s=t*2/3+1,r=(s-1)*-.5,n=[s,r,r,0,0,r,s,r,0,0,r,r,s,0,0,0,0,0,1,0];this._loadMatrix(n,i)}desaturate(){this.saturate(-1)}negative(t){const i=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(i,t)}sepia(t){const i=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(i,t)}technicolor(t){const i=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(i,t)}polaroid(t){const i=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(i,t)}toBGR(t){const i=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(i,t)}kodachrome(t){const i=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(i,t)}browni(t){const i=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(i,t)}vintage(t){const i=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(i,t)}colorTone(t,i,s,r,n){t=t||.2,i=i||.15,s=s||16770432,r=r||3375104;const o=j.shared,[a,h,l]=o.setValue(s).toArray(),[c,u,d]=o.setValue(r).toArray(),f=[.3,.59,.11,0,0,a,h,l,t,0,c,u,d,i,0,a-c,h-u,l-d,0,0];this._loadMatrix(f,n)}night(t,i){t=t||.1;const s=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(s,i)}predator(t,i){const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,i)}lsd(t){const i=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(i,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}Ns.prototype.grayscale=Ns.prototype.greyscale;var au=`varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n`,hu=`attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n`;class Ba extends gt{constructor(t,i){const s=new tt;t.renderable=!1,super(hu,au,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=s,i==null&&(i=20),this.scale=new Y(i,i)}apply(t,i,s,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),t.applyFilter(this,i,s,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}var lu=`varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n`,cu=`\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n`;class Da extends gt{constructor(){super(cu,lu)}}var uu=`precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n`;class Fa extends gt{constructor(t=.5,i=Math.random()){super(an,uu,{uNoise:0,uSeed:0}),this.noise=t,this.seed=i}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const _n={AlphaFilter:Pa,BlurFilter:Ma,BlurFilterPass:Fs,ColorMatrixFilter:Ns,DisplacementFilter:Ba,FXAAFilter:Da,NoiseFilter:Fa};Object.entries(_n).forEach(([e,t])=>{Object.defineProperty(_n,e,{get(){return t}})});class du{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(lt.system.add(this.tickerUpdate,this,ge.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){!this.tickerAdded||(lt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTimes.priority-r.priority)}dispatchEvent(t,i){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,i),this.dispatch.emit(i||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const i=this.mappingTable[t.type];if(i)for(let s=0,r=i.length;s=0;r--)if(t.currentTarget=s[r],this.notifyTarget(t,i),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,i,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(i)?i:[i];for(let n=s.length-1;n>=0;n--)r.forEach(o=>{t.currentTarget=s[n],this.notifyTarget(t,o)})}propagationPath(t){const i=[t];for(let s=0;s=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(i)?i:d.eventMode,s,r,n,o||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const h=this._isInteractive(i),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:h&&!n(t,s)&&r(t,s)?l?[t]:[]:null}hitTestRecursive(t,i,s,r,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||i==="dynamic")&&(Te.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(i)?i:c.eventMode,s,r,n);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const o=this._isInteractive(i),a=t.isInteractive();return o&&r(t,s)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,i){var s;if(t.hitArea&&(t.worldTransform.applyInverse(i,gn),!t.hitArea.contains(gn.x,gn.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((s=r.containsPoint)!=null&&s.call(r,i)))return!0}return!1}hitTestFn(t,i){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(i):!1}notifyTarget(t,i){var n,o;i=i!=null?i:t.type;const s=`on${i}`;(o=(n=t.currentTarget)[s])==null||o.call(n,t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${i}capture`:i;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,i)}mapPointerDown(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerdown"),i.pointerType==="touch")this.dispatchEvent(i,"touchstart");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const r=i.button===2;this.dispatchEvent(i,r?"rightdown":"mousedown")}const s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)}mapPointerMove(t){var h,l,c;if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const i=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s=i.pointerType==="mouse"||i.pointerType==="pen",r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.overTargets);if(((h=r.overTargets)==null?void 0:h.length)>0&&n!==i.target){const u=t.type==="mousemove"?"mouseout":"pointerout",d=this.createPointerEvent(t,u,n);if(this.dispatchEvent(d,"pointerout"),s&&this.dispatchEvent(d,"mouseout"),!i.composedPath().includes(n)){const f=this.createPointerEvent(t,"pointerleave",n);for(f.eventPhase=f.AT_TARGET;f.target&&!i.composedPath().includes(f.target);)f.currentTarget=f.target,this.notifyTarget(f),s&&this.notifyTarget(f,"mouseleave"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(d)}if(n!==i.target){const u=t.type==="mousemove"?"mouseover":"pointerover",d=this.clonePointerEvent(i,u);this.dispatchEvent(d,"pointerover"),s&&this.dispatchEvent(d,"mouseover");let f=n==null?void 0:n.parent;for(;f&&f!==this.rootTarget.parent&&f!==i.target;)f=f.parent;if(!f||f===this.rootTarget.parent){const _=this.clonePointerEvent(i,"pointerenter");for(_.eventPhase=_.AT_TARGET;_.target&&_.target!==n&&_.target!==this.rootTarget.parent;)_.currentTarget=_.target,this.notifyTarget(_),s&&this.notifyTarget(_,"mouseenter"),_.target=_.target.parent;this.freeEvent(_)}this.freeEvent(d)}const o=[],a=(l=this.enableGlobalMoveEvents)!=null?l:!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(i,"pointermove"),a&&o.push("globalpointermove"),i.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(i,"touchmove"),a&&o.push("globaltouchmove")),s&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(i,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(c=i.target)==null?void 0:c.cursor),o.length>0&&this.all(i,o),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=i.composedPath(),this.freeEvent(i)}mapPointerOver(t){var o;if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId),s=this.createPointerEvent(t),r=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(o=s.target)==null?void 0:o.cursor);const n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;i.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId);if(i.overTargets){const s=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");const o=this.createPointerEvent(t,"pointerleave",r);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),s&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;i.overTargets=null,this.freeEvent(n),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=n;if(n&&!s.composedPath().includes(n)){let a=n;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const h=s.button===2;this.notifyTarget(s,h?"rightupoutside":"mouseupoutside")}a=a.parent}delete r.pressTargetsByButton[t.button],o=a}if(o){const a=this.clonePointerEvent(s,"click");a.target=o,a.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:i});const h=r.clicksByButton[t.button];if(h.target===a.target&&i-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=a.target,h.timeStamp=i,a.detail=h.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(s){let n=s;for(;n;)r.currentTarget=n,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof ke)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const i=this.createWheelEvent(t);this.dispatchEvent(i),this.freeEvent(i)}findMountedTarget(t){if(!t)return null;let i=t[0];for(let s=1;s(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){var s,r;const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,yn._defaultEventMode=(s=e.eventMode)!=null?s:"auto",Object.assign(this.features,(r=e.eventFeatures)!=null?r:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",s=this.normalizeToPointerData(e);for(let r=0,n=s.length;r{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){!this._hookDiv||(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const i=t.children;if(i)for(let s=0;s title : ${t.title}
tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:i,height:s}=this.renderer;t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>s&&(t.height=s-t.y)}addChild(t){let i=this.pool.pop();i||(i=document.createElement("button"),i.style.width=`${Ls}px`,i.style.height=`${Ls}px`,i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=ka.toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=t.accessiblePointerEvents,i.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?i.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(i.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&i.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(i),t._accessibleActive=!0,t._accessibleDiv=i,i.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,i){const{displayObject:s}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new Qe(r),{target:s});r.rootTarget=this.renderer.lastObjectRendered,i.forEach(o=>r.dispatchEvent(n,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===gu&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}vn.extension={name:"accessibility",type:[M.RendererPlugin,M.CanvasRendererPlugin]},U.add(vn);const xn=class{constructor(e){this.stage=new Ct,e=Object.assign({forceCanvas:!1},e),this.renderer=wa(e),xn._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer.view}get screen(){return this.renderer.screen}destroy(e,t){const i=xn._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};let bn=xn;bn._plugins=[],U.handleByList(M.Application,bn._plugins);class Tn{static init(t){Object.defineProperty(this,"resizeTo",{set(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{!this._resizeTo||(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let i,s;if(this._resizeTo===globalThis.window)i=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;i=r,s=n}this.renderer.resize(i,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Tn.extension=M.Application,U.add(Tn);const Ha={loader:M.LoadParser,resolver:M.ResolveParser,cache:M.CacheParser,detection:M.DetectionParser};U.handle(M.Asset,e=>{const t=e.ref;Object.entries(Ha).filter(([i])=>!!t[i]).forEach(([i,s])=>{var r;return U.add(Object.assign(t[i],{extension:(r=t[i].extension)!=null?r:s}))})},e=>{const t=e.ref;Object.keys(Ha).filter(i=>!!t[i]).forEach(i=>U.remove(t[i]))});class Eu{constructor(t,i=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=i}add(t){t.forEach(i=>{this._assetList.push(i)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],i=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s(Array.isArray(e)||(e=[e]),t?e.map(i=>typeof i=="string"?t(i):i):e),Os=(e,t)=>{const i=t.split("?")[1];return i&&(e+=`?${i}`),e};function Xa(e,t,i,s,r){const n=t[i];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),Xa(e,r,0,i,s)}else s.push(e);return s}const Bi=e=>!Array.isArray(e);class wu{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const i=this._cache.get(t);return i||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),i}set(t,i){const s=oe(t);let r;for(let a=0;a{r[a]=i}));const n=Object.keys(r),o={cacheKeys:n,keys:s};if(s.forEach(a=>{this._cacheMap.set(a,o)}),n.forEach(a=>{this._cache.has(a)&&this._cache.get(a)!==i&&console.warn("[Cache] already has key:",a),this._cache.set(a,r[a])}),i instanceof B){const a=i;s.forEach(h=>{a.baseTexture!==B.EMPTY.baseTexture&&V.addToCache(a.baseTexture,h),B.addToCache(a,h)})}}remove(t){if(this._cacheMap.get(t),!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const i=this._cacheMap.get(t);i.cacheKeys.forEach(r=>{this._cache.delete(r)}),i.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const ii=new wu;class Su{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,i,s)=>(this._parsersValidated=!1,t[i]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,i){const s={promise:null,parser:null};return s.promise=(async()=>{var o,a;let r=null,n=null;if(i.loadParser&&(n=this._parserHash[i.loadParser],n||console.warn(`[Assets] specified load parser "${i.loadParser}" not found while loading ${t}`)),!n){for(let h=0;h({src:l})),a=o.length,h=o.map(async l=>{const c=Tt.toAbsolute(l.src);if(!r[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),r[l.src]=await this.promiseCache[c].promise,i&&i(++s/a)}catch(u){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}.\n${u}`)}});return await Promise.all(h),n?r[o[0].src]:r}async unload(t){const s=oe(t,r=>({src:r})).map(async r=>{var a,h;const n=Tt.toAbsolute(r.src),o=this.promiseCache[n];if(o){const l=await o.promise;(h=(a=o.parser)==null?void 0:a.unload)==null||h.call(a,l,r,this),delete this.promiseCache[n]}});await Promise.all(s)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,i)=>(t[i.name]&&console.warn(`[Assets] loadParser name conflict "${i.name}"`),Qi(bt({},t),{[i.name]:i})),{})}}var Jt=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))(Jt||{});const Au=".json",Ru="application/json",za={extension:{type:M.LoadParser,priority:Jt.Low},name:"loadJson",test(e){return ei(e,Ru)||Ee(e,Au)},async load(e){return await(await P.ADAPTER.fetch(e)).json()}};U.add(za);const Cu=".txt",Iu="text/plain",Wa={name:"loadTxt",extension:{type:M.LoadParser,priority:Jt.Low},test(e){return ei(e,Iu)||Ee(e,Cu)},async load(e){return await(await P.ADAPTER.fetch(e)).text()}};U.add(Wa);const Pu=["normal","bold","100","200","300","400","500","600","700","800","900"],Mu=[".ttf",".otf",".woff",".woff2"],Bu=["font/ttf","font/otf","font/woff","font/woff2"],Du=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function $a(e){const t=Tt.extname(e),r=Tt.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1));let n=r.length>0;for(const a of r)if(!a.match(Du)){n=!1;break}let o=r.join(" ");return n||(o=`"${o.replace(/[\\\\"]/g,"\\\\$&")}"`),o}const ja={extension:{type:M.LoadParser,priority:Jt.Low},name:"loadWebFont",test(e){return ei(e,Bu)||Ee(e,Mu)},async load(e,t){var s,r,n,o,a,h;const i=P.ADAPTER.getFontFaceSet();if(i){const l=[],c=(r=(s=t.data)==null?void 0:s.family)!=null?r:$a(e),u=(a=(o=(n=t.data)==null?void 0:n.weights)==null?void 0:o.filter(f=>Pu.includes(f)))!=null?a:["normal"],d=(h=t.data)!=null?h:{};for(let f=0;fP.ADAPTER.getFontFaceSet().delete(t))}};U.add(ja);let Ya=0,En;const Fu={id:"checkImageBitmap",code:`\n async function checkImageBitmap()\n {\n try\n {\n if (typeof createImageBitmap !== \'function\') return false;\n\n const response = await fetch(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=\');\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n }\n catch (e)\n {\n return false;\n }\n }\n checkImageBitmap().then((result) => { self.postMessage(result); });\n `},Nu={id:"loadImageBitmap",code:`\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n\n if (!response.ok)\n {\n throw new Error(\\`[WorkerManager.loadImageBitmap] Failed to fetch \\${url}: \\`\n + \\`\\${response.status} \\${response.statusText}\\`);\n }\n\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n\n return imageBitmap;\n }\n self.onmessage = async (event) =>\n {\n try\n {\n const imageBitmap = await loadImageBitmap(event.data.data[0]);\n\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }\n catch(e)\n {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n }\n };`};let wn;class Lu{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const i=URL.createObjectURL(new Blob([Fu.code],{type:"application/javascript"})),s=new Worker(i);s.addEventListener("message",r=>{s.terminate(),URL.revokeObjectURL(i),t(r.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){En===void 0&&(En=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers{this.complete(i.data),this.returnWorker(i.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,i){await this._initWorkers();const s=new Promise((r,n)=>{this.queue.push({id:t,arguments:i,resolve:r,reject:n})});return this.next(),s}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const i=this.queue.pop(),s=i.id;this.resolveHash[Ya]={resolve:i.resolve,reject:i.reject},t.postMessage({data:i.arguments,uuid:Ya++,id:s})}}const qa=new Lu;function Di(e,t,i){const s=new B(e);return s.baseTexture.on("dispose",()=>{delete t.promiseCache[i]}),s}const Ou=[".jpeg",".jpg",".png",".webp",".avif"],Uu=["image/jpeg","image/png","image/webp","image/avif"];async function Ka(e){const t=await P.ADAPTER.fetch(e);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${e}: ${t.status} ${t.statusText}`);const i=await t.blob();return await createImageBitmap(i)}const Fi={name:"loadTextures",extension:{type:M.LoadParser,priority:Jt.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(e){return ei(e,Uu)||Ee(e,Ou)},async load(e,t,i){let s=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await qa.isImageBitmapSupported()?s=await qa.loadImageBitmap(e):s=await Ka(e):s=await new Promise(n=>{s=new Image,s.crossOrigin=this.config.crossOrigin,s.src=e,s.complete?n(s):s.onload=()=>{n(s)}});const r=new V(s,bt({resolution:fe(e)},t.data));return r.resource.src=e,Di(r,i,e)},unload(e){e.destroy(!0)}};U.add(Fi);const ku=".svg",Gu="image/svg+xml",Za={extension:{type:M.LoadParser,priority:Jt.High},name:"loadSVG",test(e){return ei(e,Gu)||Ee(e,ku)},async testParse(e){return Je.test(e)},async parse(e,t,i){var o;const s=new Je(e,(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions);await s.load();const r=new V(s,bt({resolution:fe(e)},t==null?void 0:t.data));return r.resource.src=e,Di(r,i,e)},async load(e,t){return(await P.ADAPTER.fetch(e)).text()},unload:Fi.unload};U.add(Za);class Hu{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,i)=>`${t}${this._bundleIdConnector}${i}`,extractAssetIdFromBundle:(t,i)=>i.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){var i,s,r;if(this._bundleIdConnector=(i=t.connector)!=null?i:this._bundleIdConnector,this._createBundleAssetId=(s=t.createBundleAssetId)!=null?s:this._createBundleAssetId,this._extractAssetIdFromBundle=(r=t.extractAssetIdFromBundle)!=null?r:this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(i=>{this._preferredOrder.push(i),i.priority||(i.priority=Object.keys(i.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const i=t;this._defaultSearchParams=Object.keys(i).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(i[s])}`).join("&")}}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(i=>{this.addBundle(i.name,i.assets)})}addBundle(t,i){const s=[];Array.isArray(i)?i.forEach(r=>{if(typeof r.name=="string"){const n=this._createBundleAssetId(t,r.name);s.push(n),this.add([r.name,n],r.srcs,r.data)}else{const n=r.name.map(o=>this._createBundleAssetId(t,o));n.forEach(o=>{s.push(o)}),this.add([...r.name,...n],r.srcs)}}):Object.keys(i).forEach(r=>{s.push(this._createBundleAssetId(t,r)),this.add([r,this._createBundleAssetId(t,r)],i[r])}),this._bundles[t]=s}add(t,i,s){const r=oe(t);r.forEach(o=>{this.hasKey(o)&&console.warn(`[Resolver] already has key: ${o} overwriting`)}),Array.isArray(i)||(typeof i=="string"?i=Va(i):i=[i]);const n=i.map(o=>{var h;let a=o;if(typeof o=="string"){let l=!1;for(let c=0;c{this._assetMap[o]=n})}resolveBundle(t){const i=Bi(t);t=oe(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(r,h)]=l}s[r]=a}}),i?s[t[0]]:s}resolveUrl(t){const i=this.resolve(t);if(typeof t!="string"){const s={};for(const r in i)s[r]=i[r].src;return s}return i.src}resolve(t){const i=Bi(t);t=oe(t);const s={};return t.forEach(r=>{var n;if(!this._resolverHash[r])if(this._assetMap[r]){let o=this._assetMap[r];const a=this._getPreferredOrder(o),h=o[0];a==null||a.priority.forEach(l=>{a.params[l].forEach(c=>{const u=o.filter(d=>d[l]?d[l]===c:!1);u.length&&(o=u)})}),this._resolverHash[r]=(n=o[0])!=null?n:h}else{let o=r;(this._basePath||this._rootPath)&&(o=Tt.toAbsolute(o,this._basePath,this._rootPath)),o=this._appendDefaultSearchParams(o),this._resolverHash[r]={src:o}}s[r]=this._resolverHash[r]}),i?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let i=0;in.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const i=/\\?/.test(t)?"&":"?";return`${t}${i}${this._defaultSearchParams}`}}class Ja{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Hu,this.loader=new Su,this.cache=ii,this._backgroundLoader=new Eu(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,o,a,h;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let l=t.manifest;typeof l=="string"&&(l=await this.load(l)),this.resolver.addManifest(l)}const i=(o=(n=t.texturePreference)==null?void 0:n.resolution)!=null?o:1,s=typeof i=="number"?[i]:i;let r=[];if((a=t.texturePreference)!=null&&a.format){const l=(h=t.texturePreference)==null?void 0:h.format;r=typeof l=="string"?[l]:l;for(const c of this._detections)await c.test()||(r=await c.remove(r))}else for(const l of this._detections)await l.test()&&(r=await l.add(r));this.resolver.prefer({params:{format:r,resolution:s}}),t.preferences&&this.setPreferences(t.preferences)}add(t,i,s){this.resolver.add(t,i,s)}async load(t,i){this._initialized||await this.init();const s=Bi(t),r=oe(t).map(a=>typeof a!="string"?(this.resolver.add(a.src,a),a.src):(this.resolver.hasKey(a)||this.resolver.add(a,a),a)),n=this.resolver.resolve(r),o=await this._mapLoadToResolve(n,i);return s?o[r[0]]:o}addBundle(t,i){this.resolver.addBundle(t,i)}async loadBundle(t,i){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);const r=this.resolver.resolveBundle(t),n={},o=Object.keys(r);let a=0,h=0;const l=()=>{i==null||i(++a/h)},c=o.map(u=>{const d=r[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const i=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(i))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const i=this.resolver.resolveBundle(t);Object.values(i).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return ii.get(t);const i={};for(let s=0;s{const l=n[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[r[h]]=l,ii.set(c,l)}),o}async unload(t){this._initialized||await this.init();const i=oe(t).map(r=>typeof r!="string"?r.src:r),s=this.resolver.resolve(i);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=oe(t);const i=this.resolver.resolveBundle(t),s=Object.keys(i).map(r=>this._unloadFromResolved(i[r]));await Promise.all(s)}async _unloadFromResolved(t){const i=Object.values(t);i.forEach(s=>{ii.remove(s.src)}),await this.loader.unload(i)}get detections(){return this._detections}get preferWorkers(){return Fi.config.preferWorkers}set preferWorkers(t){z("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(i=>{!i.config||Object.keys(i.config).filter(s=>s in t).forEach(s=>{i.config[s]=t[s]})})}}const Ni=new Ja;U.handleByList(M.LoadParser,Ni.loader.parsers).handleByList(M.ResolveParser,Ni.resolver.parsers).handleByList(M.CacheParser,Ni.cache.parsers).handleByList(M.DetectionParser,Ni.detections);const Qa={extension:M.CacheParser,test:e=>Array.isArray(e)&&e.every(t=>t instanceof B),getCacheableAssets:(e,t)=>{const i={};return e.forEach(s=>{t.forEach((r,n)=>{i[s+(n===0?"":n+1)]=r})}),i}};U.add(Qa);const th={extension:{type:M.DetectionParser,priority:1},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",t=await P.ADAPTER.fetch(e).then(i=>i.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"avif"],remove:async e=>e.filter(t=>t!=="avif")};U.add(th);const eh={extension:{type:M.DetectionParser,priority:0},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",t=await P.ADAPTER.fetch(e).then(i=>i.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"webp"],remove:async e=>e.filter(t=>t!=="webp")};U.add(eh);const ih=["png","jpg","jpeg"],sh={extension:{type:M.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async e=>[...e,...ih],remove:async e=>e.filter(t=>!ih.includes(t))};U.add(sh);const rh={extension:M.ResolveParser,test:Fi.test,parse:e=>{var t,i;return{resolution:parseFloat((i=(t=P.RETINA_PREFIX.exec(e))==null?void 0:t[1])!=null?i:"1"),format:e.split(".").pop(),src:e}}};U.add(rh);var It=(e=>(e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",e))(It||{});const Li={[33776]:.5,[33777]:.5,[33778]:1,[33779]:1,[35916]:.5,[35917]:.5,[35918]:1,[35919]:1,[37488]:.5,[37489]:.5,[37490]:1,[37491]:1,[37492]:.5,[37496]:1,[37493]:.5,[37497]:1,[37494]:.5,[37495]:.5,[35840]:.5,[35842]:.5,[35841]:.25,[35843]:.25,[36196]:.5,[35986]:.5,[35986]:1,[34798]:1,[37808]:1};let ve,si;function nh(){si={s3tc:ve.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:ve.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:ve.getExtension("WEBGL_compressed_texture_etc"),etc1:ve.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:ve.getExtension("WEBGL_compressed_texture_pvrtc")||ve.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:ve.getExtension("WEBGL_compressed_texture_atc"),astc:ve.getExtension("WEBGL_compressed_texture_astc")}}const oh={extension:{type:M.DetectionParser,priority:2},test:async()=>{const t=P.ADAPTER.createCanvas().getContext("webgl");return t?(ve=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async e=>{si||nh();const t=[];for(const i in si)!si[i]||t.push(i);return[...t,...e]},remove:async e=>(si||nh(),e.filter(t=>!(t in si)))};U.add(oh);class ah extends Ye{constructor(t,i={width:1,height:1,autoLoad:!0}){let s,r;typeof t=="string"?(s=t,r=new Uint8Array):(s=null,r=t),super(r,i),this.origin=s,this.buffer=r?new ds(r):null,this._load=null,this.loaded=!1,this.origin!==null&&i.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new ds(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class we extends ah{constructor(t,i){super(t,i),this.format=i.format,this.levels=i.levels||1,this._width=i.width,this._height=i.height,this._extension=we._formatToExtension(this.format),(i.levelBuffers||this.buffer)&&(this._levelBuffers=i.levelBuffers||we._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,i,s){const r=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;for(let o=0,a=this.levels;o=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,i,s,r,n,o,a){const h=new Array(s);let l=t.byteOffset,c=o,u=a,d=c+r-1&~(r-1),f=u+n-1&~(n-1),p=d*f*Li[i];for(let _=0;_1?c:d,levelHeight:s>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+r-1&~(r-1),f=u+n-1&~(n-1),p=d*f*Li[i];return h}}const Sn=4,Us=124,Xu=32,hh=20,Vu=542327876,ks={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},zu={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},Gs={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4};var Wu=(e=>(e[e.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",e[e.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",e[e.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",e[e.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",e[e.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",e[e.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",e[e.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",e[e.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",e[e.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",e[e.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",e[e.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",e[e.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",e[e.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",e[e.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",e[e.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",e[e.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",e[e.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",e[e.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",e[e.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",e[e.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",e[e.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",e[e.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",e[e.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",e[e.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",e[e.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",e[e.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",e[e.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",e[e.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",e[e.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",e[e.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",e[e.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",e[e.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",e[e.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",e[e.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",e[e.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",e[e.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",e[e.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",e[e.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",e[e.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",e[e.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",e[e.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",e[e.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",e[e.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",e[e.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",e[e.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",e[e.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",e[e.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",e[e.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",e[e.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",e[e.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",e[e.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",e[e.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",e[e.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",e[e.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",e[e.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",e[e.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",e[e.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",e[e.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",e[e.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",e[e.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",e[e.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",e[e.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",e[e.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",e[e.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",e[e.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",e[e.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",e[e.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",e[e.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",e[e.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",e[e.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",e[e.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",e[e.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",e[e.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",e[e.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",e[e.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",e[e.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",e[e.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",e[e.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",e[e.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",e[e.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",e[e.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",e[e.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",e[e.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",e[e.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",e[e.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",e[e.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",e[e.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",e[e.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",e[e.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",e[e.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",e[e.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",e[e.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",e[e.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",e[e.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",e[e.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",e[e.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",e[e.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",e[e.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",e[e.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",e[e.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",e[e.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",e[e.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",e[e.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",e[e.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",e[e.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",e[e.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",e[e.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",e[e.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",e[e.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",e[e.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",e[e.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",e[e.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",e))(Wu||{}),$u=(e=>(e[e.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",e[e.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",e[e.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",e))($u||{});const ju=1,Yu=2,qu=4,Ku=64,Zu=512,Ju=131072,Qu=827611204,td=861165636,ed=894720068,id=808540228,sd=4,rd={[Qu]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[td]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[ed]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT},nd={[70]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[71]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[73]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[74]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[76]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT,[77]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT,[72]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,[75]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,[78]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function lh(e){const t=new Uint32Array(e);if(t[0]!==Vu)throw new Error("Invalid DDS file magic word");const s=new Uint32Array(e,0,Us/Uint32Array.BYTES_PER_ELEMENT),r=s[ks.HEIGHT],n=s[ks.WIDTH],o=s[ks.MIPMAP_COUNT],a=new Uint32Array(e,ks.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Xu/Uint32Array.BYTES_PER_ELEMENT),h=a[ju];if(h&qu){const l=a[zu.FOURCC];if(l!==id){const y=rd[l],x=Sn+Us,A=new Uint8Array(e,x);return[new we(A,{format:y,width:n,height:r,levels:o})]}const c=Sn+Us,u=new Uint32Array(t.buffer,c,hh/Uint32Array.BYTES_PER_ELEMENT),d=u[Gs.DXGI_FORMAT],f=u[Gs.RESOURCE_DIMENSION],p=u[Gs.MISC_FLAG],_=u[Gs.ARRAY_SIZE],g=nd[d];if(g===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${d}`);if(p===sd)throw new Error("DDSParser does not support cubemap textures");if(f===6)throw new Error("DDSParser does not supported 3D texture data");const v=new Array,b=Sn+Us+hh;if(_===1)v.push(new Uint8Array(e,b));else{const y=Li[g];let x=0,A=n,D=r;for(let E=0;E>>1,D=D>>>1}let R=b;for(let E=0;E<_;E++)v.push(new Uint8Array(e,R,x)),R+=x}return v.map(y=>new we(y,{format:g,width:n,height:r,levels:o}))}throw h&Ku?new Error("DDSParser does not support uncompressed texture data."):h&Zu?new Error("DDSParser does not supported YUV uncompressed texture data."):h&Ju?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&Yu?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const ch=[171,75,84,88,32,49,49,187,13,10,26,10],od=67305985,Qt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},An=64,Rn={[k.UNSIGNED_BYTE]:1,[k.UNSIGNED_SHORT]:2,[k.INT]:4,[k.UNSIGNED_INT]:4,[k.FLOAT]:4,[k.HALF_FLOAT]:8},uh={[C.RGBA]:4,[C.RGB]:3,[C.RG]:2,[C.RED]:1,[C.LUMINANCE]:1,[C.LUMINANCE_ALPHA]:2,[C.ALPHA]:1},dh={[k.UNSIGNED_SHORT_4_4_4_4]:2,[k.UNSIGNED_SHORT_5_5_5_1]:2,[k.UNSIGNED_SHORT_5_6_5]:2};function fh(e,t,i=!1){const s=new DataView(t);if(!ad(e,s))return null;const r=s.getUint32(Qt.ENDIANNESS,!0)===od,n=s.getUint32(Qt.GL_TYPE,r),o=s.getUint32(Qt.GL_FORMAT,r),a=s.getUint32(Qt.GL_INTERNAL_FORMAT,r),h=s.getUint32(Qt.PIXEL_WIDTH,r),l=s.getUint32(Qt.PIXEL_HEIGHT,r)||1,c=s.getUint32(Qt.PIXEL_DEPTH,r)||1,u=s.getUint32(Qt.NUMBER_OF_ARRAY_ELEMENTS,r)||1,d=s.getUint32(Qt.NUMBER_OF_FACES,r),f=s.getUint32(Qt.NUMBER_OF_MIPMAP_LEVELS,r),p=s.getUint32(Qt.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const _=4,g=4,v=h+3&-4,b=l+3&-4,y=new Array(u);let x=h*l;n===0&&(x=v*b);let A;if(n!==0?Rn[n]?A=Rn[n]*uh[o]:A=dh[n]:A=Li[a],A===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const D=i?ld(s,p,r):null;let E=x*A,O=h,H=l,I=v,N=b,w=An+p;for(let T=0;T1||n!==0?O:I,levelHeight:f>1||n!==0?H:N,levelBuffer:new Uint8Array(t,q,E)},q+=E}w+=W+4,w=w%4!==0?w+4-w%4:w,O=O>>1||1,H=H>>1||1,I=O+_-1&~(_-1),N=H+g-1&~(g-1),E=I*N*A}return n!==0?{uncompressed:y.map(T=>{let W=T[0].levelBuffer,q=!1;return n===k.FLOAT?W=new Float32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4):n===k.UNSIGNED_INT?(q=!0,W=new Uint32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)):n===k.INT&&(q=!0,W=new Int32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)),{resource:new Ye(W,{width:T[0].levelWidth,height:T[0].levelHeight}),type:n,format:q?hd(o):o}}),kvData:D}:{compressed:y.map(T=>new we(null,{format:a,width:h,height:l,levels:f,levelBuffers:T})),kvData:D}}function ad(e,t){for(let i=0;it-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const h=new V(a,bt({mipmap:Wt.OFF,alphaMode:Nt.NO_PREMULTIPLIED_ALPHA,resolution:fe(e)},t.data));return Di(h,i,e)});return o.length===1?o[0]:o},unload(e){Array.isArray(e)?e.forEach(t=>t.destroy(!0)):e.destroy(!0)}};U.add(ph);const mh={extension:{type:M.LoadParser,priority:Jt.High},name:"loadKTX",test(e){return Ee(e,".ktx")},async load(e,t,i){const r=await(await P.ADAPTER.fetch(e)).arrayBuffer(),{compressed:n,uncompressed:o,kvData:a}=fh(e,r),h=n!=null?n:o,l=bt({mipmap:Wt.OFF,alphaMode:Nt.NO_PREMULTIPLIED_ALPHA,resolution:fe(e)},t.data),c=h.map(u=>{h===o&&Object.assign(l,{type:u.type,format:u.format});const d=new V(u,l);return d.ktxKeyValueData=a,Di(d,i,e)});return c.length===1?c[0]:c},unload(e){Array.isArray(e)?e.forEach(t=>t.destroy(!0)):e.destroy(!0)}};U.add(mh);const _h={extension:M.ResolveParser,test:e=>{const i=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(i)},parse:e=>{var s,r,n,o;if(e.split("?")[0].split(".").pop()==="ktx"){const a=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(a.some(h=>e.endsWith(h)))return{resolution:parseFloat((r=(s=P.RETINA_PREFIX.exec(e))==null?void 0:s[1])!=null?r:"1"),format:a.find(h=>e.endsWith(h)),src:e}}return{resolution:parseFloat((o=(n=P.RETINA_PREFIX.exec(e))==null?void 0:n[1])!=null?o:"1"),format:e.split(".").pop(),src:e}}};U.add(_h);const cd=new $,ud=4,Oi=class{constructor(e){this.renderer=e}async image(e,t,i){const s=new Image;return s.src=await this.base64(e,t,i),s}async base64(e,t,i){const s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((r,n)=>{s.toBlob(o=>{if(!o){n(new Error("ICanvas.toBlob failed!"));return}const a=new FileReader;a.onload=()=>r(a.result),a.onerror=n,a.readAsDataURL(o)},t,i)});if(s.toDataURL!==void 0)return s.toDataURL(t,i);if(s.convertToBlob!==void 0){const r=await s.convertToBlob({type:t,quality:i});return new Promise((n,o)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=o,a.readAsDataURL(r)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:s,height:r,flipY:n}=this._rawPixels(e,t);n&&Oi._flipY(i,s,r),Oi._unpremultiplyAlpha(i);const o=new No(s,r,1),a=new ImageData(new Uint8ClampedArray(i.buffer),s,r);return o.context.putImageData(a,0,0),o.canvas}pixels(e,t){const{pixels:i,width:s,height:r,flipY:n}=this._rawPixels(e,t);return n&&Oi._flipY(i,s,r),Oi._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,r=!1,n,o=!1;if(e&&(e instanceof be?n=e:(n=i.generateTexture(e,{resolution:i.resolution,multisample:i.multisample}),o=!0)),n){if(s=n.baseTexture.resolution,t=t!=null?t:n.frame,r=!1,!o){i.renderTexture.bind(n);const u=n.framebuffer.glFramebuffers[i.CONTEXT_UID];u.blitFramebuffer&&i.framebuffer.bind(u.blitFramebuffer)}}else s=i.resolution,t||(t=cd,t.width=i.width/s,t.height=i.height/s),r=!0,i.renderTexture.bind();const a=Math.round(t.width*s),h=Math.round(t.height*s),l=new Uint8Array(ud*a*h),c=i.gl;return c.readPixels(Math.round(t.x*s),Math.round(t.y*s),a,h,c.RGBA,c.UNSIGNED_BYTE,l),o&&(n==null||n.destroy(!0)),{pixels:l,width:a,height:h,flipY:r}}destroy(){this.renderer=null}static _flipY(e,t,i){const s=t<<2,r=i>>1,n=new Uint8Array(s);for(let o=0;o=0&&a>=0&&r>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(r?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=i+r,t[1]=t[3]=s+n,t[2]=t[4]=i-r,t[5]=t[7]=s-n;return}let c=0,u=h*4+(r?2:0)+2,d=u,f=l;{const p=r+o,_=n,g=i+p,v=i-p,b=s+_;if(t[c++]=g,t[c++]=b,t[--u]=b,t[--u]=v,n){const y=s-_;t[d++]=v,t[d++]=y,t[--f]=y,t[--f]=g}}for(let p=1;p0||t&&s<=0){const r=i/2;for(let n=r+r%2;n=6){gh(i,!1);const o=[];for(let l=0;l=0&&n>=0&&o.push(i,s,i+r,s,i+r,s+n,i,s+n)},triangulate(e,t){const i=e.points,s=t.points;if(i.length===0)return;const r=s.length/2;s.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},vh={build(e){Ui.build(e)},triangulate(e,t){Ui.triangulate(e,t)}};var Vt=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(Vt||{}),Se=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(Se||{});const Ae={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=20){if(!this.adaptive||!e||isNaN(e))return t;let i=Math.ceil(e/this.maxLength);return ithis.maxSegments&&(i=this.maxSegments),i}},dd=Ae;class Pn{static curveTo(t,i,s,r,n,o){const a=o[o.length-2],l=o[o.length-1]-i,c=a-t,u=r-i,d=s-t,f=Math.abs(l*d-c*u);if(f<1e-8||n===0)return(o[o.length-2]!==t||o[o.length-1]!==i)&&o.push(t,i),null;const p=l*l+c*c,_=u*u+d*d,g=l*u+c*d,v=n*Math.sqrt(p)/f,b=n*Math.sqrt(_)/f,y=v*g/p,x=b*g/_,A=v*d+b*c,D=v*u+b*l,R=c*(b+y),E=l*(b+y),O=d*(v+x),H=u*(v+x),I=Math.atan2(E-D,R-A),N=Math.atan2(H-D,O-A);return{cx:A+t,cy:D+i,radius:n,startAngle:I,endAngle:N,anticlockwise:c*u>d*l}}static arc(t,i,s,r,n,o,a,h,l){const c=a-o,u=Ae._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/yi)*40),d=c/(u*2),f=d*2,p=Math.cos(d),_=Math.sin(d),g=u-1,v=g%1/g;for(let b=0;b<=g;++b){const y=b+v*b,x=d+o+f*y,A=Math.cos(x),D=-Math.sin(x);l.push((p*A+_*D)*n+s,(p*-D+_*A)*n+r)}}}class xh{constructor(){this.reset()}begin(t,i,s){this.reset(),this.style=t,this.start=i,this.attribStart=s}end(t,i){this.attribSize=i-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Hs{static curveLength(t,i,s,r,n,o,a,h){let c=0,u=0,d=0,f=0,p=0,_=0,g=0,v=0,b=0,y=0,x=0,A=t,D=i;for(let R=1;R<=10;++R)u=R/10,d=u*u,f=d*u,p=1-u,_=p*p,g=_*p,v=g*t+3*_*u*s+3*p*d*n+f*a,b=g*i+3*_*u*r+3*p*d*o+f*h,y=A-v,x=D-b,A=v,D=b,c+=Math.sqrt(y*y+x*x);return c}static curveTo(t,i,s,r,n,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=Ae._segmentsCount(Hs.curveLength(h,l,t,i,s,r,n,o));let u=0,d=0,f=0,p=0,_=0;a.push(h,l);for(let g=1,v=0;g<=c;++g)v=g/c,u=1-v,d=u*u,f=d*u,p=v*v,_=p*v,a.push(f*h+3*d*v*t+3*u*p*s+_*n,f*l+3*d*v*i+3*u*p*r+_*o)}}function bh(e,t,i,s,r,n,o,a){const h=e-i*r,l=t-s*r,c=e+i*n,u=t+s*n;let d,f;o?(d=s,f=-i):(d=-s,f=i);const p=h+d,_=l+f,g=c+d,v=u+f;return a.push(p,_,g,v),2}function Ge(e,t,i,s,r,n,o,a){const h=i-e,l=s-t;let c=Math.atan2(h,l),u=Math.atan2(r-e,n-t);a&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),_=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(_)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(e,t,i,s);for(let b=1,y=d;b=0&&(n.join===Vt.ROUND?d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+4:d+=2,c.push(y-O*T,x-H*T,y+O*w,x+H*w));continue}const vt=(-R+v)*(-E+x)-(-R+y)*(-E+b),ut=(-O+A)*(-H+x)-(-O+y)*(-H+D),xt=(Z*ut-S*vt)/J,wt=(X*vt-at*ut)/J,Ft=(xt-y)*(xt-y)+(wt-x)*(wt-x),Et=y+(xt-y)*w,rt=x+(wt-x)*w,dt=y-(xt-y)*T,ft=x-(wt-x)*T,he=Math.min(Z*Z+at*at,S*S+X*X),le=Q?w:T,Ji=he+le*le*_,Yd=Ft<=Ji;let er=n.join;if(er===Vt.MITER&&Ft/_>g&&(er=Vt.BEVEL),Yd)switch(er){case Vt.MITER:{c.push(Et,rt,dt,ft);break}case Vt.BEVEL:{Q?c.push(Et,rt,y+R*T,x+E*T,Et,rt,y+O*T,x+H*T):c.push(y-R*w,x-E*w,dt,ft,y-O*w,x-H*w,dt,ft),d+=2;break}case Vt.ROUND:{Q?(c.push(Et,rt,y+R*T,x+E*T),d+=Ge(y,x,y+R*T,x+E*T,y+O*T,x+H*T,c,!0)+4,c.push(Et,rt,y+O*T,x+H*T)):(c.push(y-R*w,x-E*w,dt,ft),d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+4,c.push(y-O*w,x-H*w,dt,ft));break}}else{switch(c.push(y-R*w,x-E*w,y+R*T,x+E*T),er){case Vt.MITER:{Q?c.push(dt,ft,dt,ft):c.push(Et,rt,Et,rt),d+=2;break}case Vt.ROUND:{Q?d+=Ge(y,x,y+R*T,x+E*T,y+O*T,x+H*T,c,!0)+2:d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+2;break}}c.push(y-O*w,x-H*w,y+O*T,x+H*T),d+=2}}v=s[(u-2)*2],b=s[(u-2)*2+1],y=s[(u-1)*2],x=s[(u-1)*2+1],R=-(b-x),E=v-y,I=Math.sqrt(R*R+E*E),R/=I,E/=I,R*=p,E*=p,c.push(y-R*w,x-E*w,y+R*T,x+E*T),h||(n.cap===Se.ROUND?d+=Ge(y-R*(w-T)*.5,x-E*(w-T)*.5,y-R*w,x-E*w,y+R*T,x+E*T,c,!1)+2:n.cap===Se.SQUARE&&(d+=bh(y,x,R,E,w,T,!1,c)));const W=t.indices,q=Ae.epsilon*Ae.epsilon;for(let F=f;F0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,s=null){const r=new Gi(e,t,i,s);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new Gi(e,null,null,t),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],s=i.style);for(let a=this.shapeIndex;a65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(s=ki.pop(),s||(s=new ps,s.texArray=new Es),this.drawCalls.push(s)),s.start=l,s.size=0,s.texArray.count=0,s.type=h),p.touched=1,p._batchEnabled=e,p._batchLocation=r,p.wrapMode=ie.REPEAT,s.texArray.elements[s.texArray.count++]=p,r++)),s.size+=u.size,l+=u.size,o=p._batchLocation,this.addColors(t,f.color,f.alpha,u.attribSize,u.attribStart),this.addTextureIds(i,o,u.attribSize,u.attribStart)}V._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,s=this.textureIds,r=new ArrayBuffer(e.length*3*4),n=new Float32Array(r),o=new Uint32Array(r);let a=0;for(let h=0;h0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new Pe,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Pe,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],r=i[i.length-1];return(s!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,s){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),Xs.curveTo(e,t,i,s,r),this}bezierCurveTo(e,t,i,s,r,n){return this._initCurve(),Hs.curveTo(e,t,i,s,r,n,this.currentPath.points),this}arcTo(e,t,i,s,r){this._initCurve(e,t);const n=this.currentPath.points,o=Pn.curveTo(e,t,i,s,r,n);if(o){const{cx:a,cy:h,radius:l,startAngle:c,endAngle:u,anticlockwise:d}=o;this.arc(a,h,l,c,u,d)}return this}arc(e,t,i,s,r,n=!1){if(s===r)return this;if(!n&&r<=s?r+=yi:n&&s<=r&&(s+=yi),r-s===0)return this;const a=e+Math.cos(s)*i,h=t+Math.sin(s)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,s){return this.drawShape(new $(e,t,i,s))}drawRoundedRect(e,t,i,s,r){return this.drawShape(new ys(e,t,i,s,r))}drawCircle(e,t,i){return this.drawShape(new _s(e,t,i))}drawEllipse(e,t,i,s){return this.drawShape(new gs(e,t,i,s))}drawPolygon(...e){let t,i=!0;const s=e[0];s.points?(i=s.closeStroke,t=s.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new Pe(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===_t.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let s=0;s0){const p=h.x-t[d].x,_=h.y-t[d].y,g=Math.sqrt(p*p+_*_);h=t[d],a+=g/l}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1}let u=0;for(let d=0;d0?this.textureScale*this._width/2:this._width/2;for(let l=0;l1&&(d=1);const f=Math.sqrt(r*r+n*n);f<1e-6?(r=0,n=0):(r/=f,n/=f,r*=h,n*=h),o[u]=c.x+r,o[u+1]=c.y+n,o[u+2]=c.x-r,o[u+3]=c.y-n,i=c}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class Ch extends He{constructor(t,i,s){const r=new Ah(t.width,t.height,i,s),n=new ni(B.WHITE);super(r,n),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:i,height:s}=this.shader.texture;this.autoResize&&(t.width!==i||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}const $s=10;class yd extends Ch{constructor(t,i,s,r,n){var o,a,h,l,c,u,d,f;super(B.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=(a=i!=null?i:(o=t.defaultBorders)==null?void 0:o.left)!=null?a:$s,this._rightWidth=(l=r!=null?r:(h=t.defaultBorders)==null?void 0:h.right)!=null?l:$s,this._topHeight=(u=s!=null?s:(c=t.defaultBorders)==null?void 0:c.top)!=null?u:$s,this._bottomHeight=(f=n!=null?n:(d=t.defaultBorders)==null?void 0:d.bottom)!=null?f:$s,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,i=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,i=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,i=this._width>t?1:this._width/t,s=this._topHeight+this._bottomHeight,r=this._height>s?1:this._height/s;return Math.min(i,r)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,i=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const s=1/this._origWidth,r=1/this._origHeight;i[0]=i[8]=i[16]=i[24]=0,i[1]=i[3]=i[5]=i[7]=0,i[6]=i[14]=i[22]=i[30]=1,i[25]=i[27]=i[29]=i[31]=1,i[2]=i[10]=i[18]=i[26]=s*this._leftWidth,i[4]=i[12]=i[20]=i[28]=1-s*this._rightWidth,i[9]=i[11]=i[13]=i[15]=r*this._topHeight,i[17]=i[19]=i[21]=i[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class vd extends He{constructor(t=B.EMPTY,i,s,r,n){const o=new Vi(i,s,r);o.getBuffer("aVertexPosition").static=!1;const a=new ni(t);super(o,a,null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class xd extends He{constructor(t,i,s=0){const r=new Rh(t.height,i,s),n=new ni(t);s>0&&(t.baseTexture.wrapMode=ie.REPEAT),super(r,n),this.autoUpdate=!0}_render(t){const i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),super._render(t)}}class bd extends Ct{constructor(t=1500,i,s=16384,r=!1){super();const n=16384;s>n&&(s=n),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=G.NORMAL,this.autoResize=r,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tintColor=new j(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const i=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.lengths&&!t.autoResize&&(o=s);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=i[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=xr(t.blendMode,l),n.state.set(this.state);const c=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=j.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fr&&(_=r),p>=a.length&&a.push(this._generateOneMoreBuffer(t));const g=a[p];g.uploadDynamic(i,f,_);const v=t._bufferUpdateIDs[p]||0;d=d||g._updateID0);r[o]=l,r[o+n]=l,r[o+n*2]=l,r[o+n*3]=l,o+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Ln.extension={name:"particle",type:M.RendererPlugin},U.add(Ln);var zi=(e=>(e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",e))(zi||{});const js={willReadFrequently:!0},L=class{static get experimentalLetterSpacingSupported(){let e=L._experimentalLetterSpacingSupported;if(e!==void 0){const t=P.ADAPTER.getCanvasRenderingContext2D().prototype;e=L._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,s,r,n,o,a,h){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=r,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}static measureText(e,t,i,s=L._canvas){i=i==null?t.wordWrap:i;const r=t.toFontString(),n=L.measureFont(r);n.fontSize===0&&(n.fontSize=t.fontSize,n.ascent=t.fontSize);const o=s.getContext("2d",js);o.font=r;const h=(i?L.wordWrap(e,t,s):e).split(/(?:\\r\\n|\\r|\\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(s?r-=t:r+=(L.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=L._canvas){const s=i.getContext("2d",js);let r=0,n="",o="";const a=Object.create(null),{letterSpacing:h,whiteSpace:l}=t,c=L.collapseSpaces(l),u=L.collapseNewlines(l);let d=!c;const f=t.wordWrapWidth+h,p=L.tokenize(e);for(let _=0;_f)if(n!==""&&(o+=L.addLine(n),n="",r=0),L.canBreakWords(g,t.breakWords)){const b=L.wordWrapSplit(g);for(let y=0;yf&&(o+=L.addLine(n),d=!1,n="",r=0),n+=x,r+=R}}else{n.length>0&&(o+=L.addLine(n),n="",r=0);const b=_===p.length-1;o+=L.addLine(g,!b),d=!1,n="",r=0}else v+r>f&&(d=!1,o+=L.addLine(n),n="",r=0),(n.length>0||!L.isBreakingSpace(g)||d)&&(n+=g,r+=v)}return o+=L.addLine(n,!1),o}static addLine(e,t=!0){return e=L.trimRight(e),e=t?`${e}\n`:e,e}static getFromCache(e,t,i,s){let r=i[e];return typeof r!="number"&&(r=L._measureText(e,t,s)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!L.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:L._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:L._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let s=0;so;--u){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const e=new Intl.Segmenter;return t=>[...e.segment(t)].map(i=>i.segment)}return e=>[...e]})(),yt.experimentalLetterSpacing=!1,yt._fonts={},yt._newlines=[10,13],yt._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];const wd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wi=class{constructor(e){this.styleID=0,this.reset(),Un(this,e,e)}clone(){const e={};return Un(e,this,Wi.defaultStyle),new Wi(e)}reset(){Un(this,Wi.defaultStyle,Wi.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=On(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=On(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){Sd(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=On(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\\"\\\'])[^\\\'\\"]+\\1/.test(s)&&!wd.includes(s)&&(s=`"${s}"`),t[i]=s}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};let ae=Wi;ae.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:zi.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};function On(e){const t=j.shared;return Array.isArray(e)?e.map(i=>t.setValue(i).toHex()):t.setValue(e).toHex()}function Sd(e,t){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i0&&f>p&&(_=(p+f)/2);const g=p+u,v=i.lineHeight*(d+1);let b=g;d+10}}function Rd(e,t){var s;let i=!1;if((s=e==null?void 0:e._textures)!=null&&s.length){for(let r=0;r{!this.queue||this.prepareItems()},this.registerFindHook(Bd),this.registerFindHook(Dd),this.registerFindHook(Rd),this.registerFindHook(Cd),this.registerFindHook(Id),this.registerUploadHook(Pd),this.registerUploadHook(Md)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,lt.system.addOnce(this.tick,this,ge.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,s=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&<.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};let $i=Mh;$i.uploadsPerFrame=4,Object.defineProperties(P,{UPLOADS_PER_FRAME:{get(){return $i.uploadsPerFrame},set(e){z("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),$i.uploadsPerFrame=e}}});function Bh(e,t){return t instanceof V?(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0):!1}function Fd(e,t){if(!(t instanceof Xi))return!1;const{geometry:i}=t;t.finishPoly(),i.updateBatches();const{batches:s}=i;for(let r=0;r=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrames)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const i=[];for(let s=0;sthis.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const ji=new Y;class Hn extends ye{constructor(t,i=100,s=100){super(t),this.tileTransform=new vi,this._width=i,this._height=s,this.uvMatrix=this.texture.uvMatrix||new Rs(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const i=this._texture;!i||!i.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,i=this._height*-this._anchor._y,s=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,i,s,r)}getLocalBounds(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new $),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,ji);const i=this._width,s=this._height,r=-i*this.anchor._x;if(ji.x>=r&&ji.x=n&&ji.y1?Kt.from(Ud,Od,i):Kt.from(Dh,kd,i)}render(t){const i=this.renderer,s=this.quad;let r=s.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;r=s.uvs,r[0]=r[6]=-n,r[1]=r[3]=-o,r[2]=r[4]=1-n,r[5]=r[7]=1-o,s.invalidate();const a=t._texture,h=a.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[i.CONTEXT_UID]?d=h.wrapMode!==ie.CLAMP:h.wrapMode===ie.CLAMP&&(h.wrapMode=ie.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,_=a.height,g=t._width,v=t._height;Ks.set(c.a*p/g,c.b*p/v,c.c*_/g,c.d*_/v,c.tx/g,c.ty/v),Ks.invert(),d?Ks.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=Ks.toArray(!0),f.uniforms.uColor=j.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,i.shader.bind(f),i.geometry.bind(s),this.state.blendMode=xr(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Xn.extension={name:"tilingSprite",type:M.RendererPlugin},U.add(Xn);const Yi=class{constructor(e,t,i=null){this.linkedSheets=[],this._texture=e instanceof B?e:null,this.baseTexture=e instanceof V?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=t;const s=this.baseTexture.resource;this.resolution=this._updateResolution(i||(s?s.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=fe(e,null);return i===null&&(i=parseFloat(t!=null?t:"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Yi.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Yi.BATCH_SIZE;for(;t-e{this._batchIndex*Yi.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[r]=t.textures[r]}),!i){const r=Tt.dirname(e[0]);t.linkedSheets.forEach((n,o)=>{const a=Fh([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const Nh={extension:M.Asset,cache:{test:e=>e instanceof Zs,getCacheableAssets:(e,t)=>Fh(e,t,!1)},resolver:{test:e=>{const i=e.split("?")[0].split("."),s=i.pop(),r=i.pop();return s==="json"&&Hd.includes(r)},parse:e=>{var i,s;const t=e.split(".");return{resolution:parseFloat((s=(i=P.RETINA_PREFIX.exec(e))==null?void 0:i[1])!=null?s:"1"),format:t[t.length-2],src:e}}},loader:{name:"spritesheetLoader",extension:{type:M.LoadParser,priority:Jt.Normal},async testParse(e,t){return Tt.extname(t.src).toLowerCase()===".json"&&!!e.frames},async parse(e,t,i){var l,c;let s=Tt.dirname(t.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");let r=s+e.meta.image;r=Os(r,t.src);const o=(await i.load([r]))[r],a=new Zs(o.baseTexture,e,t.src);await a.parse();const h=(l=e==null?void 0:e.meta)==null?void 0:l.related_multi_packs;if(Array.isArray(h)){const u=[];for(const f of h){if(typeof f!="string")continue;let p=s+f;(c=t.data)!=null&&c.ignoreMultiPack||(p=Os(p,t.src),u.push(i.load({src:p,data:{ignoreMultiPack:!0}})))}const d=await Promise.all(u);a.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[a].concat(a.linkedSheets.filter(p=>p!==f))})}return a},unload(e){e.destroy(!0)}}};U.add(Nh);class qi{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ki{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const i=t.match(/^[a-z]+\\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in i){const o=i[n].match(/^[a-z]+/gm)[0],a=i[n].match(/[a-zA-Z]+=([^\\s"\']+|"([^"]*)")/gm),h={};for(const l in a){const c=a[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}s[o].push(h)}const r=new qi;return s.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),s.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),s.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),s.char.forEach(n=>r.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),s.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),s.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class Js{static test(t){const i=t;return"getElementsByTagName"in i&&i.getElementsByTagName("page").length&&i.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const i=new qi,s=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?Js.test(P.ADAPTER.parseXML(t)):!1}static parse(t){return Js.parse(P.ADAPTER.parseXML(t))}}const Vn=[Ki,Js,Qs];function Lh(e){for(let t=0;t=a-I*n){if(p===0)throw new Error(`[BitmapFont] textureHeight ${a}px is too small (fontFamily: \'${c.fontFamily}\', fontSize: ${c.fontSize}px, char: \'${E}\')`);--R,_=null,g=null,v=null,p=0,f=0,b=0;continue}if(b=Math.max(I+O.fontProperties.descent,b),N*n+f>=u){if(f===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: \'${c.fontFamily}\', fontSize: ${c.fontSize}px, char: \'${E}\')`);--R,p+=b*n,p=Math.ceil(p),f=0,b=0;continue}Vd(_,g,O,f,p,n,c);const w=tr(O.text);d.char.push({id:w,page:x.length-1,x:f/n,y:p/n,width:N,height:I,xoffset:0,yoffset:0,xadvance:H-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0)}),f+=(N+2*r)*n,f=Math.ceil(f)}for(let R=0,E=l.length;R 0.99) {\\r\n alpha = 1.0;\\r\n }\\r\n\\r\n // Gamma correction for coverage-like alpha\\r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\\r\n float gamma = mix(1.0, 1.0 / 2.2, luma);\\r\n float coverage = pow(uColor.a * alpha, gamma); \\r\n\\r\n // NPM Textures, NPM outputs\\r\n gl_FragColor = vec4(uColor.rgb, coverage);\\r\n}\\r\n`,$d=`// Mesh material default fragment\\r\nattribute vec2 aVertexPosition;\\r\nattribute vec2 aTextureCoord;\\r\n\\r\nuniform mat3 projectionMatrix;\\r\nuniform mat3 translationMatrix;\\r\nuniform mat3 uTextureMatrix;\\r\n\\r\nvarying vec2 vTextureCoord;\\r\n\\r\nvoid main(void)\\r\n{\\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\r\n\\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\\r\n}\\r\n`;const Uh=[],kh=[],Gh=[],Hh=class extends Ct{constructor(e,t={}){super();const{align:i,tint:s,maxWidth:r,letterSpacing:n,fontName:o,fontSize:a}=Object.assign({},Hh.styleDefaults,t);if(!At.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new j(s),this._font=void 0,this._fontName=o,this._fontSize=a,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=n,this._anchor=new me(()=>{this.dirty=!0},this,0,0),this._roundPixels=P.ROUND_PIXELS,this.dirty=!0,this._resolution=P.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var H;const e=At.available[this._fontName],t=this.fontSize,i=t/e.size,s=new Y,r=[],n=[],o=[],a=this._text.replace(/(?:\\r\\n|\\r)/g,`\n`)||" ",h=Oh(a),l=this._maxWidth*e.size/t,c=e.distanceFieldType==="none"?Uh:kh;let u=null,d=0,f=0,p=0,_=-1,g=0,v=0,b=0,y=0;for(let I=0;I0&&s.x>l&&(++v,Ie(r,1+_-v,1+I-_),I=_,_=-1,n.push(g),o.push(r.length>0?r[r.length-1].prevSpaces:0),f=Math.max(f,g),p++,s.x=0,s.y+=e.lineHeight,u=null,y=0)}const x=h[h.length-1];x!=="\\r"&&x!==`\n`&&(/(?:\\s)/.test(x)&&(d=g),n.push(d),f=Math.max(f,d),o.push(-1));const A=[];for(let I=0;I<=p;I++){let N=0;this._align==="right"?N=f-n[I]:this._align==="center"?N=(f-n[I])/2:this._align==="justify"&&(N=o[I]<0?0:(f-n[I])/o[I]),A.push(N)}const D=r.length,R={},E=[],O=this._activePagesMeshData;c.push(...O);for(let I=0;I6*w)||N.vertices.lengtht[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=B.EMPTY});for(const r in t)t[r].destroy(),delete t[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};let Xh=Hh;Xh.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const jd=[".xml",".fnt"],Vh={extension:{type:M.LoadParser,priority:Jt.Normal},name:"loadBitmapFont",test(e){return jd.includes(Tt.extname(e).toLowerCase())},async testParse(e){return Ki.test(e)||Qs.test(e)},async parse(e,t,i){const s=Ki.test(e)?Ki.parse(e):Qs.parse(e),{src:r}=t,{page:n}=s,o=[];for(let l=0;la[l]);return At.install(s,h,!0)},async load(e,t){return(await P.ADAPTER.fetch(e)).text()},unload(e){e.destroy()}};U.add(Vh);const oi=class extends ae{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new oi(Object.keys(oi.defaultOptions).reduce((t,i)=>Qi(bt({},t),{[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete oi.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=oi;if(i[e]){const s=i[e];return this._fonts.push(s),s.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return P.ADAPTER.fetch(e).then(s=>s.blob()).then(async s=>new Promise((r,n)=>{const o=URL.createObjectURL(s),a=new FileReader;a.onload=()=>r([o,a.result]),a.onerror=n,a.readAsDataURL(s)})).then(async([s,r])=>{const n=Object.assign({family:Tt.basename(e,Tt.extname(e)),weight:"normal",style:"normal",src:s,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=n,this._fonts.push(n),this.styleID++;const o=new FontFace(n.family,`url(${n.src})`,{weight:n.weight,style:n.style});n.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e}\n @font-face {\n font-family: "${t.family}";\n src: url(\'${t.dataSrc}\');\n font-weight: ${t.weight};\n font-style: ${t.style}; \n }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Mo(e)),typeof e=="number"?Po(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,oi.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=P.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let ai=oi;ai.availableFonts={},ai.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const hi=class extends ye{constructor(e="",t={}){var c;super(B.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const i=new Image,s=B.from(i,{scaleMode:P.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new $,s.trim=new $,this.texture=s;const r="http://www.w3.org/2000/svg",n="http://www.w3.org/1999/xhtml",o=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject"),h=document.createElementNS(n,"div"),l=document.createElementNS(n,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",o.appendChild(a),this.maxWidth=hi.defaultMaxWidth,this.maxHeight=hi.defaultMaxHeight,this._domElement=h,this._styleElement=l,this._svgRoot=o,this._foreignObject=a,this._foreignObject.appendChild(l),this._foreignObject.appendChild(h),this._image=i,this._loadImage=new Image,this._autoResolution=hi.defaultAutoResolution,this._resolution=(c=hi.defaultResolution)!=null?c:P.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,h;const{text:t,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const n=Math.min(this.maxWidth,Math.ceil(r.width)),o=Math.min(this.maxHeight,Math.ceil(r.height));return this._svgRoot.setAttribute("width",n.toString()),this._svgRoot.setAttribute("height",o.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(s)}),this._styleElement.textContent=(h=this._style)==null?void 0:h.toGlobalCSS()),{width:n+i.padding*2,height:o+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:s}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:n}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,r)),i.height=s.height=Math.ceil(Math.max(1,n)),this._loading||(this._loading=!0,await new Promise(o=>{s.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,i.src=s.src,s.onload=null,s.src="",this.updateTexture(),o()};const a=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:i,resolution:s}=this,{padding:r}=e,{baseTexture:n}=t;t.trim.width=t._frame.width=i.width/s,t.trim.height=t._frame.height=i.height/s,t.trim.x=-r,t.trim.y=-r,t.orig.width=t._frame.width-r*2,t.orig.height=t._frame.height-r*2,this._onTextureUpdate(),n.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,r,n,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},hi.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=t,(s=this._svgRoot)==null||s.remove(),this._svgRoot=t,(r=this._domElement)==null||r.remove(),this._domElement=t,(n=this._foreignObject)==null||n.remove(),this._foreignObject=t,(o=this._styleElement)==null||o.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=de(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=de(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof ai?(this.ownsStyle=!1,this._style=e):e instanceof ae?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=ai.from(e)):(this.ownsStyle=!0,this._style=new ai(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/

/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let Zi=hi;return Zi.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Zi.defaultMaxWidth=2024,Zi.defaultMaxHeight=2024,Zi.defaultAutoResolution=!0,m.ALPHA_MODES=Nt,m.AbstractMultiResource=dn,m.AccessibilityManager=vn,m.AlphaFilter=Pa,m.AnimatedSprite=qs,m.Application=bn,m.ArrayResource=Aa,m.Assets=Ni,m.AssetsClass=Ja,m.Attribute=gi,m.BLEND_MODES=G,m.BUFFER_BITS=Rt,m.BUFFER_TYPE=jt,m.BackgroundSystem=Ei,m.BaseImageResource=_e,m.BasePrepare=$i,m.BaseRenderTexture=Lr,m.BaseTexture=V,m.BatchDrawCall=ps,m.BatchGeometry=Br,m.BatchRenderer=Gt,m.BatchShaderGenerator=ra,m.BatchSystem=Nr,m.BatchTextureArray=Es,m.BitmapFont=At,m.BitmapFontData=qi,m.BitmapText=Xh,m.BlobResource=ah,m.BlurFilter=Ma,m.BlurFilterPass=Fs,m.Bounds=Ii,m.BrowserAdapter=$n,m.Buffer=ot,m.BufferResource=Ye,m.BufferSystem=ln,m.CLEAR_MODES=$t,m.COLOR_MASK_BITS=Wn,m.Cache=ii,m.CanvasResource=Ra,m.Circle=_s,m.Color=j,m.ColorMatrixFilter=Ns,m.CompressedTextureResource=we,m.Container=Ct,m.ContextSystem=wi,m.CountLimiter=Ph,m.CubeResource=fn,m.DEG_TO_RAD=Wo,m.DRAW_MODES=zt,m.DisplacementFilter=Ba,m.DisplayObject=st,m.ENV=et,m.Ellipse=gs,m.EventBoundary=Na,m.EventSystem=ti,m.ExtensionType=M,m.Extract=Cn,m.FORMATS=C,m.FORMATS_TO_COMPONENTS=uh,m.FXAAFilter=Da,m.FederatedDisplayObject=Oa,m.FederatedEvent=Qe,m.FederatedMouseEvent=Mi,m.FederatedPointerEvent=Xt,m.FederatedWheelEvent=ke,m.FillStyle=Hi,m.Filter=gt,m.FilterState=ha,m.FilterSystem=Xr,m.Framebuffer=ws,m.FramebufferSystem=Vr,m.GC_MODES=es,m.GLFramebuffer=la,m.GLProgram=_a,m.GLTexture=Ms,m.GRAPHICS_CURVES=dd,m.GenerateTextureSystem=Zr,m.Geometry=pe,m.GeometrySystem=Wr,m.Graphics=Xi,m.GraphicsData=Gi,m.GraphicsGeometry=Dn,m.HTMLText=Zi,m.HTMLTextStyle=ai,m.IGLUniformData=Mc,m.INSTALLED=fs,m.INTERNAL_FORMATS=It,m.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL=Li,m.ImageBitmapResource=Ue,m.ImageResource=Or,m.LINE_CAP=Se,m.LINE_JOIN=Vt,m.LineStyle=zs,m.LoaderParserPriority=Jt,m.MASK_TYPES=ct,m.MIPMAP_MODES=Wt,m.MSAA_QUALITY=ht,m.MaskData=da,m.MaskSystem=$r,m.Matrix=tt,m.Mesh=He,m.MeshBatchUvs=Eh,m.MeshGeometry=Vi,m.MeshMaterial=ni,m.MultisampleSystem=hn,m.NineSlicePlane=yd,m.NoiseFilter=Fa,m.ObjectRenderer=bi,m.ObjectRendererSystem=cn,m.ObservablePoint=me,m.PI_2=yi,m.PRECISION=Pt,m.ParticleContainer=bd,m.ParticleRenderer=Ln,m.PlaneGeometry=Ah,m.PluginSystem=qr,m.Point=Y,m.Polygon=Pe,m.Prepare=Gn,m.Program=Ut,m.ProjectionSystem=Kr,m.Quad=aa,m.QuadUv=Gr,m.RAD_TO_DEG=zo,m.RENDERER_TYPE=pt,m.Rectangle=$,m.RenderTexture=be,m.RenderTexturePool=kr,m.RenderTextureSystem=Jr,m.Renderer=Oe,m.ResizePlugin=Tn,m.Resource=je,m.RopeGeometry=Rh,m.RoundedRectangle=ys,m.Runner=Bt,m.SAMPLER_TYPES=ts,m.SCALE_MODES=ee,m.SHAPES=_t,m.SVGResource=Je,m.ScissorSystem=jr,m.Shader=Kt,m.ShaderSystem=Qr,m.SimpleMesh=vd,m.SimplePlane=Ch,m.SimpleRope=xd,m.Sprite=ye,m.SpriteMaskFilter=ua,m.Spritesheet=Zs,m.StartupSystem=Ai,m.State=ne,m.StateSystem=en,m.StencilSystem=Yr,m.SystemManager=Ta,m.TARGETS=Re,m.TEXT_GRADIENT=zi,m.TYPES=k,m.TYPES_TO_BYTES_PER_COMPONENT=Rn,m.TYPES_TO_BYTES_PER_PIXEL=dh,m.TemporaryDisplayObject=Ca,m.Text=Ys,m.TextFormat=Ki,m.TextMetrics=yt,m.TextStyle=ae,m.Texture=B,m.TextureGCSystem=Ht,m.TextureMatrix=Rs,m.TextureSystem=sn,m.TextureUvs=Ur,m.Ticker=lt,m.TickerPlugin=on,m.TilingSprite=Hn,m.TilingSpriteRenderer=Xn,m.TimeLimiter=Ld,m.Transform=vi,m.TransformFeedback=Yc,m.TransformFeedbackSystem=rn,m.UPDATE_PRIORITY=ge,m.UniformGroup=kt,m.VERSION=qc,m.VideoResource=Ds,m.ViewSystem=Ri,m.ViewableBuffer=ds,m.WRAP_MODES=ie,m.XMLFormat=Js,m.XMLStringFormat=Qs,m.accessibleTarget=Ua,m.autoDetectFormat=Lh,m.autoDetectRenderer=wa,m.autoDetectResource=Mr,m.cacheTextureArray=Qa,m.checkDataUrl=ei,m.checkExtension=Ee,m.checkMaxIfStatementsInShader=Xo,m.convertToList=oe,m.copySearchParams=Os,m.createStringVariations=Va,m.createTexture=Di,m.createUBOElements=va,m.curves=Ae,m.defaultFilterVertex=an,m.defaultVertex=Sa,m.detectAvif=th,m.detectCompressedTextures=oh,m.detectDefaults=sh,m.detectWebp=eh,m.extensions=U,m.filters=_n,m.generateProgram=ga,m.generateUniformBufferSync=ba,m.getFontFamilyName=$a,m.getTestContext=Zo,m.getUBOData=xa,m.graphicsUtils=md,m.groupD8=it,m.isMobile=Yt,m.isSingleItem=Bi,m.loadBitmapFont=Vh,m.loadDDS=ph,m.loadImageBitmap=Ka,m.loadJson=za,m.loadKTX=mh,m.loadSVG=Za,m.loadTextures=Fi,m.loadTxt=Wa,m.loadWebFont=ja,m.parseDDS=lh,m.parseKTX=fh,m.resolveCompressedTextureUrl=_h,m.resolveTextureUrl=rh,m.settings=P,m.spritesheetAsset=Nh,m.uniformParsers=Ne,m.unsafeEvalSupported=sa,m.utils=tc,Object.defineProperty(m,"__esModule",{value:!0}),m}({});\n//# sourceMappingURL=pixi.min.js.map\n'; // assets/minisearch.txt.js var minisearch_txt_default = `/** * Minified by jsDelivr using Terser v5.19.2. * Original file: /npm/minisearch@6.3.0/dist/umd/index.js */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).MiniSearch=e()}(this,(function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var o,u="KEYS",a="VALUES",s="",l=function(){function t(t,e){var r=t._tree,n=Array.from(r.keys());this.set=t,this._type=e,this._path=n.length>0?[{node:r,keys:n}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=c(this._path),e=t.node,r=t.keys;if(c(r)===s)return{done:!1,value:this.result()};var n=e.get(c(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=c(this._path).keys;t.pop(),t.length>0||(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return c(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return c(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case u:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),c=function(t){return t[t.length-1]},h=function(t,e,r,i,o,u,a,l){var c,d,f=u*a;try{t:for(var y=n(t.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p===s){var m=o[f-1];m<=r&&i.set(l,[t.get(p),m])}else{for(var _=u,g=0;gr)continue t}h(t.get(p),e,r,i,o,_,a,l+p)}}}catch(t){c={error:t}}finally{try{v&&!v.done&&(d=y.return)&&d.call(y)}finally{if(c)throw c.error}}},d=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(e){var r,o;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var u=i(f(this._tree,e.slice(this._prefix.length)),2),a=u[0],l=u[1];if(void 0===a){var c=i(g(l),2),h=c[0],d=c[1];try{for(var y=n(h.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p!==s&&p.startsWith(d)){var m=new Map;return m.set(p.slice(d.length),h.get(p)),new t(m,e)}}}catch(t){r={error:t}}finally{try{v&&!v.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}}return new t(a,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,p(this._tree,t)},t.prototype.entries=function(){return new l(this,"ENTRIES")},t.prototype.forEach=function(t){var e,r;try{for(var o=n(this),u=o.next();!u.done;u=o.next()){var a=i(u.value,2);t(a[0],a[1],this)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return function(t,e,r){var n=new Map;if(void 0===e)return n;for(var i=e.length+1,o=i+r,u=new Uint8Array(o*i).fill(r+1),a=0;a0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new d,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(t){var e=this,r=this._idToShortId.get(t);if(null==r)throw new Error("MiniSearch: cannot discard document with ID ".concat(t,": it is not in the index"));this._idToShortId.delete(t),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach((function(t,n){e.removeFieldLength(r,n,e._documentCount,t)})),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(!1!==this._options.autoVacuum){var t=this._options.autoVacuum,e=t.minDirtFactor,r=t.minDirtCount,n=t.batchSize,i=t.batchWait;this.conditionalVacuum({batchSize:n,batchWait:i},{minDirtCount:r,minDirtFactor:e})}},o.prototype.discardAll=function(t){var e,r,i=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var o=n(t),u=o.next();!u.done;u=o.next()){var a=u.value;this.discard(a)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}}finally{this._options.autoVacuum=i}this.maybeAutoVacuum()},o.prototype.replace=function(t){var e=this._options,r=e.idField,n=(0,e.extractField)(t,r);this.discard(n),this.add(t)},o.prototype.vacuum=function(t){return void 0===t&&(t={}),this.conditionalVacuum(t)},o.prototype.conditionalVacuum=function(t,e){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&e,null!=this._enqueuedVacuum||(this._enqueuedVacuum=this._currentVacuum.then((function(){var e=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=I,r.performVacuuming(t,e)}))),this._enqueuedVacuum):!1===this.vacuumConditionsMet(e)?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)},o.prototype.performVacuuming=function(t,o){return e(this,void 0,void 0,(function(){var e,u,a,s,l,c,h,d,f,y,v,p,m,_,g,F,x,w,b,A,C,E,z,S,I;return r(this,(function(r){switch(r.label){case 0:if(e=this._dirtCount,!this.vacuumConditionsMet(o))return[3,10];u=t.batchSize||D.batchSize,a=t.batchWait||D.batchWait,s=1,r.label=1;case 1:r.trys.push([1,7,8,9]),l=n(this._index),c=l.next(),r.label=2;case 2:if(c.done)return[3,6];h=i(c.value,2),d=h[0],f=h[1];try{for(E=void 0,y=n(f),v=y.next();!v.done;v=y.next()){p=i(v.value,2),m=p[0],_=p[1];try{for(S=void 0,g=n(_),F=g.next();!F.done;F=g.next())x=i(F.value,1),w=x[0],this._documentIds.has(w)||(_.size<=1?f.delete(m):_.delete(w))}catch(t){S={error:t}}finally{try{F&&!F.done&&(I=g.return)&&I.call(g)}finally{if(S)throw S.error}}}}catch(t){E={error:t}}finally{try{v&&!v.done&&(z=y.return)&&z.call(y)}finally{if(E)throw E.error}}return 0===this._index.get(d).size&&this._index.delete(d),s%u!=0?[3,4]:[4,new Promise((function(t){return setTimeout(t,a)}))];case 3:r.sent(),r.label=4;case 4:s+=1,r.label=5;case 5:return c=l.next(),[3,2];case 6:return[3,9];case 7:return b=r.sent(),A={error:b},[3,9];case 8:try{c&&!c.done&&(C=l.return)&&C.call(l)}finally{if(A)throw A.error}return[7];case 9:this._dirtCount-=e,r.label=10;case 10:return[4,null];case 11:return r.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}}))}))},o.prototype.vacuumConditionsMet=function(t){if(null==t)return!0;var e=t.minDirtCount,r=t.minDirtFactor;return e=e||k.minDirtCount,r=r||k.minDirtFactor,this.dirtCount>=e&&this.dirtFactor>=r},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return null!=this._currentVacuum},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(t){return this._idToShortId.has(t)},o.prototype.getStoredFields=function(t){var e=this._idToShortId.get(t);if(null!=e)return this._storedFields.get(e)},o.prototype.search=function(t,e){var r,u;void 0===e&&(e={});var a=this.executeQuery(t,e),s=[];try{for(var l=n(a),c=l.next();!c.done;c=l.next()){var h=i(c.value,2),d=h[0],f=h[1],y=f.score,v=f.terms,p=f.match,m=v.length||1,_={id:this._documentIds.get(d),score:y*m,terms:Object.keys(p),queryTerms:v,match:p};Object.assign(_,this._storedFields.get(d)),(null==e.filter||e.filter(_))&&s.push(_)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(r)throw r.error}}return t===o.wildcard&&null==e.boostDocument&&null==this._options.searchOptions.boostDocument||s.sort(V),s},o.prototype.autoSuggest=function(e,r){var o,u,a,s;void 0===r&&(r={}),r=t(t({},this._options.autoSuggestOptions),r);var l=new Map;try{for(var c=n(this.search(e,r)),h=c.next();!h.done;h=c.next()){var d=h.value,f=d.score,y=(x=d.terms).join(" ");null!=(g=l.get(y))?(g.score+=f,g.count+=1):l.set(y,{score:f,terms:x,count:1})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}var v=[];try{for(var p=n(l),m=p.next();!m.done;m=p.next()){var _=i(m.value,2),g=_[0],F=_[1],x=(f=F.score,F.terms),w=F.count;v.push({suggestion:g,terms:x,score:f/w})}}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return v.sort(V),v},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),e)},o.getDefault=function(t){if(E.hasOwnProperty(t))return w(E,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},o.loadJS=function(t,e){var r,u,a,s,l,c,h=t.index,f=t.documentCount,y=t.nextId,v=t.documentIds,p=t.fieldIds,m=t.fieldLength,_=t.averageFieldLength,g=t.storedFields,F=t.dirtCount,x=t.serializationVersion;if(1!==x&&2!==x)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new o(e);w._documentCount=f,w._nextId=y,w._documentIds=L(v),w._idToShortId=new Map,w._fieldIds=p,w._fieldLength=L(m),w._avgFieldLength=_,w._storedFields=L(g),w._dirtCount=F||0,w._index=new d;try{for(var b=n(w._documentIds),A=b.next();!A.done;A=b.next()){var C=i(A.value,2),E=C[0],z=C[1];w._idToShortId.set(z,E)}}catch(t){r={error:t}}finally{try{A&&!A.done&&(u=b.return)&&u.call(b)}finally{if(r)throw r.error}}try{for(var S=n(h),D=S.next();!D.done;D=S.next()){var I=i(D.value,2),k=I[0],M=I[1],O=new Map;try{for(var V=(l=void 0,n(Object.keys(M))),T=V.next();!T.done;T=V.next()){var j=T.value,B=M[j];1===x&&(B=B.ds),O.set(parseInt(j,10),L(B))}}catch(t){l={error:t}}finally{try{T&&!T.done&&(c=V.return)&&c.call(V)}finally{if(l)throw l.error}}w._index.set(k,O)}}catch(t){a={error:t}}finally{try{D&&!D.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}return w},o.prototype.executeQuery=function(e,r){var n=this;if(void 0===r&&(r={}),e===o.wildcard)return this.executeWildcardQuery(r);if("string"!=typeof e){var i=t(t(t({},r),e),{queries:void 0}),u=e.queries.map((function(t){return n.executeQuery(t,i)}));return this.combineResults(u,i.combineWith)}var a=this._options,s=a.tokenize,l=a.processTerm,c=a.searchOptions,h=t(t({tokenize:s,processTerm:l},c),r),d=h.tokenize,f=h.processTerm,y=d(e).flatMap((function(t){return f(t)})).filter((function(t){return!!t})).map(C(h)).map((function(t){return n.executeQuerySpec(t,h)}));return this.combineResults(y,h.combineWith)},o.prototype.executeQuerySpec=function(e,r){var o,u,a,s,l,c,h=t(t({},this._options.searchOptions),r),d=(h.fields||this._options.fields).reduce((function(e,r){var n;return t(t({},e),((n={})[r]=w(h.boost,r)||1,n))}),{}),f=h.boostDocument,y=h.weights,v=h.maxFuzzy,p=h.bm25,m=t(t({},z.weights),y),_=m.fuzzy,g=m.prefix,F=this._index.get(e.term),x=this.termResults(e.term,e.term,1,F,d,f,p);if(e.prefix&&(l=this._index.atPrefix(e.term)),e.fuzzy){var b=!0===e.fuzzy?.2:e.fuzzy,A=b<1?Math.min(v,Math.round(e.term.length*b)):b;A&&(c=this._index.fuzzyGet(e.term,A))}if(l)try{for(var C=n(l),E=C.next();!E.done;E=C.next()){var S=i(E.value,2),D=S[0],I=S[1];if(V=D.length-e.term.length){null==c||c.delete(D);var k=g*D.length/(D.length+.3*V);this.termResults(e.term,D,k,I,d,f,p,x)}}}catch(t){o={error:t}}finally{try{E&&!E.done&&(u=C.return)&&u.call(C)}finally{if(o)throw o.error}}if(c)try{for(var M=n(c.keys()),O=M.next();!O.done;O=M.next()){D=O.value;var V,T=i(c.get(D),2),L=T[0];if(V=T[1]){k=_*D.length/(D.length+V);this.termResults(e.term,D,k,L,d,f,p,x)}}}catch(t){a={error:t}}finally{try{O&&!O.done&&(s=M.return)&&s.call(M)}finally{if(a)throw a.error}}return x},o.prototype.executeWildcardQuery=function(e){var r,o,u=new Map,a=t(t({},this._options.searchOptions),e);try{for(var s=n(this._documentIds),l=s.next();!l.done;l=s.next()){var c=i(l.value,2),h=c[0],d=c[1],f=a.boostDocument?a.boostDocument(d,"",this._storedFields.get(h)):1;u.set(h,{score:f,terms:[],match:{}})}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return u},o.prototype.combineResults=function(t,e){if(void 0===e&&(e=F),0===t.length)return new Map;var r=e.toLowerCase();return t.reduce(b[r])||new Map},o.prototype.toJSON=function(){var t,e,r,o,u=[];try{for(var a=n(this._index),s=a.next();!s.done;s=a.next()){var l=i(s.value,2),c=l[0],h=l[1],d={};try{for(var f=(r=void 0,n(h)),y=f.next();!y.done;y=f.next()){var v=i(y.value,2),p=v[0],m=v[1];d[p]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}u.push([c,d])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:u,serializationVersion:2}},o.prototype.termResults=function(t,e,r,i,o,u,a,s){var l,c,h,d,f;if(void 0===s&&(s=new Map),null==i)return s;try{for(var y=n(Object.keys(o)),v=y.next();!v.done;v=y.next()){var p=v.value,m=o[p],_=this._fieldIds[p],g=i.get(_);if(null!=g){var F=g.size,x=this._avgFieldLength[_];try{for(var b=(h=void 0,n(g.keys())),C=b.next();!C.done;C=b.next()){var E=C.value;if(this._documentIds.has(E)){var z=u?u(this._documentIds.get(E),e,this._storedFields.get(E)):1;if(z){var S=g.get(E),D=this._fieldLength.get(E)[_],I=r*m*z*A(S,F,this._documentCount,D,x,a),k=s.get(E);if(k){k.score+=I,M(k.terms,t);var O=w(k.match,e);O?O.push(p):k.match[e]=[p]}else s.set(E,{score:I,terms:[t],match:(f={},f[e]=[p],f)})}}else this.removeTerm(_,E,e),F-=1}}catch(t){h={error:t}}finally{try{C&&!C.done&&(d=b.return)&&d.call(b)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{v&&!v.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}return s},o.prototype.addTerm=function(t,e,r){var n=this._index.fetch(r,T),i=n.get(t);if(null==i)(i=new Map).set(e,1),n.set(t,i);else{var o=i.get(e);i.set(e,(o||0)+1)}},o.prototype.removeTerm=function(t,e,r){if(this._index.has(r)){var n=this._index.fetch(r,T),i=n.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,r):i.get(e)<=1?i.size<=1?n.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(r).size&&this._index.delete(r)}else this.warnDocumentChanged(e,t,r)},o.prototype.warnDocumentChanged=function(t,e,r){var i,o;try{for(var u=n(Object.keys(this._fieldIds)),a=u.next();!a.done;a=u.next()){var s=a.value;if(this._fieldIds[s]===e)return void this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(r,'" was not present in field "').concat(s,'". Removing a document after it has changed can corrupt the index!'),"version_conflict")}}catch(t){i={error:t}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},o.prototype.addDocumentId=function(t){var e=this._nextId;return this._idToShortId.set(t,e),this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},o.prototype.addFields=function(t){for(var e=0;e { if (!checkbox.checked) { checkbox.checked = true; if (!this.checkedList.includes(key)) this.checkedList.push(key); } else { checkbox.checked = false; if (this.checkedList.includes(key)) this.checkedList.remove(key); } onChange(checkbox.checked); }); checkbox.onclick = (evt) => { checkbox.checked = !checkbox.checked; }; let label = item.createDiv({ cls: "flow-label" }); label.setText(name); return item; } }; // scripts/settings/export-modal.ts var import_obsidian5 = require("obsidian"); // scripts/objects/file-picker.ts var import_obsidian4 = require("obsidian"); // scripts/objects/file-tree.ts var import_obsidian3 = require("obsidian"); // scripts/objects/tree.ts var Tree = class { constructor() { this.children = []; this.minCollapsableDepth = 1; this.title = "Tree"; this.class = "mod-tree-none"; this.showNestingIndicator = true; this.minDepth = 1; this.generateWithItemsClosed = false; this.makeLinksWebStyle = false; this.renderMarkdownTitles = true; this.container = void 0; } async buildTreeRecursive(tree, container, minDepth = 1, closeAllItems = false) { tree.minCollapsableDepth = this.minCollapsableDepth; let treeItem = await tree.generateItemHTML(container, closeAllItems); if (!tree.childContainer) return; for (let item of tree.children) { if (item.depth < minDepth) continue; await this.buildTreeRecursive(item, tree.childContainer, minDepth, closeAllItems); } } async generateTree(container) { for (let item of this.children) { await this.buildTreeRecursive(item, container, this.minDepth, this.generateWithItemsClosed); } this.forAllChildren((child) => { if (child.isCollapsed) child.setCollapse(true, false); }); } async generateTreeWithContainer(container) { this.container = container; let treeContainerEl = container.createDiv(); let treeHeaderEl = container.createDiv(); let sectionHeaderEl = container.createEl("span"); let collapseAllEl = container.createEl("button"); let treeScrollAreaEl = container.createDiv(); treeContainerEl.classList.add("tree-container", "mod-root", "nav-folder", "tree-item", this.class); treeHeaderEl.classList.add("tree-header"); sectionHeaderEl.classList.add("sidebar-section-header"); collapseAllEl.classList.add("clickable-icon", "collapse-tree-button"); collapseAllEl.setAttribute("aria-label", "Collapse All"); collapseAllEl.innerHTML = ""; treeScrollAreaEl.classList.add("tree-scroll-area", "tree-item-children", "nav-folder-children"); let invisFirst = treeScrollAreaEl.createDiv("tree-item mod-tree-folder nav-folder mod-collapsible is-collapsed"); invisFirst.style.display = "none"; if (this.generateWithItemsClosed) collapseAllEl.classList.add("is-collapsed"); if (this.showNestingIndicator) treeContainerEl.classList.add("mod-nav-indicator"); treeContainerEl.setAttribute("data-depth", "0"); sectionHeaderEl.innerText = this.title; treeContainerEl.appendChild(treeHeaderEl); treeContainerEl.appendChild(treeScrollAreaEl); treeHeaderEl.appendChild(sectionHeaderEl); treeHeaderEl.appendChild(collapseAllEl); await this.generateTree(treeScrollAreaEl); } sortAlphabetically(reverse = false) { this.children.sort((a, b) => reverse ? b.title.localeCompare(a.title, void 0, { numeric: true }) : a.title.localeCompare(b.title, void 0, { numeric: true })); for (let child of this.children) { child.sortAlphabetically(); } } forAllChildren(func, recursive = true) { for (let child of this.children) { func(child); if (recursive) child.forAllChildren(func); } } }; var TreeItem = class { constructor(tree, parent, depth) { this.children = []; this.depth = 0; this.itemClass = ""; this.title = ""; this.icon = ""; this.href = void 0; this.minCollapsableDepth = 1; this.isCollapsed = false; this.childContainer = void 0; this.itemEl = void 0; this.tree = tree; this.parent = parent; this.depth = depth; } async generateItemHTML(container, startClosed = true) { if (startClosed) this.isCollapsed = true; this.itemEl = this.createItemWrapper(container); await this.createItemLink(this.itemEl); this.createItemChildren(this.itemEl); return this.itemEl; } forAllChildren(func, recursive = true) { for (let child of this.children) { func(child); if (recursive) child.forAllChildren(func); } } async setCollapse(collapsed, animate = true) { if (!this.isCollapsible()) return; if (!this.itemEl || !this.itemEl.classList.contains("mod-collapsible")) return; let children = this.itemEl.querySelector(".tree-item-children"); if (children == null) return; if (collapsed) { this.itemEl.classList.add("is-collapsed"); if (animate) this.slideUp(children, 100); else children.style.display = "none"; } else { this.itemEl.classList.remove("is-collapsed"); if (animate) this.slideDown(children, 100); else children.style.removeProperty("display"); } this.isCollapsed = collapsed; } toggleCollapse() { if (!this.itemEl) return; this.setCollapse(!this.itemEl.classList.contains("is-collapsed")); } sortAlphabetically(reverse = false) { this.children.sort((a, b) => reverse ? b.title.localeCompare(a.title, void 0, { numeric: true }) : a.title.localeCompare(b.title, void 0, { numeric: true })); for (let child of this.children) { child.sortAlphabetically(); } } isCollapsible() { return this.children.length != 0 && this.depth >= this.minCollapsableDepth; } createItemWrapper(container) { let itemEl = container.createDiv(); itemEl.classList.add("tree-item"); if (this.itemClass.trim() != "") itemEl.classList.add(...this.itemClass.split(" ")); itemEl.setAttribute("data-depth", this.depth.toString()); if (this.isCollapsible()) itemEl.classList.add("mod-collapsible"); return itemEl; } async createItemContents(container) { var _a2; let itemContentsEl = container.createDiv("tree-item-contents"); if (this.isCollapsible()) { this.createItemCollapseIcon(itemContentsEl); if (this.isCollapsed) { (_a2 = this.itemEl) == null ? void 0 : _a2.classList.add("is-collapsed"); } } this.createItemIcon(itemContentsEl); await this.createItemTitle(itemContentsEl); return itemContentsEl; } async createItemLink(container) { if (this.tree.makeLinksWebStyle && this.href) this.href = Path.toWebStyle(this.href); let itemLinkEl = container.createEl(this.href ? "a" : "div", { cls: "tree-link" }); if (this.href) itemLinkEl.setAttribute("href", this.href); let itemContentEl = await this.createItemContents(itemLinkEl); return { linkEl: itemLinkEl, contentEl: itemContentEl }; } createItemCollapseIcon(container) { const arrowIcon = ``; let itemIconEl = container.createDiv("collapse-icon"); itemIconEl.innerHTML = arrowIcon; return itemIconEl; } async createItemTitle(container) { let titleEl = container.createEl("span", { cls: "tree-item-title" }); if (this.tree.renderMarkdownTitles) MarkdownRendererAPI.renderMarkdownSimpleEl(this.title, titleEl); else titleEl.innerText = this.title; return titleEl; } createItemIcon(container) { if (this.icon.trim() == "") return void 0; let itemIconEl = container.createDiv("tree-item-icon"); if (this.tree.renderMarkdownTitles) MarkdownRendererAPI.renderMarkdownSimpleEl(this.icon, itemIconEl); else itemIconEl.innerText = this.icon; return itemIconEl; } createItemChildren(container) { this.childContainer = container.createDiv("tree-item-children nav-folder-children"); return this.childContainer; } slideUp(target, duration = 500) { target.style.transitionProperty = "height, margin, padding"; target.style.transitionDuration = duration + "ms"; target.style.boxSizing = "border-box"; target.style.height = target.offsetHeight + "px"; target.offsetHeight; target.style.overflow = "hidden"; target.style.height = "0"; target.style.paddingTop = "0"; target.style.paddingBottom = "0"; target.style.marginTop = "0"; target.style.marginBottom = "0"; window.setTimeout(async () => { target.style.display = "none"; target.style.removeProperty("height"); target.style.removeProperty("padding-top"); target.style.removeProperty("padding-bottom"); target.style.removeProperty("margin-top"); target.style.removeProperty("margin-bottom"); target.style.removeProperty("overflow"); target.style.removeProperty("transition-duration"); target.style.removeProperty("transition-property"); }, duration); } slideDown(target, duration = 500) { target.style.removeProperty("display"); let display = window.getComputedStyle(target).display; if (display === "none") display = "block"; target.style.display = display; let height = target.offsetHeight; target.style.overflow = "hidden"; target.style.height = "0"; target.style.paddingTop = "0"; target.style.paddingBottom = "0"; target.style.marginTop = "0"; target.style.marginBottom = "0"; target.offsetHeight; target.style.boxSizing = "border-box"; target.style.transitionProperty = "height, margin, padding"; target.style.transitionDuration = duration + "ms"; target.style.height = height + "px"; target.style.removeProperty("padding-top"); target.style.removeProperty("padding-bottom"); target.style.removeProperty("margin-top"); target.style.removeProperty("margin-bottom"); window.setTimeout(async () => { target.style.removeProperty("height"); target.style.removeProperty("overflow"); target.style.removeProperty("transition-duration"); target.style.removeProperty("transition-property"); }, duration); } }; // scripts/utils/downloadable.ts var Downloadable = class { constructor(filename, content, vaultRelativeDestination, encoding = "utf8") { this.modifiedTime = 0; if (vaultRelativeDestination.isFile) throw new Error("vaultRelativeDestination must be a folder: " + vaultRelativeDestination.asString); this.filename = filename; this.content = content; this.relativeDirectory = vaultRelativeDestination; this.encoding = encoding; } get relativePath() { return this.relativeDirectory.joinString(this.filename); } async download(downloadDirectory) { let data = this.content instanceof Buffer ? this.content : Buffer.from(this.content.toString(), this.encoding); let writePath = this.getAbsoluteDownloadDirectory(downloadDirectory).joinString(this.filename); await writePath.writeFile(data, this.encoding); } getAbsoluteDownloadPath(downloadDirectory) { return this.relativeDirectory.absolute(downloadDirectory).joinString(this.filename); } getAbsoluteDownloadDirectory(downloadDirectory) { return this.relativeDirectory.absolute(downloadDirectory); } }; // scripts/objects/outline-tree.ts var OutlineTree = class extends Tree { constructor(webpage, minDepth = 1) { var _a2, _b; super(); this.minDepth = 1; this.depth = 0; this.webpage = webpage; this.file = webpage.source; this.minDepth = minDepth; let headings = webpage.headings; this.depth = Math.min(...headings.map((h) => h.level)) - 1; let parent = this; for (let heading of headings) { if (heading.level < minDepth) continue; if (heading.level > parent.depth) { let child = this.createTreeItem(heading, parent); parent.children.push(child); if (heading.level == parent.depth + 1) parent = child; } else if (heading.level == parent.depth) { if (parent instanceof OutlineTreeItem) { let child = this.createTreeItem(heading, parent.parent); parent.parent.children.push(child); parent = child; } } else if (heading.level < parent.depth) { if (parent instanceof OutlineTreeItem) { let levelChange = parent.depth - heading.level; let backParent = (_a2 = parent.parent) != null ? _a2 : parent; for (let i = 0; i < levelChange; i++) { if (backParent instanceof OutlineTreeItem) backParent = (_b = backParent.parent) != null ? _b : backParent; } let child = this.createTreeItem(heading, backParent); backParent.children.push(child); parent = child; } } } } createTreeItem(heading, parent) { let item = new OutlineTreeItem(this, parent, heading); item.title = heading.heading; return item; } }; var OutlineTreeItem = class extends TreeItem { constructor(tree, parent, heading) { super(tree, parent, heading.level); this.children = []; this.heading = heading.heading; this.href = tree.webpage.relativePath + "#" + heading.headingEl.id; } forAllChildren(func, recursive = true) { super.forAllChildren(func, recursive); } async createItemContents(container) { let linkEl = await super.createItemContents(container); linkEl == null ? void 0 : linkEl.setAttribute("heading-name", this.heading); linkEl.classList.add("heading-link"); return linkEl; } }; // scripts/objects/graph-view.ts var GraphView = class { constructor() { this.graphOptions = new GraphViewOptions(); this.isInitialized = false; } static InOutQuadBlend(start, end, t) { t /= 2; let t2 = 2 * t * (1 - t) + 0.5; t2 -= 0.5; t2 *= 2; return start + (end - start) * t2; } async init(files, options) { var _a2, _b; if (this.isInitialized) return; Object.assign(this.graphOptions, options.graphViewOptions); this.paths = files.map((f) => f.path); this.nodeCount = this.paths.length; this.linkSources = []; this.linkTargets = []; this.labels = []; this.radii = []; let linkCounts = []; for (let i = 0; i < this.nodeCount; i++) { linkCounts.push(0); } let resolvedLinks = Object.entries(app.metadataCache.resolvedLinks); let values = Array.from(resolvedLinks.values()); let sources = values.map((v) => v[0]); let targets = values.map((v) => v[1]); for (let source of this.paths) { let sourceIndex = sources.indexOf(source); let file = files.find((f) => f.path == source); if (file) { let titleInfo = await Website.getTitleAndIcon(file, true); this.labels.push(titleInfo.title); } if (sourceIndex != -1) { let target = targets[sourceIndex]; for (let link of Object.entries(target)) { if (link[0] == source) continue; if (this.paths.includes(link[0])) { let path1 = source; let path2 = link[0]; let index1 = this.paths.indexOf(path1); let index2 = this.paths.indexOf(path2); if (index1 == -1 || index2 == -1) continue; this.linkSources.push(index1); this.linkTargets.push(index2); linkCounts[index1] = ((_a2 = linkCounts[index1]) != null ? _a2 : 0) + 1; linkCounts[index2] = ((_b = linkCounts[index2]) != null ? _b : 0) + 1; } } } } let maxLinks = Math.max(...linkCounts); this.radii = linkCounts.map((l) => GraphView.InOutQuadBlend(this.graphOptions.minNodeRadius, this.graphOptions.maxNodeRadius, Math.min(l / (maxLinks * 0.8), 1))); this.paths = this.paths.map((p) => new Path(p).setExtension(".html").makeUnixStyle().makeWebStyle(options.webStylePaths).asString); this.linkCount = this.linkSources.length; this.isInitialized = true; } static generateGraphEl(container) { let graphWrapper = container.createDiv(); graphWrapper.classList.add("graph-view-wrapper"); let graphHeader = graphWrapper.createDiv(); graphHeader.addClass("sidebar-section-header"); graphHeader.innerText = "Interactive Graph"; let graphEl = graphWrapper.createDiv(); graphEl.className = "graph-view-placeholder"; graphEl.innerHTML = `
`; return graphWrapper; } getExportData() { if (!this.isInitialized) throw new Error("Graph not initialized"); return `let graphData= ${JSON.stringify(this)};`; } }; // scripts/html-generation/assets/asset.ts var { minify: runMinify } = require_htmlminifier(); var mime = require_mime(); var Asset = class extends Downloadable { constructor(filename, content, type, inlinePolicy, minify2, mutability, loadMethod = "async" /* Async */, loadPriority = 100, cdnPath = void 0, options = new MarkdownWebpageRendererAPIOptions2()) { if (options.webStylePaths) filename = Path.toWebStyle(filename); super(filename, content, Asset.typeToPath(type)); this.loadMethod = "" /* Default */; this.loadPriority = 100; this.onlineURL = void 0; this.childAssets = []; this.exportOptions = options; this.type = type; this.inlinePolicy = inlinePolicy; this.mutability = mutability; this.minify = minify2; this.loadMethod = loadMethod; this.loadPriority = loadPriority; this.onlineURL = cdnPath; this.modifiedTime = Date.now(); switch (mutability) { case "static" /* Static */: AssetHandler.staticAssets.push(this); this.modifiedTime = AssetHandler.mainJsModTime; break; case "dynamic" /* Dynamic */: AssetHandler.dynamicAssets.push(this); break; case "temporary" /* Temporary */: AssetHandler.temporaryAssets.push(this); break; } if (mutability != "child" /* Child */) AssetHandler.allAssets.push(this); } async load(options) { this.exportOptions = options; if (this.type == "style" /* Style */ && typeof this.content == "string") { this.childAssets = []; this.content = await AssetHandler.getStyleChildAssets(this, false); } if (this.minify) { this.minifyAsset(); } } async download(downloadDirectory) { if (this.isInlineFormat(this.exportOptions)) return; await super.download(downloadDirectory); } static typeToPath(type) { switch (type) { case "style" /* Style */: return AssetHandler.cssPath; case "script" /* Script */: return AssetHandler.jsPath; case "media" /* Media */: return AssetHandler.mediaPath; case "html" /* HTML */: return AssetHandler.htmlPath; case "font" /* Font */: return AssetHandler.fontPath; case "other" /* Other */: return AssetHandler.libraryPath; } } static extentionToType(extention) { const mediaTypes = ["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "mp4", "webm", "ogg", "mp3", "wav", "flac", "aac", "m4a", "opus"]; const scriptTypes = ["js", "ts"]; const styleTypes = ["css", "scss", "sass", "less"]; const htmlTypes = ["html", "htm"]; const fontTypes = ["ttf", "woff", "woff2", "eot", "otf"]; extention = extention.toLowerCase().replace(".", ""); if (mediaTypes.includes(extention)) return "media" /* Media */; if (scriptTypes.includes(extention)) return "script" /* Script */; if (styleTypes.includes(extention)) return "style" /* Style */; if (htmlTypes.includes(extention)) return "html" /* HTML */; if (fontTypes.includes(extention)) return "font" /* Font */; return "other" /* Other */; } async minifyAsset() { if (this.type == "html" /* HTML */ || typeof this.content != "string") return; let isJS = this.type == "script" /* Script */; let isCSS = this.type == "style" /* Style */; let tempContent = this.content; try { if (isJS) tempContent = `