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AIqB,IAAIP,GAC1B,QAAIH,IACIA,IAASZ,KAAKE,SACdF,KAAKE,OAASU,EAAKY,OAEnBZ,IAASZ,KAAKG,SACdH,KAAKG,OAASS,EAAKa,OAEnBb,EAAKa,QACLb,EAAKa,MAAMD,MAAQZ,EAAKY,OAExBZ,EAAKY,QACLZ,EAAKY,MAAMC,MAAQb,EAAKa,OAE5BzB,KAAKC,IAAIa,OAAOC,GAChBf,KAAKD,QAAQa,EAAK3B,MAAO8B,IAClB,EAGf,E","sources":["webpack://hiq/./node_modules/@wry/caches/lib/weak.js","webpack://hiq/./node_modules/@wry/trie/lib/index.js","webpack://hiq/./node_modules/@wry/equality/lib/index.js","webpack://hiq/./node_modules/@wry/context/lib/slot.js","webpack://hiq/./node_modules/@wry/context/lib/index.js","webpack://hiq/./node_modules/@wry/caches/lib/strong.js"],"sourcesContent":["function noop() { }\nconst defaultDispose = noop;\nconst _WeakRef = typeof WeakRef !== \"undefined\"\n ? WeakRef\n : function (value) {\n return { deref: () => value };\n };\nconst _WeakMap = typeof WeakMap !== \"undefined\" ? WeakMap : Map;\nconst _FinalizationRegistry = typeof FinalizationRegistry !== \"undefined\"\n ? FinalizationRegistry\n : function () {\n return {\n register: noop,\n unregister: noop,\n };\n };\nconst finalizationBatchSize = 10024;\nexport class WeakCache {\n constructor(max = Infinity, dispose = defaultDispose) {\n this.max = max;\n this.dispose = dispose;\n this.map = new _WeakMap();\n this.newest = null;\n this.oldest = null;\n this.unfinalizedNodes = new Set();\n this.finalizationScheduled = false;\n this.size = 0;\n this.finalize = () => {\n const iterator = this.unfinalizedNodes.values();\n for (let i = 0; i < finalizationBatchSize; i++) {\n const node = iterator.next().value;\n if (!node)\n break;\n this.unfinalizedNodes.delete(node);\n const key = node.key;\n delete node.key;\n node.keyRef = new _WeakRef(key);\n this.registry.register(key, node, node);\n }\n if (this.unfinalizedNodes.size > 0) {\n queueMicrotask(this.finalize);\n }\n else {\n this.finalizationScheduled = false;\n }\n };\n this.registry = new _FinalizationRegistry(this.deleteNode.bind(this));\n }\n has(key) {\n return this.map.has(key);\n }\n get(key) {\n const node = this.getNode(key);\n return node && node.value;\n }\n getNode(key) {\n const node = this.map.get(key);\n if (node && node !== this.newest) {\n const { older, newer } = node;\n if (newer) {\n newer.older = older;\n }\n if (older) {\n older.newer = newer;\n }\n node.older = this.newest;\n node.older.newer = node;\n node.newer = null;\n this.newest = node;\n if (node === this.oldest) {\n this.oldest = newer;\n }\n }\n return node;\n }\n set(key, value) {\n let node = this.getNode(key);\n if (node) {\n return (node.value = value);\n }\n node = {\n key,\n value,\n newer: null,\n older: this.newest,\n };\n if (this.newest) {\n this.newest.newer = node;\n }\n this.newest = node;\n this.oldest = this.oldest || node;\n this.scheduleFinalization(node);\n this.map.set(key, node);\n this.size++;\n return node.value;\n }\n clean() {\n while (this.oldest && this.size > this.max) {\n this.deleteNode(this.oldest);\n }\n }\n deleteNode(node) {\n if (node === this.newest) {\n this.newest = node.older;\n }\n if (node === this.oldest) {\n this.oldest = node.newer;\n }\n if (node.newer) {\n node.newer.older = node.older;\n }\n if (node.older) {\n node.older.newer = node.newer;\n }\n this.size--;\n const key = node.key || (node.keyRef && node.keyRef.deref());\n this.dispose(node.value, key);\n if (!node.keyRef) {\n this.unfinalizedNodes.delete(node);\n }\n else {\n this.registry.unregister(node);\n }\n if (key)\n this.map.delete(key);\n }\n delete(key) {\n const node = this.map.get(key);\n if (node) {\n this.deleteNode(node);\n return true;\n }\n return false;\n }\n scheduleFinalization(node) {\n this.unfinalizedNodes.add(node);\n if (!this.finalizationScheduled) {\n this.finalizationScheduled = true;\n queueMicrotask(this.finalize);\n }\n }\n}\n//# sourceMappingURL=weak.js.map","// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds\n// object keys weakly, yet can also hold non-object keys, unlike the\n// native `WeakMap`.\n// If no makeData function is supplied, the looked-up data will be an empty,\n// null-prototype Object.\nconst defaultMakeData = () => Object.create(null);\n// Useful for processing arguments objects as well as arrays.\nconst { forEach, slice } = Array.prototype;\nconst { hasOwnProperty } = Object.prototype;\nexport class Trie {\n constructor(weakness = true, makeData = defaultMakeData) {\n this.weakness = weakness;\n this.makeData = makeData;\n }\n lookup() {\n return this.lookupArray(arguments);\n }\n lookupArray(array) {\n let node = this;\n forEach.call(array, key => node = node.getChildTrie(key));\n return hasOwnProperty.call(node, \"data\")\n ? node.data\n : node.data = this.makeData(slice.call(array));\n }\n peek() {\n return this.peekArray(arguments);\n }\n peekArray(array) {\n let node = this;\n for (let i = 0, len = array.length; node && i < len; ++i) {\n const map = node.mapFor(array[i], false);\n node = map && map.get(array[i]);\n }\n return node && node.data;\n }\n remove() {\n return this.removeArray(arguments);\n }\n removeArray(array) {\n let data;\n if (array.length) {\n const head = array[0];\n const map = this.mapFor(head, false);\n const child = map && map.get(head);\n if (child) {\n data = child.removeArray(slice.call(array, 1));\n if (!child.data && !child.weak && !(child.strong && child.strong.size)) {\n map.delete(head);\n }\n }\n }\n else {\n data = this.data;\n delete this.data;\n }\n return data;\n }\n getChildTrie(key) {\n const map = this.mapFor(key, true);\n let child = map.get(key);\n if (!child)\n map.set(key, child = new Trie(this.weakness, this.makeData));\n return child;\n }\n mapFor(key, create) {\n return this.weakness && isObjRef(key)\n ? this.weak || (create ? this.weak = new WeakMap : void 0)\n : this.strong || (create ? this.strong = new Map : void 0);\n }\n}\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null)\n break;\n // Fall through to return true...\n case \"function\":\n return true;\n }\n return false;\n}\n//# sourceMappingURL=index.js.map","const { toString, hasOwnProperty } = Object.prototype;\nconst fnToStr = Function.prototype.toString;\nconst previousComparisons = new Map();\n/**\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\n */\nexport function equal(a, b) {\n try {\n return check(a, b);\n }\n finally {\n previousComparisons.clear();\n }\n}\n// Allow default imports as well.\nexport default equal;\nfunction check(a, b) {\n // If the two values are strictly equal, our job is easy.\n if (a === b) {\n return true;\n }\n // Object.prototype.toString returns a representation of the runtime type of\n // the given value that is considerably more precise than typeof.\n const aTag = toString.call(a);\n const bTag = toString.call(b);\n // If the runtime types of a and b are different, they could maybe be equal\n // under some interpretation of equality, but for simplicity and performance\n // we just return false instead.\n if (aTag !== bTag) {\n return false;\n }\n switch (aTag) {\n case '[object Array]':\n // Arrays are a lot like other objects, but we can cheaply compare their\n // lengths as a short-cut before comparing their elements.\n if (a.length !== b.length)\n return false;\n // Fall through to object case...\n case '[object Object]': {\n if (previouslyCompared(a, b))\n return true;\n const aKeys = definedKeys(a);\n const bKeys = definedKeys(b);\n // If `a` and `b` have a different number of enumerable keys, they\n // must be different.\n const keyCount = aKeys.length;\n if (keyCount !== bKeys.length)\n return false;\n // Now make sure they have the same keys.\n for (let k = 0; k < keyCount; ++k) {\n if (!hasOwnProperty.call(b, aKeys[k])) {\n return false;\n }\n }\n // Finally, check deep equality of all child properties.\n for (let k = 0; k < keyCount; ++k) {\n const key = aKeys[k];\n if (!check(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n case '[object Error]':\n return a.name === b.name && a.message === b.message;\n case '[object Number]':\n // Handle NaN, which is !== itself.\n if (a !== a)\n return b !== b;\n // Fall through to shared +a === +b case...\n case '[object Boolean]':\n case '[object Date]':\n return +a === +b;\n case '[object RegExp]':\n case '[object String]':\n return a == `${b}`;\n case '[object Map]':\n case '[object Set]': {\n if (a.size !== b.size)\n return false;\n if (previouslyCompared(a, b))\n return true;\n const aIterator = a.entries();\n const isMap = aTag === '[object Map]';\n while (true) {\n const info = aIterator.next();\n if (info.done)\n break;\n // If a instanceof Set, aValue === aKey.\n const [aKey, aValue] = info.value;\n // So this works the same way for both Set and Map.\n if (!b.has(aKey)) {\n return false;\n }\n // However, we care about deep equality of values only when dealing\n // with Map structures.\n if (isMap && !check(aValue, b.get(aKey))) {\n return false;\n }\n }\n return true;\n }\n case '[object Uint16Array]':\n case '[object Uint8Array]': // Buffer, in Node.js.\n case '[object Uint32Array]':\n case '[object Int32Array]':\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object ArrayBuffer]':\n // DataView doesn't need these conversions, but the equality check is\n // otherwise the same.\n a = new Uint8Array(a);\n b = new Uint8Array(b);\n // Fall through...\n case '[object DataView]': {\n let len = a.byteLength;\n if (len === b.byteLength) {\n while (len-- && a[len] === b[len]) {\n // Keep looping as long as the bytes are equal.\n }\n }\n return len === -1;\n }\n case '[object AsyncFunction]':\n case '[object GeneratorFunction]':\n case '[object AsyncGeneratorFunction]':\n case '[object Function]': {\n const aCode = fnToStr.call(a);\n if (aCode !== fnToStr.call(b)) {\n return false;\n }\n // We consider non-native functions equal if they have the same code\n // (native functions require === because their code is censored).\n // Note that this behavior is not entirely sound, since !== function\n // objects with the same code can behave differently depending on\n // their closure scope. However, any function can behave differently\n // depending on the values of its input arguments (including this)\n // and its calling context (including its closure scope), even\n // though the function object is === to itself; and it is entirely\n // possible for functions that are not === to behave exactly the\n // same under all conceivable circumstances. Because none of these\n // factors are statically decidable in JavaScript, JS function\n // equality is not well-defined. This ambiguity allows us to\n // consider the best possible heuristic among various imperfect\n // options, and equating non-native functions that have the same\n // code has enormous practical benefits, such as when comparing\n // functions that are repeatedly passed as fresh function\n // expressions within objects that are otherwise deeply equal. Since\n // any function created from the same syntactic expression (in the\n // same code location) will always stringify to the same code\n // according to fnToStr.call, we can reasonably expect these\n // repeatedly passed function expressions to have the same code, and\n // thus behave \"the same\" (with all the caveats mentioned above),\n // even though the runtime function objects are !== to one another.\n return !endsWith(aCode, nativeCodeSuffix);\n }\n }\n // Otherwise the values are not equal.\n return false;\n}\nfunction definedKeys(obj) {\n // Remember that the second argument to Array.prototype.filter will be\n // used as `this` within the callback function.\n return Object.keys(obj).filter(isDefinedKey, obj);\n}\nfunction isDefinedKey(key) {\n return this[key] !== void 0;\n}\nconst nativeCodeSuffix = \"{ [native code] }\";\nfunction endsWith(full, suffix) {\n const fromIndex = full.length - suffix.length;\n return fromIndex >= 0 &&\n full.indexOf(suffix, fromIndex) === fromIndex;\n}\nfunction previouslyCompared(a, b) {\n // Though cyclic references can make an object graph appear infinite from the\n // perspective of a depth-first traversal, the graph still contains a finite\n // number of distinct object references. We use the previousComparisons cache\n // to avoid comparing the same pair of object references more than once, which\n // guarantees termination (even if we end up comparing every object in one\n // graph to every object in the other graph, which is extremely unlikely),\n // while still allowing weird isomorphic structures (like rings with different\n // lengths) a chance to pass the equality test.\n let bSet = previousComparisons.get(a);\n if (bSet) {\n // Return true here because we can be sure false will be returned somewhere\n // else if the objects are not equivalent.\n if (bSet.has(b))\n return true;\n }\n else {\n previousComparisons.set(a, bSet = new Set);\n }\n bSet.add(b);\n return false;\n}\n//# sourceMappingURL=index.js.map","// This currentContext variable will only be used if the makeSlotClass\n// function is called, which happens only if this is the first copy of the\n// @wry/context package to be imported.\nlet currentContext = null;\n// This unique internal object is used to denote the absence of a value\n// for a given Slot, and is never exposed to outside code.\nconst MISSING_VALUE = {};\nlet idCounter = 1;\n// Although we can't do anything about the cost of duplicated code from\n// accidentally bundling multiple copies of the @wry/context package, we can\n// avoid creating the Slot class more than once using makeSlotClass.\nconst makeSlotClass = () => class Slot {\n constructor() {\n // If you have a Slot object, you can find out its slot.id, but you cannot\n // guess the slot.id of a Slot you don't have access to, thanks to the\n // randomized suffix.\n this.id = [\n \"slot\",\n idCounter++,\n Date.now(),\n Math.random().toString(36).slice(2),\n ].join(\":\");\n }\n hasValue() {\n for (let context = currentContext; context; context = context.parent) {\n // We use the Slot object iself as a key to its value, which means the\n // value cannot be obtained without a reference to the Slot object.\n if (this.id in context.slots) {\n const value = context.slots[this.id];\n if (value === MISSING_VALUE)\n break;\n if (context !== currentContext) {\n // Cache the value in currentContext.slots so the next lookup will\n // be faster. This caching is safe because the tree of contexts and\n // the values of the slots are logically immutable.\n currentContext.slots[this.id] = value;\n }\n return true;\n }\n }\n if (currentContext) {\n // If a value was not found for this Slot, it's never going to be found\n // no matter how many times we look it up, so we might as well cache\n // the absence of the value, too.\n currentContext.slots[this.id] = MISSING_VALUE;\n }\n return false;\n }\n getValue() {\n if (this.hasValue()) {\n return currentContext.slots[this.id];\n }\n }\n withValue(value, callback, \n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args, thisArg) {\n const slots = {\n __proto__: null,\n [this.id]: value,\n };\n const parent = currentContext;\n currentContext = { parent, slots };\n try {\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg, args);\n }\n finally {\n currentContext = parent;\n }\n }\n // Capture the current context and wrap a callback function so that it\n // reestablishes the captured context when called.\n static bind(callback) {\n const context = currentContext;\n return function () {\n const saved = currentContext;\n try {\n currentContext = context;\n return callback.apply(this, arguments);\n }\n finally {\n currentContext = saved;\n }\n };\n }\n // Immediately run a callback function without any captured context.\n static noContext(callback, \n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args, thisArg) {\n if (currentContext) {\n const saved = currentContext;\n try {\n currentContext = null;\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg, args);\n }\n finally {\n currentContext = saved;\n }\n }\n else {\n return callback.apply(thisArg, args);\n }\n }\n};\nfunction maybe(fn) {\n try {\n return fn();\n }\n catch (ignored) { }\n}\n// We store a single global implementation of the Slot class as a permanent\n// non-enumerable property of the globalThis object. This obfuscation does\n// nothing to prevent access to the Slot class, but at least it ensures the\n// implementation (i.e. currentContext) cannot be tampered with, and all copies\n// of the @wry/context package (hopefully just one) will share the same Slot\n// implementation. Since the first copy of the @wry/context package to be\n// imported wins, this technique imposes a steep cost for any future breaking\n// changes to the Slot class.\nconst globalKey = \"@wry/context:Slot\";\nconst host = \n// Prefer globalThis when available.\n// https://github.com/benjamn/wryware/issues/347\nmaybe(() => globalThis) ||\n // Fall back to global, which works in Node.js and may be converted by some\n // bundlers to the appropriate identifier (window, self, ...) depending on the\n // bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224\n maybe(() => global) ||\n // Otherwise, use a dummy host that's local to this module. We used to fall\n // back to using the Array constructor as a namespace, but that was flagged in\n // https://github.com/benjamn/wryware/issues/347, and can be avoided.\n Object.create(null);\n// Whichever globalHost we're using, make TypeScript happy about the additional\n// globalKey property.\nconst globalHost = host;\nexport const Slot = globalHost[globalKey] ||\n // Earlier versions of this package stored the globalKey property on the Array\n // constructor, so we check there as well, to prevent Slot class duplication.\n Array[globalKey] ||\n (function (Slot) {\n try {\n Object.defineProperty(globalHost, globalKey, {\n value: Slot,\n enumerable: false,\n writable: false,\n // When it was possible for globalHost to be the Array constructor (a\n // legacy Slot dedup strategy), it was important for the property to be\n // configurable:true so it could be deleted. That does not seem to be as\n // important when globalHost is the global object, but I don't want to\n // cause similar problems again, and configurable:true seems safest.\n // https://github.com/endojs/endo/issues/576#issuecomment-1178274008\n configurable: true\n });\n }\n finally {\n return Slot;\n }\n })(makeSlotClass());\n//# sourceMappingURL=slot.js.map","import { Slot } from \"./slot.js\";\nexport { Slot };\nexport const { bind, noContext } = Slot;\n// Like global.setTimeout, except the callback runs with captured context.\nexport { setTimeoutWithContext as setTimeout };\nfunction setTimeoutWithContext(callback, delay) {\n return setTimeout(bind(callback), delay);\n}\n// Turn any generator function into an async function (using yield instead\n// of await), with context automatically preserved across yields.\nexport function asyncFromGen(genFn) {\n return function () {\n const gen = genFn.apply(this, arguments);\n const boundNext = bind(gen.next);\n const boundThrow = bind(gen.throw);\n return new Promise((resolve, reject) => {\n function invoke(method, argument) {\n try {\n var result = method.call(gen, argument);\n }\n catch (error) {\n return reject(error);\n }\n const next = result.done ? resolve : invokeNext;\n if (isPromiseLike(result.value)) {\n result.value.then(next, result.done ? reject : invokeThrow);\n }\n else {\n next(result.value);\n }\n }\n const invokeNext = (value) => invoke(boundNext, value);\n const invokeThrow = (error) => invoke(boundThrow, error);\n invokeNext();\n });\n };\n}\nfunction isPromiseLike(value) {\n return value && typeof value.then === \"function\";\n}\n// If you use the fibers npm package to implement coroutines in Node.js,\n// you should call this function at least once to ensure context management\n// remains coherent across any yields.\nconst wrappedFibers = [];\nexport function wrapYieldingFiberMethods(Fiber) {\n // There can be only one implementation of Fiber per process, so this array\n // should never grow longer than one element.\n if (wrappedFibers.indexOf(Fiber) < 0) {\n const wrap = (obj, method) => {\n const fn = obj[method];\n obj[method] = function () {\n return noContext(fn, arguments, this);\n };\n };\n // These methods can yield, according to\n // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100\n wrap(Fiber, \"yield\");\n wrap(Fiber.prototype, \"run\");\n wrap(Fiber.prototype, \"throwInto\");\n wrappedFibers.push(Fiber);\n }\n return Fiber;\n}\n//# sourceMappingURL=index.js.map","function defaultDispose() { }\nexport class StrongCache {\n constructor(max = Infinity, dispose = defaultDispose) {\n this.max = max;\n this.dispose = dispose;\n this.map = new Map();\n this.newest = null;\n this.oldest = null;\n }\n has(key) {\n return this.map.has(key);\n }\n get(key) {\n const node = this.getNode(key);\n return node && node.value;\n }\n get size() {\n return this.map.size;\n }\n getNode(key) {\n const node = this.map.get(key);\n if (node && node !== this.newest) {\n const { older, newer } = node;\n if (newer) {\n newer.older = older;\n }\n if (older) {\n older.newer = newer;\n }\n node.older = this.newest;\n node.older.newer = node;\n node.newer = null;\n this.newest = node;\n if (node === this.oldest) {\n this.oldest = newer;\n }\n }\n return node;\n }\n set(key, value) {\n let node = this.getNode(key);\n if (node) {\n return node.value = value;\n }\n node = {\n key,\n value,\n newer: null,\n older: this.newest\n };\n if (this.newest) {\n this.newest.newer = node;\n }\n this.newest = node;\n this.oldest = this.oldest || node;\n this.map.set(key, node);\n return node.value;\n }\n clean() {\n while (this.oldest && this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n delete(key) {\n const node = this.map.get(key);\n if (node) {\n if (node === this.newest) {\n this.newest = node.older;\n }\n if (node === this.oldest) {\n this.oldest = node.newer;\n }\n if (node.newer) {\n node.newer.older = node.older;\n }\n if (node.older) {\n node.older.newer = node.newer;\n }\n this.map.delete(key);\n this.dispose(node.value, key);\n return true;\n }\n return false;\n }\n}\n//# sourceMappingURL=strong.js.map"],"names":["noop","defaultDispose","_WeakRef","WeakRef","value","deref","_WeakMap","WeakMap","Map","_FinalizationRegistry","FinalizationRegistry","register","unregister","finalizationBatchSize","WeakCache","constructor","max","Infinity","dispose","this","map","newest","oldest","unfinalizedNodes","Set","finalizationScheduled","size","finalize","iterator","values","i","node","next","delete","key","keyRef","registry","queueMicrotask","deleteNode","bind","has","get","getNode","older","newer","set","scheduleFinalization","clean","add","defaultMakeData","Object","create","forEach","slice","Array","prototype","hasOwnProperty","Trie","weakness","makeData","lookup","lookupArray","arguments","array","call","getChildTrie","data","peek","peekArray","len","length","mapFor","remove","removeArray","head","child","weak","strong","isObjRef","toString","fnToStr","Function","previousComparisons","equal","a","b","check","clear","aTag","bTag","previouslyCompared","aKeys","definedKeys","bKeys","keyCount","k","name","message","aIterator","entries","isMap","info","done","aKey","aValue","Uint8Array","byteLength","aCode","endsWith","nativeCodeSuffix","obj","keys","filter","isDefinedKey","full","suffix","fromIndex","indexOf","bSet","currentContext","MISSING_VALUE","idCounter","makeSlotClass","id","Date","now","Math","random","join","hasValue","context","parent","slots","getValue","withValue","callback","args","thisArg","__proto__","apply","saved","noContext","maybe","fn","ignored","globalKey","host","globalThis","global","globalHost","Slot","defineProperty","enumerable","writable","configurable","StrongCache"],"sourceRoot":""}