UNPKG

@localazy/api-client

Version:

Official Node.js client for the Localazy API, providing a simple and type-safe way to integrate localization features into your JavaScript and TypeScript projects.

1 lines 248 kB
{"version":3,"file":"localazy-api-client.cjs","names":["chunk","isTypedArray","cloneDeepWith","isTypedArray","isTypedArray"],"sources":["../../src/api/methods/api-base.ts","../../src/api/methods/api-ai.ts","../../src/api/methods/api-export.ts","../../src/api/methods/api-files.ts","../../src/api/methods/api-formats.ts","../../src/api/methods/api-glossary.ts","../../src/types/import-data-factory.ts","../../src/utils/delay.ts","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/function/noop.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/tags.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/_internal/globalThis.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isBuffer.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isLength.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/array/chunk.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/toArray.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/array/chunk.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/util/toString.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/util/toPath.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/get.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/updateWith.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/object/clone.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/merge.mjs","../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/compat/object/setWith.mjs","../../src/utils/json-utils.ts","../../src/api/methods/api-import.ts","../../src/api/methods/api-keys.ts","../../src/api/methods/api-projects.ts","../../src/api/methods/api-screenshots.ts","../../src/api/methods/api-webhooks.ts","../../src/http/fetch-http-adapter.ts","../../src/api/api-client.ts","../../src/enums/i18n-deprecate.ts","../../src/enums/project-tone.ts","../../src/enums/project-type.ts","../../src/enums/upload-status.ts","../../src/enums/user-role.ts","../../src/enums/webhook-event.ts","../../node_modules/.pnpm/@localazy+languages@0.1.11/node_modules/@localazy/languages/lib/module/locales.js"],"sourcesContent":["import type { ApiClient } from '@/api/api-client.js';\n\nexport abstract class ApiBase {\n protected api: ApiClient;\n\n constructor(api: ApiClient) {\n this.api = api;\n }\n\n protected static getId(val: string | { id: string }, prop: string): string {\n const id: string = typeof val === 'string' ? val : val.id || '';\n\n if (!id) {\n throw new Error(`Invalid ${prop} ID.`);\n }\n\n return id;\n }\n}\n","import { ApiBase } from '@/api/methods/api-base.js';\nimport type { AiTranslateRequest } from '@/types/ai-translate-request.js';\nimport type { AiTranslateResponse } from '@/types/ai-translate-response.js';\nimport type { RequestConfig } from '@/types/request-config.js';\n\nexport class ApiAi extends ApiBase {\n /**\n * Translate provided items from the source language to the target language\n * using Localazy AI and considering the provided context, project-defined\n * style guide and glossary.\n *\n * @param request AI translate request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/ai-translation#translate Localazy API Docs}\n */\n public async translate(\n request: AiTranslateRequest,\n config?: RequestConfig,\n ): Promise<AiTranslateResponse> {\n const { project, ...data }: AiTranslateRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n\n return (await this.api.client.post(\n `/projects/${projectId}/ai`,\n data,\n config,\n )) as AiTranslateResponse;\n }\n}\n","import { ApiBase } from '@/api/methods/api-base.js';\nimport type { ExportJsonRequest } from '@/types/export-json-request.js';\nimport type { I18nJson } from '@/types/i18n-json.js';\nimport type { Json } from '@/types/json.js';\nimport type { Key } from '@/types/key.js';\nimport type { RequestConfig } from '@/types/request-config.js';\nimport type { Locales } from '@localazy/languages';\n\nexport class ApiExport extends ApiBase {\n /**\n * Export translated keys as JSON object.\n *\n * @param request Export JSON request config.\n * @param config Request config.\n */\n public async json(request: ExportJsonRequest, config?: RequestConfig): Promise<I18nJson> {\n const { project, file, langs }: ExportJsonRequest = request;\n\n const result: Key[][] = await Promise.all(\n langs.map(\n (lang: `${Locales}`): Promise<Key[]> =>\n this.api.files.listKeys({ project, file, lang }, config),\n ),\n );\n\n return Object.fromEntries(ApiExport.mapLanguages(langs, result));\n }\n\n protected static mapLanguages(languages: `${Locales}`[], result: Key[][]) {\n return languages.map((lang: `${Locales}`, index: number) => [\n lang,\n ApiExport.mapResult(result[index]),\n ]);\n }\n\n protected static mapResult(keysList: Key[]): Json {\n return keysList.reduce((acc: Json, cur: Key): Json => {\n const parts: string[] = cur.key;\n\n // Flat: single-item array key stays as-is, even if it contains dots\n if (parts.length <= 1) {\n const only = parts[0];\n if (only !== undefined) {\n acc[only] = cur.value;\n }\n return acc;\n }\n\n // Nested: array key → build nested objects by segments\n let node: any = acc;\n for (let i = 0; i < parts.length; i++) {\n const seg = parts[i];\n const isLast = i === parts.length - 1;\n\n if (seg !== undefined) {\n if (isLast) {\n node[seg] = cur.value;\n } else {\n if (node[seg] === undefined) {\n node[seg] = {};\n }\n node = node[seg];\n }\n }\n }\n\n return acc;\n }, {});\n }\n}\n","import { ApiBase } from '@/api/methods/api-base.js';\nimport type { FileGetContentsRequest } from '@/types/file-get-contents-request.js';\nimport type { FileListKeysRequest } from '@/types/file-list-keys-request.js';\nimport type {\n FileListKeysSinceEventRequest,\n FileListKeysSinceEventResult,\n} from '@/types/file-list-keys-since-event-request.js';\nimport type { File } from '@/types/file.js';\nimport type { FilesListRequest } from '@/types/files-list-request.js';\nimport type { Key } from '@/types/key.js';\nimport type { KeysPaginated } from '@/types/keys-paginated.js';\nimport type { RequestConfig } from '@/types/request-config.js';\nimport type { Blob } from 'node:buffer';\n\nexport class ApiFiles extends ApiBase {\n /**\n * List all {@link File files} in the project.\n *\n * @param request Files list request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/files#list-files-in-project Localazy API Docs}\n */\n public async list(request: FilesListRequest, config?: RequestConfig): Promise<File[]> {\n const { project }: FilesListRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n\n return (await this.api.client.get(`/projects/${projectId}/files`, config)) as Promise<File[]>;\n }\n\n /**\n * First {@link File file} in the project.\n *\n * @param request Files list request config.\n * @param config Request config.\n * @throws Error At least one file must exist, otherwise an error is thrown.\n *\n * @see {@link https://localazy.com/docs/api/files#list-files-in-project Localazy API Docs}\n */\n public async first(request: FilesListRequest, config?: RequestConfig): Promise<File> {\n const files: File[] = await this.list(request, config);\n\n if (typeof files[0] !== 'undefined') {\n return files[0];\n }\n\n throw new Error('File not found.');\n }\n\n /**\n * List all {@link Key keys} for the language in the {@link File file}.\n *\n * @param request File list keys request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/files#retrieve-a-list-of-keys-and-translations-from-file\n * | Localazy API Docs}\n */\n public async listKeys(request: FileListKeysRequest, config?: RequestConfig): Promise<Key[]> {\n const keys: Key[] = [];\n let pageResult: KeysPaginated = {\n keys: [],\n next: '',\n };\n\n do {\n pageResult = await this.listKeysPage({ ...request, next: pageResult.next }, config);\n keys.push(...pageResult.keys);\n } while (pageResult.next);\n\n return keys;\n }\n\n /**\n * List all {@link Key keys} for the language in the {@link File file}. Result is paginated.\n *\n * @param request File list keys request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/files#retrieve-a-list-of-keys-and-translations-from-file\n * | Localazy API Docs}\n */\n public async listKeysPage(\n request: FileListKeysRequest,\n config?: RequestConfig,\n ): Promise<KeysPaginated> {\n const { project, file, lang, ...params }: FileListKeysRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const fileId: string = ApiBase.getId(file, 'file');\n\n return (await this.api.client.get(`/projects/${projectId}/files/${fileId}/keys/${lang}`, {\n ...config,\n params,\n })) as KeysPaginated;\n }\n\n /**\n * List {@link Key keys} for the language in the {@link File file} with event-based filtering.\n * Fetches all keys with `event=true`, computes the maximum event number, and optionally\n * filters to only keys changed since a given event cursor.\n *\n * This method is designed for incremental sync: pass `sinceEvent` from a previous sync\n * to receive only keys that have changed since then.\n *\n * @param request File list keys since event request config.\n * @param config Request config.\n * @returns An object containing the filtered keys and the maximum event number.\n */\n public async listKeysSinceEvent(\n request: FileListKeysSinceEventRequest,\n config?: RequestConfig,\n ): Promise<FileListKeysSinceEventResult> {\n const { sinceEvent, ...rest } = request;\n const allKeys: Key[] = await this.listKeys({ ...rest, event: true }, config);\n\n const keysWithEvent = allKeys.filter((key) => key.event !== undefined && key.event !== null);\n const maxEvent: number | null =\n keysWithEvent.length > 0\n ? keysWithEvent.reduce((max, key) => Math.max(max, key.event ?? -Infinity), -Infinity)\n : null;\n\n const keys: Key[] =\n sinceEvent !== null && sinceEvent !== undefined\n ? allKeys.filter(\n (key) => key.event !== undefined && key.event !== null && key.event > sinceEvent,\n )\n : allKeys;\n\n return { keys, maxEvent };\n }\n\n /**\n * Get the contents of the {@link File file}.\n *\n * @param request File get contents request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/files#list-file-content Localazy API Docs}\n */\n public async getContents(request: FileGetContentsRequest, config?: RequestConfig): Promise<Blob> {\n const { project, file, lang }: FileGetContentsRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const fileId: string = ApiBase.getId(file, 'file');\n\n return (await this.api.client.get(`/projects/${projectId}/files/${fileId}/download/${lang}`, {\n ...config,\n responseType: 'blob',\n })) as Blob;\n }\n}\n","import { ApiBase } from '@/api/methods/api-base.js';\nimport type { Format } from '@/types/format.js';\nimport type { RequestConfig } from '@/types/request-config.js';\n\nexport class ApiFormats extends ApiBase {\n /**\n * List all {@link Format formats} and related options.\n *\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/import#list-available-file-types Localazy API Docs}\n */\n public async list(config?: RequestConfig): Promise<Format[]> {\n return (await this.api.client.get('/import/formats', config)) as Format[];\n }\n}\n","import { ApiBase } from '@/api/methods/api-base.js';\nimport type { GlossaryCreateRequest } from '@/types/glossary-create-request.js';\nimport type { GlossaryDeleteRequest } from '@/types/glossary-delete-request.js';\nimport type { GlossaryFindRequest } from '@/types/glossary-find-request.js';\nimport type { GlossaryListRequest } from '@/types/glossary-list-request.js';\nimport type { GlossaryRecord } from '@/types/glossary-record.js';\nimport type { GlossaryUpdateRequest } from '@/types/glossary-update-request.js';\nimport type { RequestConfig } from '@/types/request-config.js';\n\nexport class ApiGlossary extends ApiBase {\n /**\n * List all {@link GlossaryRecord glossary records} in the project.\n *\n * @param request Glossary records list request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/glossary#list-all-glossary-terms Localazy API Docs}\n */\n public async list(\n request: GlossaryListRequest,\n config?: RequestConfig,\n ): Promise<GlossaryRecord[]> {\n const { project }: GlossaryListRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const response: { glossaries: GlossaryRecord[] } = (await this.api.client.get(\n `/projects/${projectId}/glossary`,\n config,\n )) as { glossaries: GlossaryRecord[] };\n\n return response.glossaries;\n }\n\n /**\n * Find {@link GlossaryRecord glossary record} specified by `id`.\n *\n * @param request Glossary record find request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/glossary#get-glossary-term Localazy API Docs}\n */\n public async find(request: GlossaryFindRequest, config?: RequestConfig): Promise<GlossaryRecord> {\n const { project, glossaryRecord }: GlossaryFindRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const id: string = typeof glossaryRecord === 'string' ? glossaryRecord : glossaryRecord.id;\n\n return (await this.api.client.get(\n `/projects/${projectId}/glossary/${id}`,\n config,\n )) as GlossaryRecord;\n }\n\n /**\n * Create {@link GlossaryRecord glossary record}.\n * There is a limit of 1000 glossary records per project.\n *\n * @param request Glossary record create request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/glossary#create-new-glossary-term Localazy API Docs}\n */\n public async create(request: GlossaryCreateRequest, config?: RequestConfig): Promise<string> {\n const { project, ...data }: GlossaryCreateRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const response: { result: string } = (await this.api.client.post(\n `/projects/${projectId}/glossary`,\n data,\n config,\n )) as { result: string };\n\n return response.result;\n }\n\n /**\n * Update {@link GlossaryRecord glossary record} specified by `id`.\n *\n * @param request Glossary record update request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/glossary#update-glossary-term Localazy API Docs}\n */\n public async update(request: GlossaryUpdateRequest, config?: RequestConfig): Promise<void> {\n const { project, glossaryRecord, ...data }: GlossaryUpdateRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const id: string = typeof glossaryRecord === 'string' ? glossaryRecord : glossaryRecord.id;\n\n await this.api.client.put(`/projects/${projectId}/glossary/${id}`, data, config);\n }\n\n /**\n * Delete {@link GlossaryRecord glossary record} specified by `id`.\n *\n * @param request Glossary record delete request config.\n * @param config Request config.\n *\n * @see {@link https://localazy.com/docs/api/glossary#delete-glossary-term Localazy API Docs}\n */\n public async delete(request: GlossaryDeleteRequest, config?: RequestConfig): Promise<void> {\n const { project, glossaryRecord }: GlossaryDeleteRequest = request;\n const projectId: string = ApiBase.getId(project, 'project');\n const id: string = typeof glossaryRecord === 'string' ? glossaryRecord : glossaryRecord.id;\n\n await this.api.client.delete(`/projects/${projectId}/glossary/${id}`, config);\n }\n}\n","import type { I18nJson } from '@/types/i18n-json.js';\nimport type { ImportDataFile } from '@/types/import-data-file.js';\nimport type { ImportData } from '@/types/import-data.js';\nimport type { ImportJsonRequest } from '@/types/import-json-request.js';\n\nexport const importDataFactory = (request: ImportJsonRequest, chunks: I18nJson[]): ImportData => ({\n ...request.i18nOptions,\n files: [\n ...chunks.map(\n (chunk: I18nJson): ImportDataFile => ({\n name: 'content.json',\n ...request.fileOptions,\n content: {\n type: 'json',\n ...request.contentOptions,\n ...chunk,\n },\n }),\n ),\n ],\n});\n","export const delay = (ms: number = 150) =>\n new Promise((resolve): void => {\n setTimeout(resolve, ms);\n });\n","//#region src/compat/predicate/isSymbol.ts\n/**\n* Check whether a value is a symbol.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.\n*\n* @param {unknown} value The value to check.\n* @returns {value is symbol} Returns `true` if `value` is a symbol, else `false`.\n* @example\n* isSymbol(Symbol.iterator);\n* // => true\n*\n* isSymbol('abc');\n* // => false\n*/\nfunction isSymbol(value) {\n\treturn typeof value === \"symbol\" || value instanceof Symbol;\n}\n//#endregion\nexport { isSymbol };\n","//#region src/compat/predicate/isPlainObject.ts\n/**\n* Checks if a given value is a plain object.\n*\n* A plain object is an object created by the `{}` literal, `new Object()`, or\n* `Object.create(null)`.\n*\n* This function also handles objects with custom\n* `Symbol.toStringTag` properties.\n*\n* `Symbol.toStringTag` is a built-in symbol that a constructor can use to customize the\n* default string description of objects.\n*\n* @param {any} [object] - The value to check.\n* @returns {boolean} - True if the value is a plain object, otherwise false.\n*\n* @example\n* console.log(isPlainObject({})); // true\n* console.log(isPlainObject([])); // false\n* console.log(isPlainObject(null)); // false\n* console.log(isPlainObject(Object.create(null))); // true\n* console.log(isPlainObject(new Map())); // false\n*/\nfunction isPlainObject(object) {\n\tif (typeof object !== \"object\") return false;\n\tif (object == null) return false;\n\tif (Object.getPrototypeOf(object) === null) return true;\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") {\n\t\tconst tag = object[Symbol.toStringTag];\n\t\tif (tag == null) return false;\n\t\tif (!Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable) return false;\n\t\treturn object.toString() === `[object ${tag}]`;\n\t}\n\tlet proto = object;\n\twhile (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);\n\treturn Object.getPrototypeOf(object) === proto;\n}\n//#endregion\nexport { isPlainObject };\n","//#region src/_internal/isEqualsSameValueZero.ts\n/**\n* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.\n*\n* @param {any} value - The value to compare.\n* @param {any} other - The other value to compare.\n* @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n*\n* @example\n* eq(1, 1); // true\n* eq(0, -0); // true\n* eq(NaN, NaN); // true\n* eq('a', Object('a')); // false\n*/\nfunction isEqualsSameValueZero(value, other) {\n\treturn value === other || Number.isNaN(value) && Number.isNaN(other);\n}\n//#endregion\nexport { isEqualsSameValueZero };\n","//#region src/function/noop.ts\n/**\n* A no-operation function that does nothing.\n* This can be used as a placeholder or default function.\n*\n* @example\n* noop(); // Does nothing\n*\n* @returns {void} This function does not return anything.\n*/\nfunction noop() {}\n//#endregion\nexport { noop };\n","//#region src/compat/_internal/getSymbols.ts\nfunction getSymbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));\n}\n//#endregion\nexport { getSymbols };\n","//#region src/compat/_internal/getTag.ts\n/**\n* Gets the `toStringTag` of `value`.\n*\n* @private\n* @param {T} value The value to query.\n* @returns {string} Returns the `Object.prototype.toString.call` result.\n*/\nfunction getTag(value) {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n}\n//#endregion\nexport { getTag };\n","//#region src/compat/_internal/tags.ts\nconst regexpTag = \"[object RegExp]\";\nconst stringTag = \"[object String]\";\nconst numberTag = \"[object Number]\";\nconst booleanTag = \"[object Boolean]\";\nconst argumentsTag = \"[object Arguments]\";\nconst symbolTag = \"[object Symbol]\";\nconst dateTag = \"[object Date]\";\nconst mapTag = \"[object Map]\";\nconst setTag = \"[object Set]\";\nconst arrayTag = \"[object Array]\";\nconst functionTag = \"[object Function]\";\nconst arrayBufferTag = \"[object ArrayBuffer]\";\nconst objectTag = \"[object Object]\";\nconst errorTag = \"[object Error]\";\nconst dataViewTag = \"[object DataView]\";\nconst uint8ArrayTag = \"[object Uint8Array]\";\nconst uint8ClampedArrayTag = \"[object Uint8ClampedArray]\";\nconst uint16ArrayTag = \"[object Uint16Array]\";\nconst uint32ArrayTag = \"[object Uint32Array]\";\nconst bigUint64ArrayTag = \"[object BigUint64Array]\";\nconst int8ArrayTag = \"[object Int8Array]\";\nconst int16ArrayTag = \"[object Int16Array]\";\nconst int32ArrayTag = \"[object Int32Array]\";\nconst bigInt64ArrayTag = \"[object BigInt64Array]\";\nconst float32ArrayTag = \"[object Float32Array]\";\nconst float64ArrayTag = \"[object Float64Array]\";\n//#endregion\nexport { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };\n","//#region src/_internal/globalThis.ts\nconst globalThis_ = typeof globalThis === \"object\" && globalThis || typeof window === \"object\" && window || typeof self === \"object\" && self || typeof global === \"object\" && global || (function() {\n\treturn this;\n})() || Function(\"return this\")();\n//#endregion\nexport { globalThis_ };\n","import { globalThis_ } from \"../_internal/globalThis.mjs\";\n//#region src/predicate/isBuffer.ts\n/**\n* Checks if the given value is a Buffer instance.\n*\n* This function tests whether the provided value is an instance of Buffer.\n* It returns `true` if the value is a Buffer, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `Buffer`.\n*\n* @param {unknown} x - The value to check if it is a Buffer.\n* @returns {boolean} Returns `true` if `x` is a Buffer, else `false`.\n*\n* @example\n* const buffer = Buffer.from(\"test\");\n* console.log(isBuffer(buffer)); // true\n*\n* const notBuffer = \"not a buffer\";\n* console.log(isBuffer(notBuffer)); // false\n*/\nfunction isBuffer(x) {\n\treturn typeof globalThis_.Buffer !== \"undefined\" && globalThis_.Buffer.isBuffer(x);\n}\n//#endregion\nexport { isBuffer };\n","//#region src/predicate/isLength.ts\n/**\n* Checks if a given value is a valid length.\n*\n* A valid length is of type `number`, is a non-negative integer, and is less than or equal to\n* JavaScript's maximum safe integer (`Number.MAX_SAFE_INTEGER`).\n* It returns `true` if the value is a valid length, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the\n* argument to a valid length (`number`).\n*\n* @param {any} value The value to check.\n* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n*\n* @example\n* isLength(0); // true\n* isLength(42); // true\n* isLength(-1); // false\n* isLength(1.5); // false\n* isLength(Number.MAX_SAFE_INTEGER); // true\n* isLength(Number.MAX_SAFE_INTEGER + 1); // false\n*/\nfunction isLength(value) {\n\treturn Number.isSafeInteger(value) && value >= 0;\n}\n//#endregion\nexport { isLength };\n","import { isLength } from \"../../predicate/isLength.mjs\";\n//#region src/compat/predicate/isArrayLike.ts\n/**\n* Checks if `value` is array-like.\n*\n* @param {any} value The value to check.\n* @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n*\n* @example\n* isArrayLike([1, 2, 3]); // true\n* isArrayLike('abc'); // true\n* isArrayLike({ 0: 'a', length: 1 }); // true\n* isArrayLike({}); // false\n* isArrayLike(null); // false\n* isArrayLike(undefined); // false\n*/\nfunction isArrayLike(value) {\n\treturn value != null && typeof value !== \"function\" && isLength(value.length);\n}\n//#endregion\nexport { isArrayLike };\n","//#region src/array/chunk.ts\n/**\n* Splits an array into smaller arrays of a specified length.\n*\n* This function takes an input array and divides it into multiple smaller arrays,\n* each of a specified length. If the input array cannot be evenly divided,\n* the final sub-array will contain the remaining elements.\n*\n* @template T The type of elements in the array.\n* @param {T[]} arr - The array to be chunked into smaller arrays.\n* @param {number} size - The size of each smaller array. Must be a positive integer.\n* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n* @throws {Error} Throws an error if `size` is not a positive integer.\n*\n* @example\n* // Splits an array of numbers into sub-arrays of length 2\n* chunk([1, 2, 3, 4, 5], 2);\n* // Returns: [[1, 2], [3, 4], [5]]\n*\n* @example\n* // Splits an array of strings into sub-arrays of length 3\n* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n*/\nfunction chunk(arr, size) {\n\tif (!Number.isInteger(size) || size <= 0) throw new Error(\"Size must be an integer greater than zero.\");\n\tconst chunkLength = Math.ceil(arr.length / size);\n\tconst result = Array(chunkLength);\n\tfor (let index = 0; index < chunkLength; index++) {\n\t\tconst start = index * size;\n\t\tconst end = start + size;\n\t\tresult[index] = arr.slice(start, end);\n\t}\n\treturn result;\n}\n//#endregion\nexport { chunk };\n","//#region src/compat/_internal/toArray.ts\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : Array.from(value);\n}\n//#endregion\nexport { toArray };\n","import { chunk as chunk$1 } from \"../../array/chunk.mjs\";\nimport { toArray } from \"../_internal/toArray.mjs\";\nimport { isArrayLike } from \"../predicate/isArrayLike.mjs\";\n//#region src/compat/array/chunk.ts\n/**\n* Splits an array into smaller arrays of a specified length.\n*\n* This function takes an input array and divides it into multiple smaller arrays,\n* each of a specified length. If the input array cannot be evenly divided,\n* the final sub-array will contain the remaining elements.\n*\n* @template T The type of elements in the array.\n* @param {ArrayLike<T> | null | undefined} arr - The array to be chunked into smaller arrays.\n* @param {number} size - The size of each smaller array. Must be a positive integer.\n* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n*\n* @example\n* // Splits an array of numbers into sub-arrays of length 2\n* chunk([1, 2, 3, 4, 5], 2);\n* // Returns: [[1, 2], [3, 4], [5]]\n*\n* @example\n* // Splits an array of strings into sub-arrays of length 3\n* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n*/\nfunction chunk(arr, size = 1) {\n\tsize = Math.max(Math.floor(size), 0);\n\tif (size === 0 || !isArrayLike(arr)) return [];\n\treturn chunk$1(toArray(arr), size);\n}\n//#endregion\nexport { chunk };\n","//#region src/compat/util/toString.ts\n/**\n* Converts `value` to a string.\n*\n* An empty string is returned for `null` and `undefined` values.\n* The sign of `-0` is preserved.\n*\n* @param {any} value - The value to convert.\n* @returns {string} Returns the converted string.\n*\n* @example\n* toString(null) // returns ''\n* toString(undefined) // returns ''\n* toString(-0) // returns '-0'\n* toString([1, 2, -0]) // returns '1,2,-0'\n* toString([Symbol('a'), Symbol('b')]) // returns 'Symbol(a),Symbol(b)'\n*/\nfunction toString(value) {\n\tif (value == null) return \"\";\n\tif (typeof value === \"string\") return value;\n\tif (Array.isArray(value)) return value.map(toString).join(\",\");\n\tconst result = String(value);\n\tif (result === \"0\" && Object.is(Number(value), -0)) return \"-0\";\n\treturn result;\n}\n//#endregion\nexport { toString };\n","//#region src/compat/_internal/toKey.ts\n/**\n* Converts `value` to a string key if it's not a string or symbol.\n*\n* @private\n* @param {*} value The value to inspect.\n* @returns {string|symbol} Returns the key.\n*/\nfunction toKey(value) {\n\tif (typeof value === \"string\" || typeof value === \"symbol\") return value;\n\tif (Object.is(value?.valueOf?.(), -0)) return \"-0\";\n\treturn String(value);\n}\n//#endregion\nexport { toKey };\n","import { toKey } from \"../_internal/toKey.mjs\";\nimport { toString } from \"./toString.mjs\";\n//#region src/compat/util/toPath.ts\n/**\n* Converts a deep key string into an array of path segments.\n*\n* This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n*\n* @param {any} deepKey - The deep key string to convert.\n* @returns {string[]} An array of strings, each representing a segment of the path.\n*\n* Examples:\n*\n* toPath('a.b.c') // Returns ['a', 'b', 'c']\n* toPath('a[b][c]') // Returns ['a', 'b', 'c']\n* toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n* toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n* toPath('') // Returns []\n* toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n*/\nfunction toPath(deepKey) {\n\tif (Array.isArray(deepKey)) return deepKey.map(toKey);\n\tif (typeof deepKey === \"symbol\") return [deepKey];\n\tdeepKey = toString(deepKey);\n\tconst result = [];\n\tconst length = deepKey.length;\n\tif (length === 0) return result;\n\tlet index = 0;\n\tlet key = \"\";\n\tlet quoteChar = \"\";\n\tlet bracket = false;\n\tif (deepKey.charCodeAt(0) === 46) {\n\t\tresult.push(\"\");\n\t\tindex++;\n\t}\n\twhile (index < length) {\n\t\tconst char = deepKey[index];\n\t\tif (quoteChar) if (char === \"\\\\\" && index + 1 < length) {\n\t\t\tindex++;\n\t\t\tkey += deepKey[index];\n\t\t} else if (char === quoteChar) quoteChar = \"\";\n\t\telse key += char;\n\t\telse if (bracket) if (char === \"\\\"\" || char === \"'\") quoteChar = char;\n\t\telse if (char === \"]\") {\n\t\t\tbracket = false;\n\t\t\tresult.push(key);\n\t\t\tkey = \"\";\n\t\t} else key += char;\n\t\telse if (char === \"[\") {\n\t\t\tbracket = true;\n\t\t\tif (key) {\n\t\t\t\tresult.push(key);\n\t\t\t\tkey = \"\";\n\t\t\t}\n\t\t} else if (char === \".\") {\n\t\t\tif (key) {\n\t\t\t\tresult.push(key);\n\t\t\t\tkey = \"\";\n\t\t\t}\n\t\t} else key += char;\n\t\tindex++;\n\t}\n\tif (key) result.push(key);\n\treturn result;\n}\n//#endregion\nexport { toPath };\n","//#region src/_internal/isUnsafeProperty.ts\n/**\n* Checks if a property key is unsafe to modify directly.\n*\n* This function is used in functions like `merge` to prevent prototype pollution attacks\n* by identifying property keys that could modify the object's prototype chain or constructor.\n*\n* @param key - The property key to check\n* @returns `true` if the property is unsafe to modify directly, `false` otherwise\n* @internal\n*/\nfunction isUnsafeProperty(key) {\n\treturn key === \"__proto__\";\n}\n//#endregion\nexport { isUnsafeProperty };\n","//#region src/compat/_internal/isDeepKey.ts\n/**\n* Checks if a given key is a deep key.\n*\n* A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n*\n* @param {PropertyKey} key - The key to check.\n* @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n*\n* Examples:\n*\n* isDeepKey('a.b') // true\n* isDeepKey('a[b]') // true\n* isDeepKey('a') // false\n* isDeepKey(123) // false\n* isDeepKey('a.b.c') // true\n* isDeepKey('a[b][c]') // true\n*/\nfunction isDeepKey(key) {\n\tswitch (typeof key) {\n\t\tcase \"number\":\n\t\tcase \"symbol\": return false;\n\t\tcase \"string\": return key.includes(\".\") || key.includes(\"[\") || key.includes(\"]\");\n\t}\n}\n//#endregion\nexport { isDeepKey };\n","import { isUnsafeProperty } from \"../../_internal/isUnsafeProperty.mjs\";\nimport { isDeepKey } from \"../_internal/isDeepKey.mjs\";\nimport { toKey } from \"../_internal/toKey.mjs\";\nimport { toPath } from \"../util/toPath.mjs\";\n//#region src/compat/object/get.ts\n/**\n* Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n*\n* @param {any} object - The object to query.\n* @param {PropertyKey | readonly PropertyKey[]} path - The path of the property to get.\n* @param {any} [defaultValue] - The value returned if the resolved value is undefined.\n* @returns {any} Returns the resolved value.\n*\n* @example\n* const object = { a: { b: { c: 1 } } };\n* get(object, 'a.b.c');\n* // => 1\n*\n* get(object, ['a', 'b', 'c']);\n* // => 1\n*\n* get(object, 'a.b.d', 'default');\n* // => 'default'\n*/\nfunction get(object, path, defaultValue) {\n\tif (object == null) return defaultValue;\n\tswitch (typeof path) {\n\t\tcase \"string\": {\n\t\t\tif (isUnsafeProperty(path)) return defaultValue;\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) if (isDeepKey(path)) return get(object, toPath(path), defaultValue);\n\t\t\telse return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t\tcase \"number\":\n\t\tcase \"symbol\": {\n\t\t\tif (typeof path === \"number\") path = toKey(path);\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t\tdefault: {\n\t\t\tif (Array.isArray(path)) return getWithPath(object, path, defaultValue);\n\t\t\tif (Object.is(path?.valueOf(), -0)) path = \"-0\";\n\t\t\telse path = String(path);\n\t\t\tif (isUnsafeProperty(path)) return defaultValue;\n\t\t\tconst result = object[path];\n\t\t\tif (result === void 0) return defaultValue;\n\t\t\treturn result;\n\t\t}\n\t}\n}\nfunction getWithPath(object, path, defaultValue) {\n\tif (path.length === 0) return defaultValue;\n\tlet current = object;\n\tfor (let index = 0; index < path.length; index++) {\n\t\tif (current == null) return defaultValue;\n\t\tif (isUnsafeProperty(path[index])) return defaultValue;\n\t\tcurrent = current[path[index]];\n\t}\n\tif (current === void 0) return defaultValue;\n\treturn current;\n}\n//#endregion\nexport { get };\n","//#region src/compat/predicate/isObject.ts\n/**\n* Checks if the given value is an object. An object is a value that is\n* not a primitive type (string, number, boolean, symbol, null, or undefined).\n*\n* This function tests whether the provided value is an object or not.\n* It returns `true` if the value is an object, and `false` otherwise.\n*\n* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object value.\n*\n* @param {any} value - The value to check if it is an object.\n* @returns {value is object} `true` if the value is an object, `false` otherwise.\n*\n* @example\n* const value1 = {};\n* const value2 = [1, 2, 3];\n* const value3 = () => {};\n* const value4 = null;\n*\n* console.log(isObject(value1)); // true\n* console.log(isObject(value2)); // true\n* console.log(isObject(value3)); // true\n* console.log(isObject(value4)); // false\n*/\nfunction isObject(value) {\n\treturn value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\n//#endregion\nexport { isObject };\n","//#region src/predicate/isPrimitive.ts\n/**\n* Checks whether a value is a JavaScript primitive.\n* JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.\n*\n* @param {unknown} value The value to check.\n* @returns {value is\n* null\n* | undefined\n* | string\n* | number\n* | boolean\n* | symbol\n* | bigint} Returns true if `value` is a primitive, false otherwise.\n*\n* @example\n* isPrimitive(null); // true\n* isPrimitive(undefined); // true\n* isPrimitive('123'); // true\n* isPrimitive(false); // true\n* isPrimitive(true); // true\n* isPrimitive(Symbol('a')); // true\n* isPrimitive(123n); // true\n* isPrimitive({}); // false\n* isPrimitive(new Date()); // false\n* isPrimitive(new Map()); // false\n* isPrimitive(new Set()); // false\n* isPrimitive([1, 2, 3]); // false\n*/\nfunction isPrimitive(value) {\n\treturn value == null || typeof value !== \"object\" && typeof value !== \"function\";\n}\n//#endregion\nexport { isPrimitive };\n","//#region src/predicate/isTypedArray.ts\n/**\n* Checks if a value is a TypedArray.\n* @param {unknown} x The value to check.\n* @returns {x is\n* Uint8Array\n* | Uint8ClampedArray\n* | Uint16Array\n* | Uint32Array\n* | BigUint64Array\n* | Int8Array\n* | Int16Array\n* | Int32Array\n* | BigInt64Array\n* | Float32Array\n* | Float64Array} Returns true if `x` is a TypedArray, false otherwise.\n*\n* @example\n* const arr = new Uint8Array([1, 2, 3]);\n* isTypedArray(arr); // true\n*\n* const regularArray = [1, 2, 3];\n* isTypedArray(regularArray); // false\n*\n* const buffer = new ArrayBuffer(16);\n* isTypedArray(buffer); // false\n*/\nfunction isTypedArray(x) {\n\treturn ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n//#endregion\nexport { isTypedArray };\n","import { isPrimitive } from \"../predicate/isPrimitive.mjs\";\nimport { isTypedArray } from \"../predicate/isTypedArray.mjs\";\nimport { getSymbols } from \"../compat/_internal/getSymbols.mjs\";\nimport { getTag } from \"../compat/_internal/getTag.mjs\";\nimport { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from \"../compat/_internal/tags.mjs\";\nimport { isBuffer } from \"../predicate/isBuffer.mjs\";\n//#region src/object/cloneDeepWith.ts\n/**\n* Deeply clones the given object.\n*\n* You can customize the deep cloning process using the `cloneValue` function.\n* The function takes the current value `value`, the property name `key`, and the entire object `obj` as arguments.\n* If the function returns a value, that value is used;\n* if it returns `undefined`, the default cloning method is used.\n*\n* @template T - The type of the object.\n* @param {T} obj - The object to clone.\n* @param {Function} [cloneValue] - A function to customize the cloning process.\n* @returns {T} - A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = cloneDeepWith(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an object with a customizer\n* const obj = { a: 1, b: 2 };\n* const clonedObj = cloneDeepWith(obj, (value) => {\n* if (typeof value === 'number') {\n* return value * 2; // Double the number\n* }\n* });\n* console.log(clonedObj); // { a: 2, b: 4 }\n* console.log(clonedObj === obj); // false\n*\n* @example\n* // Clone an array with a customizer\n* const arr = [1, 2, 3];\n* const clonedArr = cloneDeepWith(arr, (value) => {\n* return value + 1; // Increment each value\n* });\n* console.log(clonedArr); // [2, 3, 4]\n* console.log(clonedArr === arr); // false\n*/\nfunction cloneDeepWith(obj, cloneValue) {\n\treturn cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue);\n}\nfunction cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {\n\tconst cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);\n\tif (cloned !== void 0) return cloned;\n\tif (isPrimitive(valueToClone)) return valueToClone;\n\tif (stack.has(valueToClone)) return stack.get(valueToClone);\n\tif (Array.isArray(valueToClone)) {\n\t\tconst result = new Array(valueToClone.length);\n\t\tstack.set(valueToClone, result);\n\t\tfor (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n\t\tif (Object.hasOwn(valueToClone, \"index\")) result.index = valueToClone.index;\n\t\tif (Object.hasOwn(valueToClone, \"input\")) result.input = valueToClone.input;\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Date) return new Date(valueToClone.getTime());\n\tif (valueToClone instanceof RegExp) {\n\t\tconst result = new RegExp(valueToClone.source, valueToClone.flags);\n\t\tresult.lastIndex = valueToClone.lastIndex;\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Map) {\n\t\tconst result = /* @__PURE__ */ new Map();\n\t\tstack.set(valueToClone, result);\n\t\tfor (const [key, value] of valueToClone) result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Set) {\n\t\tconst result = /* @__PURE__ */ new Set();\n\t\tstack.set(valueToClone, result);\n\t\tfor (const value of valueToClone) result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));\n\t\treturn result;\n\t}\n\tif (isBuffer(valueToClone)) return valueToClone.subarray();\n\tif (isTypedArray(valueToClone)) {\n\t\tconst result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);\n\t\tstack.set(valueToClone, result);\n\t\tfor (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== \"undefined\" && valueToClone instanceof SharedArrayBuffer) return valueToClone.slice(0);\n\tif (valueToClone instanceof DataView) {\n\t\tconst result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof File !== \"undefined\" && valueToClone instanceof File) {\n\t\tconst result = new File([valueToClone], valueToClone.name, { type: valueToClone.type });\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof Blob !== \"undefined\" && valueToClone instanceof Blob) {\n\t\tconst result = new Blob([valueToClone], { type: valueToClone.type });\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Error) {\n\t\tconst result = structuredClone(valueToClone);\n\t\tstack.set(valueToClone, result);\n\t\tresult.message = valueToClone.message;\n\t\tresult.name = valueToClone.name;\n\t\tresult.stack = valueToClone.stack;\n\t\tresult.cause = valueToClone.cause;\n\t\tresult.constructor = valueToClone.constructor;\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Boolean) {\n\t\tconst result = new Boolean(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof Number) {\n\t\tconst result = new Number(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (valueToClone instanceof String) {\n\t\tconst result = new String(valueToClone.valueOf());\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\tif (typeof valueToClone === \"object\" && isCloneableObject(valueToClone)) {\n\t\tconst result = Object.create(Object.getPrototypeOf(valueToClone));\n\t\tstack.set(valueToClone, result);\n\t\tcopyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n\t\treturn result;\n\t}\n\treturn valueToClone;\n}\nfunction copyProperties(target, source, objectToClone = target, stack, cloneValue) {\n\tconst keys = [...Object.keys(source), ...getSymbols(source)];\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key = keys[i];\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(target, key);\n\t\tif (descriptor == null || descriptor.writable) target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);\n\t}\n}\nfunction isCloneableObject(object) {\n\tswitch (getTag(object)) {\n\t\tcase argumentsTag:\n\t\tcase arrayTag:\n\t\tcase arrayBufferTag:\n\t\tcase dataViewTag:\n\t\tcase booleanTag:\n\t\tcase dateTag:\n\t\tcase float32ArrayTag:\n\t\tcase float64ArrayTag:\n\t\tcase int8ArrayTag:\n\t\tcase int16ArrayTag:\n\t\tcase int32ArrayTag:\n\t\tcase mapTag:\n\t\tcase numberTag:\n\t\tcase objectTag:\n\t\tcase regexpTag:\n\t\tcase setTag:\n\t\tcase stringTag:\n\t\tcase symbolTag:\n\t\tcase uint8ArrayTag:\n\t\tcase uint8ClampedArrayTag:\n\t\tcase uint16ArrayTag:\n\t\tcase uint32ArrayTag: return true;\n\t\tdefault: return false;\n\t}\n}\n//#endregion\nexport { cloneDeepWith, cloneDeepWithImpl, copyProperties };\n","import { getTag } from \"../_internal/getTag.mjs\";\nimport { argumentsTag, booleanTag, numberTag, stringTag } from \"../_internal/tags.mjs\";\nimport { cloneDeepWith as cloneDeepWith$1, copyProperties } from \"../../object/cloneDeepWith.mjs\";\n//#region src/compat/object/cloneDeepWith.ts\n/**\n* Creates a deep clone of the given object using a customizer function.\n*\n* @template T - The type of the object.\n* @param {T} obj - The object to clone.\n* @param {Function} [cloneValue] - A function to customize the cloning process.\n* @returns {T} - A deep clone of the given object.\n*\n* @example\n* // Clone a primitive value\n* const num = 29;\n* const clonedNum = cloneDeepWith(num);\n* console.log(clonedNum); // 29\n* console.log(clonedNum === num); // true\n*\n* @example\n* // Clone an object with a customizer\n* const obj = { a: 1, b: 2 };\n* const clonedObj = cloneDeepWith(obj, (value) => {\n*