You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
46 KiB
1 lines
46 KiB
{"version":3,"file":"immer.js","sources":["../src/common.js","../src/patches.js","../src/es5.js","../src/proxy.js","../src/immer.js","../src/index.js"],"sourcesContent":["export const NOTHING =\n typeof Symbol !== \"undefined\"\n ? Symbol(\"immer-nothing\")\n : {[\"immer-nothing\"]: true}\n\nexport const DRAFT_STATE =\n typeof Symbol !== \"undefined\" ? Symbol(\"immer-state\") : \"__$immer_state\"\n\nexport function isDraft(value) {\n return !!value && !!value[DRAFT_STATE]\n}\n\nexport function isDraftable(value) {\n if (!value) return false\n if (typeof value !== \"object\") return false\n if (Array.isArray(value)) return true\n const proto = Object.getPrototypeOf(value)\n return proto === null || proto === Object.prototype\n}\n\nexport function original(value) {\n if (value && value[DRAFT_STATE]) {\n return value[DRAFT_STATE].base\n }\n // otherwise return undefined\n}\n\nexport const assign =\n Object.assign ||\n function assign(target, value) {\n for (let key in value) {\n if (has(value, key)) {\n target[key] = value[key]\n }\n }\n return target\n }\n\nexport function shallowCopy(value) {\n if (Array.isArray(value)) return value.slice()\n const target = value.__proto__ === undefined ? Object.create(null) : {}\n return assign(target, value)\n}\n\nexport function each(value, cb) {\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) cb(i, value[i], value)\n } else {\n for (let key in value) cb(key, value[key], value)\n }\n}\n\nexport function has(thing, prop) {\n return Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\nexport function is(x, y) {\n // From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y\n } else {\n return x !== x && y !== y\n }\n}\n","import {each} from \"./common\"\n\nexport function generatePatches(state, basePath, patches, inversePatches) {\n Array.isArray(state.base)\n ? generateArrayPatches(state, basePath, patches, inversePatches)\n : generateObjectPatches(state, basePath, patches, inversePatches)\n}\n\nexport function generateArrayPatches(state, basePath, patches, inversePatches) {\n const {base, copy, assigned} = state\n const minLength = Math.min(base.length, copy.length)\n\n // Look for replaced indices.\n for (let i = 0; i < minLength; i++) {\n if (assigned[i] && base[i] !== copy[i]) {\n const path = basePath.concat(i)\n patches.push({op: \"replace\", path, value: copy[i]})\n inversePatches.push({op: \"replace\", path, value: base[i]})\n }\n }\n\n // Did the array expand?\n if (minLength < copy.length) {\n for (let i = minLength; i < copy.length; i++) {\n patches.push({\n op: \"add\",\n path: basePath.concat(i),\n value: copy[i]\n })\n }\n inversePatches.push({\n op: \"replace\",\n path: basePath.concat(\"length\"),\n value: base.length\n })\n }\n\n // ...or did it shrink?\n else if (minLength < base.length) {\n patches.push({\n op: \"replace\",\n path: basePath.concat(\"length\"),\n value: copy.length\n })\n for (let i = minLength; i < base.length; i++) {\n inversePatches.push({\n op: \"add\",\n path: basePath.concat(i),\n value: base[i]\n })\n }\n }\n}\n\nfunction generateObjectPatches(state, basePath, patches, inversePatches) {\n const {base, copy} = state\n each(state.assigned, (key, assignedValue) => {\n const origValue = base[key]\n const value = copy[key]\n const op = !assignedValue ? \"remove\" : key in base ? \"replace\" : \"add\"\n if (origValue === base && op === \"replace\") return\n const path = basePath.concat(key)\n patches.push(op === \"remove\" ? {op, path} : {op, path, value})\n inversePatches.push(\n op === \"add\"\n ? {op: \"remove\", path}\n : op === \"remove\"\n ? {op: \"add\", path, value: origValue}\n : {op: \"replace\", path, value: origValue}\n )\n })\n}\n\nexport function applyPatches(draft, patches) {\n for (let i = 0; i < patches.length; i++) {\n const patch = patches[i]\n const {path} = patch\n if (path.length === 0 && patch.op === \"replace\") {\n draft = patch.value\n } else {\n let base = draft\n for (let i = 0; i < path.length - 1; i++) {\n base = base[path[i]]\n if (!base || typeof base !== \"object\")\n throw new Error(\"Cannot apply patch, path doesn't resolve: \" + path.join(\"/\")) // prettier-ignore\n }\n const key = path[path.length - 1]\n switch (patch.op) {\n case \"replace\":\n case \"add\":\n // TODO: add support is not extensive, it does not support insertion or `-` atm!\n base[key] = patch.value\n break\n case \"remove\":\n if (Array.isArray(base)) {\n if (key !== base.length - 1)\n throw new Error(`Only the last index of an array can be removed, index: ${key}, length: ${base.length}`) // prettier-ignore\n base.length -= 1\n } else {\n delete base[key]\n }\n break\n default:\n throw new Error(\"Unsupported patch operation: \" + patch.op)\n }\n }\n }\n return draft\n}\n","\"use strict\"\n// @ts-check\n\nimport {\n each,\n has,\n is,\n isDraft,\n isDraftable,\n shallowCopy,\n DRAFT_STATE\n} from \"./common\"\n\nconst descriptors = {}\n\n// For nested produce calls:\nexport const scopes = []\nexport const currentScope = () => scopes[scopes.length - 1]\n\nexport function willFinalize(result, baseDraft, needPatches) {\n const scope = currentScope()\n scope.forEach(state => (state.finalizing = true))\n if (result === undefined || result === baseDraft) {\n if (needPatches) markChangesRecursively(baseDraft)\n // This is faster when we don't care about which attributes changed.\n markChangesSweep(scope)\n }\n}\n\nexport function createDraft(base, parent) {\n let draft\n if (isDraft(base)) {\n const state = base[DRAFT_STATE]\n // Avoid creating new drafts when copying.\n state.finalizing = true\n draft = shallowCopy(state.draft)\n state.finalizing = false\n } else {\n draft = shallowCopy(base)\n }\n each(base, prop => {\n Object.defineProperty(draft, \"\" + prop, createPropertyProxy(\"\" + prop))\n })\n\n // See \"proxy.js\" for property documentation.\n const state = {\n scope: parent ? parent.scope : currentScope(),\n modified: false,\n finalizing: false, // es5 only\n finalized: false,\n assigned: {},\n parent,\n base,\n draft,\n copy: null,\n revoke,\n revoked: false // es5 only\n }\n\n createHiddenProperty(draft, DRAFT_STATE, state)\n state.scope.push(state)\n return draft\n}\n\nfunction revoke() {\n this.revoked = true\n}\n\nfunction source(state) {\n return state.copy || state.base\n}\n\nfunction get(state, prop) {\n assertUnrevoked(state)\n const value = source(state)[prop]\n // Drafts are only created for proxyable values that exist in the base state.\n if (!state.finalizing && value === state.base[prop] && isDraftable(value)) {\n prepareCopy(state)\n return (state.copy[prop] = createDraft(value, state))\n }\n return value\n}\n\nfunction set(state, prop, value) {\n assertUnrevoked(state)\n state.assigned[prop] = true\n if (!state.modified) {\n if (is(source(state)[prop], value)) return\n markChanged(state)\n prepareCopy(state)\n }\n state.copy[prop] = value\n}\n\nfunction markChanged(state) {\n if (!state.modified) {\n state.modified = true\n if (state.parent) markChanged(state.parent)\n }\n}\n\nfunction prepareCopy(state) {\n if (!state.copy) state.copy = shallowCopy(state.base)\n}\n\nfunction createPropertyProxy(prop) {\n return (\n descriptors[prop] ||\n (descriptors[prop] = {\n configurable: true,\n enumerable: true,\n get() {\n return get(this[DRAFT_STATE], prop)\n },\n set(value) {\n set(this[DRAFT_STATE], prop, value)\n }\n })\n )\n}\n\nfunction assertUnrevoked(state) {\n if (state.revoked === true)\n throw new Error(\n \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n JSON.stringify(state.copy || state.base)\n )\n}\n\n// This looks expensive, but only proxies are visited, and only objects without known changes are scanned.\nfunction markChangesSweep(scope) {\n // The natural order of drafts in the `scope` array is based on when they\n // were accessed. By processing drafts in reverse natural order, we have a\n // better chance of processing leaf nodes first. When a leaf node is known to\n // have changed, we can avoid any traversal of its ancestor nodes.\n for (let i = scope.length - 1; i >= 0; i--) {\n const state = scope[i]\n if (state.modified === false) {\n if (Array.isArray(state.base)) {\n if (hasArrayChanges(state)) markChanged(state)\n } else if (hasObjectChanges(state)) markChanged(state)\n }\n }\n}\n\nfunction markChangesRecursively(object) {\n if (!object || typeof object !== \"object\") return\n const state = object[DRAFT_STATE]\n if (!state) return\n const {base, draft, assigned} = state\n if (!Array.isArray(object)) {\n // Look for added keys.\n Object.keys(draft).forEach(key => {\n // The `undefined` check is a fast path for pre-existing keys.\n if (base[key] === undefined && !has(base, key)) {\n assigned[key] = true\n markChanged(state)\n } else if (!assigned[key]) {\n // Only untouched properties trigger recursion.\n markChangesRecursively(draft[key])\n }\n })\n // Look for removed keys.\n Object.keys(base).forEach(key => {\n // The `undefined` check is a fast path for pre-existing keys.\n if (draft[key] === undefined && !has(draft, key)) {\n assigned[key] = false\n markChanged(state)\n }\n })\n } else if (hasArrayChanges(state)) {\n markChanged(state)\n assigned.length = true\n if (draft.length < base.length) {\n for (let i = draft.length; i < base.length; i++) assigned[i] = false\n } else {\n for (let i = base.length; i < draft.length; i++) assigned[i] = true\n }\n for (let i = 0; i < draft.length; i++) {\n // Only untouched indices trigger recursion.\n if (assigned[i] === undefined) markChangesRecursively(draft[i])\n }\n }\n}\n\nfunction hasObjectChanges(state) {\n const {base, draft} = state\n\n // Search for added keys. Start at the back, because non-numeric keys\n // are ordered by time of definition on the object.\n const keys = Object.keys(draft)\n for (let i = keys.length - 1; i >= 0; i--) {\n // The `undefined` check is a fast path for pre-existing keys.\n if (base[keys[i]] === undefined && !has(base, keys[i])) {\n return true\n }\n }\n\n // Since no keys have been added, we can compare lengths to know if an\n // object has been deleted.\n return keys.length !== Object.keys(base).length\n}\n\nfunction hasArrayChanges(state) {\n const {draft} = state\n if (draft.length !== state.base.length) return true\n // See #116\n // If we first shorten the length, our array interceptors will be removed.\n // If after that new items are added, result in the same original length,\n // those last items will have no intercepting property.\n // So if there is no own descriptor on the last position, we know that items were removed and added\n // N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check\n // the last one\n const descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1)\n // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)\n if (descriptor && !descriptor.get) return true\n // For all other cases, we don't have to compare, as they would have been picked up by the index setters\n return false\n}\n\nfunction createHiddenProperty(target, prop, value) {\n Object.defineProperty(target, prop, {\n value: value,\n enumerable: false,\n writable: true\n })\n}\n","\"use strict\"\n// @ts-check\n\nimport {\n assign,\n each,\n has,\n is,\n isDraftable,\n isDraft,\n shallowCopy,\n DRAFT_STATE\n} from \"./common\"\n\n// For nested produce calls:\nexport const scopes = []\nexport const currentScope = () => scopes[scopes.length - 1]\n\n// Do nothing before being finalized.\nexport function willFinalize() {}\n\nexport function createDraft(base, parent) {\n const state = {\n // Track which produce call this is associated with.\n scope: parent ? parent.scope : currentScope(),\n // True for both shallow and deep changes.\n modified: false,\n // Used during finalization.\n finalized: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned: {},\n // The parent draft state.\n parent,\n // The base state.\n base,\n // The base proxy.\n draft: null,\n // Any property proxies.\n drafts: {},\n // The base copy with any updated values.\n copy: null,\n // Called by the `produce` function.\n revoke: null\n }\n\n const {revoke, proxy} = Array.isArray(base)\n ? Proxy.revocable([state], arrayTraps)\n : Proxy.revocable(state, objectTraps)\n\n state.draft = proxy\n state.revoke = revoke\n\n state.scope.push(state)\n return proxy\n}\n\nconst objectTraps = {\n get,\n has(target, prop) {\n return prop in source(target)\n },\n ownKeys(target) {\n return Reflect.ownKeys(source(target))\n },\n set,\n deleteProperty,\n getOwnPropertyDescriptor,\n defineProperty,\n setPrototypeOf() {\n throw new Error(\"Immer does not support `setPrototypeOf()`.\")\n }\n}\n\nconst arrayTraps = {}\neach(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0]\n return fn.apply(this, arguments)\n }\n})\narrayTraps.deleteProperty = function(state, prop) {\n if (isNaN(parseInt(prop)))\n throw new Error(\n \"Immer does not support deleting properties from arrays: \" + prop\n )\n return objectTraps.deleteProperty.call(this, state[0], prop)\n}\narrayTraps.set = function(state, prop, value) {\n if (prop !== \"length\" && isNaN(parseInt(prop)))\n throw new Error(\n \"Immer does not support setting non-numeric properties on arrays: \" +\n prop\n )\n return objectTraps.set.call(this, state[0], prop, value)\n}\n\nfunction source(state) {\n return state.copy || state.base\n}\n\nfunction get(state, prop) {\n if (prop === DRAFT_STATE) return state\n let {drafts} = state\n\n // Check for existing draft in unmodified state.\n if (!state.modified && has(drafts, prop)) {\n return drafts[prop]\n }\n\n const value = source(state)[prop]\n if (state.finalized || !isDraftable(value)) return value\n\n // Check for existing draft in modified state.\n if (state.modified) {\n // Assigned values are never drafted. This catches any drafts we created, too.\n if (value !== state.base[prop]) return value\n // Store drafts on the copy (when one exists).\n drafts = state.copy\n }\n\n return (drafts[prop] = createDraft(value, state))\n}\n\nfunction set(state, prop, value) {\n if (!state.modified) {\n // Optimize based on value's truthiness. Truthy values are guaranteed to\n // never be undefined, so we can avoid the `in` operator. Lastly, truthy\n // values may be drafts, but falsy values are never drafts.\n const isUnchanged = value\n ? is(state.base[prop], value) || value === state.drafts[prop]\n : is(state.base[prop], value) && prop in state.base\n if (isUnchanged) return true\n markChanged(state)\n }\n state.assigned[prop] = true\n state.copy[prop] = value\n return true\n}\n\nfunction deleteProperty(state, prop) {\n // The `undefined` check is a fast path for pre-existing keys.\n if (state.base[prop] !== undefined || prop in state.base) {\n state.assigned[prop] = false\n markChanged(state)\n }\n if (state.copy) delete state.copy[prop]\n return true\n}\n\nfunction getOwnPropertyDescriptor(state, prop) {\n const owner = state.modified\n ? state.copy\n : has(state.drafts, prop)\n ? state.drafts\n : state.base\n const descriptor = Reflect.getOwnPropertyDescriptor(owner, prop)\n if (descriptor && !(Array.isArray(owner) && prop === \"length\"))\n descriptor.configurable = true\n return descriptor\n}\n\nfunction defineProperty() {\n throw new Error(\n \"Immer does not support defining properties on draft objects.\"\n )\n}\n\nfunction markChanged(state) {\n if (!state.modified) {\n state.modified = true\n state.copy = assign(shallowCopy(state.base), state.drafts)\n state.drafts = null\n if (state.parent) markChanged(state.parent)\n }\n}\n","import * as legacyProxy from \"./es5\"\nimport * as modernProxy from \"./proxy\"\nimport {generatePatches} from \"./patches\"\nimport {\n assign,\n each,\n is,\n isDraft,\n isDraftable,\n shallowCopy,\n DRAFT_STATE,\n NOTHING\n} from \"./common\"\n\nfunction verifyMinified() {}\n\nconst configDefaults = {\n useProxies: typeof Proxy !== \"undefined\" && typeof Reflect !== \"undefined\",\n autoFreeze:\n typeof process !== \"undefined\"\n ? process.env.NODE_ENV !== \"production\"\n : verifyMinified.name === \"verifyMinified\",\n onAssign: null,\n onDelete: null,\n onCopy: null\n}\n\nexport class Immer {\n constructor(config) {\n assign(this, configDefaults, config)\n this.setUseProxies(this.useProxies)\n this.produce = this.produce.bind(this)\n }\n produce(base, recipe, patchListener) {\n // curried invocation\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe\n recipe = base\n\n // prettier-ignore\n return (base = defaultBase, ...args) =>\n this.produce(base, draft => recipe.call(draft, draft, ...args))\n }\n\n // prettier-ignore\n {\n if (typeof recipe !== \"function\") throw new Error(\"if first argument is not a function, the second argument to produce should be a function\")\n if (patchListener !== undefined && typeof patchListener !== \"function\") throw new Error(\"the third argument of a producer should not be set or a function\")\n }\n\n let result\n // Only create proxies for plain objects/arrays.\n if (!isDraftable(base)) {\n result = recipe(base)\n if (result === undefined) return base\n }\n // See #100, don't nest producers\n else if (isDraft(base)) {\n result = recipe.call(base, base)\n if (result === undefined) return base\n }\n // The given value must be proxied.\n else {\n this.scopes.push([])\n const baseDraft = this.createDraft(base)\n try {\n result = recipe.call(baseDraft, baseDraft)\n this.willFinalize(result, baseDraft, !!patchListener)\n\n // Never generate patches when no listener exists.\n var patches = patchListener && [],\n inversePatches = patchListener && []\n\n // Finalize the modified draft...\n if (result === undefined || result === baseDraft) {\n result = this.finalize(\n baseDraft,\n [],\n patches,\n inversePatches\n )\n }\n // ...or use a replacement value.\n else {\n // Users must never modify the draft _and_ return something else.\n if (baseDraft[DRAFT_STATE].modified)\n throw new Error(\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\") // prettier-ignore\n\n // Finalize the replacement in case it contains (or is) a subset of the draft.\n if (isDraftable(result)) result = this.finalize(result)\n\n if (patchListener) {\n patches.push({\n op: \"replace\",\n path: [],\n value: result\n })\n inversePatches.push({\n op: \"replace\",\n path: [],\n value: base\n })\n }\n }\n } finally {\n this.currentScope().forEach(state => state.revoke())\n this.scopes.pop()\n }\n patchListener && patchListener(patches, inversePatches)\n }\n // Normalize the result.\n return result === NOTHING ? undefined : result\n }\n setAutoFreeze(value) {\n this.autoFreeze = value\n }\n setUseProxies(value) {\n this.useProxies = value\n assign(this, value ? modernProxy : legacyProxy)\n }\n /**\n * @internal\n * Finalize a draft, returning either the unmodified base state or a modified\n * copy of the base state.\n */\n finalize(draft, path, patches, inversePatches) {\n const state = draft[DRAFT_STATE]\n if (!state) {\n if (Object.isFrozen(draft)) return draft\n return this.finalizeTree(draft)\n }\n // Never finalize drafts owned by an outer scope.\n if (state.scope !== this.currentScope()) {\n return draft\n }\n if (!state.modified) return state.base\n if (!state.finalized) {\n state.finalized = true\n this.finalizeTree(state.draft, path, patches, inversePatches)\n if (this.onDelete) {\n const {assigned} = state\n for (const prop in assigned)\n assigned[prop] || this.onDelete(state, prop)\n }\n if (this.onCopy) this.onCopy(state)\n\n // Nested producers must never auto-freeze their result,\n // because it may contain drafts from parent producers.\n if (this.autoFreeze && this.scopes.length === 1) {\n Object.freeze(state.copy)\n }\n\n if (patches) generatePatches(state, path, patches, inversePatches)\n }\n return state.copy\n }\n /**\n * @internal\n * Finalize all drafts in the given state tree.\n */\n finalizeTree(root, path, patches, inversePatches) {\n const state = root[DRAFT_STATE]\n if (state) {\n root = this.useProxies\n ? state.copy\n : (state.copy = shallowCopy(state.draft))\n }\n\n const {onAssign} = this\n const finalizeProperty = (prop, value, parent) => {\n // Only `root` can be a draft in here.\n const inDraft = !!state && parent === root\n\n if (isDraft(value)) {\n // prettier-ignore\n parent[prop] = value =\n // Patches are never generated for assigned properties.\n patches && inDraft && !state.assigned[prop]\n ? this.finalize(value, path.concat(prop), patches, inversePatches)\n : this.finalize(value)\n\n // Unchanged drafts are ignored.\n if (inDraft && value === state.base[prop]) return\n }\n // Unchanged draft properties are ignored.\n else if (inDraft && is(value, state.base[prop])) {\n return\n }\n // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n else if (isDraftable(value) && !Object.isFrozen(value)) {\n each(value, finalizeProperty)\n }\n\n if (inDraft && onAssign) {\n onAssign(state, prop, value)\n }\n }\n\n each(root, finalizeProperty)\n return root\n }\n}\n","import {applyPatches as applyPatchesImpl} from \"./patches\"\nimport {Immer} from \"./immer\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce = immer.produce\nexport default produce\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is disabled in production.\n */\nexport const setAutoFreeze = value => immer.setAutoFreeze(value)\n\n/**\n * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n * always faster than using ES5 proxies.\n *\n * By default, feature detection is used, so calling this is rarely necessary.\n */\nexport const setUseProxies = value => immer.setUseProxies(value)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = produce(applyPatchesImpl)\n\nexport {original, isDraft, NOTHING as nothing} from \"./common\"\n\nexport {Immer}\n"],"names":["NOTHING","Symbol","DRAFT_STATE","isDraft","value","isDraftable","Array","isArray","proto","Object","getPrototypeOf","prototype","original","base","assign","target","key","has","shallowCopy","slice","__proto__","undefined","create","each","cb","i","length","thing","prop","hasOwnProperty","call","is","x","y","generatePatches","state","basePath","patches","inversePatches","generateArrayPatches","generateObjectPatches","copy","assigned","minLength","Math","min","path","concat","push","op","assignedValue","origValue","applyPatches","draft","patch","Error","join","descriptors","scopes","currentScope","willFinalize","result","baseDraft","needPatches","scope","forEach","finalizing","markChangesRecursively","createDraft","parent","defineProperty","createPropertyProxy","revoke","revoked","source","get","set","modified","markChanged","prepareCopy","assertUnrevoked","JSON","stringify","markChangesSweep","hasArrayChanges","hasObjectChanges","object","keys","descriptor","getOwnPropertyDescriptor","createHiddenProperty","Proxy","revocable","arrayTraps","objectTraps","proxy","Reflect","ownKeys","fn","arguments","apply","deleteProperty","isNaN","parseInt","drafts","finalized","isUnchanged","owner","configurable","verifyMinified","configDefaults","process","env","NODE_ENV","name","Immer","config","setUseProxies","useProxies","produce","bind","recipe","patchListener","defaultBase","args","finalize","pop","autoFreeze","modernProxy","legacyProxy","isFrozen","finalizeTree","onDelete","onCopy","freeze","root","onAssign","finalizeProperty","inDraft","immer","setAutoFreeze","applyPatchesImpl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,UACT,OAAOC,MAAP,KAAkB,WAAlB,GACMA,OAAO,eAAP,CADN,sBAEQ,eAFR,EAE0B,IAF1B,CADG;;AAKP,AAAO,IAAMC,cACT,OAAOD,MAAP,KAAkB,WAAlB,GAAgCA,OAAO,aAAP,CAAhC,GAAwD,gBADrD;;AAGP,AAAO,SAASE,OAAT,CAAiBC,KAAjB,EAAwB;WACpB,CAAC,CAACA,KAAF,IAAW,CAAC,CAACA,MAAMF,WAAN,CAApB;;;AAGJ,AAAO,SAASG,WAAT,CAAqBD,KAArB,EAA4B;QAC3B,CAACA,KAAL,EAAY,OAAO,KAAP;QACR,QAAOA,KAAP,yCAAOA,KAAP,OAAiB,QAArB,EAA+B,OAAO,KAAP;QAC3BE,MAAMC,OAAN,CAAcH,KAAd,CAAJ,EAA0B,OAAO,IAAP;QACpBI,QAAQC,OAAOC,cAAP,CAAsBN,KAAtB,CAAd;WACOI,UAAU,IAAV,IAAkBA,UAAUC,OAAOE,SAA1C;;;AAGJ,AAAO,SAASC,QAAT,CAAkBR,KAAlB,EAAyB;QACxBA,SAASA,MAAMF,WAAN,CAAb,EAAiC;eACtBE,MAAMF,WAAN,EAAmBW,IAA1B;;;;;AAKR,AAAO,IAAMC,SACTL,OAAOK,MA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