@powerhousedao/powerhouse-vetra-packages 6.2.0-dev.3 → 6.2.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/browser/{connect-ZnLjvmRt.js → connect-DPNyOTBV.js} +4 -4
  2. package/dist/browser/{connect-ZnLjvmRt.js.map → connect-DPNyOTBV.js.map} +1 -1
  3. package/dist/browser/{dist-C1nRM9t2.js → dist-Bha1Om6O.js} +4 -25
  4. package/dist/browser/dist-Bha1Om6O.js.map +1 -0
  5. package/dist/browser/{dist-DLFI75Zd.js → dist-DnQpckQ8.js} +2 -2
  6. package/dist/browser/{dist-DLFI75Zd.js.map → dist-DnQpckQ8.js.map} +1 -1
  7. package/dist/browser/{document-drive-oqv68jDU.js → document-drive-CDaY4aIj.js} +5 -7
  8. package/dist/browser/document-drive-CDaY4aIj.js.map +1 -0
  9. package/dist/browser/document-models/index.js +1 -1
  10. package/dist/browser/{editor-DC3bigBu.js → editor-BtOSWTjb.js} +5 -5
  11. package/dist/browser/{editor-DC3bigBu.js.map → editor-BtOSWTjb.js.map} +1 -1
  12. package/dist/browser/{editor-CoTq6fqT.js → editor-CJFM1rC9.js} +6 -6
  13. package/dist/browser/{editor-CoTq6fqT.js.map → editor-CJFM1rC9.js.map} +1 -1
  14. package/dist/browser/editors/document-model-editor/module.js +1 -1
  15. package/dist/browser/editors/generic-drive-explorer/index.js +4 -4
  16. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  17. package/dist/browser/{folder-view-DmYBf2pP.js → folder-view-DAhpWssS.js} +3 -3
  18. package/dist/browser/{folder-view-DmYBf2pP.js.map → folder-view-DAhpWssS.js.map} +1 -1
  19. package/dist/browser/{graphql-editor-CiGd_Li7.js → graphql-editor-Dwgpm08w.js} +3 -3
  20. package/dist/browser/{graphql-editor-CiGd_Li7.js.map → graphql-editor-Dwgpm08w.js.map} +1 -1
  21. package/dist/browser/index.js +2 -2
  22. package/dist/browser/{json-editor-sEqd5piI.js → json-editor-SKLjwlux.js} +3 -3
  23. package/dist/browser/{json-editor-sEqd5piI.js.map → json-editor-SKLjwlux.js.map} +1 -1
  24. package/dist/browser/{state-schemas-DJmzG_M8.js → state-schemas-S69fnpVk.js} +3 -3
  25. package/dist/browser/{state-schemas-DJmzG_M8.js.map → state-schemas-S69fnpVk.js.map} +1 -1
  26. package/dist/node/{connect-BLC4PXD9.mjs → connect-5a3Nx0Jd.mjs} +4 -4
  27. package/dist/node/{connect-BLC4PXD9.mjs.map → connect-5a3Nx0Jd.mjs.map} +1 -1
  28. package/dist/node/{dist-Cn3iExnV.mjs → dist-C7ZmTHz4.mjs} +2 -2
  29. package/dist/node/{dist-Cn3iExnV.mjs.map → dist-C7ZmTHz4.mjs.map} +1 -1
  30. package/dist/node/{dist-Bm05eoTg.mjs → dist-QOGgRb-y.mjs} +4 -25
  31. package/dist/node/dist-QOGgRb-y.mjs.map +1 -0
  32. package/dist/node/{document-drive-sM33juXr.mjs → document-drive-BK2-EDni.mjs} +5 -7
  33. package/dist/node/document-drive-BK2-EDni.mjs.map +1 -0
  34. package/dist/node/document-models/index.mjs +1 -1
  35. package/dist/node/{editor-BFBa9nsO.mjs → editor-BNOTRmUU.mjs} +6 -6
  36. package/dist/node/{editor-BFBa9nsO.mjs.map → editor-BNOTRmUU.mjs.map} +1 -1
  37. package/dist/node/{editor-BrS98lEH.mjs → editor-C_Gchmop.mjs} +5 -5
  38. package/dist/node/{editor-BrS98lEH.mjs.map → editor-C_Gchmop.mjs.map} +1 -1
  39. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  40. package/dist/node/editors/generic-drive-explorer/index.mjs +4 -4
  41. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  42. package/dist/node/{folder-view-DHph3Yuu.mjs → folder-view-af4hVjjx.mjs} +3 -3
  43. package/dist/node/{folder-view-DHph3Yuu.mjs.map → folder-view-af4hVjjx.mjs.map} +1 -1
  44. package/dist/node/{graphql-editor-CPq7oIbf.mjs → graphql-editor-BoTCyC9n.mjs} +3 -3
  45. package/dist/node/{graphql-editor-CPq7oIbf.mjs.map → graphql-editor-BoTCyC9n.mjs.map} +1 -1
  46. package/dist/node/index.mjs +2 -2
  47. package/dist/node/{json-editor-L32CP7TS.mjs → json-editor-Bk4_b03g.mjs} +3 -3
  48. package/dist/node/{json-editor-L32CP7TS.mjs.map → json-editor-Bk4_b03g.mjs.map} +1 -1
  49. package/dist/node/{state-schemas-XTTjQZOe.mjs → state-schemas-DMw1UvT8.mjs} +3 -3
  50. package/dist/node/{state-schemas-XTTjQZOe.mjs.map → state-schemas-DMw1UvT8.mjs.map} +1 -1
  51. package/package.json +6 -6
  52. package/dist/browser/dist-C1nRM9t2.js.map +0 -1
  53. package/dist/browser/document-drive-oqv68jDU.js.map +0 -1
  54. package/dist/node/dist-Bm05eoTg.mjs.map +0 -1
  55. package/dist/node/document-drive-sM33juXr.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-drive-BK2-EDni.mjs","names":["stringify","cjsModule","stringify","isDefinedNonNullAny","definedNonNullAnySchema","z.any","z.enum","z.string","z.union","z.object","z.lazy","z.number","z.unknown","z.literal","z.array","z.boolean","stringify","isStateOfType","assertIsStateOfType","isDocumentOfType","assertIsDocumentOfType","#tags","#tagString","#level","#includeStack","z.any","z.enum","z.object","z.string","z.literal","z.boolean","z.array","z.union","createState$1"],"sources":["../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js","../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js","../../../../node_modules/.pnpm/sha1-uint8array@0.10.7/node_modules/sha1-uint8array/dist/sha1-uint8array.mjs","../../../shared/dist/utils-DKOFCM0Q.js","../../../../node_modules/.pnpm/fflate@0.8.2/node_modules/fflate/esm/index.mjs","../../../../node_modules/.pnpm/mutative@1.3.0/node_modules/mutative/dist/mutative.esm.mjs","../../../shared/dist/document-model/index.js","../../../document-model/dist/index.js","../../../shared/dist/document-drive/index.js"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","/**\n * sha1-uint8array.ts\n */\nconst K = [\n 0x5a827999 | 0,\n 0x6ed9eba1 | 0,\n 0x8f1bbcdc | 0,\n 0xca62c1d6 | 0,\n];\nconst algorithms = {\n sha1: 1,\n};\nexport function createHash(algorithm) {\n if (algorithm && !algorithms[algorithm] && !algorithms[algorithm.toLowerCase()]) {\n throw new Error(\"Digest method not supported\");\n }\n return new Hash();\n}\nclass Hash {\n constructor() {\n this.A = 0x67452301 | 0;\n this.B = 0xefcdab89 | 0;\n this.C = 0x98badcfe | 0;\n this.D = 0x10325476 | 0;\n this.E = 0xc3d2e1f0 | 0;\n this._size = 0;\n this._sp = 0; // surrogate pair\n if (!sharedBuffer || sharedOffset >= 8000 /* N.allocTotal */) {\n sharedBuffer = new ArrayBuffer(8000 /* N.allocTotal */);\n sharedOffset = 0;\n }\n this._byte = new Uint8Array(sharedBuffer, sharedOffset, 80 /* N.allocBytes */);\n this._word = new Int32Array(sharedBuffer, sharedOffset, 20 /* N.allocWords */);\n sharedOffset += 80 /* N.allocBytes */;\n }\n update(data) {\n // data: string\n if (\"string\" === typeof data) {\n return this._utf8(data);\n }\n // data: undefined\n if (data == null) {\n throw new TypeError(\"Invalid type: \" + typeof data);\n }\n const byteOffset = data.byteOffset;\n const length = data.byteLength;\n let blocks = (length / 64 /* N.inputBytes */) | 0;\n let offset = 0;\n // longer than 1 block\n if (blocks && !(byteOffset & 3) && !(this._size % 64 /* N.inputBytes */)) {\n const block = new Int32Array(data.buffer, byteOffset, blocks * 16 /* N.inputWords */);\n while (blocks--) {\n this._int32(block, offset >> 2);\n offset += 64 /* N.inputBytes */;\n }\n this._size += offset;\n }\n // data: TypedArray | DataView\n const BYTES_PER_ELEMENT = data.BYTES_PER_ELEMENT;\n if (BYTES_PER_ELEMENT !== 1 && data.buffer) {\n const rest = new Uint8Array(data.buffer, byteOffset + offset, length - offset);\n return this._uint8(rest);\n }\n // no more bytes\n if (offset === length)\n return this;\n // data: Uint8Array | Int8Array\n return this._uint8(data, offset);\n }\n _uint8(data, offset) {\n const { _byte, _word } = this;\n const length = data.length;\n offset = offset | 0;\n while (offset < length) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n _byte[index++] = data[offset++];\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n }\n this._size += index - start;\n }\n return this;\n }\n _utf8(text) {\n const { _byte, _word } = this;\n const length = text.length;\n let surrogate = this._sp;\n for (let offset = 0; offset < length;) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n let code = text.charCodeAt(offset++) | 0;\n if (code < 0x80) {\n // ASCII characters\n _byte[index++] = code;\n }\n else if (code < 0x800) {\n // 2 bytes\n _byte[index++] = 0xC0 | (code >>> 6);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (code < 0xD800 || code > 0xDFFF) {\n // 3 bytes\n _byte[index++] = 0xE0 | (code >>> 12);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (surrogate) {\n // 4 bytes - surrogate pair\n code = ((surrogate & 0x3FF) << 10) + (code & 0x3FF) + 0x10000;\n _byte[index++] = 0xF0 | (code >>> 18);\n _byte[index++] = 0x80 | ((code >>> 12) & 0x3F);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n surrogate = 0;\n }\n else {\n surrogate = code;\n }\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n _word[0] = _word[16 /* N.inputWords */];\n }\n this._size += index - start;\n }\n this._sp = surrogate;\n return this;\n }\n _int32(data, offset) {\n let { A, B, C, D, E } = this;\n let i = 0;\n offset = offset | 0;\n while (i < 16 /* N.inputWords */) {\n W[i++] = swap32(data[offset++]);\n }\n for (i = 16 /* N.inputWords */; i < 80 /* N.workWords */; i++) {\n W[i] = rotate1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]);\n }\n for (i = 0; i < 80 /* N.workWords */; i++) {\n const S = (i / 20) | 0;\n const T = (rotate5(A) + ft(S, B, C, D) + E + W[i] + K[S]) | 0;\n E = D;\n D = C;\n C = rotate30(B);\n B = A;\n A = T;\n }\n this.A = (A + this.A) | 0;\n this.B = (B + this.B) | 0;\n this.C = (C + this.C) | 0;\n this.D = (D + this.D) | 0;\n this.E = (E + this.E) | 0;\n }\n digest(encoding) {\n const { _byte, _word } = this;\n let i = (this._size % 64 /* N.inputBytes */) | 0;\n _byte[i++] = 0x80;\n // pad 0 for current word\n while (i & 3) {\n _byte[i++] = 0;\n }\n i >>= 2;\n if (i > 14 /* N.highIndex */) {\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n i = 0;\n this._int32(_word);\n }\n // pad 0 for rest words\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n // input size\n const bits64 = this._size * 8;\n const low32 = (bits64 & 0xffffffff) >>> 0;\n const high32 = (bits64 - low32) / 0x100000000;\n if (high32)\n _word[14 /* N.highIndex */] = swap32(high32);\n if (low32)\n _word[15 /* N.lowIndex */] = swap32(low32);\n this._int32(_word);\n return (encoding === \"hex\") ? this._hex() : this._bin();\n }\n _hex() {\n const { A, B, C, D, E } = this;\n return hex32(A) + hex32(B) + hex32(C) + hex32(D) + hex32(E);\n }\n _bin() {\n const { A, B, C, D, E, _byte, _word } = this;\n _word[0] = swap32(A);\n _word[1] = swap32(B);\n _word[2] = swap32(C);\n _word[3] = swap32(D);\n _word[4] = swap32(E);\n return _byte.slice(0, 20);\n }\n}\nconst W = new Int32Array(80 /* N.workWords */);\nlet sharedBuffer;\nlet sharedOffset = 0;\nconst hex32 = num => (num + 0x100000000).toString(16).substr(-8);\nconst swapLE = (c => (((c << 24) & 0xff000000) | ((c << 8) & 0xff0000) | ((c >> 8) & 0xff00) | ((c >> 24) & 0xff)));\nconst swapBE = (c => c);\nconst swap32 = isBE() ? swapBE : swapLE;\nconst rotate1 = num => (num << 1) | (num >>> 31);\nconst rotate5 = num => (num << 5) | (num >>> 27);\nconst rotate30 = num => (num << 30) | (num >>> 2);\nfunction ft(s, b, c, d) {\n if (s === 0)\n return (b & c) | ((~b) & d);\n if (s === 2)\n return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\nfunction isBE() {\n const buf = new Uint8Array(new Uint16Array([0xFEFF]).buffer); // BOM\n return (buf[0] === 0xFE);\n}\n","import { stringify } from \"safe-stable-stringify\";\nimport { createHash } from \"sha1-uint8array\";\n//#region document-model/crypto.ts\nconst hashBrowser = (data, algorithm = \"sha1\", encoding = \"base64\", _params) => {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(`Hashing algorithm not supported: \"${algorithm}\". Available: sha1`);\n\tif (![\"base64\", \"hex\"].includes(encoding)) throw new Error(`Hash encoding not supported: \"${encoding}\". Available: base64, hex`);\n\tconst hash = hashUIntArray(data, algorithm);\n\tif (encoding === \"hex\") return uint8ArrayToHex(hash);\n\treturn uint8ArrayToBase64(hash);\n};\nfunction uint8ArrayToBase64(uint8Array) {\n\tlet binaryString = \"\";\n\tfor (let i = 0; i < uint8Array.length; i++) binaryString += String.fromCharCode(uint8Array[i]);\n\treturn btoa(binaryString);\n}\nfunction uint8ArrayToHex(uint8Array) {\n\treturn Array.from(uint8Array).map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction hashUIntArray(data, algorithm = \"sha1\") {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(\"Hashing algorithm not supported: Available: sha1\");\n\treturn createHash(\"sha1\").update(data).digest();\n}\nfunction getUnixTimestamp(date) {\n\treturn (new Date(date).getTime() / 1e3).toFixed(0);\n}\nfunction buildOperationSignatureParams({ documentId, signer, action, previousStateHash }) {\n\tconst { scope, type } = action;\n\treturn [\n\t\tgetUnixTimestamp(/* @__PURE__ */ new Date()),\n\t\tsigner.app.key,\n\t\thashBrowser([\n\t\t\tdocumentId,\n\t\t\tscope,\n\t\t\ttype,\n\t\t\tstringify(action.input)\n\t\t].join(\"\")),\n\t\tpreviousStateHash\n\t];\n}\nconst textEncode = new TextEncoder();\nfunction buildOperationSignatureMessage(params) {\n\tconst message = params.join(\"\");\n\tconst prefix = \"\u0019Signed Operation:\\n\" + message.length.toString();\n\treturn textEncode.encode(prefix + message);\n}\nfunction ab2hex(ab) {\n\tconst view = ArrayBuffer.isView(ab) ? ab : new Uint8Array(ab);\n\treturn Array.prototype.map.call(view, (x) => (\"00\" + x.toString(16)).slice(-2)).join(\"\");\n}\nfunction hex2ab(hex) {\n\treturn new Uint8Array(hex.match(/[\\da-f]{2}/gi)?.map(function(h) {\n\t\treturn parseInt(h, 16);\n\t}) ?? []);\n}\n//#endregion\n//#region document-model/utils.ts\nfunction generateId(method) {\n\tif (method && method.toString() !== \"UUIDv4\") throw new Error(`Id generation method not supported: \"${method.toString()}\"`);\n\treturn globalThis.crypto.randomUUID();\n}\n/**\n* Derives a deterministic operation ID from stable properties.\n*/\nfunction deriveOperationId(documentId, scope, branch, actionId) {\n\treturn hashBrowser(`${documentId}:${scope}:${branch}:${actionId}`, \"sha1\", \"hex\").slice(0, 32);\n}\n//#endregion\nexport { buildOperationSignatureParams as a, hex2ab as c, buildOperationSignatureMessage as i, generateId as n, getUnixTimestamp as o, ab2hex as r, hashBrowser as s, deriveOperationId as t };\n\n//# sourceMappingURL=utils-DKOFCM0Q.js.map","import { createRequire } from 'module';\nvar require = createRequire('/');\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\n// Mediocre shim\nvar Worker;\nvar workerAdd = \";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global\";\ntry {\n Worker = require('worker_threads').Worker;\n}\ncatch (e) {\n}\nvar wk = Worker ? function (c, _, msg, transfer, cb) {\n var done = false;\n var w = new Worker(c + workerAdd, { eval: true })\n .on('error', function (e) { return cb(e, null); })\n .on('message', function (m) { return cb(null, m); })\n .on('exit', function (c) {\n if (c && !done)\n cb(new Error('exited with code ' + c), null);\n });\n w.postMessage(msg, transfer);\n w.terminate = function () {\n done = true;\n return Worker.prototype.terminate.call(w);\n };\n return w;\n} : function (_, __, ___, ____, cb) {\n setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); });\n var NOP = function () { };\n return {\n terminate: NOP,\n postMessage: NOP\n };\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n }\n else\n strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain)\n strm.ondrain(dat[0]);\n }\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n if (flush) {\n strm.flush = function () { w.postMessage([]); };\n }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o)\n : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain)\n _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this.d & 1))\n return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c)\n _this.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","const Operation = {\n Remove: 'remove',\n Replace: 'replace',\n Add: 'add',\n};\n\n// Don't use `Symbol()` just for 3rd party access the draft\nconst PROXY_DRAFT = Symbol.for('__MUTATIVE_PROXY_DRAFT__');\nconst RAW_RETURN_SYMBOL = Symbol('__MUTATIVE_RAW_RETURN_SYMBOL__');\nconst iteratorSymbol = Symbol.iterator;\nconst dataTypes = {\n mutable: 'mutable',\n immutable: 'immutable',\n};\n\nconst internal = {};\n\nfunction has(target, key) {\n return target instanceof Map\n ? target.has(key)\n : Object.prototype.hasOwnProperty.call(target, key);\n}\nfunction getDescriptor(target, key) {\n if (key in target) {\n let prototype = Reflect.getPrototypeOf(target);\n while (prototype) {\n const descriptor = Reflect.getOwnPropertyDescriptor(prototype, key);\n if (descriptor)\n return descriptor;\n prototype = Reflect.getPrototypeOf(prototype);\n }\n }\n return;\n}\nfunction isBaseSetInstance(obj) {\n return Object.getPrototypeOf(obj) === Set.prototype;\n}\nfunction isBaseMapInstance(obj) {\n return Object.getPrototypeOf(obj) === Map.prototype;\n}\n\nfunction latest(proxyDraft) {\n var _a;\n return (_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original;\n}\n/**\n * Check if the value is a draft\n */\nfunction isDraft(target) {\n return !!getProxyDraft(target);\n}\nfunction getProxyDraft(value) {\n if (typeof value !== 'object')\n return null;\n return value === null || value === void 0 ? void 0 : value[PROXY_DRAFT];\n}\nfunction getValue(value) {\n var _a;\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? ((_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original) : value;\n}\n/**\n * Check if a value is draftable\n */\nfunction isDraftable(value, options) {\n if (!value || typeof value !== 'object')\n return false;\n let markResult;\n return (Object.getPrototypeOf(value) === Object.prototype ||\n Array.isArray(value) ||\n value instanceof Map ||\n value instanceof Set ||\n (!!(options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable ||\n typeof markResult === 'function')));\n}\nfunction getPath(target, path = []) {\n if (Object.hasOwnProperty.call(target, 'key')) {\n // check if the parent is a draft and the original value is not equal to the current value\n const parentCopy = target.parent.copy;\n const proxyDraft = getProxyDraft(get(parentCopy, target.key));\n if (proxyDraft !== null && (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== target.original) {\n return null;\n }\n const isSet = target.parent.type === 3 /* DraftType.Set */;\n const key = isSet\n ? Array.from(target.parent.setMap.keys()).indexOf(target.key)\n : target.key;\n // check if the key is still in the next state parent\n if (!((isSet && parentCopy.size > key) || has(parentCopy, key)))\n return null;\n path.push(key);\n }\n if (target.parent) {\n return getPath(target.parent, path);\n }\n // `target` is root draft.\n path.reverse();\n try {\n // check if the path is valid\n resolvePath(target.copy, path);\n }\n catch (e) {\n return null;\n }\n return path;\n}\nfunction getType(target) {\n if (Array.isArray(target))\n return 1 /* DraftType.Array */;\n if (target instanceof Map)\n return 2 /* DraftType.Map */;\n if (target instanceof Set)\n return 3 /* DraftType.Set */;\n return 0 /* DraftType.Object */;\n}\nfunction get(target, key) {\n return getType(target) === 2 /* DraftType.Map */ ? target.get(key) : target[key];\n}\nfunction set(target, key, value) {\n const type = getType(target);\n if (type === 2 /* DraftType.Map */) {\n target.set(key, value);\n }\n else {\n target[key] = value;\n }\n}\nfunction peek(target, key) {\n const state = getProxyDraft(target);\n const source = state ? latest(state) : target;\n return source[key];\n}\nfunction isEqual(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nfunction revokeProxy(proxyDraft) {\n if (!proxyDraft)\n return;\n while (proxyDraft.finalities.revoke.length > 0) {\n const revoke = proxyDraft.finalities.revoke.pop();\n revoke();\n }\n}\n// handle JSON Pointer path with spec https://www.rfc-editor.org/rfc/rfc6901\nfunction escapePath(path, pathAsArray) {\n return pathAsArray\n ? path\n : ['']\n .concat(path)\n .map((_item) => {\n const item = `${_item}`;\n if (item.indexOf('/') === -1 && item.indexOf('~') === -1)\n return item;\n return item.replace(/~/g, '~0').replace(/\\//g, '~1');\n })\n .join('/');\n}\nfunction unescapePath(path) {\n if (Array.isArray(path))\n return path;\n return path\n .split('/')\n .map((_item) => _item.replace(/~1/g, '/').replace(/~0/g, '~'))\n .slice(1);\n}\nfunction resolvePath(base, path) {\n for (let index = 0; index < path.length - 1; index += 1) {\n const key = path[index];\n // use `index` in Set draft\n base = get(getType(base) === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot resolve patch at '${path.join('/')}'.`);\n }\n }\n return base;\n}\n\nfunction strictCopy(target) {\n const copy = Object.create(Object.getPrototypeOf(target));\n Reflect.ownKeys(target).forEach((key) => {\n let desc = Reflect.getOwnPropertyDescriptor(target, key);\n if (desc.enumerable && desc.configurable && desc.writable) {\n copy[key] = target[key];\n return;\n }\n // for freeze\n if (!desc.writable) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n desc = {\n configurable: true,\n writable: true,\n enumerable: desc.enumerable,\n value: target[key],\n };\n Reflect.defineProperty(copy, key, desc);\n });\n return copy;\n}\nconst propIsEnum = Object.prototype.propertyIsEnumerable;\nfunction shallowCopy(original, options) {\n let markResult;\n if (Array.isArray(original)) {\n return Array.prototype.concat.call(original);\n }\n else if (original instanceof Set) {\n if (!isBaseSetInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original.values());\n }\n return Set.prototype.difference\n ? Set.prototype.difference.call(original, new Set())\n : new Set(original.values());\n }\n else if (original instanceof Map) {\n if (!isBaseMapInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original);\n }\n return new Map(original);\n }\n else if ((options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(original, dataTypes)),\n markResult !== undefined) &&\n markResult !== dataTypes.mutable) {\n if (markResult === dataTypes.immutable) {\n return strictCopy(original);\n }\n else if (typeof markResult === 'function') {\n if ((options.enablePatches || options.enableAutoFreeze)) {\n throw new Error(`You can't use mark and patches or auto freeze together.`);\n }\n return markResult();\n }\n throw new Error(`Unsupported mark result: ${markResult}`);\n }\n else if (typeof original === 'object' &&\n Object.getPrototypeOf(original) === Object.prototype) {\n // For best performance with shallow copies,\n // don't use `Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));` by default.\n const copy = {};\n Object.keys(original).forEach((key) => {\n copy[key] = original[key];\n });\n Object.getOwnPropertySymbols(original).forEach((key) => {\n if (propIsEnum.call(original, key)) {\n copy[key] = original[key];\n }\n });\n return copy;\n }\n else {\n throw new Error(`Please check mark() to ensure that it is a stable marker draftable function.`);\n }\n}\nfunction ensureShallowCopy(target) {\n if (target.copy)\n return;\n target.copy = shallowCopy(target.original, target.options);\n}\nfunction deepClone(target) {\n if (!isDraftable(target))\n return getValue(target);\n if (Array.isArray(target))\n return target.map(deepClone);\n if (target instanceof Map) {\n const iterable = Array.from(target.entries()).map(([k, v]) => [\n k,\n deepClone(v),\n ]);\n if (!isBaseMapInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Map(iterable);\n }\n if (target instanceof Set) {\n const iterable = Array.from(target).map(deepClone);\n if (!isBaseSetInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Set(iterable);\n }\n const copy = Object.create(Object.getPrototypeOf(target));\n for (const key in target)\n copy[key] = deepClone(target[key]);\n return copy;\n}\nfunction cloneIfNeeded(target) {\n return isDraft(target) ? deepClone(target) : target;\n}\n\nfunction markChanged(proxyDraft) {\n var _a;\n proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n if (!proxyDraft.operated) {\n proxyDraft.operated = true;\n if (proxyDraft.parent) {\n markChanged(proxyDraft.parent);\n }\n }\n}\n\nfunction throwFrozenError() {\n throw new Error('Cannot modify frozen object');\n}\nfunction deepFreeze(target, subKey, updatedValues, stack, keys) {\n {\n updatedValues = updatedValues !== null && updatedValues !== void 0 ? updatedValues : new WeakMap();\n stack = stack !== null && stack !== void 0 ? stack : [];\n keys = keys !== null && keys !== void 0 ? keys : [];\n const value = updatedValues.has(target)\n ? updatedValues.get(target)\n : target;\n if (stack.length > 0) {\n const index = stack.indexOf(value);\n if (value && typeof value === 'object' && index !== -1) {\n if (stack[0] === value) {\n throw new Error(`Forbids circular reference`);\n }\n throw new Error(`Forbids circular reference: ~/${keys\n .slice(0, index)\n .map((key, index) => {\n if (typeof key === 'symbol')\n return `[${key.toString()}]`;\n const parent = stack[index];\n if (typeof key === 'object' &&\n (parent instanceof Map || parent instanceof Set))\n return Array.from(parent.keys()).indexOf(key);\n return key;\n })\n .join('/')}`);\n }\n stack.push(value);\n keys.push(subKey);\n }\n else {\n stack.push(value);\n }\n }\n if (Object.isFrozen(target) || isDraft(target)) {\n {\n stack.pop();\n keys.pop();\n }\n return;\n }\n const type = getType(target);\n switch (type) {\n case 2 /* DraftType.Map */:\n for (const [key, value] of target) {\n deepFreeze(key, key, updatedValues, stack, keys);\n deepFreeze(value, key, updatedValues, stack, keys);\n }\n target.set = target.clear = target.delete = throwFrozenError;\n break;\n case 3 /* DraftType.Set */:\n for (const value of target) {\n deepFreeze(value, value, updatedValues, stack, keys);\n }\n target.add = target.clear = target.delete = throwFrozenError;\n break;\n case 1 /* DraftType.Array */:\n Object.freeze(target);\n let index = 0;\n for (const value of target) {\n deepFreeze(value, index, updatedValues, stack, keys);\n index += 1;\n }\n break;\n default:\n Object.freeze(target);\n // ignore non-enumerable or symbol properties\n Object.keys(target).forEach((name) => {\n const value = target[name];\n deepFreeze(value, name, updatedValues, stack, keys);\n });\n }\n {\n stack.pop();\n keys.pop();\n }\n}\n\nfunction forEach(target, iter) {\n const type = getType(target);\n if (type === 0 /* DraftType.Object */) {\n Reflect.ownKeys(target).forEach((key) => {\n iter(key, target[key], target);\n });\n }\n else if (type === 1 /* DraftType.Array */) {\n let index = 0;\n for (const entry of target) {\n iter(index, entry, target);\n index += 1;\n }\n }\n else {\n target.forEach((entry, index) => iter(index, entry, target));\n }\n}\n\nfunction handleValue(target, handledSet, options) {\n if (isDraft(target) ||\n !isDraftable(target, options) ||\n handledSet.has(target) ||\n Object.isFrozen(target))\n return;\n const isSet = target instanceof Set;\n const setMap = isSet ? new Map() : undefined;\n handledSet.add(target);\n forEach(target, (key, value) => {\n var _a;\n if (isDraft(value)) {\n const proxyDraft = getProxyDraft(value);\n ensureShallowCopy(proxyDraft);\n // A draft where a child node has been changed, or assigned a value\n const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === void 0 ? void 0 : _a.size) || proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original;\n // final update value\n set(isSet ? setMap : target, key, updatedValue);\n }\n else {\n handleValue(value, handledSet, options);\n }\n });\n if (setMap) {\n const set = target;\n const values = Array.from(set);\n set.clear();\n values.forEach((value) => {\n set.add(setMap.has(value) ? setMap.get(value) : value);\n });\n }\n}\nfunction finalizeAssigned(proxyDraft, key) {\n // handle the draftable assigned values, and the value is not a draft\n const copy = proxyDraft.type === 3 /* DraftType.Set */ ? proxyDraft.setMap : proxyDraft.copy;\n if (proxyDraft.finalities.revoke.length > 1 &&\n proxyDraft.assignedMap.get(key) &&\n copy) {\n handleValue(get(copy, key), proxyDraft.finalities.handledSet, proxyDraft.options);\n }\n}\nfunction finalizeSetValue(target) {\n if (target.type === 3 /* DraftType.Set */ && target.copy) {\n target.copy.clear();\n target.setMap.forEach((value) => {\n target.copy.add(getValue(value));\n });\n }\n}\nfunction finalizePatches(target, generatePatches, patches, inversePatches) {\n const shouldFinalize = target.operated &&\n target.assignedMap &&\n target.assignedMap.size > 0 &&\n !target.finalized;\n if (shouldFinalize) {\n if (patches && inversePatches) {\n const basePath = getPath(target);\n if (basePath) {\n generatePatches(target, basePath, patches, inversePatches);\n }\n }\n target.finalized = true;\n }\n}\nfunction markFinalization(target, key, value, generatePatches) {\n const proxyDraft = getProxyDraft(value);\n if (proxyDraft) {\n // !case: assign the draft value\n if (!proxyDraft.callbacks) {\n proxyDraft.callbacks = [];\n }\n proxyDraft.callbacks.push((patches, inversePatches) => {\n var _a;\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n let updatedValue = proxyDraft.original;\n if (proxyDraft.copy) {\n updatedValue = proxyDraft.copy;\n }\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n });\n if (target.options.enableAutoFreeze) {\n // !case: assign the draft value in cross draft tree\n if (proxyDraft.finalities !== target.finalities) {\n target.options.enableAutoFreeze = false;\n }\n }\n }\n if (isDraftable(value, target.options)) {\n // !case: assign the non-draft value\n target.finalities.draft.push(() => {\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n finalizeAssigned(target, key);\n }\n });\n }\n}\n\nfunction generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray) {\n let { original, assignedMap, options } = proxyState;\n let copy = proxyState.copy;\n if (copy.length < original.length) {\n [original, copy] = [copy, original];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let index = 0; index < original.length; index += 1) {\n if (assignedMap.get(index.toString()) && copy[index] !== original[index]) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n inversePatches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(original[index]),\n });\n }\n }\n for (let index = original.length; index < copy.length; index += 1) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n }\n if (original.length < copy.length) {\n // https://www.rfc-editor.org/rfc/rfc6902#appendix-A.4\n // For performance, here we only generate an operation that replaces the length of the array,\n // which is inconsistent with JSON Patch specification\n const { arrayLengthAssignment = true } = options.enablePatches;\n if (arrayLengthAssignment) {\n const _path = basePath.concat(['length']);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Replace,\n path,\n value: original.length,\n });\n }\n else {\n for (let index = copy.length; original.length < index; index -= 1) {\n const _path = basePath.concat([index - 1]);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Remove,\n path,\n });\n }\n }\n }\n}\nfunction generatePatchesFromAssigned({ original, copy, assignedMap }, basePath, patches, inversePatches, pathAsArray) {\n assignedMap.forEach((assignedValue, key) => {\n const originalValue = get(original, key);\n const value = cloneIfNeeded(get(copy, key));\n const op = !assignedValue\n ? Operation.Remove\n : has(original, key)\n ? Operation.Replace\n : Operation.Add;\n if (isEqual(originalValue, value) && op === Operation.Replace)\n return;\n const _path = basePath.concat(key);\n const path = escapePath(_path, pathAsArray);\n patches.push(op === Operation.Remove ? { op, path } : { op, path, value });\n inversePatches.push(op === Operation.Add\n ? { op: Operation.Remove, path }\n : op === Operation.Remove\n ? { op: Operation.Add, path, value: originalValue }\n : { op: Operation.Replace, path, value: originalValue });\n });\n}\nfunction generateSetPatches({ original, copy }, basePath, patches, inversePatches, pathAsArray) {\n let index = 0;\n original.forEach((value) => {\n if (!copy.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Remove,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Add,\n path,\n value,\n });\n }\n index += 1;\n });\n index = 0;\n copy.forEach((value) => {\n if (!original.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Remove,\n path,\n value,\n });\n }\n index += 1;\n });\n}\nfunction generatePatches(proxyState, basePath, patches, inversePatches) {\n const { pathAsArray = true } = proxyState.options.enablePatches;\n switch (proxyState.type) {\n case 0 /* DraftType.Object */:\n case 2 /* DraftType.Map */:\n return generatePatchesFromAssigned(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 1 /* DraftType.Array */:\n return generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 3 /* DraftType.Set */:\n return generateSetPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n }\n}\n\nlet readable = false;\nconst checkReadable = (value, options, ignoreCheckDraftable = false) => {\n if (typeof value === 'object' &&\n value !== null &&\n (!isDraftable(value, options) || ignoreCheckDraftable) &&\n !readable) {\n throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);\n }\n};\n/**\n * `unsafe(callback)` to access mutable data directly in strict mode.\n *\n * ## Example\n *\n * ```ts\n * import { create, unsafe } from '../index';\n *\n * class Foobar {\n * bar = 1;\n * }\n *\n * const baseState = { foobar: new Foobar() };\n * const state = create(\n * baseState,\n * (draft) => {\n * unsafe(() => {\n * draft.foobar.bar = 2;\n * });\n * },\n * {\n * strict: true,\n * }\n * );\n *\n * expect(state).toBe(baseState);\n * expect(state.foobar).toBe(baseState.foobar);\n * expect(state.foobar.bar).toBe(2);\n * ```\n */\nfunction unsafe(callback) {\n readable = true;\n let result;\n try {\n result = callback();\n }\n finally {\n readable = false;\n }\n return result;\n}\n\nconst mapHandler = {\n get size() {\n const current = latest(getProxyDraft(this));\n return current.size;\n },\n has(key) {\n return latest(getProxyDraft(this)).has(key);\n },\n set(key, value) {\n const target = getProxyDraft(this);\n const source = latest(target);\n if (!source.has(key) || !isEqual(source.get(key), value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, true);\n target.copy.set(key, value);\n markFinalization(target, key, value, generatePatches);\n }\n return this;\n },\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n if (target.original.has(key)) {\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap.delete(key);\n }\n target.copy.delete(key);\n return true;\n },\n clear() {\n const target = getProxyDraft(this);\n if (!this.size)\n return;\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap = new Map();\n for (const [key] of target.original) {\n target.assignedMap.set(key, false);\n }\n target.copy.clear();\n },\n forEach(callback, thisArg) {\n const target = getProxyDraft(this);\n latest(target).forEach((_value, _key) => {\n callback.call(thisArg, this.get(_key), _key, this);\n });\n },\n get(key) {\n var _a, _b;\n const target = getProxyDraft(this);\n const value = latest(target).get(key);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(value, target.options, mutable);\n }\n if (mutable) {\n return value;\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // drafted or reassigned\n if (value !== target.original.get(key)) {\n return value;\n }\n const draft = internal.createDraft({\n original: value,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n ensureShallowCopy(target);\n target.copy.set(key, draft);\n return draft;\n },\n keys() {\n return latest(getProxyDraft(this)).keys();\n },\n values() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.values(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value,\n };\n },\n };\n },\n entries() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.entries(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value: [result.value, value],\n };\n },\n };\n },\n [iteratorSymbol]() {\n return this.entries();\n },\n};\nconst mapHandlerKeys = Reflect.ownKeys(mapHandler);\n\nconst getNextIterator = (target, iterator, { isValuesIterator }) => () => {\n var _a, _b;\n const result = iterator.next();\n if (result.done)\n return result;\n const key = result.value;\n let value = target.setMap.get(key);\n const currentDraft = getProxyDraft(value);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(key, target.options, mutable);\n }\n if (!mutable &&\n !currentDraft &&\n isDraftable(key, target.options) &&\n !target.finalized &&\n target.original.has(key)) {\n // draft a draftable original set item\n const proxy = internal.createDraft({\n original: key,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n target.setMap.set(key, proxy);\n value = proxy;\n }\n else if (currentDraft) {\n // drafted\n value = currentDraft.proxy;\n }\n return {\n done: false,\n value: isValuesIterator ? value : [value, value],\n };\n};\nconst setHandler = {\n get size() {\n const target = getProxyDraft(this);\n return target.setMap.size;\n },\n has(value) {\n const target = getProxyDraft(this);\n // reassigned or non-draftable values\n if (target.setMap.has(value))\n return true;\n ensureShallowCopy(target);\n const valueProxyDraft = getProxyDraft(value);\n // drafted\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original))\n return true;\n return false;\n },\n add(value) {\n const target = getProxyDraft(this);\n if (!this.has(value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(value, true);\n target.setMap.set(value, value);\n markFinalization(target, value, value, generatePatches);\n }\n return this;\n },\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n const valueProxyDraft = getProxyDraft(value);\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original)) {\n // delete drafted\n target.assignedMap.set(valueProxyDraft.original, false);\n return target.setMap.delete(valueProxyDraft.original);\n }\n if (!valueProxyDraft && target.setMap.has(value)) {\n // non-draftable values\n target.assignedMap.set(value, false);\n }\n else {\n // reassigned\n target.assignedMap.delete(value);\n }\n // delete reassigned or non-draftable values\n return target.setMap.delete(value);\n },\n clear() {\n if (!this.size)\n return;\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n for (const value of target.original) {\n target.assignedMap.set(value, false);\n }\n target.setMap.clear();\n },\n values() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: getNextIterator(target, iterator, { isValuesIterator: true }),\n };\n },\n entries() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: getNextIterator(target, iterator, {\n isValuesIterator: false,\n }),\n };\n },\n keys() {\n return this.values();\n },\n [iteratorSymbol]() {\n return this.values();\n },\n forEach(callback, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n callback.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n },\n};\nif (Set.prototype.difference) {\n // for compatibility with new Set methods\n // https://github.com/tc39/proposal-set-methods\n // And `https://github.com/tc39/proposal-set-methods/blob/main/details.md#symbolspecies` has some details about the `@@species` symbol.\n // So we can't use SubSet instance constructor to get the constructor of the SubSet instance.\n Object.assign(setHandler, {\n intersection(other) {\n return Set.prototype.intersection.call(new Set(this.values()), other);\n },\n union(other) {\n return Set.prototype.union.call(new Set(this.values()), other);\n },\n difference(other) {\n return Set.prototype.difference.call(new Set(this.values()), other);\n },\n symmetricDifference(other) {\n return Set.prototype.symmetricDifference.call(new Set(this.values()), other);\n },\n isSubsetOf(other) {\n return Set.prototype.isSubsetOf.call(new Set(this.values()), other);\n },\n isSupersetOf(other) {\n return Set.prototype.isSupersetOf.call(new Set(this.values()), other);\n },\n isDisjointFrom(other) {\n return Set.prototype.isDisjointFrom.call(new Set(this.values()), other);\n },\n });\n}\nconst setHandlerKeys = Reflect.ownKeys(setHandler);\n\nconst proxyHandler = {\n get(target, key, receiver) {\n var _a, _b;\n const copy = (_a = target.copy) === null || _a === void 0 ? void 0 : _a[key];\n // Improve draft reading performance by caching the draft copy.\n if (copy && target.finalities.draftsCache.has(copy)) {\n return copy;\n }\n if (key === PROXY_DRAFT)\n return target;\n let markResult;\n if (target.options.mark) {\n // handle `Uncaught TypeError: Method get Map.prototype.size called on incompatible receiver #<Map>`\n // or `Uncaught TypeError: Method get Set.prototype.size called on incompatible receiver #<Set>`\n const value = key === 'size' &&\n (target.original instanceof Map || target.original instanceof Set)\n ? Reflect.get(target.original, key)\n : Reflect.get(target.original, key, receiver);\n markResult = target.options.mark(value, dataTypes);\n if (markResult === dataTypes.mutable) {\n if (target.options.strict) {\n checkReadable(value, target.options, true);\n }\n return value;\n }\n }\n const source = latest(target);\n if (source instanceof Map && mapHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(mapHandler, 'size').get.call(target.proxy);\n }\n const handle = mapHandler[key];\n return handle.bind(target.proxy);\n }\n if (source instanceof Set && setHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(setHandler, 'size').get.call(target.proxy);\n }\n const handle = setHandler[key];\n return handle.bind(target.proxy);\n }\n if (!has(source, key)) {\n const desc = getDescriptor(source, key);\n return desc\n ? `value` in desc\n ? desc.value\n : // !case: support for getter\n (_b = desc.get) === null || _b === void 0 ? void 0 : _b.call(target.proxy)\n : undefined;\n }\n const value = source[key];\n if (target.options.strict) {\n checkReadable(value, target.options);\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // Ensure that the assigned values are not drafted\n if (value === peek(target.original, key)) {\n ensureShallowCopy(target);\n target.copy[key] = createDraft({\n original: target.original[key],\n parentDraft: target,\n key: target.type === 1 /* DraftType.Array */ ? Number(key) : key,\n finalities: target.finalities,\n options: target.options,\n });\n // !case: support for custom shallow copy function\n if (typeof markResult === 'function') {\n const subProxyDraft = getProxyDraft(target.copy[key]);\n ensureShallowCopy(subProxyDraft);\n // Trigger a custom shallow copy to update to a new copy\n markChanged(subProxyDraft);\n return subProxyDraft.copy;\n }\n return target.copy[key];\n }\n if (isDraft(value)) {\n target.finalities.draftsCache.add(value);\n }\n return value;\n },\n set(target, key, value) {\n var _a;\n if (target.type === 3 /* DraftType.Set */ || target.type === 2 /* DraftType.Map */) {\n throw new Error(`Map/Set draft does not support any property assignment.`);\n }\n let _key;\n if (target.type === 1 /* DraftType.Array */ &&\n key !== 'length' &&\n !(Number.isInteger((_key = Number(key))) &&\n _key >= 0 &&\n (key === 0 || _key === 0 || String(_key) === String(key)))) {\n throw new Error(`Only supports setting array indices and the 'length' property.`);\n }\n const desc = getDescriptor(latest(target), key);\n if (desc === null || desc === void 0 ? void 0 : desc.set) {\n // !case: cover the case of setter\n desc.set.call(target.proxy, value);\n return true;\n }\n const current = peek(latest(target), key);\n const currentProxyDraft = getProxyDraft(current);\n if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {\n // !case: ignore the case of assigning the original draftable value to a draft\n target.copy[key] = value;\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n target.assignedMap.set(key, false);\n return true;\n }\n // !case: handle new props with value 'undefined'\n if (isEqual(value, current) &&\n (value !== undefined || has(target.original, key)))\n return true;\n ensureShallowCopy(target);\n markChanged(target);\n if (has(target.original, key) && isEqual(value, target.original[key])) {\n // !case: handle the case of assigning the original non-draftable value to a draft\n target.assignedMap.delete(key);\n }\n else {\n target.assignedMap.set(key, true);\n }\n target.copy[key] = value;\n markFinalization(target, key, value, generatePatches);\n return true;\n },\n has(target, key) {\n return key in latest(target);\n },\n ownKeys(target) {\n return Reflect.ownKeys(latest(target));\n },\n getOwnPropertyDescriptor(target, key) {\n const source = latest(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(source, key);\n if (!descriptor)\n return descriptor;\n return {\n writable: true,\n configurable: target.type !== 1 /* DraftType.Array */ || key !== 'length',\n enumerable: descriptor.enumerable,\n value: source[key],\n };\n },\n getPrototypeOf(target) {\n return Reflect.getPrototypeOf(target.original);\n },\n setPrototypeOf() {\n throw new Error(`Cannot call 'setPrototypeOf()' on drafts`);\n },\n defineProperty() {\n throw new Error(`Cannot call 'defineProperty()' on drafts`);\n },\n deleteProperty(target, key) {\n var _a;\n if (target.type === 1 /* DraftType.Array */) {\n return proxyHandler.set.call(this, target, key, undefined, target.proxy);\n }\n if (peek(target.original, key) !== undefined || key in target.original) {\n // !case: delete an existing key\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n // The original non-existent key has been deleted\n target.assignedMap.delete(key);\n }\n if (target.copy)\n delete target.copy[key];\n return true;\n },\n};\nfunction createDraft(createDraftOptions) {\n const { original, parentDraft, key, finalities, options } = createDraftOptions;\n const type = getType(original);\n const proxyDraft = {\n type,\n finalized: false,\n parent: parentDraft,\n original,\n copy: null,\n proxy: null,\n finalities,\n options,\n // Mapping of draft Set items to their corresponding draft values.\n setMap: type === 3 /* DraftType.Set */\n ? new Map(original.entries())\n : undefined,\n };\n // !case: undefined as a draft map key\n if (key || 'key' in createDraftOptions) {\n proxyDraft.key = key;\n }\n const { proxy, revoke } = Proxy.revocable(type === 1 /* DraftType.Array */ ? Object.assign([], proxyDraft) : proxyDraft, proxyHandler);\n finalities.revoke.push(revoke);\n proxyDraft.proxy = proxy;\n if (parentDraft) {\n const target = parentDraft;\n target.finalities.draft.push((patches, inversePatches) => {\n var _a, _b;\n const oldProxyDraft = getProxyDraft(proxy);\n // if target is a Set draft, `setMap` is the real Set copies proxy mapping.\n let copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n const draft = get(copy, key);\n const proxyDraft = getProxyDraft(draft);\n if (proxyDraft) {\n // assign the updated value to the copy object\n let updatedValue = proxyDraft.original;\n if (proxyDraft.operated) {\n updatedValue = getValue(draft);\n }\n finalizeSetValue(proxyDraft);\n finalizePatches(proxyDraft, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n // !case: handle the deleted key\n (_b = oldProxyDraft.callbacks) === null || _b === void 0 ? void 0 : _b.forEach((callback) => {\n callback(patches, inversePatches);\n });\n });\n }\n else {\n // !case: handle the root draft\n const target = getProxyDraft(proxy);\n target.finalities.draft.push((patches, inversePatches) => {\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n });\n }\n return proxy;\n}\ninternal.createDraft = createDraft;\nfunction finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {\n var _a;\n const proxyDraft = getProxyDraft(result);\n const original = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : result;\n const hasReturnedValue = !!returnedValue.length;\n if (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated) {\n while (proxyDraft.finalities.draft.length > 0) {\n const finalize = proxyDraft.finalities.draft.pop();\n finalize(patches, inversePatches);\n }\n }\n const state = hasReturnedValue\n ? returnedValue[0]\n : proxyDraft\n ? proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original\n : result;\n if (proxyDraft)\n revokeProxy(proxyDraft);\n if (enableAutoFreeze) {\n deepFreeze(state, state, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options.updatedValues);\n }\n return [\n state,\n patches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: returnedValue[0] }]\n : patches,\n inversePatches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: original }]\n : inversePatches,\n ];\n}\n\nfunction draftify(baseState, options) {\n var _a;\n const finalities = {\n draft: [],\n revoke: [],\n handledSet: new WeakSet(),\n draftsCache: new WeakSet(),\n };\n let patches;\n let inversePatches;\n if (options.enablePatches) {\n patches = [];\n inversePatches = [];\n }\n const isMutable = ((_a = options.mark) === null || _a === void 0 ? void 0 : _a.call(options, baseState, dataTypes)) === dataTypes.mutable ||\n !isDraftable(baseState, options);\n const draft = isMutable\n ? baseState\n : createDraft({\n original: baseState,\n parentDraft: null,\n finalities,\n options,\n });\n return [\n draft,\n (returnedValue = []) => {\n const [finalizedState, finalizedPatches, finalizedInversePatches] = finalizeDraft(draft, returnedValue, patches, inversePatches, options.enableAutoFreeze);\n return (options.enablePatches\n ? [finalizedState, finalizedPatches, finalizedInversePatches]\n : finalizedState);\n },\n ];\n}\n\nfunction handleReturnValue(options) {\n const { rootDraft, value, useRawReturn = false, isRoot = true } = options;\n forEach(value, (key, item, source) => {\n const proxyDraft = getProxyDraft(item);\n // just handle the draft which is created by the same rootDraft\n if (proxyDraft &&\n rootDraft &&\n proxyDraft.finalities === rootDraft.finalities) {\n options.isContainDraft = true;\n const currentValue = proxyDraft.original;\n // final update value, but just handle return value\n if (source instanceof Set) {\n const arr = Array.from(source);\n source.clear();\n arr.forEach((_item) => source.add(key === _item ? currentValue : _item));\n }\n else {\n set(source, key, currentValue);\n }\n }\n else if (typeof item === 'object' && item !== null) {\n options.value = item;\n options.isRoot = false;\n handleReturnValue(options);\n }\n });\n if (isRoot) {\n if (!options.isContainDraft)\n console.warn(`The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance.`);\n if (useRawReturn) {\n console.warn(`The return value contains drafts, please don't use 'rawReturn()' to wrap the return value.`);\n }\n }\n}\nfunction getCurrent(target) {\n var _a;\n const proxyDraft = getProxyDraft(target);\n if (!isDraftable(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options))\n return target;\n const type = getType(target);\n if (proxyDraft && !proxyDraft.operated)\n return proxyDraft.original;\n let currentValue;\n function ensureShallowCopy() {\n currentValue =\n type === 2 /* DraftType.Map */\n ? !isBaseMapInstance(target)\n ? new (Object.getPrototypeOf(target).constructor)(target)\n : new Map(target)\n : type === 3 /* DraftType.Set */\n ? Array.from(proxyDraft.setMap.values())\n : shallowCopy(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options);\n }\n if (proxyDraft) {\n // It's a proxy draft, let's create a shallow copy eagerly\n proxyDraft.finalized = true;\n try {\n ensureShallowCopy();\n }\n finally {\n proxyDraft.finalized = false;\n }\n }\n else {\n // It's not a proxy draft, let's use the target directly and let's see\n // lazily if we need to create a shallow copy\n currentValue = target;\n }\n forEach(currentValue, (key, value) => {\n if (proxyDraft && isEqual(get(proxyDraft.original, key), value))\n return;\n const newValue = getCurrent(value);\n if (newValue !== value) {\n if (currentValue === target)\n ensureShallowCopy();\n set(currentValue, key, newValue);\n }\n });\n if (type === 3 /* DraftType.Set */) {\n const value = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : currentValue;\n return !isBaseSetInstance(value)\n ? new (Object.getPrototypeOf(value).constructor)(currentValue)\n : new Set(currentValue);\n }\n return currentValue;\n}\nfunction current(target) {\n if (!isDraft(target)) {\n throw new Error(`current() is only used for Draft, parameter: ${target}`);\n }\n return getCurrent(target);\n}\n\n/**\n * `makeCreator(options)` to make a creator function.\n *\n * ## Example\n *\n * ```ts\n * import { makeCreator } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const create = makeCreator({ enableAutoFreeze: true });\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * expect(Object.isFrozen(state)).toBeTruthy();\n * ```\n */\nconst makeCreator = (arg) => {\n if (arg !== undefined &&\n Object.prototype.toString.call(arg) !== '[object Object]') {\n throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);\n }\n return function create(arg0, arg1, arg2) {\n var _a, _b, _c;\n if (typeof arg0 === 'function' && typeof arg1 !== 'function') {\n return function (base, ...args) {\n return create(base, (draft) => arg0.call(this, draft, ...args), arg1);\n };\n }\n const base = arg0;\n const mutate = arg1;\n let options = arg2;\n if (typeof arg1 !== 'function') {\n options = arg1;\n }\n if (options !== undefined &&\n Object.prototype.toString.call(options) !== '[object Object]') {\n throw new Error(`Invalid options: ${options}, 'options' should be an object.`);\n }\n options = Object.assign(Object.assign({}, arg), options);\n const state = isDraft(base) ? current(base) : base;\n const mark = Array.isArray(options.mark)\n ? ((value, types) => {\n for (const mark of options.mark) {\n if (typeof mark !== 'function') {\n throw new Error(`Invalid mark: ${mark}, 'mark' should be a function.`);\n }\n const result = mark(value, types);\n if (result) {\n return result;\n }\n }\n return;\n })\n : options.mark;\n const enablePatches = (_a = options.enablePatches) !== null && _a !== void 0 ? _a : false;\n const strict = (_b = options.strict) !== null && _b !== void 0 ? _b : false;\n const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== void 0 ? _c : false;\n const _options = {\n enableAutoFreeze,\n mark,\n strict,\n enablePatches,\n };\n if (!isDraftable(state, _options) &&\n typeof state === 'object' &&\n state !== null) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n const [draft, finalize] = draftify(state, _options);\n if (typeof arg1 !== 'function') {\n if (!isDraftable(state, _options)) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n return [draft, finalize];\n }\n let result;\n try {\n result = mutate(draft);\n }\n catch (error) {\n revokeProxy(getProxyDraft(draft));\n throw error;\n }\n const returnValue = (value) => {\n const proxyDraft = getProxyDraft(draft);\n if (!isDraft(value)) {\n if (value !== undefined &&\n !isEqual(value, draft) &&\n (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated)) {\n throw new Error(`Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.`);\n }\n const rawReturnValue = value === null || value === void 0 ? void 0 : value[RAW_RETURN_SYMBOL];\n if (rawReturnValue) {\n const _value = rawReturnValue[0];\n if (_options.strict && typeof value === 'object' && value !== null) {\n handleReturnValue({\n rootDraft: proxyDraft,\n value,\n useRawReturn: true,\n });\n }\n return finalize([_value]);\n }\n if (value !== undefined) {\n if (typeof value === 'object' && value !== null) {\n handleReturnValue({ rootDraft: proxyDraft, value });\n }\n return finalize([value]);\n }\n }\n if (value === draft || value === undefined) {\n return finalize([]);\n }\n const returnedProxyDraft = getProxyDraft(value);\n if (_options === returnedProxyDraft.options) {\n if (returnedProxyDraft.operated) {\n throw new Error(`Cannot return a modified child draft.`);\n }\n return finalize([current(value)]);\n }\n return finalize([value]);\n };\n if (result instanceof Promise) {\n return result.then(returnValue, (error) => {\n revokeProxy(getProxyDraft(draft));\n throw error;\n });\n }\n return returnValue(result);\n };\n};\n\n/**\n * `create(baseState, callback, options)` to create the next state\n *\n * ## Example\n *\n * ```ts\n * import { create } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * ```\n */\nconst create = makeCreator();\n\n/**\n * `apply(state, patches)` to apply patches to state\n *\n * ## Example\n *\n * ```ts\n * import { create, apply } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const [state, patches] = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * { enablePatches: true }\n * );\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(patches).toEqual([{ op: 'replace', path: ['foo', 'bar'], value: 'str2' }]);\n * expect(state).toEqual(apply(baseState, patches));\n * ```\n */\nfunction apply(state, patches, applyOptions) {\n let i;\n for (i = patches.length - 1; i >= 0; i -= 1) {\n const { value, op, path } = patches[i];\n if ((!path.length && op === Operation.Replace) ||\n (path === '' && op === Operation.Add)) {\n state = value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const mutate = (draft) => {\n patches.forEach((patch) => {\n const { path: _path, op } = patch;\n const path = unescapePath(_path);\n let base = draft;\n for (let index = 0; index < path.length - 1; index += 1) {\n const parentType = getType(base);\n let key = path[index];\n if (typeof key !== 'string' && typeof key !== 'number') {\n key = String(key);\n }\n if (((parentType === 0 /* DraftType.Object */ ||\n parentType === 1 /* DraftType.Array */) &&\n (key === '__proto__' || key === 'constructor')) ||\n (typeof base === 'function' && key === 'prototype')) {\n throw new Error(`Patching reserved attributes like __proto__ and constructor is not allowed.`);\n }\n // use `index` in Set draft\n base = get(parentType === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot apply patch at '${path.join('/')}'.`);\n }\n }\n const type = getType(base);\n // ensure the original patch is not modified.\n const value = deepClone(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case Operation.Replace:\n switch (type) {\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n throw new Error(`Cannot apply replace patch to set.`);\n default:\n return (base[key] = value);\n }\n case Operation.Add:\n switch (type) {\n case 1 /* DraftType.Array */:\n // If the \"-\" character is used to\n // index the end of the array (see [RFC6901](https://datatracker.ietf.org/doc/html/rfc6902)),\n // this has the effect of appending the value to the array.\n return key === '-'\n ? base.push(value)\n : base.splice(key, 0, value);\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n return base.add(value);\n default:\n return (base[key] = value);\n }\n case Operation.Remove:\n switch (type) {\n case 1 /* DraftType.Array */:\n return base.splice(key, 1);\n case 2 /* DraftType.Map */:\n return base.delete(key);\n case 3 /* DraftType.Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n throw new Error(`Unsupported patch operation: ${op}.`);\n }\n });\n };\n if (applyOptions === null || applyOptions === void 0 ? void 0 : applyOptions.mutable) {\n {\n if (Object.keys(applyOptions).filter((key) => key !== 'mutable').length) {\n console.warn('The \"mutable\" option is not allowed to be used with other options.');\n }\n }\n mutate(state);\n return undefined;\n }\n if (isDraft(state)) {\n if (applyOptions !== undefined) {\n throw new Error(`Cannot apply patches with options to a draft.`);\n }\n mutate(state);\n return state;\n }\n return create(state, mutate, Object.assign(Object.assign({}, applyOptions), { enablePatches: false }));\n}\n\n/**\n * `original(draft)` to get original state in the draft mutation function.\n *\n * ## Example\n *\n * ```ts\n * import { create, original } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * expect(original(draft.foo)).toEqual({ bar: 'str' });\n * }\n * );\n * ```\n */\nfunction original(target) {\n const proxyDraft = getProxyDraft(target);\n if (!proxyDraft) {\n throw new Error(`original() is only used for a draft, parameter: ${target}`);\n }\n return proxyDraft.original;\n}\n\n/**\n * Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.\n *\n * ## Example\n *\n * ```ts\n * import { create, rawReturn } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * return rawReturn(baseState);\n * },\n * );\n * expect(state).toBe(baseState);\n * ```\n */\nfunction rawReturn(value) {\n if (arguments.length === 0) {\n throw new Error('rawReturn() must be called with a value.');\n }\n if (arguments.length > 1) {\n throw new Error('rawReturn() must be called with one argument.');\n }\n if (value !== undefined &&\n (typeof value !== 'object' || value === null)) {\n console.warn('rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().');\n }\n return {\n [RAW_RETURN_SYMBOL]: [value],\n };\n}\n\nconst constructorString = Object.prototype.constructor.toString();\n/**\n * Check if the value is a simple object(No prototype chain object or iframe same-origin object),\n * support case: https://github.com/unadlib/mutative/issues/17\n */\nconst isSimpleObject = (value) => {\n if (!value || typeof value !== 'object')\n return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n const constructor = Object.hasOwnProperty.call(prototype, 'constructor') &&\n prototype.constructor;\n if (constructor === Object)\n return true;\n return (typeof constructor === 'function' &&\n Function.toString.call(constructor) === constructorString);\n};\nconst markSimpleObject = (value) => {\n if (isSimpleObject(value)) {\n return dataTypes.immutable;\n }\n return;\n};\n\n/**\n * Cast a value to an Draft type value.\n */\nfunction castDraft(value) {\n return value;\n}\n/**\n * Cast a value to an Immutable type value.\n */\nfunction castImmutable(value) {\n return value;\n}\n/**\n * Cast a value to an Mutable type value.\n */\nfunction castMutable(draft) {\n return draft;\n}\n\nexport { apply, castDraft, castImmutable, castMutable, create, current, isDraft, isDraftable, makeCreator, markSimpleObject, original, rawReturn, unsafe };\n//# sourceMappingURL=mutative.esm.mjs.map\n","import { a as buildOperationSignatureParams, c as hex2ab, i as buildOperationSignatureMessage, n as generateId, o as getUnixTimestamp, r as ab2hex, s as hashBrowser, t as deriveOperationId } from \"../utils-DKOFCM0Q.js\";\nimport { generateMock } from \"./mock.js\";\nimport { ZodError, z } from \"zod\";\nimport { stringify } from \"safe-stable-stringify\";\nimport { strFromU8, strToU8, unzip, zip } from \"fflate\";\nimport { castDraft, create, unsafe } from \"mutative\";\nimport { constantCase, pascalCase } from \"change-case\";\n//#region document-model/errors.ts\nconst FileSystemError = /* @__PURE__ */ new Error(\"File system not available.\");\nvar InvalidActionInputError = class extends Error {\n\tdata;\n\tconstructor(data) {\n\t\tsuper();\n\t\tthis.name = \"InvalidActionInputError\";\n\t\tthis.data = data;\n\t\tthis.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;\n\t}\n};\nvar InvalidActionInputZodError = class extends InvalidActionInputError {\n\tissues;\n\tconstructor(issues) {\n\t\tsuper(issues);\n\t\tthis.issues = issues;\n\t\tthis.name = \"InvalidActionInputZodError\";\n\t}\n};\nvar HashMismatchError = class extends Error {\n\t_scope;\n\t_document;\n\t_operation;\n\tconstructor(scope, document, operation) {\n\t\tsuper();\n\t\tthis.name = \"HashMismatchError\";\n\t\tthis._document = document;\n\t\tthis._scope = scope;\n\t\tthis._operation = operation;\n\t\tthis.message = JSON.stringify({\n\t\t\terror: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,\n\t\t\tdocument,\n\t\t\toperation\n\t\t}, null, 1);\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget scope() {\n\t\treturn this._scope;\n\t}\n\tget operation() {\n\t\treturn this._operation;\n\t}\n};\n//#endregion\n//#region document-model/schemas.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst Load_StateSchema = z.enum([\"LOAD_STATE\"]);\nconst PruneSchema = z.enum([\"PRUNE\"]);\nconst RedoSchema = z.enum([\"REDO\"]);\nconst Set_NameSchema = z.enum([\"SET_NAME\"]);\nconst Set_PreferredEditorSchema = z.enum([\"SET_PREFERRED_EDITOR\"]);\nconst UndoSchema = z.enum([\"UNDO\"]);\nfunction OperationScopeSchema() {\n\treturn z.string();\n}\nfunction DocumentActionSchema() {\n\treturn z.union([\n\t\tLoadStateActionSchema(),\n\t\tPruneActionSchema(),\n\t\tRedoActionSchema(),\n\t\tSetNameActionSchema(),\n\t\tSetPreferredEditorActionSchema(),\n\t\tUndoActionSchema()\n\t]);\n}\nfunction LoadStateActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => LoadStateActionInputSchema()),\n\t\ttype: Load_StateSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction LoadStateActionInputSchema() {\n\treturn z.object({\n\t\toperations: z.number(),\n\t\tstate: z.lazy(() => LoadStateActionStateInputSchema())\n\t});\n}\nfunction LoadStateActionStateInputSchema() {\n\treturn z.object({\n\t\tdata: z.unknown().nullish(),\n\t\tname: z.string()\n\t});\n}\nfunction PruneActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => PruneActionInputSchema()),\n\t\ttype: PruneSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction PruneActionInputSchema() {\n\treturn z.object({\n\t\tend: z.number().nullish(),\n\t\tstart: z.number().nullish()\n\t});\n}\nfunction RedoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction RedoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: RedoActionInputSchema(),\n\t\ttype: RedoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetNameActionInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetNameActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetNameActionInputSchema(),\n\t\ttype: Set_NameSchema,\n\t\tscope: z.literal(\"global\")\n\t});\n}\nfunction SetPreferredEditorActionInputSchema() {\n\treturn z.object({ preferredEditor: z.string().nullable() });\n}\nfunction SetPreferredEditorActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetPreferredEditorActionInputSchema(),\n\t\ttype: Set_PreferredEditorSchema,\n\t\tscope: z.literal(\"header\")\n\t});\n}\nfunction UndoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction UndoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: UndoActionInputSchema(),\n\t\ttype: UndoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction AddChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"AddChangeLogItemInput\").optional(),\n\t\tcontent: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullable()\n\t});\n}\nfunction AddModuleInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string()\n\t});\n}\nfunction AddOperationErrorInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\terrorDescription: z.string().nullish(),\n\t\terrorName: z.string().nullish(),\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tmoduleId: z.string(),\n\t\tname: z.string(),\n\t\treducer: z.string().nullish(),\n\t\tschema: z.string().nullish(),\n\t\ttemplate: z.string().nullish(),\n\t\tscope: OperationScopeSchema().nullish()\n\t});\n}\nfunction AddStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullish()\n\t});\n}\nfunction AuthorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Author\").optional(),\n\t\tname: z.string(),\n\t\twebsite: z.string().nullable()\n\t});\n}\nfunction CodeExampleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"CodeExample\").optional(),\n\t\tid: z.string(),\n\t\tvalue: z.string()\n\t});\n}\nfunction DeleteChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n\t\tid: z.string()\n\t});\n}\nfunction DeleteModuleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationErrorInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationExampleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction DocumentModelInputSchema() {\n\treturn z.union([\n\t\tAddChangeLogItemInputSchema(),\n\t\tAddModuleInputSchema(),\n\t\tAddOperationErrorInputSchema(),\n\t\tAddOperationExampleInputSchema(),\n\t\tAddOperationInputSchema(),\n\t\tAddStateExampleInputSchema(),\n\t\tDeleteChangeLogItemInputSchema(),\n\t\tDeleteModuleInputSchema(),\n\t\tDeleteOperationErrorInputSchema(),\n\t\tDeleteOperationExampleInputSchema(),\n\t\tDeleteOperationInputSchema(),\n\t\tDeleteStateExampleInputSchema(),\n\t\tMoveOperationInputSchema(),\n\t\tReorderChangeLogItemsInputSchema(),\n\t\tReorderModuleOperationsInputSchema(),\n\t\tReorderModulesInputSchema(),\n\t\tReorderOperationErrorsInputSchema(),\n\t\tReorderOperationExamplesInputSchema(),\n\t\tReorderStateExamplesInputSchema(),\n\t\tSetAuthorNameInputSchema(),\n\t\tSetAuthorWebsiteInputSchema(),\n\t\tSetInitialStateInputSchema(),\n\t\tSetModelDescriptionInputSchema(),\n\t\tSetModelExtensionInputSchema(),\n\t\tSetModelIdInputSchema(),\n\t\tSetModelNameInputSchema(),\n\t\tSetModuleDescriptionInputSchema(),\n\t\tSetModuleNameInputSchema(),\n\t\tSetOperationDescriptionInputSchema(),\n\t\tSetOperationErrorCodeInputSchema(),\n\t\tSetOperationErrorDescriptionInputSchema(),\n\t\tSetOperationErrorNameInputSchema(),\n\t\tSetOperationErrorTemplateInputSchema(),\n\t\tSetOperationNameInputSchema(),\n\t\tSetOperationReducerInputSchema(),\n\t\tSetOperationSchemaInputSchema(),\n\t\tSetOperationTemplateInputSchema(),\n\t\tSetStateSchemaInputSchema(),\n\t\tUpdateChangeLogItemInputSchema(),\n\t\tUpdateOperationExampleInputSchema(),\n\t\tUpdateStateExampleInputSchema()\n\t]);\n}\nfunction DocumentModelGlobalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentModelGlobalState\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tauthor: AuthorSchema(),\n\t\textension: z.string(),\n\t\tdescription: z.string(),\n\t\tspecifications: z.array(DocumentSpecificationSchema())\n\t});\n}\nfunction DocumentSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentSpecification\").optional(),\n\t\tstate: ScopeStateSchema(),\n\t\tmodules: z.array(ModuleSchema()),\n\t\tversion: z.number().int(),\n\t\tchangeLog: z.array(z.string())\n\t});\n}\nfunction ModuleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ModuleSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\toperations: z.array(OperationSpecificationSchema())\n\t});\n}\nfunction MoveOperationInputSchema() {\n\treturn z.object({\n\t\tnewModuleId: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction OperationSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\tschema: z.string().nullable(),\n\t\ttemplate: z.string().nullable(),\n\t\treducer: z.string().nullable(),\n\t\terrors: z.array(OperationErrorSchema()),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction OperationErrorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationErrorSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\tcode: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\ttemplate: z.string().nullable()\n\t});\n}\nfunction ReorderChangeLogItemsInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModuleOperationsInputSchema() {\n\treturn z.object({\n\t\tmoduleId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModulesInputSchema() {\n\treturn z.object({ order: z.array(z.string()) });\n}\nfunction ReorderOperationErrorsInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderOperationExamplesInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderStateExamplesInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction SetAuthorNameInputSchema() {\n\treturn z.object({ authorName: z.string() });\n}\nfunction SetAuthorWebsiteInputSchema() {\n\treturn z.object({ authorWebsite: z.string() });\n}\nfunction SetInitialStateInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction SetModelDescriptionInputSchema() {\n\treturn z.object({ description: z.string() });\n}\nfunction SetModelExtensionInputSchema() {\n\treturn z.object({ extension: z.string() });\n}\nfunction SetModelIdInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction SetModelNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetModuleDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetModuleNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorCodeInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorDescriptionInputSchema() {\n\treturn z.object({\n\t\terrorDescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorNameInputSchema() {\n\treturn z.object({\n\t\terrorName: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorTemplateInputSchema() {\n\treturn z.object({\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationScopeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetOperationReducerInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\treducer: z.string().nullish()\n\t});\n}\nfunction SetOperationSchemaInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tschema: z.string().nullish()\n\t});\n}\nfunction SetOperationTemplateInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttemplate: z.string().nullish()\n\t});\n}\nfunction SetStateSchemaInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction StateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"State\").optional(),\n\t\tschema: z.string(),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction ScopeStateSchema() {\n\treturn z.object({\n\t\tlocal: StateSchema(),\n\t\tglobal: StateSchema()\n\t});\n}\nfunction UpdateChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n\t\tid: z.string(),\n\t\tnewContent: z.string()\n\t});\n}\nfunction UpdateOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction UpdateStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string(),\n\t\tnewExample: z.string()\n\t});\n}\nconst PowerhouseModuleSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tdocumentTypes: z.array(z.string()).optional()\n});\nconst PowerhouseModulesSchema = z.array(PowerhouseModuleSchema).optional();\nconst PublisherSchema = z.object({\n\tname: z.string().optional(),\n\turl: z.string().optional()\n});\nconst ConfigEntryTypeSchema = z.union([z.literal(\"var\"), z.literal(\"secret\")]);\nconst ConfigEntrySchema = z.object({\n\tname: z.string(),\n\ttype: ConfigEntryTypeSchema,\n\tdescription: z.string().optional(),\n\trequired: z.boolean().optional(),\n\tdefault: z.boolean().optional()\n});\nconst ManifestSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tcategory: z.string().optional(),\n\tpublisher: PublisherSchema.optional(),\n\tdocumentModels: PowerhouseModulesSchema,\n\tapps: PowerhouseModulesSchema,\n\teditors: PowerhouseModulesSchema,\n\tprocessors: PowerhouseModulesSchema,\n\tsubgraphs: PowerhouseModulesSchema,\n\tconfig: z.array(ConfigEntrySchema).optional()\n});\n//#endregion\n//#region document-model/actions.ts\n/**\n* Cancels the last `count` operations.\n*\n* @param count - Number of operations to cancel\n* @category Actions\n*/\nconst undo = (count = 1, scope = \"global\") => createAction(\"UNDO\", { count }, void 0, UndoActionInputSchema, scope);\n/**\n* Cancels the last `count` {@link undo | UNDO} operations.\n*\n* @param count - Number of UNDO operations to cancel\n* @category Actions\n*/\nconst redo = (count = 1, scope = \"global\") => createAction(\"REDO\", { count }, void 0, RedoActionInputSchema, scope);\n/**\n* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.\n*\n* @remarks\n* Useful to keep operations history smaller. Operations to prune are selected by index,\n* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.\n*\n* @param start - Index of the first operation to prune\n* @param end - Index of the last operation to prune\n* @category Actions\n*/\nconst prune = (start, end, scope = \"global\") => createAction(\"PRUNE\", {\n\tstart,\n\tend\n}, void 0, PruneActionInputSchema, scope);\n/**\n* Replaces the state of the document.\n*\n* @remarks\n* This action shouldn't be used directly. It is dispatched by the {@link prune} action.\n*\n* @param state - State to be set in the document.\n* @param operations - Number of operations that were removed from the previous state.\n* @category Actions\n*/\nconst loadState = (state, operations) => createAction(\"LOAD_STATE\", {\n\tstate,\n\toperations\n}, void 0, LoadStateActionInputSchema);\nconst noop = (scope = \"global\") => createAction(\"NOOP\", {}, void 0, void 0, scope);\n/**\n* Helper function to be used by action creators.\n*\n* @remarks\n* Creates an action with the given type and input properties. The input\n* properties default to an empty object.\n*\n* @typeParam A - Type of the action to be returned.\n*\n* @param type - The type of the action.\n* @param input - The input properties of the action.\n* @param _attachments - Deprecated and ignored. Retained so action creators\n* generated before the attachment-system removal keep their 5-argument shape.\n* @param validator - The validator to use for the input properties.\n* @param scope - The scope of the action, can either be 'global' or 'local'.\n*\n* @throws Error if the type is empty or not a string.\n*\n* @returns The new action.\n*/\nfunction createAction(type, input, _attachments, validator, scope = \"global\") {\n\tif (!type) throw new Error(\"Empty action type\");\n\tif (typeof type !== \"string\") throw new Error(`Invalid action type: ${JSON.stringify(type)}`);\n\tconst action = {\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\ttype,\n\t\tinput,\n\t\tscope\n\t};\n\ttry {\n\t\tvalidator?.().parse(action.input);\n\t} catch (error) {\n\t\tif (error instanceof ZodError) throw new InvalidActionInputZodError(error.issues);\n\t\tthrow new InvalidActionInputError(error);\n\t}\n\treturn action;\n}\n/**\n* This function should be used instead of { ...action } to ensure\n* that extra properties are not included in the action.\n*/\nconst actionFromAction = (action) => {\n\treturn {\n\t\tid: action.id,\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\ttype: action.type,\n\t\tinput: action.input,\n\t\tscope: action.scope,\n\t\tcontext: action.context\n\t};\n};\nconst operationFromAction = (action, index, skip, context) => {\n\treturn {\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(context.documentId, context.scope, context.branch, action.id),\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip\n\t};\n};\nconst operationFromOperation = (operation, index, skip, context) => {\n\tconst id = deriveOperationId(context.documentId, context.scope, context.branch, operation.action.id);\n\treturn {\n\t\t...operation,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip,\n\t\tid\n\t};\n};\nconst operationWithContext = (operation, context) => {\n\tif (!operation.action) throw new Error(\"Operation has no action\");\n\treturn {\n\t\t...operation,\n\t\taction: {\n\t\t\t...operation.action,\n\t\t\tcontext\n\t\t}\n\t};\n};\nconst actionContext = () => ({});\nconst actionSigner = (user, app, signatures = []) => ({\n\tuser,\n\tapp,\n\tsignatures\n});\nasync function buildOperationSignature(context, signMethod) {\n\tconst params = buildOperationSignatureParams(context);\n\tconst signature = await signMethod(buildOperationSignatureMessage(params));\n\treturn [...params, `0x${ab2hex(signature)}`];\n}\nasync function buildSignedAction(action, reducer, document, signer, signHandler) {\n\tconst scopeOperations = reducer(document, action, void 0, { reuseOperationResultingState: true }).operations[action.scope];\n\tif (!scopeOperations) throw new Error(`No operations found for scope: ${action.scope}`);\n\tconst operation = scopeOperations.at(-1);\n\tif (!operation) throw new Error(\"Action was not applied\");\n\tconst previousStateHash = scopeOperations.at(-2)?.hash ?? \"\";\n\tconst signature = await buildOperationSignature({\n\t\tdocumentId: document.header.id,\n\t\tsigner,\n\t\taction,\n\t\tpreviousStateHash\n\t}, signHandler);\n\treturn operationWithContext(operation, { signer: actionSigner(signer.user, signer.app, [...signer.signatures, signature]) });\n}\nasync function verifyOperationSignature(signature, signer, verifyHandler) {\n\tconst publicKey = signer.app.key;\n\tconst params = signature.slice(0, 4);\n\treturn verifyHandler(publicKey, hex2ab(signature[4]), buildOperationSignatureMessage(params));\n}\n/**\n* Changes the name of the document.\n*\n* @param name - The name to be set in the document.\n* @category Actions\n*/\nconst setName = (name) => createAction(\"SET_NAME\", typeof name === \"string\" ? { name } : name, void 0, SetNameActionInputSchema, \"global\");\n/**\n* Changes the preferred editor recorded in the document header meta.\n*\n* Passing `null` clears the preferred editor.\n*\n* @category Actions\n*/\nconst setPreferredEditor = (input) => createAction(\"SET_PREFERRED_EDITOR\", typeof input === \"object\" && input !== null ? input : { preferredEditor: input }, void 0, SetPreferredEditorActionInputSchema, \"header\");\nconst setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, void 0, SetModelNameInputSchema, \"global\");\nconst setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, void 0, SetModelIdInputSchema, \"global\");\nconst setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, void 0, SetModelExtensionInputSchema, \"global\");\nconst setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, void 0, SetModelDescriptionInputSchema, \"global\");\nconst setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, void 0, SetAuthorNameInputSchema, \"global\");\nconst setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, void 0, SetAuthorWebsiteInputSchema, \"global\");\nconst addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, void 0, AddModuleInputSchema, \"global\");\nconst setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, void 0, SetModuleNameInputSchema, \"global\");\nconst setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, void 0, SetModuleDescriptionInputSchema, \"global\");\nconst deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, void 0, DeleteModuleInputSchema, \"global\");\nconst reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, void 0, ReorderModulesInputSchema, \"global\");\nconst addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, void 0, AddOperationInputSchema, \"global\");\nconst setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, void 0, SetOperationNameInputSchema, \"global\");\nconst setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, void 0, SetOperationScopeInputSchema, \"global\");\nconst setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, void 0, SetOperationSchemaInputSchema, \"global\");\nconst setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, void 0, SetOperationDescriptionInputSchema, \"global\");\nconst setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, void 0, SetOperationTemplateInputSchema, \"global\");\nconst setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, void 0, SetOperationReducerInputSchema, \"global\");\nconst moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, void 0, MoveOperationInputSchema, \"global\");\nconst deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, void 0, DeleteOperationInputSchema, \"global\");\nconst reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, void 0, ReorderModuleOperationsInputSchema, \"global\");\nconst addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, void 0, AddOperationErrorInputSchema, \"global\");\nconst setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, void 0, SetOperationErrorCodeInputSchema, \"global\");\nconst setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, void 0, SetOperationErrorNameInputSchema, \"global\");\nconst setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, void 0, SetOperationErrorDescriptionInputSchema, \"global\");\nconst setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, void 0, SetOperationErrorTemplateInputSchema, \"global\");\nconst deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, void 0, DeleteOperationErrorInputSchema, \"global\");\nconst reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, void 0, ReorderOperationErrorsInputSchema, \"global\");\nconst addOperationExample = (input) => createAction(\"ADD_OPERATION_EXAMPLE\", { ...input }, void 0, AddOperationExampleInputSchema, \"global\");\nconst updateOperationExample = (input) => createAction(\"UPDATE_OPERATION_EXAMPLE\", { ...input }, void 0, UpdateOperationExampleInputSchema, \"global\");\nconst deleteOperationExample = (input) => createAction(\"DELETE_OPERATION_EXAMPLE\", { ...input }, void 0, DeleteOperationExampleInputSchema, \"global\");\nconst reorderOperationExamples = (input) => createAction(\"REORDER_OPERATION_EXAMPLES\", { ...input }, void 0, ReorderOperationExamplesInputSchema, \"global\");\nconst operationExampleCreators = {\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples\n};\nconst setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, void 0, SetStateSchemaInputSchema, \"global\");\nconst setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, void 0, SetInitialStateInputSchema, \"global\");\nconst addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, void 0, AddStateExampleInputSchema, \"global\");\nconst updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, void 0, UpdateStateExampleInputSchema, \"global\");\nconst deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, void 0, DeleteStateExampleInputSchema, \"global\");\nconst reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, void 0, ReorderStateExamplesInputSchema, \"global\");\nconst addChangeLogItem = (input) => createAction(\"ADD_CHANGE_LOG_ITEM\", { ...input }, void 0, AddChangeLogItemInputSchema, \"global\");\nconst updateChangeLogItem = (input) => createAction(\"UPDATE_CHANGE_LOG_ITEM\", { ...input }, void 0, UpdateChangeLogItemInputSchema, \"global\");\nconst deleteChangeLogItem = (input) => createAction(\"DELETE_CHANGE_LOG_ITEM\", { ...input }, void 0, DeleteChangeLogItemInputSchema, \"global\");\nconst reorderChangeLogItems = (input) => createAction(\"REORDER_CHANGE_LOG_ITEMS\", { ...input }, void 0, ReorderChangeLogItemsInputSchema, \"global\");\nconst releaseNewVersion = () => createAction(\"RELEASE_NEW_VERSION\", {}, void 0, void 0, \"global\");\nconst baseActions = {\n\tsetName,\n\tsetPreferredEditor,\n\tundo,\n\tredo,\n\tprune,\n\tloadState,\n\tnoop\n};\nconst documentModelActions = {\n\tsetModelName,\n\tsetModelId,\n\tsetModelExtension,\n\tsetModelDescription,\n\tsetAuthorName,\n\tsetAuthorWebsite,\n\taddModule,\n\tsetModuleName,\n\tsetModuleDescription,\n\tdeleteModule,\n\treorderModules,\n\taddOperation,\n\tsetOperationName,\n\tsetOperationScope,\n\tsetOperationSchema,\n\tsetOperationDescription,\n\tsetOperationTemplate,\n\tsetOperationReducer,\n\tmoveOperation,\n\tdeleteOperation,\n\treorderModuleOperations,\n\taddOperationError,\n\tsetOperationErrorCode,\n\tsetOperationErrorName,\n\tsetOperationErrorDescription,\n\tsetOperationErrorTemplate,\n\tdeleteOperationError,\n\treorderOperationErrors,\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples,\n\tsetStateSchema,\n\tsetInitialState,\n\taddStateExample,\n\tupdateStateExample,\n\tdeleteStateExample,\n\treorderStateExamples,\n\taddChangeLogItem,\n\tupdateChangeLogItem,\n\tdeleteChangeLogItem,\n\treorderChangeLogItems,\n\treleaseNewVersion\n};\nconst actions = {\n\t...baseActions,\n\t...documentModelActions\n};\n//#endregion\n//#region document-model/constants.ts\nconst documentModelFileExtension = \"phdm\";\nconst documentModelInitialLocalState = {};\nconst documentModelInitialGlobalState = {\n\tid: \"\",\n\tname: \"\",\n\textension: \"\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"\",\n\t\twebsite: \"\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: []\n\t}]\n};\nconst documentModelGlobalState = {\n\tid: \"powerhouse/document-model\",\n\tname: \"DocumentModel\",\n\textension: \"phdm\",\n\tdescription: \"The Powerhouse Document Model describes the state and operations of a document type.\",\n\tauthor: {\n\t\tname: \"Powerhouse\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type CodeExample {\\n id: ID!\\n value: String!\\n}\\n\\ntype OperationError {\\n id: ID!\\n code: String\\n name: String\\n description: String\\n template: String\\n}\\n\\ntype Operation {\\n id: ID!\\n name: String\\n schema: String\\n description: String\\n template: String\\n errors: [OperationError!]!\\n examples: [CodeExample!]!\\n reducer: String\\n scope: String\\n}\\n\\ntype Module {\\n id: ID!\\n name: String!\\n description: String\\n operations: [Operation!]!\\n}\\n\\ntype State {\\n schema: String!\\n initialValue: String!\\n examples: [CodeExample!]!\\n}\\n\\ntype ScopeState {\\n global: State!\\n local: State!\\n}\\n\\ntype Author {\\n name: String!\\n website: String\\n}\\n\\ntype DocumentSpecification {\\n version: Int!\\n state: ScopeState!\\n modules: [Module!]!\\n changeLog: [String!]!\\n}\\n\\ntype DocumentModelGlobalState {\\n name: String!\\n id: String!\\n extension: String!\\n description: String!\\n author: Author!\\n specifications: [DocumentSpecification!]!\\n}\",\n\t\t\t\tinitialValue: \"{\\n \\\"id\\\": \\\"\\\",\\n \\\"name\\\": \\\"\\\",\\n \\\"extension\\\": \\\"\\\",\\n \\\"description\\\": \\\"\\\",\\n \\\"author\\\": {\\n \\\"name\\\": \\\"\\\",\\n \\\"website\\\": \\\"\\\"\\n },\\n \\\"specifications\\\": [\\n {\\n \\\"version\\\": 1,\\n \\\"changeLog\\\": [],\\n \\\"state\\\": {\\n \\\"global\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n },\\n \\\"local\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n }\\n },\\n \\\"modules\\\": []\\n }\\n ]\\n}\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [\n\t\t\t{\n\t\t\t\tname: \"header\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model\",\n\t\t\t\t\t\tschema: \"input SetModelNameInput {\\n name: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_ID\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the unique identifier for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelIdInput {\\n id: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_EXTENSION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the file extension associated with this document model\",\n\t\t\t\t\t\tschema: \"input SetModelExtensionInput {\\n extension: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description text for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelDescriptionInput {\\n description: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorNameInput {\\n authorName: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_WEBSITE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the website URL of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorWebsiteInput {\\n authorWebsite: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"versioning\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new item to the document model changelog\",\n\t\t\t\t\t\tschema: \"input AddChangeLogItemInput {\\n id: ID!\\n insertBefore: ID\\n content: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing changelog item\",\n\t\t\t\t\t\tschema: \"input UpdateChangeLogItemInput {\\n id: ID!\\n newContent: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an item from the document model changelog\",\n\t\t\t\t\t\tschema: \"input DeleteChangeLogItemInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_CHANGE_LOG_ITEMS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of changelog items\",\n\t\t\t\t\t\tschema: \"input ReorderChangeLogItemsInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"RELEASE_NEW_VERSION\",\n\t\t\t\t\t\tschema: null,\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Creates a new version of the document model specification\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"module\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new module to the document model specification\",\n\t\t\t\t\t\tschema: \"input AddModuleInput {\\n id: ID!\\n name: String!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a module from the document model specification\",\n\t\t\t\t\t\tschema: \"input DeleteModuleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of modules in the document model specification\",\n\t\t\t\t\t\tschema: \"input ReorderModulesInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-error\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new error definition to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationErrorInput {\\n operationId: ID!\\n id: ID!\\n errorCode: String\\n errorName: String\\n errorDescription: String\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_CODE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the error code for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorCodeInput {\\n id: ID!\\n errorCode: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorNameInput {\\n id: ID!\\n errorName: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorDescriptionInput {\\n id: ID!\\n errorDescription: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorTemplateInput {\\n id: ID!\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an error definition from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationErrorInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_ERRORS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of error definitions for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationErrorsInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-example\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new code example to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationExampleInput {\\n operationId: ID!\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing code example for an operation\",\n\t\t\t\t\t\tschema: \"input UpdateOperationExampleInput {\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a code example from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationExampleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of code examples for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationExamplesInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new operation to a module\",\n\t\t\t\t\t\tschema: \"input AddOperationInput {\\n moduleId: ID!\\n id: ID!\\n name: String!\\n schema: String\\n description: String\\n template: String\\n reducer: String\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for an operation's input\",\n\t\t\t\t\t\tschema: \"input SetOperationSchemaInput {\\n id: ID!\\n schema: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationTemplateInput {\\n id: ID!\\n template: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_REDUCER\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the reducer function code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationReducerInput {\\n id: ID!\\n reducer: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCOPE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the scope of an operation (global or local)\",\n\t\t\t\t\t\tschema: \"input SetOperationScopeInput {\\n id: ID!\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"MOVE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Moves an operation from one module to another\",\n\t\t\t\t\t\tschema: \"input MoveOperationInput {\\n operationId: ID!\\n newModuleId: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an operation from a module\",\n\t\t\t\t\t\tschema: \"input DeleteOperationInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULE_OPERATIONS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of operations within a module\",\n\t\t\t\t\t\tschema: \"input ReorderModuleOperationsInput {\\n moduleId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"state\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_STATE_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for document state\",\n\t\t\t\t\t\tschema: \"input SetStateSchemaInput {\\n scope: String!\\n schema: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_INITIAL_STATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the initial state value for a document scope\",\n\t\t\t\t\t\tschema: \"input SetInitialStateInput {\\n scope: String!\\n initialValue: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new state example to a document scope\",\n\t\t\t\t\t\tschema: \"input AddStateExampleInput {\\n scope: String!\\n id: ID!\\n insertBefore: ID\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing state example for a document scope\",\n\t\t\t\t\t\tschema: \"input UpdateStateExampleInput {\\n scope: String!\\n id: ID!\\n newExample: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a state example from a document scope\",\n\t\t\t\t\t\tschema: \"input DeleteStateExampleInput {\\n scope: String!\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_STATE_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of state examples for a document scope\",\n\t\t\t\t\t\tschema: \"input ReorderStateExamplesInput {\\n scope: String!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t}\n\t\t]\n\t}]\n};\nconst HASH_ALGORITHM_SHA1 = \"sha1\";\nconst HASH_ALGORITHM_SHA256 = \"sha256\";\nconst HASH_ALGORITHM_SHA512 = \"sha512\";\nconst HASH_ENCODING_BASE64 = \"base64\";\nconst HASH_ENCODING_HEX = \"hex\";\n//#endregion\n//#region document-model/document-type.ts\nconst documentModelDocumentType = \"powerhouse/document-model\";\n//#endregion\n//#region document-model/document-schema.ts\nconst BaseDocumentHeaderSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtUtcIso: z.string(),\n\tlastModifiedAtUtcIso: z.string(),\n\tdocumentType: z.string()\n});\nconst BaseDocumentStateSchema = z.object({ global: z.unknown() });\n/** Schema for validating the header object of a DocumentModel document */\nconst DocumentModelHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(documentModelDocumentType) });\n/** Schema for validating the state object of a DocumentModel document */\nconst DocumentModelPHStateSchema = BaseDocumentStateSchema.extend({ global: DocumentModelGlobalStateSchema() });\nconst DocumentModelSchema = z.object({\n\theader: DocumentModelHeaderSchema,\n\tstate: DocumentModelPHStateSchema,\n\tinitialState: DocumentModelPHStateSchema\n});\n/** Simple helper function to check if a state object is a DocumentModel document state object */\nfunction isDocumentModelState(state) {\n\treturn DocumentModelPHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a DocumentModel document state object */\nfunction assertIsDocumentModelState(state) {\n\tDocumentModelPHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a DocumentModel document */\nfunction isDocumentModelDocument(document) {\n\treturn DocumentModelSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a DocumentModel document */\nfunction assertIsDocumentModelDocument(document) {\n\tDocumentModelSchema.parse(document);\n}\n//#endregion\n//#region document-model/header.ts\n/**\n* Generates a deterministic payload from signing parameters\n*/\nconst generateStablePayload = (parameters) => `${parameters.documentType}:${parameters.createdAtUtcIso}:${parameters.nonce}`;\n/**\n* Creates a verification-only signer from a public key.\n* This signer can only verify signatures, not sign data.\n*\n* @param pubKey - The public key to use for verification.\n* @returns An ISigner that can only verify signatures.\n*/\nasync function createVerificationSigner(pubKey) {\n\tconst cryptoKey = await crypto.subtle.importKey(\"jwk\", pubKey, {\n\t\tname: \"ECDSA\",\n\t\tnamedCurve: \"P-256\"\n\t}, true, [\"verify\"]);\n\treturn {\n\t\tpublicKey: cryptoKey,\n\t\tasync sign(_data) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign data\");\n\t\t},\n\t\tasync signAction(_action, _abortSignal) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign actions\");\n\t\t},\n\t\tasync verify(data, signature) {\n\t\t\tlet isValid;\n\t\t\ttry {\n\t\t\t\tisValid = await crypto.subtle.verify({\n\t\t\t\t\tname: \"ECDSA\",\n\t\t\t\t\thash: \"SHA-256\"\n\t\t\t\t}, cryptoKey, new Uint8Array(signature), new Uint8Array(data));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"invalid signature\");\n\t\t\t}\n\t\t\tif (!isValid) throw new Error(\"invalid signature\");\n\t\t}\n\t};\n}\n/**\n* Creates a verification-only signer from a header.\n*\n* @param header - The header to create a signer from.\n* @returns A signer that can verify the header's signature.\n*/\nconst createSignerFromHeader = async (header) => {\n\treturn createVerificationSigner(header.sig.publicKey);\n};\n/**\n* Signs a header. Generally, this is not called directly, but rather through\n* {@link createSignedHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signer - The signer of the document.\n*\n* @returns The signature of the header.\n*/\nconst sign = async (parameters, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signature = await signer.sign(data);\n\tconst signatureArray = new Uint8Array(signature);\n\treturn btoa(String.fromCharCode(...signatureArray));\n};\n/**\n* Verifies a header signature. Generally, this is not called directly, but\n* rather through {@link validateHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signature - The signature to verify.\n* @param signer - The signer of the document.\n*/\nconst verify = async (parameters, signature, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signatureBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));\n\tawait signer.verify(data, signatureBytes);\n};\n/**\n* Validates a header signature.\n*/\nconst validateHeader = async (header) => {\n\tconst signer = await createSignerFromHeader(header);\n\treturn verify({\n\t\tdocumentType: header.documentType,\n\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\tnonce: header.sig.nonce\n\t}, header.id, signer);\n};\n/**\n* Creates a header that has yet to be signed. This header is not valid, but\n* can be input into {@link createSignedHeader} to create a signed header.\n*\n* @returns An unsigned header for a document.\n*/\nconst createPresignedHeader = (id = generateId(), documentType = \"\") => {\n\treturn {\n\t\tid,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tslug: \"\",\n\t\tname: \"\",\n\t\tbranch: \"main\",\n\t\trevision: { document: 0 },\n\t\tlastModifiedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tmeta: {}\n\t};\n};\n/**\n* Creates a new, signed header for a document. This will replace the id of the\n* document.\n*\n* @param unsignedHeader - The unsigned header to created the signed header from.\n* @param signer - The signer of the document.\n*\n* @returns A new signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeader = async (unsignedHeader, documentType, signer) => {\n\tconst parameters = {\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tnonce: generateId()\n\t};\n\treturn {\n\t\tid: await sign(parameters, signer),\n\t\tsig: {\n\t\t\tpublicKey: await crypto.subtle.exportKey(\"jwk\", signer.publicKey),\n\t\t\tnonce: parameters.nonce\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tslug: unsignedHeader.slug,\n\t\tname: unsignedHeader.name,\n\t\tbranch: unsignedHeader.branch,\n\t\trevision: unsignedHeader.revision,\n\t\tlastModifiedAtUtcIso: unsignedHeader.lastModifiedAtUtcIso,\n\t\tmeta: unsignedHeader.meta\n\t};\n};\n/**\n* Creates a signed header for a document. The document header requires a signer\n* as the document id is a cryptographic signature.\n*\n* @param documentType - The type of the document.\n* @param signer - The signer of the document.\n*\n* @returns The signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeaderForSigner = async (documentType, signer) => {\n\treturn await createSignedHeader(createPresignedHeader(), documentType, signer);\n};\n//#endregion\n//#region document-model/documents.ts\nfunction isNoopOperation(op) {\n\treturn op.type === \"NOOP\" && op.skip !== void 0 && op.skip > 0 && op.hash !== void 0;\n}\nfunction isUndoRedo(action) {\n\treturn [\"UNDO\", \"REDO\"].includes(action.type);\n}\nfunction isUndo(action) {\n\treturn action.type === \"UNDO\";\n}\nfunction isDocumentAction(action) {\n\treturn [\n\t\t\"SET_NAME\",\n\t\t\"SET_PREFERRED_EDITOR\",\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\",\n\t\t\"LOAD_STATE\"\n\t].includes(action.type);\n}\n/**\n* The document-scope operations a reactor mints on `create`, so a standalone\n* document carries its initial state when exported outside a reactor.\n*/\nfunction createDocumentScopeOperations(header, state) {\n\tconst createInput = {\n\t\tmodel: header.documentType,\n\t\tversion: 0,\n\t\tdocumentId: header.id,\n\t\tsigning: {\n\t\t\tsignature: header.id,\n\t\t\tpublicKey: header.sig.publicKey,\n\t\t\tnonce: header.sig.nonce,\n\t\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\t\tdocumentType: header.documentType\n\t\t},\n\t\tslug: header.slug,\n\t\tname: header.name,\n\t\tbranch: header.branch,\n\t\tmeta: header.meta,\n\t\tprotocolVersions: header.protocolVersions ?? { \"base-reducer\": 2 }\n\t};\n\tconst upgradeInput = {\n\t\tmodel: header.documentType,\n\t\tfromVersion: 0,\n\t\ttoVersion: state.document.version,\n\t\tdocumentId: header.id,\n\t\tinitialState: state\n\t};\n\treturn [{\n\t\tid: generateId(),\n\t\ttype: \"CREATE_DOCUMENT\",\n\t\tscope: \"document\",\n\t\ttimestampUtcMs: header.createdAtUtcIso,\n\t\tinput: createInput\n\t}, {\n\t\tid: generateId(),\n\t\ttype: \"UPGRADE_DOCUMENT\",\n\t\tscope: \"document\",\n\t\ttimestampUtcMs: header.createdAtUtcIso,\n\t\tinput: upgradeInput\n\t}].map((action, index) => ({\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(header.id, \"document\", header.branch, action.id),\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip: 0\n\t}));\n}\n/**\n* Creates a new document. When `documentType` is given the header is stamped\n* with it and the document-scope operations are seeded.\n*/\nfunction baseCreateDocument(createState, initialState, documentType = \"\") {\n\tconst state = createState(initialState);\n\tconst header = createPresignedHeader(generateId(), documentType);\n\treturn {\n\t\theader,\n\t\tstate,\n\t\tinitialState: state,\n\t\toperations: documentType ? {\n\t\t\tglobal: [],\n\t\t\tlocal: [],\n\t\t\tdocument: createDocumentScopeOperations(header, state)\n\t\t} : {\n\t\t\tglobal: [],\n\t\t\tlocal: []\n\t\t},\n\t\tclipboard: []\n\t};\n}\nfunction hashDocumentStateForScope(document, scope = \"global\") {\n\treturn hashBrowser(stringify(document.state[scope] || \"\"));\n}\nfunction readOnly(value) {\n\treturn Object.freeze(value);\n}\n/**\n* Maps skipped operations in an array of operations.\n* Skipped operations are operations that are ignored during processing.\n* @param operations - The array of operations to map.\n* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.\n* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.\n* @throws Error if the operation index is invalid and there are missing operations.\n*/\nfunction mapSkippedOperations(operations, skippedHeadOperations) {\n\tconst ops = [...operations];\n\tlet skipped = skippedHeadOperations || 0;\n\tlet latestOpIndex = ops.length > 0 ? ops[ops.length - 1].index : 0;\n\tconst scopeOpsWithIgnore = [];\n\tfor (const operation of ops.reverse()) {\n\t\tif (skipped > 0) {\n\t\t\tconst operationsDiff = latestOpIndex - operation.index;\n\t\t\tskipped -= operationsDiff;\n\t\t}\n\t\tif (skipped < 0) throw new Error(\"Invalid operation index, missing operations\");\n\t\tconst mappedOp = {\n\t\t\tignore: skipped > 0,\n\t\t\toperation\n\t\t};\n\t\tconst operationSkip = operation.skip > 0 ? operation.skip + 1 : 0;\n\t\tif (operationSkip > 0 && operationSkip > skipped) {\n\t\t\tconst skipDiff = operationSkip - skipped;\n\t\t\tskipped = skipped + skipDiff;\n\t\t}\n\t\tlatestOpIndex = operation.index;\n\t\tscopeOpsWithIgnore.push(mappedOp);\n\t}\n\treturn scopeOpsWithIgnore.reverse();\n}\n/**\n* V2 version of mapSkippedOperations for protocol version 2+.\n* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.\n* N consecutive NOOPs at any point skip N preceding content operations.\n*\n* Algorithm: Process from end to start\n* - When hitting a NOOP: increment chain length, mark as ignored\n* - When hitting a non-NOOP:\n* - If chain > 0: decrement chain, mark as ignored (this op was undone)\n* - If chain == 0: mark as not ignored (apply this op)\n*/\nfunction mapSkippedOperationsV2(operations) {\n\tconst ops = [...operations];\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = ops.length - 1; i >= 0; i--) {\n\t\tconst operation = ops[i];\n\t\tif (operation.action.type === \"NOOP\") {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else if (noopChainLength > 0) {\n\t\t\tnoopChainLength--;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else result.unshift({\n\t\t\tignore: false,\n\t\t\toperation\n\t\t});\n\t}\n\treturn result;\n}\n/**\n* V2 garbage collect that returns only operations that should be applied for state.\n* Uses the V2 model where consecutive NOOPs form chains.\n* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.\n*/\nfunction garbageCollectV2(sortedOperations) {\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = sortedOperations.length - 1; i >= 0; i--) {\n\t\tconst op = sortedOperations[i];\n\t\tif (\"action\" in op && op.action.type === \"NOOP\" && op.skip > 0) {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift(op);\n\t\t} else if (noopChainLength > 0) noopChainLength--;\n\t\telse result.unshift(op);\n\t}\n\treturn result;\n}\nfunction sortMappedOperations(operations) {\n\treturn Object.values(operations).flatMap((array) => array).sort((a, b) => new Date(a.operation.timestampUtcMs).getTime() - new Date(b.operation.timestampUtcMs).getTime());\n}\nconst defaultCreateState = (state) => {\n\treturn state;\n};\nfunction replayDocument(initialState, operations, reducer, header, dispatch, skipHeaderOperations = {}, options) {\n\tconst { checkHashes = true, reuseOperationResultingState, operationResultingStateParser = parseResultingState, skipIndexValidation } = options || {};\n\tlet documentState = initialState;\n\tconst operationsToReplay = [];\n\tconst allScopes = new Set([\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialOperations = {};\n\tfor (const scope of allScopes) initialOperations[scope] = [];\n\tif (reuseOperationResultingState) for (const [scope, scopeOperations] of Object.entries(operations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst index = scopeOperations.findLastIndex((s) => !!s.resultingState);\n\t\tif (index < 0) {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t\tcontinue;\n\t\t}\n\t\tconst opWithState = scopeOperations[index];\n\t\tif (!opWithState || !opWithState.resultingState) continue;\n\t\ttry {\n\t\t\tconst scopeState = operationResultingStateParser(opWithState.resultingState);\n\t\t\tdocumentState = {\n\t\t\t\t...documentState,\n\t\t\t\t[scope]: scopeState\n\t\t\t};\n\t\t\tconst scopeInitialOps = initialOperations[scope];\n\t\t\tif (scopeInitialOps) scopeInitialOps.push(...scopeOperations.slice(0, index + 1));\n\t\t\toperationsToReplay.push(...scopeOperations.slice(index + 1));\n\t\t} catch {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t}\n\t}\n\telse operationsToReplay.push(...Object.values(operations).flatMap((ops) => ops || []));\n\tconst document = {\n\t\theader,\n\t\tstate: defaultCreateState(documentState),\n\t\tinitialState,\n\t\toperations: initialOperations,\n\t\tclipboard: []\n\t};\n\tlet result = document;\n\tif (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {\n\t\treturn reducer(document, operation.action, dispatch, {\n\t\t\tignoreSkipOperations: true,\n\t\t\tcheckHashes,\n\t\t\tskipIndexValidation,\n\t\t\treplayOptions: { operation }\n\t\t});\n\t}, document);\n\telse for (const scopeOperations of Object.values(initialOperations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst lastOperation = scopeOperations.at(-1);\n\t\tif (lastOperation) result = updateHeaderRevision(result, lastOperation.action.scope, lastOperation.timestampUtcMs);\n\t}\n\tif (!checkHashes) for (const scope of Object.keys(result.state)) for (let i = operationsToReplay.length - 1; i >= 0; i--) {\n\t\tconst operation = operationsToReplay[i];\n\t\tif (operation.action.scope !== scope) continue;\n\t\tif (operation.hash !== hashDocumentStateForScope(result, scope)) throw new HashMismatchError(scope, result, operation);\n\t\telse break;\n\t}\n\tconst allResultScopes = new Set([\n\t\t...Object.keys(result.operations),\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialResultOperations = {};\n\tfor (const scope of allResultScopes) initialResultOperations[scope] = [];\n\tconst resultOperations = Array.from(allResultScopes).reduce((acc, scope) => {\n\t\tconst scopeOps = result.operations[scope] || [];\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: [...scopeOps.map((operation, index) => {\n\t\t\t\treturn {\n\t\t\t\t\t...operation,\n\t\t\t\t\ttimestamp: operations[scope]?.[index]?.timestampUtcMs ?? operation.timestampUtcMs\n\t\t\t\t};\n\t\t\t})]\n\t\t};\n\t}, initialResultOperations);\n\tconst lastModified = header ? header.lastModifiedAtUtcIso : Object.values(resultOperations).reduce((acc, curr) => {\n\t\tif (!curr) return acc;\n\t\tconst operation = curr.at(-1);\n\t\tif (operation) {\n\t\t\tif (operation.timestampUtcMs > acc) return operation.timestampUtcMs;\n\t\t}\n\t\treturn acc;\n\t}, document.header.lastModifiedAtUtcIso);\n\tif (header) result.header = {\n\t\t...header,\n\t\trevision: result.header.revision,\n\t\tlastModifiedAtUtcIso: lastModified\n\t};\n\treturn {\n\t\t...result,\n\t\toperations: resultOperations\n\t};\n}\nfunction parseResultingState(state) {\n\tconst stateType = typeof state;\n\tif (stateType === \"string\") return JSON.parse(state);\n\telse if (stateType === \"object\") return state;\n\telse throw new Error(`Providing resulting state is of type: ${stateType}`);\n}\nlet IntegrityIssueType = /* @__PURE__ */ function(IntegrityIssueType) {\n\tIntegrityIssueType[\"UNEXPECTED_INDEX\"] = \"UNEXPECTED_INDEX\";\n\treturn IntegrityIssueType;\n}({});\nlet IntegrityIssueSubType = /* @__PURE__ */ function(IntegrityIssueSubType) {\n\tIntegrityIssueSubType[\"DUPLICATED_INDEX\"] = \"DUPLICATED_INDEX\";\n\tIntegrityIssueSubType[\"MISSING_INDEX\"] = \"MISSING_INDEX\";\n\treturn IntegrityIssueSubType;\n}({});\nfunction checkCleanedOperationsIntegrity(sortedOperations) {\n\tconst result = [];\n\tlet currentIndex = -1;\n\tfor (const nextOperation of sortedOperations) {\n\t\tconst nextIndex = nextOperation.index - nextOperation.skip;\n\t\tif (nextIndex !== currentIndex + 1) result.push({\n\t\t\toperation: {\n\t\t\t\tindex: nextOperation.index,\n\t\t\t\tskip: nextOperation.skip\n\t\t\t},\n\t\t\tissue: IntegrityIssueType.UNEXPECTED_INDEX,\n\t\t\tcategory: nextIndex > currentIndex + 1 ? IntegrityIssueSubType.MISSING_INDEX : IntegrityIssueSubType.DUPLICATED_INDEX,\n\t\t\tmessage: `Expected index ${currentIndex + 1} with skip 0 or equivalent, got index ${nextOperation.index} with skip ${nextOperation.skip}`\n\t\t});\n\t\tcurrentIndex = nextOperation.index;\n\t}\n\treturn result;\n}\nfunction garbageCollect(sortedOperations) {\n\tconst result = [];\n\tlet i = sortedOperations.length - 1;\n\twhile (i > -1) {\n\t\tresult.unshift(sortedOperations[i]);\n\t\tconst skipUntil = (sortedOperations[i]?.index || 0) - (sortedOperations[i]?.skip || 0) - 1;\n\t\tlet j = i - 1;\n\t\twhile (j > -1 && (sortedOperations[j]?.index || 0) > skipUntil) j--;\n\t\ti = j;\n\t}\n\treturn result;\n}\nfunction addUndo(sortedOperations) {\n\tconst operationsCopy = [...sortedOperations];\n\tconst latestOperation = operationsCopy[operationsCopy.length - 1];\n\tif (!latestOperation) return operationsCopy;\n\tif (latestOperation.action.type === \"NOOP\") operationsCopy.push({\n\t\t...latestOperation,\n\t\tindex: latestOperation.index,\n\t\tskip: nextSkipNumber(sortedOperations),\n\t\taction: {\n\t\t\t...latestOperation.action,\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\"\n\t\t}\n\t});\n\telse operationsCopy.push({\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tindex: latestOperation.index + 1,\n\t\tskip: 1,\n\t\thash: latestOperation.hash,\n\t\taction: {\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\",\n\t\t\tinput: {},\n\t\t\tscope: latestOperation.action.scope\n\t\t}\n\t});\n\treturn operationsCopy;\n}\nfunction sortOperations(operations) {\n\treturn operations.slice().sort((a, b) => a.skip - b.skip).sort((a, b) => a.index - b.index);\n}\nfunction reshuffleByTimestamp(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction reshuffleByTimestampAndIndex(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst indexDiff = a.index - b.index;\n\t\tif (indexDiff !== 0) return indexDiff;\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction operationsAreEqual(op1, op2) {\n\tconst a = op1;\n\tconst b = op2;\n\tconst aComparable = {\n\t\tindex: a.index,\n\t\tskip: a.skip,\n\t\ttype: a.type ?? null,\n\t\tscope: a.scope ?? null,\n\t\tinput: a.input ?? null\n\t};\n\tconst bComparable = {\n\t\tindex: b.index,\n\t\tskip: b.skip,\n\t\ttype: b.type ?? null,\n\t\tscope: b.scope ?? null,\n\t\tinput: b.input ?? null\n\t};\n\treturn stringify(aComparable) === stringify(bComparable);\n}\nfunction attachBranch(trunk, newBranch) {\n\tconst trunkCopy = garbageCollect(sortOperations(trunk.slice()));\n\tconst newOperations = garbageCollect(sortOperations(newBranch.slice()));\n\tif (trunkCopy.length < 1) return [newOperations, []];\n\tconst result = [];\n\tlet enteredBranch = false;\n\twhile (newOperations.length > 0) {\n\t\tconst newOperationCandidate = newOperations[0];\n\t\tlet nextTrunkOperation = trunkCopy.shift();\n\t\twhile (nextTrunkOperation && precedes(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tresult.push(nextTrunkOperation);\n\t\t\tnextTrunkOperation = trunkCopy.shift();\n\t\t}\n\t\tif (!nextTrunkOperation) enteredBranch = true;\n\t\telse if (!enteredBranch) if (operationsAreEqual(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tnewOperations.shift();\n\t\t\tresult.push(nextTrunkOperation);\n\t\t} else {\n\t\t\ttrunkCopy.unshift(nextTrunkOperation);\n\t\t\tenteredBranch = true;\n\t\t}\n\t\tif (enteredBranch) {\n\t\t\tlet nextAppend = newOperations.shift();\n\t\t\twhile (nextAppend) {\n\t\t\t\tresult.push(nextAppend);\n\t\t\t\tnextAppend = newOperations.shift();\n\t\t\t}\n\t\t}\n\t}\n\tif (!enteredBranch) {\n\t\tlet nextAppend = trunkCopy.shift();\n\t\twhile (nextAppend) {\n\t\t\tresult.push(nextAppend);\n\t\t\tnextAppend = trunkCopy.shift();\n\t\t}\n\t}\n\treturn [garbageCollect(result), trunkCopy];\n}\nfunction precedes(op1, op2) {\n\treturn op1.index < op2.index || op1.index === op2.index && op1.id === op2.id && op1.skip < op2.skip;\n}\nfunction split(sortedTargetOperations, sortedMergeOperations) {\n\tconst commonOperations = [];\n\tconst targetDiffOperations = [];\n\tconst mergeDiffOperations = [];\n\tconst maxLength = Math.max(sortedTargetOperations.length, sortedMergeOperations.length);\n\tlet splitHappened = false;\n\tfor (let i = 0; i < maxLength; i++) {\n\t\tconst targetOperation = sortedTargetOperations[i];\n\t\tconst mergeOperation = sortedMergeOperations[i];\n\t\tif (targetOperation && mergeOperation) if (!splitHappened && operationsAreEqual(targetOperation, mergeOperation)) commonOperations.push(targetOperation);\n\t\telse {\n\t\t\tsplitHappened = true;\n\t\t\ttargetDiffOperations.push(targetOperation);\n\t\t\tmergeDiffOperations.push(mergeOperation);\n\t\t}\n\t\telse if (targetOperation) targetDiffOperations.push(targetOperation);\n\t\telse if (mergeOperation) mergeDiffOperations.push(mergeOperation);\n\t}\n\treturn [\n\t\tcommonOperations,\n\t\ttargetDiffOperations,\n\t\tmergeDiffOperations\n\t];\n}\nfunction merge(sortedTargetOperations, sortedMergeOperations, reshuffle) {\n\tconst [_commonOperations, _targetOperations, _mergeOperations] = split(garbageCollect(sortedTargetOperations), garbageCollect(sortedMergeOperations));\n\tconst maxCommonIndex = getMaxIndex(_commonOperations);\n\tconst nextIndex = 1 + Math.max(maxCommonIndex, getMaxIndex(_targetOperations), getMaxIndex(_mergeOperations));\n\tconst filteredMergeOperations = filterDuplicatedOperations(_mergeOperations, _targetOperations);\n\tconst newOperationHistory = reshuffle({\n\t\tindex: nextIndex,\n\t\tskip: nextIndex - (maxCommonIndex + 1)\n\t}, _targetOperations, filteredMergeOperations);\n\treturn _commonOperations.concat(newOperationHistory);\n}\nfunction getMaxIndex(sortedOperations) {\n\tconst lastElement = sortedOperations[sortedOperations.length - 1];\n\tif (!lastElement) return -1;\n\treturn lastElement.index;\n}\nfunction nextSkipNumber(sortedOperations) {\n\tif (sortedOperations.length < 1) return -1;\n\tconst cleanedOperations = garbageCollect(sortedOperations);\n\tlet nextSkip = (cleanedOperations[cleanedOperations.length - 1]?.skip || 0) + 1;\n\tif (cleanedOperations.length > 1) nextSkip += cleanedOperations[cleanedOperations.length - 2]?.skip || 0;\n\treturn (cleanedOperations[cleanedOperations.length - 1]?.index || -1) < nextSkip ? -1 : nextSkip;\n}\nfunction checkOperationsIntegrity(operations) {\n\treturn checkCleanedOperationsIntegrity(garbageCollect(sortOperations(operations)));\n}\nfunction groupOperationsByScope(operations) {\n\treturn operations.reduce((acc, operation) => {\n\t\tif (!acc[operation.action.scope]) acc[operation.action.scope] = [];\n\t\tacc[operation.action.scope]?.push(operation);\n\t\treturn acc;\n\t}, {});\n}\nfunction prepareOperations(operationsHistory, newOperations) {\n\tconst result = {\n\t\tintegrityIssues: [],\n\t\tvalidOperations: [],\n\t\tinvalidOperations: [],\n\t\tduplicatedOperations: []\n\t};\n\tconst sortedOperationsHistory = sortOperations(operationsHistory);\n\tconst sortedOperations = sortOperations(newOperations);\n\tconst integrityErrors = checkCleanedOperationsIntegrity([...sortedOperationsHistory, ...sortedOperations]);\n\tconst firstMissingIndexOperation = [...integrityErrors.filter((integrityIssue) => integrityIssue.category === IntegrityIssueSubType.MISSING_INDEX)].sort((a, b) => b.operation.index - a.operation.index).pop()?.operation;\n\tfor (const newOperation of sortedOperations) {\n\t\tif (firstMissingIndexOperation && newOperation.index >= firstMissingIndexOperation.index) {\n\t\t\tresult.invalidOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tif (integrityErrors.some((integrityError) => {\n\t\t\treturn integrityError.operation.index === newOperation.index && integrityError.operation.skip === newOperation.skip && integrityError.category === IntegrityIssueSubType.DUPLICATED_INDEX;\n\t\t})) {\n\t\t\tresult.duplicatedOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tresult.validOperations.push(newOperation);\n\t}\n\tresult.integrityIssues.push(...integrityErrors);\n\treturn result;\n}\nfunction removeExistingOperations(newOperations, operationsHistory) {\n\treturn newOperations.filter((newOperation) => {\n\t\treturn !operationsHistory.some((historyOperation) => {\n\t\t\treturn newOperation.action.type === \"NOOP\" && newOperation.skip === 0 && newOperation.index === historyOperation.index || newOperation.index === historyOperation.index && newOperation.skip === historyOperation.skip && newOperation.action.scope === historyOperation.action.scope && newOperation.hash === historyOperation.hash && newOperation.action.type === historyOperation.action.type;\n\t\t});\n\t});\n}\n/**\n* Skips header operations and returns the remaining operations.\n*\n* @param operations - The array of operations.\n* @param skipHeaderOperation - The skip header operation index.\n* @returns The remaining operations after skipping header operations.\n*/\nfunction skipHeaderOperations(operations, skipHeaderOperation) {\n\tconst lastIndex = sortOperations(operations).at(-1)?.index ?? -1;\n\tconst nextIndex = lastIndex + 1;\n\tconst skipOperationIndex = {\n\t\t...skipHeaderOperation,\n\t\tindex: skipHeaderOperation.index ?? nextIndex\n\t};\n\tif (skipOperationIndex.index < lastIndex) throw new Error(`The skip header operation index must be greater than or equal to ${lastIndex}`);\n\treturn garbageCollect(sortOperations([...operations, skipOperationIndex])).slice(0, -1);\n}\nfunction garbageCollectDocumentOperations(documentOperations) {\n\treturn Object.entries(documentOperations).reduce((acc, entry) => {\n\t\tconst [scope, ops] = entry;\n\t\tif (!ops) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: garbageCollect(sortOperations(ops))\n\t\t};\n\t}, {});\n}\n/**\n* Filters out duplicated operations from the target operations array based on their IDs.\n* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.\n* If an operation does not have an ID, it is considered unique and will not be filtered out.\n* @param targetOperations - The array of target operations to filter.\n* @param sourceOperations - The array of source operations to compare against.\n* @returns An array of operations with duplicates filtered out.\n*/\nfunction filterDuplicatedOperations(targetOperations, sourceOperations) {\n\treturn targetOperations.filter((op) => {\n\t\tif (op.id) return !sourceOperations.some((targetOp) => targetOp.id === op.id);\n\t\treturn true;\n\t});\n}\nfunction filterDocumentOperationsResultingState(documentOperations) {\n\tif (!documentOperations) return {};\n\treturn Object.entries(documentOperations).reduce((acc, [scope, operations]) => {\n\t\tif (!operations) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: operations.map((op) => {\n\t\t\t\tconst { resultingState, ...restProps } = op;\n\t\t\t\treturn restProps;\n\t\t\t})\n\t\t};\n\t}, {});\n}\n/**\n* Calculates the difference between two arrays of operations.\n* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.\n*\n* @template TOp - The type of the operations.\n* @param {TOp[]} clearedOperationsA - The first array of operations.\n* @param {TOp[]} clearedOperationsB - The second array of operations.\n* @returns {TOp[]} - The difference between the two arrays of operations.\n*/\nfunction diffOperations(clearedOperationsA, clearedOperationsB) {\n\treturn clearedOperationsA.filter((operationA) => !clearedOperationsB.some((operationB) => operationA.index === operationB.index));\n}\nfunction getDocumentLastModified(document) {\n\tlet latest;\n\tfor (const ops of Object.values(document.operations)) {\n\t\tif (!ops) continue;\n\t\tfor (const op of ops) if (!latest || op.index > latest.index || op.index === latest.index && op.skip > latest.skip) latest = op;\n\t}\n\treturn latest?.timestampUtcMs || document.header.lastModifiedAtUtcIso;\n}\n/**\n* Gets the next revision number based on the provided scope.\n*\n* @param state The current state of the document.\n* @param scope The scope of the operation.\n* @returns The next revision number.\n*/\nfunction getNextRevision(document, scope) {\n\treturn (document.operations[scope]?.at(-1)?.index ?? -1) + 1;\n}\n/**\n* Updates the document header with the latest revision number and\n* date of last modification.\n*\n* @param document The current state of the document.\n* @param scope The scope of the operation.\n* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.\n* @returns The updated document state.\n*/\nfunction updateHeaderRevision(document, scope, lastModifiedTimestamp) {\n\tconst newTimestamp = lastModifiedTimestamp ?? getDocumentLastModified(document);\n\tconst currentTimestamp = document.header.lastModifiedAtUtcIso;\n\tconst header = {\n\t\t...document.header,\n\t\trevision: {\n\t\t\t...document.header.revision,\n\t\t\t[scope]: getNextRevision(document, scope)\n\t\t},\n\t\tlastModifiedAtUtcIso: !currentTimestamp || newTimestamp > currentTimestamp ? newTimestamp : currentTimestamp\n\t};\n\treturn {\n\t\t...document,\n\t\theader\n\t};\n}\n//#endregion\n//#region document-model/operations.ts\nfunction setNameOperation(document, input) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: input.name\n\t\t}\n\t};\n}\nfunction setPreferredEditorOperation(document, input) {\n\tconst existingMeta = document.header.meta ?? {};\n\tif (input.preferredEditor) return {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tmeta: {\n\t\t\t\t...existingMeta,\n\t\t\t\tpreferredEditor: input.preferredEditor\n\t\t\t}\n\t\t}\n\t};\n\tconst { preferredEditor: _removed, ...rest } = existingMeta;\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tmeta: rest\n\t\t}\n\t};\n}\nfunction undoOperation(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope]]);\n\t\tdraft.action = noop(scope);\n\t\tconst lastOperation = sortedOperations.at(-1);\n\t\tlet nextIndex = lastOperation?.index ?? -1;\n\t\tconst isNewNoop = lastOperation?.action.type !== \"NOOP\";\n\t\tif (isNewNoop) nextIndex = nextIndex + 1;\n\t\telse draft.reuseLastOperationIndex = true;\n\t\tdraft.skip = nextSkipNumber(isNewNoop ? [...sortedOperations, {\n\t\t\tindex: nextIndex,\n\t\t\tskip: 0\n\t\t}] : sortedOperations);\n\t\tif (lastOperation && draft.skip > lastOperation.skip + 1) draft.skip = draft.skip + 1;\n\t\tif (draft.skip < 0) throw new Error(`Cannot undo: you can't undo more operations than the ones in the scope history`);\n\t});\n}\n/**\n* V2 of undoOperation for protocol version 2+.\n* Key differences from undoOperation:\n* - Never reuses operation index (always increments)\n* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)\n* - No complex skip calculation - simpler model where each UNDO is independent\n*/\nfunction undoOperationV2(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope] || []]);\n\t\tconst nonNoopOps = sortedOperations.filter((op) => op.action.type !== \"NOOP\");\n\t\tlet noopChainLength = 0;\n\t\tfor (let i = sortedOperations.length - 1; i >= 0; i--) if (sortedOperations[i].action.type === \"NOOP\") noopChainLength++;\n\t\telse break;\n\t\tif (nonNoopOps.length <= noopChainLength) throw new Error(`Cannot undo: no more operations to undo in scope history`);\n\t\tdraft.action = noop(scope);\n\t\tdraft.skip = 1;\n\t});\n}\nfunction redoOperation(document, action, skip) {\n\tconst { scope, input } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tif (draft.skip > 0) throw new Error(`Cannot redo: skip value from reducer cannot be used with REDO action`);\n\t\tconst count = typeof input === \"object\" && input !== null && \"count\" in input ? input.count : input;\n\t\tif (typeof count !== \"number\" || count > 1) throw new Error(`Cannot redo: you can only redo one operation at a time`);\n\t\tif (typeof count !== \"number\" || count < 1) throw new Error(`Invalid REDO action: invalid redo input value`);\n\t\tif (draft.document.clipboard.length < 1) throw new Error(`Cannot redo: no operations in the clipboard`);\n\t\tconst operationIndex = draft.document.clipboard.findLastIndex((op) => op.action.scope === scope);\n\t\tif (operationIndex < 0) throw new Error(`Cannot redo: no operations in clipboard for scope \"${scope}\"`);\n\t\tconst operation = draft.document.clipboard.splice(operationIndex, 1)[0];\n\t\tdraft.action = castDraft({\n\t\t\ttype: operation.action.type,\n\t\t\tscope: operation.action.scope,\n\t\t\tinput: operation.action.input\n\t\t});\n\t});\n}\nfunction loadStateOperation(document, action) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: action.state.name\n\t\t},\n\t\tstate: action.state.data\n\t};\n}\n//#endregion\n//#region document-model/reducer.ts\nfunction replayOperations(initialState, clearedOperations, stateReducer, header, dispatch, documentReducer = baseReducer, skipHeaderOperations = {}, options) {\n\treturn replayDocument(initialState, clearedOperations, createReducer(stateReducer, documentReducer), header, dispatch, skipHeaderOperations, options);\n}\n/**\n* Updates the operations history of the document based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param index The index of the operation to update.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context) {\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(action.type)) return document;\n\tconst scope = action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst newOperation = operationFromAction(action, reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\nfunction updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation) {\n\tconst scope = operation.action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst nextIndex = reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1;\n\tif (!skipIndexValidation && operation.index - skip > nextIndex) throw new Error(`Missing operations: expected ${nextIndex} with skip 0 or equivalent, got index ${operation.index} with skip ${skip}`);\n\tconst newOperation = operationFromOperation(operation, operation.index, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\n/**\n* Updates the document state based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateDocument(document, action, reuseLastOperationIndex, skip, context, operation, skipIndexValidation) {\n\tlet newDocument;\n\tif (operation) newDocument = updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation);\n\telse newDocument = updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context);\n\tnewDocument = updateHeaderRevision(newDocument, action.scope, action.timestampUtcMs);\n\treturn newDocument;\n}\n/**\n* The base document reducer function that wraps a custom reducer function.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param wrappedReducer The custom reducer function being wrapped by the base reducer.\n* @returns The updated document state.\n*/\nfunction _baseReducer(document, action, wrappedReducer) {\n\tconst parsedAction = DocumentActionSchema().parse(action);\n\tswitch (parsedAction.type) {\n\t\tcase \"SET_NAME\": return setNameOperation(document, parsedAction.input);\n\t\tcase \"SET_PREFERRED_EDITOR\": return setPreferredEditorOperation(document, parsedAction.input);\n\t\tcase \"PRUNE\": return pruneOperation(document, parsedAction.input, wrappedReducer);\n\t\tcase \"LOAD_STATE\": return loadStateOperation(document, parsedAction.input);\n\t\tdefault: return document;\n\t}\n}\n/**\n* Processes an UNDO or REDO action.\n*\n* @param document The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @returns The updated document, calculated skip value and transformed action (if applied).\n*/\nfunction processUndoRedo(document, action, skip, protocolVersion = 1) {\n\tswitch (action.type) {\n\t\tcase \"UNDO\":\n\t\t\tif (protocolVersion >= 2) return undoOperationV2(document, action, skip);\n\t\t\treturn undoOperation(document, action, skip);\n\t\tcase \"REDO\": return redoOperation(document, action, skip);\n\t\tdefault: return {\n\t\t\tdocument,\n\t\t\taction,\n\t\t\tskip,\n\t\t\treuseLastOperationIndex: false\n\t\t};\n\t}\n}\nfunction processSkipOperation(document, action, customReducer, skipValue, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scope = action.scope;\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst latestOperation = scopeOperations.at(-1);\n\tif (!latestOperation) return document;\n\tconst documentOperations = garbageCollectDocumentOperations({\n\t\t...document.operations,\n\t\t[scope]: skipHeaderOperations(scopeOperations, latestOperation)\n\t});\n\tlet scopeState = void 0;\n\tconst lastRemainingOperation = documentOperations[scope]?.at(-1);\n\tif (reuseOperationResultingState && lastRemainingOperation?.resultingState) scopeState = resultingStateParser(lastRemainingOperation.resultingState);\n\telse {\n\t\tconst { state } = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\t\treuseOperationResultingState,\n\t\t\toperationResultingStateParser: resultingStateParser,\n\t\t\tskipIndexValidation: true\n\t\t});\n\t\tscopeState = state[scope];\n\t}\n\treturn {\n\t\t...document,\n\t\tstate: {\n\t\t\t...document.state,\n\t\t\t[scope]: scopeState\n\t\t},\n\t\toperations: garbageCollectDocumentOperations({ ...document.operations })\n\t};\n}\nfunction processUndoOperation(document, scope, customReducer, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst sortedOperations = sortOperations([...scopeOperations]);\n\tsortedOperations.pop();\n\tconst documentOperations = garbageCollectDocumentOperations({ ...document.operations });\n\tconst documentScopeOps = documentOperations[scope];\n\tif (!documentScopeOps) return document;\n\tconst clearedOperations = [...documentScopeOps];\n\tconst diff = diffOperations(garbageCollect(sortedOperations), clearedOperations);\n\tconst doc = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\treuseOperationResultingState,\n\t\toperationResultingStateParser: resultingStateParser\n\t});\n\tconst clipboard = sortOperations([...document.clipboard, ...diff].filter((op) => op.action.type !== \"NOOP\")).reverse();\n\treturn {\n\t\t...doc,\n\t\tclipboard\n\t};\n}\n/**\n* Base document reducer that wraps a custom document reducer and handles\n* document-level actions such as undo, redo, prune, and set name.\n*\n* @template TGlobalState - The type of the state of the custom reducer.\n* @template TAction - The type of the actions of the custom reducer.\n* @param state - The current state of the document.\n* @param action - The action object to apply to the state.\n* @param customReducer - The custom reducer that implements the application logic\n* specific to the document's state.\n* @returns The new state of the document.\n*/\nfunction baseReducer(document, action, customReducer, dispatch, options = {}) {\n\tconst { skip, ignoreSkipOperations = false, reuseOperationResultingState = false, operationResultingStateParser, pruneOnSkip = true, branch = \"main\" } = options;\n\tlet _action = actionFromAction(action);\n\tlet skipValue = skip ?? options.replayOptions?.operation.skip ?? 0;\n\tlet newDocument = { ...document };\n\tlet reuseLastOperationIndex = false;\n\tconst shouldProcessSkipOperation = !ignoreSkipOperations && skipValue > 0;\n\tif (isUndoRedo(_action)) {\n\t\tconst { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ?? 1);\n\t\t_action = transformedAction;\n\t\tskipValue = calculatedSkip;\n\t\tnewDocument = processedDocument;\n\t\treuseLastOperationIndex = reuseIndex;\n\t} else newDocument = {\n\t\t...newDocument,\n\t\tclipboard: []\n\t};\n\tif (isDocumentAction(_action)) newDocument = _baseReducer(newDocument, _action, customReducer);\n\tconst operationContext = {\n\t\tdocumentId: document.header.id,\n\t\tscope: _action.scope,\n\t\tbranch\n\t};\n\tnewDocument = updateDocument(newDocument, _action, reuseLastOperationIndex, skipValue, operationContext, options.replayOptions?.operation, options.skipIndexValidation);\n\tconst protocolVersion = options.protocolVersion ?? 1;\n\tif (isUndo(action) && protocolVersion < 2) return processUndoOperation(newDocument, action.scope, customReducer);\n\tconst isNoopWithSkip = _action.type === \"NOOP\" && skipValue > 0;\n\tif ((isUndo(action) || isNoopWithSkip) && protocolVersion >= 2) {\n\t\tconst scope = _action.scope;\n\t\tconst opsToReplay = garbageCollectV2(sortOperations([...newDocument.operations[scope] || []])).filter((op) => op.action.type !== \"NOOP\");\n\t\tconst replayOps = {\n\t\t\t...newDocument.operations,\n\t\t\t[scope]: opsToReplay\n\t\t};\n\t\treturn {\n\t\t\t...replayOperations(newDocument.initialState, replayOps, customReducer, newDocument.header, dispatch, baseReducer, {}, { skipIndexValidation: true }),\n\t\t\toperations: newDocument.operations,\n\t\t\tclipboard: []\n\t\t};\n\t}\n\tif (shouldProcessSkipOperation) {\n\t\tconst processed = processSkipOperation(newDocument, _action, customReducer, skipValue, reuseOperationResultingState, operationResultingStateParser);\n\t\tif (!pruneOnSkip) newDocument = {\n\t\t\t...processed,\n\t\t\toperations: newDocument.operations\n\t\t};\n\t\telse newDocument = processed;\n\t}\n\tnewDocument = create(newDocument, (draft) => {\n\t\ttry {\n\t\t\tconst newState = customReducer(draft.state, _action, dispatch);\n\t\t\tif (newState) unsafe(() => {\n\t\t\t\tdraft.state = castDraft(newState);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst actionScopeOps = newDocument.operations[_action.scope];\n\t\t\tif (!actionScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`, { cause: error });\n\t\t\tconst lastOperationIndex = actionScopeOps.length - 1;\n\t\t\tconst draftScopeOps = draft.operations[_action.scope];\n\t\t\tif (!draftScopeOps) throw new Error(`No operations found in draft for scope: ${_action.scope}`, { cause: error });\n\t\t\tdraftScopeOps[lastOperationIndex].error = error.message;\n\t\t\tdraftScopeOps[lastOperationIndex].skip = 0;\n\t\t\tif (shouldProcessSkipOperation) {\n\t\t\t\tdraft.state = castDraft({ ...document.state });\n\t\t\t\tconst documentScopeOps = document.operations[_action.scope];\n\t\t\t\tif (!documentScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`, { cause: error });\n\t\t\t\tdraft.operations = castDraft({\n\t\t\t\t\t...document.operations,\n\t\t\t\t\t[_action.scope]: [...documentScopeOps, { ...draftScopeOps[lastOperationIndex] }]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(_action.type)) return newDocument;\n\tconst scope = _action.scope || \"global\";\n\tlet hash = hashDocumentStateForScope(newDocument, scope);\n\tif (options.replayOptions?.operation.hash && options.replayOptions.operation.hash !== \"\") hash = options.replayOptions.operation.hash;\n\tconst lastOperation = newDocument.operations[scope]?.at(-1);\n\tif (lastOperation) {\n\t\tlastOperation.hash = hash;\n\t\tif (reuseOperationResultingState) lastOperation.resultingState = JSON.stringify(newDocument.state[scope]);\n\t}\n\treturn newDocument;\n}\n/**\n* Helper function to create a document model reducer.\n*\n* @remarks\n* This function creates a new reducer that wraps the provided `reducer` with\n* `documentReducer`, adding support for document actions:\n* - `SET_NAME`\n* - `UNDO`\n* - `REDO`\n* - `PRUNE`\n*\n* It also updates the document-related attributes on every operation.\n*\n* @param reducer - The custom reducer to wrap.\n* @param documentReducer - The document reducer to use.\n*\n* @returns The new reducer.\n*/\nfunction createReducer(stateReducer, documentReducer = baseReducer) {\n\tconst reducer = (document, action, dispatch, options) => {\n\t\treturn documentReducer(document, action, stateReducer, dispatch, options);\n\t};\n\treturn reducer;\n}\nfunction pruneOperation(document, input, wrappedReducer) {\n\tconst operations = document.operations.global;\n\tif (!operations) throw new Error(\"No global operations found\");\n\tlet { start, end } = input;\n\tstart = start || 0;\n\tend = end || operations.length;\n\tconst actionsToPrune = operations.slice(start, end);\n\tconst actionsToKeepStart = operations.slice(0, start);\n\tconst actionsToKeepEnd = operations.slice(end);\n\tconst newDocument = replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: actionsToKeepStart.concat(actionsToPrune)\n\t}, wrappedReducer, document.header);\n\tconst newState = newDocument.state;\n\tconst name = newDocument.header.name;\n\tconst loadStateIndex = actionsToKeepStart.length;\n\tconst loadStateTimestamp = actionsToKeepStart.length ? actionsToKeepStart[actionsToKeepStart.length - 1].timestampUtcMs : actionsToKeepEnd.length ? actionsToKeepEnd[0].timestampUtcMs : (/* @__PURE__ */ new Date()).toISOString();\n\tconst action = loadState({\n\t\tname,\n\t\t...newState\n\t}, actionsToPrune.length);\n\treturn replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: [\n\t\t\t...actionsToKeepStart,\n\t\t\t{\n\t\t\t\tskip: 0,\n\t\t\t\t...action,\n\t\t\t\taction,\n\t\t\t\ttimestampUtcMs: loadStateTimestamp,\n\t\t\t\tindex: loadStateIndex,\n\t\t\t\thash: hashDocumentStateForScope({ state: newState }, \"global\")\n\t\t\t},\n\t\t\t...actionsToKeepEnd.map((action, index) => ({\n\t\t\t\t...action,\n\t\t\t\tindex: loadStateIndex + index + 1\n\t\t\t}))\n\t\t]\n\t}, wrappedReducer, document.header);\n}\n//#endregion\n//#region document-model/validation.ts\n/**\n* Reserved operation names from base reducer (core/actions.ts).\n* These names cannot be used for custom operations.\n*/\nconst RESERVED_OPERATION_NAMES = [\n\t\"UNDO\",\n\t\"REDO\",\n\t\"PRUNE\",\n\t\"LOAD_STATE\",\n\t\"SET_NAME\",\n\t\"SET_PREFERRED_EDITOR\",\n\t\"NOOP\"\n];\n/**\n* Operation names become the literal action `type` string at runtime and the\n* key for codegen's action union. They must be SCREAMING_SNAKE_CASE so the\n* generated TypeScript is valid.\n*/\nconst OPERATION_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;\nfunction isValidOperationNameFormat(name) {\n\treturn OPERATION_NAME_PATTERN.test(name);\n}\n/**\n* Check if name conflicts with base reducer actions (case-insensitive).\n*/\nfunction isReservedOperationName(name) {\n\treturn RESERVED_OPERATION_NAMES.includes(name.toUpperCase());\n}\n/**\n* Get all operation names from all modules in the latest specification.\n* Returns names in uppercase for case-insensitive comparison.\n*/\nfunction getAllOperationNames(state, excludeOperationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (!latestSpec) return [];\n\tconst names = [];\n\tfor (const module of latestSpec.modules) for (const operation of module.operations) {\n\t\tif (excludeOperationId && operation.id === excludeOperationId) continue;\n\t\tif (operation.name) names.push(operation.name.toUpperCase());\n\t}\n\treturn names;\n}\n/**\n* Validate operation name is not reserved or duplicate. Throws on failure.\n*\n* @param name - The operation name to validate\n* @param state - The document model global state\n* @param excludeOperationId - Optional operation ID to exclude (for rename validation)\n* @throws Error if the name is reserved or a duplicate\n*/\nfunction validateOperationName(name, state, excludeOperationId) {\n\tif (!name) return;\n\tif (!isValidOperationNameFormat(name)) {\n\t\tconst suggestion = constantCase(name);\n\t\tconst hint = suggestion && suggestion !== name && isValidOperationNameFormat(suggestion) ? ` Did you mean \"${suggestion}\"?` : \"\";\n\t\tthrow new Error(`Operation name \"${name}\" is invalid. Names must be SCREAMING_SNAKE_CASE (matching ${OPERATION_NAME_PATTERN.source}).${hint}`);\n\t}\n\tconst upperName = name.toUpperCase();\n\tif (isReservedOperationName(name)) throw new Error(`Operation name \"${name}\" is reserved. Please use a different name.`);\n\tif (getAllOperationNames(state, excludeOperationId).includes(upperName)) throw new Error(`Operation name \"${name}\" is already used by another operation. Operation names must be unique across all modules.`);\n}\nfunction validateInitialState(initialState, allowEmptyState = false) {\n\tconst errors = [];\n\tif (allowEmptyState && initialState === \"\") return errors;\n\ttry {\n\t\tconst state = JSON.parse(initialState);\n\t\tif (!allowEmptyState && !Object.keys(state).length) errors.push({\n\t\t\tmessage: \"Initial state cannot be empty\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t} catch {\n\t\terrors.push({\n\t\t\tmessage: \"Invalid initial state\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t}\n\treturn errors;\n}\nfunction validateStateSchemaName(schema, documentName, scope = \"\", allowEmptySchema = true) {\n\tconst errors = [];\n\tif (!allowEmptySchema && !schema) {\n\t\terrors.push({\n\t\t\tmessage: \"State schema is required\",\n\t\t\tdetails: { schema }\n\t\t});\n\t\treturn errors;\n\t}\n\tif (allowEmptySchema && !schema) return errors;\n\tconst expectedTypeName = `${pascalCase(documentName)}${pascalCase(scope)}State`;\n\tif (!new RegExp(`\\\\btype\\\\s+${expectedTypeName}(?:\\\\s|\\\\{|@|$)`).test(schema)) errors.push({\n\t\tmessage: `Invalid state schema name. Expected type ${expectedTypeName}`,\n\t\tdetails: { schema }\n\t});\n\treturn errors;\n}\nfunction validateModules(modules) {\n\tconst errors = [];\n\tif (!modules.length) errors.push({\n\t\tmessage: \"Modules are required\",\n\t\tdetails: { modules }\n\t});\n\tconst modulesError = modules.reduce((acc, mod) => [...acc, ...validateModule(mod)], []);\n\treturn [...errors, ...modulesError];\n}\nfunction validateModule(mod) {\n\tconst errors = [];\n\tif (!mod.name) errors.push({\n\t\tmessage: \"Module name is required\",\n\t\tdetails: { module: mod }\n\t});\n\tif (!mod.operations.length) errors.push({\n\t\tmessage: \"Module operations are required\",\n\t\tdetails: { module: mod }\n\t});\n\tconst operationErrors = mod.operations.reduce((acc, operation) => [...acc, ...validateModuleOperation(operation)], []);\n\treturn [...errors, ...operationErrors];\n}\nfunction validateModuleOperation(operation) {\n\tconst errors = [];\n\tif (!operation.name) errors.push({\n\t\tmessage: \"Operation name is required\",\n\t\tdetails: { operation }\n\t});\n\tif (!operation.schema) errors.push({\n\t\tmessage: \"Operation schema is required\",\n\t\tdetails: { operation }\n\t});\n\treturn errors;\n}\n/**\n* Find a module in the latest specification by id, or throw. Reducers that\n* mutate-by-id should call this up front so an unknown id fails loudly\n* instead of silently no-opping.\n*/\nfunction findModuleOrThrow(state, moduleId) {\n\tconst mod = state.specifications[state.specifications.length - 1]?.modules.find((m) => m.id === moduleId);\n\tif (!mod) throw new Error(`Module \"${moduleId}\" not found in the latest specification`);\n\treturn mod;\n}\n/**\n* Find an operation in the latest specification by id, or throw. Same\n* rationale as findModuleOrThrow — reducers that target an operation must\n* fail loudly when the operation doesn't exist.\n*/\nfunction findOperationOrThrow(state, operationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (latestSpec) for (const mod of latestSpec.modules) {\n\t\tconst op = mod.operations.find((o) => o.id === operationId);\n\t\tif (op) return op;\n\t}\n\tthrow new Error(`Operation \"${operationId}\" not found in the latest specification`);\n}\n/**\n* Find an operation error by id across all operations in the latest\n* specification, or throw. Throws on a duplicate id too: setters act on a\n* single error, so an ambiguous id must fail loudly rather than mutate an\n* arbitrary match.\n*/\nfunction findOperationErrorOrThrow(state, errorId) {\n\tconst matches = state.specifications[state.specifications.length - 1]?.modules.flatMap((mod) => mod.operations.flatMap((op) => op.errors.filter((e) => e.id === errorId))) ?? [];\n\tif (matches.length === 0) throw new Error(`Operation error \"${errorId}\" not found in the latest specification`);\n\tif (matches.length > 1) throw new Error(`Operation error \"${errorId}\" is duplicated in the latest specification`);\n\treturn matches[0];\n}\n/**\n* Find an operation example (code example) by id across all operations in the\n* latest specification, or throw. Throws on a duplicate id for the same reason\n* as findOperationErrorOrThrow.\n*/\nfunction findOperationExampleOrThrow(state, exampleId) {\n\tconst matches = state.specifications[state.specifications.length - 1]?.modules.flatMap((mod) => mod.operations.flatMap((op) => op.examples.filter((e) => e.id === exampleId))) ?? [];\n\tif (matches.length === 0) throw new Error(`Operation example \"${exampleId}\" not found in the latest specification`);\n\tif (matches.length > 1) throw new Error(`Operation example \"${exampleId}\" is duplicated in the latest specification`);\n\treturn matches[0];\n}\n/**\n* Assert no module in the latest specification already uses `id`. Modules are\n* targeted by id by the setter/delete/reorder reducers, so a duplicate id makes\n* those operations ambiguous.\n*/\nfunction assertModuleIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.id === id)) throw new Error(`Module \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation in the latest specification already uses `id`. Operations\n* are targeted by id across all modules, so the id must be unique document-wide.\n*/\nfunction assertOperationIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.id === id))) throw new Error(`Operation \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation error in the latest specification already uses `id`.\n* Error ids are targeted document-wide by the setter/delete reducers, so the id\n* must be unique to keep those operations unambiguous.\n*/\nfunction assertOperationErrorIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.errors.some((e) => e.id === id)))) throw new Error(`Operation error \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation example in the latest specification already uses `id`.\n* Example ids are targeted document-wide by the update/delete reducers, so the\n* id must be unique to keep those operations unambiguous.\n*/\nfunction assertOperationExampleIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.examples.some((e) => e.id === id)))) throw new Error(`Operation example \"${id}\" already exists in the latest specification`);\n}\nfunction validateOperations(operations) {\n\tconst errors = [];\n\tconst scopes = Object.keys(operations);\n\tfor (const scope of scopes) {\n\t\tconst scopeOperations = operations[scope];\n\t\tif (!scopeOperations) continue;\n\t\tconst ops = scopeOperations.sort((a, b) => a.index - b.index);\n\t\tlet opIndex = -1;\n\t\tfor (let i = 0; i < ops.length; i++) {\n\t\t\topIndex = opIndex + 1 + ops[i].skip;\n\t\t\tif (ops[i].index !== opIndex) errors.push({\n\t\t\t\tmessage: `Invalid operation index ${ops[i].index} at position ${i}`,\n\t\t\t\tdetails: {\n\t\t\t\t\tposition: i,\n\t\t\t\t\toperation: ops[i],\n\t\t\t\t\tscope: ops[i].action.scope\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn errors;\n}\n//#endregion\n//#region document-model/reducers.ts\n/**\n* Reorder `items` by the position of their id in `order`. Ids not listed in\n* `order` keep their relative position after the listed ones. Throws if `order`\n* references an id that isn't present, so a stale or mistyped id fails loudly\n* instead of silently producing an arbitrary order.\n*/\nfunction orderBy(items, order) {\n\tconst ids = new Set(items.map((item) => item.id));\n\tfor (const id of order) if (!ids.has(id)) throw new Error(`Cannot reorder: unknown id \"${id}\"`);\n\tconst rank = new Map(order.map((id, index) => [id, index]));\n\treturn items.map((item, index) => ({\n\t\titem,\n\t\tindex\n\t})).sort((a, b) => {\n\t\treturn (rank.get(a.item.id) ?? Number.MAX_SAFE_INTEGER) - (rank.get(b.item.id) ?? Number.MAX_SAFE_INTEGER) || a.index - b.index;\n\t}).map(({ item }) => item);\n}\nconst documentModelHeaderReducer = {\n\tsetModelNameOperation(state, action) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetModelIdOperation(state, action) {\n\t\tstate.id = action.input.id;\n\t},\n\tsetModelExtensionOperation(state, action) {\n\t\tstate.extension = action.input.extension;\n\t},\n\tsetModelDescriptionOperation(state, action) {\n\t\tstate.description = action.input.description;\n\t},\n\tsetAuthorNameOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.name = action.input.authorName;\n\t},\n\tsetAuthorWebsiteOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.website = action.input.authorWebsite;\n\t}\n};\nconst documentModelModuleReducer = {\n\taddModuleOperation(state, action) {\n\t\tassertModuleIdUnique(state, action.input.id);\n\t\tstate.specifications[state.specifications.length - 1].modules.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\toperations: []\n\t\t});\n\t},\n\tsetModuleNameOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.id);\n\t\ttargetModule.name = action.input.name || \"\";\n\t},\n\tsetModuleDescriptionOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.id);\n\t\ttargetModule.description = action.input.description || \"\";\n\t},\n\tdeleteModuleOperation(state, action) {\n\t\tfindModuleOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = latestSpec.modules.filter((m) => m.id != action.input.id);\n\t},\n\treorderModulesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = orderBy(latestSpec.modules, action.input.order);\n\t}\n};\nconst documentModelOperationErrorReducer = {\n\taddOperationErrorOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\tassertOperationErrorIdUnique(state, action.input.id);\n\t\ttargetOp.errors.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.errorName || \"\",\n\t\t\tcode: action.input.errorCode || \"\",\n\t\t\tdescription: action.input.errorDescription || \"\",\n\t\t\ttemplate: action.input.errorTemplate || \"\"\n\t\t});\n\t},\n\tsetOperationErrorCodeOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.code = action.input.errorCode || \"\";\n\t},\n\tsetOperationErrorNameOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.name = action.input.errorName || \"\";\n\t},\n\tsetOperationErrorDescriptionOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.description = action.input.errorDescription || \"\";\n\t},\n\tsetOperationErrorTemplateOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.template = action.input.errorTemplate || \"\";\n\t},\n\tdeleteOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!latestSpec.modules.some((mod) => mod.operations.some((op) => op.errors.some((e) => e.id === action.input.id)))) throw new Error(`Operation error \"${action.input.id}\" not found in the latest specification`);\n\t\tfor (const mod of latestSpec.modules) for (const op of mod.operations) op.errors = op.errors.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationErrorsOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\ttargetOp.errors = orderBy(targetOp.errors, action.input.order);\n\t}\n};\nconst documentModelOperationExampleReducer = {\n\taddOperationExampleOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\tassertOperationExampleIdUnique(state, action.input.id);\n\t\ttargetOp.examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t},\n\tupdateOperationExampleOperation(state, action) {\n\t\tconst example = findOperationExampleOrThrow(state, action.input.id);\n\t\texample.value = action.input.example;\n\t},\n\tdeleteOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!latestSpec.modules.some((mod) => mod.operations.some((op) => op.examples.some((e) => e.id === action.input.id)))) throw new Error(`Operation example \"${action.input.id}\" not found in the latest specification`);\n\t\tfor (const mod of latestSpec.modules) for (const op of mod.operations) op.examples = op.examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationExamplesOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\ttargetOp.examples = orderBy(targetOp.examples, action.input.order);\n\t}\n};\nconst documentModelOperationReducer = {\n\taddOperationOperation(state, action) {\n\t\tvalidateOperationName(action.input.name, state);\n\t\tassertOperationIdUnique(state, action.input.id);\n\t\tfindModuleOrThrow(state, action.input.moduleId).operations.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\tschema: action.input.schema || \"\",\n\t\t\ttemplate: action.input.template || action.input.description || \"\",\n\t\t\treducer: action.input.reducer || \"\",\n\t\t\terrors: [],\n\t\t\texamples: [],\n\t\t\tscope: action.input.scope || \"global\"\n\t\t});\n\t},\n\tsetOperationNameOperation(state, action) {\n\t\tif (action.input.name) validateOperationName(action.input.name, state, action.input.id);\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.name = action.input.name || \"\";\n\t},\n\tsetOperationScopeOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst allowedScopes = Object.keys(latestSpec.state);\n\t\tif (action.input.scope && !allowedScopes.includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\ttargetOp.scope = action.input.scope || \"global\";\n\t},\n\tsetOperationSchemaOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.schema = action.input.schema || \"\";\n\t},\n\tsetOperationDescriptionOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.description = action.input.description || \"\";\n\t},\n\tsetOperationTemplateOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.template = action.input.template || \"\";\n\t},\n\tsetOperationReducerOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.reducer = action.input.reducer || \"\";\n\t},\n\tmoveOperationOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.newModuleId);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst matches = latestSpec.modules.flatMap((mod) => mod.operations.filter((op) => op.id === action.input.operationId));\n\t\tif (matches.length === 0) throw new Error(`Operation \"${action.input.operationId}\" not found in the latest specification`);\n\t\tif (matches.length > 1) throw new Error(`Operation \"${action.input.operationId}\" is duplicated in the latest specification`);\n\t\tconst moved = matches[0];\n\t\tfor (const mod of latestSpec.modules) mod.operations = mod.operations.filter((op) => op.id !== action.input.operationId);\n\t\ttargetModule.operations.push(moved);\n\t},\n\tdeleteOperationOperation(state, action) {\n\t\tfindOperationOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (const mod of latestSpec.modules) mod.operations = mod.operations.filter((operation) => operation.id != action.input.id);\n\t},\n\treorderModuleOperationsOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.moduleId);\n\t\ttargetModule.operations = orderBy(targetModule.operations, action.input.order);\n\t}\n};\nconst documentModelStateSchemaReducer = {\n\tsetStateSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].schema = action.input.schema;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tsetInitialStateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].initialValue = action.input.initialValue;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\taddStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tupdateStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst example = latestSpec.state[action.input.scope].examples.find((e) => e.id == action.input.id);\n\t\tif (!example) throw new Error(`State example \"${action.input.id}\" not found in scope \"${action.input.scope}\"`);\n\t\texample.value = action.input.newExample;\n\t},\n\tdeleteStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst scopeState = latestSpec.state[action.input.scope];\n\t\tif (!scopeState.examples.some((e) => e.id == action.input.id)) throw new Error(`State example \"${action.input.id}\" not found in scope \"${action.input.scope}\"`);\n\t\tscopeState.examples = scopeState.examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderStateExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst scopeState = latestSpec.state[action.input.scope];\n\t\tscopeState.examples = orderBy(scopeState.examples, action.input.order);\n\t}\n};\nconst documentModelVersioningReducer = {\n\taddChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"addChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tupdateChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"updateChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tdeleteChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"deleteChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\treorderChangeLogItemsOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"reorderChangeLogItemsOperation\\\" not yet implemented\");\n\t},\n\treleaseNewVersionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst copiedModules = latestSpec.modules.map((module) => ({\n\t\t\t...module,\n\t\t\toperations: module.operations.map((op) => ({\n\t\t\t\t...op,\n\t\t\t\terrors: op.errors.map((err) => ({ ...err })),\n\t\t\t\texamples: op.examples.map((ex) => ({ ...ex }))\n\t\t\t}))\n\t\t}));\n\t\tconst copiedState = {\n\t\t\tglobal: {\n\t\t\t\t...latestSpec.state.global,\n\t\t\t\texamples: latestSpec.state.global.examples.map((ex) => ({ ...ex }))\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\t...latestSpec.state.local,\n\t\t\t\texamples: latestSpec.state.local.examples.map((ex) => ({ ...ex }))\n\t\t\t}\n\t\t};\n\t\tconst newSpec = {\n\t\t\tversion: latestSpec.version + 1,\n\t\t\tchangeLog: [],\n\t\t\tstate: copiedState,\n\t\t\tmodules: copiedModules\n\t\t};\n\t\tstate.specifications.push(newSpec);\n\t}\n};\nconst documentModelStateReducer = (state, action) => {\n\tif (isDocumentAction(action)) return state;\n\tswitch (action.type) {\n\t\tcase \"SET_MODEL_NAME\":\n\t\t\tSetModelNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_ID\":\n\t\t\tSetModelIdInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelIdOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_EXTENSION\":\n\t\t\tSetModelExtensionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelExtensionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_DESCRIPTION\":\n\t\t\tSetModelDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_NAME\":\n\t\t\tSetAuthorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_WEBSITE\":\n\t\t\tSetAuthorWebsiteInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorWebsiteOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_CHANGE_LOG_ITEM\":\n\t\t\tAddChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.addChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_CHANGE_LOG_ITEM\":\n\t\t\tUpdateChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.updateChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_CHANGE_LOG_ITEM\":\n\t\t\tDeleteChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.deleteChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_CHANGE_LOG_ITEMS\":\n\t\t\tReorderChangeLogItemsInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.reorderChangeLogItemsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"RELEASE_NEW_VERSION\":\n\t\t\tif (Object.keys(action.input).length > 0) throw new Error(\"Expected empty input for action RELEASE_NEW_VERSION\");\n\t\t\tdocumentModelVersioningReducer.releaseNewVersionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_MODULE\":\n\t\t\tAddModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.addModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_NAME\":\n\t\t\tSetModuleNameInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_DESCRIPTION\":\n\t\t\tSetModuleDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_MODULE\":\n\t\t\tDeleteModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.deleteModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULES\":\n\t\t\tReorderModulesInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.reorderModulesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_ERROR\":\n\t\t\tAddOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.addOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_CODE\":\n\t\t\tSetOperationErrorCodeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorCodeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_NAME\":\n\t\t\tSetOperationErrorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_DESCRIPTION\":\n\t\t\tSetOperationErrorDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_TEMPLATE\":\n\t\t\tSetOperationErrorTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_ERROR\":\n\t\t\tDeleteOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.deleteOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_ERRORS\":\n\t\t\tReorderOperationErrorsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.reorderOperationErrorsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_EXAMPLE\":\n\t\t\tAddOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.addOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_OPERATION_EXAMPLE\":\n\t\t\tUpdateOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.updateOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_EXAMPLE\":\n\t\t\tDeleteOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.deleteOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_EXAMPLES\":\n\t\t\tReorderOperationExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.reorderOperationExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION\":\n\t\t\tAddOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.addOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_NAME\":\n\t\t\tSetOperationNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCOPE\":\n\t\t\tSetOperationScopeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationScopeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCHEMA\":\n\t\t\tSetOperationSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_DESCRIPTION\":\n\t\t\tSetOperationDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_TEMPLATE\":\n\t\t\tSetOperationTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_REDUCER\":\n\t\t\tSetOperationReducerInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationReducerOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"MOVE_OPERATION\":\n\t\t\tMoveOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.moveOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION\":\n\t\t\tDeleteOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.deleteOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULE_OPERATIONS\":\n\t\t\tReorderModuleOperationsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.reorderModuleOperationsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_STATE_SCHEMA\":\n\t\t\tSetStateSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setStateSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_INITIAL_STATE\":\n\t\t\tSetInitialStateInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setInitialStateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_STATE_EXAMPLE\":\n\t\t\tAddStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.addStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_STATE_EXAMPLE\":\n\t\t\tUpdateStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.updateStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_STATE_EXAMPLE\":\n\t\t\tDeleteStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.deleteStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_STATE_EXAMPLES\":\n\t\t\tReorderStateExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.reorderStateExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst documentModelReducer = createReducer(documentModelStateReducer);\n//#endregion\n//#region document-model/files.ts\nconst NON_DOMAIN_SCOPES = new Set([\"auth\", \"document\"]);\nfunction zipAsync(data) {\n\treturn new Promise((resolve, reject) => {\n\t\tzip(data, (err, out) => err ? reject(err) : resolve(out));\n\t});\n}\nfunction unzipAsync(data) {\n\treturn new Promise((resolve, reject) => {\n\t\tunzip(data, (err, out) => err ? reject(err) : resolve(out));\n\t});\n}\nconst BASE64_RE = /^[A-Za-z0-9+/]+={0,2}$/;\nfunction isLikelyBase64(s) {\n\tif (s.length === 0 || s.length % 4 !== 0) return false;\n\treturn BASE64_RE.test(s);\n}\nfunction binaryStringToUint8Array(s) {\n\tconst arr = new Uint8Array(s.length);\n\tfor (let i = 0; i < s.length; i++) arr[i] = s.charCodeAt(i) & 255;\n\treturn arr;\n}\nfunction base64ToUint8Array(s) {\n\tif (typeof atob === \"function\") return binaryStringToUint8Array(atob(s));\n\tconst BufferCtor = globalThis.Buffer;\n\tif (!BufferCtor) throw new Error(\"Cannot decode base64 string: neither `atob` nor `Buffer` is available in this environment\");\n\treturn BufferCtor.from(s, \"base64\");\n}\nasync function toUint8Array(input) {\n\tif (input instanceof Uint8Array) return input;\n\tif (input instanceof ArrayBuffer) return new Uint8Array(input);\n\tif (typeof Blob !== \"undefined\" && input instanceof Blob) return new Uint8Array(await input.arrayBuffer());\n\tif (Array.isArray(input)) return new Uint8Array(input);\n\tif (typeof input === \"string\") return isLikelyBase64(input) ? base64ToUint8Array(input) : binaryStringToUint8Array(input);\n\tthrow new Error(\"Unsupported FileInput type\");\n}\nfunction jsonEntry(value) {\n\treturn strToU8(JSON.stringify(value, null, 2));\n}\nasync function createZip(document) {\n\treturn zipAsync({\n\t\t\"header.json\": jsonEntry(document.header),\n\t\t\"state.json\": jsonEntry(document.initialState || {}),\n\t\t\"current-state.json\": jsonEntry(document.state || {}),\n\t\t\"operations.json\": jsonEntry(filterDocumentOperationsResultingState(document.operations))\n\t});\n}\n/**\n* Creates a minimal ZIP backup from strand data.\n* Used when the full document is not available (e.g., in onOperations handler).\n* Creates a ZIP with minimal header and empty operations.\n*/\nasync function createMinimalZip(data) {\n\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\tconst header = {\n\t\tid: data.documentId,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType: data.documentType,\n\t\tcreatedAtUtcIso: now,\n\t\tslug: data.name,\n\t\tname: data.name,\n\t\tbranch: data.branch,\n\t\trevision: {},\n\t\tlastModifiedAtUtcIso: now\n\t};\n\treturn zipAsync({\n\t\t\"header.json\": jsonEntry(header),\n\t\t\"state.json\": jsonEntry(data.state),\n\t\t\"current-state.json\": jsonEntry(data.state),\n\t\t\"operations.json\": jsonEntry({})\n\t});\n}\nasync function baseSaveToFileHandle(document, input) {\n\tconst data = await createZip(document);\n\tconst writable = await input.createWritable();\n\tawait writable.write(new Uint8Array(data));\n\tawait writable.close();\n}\nfunction readEntry(files, name) {\n\tconst entry = files[name];\n\tif (!entry) throw new Error(`${name} not found in document zip`);\n\treturn strFromU8(entry);\n}\nasync function loadFromZipData(data, reducer, options) {\n\tconst files = await unzipAsync(data);\n\tif (!files[\"state.json\"]) throw new Error(\"Initial state not found\");\n\tconst initialState = JSON.parse(readEntry(files, \"state.json\"));\n\tif (!files[\"header.json\"]) throw new Error(\"Document header not found - file format may be outdated\");\n\tconst header = JSON.parse(readEntry(files, \"header.json\"));\n\tif (!files[\"operations.json\"]) throw new Error(\"Operations history not found\");\n\tconst clearedOperations = garbageCollectDocumentOperations(JSON.parse(readEntry(files, \"operations.json\")));\n\tconst operationsError = validateOperations(clearedOperations);\n\tif (operationsError.length) {\n\t\tconst errorMessages = operationsError.map((err) => err.message);\n\t\tthrow new Error(errorMessages.join(\"\\n\"));\n\t}\n\treturn {\n\t\t...replayDocument(initialState, Object.fromEntries(Object.entries(clearedOperations).filter(([scope]) => !NON_DOMAIN_SCOPES.has(scope))), reducer, header, void 0, {}, options),\n\t\toperations: clearedOperations\n\t};\n}\nasync function baseLoadFromInput(input, reducer, options) {\n\treturn loadFromZipData(await toUint8Array(input), reducer, options);\n}\nconst documentModelLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, documentModelReducer);\n};\nconst documentModelSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nfunction writeFileBrowser(path, name, stream) {\n\tthrow FileSystemError;\n}\nfunction readFileBrowser(path) {\n\tthrow FileSystemError;\n}\nfunction fetchFileBrowser(url) {\n\tthrow FileSystemError;\n}\nconst getFileBrowser = async (file) => {\n\treturn readFileBrowser(file);\n};\n//#endregion\n//#region document-model/state.ts\n/**\n* Creates a default PHAuthState\n*/\nfunction defaultAuthState() {\n\treturn {};\n}\n/**\n* Creates a default PHDocumentState\n*/\nfunction defaultDocumentState() {\n\treturn {\n\t\tversion: 0,\n\t\thash: {\n\t\t\talgorithm: HASH_ALGORITHM_SHA1,\n\t\t\tencoding: HASH_ENCODING_BASE64\n\t\t}\n\t};\n}\n/**\n* Creates a default PHBaseState with auth and document properties\n*/\nfunction defaultBaseState() {\n\treturn {\n\t\tauth: defaultAuthState(),\n\t\tdocument: defaultDocumentState()\n\t};\n}\n/**\n* Creates a PHAuthState with the given properties\n*/\nfunction createAuthState(auth) {\n\treturn {\n\t\t...defaultAuthState(),\n\t\t...auth\n\t};\n}\n/**\n* Creates a PHDocumentState with the given properties\n*/\nfunction createDocumentState(document) {\n\treturn {\n\t\t...defaultDocumentState(),\n\t\t...document\n\t};\n}\n/**\n* Creates a PHBaseState with the given auth and document properties\n*/\nfunction createBaseState(auth, document) {\n\treturn {\n\t\tauth: createAuthState(auth),\n\t\tdocument: createDocumentState(document)\n\t};\n}\nfunction defaultGlobalState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tauthor: {\n\t\t\tname: \"\",\n\t\t\twebsite: \"\"\n\t\t},\n\t\tdescription: \"\",\n\t\textension: \"\",\n\t\tid: \"\",\n\t\tname: \"\",\n\t\tspecifications: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\nexport { AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, FileSystemError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, ManifestSchema, ModuleSchema, MoveOperationInputSchema, OPERATION_NAME_PATTERN, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetPreferredEditorActionInputSchema, SetPreferredEditorActionSchema, SetStateSchemaInputSchema, Set_NameSchema, Set_PreferredEditorSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, assertIsDocumentModelDocument, assertIsDocumentModelState, assertModuleIdUnique, assertOperationErrorIdUnique, assertOperationExampleIdUnique, assertOperationIdUnique, attachBranch, baseActions, baseCreateDocument, baseLoadFromInput, baseReducer, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, findModuleOrThrow, findOperationErrorOrThrow, findOperationExampleOrThrow, findOperationOrThrow, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, isDefinedNonNullAny, isDocumentAction, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isReservedOperationName, isUndo, isUndoRedo, isValidOperationNameFormat, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, merge, moveOperation, nextSkipNumber, noop, operationExampleCreators, operationFromAction, operationFromOperation, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, releaseNewVersion, removeExistingOperations, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, setAuthorName, setAuthorWebsite, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setPreferredEditor, setPreferredEditorOperation, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };\n\n//# sourceMappingURL=index.js.map","import { actions, assertIsDocumentModelDocument, assertIsDocumentModelState, baseCreateDocument, createState, defaultBaseState, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelReducer, documentModelSaveToFileHandle, isDocumentModelDocument, isDocumentModelState } from \"@powerhousedao/shared/document-model\";\nexport * from \"@powerhousedao/shared/document-model\";\n//#region src/state.ts\nconst isStateOfType = (state) => {\n\treturn isDocumentModelState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDocumentModelState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDocumentModelDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDocumentModelDocument(document);\n};\nconst documentModelCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...documentModelInitialGlobalState,\n\t\t\t...state?.global ?? {}\n\t\t},\n\t\tlocal: {\n\t\t\t...documentModelInitialLocalState,\n\t\t\t...state?.local ?? {}\n\t\t}\n\t};\n};\nfunction documentModelCreateDocument(state) {\n\treturn baseCreateDocument(documentModelCreateState, state, documentModelDocumentType);\n}\n//#endregion\n//#region src/module.ts\nconst utils = {\n\tfileExtension: documentModelFileExtension,\n\tcreateState: documentModelCreateState,\n\tcreateDocument: documentModelCreateDocument,\n\tloadFromInput: documentModelLoadFromInput,\n\tsaveToFileHandle: documentModelSaveToFileHandle,\n\tisStateOfType,\n\tassertIsStateOfType,\n\tisDocumentOfType,\n\tassertIsDocumentOfType\n};\nconst documentModelDocumentModelModule = {\n\treducer: documentModelReducer,\n\tdocumentModel: createState(defaultBaseState(), documentModelGlobalState),\n\tactions,\n\tutils\n};\n//#endregion\n//#region src/controller.ts\nvar PHDocumentController = class PHDocumentController {\n\tmodule;\n\t_document;\n\tlisteners = [];\n\tconstructor(module, initialDocument) {\n\t\tthis.module = module;\n\t\tthis._document = initialDocument ?? module.utils.createDocument();\n\t\tfor (const actionType in this.module.actions) Object.defineProperty(this, actionType, { value: (input) => {\n\t\t\tconst action = this.module.actions[actionType](input);\n\t\t\tthis._document = this.module.reducer(this._document, action);\n\t\t\tthis.notifyListeners();\n\t\t\treturn this;\n\t\t} });\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget header() {\n\t\treturn this.document.header;\n\t}\n\tget state() {\n\t\treturn this.document.state;\n\t}\n\tget initialState() {\n\t\treturn this.document.initialState;\n\t}\n\tget operations() {\n\t\treturn this.document.operations;\n\t}\n\tget clipboard() {\n\t\treturn this.document.clipboard;\n\t}\n\tonChange(listener) {\n\t\tthis.listeners.push(listener);\n\t\treturn () => {\n\t\t\tthis.listeners = this.listeners.filter((l) => l !== listener);\n\t\t};\n\t}\n\tnotifyListeners() {\n\t\tif (this.listeners.length === 0) return;\n\t\tconst event = { document: this._document };\n\t\tfor (const listener of this.listeners) listener(event);\n\t}\n\tstatic forDocumentModel(module) {\n\t\treturn class extends PHDocumentController {\n\t\t\tconstructor(initialDocument) {\n\t\t\t\tsuper(module, initialDocument);\n\t\t\t}\n\t\t};\n\t}\n};\nconst DocumentModelController = PHDocumentController.forDocumentModel(documentModelDocumentModelModule);\n//#endregion\n//#region src/logger.ts\nconst tokenSub = /@([a-zA-Z0-9_]+)/g;\nconst dtf = new Intl.DateTimeFormat(void 0, {\n\thour12: false,\n\thour: \"2-digit\",\n\tminute: \"2-digit\",\n\tsecond: \"2-digit\",\n\tfractionalSecondDigits: 2\n});\nconst stringify = (value, includeStack) => {\n\tif (value === null || value === void 0) return \"null\";\n\tif (typeof value === \"string\") return value;\n\tif (value instanceof Error) {\n\t\tconst base = `${value.name}: ${value.message}`;\n\t\treturn includeStack && value.stack ? `${base}\\n${value.stack}` : base;\n\t}\n\tif (typeof value === \"object\") try {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn Object.prototype.toString.call(value);\n\t}\n\tif (typeof value === \"function\") {\n\t\tconst name = value.name;\n\t\treturn name ? `${name}()` : \"anonymous()\";\n\t}\n\treturn String(value);\n};\nconst formatMessage = (tagString, message, replacements, includeStack) => {\n\tconst meta = {};\n\tconst uniqueTokens = [];\n\tlet results;\n\twhile ((results = tokenSub.exec(message)) !== null) {\n\t\tconst tokenName = results[1];\n\t\tif (uniqueTokens.indexOf(tokenName) === -1) {\n\t\t\tuniqueTokens.push(tokenName);\n\t\t\tmeta[tokenName] = replacements[uniqueTokens.length - 1];\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(meta)) message = message.replaceAll(`@${key}`, stringify(value, includeStack));\n\tconst extras = replacements.slice(uniqueTokens.length);\n\tif (extras.length > 0) message = `${message} ${extras.map((v) => stringify(v, includeStack)).join(\" \")}`;\n\tif (tagString.length > 0) message = `${tagString} ${message}`;\n\tconst now = /* @__PURE__ */ new Date();\n\tmeta[\"timestamp\"] = dtf.format(now);\n\treturn [message, meta];\n};\nconst LOG_LEVELS = {\n\tverbose: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4\n};\nvar ConsoleLogger = class ConsoleLogger {\n\t#tags;\n\t#tagString;\n\t#level = LOG_LEVELS.info;\n\terrorHandler;\n\tconstructor(tags, handler) {\n\t\tthis.#tags = tags || [];\n\t\tthis.#tagString = this.#tags.map((tag) => `[${tag}]`).join(\"\");\n\t\tthis.errorHandler = handler ?? (() => {});\n\t}\n\tget level() {\n\t\treturn Object.keys(LOG_LEVELS).find((key) => LOG_LEVELS[key] === this.#level);\n\t}\n\tset level(value) {\n\t\tthis.#level = LOG_LEVELS[value];\n\t}\n\tchild(tags) {\n\t\tconst logger = new ConsoleLogger([...this.#tags, ...tags], this.errorHandler);\n\t\tlogger.level = this.level;\n\t\treturn logger;\n\t}\n\tget #includeStack() {\n\t\treturn this.#level <= LOG_LEVELS.debug;\n\t}\n\tverbose(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.verbose) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tdebug(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.debug) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tinfo(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.info) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.info(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\twarn(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.warn) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.warn(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\terror(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.error) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.error(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n};\nconst logger = new ConsoleLogger();\nconst setLogLevel = (level) => {\n\tlogger.level = level;\n};\nconst setErrorHandler = (handler) => {\n\tlogger.errorHandler = handler;\n};\nconst childLogger = (tags) => {\n\treturn logger.child(tags);\n};\n//#endregion\nexport { ConsoleLogger, DocumentModelController, PHDocumentController, assertIsDocumentOfType, assertIsStateOfType, childLogger, documentModelCreateDocument, documentModelCreateState, documentModelDocumentModelModule, isDocumentOfType, isStateOfType, logger, setErrorHandler, setLogLevel };\n\n//# sourceMappingURL=index.js.map","import { BaseDocumentHeaderSchema, BaseDocumentStateSchema, baseCreateDocument, baseLoadFromInput, baseSaveToFileHandle, createAction, createBaseState, createReducer, createState as createState$1, defaultBaseState, isDocumentAction } from \"../document-model/index.js\";\nimport { z } from \"zod\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region document-drive/constants.ts\nconst driveDocumentFileExtension = \"phdd\";\n//#endregion\n//#region document-drive/gen/schema/zod.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst TransmitterTypeSchema = z.enum([\n\t\"Internal\",\n\t\"MatrixConnect\",\n\t\"PullResponder\",\n\t\"RESTWebhook\",\n\t\"SecureConnect\",\n\t\"SwitchboardPush\"\n]);\nconst TriggerTypeSchema = z.enum([\"PullResponder\"]);\nfunction AddFileInputSchema() {\n\treturn z.object({\n\t\tdocumentType: z.string(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction AddFolderInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction AddListenerInputSchema() {\n\treturn z.object({ listener: ListenerInputSchema() });\n}\nfunction AddTriggerInputSchema() {\n\treturn z.object({ trigger: TriggerInputSchema() });\n}\nfunction CopyNodeInputSchema() {\n\treturn z.object({\n\t\tsrcId: z.string(),\n\t\ttargetId: z.string(),\n\t\ttargetName: z.string().nullish(),\n\t\ttargetParentFolder: z.string().nullish()\n\t});\n}\nfunction DeleteNodeInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DocumentDriveLocalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentDriveLocalState\").optional(),\n\t\tavailableOffline: z.boolean(),\n\t\tlisteners: z.array(ListenerSchema()),\n\t\tsharingType: z.string().nullable(),\n\t\ttriggers: z.array(TriggerSchema())\n\t});\n}\nfunction DocumentDriveStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentDriveState\").optional(),\n\t\ticon: z.string().nullable(),\n\t\tname: z.string(),\n\t\tnodes: z.array(NodeSchema())\n\t});\n}\nfunction FileNodeSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"FileNode\").optional(),\n\t\tdocumentType: z.string(),\n\t\tid: z.string(),\n\t\tkind: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullable()\n\t});\n}\nfunction FolderNodeSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"FolderNode\").optional(),\n\t\tid: z.string(),\n\t\tkind: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullable()\n\t});\n}\nfunction ListenerSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Listener\").optional(),\n\t\tblock: z.boolean(),\n\t\tcallInfo: ListenerCallInfoSchema().nullable(),\n\t\tfilter: ListenerFilterSchema(),\n\t\tlabel: z.string().nullable(),\n\t\tlistenerId: z.string(),\n\t\tsystem: z.boolean()\n\t});\n}\nfunction ListenerInputSchema() {\n\treturn z.object({\n\t\tblock: z.boolean(),\n\t\tcallInfo: ListenerCallInfoInputSchema().nullish(),\n\t\tfilter: ListenerFilterInputSchema(),\n\t\tlabel: z.string().nullish(),\n\t\tlistenerId: z.string(),\n\t\tsystem: z.boolean()\n\t});\n}\nfunction ListenerCallInfoSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ListenerCallInfo\").optional(),\n\t\tdata: z.string().nullable(),\n\t\tname: z.string().nullable(),\n\t\ttransmitterType: TransmitterTypeSchema.nullable()\n\t});\n}\nfunction ListenerCallInfoInputSchema() {\n\treturn z.object({\n\t\tdata: z.string().nullish(),\n\t\tname: z.string().nullish(),\n\t\ttransmitterType: TransmitterTypeSchema.nullish()\n\t});\n}\nfunction ListenerFilterSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ListenerFilter\").optional(),\n\t\tbranch: z.array(z.string()).nullable(),\n\t\tdocumentId: z.array(z.string()).nullable(),\n\t\tdocumentType: z.array(z.string()),\n\t\tscope: z.array(z.string()).nullable()\n\t});\n}\nfunction ListenerFilterInputSchema() {\n\treturn z.object({\n\t\tbranch: z.array(z.string()).nullish(),\n\t\tdocumentId: z.array(z.string()).nullish(),\n\t\tdocumentType: z.array(z.string()).nullish(),\n\t\tscope: z.array(z.string()).nullish()\n\t});\n}\nfunction MoveNodeInputSchema() {\n\treturn z.object({\n\t\tsrcFolder: z.string(),\n\t\ttargetParentFolder: z.string().nullish()\n\t});\n}\nfunction NodeSchema() {\n\treturn z.union([FileNodeSchema(), FolderNodeSchema()]);\n}\nfunction PullResponderTriggerDataSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"PullResponderTriggerData\").optional(),\n\t\tinterval: z.string(),\n\t\tlistenerId: z.string(),\n\t\turl: z.string()\n\t});\n}\nfunction PullResponderTriggerDataInputSchema() {\n\treturn z.object({\n\t\tinterval: z.string(),\n\t\tlistenerId: z.string(),\n\t\turl: z.string()\n\t});\n}\nfunction RemoveListenerInputSchema() {\n\treturn z.object({ listenerId: z.string() });\n}\nfunction RemoveTriggerInputSchema() {\n\treturn z.object({ triggerId: z.string() });\n}\nfunction SetAvailableOfflineInputSchema() {\n\treturn z.object({ availableOffline: z.boolean() });\n}\nfunction SetDriveIconInputSchema() {\n\treturn z.object({ icon: z.string() });\n}\nfunction SetDriveNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetSharingTypeInputSchema() {\n\treturn z.object({ type: z.string() });\n}\nfunction TriggerSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Trigger\").optional(),\n\t\tdata: TriggerDataSchema().nullable(),\n\t\tid: z.string(),\n\t\ttype: TriggerTypeSchema\n\t});\n}\nfunction TriggerInputSchema() {\n\treturn z.object({\n\t\tdata: PullResponderTriggerDataInputSchema().nullish(),\n\t\tid: z.string(),\n\t\ttype: TriggerTypeSchema\n\t});\n}\nfunction TriggerDataSchema() {\n\treturn PullResponderTriggerDataSchema();\n}\nfunction UpdateFileInputSchema() {\n\treturn z.object({\n\t\tdocumentType: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string().nullish(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction UpdateNodeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\n//#endregion\n//#region document-drive/gen/node/creators.ts\nfunction addFile(input) {\n\tif (input && typeof input === \"object\" && \"synchronizationUnits\" in input) return createAction(\"ADD_FILE\", { ...input }, void 0, void 0, \"global\");\n\treturn createAction(\"ADD_FILE\", { ...input }, void 0, AddFileInputSchema, \"global\");\n}\nconst addFolder = (input) => createAction(\"ADD_FOLDER\", { ...input }, void 0, AddFolderInputSchema, \"global\");\nconst deleteNode = (input) => createAction(\"DELETE_NODE\", { ...input }, void 0, DeleteNodeInputSchema, \"global\");\nconst updateFile = (input) => createAction(\"UPDATE_FILE\", { ...input }, void 0, UpdateFileInputSchema, \"global\");\nconst updateNode = (input) => createAction(\"UPDATE_NODE\", { ...input }, void 0, UpdateNodeInputSchema, \"global\");\nconst copyNode = (input) => createAction(\"COPY_NODE\", { ...input }, void 0, CopyNodeInputSchema, \"global\");\nconst moveNode = (input) => createAction(\"MOVE_NODE\", { ...input }, void 0, MoveNodeInputSchema, \"global\");\n//#endregion\n//#region document-drive/gen/drive/creators.ts\nconst setDriveName = (input) => createAction(\"SET_DRIVE_NAME\", { ...input }, void 0, SetDriveNameInputSchema, \"global\");\nconst setDriveIcon = (input) => createAction(\"SET_DRIVE_ICON\", { ...input }, void 0, SetDriveIconInputSchema, \"global\");\nconst setSharingType = (input) => createAction(\"SET_SHARING_TYPE\", { ...input }, void 0, SetSharingTypeInputSchema, \"local\");\nconst setAvailableOffline = (input) => createAction(\"SET_AVAILABLE_OFFLINE\", { ...input }, void 0, SetAvailableOfflineInputSchema, \"local\");\nconst addListener = (input) => createAction(\"ADD_LISTENER\", { ...input }, void 0, AddListenerInputSchema, \"local\");\nconst removeListener = (input) => createAction(\"REMOVE_LISTENER\", { ...input }, void 0, RemoveListenerInputSchema, \"local\");\nconst addTrigger = (input) => createAction(\"ADD_TRIGGER\", { ...input }, void 0, AddTriggerInputSchema, \"local\");\nconst removeTrigger = (input) => createAction(\"REMOVE_TRIGGER\", { ...input }, void 0, RemoveTriggerInputSchema, \"local\");\n//#endregion\n//#region document-drive/gen/creators.ts\nvar creators_exports = /* @__PURE__ */ __exportAll({\n\taddFile: () => addFile,\n\taddFolder: () => addFolder,\n\taddListener: () => addListener,\n\taddTrigger: () => addTrigger,\n\tcopyNode: () => copyNode,\n\tdeleteNode: () => deleteNode,\n\tmoveNode: () => moveNode,\n\tremoveListener: () => removeListener,\n\tremoveTrigger: () => removeTrigger,\n\tsetAvailableOffline: () => setAvailableOffline,\n\tsetDriveIcon: () => setDriveIcon,\n\tsetDriveName: () => setDriveName,\n\tsetSharingType: () => setSharingType,\n\tupdateFile: () => updateFile,\n\tupdateNode: () => updateNode\n});\n//#endregion\n//#region document-drive/gen/document-model.ts\nconst driveDocumentModel = {\n\tid: \"powerhouse/document-drive\",\n\tname: \"DocumentDrive\",\n\textension: \"phdd\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"Powerhouse Inc\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type FolderNode {\\n id: String!\\n name: String!\\n kind: String!\\n parentFolder: String\\n}\\n\\ntype FileNode {\\n id: String!\\n name: String!\\n kind: String!\\n documentType: String!\\n parentFolder: String\\n}\\n\\nunion Node = FolderNode | FileNode\\n\\ntype DocumentDriveState {\\n name: String!\\n nodes: [Node!]!\\n icon: String\\n}\",\n\t\t\t\tinitialValue: \"\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"nodes\\\\\\\":[],\\\\\\\"icon\\\\\\\":null}\\\"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"type ListenerFilter {\\n documentType: [String!]!\\n documentId: [ID!]\\n scope: [String!]\\n branch: [String!]\\n}\\n\\nenum TransmitterType {\\n Internal,\\n SwitchboardPush,\\n PullResponder,\\n SecureConnect, \\n MatrixConnect,\\n RESTWebhook\\n}\\n\\ntype ListenerCallInfo {\\n transmitterType: TransmitterType\\n name: String\\n data: String\\n}\\n\\ntype Listener {\\n listenerId: ID!\\n label: String\\n block: Boolean!\\n system: Boolean!\\n filter: ListenerFilter!\\n callInfo: ListenerCallInfo\\n}\\n\\nenum TriggerType {\\n PullResponder\\n}\\n\\ntype PullResponderTriggerData {\\n listenerId: ID!\\n url: String!\\n interval: String!\\n}\\n\\nunion TriggerData = PullResponderTriggerData\\n\\ntype Trigger {\\n id: ID!\\n type: TriggerType!\\n data: TriggerData\\n}\\n\\ntype DocumentDriveLocalState{\\n sharingType: String\\n listeners: [Listener!]!\\n triggers: [Trigger!]!\\n availableOffline: Boolean!\\n}\",\n\t\t\t\tinitialValue: \"\\\"{ \\\\\\\"listeners\\\\\\\": [], \\\\\\\"triggers\\\\\\\": [], \\\\\\\"sharingType\\\\\\\": \\\\\\\"private\\\\\\\", \\\\\\\"availableOffline\\\\\\\": false}\\\"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [{\n\t\t\tid: \"GRzuvv78tBvmB6ciitokLfonNHA=\",\n\t\t\tname: \"Node\",\n\t\t\tdescription: \"\",\n\t\t\toperations: [\n\t\t\t\t{\n\t\t\t\t\tid: \"7xiTdxonc9yEASR8sfV/KnbSV10=\",\n\t\t\t\t\tname: \"ADD_FILE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input AddFileInput {\\n id: ID!\\n name: String!\\n documentType: String!\\n parentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"4lzNMMKKdIAtEU6i12xLgi9hp+U=\",\n\t\t\t\t\tname: \"ADD_FOLDER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input AddFolderInput {\\n id: ID!\\n name: String!\\n parentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"53jH2/3TWTTcgCJiv2C+BmuC6i0=\",\n\t\t\t\t\tname: \"DELETE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input DeleteNodeInput {\\n id: ID!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"pNn+Y1/HVq/GNMk7t0u3g3gtMLE=\",\n\t\t\t\t\tname: \"UPDATE_FILE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input UpdateFileInput {\\n id: ID!\\n parentFolder: ID\\n name: String\\n documentType: String\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"P0x1M8Mnt+Q/+9nggkwgVbfybsc=\",\n\t\t\t\t\tname: \"UPDATE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input UpdateNodeInput {\\n id: ID!\\n parentFolder: ID\\n name: String\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"vnQ7OB5b3wGLgjhbgJqAIpA+JLE=\",\n\t\t\t\t\tname: \"COPY_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input CopyNodeInput {\\n srcId: ID!\\n targetId: ID!\\n targetName: String\\n targetParentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"VNyiD/sNGzk6k9A1Qe7s8dmrJxA=\",\n\t\t\t\t\tname: \"MOVE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input MoveNodeInput {\\n srcFolder: ID!\\n targetParentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t}\n\t\t\t]\n\t\t}, {\n\t\t\tid: \"0dHwHlxOM9x0vMZ+gLnKxf2qTEo=\",\n\t\t\tname: \"Drive\",\n\t\t\tdescription: \"\",\n\t\t\toperations: [\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z1dsU=\",\n\t\t\t\t\tname: \"SET_DRIVE_NAME\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetDriveNameInput {\\n name: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z30dsU=\",\n\t\t\t\t\tname: \"SET_DRIVE_ICON\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetDriveIconInput {\\n icon: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z2dsU=\",\n\t\t\t\t\tname: \"SET_SHARING_TYPE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetSharingTypeInput {\\n type: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z3dsU=\",\n\t\t\t\t\tname: \"SET_AVAILABLE_OFFLINE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetAvailableOfflineInput {\\n availableOffline: Boolean!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z9dsU=\",\n\t\t\t\t\tname: \"ADD_LISTENER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input ListenerFilterInput {\\n documentType: [String!]\\n documentId: [ID!]\\n scope: [String!]\\n branch: [String!]\\n}\\n\\ninput ListenerCallInfoInput {\\n transmitterType: TransmitterType\\n name: String\\n data: String\\n}\\n\\ninput ListenerInput {\\n listenerId: ID!\\n label: String\\n block: Boolean!\\n system: Boolean!\\n filter: ListenerFilterInput!\\n callInfo: ListenerCallInfoInput\\n}\\n\\ninput AddListenerInput {\\n listener: ListenerInput!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z10dsU=\",\n\t\t\t\t\tname: \"REMOVE_LISTENER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input RemoveListenerInput {\\n listenerId: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z20dsU=\",\n\t\t\t\t\tname: \"ADD_TRIGGER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input PullResponderTriggerDataInput {\\n listenerId: ID!\\n url: String!\\n interval: String!\\n}\\n\\ninput TriggerInput {\\n id: ID!\\n type: TriggerType!\\n data: PullResponderTriggerDataInput\\n}\\n\\ninput AddTriggerInput {\\n trigger: TriggerInput!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z30dsU=\",\n\t\t\t\t\tname: \"REMOVE_TRIGGER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input RemoveTriggerInput {\\n triggerId: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t}\n\t\t\t]\n\t\t}]\n\t}]\n};\n//#endregion\n//#region document-drive/gen/document-type.ts\nconst driveDocumentType = \"powerhouse/document-drive\";\n//#endregion\n//#region document-drive/gen/document-schema.ts\n/** Schema for validating the header object of a Drive document */\nconst DriveDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(driveDocumentType) });\n/** Schema for validating the state object of a Drive document */\nconst DrivePHStateSchema = BaseDocumentStateSchema.extend({\n\tglobal: DocumentDriveStateSchema(),\n\tlocal: DocumentDriveLocalStateSchema()\n});\nconst DriveDocumentSchema = z.object({\n\theader: DriveDocumentHeaderSchema,\n\tstate: DrivePHStateSchema,\n\tinitialState: DrivePHStateSchema\n});\n/** Simple helper function to check if a state object is a Drive document state object */\nfunction isDriveState(state) {\n\treturn DrivePHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a Drive document state object */\nfunction assertIsDriveState(state) {\n\tDrivePHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a Drive document */\nfunction isDriveDocument(document) {\n\treturn DriveDocumentSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a Drive document */\nfunction assertIsDriveDocument(document) {\n\tDriveDocumentSchema.parse(document);\n}\n//#endregion\n//#region document-drive/gen/ph-factories.ts\n/**\n* Factory methods for creating DocumentDriveDocument instances\n*/\nfunction defaultGlobalState() {\n\treturn {\n\t\ticon: null,\n\t\tname: \"\",\n\t\tnodes: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {\n\t\tavailableOffline: false,\n\t\tlisteners: [],\n\t\tsharingType: null,\n\t\ttriggers: []\n\t};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\n//#region document-drive/src/reducers/drive.ts\nconst driveReducer = {\n\tsetDriveNameOperation(state, action, dispatch) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetDriveIconOperation(state, action, dispatch) {\n\t\tstate.icon = action.input.icon;\n\t},\n\tsetSharingTypeOperation(state, action, dispatch) {\n\t\tstate.sharingType = action.input.type;\n\t},\n\tsetAvailableOfflineOperation(state, action, dispatch) {\n\t\tstate.availableOffline = action.input.availableOffline;\n\t},\n\taddListenerOperation(state, action, dispatch) {\n\t\tconst { listener: input } = action.input;\n\t\tif (state.listeners.find((l) => l.listenerId === input.listenerId)) throw new Error(`A listener with Id: ${input.listenerId} already exists`);\n\t\tconst listener = {\n\t\t\tlistenerId: input.listenerId,\n\t\t\tlabel: input.label ?? null,\n\t\t\tblock: input.block,\n\t\t\tsystem: input.system,\n\t\t\tfilter: {\n\t\t\t\tdocumentType: input.filter.documentType ?? null,\n\t\t\t\tdocumentId: input.filter.documentId ?? null,\n\t\t\t\tscope: input.filter.scope ?? null,\n\t\t\t\tbranch: input.filter.branch ?? null\n\t\t\t},\n\t\t\tcallInfo: input.callInfo ? {\n\t\t\t\ttransmitterType: input.callInfo.transmitterType ?? null,\n\t\t\t\tname: input.callInfo.name ?? null,\n\t\t\t\tdata: input.callInfo.data ?? null\n\t\t\t} : null\n\t\t};\n\t\tstate.listeners.push(listener);\n\t},\n\tremoveListenerOperation(state, action, dispatch) {\n\t\tstate.listeners = state.listeners.filter((listener) => listener.listenerId !== action.input.listenerId);\n\t},\n\taddTriggerOperation(state, action, dispatch) {\n\t\tconst { trigger: input } = action.input;\n\t\tif (state.triggers.find((t) => t.id === input.id)) throw new Error(`A trigger with Id: ${input.id} already exists`);\n\t\tconst trigger = {\n\t\t\tid: input.id,\n\t\t\ttype: input.type,\n\t\t\tdata: input.data ? { ...input.data } : null\n\t\t};\n\t\tstate.triggers.push(trigger);\n\t},\n\tremoveTriggerOperation(state, action, dispatch) {\n\t\tstate.triggers = state.triggers.filter((trigger) => trigger.id !== action.input.triggerId);\n\t}\n};\n//#endregion\n//#region document-drive/src/utils.ts\nfunction isFileNode(node) {\n\treturn node.kind === \"file\";\n}\nfunction isFolderNode(node) {\n\treturn node.kind === \"folder\";\n}\nfunction getAncestors(node, allNodes) {\n\tif (!node.parentFolder) return [];\n\telse {\n\t\tconst parentNode = allNodes.find((_node) => _node.id === node.parentFolder);\n\t\tif (!parentNode) throw new Error(`Parent node with id ${node.parentFolder} not found`);\n\t\treturn [parentNode, ...getAncestors(parentNode, allNodes)];\n\t}\n}\nfunction getDescendants(node, allNodes) {\n\tconst children = allNodes.filter((_node) => _node.parentFolder === node.id);\n\tconst descendants = children.map((child) => getDescendants(child, allNodes));\n\treturn [...children, ...descendants.flat()];\n}\n/**\n* Generates a copy of nodes based on the provided source and target information.\n* @param src - The source information for generating the copy.\n* @param idGenerator - The function used to generate new IDs for the copied nodes.\n* @param nodes - The array of nodes to copy from.\n* @returns An array of copied nodes with updated IDs and parent folders.\n* @throws Error if the root node with the specified ID is not found.\n*/\nfunction generateNodesCopy(src, idGenerator, nodes) {\n\tconst rootNode = nodes.find((node) => node.id === src.srcId);\n\tif (!rootNode) throw new Error(`Node with id ${src.srcId} not found`);\n\tconst nodesToCopy = [{\n\t\t...rootNode,\n\t\tname: src.targetName || rootNode.name,\n\t\tparentFolder: src.targetParentFolder || null\n\t}, ...getDescendants(rootNode, nodes)];\n\tconst ids = {};\n\tif (src.targetParentFolder) ids[src.targetParentFolder] = src.targetParentFolder;\n\tconst getNewNodeId = (node) => {\n\t\tlet newId = ids[node.id];\n\t\tif (!newId) {\n\t\t\tconst oldId = node.id;\n\t\t\tnewId = idGenerator(node);\n\t\t\tids[oldId] = newId;\n\t\t}\n\t\treturn newId;\n\t};\n\treturn nodesToCopy.map((node) => ({\n\t\tsrcId: node.id,\n\t\ttargetId: getNewNodeId(node),\n\t\ttargetName: node.name,\n\t\ttargetParentFolder: node.parentFolder ? ids[node.parentFolder] : null\n\t}));\n}\nfunction getNextCopyNumber(files, baseFilename) {\n\tlet maxNumber = 0;\n\tconst regex = new RegExp(`^${escapeRegExp(baseFilename)} \\\\(copy\\\\)(?: (\\\\d+))?$`);\n\tfor (const file of files) {\n\t\tconst match = file.match(regex);\n\t\tif (match) {\n\t\t\tconst number = match[1] ? parseInt(match[1], 10) : 1;\n\t\t\tif (number > maxNumber) maxNumber = number;\n\t\t}\n\t}\n\treturn maxNumber + 1;\n}\nfunction escapeRegExp(string) {\n\treturn string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nfunction handleTargetNameCollisions(params) {\n\tconst { nodes, targetParentFolder, srcName, srcKind } = params;\n\tconst targetNodeChildrenNames = nodes.filter((node) => targetParentFolder === \"\" ? node.parentFolder === null : node.parentFolder === targetParentFolder).filter((node) => node.kind === srcKind).map((node) => node.name);\n\treturn targetNodeChildrenNames.includes(srcName) ? `${srcName} (copy) ${getNextCopyNumber(targetNodeChildrenNames, srcName)}` : srcName;\n}\nconst isValidName = (name) => {\n\treturn name.trim().length > 0 && !/[\\u0000-\\u001F\\u007F]/.test(name);\n};\n//#endregion\n//#region document-drive/src/reducers/node.ts\nconst nodeReducer = {\n\taddFileOperation(state, action, dispatch) {\n\t\tif (state.nodes.find((node) => node.id === action.input.id)) throw new Error(`Node with id ${action.input.id} already exists!`);\n\t\tif (!isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must not be empty or contain control characters.`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.name,\n\t\t\tsrcKind: \"file\",\n\t\t\ttargetParentFolder: action.input.parentFolder || null\n\t\t});\n\t\tconst fileNode = {\n\t\t\tid: action.input.id,\n\t\t\tname,\n\t\t\tkind: \"file\",\n\t\t\tparentFolder: action.input.parentFolder ?? null,\n\t\t\tdocumentType: action.input.documentType\n\t\t};\n\t\tstate.nodes.push(fileNode);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t\tdispatch?.({\n\t\t\ttype: \"CREATE_CHILD_DOCUMENT\",\n\t\t\tinput: {\n\t\t\t\tid: action.input.id,\n\t\t\t\tdocumentType: action.input.documentType\n\t\t\t}\n\t\t});\n\t},\n\taddFolderOperation(state, action) {\n\t\tif (state.nodes.find((node) => node.id === action.input.id)) throw new Error(`Node with id ${action.input.id} already exists!`);\n\t\tif (!isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must not be empty or contain control characters.`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.name,\n\t\t\tsrcKind: \"folder\",\n\t\t\ttargetParentFolder: action.input.parentFolder || null\n\t\t});\n\t\tstate.nodes.push({\n\t\t\t...action.input,\n\t\t\tname,\n\t\t\tkind: \"folder\",\n\t\t\tparentFolder: action.input.parentFolder ?? null\n\t\t});\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tdeleteNodeOperation(state, action, dispatch) {\n\t\tconst node = state.nodes.find((node) => node.id === action.input.id);\n\t\tif (!node) throw new Error(`Node with id ${action.input.id} not found`);\n\t\tconst descendants = getDescendants(node, state.nodes);\n\t\tstate.nodes = state.nodes.filter((node) => node.id !== action.input.id && !descendants.find((descendant) => descendant.id === node.id));\n\t\t[node, ...descendants].filter((node) => isFileNode(node)).forEach((node) => {\n\t\t\tdispatch?.({\n\t\t\t\ttype: \"DELETE_CHILD_DOCUMENT\",\n\t\t\t\tinput: { id: node.id }\n\t\t\t});\n\t\t});\n\t},\n\tupdateFileOperation(state, action) {\n\t\tif (action.input.name && !isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must not be empty or contain control characters.`);\n\t\tstate.nodes = state.nodes.map((node) => node.id === action.input.id ? {\n\t\t\t...node,\n\t\t\tname: handleTargetNameCollisions({\n\t\t\t\tnodes: state.nodes.filter((n) => n.id !== action.input.id),\n\t\t\t\tsrcName: action.input.name ?? node.name,\n\t\t\t\tsrcKind: \"file\",\n\t\t\t\ttargetParentFolder: action.input.parentFolder ?? node.parentFolder\n\t\t\t}),\n\t\t\tdocumentType: action.input.documentType ?? node.documentType\n\t\t} : node);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tupdateNodeOperation(state, action) {\n\t\tif (action.input.name && !isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must not be empty or contain control characters.`);\n\t\tstate.nodes = state.nodes.map((node) => node.id === action.input.id ? {\n\t\t\t...node,\n\t\t\tname: handleTargetNameCollisions({\n\t\t\t\tnodes: state.nodes.filter((n) => n.id !== action.input.id),\n\t\t\t\tsrcName: action.input.name ?? node.name,\n\t\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\t\ttargetParentFolder: action.input.parentFolder ?? node.parentFolder\n\t\t\t}),\n\t\t\tparentFolder: action.input.parentFolder === null ? null : node.parentFolder\n\t\t} : node);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tcopyNodeOperation(state, action, dispatch) {\n\t\tconst node = state.nodes.find((node) => node.id === action.input.srcId);\n\t\tif (!node) throw new Error(`Node with id ${action.input.srcId} not found`);\n\t\tif (state.nodes.find((node) => node.id === action.input.targetId)) throw new Error(`Node with id ${action.input.targetId} already exists`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.targetName || node.name,\n\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\ttargetParentFolder: action.input.targetParentFolder || null\n\t\t});\n\t\tconst newNode = {\n\t\t\t...node,\n\t\t\tid: action.input.targetId,\n\t\t\tslug: action.input.targetId,\n\t\t\tname,\n\t\t\tparentFolder: action.input.targetParentFolder || null\n\t\t};\n\t\tstate.nodes.push(newNode);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t\tif (isFileNode(newNode)) dispatch?.({\n\t\t\ttype: \"COPY_CHILD_DOCUMENT\",\n\t\t\tinput: {\n\t\t\t\tid: action.input.srcId,\n\t\t\t\tnewId: action.input.targetId\n\t\t\t}\n\t\t});\n\t},\n\tmoveNodeOperation(state, action) {\n\t\tif (action.input.srcFolder === action.input.targetParentFolder) throw new Error(\"Circular Reference Error: Attempting to move a node to its current parent folder\");\n\t\tconst node = state.nodes.find((node) => node.id === action.input.srcFolder);\n\t\tif (!node) throw new Error(`Node with id ${action.input.srcFolder} not found`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: node.name,\n\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\ttargetParentFolder: action.input.targetParentFolder || null\n\t\t});\n\t\tif (isFolderNode(node)) {\n\t\t\tif (getDescendants(node, state.nodes).find((descendant) => descendant.id === action.input.targetParentFolder)) throw new Error(\"Circular Reference Error: Cannot move a folder to one of its descendants\");\n\t\t}\n\t\tstate.nodes = state.nodes.map((node) => {\n\t\t\tif (node.id === action.input.srcFolder) return {\n\t\t\t\t...node,\n\t\t\t\tname,\n\t\t\t\tparentFolder: action.input.targetParentFolder || null\n\t\t\t};\n\t\t\treturn node;\n\t\t});\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t}\n};\n//#endregion\n//#region document-drive/gen/reducer.ts\nconst driveStateReducer = (state, action, dispatch) => {\n\tif (isDocumentAction(action)) return state;\n\tconst typedAction = action;\n\tswitch (typedAction.type) {\n\t\tcase \"ADD_FILE\":\n\t\t\tAddFileInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.addFileOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_FOLDER\":\n\t\t\tAddFolderInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.addFolderOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"DELETE_NODE\":\n\t\t\tDeleteNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.deleteNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"UPDATE_FILE\":\n\t\t\tUpdateFileInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.updateFileOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"UPDATE_NODE\":\n\t\t\tUpdateNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.updateNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"COPY_NODE\":\n\t\t\tCopyNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.copyNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"MOVE_NODE\":\n\t\t\tMoveNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.moveNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_DRIVE_NAME\":\n\t\t\tSetDriveNameInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setDriveNameOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_DRIVE_ICON\":\n\t\t\tSetDriveIconInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setDriveIconOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_SHARING_TYPE\":\n\t\t\tSetSharingTypeInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setSharingTypeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_AVAILABLE_OFFLINE\":\n\t\t\tSetAvailableOfflineInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setAvailableOfflineOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_LISTENER\":\n\t\t\tAddListenerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.addListenerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"REMOVE_LISTENER\":\n\t\t\tRemoveListenerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.removeListenerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_TRIGGER\":\n\t\t\tAddTriggerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.addTriggerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"REMOVE_TRIGGER\":\n\t\t\tRemoveTriggerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.removeTriggerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst driveDocumentReducer = createReducer(driveStateReducer);\n//#endregion\n//#region document-drive/gen/utils.ts\nconst initialGlobalState = {\n\tname: \"\",\n\tnodes: [],\n\ticon: null\n};\nconst initialLocalState = {\n\tlisteners: [],\n\ttriggers: [],\n\tsharingType: \"private\",\n\tavailableOffline: false\n};\nconst driveCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...initialGlobalState,\n\t\t\t...state?.global\n\t\t},\n\t\tlocal: {\n\t\t\t...initialLocalState,\n\t\t\t...state?.local\n\t\t}\n\t};\n};\nconst driveCreateDocument = (state) => {\n\treturn baseCreateDocument(driveCreateState, state, driveDocumentType);\n};\nconst driveSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nconst driveLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, driveDocumentReducer);\n};\nconst isStateOfType = (state) => {\n\treturn isDriveState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDriveState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDriveDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDriveDocument(document);\n};\n//#endregion\n//#region document-drive/module.ts\nconst driveDocumentModelModule = {\n\tactions: creators_exports,\n\treducer: driveDocumentReducer,\n\tdocumentModel: createState$1(defaultBaseState(), driveDocumentModel),\n\tutils: {\n\t\tfileExtension: driveDocumentFileExtension,\n\t\tcreateState: driveCreateState,\n\t\tcreateDocument: driveCreateDocument,\n\t\tloadFromInput: driveLoadFromInput,\n\t\tsaveToFileHandle: driveSaveToFileHandle,\n\t\tisStateOfType,\n\t\tassertIsStateOfType,\n\t\tisDocumentOfType,\n\t\tassertIsDocumentOfType\n\t}\n};\n//#endregion\nexport { AddFileInputSchema, AddFolderInputSchema, AddListenerInputSchema, AddTriggerInputSchema, CopyNodeInputSchema, DeleteNodeInputSchema, DocumentDriveLocalStateSchema, DocumentDriveStateSchema, DriveDocumentHeaderSchema, DriveDocumentSchema, DrivePHStateSchema, FileNodeSchema, FolderNodeSchema, ListenerCallInfoInputSchema, ListenerCallInfoSchema, ListenerFilterInputSchema, ListenerFilterSchema, ListenerInputSchema, ListenerSchema, MoveNodeInputSchema, NodeSchema, PullResponderTriggerDataInputSchema, PullResponderTriggerDataSchema, RemoveListenerInputSchema, RemoveTriggerInputSchema, SetAvailableOfflineInputSchema, SetDriveIconInputSchema, SetDriveNameInputSchema, SetSharingTypeInputSchema, TransmitterTypeSchema, TriggerDataSchema, TriggerInputSchema, TriggerSchema, TriggerTypeSchema, UpdateFileInputSchema, UpdateNodeInputSchema, addFile, addFolder, addListener, addTrigger, assertIsDocumentOfType, assertIsDriveDocument, assertIsDriveState, assertIsStateOfType, copyNode, createGlobalState, createLocalState, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteNode, driveCreateDocument, driveCreateState, driveDocumentFileExtension, driveDocumentModel, driveDocumentModelModule, driveDocumentReducer, driveDocumentType, driveLoadFromInput, driveReducer, driveSaveToFileHandle, escapeRegExp, generateNodesCopy, getAncestors, getDescendants, getNextCopyNumber, handleTargetNameCollisions, initialGlobalState, initialLocalState, isDefinedNonNullAny, isDocumentOfType, isDriveDocument, isDriveState, isFileNode, isFolderNode, isStateOfType, isValidName, moveNode, nodeReducer, removeListener, removeTrigger, setAvailableOffline, setDriveIcon, setDriveName, setSharingType, updateFile, updateNode };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0,1,2,4,5],"mappings":";;;;;CAEA,MAAM,EAAE,mBAAmB,OAAO;CAElC,MAAM,YAAY,WAAW;AAG7B,WAAU,YAAY;AAEtB,WAAU,YAAY;AAGtB,WAAU,UAAU;AAGpB,SAAQ,YAAY;AAEpB,SAAQ,YAAY;AAEpB,QAAO,UAAU;CAGjB,MAAM,2BAA2B;CAIjC,SAAS,UAAW,KAAK;AAEvB,MAAI,IAAI,SAAS,OAAQ,CAAC,yBAAyB,KAAK,IAAI,CAC1D,QAAO,IAAI,IAAI;AAEjB,SAAO,KAAK,UAAU,IAAI;;CAG5B,SAAS,KAAM,OAAO,YAAY;AAGhC,MAAI,MAAM,SAAS,OAAO,WACxB,QAAO,MAAM,KAAK,WAAW;AAE/B,OAAK,IAAI,IAAI,GAAG,IAA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AAG,SAAS;AACjG,MAAM,cAAc;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAM,UAAU;CACf,GAAG;CACH,GAAG;CACH;AAGD,MAAM,6BAA6B;AACnC,MAAM,iCAAiC,EAAE;AACzC,MAAM,kCAAkC;CACvC,IAAI;CACJ,MAAM;CACN,WAAW;CACX,aAAa;CACb,QAAQ;EACP,MAAM;EACN,SAAS;EACT;CACD,gBAAgB,CAAC;EAChB,SAAS;EACT,WAAW,EAAE;EACb,OAAO;GACN,QAAQ;IACP,QAAQ;IACR,cAAc;IACd,UAAU,EAAE;IACZ;GACD,OAAO;IACN,QAAQ;IACR,cAAc;IACd,UAAU,EAAE;IACZ;GACD;EACD,SAAS,EAAE;EACX,CAAC;CACF;AACD,MAAM,2BAA2B;CAChC,IAAI;CACJ,MAAM;CACN,WAAW;CACX,aAAa;CACb,QAAQ;EACP,MAAM;EACN,SAAS;EACT;CACD,gBAAgB,CAAC;EAChB,SAAS;EACT,WAAW,EAAE;EACb,OAAO;GACN,QAAQ;IACP,QAAQ;IACR,cAAc;IACd,UAAU,EAAE;IACZ;GACD,OAAO;IACN,QAAQ;IACR,cAAc;IACd,UAAU,EAAE;IACZ;GACD;EACD,SAAS;GACR;IACC,MAAM;IACN,YAAY;KACX;MACC,MAAM;MACN,IAAI;MACJ,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SAAS;MACT,UAAU,EAAE;MACZ,QAAQ,EAAE;MACV,OAAO;MACP;KACD;MACC,MAAM;MACN,IAAI;MACJ,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SAAS;MACT,UAAU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