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EACA,EACA,EACJ,OAAa,CACZ,IACC,MAAM,QAAmB,SAAS,QAAQ,QAAQ,KAAS,GAC3D,IAAK,EAAW,GACf,MAED,MAAM,EAAW,EAAQ,QAAQ,EAAW,OACtC,EAAW,EAAQ,OAAO,GAChC,QAAqB,IAAjB,GAA8B,IAAa,GAK9C,GAJA,EAAa,CACZ,WACA,aAEI,GAAS,EAAM,GACnB,WAGD,EAAe,EACf,OAAa,CAEf,CAAE,MAAO,GAER,OAAe,EACf,OAAa,EACb,EAAgB,CACjB,CAEA,WADsB,SAAS,IAAI,QAAS,GAAM,WAAW,EAAG,IAAY,IAC/D,GACZ,KAEF,CACA,MAAO,IACH,EACH,gBAEF,CAEA,SAAS,SAAS,EAAS,GAC1B,MAAM,EAAO,EAAQ,KAAM,IAAU,CACpC,IAAI,EACJ,WAED,OAAK,EAGE,QAAQ,KAAK,CAAC,EAAM,EAAM,KAAM,IAAU,CAChD,IAAI,EACJ,aAJO,CAMT,QAES,eAAgB,cAAe","file":"/npm/@vitest/snapshot@5.0.2/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@vitest/snapshot@5.0.2/dist/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","import { parseErrorStacktrace } from '@vitest/utils/source-map';\nimport { getCallLastIndex } from '@vitest/utils/helpers';\nimport { positionToOffset, offsetToLineNumber, lineSplitRE } from '@vitest/utils/offset';\nimport { m as memo, C as CounterMap, D as DefaultMap, e as evaluateSnapshotFile, k as keyToTestName, s as saveSnapshotFile, t as testNameToKey, a as serialize, b as addExtraLineBreaks, n as normalizeNewlines, r as removeExtraLineBreaks, d as deepMergeSnapshot } from './chunk-utils.js';\nexport { c as addSerializer, g as getSerializers } from './chunk-utils.js';\nimport '@vitest/pretty-format';\n\nasync function saveInlineSnapshots(environment, snapshots) {\n\tconst MagicString = (await import('magic-string')).default;\n\tconst files = new Set(snapshots.map((i) => i.file));\n\tawait Promise.all(Array.from(files).map(async (file) => {\n\t\tconst snaps = snapshots.filter((i) => i.file === file);\n\t\tconst code = await environment.readSnapshotFile(file);\n\t\tif (code == null) {\n\t\t\tthrow new Error(`cannot read ${file} when saving inline snapshot`);\n\t\t}\n\t\tconst s = new MagicString(code);\n\t\tfor (const snap of snaps) {\n\t\t\tconst index = positionToOffset(code, snap.line, snap.column);\n\t\t\treplaceInlineSnap(code, s, index, snap.snapshot, snap.assertionName);\n\t\t}\n\t\tconst transformed = s.toString();\n\t\tif (transformed !== code) {\n\t\t\tawait environment.saveSnapshotFile(file, transformed);\n\t\t}\n\t}));\n}\nconst defaultStartObjectRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\s\\S]*\\*\\/\\s*|\\/\\/.*(?:[\\n\\r\\u2028\\u2029]\\s*|[\\t\\v\\f \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF]))*\\{/;\nfunction escapeRegExp(s) {\n\treturn s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nconst buildStartObjectRegex = memo((assertionName) => {\n\tconst replaced = defaultStartObjectRegex.source.replace(\"toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot\", escapeRegExp(assertionName));\n\treturn new RegExp(replaced);\n});\nfunction replaceObjectSnap(code, s, index, newSnap, assertionName) {\n\tlet _code = code.slice(index);\n\tconst regex = assertionName ? buildStartObjectRegex(assertionName) : defaultStartObjectRegex;\n\tconst startMatch = regex.exec(_code);\n\tif (!startMatch) {\n\t\treturn false;\n\t}\n\t_code = _code.slice(startMatch.index);\n\tlet callEnd = getCallLastIndex(_code);\n\tif (callEnd === null) {\n\t\treturn false;\n\t}\n\tcallEnd += index + startMatch.index;\n\tconst shapeStart = index + startMatch.index + startMatch[0].length;\n\tconst shapeEnd = getObjectShapeEndIndex(code, shapeStart);\n\tconst snap = `, ${prepareSnapString(newSnap, code, index)}`;\n\tif (shapeEnd === callEnd) {\n\t\t// toMatchInlineSnapshot({ foo: expect.any(String) })\n\t\ts.appendLeft(callEnd, snap);\n\t} else {\n\t\t// toMatchInlineSnapshot({ foo: expect.any(String) }, ``)\n\t\ts.overwrite(shapeEnd, callEnd, snap);\n\t}\n\treturn true;\n}\nfunction getObjectShapeEndIndex(code, index) {\n\tlet startBraces = 1;\n\tlet endBraces = 0;\n\twhile (startBraces !== endBraces && index < code.length) {\n\t\tconst s = code[index++];\n\t\tif (s === \"{\") {\n\t\t\tstartBraces++;\n\t\t} else if (s === \"}\") {\n\t\t\tendBraces++;\n\t\t}\n\t}\n\treturn index;\n}\nfunction prepareSnapString(snap, source, index) {\n\tconst lineNumber = offsetToLineNumber(source, index);\n\tconst line = source.split(lineSplitRE)[lineNumber - 1];\n\tconst indent = line.match(/^\\s*/)[0] || \"\";\n\tconst indentNext = indent.includes(\"\t\") ? `${indent}\\t` : `${indent}  `;\n\tconst lines = snap.trim().replace(/\\\\/g, \"\\\\\\\\\").split(/\\n/g);\n\tconst isOneline = lines.length <= 1;\n\tconst quote = \"`\";\n\tif (isOneline) {\n\t\treturn `${quote}${lines.join(\"\\n\").replace(/`/g, \"\\\\`\").replace(/\\$\\{/g, \"\\\\${\")}${quote}`;\n\t}\n\treturn `${quote}\\n${lines.map((i) => i ? indentNext + i : \"\").join(\"\\n\").replace(/`/g, \"\\\\`\").replace(/\\$\\{/g, \"\\\\${\")}\\n${indent}${quote}`;\n}\nconst defaultMethodNames = [\"toMatchInlineSnapshot\", \"toThrowErrorMatchingInlineSnapshot\"];\n// on webkit, the line number is at the end of the method, not at the start\nfunction getCodeStartingAtIndex(code, index, methodNames) {\n\tfor (const name of methodNames) {\n\t\tconst adjusted = index - name.length;\n\t\tif (adjusted >= 0 && code.slice(adjusted, index) === name) {\n\t\t\treturn {\n\t\t\t\tcode: code.slice(adjusted),\n\t\t\t\tindex: adjusted\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tcode: code.slice(index),\n\t\tindex\n\t};\n}\nconst defaultStartRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\s\\S]*\\*\\/\\s*|\\/\\/.*(?:[\\n\\r\\u2028\\u2029]\\s*|[\\t\\v\\f \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF]))*[\\w$]*(['\"`)])/;\nconst buildStartRegex = memo((assertionName) => {\n\tconst replaced = defaultStartRegex.source.replace(\"toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot\", escapeRegExp(assertionName));\n\treturn new RegExp(replaced);\n});\nfunction replaceInlineSnap(code, s, currentIndex, newSnap, assertionName) {\n\tconst methodNames = assertionName ? [assertionName] : defaultMethodNames;\n\tconst { code: codeStartingAtIndex, index } = getCodeStartingAtIndex(code, currentIndex, methodNames);\n\tconst startRegex = assertionName ? buildStartRegex(assertionName) : defaultStartRegex;\n\tconst startMatch = startRegex.exec(codeStartingAtIndex);\n\tconst keywordRegex = assertionName ? new RegExp(escapeRegExp(assertionName)) : /toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/;\n\tconst firstKeywordMatch = keywordRegex.exec(codeStartingAtIndex);\n\tif (!startMatch || startMatch.index !== firstKeywordMatch?.index) {\n\t\treturn replaceObjectSnap(code, s, index, newSnap, assertionName);\n\t}\n\tconst quote = startMatch[1];\n\tconst startIndex = index + startMatch.index + startMatch[0].length;\n\tconst snapString = prepareSnapString(newSnap, code, index);\n\tif (quote === \")\") {\n\t\ts.appendRight(startIndex - 1, snapString);\n\t\treturn true;\n\t}\n\tconst quoteEndRE = new RegExp(`(?:^|[^\\\\\\\\])${quote}`);\n\tconst endMatch = quoteEndRE.exec(code.slice(startIndex));\n\tif (!endMatch) {\n\t\treturn false;\n\t}\n\tconst endIndex = startIndex + endMatch.index + endMatch[0].length;\n\ts.overwrite(startIndex - 1, endIndex, snapString);\n\treturn true;\n}\nconst INDENTATION_REGEX = /^([^\\S\\n]*)\\S/m;\nfunction stripSnapshotIndentation(inlineSnapshot) {\n\t// Find indentation if exists.\n\tconst match = inlineSnapshot.match(INDENTATION_REGEX);\n\tif (!match || !match[1]) {\n\t\t// No indentation.\n\t\treturn inlineSnapshot;\n\t}\n\tconst indentation = match[1];\n\tconst lines = inlineSnapshot.split(/\\n/g);\n\tif (lines.length <= 2) {\n\t\t// Must be at least 3 lines.\n\t\treturn inlineSnapshot;\n\t}\n\tif (lines[0].trim() !== \"\" || lines.at(-1)?.trim() !== \"\") {\n\t\t// If not blank first and last lines, abort.\n\t\treturn inlineSnapshot;\n\t}\n\tfor (let i = 1; i < lines.length - 1; i++) {\n\t\tif (lines[i] !== \"\") {\n\t\t\tif (lines[i].indexOf(indentation) !== 0) {\n\t\t\t\t// All lines except first and last should either be blank or have the same\n\t\t\t\t// indent as the first line (or more). If this isn't the case we don't\n\t\t\t\t// want to touch the snapshot at all.\n\t\t\t\treturn inlineSnapshot;\n\t\t\t}\n\t\t\tlines[i] = lines[i].substring(indentation.length);\n\t\t}\n\t}\n\t// Last line is a special case because it won't have the same indent as others\n\t// but may still have been given some indent to line up.\n\tlines[lines.length - 1] = \"\";\n\t// Return inline snapshot, now at indent 0.\n\tinlineSnapshot = lines.join(\"\\n\");\n\treturn inlineSnapshot;\n}\n\nasync function saveRawSnapshots(environment, snapshots) {\n\tawait Promise.all(snapshots.map(async (snap) => {\n\t\tif (!snap.readonly) {\n\t\t\tawait environment.saveSnapshotFile(snap.file, snap.snapshot);\n\t\t}\n\t}));\n}\n\nfunction isSameStackPosition(x, y) {\n\treturn x.file === y.file && x.column === y.column && x.line === y.line;\n}\nclass SnapshotState {\n\ttestFilePath;\n\tsnapshotPath;\n\t_counters = new CounterMap();\n\t_dirty;\n\t_updateSnapshot;\n\t_snapshotData;\n\t_initialData;\n\t_inlineSnapshots;\n\t_inlineSnapshotStacks;\n\t_testIdToKeys = new DefaultMap(() => []);\n\t_rawSnapshots;\n\t_uncheckedKeys;\n\t_snapshotFormat;\n\t_environment;\n\t_fileExists;\n\texpand;\n\t// getter/setter for jest-image-snapshot compat\n\t// https://github.com/vitest-dev/vitest/issues/7322\n\t_added = new CounterMap();\n\t_matched = new CounterMap();\n\t_unmatched = new CounterMap();\n\t_updated = new CounterMap();\n\tget added() {\n\t\treturn this._added;\n\t}\n\tset added(value) {\n\t\tthis._added._total = value;\n\t}\n\tget matched() {\n\t\treturn this._matched;\n\t}\n\tset matched(value) {\n\t\tthis._matched._total = value;\n\t}\n\tget unmatched() {\n\t\treturn this._unmatched;\n\t}\n\tset unmatched(value) {\n\t\tthis._unmatched._total = value;\n\t}\n\tget updated() {\n\t\treturn this._updated;\n\t}\n\tset updated(value) {\n\t\tthis._updated._total = value;\n\t}\n\tconstructor(testFilePath, snapshotPath, fileData, options) {\n\t\tthis.testFilePath = testFilePath;\n\t\tthis.snapshotPath = snapshotPath;\n\t\tconst data = fileData ?? Object.create(null);\n\t\tthis._fileExists = fileData != null;\n\t\tconst update = options.updateSnapshot;\n\t\tconst dirty = (update === \"all\" || update === \"new\") && fileData != null;\n\t\tthis._initialData = { ...data };\n\t\tthis._snapshotData = { ...data };\n\t\tthis._dirty = dirty;\n\t\tthis._inlineSnapshots = [];\n\t\tthis._inlineSnapshotStacks = [];\n\t\tthis._rawSnapshots = [];\n\t\tthis._uncheckedKeys = new Set(Object.keys(this._snapshotData));\n\t\tthis.expand = options.expand || false;\n\t\tthis._updateSnapshot = options.updateSnapshot;\n\t\tthis._snapshotFormat = {\n\t\t\tprintBasicPrototype: false,\n\t\t\tescapeString: false,\n\t\t\t// more generous safety cap 128MB (same as Node's util.inspect)\n\t\t\t// instead of tighter pretty-format default 1MB\n\t\t\t// since users can purposely save large snapshot to a dedicated file.\n\t\t\tmaxOutputLength: 2 ** 27,\n\t\t\t...options.snapshotFormat\n\t\t};\n\t\tthis._environment = options.snapshotEnvironment;\n\t}\n\tstatic async create(testFilePath, options) {\n\t\tconst environment = options.snapshotEnvironment;\n\t\tconst snapshotPath = await environment.resolvePath(testFilePath);\n\t\tlet fileData;\n\t\tif (environment.readSnapshotFileData) {\n\t\t\tfileData = await environment.readSnapshotFileData(snapshotPath);\n\t\t} else {\n\t\t\tconst content = await environment.readSnapshotFile(snapshotPath);\n\t\t\tfileData = content != null ? evaluateSnapshotFile(snapshotPath, content) : null;\n\t\t}\n\t\treturn new SnapshotState(testFilePath, snapshotPath, fileData, options);\n\t}\n\tget snapshotUpdateState() {\n\t\treturn this._updateSnapshot;\n\t}\n\tget environment() {\n\t\treturn this._environment;\n\t}\n\tmarkSnapshotsAsCheckedForTest(testName) {\n\t\tthis._uncheckedKeys.forEach((uncheckedKey) => {\n\t\t\t// skip snapshots with following keys\n\t\t\t//   testName n\n\t\t\t//   testName > xxx n (this is for toMatchSnapshot(\"xxx\") API)\n\t\t\tif (uncheckedKey.startsWith(testName) && /^ \\d+$|^ > /.test(uncheckedKey.slice(testName.length))) {\n\t\t\t\tthis._uncheckedKeys.delete(uncheckedKey);\n\t\t\t}\n\t\t});\n\t}\n\tclearTest(testId) {\n\t\t// clear inline\n\t\tthis._inlineSnapshots = this._inlineSnapshots.filter((s) => s.testId !== testId);\n\t\tthis._inlineSnapshotStacks = this._inlineSnapshotStacks.filter((s) => s.testId !== testId);\n\t\t// clear file\n\t\tfor (const key of this._testIdToKeys.get(testId)) {\n\t\t\tconst name = keyToTestName(key);\n\t\t\tconst count = this._counters.get(name);\n\t\t\tif (count > 0) {\n\t\t\t\tif (key in this._snapshotData || key in this._initialData) {\n\t\t\t\t\tthis._snapshotData[key] = this._initialData[key];\n\t\t\t\t}\n\t\t\t\tthis._counters.set(name, count - 1);\n\t\t\t}\n\t\t}\n\t\tthis._testIdToKeys.delete(testId);\n\t\t// clear stats\n\t\tthis.added.delete(testId);\n\t\tthis.updated.delete(testId);\n\t\tthis.matched.delete(testId);\n\t\tthis.unmatched.delete(testId);\n\t}\n\t_inferInlineSnapshotStack(stacks) {\n\t\t// if called inside resolves/rejects, stacktrace is different\n\t\tconst promiseIndex = stacks.findIndex((i) => i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));\n\t\tif (promiseIndex !== -1) {\n\t\t\treturn stacks[promiseIndex + 3];\n\t\t}\n\t\t// support poll + inline snapshot\n\t\tconst pollChainIndex = stacks.findIndex((i) => i.method.match(/__VITEST_POLL_CHAIN__/));\n\t\tif (pollChainIndex !== -1) {\n\t\t\treturn stacks[pollChainIndex + 1];\n\t\t}\n\t\t// inline snapshot function can be named __INLINE_SNAPSHOT_OFFSET_<n>__\n\t\t// to specify a custom stack offset\n\t\tfor (let i = 0; i < stacks.length; i++) {\n\t\t\tconst match = stacks[i].method.match(/__INLINE_SNAPSHOT_OFFSET_(\\d+)__/);\n\t\t\tif (match) {\n\t\t\t\treturn stacks[i + Number(match[1])] ?? null;\n\t\t\t}\n\t\t}\n\t\t// custom matcher registered via expect.extend() — the wrapper function\n\t\t// in jest-extend.ts is named __VITEST_EXTEND_ASSERTION__\n\t\tconst customMatcherIndex = stacks.findIndex((i) => i.method.includes(\"__VITEST_EXTEND_ASSERTION__\"));\n\t\tif (customMatcherIndex !== -1) {\n\t\t\treturn stacks[customMatcherIndex + 3] ?? null;\n\t\t}\n\t\t// inline snapshot function is called __INLINE_SNAPSHOT__\n\t\t// in integrations/snapshot/chai.ts\n\t\tconst stackIndex = stacks.findIndex((i) => i.method.includes(\"__INLINE_SNAPSHOT__\"));\n\t\treturn stackIndex !== -1 ? stacks[stackIndex + 2] : null;\n\t}\n\t_addSnapshot(key, receivedSerialized, options) {\n\t\tthis._dirty = true;\n\t\tif (options.stack) {\n\t\t\tthis._inlineSnapshots.push({\n\t\t\t\t...options.stack,\n\t\t\t\tsnapshot: receivedSerialized,\n\t\t\t\ttestId: options.testId,\n\t\t\t\tassertionName: options.assertionName\n\t\t\t});\n\t\t} else if (options.rawSnapshot) {\n\t\t\tthis._rawSnapshots.push({\n\t\t\t\t...options.rawSnapshot,\n\t\t\t\tsnapshot: receivedSerialized\n\t\t\t});\n\t\t} else {\n\t\t\tthis._snapshotData[key] = receivedSerialized;\n\t\t}\n\t}\n\t_resolveKey(testId, testName, key) {\n\t\tthis._counters.increment(testName);\n\t\tconst count = this._counters.get(testName);\n\t\tif (!key) {\n\t\t\tkey = testNameToKey(testName, count);\n\t\t}\n\t\tthis._testIdToKeys.get(testId).push(key);\n\t\treturn {\n\t\t\tkey,\n\t\t\tcount\n\t\t};\n\t}\n\t_resolveInlineStack(options) {\n\t\tconst { testId, snapshot, assertionName, error } = options;\n\t\tconst stacks = parseErrorStacktrace(error, { ignoreStackEntries: [] });\n\t\tconst _stack = this._inferInlineSnapshotStack(stacks);\n\t\tif (!_stack) {\n\t\t\tconst message = stacks.map((s) => `  ${s.file}:${s.line}:${s.column}${s.method ? ` (${s.method})` : \"\"}`).join(\"\\n\");\n\t\t\tthrow new Error(`@vitest/snapshot: Couldn't infer stack frame for inline snapshot.\\n${message}`);\n\t\t}\n\t\tconst stack = this.environment.processStackTrace?.(_stack) || _stack;\n\t\t// removing 1 column, because source map points to the wrong\n\t\t// location for js files, but `column-1` points to the same in both js/ts\n\t\t// https://github.com/vitejs/vite/issues/8657\n\t\tstack.column--;\n\t\t// reject multiple inline snapshots at the same location if snapshot is different\n\t\tconst snapshotsWithSameStack = this._inlineSnapshotStacks.filter((s) => isSameStackPosition(s, stack));\n\t\tif (snapshotsWithSameStack.length > 0) {\n\t\t\t// ensure only one snapshot will be written at the same location\n\t\t\tthis._inlineSnapshots = this._inlineSnapshots.filter((s) => !isSameStackPosition(s, stack));\n\t\t\tconst differentSnapshot = snapshotsWithSameStack.find((s) => s.snapshot !== snapshot);\n\t\t\tif (differentSnapshot) {\n\t\t\t\tthrow Object.assign(new Error(`${assertionName} with different snapshots cannot be called at the same location`), {\n\t\t\t\t\tactual: snapshot,\n\t\t\t\t\texpected: differentSnapshot.snapshot\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tthis._inlineSnapshotStacks.push({\n\t\t\t...stack,\n\t\t\ttestId,\n\t\t\tsnapshot\n\t\t});\n\t\treturn stack;\n\t}\n\t_reconcile(opts) {\n\t\t// These are the conditions on when to write snapshots:\n\t\t//  * There's no snapshot file in a non-CI environment.\n\t\t//  * There is a snapshot file and we decided to update the snapshot.\n\t\t//  * There is a snapshot file, but it doesn't have this snapshot.\n\t\t// These are the conditions on when not to write snapshots:\n\t\t//  * The update flag is set to 'none'.\n\t\t//  * There's no snapshot file or a file without this snapshot on a CI environment.\n\t\tif (opts.hasSnapshot && this._updateSnapshot === \"all\" || (!opts.hasSnapshot || !opts.snapshotIsPersisted) && (this._updateSnapshot === \"new\" || this._updateSnapshot === \"all\")) {\n\t\t\tif (this._updateSnapshot === \"all\") {\n\t\t\t\tif (!opts.pass) {\n\t\t\t\t\tif (opts.hasSnapshot) {\n\t\t\t\t\t\tthis.updated.increment(opts.testId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.added.increment(opts.testId);\n\t\t\t\t\t}\n\t\t\t\t\tthis._addSnapshot(opts.key, opts.addValue, {\n\t\t\t\t\t\tstack: opts.stack,\n\t\t\t\t\t\ttestId: opts.testId,\n\t\t\t\t\t\trawSnapshot: opts.rawSnapshot,\n\t\t\t\t\t\tassertionName: opts.assertionName\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.matched.increment(opts.testId);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._addSnapshot(opts.key, opts.addValue, {\n\t\t\t\t\tstack: opts.stack,\n\t\t\t\t\ttestId: opts.testId,\n\t\t\t\t\trawSnapshot: opts.rawSnapshot,\n\t\t\t\t\tassertionName: opts.assertionName\n\t\t\t\t});\n\t\t\t\tthis.added.increment(opts.testId);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tactual: \"\",\n\t\t\t\tcount: opts.count,\n\t\t\t\texpected: \"\",\n\t\t\t\tkey: opts.key,\n\t\t\t\tpass: true\n\t\t\t};\n\t\t} else {\n\t\t\tif (!opts.pass) {\n\t\t\t\tthis.unmatched.increment(opts.testId);\n\t\t\t\treturn {\n\t\t\t\t\tactual: opts.actualDisplay,\n\t\t\t\t\tcount: opts.count,\n\t\t\t\t\texpected: opts.expectedDisplay,\n\t\t\t\t\tkey: opts.key,\n\t\t\t\t\tpass: false\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tthis.matched.increment(opts.testId);\n\t\t\t\treturn {\n\t\t\t\t\tactual: \"\",\n\t\t\t\t\tcount: opts.count,\n\t\t\t\t\texpected: \"\",\n\t\t\t\t\tkey: opts.key,\n\t\t\t\t\tpass: true\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\tasync save() {\n\t\tconst hasExternalSnapshots = Object.keys(this._snapshotData).length;\n\t\tconst hasInlineSnapshots = this._inlineSnapshots.length;\n\t\tconst hasRawSnapshots = this._rawSnapshots.length;\n\t\tconst isEmpty = !hasExternalSnapshots && !hasInlineSnapshots && !hasRawSnapshots;\n\t\tconst status = {\n\t\t\tdeleted: false,\n\t\t\tsaved: false\n\t\t};\n\t\tif ((this._dirty || this._uncheckedKeys.size) && !isEmpty) {\n\t\t\tif (hasExternalSnapshots) {\n\t\t\t\tawait saveSnapshotFile(this._environment, this._snapshotData, this.snapshotPath);\n\t\t\t\tthis._fileExists = true;\n\t\t\t}\n\t\t\tif (hasInlineSnapshots) {\n\t\t\t\tawait saveInlineSnapshots(this._environment, this._inlineSnapshots);\n\t\t\t}\n\t\t\tif (hasRawSnapshots) {\n\t\t\t\tawait saveRawSnapshots(this._environment, this._rawSnapshots);\n\t\t\t}\n\t\t\tstatus.saved = true;\n\t\t} else if (!hasExternalSnapshots && this._fileExists) {\n\t\t\tif (this._updateSnapshot === \"all\") {\n\t\t\t\tawait this._environment.removeSnapshotFile(this.snapshotPath);\n\t\t\t\tthis._fileExists = false;\n\t\t\t}\n\t\t\tstatus.deleted = true;\n\t\t}\n\t\treturn status;\n\t}\n\tgetUncheckedCount() {\n\t\treturn this._uncheckedKeys.size || 0;\n\t}\n\tgetUncheckedKeys() {\n\t\treturn Array.from(this._uncheckedKeys);\n\t}\n\tremoveUncheckedKeys() {\n\t\tif (this._updateSnapshot === \"all\" && this._uncheckedKeys.size) {\n\t\t\tthis._dirty = true;\n\t\t\tthis._uncheckedKeys.forEach((key) => delete this._snapshotData[key]);\n\t\t\tthis._uncheckedKeys.clear();\n\t\t}\n\t}\n\tprobeExpectedSnapshot(options) {\n\t\tconst count = this._counters.get(options.testName) + 1;\n\t\tconst key = testNameToKey(options.testName, count);\n\t\treturn {\n\t\t\tkey,\n\t\t\tcount,\n\t\t\tdata: options?.isInline ? options.inlineSnapshot : this._snapshotData[key],\n\t\t\tmarkAsChecked: () => {\n\t\t\t\tthis._counters.increment(options.testName);\n\t\t\t\tthis._testIdToKeys.get(options.testId).push(key);\n\t\t\t\tthis._uncheckedKeys.delete(key);\n\t\t\t}\n\t\t};\n\t}\n\tmatch({ testId, testName, received, key, inlineSnapshot, isInline, error, rawSnapshot, assertionName }) {\n\t\tconst resolved = this._resolveKey(testId, testName, key);\n\t\tkey = resolved.key;\n\t\tconst count = resolved.count;\n\t\t// Do not mark the snapshot as \"checked\" if the snapshot is inline and\n\t\t// there's an external snapshot. This way the external snapshot can be\n\t\t// removed with `--updateSnapshot`.\n\t\tif (!(isInline && this._snapshotData[key] !== undefined)) {\n\t\t\tthis._uncheckedKeys.delete(key);\n\t\t}\n\t\tlet receivedSerialized = rawSnapshot && typeof received === \"string\" ? received : serialize(received, undefined, this._snapshotFormat);\n\t\tif (!rawSnapshot) {\n\t\t\treceivedSerialized = addExtraLineBreaks(receivedSerialized);\n\t\t}\n\t\tif (rawSnapshot) {\n\t\t\t// normalize EOL when snapshot contains CRLF but received is LF\n\t\t\tif (rawSnapshot.content && /\\r\\n/.test(rawSnapshot.content) && !/\\r\\n/.test(receivedSerialized)) {\n\t\t\t\trawSnapshot.content = normalizeNewlines(rawSnapshot.content);\n\t\t\t}\n\t\t}\n\t\tconst expected = isInline ? inlineSnapshot : rawSnapshot ? rawSnapshot.content : this._snapshotData[key];\n\t\tconst expectedTrimmed = rawSnapshot ? expected : expected?.trim();\n\t\tconst pass = expectedTrimmed === (rawSnapshot ? receivedSerialized : receivedSerialized.trim());\n\t\tconst hasSnapshot = expected !== undefined;\n\t\tconst snapshotIsPersisted = isInline || this._fileExists || rawSnapshot && rawSnapshot.content != null;\n\t\tif (pass && !isInline && !rawSnapshot) {\n\t\t\t// When the file is re-saved (because other snapshots changed), the JS\n\t\t\t// round-trip can lose proper escaping. Refresh in-memory data with the\n\t\t\t// freshly serialized string so the file is written correctly.\n\t\t\t// _reconcile does not write _snapshotData on pass, so this is the only\n\t\t\t// place it gets refreshed. Domain snapshots skip this because the stored\n\t\t\t// value may contain match patterns that differ from the received output.\n\t\t\tthis._snapshotData[key] = receivedSerialized;\n\t\t}\n\t\tconst stack = isInline ? this._resolveInlineStack({\n\t\t\ttestId,\n\t\t\tsnapshot: receivedSerialized,\n\t\t\tassertionName: assertionName || \"toMatchInlineSnapshot\",\n\t\t\terror: error || new Error(\"snapshot\")\n\t\t}) : undefined;\n\t\treturn this._reconcile({\n\t\t\ttestId,\n\t\t\tkey,\n\t\t\tcount,\n\t\t\tpass,\n\t\t\thasSnapshot,\n\t\t\tsnapshotIsPersisted: !!snapshotIsPersisted,\n\t\t\taddValue: receivedSerialized,\n\t\t\tactualDisplay: rawSnapshot ? receivedSerialized : removeExtraLineBreaks(receivedSerialized),\n\t\t\texpectedDisplay: expectedTrimmed !== undefined ? rawSnapshot ? expectedTrimmed : removeExtraLineBreaks(expectedTrimmed) : undefined,\n\t\t\tstack,\n\t\t\trawSnapshot,\n\t\t\tassertionName\n\t\t});\n\t}\n\tprocessDomainSnapshot({ testId, received, expectedSnapshot, matchResult, isInline, error, assertionName }) {\n\t\tconst stack = isInline ? this._resolveInlineStack({\n\t\t\ttestId,\n\t\t\tsnapshot: received,\n\t\t\tassertionName,\n\t\t\terror: error || new Error(\"STACK_TRACE_ERROR\")\n\t\t}) : undefined;\n\t\tconst actualResolved = matchResult?.resolved ?? received;\n\t\tconst expectedResolved = matchResult?.expected ?? expectedSnapshot.data;\n\t\treturn this._reconcile({\n\t\t\ttestId,\n\t\t\tkey: expectedSnapshot.key,\n\t\t\tcount: expectedSnapshot.count,\n\t\t\tpass: matchResult?.pass ?? false,\n\t\t\thasSnapshot: expectedSnapshot.data !== undefined,\n\t\t\tsnapshotIsPersisted: isInline ? true : this._fileExists,\n\t\t\taddValue: actualResolved,\n\t\t\tactualDisplay: removeExtraLineBreaks(actualResolved),\n\t\t\texpectedDisplay: expectedResolved !== undefined ? removeExtraLineBreaks(expectedResolved) : undefined,\n\t\t\tstack,\n\t\t\tassertionName\n\t\t});\n\t}\n\tasync pack() {\n\t\tconst snapshot = {\n\t\t\tfilepath: this.testFilePath,\n\t\t\tadded: 0,\n\t\t\tfileDeleted: false,\n\t\t\tmatched: 0,\n\t\t\tunchecked: 0,\n\t\t\tuncheckedKeys: [],\n\t\t\tunmatched: 0,\n\t\t\tupdated: 0\n\t\t};\n\t\tconst uncheckedCount = this.getUncheckedCount();\n\t\tconst uncheckedKeys = this.getUncheckedKeys();\n\t\tif (uncheckedCount) {\n\t\t\tthis.removeUncheckedKeys();\n\t\t}\n\t\tconst status = await this.save();\n\t\tsnapshot.fileDeleted = status.deleted;\n\t\tsnapshot.added = this.added.total();\n\t\tsnapshot.matched = this.matched.total();\n\t\tsnapshot.unmatched = this.unmatched.total();\n\t\tsnapshot.updated = this.updated.total();\n\t\tsnapshot.unchecked = !status.deleted ? uncheckedCount : 0;\n\t\tsnapshot.uncheckedKeys = Array.from(uncheckedKeys);\n\t\treturn snapshot;\n\t}\n}\n\nfunction createMismatchError(message, expand, actual, expected) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"actual\", {\n\t\tvalue: actual,\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t\twritable: true\n\t});\n\tObject.defineProperty(error, \"expected\", {\n\t\tvalue: expected,\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t\twritable: true\n\t});\n\tObject.defineProperty(error, \"diffOptions\", { value: { expand } });\n\treturn error;\n}\nclass SnapshotClient {\n\toptions;\n\tsnapshotStateMap = new Map();\n\tconstructor(options = {}) {\n\t\tthis.options = options;\n\t}\n\tasync setup(filepath, options) {\n\t\tif (this.snapshotStateMap.has(filepath)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.snapshotStateMap.set(filepath, await SnapshotState.create(filepath, options));\n\t}\n\tasync finish(filepath) {\n\t\tconst state = this.getSnapshotState(filepath);\n\t\tconst result = await state.pack();\n\t\tthis.snapshotStateMap.delete(filepath);\n\t\treturn result;\n\t}\n\tskipTest(filepath, testName) {\n\t\tconst state = this.getSnapshotState(filepath);\n\t\tstate.markSnapshotsAsCheckedForTest(testName);\n\t}\n\tclearTest(filepath, testId) {\n\t\tconst state = this.getSnapshotState(filepath);\n\t\tstate.clearTest(testId);\n\t}\n\tgetSnapshotState(filepath) {\n\t\tconst state = this.snapshotStateMap.get(filepath);\n\t\tif (!state) {\n\t\t\tthrow new Error(`The snapshot state for '${filepath}' is not found. Did you call 'SnapshotClient.setup()'?`);\n\t\t}\n\t\treturn state;\n\t}\n\tmatch(options) {\n\t\tconst { filepath, name, testId = name, message, isInline = false, properties, inlineSnapshot, error, errorMessage, rawSnapshot, assertionName } = options;\n\t\tlet { received } = options;\n\t\tif (!filepath) {\n\t\t\tthrow new Error(\"Snapshot cannot be used outside of test\");\n\t\t}\n\t\tconst snapshotState = this.getSnapshotState(filepath);\n\t\tif (rawSnapshot?.file === snapshotState.snapshotPath) {\n\t\t\t// note that this hard rejection is best-effort in a sense that,\n\t\t\t// if `toMatchFileSnapshot` is called with a different test file's snapshot path,\n\t\t\t// this check will not catch it.\n\t\t\tthrow new Error(`File snapshot cannot use the same path as the test snapshot file: ${rawSnapshot.file}`);\n\t\t}\n\t\tconst testName = [name, ...message ? [message] : []].join(\" > \");\n\t\t// Probe first so we can mark as checked even on early return\n\t\tconst expectedSnapshot = snapshotState.probeExpectedSnapshot({\n\t\t\ttestName,\n\t\t\ttestId,\n\t\t\tisInline,\n\t\t\tinlineSnapshot\n\t\t});\n\t\tif (typeof properties === \"object\") {\n\t\t\tif (typeof received !== \"object\" || !received) {\n\t\t\t\texpectedSnapshot.markAsChecked();\n\t\t\t\tthrow new Error(\"Received value must be an object when the matcher has properties\");\n\t\t\t}\n\t\t\tlet propertiesPass;\n\t\t\ttry {\n\t\t\t\tpropertiesPass = this.options.isEqual?.(received, properties) ?? false;\n\t\t\t} catch (err) {\n\t\t\t\texpectedSnapshot.markAsChecked();\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif (!propertiesPass) {\n\t\t\t\texpectedSnapshot.markAsChecked();\n\t\t\t\treturn {\n\t\t\t\t\tpass: false,\n\t\t\t\t\tmessage: () => errorMessage || \"Snapshot properties mismatched\",\n\t\t\t\t\tactual: received,\n\t\t\t\t\texpected: properties\n\t\t\t\t};\n\t\t\t}\n\t\t\treceived = deepMergeSnapshot(received, properties);\n\t\t}\n\t\tconst { actual, expected, key, pass } = snapshotState.match({\n\t\t\ttestId,\n\t\t\ttestName,\n\t\t\treceived,\n\t\t\tisInline,\n\t\t\terror,\n\t\t\tinlineSnapshot,\n\t\t\trawSnapshot,\n\t\t\tassertionName\n\t\t});\n\t\treturn {\n\t\t\tpass,\n\t\t\tmessage: () => `Snapshot \\`${key || \"unknown\"}\\` mismatched`,\n\t\t\tactual: rawSnapshot ? actual : actual?.trim(),\n\t\t\texpected: rawSnapshot ? expected : expected?.trim()\n\t\t};\n\t}\n\tassert(options) {\n\t\tconst result = this.match(options);\n\t\tif (!result.pass) {\n\t\t\tconst snapshotState = this.getSnapshotState(options.filepath);\n\t\t\tthrow createMismatchError(result.message(), snapshotState.expand, result.actual, result.expected);\n\t\t}\n\t}\n\tmatchDomain(options) {\n\t\tconst { received, filepath, name, testId = name, message, adapter, isInline = false, inlineSnapshot, error } = options;\n\t\tif (!filepath) {\n\t\t\tthrow new Error(\"Snapshot cannot be used outside of test\");\n\t\t}\n\t\tconst captured = adapter.capture(received);\n\t\tconst rendered = adapter.render(captured);\n\t\tconst snapshotState = this.getSnapshotState(filepath);\n\t\tconst testName = [name, ...message ? [message] : []].join(\" > \");\n\t\tconst expectedSnapshot = snapshotState.probeExpectedSnapshot({\n\t\t\ttestName,\n\t\t\ttestId,\n\t\t\tisInline,\n\t\t\tinlineSnapshot\n\t\t});\n\t\texpectedSnapshot.markAsChecked();\n\t\tconst matchResult = expectedSnapshot.data !== undefined ? adapter.match(captured, adapter.parseExpected(expectedSnapshot.data)) : undefined;\n\t\tconst { actual, expected, key, pass } = snapshotState.processDomainSnapshot({\n\t\t\ttestId,\n\t\t\treceived: rendered,\n\t\t\texpectedSnapshot,\n\t\t\tmatchResult,\n\t\t\tisInline,\n\t\t\terror,\n\t\t\tassertionName: options.assertionName\n\t\t});\n\t\treturn {\n\t\t\tpass,\n\t\t\tmessage: () => `Snapshot \\`${key}\\` mismatched`,\n\t\t\tactual: actual?.trim(),\n\t\t\texpected: expected?.trim()\n\t\t};\n\t}\n\tasync pollMatchDomain(options) {\n\t\tconst { poll, filepath, name, testId = name, message, adapter, isInline = false, inlineSnapshot, error, timeout = 1e3, interval = 50 } = options;\n\t\tif (!filepath) {\n\t\t\tthrow new Error(\"Snapshot cannot be used outside of test\");\n\t\t}\n\t\tconst snapshotState = this.getSnapshotState(filepath);\n\t\tconst testName = [name, ...message ? [message] : []].join(\" > \");\n\t\tconst expectedSnapshot = snapshotState.probeExpectedSnapshot({\n\t\t\ttestName,\n\t\t\ttestId,\n\t\t\tisInline,\n\t\t\tinlineSnapshot\n\t\t});\n\t\tconst reference = expectedSnapshot.data !== undefined && snapshotState.snapshotUpdateState !== \"all\" ? adapter.parseExpected(expectedSnapshot.data) : undefined;\n\t\tconst timeoutController = new AbortController();\n\t\tconst timedOut = timeout > 0 ? new Promise((r) => setTimeout(() => {\n\t\t\ttimeoutController.abort();\n\t\t\tr();\n\t\t}, timeout)) : undefined;\n\t\tconst stableResult = await getStableSnapshot({\n\t\t\tadapter,\n\t\t\tpoll: () => poll({ signal: timeoutController.signal }),\n\t\t\tinterval,\n\t\t\ttimedOut,\n\t\t\tmatch: reference ? (captured) => adapter.match(captured, reference).pass : undefined\n\t\t});\n\t\texpectedSnapshot.markAsChecked();\n\t\tif (stableResult?.rendered === undefined) {\n\t\t\t// the original caller `expect.poll` later manipulates error via `throwWithCause`,\n\t\t\t// so here we can directly throw `lastPollError` if exists.\n\t\t\tif (stableResult?.lastPollError) {\n\t\t\t\tthrow stableResult.lastPollError;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tpass: false,\n\t\t\t\tmessage: () => `poll() did not produce a stable snapshot within the timeout`\n\t\t\t};\n\t\t}\n\t\t// TODO: should `all` mode ignore parse error?\n\t\t// Silently hiding the error and creating snapshot full scratch isn't good either.\n\t\t// Users can fix or purge the broken snapshot manually and that decision affects how domain snapshot gets updated.\n\t\tconst matchResult = expectedSnapshot.data !== undefined ? adapter.match(stableResult.captured, adapter.parseExpected(expectedSnapshot.data)) : undefined;\n\t\tconst { actual, expected, key, pass } = snapshotState.processDomainSnapshot({\n\t\t\ttestId,\n\t\t\treceived: stableResult.rendered,\n\t\t\texpectedSnapshot,\n\t\t\tmatchResult,\n\t\t\tisInline,\n\t\t\terror,\n\t\t\tassertionName: options.assertionName\n\t\t});\n\t\treturn {\n\t\t\tpass,\n\t\t\tmessage: () => `Snapshot \\`${key}\\` mismatched`,\n\t\t\tactual: actual?.trim(),\n\t\t\texpected: expected?.trim()\n\t\t};\n\t}\n\tasync assertRaw(options) {\n\t\tif (!options.rawSnapshot) {\n\t\t\tthrow new Error(\"Raw snapshot is required\");\n\t\t}\n\t\tconst { filepath, rawSnapshot } = options;\n\t\tif (rawSnapshot.content == null) {\n\t\t\tif (!filepath) {\n\t\t\t\tthrow new Error(\"Snapshot cannot be used outside of test\");\n\t\t\t}\n\t\t\tconst snapshotState = this.getSnapshotState(filepath);\n\t\t\t// save the filepath, so it don't lose even if the await make it out-of-context\n\t\t\toptions.filepath ||= filepath;\n\t\t\t// resolve and read the raw snapshot file\n\t\t\trawSnapshot.file = await snapshotState.environment.resolveRawPath(filepath, rawSnapshot.file);\n\t\t\trawSnapshot.content = await snapshotState.environment.readSnapshotFile(rawSnapshot.file) ?? undefined;\n\t\t}\n\t\treturn this.assert(options);\n\t}\n\tclear() {\n\t\tthis.snapshotStateMap.clear();\n\t}\n}\n/**\n* Polls repeatedly until the value reaches a stable state.\n*\n* Compares consecutive rendered outputs from the current session —\n* when two consecutive polls produce the same rendered string,\n* the value is considered stable.\n*\n* Every `await` (poll call, interval delay) races against `timedOut`\n* so that hanging polls and delays are interrupted.\n*/\nasync function getStableSnapshot({ adapter, poll, interval, timedOut, match }) {\n\tlet lastRendered;\n\tlet lastPollError;\n\tlet lastStable;\n\twhile (true) {\n\t\ttry {\n\t\t\tconst pollResult = await raceWith(Promise.resolve(poll()), timedOut);\n\t\t\tif (!pollResult.ok) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst captured = adapter.capture(pollResult.value);\n\t\t\tconst rendered = adapter.render(captured);\n\t\t\tif (lastRendered !== undefined && rendered === lastRendered) {\n\t\t\t\tlastStable = {\n\t\t\t\t\tcaptured,\n\t\t\t\t\trendered\n\t\t\t\t};\n\t\t\t\tif (!match || match(captured)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlastRendered = rendered;\n\t\t\t\tlastStable = undefined;\n\t\t\t}\n\t\t} catch (pollError) {\n\t\t\t// poll() threw — reset stability baseline and retry\n\t\t\tlastRendered = undefined;\n\t\t\tlastStable = undefined;\n\t\t\tlastPollError = pollError;\n\t\t}\n\t\tconst delayed = await raceWith(new Promise((r) => setTimeout(r, interval)), timedOut);\n\t\tif (!delayed.ok) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn {\n\t\t...lastStable,\n\t\tlastPollError\n\t};\n}\n/** Type-safe `Promise.race` — tells you which promise won. */\nfunction raceWith(promise, other) {\n\tconst left = promise.then((value) => ({\n\t\tok: true,\n\t\tvalue\n\t}));\n\tif (!other) {\n\t\treturn left;\n\t}\n\treturn Promise.race([left, other.then((value) => ({\n\t\tok: false,\n\t\tvalue\n\t}))]);\n}\n\nexport { SnapshotClient, SnapshotState, stripSnapshotIndentation };\n"]}