{"version":3,"sources":["jsdelivr-header.js","/npm/cms-clone-deep@2.0.0/src/utils/clone-deep-error.js","/npm/cms-clone-deep@2.0.0/src/utils/constants.js","/npm/cms-clone-deep@2.0.0/src/utils/metadata.js","/npm/cms-clone-deep@2.0.0/src/utils/helpers.js","/npm/cms-clone-deep@2.0.0/src/utils/type-checking.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/misc.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/assign.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-additional-values.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-customizer.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-async-web-types.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-ecma-types.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-node-types.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-sync-web-types.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-tag.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/handle-cloning-method.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/get-tag.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/process-queue.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/process-pending-results.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-utils/global-state.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep-internal.js","/npm/cms-clone-deep@2.0.0/src/clone-deep/clone-deep.js","/npm/cms-clone-deep@2.0.0/src/clone-deep-fully/clone-deep-fully-internal.js","/npm/cms-clone-deep@2.0.0/src/clone-deep-fully/clone-deep-fully.js","/npm/cms-clone-deep@2.0.0/src/use-customizers.js","/npm/cms-clone-deep@2.0.0/index.js"],"names":[],"mappings":"AA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AI,OAAO,GAAW,SAClB,OAAO,CAEf,CACJ,CACJ,ECpBa,GAAiB,GACjB,GAAiB,GACjB,GAAsB,GACtB,GAAiB","file":"/npm/cms-clone-deep@2.0.0/index.js/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/cms-clone-deep@2.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\r\n * Used to log warnings.\r\n */\r\nclass CloneDeepError extends Error {\r\n    /**\r\n     * @param {string} message\r\n     * @param {ErrorOptions} [cause]\r\n     * @param {string} [stack]\r\n     */\r\n    constructor(message, cause, stack) {\r\n        super(message, cause);\r\n        this.name = CloneDeepError.name;\r\n        if (typeof stack === 'string') {\r\n            Object.defineProperty(this, 'stack', {\r\n                value: stack\r\n            });\r\n        }\r\n    }\r\n}\r\n\r\n/**\r\n * Creates a {@link CloneDeepError} instance.\r\n * @param {String} message The error message.\r\n * @param {ErrorOptions} [cause] If an object with a `cause` property, it will\r\n * add a cause to the error when logged.\r\n * @param {string} [stack] If provided, determines the stack associated with the\r\n * error object.\r\n * @returns {CloneDeepError}\r\n */\r\nexport const getError = (message, cause, stack) => {\r\n    return new CloneDeepError(message, cause, stack);\r\n};\r\n\r\n/**\r\n * Commonly-used {@link CloneDeepError} instances.\r\n */\r\nexport const CloneError = {\r\n    WEAKMAP: getError('Attempted to clone unsupported type WeakMap.'),\r\n    WEAKSET: getError('Attempted to clone unsupported type WeakSet.'),\r\n    IMPROPER_ADDITIONAL_VALUES: getError(\r\n        'The additionalValue property must be an array of objects. The ' +\r\n        'objects must have a `value` property and an `assigner` property ' +\r\n        'that is a function.'),\r\n    CUSTOMIZER_ASYNC_IN_SYNC_MODE: getError(\r\n        'Customizer attempted to asynchronously get the clone for an object, ' +\r\n        'but cloneDeep was not run in async mode.'),\r\n    ADDITIONAL_VALUES_ASYNC_IN_SYNC_MODE: getError(\r\n        'Customizer attempted to add additional values asynchronously, but ' +\r\n        'cloneDeep was not run in async mode.'),\r\n    CUSTOMIZER_IMPROPER_PROPS_TO_IGNORE: getError(\r\n        'return value of customizer is an object whose propsToIgnore ' +\r\n        'property, if not undefined, is expected to be an array of strings ' +\r\n        'or symbols. The given result is not this type of array so it will ' +\r\n        'have no effect.'),\r\n    CLONING_METHOD_ASYNC_IN_SYNC_MODE: getError(\r\n        'Cloning method attempted to asynchronously get the clone for an ' +\r\n        'object, but cloneDeep was not run in async mode.'),\r\n    CLONING_METHOD_IMPROPER_PROPS_TO_IGNORE: getError(\r\n        'return value of CLONE method is an object whose propsToIgnore ' +\r\n        'property, if not undefined, is expected to be an array of strings ' +\r\n        'or symbols. The given result is not this type of array so it will ' +\r\n        'have no effect.'),\r\n    UNSUPPORTED_TYPE: getError('Attempted to clone unsupported type.'),\r\n    IMPROPER_AGGREGATE_ERRORS: getError(\r\n        'Cloning AggregateError with non-iterable errors property. It will ' +\r\n        'be cloned into an AggregateError instance with an empty aggregation.'),\r\n    FILELIST_DISALLOWED: getError('Cannot create FileList in this runtime.'),\r\n    UNRECOGNIZED_TYPEARRAY_SUBCLASS: getError(\r\n        'Unrecognized TypedArray subclass. This object will be cloned into a ' +\r\n        'DataView instance.')\r\n};\r\n\r\n/** @type {import('../types').Log} */\r\nexport const defaultLog = {\r\n    info(error) {\r\n        console.log(error);\r\n    },\r\n    warn(error) {\r\n        console.warn(typeof error === 'object' ? error.message : error);\r\n    },\r\n    error(error) {\r\n        console.error(error);\r\n    }\r\n};\r\n","/** Used to create methods for cloning objects.*/\r\nexport const CLONE = Symbol('CLONE');\r\n\r\n/**\r\n * Contains the tag for various types.\r\n * @type {import('./types').Tag}\r\n */\r\nexport const Tag = Object.freeze({\r\n    // \"standard\" classes\r\n    ARGUMENTS: '[object Arguments]',\r\n    ARRAY: '[object Array]',\r\n    BIGINT: '[object BigInt]',\r\n    BOOLEAN: '[object Boolean]',\r\n    DATE: '[object Date]',\r\n    ERROR: '[object Error]',\r\n    FUNCTION: '[object Function]',\r\n    MAP: '[object Map]',\r\n    NUMBER: '[object Number]',\r\n    OBJECT: '[object Object]',\r\n    PROMISE: '[object Promise]',\r\n    REGEXP: '[object RegExp]',\r\n    SET: '[object Set]',\r\n    STRING: '[object String]',\r\n    SYMBOL: '[object Symbol]',\r\n    WEAKMAP: '[object WeakMap]',\r\n    WEAKSET: '[object WeakSet]',\r\n\r\n    // ArrayBuffer, DataView and TypedArrays\r\n    ARRAYBUFFER: '[object ArrayBuffer]',\r\n    DATAVIEW: '[object DataView]',\r\n    FLOAT32: '[object Float32Array]',\r\n    FLOAT64: '[object Float64Array]',\r\n    INT8: '[object Int8Array]',\r\n    INT16: '[object Int16Array]',\r\n    INT32: '[object Int32Array]',\r\n    UINT8: '[object Uint8Array]',\r\n    UINT8CLAMPED: '[object Uint8ClampedArray]',\r\n    UINT16: '[object Uint16Array]',\r\n    UINT32: '[object Uint32Array]',\r\n    BIGINT64: '[object BigInt64Array]',\r\n    BIGUINT64: '[object BigUint64Array]',\r\n\r\n    // Web APIs\r\n    AUDIODATA: '[object AudioData]',\r\n    BLOB: '[object Blob]',\r\n    DOMEXCEPTION: '[object DOMException]',\r\n    DOMMATRIX: '[object DOMMatrix]',\r\n    DOMMATRIXREADONLY: '[object DOMMatrixReadOnly]',\r\n    DOMPOINT: '[object DOMPoint]',\r\n    DOMPOINTREADONLY: '[object DOMPointReadOnly]',\r\n    DOMRECT: '[object DOMRect]',\r\n    DOMRECTREADONLY: '[object DOMRectReadOnly]',\r\n    DOMQUAD: '[object DOMQuad]',\r\n    FILE: '[object File]',\r\n    FILELIST: '[object FileList]',\r\n    IMAGEDATA: '[object ImageData]',\r\n    VIDEOFRAME: '[object VideoFrame]',\r\n\r\n    // Async Web APIs\r\n    IMAGEBITMAP: '[object ImageBitmap]',\r\n\r\n    // Node types\r\n    BUFFER: '[object Buffer]'\r\n});\r\n\r\nexport const Es6NativeTypes = Object.freeze({\r\n    ArrayBuffer: 'ArrayBuffer',\r\n    BigInt: 'BigInt',\r\n    Map: 'Map',\r\n    Promise: 'Promise',\r\n    Set: 'Set',\r\n    Symbol: 'Symbol',\r\n    DataView: 'DataView',\r\n    Float32Array: 'Float32Array',\r\n    Float64Array: 'Float64Array',\r\n    Int8Array: 'Int8Array',\r\n    Int16Array: 'Int16Array',\r\n    Int32Array: 'Int32Array',\r\n    Uint8Array: 'Uint8Array',\r\n    Uint8ClampedArray: 'Uint8ClampedArray',\r\n    Uint16Array: 'Uint16Array',\r\n    Uint32Array: 'Uint32Array',\r\n    BigInt64Array: 'BigInt64Array',\r\n    BigUint64Array: 'BigUint64Array'\r\n});\r\n\r\nexport const WebApis = Object.freeze({\r\n    AudioData: 'AudioData',\r\n    Blob: 'Blob',\r\n    DOMException: 'DOMException',\r\n    DOMMatrix: 'DOMMatrix',\r\n    DOMMatrixReadOnly: 'DOMMatrixReadOnly',\r\n    DOMPoint: 'DOMPoint',\r\n    DOMPointReadOnly: 'DOMPointReadOnly',\r\n    DOMQuad: 'DOMQuad',\r\n    DOMRect: 'DOMRect',\r\n    DOMRectReadOnly: 'DOMRectReadOnly',\r\n    File: 'File',\r\n    FileList: 'FileList',\r\n    ImageBitmap: 'ImageBitmap',\r\n    ImageData: 'ImageData',\r\n    VideoFrame: 'VideoFrame'\r\n});\r\n\r\nexport const NodeTypes = Object.freeze({\r\n    Buffer: 'Buffer'\r\n});\r\n\r\n/** All prototypes of supported types. */\r\nexport const supportedPrototypes = Object.freeze([\r\n    Array.prototype,\r\n    Boolean.prototype,\r\n    Date.prototype,\r\n    Error.prototype,\r\n    Function.prototype,\r\n    Number.prototype,\r\n    Object.prototype,\r\n    RegExp.prototype,\r\n    String.prototype\r\n]);\r\n","/**\r\n * Gets the prototype of the provided object.\r\n * @param {any} value\r\n * @returns {any}\r\n */\r\nexport const getPrototype = (value) => {\r\n    return Object.getPrototypeOf(value);\r\n};\r\n\r\n/**\r\n * Retrieves the property descriptors of the provided object.\r\n * The result is a hash which maps properties to their property descriptor.\r\n * @param {any} value\r\n * @returns {{ [property: string|symbol]: PropertyDescriptor }}\r\n */\r\nexport const getDescriptors = (value) => {\r\n    return Object.getOwnPropertyDescriptors(value);\r\n};\r\n\r\n/**\r\n * Whether the provided property descriptor is the default value.\r\n * @param {PropertyDescriptor} [descriptor]\r\n * @returns {boolean}\r\n */\r\nexport const isDefaultDescriptor = (descriptor) => {\r\n    return typeof descriptor === 'object'\r\n           && descriptor.configurable === true\r\n           && descriptor.enumerable === true\r\n           && descriptor.writable === true;\r\n};\r\n\r\n/**\r\n * Whether the property descriptor is for a property with getter and/or setter.\r\n * @param {PropertyDescriptor} [metadata]\r\n * @returns {boolean}\r\n */\r\nexport const hasAccessor = (metadata) => {\r\n    return typeof metadata === 'object'\r\n           && (typeof metadata.get === 'function'\r\n               || typeof metadata.set === 'function');\r\n};\r\n\r\n/**\r\n * Returns an array of all properties in the object.\r\n * This includes symbols and non-enumerable properties. `undefined` or `null`\r\n * returns an empty array.\r\n * @param {Object} object An object.\r\n * @returns {(string|symbol)[]} An array of property names.\r\n */\r\nexport const getAllPropertiesOf = (object) => {\r\n    return [\r\n        Object.getOwnPropertyNames(object),\r\n        Object.getOwnPropertySymbols(object)\r\n    ].flat();\r\n};\r\n\r\n/**\r\n * Is true if the provided object has methods. Is false otherwise.\r\n * @param {any} object An object\r\n * @returns {Boolean}\r\n */\r\nexport const hasMethods = (object) => {\r\n    // We cannot access some properties of Function.prototype in strict mode\r\n    if (object === Function.prototype) {\r\n        return true;\r\n    }\r\n    return getAllPropertiesOf(object).some((key) => {\r\n        return typeof object[key] === 'function';\r\n    });\r\n};\r\n\r\n/**\r\n * Iterate the provided callback on every owned property of the given object.\r\n * This includes symbols and non-enumerable properties but not properties from\r\n * the prototype chain.\r\n * This is more performant than using {@link getAllPropertiesOf}.\r\n * @param {any} object\r\n * @param {(key: string|symbol) => void} propertyCallback\r\n */\r\nexport const forAllOwnProperties = (object, propertyCallback) => {\r\n    [Object.getOwnPropertyNames(object), Object.getOwnPropertySymbols(object)]\r\n        .forEach((array) => {\r\n            array.forEach(propertyCallback);\r\n        });\r\n};\r\n","import {\r\n    supportedPrototypes,\r\n    Es6NativeTypes,\r\n    Tag,\r\n    WebApis,\r\n    NodeTypes\r\n} from './constants.js';\r\nimport { getError, CloneError } from './clone-deep-error.js';\r\nimport { isCallable } from './type-checking.js';\r\nimport { getPrototype } from './metadata.js';\r\n\r\n/**\r\n * Gets the appropriate TypedArray constructor for the given object tag.\r\n * @param {string} tag\r\n * The tag for the object.\r\n * @param {import('../types').Log} log\r\n * A logging function.\r\n * @returns {import('./types').TypedArrayConstructor}\r\n */\r\nexport const getTypedArrayConstructor = (tag, log) => {\r\n    switch (tag) {\r\n    case Tag.DATAVIEW:\r\n        return DataView;\r\n    case Tag.FLOAT32:\r\n        return Float32Array;\r\n    case Tag.FLOAT64:\r\n        return Float64Array;\r\n    case Tag.INT8:\r\n        return Int8Array;\r\n    case Tag.INT16:\r\n        return Int16Array;\r\n    case Tag.INT32:\r\n        return Int32Array;\r\n    case Tag.UINT8:\r\n        return Uint8Array;\r\n    case Tag.UINT8CLAMPED:\r\n        return Uint8ClampedArray;\r\n    case Tag.UINT16:\r\n        return Uint16Array;\r\n    case Tag.UINT32:\r\n        return Uint32Array;\r\n    case Tag.BIGINT64:\r\n        return BigInt64Array;\r\n    case Tag.BIGUINT64:\r\n        return BigUint64Array;\r\n    default:\r\n        log.warn(CloneError.UNRECOGNIZED_TYPEARRAY_SUBCLASS);\r\n        return DataView;\r\n    }\r\n};\r\n\r\n/**\r\n * Gets the appropriate error constructor for the error name.\r\n * @param {Error} value\r\n * The object itself. This is necessary to correctly find constructors for\r\n * various Error subclasses.\r\n * @param {import('../types').Log} [log]\r\n * An optional logging function.\r\n * @returns {import('./types').AtomicErrorConstructor}\r\n */\r\nexport const getAtomicErrorConstructor = (value, log) => {\r\n    const { name } = value;\r\n    switch (name) {\r\n    case 'Error':\r\n        return Error;\r\n    case 'EvalError':\r\n        return EvalError;\r\n    case 'RangeError':\r\n        return RangeError;\r\n    case 'ReferenceError':\r\n        return ReferenceError;\r\n    case 'SyntaxError':\r\n        return SyntaxError;\r\n    case 'TypeError':\r\n        return TypeError;\r\n    case 'URIError':\r\n        return URIError;\r\n    default:\r\n        if (log !== undefined) {\r\n            log.warn(getError('Cloning error with unrecognized name ' +\r\n                              `${name}! It will be cloned into an ` +\r\n                              'ordinary Error object.'));\r\n        }\r\n        return Error;\r\n    }\r\n};\r\n\r\n/**\r\n * Creates a FileList.\r\n * See https://github.com/fisker/create-file-list.\r\n * @param  {...File} files\r\n * @returns {FileList|undefined}\r\n */\r\nexport const createFileList = (...files) => {\r\n    const getDataTransfer = () => {\r\n        try {\r\n            return new DataTransfer();\r\n        } catch {\r\n            return new ClipboardEvent('').clipboardData;\r\n        }\r\n    };\r\n\r\n    let dataTransfer;\r\n\r\n    try {\r\n        dataTransfer = getDataTransfer();\r\n    } catch {\r\n        throw CloneError.FILELIST_DISALLOWED;\r\n    }\r\n\r\n    for (const file of files) {\r\n        dataTransfer?.items.add(file);\r\n    }\r\n\r\n    return dataTransfer?.files;\r\n};\r\n\r\n/**\r\n * Returns a deep clone of the given File.\r\n * @param {File} file\r\n * @returns {File}\r\n */\r\nexport const cloneFile = (file) => {\r\n    return new File([file], file.name, {\r\n        type: file.type,\r\n        lastModified: file.lastModified\r\n    });\r\n};\r\n\r\n\r\n/** @type {any} */\r\nconst __global = globalThis;\r\n\r\n/** @type {{ [key: string]: new (...args: any[]) => any | undefined }} */\r\nconst global = __global;\r\n\r\n/** @typedef {new (...args: any[]) => any} Constructor */\r\n\r\n/**\r\n * Attempts to retreive a web API from the global object.\r\n * Doing this in a way that utilizes TypeScript effectively is obtuse, hence\r\n * this function was made so that TypeScript jank doesn't obfuscate code\r\n * elsewhere.\r\n * @param {string} string\r\n * @returns {Constructor | undefined}\r\n */\r\nexport const getConstructorFromString = (string) => {\r\n    return global[string];\r\n};\r\n\r\n/**\r\n * Returns an array of prototypes of available supported types for this runtime.\r\n * @returns {any[]}\r\n */\r\nexport const getSupportedPrototypes = () => {\r\n    /** @type {object[]} */\r\n    const additionalPrototypes = [];\r\n\r\n    Object.keys(WebApis).forEach((webApiString) => {\r\n        const PotentialWebApi = getConstructorFromString(webApiString);\r\n\r\n        if (PotentialWebApi !== undefined && isCallable(PotentialWebApi)) {\r\n            additionalPrototypes.push(PotentialWebApi.prototype);\r\n        }\r\n    });\r\n\r\n    Object.keys(Es6NativeTypes).forEach((typeArrayString) => {\r\n        const PotentialArray = getConstructorFromString(typeArrayString);\r\n\r\n        if (PotentialArray !== undefined && isCallable(PotentialArray)) {\r\n            additionalPrototypes.push(PotentialArray.prototype);\r\n        }\r\n    });\r\n\r\n    Object.keys(NodeTypes).forEach((typeArrayString) => {\r\n        const PotentialArray = getConstructorFromString(typeArrayString);\r\n\r\n        if (PotentialArray !== undefined && isCallable(PotentialArray)) {\r\n            additionalPrototypes.push(PotentialArray.prototype);\r\n        }\r\n    });\r\n\r\n    return supportedPrototypes.concat(additionalPrototypes);\r\n};\r\n\r\n/**\r\n * Returns an object containing all constructors in this runtime.\r\n * The object maps names of a constructor ('Array', 'Map', 'AudioData') to the\r\n * constructor itself, or `undefined` if the constructor is not available in\r\n * this runtime.\r\n * @returns {Readonly<{ [key: string]: Constructor | undefined }>}\r\n */\r\nexport const getSupportedConstructors = () => {\r\n    /** @type {{ [key: string]: Constructor | undefined }} */\r\n    const result = {};\r\n    Object.values(Tag).forEach((tag) => {\r\n        const name = tag.substring(8, tag.length - 1);\r\n        result[name] = getConstructorFromString(name);\r\n    });\r\n    return Object.freeze(result);\r\n};\r\n\r\n/**\r\n * @template T\r\n * Returns the provided value as an \"instance\" of the given \"class\".\r\n * Where a \"class\" is a constructor function, and being an instance means having\r\n * the prototype of the constructor function in the prototype chain.\r\n * If the provided value is not a suitable instance of the class, then the\r\n * function returns `undefined`.\r\n * @param {any} value\r\n * @param {T extends new (...args: any[]) => any ? T : never} constructor\r\n * @returns {undefined | ReturnType<T>}\r\n */\r\nexport const castAsInstanceOf = (value, constructor) => {\r\n    if (!isCallable(constructor)) {\r\n        return;\r\n    }\r\n    let tempPrototype = getPrototype(value);\r\n    while (tempPrototype !== null) {\r\n        if (tempPrototype === constructor.prototype) {\r\n            return value;\r\n        }\r\n        tempPrototype = getPrototype(tempPrototype);\r\n    }\r\n    return;\r\n};\r\n","import { Tag, WebApis } from './constants.js';\r\nimport { castAsInstanceOf, getConstructorFromString } from './helpers.js';\r\nimport { getDescriptors, getPrototype } from './metadata.js';\r\n\r\nconst { toString } = Object.prototype;\r\n\r\n/**\r\n * Gets the tag using `Object.prototype.toString`.\r\n * Since we cache the lookup for `Object.prototype.toString` in the\r\n * implementation of this function, this is slightly more performant than\r\n * calling `Object.prototype.toString.call` explicitly.\r\n * @param {any} value\r\n * @returns {string}\r\n */\r\nexport const toStringTag = (value) => {\r\n    return toString.call(value);\r\n};\r\n\r\n/**\r\n * Determines whether a particular property is read-only.\r\n * @param {any} value\r\n * Any object.\r\n * @param {string|symbol} property\r\n * The property on the object whose mutability will be checked.\r\n * A function which modifies the value assigned to that property.\r\n */\r\nexport const isReadOnly = (value, property) => {\r\n    try {\r\n        const original = value[property];\r\n        value[property] = value[property] + 1;\r\n        const final = value[property];\r\n\r\n        value[property] = original;\r\n        return final !== original + 1;\r\n    } catch {\r\n        // The web specification does not determine whether an implementation\r\n        // should throw if reassignment of a readonly property of a web api\r\n        // is performed; hence we use a try-catch to catch runtimes which will\r\n        // throw.\r\n        return true;\r\n    }\r\n};\r\n\r\n/**\r\n * Whether the provided value can be called as a function.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isCallable = (value) => {\r\n    return typeof value === 'function';\r\n};\r\n\r\n/**\r\n * A factory which creates type checkers for readonly geometry (sub)classes.\r\n * @param {string} webApiString\r\n * The name of an immutable geometry subclass.\r\n * @param {string|symbol|{ name: string|symbol }} methodOrProp\r\n * If a primitive, then the name of a method on the immutable geometry subclass.\r\n * If an object, it should be a hash with a single property `\"name\"` that\r\n * refers to a non-method property on the instance.\r\n * @param {string|symbol} property\r\n * An instance property.\r\n * @returns {{ [method: string]: (value: any) => boolean }}\r\n */\r\nexport const getGeometryCheckers = (webApiString, methodOrProp, property) => {\r\n\r\n    /** @type {Map<any, boolean>} */\r\n    const registry = new Map();\r\n\r\n    /**\r\n     * @param {any} value\r\n     * @returns {boolean}\r\n     */\r\n    const isSubclass = (value) => {\r\n        const PotentialWebApi = getConstructorFromString(webApiString);\r\n        if (typeof PotentialWebApi !== 'function') {\r\n            return false;\r\n        }\r\n\r\n        if (registry.has(value)) {\r\n            const result = registry.get(value);\r\n            if (typeof result === 'boolean') {\r\n                return result;\r\n            }\r\n        }\r\n\r\n        const descriptors = getDescriptors(getPrototype(new PotentialWebApi()));\r\n\r\n        /** @type {boolean} */\r\n        let result;\r\n\r\n        try {\r\n            if (typeof methodOrProp === 'object') {\r\n                descriptors[methodOrProp.name].get?.call(value);\r\n            } else {\r\n                PotentialWebApi?.prototype[methodOrProp].call(value);\r\n            }\r\n            result = true;\r\n        } catch {\r\n            result = false;\r\n        }\r\n\r\n        registry.set(value, result);\r\n        return result;\r\n    };\r\n\r\n    /** @type {(value?: any) => boolean} */\r\n    const isMutable = typeof methodOrProp === 'object'\r\n        ? (value) => {\r\n            return !isReadOnly(value, methodOrProp.name);\r\n        }\r\n        : (value) => {\r\n            return !isReadOnly(value, property);\r\n        };\r\n\r\n\r\n    /** @type {(value: any) => boolean} */\r\n    const isImmutableType = (value) => {\r\n        return isSubclass(value) && !isMutable(value);\r\n    };\r\n\r\n    /** @type {(value: any) => boolean} */\r\n    const isMutableType = (value) => {\r\n        return isSubclass(value) && isMutable(value);\r\n    };\r\n\r\n    const immutableClassName = webApiString;\r\n    const mutableClassName = webApiString.substring(0, webApiString.length - 8);\r\n\r\n    return {\r\n        [`is${immutableClassName}`]: isImmutableType,\r\n        [`is${mutableClassName}`]: isMutableType\r\n    };\r\n};\r\n\r\nexport const {\r\n    isDOMMatrixReadOnly,\r\n    isDOMMatrix\r\n} = getGeometryCheckers(WebApis.DOMMatrixReadOnly, 'scale', 'm11');\r\n\r\nexport const {\r\n    isDOMPointReadOnly,\r\n    isDOMPoint\r\n} = getGeometryCheckers(WebApis.DOMPointReadOnly, 'toJSON', 'x');\r\n\r\nexport const {\r\n    isDOMRectReadOnly,\r\n    isDOMRect\r\n} = getGeometryCheckers(WebApis.DOMRectReadOnly, { name: 'x' }, 'x');\r\n\r\n/**\r\n * Returns `true` if the given value is a File instance, `false` otherwise.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isFile = (value) => {\r\n    try {\r\n        getDescriptors(File.prototype).lastModified.get?.call(value);\r\n        return true;\r\n    } catch {\r\n        return false;\r\n    }\r\n};\r\n\r\n/**\r\n * Returns `true` if the given value is an ImageBitmap, `false` otherwise.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isImageBitmap = (value) => {\r\n    try {\r\n        getDescriptors(ImageBitmap.prototype).height.get?.call(value);\r\n        return true;\r\n    } catch {\r\n        return false;\r\n    }\r\n};\r\n\r\n/**\r\n * Returns `true` if the given value is an ImageBitmap, `false` otherwise.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isImageData = (value) => {\r\n    try {\r\n        getDescriptors(ImageData.prototype).width.get?.call(value);\r\n        return true;\r\n    } catch {\r\n        return false;\r\n    }\r\n};\r\n\r\n/**\r\n * Returns `true` if the given value is a DOMException, `false` otherwise.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isDOMException = (value) => {\r\n    try {\r\n        const domException = castAsInstanceOf(value, DOMException);\r\n        if (!domException) {\r\n            return false;\r\n        }\r\n        getDescriptors(DOMException.prototype).code.get?.call(domException);\r\n        return true;\r\n    } catch {\r\n        return false;\r\n    }\r\n};\r\n\r\n/**\r\n * Whether the provided value is iterable.\r\n * See https://stackoverflow.com/a/32538867/22334683.\r\n * @param {any} value\r\n * The value whose iterability will be checked.\r\n * @returns {boolean}\r\n */\r\nexport const isIterable = (value) => {\r\n    if (value === null || value === undefined) {\r\n        return false;\r\n    }\r\n    return typeof value[Symbol.iterator] === 'function';\r\n};\r\n\r\nconst typedArrayTags = Object.freeze([\r\n    Tag.FLOAT32,\r\n    Tag.FLOAT64,\r\n    Tag.INT8,\r\n    Tag.INT16,\r\n    Tag.INT32,\r\n    Tag.UINT8,\r\n    Tag.UINT8CLAMPED,\r\n    Tag.UINT16,\r\n    Tag.UINT32,\r\n    Tag.BIGINT64,\r\n    Tag.BIGUINT64\r\n]);\r\n\r\n/**\r\n * Returns `true` if given value is a TypedArray instance, `false` otherwise.\r\n * @param {string} value\r\n * Any arbitrary value\r\n * @param {string} tag\r\n * The tag for the value.\r\n * @param {import('../clone-deep/clone-deep-utils/types').PerformanceConfig} [performanceConfig]\r\n * Whether type-checking should be done performantly.\r\n * @returns {boolean}\r\n */\r\nexport const isTypedArray = (value, tag, performanceConfig) => {\r\n    if (performanceConfig?.robustTypeChecking !== true) {\r\n        return typedArrayTags.includes(tag);\r\n    }\r\n\r\n    try {\r\n        getPrototype(getPrototype(\r\n            new Float32Array(new ArrayBuffer(0))))?.lastIndexOf.call(value);\r\n        return true;\r\n    } catch {\r\n        return false;\r\n    }\r\n};\r\n\r\n/**\r\n * Returns `true` if given value is a Buffer instance, `false` otherwise.\r\n * @param {any} value\r\n * @param {{ [key: string]: (new (...args: any[]) => any)|undefined}} supportedConstructors\r\n * @returns {boolean}\r\n */\r\nexport const isBuffer = (value, supportedConstructors) => {\r\n    const NodeBuffer = supportedConstructors['Buffer'];\r\n    return NodeBuffer !== undefined && value instanceof NodeBuffer;\r\n};\r\n\r\n/**\r\n * Returns true if the provided value is an object, false otherwise.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isObject = (value) => {\r\n    return value !== null && ['object', 'function'].includes(typeof value);\r\n};\r\n\r\n/**\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nconst isStringOrSymbol = (value) => {\r\n    return ['string', 'symbol'].includes(typeof value);\r\n};\r\n\r\n/**\r\n * Returns true if the provided value is an array of strings or symbols.\r\n * @param {any} value\r\n * @returns {boolean}\r\n */\r\nexport const isPropertyKeyArray = (value) => {\r\n    if (!Array.isArray(value)) {\r\n        return false;\r\n    }\r\n    return value.every(isStringOrSymbol);\r\n};\r\n","import { getError } from '../../utils/clone-deep-error.js';\r\nimport {\r\n    forAllOwnProperties,\r\n    getPrototype,\r\n    hasAccessor\r\n} from '../../utils/metadata.js';\r\nimport { castAsInstanceOf } from '../../utils/helpers.js';\r\nimport { isObject } from '../../utils/type-checking.js';\r\n\r\n/**\r\n * Checks the clone store to see if we the given value was already cloned.\r\n * This is used to avoid infinite loops on objects with circular references.\r\n * This may have a side effect of saving the clone to a persistent place.\r\n * @param {any} value\r\n * The value to check.\r\n * @param {Map<any, any>} cloneStore\r\n * The clone store.\r\n * @param {(clone: any) => any} saveClone\r\n * Handles saving the provided clone to a persistent place.\r\n * @returns {boolean}\r\n * Whether the store contained a clone for this value.\r\n */\r\nexport const checkCloneStore = (value, cloneStore, saveClone) => {\r\n    if (cloneStore.has(value)) {\r\n        saveClone(cloneStore.get(value));\r\n        return true;\r\n    }\r\n    return false;\r\n};\r\n\r\n/**\r\n * Checks if a cloned parent object is an \"instance\" of the provided value.\r\n * We say \"instance\" to say that the constructor for the cloned object used the\r\n * value as its prototype.\r\n * @param {any} value\r\n * The value to check.\r\n * @param {Set<any>|undefined} registry\r\n * The \"parent object registry\" used internally by cloneDeepFully. A \"parent\r\n * object\" is a top-level object that was cloned. For example, if we have:\r\n *\r\n * ```\r\n * const protoChild = {};\r\n * const protoParent = { protoChild };\r\n *\r\n * const childObject = {};\r\n * const parentObject = Object.create(protoParent);\r\n * parent.childObject = childObject;\r\n *\r\n * const cloned = cloneDeepFully(parentObject);\r\n * ```\r\n *\r\n * `parentObject` and `protoParent` would be \"parent objects\" stored in the\r\n * parent object registry.\r\n * @returns {boolean}\r\n * Whether registered parent object is an instance of the given value.\r\n */\r\nexport const checkParentObjectRegistry = (value, registry) => {\r\n    let ignoreCloningMethodsThisLoop = false;\r\n\r\n    if (registry !== undefined) {\r\n        [...registry].some((object) => {\r\n            if (value === object?.constructor?.prototype) {\r\n                ignoreCloningMethodsThisLoop = true;\r\n                return true;\r\n            }\r\n            return false;\r\n        });\r\n    }\r\n\r\n    return ignoreCloningMethodsThisLoop;\r\n};\r\n\r\n/**\r\n * If an error occurs when handling supported types, it will be handled here.\r\n * This will have a side effect of storing an empty object in the place where\r\n * a successful clone should have gone.\r\n * @param {unknown} thrown\r\n * The error thrown.\r\n * @param {import('../../types').Log} log\r\n * A logger.\r\n * @param {(clone: any) => any} saveClone\r\n * Handles saving the provided clone to a persistent place.\r\n * @returns {{ cloned: any, ignoreProto: boolean }}\r\n * An object containing the dummy clone value that was saved and a boolean\r\n * property indicating that the prototype for the dummy clone value should not\r\n * be checked.\r\n */\r\nexport const handleError = (thrown, log, saveClone) => {\r\n    const msg = 'Encountered error while attempting to clone specific value. ' +\r\n                'The value will be \"cloned\" into an empty object. Error ' +\r\n                'encountered:';\r\n\r\n    const error = castAsInstanceOf(thrown, Error);\r\n\r\n    if (error) {\r\n        error.message = `${msg} ${error.message}`;\r\n        const cause = error.cause ? { cause: error.cause } : undefined;\r\n        const stack = error.stack ? error.stack : undefined;\r\n        log.error(getError(error.message, cause, stack));\r\n    } else {\r\n        log.error(getError(msg, { cause: thrown }));\r\n    }\r\n\r\n    return {\r\n        cloned: saveClone({}),\r\n        ignoreProto: true\r\n    };\r\n};\r\n\r\n/**\r\n * Error handler used for customizers or cloning methods.\r\n * This method always returns the value `false`, in case you would like to flag\r\n * that an error was thrown.\r\n * @param {Object} spec\r\n * @param {import('../../types').Log} spec.log\r\n * The logger.\r\n * @param {unknown} spec.error\r\n * The error thrown by the customizer/cloning method.\r\n * @param {boolean} [spec.doThrow]\r\n * Whether errors thrown by customizers/cloning methods should be thrown by\r\n * the algorithm.\r\n * @param {string} spec.name\r\n * Either 'Customizer' or 'Cloning method'.\r\n * @returns {boolean}\r\n */\r\nexport const handleCustomError = ({\r\n    log,\r\n    error: thrown,\r\n    doThrow,\r\n    name\r\n}) => {\r\n    if (doThrow === true) {\r\n        throw thrown;\r\n    }\r\n\r\n    const msg = `${name} encountered error. Its results will be ignored for ` +\r\n                'the current value and the algorithm will proceed with ' +\r\n                'default behavior. ';\r\n\r\n    const error = castAsInstanceOf(thrown, Error);\r\n\r\n    if (error) {\r\n        error.message = `${msg}Error encountered: ${error.message}`;\r\n\r\n        const cause = error.cause\r\n            ? { cause: error.cause }\r\n            : undefined;\r\n\r\n        const stack = error.stack ? error.stack : undefined;\r\n        log.error(getError(error.message, cause, stack));\r\n    } else {\r\n        log.error(getError(msg, { cause: error }));\r\n    }\r\n\r\n    return false;\r\n};\r\n\r\n/**\r\n * Performs last-minute pruning of the cloned value.\r\n * This function stores the cloned value in the clone store, check that\r\n * prototype is the same as the original value, and adds properties of the\r\n * original value to the queue.\r\n * @param {Object} spec\r\n * @param {any} spec.value\r\n * The value that was cloned.\r\n * @param {any} spec.cloned\r\n * The clone of `value`.\r\n * @param {boolean} spec.cloneIsCached\r\n * Whether the clone was acquired from the clone store.\r\n * @param {boolean|undefined} spec.ignoreProto\r\n * If tre, the algorithm will not ensure that `value` and `clone` share\r\n * prototypes.\r\n * @param {boolean|undefined} spec.ignoreProps\r\n * If true, the algorithm will not add additional values from the properties of\r\n * `value` to the queue.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * A list of properties under this value that should not be cloned.\r\n * @param {boolean} spec.useCloningMethod\r\n * Whether cloning methods will be observed.\r\n * @param {Map<any, any>} spec.cloneStore\r\n * A store of previously cloned values, used to resolve circular references.\r\n * @param {import('../../types').QueueItem[]} spec.queue\r\n * The queue storing all values to clone.\r\n * @param {boolean} [spec.asyncResult]\r\n * Whether the clone of this value was acquired asynchronously.\r\n */\r\nexport const finalizeClone = ({\r\n    value,\r\n    cloned,\r\n    cloneIsCached,\r\n    ignoreProto,\r\n    ignoreProps,\r\n    propsToIgnore,\r\n    cloneStore,\r\n    queue,\r\n    asyncResult\r\n}) => {\r\n    if (!isObject(cloned) || cloneIsCached || asyncResult) {\r\n        return;\r\n    }\r\n\r\n    cloneStore.set(value, cloned);\r\n\r\n    if (!ignoreProto && getPrototype(cloned) !== getPrototype(value)) {\r\n        Object.setPrototypeOf(cloned, getPrototype(value));\r\n    }\r\n\r\n    if (!ignoreProps && isObject(value)) {\r\n        forAllOwnProperties(value, (key) => {\r\n            if (propsToIgnore.includes(key)) {\r\n                return;\r\n            }\r\n\r\n            const meta = Object.getOwnPropertyDescriptor(value, key);\r\n\r\n            queue.push({\r\n                value: !hasAccessor(meta) ? value[key] : undefined,\r\n                parentOrAssigner: cloned,\r\n                prop: key,\r\n                metadata: meta\r\n            });\r\n        });\r\n    }\r\n};\r\n\r\n/**\r\n * Ensures each clone has the correct extensibility/sealedness/frozenness.\r\n * @param {[any, any][]} isExtensibleSealFrozen\r\n */\r\nexport const handleMetadata = (isExtensibleSealFrozen) => {\r\n    isExtensibleSealFrozen.forEach(([value, cloned]) => {\r\n        if (!Object.isExtensible(value)) {\r\n            Object.preventExtensions(cloned);\r\n        }\r\n        if (Object.isSealed(value)) {\r\n            Object.seal(cloned);\r\n        }\r\n        if (Object.isFrozen(value)) {\r\n            Object.freeze(cloned);\r\n        }\r\n    });\r\n};\r\n","import { getError } from '../../utils/clone-deep-error.js';\r\nimport { hasAccessor, isDefaultDescriptor } from '../../utils/metadata.js';\r\n\r\n/**\r\n * This symbol is used to indicate that the cloned value is the top-level object\r\n * that will be returned by {@link cloneDeepInternal}.\r\n * @type {symbol}\r\n */\r\nexport const TOP_LEVEL = Symbol('TOP_LEVEL');\r\n\r\n/**\r\n * Handles the task of assigning a cloned result using a property descriptor.\r\n * @template [T=any]\r\n * The type of the cloned value.\r\n * @param {Object} spec\r\n * @param {import('../../types').Log} spec.log\r\n * A logger.\r\n * @param {T} spec.cloned\r\n * The resultant cloned value.\r\n * @param {object} spec.parent\r\n * The object that will have a property assigned the cloned value.\r\n * @param {PropertyKey} spec.prop\r\n * The property of the parent object that will hold the cloned value.\r\n * @param {PropertyDescriptor} spec.metadata\r\n * The property descriptor.\r\n */\r\nconst handleMetadata = ({ log, cloned, parent, prop, metadata }) => {\r\n    /** @type {PropertyDescriptor} */\r\n    const clonedMetadata = {\r\n        configurable: metadata.configurable,\r\n        enumerable: metadata.enumerable\r\n    };\r\n\r\n    if (!hasAccessor(metadata)) {\r\n        // `cloned` or getAccessor will determine the value\r\n        clonedMetadata.value = cloned;\r\n\r\n        // defineProperty throws if property with accessors is writable\r\n        clonedMetadata.writable = metadata.writable;\r\n    }\r\n\r\n    if (typeof metadata.get === 'function') {\r\n        clonedMetadata.get = metadata.get;\r\n    }\r\n    if (typeof metadata.set === 'function') {\r\n        clonedMetadata.set = metadata.set;\r\n    }\r\n\r\n    if (hasAccessor(metadata)) {\r\n        log.warn(getError(\r\n            `Cloning value with name ${String(prop)} whose property ` +\r\n            'descriptor contains a get or set accessor.'));\r\n    }\r\n\r\n    Object.defineProperty(parent, prop, clonedMetadata);\r\n};\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * Handles the assignment of the cloned value to some persistent place.\r\n * @template U\r\n * @param {Object} spec\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * A logger.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {any} spec.cloned\r\n * The cloned value.\r\n * @returns {any}\r\n * The cloned value.\r\n */\r\nexport const assign = ({ globalState, queueItem, cloned }) => {\r\n\r\n    const { container, log } = globalState;\r\n\r\n    const { parentOrAssigner, prop, metadata } = queueItem;\r\n\r\n    if (parentOrAssigner === TOP_LEVEL) {\r\n        container.clone = cloned;\r\n    } else if (typeof parentOrAssigner === 'function') {\r\n        parentOrAssigner(cloned, prop, metadata);\r\n    } else if (typeof parentOrAssigner === 'object'\r\n               && (typeof prop === 'string'\r\n                   || typeof prop === 'symbol')\r\n               && isDefaultDescriptor(metadata)) {\r\n        /** @type {{ [key: string|symbol|number]: any }} */\r\n        const parent = parentOrAssigner;\r\n\r\n        parent[prop] = cloned;\r\n    } else if (typeof parentOrAssigner === 'object'\r\n               && typeof prop !== 'undefined'\r\n               && typeof metadata === 'object') {\r\n        handleMetadata(\r\n            { log, cloned, parent: parentOrAssigner, prop, metadata });\r\n    }\r\n    return cloned;\r\n};\r\n","import { CloneError } from '../../utils/clone-deep-error.js';\r\nimport { isCallable, isObject } from '../../utils/type-checking.js';\r\n\r\n/**\r\n * Validates and processes any `additionalValues` from a customizer.\r\n * @param {Object} spec\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {import('../../utils/types').AdditionalValue[]} [spec.additionalValues]\r\n * Data associated with value that also will be cloned. This should only\r\n * represent data that is inaccessible via property access (like, for example,\r\n * the data in a Set or Map).\r\n * @param {boolean} [spec.asyncMode]\r\n * Whether the algorithm is run in async mode.\r\n * @param {import('../../types').QueueItem[]} spec.queue\r\n * The queue storing all values to clone.\r\n * @param {import('../../types').PendingResultItem[]} [spec.pendingResults]\r\n * The list of all clones that can only be acquired asynchronously.\r\n */\r\nexport const handleAdditionalValues = ({\r\n    additionalValues,\r\n    asyncMode,\r\n    queue,\r\n    pendingResults\r\n}) => {\r\n    additionalValues?.forEach((additionalValueConfig) => {\r\n        const {\r\n            value: additionalValue,\r\n            assigner,\r\n            async\r\n        } = additionalValueConfig;\r\n\r\n        if (!isObject(additionalValueConfig) || !isCallable(assigner)) {\r\n            throw CloneError.IMPROPER_ADDITIONAL_VALUES;\r\n        }\r\n\r\n        if (async && !asyncMode) {\r\n            throw CloneError.ADDITIONAL_VALUES_ASYNC_IN_SYNC_MODE;\r\n        }\r\n\r\n        if (async) {\r\n            pendingResults?.push({\r\n                queueItem: { parentOrAssigner: assigner },\r\n                promise: Promise.resolve(additionalValue),\r\n                propsToIgnore: []\r\n            });\r\n        } else {\r\n            queue.push({\r\n                value: additionalValueConfig.value,\r\n                parentOrAssigner: additionalValueConfig.assigner\r\n            });\r\n        }\r\n    });\r\n};\r\n","import { CloneError } from '../../utils/clone-deep-error.js';\r\nimport { isPropertyKeyArray } from '../../utils/type-checking.js';\r\nimport { handleAdditionalValues } from './handle-additional-values.js';\r\nimport { handleCustomError } from './misc.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * Processes the return value from the provided customizer.\r\n * This may have the side effect of saving the cloned value to some persistent\r\n * place, as well as pushing more elements in the appropriate queue if\r\n * necessary. Errors from the customizers are also handled here.\r\n * @param {Object} spec\r\n * @param {import('../../types').Customizer} spec.customizer\r\n * The customizer used to qualify the default behavior of cloneDeepInternal.\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * An array of properties of the given value that will not be cloned.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     useCustomizerClone: boolean,\r\n *     ignoreProto: boolean|undefined,\r\n *     ignoreProps: boolean|undefined,\r\n *     async?: boolean\r\n * }}\r\n */\r\nexport const handleCustomizer = ({\r\n    customizer,\r\n    globalState,\r\n    queueItem,\r\n    propsToIgnore,\r\n    saveClone\r\n}) => {\r\n\r\n    const {\r\n        log,\r\n        queue,\r\n        pendingResults,\r\n        doThrow,\r\n        async: asyncMode\r\n    } = globalState;\r\n\r\n    const { value } = queueItem;\r\n\r\n    /** @type {any} */\r\n    let cloned;\r\n\r\n    /** @type {boolean} */\r\n    let useCustomizerClone = false;\r\n\r\n    /** @type {import('../../utils/types').AdditionalValue[]|undefined} */\r\n    let additionalValues;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let ignoreProps;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let ignoreProto;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let async;\r\n\r\n    /** @type {Error|undefined} */\r\n    let throwWith;\r\n\r\n    let forceThrow = false;\r\n\r\n    try {\r\n        const customResult = customizer(value, log);\r\n\r\n        if (typeof customResult !== 'object') {\r\n            return {\r\n                cloned,\r\n                useCustomizerClone: false,\r\n                ignoreProto,\r\n                ignoreProps,\r\n                async\r\n            };\r\n        }\r\n\r\n        ({\r\n            additionalValues,\r\n            ignoreProps,\r\n            ignoreProto,\r\n            async,\r\n            throwWith\r\n        } = customResult);\r\n\r\n        if (throwWith !== undefined) {\r\n            forceThrow = true;\r\n            throw throwWith;\r\n        }\r\n\r\n        useCustomizerClone =\r\n            typeof customResult.useCustomizerClone === 'boolean'\r\n                ? customResult.useCustomizerClone\r\n                : true;\r\n\r\n        if (!Array.isArray(additionalValues)\r\n            && additionalValues !== undefined) {\r\n            throw CloneError.IMPROPER_ADDITIONAL_VALUES;\r\n        }\r\n\r\n        if (async && !asyncMode) {\r\n            throw CloneError.CUSTOMIZER_ASYNC_IN_SYNC_MODE;\r\n        }\r\n\r\n        if (customResult.propsToIgnore !== undefined\r\n            && !isPropertyKeyArray(customResult.propsToIgnore)) {\r\n            throw CloneError.CUSTOMIZER_IMPROPER_PROPS_TO_IGNORE;\r\n        }\r\n\r\n        if (Array.isArray(customResult.propsToIgnore)\r\n            && isPropertyKeyArray(customResult.propsToIgnore)) {\r\n            propsToIgnore.push(...customResult.propsToIgnore);\r\n        }\r\n\r\n        if (!asyncMode) {\r\n            cloned = saveClone(customResult.clone);\r\n        } else {\r\n            pendingResults?.push({\r\n                queueItem,\r\n                promise: Promise.resolve(customResult.clone),\r\n                ignoreProto,\r\n                ignoreProps,\r\n                propsToIgnore: []\r\n            });\r\n        }\r\n\r\n        handleAdditionalValues({\r\n            queueItem,\r\n            additionalValues,\r\n            asyncMode,\r\n            queue,\r\n            pendingResults\r\n        });\r\n    } catch (error) {\r\n        useCustomizerClone = handleCustomError({\r\n            log,\r\n            error,\r\n            doThrow: doThrow || forceThrow,\r\n            name: 'Customizer'\r\n        });\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        useCustomizerClone,\r\n        ignoreProto,\r\n        ignoreProps,\r\n        async\r\n    };\r\n};\r\n","import { Tag } from '../../utils/constants.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * Handles Web API types that can only be cloned asynchronously.\r\n * @param {Object} spec\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {string} spec.tag\r\n * The tag for the value.\r\n * @param {(promise: Promise<any>, options?: {\r\n *     ignoreProps?: boolean,\r\n *     ignoreProto?: boolean\r\n * }) => void} spec.pushPendingResult\r\n * A callback which adds the given promise to the list of pendingResults.\r\n * @returns {boolean}\r\n */\r\nexport const handleAsyncWebTypes = ({\r\n    queueItem,\r\n    tag,\r\n    pushPendingResult\r\n}) => {\r\n\r\n    const { value } = queueItem;\r\n\r\n    let asyncWebTypeDetected = true;\r\n\r\n    if (Tag.IMAGEBITMAP === tag) {\r\n        /** @type {ImageBitmap} */\r\n        const imageBitmap = value;\r\n\r\n        pushPendingResult(createImageBitmap(imageBitmap,\r\n                                            0,\r\n                                            0,\r\n                                            imageBitmap.width,\r\n                                            imageBitmap.height));\r\n\r\n    } else {\r\n        asyncWebTypeDetected = false;\r\n    }\r\n\r\n    return asyncWebTypeDetected;\r\n};\r\n","import { TOP_LEVEL } from './assign.js';\r\nimport { CloneError } from '../../utils/clone-deep-error.js';\r\nimport { Tag } from '../../utils/constants.js';\r\nimport {\r\n    getAtomicErrorConstructor,\r\n    getTypedArrayConstructor\r\n} from '../../utils/helpers.js';\r\nimport { getPrototype } from '../../utils/metadata.js';\r\nimport { isIterable, isTypedArray } from '../../utils/type-checking.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * @param {Object} spec\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {string} spec.tag\r\n * The tag of the provided value.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * A list of properties under this value that should not be cloned.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     ignoreProps: boolean,\r\n *     ignoreProto: boolean,\r\n *     nativeTypeDetected: boolean\r\n * }}\r\n */\r\nexport const handleEcmaTypes = ({\r\n    globalState,\r\n    queueItem,\r\n    tag,\r\n    propsToIgnore,\r\n    saveClone\r\n}) => {\r\n\r\n    const {\r\n        performanceConfig,\r\n        log,\r\n        queue,\r\n        isExtensibleSealFrozen,\r\n        supportedPrototypes\r\n    } = globalState;\r\n\r\n    const { value, parentOrAssigner, prop } = queueItem;\r\n\r\n    /** @type {any} */\r\n    let cloned;\r\n\r\n    let ignoreProps = false;\r\n\r\n    let ignoreProto = false;\r\n\r\n    let nativeTypeDetected = true;\r\n\r\n    // We won't clone weakmaps or weaksets (or their prototypes).\r\n    if ([Tag.WEAKMAP, Tag.WEAKSET].includes(tag)) {\r\n        throw tag === Tag.WEAKMAP ? CloneError.WEAKMAP : CloneError.WEAKSET;\r\n\r\n    // Ordinary objects, or the rare `arguments` clone.\r\n    // Also, treat prototypes like ordinary objects. The tag wrongly\r\n    // indicates that prototypes are instances of themselves.\r\n    } else if ([Tag.OBJECT, Tag.ARGUMENTS].includes(tag)\r\n            || supportedPrototypes.includes(value)) {\r\n        cloned = saveClone(Object.create(getPrototype(value)));\r\n\r\n    // We only copy functions if they are methods.\r\n    } else if (typeof value === 'function') {\r\n        cloned = saveClone(parentOrAssigner !== TOP_LEVEL\r\n            ? value\r\n            : Object.create(Function.prototype));\r\n        log.warn(\r\n            `Attempted to clone function` +\r\n            `${typeof prop === 'string'\r\n                ? ` with name ${prop}`\r\n                : ''}. JavaScript functions cannot be reliably ` +\r\n            'cloned. If this function is a method, it will be copied ' +\r\n            'directly. If this is the top-level object being cloned, ' +\r\n            'then an empty object will be returned.');\r\n        [ignoreProps, ignoreProto] = [true, true];\r\n\r\n    } else if (Array.isArray(value)) {\r\n        cloned = saveClone(new Array(value.length));\r\n\r\n    } else if ([Tag.BOOLEAN, Tag.DATE].includes(tag)) {\r\n        /** @type {BooleanConstructor|DateConstructor} */\r\n        const BooleanOrDateConstructor = tag === Tag.DATE\r\n            ? Date\r\n            : Boolean;\r\n\r\n        cloned = saveClone(new BooleanOrDateConstructor(Number(value)));\r\n\r\n    } else if ([Tag.NUMBER, Tag.STRING].includes(tag)) {\r\n        /** @type {NumberConstructor|StringConstructor} */\r\n        const NumberOrStringConstructor = tag === Tag.NUMBER\r\n            ? Number\r\n            : String;\r\n\r\n        cloned = saveClone(new NumberOrStringConstructor(value));\r\n\r\n    // `typeof Object(Symbol(\"foo\"))` is `\"object\"\r\n    } else if (Tag.SYMBOL === tag) {\r\n        /** @type {Symbol} */\r\n        const symbol = value;\r\n\r\n        cloned = saveClone(Object(Symbol.prototype.valueOf.call(symbol)));\r\n\r\n    // `typeof Object(BigInt(3))` is `\"object\"\r\n    } else if (Tag.BIGINT === tag) {\r\n        /** @type {BigInt} */\r\n        const bigint = value;\r\n\r\n        cloned = saveClone(\r\n            Object(BigInt.prototype.valueOf.call(bigint)));\r\n\r\n    } else if (Tag.REGEXP === tag) {\r\n        /** @type {RegExp} */\r\n        const regExp = value;\r\n\r\n        cloned = saveClone(new RegExp(regExp.source, regExp.flags));\r\n\r\n    } else if (Tag.ERROR === tag) {\r\n        /** @type {Error} */\r\n        const error = value;\r\n\r\n        /** @type {Error} */\r\n        let clonedError;\r\n\r\n        if (error.name === 'AggregateError') {\r\n            /** @type {AggregateError} */\r\n            const aggregateError = value;\r\n\r\n            const errors = isIterable(aggregateError.errors)\r\n                ? aggregateError.errors\r\n                : [];\r\n\r\n            if (!isIterable(aggregateError.errors)) {\r\n                log.warn(CloneError.IMPROPER_AGGREGATE_ERRORS);\r\n            }\r\n\r\n            const { cause } = aggregateError;\r\n            const { message } = aggregateError;\r\n            clonedError = cause === undefined\r\n                ? new AggregateError(errors, message)\r\n                : new AggregateError(errors, message, { cause });\r\n\r\n        } else {\r\n            /** @type {import('../../utils/types').AtomicErrorConstructor} */\r\n            const ErrorConstructor = getAtomicErrorConstructor(error, log);\r\n\r\n            const { cause } = error;\r\n            clonedError = cause === undefined\r\n                ? new ErrorConstructor(error.message)\r\n                : new ErrorConstructor(error.message, { cause });\r\n        }\r\n\r\n        const defaultDescriptor = Object.getOwnPropertyDescriptor(new Error(),\r\n                                                                  'stack');\r\n        const set = typeof defaultDescriptor === 'object'\r\n            ? defaultDescriptor.set\r\n            : undefined;\r\n\r\n        queue.push({\r\n            value: error.stack,\r\n\r\n            /** @param {any} clonedValue */\r\n            parentOrAssigner(clonedValue) {\r\n                isExtensibleSealFrozen.push([error.stack, clonedValue]);\r\n                Object.defineProperty(clonedError, 'stack', {\r\n                    enumerable: defaultDescriptor?.enumerable || false,\r\n                    get: () => {\r\n                        return clonedValue;\r\n                    },\r\n                    set\r\n                });\r\n            }\r\n        });\r\n\r\n        cloned = saveClone(clonedError);\r\n\r\n        propsToIgnore.push('stack');\r\n\r\n    } else if (Tag.ARRAYBUFFER === tag) {\r\n        const arrayBuffer = new ArrayBuffer(value.byteLength);\r\n        new Uint8Array(arrayBuffer).set(new Uint8Array(value));\r\n\r\n        cloned = saveClone(arrayBuffer);\r\n\r\n    } else if (isTypedArray(value, tag, performanceConfig)\r\n            || Tag.DATAVIEW === tag) {\r\n\r\n        /** @type {import('../../utils/types').TypedArrayConstructor} */\r\n        const TypedArray = getTypedArrayConstructor(tag, log);\r\n\r\n        // copy data over to clone\r\n        const buffer = new ArrayBuffer(value.buffer.byteLength);\r\n        new Uint8Array(buffer).set(new Uint8Array(value.buffer));\r\n\r\n        cloned = saveClone(new TypedArray(buffer,\r\n                                          value.byteOffset,\r\n                                          value.length));\r\n\r\n        for (let index = 0; index < cloned.length; index++) {\r\n            propsToIgnore.push(String(index));\r\n        }\r\n\r\n    } else if (Tag.MAP === tag) {\r\n        /** @type {Map<any, any>} */\r\n        const originalMap = value;\r\n\r\n        const cloneMap = new Map();\r\n        cloned = saveClone(cloneMap);\r\n\r\n        originalMap.forEach((subValue, key) => {\r\n            queue.push({\r\n                value: subValue,\r\n\r\n                /** @param {any} clonedValue */\r\n                parentOrAssigner(clonedValue) {\r\n                    isExtensibleSealFrozen.push([subValue, clonedValue]);\r\n                    cloneMap.set(key, clonedValue);\r\n                }\r\n            });\r\n        });\r\n\r\n    } else if (Tag.SET === tag) {\r\n        /** @type {Set<any>} */\r\n        const originalSet = value;\r\n\r\n        const cloneSet = new Set();\r\n        cloned = saveClone(cloneSet);\r\n\r\n        originalSet.forEach((subValue) => {\r\n            queue.push({\r\n                value: subValue,\r\n\r\n                /** @param {any} clonedValue */\r\n                parentOrAssigner(clonedValue) {\r\n                    isExtensibleSealFrozen.push([subValue, clonedValue]);\r\n                    cloneSet.add(clonedValue);\r\n                }\r\n            });\r\n        });\r\n\r\n    } else if (Tag.PROMISE === tag) {\r\n        /** @type {Promise<any>} */\r\n        const promise = value;\r\n\r\n        cloned = new Promise((resolve, reject) => {\r\n            promise.then(resolve)['catch'](reject);\r\n        });\r\n\r\n        saveClone(cloned);\r\n\r\n    } else {\r\n        nativeTypeDetected = false;\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        ignoreProps,\r\n        ignoreProto,\r\n        nativeTypeDetected\r\n    };\r\n};\r\n","import { Tag } from '../../utils/constants.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * Handles Node types.\r\n * @param {Object} spec\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {string} spec.tag\r\n * The tag for the value.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     nodeTypeDetected: boolean\r\n * }}\r\n */\r\nexport const handleNodeTypes = ({\r\n    queueItem,\r\n    tag,\r\n    saveClone\r\n}) => {\r\n\r\n    const { value } = queueItem;\r\n\r\n    let nodeTypeDetected = true;\r\n\r\n    let cloned;\r\n\r\n    if (Tag.BUFFER === tag) {\r\n        /** @type {import('./types').Buffer} */\r\n        const buffer = value;\r\n\r\n        cloned = saveClone(buffer.slice());\r\n\r\n    } else {\r\n        nodeTypeDetected = false;\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        nodeTypeDetected\r\n    };\r\n};\r\n","import { Tag } from '../../utils/constants.js';\r\nimport { cloneFile, createFileList } from '../../utils/helpers.js';\r\nimport { forAllOwnProperties, hasAccessor } from '../../utils/metadata.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * @param {Object} spec\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {string} spec.tag\r\n * The tag of the provided value.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * A list of properties under this value that should not be cloned.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     webTypeDetected: boolean\r\n * }}\r\n */\r\nexport const handleSyncWebTypes = ({\r\n    globalState,\r\n    queueItem,\r\n    tag,\r\n    propsToIgnore,\r\n    saveClone\r\n}) => {\r\n\r\n    const { queue, isExtensibleSealFrozen } = globalState;\r\n    const { value } = queueItem;\r\n\r\n    /** @type {any} */\r\n    let cloned;\r\n\r\n    let webTypeDetected = true;\r\n\r\n    if (Tag.BLOB === tag) {\r\n        /** @type {Blob} */\r\n        const blob = value;\r\n\r\n        cloned = saveClone(blob.slice());\r\n\r\n    } else if (Tag.FILE === tag) {\r\n        /** @type {File} */\r\n        const file = value;\r\n\r\n        cloned = saveClone(cloneFile(file));\r\n\r\n    } else if (Tag.FILELIST === tag) {\r\n        /** @type {FileList} */\r\n        const fileList = value;\r\n\r\n        /** @type {File[]} */\r\n        const files = [];\r\n        for (let index = 0; index < fileList.length; index++) {\r\n            const file = fileList.item(index);\r\n            if (file !== null) {\r\n                files.push(cloneFile(file));\r\n            }\r\n        }\r\n\r\n        cloned = saveClone(createFileList(...files));\r\n\r\n    } else if (Tag.DOMEXCEPTION === tag) {\r\n        /** @type {DOMException} */\r\n        const exception = value;\r\n\r\n        const clonedException = new DOMException(exception.message,\r\n                                                 exception.name);\r\n        const descriptor = Object.getOwnPropertyDescriptor(exception, 'stack');\r\n\r\n        queue.push({\r\n            value: exception.stack,\r\n\r\n            /** @param {any} clonedValue */\r\n            parentOrAssigner(clonedValue) {\r\n                isExtensibleSealFrozen.push([\r\n                    exception.stack,\r\n                    clonedValue\r\n                ]);\r\n                Object.defineProperty(clonedException, 'stack', {\r\n                    enumerable: descriptor?.enumerable || false,\r\n                    get: () => {\r\n                        return clonedValue;\r\n                    }\r\n                });\r\n            }\r\n        });\r\n\r\n        cloned = saveClone(clonedException);\r\n\r\n        propsToIgnore.push('stack');\r\n\r\n    } else if (Tag.DOMMATRIX === tag) {\r\n        /** @type {DOMMatrix} */\r\n        const matrix = value;\r\n\r\n        cloned = saveClone(matrix.scale(1));\r\n\r\n    } else if (Tag.DOMMATRIXREADONLY === tag) {\r\n        /** @type {DOMMatrixReadOnly} */\r\n        const matrix = value;\r\n\r\n        cloned = matrix.is2D\r\n            ? new DOMMatrixReadOnly([\r\n                matrix.a, matrix.b, matrix.c, matrix.d,\r\n                matrix.e, matrix.f])\r\n            : new DOMMatrixReadOnly([\r\n                matrix.m11, matrix.m12, matrix.m13, matrix.m14,\r\n                matrix.m21, matrix.m22, matrix.m23, matrix.m24,\r\n                matrix.m31, matrix.m32, matrix.m33, matrix.m34,\r\n                matrix.m41, matrix.m42, matrix.m43, matrix.m44\r\n            ]);\r\n        saveClone(cloned);\r\n\r\n    } else if ([Tag.DOMPOINT, Tag.DOMPOINTREADONLY].includes(tag)) {\r\n        /** @type {DOMPoint} */\r\n        const domPoint = value;\r\n\r\n        const Class = tag === Tag.DOMPOINT\r\n            ? DOMPoint\r\n            : DOMPointReadOnly;\r\n\r\n        cloned = saveClone(Class.fromPoint(domPoint));\r\n\r\n    } else if (Tag.DOMQUAD === tag) {\r\n        /** @type {import('../../utils/types').DOMQuadExtended} */\r\n        const quad = value;\r\n\r\n        /** @type {import('../../utils/types').DOMQuadExtended} */\r\n        cloned = new DOMQuad(quad.p1, quad.p2, quad.p3, quad.p4);\r\n\r\n        ['p1', 'p2', 'p3', 'p4'].forEach((pointProperty) => {\r\n            /** @type {import('../../utils/types').DOMPointExtended} */\r\n            const point = quad[pointProperty];\r\n\r\n            forAllOwnProperties(point, (key) => {\r\n                const meta = Object.getOwnPropertyDescriptor(point, key);\r\n\r\n                queue.push({\r\n                    value: !hasAccessor(meta) ? point[key] : null,\r\n                    parentOrAssigner: cloned[pointProperty],\r\n                    prop: key,\r\n                    metadata: meta\r\n                });\r\n            });\r\n        });\r\n\r\n        saveClone(cloned);\r\n\r\n    } else if ([Tag.DOMRECT, Tag.DOMRECTREADONLY].includes(tag)) {\r\n        /** @type {DOMRect|DOMRectReadOnly} */\r\n        const domRect = value;\r\n\r\n        const Class = tag === Tag.DOMRECT ? DOMRect : DOMRectReadOnly;\r\n\r\n        cloned = saveClone(Class.fromRect(domRect));\r\n\r\n    } else if (Tag.IMAGEDATA === tag) {\r\n        /** @type {ImageData} */\r\n        const imageData = value;\r\n\r\n        // ImageData::data is read-only so clone it now instead of later\r\n        propsToIgnore.push('data');\r\n        const dataArray = Uint8ClampedArray.from(imageData.data);\r\n\r\n        cloned = saveClone(new ImageData(\r\n            dataArray, imageData.width, imageData.height, {\r\n                colorSpace: imageData.colorSpace\r\n            }));\r\n\r\n    } else if ([Tag.AUDIODATA, Tag.VIDEOFRAME].includes(tag)) {\r\n        /** @type {import('./types').AudioData | import('./types').VideoFrame} */\r\n        const data = value;\r\n\r\n        cloned = saveClone(data.clone());\r\n\r\n    } else {\r\n        webTypeDetected = false;\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        webTypeDetected\r\n    };\r\n};\r\n","import { handleError } from './misc.js';\r\nimport { handleAsyncWebTypes } from './handle-async-web-types.js';\r\nimport { handleEcmaTypes } from './handle-ecma-types.js';\r\nimport { handleNodeTypes } from './handle-node-types.js';\r\nimport { handleSyncWebTypes } from './handle-sync-web-types.js';\r\nimport { CloneError } from '../../utils/clone-deep-error.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * @param {Object} spec\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {string} spec.tag\r\n * The tag for the value.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * A list of properties under this value that should not be cloned.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     ignoreProps: boolean|undefined,\r\n *     ignoreProto: boolean|undefined\r\n * }}\r\n */\r\nexport const handleTag = ({\r\n    globalState,\r\n    queueItem,\r\n    tag,\r\n    propsToIgnore,\r\n    saveClone\r\n}) => {\r\n\r\n    const {\r\n        log,\r\n        pendingResults,\r\n        async\r\n    } = globalState;\r\n\r\n    let cloned;\r\n    let ignoreProps;\r\n    let ignoreProto;\r\n\r\n    try {\r\n        /** @type {boolean|undefined} */\r\n        let nodeTypeDetected;\r\n\r\n        /** @type {boolean|undefined} */\r\n        let nativeTypeDetected;\r\n\r\n        /** @type {boolean|undefined} */\r\n        let webTypeDetected;\r\n\r\n        /** @type {boolean|undefined} */\r\n        let asyncWebTypeDetected;\r\n\r\n        ({\r\n            cloned,\r\n            nodeTypeDetected\r\n        } = handleNodeTypes({\r\n            queueItem,\r\n            tag,\r\n            saveClone\r\n        }));\r\n\r\n        if (!nodeTypeDetected) {\r\n            ({\r\n                cloned,\r\n                ignoreProps,\r\n                ignoreProto,\r\n                nativeTypeDetected\r\n            } = handleEcmaTypes({\r\n                globalState,\r\n                queueItem,\r\n                tag,\r\n                propsToIgnore,\r\n                saveClone\r\n            }));\r\n        }\r\n\r\n        if (!nodeTypeDetected && !nativeTypeDetected) {\r\n            ({\r\n                cloned,\r\n                webTypeDetected\r\n            } = handleSyncWebTypes({\r\n                globalState,\r\n                queueItem,\r\n                tag,\r\n                propsToIgnore,\r\n                saveClone\r\n            }));\r\n        }\r\n\r\n        if (async && !nodeTypeDetected && !nativeTypeDetected\r\n            && !webTypeDetected) {\r\n            /**\r\n             * Pushes the given promise into the list of pending results.\r\n             * @param {Promise<any>} promise\r\n             */\r\n            const pushPendingResult = (promise) => {\r\n                pendingResults?.push({\r\n                    queueItem,\r\n                    promise,\r\n                    propsToIgnore\r\n                });\r\n            };\r\n            asyncWebTypeDetected = handleAsyncWebTypes({\r\n                queueItem,\r\n                tag,\r\n                pushPendingResult\r\n            });\r\n        }\r\n\r\n        if (!nodeTypeDetected && !nativeTypeDetected && !webTypeDetected\r\n            && !asyncWebTypeDetected) {\r\n            throw CloneError.UNSUPPORTED_TYPE;\r\n        }\r\n    } catch (error) {\r\n        ({ cloned, ignoreProto } = handleError(error, log, saveClone));\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        ignoreProps,\r\n        ignoreProto\r\n    };\r\n};\r\n","import { CloneError } from '../../utils/clone-deep-error.js';\r\nimport { CLONE } from '../../utils/constants.js';\r\nimport {\r\n    isCallable,\r\n    isObject,\r\n    isPropertyKeyArray\r\n} from '../../utils/type-checking.js';\r\nimport { checkParentObjectRegistry, handleCustomError } from './misc.js';\r\n\r\n/** @typedef {import('../../utils/types').Assigner} Assigner */\r\n\r\n/**\r\n * Handles the return value from a cloning method.\r\n * @param {Object} spec\r\n * @param {import('./global-state.js').GlobalState} spec.globalState\r\n * The fundamental data structures used for cloneDeep.\r\n * @param {import('../../types').QueueItem} spec.queueItem\r\n * Describes the value and metadata of the data being cloned.\r\n * @param {(string|symbol)[]} spec.propsToIgnore\r\n * A list of properties under this value that should not be cloned.\r\n * @param {(clone: any) => any} spec.saveClone\r\n * A function which stores the clone of `value` into the cloned object.\r\n * @returns {{\r\n *     cloned: any,\r\n *     ignoreProps: boolean,\r\n *     ignoreProto: boolean,\r\n *     useCloningMethod: boolean,\r\n *     async?: boolean\r\n * }}\r\n */\r\nexport const handleCloningMethods = ({\r\n    globalState,\r\n    queueItem,\r\n    propsToIgnore,\r\n    saveClone\r\n}) => {\r\n\r\n    const {\r\n        log,\r\n        pendingResults,\r\n        parentObjectRegistry,\r\n        async: asyncMode,\r\n        doThrow\r\n    } = globalState;\r\n\r\n    const { value } = queueItem;\r\n\r\n    /** @type {any} */\r\n    let cloned;\r\n\r\n    let ignoreProps = false;\r\n\r\n    let ignoreProto = false;\r\n\r\n    let useCloningMethod = true;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let async;\r\n\r\n    /** @type {Error|undefined} */\r\n    let throwWith;\r\n\r\n    let forceThrow = false;\r\n\r\n    try {\r\n        if (!isCallable(value[CLONE])) {\r\n            return {\r\n                cloned,\r\n                ignoreProps,\r\n                ignoreProto,\r\n                useCloningMethod: false,\r\n                async\r\n            };\r\n        }\r\n\r\n        if (checkParentObjectRegistry(value, parentObjectRegistry)) {\r\n            return {\r\n                cloned,\r\n                ignoreProps,\r\n                ignoreProto,\r\n                useCloningMethod: false,\r\n                async\r\n            };\r\n        }\r\n\r\n        /** @type {import('../../utils/types').CloningMethodResult} */\r\n        const result = value[CLONE](log);\r\n\r\n        if (!isObject(result)) {\r\n            return {\r\n                cloned,\r\n                ignoreProps,\r\n                ignoreProto,\r\n                useCloningMethod: false,\r\n                async\r\n            };\r\n        }\r\n\r\n        if (result.throwWith !== undefined) {\r\n            forceThrow = true;\r\n            throw throwWith;\r\n        }\r\n\r\n\r\n        if (result.async && !asyncMode) {\r\n            throw CloneError.CLONING_METHOD_ASYNC_IN_SYNC_MODE;\r\n        }\r\n\r\n        if (result.propsToIgnore !== undefined\r\n            && !isPropertyKeyArray(result.propsToIgnore)) {\r\n            throw CloneError.CLONING_METHOD_IMPROPER_PROPS_TO_IGNORE;\r\n        }\r\n\r\n        if (typeof result.useCloningMethod === 'boolean') {\r\n            ({ useCloningMethod } = result);\r\n        }\r\n\r\n        if (typeof result.ignoreProps === 'boolean') {\r\n            ({ ignoreProps } = result);\r\n        }\r\n\r\n        if (typeof result.ignoreProto === 'boolean') {\r\n            ({ ignoreProto } = result);\r\n        }\r\n\r\n        if (Array.isArray(result.propsToIgnore)\r\n            && isPropertyKeyArray(result.propsToIgnore)) {\r\n            propsToIgnore.push(...result.propsToIgnore);\r\n        }\r\n\r\n        if (!result.async) {\r\n            cloned = saveClone(result.clone);\r\n        } else {\r\n            async = true;\r\n            pendingResults?.push({\r\n                queueItem,\r\n                promise: Promise.resolve(result.clone),\r\n                ignoreProto,\r\n                ignoreProps,\r\n                propsToIgnore\r\n            });\r\n        }\r\n\r\n    } catch (error) {\r\n        useCloningMethod = handleCustomError({\r\n            log,\r\n            error,\r\n            doThrow: doThrow || forceThrow,\r\n            name: 'Cloning method'\r\n        });\r\n    }\r\n\r\n    return {\r\n        cloned,\r\n        ignoreProps,\r\n        ignoreProto,\r\n        useCloningMethod,\r\n        async\r\n    };\r\n};\r\n","import { Tag } from '../../utils/constants.js';\r\nimport {\r\n    isBuffer,\r\n    isDOMException,\r\n    isDOMMatrix,\r\n    isDOMMatrixReadOnly,\r\n    isDOMPoint,\r\n    isDOMPointReadOnly,\r\n    isDOMRect,\r\n    isDOMRectReadOnly,\r\n    isFile,\r\n    isImageBitmap,\r\n    isImageData,\r\n    toStringTag\r\n} from '../../utils/type-checking.js';\r\n\r\n/** @typedef {new (...args: any[]) => any} Constructor */\r\n\r\n/**\r\n * Convenience array used for `getTag`.\r\n * @type {Array<[Constructor|string, string, string, ...any]>}\r\n */\r\nconst classesToTypeCheck = [\r\n    // \"standard\" classes\r\n    ['ArrayBuffer', 'slice', Tag.ARRAYBUFFER],\r\n    ['BigInt', 'valueOf', Tag.BIGINT],\r\n    [Boolean, 'valueOf', Tag.BOOLEAN],\r\n    [Date, 'getUTCMilliseconds', Tag.DATE],\r\n    [Function, 'bind', Tag.FUNCTION],\r\n    [Map, 'has', Tag.MAP],\r\n    [Number, 'valueOf', Tag.NUMBER],\r\n    ['Promise', 'then', Tag.PROMISE],\r\n    [RegExp, 'exec', Tag.REGEXP],\r\n    ['Set', 'has', Tag.SET],\r\n    [String, 'valueOf', Tag.STRING],\r\n    ['Symbol', 'valueOf', Tag.SYMBOL],\r\n    ['WeakMap', 'has', Tag.WEAKMAP],\r\n    ['WeakSet', 'has', Tag.WEAKSET],\r\n\r\n    // ArrayBuffer, DataView and TypedArrays\r\n    ['DataView', 'getInt8', Tag.DATAVIEW],\r\n\r\n    // Web APIs\r\n    ['AudioData', 'allocationSize', Tag.AUDIODATA, { planeIndex: 1 }],\r\n    ['Blob', 'clone', Tag.BLOB],\r\n    ['DOMQuad', 'toJSON', Tag.DOMQUAD],\r\n    ['FileList', 'item', Tag.FILELIST, 0],\r\n    ['VideoFrame', 'allocationSize', Tag.VIDEOFRAME, 0],\r\n\r\n    // Node types\r\n    ['Buffer', 'toString', Tag.BUFFER]\r\n];\r\n\r\n/**\r\n * Convenience array used for `getTag`.\r\n * Certain classes that require special handling to type check are handled here.\r\n * @type {Array<[(value: any) => boolean, string]>}\r\n */\r\nconst typeCheckers = [\r\n    [isDOMException, Tag.DOMEXCEPTION],\r\n    [isDOMMatrix, Tag.DOMMATRIX],\r\n    [isDOMMatrixReadOnly, Tag.DOMMATRIXREADONLY],\r\n    [isDOMPoint, Tag.DOMPOINT],\r\n    [isDOMPointReadOnly, Tag.DOMPOINTREADONLY],\r\n    [isDOMRect, Tag.DOMRECT],\r\n    [isDOMRectReadOnly, Tag.DOMRECTREADONLY],\r\n    [isFile, Tag.FILE],\r\n    [isImageBitmap, Tag.IMAGEBITMAP],\r\n    [isImageData, Tag.IMAGEDATA]\r\n];\r\n\r\n/**\r\n * Gets a \"tag\", which is an string which identifies the type of a value.\r\n *\r\n * `Object.prototype.toString` returns a string like `\"[object <Type>]\"`,  where\r\n * `\"<Type>\"` is the type of the object. We refer this return value as the\r\n * **tag**. Normally, the tag is determined by what `this[Symbol.toStringTag]`\r\n * is, but the JavaScript specification for `Object.prototype.toString` requires\r\n * that many native JavaScript objects return a specific tag if the object does\r\n * not have the `Symbol.toStringTag` property. Also, classes introduced after\r\n * ES6 typically have their own non-writable `Symbol.toStringTag` property. This\r\n * makes `Object.prototype.toString.call` a stronger type-check that\r\n * `instanceof`.\r\n *\r\n * @example\r\n * ```\r\n * const array = new Array();\r\n *\r\n * console.log(array instanceof Array);\r\n * // true\r\n *\r\n * console.log(Object.prototype.toString.call(array));\r\n * // \"[object Array]\"\r\n *\r\n *\r\n * const arraySubclass = Object.create(Array.prototype);\r\n *\r\n * console.log(arraySubclass instance Array);\r\n * // true;\r\n *\r\n * console.log(Object.prototype.toString.call(arraySubclass));\r\n * // \"[object Object]\"\r\n *\r\n *\r\n * // Note this is not a perfect type check because we can do:\r\n * arraySubclass[Symbol.toStringTag] = \"Array\"\r\n * console.log(Object.prototype.toString.call(arraySubclass));\r\n * // \"[object Array]\"\r\n * ```\r\n *\r\n * However, most native classes will throw if their prototype methods are called\r\n * on an object that wasn't called with the appropriate constructor function.\r\n * This can be used as a stronger type check than\r\n * `Object.prototype.toString.call` on classes where this is applicable.\r\n *\r\n * @example\r\n * ```\r\n * const isMap = value => {\r\n *     try {\r\n *         Map.prototype.has.call(value);\r\n *         return true;\r\n *     }\r\n *     catch {\r\n *         return false;\r\n *     }\r\n * }\r\n *\r\n * console.log(isMap(new Map()));\r\n * // true\r\n *\r\n * console.log(isMap(Object.create(Map.prototype)));\r\n * // false\r\n *\r\n * console.log(isMap({ [Symbol.toStringTag]: \"Map\" }));\r\n * // false\r\n * ```\r\n *\r\n * Some classes don't have any native instances, but instead have properties\r\n * with get/set accessors. These accessors typically throw if bound to incorrect\r\n * instances so we can use a nearly equivalent technique for them.\r\n *\r\n * Currently, only Array, Error subclasses, and TypedArray subclasses are having\r\n * their tag retrieved from `Object.prototype.toString.call`. All other classes\r\n * are checked by binding the given value to the appropriate prototype method or\r\n * accessor function. No matter which method is used, we return the tag\r\n * associated with the detected class.\r\n *\r\n * Since calling prototype methods can be expensive, it is possible to call this\r\n * function is such a way that `Object.prototype.toString.call` is solely used\r\n * to determine tags using the `performanceConfig.robustTypeChecking` parameter.\r\n *\r\n * @param {any} value\r\n * The value to get the tag of.\r\n * Whether type-checking should be done performantly.\r\n * @param {import('./global-state.js').GlobalState} globalState\r\n * The global application state.\r\n * @returns {string} tag\r\n * A string indicating the value's type.\r\n */\r\nexport const getTag = (value, globalState) => {\r\n\r\n    const { performanceConfig, supportedConstructors } = globalState;\r\n\r\n    if (performanceConfig?.robustTypeChecking !== true) {\r\n        if (isBuffer(value, supportedConstructors)) {\r\n            return Tag.BUFFER;\r\n        }\r\n        return toStringTag(value);\r\n    }\r\n\r\n    /** @type {undefined|string} */\r\n    let result;\r\n\r\n    classesToTypeCheck.some(([constructorOrString, method, tag, ...args]) => {\r\n\r\n        const constructor = typeof constructorOrString === 'string'\r\n            ? supportedConstructors[constructorOrString]\r\n            : constructorOrString;\r\n\r\n        if (constructor === undefined) {\r\n            return false; // continue iterating\r\n        }\r\n\r\n        try {\r\n            constructor.prototype[method].call(value, ...args);\r\n            result = tag;\r\n            return true; // stop iterating\r\n        } catch {\r\n            return false; // continue iterating\r\n        }\r\n    });\r\n\r\n    if (result === undefined) {\r\n        typeCheckers.some(([typeChecker, tag]) => {\r\n            if (typeChecker(value)) {\r\n                result = tag;\r\n                return true; // stop iterating\r\n            }\r\n            return false; // continue iterating\r\n        });\r\n    }\r\n\r\n    return result || toStringTag(value);\r\n};\r\n","import { assign } from './assign.js';\r\nimport { checkCloneStore, finalizeClone } from './misc.js';\r\nimport { handleCustomizer } from './handle-customizer.js';\r\nimport { handleTag } from './handle-tag.js';\r\nimport { handleCloningMethods } from './handle-cloning-method.js';\r\nimport { isObject } from '../../utils/type-checking.js';\r\nimport { getTag } from './get-tag.js';\r\n\r\n/**\r\n * Iterate through all items in the queue.\r\n * @param {import('./global-state.js').GlobalState} globalState\r\n * The global application state.\r\n */\r\nexport const processQueue = (globalState) => {\r\n\r\n    const {\r\n        queue,\r\n        customizer,\r\n        cloneStore,\r\n        isExtensibleSealFrozen,\r\n        ignoreCloningMethods\r\n    } = globalState;\r\n\r\n    for (let queueItem = queue.shift(); queueItem; queueItem = queue.shift()) {\r\n\r\n        const { value } = queueItem;\r\n\r\n        /**\r\n         * A shortcut for conveniently using {@link assign}.\r\n         * @param {any} clonedValue\r\n         * @returns {any}\r\n         */\r\n        const saveClone = (clonedValue) => {\r\n            return assign({\r\n                globalState,\r\n                queueItem: {\r\n                    value: queueItem?.value,\r\n                    parentOrAssigner: queueItem?.parentOrAssigner,\r\n                    prop: queueItem?.prop,\r\n                    metadata: queueItem?.metadata\r\n                },\r\n                cloned: clonedValue\r\n            });\r\n        };\r\n\r\n        /**\r\n         * Will contain the cloned object.\r\n         * @type {any}\r\n         */\r\n        let cloned;\r\n\r\n        /** Whether the clone for this value has been cached in the store. */\r\n        let cloneIsCached = false;\r\n\r\n        /**\r\n         * If true, do not not clone the properties of value.\r\n         * @type {boolean|undefined}\r\n         */\r\n        let ignoreProps = false;\r\n\r\n        /**\r\n         * If true, do not have `cloned` share the prototype of `value`.\r\n         * @type {boolean|undefined}\r\n         */\r\n        let ignoreProto = false;\r\n\r\n        /** Whether the provided value is a non-object. */\r\n        const isPrimitive = !isObject(value);\r\n\r\n        /** Is true if the provided value has a valid cloning method. */\r\n        let useCloningMethod = false;\r\n\r\n        /** Is true if the customizer determines the value of `cloned`. */\r\n        let useCustomizerClone = false;\r\n\r\n        /**\r\n         * Is true if the clone will be resolved asynchronously.\r\n         * @type {boolean|undefined}\r\n         */\r\n        let asyncResult;\r\n\r\n        /**\r\n         * Any properties in `value` added here will not be cloned.\r\n         * @type {(string|symbol)[]}\r\n         */\r\n        const propsToIgnore = [];\r\n\r\n        /** Identifies the type of the value. */\r\n        const tag = getTag(value, globalState);\r\n\r\n        cloneIsCached = checkCloneStore(value, cloneStore, saveClone);\r\n\r\n        if (!cloneIsCached && typeof customizer === 'function') {\r\n            ({\r\n                cloned,\r\n                useCustomizerClone,\r\n                ignoreProto,\r\n                ignoreProps,\r\n                async: asyncResult\r\n            } = handleCustomizer({\r\n                customizer,\r\n                globalState,\r\n                queueItem,\r\n                propsToIgnore,\r\n                saveClone\r\n            }));\r\n        }\r\n\r\n        if (!useCustomizerClone && isPrimitive) {\r\n            saveClone(value);\r\n        }\r\n\r\n        const ignore = cloneIsCached || useCustomizerClone || isPrimitive;\r\n\r\n        if (!ignore && !ignoreCloningMethods) {\r\n            const cloningMethodResult = handleCloningMethods({\r\n                globalState,\r\n                queueItem,\r\n                propsToIgnore,\r\n                saveClone\r\n            });\r\n\r\n            ({\r\n                cloned,\r\n                useCloningMethod,\r\n                async: asyncResult\r\n            } = cloningMethodResult);\r\n\r\n            ignoreProps ||= cloningMethodResult.ignoreProps;\r\n            ignoreProto ||= cloningMethodResult.ignoreProto;\r\n        }\r\n\r\n        if (!ignore && !useCloningMethod) {\r\n            const handleTagResult = handleTag({\r\n                globalState,\r\n                queueItem,\r\n                tag,\r\n                propsToIgnore,\r\n                saveClone\r\n            });\r\n\r\n            ({ cloned } = handleTagResult);\r\n\r\n            ignoreProps ||= handleTagResult.ignoreProps;\r\n            ignoreProto ||= handleTagResult.ignoreProto;\r\n        }\r\n\r\n        isExtensibleSealFrozen.push([value, cloned]);\r\n\r\n        finalizeClone({\r\n            value,\r\n            cloneStore,\r\n            queue,\r\n            cloned,\r\n            cloneIsCached,\r\n            ignoreProto,\r\n            ignoreProps,\r\n            useCloningMethod,\r\n            propsToIgnore,\r\n            asyncResult\r\n        });\r\n    }\r\n};\r\n","import { assign } from './assign.js';\r\nimport { finalizeClone } from './misc.js';\r\nimport { getError } from '../../utils/clone-deep-error.js';\r\n\r\n/**\r\n * Processes pending results.\r\n * @param {import('./global-state.js').GlobalState} globalState\r\n */\r\nexport const processPendingResults = async (globalState) => {\r\n    const {\r\n        log,\r\n        queue,\r\n        cloneStore,\r\n        pendingResults\r\n    } = globalState;\r\n\r\n    const clones = await Promise\r\n        .allSettled(pendingResults.map((result) => {\r\n            return result.promise;\r\n        }));\r\n\r\n    clones.forEach((clone, i) => {\r\n        /** @type {any} */\r\n        let cloned;\r\n        const result = pendingResults[i];\r\n\r\n        if (clone.status === 'rejected') {\r\n            log.warn(getError(\r\n                'Promise rejected' + (result.queueItem.prop !== undefined\r\n                    ? ' for value assigned to property ' +\r\n                      `\"${String(result.queueItem.prop)}\". `\r\n                    : '. ') +\r\n                'This value will be cloned into an empty object.',\r\n                { cause: clone.reason }));\r\n            cloned = {};\r\n        } else {\r\n            cloned = clone.value;\r\n        }\r\n\r\n        assign({\r\n            globalState,\r\n            queueItem: result.queueItem,\r\n            cloned\r\n        });\r\n\r\n        finalizeClone({\r\n            value: result.queueItem.value,\r\n            cloned,\r\n            cloneIsCached: false,\r\n            ignoreProto: result.ignoreProto,\r\n            ignoreProps: result.ignoreProps,\r\n            useCloningMethod: false,\r\n            propsToIgnore: result.propsToIgnore,\r\n            cloneStore,\r\n            queue\r\n        });\r\n    });\r\n\r\n    pendingResults.length = 0;\r\n};\r\n","import { TOP_LEVEL } from './assign.js';\r\nimport {\r\n    getSupportedConstructors,\r\n    getSupportedPrototypes\r\n} from '../../utils/helpers.js';\r\n\r\n/**\r\n * Container for various data structures often used in cloneDeep.\r\n */\r\nexport class GlobalState {\r\n    /**\r\n     * Contains the cloned value.\r\n     * @type {{ clone: any }}\r\n     * @readonly\r\n     */\r\n    container;\r\n\r\n    /**\r\n     * Will be used to store cloned values so that we don't loop infinitely on\r\n     * circular references.\r\n     * @readonly\r\n     */\r\n    cloneStore = new Map();\r\n\r\n    /**\r\n     * A queue so we can avoid recursion.\r\n     * @type {import('../../types').QueueItem[]}\r\n     * @readonly\r\n     */\r\n    queue;\r\n\r\n    /**\r\n     * A list. Each item contains a promise which resolves to the clone of a\r\n     * value, as well as metadata for that clone.\r\n     * @type import('../../types').PendingResultItem[]}\r\n     * @readonly\r\n     */\r\n    pendingResults = [];\r\n\r\n    /**\r\n     * We will do a second pass through everything to check Object.isExtensible,\r\n     * Object.isSealed and Object.isFrozen. We do it last so we don't run into\r\n     * issues where we append properties on a frozen object, etc.\r\n     * @type {Array<[any, any]>}\r\n     * @readonly\r\n     */\r\n    isExtensibleSealFrozen = [];\r\n\r\n    /**\r\n     * An optional function which customizes the behavior of CloneDeep.\r\n     * @type {import('../../types').Customizer|undefined}\r\n     * @readonly\r\n     */\r\n    customizer;\r\n\r\n    /**\r\n     * An array of all prototypes of supported types in this runtime.\r\n     * @type {any[]}\r\n     * @readonly\r\n     */\r\n    supportedPrototypes;\r\n\r\n    /**\r\n     * An object mapping constructor names to the constructor itself, or\r\n     * `undefined` if the constructor is not available in this runtime.\r\n     * @type {Readonly<{ [key: string]: (new (...args: any[]) => any) | undefined }>}\r\n     * @readonly\r\n     */\r\n    supportedConstructors;\r\n\r\n    /**\r\n     * This is used by cloneDeepFully to check if an object with a cloning\r\n     * method is in the prototype of an object that was cloned earlier in the\r\n     * chain.\r\n     * @type {Set<any>|undefined}\r\n     * @readonly\r\n     */\r\n    parentObjectRegistry;\r\n\r\n    /**\r\n     * Whether or not type-checking will be more performant.\r\n     * @type {import('./types').PerformanceConfig|undefined}\r\n     * @readonly\r\n     */\r\n    performanceConfig;\r\n\r\n    /**\r\n     * Whether cloning methods should even be considered.\r\n     * @type {boolean}\r\n     * @readonly\r\n     */\r\n    ignoreCloningMethods;\r\n\r\n    /**\r\n     * Whether errors in the customizer should cause the function to throw.\r\n     * @type {boolean}\r\n     * @readonly\r\n     */\r\n    doThrow;\r\n\r\n    /**\r\n     * Whether the algorithm will return the clone asynchronously.\r\n     * @type {boolean|undefined}\r\n     * @readonly\r\n     */\r\n    async;\r\n\r\n    /**\r\n     * @param {Object} spec\r\n     * @param {any} spec.value\r\n     * The initial value being cloned.\r\n     * @param {import('../../types').Log} spec.log\r\n     * A logger.\r\n     * @param {import('../../types').Customizer} [spec.customizer]\r\n     * A function which modifies the default behavior of cloneDeep.\r\n     * @param {Set<any>} [spec.parentObjectRegistry]\r\n     * This is used by cloneDeepFully to check if an object with a cloning\r\n     * method is in the prototype of an object that was cloned earlier in the\r\n     * chain.\r\n     * @param {import('./types').PerformanceConfig} [spec.performanceConfig]\r\n     * Whether or not type-checking will be more performant.\r\n     * @param {boolean} spec.ignoreCloningMethods\r\n     * Whether cloning methods should even be considered.\r\n     * @param {boolean} spec.doThrow\r\n     * Whether errors in the customizer should cause the function to throw.\r\n     * @param {boolean} [spec.async]\r\n     * Whether the algorithm will return the clone asynchronously.\r\n     */\r\n    constructor({\r\n        value,\r\n        log,\r\n        customizer,\r\n        parentObjectRegistry,\r\n        performanceConfig,\r\n        ignoreCloningMethods,\r\n        doThrow,\r\n        async\r\n    }) {\r\n        this.container = { clone: undefined };\r\n        this.customizer = customizer;\r\n        this.log = log;\r\n        this.queue = [{ value, parentOrAssigner: TOP_LEVEL }];\r\n        this.supportedPrototypes = getSupportedPrototypes();\r\n        this.supportedConstructors = getSupportedConstructors();\r\n        this.parentObjectRegistry = parentObjectRegistry;\r\n        this.performanceConfig = performanceConfig;\r\n        this.ignoreCloningMethods = Boolean(ignoreCloningMethods);\r\n        this.doThrow = Boolean(doThrow);\r\n        this.async = Boolean(async);\r\n\r\n        return new Proxy(this, {\r\n            set() {\r\n                throw new TypeError('GlobalState properties are readonly!');\r\n            }\r\n        });\r\n    }\r\n}\r\n","import { handleMetadata } from './clone-deep-utils/misc.js';\r\nimport { processQueue } from './clone-deep-utils/process-queue.js';\r\nimport {\r\n    processPendingResults\r\n} from './clone-deep-utils/process-pending-results.js';\r\nimport { GlobalState } from './clone-deep-utils/global-state.js';\r\n\r\n/**\r\n * Clones the provided value.\r\n * @template T\r\n * See CloneDeep.\r\n * @template [U = T]\r\n * See CloneDeep.\r\n * @param {Object} spec\r\n * @param {T} spec.value\r\n * The value to clone.\r\n * @param {import('../types').Customizer|undefined} spec.customizer\r\n * A customizer function.\r\n * @param {import('../types').Log} spec.log\r\n * Receives an error object for logging.\r\n * @param {import('./clone-deep-utils/types').PerformanceConfig} [spec.performanceConfig]\r\n * Whether or not type-checking will be more performant.\r\n * @param {boolean} spec.ignoreCloningMethods\r\n * Whether cloning methods will be observed.\r\n * @param {boolean} spec.doThrow\r\n * Whether errors in the customizer should cause the function to throw.\r\n * @param {Set<any>} [spec.parentObjectRegistry]\r\n * This is used by cloneDeepFully to check if an object with a cloning method is\r\n * in the prototype of an object that was cloned earlier in the chain.\r\n * @param {boolean} [spec.async]\r\n * Whether or not the algorithm will return the clone asynchronously.\r\n * @returns {U | Promise<{ clone: U }>}\r\n */\r\nexport const cloneDeepInternal = ({\r\n    value,\r\n    customizer,\r\n    log,\r\n    performanceConfig,\r\n    ignoreCloningMethods,\r\n    doThrow,\r\n    parentObjectRegistry,\r\n    async\r\n}) => {\r\n\r\n    const globalState = new GlobalState({\r\n        value,\r\n        log,\r\n        customizer,\r\n        parentObjectRegistry,\r\n        performanceConfig,\r\n        ignoreCloningMethods,\r\n        doThrow,\r\n        async\r\n    });\r\n\r\n    if (!async) {\r\n        processQueue(globalState);\r\n\r\n        if (globalState.performanceConfig?.ignoreMetadata !== true) {\r\n            handleMetadata(globalState.isExtensibleSealFrozen);\r\n        }\r\n\r\n        return globalState.container.clone;\r\n    }\r\n\r\n    /** @returns {Promise<void>} */\r\n    const processData = async () => {\r\n        try {\r\n            processQueue(globalState);\r\n\r\n            if (globalState.pendingResults.length > 0) {\r\n                await processPendingResults(globalState);\r\n\r\n                return processData();\r\n            }\r\n\r\n            if (globalState.performanceConfig?.ignoreMetadata !== true) {\r\n                handleMetadata(globalState.isExtensibleSealFrozen);\r\n            }\r\n        } catch (reason) {\r\n            return Promise.reject(reason);\r\n        }\r\n    };\r\n\r\n    return processData().then(() => {\r\n        return globalState.container;\r\n    });\r\n};\r\n","import { defaultLog } from '../utils/clone-deep-error.js';\r\nimport { isCallable } from '../utils/type-checking.js';\r\nimport { cloneDeepInternal } from './clone-deep-internal.js';\r\n\r\n/** @typedef {import('./clone-deep-utils/types').PerformanceConfig} PerformanceConfig */\r\n\r\n/** @typedef {import('../types').CloneDeepProxyOptions} CloneDeepProxyOptions */\r\n\r\n/** @typedef {import('../types').CloneDeepOptions} CloneDeepOptions */\r\n\r\n/** @typedef {import('../types').Customizer} Customizer */\r\n\r\n/** @typedef {import('../types').Log} Log */\r\n\r\n/**\r\n * @template T\r\n * The type of the input value.\r\n * @template [U = T]\r\n * The type of the return value, which by default is the same as `T`. Strictly\r\n * speaking it is possible for the types to differ because we don't support\r\n * all types, and customizers and cloning methods can arbitrarily manipulate\r\n * the resultant type of the clone. Provide this parameter if you know what you\r\n * are doing.\r\n * @param {T} value\r\n * The value to deeply copy.\r\n * @param {CloneDeepProxyOptions} [options]\r\n * @param {object} [options]\r\n * @param {Customizer} options.customizer\r\n * Allows the user to inject custom logic. The function is given the value to\r\n * copy. If the function returns an object, the value of the `clone` property on\r\n * that object will be used as the clone.\r\n * @param {Log} options.log\r\n * Any errors which occur during the algorithm can optionally be passed to a log\r\n * function. `log` should take one argument which will be the error encountered.\r\n * Use this to log the error to a custom logger.\r\n * @param {PerformanceConfig} [options.performanceConfig]\r\n * Whether type-checking will be done performantly or robustly.\r\n * @param {boolean} options.ignoreCloningMethods\r\n * Whether cloning methods will be observed.\r\n * @param {string} options.logMode\r\n * Case-insensitive. If \"silent\", no warnings will be logged. Use with caution,\r\n * as failures to perform true clones are logged as warnings.\r\n * @param {boolean} options.letCustomizerThrow\r\n * If `true`, errors thrown by the customizer will be thrown by `cloneDeep`. By\r\n * default, the error is logged and the algorithm proceeds with default\r\n * behavior.\r\n * @param {boolean} options.async\r\n * If `true`, the function will return a promise that resolves with the cloned\r\n * object.\r\n * @returns {U | Promise<{ clone: U }>}\r\n * The deep copy.\r\n */\r\nconst cloneDeepProxy = (value, options) => {\r\n    /** @type {Customizer|undefined} */\r\n    let customizer;\r\n\r\n    /** @type {Log|undefined} */\r\n    let log;\r\n\r\n    /** @type {PerformanceConfig|undefined} */\r\n    let performanceConfig;\r\n\r\n    /** @type {string|undefined} */\r\n    let logMode;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let letCustomizerThrow = false;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let ignoreCloningMethods = false;\r\n\r\n    /** @type {boolean|undefined} */\r\n    let async = false;\r\n\r\n    if (options !== null && typeof options === 'object') {\r\n        ({\r\n            customizer,\r\n            log,\r\n            performanceConfig,\r\n            logMode,\r\n            ignoreCloningMethods,\r\n            letCustomizerThrow,\r\n            async\r\n        } = options);\r\n    }\r\n\r\n    if (log === undefined || !isCallable(log?.warn) || !isCallable(log?.error)) {\r\n        log = defaultLog;\r\n    }\r\n\r\n    if (typeof logMode === 'string' && logMode.toLowerCase() === 'silent') {\r\n        const noop = () => {};\r\n        log = {\r\n            info: noop,\r\n            warn: noop,\r\n            error: noop\r\n        };\r\n    }\r\n\r\n    /** @type {U | Promise<{ clone: U }>} */\r\n    return cloneDeepInternal({\r\n        value,\r\n        customizer,\r\n        log,\r\n        performanceConfig: performanceConfig || {},\r\n        ignoreCloningMethods: ignoreCloningMethods || false,\r\n        doThrow: letCustomizerThrow || false,\r\n        async: async || false\r\n    });\r\n};\r\n\r\n/**\r\n * I should be able to use conditional types to correctly have\r\n * cloneDeepOptionsProxy return a promise or a non-promise without problems. But\r\n * it does not work. See https://github.com/microsoft/TypeScript/issues/33912.\r\n * As a workaround, I perform some evil casting to force the return to have the\r\n * correct type.\r\n * @template T\r\n * The type of the input value.\r\n * @template [U = T]\r\n * See documentation for cloneDeepProxy.\r\n * @param {T} value\r\n * The value to deeply copy.\r\n * @param {CloneDeepOptions} [options]\r\n * @returns {U}\r\n * See documentation for_cloneDeep.\r\n */\r\nconst cloneDeep = (value, options) => {\r\n    if (options === null || typeof options !== 'object') {\r\n        options = {};\r\n    }\r\n\r\n    return /** @type {U} */ (cloneDeepProxy(value, {\r\n        ...options,\r\n        async: false\r\n    }));\r\n};\r\n\r\n/**\r\n * I should be able to use conditional types to correctly have _cloneDeep return\r\n * a promise or a non-promise without problems. But it does not work.\r\n * See https://github.com/microsoft/TypeScript/issues/33912.\r\n * As a workaround, I perform some evil \"casting\" to force the return to have\r\n * the correct type.\r\n * @template T\r\n * The type of the input value.\r\n * @template [U = T]\r\n * See documentation for cloneDeepProxy.\r\n * @param {T} value\r\n * The value to deeply copy.\r\n * @param {CloneDeepOptions} [options]\r\n * @returns {Promise<{ clone: U }> }\r\n * See documentation for_cloneDeep..\r\n */\r\nexport const cloneDeepAsync = (value, options) => {\r\n    if (options === null || typeof options !== 'object') {\r\n        options = {};\r\n    }\r\n\r\n    return /** @type {Promise<{ clone: U }>} */(cloneDeepProxy(value, {\r\n        ...options,\r\n        async: true\r\n    }));\r\n};\r\n\r\nexport default cloneDeep;\r\n","import cloneDeep, { cloneDeepAsync } from '../clone-deep/clone-deep.js';\r\nimport { cloneDeepInternal } from '../clone-deep/clone-deep-internal.js';\r\nimport { hasMethods } from '../utils/metadata.js';\r\nimport { isObject } from '../utils/type-checking.js';\r\n\r\n/** @typedef {import('../clone-deep/clone-deep-utils/types').PerformanceConfig} PerformanceConfig */\r\n\r\n/** @typedef {import('../types').Customizer} Customizer */\r\n\r\n/** @typedef {import('../types').Log} Log */\r\n\r\n/**\r\n * Handles internal logic for the full deep clone.\r\n * @template [T=any]\r\n * The type of the input value.\r\n * @template [U = T]\r\n * The return type of the clone.\r\n * @param {Object} spec\r\n * @param {T} spec.value\r\n * The value to clone.\r\n * @param {Customizer|undefined} spec.customizer\r\n * A customizer that would qualify the default behavior of `cloneDeep`.\r\n * @param {Log} spec.log\r\n * A logger.\r\n * @param {string|undefined} spec.logMode\r\n * Either \"silent\" or \"quiet\". This will configure the behavior of the default\r\n * logger.\r\n * @param {PerformanceConfig} spec.performanceConfig\r\n * Whether type-checking will be performed performantly.\r\n * @param {boolean} spec.ignoreCloningMethods\r\n * Whether cloning methods will be observed.\r\n * @param {boolean} spec.letCustomizerThrow\r\n * Whether errors from the customizer will be thrown by the algorithm.\r\n * @param {boolean} spec.force\r\n * If true, then prototypes with methods will be cloned.\r\n * @returns {U}\r\n */\r\nexport const cloneDeepFullyInternal = ({\r\n    value,\r\n    customizer,\r\n    log,\r\n    logMode,\r\n    performanceConfig,\r\n    ignoreCloningMethods,\r\n    letCustomizerThrow,\r\n    force\r\n}) => {\r\n    /** @type {U} */\r\n    const clone = cloneDeep(value, {\r\n        customizer,\r\n        log,\r\n        logMode,\r\n        performanceConfig,\r\n        ignoreCloningMethods,\r\n        letCustomizerThrow\r\n    });\r\n\r\n    /** @type {U} */\r\n    let tempClone = clone;\r\n\r\n    /** @type {any} */\r\n    let tempOrig = value;\r\n\r\n    const parentObjectRegistry = ignoreCloningMethods !== true\r\n        ? new Set()\r\n        : undefined;\r\n\r\n    while (isObject(tempOrig)\r\n           && Object.getPrototypeOf(tempOrig) !== null\r\n           && (!hasMethods(Object.getPrototypeOf(tempOrig)) || force)) {\r\n\r\n        if (ignoreCloningMethods !== true) {\r\n            parentObjectRegistry?.add(tempOrig);\r\n        }\r\n\r\n        const newProto = cloneDeepInternal({\r\n            value: Object.getPrototypeOf(tempOrig),\r\n            customizer,\r\n            log,\r\n            performanceConfig,\r\n            ignoreCloningMethods,\r\n            doThrow: letCustomizerThrow,\r\n            parentObjectRegistry,\r\n            async: false\r\n        });\r\n\r\n        Object.setPrototypeOf(tempClone, newProto);\r\n\r\n        tempClone = Object.getPrototypeOf(tempClone);\r\n        tempOrig = Object.getPrototypeOf(tempOrig);\r\n    }\r\n\r\n    return clone;\r\n};\r\n\r\n/**\r\n * Handles internal logic for the full deep clone.\r\n * @template [T=any]\r\n * The type of the input value.\r\n * @template [U = T]\r\n * The return type of the clone.\r\n * @param {Object} spec\r\n * @param {T} spec.value\r\n * The value to clone.\r\n * @param {Customizer|undefined} spec.customizer\r\n * A customizer that would qualify the default behavior of `cloneDeep`.\r\n * @param {Log} spec.log\r\n * A logger.\r\n * @param {string|undefined} spec.logMode\r\n * Either \"silent\" or \"quiet\". This will configure the behavior of the default\r\n * logger.\r\n * @param {PerformanceConfig} spec.performanceConfig\r\n * Whether type-checking will be performed performantly.\r\n * @param {boolean} spec.ignoreCloningMethods\r\n * Whether cloning methods will be observed.\r\n * @param {boolean} spec.letCustomizerThrow\r\n * Whether errors from the customizer will be thrown by the algorithm.\r\n * @param {boolean} spec.force\r\n * If true, then prototypes with methods will be cloned.\r\n * @returns {Promise<{ clone: U }>}\r\n */\r\nexport const cloneDeepFullyInternalAsync = async ({\r\n    value,\r\n    customizer,\r\n    log,\r\n    logMode,\r\n    performanceConfig,\r\n    ignoreCloningMethods,\r\n    letCustomizerThrow,\r\n    force\r\n}) => {\r\n    const { clone } = await /** @type {Promise<{ clone: U }>} */ (\r\n        cloneDeepAsync(value, {\r\n            customizer,\r\n            log,\r\n            logMode,\r\n            performanceConfig,\r\n            ignoreCloningMethods,\r\n            letCustomizerThrow\r\n        }));\r\n\r\n    /** @type {any} */\r\n    let tempClone = clone;\r\n\r\n    /** @type {any} */\r\n    let tempOrig = value;\r\n\r\n    const parentObjectRegistry = ignoreCloningMethods !== true\r\n        ? new Set()\r\n        : undefined;\r\n\r\n    /** @type Promise<{ clone: any }>[]*/\r\n    const pendingCloneContainers = [];\r\n\r\n    while (isObject(tempOrig)\r\n           && Object.getPrototypeOf(tempOrig) !== null\r\n           && (!hasMethods(Object.getPrototypeOf(tempOrig)) || force)) {\r\n\r\n        if (ignoreCloningMethods !== true) {\r\n            parentObjectRegistry?.add(tempOrig);\r\n        }\r\n\r\n        pendingCloneContainers.push(cloneDeepInternal({\r\n            value: Object.getPrototypeOf(tempOrig),\r\n            customizer,\r\n            log,\r\n            performanceConfig,\r\n            ignoreCloningMethods,\r\n            doThrow: letCustomizerThrow,\r\n            parentObjectRegistry,\r\n            async: true\r\n        }));\r\n\r\n        tempClone = Object.getPrototypeOf(tempClone);\r\n        tempOrig = Object.getPrototypeOf(tempOrig);\r\n    }\r\n\r\n    const containers = await Promise.all(pendingCloneContainers);\r\n\r\n    let _tempClone = clone;\r\n    let _tempOrig = value;\r\n    containers.forEach(({ clone: newProto }) => {\r\n        Object.setPrototypeOf(_tempClone, newProto);\r\n\r\n        _tempClone = Object.getPrototypeOf(_tempClone);\r\n        _tempOrig = Object.getPrototypeOf(_tempOrig);\r\n    });\r\n\r\n    return { clone };\r\n};\r\n","import { defaultLog } from '../utils/clone-deep-error.js';\r\nimport {\r\n    cloneDeepFullyInternal,\r\n    cloneDeepFullyInternalAsync\r\n} from './clone-deep-fully-internal.js';\r\n\r\n/** @typedef {import('../clone-deep/clone-deep-utils/types').PerformanceConfig} PerformanceConfig */\r\n\r\n/** @typedef {import('../types').CloneDeepFullyProxyOptions} CloneDeepFullyProxyOptions */\r\n\r\n/** @typedef {import('../types').CloneDeepFullyOptions} CloneDeepFullyOptions */\r\n\r\n/** @typedef {import('../types').Customizer} Customizer */\r\n\r\n/** @typedef {import('../types').Log} Log */\r\n\r\n/**\r\n * Deeply clones the provided object and its prototype chain.\r\n * @template T\r\n * See the documentation for `cloneDeep`.\r\n * @template [U = T | Promise<{ clone: T }>]\r\n * See the documentation for `cloneDeep`.\r\n * @param {T} value\r\n * The object to clone.\r\n * @param {CloneDeepFullyProxyOptions} options\r\n * @param {object} options\r\n * @param {boolean} options.force\r\n * If `true`, prototypes with methods will be cloned. Normally, this function\r\n * stops if it reaches any prototype with methods.\r\n * @param {Customizer} options.customizer\r\n * See the documentation for `cloneDeep`.\r\n * @param {boolean} options.ignoreCloningMethods\r\n * See the documentation for `cloneDeep`.\r\n * @param {Log} options.log\r\n * See the documentation for `cloneDeep`.\r\n * @param {PerformanceConfig} [options.performanceConfig]\r\n * See the documentation for `cloneDeep`.\r\n * @param {string} options.logMode\r\n * See the documentation for `cloneDeep`.\r\n * @param {boolean} options.letCustomizerThrow\r\n * See the documentation for `cloneDeep`.\r\n * @param {boolean} options.async\r\n * See the documentation for `cloneDeep`.\r\n * @returns {U | Promise<{ clone: U }>} The deep copy.\r\n */\r\nconst cloneDeepFullyProxy = (value, options) => {\r\n    const {\r\n        customizer,\r\n        log,\r\n        logMode,\r\n        performanceConfig,\r\n        ignoreCloningMethods,\r\n        letCustomizerThrow,\r\n        force,\r\n        async\r\n    } = options;\r\n\r\n    if (!async) {\r\n        return cloneDeepFullyInternal({\r\n            value,\r\n            customizer,\r\n            log: log || defaultLog,\r\n            logMode,\r\n            performanceConfig: performanceConfig || {},\r\n            ignoreCloningMethods: ignoreCloningMethods || false,\r\n            letCustomizerThrow: letCustomizerThrow || false,\r\n            force: force || false\r\n        });\r\n    }\r\n    return cloneDeepFullyInternalAsync({\r\n        value,\r\n        customizer,\r\n        log: log || defaultLog,\r\n        logMode,\r\n        performanceConfig: performanceConfig || {},\r\n        ignoreCloningMethods: ignoreCloningMethods || false,\r\n        letCustomizerThrow: letCustomizerThrow || false,\r\n        force: force || false\r\n    });\r\n};\r\n\r\n/**\r\n * I should be able to use conditional types to correctly have\r\n * cloneDeepFullyOptionsProxy return a promise or a non-promise without\r\n * problems. But it does not work. See https://github.com/microsoft/TypeScript/issues/33912.\r\n * As a workaround, I perform some evil \"casting\" to force the return to have\r\n * the correct type.\r\n * @template T\r\n * The type of the input value.\r\n * @template [U = T]\r\n * See documentation for_cloneDeep.\r\n * @param {T} value\r\n * The value to deeply copy.\r\n * @param {CloneDeepFullyOptions} [options]\r\n * @returns {U}\r\n * See documentation for_cloneDeep.\r\n */\r\nconst cloneDeepFully = (value, options) => {\r\n    if (options === null || typeof options !== 'object') {\r\n        options = {};\r\n    }\r\n\r\n    return /** @type {U} */ (cloneDeepFullyProxy(value, {\r\n        ...options,\r\n        async: false\r\n    }));\r\n};\r\n\r\n/**\r\n * I should be able to use conditional types to correctly have\r\n * cloneDeepFullyOptionsProxy return a promise or a non-promise without\r\n * problems. But it does not work. See https://github.com/microsoft/TypeScript/issues/33912.\r\n * As a workaround, I perform some evil \"casting\" to force the return to have\r\n * the correct type.\r\n * @template T\r\n * The type of the input value.\r\n * @template [U = T]\r\n * See documentation for_cloneDeep.\r\n * @param {T} value\r\n * The value to deeply copy.\r\n * @param {CloneDeepFullyOptions} [options]\r\n * @returns {Promise<{ clone: U }> }\r\n * See documentation for_cloneDeep..\r\n */\r\nexport const cloneDeepFullyAsync = (value, options) => {\r\n    if (options === null || typeof options !== 'object') {\r\n        options = {};\r\n    }\r\n\r\n    return /** @type {Promise<{ clone: U }>}*/ (cloneDeepFullyProxy(value, {\r\n        ...options,\r\n        async: true\r\n    }));\r\n};\r\n\r\nexport default cloneDeepFully;\r\n","/**\r\n * Creates a customizer which composes other customizers.\r\n * The customizers are executed in order. The first to return an object is used\r\n * as the result. If no customizer returns an object, undefined is returned.\r\n * @param {import('./types').Customizer[]} customizers\r\n * An array of customizer functions.\r\n * @returns {import('./types').Customizer}\r\n * A new customizer which composes the provided customizers.\r\n */\r\nconst useCustomizers = (customizers) => {\r\n    if (!Array.isArray(customizers)\r\n        || customizers.some((func) => {\r\n            return typeof func !== 'function';\r\n        })) {\r\n        throw new Error('useCustomizers must receive an array of functions');\r\n    }\r\n\r\n    /**\r\n     * @param {any} value\r\n     * @returns {import('./utils/types').CustomizerResult|void}\r\n     */\r\n    return function combinedCustomizer(value) {\r\n        for (const customizer of customizers) {\r\n            const result = customizer(value);\r\n            if (typeof result === 'object') {\r\n                return result;\r\n            }\r\n        }\r\n    };\r\n};\r\n\r\nexport default useCustomizers;\r\n","import cloneDeep, {\r\n    cloneDeepAsync as _cloneDeepAsync\r\n} from './src/clone-deep/clone-deep.js';\r\nimport _cloneDeepFully, {\r\n    cloneDeepFullyAsync as _cloneDeepFullyAsync\r\n} from './src/clone-deep-fully/clone-deep-fully.js';\r\nimport _useCustomizers from './src/use-customizers.js';\r\n\r\nexport default cloneDeep;\r\nexport const cloneDeepAsync = _cloneDeepAsync;\r\nexport const cloneDeepFully = _cloneDeepFully;\r\nexport const cloneDeepFullyAsync = _cloneDeepFullyAsync;\r\nexport const useCustomizers = _useCustomizers;\r\nexport { CLONE } from './src/utils/constants.js';\r\n"]}