{"version":3,"sources":["jsdelivr-header.js","/npm/@permafrost-dev/pretty-format@1.1.5/src/index.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/collections.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/plugins/ConvertAnsi.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/plugins/DOMCollection.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/plugins/lib/escapeHTML.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/plugins/lib/markup.ts","/npm/@permafrost-dev/pretty-format@1.1.5/src/plugins/DOMElement.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,kzBCNA,YAAA,GAAA,SAAA,YAAA,CAAA,QAAA,IAAA,YAAA,OAAA,IAAA,OAAA,QAAA,IAAA,UAAA,OAAA,QAAA,aAAA,aCUA,IAAM,8BAAgC,QAAC,IACnC,MAAM,EAA+B,OAAO,KAAK,GAAQ,OAUzD,OARI,OAAO,uBACP,OAAO,sBAAsB,GAAQ,SAAQ,IACrC,OAAO,yBAAyB,EAAQ,GAAS,YACjD,EAAK,KAAK,EACd,IAID,CAAA,GAX2B,iCAmB/B,SAAS,qBACZ,EACA,EACA,EACA,EACA,EACA,EAIA,EAAY,MAEZ,IAAI,EAAS,GACT,EAAU,EAAS,OAEvB,IAAK,EAAQ,KAAM,CACf,GAAU,EAAO,aAEjB,MAAM,EAAkB,EAAc,EAAO,OAE7C,MAAQ,EAAQ,MAAM,CAIlB,GAAU,EAHG,EAAQ,EAAQ,MAAM,GAAI,EAAQ,EAAiB,EAAO,GAGpC,EAFrB,EAAQ,EAAQ,MAAM,GAAI,EAAQ,EAAiB,EAAO,GAIxE,EAAU,EAAS,OAEd,EAAQ,KAED,EAAO,MACf,GAAU,KAFV,GAAU,IAAM,EAAO,YAI/B,CAEA,GAAU,EAAO,aAAe,CACpC,CAEA,OAAO,CACX,CAOO,SAAS,oBACZ,EACA,EACA,EACA,EACA,EACA,GAEA,IAAI,EAAS,GACT,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,OAAA,aAAA,gBASO,OAAA,OAAA,UAmBT,IAAM,QAAU,CACnB,YAAA,oBACA,cAAA,sBACA,WAAA,oBAGG,YAAQ","file":"/npm/@permafrost-dev/pretty-format@1.1.5/dist/index.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@permafrost-dev/pretty-format@1.1.5/dist/index.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable no-undef */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-prototype-builtins */\n\nimport { printIteratorEntries, printIteratorValues, printListItems, printObjectProperties } from './collections';\nimport ConvertAnsi from './plugins/ConvertAnsi';\nimport DOMCollection from './plugins/DOMCollection';\nimport DOMElement from './plugins/DOMElement';\nimport type { Colors, Config, NewPlugin, Options, OptionsReceived, Plugin, Plugins, Refs, Theme } from './types';\nimport style from 'ansi-styles';\n\nexport type { Colors, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, Refs, Theme } from './types';\n\n\nconst toString = Object.prototype.toString;\nconst toISOString = Date.prototype.toISOString;\nconst errorToString = Error.prototype.toString;\nconst regExpToString = RegExp.prototype.toString;\n\n/**\n * Explicitly comparing typeof constructor to function avoids undefined as name\n * when mock identity-obj-proxy returns the key as the value for any key.\n */\nconst getConstructorName = (val: new (...args: Array<any>) => unknown) => (typeof val.constructor === 'function' && val.constructor.name) || 'Object';\n\n/* global window */\n/** Is val is equal to global window object? Works even if it does not exist :) */\nconst isWindow = (val: unknown) => typeof window !== 'undefined' && val === window;\n\nconst SYMBOL_REGEXP = /^Symbol\\((.*)\\)(.*)$/;\nconst NEWLINE_REGEXP = /\\n/gi;\n\nclass PrettyFormatPluginError extends Error {\n    constructor(message: string, stack: string) {\n        super(message);\n        this.stack = stack;\n        this.name = this.constructor.name;\n    }\n}\n\nfunction isToStringedArrayType(toStringed: string): boolean {\n    return (\n        toStringed === '[object Array]' ||\n        toStringed === '[object ArrayBuffer]' ||\n        toStringed === '[object DataView]' ||\n        toStringed === '[object Float32Array]' ||\n        toStringed === '[object Float64Array]' ||\n        toStringed === '[object Int8Array]' ||\n        toStringed === '[object Int16Array]' ||\n        toStringed === '[object Int32Array]' ||\n        toStringed === '[object Uint8Array]' ||\n        toStringed === '[object Uint8ClampedArray]' ||\n        toStringed === '[object Uint16Array]' ||\n        toStringed === '[object Uint32Array]'\n    );\n}\n\nfunction printNumber(val: number): string {\n    return Object.is(val, -0) ? '-0' : String(val);\n}\n\nfunction printBigInt(val: bigint): string {\n    return String(`${val}n`);\n}\n\nfunction printFunction(val: Function, printFunctionName: boolean): string {\n    if (!printFunctionName) {\n        return '[Function]';\n    }\n    return '[Function ' + (val.name || 'anonymous') + ']';\n}\n\nfunction printSymbol(val: symbol): string {\n    return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');\n}\n\nfunction printError(val: Error): string {\n    return '[' + errorToString.call(val) + ']';\n}\n\n/**\n * The first port of call for printing an object, handles most of the\n * data-types in JS.\n */\nfunction printBasicValue(val: any, printFunctionName: boolean, escapeRegex: boolean, escapeString: boolean): string | null {\n    if (val === true || val === false) {\n        return '' + val;\n    }\n    if (val === undefined) {\n        return 'undefined';\n    }\n    if (val === null) {\n        return 'null';\n    }\n\n    const typeOf = typeof val;\n\n    if (typeOf === 'number') {\n        return printNumber(val);\n    }\n    if (typeOf === 'bigint') {\n        return printBigInt(val);\n    }\n    if (typeOf === 'string') {\n        if (escapeString) {\n            return '\"' + val.replace(/\"|\\\\/g, '\\\\$&') + '\"';\n        }\n        return '\"' + val + '\"';\n    }\n    if (typeOf === 'function') {\n        return printFunction(val, printFunctionName);\n    }\n    if (typeOf === 'symbol') {\n        return printSymbol(val);\n    }\n\n    const toStringed = toString.call(val);\n\n    if (toStringed === '[object WeakMap]') {\n        return 'WeakMap {}';\n    }\n    if (toStringed === '[object WeakSet]') {\n        return 'WeakSet {}';\n    }\n    if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') {\n        return printFunction(val, printFunctionName);\n    }\n    if (toStringed === '[object Symbol]') {\n        return printSymbol(val);\n    }\n    if (toStringed === '[object Date]') {\n        return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);\n    }\n    if (toStringed === '[object Error]') {\n        return printError(val);\n    }\n    if (toStringed === '[object RegExp]') {\n        if (escapeRegex) {\n            // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js\n            return regExpToString.call(val).replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n        }\n        return regExpToString.call(val);\n    }\n\n    if (val instanceof Error) {\n        return printError(val);\n    }\n\n    return null;\n}\n\n/**\n * Handles more complex objects ( such as objects with circular references.\n * maps and sets etc )\n */\nfunction printComplexValue(val: any, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean): string {\n    if (refs.indexOf(val) !== -1) {\n        return '[Circular]';\n    }\n    refs = refs.slice();\n    refs.push(val);\n\n    const hitMaxDepth = ++depth > config.maxDepth;\n    const min = config.min;\n\n    if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {\n        return printer(val.toJSON(), config, indentation, depth, refs, true);\n    }\n\n    const toStringed = toString.call(val);\n    if (toStringed === '[object Arguments]') {\n        return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';\n    }\n    if (isToStringedArrayType(toStringed)) {\n        return hitMaxDepth\n            ? '[' + val.constructor.name + ']'\n            : (min ? '' : val.constructor.name + ' ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';\n    }\n    if (toStringed === '[object Map]') {\n        return hitMaxDepth ? '[Map]' : 'Map {' + printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';\n    }\n    if (toStringed === '[object Set]') {\n        return hitMaxDepth ? '[Set]' : 'Set {' + printIteratorValues(val.values(), config, indentation, depth, refs, printer) + '}';\n    }\n\n    // Avoid failure to serialize global window object in jsdom test environment.\n    // For example, not even relevant if window is prop of React element.\n    return hitMaxDepth || isWindow(val)\n        ? '[' + getConstructorName(val) + ']'\n        : (min ? '' : getConstructorName(val) + ' ') + '{' + printObjectProperties(val, config, indentation, depth, refs, printer) + '}';\n}\n\nfunction isNewPlugin(plugin: Plugin): plugin is NewPlugin {\n    return (plugin as NewPlugin).serialize != null;\n}\n\nfunction printPlugin(plugin: Plugin, val: any, config: Config, indentation: string, depth: number, refs: Refs): string {\n    let printed;\n\n    try {\n        printed = isNewPlugin(plugin)\n            ? plugin.serialize(val, config, indentation, depth, refs, printer)\n            : plugin.print(\n                  val,\n                  valChild => printer(valChild, config, indentation, depth, refs),\n                  str => {\n                      const indentationNext = indentation + config.indent;\n                      return indentationNext + str.replace(NEWLINE_REGEXP, '\\n' + indentationNext);\n                  },\n                  {\n                      edgeSpacing: config.spacingOuter,\n                      min: config.min,\n                      spacing: config.spacingInner,\n                  },\n                  config.colors,\n              );\n    } catch (error: any) {\n        throw new PrettyFormatPluginError(error.message, error.stack);\n    }\n    if (typeof printed !== 'string') {\n        throw new Error(`pretty-format: Plugin must return type \"string\" but instead returned \"${typeof printed}\".`);\n    }\n    return printed;\n}\n\nfunction findPlugin(plugins: Plugins, val: unknown) {\n    for (let p = 0; p < plugins.length; p++) {\n        try {\n            if (plugins[p].test(val)) {\n                return plugins[p];\n            }\n        } catch (error: any) {\n            throw new PrettyFormatPluginError(error.message, error.stack);\n        }\n    }\n\n    return null;\n}\n\nfunction printer(val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean): string {\n    const plugin = findPlugin(config.plugins, val);\n    if (plugin !== null) {\n        return printPlugin(plugin, val, config, indentation, depth, refs);\n    }\n\n    const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);\n    if (basicResult !== null) {\n        return basicResult;\n    }\n\n    return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);\n}\n\nconst DEFAULT_THEME: Theme = {\n    comment: 'gray',\n    content: 'reset',\n    prop: 'yellow',\n    tag: 'cyan',\n    value: 'green',\n};\n\nconst DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME) as Array<keyof typeof DEFAULT_THEME>;\n\nconst DEFAULT_OPTIONS: Options = {\n    callToJSON: true,\n    escapeRegex: false,\n    escapeString: true,\n    highlight: false,\n    indent: 2,\n    maxDepth: Infinity,\n    min: false,\n    plugins: [],\n    printFunctionName: true,\n    theme: DEFAULT_THEME,\n};\n\nfunction validateOptions(options: OptionsReceived) {\n    Object.keys(options).forEach(key => {\n        if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {\n            throw new Error(`pretty-format: Unknown option \"${key}\".`);\n        }\n    });\n\n    if (options.min && options.indent !== undefined && options.indent !== 0) {\n        throw new Error('pretty-format: Options \"min\" and \"indent\" cannot be used together.');\n    }\n\n    if (options.theme !== undefined) {\n        if (options.theme === null) {\n            throw new Error(`pretty-format: Option \"theme\" must not be null.`);\n        }\n\n        if (typeof options.theme !== 'object') {\n            throw new Error(`pretty-format: Option \"theme\" must be of type \"object\" but instead received \"${typeof options.theme}\".`);\n        }\n    }\n}\n\nconst getColorsHighlight = (options: OptionsReceived): Colors =>\n    DEFAULT_THEME_KEYS.reduce((colors, key) => {\n        const value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key];\n        const color = value && (style as any)[value];\n        if (color && typeof color.close === 'string' && typeof color.open === 'string') {\n            colors[key] = color;\n        } else {\n            throw new Error(`pretty-format: Option \"theme\" has a key \"${key}\" whose value \"${value}\" is undefined in ansi-styles.`);\n        }\n        return colors;\n    }, Object.create(null));\n\nconst getColorsEmpty = (): Colors =>\n    DEFAULT_THEME_KEYS.reduce((colors, key) => {\n        colors[key] = { close: '', open: '' };\n        return colors;\n    }, Object.create(null));\n\nconst getPrintFunctionName = (options?: OptionsReceived) =>\n    options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;\n\nconst getEscapeRegex = (options?: OptionsReceived) => (options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex);\n\nconst getEscapeString = (options?: OptionsReceived) =>\n    options && options.escapeString !== undefined ? options.escapeString : DEFAULT_OPTIONS.escapeString;\n\nconst getConfig = (options?: OptionsReceived): Config => ({\n    callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,\n    colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),\n    escapeRegex: getEscapeRegex(options),\n    escapeString: getEscapeString(options),\n    indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent),\n    maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,\n    min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,\n    plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins,\n    printFunctionName: getPrintFunctionName(options),\n    spacingInner: options && options.min ? ' ' : '\\n',\n    spacingOuter: options && options.min ? '' : '\\n',\n});\n\nfunction createIndent(indent: number): string {\n    return new Array(indent + 1).join(' ');\n}\n\n/**\n * Returns a presentation string of your `val` object\n * @param val any potential JavaScript object\n * @param options Custom settings\n */\nexport function format(val: unknown, options?: OptionsReceived): string {\n    if (options) {\n        validateOptions(options);\n        if (options.plugins) {\n            const plugin = findPlugin(options.plugins, val);\n            if (plugin !== null) {\n                return printPlugin(plugin, val, getConfig(options), '', 0, []);\n            }\n        }\n    }\n\n    const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));\n    if (basicResult !== null) {\n        return basicResult;\n    }\n\n    return printComplexValue(val, getConfig(options), '', 0, []);\n}\n\nexport const plugins = {\n    ConvertAnsi,\n    DOMCollection,\n    DOMElement,\n};\n\nexport default format;\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport type { Config, Printer, Refs } from './types';\n\nconst getKeysOfEnumerableProperties = (object: Record<string, unknown>) => {\n    const keys: Array<string | symbol> = Object.keys(object).sort();\n\n    if (Object.getOwnPropertySymbols) {\n        Object.getOwnPropertySymbols(object).forEach(symbol => {\n            if (Object.getOwnPropertyDescriptor(object, symbol)!.enumerable) {\n                keys.push(symbol);\n            }\n        });\n    }\n\n    return keys as Array<string>;\n};\n\n/**\n * Return entries (for example, of a map)\n * with spacing, indentation, and comma\n * without surrounding punctuation (for example, braces)\n */\nexport function printIteratorEntries(\n    iterator: Iterator<[unknown, unknown]>,\n    config: Config,\n    indentation: string,\n    depth: number,\n    refs: Refs,\n    printer: Printer,\n    // Too bad, so sad that separator for ECMAScript Map has been ' => '\n    // What a distracting diff if you change a data structure to/from\n    // ECMAScript Object or Immutable.Map/OrderedMap which use the default.\n    separator = ': ',\n): string {\n    let result = '';\n    let current = iterator.next();\n\n    if (!current.done) {\n        result += config.spacingOuter;\n\n        const indentationNext = indentation + config.indent;\n\n        while (!current.done) {\n            const name = printer(current.value[0], config, indentationNext, depth, refs);\n            const value = printer(current.value[1], config, indentationNext, depth, refs);\n\n            result += indentationNext + name + separator + value;\n\n            current = iterator.next();\n\n            if (!current.done) {\n                result += ',' + config.spacingInner;\n            } else if (!config.min) {\n                result += ',';\n            }\n        }\n\n        result += config.spacingOuter + indentation;\n    }\n\n    return result;\n}\n\n/**\n * Return values (for example, of a set)\n * with spacing, indentation, and comma\n * without surrounding punctuation (braces or brackets)\n */\nexport function printIteratorValues(\n    iterator: Iterator<unknown>,\n    config: Config,\n    indentation: string,\n    depth: number,\n    refs: Refs,\n    printer: Printer,\n): string {\n    let result = '';\n    let current = iterator.next();\n\n    if (!current.done) {\n        result += config.spacingOuter;\n\n        const indentationNext = indentation + config.indent;\n\n        while (!current.done) {\n            result += indentationNext + printer(current.value, config, indentationNext, depth, refs);\n\n            current = iterator.next();\n\n            if (!current.done) {\n                result += ',' + config.spacingInner;\n            } else if (!config.min) {\n                result += ',';\n            }\n        }\n\n        result += config.spacingOuter + indentation;\n    }\n\n    return result;\n}\n\n/**\n * Return items (for example, of an array)\n * with spacing, indentation, and comma\n * without surrounding punctuation (for example, brackets)\n **/\nexport function printListItems(list: ArrayLike<unknown>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string {\n    let result = '';\n\n    if (list.length) {\n        result += config.spacingOuter;\n\n        const indentationNext = indentation + config.indent;\n\n        for (let i = 0; i < list.length; i++) {\n            result += indentationNext + printer(list[i], config, indentationNext, depth, refs);\n\n            if (i < list.length - 1) {\n                result += ',' + config.spacingInner;\n            } else if (!config.min) {\n                result += ',';\n            }\n        }\n\n        result += config.spacingOuter + indentation;\n    }\n\n    return result;\n}\n\n/**\n * Return properties of an object\n * with spacing, indentation, and comma\n * without surrounding punctuation (for example, braces)\n */\nexport function printObjectProperties(\n    val: Record<string, unknown>,\n    config: Config,\n    indentation: string,\n    depth: number,\n    refs: Refs,\n    printer: Printer,\n): string {\n    let result = '';\n    const keys = getKeysOfEnumerableProperties(val);\n\n    if (keys.length) {\n        result += config.spacingOuter;\n\n        const indentationNext = indentation + config.indent;\n\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const name = printer(key, config, indentationNext, depth, refs);\n            const value = printer(val[key], config, indentationNext, depth, refs);\n\n            result += indentationNext + name + ': ' + value;\n\n            if (i < keys.length - 1) {\n                result += ',' + config.spacingInner;\n            } else if (!config.min) {\n                result += ',';\n            }\n        }\n\n        result += config.spacingOuter + indentation;\n    }\n\n    return result;\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport * as ansiRegexNs from 'ansi-regex';\nimport style from 'ansi-styles';\nimport type { Config, NewPlugin, Printer, Refs } from '../types';\n\nconst ansiRegex = ansiRegexNs.default;\n\nconst toHumanReadableAnsi = (text: string) =>\n    text.replace(ansiRegex(), match => {\n        switch (match) {\n            case style.red.close:\n            case style.green.close:\n            case style.cyan.close:\n            case style.gray.close:\n            case style.white.close:\n            case style.yellow.close:\n            case style.bgRed.close:\n            case style.bgGreen.close:\n            case style.bgYellow.close:\n            case style.inverse.close:\n            case style.dim.close:\n            case style.bold.close:\n            case style.reset.open:\n            case style.reset.close:\n                return '</>';\n            case style.red.open:\n                return '<red>';\n            case style.green.open:\n                return '<green>';\n            case style.cyan.open:\n                return '<cyan>';\n            case style.gray.open:\n                return '<gray>';\n            case style.white.open:\n                return '<white>';\n            case style.yellow.open:\n                return '<yellow>';\n            case style.bgRed.open:\n                return '<bgRed>';\n            case style.bgGreen.open:\n                return '<bgGreen>';\n            case style.bgYellow.open:\n                return '<bgYellow>';\n            case style.inverse.open:\n                return '<inverse>';\n            case style.dim.open:\n                return '<dim>';\n            case style.bold.open:\n                return '<bold>';\n            default:\n                return '';\n        }\n    });\n\nexport const test: NewPlugin['test'] = (val: unknown) => typeof val === 'string' && !!val.match(ansiRegex());\n\nexport const serialize: NewPlugin['serialize'] = (val: string, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) =>\n    printer(toHumanReadableAnsi(val), config, indentation, depth, refs);\n\nconst plugin: NewPlugin = { serialize, test };\n\nexport default plugin;\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable no-undef */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport { printListItems, printObjectProperties } from '../collections';\nimport type { Config, NewPlugin, Printer, Refs } from '../types';\n\nconst SPACE = ' ';\n\nconst OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap'];\nconst ARRAY_REGEXP = /^(HTML\\w*Collection|NodeList)$/;\n\nconst testName = (name: any) => OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);\n\nexport const test: NewPlugin['test'] = (val: object) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);\n\nconst isNamedNodeMap = (collection: object): collection is NamedNodeMap => collection.constructor.name === 'NamedNodeMap';\n\nexport const serialize: NewPlugin['serialize'] = (\n    collection: any | NamedNodeMap,\n    config: Config,\n    indentation: string,\n    depth: number,\n    refs: Refs,\n    printer: Printer,\n) => {\n    const name = collection.constructor.name;\n    if (++depth > config.maxDepth) {\n        return '[' + name + ']';\n    }\n\n    return (\n        (config.min ? '' : name + SPACE) +\n        (OBJECT_NAMES.indexOf(name) !== -1\n            ? '{' +\n              printObjectProperties(\n                  isNamedNodeMap(collection)\n                      ? Array.from(collection).reduce<Record<string, string>>((props, attribute) => {\n                            props[attribute.name] = attribute.value;\n                            return props;\n                        }, {})\n                      : { ...collection },\n                  config,\n                  indentation,\n                  depth,\n                  refs,\n                  printer,\n              ) +\n              '}'\n            : '[' + printListItems(Array.from(collection), config, indentation, depth, refs, printer) + ']')\n    );\n};\n\nconst plugin: NewPlugin = { serialize, test };\n\nexport default plugin;\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport default function escapeHTML(str: string): string {\n    return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { Config, Printer, Refs } from '../../types';\nimport escapeHTML from './escapeHTML';\n\n// Return empty string if keys is empty.\nexport const printProps = (\n    keys: Array<string>,\n    props: Record<string, unknown>,\n    config: Config,\n    indentation: string,\n    depth: number,\n    refs: Refs,\n    printer: Printer,\n): string => {\n    const indentationNext = indentation + config.indent;\n    const colors = config.colors;\n    return keys\n        .map(key => {\n            const value = props[key];\n            let printed = printer(value, config, indentationNext, depth, refs);\n\n            if (typeof value !== 'string') {\n                if (printed.indexOf('\\n') !== -1) {\n                    printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;\n                }\n                printed = '{' + printed + '}';\n            }\n\n            return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close;\n        })\n        .join('');\n};\n\n// Return empty string if children is empty.\nexport const printChildren = (children: Array<unknown>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string =>\n    children\n        .map(\n            child =>\n                config.spacingOuter +\n                indentation +\n                (typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs)),\n        )\n        .join('');\n\nexport const printText = (text: string, config: Config): string => {\n    const contentColor = config.colors.content;\n    return contentColor.open + escapeHTML(text) + contentColor.close;\n};\n\nexport const printComment = (comment: string, config: Config): string => {\n    const commentColor = config.colors.comment;\n    return commentColor.open + '<!--' + escapeHTML(comment) + '-->' + commentColor.close;\n};\n\n// Separate the functions to format props, children, and element,\n// so a plugin could override a particular function, if needed.\n// Too bad, so sad: the traditional (but unnecessary) space\n// in a self-closing tagColor requires a second test of printedProps.\nexport const printElement = (type: string, printedProps: string, printedChildren: string, config: Config, indentation: string): string => {\n    const tagColor = config.colors.tag;\n    return (\n        tagColor.open +\n        '<' +\n        type +\n        (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) +\n        (printedChildren\n            ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '</' + type\n            : (printedProps && !config.min ? '' : ' ') + '/') +\n        '>' +\n        tagColor.close\n    );\n};\n\nexport const printElementAsLeaf = (type: string, config: Config): string => {\n    const tagColor = config.colors.tag;\n    return tagColor.open + '<' + type + tagColor.close + ' …' + tagColor.open + ' />' + tagColor.close;\n};\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable no-undef */\n\nimport type { Config, NewPlugin, Printer, Refs } from '../types';\nimport { printChildren, printComment, printElement, printElementAsLeaf, printProps, printText } from './lib/markup';\n\nconst ELEMENT_NODE = 1;\nconst TEXT_NODE = 3;\nconst COMMENT_NODE = 8;\nconst FRAGMENT_NODE = 11;\n\nconst ELEMENT_REGEXP = /^((HTML|SVG)\\w*)?Element$/;\n\nconst testNode = (val: any) => {\n    const constructorName = val.constructor.name;\n    const { nodeType, tagName } = val;\n    const isCustomElement = (typeof tagName === 'string' && tagName.includes('-')) || (typeof val.hasAttribute === 'function' && val.hasAttribute('is'));\n\n    return (\n        (nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement)) ||\n        (nodeType === TEXT_NODE && constructorName === 'Text') ||\n        (nodeType === COMMENT_NODE && constructorName === 'Comment') ||\n        (nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')\n    );\n};\n\nexport const test: NewPlugin['test'] = (val: any) => val?.constructor?.name && testNode(val);\n\ntype HandledType = Element | Text | Comment | DocumentFragment;\n\nfunction nodeIsText(node: HandledType): node is Text {\n    return node.nodeType === TEXT_NODE;\n}\n\nfunction nodeIsComment(node: HandledType): node is Comment {\n    return node.nodeType === COMMENT_NODE;\n}\n\nfunction nodeIsFragment(node: HandledType): node is DocumentFragment {\n    return node.nodeType === FRAGMENT_NODE;\n}\n\nexport const serialize: NewPlugin['serialize'] = (node: HandledType, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => {\n    if (nodeIsText(node)) {\n        return printText(node.data, config);\n    }\n\n    if (nodeIsComment(node)) {\n        return printComment(node.data, config);\n    }\n\n    const type = nodeIsFragment(node) ? `DocumentFragment` : node.tagName.toLowerCase();\n\n    if (++depth > config.maxDepth) {\n        return printElementAsLeaf(type, config);\n    }\n\n    return printElement(\n        type,\n        printProps(\n            nodeIsFragment(node)\n                ? []\n                : Array.from(node.attributes)\n                      .map(attr => attr.name)\n                      .sort(),\n            nodeIsFragment(node)\n                ? {}\n                : Array.from(node.attributes).reduce<Record<string, string>>((props, attribute) => {\n                      props[attribute.name] = attribute.value;\n                      return props;\n                  }, {}),\n            config,\n            indentation + config.indent,\n            depth,\n            refs,\n            printer,\n        ),\n        printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer),\n        config,\n        indentation,\n    );\n};\n\nconst plugin: NewPlugin = { serialize, test };\n\nexport default plugin;\n"]}