@velarscript-labs/sqlite 0.3.3 → 0.3.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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../velar-standard:velar/text","../velar-standard:velar/compiler-runtime-reactive-v1","../velar-standard:velar/compiler-runtime-primitives-v1","../velar-standard:velar/compiler-runtime-class-fields-v1","../velar-standard:velar/compiler-runtime-narrowing-v1","../velar-standard:velar/compiler-runtime-promises-v1","../velar-standard:velar/compiler-runtime-errors-v1","../velar-standard:velar/compiler-runtime-types-v1","../velar-standard:velar/compiler-runtime-collections-v1","../velar-standard:velar/compiler-runtime-collection-lowering-v1","../src/index.vel","../src/index.vel"],"sourcesContent":["const __velarMaxTextCodeUnits = 16 * 1024 * 1024;\nconst __velarMaxTextItems = 1000000;\nconst __velarTextNativeArray = globalThis.Array;\nconst __velarTextNativeString = globalThis.String;\nconst __velarTextNativeNumber = globalThis.Number;\nconst __velarTextNativeMath = globalThis.Math;\nconst __velarTextNativeObject = globalThis.Object;\nconst __velarTextNativeMap = globalThis.Map;\nconst __velarTextNativeTypeError = globalThis.TypeError;\nconst __velarTextNativeRangeError = globalThis.RangeError;\nconst __velarTextGetOwnPropertyDescriptor = __velarTextNativeObject.getOwnPropertyDescriptor;\nconst __velarTextRuntimeGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextReflectApply = __velarTextGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTextStringPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"prototype\")?.value;\nconst __velarTextArrayIsArray = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"isArray\")?.value;\nconst __velarTextNumberIsSafeInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isSafeInteger\")?.value;\nconst __velarTextNumberIsInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isInteger\")?.value;\nconst __velarTextMathFloor = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"floor\")?.value;\nconst __velarTextMathMax = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"max\")?.value;\nconst __velarTextMathMin = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"min\")?.value;\nconst __velarNativeStringIndexOf = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"indexOf\")?.value;\nconst __velarNativeStringSlice = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"slice\")?.value;\nconst __velarNativeStringCharCodeAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"charCodeAt\")?.value;\nconst __velarNativeStringTrim = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trim\")?.value;\nconst __velarNativeStringUpper = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toUpperCase\")?.value;\nconst __velarNativeStringLower = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toLowerCase\")?.value;\nconst __velarNativeStringSplit = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"split\")?.value;\nconst __velarNativeStringReplaceAll = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"replaceAll\")?.value;\nconst __velarNativeStringRepeat = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"repeat\")?.value;\nconst __velarTextMapPrototype = typeof __velarTextNativeMap === \"function\" ? __velarTextGetOwnPropertyDescriptor(__velarTextNativeMap, \"prototype\")?.value : null;\nconst __velarTextMapGet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"get\")?.value : null;\nconst __velarTextMapSet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"set\")?.value : null;\nconst __velarTextMapClear = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"clear\")?.value : null;\nconst __velarTextSurrogatePattern = /[\\u{10000}-\\u{10FFFF}\\uD800-\\uDFFF]/u;\nconst __velarTextRegExpPrototype = typeof __velarTextRuntimeGetPrototypeOf === \"function\" ? __velarTextRuntimeGetPrototypeOf(__velarTextSurrogatePattern) : null;\nconst __velarTextSurrogateExec = __velarTextRegExpPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextRegExpPrototype, \"exec\")?.value : null;\nfunction __velarTextCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarTextReflectApply !== \"function\") throw new __velarTextNativeTypeError(\"The JavaScript text runtime is unavailable\");\n return __velarTextReflectApply(operation, receiver, arguments_);\n}\n\nfunction __velarTextValue(value) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"String methods require a string receiver\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"Strings cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextArgument(value, name) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(name + \" must be a string\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextOutput(value, name) {\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextCount(value, name) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > __velarMaxTextCodeUnits) {\n throw new __velarTextNativeRangeError(name + \" must be an integer from 0 through \" + __velarMaxTextCodeUnits);\n }\n return value;\n}\nfunction __velarTextList(values, name) {\n if (values.length > __velarMaxTextItems) throw new __velarTextNativeRangeError(name + \" cannot produce more than \" + __velarMaxTextItems + \" items\");\n return values;\n}\nfunction __velarTextNextCodePointOffset(value, offset) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n if (first < 0xD800 || first > 0xDBFF || offset + 1 >= value.length) return offset + 1;\n const second = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset + 1]);\n return second >= 0xDC00 && second <= 0xDFFF ? offset + 2 : offset + 1;\n}\n// D90 R7, performance half. Measuring a string used to be a whole-string job\n// every single time: the surrogate probe ran per call, and one astral character\n// anywhere forced every offset conversion to walk code points from zero, which\n// made a loop of char/slice calls quadratic: 20,000 char/slice calls over a\n// 200 KiB string with one leading astral character took 17.1 s, and 34 ms\n// once measurement was memoised. A measurement is a pure function of an\n// immutable value, so it is memoised: a dense string answers offset conversions in\n// O(1) when no surrogate pair splits it, and otherwise the checkpoint list\n// records the code-unit offset of every stride-th code point so a conversion\n// starts from the nearest checkpoint instead of from the start of the string.\n// The cache may only change the cost of an answer, never the answer.\nconst __velarTextCheckpointStride = 64;\nconst __velarTextMeasureMinimumUnits = 64;\n// The cache holds its keys strongly, so its budget is memory the program has\n// stopped using but cannot reclaim. Eight MiB buys the loops that matter and\n// bounds what a document-processing program leaves behind; a single string\n// larger than the budget still measures once and stays, because evicting the\n// string a loop is walking would put the cliff back. The entry count only\n// bounds the cache's own bookkeeping, so it is set well above the number of\n// strings a loop cycles through: a tighter count made a walk over 65 short\n// strings 15x slower than the same walk over 64.\nconst __velarTextMeasureCacheEntries = 512;\nconst __velarTextMeasureCacheUnits = 8 * 1024 * 1024;\nconst __velarTextMeasureCache = typeof __velarTextNativeMap === \"function\"\n && typeof __velarTextMapGet === \"function\" && typeof __velarTextMapSet === \"function\" && typeof __velarTextMapClear === \"function\"\n ? new __velarTextNativeMap() : null;\nlet __velarTextMeasureCacheCount = 0;\nlet __velarTextMeasureCacheHeld = 0;\nfunction __velarTextMeasureText(value) {\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [value]) === null) {\n return { length: value.length, dense: true, checkpoints: null };\n }\n const checkpoints = new __velarTextNativeArray();\n let length = 0, offset = 0;\n while (offset < value.length) {\n if (length % __velarTextCheckpointStride === 0) checkpoints[length / __velarTextCheckpointStride] = offset;\n offset = __velarTextNextCodePointOffset(value, offset);\n length += 1;\n }\n // A string that carries only unpaired surrogates still has one unit per code\n // point, so it keeps the O(1) path even though the probe matched.\n return { length: length, dense: length === value.length, checkpoints: checkpoints };\n}\nfunction __velarTextMeasure(value) {\n if (__velarTextMeasureCache === null || value.length < __velarTextMeasureMinimumUnits) return __velarTextMeasureText(value);\n const cached = __velarTextCall(__velarTextMapGet, __velarTextMeasureCache, [value]);\n if (cached !== undefined) return cached;\n const measured = __velarTextMeasureText(value);\n if (__velarTextMeasureCacheCount >= __velarTextMeasureCacheEntries\n || (__velarTextMeasureCacheCount > 0 && __velarTextMeasureCacheHeld + value.length > __velarTextMeasureCacheUnits)) {\n __velarTextCall(__velarTextMapClear, __velarTextMeasureCache, []);\n __velarTextMeasureCacheCount = 0;\n __velarTextMeasureCacheHeld = 0;\n }\n __velarTextCall(__velarTextMapSet, __velarTextMeasureCache, [value, measured]);\n __velarTextMeasureCacheCount += 1;\n __velarTextMeasureCacheHeld += value.length;\n return measured;\n}\nfunction __velarTextCodePointLength(value) {\n return __velarTextMeasure(value).length;\n}\nfunction __velarTextCodePointPrefix(value, count) { return __velarTextCall(__velarNativeStringSlice, value, [0, __velarTextCodeUnitOffset(value, count)]); }\nfunction __velarTextCodeUnitOffset(value, position) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return position < value.length ? position : value.length;\n if (position <= 0) return 0;\n const checkpoints = measured.checkpoints;\n let block = __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [position / __velarTextCheckpointStride]);\n if (block >= checkpoints.length) block = checkpoints.length - 1;\n let offset = checkpoints[block], current = block * __velarTextCheckpointStride;\n while (offset < value.length && current < position) { offset = __velarTextNextCodePointOffset(value, offset); current += 1; }\n return offset;\n}\nfunction __velarTextCodePointIndex(value, unitOffset) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return unitOffset <= value.length ? unitOffset : null;\n if (unitOffset < 0 || unitOffset > value.length) return null;\n const checkpoints = measured.checkpoints;\n let low = 0, high = checkpoints.length - 1;\n while (low < high) {\n const middle = low + __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(high - low + 1) / 2]);\n if (checkpoints[middle] <= unitOffset) low = middle; else high = middle - 1;\n }\n let offset = checkpoints[low], position = low * __velarTextCheckpointStride;\n while (offset < unitOffset && offset < value.length) { offset = __velarTextNextCodePointOffset(value, offset); position += 1; }\n return offset === unitOffset ? position : null;\n}\nfunction __velarTextCodePointDistance(value, start, end) {\n if (__velarTextMeasure(value).dense) return end >= start ? end - start : null;\n let offset = start, distance = 0;\n while (offset < end) { offset = __velarTextNextCodePointOffset(value, offset); distance += 1; }\n return offset === end ? distance : null;\n}\n// D90 R7: a code-unit offset sits between two code points unless it splits a\n// surrogate pair, and only an adjacent lead/trail pair can be split. The test\n// is O(1), so every search below can reject a mid-pair hit without measuring\n// the string.\nfunction __velarTextIsBoundary(value, offset) {\n if (offset <= 0 || offset >= value.length) return true;\n const lead = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset - 1]);\n if (lead < 0xD800 || lead > 0xDBFF) return true;\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n return trail < 0xDC00 || trail > 0xDFFF;\n}\n// D90 R7, performance half. A match can only start inside a pair when the\n// needle starts with a trail surrogate, and can only end inside one when the\n// needle ends with a lead surrogate: the unit the gate reads at each end of a\n// match is the needle's own edge unit. Both are properties of the needle\n// alone, so one O(1) look says whether the native scan already answers what\n// the bounded scan answers, and an ordinary needle keeps native speed on any\n// haystack. The needle must not be empty; each caller handles that case.\nfunction __velarTextNeedsBoundaryCheck(search) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, search, [0]);\n if (first >= 0xDC00 && first <= 0xDFFF) return true;\n const last = __velarTextCall(__velarNativeStringCharCodeAt, search, [search.length - 1]);\n return last >= 0xD800 && last <= 0xDBFF;\n}\n// Every search operation goes through here so that a match is accepted only\n// when it starts and ends on a code-point boundary. A needle that begins or\n// ends with an unpaired surrogate therefore never matches inside a pair, which\n// is what keeps split/replace/replaceAll from manufacturing lone surrogates.\n// The needle must not be empty; each caller handles that case in its own voice.\nfunction __velarTextBoundedIndexOf(value, search, cursor) {\n if (!__velarTextNeedsBoundaryCheck(search)) return __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n while (cursor <= value.length) {\n const found = __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n if (found < 0) return -1;\n if (__velarTextIsBoundary(value, found) && __velarTextIsBoundary(value, found + search.length)) return found;\n cursor = found + 1;\n }\n return -1;\n}\nfunction __velarTextReplacementOutputUnits(value, search, replacement, all) {\n let matches = 0;\n if (search === \"\") matches = all ? __velarTextCodePointLength(value) + 1 : 1;\n else {\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, search, cursor);\n if (index < 0) break;\n matches += 1;\n if (!all) break;\n cursor = index + search.length;\n }\n }\n if (replacement.length <= search.length || matches === 0) return value.length;\n const growth = replacement.length - search.length;\n if (matches > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(__velarMaxTextCodeUnits - value.length) / growth])) return __velarMaxTextCodeUnits + 1;\n return value.length + matches * growth;\n}\n\n// TXT-D1: ordered string comparison uses code-point order (= UTF-8 binary\n// order). UTF-16 code-unit order already agrees when neither operand\n// contains a surrogate, so the native probe keeps the decoded walk on\n// surrogate-bearing strings only.\nfunction __velarStringCompare(left, right) {\n left = __velarTextValue(left);\n right = __velarTextValue(right);\n if (left === right) return 0;\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [left]) === null\n && __velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [right]) === null) {\n return left < right ? -1 : 1;\n }\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset]);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset]);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\n// D41 item 61: two 'Comparable'-bounded values hold numbers or strings, and\n// which one is known only at runtime. A string pair keeps code-point order\n// (TXT-D1); everything else uses the plain relational order, exactly as a\n// monomorphic comparison of that category would.\n// D90 R6: one NaN policy. A NaN may be held and tested with .isNaN(), but an\n// operation that orders it raises instead of answering. Without this the\n// \"neither less nor greater\" arm returned 0, which made NaN compare both <=\n// and >= as true at a generic site while the same source on a plain number\n// answered false, and produced genuinely mis-sorted output.\nfunction __velarOrderCompare(left, right) {\n if (typeof left === \"string\" && typeof right === \"string\") return __velarStringCompare(left, right);\n if (left !== left || right !== right) throw new __velarTextNativeTypeError(\"ordered comparison found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\");\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarStringSize(value) { return __velarTextCodePointLength(__velarTextValue(value)); }\nfunction __velarStringTrim(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []); }\nfunction __velarStringIsBlank(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []) === \"\"; }\nfunction __velarStringUpper(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringUpper, __velarTextValue(value), []), \"String.upper\"); }\nfunction __velarStringLower(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringLower, __velarTextValue(value), []), \"String.lower\"); }\nfunction __velarStringSlice(value, start = 0, end = null) {\n value = __velarTextValue(value);\n const total = __velarTextCodePointLength(value);\n if (end === null) end = total;\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start]) || !__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [end])) throw new __velarTextNativeTypeError(\"String.slice positions must be integers\");\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const last = end < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + end, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [end, total]);\n return __velarTextCall(__velarNativeStringSlice, value, [__velarTextCodeUnitOffset(value, first), __velarTextCodeUnitOffset(value, last)]);\n}\nfunction __velarStringChar(value, index) {\n value = __velarTextValue(value);\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [index])) throw new __velarTextNativeTypeError(\"String.char index must be an integer\");\n const total = __velarTextCodePointLength(value);\n if (index < 0) index += total;\n if (index < 0) return null;\n if (index >= total) return null;\n const start = __velarTextCodeUnitOffset(value, index);\n return __velarTextCall(__velarNativeStringSlice, value, [start, __velarTextNextCodePointOffset(value, start)]);\n}\nfunction __velarStringHas(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.has text\");\n return text === \"\" || __velarTextBoundedIndexOf(value, text, 0) >= 0;\n}\nfunction __velarStringIndex(value, text, start = 0) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.index text\");\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start])) throw new __velarTextNativeTypeError(\"String.index start must be an integer\");\n const total = __velarTextCodePointLength(value);\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const cursor = __velarTextCodeUnitOffset(value, first);\n if (text === \"\") return first;\n const found = __velarTextBoundedIndexOf(value, text, cursor);\n if (found < 0) return null;\n return __velarTextCodePointIndex(value, found);\n}\nfunction __velarStringCount(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.count text\");\n if (text === \"\") return __velarTextCodePointLength(value) + 1;\n let count = 0;\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, text, cursor);\n if (index < 0) return count;\n count += 1;\n cursor = index + text.length;\n }\n}\nfunction __velarStringStartsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.startsWith text\");\n return __velarTextCall(__velarNativeStringIndexOf, value, [text, 0]) === 0 && __velarTextIsBoundary(value, text.length);\n}\nfunction __velarStringEndsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.endsWith text\");\n const start = value.length - text.length;\n return start >= 0 && __velarTextIsBoundary(value, start) && __velarTextCall(__velarNativeStringIndexOf, value, [text, start]) === start;\n}\nfunction __velarStringSplit(value, separator) {\n value = __velarTextValue(value); separator = __velarTextArgument(separator, \"String.split separator\");\n if (separator === \"\") {\n const count = __velarTextCodePointLength(value);\n if (count > __velarMaxTextItems) throw new __velarTextNativeRangeError(\"String.split cannot produce more than \" + __velarMaxTextItems + \" items\");\n const output = new __velarTextNativeArray(count);\n let offset = 0;\n for (let index = 0; index < count; index += 1) {\n const next = __velarTextNextCodePointOffset(value, offset);\n output[index] = __velarTextCall(__velarNativeStringSlice, value, [offset, next]);\n offset = next;\n }\n return output;\n }\n // The native split matches UTF-16 code units, so it would cut a surrogate\n // pair in half on a separator that begins or ends with an unpaired\n // surrogate. Every other separator makes the two scans agree match for\n // match, and the native one is the faster: its limit argument also stops it\n // before it can build an oversize array.\n if (!__velarTextNeedsBoundaryCheck(separator)) {\n return __velarTextList(__velarTextCall(__velarNativeStringSplit, value, [separator, __velarMaxTextItems + 1]), \"String.split\");\n }\n // Searching on code-point boundaries keeps every piece well formed; the\n // pieces themselves are still plain slices of the input.\n const parts = new __velarTextNativeArray();\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, separator, cursor);\n if (found < 0) break;\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor, found]);\n if (parts.length > __velarMaxTextItems) return __velarTextList(parts, \"String.split\");\n cursor = found + separator.length;\n }\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n return __velarTextList(parts, \"String.split\");\n}\nfunction __velarStringReplace(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replace from\"); to = __velarTextArgument(to, \"String.replace to\");\n if (__velarTextReplacementOutputUnits(value, from, to, false) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replace output cannot exceed 16 MiB\");\n if (from === \"\") return to + value;\n const found = __velarTextBoundedIndexOf(value, from, 0);\n if (found < 0) return value;\n return __velarTextCall(__velarNativeStringSlice, value, [0, found]) + to + __velarTextCall(__velarNativeStringSlice, value, [found + from.length]);\n}\nfunction __velarStringReplaceAll(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replaceAll from\"); to = __velarTextArgument(to, \"String.replaceAll to\");\n if (__velarTextReplacementOutputUnits(value, from, to, true) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replaceAll output cannot exceed 16 MiB\");\n if (from === \"\") {\n let output = to;\n let offset = 0;\n while (offset < value.length) { const next = __velarTextNextCodePointOffset(value, offset); output += __velarTextCall(__velarNativeStringSlice, value, [offset, next]) + to; offset = next; }\n return output;\n }\n // A separator that cannot split a pair leaves nothing for the bounded walk\n // to reject, so the native rewrite answers the same string faster. The\n // replacement is passed as a function so that a '$' in it stays literal.\n if (!__velarTextNeedsBoundaryCheck(from)) return __velarTextCall(__velarNativeStringReplaceAll, value, [from, () => to]);\n let output = \"\";\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, from, cursor);\n if (found < 0) break;\n output += __velarTextCall(__velarNativeStringSlice, value, [cursor, found]) + to;\n cursor = found + from.length;\n }\n return output + __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n}\nfunction __velarStringPad(value, size, fill, start) {\n const name = start ? \"String.padStart\" : \"String.padEnd\";\n value = __velarTextValue(value); size = __velarTextCount(size, name + \" size\"); fill = __velarTextArgument(fill, name + \" fill\");\n const needed = size - __velarTextCodePointLength(value);\n if (needed <= 0 || fill.length === 0) return value;\n let outputUnits = value.length;\n let padding = \"\";\n let counted = 0, fillOffset = 0;\n while (counted < needed) {\n const next = __velarTextNextCodePointOffset(fill, fillOffset);\n const character = __velarTextCall(__velarNativeStringSlice, fill, [fillOffset, next]);\n outputUnits += character.length;\n if (outputUnits > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n padding += character;\n counted += 1;\n fillOffset = next === fill.length ? 0 : next;\n }\n return start ? padding + value : value + padding;\n}\nfunction __velarStringPadStart(value, size, fill = \" \") { return __velarStringPad(value, size, fill, true); }\nfunction __velarStringPadEnd(value, size, fill = \" \") { return __velarStringPad(value, size, fill, false); }\nfunction __velarStringRepeat(value, count) {\n value = __velarTextValue(value); count = __velarTextCount(count, \"String.repeat count\");\n if (value.length > 0 && count > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [__velarMaxTextCodeUnits / value.length])) throw new __velarTextNativeRangeError(\"String.repeat output cannot exceed 16 MiB\");\n return __velarTextCall(__velarNativeStringRepeat, value, [count]);\n}\n\nconst __velarUtf8CharCodeAt = Object.getOwnPropertyDescriptor(String.prototype, \"charCodeAt\")?.value;\nconst __velarUtf8ReflectApply = Object.getOwnPropertyDescriptor(Reflect, \"apply\")?.value;\nfunction __velarUtf8ByteLength(value) {\n if (typeof value !== \"string\") throw new TypeError(\"UTF-8 byte length requires text\");\n if (typeof __velarUtf8CharCodeAt !== \"function\" || typeof __velarUtf8ReflectApply !== \"function\") {\n throw new TypeError(\"The host UTF-8 sizing intrinsics are unavailable\");\n }\n let bytes = 0;\n for (let index = 0; index < value.length; index += 1) {\n const unit = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index]);\n if (unit <= 0x7F) bytes += 1;\n else if (unit <= 0x7FF) bytes += 2;\n else if (unit >= 0xD800 && unit <= 0xDBFF && index + 1 < value.length) {\n const next = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index + 1]);\n if (next >= 0xDC00 && next <= 0xDFFF) { bytes += 4; index += 1; }\n else bytes += 3;\n } else bytes += 3;\n }\n return bytes;\n}\nfunction __velarDeclaredLength(value) {\n if (typeof value !== \"string\" || value.length === 0) return null;\n if (typeof __velarUtf8CharCodeAt !== \"function\" || typeof __velarUtf8ReflectApply !== \"function\") {\n throw new TypeError(\"The host transport sizing intrinsics are unavailable\");\n }\n let length = 0;\n for (let index = 0; index < value.length; index += 1) {\n const unit = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index]);\n if (unit < 48 || unit > 57) return null;\n if (length > 900719925474099) return 1 / 0;\n length = length * 10 + unit - 48;\n if (length > 9007199254740991) return 1 / 0;\n }\n return length;\n}\n\nconst maxTextCodeUnits = __velarMaxTextCodeUnits;\nconst maxTextItems = __velarMaxTextItems;\nconst maxTextPatternMillis = 250;\nconst __velarTextGetOwnPropertyNames = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarTextGetOwnPropertySymbols = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarTextGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextObjectPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"prototype\")?.value;\nconst __velarTextObjectCreate = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"create\")?.value;\nconst __velarTextObjectFreeze = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"freeze\")?.value;\nconst __velarTextArrayPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"prototype\")?.value;\nconst __velarTextArrayJoin = __velarTextGetOwnPropertyDescriptor(__velarTextArrayPrototype, \"join\")?.value;\nconst __velarTextStringTrimStart = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trimStart\")?.value;\nconst __velarTextStringTrimEnd = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trimEnd\")?.value;\nconst __velarTextStringNormalize = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"normalize\")?.value;\nconst __velarTextNativeDate = globalThis.Date;\nconst __velarTextDateNow = __velarTextGetOwnPropertyDescriptor(__velarTextNativeDate, \"now\")?.value;\nconst nativeRegExpPrototype = __velarTextGetPrototypeOf(/(?:)/u);\nconst NativeRegExp = __velarTextGetOwnPropertyDescriptor(nativeRegExpPrototype, \"constructor\")?.value;\nconst nativeRegExpExec = __velarTextGetOwnPropertyDescriptor(nativeRegExpPrototype, \"exec\")?.value;\nconst nativeStringReplaceAll = __velarNativeStringReplaceAll;\nconst __velarTextStringCodePointAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"codePointAt\")?.value;\nconst __velarTextStringFromCodePoint = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"fromCodePoint\")?.value;\nconst __velarTextTitleSeparators = /[_\\-/]+/gu;\nconst __velarTextTitleWords = /(^|\\s)([\\p{L}\\p{N}])/gu;\n// A line ends at CRLF, at a lone CR, or at LF — the same three the language\n// itself accepts as a statement separator and the same three\n// SourceText indexes for diagnostics. A text API that disagreed with its\n// own language would make Text.lineStarts on Vel source compute line\n// numbers the compiler does not report.\nconst __velarTextLines = /\\r\\n|[\\r\\n]/gu;\nconst __velarTextWords = /\\s+/gu;\nconst __velarTextLatinMarks = /(?<=\\p{Script=Latin})\\p{M}+/gu;\nconst __velarTextBaselessMarks = /(?<![\\p{L}\\p{N}\\p{M}])\\p{M}+/gu;\nconst __velarTextSlugSeparators = /[^\\p{L}\\p{N}\\p{M}]+/gu;\nconst __velarTextSlugEdges = /^-+|-+$/gu;\nconst __velarTextWhitespace = /\\s+/gu;\nconst __velarTextPatternPrefix = /^Invalid regular expression: (?:\\/[\\s\\S]*\\/[a-z]*: )?/u;\nfunction __velarTextAppend(values, value) { values[values.length] = value; }\nfunction __velarTextJoin(values, separator) { return __velarTextCall(__velarTextArrayJoin, values, [separator]); }\n// TXT-P2: bounded work is already the promise on this surface — the code-unit\n// and item caps are here — and time was the dimension that was missed, so a\n// backtracking pattern over hostile input could run for as long as it liked.\n// Every operation that runs a pattern the author supplied gets a fresh budget,\n// checked at every exec boundary. The engine is not interruptible, so one\n// catastrophic exec is caught when it returns rather than pre-empted; that\n// still turns a silent unbounded hang into a loud bounded failure and stops\n// the amplification a per-match loop would otherwise give it. The budget is\n// deliberately not charged to slug, title or normalizeWhitespace: they run\n// this module's own linear patterns, so their only bound is on size, and a\n// wall clock would otherwise make a large but legal text succeed or fail by\n// how busy the machine is.\nfunction patternDeadline() { return __velarTextCall(__velarTextDateNow, __velarTextNativeDate, []) + maxTextPatternMillis; }\nfunction checkPatternDeadline(deadline) {\n if (__velarTextCall(__velarTextDateNow, __velarTextNativeDate, []) > deadline) throw new __velarTextNativeRangeError(\"text pattern matching cannot exceed \" + maxTextPatternMillis + \" ms\");\n}\nfunction __velarTextRegexReplace(value, pattern, replacement) {\n pattern.lastIndex = 0;\n const output = []; let end = 0, units = 0;\n while (true) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n if (raw === null) break;\n const match = checkedMatchValue(raw, value);\n const before = __velarTextCall(__velarNativeStringSlice, value, [end, match.unitIndex]);\n const next = typeof replacement === \"function\" ? replacement(match) : replacement;\n if (typeof next !== \"string\") throw new __velarTextNativeTypeError(\"Text replacement must produce a string\");\n units += before.length + next.length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text replacement output cannot exceed 16 MiB\");\n __velarTextAppend(output, before); __velarTextAppend(output, next);\n end = match.unitIndex + match.value.length;\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n const tail = __velarTextCall(__velarNativeStringSlice, value, [end]);\n if (units + tail.length > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text replacement output cannot exceed 16 MiB\");\n __velarTextAppend(output, tail); pattern.lastIndex = 0;\n return __velarTextJoin(output, \"\");\n}\nfunction __velarTextRegexSplit(value, pattern, limit) {\n pattern.lastIndex = 0;\n const output = []; let end = 0;\n while (output.length + 1 < limit) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n if (raw === null) break;\n const match = checkedMatchValue(raw, value);\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end, match.unitIndex]));\n end = match.unitIndex + match.value.length;\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n if (output.length < limit) __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end]));\n pattern.lastIndex = 0;\n return output;\n}\nfunction valueOf(value) { return __velarTextArgument(value, \"velar/text value\"); }\nfunction textOutput(value, name) { return __velarTextOutput(value, name); }\nfunction textCount(value, name) { return __velarTextCount(value, name); }\nfunction textList(values, name) { return __velarTextList(values, name); }\nfunction htmlOutputUnits(value) {\n let units = value.length;\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index];\n if (character === \"&\" || character === \"'\") units += 4;\n else if (character === \"<\" || character === \">\") units += 3;\n else if (character === '\"') units += 5;\n if (units > maxTextCodeUnits) return units;\n }\n return units;\n}\nconst codePointLength = __velarTextCodePointLength;\nconst codePointPrefix = __velarTextCodePointPrefix;\nfunction patternOptions(value) {\n if (value == null) return {};\n const prototype = typeof value === \"object\" && value !== null ? __velarTextGetPrototypeOf(value) : undefined;\n if (typeof value !== \"object\" || value === null || __velarTextCall(__velarTextArrayIsArray, __velarTextNativeArray, [value]) || (prototype !== __velarTextObjectPrototype && prototype !== null)) throw new __velarTextNativeTypeError(\"text pattern options must be a record\");\n if (__velarTextGetOwnPropertySymbols(value).length > 0) throw new __velarTextNativeTypeError(\"text pattern options cannot contain symbol fields\");\n const output = __velarTextCall(__velarTextObjectCreate, __velarTextNativeObject, [null]);\n const names = __velarTextGetOwnPropertyNames(value);\n for (let index = 0; index < names.length; index += 1) {\n const name = names[index];\n const descriptor = __velarTextGetOwnPropertyDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) throw new __velarTextNativeTypeError(\"Text pattern option '\" + name + \"' must be an enumerable data field\");\n if (name !== \"ignoreCase\" && name !== \"multiline\" && name !== \"dotAll\") throw new __velarTextNativeTypeError(\"Unknown text pattern option '\" + name + \"'\");\n const option = descriptor.value;\n if (option != null && typeof option !== \"boolean\") throw new __velarTextNativeTypeError(\"Text pattern option '\" + name + \"' must be bool\");\n output[name] = option;\n }\n return output;\n}\n// TXT-P1: the engine's reason is the only actionable half of an invalid-pattern\n// failure. Patterns compile in 'u' mode, so an identity escape that is tolerated\n// everywhere else in JavaScript is an error here, and \"[a-z\" and \"\\\\@\" are\n// otherwise byte-identical failures. The host-shaped prefix is stripped so the\n// engine's own text does not travel verbatim, and a caught value that is not an\n// Error, or carries no usable message, falls back to the bare message.\nfunction patternReason(error) {\n if (typeof error !== \"object\" || error === null) return \"\";\n const descriptor = __velarTextGetOwnPropertyDescriptor(error, \"message\");\n if (!descriptor || !(\"value\" in descriptor) || typeof descriptor.value !== \"string\") return \"\";\n const message = descriptor.value;\n const prefix = __velarTextCall(nativeRegExpExec, __velarTextPatternPrefix, [message]);\n const head = prefix === null ? null : __velarTextGetOwnPropertyDescriptor(prefix, 0);\n const reason = head && typeof head.value === \"string\" ? __velarTextCall(__velarNativeStringSlice, message, [head.value.length]) : message;\n return reason === \"\" || reason.length > 200 ? \"\" : \": \" + reason;\n}\nfunction patternOf(expression, options, global = false) {\n expression = valueOf(expression); options = patternOptions(options);\n if (expression.length > 4096) throw new __velarTextNativeRangeError(\"text patterns cannot exceed 4096 code units\");\n let flags = \"u\";\n if (global) flags += \"g\";\n if (options.ignoreCase === true) flags += \"i\";\n if (options.multiline === true) flags += \"m\";\n if (options.dotAll === true) flags += \"s\";\n try { return new NativeRegExp(expression, flags); }\n catch (error) { throw new __velarTextNativeTypeError(\"Invalid text pattern\" + patternReason(error)); }\n}\nfunction checkedMatchValue(match, input) {\n if (!__velarTextCall(__velarTextArrayIsArray, __velarTextNativeArray, [match]) || match.length < 1 || match.length > 4097) throw new __velarTextNativeTypeError(\"The regular expression engine returned an invalid match\");\n const groups = new __velarTextNativeArray(match.length - 1);\n for (let index = 0; index < match.length; index += 1) {\n const descriptor = __velarTextGetOwnPropertyDescriptor(match, index);\n if (!descriptor || !(\"value\" in descriptor)) throw new __velarTextNativeTypeError(\"Regular expression matches must contain data values\");\n const value = descriptor.value;\n if (value !== undefined && typeof value !== \"string\") throw new __velarTextNativeTypeError(\"Regular expression match values must be strings\");\n if (index === 0) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"A regular expression match requires full text\");\n } else groups[index - 1] = value === undefined ? null : value;\n }\n const indexDescriptor = __velarTextGetOwnPropertyDescriptor(match, \"index\");\n if (!indexDescriptor || !(\"value\" in indexDescriptor) || !__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [indexDescriptor.value]) || indexDescriptor.value < 0 || indexDescriptor.value > input.length) throw new __velarTextNativeTypeError(\"A regular expression match requires a valid index\");\n return { value: __velarTextGetOwnPropertyDescriptor(match, 0).value, groups, unitIndex: indexDescriptor.value };\n}\nfunction publicMatchValue(checked, input, index = null) {\n if (index === null) index = __velarTextCodePointIndex(input, checked.unitIndex);\n if (index === null) throw new __velarTextNativeTypeError(\"A regular expression match must begin at a Unicode code-point boundary\");\n return __velarTextCall(__velarTextObjectFreeze, __velarTextNativeObject, [{ value: checked.value, index, groups: checked.groups }]);\n}\nfunction nextTextIndex(value, index) {\n return index >= value.length ? index + 1 : __velarTextNextCodePointOffset(value, index);\n}\nfunction eachMatch(value, pattern, visit) {\n const deadline = patternDeadline();\n let count = 0, units = 0, previousUnitIndex = 0, previousCodePointIndex = 0;\n while (true) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n checkPatternDeadline(deadline);\n if (raw === null) return;\n if (count >= maxTextItems) throw new __velarTextNativeRangeError(\"Text patterns cannot produce more than \" + maxTextItems + \" matches\");\n count += 1;\n const checked = checkedMatchValue(raw, value);\n const distance = __velarTextCodePointDistance(value, previousUnitIndex, checked.unitIndex);\n if (distance === null) throw new __velarTextNativeTypeError(\"A regular expression match must begin at a Unicode code-point boundary\");\n const match = publicMatchValue(checked, value, previousCodePointIndex + distance);\n previousUnitIndex = checked.unitIndex;\n previousCodePointIndex = match.index;\n units += match.value.length;\n for (let index = 0; index < match.groups.length; index += 1) { const group = match.groups[index]; if (group !== null) units += group.length; }\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text pattern results cannot exceed 16 MiB\");\n visit(match, checked.unitIndex);\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n}\nexport function trimStart(value) { return __velarTextCall(__velarTextStringTrimStart, valueOf(value), []); }\nexport function trimEnd(value) { return __velarTextCall(__velarTextStringTrimEnd, valueOf(value), []); }\nexport function capitalize(value) { value = valueOf(value); if (!value) return \"\"; const end = __velarTextNextCodePointOffset(value, 0); const first = __velarTextCall(__velarNativeStringSlice, value, [0, end]); const tail = __velarTextCall(__velarNativeStringSlice, value, [end]); return textOutput(__velarTextCall(__velarNativeStringUpper, first, []) + __velarTextCall(__velarNativeStringLower, tail, []), \"capitalize\"); }\nexport function title(value) { let output = __velarTextCall(__velarNativeStringLower, valueOf(value), []); output = __velarTextRegexReplace(output, __velarTextTitleSeparators, \" \"); output = __velarTextRegexReplace(output, __velarTextTitleWords, match => match.groups[0] + __velarTextCall(__velarNativeStringUpper, match.groups[1], [])); return textOutput(output, \"title\"); }\nexport function lines(value) { return textList(__velarTextRegexSplit(valueOf(value), __velarTextLines, maxTextItems + 1), \"lines\"); }\nexport function lineStarts(value) {\n value = valueOf(value);\n const output = [0];\n let unitOffset = 0, codePointOffset = 0;\n while (unitOffset < value.length) {\n const nextUnitOffset = __velarTextNextCodePointOffset(value, unitOffset);\n const code = __velarTextCall(__velarNativeStringCharCodeAt, value, [unitOffset]);\n // CRLF is one break, not two: consume the LF with the CR so the following\n // line starts once. A lone CR breaks as well — see __velarTextLines.\n if (code === 13 && __velarTextCall(__velarNativeStringCharCodeAt, value, [nextUnitOffset]) === 10) {\n __velarTextAppend(output, codePointOffset + 2);\n unitOffset = __velarTextNextCodePointOffset(value, nextUnitOffset);\n codePointOffset += 2;\n continue;\n }\n if (code === 10 || code === 13) __velarTextAppend(output, codePointOffset + 1);\n unitOffset = nextUnitOffset;\n codePointOffset += 1;\n }\n return textList(output, \"lineStarts\");\n}\nexport function chunks(value, size) {\n value = valueOf(value);\n size = textCount(size, \"chunks size\");\n if (size === 0) throw new __velarTextNativeRangeError(\"chunks size must be greater than zero\");\n if (value.length === 0) return [];\n const output = [];\n let start = 0, offset = 0, count = 0;\n while (offset < value.length) {\n offset = __velarTextNextCodePointOffset(value, offset);\n count += 1;\n if (count === size) {\n if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"chunks cannot produce more than \" + maxTextItems + \" items\");\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [start, offset]));\n start = offset;\n count = 0;\n }\n }\n if (start < value.length) {\n if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"chunks cannot produce more than \" + maxTextItems + \" items\");\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [start]));\n }\n return textList(output, \"chunks\");\n}\nexport function words(value) { const cleaned = __velarTextCall(__velarNativeStringTrim, valueOf(value), []); return cleaned ? textList(__velarTextRegexSplit(cleaned, __velarTextWords, maxTextItems + 1), \"words\") : []; }\n// TXT-U4: the NFKD pass is folding machinery, not a result. Text equality is\n// code-point-sequence identity, so a decomposed slug misses the text it renders\n// as — a Hangul syllable comes back as conjoining jamo and never matches the\n// title it was made from. The output is recomposed to NFC before it leaves.\n// Folding only reaches marks sitting on a Latin base, because dropping a mark\n// is meaning-preserving there and meaning-destroying everywhere else: every\n// other script keeps its marks, and those slugs are percent-encoded in a URL.\n// Marks the separator pass now has to keep must still have something to sit\n// on: a mark run with no letter or digit before it — a variation selector left\n// behind by a dropped emoji, a stray accent — is invisible in a URL, so two\n// slugs that read alike would name different pages. Those runs go.\nexport function slug(value) { let output = __velarTextCall(__velarTextStringNormalize, valueOf(value), [\"NFKD\"]); output = __velarTextRegexReplace(output, __velarTextLatinMarks, \"\"); output = __velarTextRegexReplace(output, __velarTextBaselessMarks, \"\"); output = __velarTextCall(__velarNativeStringLower, output, []); output = __velarTextCall(__velarNativeStringTrim, output, []); output = __velarTextRegexReplace(output, __velarTextSlugSeparators, \"-\"); output = __velarTextRegexReplace(output, __velarTextSlugEdges, \"\"); return textOutput(__velarTextCall(__velarTextStringNormalize, output, [\"NFC\"]), \"slug\"); }\n// TXT-U3: text equality is code-point-sequence identity, so \"café\" typed on a\n// keyboard (NFC) and the same name read back from a macOS filename (NFD) are\n// different values with different sizes. This is the boundary tool that makes\n// them one value; the four Unicode forms are the only accepted spellings.\nexport function normalize(value, form = \"NFC\") {\n value = valueOf(value);\n form = valueOf(form);\n if (form !== \"NFC\" && form !== \"NFD\" && form !== \"NFKC\" && form !== \"NFKD\") {\n throw new __velarTextNativeRangeError(\"normalize form must be NFC, NFD, NFKC, or NFKD\");\n }\n return textOutput(__velarTextCall(__velarTextStringNormalize, value, [form]), \"normalize\");\n}\nexport function truncate(value, length, suffix = \"…\") { value = valueOf(value); suffix = valueOf(suffix); length = textCount(length, \"truncate length\"); const valueLength = codePointLength(value); if (valueLength <= length) return value; const suffixLength = codePointLength(suffix); if (suffixLength >= length) return codePointPrefix(suffix, length); return codePointPrefix(value, length - suffixLength) + suffix; }\nexport function indent(value, prefix = \" \") {\n const rows = lines(valueOf(value)); prefix = valueOf(prefix);\n let units = __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [0, rows.length - 1]);\n const output = new __velarTextNativeArray(rows.length);\n for (let index = 0; index < rows.length; index += 1) {\n units += prefix.length + rows[index].length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"indent output cannot exceed 16 MiB\");\n output[index] = prefix + rows[index];\n }\n return __velarTextJoin(output, \"\\n\");\n}\nexport function dedent(value) { const rows = lines(valueOf(value)); let width = null; for (let index = 0; index < rows.length; index += 1) { const line = rows[index]; if (__velarTextCall(__velarNativeStringTrim, line, [])) { let current = 0; while (current < line.length && (line[current] === \" \" || line[current] === \"\\t\")) current += 1; width = width === null ? current : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [width, current]); } } const output = new __velarTextNativeArray(rows.length); for (let index = 0; index < rows.length; index += 1) output[index] = __velarTextCall(__velarNativeStringSlice, rows[index], [width ?? 0]); return __velarTextJoin(output, \"\\n\"); }\nexport function normalizeWhitespace(value) { return __velarTextRegexReplace(__velarTextCall(__velarNativeStringTrim, valueOf(value), []), __velarTextWhitespace, \" \"); }\nexport function utf8Size(value) { return __velarUtf8ByteLength(valueOf(value)); }\nexport function escapeHtml(value) {\n value = valueOf(value);\n if (htmlOutputUnits(value) > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"escapeHtml output cannot exceed 16 MiB\");\n const replacements = [[\"&\", \"&amp;\"], [\"<\", \"&lt;\"], [\">\", \"&gt;\"], ['\"', \"&quot;\"], [\"'\", \"&#39;\"]];\n for (let index = 0; index < replacements.length; index += 1) {\n const pair = replacements[index];\n value = __velarTextCall(nativeStringReplaceAll, value, [pair[0], pair[1]]);\n }\n return value;\n}\n// TXT-U4 (D50 rule 90 item 4): one character in, one code point out. Anything\n// that is not exactly one code point — empty text, several characters, or a\n// lone surrogate half — answers null rather than a partial reading, and the\n// inverse refuses to build a surrogate half that could never stand alone.\nexport function codePoint(value) {\n value = valueOf(value);\n if (value.length === 0 || __velarTextNextCodePointOffset(value, 0) !== value.length) return null;\n const point = __velarTextCall(__velarTextStringCodePointAt, value, [0]);\n if (typeof point !== \"number\" || point >= 0xD800 && point <= 0xDFFF) return null;\n return point;\n}\nexport function fromCodePoint(value) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > 0x10FFFF) {\n throw new __velarTextNativeRangeError(\"fromCodePoint requires a code point from 0 through 1114111\");\n }\n if (value >= 0xD800 && value <= 0xDFFF) throw new __velarTextNativeRangeError(\"fromCodePoint refuses surrogate halves; they are not characters on their own\");\n return __velarTextCall(__velarTextStringFromCodePoint, __velarTextNativeString, [value]);\n}\nexport function matches(value, expression, options = {}) { value = valueOf(value); const pattern = patternOf(expression, options); const deadline = patternDeadline(); const found = __velarTextCall(nativeRegExpExec, pattern, [value]) !== null; checkPatternDeadline(deadline); return found; }\nexport function findMatch(value, expression, options = {}) { value = valueOf(value); const pattern = patternOf(expression, options); const deadline = patternDeadline(); const match = __velarTextCall(nativeRegExpExec, pattern, [value]); checkPatternDeadline(deadline); return match === null ? null : publicMatchValue(checkedMatchValue(match, value), value); }\nexport function findMatches(value, expression, options = {}) { value = valueOf(value); const output = []; eachMatch(value, patternOf(expression, options, true), match => __velarTextAppend(output, match)); return output; }\nexport function replaceMatches(value, expression, replacement, options = {}) {\n value = valueOf(value); replacement = valueOf(replacement);\n const output = []; let end = 0, units = 0;\n eachMatch(value, patternOf(expression, options, true), (match, unitIndex) => {\n const before = __velarTextCall(__velarNativeStringSlice, value, [end, unitIndex]);\n units += before.length + replacement.length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"replaceMatches output cannot exceed 16 MiB\");\n __velarTextAppend(output, before); __velarTextAppend(output, replacement);\n end = unitIndex + match.value.length;\n });\n const tail = __velarTextCall(__velarNativeStringSlice, value, [end]);\n if (units + tail.length > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"replaceMatches output cannot exceed 16 MiB\");\n __velarTextAppend(output, tail);\n return __velarTextJoin(output, \"\");\n}\nexport function splitPattern(value, expression, options = {}) {\n value = valueOf(value); const output = []; let end = 0;\n eachMatch(value, patternOf(expression, options, true), (match, unitIndex) => { if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"splitPattern cannot produce more than \" + maxTextItems + \" items\"); __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end, unitIndex])); end = unitIndex + match.value.length; });\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end])); return textList(output, \"splitPattern\");\n}\n","const __velarReactiveIterateKey = null;\nconst __velarReactiveStructureKey = null;\nfunction __velarReactiveRaw(value) { return value; }\nfunction __velarHostRaw(value) { return value; }\n\nfunction __velarReactiveCollectionRead(value, key, child) { return child === undefined ? null : child; }\nfunction __velarReactiveCollectionTrack() {}\nfunction __velarReactiveCollectionLink() {}\nfunction __velarReactiveCollectionTrigger() {}\nfunction __velarReactiveCollectionUnlink() {}\n\nexport {\n __velarReactiveIterateKey as reactiveIterateKey,\n __velarReactiveStructureKey as reactiveStructureKey,\n __velarReactiveRaw as reactiveRaw,\n __velarHostRaw as hostRaw,\n __velarReactiveCollectionRead as reactiveCollectionRead,\n __velarReactiveCollectionTrack as reactiveCollectionTrack,\n __velarReactiveCollectionLink as reactiveCollectionLink,\n __velarReactiveCollectionTrigger as reactiveCollectionTrigger,\n __velarReactiveCollectionUnlink as reactiveCollectionUnlink,\n};\n","const __velarMaxTextCodeUnits = 16 * 1024 * 1024;\nconst __velarMaxTextItems = 1000000;\nconst __velarTextNativeArray = globalThis.Array;\nconst __velarTextNativeString = globalThis.String;\nconst __velarTextNativeNumber = globalThis.Number;\nconst __velarTextNativeMath = globalThis.Math;\nconst __velarTextNativeObject = globalThis.Object;\nconst __velarTextNativeMap = globalThis.Map;\nconst __velarTextNativeTypeError = globalThis.TypeError;\nconst __velarTextNativeRangeError = globalThis.RangeError;\nconst __velarTextGetOwnPropertyDescriptor = __velarTextNativeObject.getOwnPropertyDescriptor;\nconst __velarTextRuntimeGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextReflectApply = __velarTextGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTextStringPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"prototype\")?.value;\nconst __velarTextArrayIsArray = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"isArray\")?.value;\nconst __velarTextNumberIsSafeInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isSafeInteger\")?.value;\nconst __velarTextNumberIsInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isInteger\")?.value;\nconst __velarTextMathFloor = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"floor\")?.value;\nconst __velarTextMathMax = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"max\")?.value;\nconst __velarTextMathMin = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"min\")?.value;\nconst __velarNativeStringIndexOf = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"indexOf\")?.value;\nconst __velarNativeStringSlice = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"slice\")?.value;\nconst __velarNativeStringCharCodeAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"charCodeAt\")?.value;\nconst __velarNativeStringTrim = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trim\")?.value;\nconst __velarNativeStringUpper = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toUpperCase\")?.value;\nconst __velarNativeStringLower = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toLowerCase\")?.value;\nconst __velarNativeStringSplit = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"split\")?.value;\nconst __velarNativeStringReplaceAll = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"replaceAll\")?.value;\nconst __velarNativeStringRepeat = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"repeat\")?.value;\nconst __velarTextMapPrototype = typeof __velarTextNativeMap === \"function\" ? __velarTextGetOwnPropertyDescriptor(__velarTextNativeMap, \"prototype\")?.value : null;\nconst __velarTextMapGet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"get\")?.value : null;\nconst __velarTextMapSet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"set\")?.value : null;\nconst __velarTextMapClear = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"clear\")?.value : null;\nconst __velarTextSurrogatePattern = /[\\u{10000}-\\u{10FFFF}\\uD800-\\uDFFF]/u;\nconst __velarTextRegExpPrototype = typeof __velarTextRuntimeGetPrototypeOf === \"function\" ? __velarTextRuntimeGetPrototypeOf(__velarTextSurrogatePattern) : null;\nconst __velarTextSurrogateExec = __velarTextRegExpPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextRegExpPrototype, \"exec\")?.value : null;\nfunction __velarTextCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarTextReflectApply !== \"function\") throw new __velarTextNativeTypeError(\"The JavaScript text runtime is unavailable\");\n return __velarTextReflectApply(operation, receiver, arguments_);\n}\n\nfunction __velarTextValue(value) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"String methods require a string receiver\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"Strings cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextArgument(value, name) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(name + \" must be a string\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextOutput(value, name) {\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextCount(value, name) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > __velarMaxTextCodeUnits) {\n throw new __velarTextNativeRangeError(name + \" must be an integer from 0 through \" + __velarMaxTextCodeUnits);\n }\n return value;\n}\nfunction __velarTextList(values, name) {\n if (values.length > __velarMaxTextItems) throw new __velarTextNativeRangeError(name + \" cannot produce more than \" + __velarMaxTextItems + \" items\");\n return values;\n}\nfunction __velarTextNextCodePointOffset(value, offset) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n if (first < 0xD800 || first > 0xDBFF || offset + 1 >= value.length) return offset + 1;\n const second = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset + 1]);\n return second >= 0xDC00 && second <= 0xDFFF ? offset + 2 : offset + 1;\n}\n// D90 R7, performance half. Measuring a string used to be a whole-string job\n// every single time: the surrogate probe ran per call, and one astral character\n// anywhere forced every offset conversion to walk code points from zero, which\n// made a loop of char/slice calls quadratic: 20,000 char/slice calls over a\n// 200 KiB string with one leading astral character took 17.1 s, and 34 ms\n// once measurement was memoised. A measurement is a pure function of an\n// immutable value, so it is memoised: a dense string answers offset conversions in\n// O(1) when no surrogate pair splits it, and otherwise the checkpoint list\n// records the code-unit offset of every stride-th code point so a conversion\n// starts from the nearest checkpoint instead of from the start of the string.\n// The cache may only change the cost of an answer, never the answer.\nconst __velarTextCheckpointStride = 64;\nconst __velarTextMeasureMinimumUnits = 64;\n// The cache holds its keys strongly, so its budget is memory the program has\n// stopped using but cannot reclaim. Eight MiB buys the loops that matter and\n// bounds what a document-processing program leaves behind; a single string\n// larger than the budget still measures once and stays, because evicting the\n// string a loop is walking would put the cliff back. The entry count only\n// bounds the cache's own bookkeeping, so it is set well above the number of\n// strings a loop cycles through: a tighter count made a walk over 65 short\n// strings 15x slower than the same walk over 64.\nconst __velarTextMeasureCacheEntries = 512;\nconst __velarTextMeasureCacheUnits = 8 * 1024 * 1024;\nconst __velarTextMeasureCache = typeof __velarTextNativeMap === \"function\"\n && typeof __velarTextMapGet === \"function\" && typeof __velarTextMapSet === \"function\" && typeof __velarTextMapClear === \"function\"\n ? new __velarTextNativeMap() : null;\nlet __velarTextMeasureCacheCount = 0;\nlet __velarTextMeasureCacheHeld = 0;\nfunction __velarTextMeasureText(value) {\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [value]) === null) {\n return { length: value.length, dense: true, checkpoints: null };\n }\n const checkpoints = new __velarTextNativeArray();\n let length = 0, offset = 0;\n while (offset < value.length) {\n if (length % __velarTextCheckpointStride === 0) checkpoints[length / __velarTextCheckpointStride] = offset;\n offset = __velarTextNextCodePointOffset(value, offset);\n length += 1;\n }\n // A string that carries only unpaired surrogates still has one unit per code\n // point, so it keeps the O(1) path even though the probe matched.\n return { length: length, dense: length === value.length, checkpoints: checkpoints };\n}\nfunction __velarTextMeasure(value) {\n if (__velarTextMeasureCache === null || value.length < __velarTextMeasureMinimumUnits) return __velarTextMeasureText(value);\n const cached = __velarTextCall(__velarTextMapGet, __velarTextMeasureCache, [value]);\n if (cached !== undefined) return cached;\n const measured = __velarTextMeasureText(value);\n if (__velarTextMeasureCacheCount >= __velarTextMeasureCacheEntries\n || (__velarTextMeasureCacheCount > 0 && __velarTextMeasureCacheHeld + value.length > __velarTextMeasureCacheUnits)) {\n __velarTextCall(__velarTextMapClear, __velarTextMeasureCache, []);\n __velarTextMeasureCacheCount = 0;\n __velarTextMeasureCacheHeld = 0;\n }\n __velarTextCall(__velarTextMapSet, __velarTextMeasureCache, [value, measured]);\n __velarTextMeasureCacheCount += 1;\n __velarTextMeasureCacheHeld += value.length;\n return measured;\n}\nfunction __velarTextCodePointLength(value) {\n return __velarTextMeasure(value).length;\n}\nfunction __velarTextCodePointPrefix(value, count) { return __velarTextCall(__velarNativeStringSlice, value, [0, __velarTextCodeUnitOffset(value, count)]); }\nfunction __velarTextCodeUnitOffset(value, position) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return position < value.length ? position : value.length;\n if (position <= 0) return 0;\n const checkpoints = measured.checkpoints;\n let block = __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [position / __velarTextCheckpointStride]);\n if (block >= checkpoints.length) block = checkpoints.length - 1;\n let offset = checkpoints[block], current = block * __velarTextCheckpointStride;\n while (offset < value.length && current < position) { offset = __velarTextNextCodePointOffset(value, offset); current += 1; }\n return offset;\n}\nfunction __velarTextCodePointIndex(value, unitOffset) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return unitOffset <= value.length ? unitOffset : null;\n if (unitOffset < 0 || unitOffset > value.length) return null;\n const checkpoints = measured.checkpoints;\n let low = 0, high = checkpoints.length - 1;\n while (low < high) {\n const middle = low + __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(high - low + 1) / 2]);\n if (checkpoints[middle] <= unitOffset) low = middle; else high = middle - 1;\n }\n let offset = checkpoints[low], position = low * __velarTextCheckpointStride;\n while (offset < unitOffset && offset < value.length) { offset = __velarTextNextCodePointOffset(value, offset); position += 1; }\n return offset === unitOffset ? position : null;\n}\nfunction __velarTextCodePointDistance(value, start, end) {\n if (__velarTextMeasure(value).dense) return end >= start ? end - start : null;\n let offset = start, distance = 0;\n while (offset < end) { offset = __velarTextNextCodePointOffset(value, offset); distance += 1; }\n return offset === end ? distance : null;\n}\n// D90 R7: a code-unit offset sits between two code points unless it splits a\n// surrogate pair, and only an adjacent lead/trail pair can be split. The test\n// is O(1), so every search below can reject a mid-pair hit without measuring\n// the string.\nfunction __velarTextIsBoundary(value, offset) {\n if (offset <= 0 || offset >= value.length) return true;\n const lead = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset - 1]);\n if (lead < 0xD800 || lead > 0xDBFF) return true;\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n return trail < 0xDC00 || trail > 0xDFFF;\n}\n// D90 R7, performance half. A match can only start inside a pair when the\n// needle starts with a trail surrogate, and can only end inside one when the\n// needle ends with a lead surrogate: the unit the gate reads at each end of a\n// match is the needle's own edge unit. Both are properties of the needle\n// alone, so one O(1) look says whether the native scan already answers what\n// the bounded scan answers, and an ordinary needle keeps native speed on any\n// haystack. The needle must not be empty; each caller handles that case.\nfunction __velarTextNeedsBoundaryCheck(search) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, search, [0]);\n if (first >= 0xDC00 && first <= 0xDFFF) return true;\n const last = __velarTextCall(__velarNativeStringCharCodeAt, search, [search.length - 1]);\n return last >= 0xD800 && last <= 0xDBFF;\n}\n// Every search operation goes through here so that a match is accepted only\n// when it starts and ends on a code-point boundary. A needle that begins or\n// ends with an unpaired surrogate therefore never matches inside a pair, which\n// is what keeps split/replace/replaceAll from manufacturing lone surrogates.\n// The needle must not be empty; each caller handles that case in its own voice.\nfunction __velarTextBoundedIndexOf(value, search, cursor) {\n if (!__velarTextNeedsBoundaryCheck(search)) return __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n while (cursor <= value.length) {\n const found = __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n if (found < 0) return -1;\n if (__velarTextIsBoundary(value, found) && __velarTextIsBoundary(value, found + search.length)) return found;\n cursor = found + 1;\n }\n return -1;\n}\nfunction __velarTextReplacementOutputUnits(value, search, replacement, all) {\n let matches = 0;\n if (search === \"\") matches = all ? __velarTextCodePointLength(value) + 1 : 1;\n else {\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, search, cursor);\n if (index < 0) break;\n matches += 1;\n if (!all) break;\n cursor = index + search.length;\n }\n }\n if (replacement.length <= search.length || matches === 0) return value.length;\n const growth = replacement.length - search.length;\n if (matches > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(__velarMaxTextCodeUnits - value.length) / growth])) return __velarMaxTextCodeUnits + 1;\n return value.length + matches * growth;\n}\n\n// TXT-D1: ordered string comparison uses code-point order (= UTF-8 binary\n// order). UTF-16 code-unit order already agrees when neither operand\n// contains a surrogate, so the native probe keeps the decoded walk on\n// surrogate-bearing strings only.\nfunction __velarStringCompare(left, right) {\n left = __velarTextValue(left);\n right = __velarTextValue(right);\n if (left === right) return 0;\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [left]) === null\n && __velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [right]) === null) {\n return left < right ? -1 : 1;\n }\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset]);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset]);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\n// D41 item 61: two 'Comparable'-bounded values hold numbers or strings, and\n// which one is known only at runtime. A string pair keeps code-point order\n// (TXT-D1); everything else uses the plain relational order, exactly as a\n// monomorphic comparison of that category would.\n// D90 R6: one NaN policy. A NaN may be held and tested with .isNaN(), but an\n// operation that orders it raises instead of answering. Without this the\n// \"neither less nor greater\" arm returned 0, which made NaN compare both <=\n// and >= as true at a generic site while the same source on a plain number\n// answered false, and produced genuinely mis-sorted output.\nfunction __velarOrderCompare(left, right) {\n if (typeof left === \"string\" && typeof right === \"string\") return __velarStringCompare(left, right);\n if (left !== left || right !== right) throw new __velarTextNativeTypeError(\"ordered comparison found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\");\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarStringSize(value) { return __velarTextCodePointLength(__velarTextValue(value)); }\nfunction __velarStringTrim(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []); }\nfunction __velarStringIsBlank(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []) === \"\"; }\nfunction __velarStringUpper(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringUpper, __velarTextValue(value), []), \"String.upper\"); }\nfunction __velarStringLower(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringLower, __velarTextValue(value), []), \"String.lower\"); }\nfunction __velarStringSlice(value, start = 0, end = null) {\n value = __velarTextValue(value);\n const total = __velarTextCodePointLength(value);\n if (end === null) end = total;\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start]) || !__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [end])) throw new __velarTextNativeTypeError(\"String.slice positions must be integers\");\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const last = end < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + end, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [end, total]);\n return __velarTextCall(__velarNativeStringSlice, value, [__velarTextCodeUnitOffset(value, first), __velarTextCodeUnitOffset(value, last)]);\n}\nfunction __velarStringChar(value, index) {\n value = __velarTextValue(value);\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [index])) throw new __velarTextNativeTypeError(\"String.char index must be an integer\");\n const total = __velarTextCodePointLength(value);\n if (index < 0) index += total;\n if (index < 0) return null;\n if (index >= total) return null;\n const start = __velarTextCodeUnitOffset(value, index);\n return __velarTextCall(__velarNativeStringSlice, value, [start, __velarTextNextCodePointOffset(value, start)]);\n}\nfunction __velarStringHas(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.has text\");\n return text === \"\" || __velarTextBoundedIndexOf(value, text, 0) >= 0;\n}\nfunction __velarStringIndex(value, text, start = 0) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.index text\");\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start])) throw new __velarTextNativeTypeError(\"String.index start must be an integer\");\n const total = __velarTextCodePointLength(value);\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const cursor = __velarTextCodeUnitOffset(value, first);\n if (text === \"\") return first;\n const found = __velarTextBoundedIndexOf(value, text, cursor);\n if (found < 0) return null;\n return __velarTextCodePointIndex(value, found);\n}\nfunction __velarStringCount(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.count text\");\n if (text === \"\") return __velarTextCodePointLength(value) + 1;\n let count = 0;\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, text, cursor);\n if (index < 0) return count;\n count += 1;\n cursor = index + text.length;\n }\n}\nfunction __velarStringStartsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.startsWith text\");\n return __velarTextCall(__velarNativeStringIndexOf, value, [text, 0]) === 0 && __velarTextIsBoundary(value, text.length);\n}\nfunction __velarStringEndsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.endsWith text\");\n const start = value.length - text.length;\n return start >= 0 && __velarTextIsBoundary(value, start) && __velarTextCall(__velarNativeStringIndexOf, value, [text, start]) === start;\n}\nfunction __velarStringSplit(value, separator) {\n value = __velarTextValue(value); separator = __velarTextArgument(separator, \"String.split separator\");\n if (separator === \"\") {\n const count = __velarTextCodePointLength(value);\n if (count > __velarMaxTextItems) throw new __velarTextNativeRangeError(\"String.split cannot produce more than \" + __velarMaxTextItems + \" items\");\n const output = new __velarTextNativeArray(count);\n let offset = 0;\n for (let index = 0; index < count; index += 1) {\n const next = __velarTextNextCodePointOffset(value, offset);\n output[index] = __velarTextCall(__velarNativeStringSlice, value, [offset, next]);\n offset = next;\n }\n return output;\n }\n // The native split matches UTF-16 code units, so it would cut a surrogate\n // pair in half on a separator that begins or ends with an unpaired\n // surrogate. Every other separator makes the two scans agree match for\n // match, and the native one is the faster: its limit argument also stops it\n // before it can build an oversize array.\n if (!__velarTextNeedsBoundaryCheck(separator)) {\n return __velarTextList(__velarTextCall(__velarNativeStringSplit, value, [separator, __velarMaxTextItems + 1]), \"String.split\");\n }\n // Searching on code-point boundaries keeps every piece well formed; the\n // pieces themselves are still plain slices of the input.\n const parts = new __velarTextNativeArray();\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, separator, cursor);\n if (found < 0) break;\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor, found]);\n if (parts.length > __velarMaxTextItems) return __velarTextList(parts, \"String.split\");\n cursor = found + separator.length;\n }\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n return __velarTextList(parts, \"String.split\");\n}\nfunction __velarStringReplace(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replace from\"); to = __velarTextArgument(to, \"String.replace to\");\n if (__velarTextReplacementOutputUnits(value, from, to, false) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replace output cannot exceed 16 MiB\");\n if (from === \"\") return to + value;\n const found = __velarTextBoundedIndexOf(value, from, 0);\n if (found < 0) return value;\n return __velarTextCall(__velarNativeStringSlice, value, [0, found]) + to + __velarTextCall(__velarNativeStringSlice, value, [found + from.length]);\n}\nfunction __velarStringReplaceAll(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replaceAll from\"); to = __velarTextArgument(to, \"String.replaceAll to\");\n if (__velarTextReplacementOutputUnits(value, from, to, true) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replaceAll output cannot exceed 16 MiB\");\n if (from === \"\") {\n let output = to;\n let offset = 0;\n while (offset < value.length) { const next = __velarTextNextCodePointOffset(value, offset); output += __velarTextCall(__velarNativeStringSlice, value, [offset, next]) + to; offset = next; }\n return output;\n }\n // A separator that cannot split a pair leaves nothing for the bounded walk\n // to reject, so the native rewrite answers the same string faster. The\n // replacement is passed as a function so that a '$' in it stays literal.\n if (!__velarTextNeedsBoundaryCheck(from)) return __velarTextCall(__velarNativeStringReplaceAll, value, [from, () => to]);\n let output = \"\";\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, from, cursor);\n if (found < 0) break;\n output += __velarTextCall(__velarNativeStringSlice, value, [cursor, found]) + to;\n cursor = found + from.length;\n }\n return output + __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n}\nfunction __velarStringPad(value, size, fill, start) {\n const name = start ? \"String.padStart\" : \"String.padEnd\";\n value = __velarTextValue(value); size = __velarTextCount(size, name + \" size\"); fill = __velarTextArgument(fill, name + \" fill\");\n const needed = size - __velarTextCodePointLength(value);\n if (needed <= 0 || fill.length === 0) return value;\n let outputUnits = value.length;\n let padding = \"\";\n let counted = 0, fillOffset = 0;\n while (counted < needed) {\n const next = __velarTextNextCodePointOffset(fill, fillOffset);\n const character = __velarTextCall(__velarNativeStringSlice, fill, [fillOffset, next]);\n outputUnits += character.length;\n if (outputUnits > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n padding += character;\n counted += 1;\n fillOffset = next === fill.length ? 0 : next;\n }\n return start ? padding + value : value + padding;\n}\nfunction __velarStringPadStart(value, size, fill = \" \") { return __velarStringPad(value, size, fill, true); }\nfunction __velarStringPadEnd(value, size, fill = \" \") { return __velarStringPad(value, size, fill, false); }\nfunction __velarStringRepeat(value, count) {\n value = __velarTextValue(value); count = __velarTextCount(count, \"String.repeat count\");\n if (value.length > 0 && count > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [__velarMaxTextCodeUnits / value.length])) throw new __velarTextNativeRangeError(\"String.repeat output cannot exceed 16 MiB\");\n return __velarTextCall(__velarNativeStringRepeat, value, [count]);\n}\n\nconst __velarNumberNativeMath = globalThis.Math;\nconst __velarNumberNativeNumber = globalThis.Number;\nconst __velarNumberNativeObject = globalThis.Object;\nconst __velarNumberNativeTypeError = globalThis.TypeError;\nconst __velarNumberNativeRangeError = globalThis.RangeError;\nconst __velarNumberGetOwnPropertyDescriptor = __velarNumberNativeObject.getOwnPropertyDescriptor;\nconst __velarNumberReflectApply = __velarNumberGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarNumberPrototype = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"prototype\")?.value;\nconst __velarNumberMathAbs = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"abs\")?.value;\nconst __velarNumberMathRound = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"round\")?.value;\nconst __velarNumberMathFloor = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"floor\")?.value;\nconst __velarNumberMathCeil = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"ceil\")?.value;\nconst __velarNumberIsSafeInteger = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isSafeInteger\")?.value;\nconst __velarNumberNativeIsInteger = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isInteger\")?.value;\nconst __velarNumberNativeIsNaN = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isNaN\")?.value;\nconst __velarNumberNativeIsFinite = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isFinite\")?.value;\nconst __velarNativeNumberToFixed = __velarNumberGetOwnPropertyDescriptor(__velarNumberPrototype, \"toFixed\")?.value;\nfunction __velarNumberCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarNumberReflectApply !== \"function\") throw new __velarNumberNativeTypeError(\"The JavaScript Number runtime is unavailable\");\n return __velarNumberReflectApply(operation, receiver, arguments_);\n}\nfunction __velarNumberValue(value) { if (typeof value !== \"number\") throw new __velarNumberNativeTypeError(\"Number methods require a number receiver\"); return value; }\nfunction __velarNumberAbs(value) { return __velarNumberCall(__velarNumberMathAbs, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberRound(value) { return __velarNumberCall(__velarNumberMathRound, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberFloor(value) { return __velarNumberCall(__velarNumberMathFloor, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberCeil(value) { return __velarNumberCall(__velarNumberMathCeil, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberToFixed(value, digits) {\n if (!__velarNumberCall(__velarNumberIsSafeInteger, __velarNumberNativeNumber, [digits]) || digits < 0 || digits > 100) throw new __velarNumberNativeRangeError(\"Number.toFixed digits must be an integer from 0 through 100\");\n return __velarNumberCall(__velarNativeNumberToFixed, __velarNumberValue(value), [digits]);\n}\nfunction __velarNumberIsInteger(value) { return __velarNumberCall(__velarNumberNativeIsInteger, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\nfunction __velarNumberIsNaN(value) { return __velarNumberCall(__velarNumberNativeIsNaN, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\nfunction __velarNumberIsFinite(value) { return __velarNumberCall(__velarNumberNativeIsFinite, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\n\nexport {\n __velarStringSize as stringSize,\n __velarStringTrim as stringTrim,\n __velarStringUpper as stringUpper,\n __velarStringLower as stringLower,\n __velarStringSlice as stringSlice,\n __velarStringChar as stringChar,\n __velarStringHas as stringHas,\n __velarStringIndex as stringIndex,\n __velarStringCount as stringCount,\n __velarStringStartsWith as stringStartsWith,\n __velarStringEndsWith as stringEndsWith,\n __velarStringSplit as stringSplit,\n __velarStringReplace as stringReplace,\n __velarStringReplaceAll as stringReplaceAll,\n __velarStringPadStart as stringPadStart,\n __velarStringPadEnd as stringPadEnd,\n __velarStringRepeat as stringRepeat,\n __velarStringIsBlank as stringIsBlank,\n __velarStringCompare as stringCompare,\n __velarOrderCompare as orderCompare,\n __velarNumberAbs as numberAbs,\n __velarNumberRound as numberRound,\n __velarNumberFloor as numberFloor,\n __velarNumberCeil as numberCeil,\n __velarNumberToFixed as numberToFixed,\n __velarNumberIsInteger as numberIsInteger,\n __velarNumberIsNaN as numberIsNaN,\n __velarNumberIsFinite as numberIsFinite,\n};\n","const __velarClassNativeObject = globalThis.Object;\nconst __velarClassNativeReflect = globalThis.Reflect;\nconst __velarClassNativeTypeError = globalThis.TypeError;\nconst __velarClassGetOwnPropertyDescriptor = __velarClassNativeObject.getOwnPropertyDescriptor;\nconst __velarClassReflectApply = __velarClassGetOwnPropertyDescriptor(__velarClassNativeReflect, \"apply\")?.value;\nconst __velarClassReflectGet = __velarClassGetOwnPropertyDescriptor(__velarClassNativeReflect, \"get\")?.value;\nconst __velarClassGetPrototypeOf = __velarClassGetOwnPropertyDescriptor(__velarClassNativeObject, \"getPrototypeOf\")?.value;\nfunction __velarClassHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarClassReflectApply !== \"function\") throw new __velarClassNativeTypeError(\"The JavaScript class field runtime is unavailable\");\n return __velarClassReflectApply(operation, receiver, arguments_);\n}\nfunction __velarReadInstanceField(receiver, name) {\n const value = __velarClassHostCall(__velarClassReflectGet, __velarClassNativeReflect, [receiver, name]);\n if (value === undefined) throw new __velarClassNativeTypeError(\"Field '\" + name + \"' was read before initialization or contains undefined\");\n return value;\n}\nfunction __velarReadPrivateField(value, name) {\n if (value === undefined) throw new __velarClassNativeTypeError(\"Private field '\" + name + \"' was read before initialization or contains undefined\");\n return value;\n}\nfunction __velarReadStaticField(receiver, name, ownerDepth) {\n let owner = receiver;\n for (let depth = 0; depth < ownerDepth; depth += 1) owner = __velarClassHostCall(__velarClassGetPrototypeOf, __velarClassNativeObject, [owner]);\n const descriptor = owner == null ? null : __velarClassHostCall(__velarClassGetOwnPropertyDescriptor, __velarClassNativeObject, [owner, name]);\n if (!descriptor || !(\"value\" in descriptor) || descriptor.value === undefined) {\n throw new __velarClassNativeTypeError(\"Static field '\" + name + \"' was read before initialization\");\n }\n const value = __velarClassHostCall(__velarClassReflectGet, __velarClassNativeReflect, [receiver, name]);\n if (value === undefined) throw new __velarClassNativeTypeError(\"Static field '\" + name + \"' contains undefined\");\n return value;\n}\n\nexport {\n __velarReadInstanceField as readInstanceField,\n __velarReadPrivateField as readPrivateField,\n __velarReadStaticField as readStaticField,\n};\n","const __velarNarrowingNativeTypeError = globalThis.TypeError;\nconst __velarNarrowingDefineProperty = globalThis.Object.defineProperty;\nclass __VelarNarrowingError extends __velarNarrowingNativeTypeError {\n constructor(message) {\n super(message);\n this.name = \"NarrowingError\";\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarNarrowingDefineProperty(__VelarNarrowingError, \"name\", { value: \"NarrowingError\", writable: false, enumerable: false, configurable: true });\nfunction __velarNarrow(value, valid, expected, description, offset) {\n if (!valid) throw new __VelarNarrowingError(\"Flow narrowing for '\" + description + \"' no longer holds: expected \" + expected + \" at source offset \" + offset);\n return value;\n}\n\nexport {\n __VelarNarrowingError as NarrowingError,\n __velarNarrow as narrow,\n};\n","const __velarNormalizeGlobal = globalThis;\nconst __velarNormalizeNativeObject = globalThis.Object;\nconst __velarNormalizeNativeReflect = globalThis.Reflect;\nconst __velarNormalizeNativeWeakMap = globalThis.WeakMap;\nconst __velarNormalizeNativePromise = globalThis.Promise;\nconst __velarNormalizeNativeSymbol = globalThis.Symbol;\nconst __velarNormalizeTypeError = globalThis.TypeError;\nconst __velarNormalizeGetOwnPropertyDescriptor = __velarNormalizeNativeObject.getOwnPropertyDescriptor;\nconst __velarNormalizeGetPrototypeOf = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeObject, \"getPrototypeOf\")?.value;\nconst __velarNormalizeDefineProperty = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeObject, \"defineProperty\")?.value;\nconst __velarNormalizeApply = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeReflect, \"apply\")?.value;\nconst __velarNormalizeWeakMapPrototype = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeWeakMap, \"prototype\")?.value;\nconst __velarNormalizeWeakMapHas = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"has\")?.value;\nconst __velarNormalizeWeakMapGet = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"get\")?.value;\nconst __velarNormalizeWeakMapSet = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"set\")?.value;\nconst __velarNormalizePromisePrototype = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativePromise, \"prototype\")?.value;\nconst __velarNormalizePromiseThen = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizePromisePrototype, \"then\")?.value;\nconst __velarNormalizeSymbolFor = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeSymbol, \"for\")?.value;\nfunction __velarNormalizeCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarNormalizeApply !== \"function\") throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n return __velarNormalizeApply(operation, receiver, arguments_);\n}\nconst __velarNormalizedPromiseRegistryKey = __velarNormalizeCall(__velarNormalizeSymbolFor, __velarNormalizeNativeSymbol, [\"velar.promise.normalization.v1\"]);\nconst __velarNormalizedPromiseValues = (() => {\n const descriptor = __velarNormalizeCall(__velarNormalizeGetOwnPropertyDescriptor, __velarNormalizeNativeObject, [__velarNormalizeGlobal, __velarNormalizedPromiseRegistryKey]);\n if (descriptor) {\n if (!(\"value\" in descriptor) || descriptor.enumerable || descriptor.configurable || descriptor.writable) {\n throw new __velarNormalizeTypeError(\"VelarScript Promise normalization registry ownership is invalid\");\n }\n try { __velarNormalizeCall(__velarNormalizeWeakMapHas, descriptor.value, [descriptor.value]); }\n catch { throw new __velarNormalizeTypeError(\"VelarScript Promise normalization registry is invalid\"); }\n return descriptor.value;\n }\n const registry = new __velarNormalizeNativeWeakMap();\n __velarNormalizeCall(__velarNormalizeDefineProperty, __velarNormalizeNativeObject, [__velarNormalizeGlobal, __velarNormalizedPromiseRegistryKey, {\n value: registry,\n enumerable: false,\n configurable: false,\n writable: false,\n }]);\n return registry;\n})();\nfunction __velarNormalizeOwnsPromise(candidate) {\n if ((typeof candidate !== \"object\" && typeof candidate !== \"function\") || candidate === null) return false;\n let prototype;\n try { prototype = __velarNormalizeCall(__velarNormalizeGetPrototypeOf, __velarNormalizeNativeObject, [candidate]); }\n catch { return false; }\n return prototype === __velarNormalizePromisePrototype;\n}\nfunction __velarNormalizePromiseValue(value) {\n if ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) throw new __velarNormalizeTypeError(\"Expected an actual Promise\");\n const known = __velarNormalizeCall(__velarNormalizeWeakMapGet, __velarNormalizedPromiseValues, [value]);\n if (known) return known;\n let settle;\n let fail;\n try {\n __velarNormalizeCall(__velarNormalizePromiseThen, value, [\n (resolved) => { if (typeof settle === \"function\") settle(resolved ?? null); },\n (reason) => { if (typeof fail === \"function\") fail(reason); },\n ]);\n }\n catch { throw new __velarNormalizeTypeError(\"Expected an actual Promise\"); }\n if (typeof __velarNormalizeNativePromise !== \"function\") throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n const normalized = new __velarNormalizeNativePromise((resolve, reject) => { settle = resolve; fail = reject; });\n if (typeof settle !== \"function\" || typeof fail !== \"function\" || !__velarNormalizeOwnsPromise(normalized)) throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [value, normalized]);\n __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [normalized, normalized]);\n return normalized;\n}\nfunction __velarAsyncResolvedValue(value) {\n if (value === undefined) return null;\n if ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) return value;\n try { return __velarNormalizePromiseValue(value); } catch {}\n let owner = value;\n for (let depth = 0; owner !== null && depth < 128; depth += 1) {\n let descriptor;\n try { descriptor = __velarNormalizeCall(__velarNormalizeGetOwnPropertyDescriptor, __velarNormalizeNativeObject, [owner, \"then\"]); }\n catch { throw new __velarNormalizeTypeError(\"An async result must not expose a callable 'then' or a 'then' getter\"); }\n if (descriptor) {\n if (!(\"value\" in descriptor) || typeof descriptor.value === \"function\") throw new __velarNormalizeTypeError(\"An async result must not expose a callable 'then' or a 'then' getter\");\n return value;\n }\n try { owner = __velarNormalizeCall(__velarNormalizeGetPrototypeOf, __velarNormalizeNativeObject, [owner]); }\n catch { throw new __velarNormalizeTypeError(\"An async result must have an inspectable prototype chain\"); }\n }\n if (owner !== null) throw new __velarNormalizeTypeError(\"An async result prototype chain is too deep\");\n return value;\n}\n\nexport {\n __velarNormalizePromiseValue as normalizePromiseValue,\n __velarAsyncResolvedValue as asyncResolvedValue,\n};\n","const __velarErrorNativeError = globalThis.Error;\nconst __velarErrorNativeString = globalThis.String;\nconst __velarErrorNativeObject = globalThis.Object;\nconst __velarErrorNativeReflect = globalThis.Reflect;\nconst __velarErrorNativeTypeError = globalThis.TypeError;\nconst __velarErrorGetOwnPropertyDescriptor = __velarErrorNativeObject.getOwnPropertyDescriptor;\nconst __velarErrorGetPrototypeOf = __velarErrorNativeObject.getPrototypeOf;\nconst __velarErrorReflectApply = __velarErrorGetOwnPropertyDescriptor(__velarErrorNativeReflect, \"apply\")?.value;\nconst __velarErrorIsErrorOperation = __velarErrorGetOwnPropertyDescriptor(__velarErrorNativeError, \"isError\")?.value;\nfunction __velarErrorApply(operation, receiver, arguments_, label) {\n if (typeof operation !== \"function\" || typeof __velarErrorReflectApply !== \"function\") {\n throw new __velarErrorNativeTypeError(\"The JavaScript \" + label + \" API is unavailable\");\n }\n return __velarErrorReflectApply(operation, receiver, arguments_);\n}\nfunction __velarIsError(value) {\n return __velarErrorApply(__velarErrorIsErrorOperation, __velarErrorNativeError, [value], \"Error.isError\");\n}\n// D50 rule 89: 'code' is the string projection of an error's declared class,\n// never a second taxonomy. The class lowering writes the declared name into\n// the instance's own 'name' property (rule 74), and this reads exactly that\n// property back — one source of truth, so the two can never diverge. A value\n// no Velar class declared (a host TypeError, a foreign Error) reports the base\n// contract it actually satisfies: \"Error\".\n//\n// D51 rule 107: 'is' is the only discrimination authority, so the own 'name'\n// counts only when the class the value was constructed from declares that same\n// name. A JavaScript caller writing e.name = \"FileNotFoundError\" on a host\n// TypeError produced an error whose 'code' said FileNotFoundError while 'is'\n// said false; the class behind the value is what answers now.\nfunction __velarErrorCode(value) {\n if (value === null || typeof value !== \"object\" && typeof value !== \"function\") return \"Error\";\n const descriptor = __velarErrorGetOwnPropertyDescriptor(value, \"name\");\n if (!descriptor || !(\"value\" in descriptor) || typeof descriptor.value !== \"string\" || descriptor.value.length === 0) return \"Error\";\n const prototype = __velarErrorGetPrototypeOf(value);\n const constructor = prototype === null ? null : __velarErrorGetOwnPropertyDescriptor(prototype, \"constructor\");\n if (!constructor || !(\"value\" in constructor) || typeof constructor.value !== \"function\") return \"Error\";\n const declared = __velarErrorGetOwnPropertyDescriptor(constructor.value, \"name\");\n return declared && \"value\" in declared && declared.value === descriptor.value ? descriptor.value : \"Error\";\n}\nfunction __velarNormalizeError(value) {\n if (__velarIsError(value)) return value;\n const kind = typeof value;\n let message;\n if (kind === \"string\") message = value;\n else if (value === null) message = \"null\";\n else if (kind === \"undefined\") message = \"undefined\";\n else if (kind === \"number\" || kind === \"boolean\" || kind === \"bigint\" || kind === \"symbol\") {\n message = __velarErrorApply(__velarErrorNativeString, globalThis, [value], \"String\");\n }\n else message = \"A non-Error value was thrown by JavaScript\";\n return new __velarErrorNativeError(message, { cause: value });\n}\n\nconst __velarAssertionNativeError = globalThis.Error;\nconst __velarAssertionDefineProperty = globalThis.Object.defineProperty;\nclass __VelarAssertionError extends __velarAssertionNativeError {\n constructor(message) {\n super(message);\n this.name = \"AssertionError\";\n }\n}\n__velarAssertionDefineProperty(__VelarAssertionError, \"name\", { value: \"AssertionError\", writable: false, enumerable: false, configurable: true });\n\nconst __velarHostErrorNativeError = globalThis.Error;\nconst __velarHostErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarFileNotFoundError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"FileNotFoundError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarFileNotFoundError, \"name\", { value: \"FileNotFoundError\", writable: false, enumerable: false, configurable: true });\nclass __VelarPermissionError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"PermissionError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarPermissionError, \"name\", { value: \"PermissionError\", writable: false, enumerable: false, configurable: true });\nclass __VelarNotADirectoryError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"NotADirectoryError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarNotADirectoryError, \"name\", { value: \"NotADirectoryError\", writable: false, enumerable: false, configurable: true });\nclass __VelarFileExistsError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"FileExistsError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarFileExistsError, \"name\", { value: \"FileExistsError\", writable: false, enumerable: false, configurable: true });\nclass __VelarAddressInUseError extends __velarHostErrorNativeError {\n constructor(message) {\n super(message);\n this.name = \"AddressInUseError\";\n }\n}\n__velarHostErrorDefineProperty(__VelarAddressInUseError, \"name\", { value: \"AddressInUseError\", writable: false, enumerable: false, configurable: true });\n\nexport {\n __VelarAssertionError as AssertionError,\n __velarErrorApply as errorApply,\n __velarErrorCode as errorCode,\n __velarIsError as isError,\n __velarNormalizeError as normalizeError,\n __VelarFileNotFoundError as FileNotFoundError,\n __VelarPermissionError as PermissionError,\n __VelarNotADirectoryError as NotADirectoryError,\n __VelarFileExistsError as FileExistsError,\n __VelarAddressInUseError as AddressInUseError,\n};\n","const __velarCollectionNativeArray = globalThis.Array;\nconst __velarCollectionNativeMap = globalThis.Map;\nconst __velarCollectionNativeSet = globalThis.Set;\nconst __velarCollectionNativeObject = globalThis.Object;\nconst __velarCollectionNativeReflect = globalThis.Reflect;\nconst __velarCollectionNativeWeakMap = globalThis.WeakMap;\nconst __velarCollectionNativeTypeError = globalThis.TypeError;\nconst __velarCollectionGetOwnPropertyDescriptor = __velarCollectionNativeObject.getOwnPropertyDescriptor;\nconst __velarCollectionReflectApply = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"apply\")?.value;\nconst __velarCollectionArrayIsArray = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"isArray\")?.value;\nconst __velarCollectionGetPrototypeOf = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getPrototypeOf\")?.value;\nconst __velarCollectionObjectPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"prototype\")?.value;\nconst __velarCollectionMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeMap, \"prototype\")?.value;\nconst __velarCollectionSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeSet, \"prototype\")?.value;\nconst __velarCollectionMapSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"size\")?.get;\nconst __velarCollectionSetSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"size\")?.get;\nfunction __velarCollectionHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarCollectionReflectApply !== \"function\") throw new __velarCollectionNativeTypeError(\"The JavaScript collection runtime is unavailable\");\n return __velarCollectionReflectApply(operation, receiver, arguments_);\n}\nconst __velarCollectionWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeWeakMap, \"prototype\")?.value;\nconst __velarCollectionWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"get\")?.value;\nconst __velarCollectionWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"set\")?.value;\nconst __velarCollectionBrands = new __velarCollectionNativeWeakMap();\n// The only unforgeable, cross-realm Map/Set test JavaScript offers is invoking\n// the prototype 'size' getter and observing whether it throws, and a thrown and\n// caught exception costs roughly 1.8us -- paid by every Set membership test,\n// which probes Map first. Internal slots are fixed at construction, so the\n// verdict can never change for a given object: probe once, then answer from a\n// WeakMap. 0 = neither, 1 = Map, 2 = Set.\nfunction __velarCollectionBrand(value) {\n if (value === null || (typeof value !== \"object\" && typeof value !== \"function\")) return 0;\n const known = __velarCollectionHostCall(__velarCollectionWeakMapGetOperation, __velarCollectionBrands, [value]);\n if (known !== undefined) return known;\n let brand = 0;\n try { __velarCollectionHostCall(__velarCollectionMapSize, value, []); brand = 1; }\n catch {\n try { __velarCollectionHostCall(__velarCollectionSetSize, value, []); brand = 2; }\n catch { brand = 0; }\n }\n __velarCollectionHostCall(__velarCollectionWeakMapSetOperation, __velarCollectionBrands, [value, brand]);\n return brand;\n}\nfunction __velarIsMap(value) {\n return __velarCollectionBrand(value) === 1;\n}\nfunction __velarIsSet(value) {\n return __velarCollectionBrand(value) === 2;\n}\nfunction __velarIsRecord(value) {\n if (value === null || typeof value !== \"object\" || __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value])) return false;\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n return prototype === __velarCollectionObjectPrototype || prototype === null;\n}\n\nconst __velarCollectionOwnNames = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionOwnSymbols = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionOwnKeys = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"ownKeys\")?.value;\nconst __velarCollectionMapEntries = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"entries\")?.value;\nconst __velarCollectionSetValues = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"values\")?.value;\nconst __velarCollectionMapIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionMapEntries, new __velarCollectionNativeMap(), [])]);\nconst __velarCollectionSetIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionSetValues, new __velarCollectionNativeSet(), [])]);\nconst __velarCollectionMapIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapIteratorPrototype, \"next\")?.value;\nconst __velarCollectionSetIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetIteratorPrototype, \"next\")?.value;\nfunction __velarCollectionMapTypeIterator(value) { return __velarCollectionHostCall(__velarCollectionMapEntries, value, []); }\nfunction __velarCollectionSetTypeIterator(value) { return __velarCollectionHostCall(__velarCollectionSetValues, value, []); }\nfunction __velarCollectionMapTypeNext(iterator) { return __velarCollectionHostCall(__velarCollectionMapIteratorNext, iterator, []); }\nfunction __velarCollectionSetTypeNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetIteratorNext, iterator, []); }\n\nconst __velarTypeNativeWeakSet = globalThis.WeakSet;\nconst __velarTypeNativeObject = globalThis.Object;\nconst __velarTypeNativeTypeError = globalThis.TypeError;\nconst __velarTypeGetOwnPropertyDescriptor = __velarTypeNativeObject.getOwnPropertyDescriptor;\nconst __velarTypeDefineProperty = __velarTypeNativeObject.defineProperty;\nconst __velarTypeReflectApply = __velarTypeGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTypeSymbolFor = globalThis.Symbol.for;\nconst __velarTypeWeakSetPrototype = __velarTypeGetOwnPropertyDescriptor(__velarTypeNativeWeakSet, \"prototype\")?.value;\nconst __velarTypeWeakSetHas = __velarTypeGetOwnPropertyDescriptor(__velarTypeWeakSetPrototype, \"has\")?.value;\nconst __velarTypeWeakSetAdd = __velarTypeGetOwnPropertyDescriptor(__velarTypeWeakSetPrototype, \"add\")?.value;\nfunction __velarTypeCall(operation, receiver, arguments_) { if (typeof operation !== \"function\" || typeof __velarTypeReflectApply !== \"function\") throw new __velarTypeNativeTypeError(\"The JavaScript runtime Type registry API is unavailable\"); return __velarTypeReflectApply(operation, receiver, arguments_); }\nconst __velarRuntimeTypeRegistryKey = __velarTypeCall(__velarTypeSymbolFor, globalThis.Symbol, [\"velar.type.registry.v1\"]);\nconst __velarRuntimeTypeRegistry = (() => {\n const descriptor = __velarTypeGetOwnPropertyDescriptor(globalThis, __velarRuntimeTypeRegistryKey);\n if (descriptor) {\n if (!(\"value\" in descriptor) || descriptor.enumerable || descriptor.configurable || descriptor.writable) {\n throw new __velarTypeNativeTypeError(\"VelarScript runtime type registry descriptor is invalid\");\n }\n try { __velarTypeCall(__velarTypeWeakSetHas, descriptor.value, [descriptor.value]); }\n catch { throw new __velarTypeNativeTypeError(\"VelarScript runtime type registry is invalid\"); }\n return descriptor.value;\n }\n const registry = new __velarTypeNativeWeakSet();\n __velarTypeCall(__velarTypeDefineProperty, __velarTypeNativeObject, [globalThis, __velarRuntimeTypeRegistryKey, {\n value: registry,\n enumerable: false,\n configurable: false,\n writable: false,\n }]);\n return registry;\n})();\nfunction __velarRegisterRuntimeType(value) {\n __velarTypeCall(__velarTypeWeakSetAdd, __velarRuntimeTypeRegistry, [value]);\n return value;\n}\nfunction __velarRequireRuntimeType(value, name, optional = false) {\n if (optional && value == null) return null;\n // Registry membership proves the value was registered somewhere in this\n // realm; it does not prove it still presents the Type surface. A module built\n // by another generation registers into the same WeakSet whenever both\n // generations share the registry key, so the surface itself is asserted here:\n // 'is' and 'parse' are the two operations every caller of this helper goes on\n // to invoke.\n if (!value || typeof value !== \"object\" || !__velarTypeCall(__velarTypeWeakSetHas, __velarRuntimeTypeRegistry, [value])\n || typeof value.is !== \"function\" || typeof value.parse !== \"function\") {\n throw new __velarTypeNativeTypeError(name + \" requires a compiler-known VelarScript runtime type\");\n }\n return value;\n}\n\nconst __velarValidationNativeWeakMap = globalThis.WeakMap;\nconst __velarValidationNativeSet = globalThis.Set;\nconst __velarValidationNativePromise = globalThis.Promise;\nconst __velarValidationNativeFunction = globalThis.Function;\nconst __velarValidationNativeSymbol = globalThis.Symbol;\nconst __velarValidationWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeWeakMap, \"prototype\")?.value;\nconst __velarValidationSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeSet, \"prototype\")?.value;\nconst __velarValidationFunctionPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeFunction, \"prototype\")?.value;\nconst __velarValidationHasInstanceSymbol = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeSymbol, \"hasInstance\")?.value;\nconst __velarValidationWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"get\")?.value;\nconst __velarValidationWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"set\")?.value;\nconst __velarValidationWeakMapDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"delete\")?.value;\nconst __velarValidationSetHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"has\")?.value;\nconst __velarValidationSetAddOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"add\")?.value;\nconst __velarValidationSetDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"delete\")?.value;\nconst __velarValidationSetSizeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"size\")?.get;\nconst __velarValidationFunctionHasInstanceOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationFunctionPrototype, __velarValidationHasInstanceSymbol)?.value;\nconst __velarValidationFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nconst __velarValidationDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarValidationMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"set\")?.value;\nconst __velarValidationMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"get\")?.value;\n// D90 rule R5: the per-call graph state carries both the validator's cycle\n// guard and the copy memo, because parse runs one then the other over the same\n// object graph. 'copies' stays null until something is actually copied.\nfunction __velarValidationState() { return { active: new __velarValidationNativeWeakMap(), depth: 0, copies: null, copy: __velarValidationCopy }; }\nfunction __velarValidationSet() { return new __velarValidationNativeSet(); }\nfunction __velarValidationWeakMapGet(value, key) { return __velarCollectionHostCall(__velarValidationWeakMapGetOperation, value, [key]); }\nfunction __velarValidationWeakMapSet(value, key, item) { return __velarCollectionHostCall(__velarValidationWeakMapSetOperation, value, [key, item]); }\nfunction __velarValidationWeakMapDelete(value, key) { return __velarCollectionHostCall(__velarValidationWeakMapDeleteOperation, value, [key]); }\nfunction __velarValidationMapGet(value, key) { return __velarCollectionHostCall(__velarValidationMapGetOperation, value, [key]); }\nfunction __velarValidationMapSet(value, key, item) { return __velarCollectionHostCall(__velarValidationMapSetOperation, value, [key, item]); }\nfunction __velarValidationSetHas(value, item) { return __velarCollectionHostCall(__velarValidationSetHasOperation, value, [item]); }\nfunction __velarValidationSetAdd(value, item) { return __velarCollectionHostCall(__velarValidationSetAddOperation, value, [item]); }\nfunction __velarValidationSetDelete(value, item) { return __velarCollectionHostCall(__velarValidationSetDeleteOperation, value, [item]); }\nfunction __velarValidationSetSize(value) { return __velarCollectionHostCall(__velarValidationSetSizeOperation, value, []); }\nfunction __velarValidationIsArray(value) { return __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]); }\nfunction __velarValidationOwnDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarValidationIsInstance(value, constructor) { return __velarCollectionHostCall(__velarValidationFunctionHasInstanceOperation, constructor, [value]); }\nfunction __velarValidationIsPromise(value) { return __velarValidationIsInstance(value, __velarValidationNativePromise); }\nfunction __velarValidationFreeze(value) { return __velarCollectionHostCall(__velarValidationFreezeOperation, __velarCollectionNativeObject, [value]); }\n// A record contract accepts only plain data objects: prototype null, or a\n// prototype that itself has none (some realm's Object.prototype). The check\n// is structural rather than an identity comparison so plain values from other\n// realms validate, while class instances, Error values, and host objects are\n// rejected — their prototypes always chain through another object.\nfunction __velarValidationIsPlainObject(value) {\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n if (prototype === null) return true;\n return __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [prototype]) === null;\n}\n// D90 rule R5: parse returns a copy, so \"validated\" means \"and it stays\n// valid\" rather than \"it was correct at the instant of the check\". The copy\n// follows the declared shape — the generated validators supply one callback\n// per element position — and the memo answers per source object *and* copy\n// plan, so a shared or cyclic subgraph is copied once per declared shape and\n// the copy preserves the sharing the source had. Keying on the source alone\n// would hand the second projection of one object the first projection's copy:\n// a value the caller never wrote and no declared type ever accepted. The four\n// container members are spelled with an \"Of\" suffix because this runtime\n// reaches every host collection through a captured operation: no member call\n// inside it may read as a get, set, has, add, or delete call, which is the\n// boundary gate's rule for this file.\nconst __velarValidationCopy = {\n seen(state, value, plan) {\n if (state.copies === null) return undefined;\n const plans = __velarValidationWeakMapGet(state.copies, value);\n return plans === undefined ? undefined : __velarValidationMapGet(plans, plan);\n },\n remember(state, value, copy, plan) {\n if (state.copies === null) state.copies = new __velarValidationNativeWeakMap();\n let plans = __velarValidationWeakMapGet(state.copies, value);\n if (plans === undefined) {\n plans = new __velarCollectionNativeMap();\n __velarValidationWeakMapSet(state.copies, value, plans);\n }\n __velarValidationMapSet(plans, plan, copy);\n return copy;\n },\n object(state, value, plan) {\n return __velarValidationCopy.remember(state, value, {}, plan);\n },\n // Fields are written through defineProperty so a field literally named\n // '__proto__' lands as an own data property instead of retargeting the\n // copy's prototype, and so every copied field is an ordinary mutable\n // enumerable data property whatever the source's descriptor said.\n field(target, name, value) {\n __velarCollectionHostCall(__velarValidationDefinePropertyOperation, __velarCollectionNativeObject, [target, name, { value: value, writable: true, enumerable: true, configurable: true }]);\n },\n // A null element callback means the element position has nothing to copy —\n // a primitive, an enum member, a class instance, or an opaque 'unknown'.\n // 'plan' is the container position's own stable identity: the emitter hoists\n // one function per distinct copy plan and hands it in as both the element\n // callback and the key this memo files the copy under.\n listOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, [], plan);\n const length = __velarValidationOwnDescriptor(value, \"length\")?.value ?? 0;\n for (let index = 0; index < length; index += 1) {\n const descriptor = __velarValidationOwnDescriptor(value, index);\n result[index] = item === null ? descriptor?.value : item(descriptor?.value, state);\n }\n return result;\n },\n setOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, __velarValidationSet(), plan);\n const iterator = __velarCollectionSetTypeIterator(value);\n while (true) {\n const step = __velarCollectionSetTypeNext(iterator);\n if (step.done) break;\n __velarValidationSetAdd(result, item === null ? step.value : item(step.value, state));\n }\n return result;\n },\n mapOf(value, state, key, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, new __velarCollectionNativeMap(), plan);\n const iterator = __velarCollectionMapTypeIterator(value);\n while (true) {\n const step = __velarCollectionMapTypeNext(iterator);\n if (step.done) break;\n const entry = step.value;\n __velarValidationMapSet(result, key === null ? entry[0] : key(entry[0], state), item === null ? entry[1] : item(entry[1], state));\n }\n return result;\n },\n recordOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, {}, plan);\n const keys = __velarCollectionHostCall(__velarCollectionOwnKeys, __velarCollectionNativeReflect, [value]);\n for (let index = 0; index < keys.length; index += 1) {\n const name = keys[index];\n if (typeof name !== \"string\") continue;\n const descriptor = __velarValidationOwnDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) continue;\n __velarValidationCopy.field(result, name, item === null ? descriptor.value : item(descriptor.value, state));\n }\n return result;\n },\n // A generic instantiation supplies a predicate per type argument but no copy\n // plan, and a structural or union position is validated as a shape the\n // predicate did not fully decide. Both copy the plain data they can see:\n // arrays, Maps, Sets, and plain objects recurse; anything else — a class\n // instance, a promise, a function, a binary buffer — is not plain data and\n // passes through by reference.\n plain(value, state) {\n if (value === null || typeof value !== \"object\") return value;\n const found = __velarValidationCopy.seen(state, value, __velarValidationCopy.plain);\n if (found !== undefined) return found;\n if (__velarValidationIsArray(value)) return __velarValidationCopy.listOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (__velarIsMap(value)) return __velarValidationCopy.mapOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (__velarIsSet(value)) return __velarValidationCopy.setOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (!__velarValidationIsPlainObject(value)) return value;\n return __velarValidationCopy.recordOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n },\n // A Type object from a target extension, or one emitted by an older build,\n // may carry no copy plan; the structural copy is what is left to fall back on.\n // A Type that does answer 'copy' owns its own plan identity — a declared\n // record files under its copy function, an instantiation under its arguments\n // — so nothing is threaded in from here.\n through(type, value, state) {\n const operation = type === null || type === undefined ? undefined : type.copy;\n if (typeof operation !== \"function\") return __velarValidationCopy.plain(value, state);\n return __velarCollectionHostCall(operation, type, [value, state]);\n },\n};\n// Teaching suffix for record parse failures caused by the plain-object rule.\nfunction __velarValidationRejectionHint(value) {\n if (value === null || typeof value !== \"object\" || __velarValidationIsArray(value) || __velarValidationIsPlainObject(value)) return \"\";\n return \"; a record accepts only plain data objects — project the fields into a record first, for example {x: instance.x}\";\n}\n\nfunction __velarListTypeIs(value, check) {\n if (!__velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]) || value.length > 1000000 || __velarCollectionHostCall(__velarCollectionOwnSymbols, __velarCollectionNativeObject, [value]).length > 0 || __velarCollectionHostCall(__velarCollectionOwnNames, __velarCollectionNativeObject, [value]).length !== value.length + 1) return false;\n const lengthDescriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, \"length\"]);\n if (!lengthDescriptor || !lengthDescriptor.writable || lengthDescriptor.enumerable || lengthDescriptor.configurable || !(\"value\" in lengthDescriptor)) return false;\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, index]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor) || !check(descriptor.value)) return false;\n }\n return true;\n}\n\nfunction __velarSetTypeIs(value, check) {\n if (!__velarIsSet(value) || __velarCollectionHostCall(__velarCollectionSetSize, value, []) > 1000000) return false;\n const iterator = __velarCollectionSetTypeIterator(value);\n while (true) { const step = __velarCollectionSetTypeNext(iterator); if (step.done) break; if (!check(step.value)) return false; }\n return true;\n}\n\nfunction __velarMapTypeIs(value, check) {\n if (!__velarIsMap(value) || __velarCollectionHostCall(__velarCollectionMapSize, value, []) > 1000000) return false;\n const iterator = __velarCollectionMapTypeIterator(value);\n while (true) { const step = __velarCollectionMapTypeNext(iterator); if (step.done) break; const entry = step.value; if (!check(entry[0], entry[1])) return false; }\n return true;\n}\n\nfunction __velarRecordTypeIs(value, check) {\n if (!__velarIsRecord(value)) return false;\n const keys = __velarCollectionHostCall(__velarCollectionOwnKeys, __velarCollectionNativeReflect, [value]);\n if (keys.length > 1000000) return false;\n for (let index = 0; index < keys.length; index += 1) {\n const key = keys[index];\n if (typeof key !== \"string\") return false;\n const descriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor) || !check(descriptor.value)) return false;\n }\n return true;\n}\n\nconst __velarValidationErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarValidationError extends __velarCollectionNativeTypeError {\n constructor(message, detail) {\n super(message);\n this.name = \"ValidationError\";\n this.path = detail?.path ?? null;\n this.field = detail?.field ?? null;\n this.reason = detail?.reason ?? null;\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarValidationErrorDefineProperty(__VelarValidationError, \"name\", { value: \"ValidationError\", writable: false, enumerable: false, configurable: true });\n\nexport {\n __velarRegisterRuntimeType as registerRuntimeType,\n __velarValidationState as validationState,\n __velarValidationSet as validationSet,\n __velarValidationWeakMapGet as validationWeakMapGet,\n __velarValidationWeakMapSet as validationWeakMapSet,\n __velarValidationWeakMapDelete as validationWeakMapDelete,\n __velarValidationSetHas as validationSetHas,\n __velarValidationSetAdd as validationSetAdd,\n __velarValidationSetDelete as validationSetDelete,\n __velarValidationSetSize as validationSetSize,\n __velarValidationIsArray as validationIsArray,\n __velarValidationOwnDescriptor as validationOwnDescriptor,\n __velarValidationIsInstance as validationIsInstance,\n __velarValidationIsPromise as validationIsPromise,\n __velarValidationIsPlainObject as validationIsPlainObject,\n __velarValidationRejectionHint as validationRejectionHint,\n __velarValidationFreeze as validationFreeze,\n __velarListTypeIs as listTypeIs,\n __velarSetTypeIs as setTypeIs,\n __velarMapTypeIs as mapTypeIs,\n __velarRecordTypeIs as recordTypeIs,\n __VelarValidationError as ValidationError,\n};\n","const __velarCollectionNativeArray = globalThis.Array;\nconst __velarCollectionNativeMap = globalThis.Map;\nconst __velarCollectionNativeSet = globalThis.Set;\nconst __velarCollectionNativeObject = globalThis.Object;\nconst __velarCollectionNativeReflect = globalThis.Reflect;\nconst __velarCollectionNativeWeakMap = globalThis.WeakMap;\nconst __velarCollectionNativeTypeError = globalThis.TypeError;\nconst __velarCollectionGetOwnPropertyDescriptor = __velarCollectionNativeObject.getOwnPropertyDescriptor;\nconst __velarCollectionReflectApply = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"apply\")?.value;\nconst __velarCollectionArrayIsArray = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"isArray\")?.value;\nconst __velarCollectionGetPrototypeOf = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getPrototypeOf\")?.value;\nconst __velarCollectionObjectPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"prototype\")?.value;\nconst __velarCollectionMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeMap, \"prototype\")?.value;\nconst __velarCollectionSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeSet, \"prototype\")?.value;\nconst __velarCollectionMapSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"size\")?.get;\nconst __velarCollectionSetSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"size\")?.get;\nfunction __velarCollectionHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarCollectionReflectApply !== \"function\") throw new __velarCollectionNativeTypeError(\"The JavaScript collection runtime is unavailable\");\n return __velarCollectionReflectApply(operation, receiver, arguments_);\n}\nconst __velarCollectionWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeWeakMap, \"prototype\")?.value;\nconst __velarCollectionWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"get\")?.value;\nconst __velarCollectionWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"set\")?.value;\nconst __velarCollectionBrands = new __velarCollectionNativeWeakMap();\n// The only unforgeable, cross-realm Map/Set test JavaScript offers is invoking\n// the prototype 'size' getter and observing whether it throws, and a thrown and\n// caught exception costs roughly 1.8us -- paid by every Set membership test,\n// which probes Map first. Internal slots are fixed at construction, so the\n// verdict can never change for a given object: probe once, then answer from a\n// WeakMap. 0 = neither, 1 = Map, 2 = Set.\nfunction __velarCollectionBrand(value) {\n if (value === null || (typeof value !== \"object\" && typeof value !== \"function\")) return 0;\n const known = __velarCollectionHostCall(__velarCollectionWeakMapGetOperation, __velarCollectionBrands, [value]);\n if (known !== undefined) return known;\n let brand = 0;\n try { __velarCollectionHostCall(__velarCollectionMapSize, value, []); brand = 1; }\n catch {\n try { __velarCollectionHostCall(__velarCollectionSetSize, value, []); brand = 2; }\n catch { brand = 0; }\n }\n __velarCollectionHostCall(__velarCollectionWeakMapSetOperation, __velarCollectionBrands, [value, brand]);\n return brand;\n}\nfunction __velarIsMap(value) {\n return __velarCollectionBrand(value) === 1;\n}\nfunction __velarIsSet(value) {\n return __velarCollectionBrand(value) === 2;\n}\nfunction __velarIsRecord(value) {\n if (value === null || typeof value !== \"object\" || __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value])) return false;\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n return prototype === __velarCollectionObjectPrototype || prototype === null;\n}\n\nconst __velarCollectionListNativeNumber = globalThis.Number;\nconst __velarCollectionListNativeMath = globalThis.Math;\nconst __velarCollectionListNativeRangeError = globalThis.RangeError;\nconst __velarCollectionListArrayPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"prototype\")?.value;\nconst __velarCollectionListOwnNamesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionListOwnSymbolsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionListDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarCollectionListObjectIsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"is\")?.value;\nconst __velarCollectionListIntegerOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isInteger\")?.value;\nconst __velarCollectionListNaNOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isNaN\")?.value;\nconst __velarCollectionListFiniteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isFinite\")?.value;\nconst __velarCollectionListMaximumOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeMath, \"max\")?.value;\nconst __velarCollectionListMinimumOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeMath, \"min\")?.value;\nconst __velarCollectionListJoinOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"join\")?.value;\nconst __velarCollectionListSortOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"sort\")?.value;\nconst __velarCollectionListReverseOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"reverse\")?.value;\nfunction __velarCollectionListIsArray(value) { return __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]); }\nfunction __velarCollectionListGetOwnPropertyDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarCollectionListOwnNames(value) { return __velarCollectionHostCall(__velarCollectionListOwnNamesOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionListOwnSymbols(value) { return __velarCollectionHostCall(__velarCollectionListOwnSymbolsOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionListDefineProperty(value, key, descriptor) { return __velarCollectionHostCall(__velarCollectionListDefinePropertyOperation, __velarCollectionNativeObject, [value, key, descriptor]); }\nfunction __velarCollectionListObjectIs(left, right) { return __velarCollectionHostCall(__velarCollectionListObjectIsOperation, __velarCollectionNativeObject, [left, right]); }\nfunction __velarCollectionListIsInteger(value) { return __velarCollectionHostCall(__velarCollectionListIntegerOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListIsNaN(value) { return __velarCollectionHostCall(__velarCollectionListNaNOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListIsFinite(value) { return __velarCollectionHostCall(__velarCollectionListFiniteOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListMaximum(...values) { return __velarCollectionHostCall(__velarCollectionListMaximumOperation, __velarCollectionListNativeMath, values); }\nfunction __velarCollectionListMinimum(...values) { return __velarCollectionHostCall(__velarCollectionListMinimumOperation, __velarCollectionListNativeMath, values); }\nfunction __velarCollectionListHostJoin(value, separator) { return __velarCollectionHostCall(__velarCollectionListJoinOperation, value, [separator]); }\nfunction __velarCollectionListHostSort(value, compare) { return __velarCollectionHostCall(__velarCollectionListSortOperation, value, [compare]); }\nfunction __velarCollectionListHostReverse(value) { return __velarCollectionHostCall(__velarCollectionListReverseOperation, value, []); }\n\nconst __velarCollectionSetMapNativeRangeError = globalThis.RangeError;\nconst __velarCollectionSetMapFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nconst __velarCollectionSetAddOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"add\")?.value;\nconst __velarCollectionSetHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"has\")?.value;\nconst __velarCollectionSetDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"delete\")?.value;\nconst __velarCollectionSetClearOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"clear\")?.value;\nconst __velarCollectionSetValuesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"values\")?.value;\nconst __velarCollectionMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"get\")?.value;\nconst __velarCollectionMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"set\")?.value;\nconst __velarCollectionMapHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"has\")?.value;\nconst __velarCollectionMapDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"delete\")?.value;\nconst __velarCollectionMapClearOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"clear\")?.value;\nconst __velarCollectionMapKeysOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"keys\")?.value;\nconst __velarCollectionMapValuesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"values\")?.value;\nconst __velarCollectionMapEntriesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"entries\")?.value;\nconst __velarCollectionSetMapMapIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionMapEntriesOperation, new __velarCollectionNativeMap(), [])]);\nconst __velarCollectionSetMapSetIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionSetValuesOperation, new __velarCollectionNativeSet(), [])]);\nconst __velarCollectionSetMapMapIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetMapMapIteratorPrototype, \"next\")?.value;\nconst __velarCollectionSetMapSetIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetMapSetIteratorPrototype, \"next\")?.value;\nfunction __velarCollectionSetMapFreeze(value) { return __velarCollectionHostCall(__velarCollectionSetMapFreezeOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionSetMapSetSize(value) { return __velarCollectionHostCall(__velarCollectionSetSize, value, []); }\nfunction __velarCollectionSetMapMapSize(value) { return __velarCollectionHostCall(__velarCollectionMapSize, value, []); }\nfunction __velarCollectionSetMapSetAdd(value, item) { return __velarCollectionHostCall(__velarCollectionSetAddOperation, value, [item]); }\nfunction __velarCollectionSetMapSetHas(value, item) { return __velarCollectionHostCall(__velarCollectionSetHasOperation, value, [item]); }\nfunction __velarCollectionSetMapSetDelete(value, item) { return __velarCollectionHostCall(__velarCollectionSetDeleteOperation, value, [item]); }\nfunction __velarCollectionSetMapSetClear(value) { return __velarCollectionHostCall(__velarCollectionSetClearOperation, value, []); }\nfunction __velarCollectionSetMapSetValues(value) { return __velarCollectionHostCall(__velarCollectionSetValuesOperation, value, []); }\nfunction __velarCollectionSetMapSetNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetMapSetIteratorNext, iterator, []); }\nfunction __velarCollectionSetMapMapGet(value, key) { return __velarCollectionHostCall(__velarCollectionMapGetOperation, value, [key]); }\nfunction __velarCollectionSetMapMapSet(value, key, item) { return __velarCollectionHostCall(__velarCollectionMapSetOperation, value, [key, item]); }\nfunction __velarCollectionSetMapMapHas(value, key) { return __velarCollectionHostCall(__velarCollectionMapHasOperation, value, [key]); }\nfunction __velarCollectionSetMapMapDelete(value, key) { return __velarCollectionHostCall(__velarCollectionMapDeleteOperation, value, [key]); }\nfunction __velarCollectionSetMapMapClear(value) { return __velarCollectionHostCall(__velarCollectionMapClearOperation, value, []); }\nfunction __velarCollectionSetMapMapKeys(value) { return __velarCollectionHostCall(__velarCollectionMapKeysOperation, value, []); }\nfunction __velarCollectionSetMapMapValues(value) { return __velarCollectionHostCall(__velarCollectionMapValuesOperation, value, []); }\nfunction __velarCollectionSetMapMapEntries(value) { return __velarCollectionHostCall(__velarCollectionMapEntriesOperation, value, []); }\nfunction __velarCollectionSetMapMapNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetMapMapIteratorNext, iterator, []); }\n\nconst __velarCollectionRecordNativeRangeError = globalThis.RangeError;\nconst __velarCollectionRecordOwnNamesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionRecordOwnSymbolsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionRecordDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarCollectionRecordObjectIsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"is\")?.value;\nconst __velarCollectionRecordDeletePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"deleteProperty\")?.value;\nconst __velarCollectionRecordFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nfunction __velarCollectionRecordGetOwnPropertyDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarCollectionRecordOwnNames(value) { return __velarCollectionHostCall(__velarCollectionRecordOwnNamesOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionRecordOwnSymbols(value) { return __velarCollectionHostCall(__velarCollectionRecordOwnSymbolsOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionRecordDefineProperty(value, key, descriptor) { return __velarCollectionHostCall(__velarCollectionRecordDefinePropertyOperation, __velarCollectionNativeObject, [value, key, descriptor]); }\nfunction __velarCollectionRecordObjectIs(left, right) { return __velarCollectionHostCall(__velarCollectionRecordObjectIsOperation, __velarCollectionNativeObject, [left, right]); }\nfunction __velarCollectionRecordDeleteProperty(value, key) { return __velarCollectionHostCall(__velarCollectionRecordDeletePropertyOperation, __velarCollectionNativeReflect, [value, key]); }\nfunction __velarCollectionRecordFreeze(value) { return __velarCollectionHostCall(__velarCollectionRecordFreezeOperation, __velarCollectionNativeObject, [value]); }\n\nexport {\n __velarCollectionNativeArray,\n __velarCollectionNativeMap,\n __velarCollectionNativeSet,\n __velarCollectionNativeObject,\n __velarCollectionNativeTypeError,\n __velarCollectionGetPrototypeOf,\n __velarCollectionObjectPrototype,\n __velarCollectionHostCall,\n __velarIsMap,\n __velarIsSet,\n __velarIsRecord,\n __velarCollectionListNativeRangeError,\n __velarCollectionListIsArray,\n __velarCollectionListGetOwnPropertyDescriptor,\n __velarCollectionListOwnNames,\n __velarCollectionListOwnSymbols,\n __velarCollectionListDefineProperty,\n __velarCollectionListObjectIs,\n __velarCollectionListIsInteger,\n __velarCollectionListIsNaN,\n __velarCollectionListIsFinite,\n __velarCollectionListMaximum,\n __velarCollectionListMinimum,\n __velarCollectionListHostJoin,\n __velarCollectionListHostSort,\n __velarCollectionListHostReverse,\n __velarCollectionSetMapNativeRangeError,\n __velarCollectionSetMapFreeze,\n __velarCollectionSetMapSetSize,\n __velarCollectionSetMapMapSize,\n __velarCollectionSetMapSetAdd,\n __velarCollectionSetMapSetHas,\n __velarCollectionSetMapSetDelete,\n __velarCollectionSetMapSetClear,\n __velarCollectionSetMapSetValues,\n __velarCollectionSetMapSetNext,\n __velarCollectionSetMapMapGet,\n __velarCollectionSetMapMapSet,\n __velarCollectionSetMapMapHas,\n __velarCollectionSetMapMapDelete,\n __velarCollectionSetMapMapClear,\n __velarCollectionSetMapMapKeys,\n __velarCollectionSetMapMapValues,\n __velarCollectionSetMapMapEntries,\n __velarCollectionSetMapMapNext,\n __velarCollectionRecordNativeRangeError,\n __velarCollectionRecordGetOwnPropertyDescriptor,\n __velarCollectionRecordOwnNames,\n __velarCollectionRecordOwnSymbols,\n __velarCollectionRecordDefineProperty,\n __velarCollectionRecordObjectIs,\n __velarCollectionRecordDeleteProperty,\n __velarCollectionRecordFreeze,\n};\n","import {\n __velarCollectionNativeArray,\n __velarCollectionNativeMap,\n __velarCollectionNativeSet,\n __velarCollectionNativeObject,\n __velarCollectionNativeTypeError,\n __velarCollectionGetPrototypeOf,\n __velarCollectionObjectPrototype,\n __velarCollectionHostCall,\n __velarIsMap,\n __velarIsSet,\n __velarIsRecord,\n __velarCollectionListNativeRangeError,\n __velarCollectionListIsArray,\n __velarCollectionListGetOwnPropertyDescriptor,\n __velarCollectionListOwnNames,\n __velarCollectionListOwnSymbols,\n __velarCollectionListDefineProperty,\n __velarCollectionListObjectIs,\n __velarCollectionListIsInteger,\n __velarCollectionListIsNaN,\n __velarCollectionListIsFinite,\n __velarCollectionListMaximum,\n __velarCollectionListMinimum,\n __velarCollectionListHostJoin,\n __velarCollectionListHostSort,\n __velarCollectionListHostReverse,\n __velarCollectionSetMapNativeRangeError,\n __velarCollectionSetMapFreeze,\n __velarCollectionSetMapSetSize,\n __velarCollectionSetMapMapSize,\n __velarCollectionSetMapSetAdd,\n __velarCollectionSetMapSetHas,\n __velarCollectionSetMapSetDelete,\n __velarCollectionSetMapSetClear,\n __velarCollectionSetMapSetValues,\n __velarCollectionSetMapSetNext,\n __velarCollectionSetMapMapGet,\n __velarCollectionSetMapMapSet,\n __velarCollectionSetMapMapHas,\n __velarCollectionSetMapMapDelete,\n __velarCollectionSetMapMapClear,\n __velarCollectionSetMapMapKeys,\n __velarCollectionSetMapMapValues,\n __velarCollectionSetMapMapEntries,\n __velarCollectionSetMapMapNext,\n __velarCollectionRecordNativeRangeError,\n __velarCollectionRecordGetOwnPropertyDescriptor,\n __velarCollectionRecordOwnNames,\n __velarCollectionRecordOwnSymbols,\n __velarCollectionRecordDefineProperty,\n __velarCollectionRecordObjectIs,\n __velarCollectionRecordDeleteProperty,\n __velarCollectionRecordFreeze,\n} from \"velar/compiler-runtime-collections-v1\";\nimport {\n reactiveIterateKey as __velarReactiveIterateKey,\n reactiveStructureKey as __velarReactiveStructureKey,\n reactiveRaw as __velarReactiveRaw,\n reactiveCollectionRead as __velarReactiveCollectionRead,\n reactiveCollectionTrack as __velarReactiveCollectionTrack,\n reactiveCollectionLink as __velarReactiveCollectionLink,\n reactiveCollectionTrigger as __velarReactiveCollectionTrigger,\n reactiveCollectionUnlink as __velarReactiveCollectionUnlink,\n} from \"velar/compiler-runtime-reactive-v1\";\n\nconst __velarMaxCollectionItems = 1000000;\nconst __velarCollectionValue = value => value === undefined ? null : value;\nconst __velarSameValueZero = (left, right) => { left = __velarCollectionValue(left); right = __velarCollectionValue(right); return left === right || (left !== left && right !== right); };\nconst __velarListNativeWeakMap = globalThis.WeakMap;\nconst __velarListWeakMapPrototype = __velarCollectionListGetOwnPropertyDescriptor(__velarListNativeWeakMap, \"prototype\")?.value;\nconst __velarListWeakMapGetOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListWeakMapPrototype, \"get\")?.value;\nconst __velarListWeakMapSetOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListWeakMapPrototype, \"set\")?.value;\n// Ownership is the memo of a completed dense validation: the registry records\n// the element count the List had when it was proved dense. Any foreign length\n// change -- an unsafe push, a length assignment, a truncation -- breaks the\n// match and sends the List back through full validation, so a List that\n// crossed an unsafe boundary is never trusted on the strength of an older\n// check. Without the memo every index read on a List the compiler did not\n// build (a literal, anything velar/collections returns) revalidated every\n// element, making 'for i in range(n): values[i]' quadratic.\n//\n// COL-P1: the memo also records who wrote the elements, because that is what\n// decides how much a later read still has to prove. An *owned* List holds only\n// elements this runtime wrote: it either allocated and filled the array itself\n// (every copy, map, filter, slice, and sorted result) or started from the empty\n// List literal the compiler emitted __velarAdoptList for and took every element\n// since through a List mutation. Every slot is then an ordinary data element by\n// construction, and reading one is a plain load -- the same load List.sorted\n// already performs on its own copy. A *checked* List held elements this runtime\n// did not write when it first saw it, so every element read re-proves the slot\n// with a descriptor, and an accessor installed after validation is still\n// refused. Every array that arrives from JavaScript is checked, including one\n// handed over empty: the runtime cannot tell that array from a List literal, so\n// only the compiler ever adopts an empty array.\n//\n// Before the split every element read of every List allocated two property\n// descriptors, so summing a 1,000,000-element List by index ran ~7x slower\n// than the identical plain-JavaScript loop and 'for x in xs' ~9x slower.\n//\n// One registry answers both halves in one lookup, because a second WeakMap read\n// on the checked tier cost every literal-built List ~10% for nothing: an owned\n// List records the proved length, a checked List records its bitwise\n// complement, and a length is never negative, so the sign is the tier.\nconst __velarListMemos = new __velarListNativeWeakMap();\nconst __velarListIsFrozenOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"isFrozen\")?.value;\n// COL-U4: a frozen host array fails every mutability probe below; without\n// this check the author sees \"requires ordinary mutable List data elements\"\n// with no way out. Freezing is a whole-value verdict, so it is answered once\n// with the copy-on-the-JavaScript-side workflow.\nfunction __velarListRejectFrozen(value, name) {\n if (__velarCollectionHostCall(__velarListIsFrozenOperation, __velarCollectionNativeObject, [value])) {\n throw new __velarCollectionNativeTypeError(name + \" received a frozen JavaScript array; copy it on the JavaScript side — [...values] — before passing it to VelarScript\");\n }\n}\nfunction __velarListMemo(value) { return __velarCollectionHostCall(__velarListWeakMapGetOperation, __velarListMemos, [value]); }\n// The owned half of __velarListTier, for the callers that have already\n// validated the List and only need to know which element read to use.\nfunction __velarListIsOwned(value) { const memo = __velarListMemo(value); return memo !== undefined && memo === value.length; }\nfunction __velarAdoptList(value) { __velarCollectionHostCall(__velarListWeakMapSetOperation, __velarListMemos, [value, value.length]); return value; }\nfunction __velarMarkCheckedList(value) { __velarCollectionHostCall(__velarListWeakMapSetOperation, __velarListMemos, [value, ~value.length]); return value; }\n// A mutation re-records the proved length; it never changes which side of the\n// boundary the List came from, so a host List stays checked for its whole life.\nfunction __velarMarkOwnedList(value) {\n const memo = __velarListMemo(value);\n return memo !== undefined && memo < 0 ? __velarMarkCheckedList(value) : __velarAdoptList(value);\n}\n// COL-U4/COL-P1: freezing is the one foreign change that revokes the right to\n// mutate without moving the length, so it survives every memo hit. Every\n// operation that writes re-proves this descriptor -- one descriptor per\n// operation, never per element -- and no read has to, because reading a slot\n// does not require a mutable length. Without it a frozen List answers append,\n// index assignment, and pop with the host's own \"Cannot assign to read only\n// property 'length'\" instead of a VelarScript refusal.\nfunction __velarListRequireMutableLength(value, name) {\n const lengthDescriptor = __velarCollectionListGetOwnPropertyDescriptor(value, \"length\");\n if (!lengthDescriptor || !lengthDescriptor.writable || lengthDescriptor.enumerable || lengthDescriptor.configurable || !(\"value\" in lengthDescriptor)) throw new __velarCollectionNativeTypeError(name + \" requires an ordinary mutable List length\");\n}\nfunction __velarValidateDenseList(value, name) {\n value = __velarReactiveRaw(value);\n if (!__velarCollectionListIsArray(value) || value.length > __velarMaxCollectionItems || __velarCollectionListOwnSymbols(value).length > 0 || __velarCollectionListOwnNames(value).length !== value.length + 1) {\n throw new __velarCollectionNativeTypeError(name + \" requires a dense VelarScript List\");\n }\n __velarListRejectFrozen(value, name);\n __velarListRequireMutableLength(value, name);\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = __velarCollectionListGetOwnPropertyDescriptor(value, index);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable List data elements\");\n }\n // COL-P1: this runtime can vouch for a slot it wrote and for no other, and\n // full validation only ever runs on an array whose slots it did not write --\n // one that arrived from JavaScript, or one whose length moved behind its\n // back, which is itself proof the host is holding the array. The arrays this\n // runtime did write are adopted where they are built, and the empty List\n // literal is adopted by the code the compiler emitted for it, so nothing that\n // reaches here is owned, including an array the host handed over empty.\n return __velarMarkCheckedList(value);\n}\n// 0 = no memo this runtime can still stand behind, 1 = owned, 2 = checked.\n// The registry answers undefined for a primitive, and the recorded length is\n// only compared once it exists, so the length is never read off a non-object.\nfunction __velarListTier(value) {\n const memo = __velarListMemo(value);\n if (memo === undefined) return 0;\n if (memo === value.length) return 1;\n return ~memo === value.length ? 2 : 0;\n}\nfunction __velarValidateListTier(value, name, tier) {\n // An owned memo hit answers every probe below at once: this runtime wrote\n // every element, proved the array dense with an ordinary mutable length, and\n // re-recorded the length after each of its own mutations since. Reading is\n // all this entry point promises, so it does not re-prove the mutable length;\n // __velarValidateMutableList is the entry point for everything that writes.\n if (tier === 1) return value;\n if (tier === 0) return __velarValidateDenseList(value, name);\n // A checked memo hit already proved the array dense and in range; the length\n // descriptor is the one part of that verdict a foreign write can undo\n // without moving the length itself.\n __velarListRequireMutableLength(value, name);\n return value;\n}\nfunction __velarValidateOwnedList(value, name) {\n value = __velarReactiveRaw(value);\n return __velarValidateListTier(value, name, __velarListTier(value));\n}\n// The entry point for every operation that writes: it proves what a read\n// proves and re-proves the mutable length on top of it, on both memo tiers, so\n// a frozen List refuses in the same voice whoever built it.\nfunction __velarValidateMutableList(value, name) {\n value = __velarReactiveRaw(value);\n const tier = __velarListTier(value);\n if (tier === 0) return __velarValidateDenseList(value, name);\n __velarListRequireMutableLength(value, name);\n return value;\n}\nfunction __velarCheckedListElement(value, index, name) {\n const descriptor = __velarCollectionListGetOwnPropertyDescriptor(value, index);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable List data elements\");\n return descriptor.value;\n}\n// The load is the whole check on an owned List: this runtime wrote every slot,\n// so there is nothing left to prove about the shape of one. A slot that reads\n// as undefined is the one tamper the load still notices for free -- no List\n// element is ever undefined -- so that case pays for the descriptor probe and\n// reports the same refusal a checked List would. What it notices is a value\n// the load cannot account for, not every foreign edit: a host that keeps a\n// reference to a List this runtime owns and then rewrites a slot, installs an\n// accessor on it, or empties it while a polluted array prototype answers for\n// that index, gets its own value back. That is the residual the split accepts,\n// the same one a plain foreign write always had, and [COL-P1] pins it.\nfunction __velarOwnedListElement(value, index, name) {\n const element = value[index];\n return element === undefined ? __velarCheckedListElement(value, index, name) : element;\n}\nfunction __velarListElement(value, index, name, owned) {\n return owned ? __velarOwnedListElement(value, index, name) : __velarCheckedListElement(value, index, name);\n}\nfunction* __velarReactiveListIterator(value) { __velarReactiveCollectionTrack(value); value = __velarValidateOwnedList(value, \"List iteration\"); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) yield __velarReactiveCollectionRead(value, __velarReactiveIterateKey, __velarListElement(value, index, \"List iteration\", owned)); }\nfunction* __velarReactiveSetIterator(value) { const size = __velarCollectionSetMapSetSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); __velarReactiveCollectionTrack(value); const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return; yield __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); } }\nfunction* __velarReactiveMapKeyIterator(value) { const size = __velarCollectionSetMapMapSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const iterator = __velarCollectionSetMapMapKeys(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return; yield __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value); } }\nfunction* __velarReactiveRecordIterator(value) { const fields = __velarRecordFields(value, \"Record iteration\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); for (let index = 0; index < fields.length; index += 1) yield __velarReactiveCollectionRead(value, __velarReactiveStructureKey, fields[index]); }\nfunction __velarCopyList(value, name) {\n // Every callback operation snapshots through here, so this loop is what\n // decides what map costs before its first call: the ownership memo answers\n // the whole-List validation, and on an owned List each element is a load.\n value = __velarValidateOwnedList(value, name);\n const owned = __velarListIsOwned(value);\n const output = [];\n for (let index = 0; index < value.length; index += 1) output[index] = __velarCollectionValue(__velarListElement(value, index, name, owned));\n return __velarAdoptList(output);\n}\n// TXT-D1: ordered string comparison is code-point order (= UTF-8 binary\n// order) everywhere. UTF-16 code-unit order agrees exactly when neither\n// operand contains a surrogate, so the one native regex probe keeps the\n// decoded walk on surrogate-bearing strings only.\nconst __velarListNativeString = globalThis.String;\nconst __velarListStringPrototype = __velarCollectionListGetOwnPropertyDescriptor(__velarListNativeString, \"prototype\")?.value;\nconst __velarListStringCharCodeAt = __velarCollectionListGetOwnPropertyDescriptor(__velarListStringPrototype, \"charCodeAt\")?.value;\nconst __velarListSurrogatePattern = /[\\uD800-\\uDFFF]/;\nconst __velarListRegExpPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarListSurrogatePattern]);\nconst __velarListSurrogateExecOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListRegExpPrototype, \"exec\")?.value;\nfunction __velarListCharCode(value, index) { return __velarCollectionHostCall(__velarListStringCharCodeAt, value, [index]); }\nfunction __velarListHasSurrogate(value) { return __velarCollectionHostCall(__velarListSurrogateExecOperation, __velarListSurrogatePattern, [value]) !== null; }\nfunction __velarCodePointCompare(left, right) {\n if (left === right) return 0;\n if (!__velarListHasSurrogate(left) && !__velarListHasSurrogate(right)) return left < right ? -1 : 1;\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarListCharCode(left, leftOffset);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarListCharCode(left, leftOffset + 1);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarListCharCode(right, rightOffset);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarListCharCode(right, rightOffset + 1);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\nfunction __velarOrderedCompare(kind, left, right) {\n if (kind === \"string\") return __velarCodePointCompare(left, right);\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarRecordFields(value, name) {\n value = __velarReactiveRaw(value);\n if (!__velarIsRecord(value) || __velarCollectionRecordOwnSymbols(value).length > 0) throw new __velarCollectionNativeTypeError(name + \" requires a plain Record\");\n const fields = __velarCollectionRecordOwnNames(value);\n if (fields.length > __velarMaxCollectionItems) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n for (let index = 0; index < fields.length; index += 1) {\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, fields[index]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable enumerable data fields\");\n }\n return fields;\n}\n\nfunction __velarCollectionIterator(value) {\n if (typeof value === \"string\") return String.prototype[Symbol.iterator].call(value);\n value = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(value)) return __velarReactiveListIterator(value);\n if (__velarIsMap(value)) return __velarReactiveMapKeyIterator(value);\n if (__velarIsSet(value)) return __velarReactiveSetIterator(value);\n if (__velarIsRecord(value)) return __velarReactiveRecordIterator(value);\n throw new __velarCollectionNativeTypeError(\"VelarScript iteration requires a List, Set, Map, or Record\");\n}\nfunction* __velarReactiveMapPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCheckedMapSize(raw, \"Map iteration\") > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarReactiveCollectionTrack(raw);\n const iterator = __velarCollectionSetMapMapEntries(raw);\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return; const entry = step.value; yield [__velarReactiveCollectionRead(raw, __velarReactiveIterateKey, entry[0]), __velarReactiveCollectionRead(raw, entry[0], entry[1])]; }\n}\nfunction* __velarReactiveRecordPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n const fields = __velarRecordFields(raw, \"Record iteration\");\n __velarReactiveCollectionTrack(raw);\n for (let index = 0; index < fields.length; index += 1) {\n const field = fields[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(raw, field);\n // COL-D1: the key snapshot can outlive the field — a body that removes\n // a later key must see that key skipped (Map iteration parity), not a\n // raw TypeError from reading a missing descriptor.\n if (descriptor === undefined) continue;\n yield [__velarReactiveCollectionRead(raw, __velarReactiveIterateKey, field), __velarReactiveCollectionRead(raw, field, descriptor.value)];\n }\n}\nfunction* __velarCollectionPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarIsMap(raw)) { yield* __velarReactiveMapPairIterator(raw); return; }\n if (__velarIsRecord(raw)) { yield* __velarReactiveRecordPairIterator(raw); return; }\n let index = 0;\n for (const item of __velarCollectionIterator(value)) yield [item, index++];\n}\n\nfunction __velarCheckedMapSize(value, name) {\n try { return __velarCollectionSetMapMapSize(value); }\n catch { throw new __velarCollectionNativeTypeError(name + \" requires a Map\"); }\n}\nfunction __velarCheckedSetSize(value, name) {\n try { return __velarCollectionSetMapSetSize(value); }\n catch { throw new __velarCollectionNativeTypeError(name + \" requires a Set\"); }\n}\nfunction __velarListSize(value) { value = __velarValidateOwnedList(value, \"List size\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); return value.length; }\nfunction __velarMapSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const size = __velarCheckedMapSize(value, \"Map.size\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); return size; }\nfunction __velarSetSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const size = __velarCheckedSetSize(value, \"Set.size\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); return size; }\nfunction __velarRecordSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); return __velarRecordFields(value, \"Record size\").length; }\nfunction __velarCollectionSize(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListSize(raw);\n if (__velarIsRecord(raw)) return __velarRecordSize(raw);\n if (__velarIsMap(raw)) return __velarMapSize(raw);\n if (__velarIsSet(raw)) return __velarSetSize(raw);\n throw new __velarCollectionNativeTypeError(\"VelarScript size requires a List, Set, Map, or Record\");\n}\n\nfunction __velarCreateList(parts) {\n const output = [];\n __velarValidateDenseList(parts, \"List construction parts\");\n for (let partIndex = 0; partIndex < parts.length; partIndex += 1) {\n const part = __velarValidateDenseList(__velarCollectionListGetOwnPropertyDescriptor(parts, partIndex).value, \"List construction part\");\n const spread = part[0];\n const read = part[1];\n if (!spread) {\n if (output.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n output[output.length] = __velarCollectionValue(read());\n continue;\n }\n const values = __velarValidateOwnedList(read(), \"List spread\");\n const spreadOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let index = 0; index < values.length; index += 1) output[output.length] = __velarCollectionValue(__velarListElement(values, index, \"List spread\", spreadOwned));\n }\n return __velarAdoptList(output);\n}\nasync function __velarCreateListAsync(parts) {\n const output = [];\n __velarValidateDenseList(parts, \"List construction parts\");\n for (let partIndex = 0; partIndex < parts.length; partIndex += 1) {\n const part = __velarValidateDenseList(__velarCollectionListGetOwnPropertyDescriptor(parts, partIndex).value, \"List construction part\");\n const spread = part[0];\n const asynchronous = part[1];\n const read = part[2];\n if (!spread) {\n if (output.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n output[output.length] = __velarCollectionValue(asynchronous ? await read() : read());\n continue;\n }\n const values = __velarValidateOwnedList(asynchronous ? await read() : read(), \"List spread\");\n const spreadOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let index = 0; index < values.length; index += 1) output[output.length] = __velarCollectionValue(__velarListElement(values, index, \"List spread\", spreadOwned));\n }\n return __velarAdoptList(output);\n}\n\n// Members and keys are stored raw. Every membership and key lookup unwraps\n// its argument (docs/web-api.md: \"Map keys and Set members are unwrapped\n// before lookup\"), so a construction that stored a reactive proxy would split\n// member identity and make every later lookup miss.\nfunction __velarCreateSet(value) {\n const output = new __velarCollectionNativeSet();\n if (value === undefined) return output;\n value = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(value)) { const values = __velarValidateOwnedList(value, \"Set construction\"); const owned = __velarListIsOwned(values); for (let index = 0; index < values.length; index += 1) __velarCollectionSetMapSetAdd(output, __velarCollectionValue(__velarReactiveRaw(__velarListElement(values, index, \"Set construction\", owned)))); return output; }\n if (!__velarIsSet(value)) throw new __velarCollectionNativeTypeError(\"Set construction requires a List or Set\");\n if (__velarCollectionSetMapSetSize(value) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; __velarCollectionSetMapSetAdd(output, __velarCollectionValue(__velarReactiveRaw(step.value))); }\n}\n\nfunction __velarCreateMap(value) {\n const output = new __velarCollectionNativeMap();\n if (value === undefined) return output;\n value = __velarReactiveRaw(value);\n if (__velarIsMap(value)) {\n if (__velarCollectionSetMapMapSize(value) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const iterator = __velarCollectionSetMapMapEntries(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return output; const entry = step.value; __velarCollectionSetMapMapSet(output, __velarCollectionValue(__velarReactiveRaw(entry[0])), __velarCollectionValue(__velarReactiveRaw(entry[1]))); }\n }\n if (__velarCollectionListIsArray(value)) {\n const entries = __velarValidateOwnedList(value, \"Map construction\");\n const entriesOwned = __velarListIsOwned(entries);\n for (let index = 0; index < entries.length; index += 1) {\n const entry = __velarValidateOwnedList(__velarListElement(entries, index, \"Map construction\", entriesOwned), \"Map entry construction\");\n if (entry.length !== 2) throw new __velarCollectionNativeTypeError(\"Map entry construction requires exactly [key, value]\");\n const entryOwned = __velarListIsOwned(entry);\n __velarCollectionSetMapMapSet(output, __velarCollectionValue(__velarReactiveRaw(__velarListElement(entry, 0, \"Map entry construction\", entryOwned))), __velarCollectionValue(__velarReactiveRaw(__velarListElement(entry, 1, \"Map entry construction\", entryOwned))));\n }\n return output;\n }\n if (value && typeof value === \"object\") {\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n const names = __velarCollectionRecordOwnNames(value);\n if ((prototype !== __velarCollectionObjectPrototype && prototype !== null) || __velarCollectionRecordOwnSymbols(value).length > 0 || names.length > __velarMaxCollectionItems) throw new __velarCollectionNativeTypeError(\"Map record construction requires an ordinary record\");\n for (let index = 0; index < names.length; index += 1) {\n const name = names[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(\"Map record construction requires own enumerable data fields\");\n __velarCollectionSetMapMapSet(output, name, __velarCollectionValue(__velarReactiveRaw(descriptor.value)));\n }\n return output;\n }\n throw new __velarCollectionNativeTypeError(\"Map construction requires a Map, a List of [key, value] Lists, or a record\");\n}\n\nfunction __velarListGet(value, key) {\n value = __velarValidateOwnedList(value, \"List.get\");\n if (!__velarCollectionListIsInteger(key)) throw new __VelarIndexError(\"List.get index must be an integer\");\n const index = key < 0 ? value.length + key : key;\n if (index >= 0 && index < value.length) return __velarReactiveCollectionRead(value, index, __velarListElement(value, index, \"List.get\", __velarListIsOwned(value)));\n __velarReactiveCollectionTrack(value, key < 0 ? __velarReactiveIterateKey : index);\n __velarReactiveCollectionTrack(value);\n return null;\n}\nfunction __velarRecordGet(value, key) {\n value = __velarReactiveRaw(value);\n if (typeof key !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.get requires a string key\");\n __velarRecordFields(value, \"Record.get\");\n __velarReactiveCollectionTrack(value, key);\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, key);\n return descriptor === undefined ? null : __velarReactiveCollectionRead(value, key, descriptor.value);\n}\nfunction __velarMapGet(value, key) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedMapSize(value, \"Map.get\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n key = __velarReactiveRaw(key);\n __velarReactiveCollectionTrack(value, key);\n const item = __velarCollectionSetMapMapGet(value, key);\n return item === undefined ? null : __velarReactiveCollectionRead(value, key, item);\n}\nfunction __velarCollectionGet(value, key) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListGet(raw, key);\n if (__velarIsRecord(raw)) return __velarRecordGet(raw, key);\n return __velarMapGet(raw, key);\n}\n\nfunction __velarCollectionSlice(value, start = 0, end = null) {\n value = __velarValidateOwnedList(value, \"List.slice\");\n __velarReactiveCollectionTrack(value);\n if (end === null) end = value.length;\n // COL-I2: every List position error is an IndexError.\n if (!__velarCollectionListIsInteger(start) || !__velarCollectionListIsInteger(end)) {\n throw new __VelarIndexError(\"List.slice positions must be integers\");\n }\n const length = value.length;\n const first = start < 0 ? __velarCollectionListMaximum(length + start, 0) : __velarCollectionListMinimum(start, length);\n const last = end < 0 ? __velarCollectionListMaximum(length + end, 0) : __velarCollectionListMinimum(end, length);\n const owned = __velarListIsOwned(value);\n const output = [];\n for (let index = first; index < __velarCollectionListMaximum(first, last); index += 1) output[output.length] = __velarReactiveCollectionRead(value, index, __velarListElement(value, index, \"List.slice\", owned));\n return __velarAdoptList(output);\n}\n\nclass __VelarIndexError extends __velarCollectionListNativeRangeError {\n constructor(message) {\n super(message);\n this.name = \"IndexError\";\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarCollectionListDefineProperty(__VelarIndexError, \"name\", { value: \"IndexError\", writable: false, enumerable: false, configurable: true });\nfunction __velarStrictListIndex(value, requested) {\n if (!__velarCollectionListIsInteger(requested)) throw new __VelarIndexError(\"List index must be an in-range integer\");\n const index = requested < 0 ? value.length + requested : requested;\n if (index < 0 || index >= value.length) throw new __VelarIndexError(\"List index must be an in-range integer\");\n return index;\n}\nfunction __velarListIndexGet(value, index) {\n value = __velarReactiveRaw(value);\n // The hottest read in the language, so it resolves the tier itself rather\n // than through __velarValidateOwnedList, which would read the owned registry\n // a second time. Past this branch the List is checked: a tier-0 value that\n // full validation adopts as owned was empty, and an empty List has no index\n // to read.\n const tier = __velarListTier(value);\n if (tier === 1) {\n index = __velarStrictListIndex(value, index);\n return __velarReactiveCollectionRead(value, index, __velarOwnedListElement(value, index, \"List index\"));\n }\n value = __velarValidateListTier(value, \"List index\", tier);\n index = __velarStrictListIndex(value, index);\n return __velarReactiveCollectionRead(value, index, __velarCheckedListElement(value, index, \"List index\"));\n}\nfunction __velarRecordIndexGet(value, index) {\n value = __velarReactiveRaw(value);\n if (typeof index !== \"string\") throw new __velarCollectionNativeTypeError(\"Record index requires a plain record and a string key\");\n __velarRecordFields(value, \"Record index\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, index);\n return __velarReactiveCollectionRead(value, index, descriptor?.value);\n}\nfunction __velarIndex(value, index) {\n const raw = __velarReactiveRaw(value);\n return __velarCollectionListIsArray(raw) ? __velarListIndexGet(raw, index) : __velarRecordIndexGet(raw, index);\n}\nfunction __velarOptionalIndex(value, index) {\n return value == null ? null : __velarIndex(value, index());\n}\nfunction __velarListIndexSet(value, index, next) {\n value = __velarValidateMutableList(value, \"List index assignment\");\n index = __velarStrictListIndex(value, index);\n const previous = __velarListElement(value, index, \"List index assignment\", __velarListIsOwned(value));\n next = __velarReactiveRaw(next);\n if (__velarCollectionListObjectIs(__velarReactiveRaw(previous), next)) return next;\n value[index] = next;\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, next);\n __velarReactiveCollectionTrigger(value, index, true, false);\n __velarMarkOwnedList(value);\n return next;\n}\nfunction __velarRecordIndexSet(value, index, next) {\n value = __velarReactiveRaw(value);\n if (typeof index !== \"string\") throw new __velarCollectionNativeTypeError(\"Record index assignment requires a plain record and a string key\");\n const fields = __velarRecordFields(value, \"Record index assignment\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, index);\n if (descriptor === undefined && fields.length >= 1000000) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n const previous = descriptor?.value;\n next = __velarReactiveRaw(next);\n if (descriptor !== undefined && __velarCollectionRecordObjectIs(__velarReactiveRaw(previous), next)) return next;\n __velarCollectionRecordDefineProperty(value, index, { value: next, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, next);\n __velarReactiveCollectionTrigger(value, index, true, descriptor === undefined);\n return next;\n}\nfunction __velarSetIndex(value, index, next) {\n const raw = __velarReactiveRaw(value);\n return __velarCollectionListIsArray(raw) ? __velarListIndexSet(raw, index, next) : __velarRecordIndexSet(raw, index, next);\n}\n\nfunction __velarListAppend(value, item) {\n value = __velarValidateMutableList(value, \"List.append\");\n if (value.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n item = __velarReactiveRaw(item);\n const index = value.length;\n __velarCollectionListDefineProperty(value, index, { value: item, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n __velarMarkOwnedList(value);\n return null;\n}\n\nfunction __velarListExtend(value, items) {\n value = __velarValidateMutableList(value, \"List.extend\");\n items = __velarValidateOwnedList(items, \"List.extend\");\n if (value.length + items.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n const start = value.length;\n const count = items.length;\n const itemsOwned = __velarListIsOwned(items);\n for (let index = 0; index < count; index += 1) { const item = __velarReactiveRaw(__velarListElement(items, index, \"List.extend\", itemsOwned)); __velarCollectionListDefineProperty(value, value.length, { value: item, writable: true, enumerable: true, configurable: true }); __velarReactiveCollectionLink(value, item); }\n if (count > 0) __velarReactiveCollectionTrigger(value, start, true, true, start);\n __velarMarkOwnedList(value);\n return null;\n}\n\nfunction __velarListInsert(value, index, item) {\n value = __velarValidateMutableList(value, \"List.insert\");\n // COL-I2: every List position error is an IndexError, and the accepted\n // range 0..size (inclusive) is the charter's insert contract.\n if (!__velarCollectionListIsInteger(index) || index < 0 || index > value.length) throw new __VelarIndexError(\"List.insert index must be an integer from 0 through size\");\n if (value.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n item = __velarReactiveRaw(item);\n // COL-P1: the tier is read before the new slot lands, because appending it\n // moves the length past the recorded one, and every shift below would then\n // take the descriptor path on a List this runtime wrote in full.\n const owned = __velarListIsOwned(value);\n __velarCollectionListDefineProperty(value, value.length, { value: item, writable: true, enumerable: true, configurable: true });\n for (let cursor = value.length - 1; cursor > index; cursor -= 1) value[cursor] = __velarListElement(value, cursor - 1, \"List.insert\", owned);\n value[index] = item;\n __velarMarkOwnedList(value);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n return null;\n}\n\nfunction __velarListPop(value, requested = -1) {\n value = __velarValidateMutableList(value, \"List.pop\");\n if (!__velarCollectionListIsInteger(requested)) throw new __VelarIndexError(\"List.pop index must be an integer\");\n const index = requested < 0 ? value.length + requested : requested;\n if (value.length === 0) throw new __VelarIndexError(\"List.pop requires a non-empty List\");\n if (index < 0 || index >= value.length) throw new __VelarIndexError(\"List.pop index must be an in-range integer\");\n const owned = __velarListIsOwned(value);\n const item = __velarListElement(value, index, \"List.pop\", owned);\n for (let cursor = index; cursor < value.length - 1; cursor += 1) value[cursor] = __velarListElement(value, cursor + 1, \"List.pop\", owned);\n value.length -= 1;\n __velarMarkOwnedList(value);\n __velarReactiveCollectionUnlink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n return item;\n}\nfunction __velarListRemove(value, item) { value = __velarValidateOwnedList(value, \"List.remove\"); item = __velarReactiveRaw(item); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.remove\", owned)), item)) { __velarListPop(value, index); return true; } return false; }\nfunction __velarListCopy(value) { __velarReactiveCollectionTrack(value); return __velarCopyList(value, \"List.copy\"); }\nfunction __velarListCount(value, item) { value = __velarValidateOwnedList(value, \"List.count\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); let count = 0; for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.count\", owned)), item)) count += 1; return count; }\nfunction __velarListFind(value, predicate) { const items = __velarCopyList(value, \"List.find\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); const accepted = predicate(item); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.find predicate must return bool\"); if (accepted) return item; } return null; }\nfunction __velarListIndex(value, item) { value = __velarValidateOwnedList(value, \"List.index\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.index\", owned)), item)) return index; return null; }\nfunction __velarListSome(value, predicate) { const items = __velarCopyList(value, \"List.some\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const accepted = predicate(__velarReactiveCollectionRead(value, index, items[index])); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.some predicate must return bool\"); if (accepted) return true; } return false; }\nfunction __velarListEvery(value, predicate) { const items = __velarCopyList(value, \"List.every\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const accepted = predicate(__velarReactiveCollectionRead(value, index, items[index])); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.every predicate must return bool\"); if (!accepted) return false; } return true; }\nfunction __velarListMap(value, transform) { const items = __velarCopyList(value, \"List.map\"); __velarReactiveCollectionTrack(value); const output = new __velarCollectionNativeArray(items.length); for (let index = 0; index < items.length; index += 1) { const item = transform(__velarReactiveCollectionRead(value, index, items[index])); output[index] = item === undefined ? null : __velarReactiveRaw(item); } return __velarAdoptList(output); }\nfunction __velarListFilter(value, predicate) { const items = __velarCopyList(value, \"List.filter\"); __velarReactiveCollectionTrack(value); const output = []; for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); const accepted = predicate(item); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.filter predicate must return bool\"); if (accepted) output[output.length] = __velarReactiveRaw(item); } return __velarAdoptList(output); }\nfunction __velarListReduce(value, combine, initial) { const items = __velarCopyList(value, \"List.reduce\"); __velarReactiveCollectionTrack(value); let result = initial; for (let index = 0; index < items.length; index += 1) { const next = combine(result, __velarReactiveCollectionRead(value, index, items[index])); result = next === undefined ? null : next; } return result; }\nfunction __velarListJoin(value, separator = \"\") { value = __velarValidateOwnedList(value, \"List.join\"); __velarReactiveCollectionTrack(value); if (typeof separator !== \"string\") throw new __velarCollectionNativeTypeError(\"List.join separator must be string\"); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (typeof __velarListElement(value, index, \"List.join\", owned) !== \"string\") throw new __velarCollectionNativeTypeError(\"List.join requires string values\"); return __velarCollectionListHostJoin(value, separator); }\nfunction __velarOrderedListValue(value, name, kind = null) { const current = typeof value; if (current === \"number\" && __velarCollectionListIsNaN(value)) throw new __velarCollectionNativeTypeError(name + \" found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\"); if ((current !== \"string\" && current !== \"number\") || (kind !== null && current !== kind)) throw new __velarCollectionNativeTypeError(name + \" requires uniform numbers or strings\"); return current; }\nfunction __velarListSorted(value, compare = null, by = null) {\n if (compare !== null && by !== null) throw new __velarCollectionNativeTypeError(\"List.sorted accepts either a comparator or by, not both\");\n if (compare !== null && typeof compare !== \"function\") throw new __velarCollectionNativeTypeError(\"List.sorted comparator must be a function\");\n if (by !== null && typeof by !== \"function\") throw new __velarCollectionNativeTypeError(\"List.sorted by must be a function\");\n __velarReactiveCollectionTrack(value);\n const output = __velarCopyList(value, \"List.sorted\");\n if (by !== null) {\n let kind = null;\n const decorated = new __velarCollectionNativeArray(output.length);\n for (let index = 0; index < output.length; index += 1) { const item = output[index]; const key = by(__velarReactiveCollectionRead(value, index, item)); kind = __velarOrderedListValue(key, \"List.sorted by\", kind); decorated[index] = { item, key }; }\n __velarCollectionListHostSort(decorated, (left, right) => __velarOrderedCompare(kind, left.key, right.key));\n const selected = new __velarCollectionNativeArray(decorated.length);\n for (let index = 0; index < decorated.length; index += 1) selected[index] = decorated[index].item;\n return __velarAdoptList(selected);\n }\n let kind = null;\n if (compare === null) { for (let index = 0; index < output.length; index += 1) kind = __velarOrderedListValue(output[index], \"List.sorted()\", kind); }\n const compareValues = compare ?? ((left, right) => { kind = __velarOrderedListValue(left, \"List.sorted()\", kind); __velarOrderedListValue(right, \"List.sorted()\", kind); return __velarOrderedCompare(kind, left, right); });\n __velarCollectionListHostSort(output, (left, right) => { const order = compareValues(left, right); if (typeof order !== \"number\" || !__velarCollectionListIsFinite(order)) throw new __velarCollectionNativeTypeError(\"List.sorted comparator must return a finite number\"); return order; });\n return output;\n}\nfunction __velarListSum(value) { const items = __velarCopyList(value, \"List.sum\"); __velarReactiveCollectionTrack(value); let total = 0; for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); if (typeof item !== \"number\") throw new __velarCollectionNativeTypeError(\"List.sum requires numbers\"); if (__velarCollectionListIsNaN(item)) throw new __velarCollectionNativeTypeError(\"List.sum found NaN, which poisons the total; drop it with filter(x => not x.isNaN()) or fix the upstream computation\"); total += item; } return total; }\nfunction __velarListExtremum(value, maximum) { const items = __velarCopyList(value, maximum ? \"List.max\" : \"List.min\"); __velarReactiveCollectionTrack(value); if (items.length === 0) return null; let result = __velarReactiveCollectionRead(value, 0, items[0]); let kind = __velarOrderedListValue(result, maximum ? \"List.max\" : \"List.min\"); for (let index = 1; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); __velarOrderedListValue(item, maximum ? \"List.max\" : \"List.min\", kind); const order = __velarOrderedCompare(kind, item, result); if (maximum ? order > 0 : order < 0) result = item; } return result; }\nfunction __velarListMin(value) { return __velarListExtremum(value, false); }\nfunction __velarListMax(value) { return __velarListExtremum(value, true); }\nfunction __velarListReversed(value) { __velarReactiveCollectionTrack(value); const output = __velarCopyList(value, \"List.reversed\"); __velarCollectionListHostReverse(output); return output; }\n// COL-U1: map-then-flatten-one-level. The transform must return a List for\n// every element; its items append in order, under the one 1,000,000 budget.\nfunction __velarListFlatMap(value, transform) {\n const items = __velarCopyList(value, \"List.flatMap\");\n __velarReactiveCollectionTrack(value);\n const output = [];\n for (let index = 0; index < items.length; index += 1) {\n const part = transform(__velarReactiveCollectionRead(value, index, items[index]));\n const values = __velarValidateOwnedList(part, \"List.flatMap transform result\");\n const partOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let cursor = 0; cursor < values.length; cursor += 1) output[output.length] = __velarCollectionValue(__velarReactiveRaw(__velarListElement(values, cursor, \"List.flatMap\", partOwned)));\n }\n return __velarAdoptList(output);\n}\n\nfunction __velarSetAdd(value, item) {\n value = __velarReactiveRaw(value);\n item = __velarReactiveRaw(item);\n const size = __velarCollectionSetMapSetSize(value);\n if (size >= __velarMaxCollectionItems && !__velarCollectionSetMapSetHas(value, item)) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n if (__velarCollectionSetMapSetHas(value, item)) return null;\n __velarCollectionSetMapSetAdd(value, item);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, item, true, true);\n return null;\n}\n\nfunction __velarSetUpdate(value, items) {\n value = __velarReactiveRaw(value);\n items = __velarReactiveRaw(items);\n if (!__velarCollectionListIsArray(items) && !__velarIsSet(items)) throw new __velarCollectionNativeTypeError(\"Set.update requires a List or Set\");\n let entries;\n if (__velarCollectionListIsArray(items)) entries = __velarCopyList(items, \"Set.update\");\n else { const sourceSize = __velarCollectionSetMapSetSize(items); if (sourceSize > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); entries = new __velarCollectionNativeArray(sourceSize); const iterator = __velarCollectionSetMapSetValues(items); let index = 0; while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; entries[index++] = step.value; } }\n const additions = new __velarCollectionNativeSet();\n for (let index = 0; index < entries.length; index += 1) { const item = __velarReactiveRaw(entries[index]); if (!__velarCollectionSetMapSetHas(value, item)) __velarCollectionSetMapSetAdd(additions, item); }\n const size = __velarCollectionSetMapSetSize(value);\n const added = __velarCollectionSetMapSetSize(additions);\n if (size + added > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const iterator = __velarCollectionSetMapSetValues(additions); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; const item = step.value; __velarCollectionSetMapSetAdd(value, item); __velarReactiveCollectionLink(value, item); }\n // Every member added publishes its own key exactly as Set.add does: a\n // membership observer (x in tags) tracks the member key, not the iterate\n // key, so triggering only iteration would leave it stale.\n const published = __velarCollectionSetMapSetValues(additions); while (true) { const step = __velarCollectionSetMapSetNext(published); if (step.done) break; __velarReactiveCollectionTrigger(value, step.value, true, true); }\n if (added > 0) __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true);\n return null;\n}\nfunction __velarSetCopy(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value); const size = __velarCollectionSetMapSetSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); const output = new __velarCollectionNativeSet(); const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; __velarCollectionSetMapSetAdd(output, step.value); } }\n// COL-U2: Set algebra. Each method reads both operands, copies (never\n// mutates, exactly like sorted), and answers by SameValueZero membership.\nfunction __velarSetAlgebraOperands(value, other, name) {\n value = __velarReactiveRaw(value);\n other = __velarReactiveRaw(other);\n if (!__velarIsSet(other)) throw new __velarCollectionNativeTypeError(name + \" requires a Set\");\n if (__velarCollectionSetMapSetSize(value) > __velarMaxCollectionItems || __velarCollectionSetMapSetSize(other) > __velarMaxCollectionItems) {\n throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n }\n __velarReactiveCollectionTrack(value);\n __velarReactiveCollectionTrack(other);\n return [value, other];\n}\nfunction __velarSetUnion(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.union\");\n const output = new __velarCollectionNativeSet();\n const first = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(first); if (step.done) break; __velarCollectionSetMapSetAdd(output, step.value); }\n const second = __velarCollectionSetMapSetValues(operands[1]);\n while (true) {\n const step = __velarCollectionSetMapSetNext(second);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (!__velarCollectionSetMapSetHas(output, member) && __velarCollectionSetMapSetSize(output) >= __velarMaxCollectionItems) {\n throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n }\n __velarCollectionSetMapSetAdd(output, member);\n }\n return output;\n}\nfunction __velarSetIntersection(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.intersection\");\n const output = new __velarCollectionNativeSet();\n const iterator = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; if (__velarCollectionSetMapSetHas(operands[1], step.value)) __velarCollectionSetMapSetAdd(output, step.value); }\n}\nfunction __velarSetDifference(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.difference\");\n const output = new __velarCollectionNativeSet();\n const iterator = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; if (!__velarCollectionSetMapSetHas(operands[1], step.value)) __velarCollectionSetMapSetAdd(output, step.value); }\n}\n\nfunction __velarMapSet(value, key, item) {\n value = __velarReactiveRaw(value);\n key = __velarReactiveRaw(key);\n item = __velarReactiveRaw(item);\n const size = __velarCollectionSetMapMapSize(value);\n if (size >= __velarMaxCollectionItems && !__velarCollectionSetMapMapHas(value, key)) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const present = __velarCollectionSetMapMapHas(value, key);\n const previous = present ? __velarCollectionSetMapMapGet(value, key) : undefined;\n if (present && __velarCollectionListObjectIs(__velarReactiveRaw(previous), item)) return null;\n __velarCollectionSetMapMapSet(value, key, item);\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, key);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, key, true, !present);\n return null;\n}\n\n// Map.get followed by a null check is the right spelling for a read, but it is\n// a poor grouping primitive: narrowing a collection value deliberately walks\n// that value again to catch stale flow facts. getOrSet performs the one atomic\n// map operation the algorithm means and returns V directly, so repeated bucket\n// appends remain linear without weakening narrowing checks anywhere else.\nfunction __velarMapGetOrSet(value, key, fallback) {\n value = __velarReactiveRaw(value);\n key = __velarReactiveRaw(key);\n fallback = __velarReactiveRaw(fallback);\n const size = __velarCheckedMapSize(value, \"Map.getOrSet\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarReactiveCollectionTrack(value, key);\n if (__velarCollectionSetMapMapHas(value, key)) {\n return __velarReactiveCollectionRead(value, key, __velarCollectionSetMapMapGet(value, key));\n }\n if (size >= __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarCollectionSetMapMapSet(value, key, fallback);\n __velarReactiveCollectionLink(value, key);\n __velarReactiveCollectionLink(value, fallback);\n __velarReactiveCollectionTrigger(value, key, true, true);\n return __velarReactiveCollectionRead(value, key, fallback);\n}\n\nfunction __velarMapUpdate(value, items) {\n value = __velarReactiveRaw(value);\n items = __velarReactiveRaw(items);\n if (!__velarIsMap(items)) throw new __velarCollectionNativeTypeError(\"Map.update requires a Map\");\n const sourceSize = __velarCollectionSetMapMapSize(items);\n if (sourceSize > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const size = __velarCollectionSetMapMapSize(value);\n let additions = 0;\n const keys = __velarCollectionSetMapMapKeys(items); while (true) { const step = __velarCollectionSetMapMapNext(keys); if (step.done) break; if (!__velarCollectionSetMapMapHas(value, step.value)) additions += 1; }\n if (size + additions > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const entries = __velarCollectionSetMapMapEntries(items); while (true) { const step = __velarCollectionSetMapMapNext(entries); if (step.done) break; const entry = step.value; __velarMapSet(value, entry[0], entry[1]); }\n return null;\n}\nfunction __velarMapCopy(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value); const size = __velarCollectionSetMapMapSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); const output = new __velarCollectionNativeMap(); const iterator = __velarCollectionSetMapMapEntries(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return output; const entry = step.value; __velarCollectionSetMapMapSet(output, entry[0], entry[1]); } }\n\nfunction __velarRecordSet(value, key, item) {\n value = __velarReactiveRaw(value);\n if (typeof key !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.set requires a string key\");\n const fields = __velarRecordFields(value, \"Record.set\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, key);\n if (descriptor !== undefined && !descriptor.writable) throw new __velarCollectionNativeTypeError(\"Record.set requires a writable data field\");\n if (descriptor === undefined && fields.length >= __velarMaxCollectionItems) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n const previous = descriptor?.value;\n item = __velarReactiveRaw(item);\n if (descriptor !== undefined && __velarCollectionRecordObjectIs(__velarReactiveRaw(previous), item)) return null;\n __velarCollectionRecordDefineProperty(value, key, { value: item, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, key, true, descriptor === undefined);\n return null;\n}\nfunction __velarRecordCopy(value) {\n value = __velarReactiveRaw(value);\n const output = {};\n __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.copy\");\n for (let index = 0; index < fields.length; index += 1) {\n const field = fields[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, field);\n __velarCollectionRecordDefineProperty(output, field, { value: __velarReactiveCollectionRead(value, field, descriptor.value), writable: true, enumerable: true, configurable: true });\n }\n return output;\n}\n\nfunction __velarListHas(value, item) { value = __velarValidateOwnedList(value, \"List.has\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.has\", owned)), item)) return true; return false; }\nfunction __velarRecordHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.has requires a string key\"); __velarRecordFields(value, \"Record.has\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionRecordGetOwnPropertyDescriptor(value, item) !== undefined; }\nfunction __velarMapHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); const size = __velarCheckedMapSize(value, \"Map.has\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionSetMapMapHas(value, item); }\nfunction __velarSetHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); const size = __velarCheckedSetSize(value, \"Set.has\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionSetMapSetHas(value, item); }\nfunction __velarCollectionHas(value, item) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListHas(raw, item);\n if (__velarIsRecord(raw)) return __velarRecordHas(raw, item);\n if (__velarIsMap(raw)) return __velarMapHas(raw, item);\n if (__velarIsSet(raw)) return __velarSetHas(raw, item);\n throw new __velarCollectionNativeTypeError(\"VelarScript membership requires a List, Set, Map, or Record\");\n}\n// Membership keeps source evaluation order (item before container) while the\n// method-shaped helpers keep receiver-first order for values.has(item).\nfunction __velarListContains(item, value) { return __velarListHas(value, item); }\nfunction __velarMapContains(item, value) { return __velarMapHas(value, item); }\nfunction __velarSetContains(item, value) { return __velarSetHas(value, item); }\nfunction __velarRecordContains(item, value) { return __velarRecordHas(value, item); }\nfunction __velarContains(item, value) {\n if (typeof value === \"string\") { if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"String membership requires a string\"); return value.includes(item); }\n value = __velarReactiveRaw(value);\n if (__velarIsRecord(value)) {\n if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record membership requires a string key\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, item);\n if (descriptor !== undefined && (!descriptor.enumerable || !(\"value\" in descriptor))) throw new __velarCollectionNativeTypeError(\"Record fields must be enumerable data values\");\n __velarReactiveCollectionTrack(value, item);\n return descriptor !== undefined;\n }\n return __velarCollectionHas(value, item);\n}\n\n// D47 rule 81: equals(a, b) — deep structural comparison. Lists compare\n// ordered element-wise, Sets as the same member set, Maps as the same\n// key-value pairs, records as the same field set; leaves compare by\n// SameValueZero so NaN agrees with '=='. Cyclic structures throw (the same\n// stance stringify takes), and so does data nested past the validator depth\n// budget, so a pathological input never becomes a silent stack overflow.\nfunction __velarEquals(left, right) {\n return __velarEqualsVisit(left, right, [], 0);\n}\nfunction __velarEqualsVisit(left, right, active, depth) {\n left = __velarCollectionValue(__velarReactiveRaw(left));\n right = __velarCollectionValue(__velarReactiveRaw(right));\n if (left === right || (left !== left && right !== right)) return true;\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\") return false;\n if (depth >= 1000) throw new __velarCollectionNativeTypeError(\"equals cannot compare data nested more than 1000 collections deep\");\n for (let index = 0; index < active.length; index += 1) {\n if (active[index] === left || active[index] === right) throw new __velarCollectionNativeTypeError(\"equals cannot compare cyclic data\");\n }\n active[active.length] = left;\n active[active.length] = right;\n try {\n if (__velarCollectionListIsArray(left)) {\n if (!__velarCollectionListIsArray(right)) return false;\n const leftList = __velarValidateOwnedList(left, \"equals\");\n const rightList = __velarValidateOwnedList(right, \"equals\");\n __velarReactiveCollectionTrack(leftList);\n __velarReactiveCollectionTrack(rightList);\n if (leftList.length !== rightList.length) return false;\n const leftOwned = __velarListIsOwned(leftList);\n const rightOwned = __velarListIsOwned(rightList);\n for (let index = 0; index < leftList.length; index += 1) {\n if (!__velarEqualsVisit(__velarListElement(leftList, index, \"equals\", leftOwned), __velarListElement(rightList, index, \"equals\", rightOwned), active, depth + 1)) return false;\n }\n return true;\n }\n if (__velarIsSet(left)) {\n if (!__velarIsSet(right)) return false;\n const size = __velarCollectionSetMapSetSize(left);\n if (size > __velarMaxCollectionItems || __velarCollectionSetMapSetSize(right) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A collection cannot exceed 1000000 items\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (size !== __velarCollectionSetMapSetSize(right)) return false;\n // The native lookup already answers SameValueZero membership; only\n // structured members without an identical partner fall back to the\n // injective structural matching below. Structural equality is an\n // equivalence relation, so greedy matching is exact.\n const pending = [];\n const leftIterator = __velarCollectionSetMapSetValues(left);\n while (true) {\n const step = __velarCollectionSetMapSetNext(leftIterator);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (__velarCollectionSetMapSetHas(right, member)) continue;\n if (member === null || typeof member !== \"object\") return false;\n pending[pending.length] = member;\n }\n if (pending.length === 0) return true;\n const candidates = [];\n const rightIterator = __velarCollectionSetMapSetValues(right);\n while (true) {\n const step = __velarCollectionSetMapSetNext(rightIterator);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (__velarCollectionSetMapSetHas(left, member)) continue;\n if (member === null || typeof member !== \"object\") return false;\n candidates[candidates.length] = member;\n }\n if (candidates.length !== pending.length) return false;\n const used = new __velarCollectionNativeArray(candidates.length);\n for (let leftIndex = 0; leftIndex < pending.length; leftIndex += 1) {\n let matched = false;\n for (let rightIndex = 0; rightIndex < candidates.length; rightIndex += 1) {\n if (used[rightIndex]) continue;\n if (__velarEqualsVisit(pending[leftIndex], candidates[rightIndex], active, depth + 1)) {\n used[rightIndex] = true;\n matched = true;\n break;\n }\n }\n if (!matched) return false;\n }\n return true;\n }\n if (__velarIsMap(left)) {\n if (!__velarIsMap(right)) return false;\n const size = __velarCollectionSetMapMapSize(left);\n if (size > __velarMaxCollectionItems || __velarCollectionSetMapMapSize(right) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A collection cannot exceed 1000000 items\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (size !== __velarCollectionSetMapMapSize(right)) return false;\n const pendingKeys = [];\n const pendingValues = [];\n const leftIterator = __velarCollectionSetMapMapEntries(left);\n while (true) {\n const step = __velarCollectionSetMapMapNext(leftIterator);\n if (step.done) break;\n const key = __velarCollectionValue(__velarReactiveRaw(step.value[0]));\n const value = step.value[1];\n if (__velarCollectionSetMapMapHas(right, key)) {\n if (!__velarEqualsVisit(value, __velarCollectionSetMapMapGet(right, key), active, depth + 1)) return false;\n continue;\n }\n if (key === null || typeof key !== \"object\") return false;\n pendingKeys[pendingKeys.length] = key;\n pendingValues[pendingValues.length] = value;\n }\n if (pendingKeys.length === 0) return true;\n const candidateKeys = [];\n const candidateValues = [];\n const rightIterator = __velarCollectionSetMapMapEntries(right);\n while (true) {\n const step = __velarCollectionSetMapMapNext(rightIterator);\n if (step.done) break;\n const key = __velarCollectionValue(__velarReactiveRaw(step.value[0]));\n if (__velarCollectionSetMapMapHas(left, key)) continue;\n if (key === null || typeof key !== \"object\") return false;\n candidateKeys[candidateKeys.length] = key;\n candidateValues[candidateValues.length] = step.value[1];\n }\n if (candidateKeys.length !== pendingKeys.length) return false;\n const used = new __velarCollectionNativeArray(candidateKeys.length);\n for (let leftIndex = 0; leftIndex < pendingKeys.length; leftIndex += 1) {\n let matched = false;\n for (let rightIndex = 0; rightIndex < candidateKeys.length; rightIndex += 1) {\n if (used[rightIndex]) continue;\n if (__velarEqualsVisit(pendingKeys[leftIndex], candidateKeys[rightIndex], active, depth + 1)\n && __velarEqualsVisit(pendingValues[leftIndex], candidateValues[rightIndex], active, depth + 1)) {\n used[rightIndex] = true;\n matched = true;\n break;\n }\n }\n if (!matched) return false;\n }\n return true;\n }\n if (__velarIsRecord(left)) {\n if (!__velarIsRecord(right)) return false;\n const leftFields = __velarRecordFields(left, \"equals\");\n const rightFields = __velarRecordFields(right, \"equals\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (leftFields.length !== rightFields.length) return false;\n for (let index = 0; index < leftFields.length; index += 1) {\n const field = leftFields[index];\n const rightDescriptor = __velarCollectionRecordGetOwnPropertyDescriptor(right, field);\n if (!rightDescriptor || !rightDescriptor.enumerable || !(\"value\" in rightDescriptor)) return false;\n if (!__velarEqualsVisit(__velarCollectionRecordGetOwnPropertyDescriptor(left, field).value, rightDescriptor.value, active, depth + 1)) return false;\n }\n return true;\n }\n // Anything else — class instances, host objects — has no structural\n // content contract; the analyzer rejects those domains statically, so a\n // value reaching here came through 'any' and fails closed.\n return false;\n } finally {\n active.length -= 2;\n }\n}\n\nfunction __velarRecordRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.remove requires a string key\");\n __velarRecordFields(value, \"Record.remove\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, item);\n if (descriptor === undefined) return false;\n if (!descriptor.configurable) throw new __velarCollectionNativeTypeError(\"Record.remove requires a configurable data field\");\n if (!__velarCollectionRecordDeleteProperty(value, item)) throw new __velarCollectionNativeTypeError(\"Record.remove could not delete the field\");\n __velarReactiveCollectionUnlink(value, descriptor.value);\n __velarReactiveCollectionTrigger(value, item, true, true);\n return true;\n}\nfunction __velarMapRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n const size = __velarCheckedMapSize(value, \"Map.remove\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const previous = __velarCollectionSetMapMapGet(value, item);\n const removed = __velarCollectionSetMapMapDelete(value, item);\n if (removed) { __velarReactiveCollectionUnlink(value, item); __velarReactiveCollectionUnlink(value, previous); __velarReactiveCollectionTrigger(value, item, true, true); }\n return removed;\n}\nfunction __velarSetRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n const size = __velarCheckedSetSize(value, \"Set.remove\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const removed = __velarCollectionSetMapSetDelete(value, item);\n if (removed) { __velarReactiveCollectionUnlink(value, item); __velarReactiveCollectionTrigger(value, item, true, true); }\n return removed;\n}\nfunction __velarCollectionRemove(value, item) {\n const raw = __velarReactiveRaw(value);\n if (__velarIsRecord(raw)) return __velarRecordRemove(raw, item);\n if (__velarIsMap(raw)) return __velarMapRemove(raw, item);\n return __velarSetRemove(raw, item);\n}\n\nfunction __velarListClear(value) {\n value = __velarReactiveRaw(value);\n const previous = __velarCopyList(value, \"List.clear\");\n if (previous.length === 0) return null;\n __velarListRequireMutableLength(value, \"List.clear\");\n value.length = 0;\n __velarMarkOwnedList(value);\n for (let index = 0; index < previous.length; index += 1) __velarReactiveCollectionUnlink(value, previous[index]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, 0);\n return null;\n}\nfunction __velarRecordClear(value) {\n value = __velarReactiveRaw(value);\n const fields = __velarRecordFields(value, \"Record.clear\");\n if (fields.length === 0) return null;\n const previous = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, fields[index]); if (!descriptor.configurable) throw new __velarCollectionNativeTypeError(\"Record.clear requires configurable data fields\"); previous[index] = descriptor.value; }\n for (let index = 0; index < fields.length; index += 1) if (!__velarCollectionRecordDeleteProperty(value, fields[index])) throw new __velarCollectionNativeTypeError(\"Record.clear could not delete a field\");\n for (let index = 0; index < previous.length; index += 1) __velarReactiveCollectionUnlink(value, previous[index]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarMapClear(value) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedMapSize(value, \"Map.clear\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n if (size === 0) return null;\n const previous = new __velarCollectionNativeArray(size * 2);\n const iterator = __velarCollectionSetMapMapEntries(value);\n let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) break; previous[index++] = step.value[0]; previous[index++] = step.value[1]; }\n __velarCollectionSetMapMapClear(value);\n for (let previousIndex = 0; previousIndex < previous.length; previousIndex += 1) __velarReactiveCollectionUnlink(value, previous[previousIndex]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarSetClear(value) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedSetSize(value, \"Set.clear\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n if (size === 0) return null;\n const previous = new __velarCollectionNativeArray(size);\n const iterator = __velarCollectionSetMapSetValues(value);\n let index = 0;\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; previous[index++] = step.value; }\n __velarCollectionSetMapSetClear(value);\n for (let previousIndex = 0; previousIndex < previous.length; previousIndex += 1) __velarReactiveCollectionUnlink(value, previous[previousIndex]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarCollectionClear(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListClear(raw);\n if (__velarIsRecord(raw)) return __velarRecordClear(raw);\n if (__velarIsMap(raw)) return __velarMapClear(raw);\n return __velarSetClear(raw);\n}\n\nfunction __velarRecordKeys(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const fields = __velarRecordFields(value, \"Record.keys\");\n const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) output[index] = __velarReactiveCollectionRead(value, __velarReactiveStructureKey, fields[index]);\n return __velarAdoptList(output);\n}\nfunction __velarMapKeys(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const size = __velarCheckedMapSize(value, \"Map.keys\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapKeys(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value); }\n}\n// 这里不复用 Map.keys(),因为它的 VelarScript 契约是构造完整 List 快照。\n// 游标直接持有宿主 Map 的原生 key iterator,所以创建和每次 next 都是 O(1)。\n// next 的外层 null 只表示耗尽;真实 key 放在冻结的 {value} 中,因此 null key\n// 仍然可以无歧义地返回。宿主 keys/next/freeze 操作都已在运行时初始化时捕获,\n// 应用代码之后改写 JavaScript 原型也不能劫持这条路径。\nfunction __velarMapIterator(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const size = __velarCheckedMapSize(value, \"Map.iterator\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const iterator = __velarCollectionSetMapMapKeys(value);\n let exhausted = false;\n const next = () => {\n if (exhausted) return null;\n const step = __velarCollectionSetMapMapNext(iterator);\n if (step.done) { exhausted = true; return null; }\n return __velarCollectionSetMapFreeze({value: __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value)});\n };\n return __velarCollectionSetMapFreeze({next});\n}\nfunction __velarCollectionKeys(value) { value = __velarReactiveRaw(value); return __velarIsRecord(value) ? __velarRecordKeys(value) : __velarMapKeys(value); }\n\nfunction __velarRecordValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.values\"); const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const field = fields[index]; output[index] = __velarReactiveCollectionRead(value, field, __velarCollectionRecordGetOwnPropertyDescriptor(value, field).value); }\n return __velarAdoptList(output);\n}\nfunction __velarMapValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedMapSize(value, \"Map.values\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapValues(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); }\n}\nfunction __velarSetValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedSetSize(value, \"Set.values\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapSetValues(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); }\n}\nfunction __velarCollectionValues(value) {\n value = __velarReactiveRaw(value);\n if (__velarIsRecord(value)) return __velarRecordValues(value);\n if (__velarIsMap(value)) return __velarMapValues(value);\n return __velarSetValues(value);\n}\n\nfunction __velarRecordEntries(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.entries\"); const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const field = fields[index]; output[index] = __velarCollectionRecordFreeze({ key: __velarReactiveCollectionRead(value, __velarReactiveIterateKey, field), value: __velarReactiveCollectionRead(value, field, __velarCollectionRecordGetOwnPropertyDescriptor(value, field).value) }); }\n return __velarAdoptList(output);\n}\nfunction __velarMapEntries(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedMapSize(value, \"Map.entries\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapEntries(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); const entry = step.value; output[index++] = __velarCollectionSetMapFreeze({ key: __velarReactiveCollectionRead(value, __velarReactiveIterateKey, entry[0]), value: __velarReactiveCollectionRead(value, entry[0], entry[1]) }); }\n}\nfunction __velarCollectionEntries(value) { value = __velarReactiveRaw(value); return __velarIsRecord(value) ? __velarRecordEntries(value) : __velarMapEntries(value); }\nfunction __velarOptionalCollection(value, operation) { return value == null ? null : operation(value); }\nexport {\n __velarMaxCollectionItems,\n __velarCollectionValue,\n __velarSameValueZero,\n __velarEquals,\n __velarValidateDenseList,\n __velarAdoptList,\n __velarReactiveListIterator,\n __velarReactiveSetIterator,\n __velarReactiveMapKeyIterator,\n __velarReactiveRecordIterator,\n __velarReactiveMapPairIterator,\n __velarReactiveRecordPairIterator,\n __velarCollectionIterator,\n __velarCollectionPairIterator,\n __velarCopyList,\n __velarOrderedListValue,\n __velarCreateList,\n __velarCreateListAsync,\n __velarCreateSet,\n __velarCreateMap,\n __velarCollectionSize,\n __velarListSize,\n __velarMapSize,\n __velarSetSize,\n __velarRecordSize,\n __velarCollectionGet,\n __velarListGet,\n __velarMapGet,\n __velarRecordGet,\n __velarCollectionSlice,\n __VelarIndexError,\n __velarIndex,\n __velarListIndexGet,\n __velarRecordIndexGet,\n __velarOptionalIndex,\n __velarSetIndex,\n __velarListIndexSet,\n __velarRecordIndexSet,\n __velarListAppend,\n __velarListExtend,\n __velarListInsert,\n __velarListRemove,\n __velarListPop,\n __velarListCopy,\n __velarListCount,\n __velarListIndex,\n __velarListFind,\n __velarListMap,\n __velarListFilter,\n __velarListReduce,\n __velarListEvery,\n __velarListSome,\n __velarListSum,\n __velarListExtremum,\n __velarListMin,\n __velarListMax,\n __velarListJoin,\n __velarListSorted,\n __velarListReversed,\n __velarListFlatMap,\n __velarSetAdd,\n __velarSetUpdate,\n __velarSetCopy,\n __velarSetUnion,\n __velarSetIntersection,\n __velarSetDifference,\n __velarMapSet,\n __velarMapGetOrSet,\n __velarMapUpdate,\n __velarMapCopy,\n __velarRecordFields,\n __velarRecordSet,\n __velarRecordCopy,\n __velarCollectionHas,\n __velarListHas,\n __velarMapHas,\n __velarSetHas,\n __velarRecordHas,\n __velarListContains,\n __velarMapContains,\n __velarSetContains,\n __velarRecordContains,\n __velarContains,\n __velarCollectionRemove,\n __velarMapRemove,\n __velarSetRemove,\n __velarRecordRemove,\n __velarCollectionClear,\n __velarListClear,\n __velarMapClear,\n __velarSetClear,\n __velarRecordClear,\n __velarCollectionKeys,\n __velarMapIterator,\n __velarMapKeys,\n __velarRecordKeys,\n __velarCollectionValues,\n __velarMapValues,\n __velarSetValues,\n __velarRecordValues,\n __velarCollectionEntries,\n __velarMapEntries,\n __velarRecordEntries,\n __velarOptionalCollection,\n};\n","/// Per-connection bounds. Every operation is serialized through one Worker;\n/// queueCapacity bounds admitted operations waiting for that connection.\nimport {DatabaseExecutor, DatabaseStatement, trustedSql} from \"@velarscript-labs/database\"\n\nexport enum SqliteJournalMode:\n delete\n truncate\n persist\n memory\n wal\n off\n\nexport type SqliteOptions:\n busyTimeoutMilliseconds: number?\n queueCapacity: number?\n maxRows: number?\n maxResultBytes: number?\n statementCacheCapacity: number?\n journalMode: SqliteJournalMode?\n readOnly: bool?\n\nextern js`\n import { AsyncLocalStorage } from \"node:async_hooks\";\n import { Worker } from \"node:worker_threads\";\n\n const TOKEN = Object.freeze({});\n const connectionStates = new WeakMap();\n const transactionStates = new WeakMap();\n const transactionContext = new AsyncLocalStorage();\n\n export class NativeSqliteError extends Error {\n constructor(message = \"SQLite operation failed\", sqliteCode = null, operation = \"unknown\", retryable = false) {\n super(message);\n this.name = \"NativeSqliteError\";\n this.sqliteCode = sqliteCode;\n this.operation = operation;\n this.retryable = retryable;\n }\n }\n\n export class NativeSqliteBackpressureError extends NativeSqliteError {\n constructor(message = \"SQLite queue is full\") {\n super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true);\n this.name = \"NativeSqliteBackpressureError\";\n }\n }\n\n export class NativeSqliteConcurrencyError extends NativeSqliteError {\n constructor(message = \"SQLite connection cannot be used from its transaction callback\") {\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true);\n this.name = \"NativeSqliteConcurrencyError\";\n }\n }\n\n function integer(value, fallback, minimum, maximum, label) {\n const selected = value == null ? fallback : value;\n if (!Number.isSafeInteger(selected) || selected < minimum || selected > maximum) {\n throw new TypeError(label + \" must be an integer from \" + minimum + \" through \" + maximum);\n }\n return selected;\n }\n\n function checkedOptions(value) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TypeError(\"SQLite options must be a record\");\n const allowed = new Set([\"busyTimeoutMilliseconds\", \"queueCapacity\", \"maxRows\", \"maxResultBytes\", \"statementCacheCapacity\", \"journalMode\", \"readOnly\"]);\n for (const key of Object.keys(value)) if (!allowed.has(key)) throw new TypeError(\"Unknown SQLite option \" + key);\n const journalModes = new Set([\"delete\", \"truncate\", \"persist\", \"memory\", \"wal\", \"off\"]);\n const journalMode = value.journalMode == null ? null : value.journalMode;\n if (journalMode !== null && (typeof journalMode !== \"string\" || !journalModes.has(journalMode))) throw new TypeError(\"SQLite journalMode must name a supported mode\");\n if (value.readOnly != null && typeof value.readOnly !== \"boolean\") throw new TypeError(\"SQLite readOnly must be bool\");\n if (value.readOnly === true && journalMode !== null) throw new TypeError(\"SQLite readOnly connections cannot change journalMode\");\n return {\n busyTimeoutMilliseconds: integer(value.busyTimeoutMilliseconds, 2000, 1, 60000, \"SQLite busy timeout\"),\n queueCapacity: integer(value.queueCapacity, 64, 1, 1024, \"SQLite queue capacity\"),\n maxRows: integer(value.maxRows, 10000, 1, 1000000, \"SQLite row limit\"),\n maxResultBytes: integer(value.maxResultBytes, 64 * 1024 * 1024, 1, 128 * 1024 * 1024, \"SQLite result byte limit\"),\n statementCacheCapacity: integer(value.statementCacheCapacity, 128, 1, 1024, \"SQLite statement cache capacity\"),\n journalMode,\n readOnly: value.readOnly === true,\n };\n }\n\n function workerMain() {\n const { Buffer } = require(\"node:buffer\");\n const { parentPort, workerData } = require(\"node:worker_threads\");\n const { DatabaseSync, constants } = require(\"node:sqlite\");\n const { parseStmt } = require(\"sqlite3-parser\");\n let database = null;\n let statements = null;\n let closed = false;\n\n function failure(message, code, operation, retryable = false) {\n const error = new Error(message);\n error.code = code;\n error.operation = operation;\n error.retryable = retryable;\n return error;\n }\n\n function errorData(error, operation) {\n const message = error instanceof Error ? error.message : String(error);\n const rawCode = error && typeof error === \"object\" ? error.errstr ?? error.code ?? null : null;\n const code = rawCode == null ? null : String(rawCode);\n const upper = code == null ? \"\" : code.toUpperCase();\n return {\n message,\n sqliteCode: code,\n operation: error && typeof error.operation === \"string\" ? error.operation : operation,\n retryable: error && error.retryable === true || upper.includes(\"BUSY\") || upper.includes(\"LOCKED\"),\n };\n }\n\n function parameter(value, budget) {\n if (value === null) return null;\n if (typeof value === \"boolean\") return value ? 1 : 0;\n if (typeof value === \"string\") {\n budget.value += Buffer.byteLength(value, \"utf8\");\n return value;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw failure(\"SQLite number parameters must be finite\", \"SQLITE_INPUT\", \"params\");\n if (Number.isInteger(value) && !Number.isSafeInteger(value)) throw failure(\"SQLite integer parameters must be safe integers\", \"SQLITE_INPUT\", \"params\");\n budget.value += 8;\n return value;\n }\n if (value instanceof Uint8Array) {\n budget.value += value.byteLength;\n return value;\n }\n throw failure(\"SQLite parameters support only null, bool, string, finite number, and Bytes\", \"SQLITE_INPUT\", \"params\");\n }\n\n function parameters(value) {\n if (!Array.isArray(value) || value.length > 999) throw failure(\"SQLite parameters must be a List with at most 999 values\", \"SQLITE_INPUT\", \"params\");\n const budget = { value: 0 };\n const output = value.map(item => parameter(item, budget));\n if (budget.value > workerData.maxResultBytes) throw failure(\"SQLite parameters exceed the connection byte limit\", \"SQLITE_INPUT\", \"params\");\n return output;\n }\n\n function statementParts(rawFragments, rawParameters, operation) {\n if (!Array.isArray(rawFragments) || rawFragments.length !== rawParameters.length + 1 || rawFragments.length > 1000) {\n throw failure(\"SQLite statements require exactly one more SQL fragment than bound parameters\", \"SQLITE_INPUT\", operation);\n }\n let sourceBytes = 0;\n const fragments = rawFragments.map(fragment => {\n if (typeof fragment !== \"string\" || fragment.includes(\"\\0\") || fragment.includes(\"?\")) {\n throw failure(\"SQLite SQL fragments must be text without NUL or raw parameter placeholders\", \"SQLITE_INPUT\", operation);\n }\n sourceBytes += Buffer.byteLength(fragment, \"utf8\");\n return fragment;\n });\n if (sourceBytes === 0 || sourceBytes > 1024 * 1024) throw failure(\"SQLite SQL must be non-empty text no longer than 1 MiB\", \"SQLITE_INPUT\", operation);\n const bound = parameters(rawParameters);\n const source = fragments.join(\"?\");\n const parsed = parseStmt(source);\n if (parsed.status !== \"ok\") {\n const message = parsed.errors.length === 0 ? \"invalid statement\" : parsed.errors[0].message;\n throw failure(\"SQLite requires exactly one valid statement: \" + message, \"SQLITE_INPUT\", operation);\n }\n return { fragments, bound };\n }\n\n function count(value, label) {\n const number = typeof value === \"bigint\" ? Number(value) : value;\n if (!Number.isSafeInteger(number) || number < 0) throw failure(label + \" is outside VelarScript's safe integer range\", \"SQLITE_INTEGER_RANGE\", \"result\");\n return number;\n }\n\n function resultValue(value, budget, field) {\n if (value === null) return null;\n if (typeof value === \"string\") {\n budget.value += Buffer.byteLength(value, \"utf8\");\n return value;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw failure(\"SQLite returned a non-finite number in \" + field, \"SQLITE_RESULT\", \"result\");\n budget.value += 8;\n return value;\n }\n if (typeof value === \"bigint\") {\n const number = Number(value);\n if (!Number.isSafeInteger(number)) throw failure(\"SQLite returned an integer outside VelarScript's safe range in \" + field, \"SQLITE_INTEGER_RANGE\", \"result\");\n budget.value += 8;\n return number;\n }\n if (value instanceof Uint8Array) {\n budget.value += value.byteLength;\n return value;\n }\n throw failure(\"SQLite returned an unsupported value in \" + field, \"SQLITE_RESULT\", \"result\");\n }\n\n function resultRow(value, budget) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw failure(\"SQLite returned a non-record row\", \"SQLITE_RESULT\", \"result\");\n const output = Object.create(null);\n for (const key of Object.keys(value)) {\n budget.value += Buffer.byteLength(key, \"utf8\");\n output[key] = resultValue(value[key], budget, key);\n if (budget.value > workerData.maxResultBytes) throw failure(\"SQLite result exceeds the connection byte limit\", \"SQLITE_RESULT_LIMIT\", \"result\");\n }\n return output;\n }\n\n function execute(message) {\n const statement = statementParts(message.fragments, message.params, \"execute\");\n const result = statements.run(statement.fragments, ...statement.bound);\n return count(result.changes, \"SQLite affected row count\");\n }\n\n function one(message) {\n const statement = statementParts(message.fragments, message.params, \"one\");\n const row = statements.get(statement.fragments, ...statement.bound);\n if (row === undefined) return null;\n return resultRow(row, { value: 0 });\n }\n\n function all(message) {\n const statement = statementParts(message.fragments, message.params, \"all\");\n const rows = [];\n const budget = { value: 0 };\n for (const row of statements.iterate(statement.fragments, ...statement.bound)) {\n if (rows.length >= workerData.maxRows) throw failure(\"SQLite result exceeds the connection row limit\", \"SQLITE_ROW_LIMIT\", \"all\");\n rows.push(resultRow(row, budget));\n }\n return rows;\n }\n\n function dispatch(message) {\n if (closed) throw failure(\"SQLite connection is closed\", \"SQLITE_CLOSED\", message.operation);\n if (message.operation === \"execute\") return execute(message);\n if (message.operation === \"one\") return one(message);\n if (message.operation === \"all\") return all(message);\n if (message.operation === \"begin\") {\n if (database.isTransaction) throw failure(\"SQLite transaction is already active\", \"SQLITE_TRANSACTION\", \"begin\", true);\n database.exec(\"BEGIN IMMEDIATE\");\n return null;\n }\n if (message.operation === \"commit\") {\n if (!database.isTransaction) throw failure(\"SQLite transaction is not active\", \"SQLITE_TRANSACTION\", \"commit\");\n database.exec(\"COMMIT\");\n return null;\n }\n if (message.operation === \"rollback\") {\n if (database.isTransaction) database.exec(\"ROLLBACK\");\n return null;\n }\n if (message.operation === \"close\") {\n try {\n if (database.isTransaction) database.exec(\"ROLLBACK\");\n } finally {\n database.close();\n closed = true;\n }\n return null;\n }\n throw failure(\"Unknown SQLite operation\", \"SQLITE_PROTOCOL\", String(message.operation));\n }\n\n try {\n database = new DatabaseSync(workerData.path, {\n timeout: workerData.busyTimeoutMilliseconds,\n readOnly: workerData.readOnly,\n enableForeignKeyConstraints: true,\n enableDoubleQuotedStringLiterals: false,\n allowExtension: false,\n readBigInts: true,\n allowBareNamedParameters: false,\n allowUnknownNamedParameters: false,\n defensive: true,\n limits: {\n length: workerData.maxResultBytes,\n sqlLength: 1024 * 1024,\n column: 2000,\n exprDepth: 1000,\n compoundSelect: 500,\n vdbeOp: 250000,\n functionArg: 1000,\n attach: 0,\n likePatternLength: 50000,\n variableNumber: 999,\n triggerDepth: 100,\n },\n });\n database.enableDefensive(true);\n database.enableLoadExtension(false);\n database.setAuthorizer((actionCode, arg1, arg2) => {\n if (actionCode === constants.SQLITE_ATTACH || actionCode === constants.SQLITE_DETACH) return constants.SQLITE_DENY;\n if (actionCode === constants.SQLITE_FUNCTION && typeof arg2 === \"string\" && arg2.toLowerCase() === \"load_extension\") return constants.SQLITE_DENY;\n return constants.SQLITE_OK;\n });\n statements = database.createTagStore(workerData.statementCacheCapacity);\n if (workerData.journalMode !== null) database.exec(\"PRAGMA journal_mode = \" + workerData.journalMode.toUpperCase());\n parentPort.postMessage({ kind: \"ready\" });\n } catch (error) {\n parentPort.postMessage({ kind: \"ready\", error: errorData(error, \"open\") });\n parentPort.close();\n return;\n }\n\n parentPort.on(\"message\", message => {\n try {\n const value = dispatch(message);\n parentPort.postMessage({ kind: \"response\", id: message.id, value });\n if (message.operation === \"close\") parentPort.close();\n } catch (error) {\n parentPort.postMessage({ kind: \"response\", id: message.id, error: errorData(error, message.operation) });\n }\n });\n }\n\n function nativeError(value) {\n return new NativeSqliteError(value.message, value.sqliteCode, value.operation, value.retryable);\n }\n\n function failPending(state, error) {\n if (state.readyReject !== null) {\n state.readyReject(error);\n state.readyReject = null;\n state.readyResolve = null;\n }\n for (const pending of state.pending.values()) pending.reject(error);\n state.pending.clear();\n }\n\n function request(state, operation, fragments = [\"\"], params = []) {\n if (state.closed) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", operation));\n const id = state.nextId++;\n return new Promise((resolve, reject) => {\n state.pending.set(id, { resolve, reject });\n try {\n state.worker.postMessage({ id, operation, fragments, params });\n } catch (error) {\n state.pending.delete(id);\n reject(error);\n }\n });\n }\n\n function stateOf(connection) {\n const state = connectionStates.get(connection);\n if (!state) throw new TypeError(\"Invalid SQLite connection\");\n return state;\n }\n\n function transactionStateOf(transaction) {\n const state = transactionStates.get(transaction);\n if (!state || !state.active) throw new NativeSqliteConcurrencyError(\"SQLite transaction is no longer active\");\n return state;\n }\n\n function transactionRequest(transaction, operation, fragments = [\"\"], params = []) {\n const state = transactionStateOf(transaction);\n if (state.busy) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite transaction operations must be awaited one at a time\"));\n state.busy = true;\n return request(state.connection, operation, fragments, params).finally(() => { state.busy = false; });\n }\n\n function enqueue(state, operation) {\n if (state.closed || state.closing) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", \"queue\"));\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError());\n if (state.queued >= state.queueCapacity) return Promise.reject(new NativeSqliteBackpressureError());\n state.queued += 1;\n const running = state.tail.then(operation, operation);\n state.tail = running.then(() => null, () => null);\n return running.finally(() => { state.queued -= 1; });\n }\n\n export class NativeSqliteTransaction {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"SQLite transactions are created by connection.transaction\");\n transactionStates.set(this, state);\n }\n\n execute(fragments, params = []) { return transactionRequest(this, \"execute\", fragments, params); }\n one(fragments, params = []) { return transactionRequest(this, \"one\", fragments, params); }\n all(fragments, params = []) { return transactionRequest(this, \"all\", fragments, params); }\n }\n\n export class NativeSqliteConnection {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"Use openSqlite to create a SQLite connection\");\n connectionStates.set(this, state);\n }\n\n execute(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"execute\", fragments, params));\n }\n\n one(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"one\", fragments, params));\n }\n\n all(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"all\", fragments, params));\n }\n\n transaction(operation) {\n if (typeof operation !== \"function\") return Promise.reject(new TypeError(\"SQLite transaction requires an async operation\"));\n const state = stateOf(this);\n return enqueue(state, async () => {\n await request(state, \"begin\");\n const transactionState = { connection: state, active: true, busy: false };\n const transaction = new NativeSqliteTransaction(TOKEN, transactionState);\n try {\n await transactionContext.run(state, () => operation(transaction));\n await transactionRequest(transaction, \"commit\");\n transactionState.active = false;\n return null;\n } catch (error) {\n try {\n if (transactionState.active) await transactionRequest(transaction, \"rollback\");\n } catch {\n state.closing = true;\n state.worker.terminate();\n } finally {\n transactionState.active = false;\n }\n throw error;\n }\n });\n }\n\n close() {\n const state = stateOf(this);\n if (state.closePromise !== null) return state.closePromise;\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite connection cannot close inside its transaction callback\"));\n state.closing = true;\n state.closePromise = state.tail.then(async () => {\n try {\n if (!state.closed) await request(state, \"close\");\n await state.exited;\n } finally {\n state.closed = true;\n }\n });\n return state.closePromise;\n }\n }\n\n export async function openNativeSqlite(path, options = {}) {\n if (typeof path !== \"string\" || path.trim() === \"\" || path.length > 4096 || path.includes(\"\\0\")) throw new TypeError(\"SQLite path must be non-empty bounded text\");\n const checked = checkedOptions(options);\n const source = \"(\" + workerMain.toString() + \")()\";\n const worker = new Worker(source, { eval: true, workerData: { path, ...checked } });\n let readyResolve;\n let readyReject;\n let exitResolve;\n const ready = new Promise((resolve, reject) => { readyResolve = resolve; readyReject = reject; });\n const exited = new Promise(resolve => { exitResolve = resolve; });\n const state = {\n worker,\n readyResolve,\n readyReject,\n exited,\n pending: new Map(),\n nextId: 1,\n queueCapacity: checked.queueCapacity,\n queued: 0,\n tail: Promise.resolve(),\n closing: false,\n closed: false,\n closePromise: null,\n };\n worker.on(\"message\", message => {\n if (message.kind === \"ready\") {\n const resolve = state.readyResolve;\n const reject = state.readyReject;\n state.readyResolve = null;\n state.readyReject = null;\n if (message.error) reject(nativeError(message.error));\n else resolve();\n return;\n }\n if (message.kind !== \"response\") return;\n const pending = state.pending.get(message.id);\n if (!pending) return;\n state.pending.delete(message.id);\n if (message.error) pending.reject(nativeError(message.error));\n else pending.resolve(message.value);\n });\n worker.on(\"error\", error => {\n state.closed = true;\n failPending(state, new NativeSqliteError(error.message, \"SQLITE_WORKER\", \"worker\"));\n });\n worker.on(\"exit\", code => {\n exitResolve(code);\n if (code !== 0 && !state.closed) {\n state.closed = true;\n failPending(state, new NativeSqliteError(\"SQLite Worker exited with code \" + code, \"SQLITE_WORKER\", \"worker\"));\n }\n });\n await ready;\n return new NativeSqliteConnection(TOKEN, state);\n }\n`:\n export class NativeSqliteError:\n const message: string\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n export class NativeSqliteBackpressureError:\n const message: string\n\n export class NativeSqliteConcurrencyError:\n const message: string\n\n export class NativeSqliteTransaction:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n\n export class NativeSqliteConnection:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n async def transaction(operation: (NativeSqliteTransaction) -> Promise<null>) -> null\n async def close() -> null\n\n export async def openNativeSqlite(path: string, options: SqliteOptions = {}) -> NativeSqliteConnection\n\n/// A checked SQLite failure. sqliteCode preserves the driver result code when\n/// Node exposes one; retryable is true for busy, locked, and queue pressure.\nexport class SqliteError extends Error:\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n constructor(message: string, sqliteCode: string? = null, operation: string = \"unknown\", retryable: bool = false):\n super(message)\n self.sqliteCode = sqliteCode\n self.operation = operation\n self.retryable = retryable\n\nexport class SqliteBackpressureError extends SqliteError:\n constructor(message: string = \"SQLite queue is full\"): super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true)\n\nexport class SqliteConcurrencyError extends SqliteError:\n constructor(message: string = \"SQLite connection cannot be used from its transaction callback\"):\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true)\n\ndef sqliteFailure(error: NativeSqliteError) -> SqliteError:\n if error is NativeSqliteBackpressureError: return SqliteBackpressureError(error.message)\n if error is NativeSqliteConcurrencyError: return SqliteConcurrencyError(error.message)\n if error is NativeSqliteError: return SqliteError(error.message, error.sqliteCode, error.operation, error.retryable)\n return SqliteError(error.message)\n\n/// Produces a SQLite literal only for grammar positions where bound parameters\n/// are not legal, such as schema defaults and PRAGMA assignments. Ordinary\n/// query values must still use sqlParameter/sqlTuple/sqlRows.\nexport def sqliteLiteral(value: unknown) -> DatabaseStatement:\n if value == null: return trustedSql(\"NULL\")\n if value is bool: return trustedSql(value ? \"1\" : \"0\")\n if value is string: return trustedSql(\"'\" + value.replaceAll(\"'\", \"''\") + \"'\")\n if value is number:\n assert value.isFinite() else \"SQLite numeric literals must be finite\"\n assert not value.isInteger() or (value >= -9007199254740991 and value <= 9007199254740991) else \"SQLite integer literals must be safe integers\"\n return trustedSql(str(value))\n throw Error(\"SQLite literals support only null, bool, string, and finite number\")\n\n/// Quotes one SQLite identifier as a single name. Qualified names must compose\n/// separately quoted identifiers around trusted punctuation.\nexport def sqliteIdentifier(value: string) -> DatabaseStatement:\n assert not value.isBlank() and value.size <= 255 and not value.has(Text.fromCodePoint(0)) else \"SQLite identifiers must be non-blank text with no NUL and no longer than 255 characters\"\n return trustedSql(`\"` + value.replaceAll(`\"`, `\"\"`) + `\"`)\n\nexport class SqliteTransaction:\n constructor(private const native: NativeSqliteTransaction): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this transaction into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\nexport class SqliteConnection:\n constructor(private const native: NativeSqliteConnection): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this connection into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def transaction<T>(operation: (SqliteTransaction) -> Promise<T>) -> T:\n const results: List<T> = []\n async def run<T>(native: NativeSqliteTransaction): results.append(await operation(SqliteTransaction(native)))\n try:\n await self.native.transaction(run)\n assert results.size == 1 else \"SQLite transaction did not return exactly one result\"\n return results[0]\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw error\n\n async def close():\n try: await self.native.close()\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n @dispose: await self.close()\n\nexport async def openSqlite(path: string, options: SqliteOptions = {}) -> SqliteConnection:\n try: return SqliteConnection(await openNativeSqlite(path, options))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n","/// Per-connection bounds. Every operation is serialized through one Worker;\n/// queueCapacity bounds admitted operations waiting for that connection.\nimport {DatabaseExecutor, DatabaseStatement, trustedSql} from \"@velarscript-labs/database\"\n\nexport enum SqliteJournalMode:\n delete\n truncate\n persist\n memory\n wal\n off\n\nexport type SqliteOptions:\n busyTimeoutMilliseconds: number?\n queueCapacity: number?\n maxRows: number?\n maxResultBytes: number?\n statementCacheCapacity: number?\n journalMode: SqliteJournalMode?\n readOnly: bool?\n\nextern js`\n import { AsyncLocalStorage } from \"node:async_hooks\";\n import { Worker } from \"node:worker_threads\";\n\n const TOKEN = Object.freeze({});\n const connectionStates = new WeakMap();\n const transactionStates = new WeakMap();\n const transactionContext = new AsyncLocalStorage();\n\n export class NativeSqliteError extends Error {\n constructor(message = \"SQLite operation failed\", sqliteCode = null, operation = \"unknown\", retryable = false) {\n super(message);\n this.name = \"NativeSqliteError\";\n this.sqliteCode = sqliteCode;\n this.operation = operation;\n this.retryable = retryable;\n }\n }\n\n export class NativeSqliteBackpressureError extends NativeSqliteError {\n constructor(message = \"SQLite queue is full\") {\n super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true);\n this.name = \"NativeSqliteBackpressureError\";\n }\n }\n\n export class NativeSqliteConcurrencyError extends NativeSqliteError {\n constructor(message = \"SQLite connection cannot be used from its transaction callback\") {\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true);\n this.name = \"NativeSqliteConcurrencyError\";\n }\n }\n\n function integer(value, fallback, minimum, maximum, label) {\n const selected = value == null ? fallback : value;\n if (!Number.isSafeInteger(selected) || selected < minimum || selected > maximum) {\n throw new TypeError(label + \" must be an integer from \" + minimum + \" through \" + maximum);\n }\n return selected;\n }\n\n function checkedOptions(value) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TypeError(\"SQLite options must be a record\");\n const allowed = new Set([\"busyTimeoutMilliseconds\", \"queueCapacity\", \"maxRows\", \"maxResultBytes\", \"statementCacheCapacity\", \"journalMode\", \"readOnly\"]);\n for (const key of Object.keys(value)) if (!allowed.has(key)) throw new TypeError(\"Unknown SQLite option \" + key);\n const journalModes = new Set([\"delete\", \"truncate\", \"persist\", \"memory\", \"wal\", \"off\"]);\n const journalMode = value.journalMode == null ? null : value.journalMode;\n if (journalMode !== null && (typeof journalMode !== \"string\" || !journalModes.has(journalMode))) throw new TypeError(\"SQLite journalMode must name a supported mode\");\n if (value.readOnly != null && typeof value.readOnly !== \"boolean\") throw new TypeError(\"SQLite readOnly must be bool\");\n if (value.readOnly === true && journalMode !== null) throw new TypeError(\"SQLite readOnly connections cannot change journalMode\");\n return {\n busyTimeoutMilliseconds: integer(value.busyTimeoutMilliseconds, 2000, 1, 60000, \"SQLite busy timeout\"),\n queueCapacity: integer(value.queueCapacity, 64, 1, 1024, \"SQLite queue capacity\"),\n maxRows: integer(value.maxRows, 10000, 1, 1000000, \"SQLite row limit\"),\n maxResultBytes: integer(value.maxResultBytes, 64 * 1024 * 1024, 1, 128 * 1024 * 1024, \"SQLite result byte limit\"),\n statementCacheCapacity: integer(value.statementCacheCapacity, 128, 1, 1024, \"SQLite statement cache capacity\"),\n journalMode,\n readOnly: value.readOnly === true,\n };\n }\n\n function workerMain() {\n const { Buffer } = require(\"node:buffer\");\n const { parentPort, workerData } = require(\"node:worker_threads\");\n const { DatabaseSync, constants } = require(\"node:sqlite\");\n const { parseStmt } = require(\"sqlite3-parser\");\n let database = null;\n let statements = null;\n let closed = false;\n\n function failure(message, code, operation, retryable = false) {\n const error = new Error(message);\n error.code = code;\n error.operation = operation;\n error.retryable = retryable;\n return error;\n }\n\n function errorData(error, operation) {\n const message = error instanceof Error ? error.message : String(error);\n const rawCode = error && typeof error === \"object\" ? error.errstr ?? error.code ?? null : null;\n const code = rawCode == null ? null : String(rawCode);\n const upper = code == null ? \"\" : code.toUpperCase();\n return {\n message,\n sqliteCode: code,\n operation: error && typeof error.operation === \"string\" ? error.operation : operation,\n retryable: error && error.retryable === true || upper.includes(\"BUSY\") || upper.includes(\"LOCKED\"),\n };\n }\n\n function parameter(value, budget) {\n if (value === null) return null;\n if (typeof value === \"boolean\") return value ? 1 : 0;\n if (typeof value === \"string\") {\n budget.value += Buffer.byteLength(value, \"utf8\");\n return value;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw failure(\"SQLite number parameters must be finite\", \"SQLITE_INPUT\", \"params\");\n if (Number.isInteger(value) && !Number.isSafeInteger(value)) throw failure(\"SQLite integer parameters must be safe integers\", \"SQLITE_INPUT\", \"params\");\n budget.value += 8;\n return value;\n }\n if (value instanceof Uint8Array) {\n budget.value += value.byteLength;\n return value;\n }\n throw failure(\"SQLite parameters support only null, bool, string, finite number, and Bytes\", \"SQLITE_INPUT\", \"params\");\n }\n\n function parameters(value) {\n if (!Array.isArray(value) || value.length > 999) throw failure(\"SQLite parameters must be a List with at most 999 values\", \"SQLITE_INPUT\", \"params\");\n const budget = { value: 0 };\n const output = value.map(item => parameter(item, budget));\n if (budget.value > workerData.maxResultBytes) throw failure(\"SQLite parameters exceed the connection byte limit\", \"SQLITE_INPUT\", \"params\");\n return output;\n }\n\n function statementParts(rawFragments, rawParameters, operation) {\n if (!Array.isArray(rawFragments) || rawFragments.length !== rawParameters.length + 1 || rawFragments.length > 1000) {\n throw failure(\"SQLite statements require exactly one more SQL fragment than bound parameters\", \"SQLITE_INPUT\", operation);\n }\n let sourceBytes = 0;\n const fragments = rawFragments.map(fragment => {\n if (typeof fragment !== \"string\" || fragment.includes(\"\\0\") || fragment.includes(\"?\")) {\n throw failure(\"SQLite SQL fragments must be text without NUL or raw parameter placeholders\", \"SQLITE_INPUT\", operation);\n }\n sourceBytes += Buffer.byteLength(fragment, \"utf8\");\n return fragment;\n });\n if (sourceBytes === 0 || sourceBytes > 1024 * 1024) throw failure(\"SQLite SQL must be non-empty text no longer than 1 MiB\", \"SQLITE_INPUT\", operation);\n const bound = parameters(rawParameters);\n const source = fragments.join(\"?\");\n const parsed = parseStmt(source);\n if (parsed.status !== \"ok\") {\n const message = parsed.errors.length === 0 ? \"invalid statement\" : parsed.errors[0].message;\n throw failure(\"SQLite requires exactly one valid statement: \" + message, \"SQLITE_INPUT\", operation);\n }\n return { fragments, bound };\n }\n\n function count(value, label) {\n const number = typeof value === \"bigint\" ? Number(value) : value;\n if (!Number.isSafeInteger(number) || number < 0) throw failure(label + \" is outside VelarScript's safe integer range\", \"SQLITE_INTEGER_RANGE\", \"result\");\n return number;\n }\n\n function resultValue(value, budget, field) {\n if (value === null) return null;\n if (typeof value === \"string\") {\n budget.value += Buffer.byteLength(value, \"utf8\");\n return value;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) throw failure(\"SQLite returned a non-finite number in \" + field, \"SQLITE_RESULT\", \"result\");\n budget.value += 8;\n return value;\n }\n if (typeof value === \"bigint\") {\n const number = Number(value);\n if (!Number.isSafeInteger(number)) throw failure(\"SQLite returned an integer outside VelarScript's safe range in \" + field, \"SQLITE_INTEGER_RANGE\", \"result\");\n budget.value += 8;\n return number;\n }\n if (value instanceof Uint8Array) {\n budget.value += value.byteLength;\n return value;\n }\n throw failure(\"SQLite returned an unsupported value in \" + field, \"SQLITE_RESULT\", \"result\");\n }\n\n function resultRow(value, budget) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw failure(\"SQLite returned a non-record row\", \"SQLITE_RESULT\", \"result\");\n const output = Object.create(null);\n for (const key of Object.keys(value)) {\n budget.value += Buffer.byteLength(key, \"utf8\");\n output[key] = resultValue(value[key], budget, key);\n if (budget.value > workerData.maxResultBytes) throw failure(\"SQLite result exceeds the connection byte limit\", \"SQLITE_RESULT_LIMIT\", \"result\");\n }\n return output;\n }\n\n function execute(message) {\n const statement = statementParts(message.fragments, message.params, \"execute\");\n const result = statements.run(statement.fragments, ...statement.bound);\n return count(result.changes, \"SQLite affected row count\");\n }\n\n function one(message) {\n const statement = statementParts(message.fragments, message.params, \"one\");\n const row = statements.get(statement.fragments, ...statement.bound);\n if (row === undefined) return null;\n return resultRow(row, { value: 0 });\n }\n\n function all(message) {\n const statement = statementParts(message.fragments, message.params, \"all\");\n const rows = [];\n const budget = { value: 0 };\n for (const row of statements.iterate(statement.fragments, ...statement.bound)) {\n if (rows.length >= workerData.maxRows) throw failure(\"SQLite result exceeds the connection row limit\", \"SQLITE_ROW_LIMIT\", \"all\");\n rows.push(resultRow(row, budget));\n }\n return rows;\n }\n\n function dispatch(message) {\n if (closed) throw failure(\"SQLite connection is closed\", \"SQLITE_CLOSED\", message.operation);\n if (message.operation === \"execute\") return execute(message);\n if (message.operation === \"one\") return one(message);\n if (message.operation === \"all\") return all(message);\n if (message.operation === \"begin\") {\n if (database.isTransaction) throw failure(\"SQLite transaction is already active\", \"SQLITE_TRANSACTION\", \"begin\", true);\n database.exec(\"BEGIN IMMEDIATE\");\n return null;\n }\n if (message.operation === \"commit\") {\n if (!database.isTransaction) throw failure(\"SQLite transaction is not active\", \"SQLITE_TRANSACTION\", \"commit\");\n database.exec(\"COMMIT\");\n return null;\n }\n if (message.operation === \"rollback\") {\n if (database.isTransaction) database.exec(\"ROLLBACK\");\n return null;\n }\n if (message.operation === \"close\") {\n try {\n if (database.isTransaction) database.exec(\"ROLLBACK\");\n } finally {\n database.close();\n closed = true;\n }\n return null;\n }\n throw failure(\"Unknown SQLite operation\", \"SQLITE_PROTOCOL\", String(message.operation));\n }\n\n try {\n database = new DatabaseSync(workerData.path, {\n timeout: workerData.busyTimeoutMilliseconds,\n readOnly: workerData.readOnly,\n enableForeignKeyConstraints: true,\n enableDoubleQuotedStringLiterals: false,\n allowExtension: false,\n readBigInts: true,\n allowBareNamedParameters: false,\n allowUnknownNamedParameters: false,\n defensive: true,\n limits: {\n length: workerData.maxResultBytes,\n sqlLength: 1024 * 1024,\n column: 2000,\n exprDepth: 1000,\n compoundSelect: 500,\n vdbeOp: 250000,\n functionArg: 1000,\n attach: 0,\n likePatternLength: 50000,\n variableNumber: 999,\n triggerDepth: 100,\n },\n });\n database.enableDefensive(true);\n database.enableLoadExtension(false);\n database.setAuthorizer((actionCode, arg1, arg2) => {\n if (actionCode === constants.SQLITE_ATTACH || actionCode === constants.SQLITE_DETACH) return constants.SQLITE_DENY;\n if (actionCode === constants.SQLITE_FUNCTION && typeof arg2 === \"string\" && arg2.toLowerCase() === \"load_extension\") return constants.SQLITE_DENY;\n return constants.SQLITE_OK;\n });\n statements = database.createTagStore(workerData.statementCacheCapacity);\n if (workerData.journalMode !== null) database.exec(\"PRAGMA journal_mode = \" + workerData.journalMode.toUpperCase());\n parentPort.postMessage({ kind: \"ready\" });\n } catch (error) {\n parentPort.postMessage({ kind: \"ready\", error: errorData(error, \"open\") });\n parentPort.close();\n return;\n }\n\n parentPort.on(\"message\", message => {\n try {\n const value = dispatch(message);\n parentPort.postMessage({ kind: \"response\", id: message.id, value });\n if (message.operation === \"close\") parentPort.close();\n } catch (error) {\n parentPort.postMessage({ kind: \"response\", id: message.id, error: errorData(error, message.operation) });\n }\n });\n }\n\n function nativeError(value) {\n return new NativeSqliteError(value.message, value.sqliteCode, value.operation, value.retryable);\n }\n\n function failPending(state, error) {\n if (state.readyReject !== null) {\n state.readyReject(error);\n state.readyReject = null;\n state.readyResolve = null;\n }\n for (const pending of state.pending.values()) pending.reject(error);\n state.pending.clear();\n }\n\n function request(state, operation, fragments = [\"\"], params = []) {\n if (state.closed) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", operation));\n const id = state.nextId++;\n return new Promise((resolve, reject) => {\n state.pending.set(id, { resolve, reject });\n try {\n state.worker.postMessage({ id, operation, fragments, params });\n } catch (error) {\n state.pending.delete(id);\n reject(error);\n }\n });\n }\n\n function stateOf(connection) {\n const state = connectionStates.get(connection);\n if (!state) throw new TypeError(\"Invalid SQLite connection\");\n return state;\n }\n\n function transactionStateOf(transaction) {\n const state = transactionStates.get(transaction);\n if (!state || !state.active) throw new NativeSqliteConcurrencyError(\"SQLite transaction is no longer active\");\n return state;\n }\n\n function transactionRequest(transaction, operation, fragments = [\"\"], params = []) {\n const state = transactionStateOf(transaction);\n if (state.busy) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite transaction operations must be awaited one at a time\"));\n state.busy = true;\n return request(state.connection, operation, fragments, params).finally(() => { state.busy = false; });\n }\n\n function enqueue(state, operation) {\n if (state.closed || state.closing) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", \"queue\"));\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError());\n if (state.queued >= state.queueCapacity) return Promise.reject(new NativeSqliteBackpressureError());\n state.queued += 1;\n const running = state.tail.then(operation, operation);\n state.tail = running.then(() => null, () => null);\n return running.finally(() => { state.queued -= 1; });\n }\n\n export class NativeSqliteTransaction {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"SQLite transactions are created by connection.transaction\");\n transactionStates.set(this, state);\n }\n\n execute(fragments, params = []) { return transactionRequest(this, \"execute\", fragments, params); }\n one(fragments, params = []) { return transactionRequest(this, \"one\", fragments, params); }\n all(fragments, params = []) { return transactionRequest(this, \"all\", fragments, params); }\n }\n\n export class NativeSqliteConnection {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"Use openSqlite to create a SQLite connection\");\n connectionStates.set(this, state);\n }\n\n execute(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"execute\", fragments, params));\n }\n\n one(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"one\", fragments, params));\n }\n\n all(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"all\", fragments, params));\n }\n\n transaction(operation) {\n if (typeof operation !== \"function\") return Promise.reject(new TypeError(\"SQLite transaction requires an async operation\"));\n const state = stateOf(this);\n return enqueue(state, async () => {\n await request(state, \"begin\");\n const transactionState = { connection: state, active: true, busy: false };\n const transaction = new NativeSqliteTransaction(TOKEN, transactionState);\n try {\n await transactionContext.run(state, () => operation(transaction));\n await transactionRequest(transaction, \"commit\");\n transactionState.active = false;\n return null;\n } catch (error) {\n try {\n if (transactionState.active) await transactionRequest(transaction, \"rollback\");\n } catch {\n state.closing = true;\n state.worker.terminate();\n } finally {\n transactionState.active = false;\n }\n throw error;\n }\n });\n }\n\n close() {\n const state = stateOf(this);\n if (state.closePromise !== null) return state.closePromise;\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite connection cannot close inside its transaction callback\"));\n state.closing = true;\n state.closePromise = state.tail.then(async () => {\n try {\n if (!state.closed) await request(state, \"close\");\n await state.exited;\n } finally {\n state.closed = true;\n }\n });\n return state.closePromise;\n }\n }\n\n export async function openNativeSqlite(path, options = {}) {\n if (typeof path !== \"string\" || path.trim() === \"\" || path.length > 4096 || path.includes(\"\\0\")) throw new TypeError(\"SQLite path must be non-empty bounded text\");\n const checked = checkedOptions(options);\n const source = \"(\" + workerMain.toString() + \")()\";\n const worker = new Worker(source, { eval: true, workerData: { path, ...checked } });\n let readyResolve;\n let readyReject;\n let exitResolve;\n const ready = new Promise((resolve, reject) => { readyResolve = resolve; readyReject = reject; });\n const exited = new Promise(resolve => { exitResolve = resolve; });\n const state = {\n worker,\n readyResolve,\n readyReject,\n exited,\n pending: new Map(),\n nextId: 1,\n queueCapacity: checked.queueCapacity,\n queued: 0,\n tail: Promise.resolve(),\n closing: false,\n closed: false,\n closePromise: null,\n };\n worker.on(\"message\", message => {\n if (message.kind === \"ready\") {\n const resolve = state.readyResolve;\n const reject = state.readyReject;\n state.readyResolve = null;\n state.readyReject = null;\n if (message.error) reject(nativeError(message.error));\n else resolve();\n return;\n }\n if (message.kind !== \"response\") return;\n const pending = state.pending.get(message.id);\n if (!pending) return;\n state.pending.delete(message.id);\n if (message.error) pending.reject(nativeError(message.error));\n else pending.resolve(message.value);\n });\n worker.on(\"error\", error => {\n state.closed = true;\n failPending(state, new NativeSqliteError(error.message, \"SQLITE_WORKER\", \"worker\"));\n });\n worker.on(\"exit\", code => {\n exitResolve(code);\n if (code !== 0 && !state.closed) {\n state.closed = true;\n failPending(state, new NativeSqliteError(\"SQLite Worker exited with code \" + code, \"SQLITE_WORKER\", \"worker\"));\n }\n });\n await ready;\n return new NativeSqliteConnection(TOKEN, state);\n }\n`:\n export class NativeSqliteError:\n const message: string\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n export class NativeSqliteBackpressureError:\n const message: string\n\n export class NativeSqliteConcurrencyError:\n const message: string\n\n export class NativeSqliteTransaction:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n\n export class NativeSqliteConnection:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n async def transaction(operation: (NativeSqliteTransaction) -> Promise<null>) -> null\n async def close() -> null\n\n export async def openNativeSqlite(path: string, options: SqliteOptions = {}) -> NativeSqliteConnection\n\n/// A checked SQLite failure. sqliteCode preserves the driver result code when\n/// Node exposes one; retryable is true for busy, locked, and queue pressure.\nexport class SqliteError extends Error:\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n constructor(message: string, sqliteCode: string? = null, operation: string = \"unknown\", retryable: bool = false):\n super(message)\n self.sqliteCode = sqliteCode\n self.operation = operation\n self.retryable = retryable\n\nexport class SqliteBackpressureError extends SqliteError:\n constructor(message: string = \"SQLite queue is full\"): super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true)\n\nexport class SqliteConcurrencyError extends SqliteError:\n constructor(message: string = \"SQLite connection cannot be used from its transaction callback\"):\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true)\n\ndef sqliteFailure(error: NativeSqliteError) -> SqliteError:\n if error is NativeSqliteBackpressureError: return SqliteBackpressureError(error.message)\n if error is NativeSqliteConcurrencyError: return SqliteConcurrencyError(error.message)\n if error is NativeSqliteError: return SqliteError(error.message, error.sqliteCode, error.operation, error.retryable)\n return SqliteError(error.message)\n\n/// Produces a SQLite literal only for grammar positions where bound parameters\n/// are not legal, such as schema defaults and PRAGMA assignments. Ordinary\n/// query values must still use sqlParameter/sqlTuple/sqlRows.\nexport def sqliteLiteral(value: unknown) -> DatabaseStatement:\n if value == null: return trustedSql(\"NULL\")\n if value is bool: return trustedSql(value ? \"1\" : \"0\")\n if value is string: return trustedSql(\"'\" + value.replaceAll(\"'\", \"''\") + \"'\")\n if value is number:\n assert value.isFinite() else \"SQLite numeric literals must be finite\"\n assert not value.isInteger() or (value >= -9007199254740991 and value <= 9007199254740991) else \"SQLite integer literals must be safe integers\"\n return trustedSql(str(value))\n throw Error(\"SQLite literals support only null, bool, string, and finite number\")\n\n/// Quotes one SQLite identifier as a single name. Qualified names must compose\n/// separately quoted identifiers around trusted punctuation.\nexport def sqliteIdentifier(value: string) -> DatabaseStatement:\n assert not value.isBlank() and value.size <= 255 and not value.has(Text.fromCodePoint(0)) else \"SQLite identifiers must be non-blank text with no NUL and no longer than 255 characters\"\n return trustedSql(`\"` + value.replaceAll(`\"`, `\"\"`) + `\"`)\n\nexport class SqliteTransaction:\n constructor(private const native: NativeSqliteTransaction): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this transaction into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\nexport class SqliteConnection:\n constructor(private const native: NativeSqliteConnection): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this connection into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def transaction<T>(operation: (SqliteTransaction) -> Promise<T>) -> T:\n const results: List<T> = []\n async def run<T>(native: NativeSqliteTransaction): results.append(await operation(SqliteTransaction(native)))\n try:\n await self.native.transaction(run)\n assert results.size == 1 else \"SQLite transaction did not return exactly one result\"\n return results[0]\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw error\n\n async def close():\n try: await self.native.close()\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n @dispose: await self.close()\n\nexport async def openSqlite(path: string, options: SqliteOptions = {}) -> SqliteConnection:\n try: return SqliteConnection(await openNativeSqlite(path, options))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n"],"mappings":"AAEA,IAAMA,GAAyB,WAAW,MACpCC,GAA0B,WAAW,OACrCC,GAA0B,WAAW,OACrCC,GAAwB,WAAW,KACnCC,EAA0B,WAAW,OACrCC,GAAuB,WAAW,IAClCC,GAA6B,WAAW,UACxCC,GAA8B,WAAW,WACzCC,EAAsCJ,EAAwB,yBAC9DK,GAAmCD,EAAoCJ,EAAyB,gBAAgB,GAAG,MACnHM,GAA0BF,EAAoC,WAAW,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,QAAA,EAAA,MAAA,CAAA,WAEP,aAAGtB,aAAAM,EAAkCP,GAAcG,GAAAC,EAAAD,EAAAE,EAAAF,EAAAI,CAAA,EAAA,oBAAA,QAAA,KAAA,GAAAN,CAAA,CAAA,EAC7C,IAAAT,EAAYgC,EAAAvB,EAAA,SAAA,CAAA,uCAEhB,aAAMoB,OAAA,MAAA,CAAA,SAEpB,eAAAoB,GAAAC,EAAAC,EAAmE,CAAA,EAAA,CAC/D,GAAA,CAAK,OAAAhB,EAAO,IAAAM,GAAiB,MAAMZ,EAAAuB,GAAiBF,EAAMC,CAAA,CAAA,CAAA,CAAA,WAEtD,aAAG1C,aAAAM,EAAkCP,GAAcG,GAAAC,EAAAD,EAAAE,EAAAF,EAAAI,CAAA,EAAA,oBAAA,QAAA,KAAA,GAAAN,CAAA,CAAA,EAC7C,IAAAT,EAAYgC,EAAAvB,EAAA,SAAA,CAAA","names":["__velarTextNativeArray","__velarTextNativeString","__velarTextNativeNumber","__velarTextNativeMath","__velarTextNativeObject","__velarTextNativeMap","__velarTextNativeTypeError","__velarTextNativeRangeError","__velarTextGetOwnPropertyDescriptor","__velarTextRuntimeGetPrototypeOf","__velarTextReflectApply","__velarTextStringPrototype","__velarTextArrayIsArray","__velarTextNumberIsSafeInteger","__velarTextNumberIsInteger","__velarTextMathFloor","__velarTextMathMax","__velarTextMathMin","__velarNativeStringIndexOf","__velarNativeStringSlice","__velarNativeStringCharCodeAt","__velarNativeStringTrim","__velarNativeStringUpper","__velarNativeStringLower","__velarNativeStringSplit","__velarNativeStringReplaceAll","__velarNativeStringRepeat","__velarTextMapPrototype","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextSurrogatePattern","__velarTextRegExpPrototype","__velarTextSurrogateExec","__velarTextCall","operation","receiver","arguments_","__velarTextMeasureCacheUnits","__velarTextMeasureCache","__velarTextNativeMap","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarUtf8CharCodeAt","__velarUtf8ReflectApply","__velarTextGetOwnPropertyNames","__velarTextGetOwnPropertyDescriptor","__velarTextNativeObject","__velarTextGetOwnPropertySymbols","__velarTextGetPrototypeOf","__velarTextObjectPrototype","__velarTextObjectCreate","__velarTextObjectFreeze","__velarTextArrayPrototype","__velarTextNativeArray","__velarTextArrayJoin","__velarTextStringTrimStart","__velarTextStringPrototype","__velarTextStringTrimEnd","__velarTextStringNormalize","__velarTextNativeDate","__velarTextDateNow","nativeRegExpPrototype","NativeRegExp","nativeRegExpExec","__velarTextStringCodePointAt","__velarTextGetOwnPropertyDescriptor","__velarTextStringPrototype","__velarTextStringFromCodePoint","__velarTextNativeString","__velarTextLatinMarks","__velarTextBaselessMarks","fromCodePoint","value","__velarTextCall","__velarTextNumberIsSafeInteger","__velarTextNativeNumber","__velarTextNativeRangeError","__velarTextStringFromCodePoint","__velarTextNativeString","__velarReactiveCollectionRead","value","key","child","__velarTextNativeArray","__velarTextNativeString","__velarTextNativeNumber","__velarTextNativeMath","__velarTextNativeObject","__velarTextNativeMap","__velarTextNativeTypeError","__velarTextNativeRangeError","__velarTextGetOwnPropertyDescriptor","__velarTextRuntimeGetPrototypeOf","__velarTextReflectApply","__velarTextStringPrototype","__velarTextArrayIsArray","__velarTextNumberIsSafeInteger","__velarTextNumberIsInteger","__velarTextMathFloor","__velarTextMathMax","__velarTextMathMin","__velarNativeStringIndexOf","__velarNativeStringSlice","__velarNativeStringCharCodeAt","__velarNativeStringTrim","__velarNativeStringUpper","__velarNativeStringLower","__velarNativeStringSplit","__velarNativeStringReplaceAll","__velarNativeStringRepeat","__velarTextMapPrototype","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextSurrogatePattern","__velarTextRegExpPrototype","__velarTextSurrogateExec","__velarTextCall","operation","receiver","arguments_","__velarTextValue","value","__velarTextArgument","name","__velarTextNextCodePointOffset","value","offset","first","__velarTextCall","__velarNativeStringCharCodeAt","second","__velarTextCheckpointStride","__velarTextMeasureMinimumUnits","__velarTextMeasureCacheEntries","__velarTextMeasureCacheUnits","__velarTextMeasureCache","__velarTextNativeMap","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextMeasureCacheCount","__velarTextMeasureCacheHeld","__velarTextMeasureText","__velarTextSurrogateExec","__velarTextSurrogatePattern","checkpoints","__velarTextNativeArray","length","__velarTextMeasure","cached","measured","__velarTextCodePointLength","__velarTextIsBoundary","value","offset","lead","__velarTextCall","__velarNativeStringCharCodeAt","trail","__velarTextNeedsBoundaryCheck","search","first","last","__velarTextBoundedIndexOf","cursor","__velarNativeStringIndexOf","found","__velarTextReplacementOutputUnits","replacement","all","matches","__velarTextCodePointLength","index","growth","__velarTextMathFloor","__velarTextNativeMath","__velarStringSize","value","__velarTextCodePointLength","__velarTextValue","__velarStringIsBlank","value","__velarTextCall","__velarNativeStringTrim","__velarTextValue","__velarStringHas","value","text","__velarTextValue","__velarTextArgument","__velarTextBoundedIndexOf","__velarStringReplaceAll","value","from","to","__velarTextValue","__velarTextArgument","__velarTextReplacementOutputUnits","__velarTextNativeRangeError","output","offset","next","__velarTextNextCodePointOffset","__velarTextCall","__velarNativeStringSlice","__velarTextNeedsBoundaryCheck","__velarNativeStringReplaceAll","cursor","found","__velarTextBoundedIndexOf","__velarNumberNativeMath","__velarNumberNativeNumber","__velarNumberNativeObject","__velarNumberNativeTypeError","__velarNumberNativeRangeError","__velarNumberGetOwnPropertyDescriptor","__velarNumberReflectApply","__velarNumberPrototype","__velarNumberMathAbs","__velarNumberMathRound","__velarNumberMathFloor","__velarNumberMathCeil","__velarNumberIsSafeInteger","__velarNumberNativeIsInteger","__velarNumberNativeIsNaN","__velarNumberNativeIsFinite","__velarNativeNumberToFixed","__velarNumberCall","operation","receiver","arguments_","__velarNumberValue","value","__velarNumberIsInteger","value","__velarNumberCall","__velarNumberNativeIsInteger","__velarNumberNativeNumber","__velarNumberValue","__velarNumberIsFinite","value","__velarNumberCall","__velarNumberNativeIsFinite","__velarNumberNativeNumber","__velarNumberValue","__velarClassNativeObject","__velarClassNativeReflect","__velarClassNativeTypeError","__velarClassGetOwnPropertyDescriptor","__velarClassReflectApply","__velarClassReflectGet","__velarClassGetPrototypeOf","__velarClassHostCall","operation","receiver","arguments_","__velarReadInstanceField","name","value","__velarReadPrivateField","__velarNarrowingNativeTypeError","__velarNarrowingDefineProperty","__VelarNarrowingError","message","__velarNarrow","value","valid","expected","description","offset","__velarNormalizeGlobal","__velarNormalizeNativeObject","__velarNormalizeNativeReflect","__velarNormalizeNativeWeakMap","__velarNormalizeNativePromise","__velarNormalizeNativeSymbol","__velarNormalizeTypeError","__velarNormalizeGetOwnPropertyDescriptor","__velarNormalizeGetPrototypeOf","__velarNormalizeDefineProperty","__velarNormalizeApply","__velarNormalizeWeakMapPrototype","__velarNormalizeWeakMapHas","__velarNormalizeWeakMapGet","__velarNormalizeWeakMapSet","__velarNormalizePromisePrototype","__velarNormalizePromiseThen","__velarNormalizeSymbolFor","__velarNormalizeCall","operation","receiver","arguments_","__velarNormalizedPromiseRegistryKey","__velarNormalizedPromiseValues","descriptor","registry","__velarNormalizeOwnsPromise","candidate","prototype","__velarNormalizePromiseValue","value","known","settle","fail","resolved","reason","normalized","resolve","reject","__velarAsyncResolvedValue","owner","depth","__velarErrorNativeError","__velarErrorNativeString","__velarErrorNativeObject","__velarErrorNativeReflect","__velarErrorNativeTypeError","__velarErrorGetOwnPropertyDescriptor","__velarErrorGetPrototypeOf","__velarErrorReflectApply","__velarErrorIsErrorOperation","__velarErrorApply","operation","receiver","arguments_","label","__velarIsError","value","__velarNormalizeError","value","__velarIsError","kind","message","__velarErrorApply","__velarErrorNativeString","__velarErrorNativeError","__velarAssertionNativeError","__velarAssertionDefineProperty","__VelarAssertionError","__velarHostErrorNativeError","__velarHostErrorDefineProperty","__VelarFileNotFoundError","path","__VelarPermissionError","__VelarNotADirectoryError","__VelarFileExistsError","__VelarAddressInUseError","__velarCollectionNativeArray","__velarCollectionNativeMap","__velarCollectionNativeSet","__velarCollectionNativeObject","__velarCollectionNativeReflect","__velarCollectionNativeWeakMap","__velarCollectionNativeTypeError","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionReflectApply","__velarCollectionArrayIsArray","__velarCollectionGetPrototypeOf","__velarCollectionObjectPrototype","__velarCollectionMapPrototype","__velarCollectionSetPrototype","__velarCollectionMapSize","__velarCollectionSetSize","__velarCollectionHostCall","operation","receiver","arguments_","__velarCollectionWeakMapPrototype","__velarCollectionWeakMapGetOperation","__velarCollectionWeakMapSetOperation","__velarCollectionBrands","__velarCollectionBrand","value","known","brand","__velarIsMap","__velarIsSet","__velarCollectionOwnNames","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionOwnSymbols","__velarCollectionOwnKeys","__velarCollectionNativeReflect","__velarCollectionMapEntries","__velarCollectionMapPrototype","__velarCollectionSetValues","__velarCollectionSetPrototype","__velarCollectionMapIteratorPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeMap","__velarCollectionSetIteratorPrototype","__velarCollectionNativeSet","__velarCollectionMapIteratorNext","__velarCollectionSetIteratorNext","__velarCollectionMapTypeIterator","value","__velarCollectionSetTypeIterator","__velarCollectionMapTypeNext","iterator","__velarCollectionSetTypeNext","__velarTypeNativeWeakSet","__velarTypeNativeObject","__velarTypeNativeTypeError","__velarTypeGetOwnPropertyDescriptor","__velarTypeDefineProperty","__velarTypeReflectApply","__velarTypeSymbolFor","__velarTypeWeakSetPrototype","__velarTypeWeakSetHas","__velarTypeWeakSetAdd","__velarTypeCall","operation","receiver","arguments_","__velarRuntimeTypeRegistryKey","__velarRuntimeTypeRegistry","descriptor","registry","__velarRegisterRuntimeType","__velarValidationNativeWeakMap","__velarValidationNativeSet","__velarValidationNativePromise","__velarValidationNativeFunction","__velarValidationNativeSymbol","__velarValidationWeakMapPrototype","__velarCollectionGetOwnPropertyDescriptor","__velarValidationSetPrototype","__velarValidationFunctionPrototype","__velarValidationHasInstanceSymbol","__velarValidationWeakMapGetOperation","__velarValidationWeakMapSetOperation","__velarValidationWeakMapDeleteOperation","__velarValidationSetHasOperation","__velarValidationSetAddOperation","__velarValidationSetDeleteOperation","__velarValidationSetSizeOperation","__velarValidationFunctionHasInstanceOperation","__velarValidationFreezeOperation","__velarCollectionNativeObject","__velarValidationDefinePropertyOperation","__velarValidationMapSetOperation","__velarCollectionMapPrototype","__velarValidationMapGetOperation","__velarValidationState","__velarValidationCopy","__velarValidationSet","__velarValidationWeakMapGet","value","key","__velarCollectionHostCall","__velarValidationWeakMapSet","item","__velarValidationMapGet","value","key","__velarCollectionHostCall","__velarValidationMapGetOperation","__velarValidationMapSet","item","__velarValidationMapSetOperation","__velarValidationSetAdd","value","item","__velarCollectionHostCall","__velarValidationSetAddOperation","__velarValidationIsArray","value","__velarCollectionHostCall","__velarCollectionArrayIsArray","__velarCollectionNativeArray","__velarValidationOwnDescriptor","key","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarValidationIsInstance","constructor","__velarValidationFunctionHasInstanceOperation","__velarValidationFreeze","value","__velarCollectionHostCall","__velarValidationFreezeOperation","__velarCollectionNativeObject","__velarValidationIsPlainObject","prototype","__velarCollectionGetPrototypeOf","__velarValidationCopy","state","plan","plans","__velarValidationWeakMapGet","__velarValidationMapGet","copy","__velarValidationNativeWeakMap","__velarCollectionNativeMap","__velarValidationWeakMapSet","__velarValidationMapSet","target","name","__velarValidationDefinePropertyOperation","item","found","result","length","__velarValidationOwnDescriptor","index","descriptor","__velarValidationSet","iterator","__velarCollectionSetTypeIterator","step","__velarCollectionSetTypeNext","__velarValidationSetAdd","key","__velarCollectionMapTypeIterator","__velarCollectionMapTypeNext","entry","keys","__velarCollectionOwnKeys","__velarCollectionNativeReflect","__velarValidationIsArray","__velarIsMap","__velarIsSet","type","operation","__velarValidationRejectionHint","__velarValidationErrorDefineProperty","__VelarValidationError","__velarCollectionNativeTypeError","message","detail","__velarCollectionNativeArray","__velarCollectionNativeMap","__velarCollectionNativeSet","__velarCollectionNativeObject","__velarCollectionNativeReflect","__velarCollectionNativeWeakMap","__velarCollectionNativeTypeError","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionReflectApply","__velarCollectionArrayIsArray","__velarCollectionGetPrototypeOf","__velarCollectionObjectPrototype","__velarCollectionMapPrototype","__velarCollectionSetPrototype","__velarCollectionMapSize","__velarCollectionSetSize","__velarCollectionHostCall","operation","receiver","arguments_","__velarCollectionWeakMapPrototype","__velarCollectionWeakMapGetOperation","__velarCollectionWeakMapSetOperation","__velarCollectionBrands","__velarCollectionListNativeNumber","__velarCollectionListNativeMath","__velarCollectionListNativeRangeError","__velarCollectionListArrayPrototype","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeArray","__velarCollectionListOwnNamesOperation","__velarCollectionNativeObject","__velarCollectionListOwnSymbolsOperation","__velarCollectionListDefinePropertyOperation","__velarCollectionListObjectIsOperation","__velarCollectionListIntegerOperation","__velarCollectionListNaNOperation","__velarCollectionListFiniteOperation","__velarCollectionListMaximumOperation","__velarCollectionListMinimumOperation","__velarCollectionListJoinOperation","__velarCollectionListSortOperation","__velarCollectionListReverseOperation","__velarCollectionListIsArray","value","__velarCollectionHostCall","__velarCollectionArrayIsArray","__velarCollectionListGetOwnPropertyDescriptor","key","__velarCollectionListOwnNames","__velarCollectionListOwnSymbols","__velarCollectionListDefineProperty","descriptor","__velarCollectionListIsInteger","value","__velarCollectionHostCall","__velarCollectionListIntegerOperation","__velarCollectionListNativeNumber","__velarCollectionSetMapNativeRangeError","__velarCollectionSetMapFreezeOperation","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionSetAddOperation","__velarCollectionSetPrototype","__velarCollectionSetHasOperation","__velarCollectionSetDeleteOperation","__velarCollectionSetClearOperation","__velarCollectionSetValuesOperation","__velarCollectionMapGetOperation","__velarCollectionMapPrototype","__velarCollectionMapSetOperation","__velarCollectionMapHasOperation","__velarCollectionMapDeleteOperation","__velarCollectionMapClearOperation","__velarCollectionMapKeysOperation","__velarCollectionMapValuesOperation","__velarCollectionMapEntriesOperation","__velarCollectionSetMapMapIteratorPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeMap","__velarCollectionSetMapSetIteratorPrototype","__velarCollectionNativeSet","__velarCollectionSetMapMapIteratorNext","__velarCollectionSetMapSetIteratorNext","__velarCollectionRecordNativeRangeError","__velarCollectionRecordOwnNamesOperation","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionRecordOwnSymbolsOperation","__velarCollectionRecordDefinePropertyOperation","__velarCollectionRecordObjectIsOperation","__velarCollectionRecordDeletePropertyOperation","__velarCollectionNativeReflect","__velarCollectionRecordFreezeOperation","__velarMaxCollectionItems","__velarCollectionValue","value","__velarListNativeWeakMap","__velarListWeakMapPrototype","__velarCollectionListGetOwnPropertyDescriptor","__velarListWeakMapGetOperation","__velarListWeakMapSetOperation","__velarListMemos","__velarListIsFrozenOperation","__velarCollectionNativeObject","__velarListRejectFrozen","value","name","__velarCollectionHostCall","__velarCollectionNativeTypeError","__velarListMemo","__velarListIsOwned","memo","__velarAdoptList","__velarMarkCheckedList","__velarMarkOwnedList","__velarListRequireMutableLength","lengthDescriptor","__velarValidateDenseList","__velarCollectionListIsArray","__velarMaxCollectionItems","__velarCollectionListOwnSymbols","__velarCollectionListOwnNames","index","descriptor","__velarListTier","__velarValidateListTier","tier","__velarValidateOwnedList","__velarValidateMutableList","__velarCheckedListElement","__velarOwnedListElement","element","__velarListElement","owned","__velarCopyList","value","name","__velarValidateOwnedList","owned","__velarListIsOwned","output","index","__velarCollectionValue","__velarListElement","__velarAdoptList","__velarListNativeString","__velarListStringPrototype","__velarCollectionListGetOwnPropertyDescriptor","__velarListStringCharCodeAt","__velarListSurrogatePattern","__velarListRegExpPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeObject","__velarListSurrogateExecOperation","__velarListSize","value","__velarValidateOwnedList","__VelarIndexError","__velarCollectionListNativeRangeError","message","__velarCollectionListDefineProperty","__velarStrictListIndex","value","requested","__velarCollectionListIsInteger","index","__velarListIndexGet","tier","__velarListTier","__velarReactiveCollectionRead","__velarOwnedListElement","__velarValidateListTier","__velarCheckedListElement","__velarListAppend","value","item","__velarValidateMutableList","__velarMaxCollectionItems","__velarCollectionListNativeRangeError","index","__velarCollectionListDefineProperty","__velarMarkOwnedList","__velarListMap","value","transform","items","__velarCopyList","output","__velarCollectionNativeArray","index","item","__velarReactiveCollectionRead","__velarAdoptList","trustedSql","AsyncLocalStorage","Worker","TOKEN","connectionStates","transactionStates","transactionContext","NativeSqliteError","message","sqliteCode","operation","retryable","NativeSqliteBackpressureError","NativeSqliteConcurrencyError","integer","value","fallback","minimum","maximum","label","selected","checkedOptions","allowed","key","journalModes","journalMode","workerMain","Buffer","parentPort","workerData","DatabaseSync","constants","parseStmt","database","statements","closed","failure","code","error","errorData","rawCode","upper","parameter","budget","parameters","output","item","statementParts","rawFragments","rawParameters","sourceBytes","fragments","fragment","bound","source","parsed","count","number","resultValue","field","resultRow","execute","statement","result","one","row","all","rows","dispatch","actionCode","arg1","arg2","nativeError","failPending","state","pending","request","params","id","resolve","reject","stateOf","connection","transactionStateOf","transaction","transactionRequest","enqueue","running","NativeSqliteTransaction","token","NativeSqliteConnection","transactionState","openNativeSqlite","path","options","checked","worker","readyResolve","readyReject","exitResolve","ready","exited","SqliteJournalMode","__velarRegisterRuntimeType","__velarValidationFreeze","__velarTypeExplain_SqliteOptions","value","SqliteError","operation","retryable","message","self","sqliteCode","SqliteBackpressureError","SqliteConcurrencyError","sqliteFailure","error","NativeSqliteBackpressureError","__velarValue","__velarNarrow","__velarValidationIsInstance","NativeSqliteConcurrencyError","NativeSqliteError","sqliteLiteral","trustedSql","__velarStringReplaceAll","__velarNumberIsFinite","__velarNumberIsInteger","sqliteIdentifier","__velarStringIsBlank","__velarStringSize","__velarStringHas","fromCodePoint","SqliteTransaction","data","statement","__velarNormalizePromiseValue","__velarReadPrivateField","#native","__velarReadInstanceField","executeStatement","oneRow","__velarAsyncResolvedValue","allRows","row","RowType","rows","__velarListMap","SqliteConnection","results","__velarAdoptList","run","native","__velarListAppend","__velarListSize","__velarListIndexGet","openSqlite","path","options","openNativeSqlite"]}
1
+ {"version":3,"sources":["../velar-standard:velar/text","../velar-standard:velar/compiler-runtime-reactive-v1","../velar-standard:velar/compiler-runtime-collections-v1","../velar-standard:velar/compiler-runtime-collection-lowering-v1","../velar-standard:velar/compiler-runtime-primitives-v1","../velar-standard:velar/compiler-runtime-class-fields-v1","../velar-standard:velar/compiler-runtime-narrowing-v1","../velar-standard:velar/compiler-runtime-promises-v1","../velar-standard:velar/compiler-runtime-errors-v1","../velar-standard:velar/compiler-runtime-types-v1","../src/index.vel","../src/generated/worker-source.vel","../src/index.vel"],"sourcesContent":["const __velarIndexErrorNativeRangeError = globalThis.RangeError;\nconst __velarIndexErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarIndexError extends __velarIndexErrorNativeRangeError {\n constructor(message) {\n super(message);\n this.name = \"IndexError\";\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarIndexErrorDefineProperty(__VelarIndexError, \"name\", { value: \"IndexError\", writable: false, enumerable: false, configurable: true });\n\nconst __velarMaxTextCodeUnits = 16 * 1024 * 1024;\nconst __velarMaxTextItems = 1000000;\nconst __velarTextNativeArray = globalThis.Array;\nconst __velarTextNativeString = globalThis.String;\nconst __velarTextNativeNumber = globalThis.Number;\nconst __velarTextNativeMath = globalThis.Math;\nconst __velarTextNativeObject = globalThis.Object;\nconst __velarTextNativeMap = globalThis.Map;\nconst __velarTextNativeTypeError = globalThis.TypeError;\nconst __velarTextNativeRangeError = globalThis.RangeError;\nconst __velarTextGetOwnPropertyDescriptor = __velarTextNativeObject.getOwnPropertyDescriptor;\nconst __velarTextRuntimeGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextReflectApply = __velarTextGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTextStringPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"prototype\")?.value;\nconst __velarTextArrayIsArray = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"isArray\")?.value;\nconst __velarTextNumberIsSafeInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isSafeInteger\")?.value;\nconst __velarTextNumberIsInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isInteger\")?.value;\nconst __velarTextMathFloor = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"floor\")?.value;\nconst __velarTextMathMax = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"max\")?.value;\nconst __velarTextMathMin = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"min\")?.value;\nconst __velarNativeStringIndexOf = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"indexOf\")?.value;\nconst __velarNativeStringSlice = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"slice\")?.value;\nconst __velarNativeStringCharCodeAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"charCodeAt\")?.value;\nconst __velarNativeStringTrim = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trim\")?.value;\nconst __velarNativeStringUpper = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toUpperCase\")?.value;\nconst __velarNativeStringLower = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toLowerCase\")?.value;\nconst __velarNativeStringSplit = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"split\")?.value;\nconst __velarNativeStringReplaceAll = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"replaceAll\")?.value;\nconst __velarNativeStringRepeat = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"repeat\")?.value;\nconst __velarTextMapPrototype = typeof __velarTextNativeMap === \"function\" ? __velarTextGetOwnPropertyDescriptor(__velarTextNativeMap, \"prototype\")?.value : null;\nconst __velarTextMapGet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"get\")?.value : null;\nconst __velarTextMapSet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"set\")?.value : null;\nconst __velarTextMapClear = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"clear\")?.value : null;\nconst __velarTextSurrogatePattern = /[\\u{10000}-\\u{10FFFF}\\uD800-\\uDFFF]/u;\nconst __velarTextRegExpPrototype = typeof __velarTextRuntimeGetPrototypeOf === \"function\" ? __velarTextRuntimeGetPrototypeOf(__velarTextSurrogatePattern) : null;\nconst __velarTextSurrogateExec = __velarTextRegExpPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextRegExpPrototype, \"exec\")?.value : null;\nfunction __velarTextCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarTextReflectApply !== \"function\") throw new __velarTextNativeTypeError(\"The JavaScript text runtime is unavailable\");\n return __velarTextReflectApply(operation, receiver, arguments_);\n}\n\nfunction __velarTextValue(value) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"String methods require a string receiver\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"Strings cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextArgument(value, name) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(name + \" must be a string\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextOutput(value, name) {\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextCount(value, name) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > __velarMaxTextCodeUnits) {\n throw new __velarTextNativeRangeError(name + \" must be an integer from 0 through \" + __velarMaxTextCodeUnits);\n }\n return value;\n}\nfunction __velarTextList(values, name) {\n if (values.length > __velarMaxTextItems) throw new __velarTextNativeRangeError(name + \" cannot produce more than \" + __velarMaxTextItems + \" items\");\n return values;\n}\nfunction __velarTextNextCodePointOffset(value, offset) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n if (first < 0xD800 || first > 0xDBFF || offset + 1 >= value.length) return offset + 1;\n const second = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset + 1]);\n return second >= 0xDC00 && second <= 0xDFFF ? offset + 2 : offset + 1;\n}\n// D90 R7, performance half. Measuring a string used to be a whole-string job\n// every single time: the surrogate probe ran per call, and one astral character\n// anywhere forced every offset conversion to walk code points from zero, which\n// made a loop of char/slice calls quadratic: 20,000 char/slice calls over a\n// 200 KiB string with one leading astral character took 17.1 s, and 34 ms\n// once measurement was memoised. A measurement is a pure function of an\n// immutable value, so it is memoised: a dense string answers offset conversions in\n// O(1) when no surrogate pair splits it, and otherwise the checkpoint list\n// records the code-unit offset of every stride-th code point so a conversion\n// starts from the nearest checkpoint instead of from the start of the string.\n// The cache may only change the cost of an answer, never the answer.\nconst __velarTextCheckpointStride = 64;\nconst __velarTextMeasureMinimumUnits = 64;\n// The cache holds its keys strongly, so its budget is memory the program has\n// stopped using but cannot reclaim. Eight MiB buys the loops that matter and\n// bounds what a document-processing program leaves behind; a single string\n// larger than the budget still measures once and stays, because evicting the\n// string a loop is walking would put the cliff back. The entry count only\n// bounds the cache's own bookkeeping, so it is set well above the number of\n// strings a loop cycles through: a tighter count made a walk over 65 short\n// strings 15x slower than the same walk over 64.\nconst __velarTextMeasureCacheEntries = 512;\nconst __velarTextMeasureCacheUnits = 8 * 1024 * 1024;\nconst __velarTextMeasureCache = typeof __velarTextNativeMap === \"function\"\n && typeof __velarTextMapGet === \"function\" && typeof __velarTextMapSet === \"function\" && typeof __velarTextMapClear === \"function\"\n ? new __velarTextNativeMap() : null;\nlet __velarTextMeasureCacheCount = 0;\nlet __velarTextMeasureCacheHeld = 0;\nfunction __velarTextMeasureText(value) {\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [value]) === null) {\n return { length: value.length, dense: true, checkpoints: null };\n }\n const checkpoints = new __velarTextNativeArray();\n let length = 0, offset = 0;\n while (offset < value.length) {\n if (length % __velarTextCheckpointStride === 0) checkpoints[length / __velarTextCheckpointStride] = offset;\n offset = __velarTextNextCodePointOffset(value, offset);\n length += 1;\n }\n // A string that carries only unpaired surrogates still has one unit per code\n // point, so it keeps the O(1) path even though the probe matched.\n return { length: length, dense: length === value.length, checkpoints: checkpoints };\n}\nfunction __velarTextMeasure(value) {\n if (__velarTextMeasureCache === null || value.length < __velarTextMeasureMinimumUnits) return __velarTextMeasureText(value);\n const cached = __velarTextCall(__velarTextMapGet, __velarTextMeasureCache, [value]);\n if (cached !== undefined) return cached;\n const measured = __velarTextMeasureText(value);\n if (__velarTextMeasureCacheCount >= __velarTextMeasureCacheEntries\n || (__velarTextMeasureCacheCount > 0 && __velarTextMeasureCacheHeld + value.length > __velarTextMeasureCacheUnits)) {\n __velarTextCall(__velarTextMapClear, __velarTextMeasureCache, []);\n __velarTextMeasureCacheCount = 0;\n __velarTextMeasureCacheHeld = 0;\n }\n __velarTextCall(__velarTextMapSet, __velarTextMeasureCache, [value, measured]);\n __velarTextMeasureCacheCount += 1;\n __velarTextMeasureCacheHeld += value.length;\n return measured;\n}\nfunction __velarTextCodePointLength(value) {\n return __velarTextMeasure(value).length;\n}\nfunction __velarTextCodePointPrefix(value, count) { return __velarTextCall(__velarNativeStringSlice, value, [0, __velarTextCodeUnitOffset(value, count)]); }\nfunction __velarTextCodeUnitOffset(value, position) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return position < value.length ? position : value.length;\n if (position <= 0) return 0;\n const checkpoints = measured.checkpoints;\n let block = __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [position / __velarTextCheckpointStride]);\n if (block >= checkpoints.length) block = checkpoints.length - 1;\n let offset = checkpoints[block], current = block * __velarTextCheckpointStride;\n while (offset < value.length && current < position) { offset = __velarTextNextCodePointOffset(value, offset); current += 1; }\n return offset;\n}\nfunction __velarTextCodePointIndex(value, unitOffset) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return unitOffset <= value.length ? unitOffset : null;\n if (unitOffset < 0 || unitOffset > value.length) return null;\n const checkpoints = measured.checkpoints;\n let low = 0, high = checkpoints.length - 1;\n while (low < high) {\n const middle = low + __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(high - low + 1) / 2]);\n if (checkpoints[middle] <= unitOffset) low = middle; else high = middle - 1;\n }\n let offset = checkpoints[low], position = low * __velarTextCheckpointStride;\n while (offset < unitOffset && offset < value.length) { offset = __velarTextNextCodePointOffset(value, offset); position += 1; }\n return offset === unitOffset ? position : null;\n}\nfunction __velarTextCodePointDistance(value, start, end) {\n if (__velarTextMeasure(value).dense) return end >= start ? end - start : null;\n let offset = start, distance = 0;\n while (offset < end) { offset = __velarTextNextCodePointOffset(value, offset); distance += 1; }\n return offset === end ? distance : null;\n}\n// D90 R7: a code-unit offset sits between two code points unless it splits a\n// surrogate pair, and only an adjacent lead/trail pair can be split. The test\n// is O(1), so every search below can reject a mid-pair hit without measuring\n// the string.\nfunction __velarTextIsBoundary(value, offset) {\n if (offset <= 0 || offset >= value.length) return true;\n const lead = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset - 1]);\n if (lead < 0xD800 || lead > 0xDBFF) return true;\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n return trail < 0xDC00 || trail > 0xDFFF;\n}\n// D90 R7, performance half. A match can only start inside a pair when the\n// needle starts with a trail surrogate, and can only end inside one when the\n// needle ends with a lead surrogate: the unit the gate reads at each end of a\n// match is the needle's own edge unit. Both are properties of the needle\n// alone, so one O(1) look says whether the native scan already answers what\n// the bounded scan answers, and an ordinary needle keeps native speed on any\n// haystack. The needle must not be empty; each caller handles that case.\nfunction __velarTextNeedsBoundaryCheck(search) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, search, [0]);\n if (first >= 0xDC00 && first <= 0xDFFF) return true;\n const last = __velarTextCall(__velarNativeStringCharCodeAt, search, [search.length - 1]);\n return last >= 0xD800 && last <= 0xDBFF;\n}\n// Every search operation goes through here so that a match is accepted only\n// when it starts and ends on a code-point boundary. A needle that begins or\n// ends with an unpaired surrogate therefore never matches inside a pair, which\n// is what keeps split/replace/replaceAll from manufacturing lone surrogates.\n// The needle must not be empty; each caller handles that case in its own voice.\nfunction __velarTextBoundedIndexOf(value, search, cursor) {\n if (!__velarTextNeedsBoundaryCheck(search)) return __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n while (cursor <= value.length) {\n const found = __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n if (found < 0) return -1;\n if (__velarTextIsBoundary(value, found) && __velarTextIsBoundary(value, found + search.length)) return found;\n cursor = found + 1;\n }\n return -1;\n}\nfunction __velarTextReplacementOutputUnits(value, search, replacement, all) {\n let matches = 0;\n if (search === \"\") matches = all ? __velarTextCodePointLength(value) + 1 : 1;\n else {\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, search, cursor);\n if (index < 0) break;\n matches += 1;\n if (!all) break;\n cursor = index + search.length;\n }\n }\n if (replacement.length <= search.length || matches === 0) return value.length;\n const growth = replacement.length - search.length;\n if (matches > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(__velarMaxTextCodeUnits - value.length) / growth])) return __velarMaxTextCodeUnits + 1;\n return value.length + matches * growth;\n}\n\n// TXT-D1: ordered string comparison uses code-point order (= UTF-8 binary\n// order). UTF-16 code-unit order already agrees when neither operand\n// contains a surrogate, so the native probe keeps the decoded walk on\n// surrogate-bearing strings only.\nfunction __velarStringCompare(left, right) {\n left = __velarTextValue(left);\n right = __velarTextValue(right);\n if (left === right) return 0;\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [left]) === null\n && __velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [right]) === null) {\n return left < right ? -1 : 1;\n }\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset]);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset]);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\n// D41 item 61: two 'Comparable'-bounded values hold numbers or strings, and\n// which one is known only at runtime. A string pair keeps code-point order\n// (TXT-D1); everything else uses the plain relational order, exactly as a\n// monomorphic comparison of that category would.\n// D90 R6: one NaN policy. A NaN may be held and tested with .isNaN(), but an\n// operation that orders it raises instead of answering. Without this the\n// \"neither less nor greater\" arm returned 0, which made NaN compare both <=\n// and >= as true at a generic site while the same source on a plain number\n// answered false, and produced genuinely mis-sorted output.\nfunction __velarOrderCompare(left, right) {\n if (typeof left === \"string\" && typeof right === \"string\") return __velarStringCompare(left, right);\n if (left !== left || right !== right) throw new __velarTextNativeTypeError(\"ordered comparison found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\");\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarStringSize(value) { return __velarTextCodePointLength(__velarTextValue(value)); }\nfunction __velarStringTrim(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []); }\nfunction __velarStringIsBlank(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []) === \"\"; }\nfunction __velarStringUpper(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringUpper, __velarTextValue(value), []), \"String.upper\"); }\nfunction __velarStringLower(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringLower, __velarTextValue(value), []), \"String.lower\"); }\n// CO-U4c: a String position is a position, so it raises what a List position\n// raises. `slice` clamps an out-of-range position rather than failing, so the\n// non-integer one is its whole position contract; the sentence is the one\n// `List.slice` already says, one receiver name apart.\nfunction __velarStringSlice(value, start = 0, end = null) {\n value = __velarTextValue(value);\n const total = __velarTextCodePointLength(value);\n if (end === null) end = total;\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start]) || !__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [end])) throw new __VelarIndexError(\"String.slice positions must be integers\");\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const last = end < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + end, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [end, total]);\n return __velarTextCall(__velarNativeStringSlice, value, [__velarTextCodeUnitOffset(value, first), __velarTextCodeUnitOffset(value, last)]);\n}\n// CO-U4: `char` reads forwards. Its index domain is 0 <= index < size, so a\n// negative index is an out-of-range position rather than a read from the end:\n// `\"abc\".char(-1)` used to answer \"c\", which is a whole different member than\n// the one the author wrote and the one every message about `char` describes.\n// Past the end stays `null`, because that is the absence the `string?` result\n// exists to report; before the beginning is a position that cannot exist.\n// The report names the index and the size, as List's own position guard does.\n// CO-U4b: and it raises the class List's guard raises. A plain RangeError\n// carries no name, so `catch error: if error is IndexError` did not match it\n// and `try` turned it into the `null` that reads like \"not found\" — the costume\n// charter §11 keeps the three integrity failures out of. The class is\n// `__VelarIndexError`, imported from the collection-lowering module when this\n// runtime is a project module and emitted beside it when it is inlined, so one\n// out-of-range position has one class however the program was built.\n// CO-U4c: the non-integer index is the other half of that same §11 sentence —\n// \"an out-of-range or non-integer position\" — and it was still raising a host\n// `TypeError`, which is not one of the three names `try` refuses to swallow. So\n// a fractional index that reached this guard at run time read as an absence,\n// the very costume CO-U4b took off the negative one. The sentence is the one\n// `List.get` says for the identical failure, one member name apart.\nfunction __velarStringChar(value, index) {\n value = __velarTextValue(value);\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [index])) throw new __VelarIndexError(\"String.char index must be an integer\");\n const total = __velarTextCodePointLength(value);\n if (index < 0) throw new __VelarIndexError(\"String.char index \" + index + \" is out of range for \" + total + (total === 1 ? \" character\" : \" characters\") + \"; the index domain is 0 through size - 1\");\n if (index >= total) return null;\n const start = __velarTextCodeUnitOffset(value, index);\n return __velarTextCall(__velarNativeStringSlice, value, [start, __velarTextNextCodePointOffset(value, start)]);\n}\nfunction __velarStringHas(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.has text\");\n return text === \"\" || __velarTextBoundedIndexOf(value, text, 0) >= 0;\n}\n// CO-U4c: `start` is a position as well, clamped when out of range and refused\n// when it is not an integer, so it raises the class the other two raise.\nfunction __velarStringIndex(value, text, start = 0) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.index text\");\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start])) throw new __VelarIndexError(\"String.index start must be an integer\");\n const total = __velarTextCodePointLength(value);\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const cursor = __velarTextCodeUnitOffset(value, first);\n if (text === \"\") return first;\n const found = __velarTextBoundedIndexOf(value, text, cursor);\n if (found < 0) return null;\n return __velarTextCodePointIndex(value, found);\n}\nfunction __velarStringCount(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.count text\");\n if (text === \"\") return __velarTextCodePointLength(value) + 1;\n let count = 0;\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, text, cursor);\n if (index < 0) return count;\n count += 1;\n cursor = index + text.length;\n }\n}\nfunction __velarStringStartsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.startsWith text\");\n return __velarTextCall(__velarNativeStringIndexOf, value, [text, 0]) === 0 && __velarTextIsBoundary(value, text.length);\n}\nfunction __velarStringEndsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.endsWith text\");\n const start = value.length - text.length;\n return start >= 0 && __velarTextIsBoundary(value, start) && __velarTextCall(__velarNativeStringIndexOf, value, [text, start]) === start;\n}\nfunction __velarStringSplit(value, separator) {\n value = __velarTextValue(value); separator = __velarTextArgument(separator, \"String.split separator\");\n if (separator === \"\") {\n const count = __velarTextCodePointLength(value);\n if (count > __velarMaxTextItems) throw new __velarTextNativeRangeError(\"String.split cannot produce more than \" + __velarMaxTextItems + \" items\");\n const output = new __velarTextNativeArray(count);\n let offset = 0;\n for (let index = 0; index < count; index += 1) {\n const next = __velarTextNextCodePointOffset(value, offset);\n output[index] = __velarTextCall(__velarNativeStringSlice, value, [offset, next]);\n offset = next;\n }\n return output;\n }\n // The native split matches UTF-16 code units, so it would cut a surrogate\n // pair in half on a separator that begins or ends with an unpaired\n // surrogate. Every other separator makes the two scans agree match for\n // match, and the native one is the faster: its limit argument also stops it\n // before it can build an oversize array.\n if (!__velarTextNeedsBoundaryCheck(separator)) {\n return __velarTextList(__velarTextCall(__velarNativeStringSplit, value, [separator, __velarMaxTextItems + 1]), \"String.split\");\n }\n // Searching on code-point boundaries keeps every piece well formed; the\n // pieces themselves are still plain slices of the input.\n const parts = new __velarTextNativeArray();\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, separator, cursor);\n if (found < 0) break;\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor, found]);\n if (parts.length > __velarMaxTextItems) return __velarTextList(parts, \"String.split\");\n cursor = found + separator.length;\n }\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n return __velarTextList(parts, \"String.split\");\n}\nfunction __velarStringReplace(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replace from\"); to = __velarTextArgument(to, \"String.replace to\");\n if (__velarTextReplacementOutputUnits(value, from, to, false) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replace output cannot exceed 16 MiB\");\n if (from === \"\") return to + value;\n const found = __velarTextBoundedIndexOf(value, from, 0);\n if (found < 0) return value;\n return __velarTextCall(__velarNativeStringSlice, value, [0, found]) + to + __velarTextCall(__velarNativeStringSlice, value, [found + from.length]);\n}\nfunction __velarStringReplaceAll(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replaceAll from\"); to = __velarTextArgument(to, \"String.replaceAll to\");\n if (__velarTextReplacementOutputUnits(value, from, to, true) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replaceAll output cannot exceed 16 MiB\");\n if (from === \"\") {\n let output = to;\n let offset = 0;\n while (offset < value.length) { const next = __velarTextNextCodePointOffset(value, offset); output += __velarTextCall(__velarNativeStringSlice, value, [offset, next]) + to; offset = next; }\n return output;\n }\n // A separator that cannot split a pair leaves nothing for the bounded walk\n // to reject, so the native rewrite answers the same string faster. The\n // replacement is passed as a function so that a '$' in it stays literal.\n if (!__velarTextNeedsBoundaryCheck(from)) return __velarTextCall(__velarNativeStringReplaceAll, value, [from, () => to]);\n let output = \"\";\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, from, cursor);\n if (found < 0) break;\n output += __velarTextCall(__velarNativeStringSlice, value, [cursor, found]) + to;\n cursor = found + from.length;\n }\n return output + __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n}\nfunction __velarStringPad(value, size, fill, start) {\n const name = start ? \"String.padStart\" : \"String.padEnd\";\n value = __velarTextValue(value); size = __velarTextCount(size, name + \" size\"); fill = __velarTextArgument(fill, name + \" fill\");\n const needed = size - __velarTextCodePointLength(value);\n if (needed <= 0 || fill.length === 0) return value;\n let outputUnits = value.length;\n let padding = \"\";\n let counted = 0, fillOffset = 0;\n while (counted < needed) {\n const next = __velarTextNextCodePointOffset(fill, fillOffset);\n const character = __velarTextCall(__velarNativeStringSlice, fill, [fillOffset, next]);\n outputUnits += character.length;\n if (outputUnits > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n padding += character;\n counted += 1;\n fillOffset = next === fill.length ? 0 : next;\n }\n return start ? padding + value : value + padding;\n}\nfunction __velarStringPadStart(value, size, fill = \" \") { return __velarStringPad(value, size, fill, true); }\nfunction __velarStringPadEnd(value, size, fill = \" \") { return __velarStringPad(value, size, fill, false); }\nfunction __velarStringRepeat(value, count) {\n value = __velarTextValue(value); count = __velarTextCount(count, \"String.repeat count\");\n if (value.length > 0 && count > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [__velarMaxTextCodeUnits / value.length])) throw new __velarTextNativeRangeError(\"String.repeat output cannot exceed 16 MiB\");\n return __velarTextCall(__velarNativeStringRepeat, value, [count]);\n}\n\nconst __velarUtf8CharCodeAt = Object.getOwnPropertyDescriptor(String.prototype, \"charCodeAt\")?.value;\nconst __velarUtf8ReflectApply = Object.getOwnPropertyDescriptor(Reflect, \"apply\")?.value;\nfunction __velarUtf8ByteLength(value) {\n if (typeof value !== \"string\") throw new TypeError(\"UTF-8 byte length requires text\");\n if (typeof __velarUtf8CharCodeAt !== \"function\" || typeof __velarUtf8ReflectApply !== \"function\") {\n throw new TypeError(\"The host UTF-8 sizing intrinsics are unavailable\");\n }\n let bytes = 0;\n for (let index = 0; index < value.length; index += 1) {\n const unit = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index]);\n if (unit <= 0x7F) bytes += 1;\n else if (unit <= 0x7FF) bytes += 2;\n else if (unit >= 0xD800 && unit <= 0xDBFF && index + 1 < value.length) {\n const next = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index + 1]);\n if (next >= 0xDC00 && next <= 0xDFFF) { bytes += 4; index += 1; }\n else bytes += 3;\n } else bytes += 3;\n }\n return bytes;\n}\nfunction __velarDeclaredLength(value) {\n if (typeof value !== \"string\" || value.length === 0) return null;\n if (typeof __velarUtf8CharCodeAt !== \"function\" || typeof __velarUtf8ReflectApply !== \"function\") {\n throw new TypeError(\"The host transport sizing intrinsics are unavailable\");\n }\n let length = 0;\n for (let index = 0; index < value.length; index += 1) {\n const unit = __velarUtf8ReflectApply(__velarUtf8CharCodeAt, value, [index]);\n if (unit < 48 || unit > 57) return null;\n if (length > 900719925474099) return 1 / 0;\n length = length * 10 + unit - 48;\n if (length > 9007199254740991) return 1 / 0;\n }\n return length;\n}\n\nconst maxTextCodeUnits = __velarMaxTextCodeUnits;\nconst maxTextItems = __velarMaxTextItems;\nconst maxTextPatternMillis = 250;\nconst __velarTextGetOwnPropertyNames = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarTextGetOwnPropertySymbols = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarTextGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextObjectPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"prototype\")?.value;\nconst __velarTextObjectCreate = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"create\")?.value;\nconst __velarTextObjectFreeze = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"freeze\")?.value;\nconst __velarTextArrayPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"prototype\")?.value;\nconst __velarTextArrayJoin = __velarTextGetOwnPropertyDescriptor(__velarTextArrayPrototype, \"join\")?.value;\nconst __velarTextStringTrimStart = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trimStart\")?.value;\nconst __velarTextStringTrimEnd = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trimEnd\")?.value;\nconst __velarTextStringNormalize = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"normalize\")?.value;\nconst __velarTextNativeDate = globalThis.Date;\nconst __velarTextDateNow = __velarTextGetOwnPropertyDescriptor(__velarTextNativeDate, \"now\")?.value;\nconst nativeRegExpPrototype = __velarTextGetPrototypeOf(/(?:)/u);\nconst NativeRegExp = __velarTextGetOwnPropertyDescriptor(nativeRegExpPrototype, \"constructor\")?.value;\nconst nativeRegExpExec = __velarTextGetOwnPropertyDescriptor(nativeRegExpPrototype, \"exec\")?.value;\nconst nativeStringReplaceAll = __velarNativeStringReplaceAll;\nconst __velarTextStringCodePointAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"codePointAt\")?.value;\nconst __velarTextStringFromCodePoint = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"fromCodePoint\")?.value;\nconst __velarTextTitleSeparators = /[_\\-/]+/gu;\nconst __velarTextTitleWords = /(^|\\s)([\\p{L}\\p{N}])/gu;\n// A line ends at CRLF, at a lone CR, or at LF — the same three the language\n// itself accepts as a statement separator and the same three\n// SourceText indexes for diagnostics. A text API that disagreed with its\n// own language would make Text.lineStarts on Vel source compute line\n// numbers the compiler does not report.\nconst __velarTextLines = /\\r\\n|[\\r\\n]/gu;\nconst __velarTextWords = /\\s+/gu;\nconst __velarTextLatinMarks = /(?<=\\p{Script=Latin})\\p{M}+/gu;\nconst __velarTextBaselessMarks = /(?<![\\p{L}\\p{N}\\p{M}])\\p{M}+/gu;\nconst __velarTextSlugSeparators = /[^\\p{L}\\p{N}\\p{M}]+/gu;\nconst __velarTextSlugEdges = /^-+|-+$/gu;\nconst __velarTextWhitespace = /\\s+/gu;\nconst __velarTextPatternPrefix = /^Invalid regular expression: (?:\\/[\\s\\S]*\\/[a-z]*: )?/u;\nfunction __velarTextAppend(values, value) { values[values.length] = value; }\nfunction __velarTextJoin(values, separator) { return __velarTextCall(__velarTextArrayJoin, values, [separator]); }\n// TXT-P2: bounded work is already the promise on this surface — the code-unit\n// and item caps are here — and time was the dimension that was missed, so a\n// backtracking pattern over hostile input could run for as long as it liked.\n// Every operation that runs a pattern the author supplied gets a fresh budget,\n// checked at every exec boundary. The engine is not interruptible, so one\n// catastrophic exec is caught when it returns rather than pre-empted; that\n// still turns a silent unbounded hang into a loud bounded failure and stops\n// the amplification a per-match loop would otherwise give it. The budget is\n// deliberately not charged to slug, title or normalizeWhitespace: they run\n// this module's own linear patterns, so their only bound is on size, and a\n// wall clock would otherwise make a large but legal text succeed or fail by\n// how busy the machine is.\nfunction patternDeadline() { return __velarTextCall(__velarTextDateNow, __velarTextNativeDate, []) + maxTextPatternMillis; }\nfunction checkPatternDeadline(deadline) {\n if (__velarTextCall(__velarTextDateNow, __velarTextNativeDate, []) > deadline) throw new __velarTextNativeRangeError(\"text pattern matching cannot exceed \" + maxTextPatternMillis + \" ms\");\n}\nfunction __velarTextRegexReplace(value, pattern, replacement) {\n pattern.lastIndex = 0;\n const output = []; let end = 0, units = 0;\n while (true) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n if (raw === null) break;\n const match = checkedMatchValue(raw, value);\n const before = __velarTextCall(__velarNativeStringSlice, value, [end, match.unitIndex]);\n const next = typeof replacement === \"function\" ? replacement(match) : replacement;\n if (typeof next !== \"string\") throw new __velarTextNativeTypeError(\"Text replacement must produce a string\");\n units += before.length + next.length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text replacement output cannot exceed 16 MiB\");\n __velarTextAppend(output, before); __velarTextAppend(output, next);\n end = match.unitIndex + match.value.length;\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n const tail = __velarTextCall(__velarNativeStringSlice, value, [end]);\n if (units + tail.length > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text replacement output cannot exceed 16 MiB\");\n __velarTextAppend(output, tail); pattern.lastIndex = 0;\n return __velarTextJoin(output, \"\");\n}\nfunction __velarTextRegexSplit(value, pattern, limit) {\n pattern.lastIndex = 0;\n const output = []; let end = 0;\n while (output.length + 1 < limit) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n if (raw === null) break;\n const match = checkedMatchValue(raw, value);\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end, match.unitIndex]));\n end = match.unitIndex + match.value.length;\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n if (output.length < limit) __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end]));\n pattern.lastIndex = 0;\n return output;\n}\nfunction valueOf(value) { return __velarTextArgument(value, \"velar/text value\"); }\nfunction textOutput(value, name) { return __velarTextOutput(value, name); }\nfunction textCount(value, name) { return __velarTextCount(value, name); }\nfunction textList(values, name) { return __velarTextList(values, name); }\nfunction htmlOutputUnits(value) {\n let units = value.length;\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index];\n if (character === \"&\" || character === \"'\") units += 4;\n else if (character === \"<\" || character === \">\") units += 3;\n else if (character === '\"') units += 5;\n if (units > maxTextCodeUnits) return units;\n }\n return units;\n}\nconst codePointLength = __velarTextCodePointLength;\nconst codePointPrefix = __velarTextCodePointPrefix;\nfunction patternOptions(value) {\n if (value == null) return {};\n const prototype = typeof value === \"object\" && value !== null ? __velarTextGetPrototypeOf(value) : undefined;\n if (typeof value !== \"object\" || value === null || __velarTextCall(__velarTextArrayIsArray, __velarTextNativeArray, [value]) || (prototype !== __velarTextObjectPrototype && prototype !== null)) throw new __velarTextNativeTypeError(\"text pattern options must be a record\");\n if (__velarTextGetOwnPropertySymbols(value).length > 0) throw new __velarTextNativeTypeError(\"text pattern options cannot contain symbol fields\");\n const output = __velarTextCall(__velarTextObjectCreate, __velarTextNativeObject, [null]);\n const names = __velarTextGetOwnPropertyNames(value);\n for (let index = 0; index < names.length; index += 1) {\n const name = names[index];\n const descriptor = __velarTextGetOwnPropertyDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) throw new __velarTextNativeTypeError(\"Text pattern option '\" + name + \"' must be an enumerable data field\");\n if (name !== \"ignoreCase\" && name !== \"multiline\" && name !== \"dotAll\") throw new __velarTextNativeTypeError(\"Unknown text pattern option '\" + name + \"'\");\n const option = descriptor.value;\n if (option != null && typeof option !== \"boolean\") throw new __velarTextNativeTypeError(\"Text pattern option '\" + name + \"' must be bool\");\n output[name] = option;\n }\n return output;\n}\n// TXT-P1: the engine's reason is the only actionable half of an invalid-pattern\n// failure. Patterns compile in 'u' mode, so an identity escape that is tolerated\n// everywhere else in JavaScript is an error here, and \"[a-z\" and \"\\\\@\" are\n// otherwise byte-identical failures. The host-shaped prefix is stripped so the\n// engine's own text does not travel verbatim, and a caught value that is not an\n// Error, or carries no usable message, falls back to the bare message.\nfunction patternReason(error) {\n if (typeof error !== \"object\" || error === null) return \"\";\n const descriptor = __velarTextGetOwnPropertyDescriptor(error, \"message\");\n if (!descriptor || !(\"value\" in descriptor) || typeof descriptor.value !== \"string\") return \"\";\n const message = descriptor.value;\n const prefix = __velarTextCall(nativeRegExpExec, __velarTextPatternPrefix, [message]);\n const head = prefix === null ? null : __velarTextGetOwnPropertyDescriptor(prefix, 0);\n const reason = head && typeof head.value === \"string\" ? __velarTextCall(__velarNativeStringSlice, message, [head.value.length]) : message;\n return reason === \"\" || reason.length > 200 ? \"\" : \": \" + reason;\n}\nfunction patternOf(expression, options, global = false) {\n expression = valueOf(expression); options = patternOptions(options);\n if (expression.length > 4096) throw new __velarTextNativeRangeError(\"text patterns cannot exceed 4096 code units\");\n let flags = \"u\";\n if (global) flags += \"g\";\n if (options.ignoreCase === true) flags += \"i\";\n if (options.multiline === true) flags += \"m\";\n if (options.dotAll === true) flags += \"s\";\n try { return new NativeRegExp(expression, flags); }\n catch (error) { throw new __velarTextNativeTypeError(\"Invalid text pattern\" + patternReason(error)); }\n}\nfunction checkedMatchValue(match, input) {\n if (!__velarTextCall(__velarTextArrayIsArray, __velarTextNativeArray, [match]) || match.length < 1 || match.length > 4097) throw new __velarTextNativeTypeError(\"The regular expression engine returned an invalid match\");\n const groups = new __velarTextNativeArray(match.length - 1);\n for (let index = 0; index < match.length; index += 1) {\n const descriptor = __velarTextGetOwnPropertyDescriptor(match, index);\n if (!descriptor || !(\"value\" in descriptor)) throw new __velarTextNativeTypeError(\"Regular expression matches must contain data values\");\n const value = descriptor.value;\n if (value !== undefined && typeof value !== \"string\") throw new __velarTextNativeTypeError(\"Regular expression match values must be strings\");\n if (index === 0) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"A regular expression match requires full text\");\n } else groups[index - 1] = value === undefined ? null : value;\n }\n const indexDescriptor = __velarTextGetOwnPropertyDescriptor(match, \"index\");\n if (!indexDescriptor || !(\"value\" in indexDescriptor) || !__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [indexDescriptor.value]) || indexDescriptor.value < 0 || indexDescriptor.value > input.length) throw new __velarTextNativeTypeError(\"A regular expression match requires a valid index\");\n return { value: __velarTextGetOwnPropertyDescriptor(match, 0).value, groups, unitIndex: indexDescriptor.value };\n}\nfunction publicMatchValue(checked, input, index = null) {\n if (index === null) index = __velarTextCodePointIndex(input, checked.unitIndex);\n if (index === null) throw new __velarTextNativeTypeError(\"A regular expression match must begin at a Unicode code-point boundary\");\n return __velarTextCall(__velarTextObjectFreeze, __velarTextNativeObject, [{ value: checked.value, index, groups: checked.groups }]);\n}\nfunction nextTextIndex(value, index) {\n return index >= value.length ? index + 1 : __velarTextNextCodePointOffset(value, index);\n}\nfunction eachMatch(value, pattern, visit) {\n const deadline = patternDeadline();\n let count = 0, units = 0, previousUnitIndex = 0, previousCodePointIndex = 0;\n while (true) {\n const raw = __velarTextCall(nativeRegExpExec, pattern, [value]);\n checkPatternDeadline(deadline);\n if (raw === null) return;\n if (count >= maxTextItems) throw new __velarTextNativeRangeError(\"Text patterns cannot produce more than \" + maxTextItems + \" matches\");\n count += 1;\n const checked = checkedMatchValue(raw, value);\n const distance = __velarTextCodePointDistance(value, previousUnitIndex, checked.unitIndex);\n if (distance === null) throw new __velarTextNativeTypeError(\"A regular expression match must begin at a Unicode code-point boundary\");\n const match = publicMatchValue(checked, value, previousCodePointIndex + distance);\n previousUnitIndex = checked.unitIndex;\n previousCodePointIndex = match.index;\n units += match.value.length;\n for (let index = 0; index < match.groups.length; index += 1) { const group = match.groups[index]; if (group !== null) units += group.length; }\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"Text pattern results cannot exceed 16 MiB\");\n visit(match, checked.unitIndex);\n if (match.value === \"\") pattern.lastIndex = nextTextIndex(value, pattern.lastIndex);\n }\n}\nexport function trimStart(value) { return __velarTextCall(__velarTextStringTrimStart, valueOf(value), []); }\nexport function trimEnd(value) { return __velarTextCall(__velarTextStringTrimEnd, valueOf(value), []); }\nexport function capitalize(value) { value = valueOf(value); if (!value) return \"\"; const end = __velarTextNextCodePointOffset(value, 0); const first = __velarTextCall(__velarNativeStringSlice, value, [0, end]); const tail = __velarTextCall(__velarNativeStringSlice, value, [end]); return textOutput(__velarTextCall(__velarNativeStringUpper, first, []) + __velarTextCall(__velarNativeStringLower, tail, []), \"capitalize\"); }\nexport function title(value) { let output = __velarTextCall(__velarNativeStringLower, valueOf(value), []); output = __velarTextRegexReplace(output, __velarTextTitleSeparators, \" \"); output = __velarTextRegexReplace(output, __velarTextTitleWords, match => match.groups[0] + __velarTextCall(__velarNativeStringUpper, match.groups[1], [])); return textOutput(output, \"title\"); }\nexport function lines(value) { return textList(__velarTextRegexSplit(valueOf(value), __velarTextLines, maxTextItems + 1), \"lines\"); }\nexport function lineStarts(value) {\n value = valueOf(value);\n const output = [0];\n let unitOffset = 0, codePointOffset = 0;\n while (unitOffset < value.length) {\n const nextUnitOffset = __velarTextNextCodePointOffset(value, unitOffset);\n const code = __velarTextCall(__velarNativeStringCharCodeAt, value, [unitOffset]);\n // CRLF is one break, not two: consume the LF with the CR so the following\n // line starts once. A lone CR breaks as well — see __velarTextLines.\n if (code === 13 && __velarTextCall(__velarNativeStringCharCodeAt, value, [nextUnitOffset]) === 10) {\n __velarTextAppend(output, codePointOffset + 2);\n unitOffset = __velarTextNextCodePointOffset(value, nextUnitOffset);\n codePointOffset += 2;\n continue;\n }\n if (code === 10 || code === 13) __velarTextAppend(output, codePointOffset + 1);\n unitOffset = nextUnitOffset;\n codePointOffset += 1;\n }\n return textList(output, \"lineStarts\");\n}\nexport function chunks(value, size) {\n value = valueOf(value);\n size = textCount(size, \"chunks size\");\n if (size === 0) throw new __velarTextNativeRangeError(\"chunks size must be greater than zero\");\n if (value.length === 0) return [];\n const output = [];\n let start = 0, offset = 0, count = 0;\n while (offset < value.length) {\n offset = __velarTextNextCodePointOffset(value, offset);\n count += 1;\n if (count === size) {\n if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"chunks cannot produce more than \" + maxTextItems + \" items\");\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [start, offset]));\n start = offset;\n count = 0;\n }\n }\n if (start < value.length) {\n if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"chunks cannot produce more than \" + maxTextItems + \" items\");\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [start]));\n }\n return textList(output, \"chunks\");\n}\nexport function words(value) { const cleaned = __velarTextCall(__velarNativeStringTrim, valueOf(value), []); return cleaned ? textList(__velarTextRegexSplit(cleaned, __velarTextWords, maxTextItems + 1), \"words\") : []; }\n// TXT-U4: the NFKD pass is folding machinery, not a result. Text equality is\n// code-point-sequence identity, so a decomposed slug misses the text it renders\n// as — a Hangul syllable comes back as conjoining jamo and never matches the\n// title it was made from. The output is recomposed to NFC before it leaves.\n// Folding only reaches marks sitting on a Latin base, because dropping a mark\n// is meaning-preserving there and meaning-destroying everywhere else: every\n// other script keeps its marks, and those slugs are percent-encoded in a URL.\n// Marks the separator pass now has to keep must still have something to sit\n// on: a mark run with no letter or digit before it — a variation selector left\n// behind by a dropped emoji, a stray accent — is invisible in a URL, so two\n// slugs that read alike would name different pages. Those runs go.\nexport function slug(value) { let output = __velarTextCall(__velarTextStringNormalize, valueOf(value), [\"NFKD\"]); output = __velarTextRegexReplace(output, __velarTextLatinMarks, \"\"); output = __velarTextRegexReplace(output, __velarTextBaselessMarks, \"\"); output = __velarTextCall(__velarNativeStringLower, output, []); output = __velarTextCall(__velarNativeStringTrim, output, []); output = __velarTextRegexReplace(output, __velarTextSlugSeparators, \"-\"); output = __velarTextRegexReplace(output, __velarTextSlugEdges, \"\"); return textOutput(__velarTextCall(__velarTextStringNormalize, output, [\"NFC\"]), \"slug\"); }\n// TXT-U3: text equality is code-point-sequence identity, so \"café\" typed on a\n// keyboard (NFC) and the same name read back from a macOS filename (NFD) are\n// different values with different sizes. This is the boundary tool that makes\n// them one value; the four Unicode forms are the only accepted spellings.\nexport function normalize(value, form = \"NFC\") {\n value = valueOf(value);\n form = valueOf(form);\n if (form !== \"NFC\" && form !== \"NFD\" && form !== \"NFKC\" && form !== \"NFKD\") {\n throw new __velarTextNativeRangeError(\"normalize form must be NFC, NFD, NFKC, or NFKD\");\n }\n return textOutput(__velarTextCall(__velarTextStringNormalize, value, [form]), \"normalize\");\n}\nexport function truncate(value, length, suffix = \"…\") { value = valueOf(value); suffix = valueOf(suffix); length = textCount(length, \"truncate length\"); const valueLength = codePointLength(value); if (valueLength <= length) return value; const suffixLength = codePointLength(suffix); if (suffixLength >= length) return codePointPrefix(suffix, length); return codePointPrefix(value, length - suffixLength) + suffix; }\nexport function indent(value, prefix = \" \") {\n const rows = lines(valueOf(value)); prefix = valueOf(prefix);\n let units = __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [0, rows.length - 1]);\n const output = new __velarTextNativeArray(rows.length);\n for (let index = 0; index < rows.length; index += 1) {\n units += prefix.length + rows[index].length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"indent output cannot exceed 16 MiB\");\n output[index] = prefix + rows[index];\n }\n return __velarTextJoin(output, \"\\n\");\n}\nexport function dedent(value) { const rows = lines(valueOf(value)); let width = null; for (let index = 0; index < rows.length; index += 1) { const line = rows[index]; if (__velarTextCall(__velarNativeStringTrim, line, [])) { let current = 0; while (current < line.length && (line[current] === \" \" || line[current] === \"\\t\")) current += 1; width = width === null ? current : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [width, current]); } } const output = new __velarTextNativeArray(rows.length); for (let index = 0; index < rows.length; index += 1) output[index] = __velarTextCall(__velarNativeStringSlice, rows[index], [width ?? 0]); return __velarTextJoin(output, \"\\n\"); }\nexport function normalizeWhitespace(value) { return __velarTextRegexReplace(__velarTextCall(__velarNativeStringTrim, valueOf(value), []), __velarTextWhitespace, \" \"); }\nexport function utf8Size(value) { return __velarUtf8ByteLength(valueOf(value)); }\nexport function escapeHtml(value) {\n value = valueOf(value);\n if (htmlOutputUnits(value) > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"escapeHtml output cannot exceed 16 MiB\");\n const replacements = [[\"&\", \"&amp;\"], [\"<\", \"&lt;\"], [\">\", \"&gt;\"], ['\"', \"&quot;\"], [\"'\", \"&#39;\"]];\n for (let index = 0; index < replacements.length; index += 1) {\n const pair = replacements[index];\n value = __velarTextCall(nativeStringReplaceAll, value, [pair[0], pair[1]]);\n }\n return value;\n}\n// TXT-U4 (D50 rule 90 item 4): one character in, one code point out. Anything\n// that is not exactly one code point — empty text, several characters, or a\n// lone surrogate half — answers null rather than a partial reading, and the\n// inverse refuses to build a surrogate half that could never stand alone.\nexport function codePoint(value) {\n value = valueOf(value);\n if (value.length === 0 || __velarTextNextCodePointOffset(value, 0) !== value.length) return null;\n const point = __velarTextCall(__velarTextStringCodePointAt, value, [0]);\n if (typeof point !== \"number\" || point >= 0xD800 && point <= 0xDFFF) return null;\n return point;\n}\nexport function fromCodePoint(value) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > 0x10FFFF) {\n throw new __velarTextNativeRangeError(\"fromCodePoint requires a code point from 0 through 1114111\");\n }\n if (value >= 0xD800 && value <= 0xDFFF) throw new __velarTextNativeRangeError(\"fromCodePoint refuses surrogate halves; they are not characters on their own\");\n return __velarTextCall(__velarTextStringFromCodePoint, __velarTextNativeString, [value]);\n}\nexport function matches(value, expression, options = {}) { value = valueOf(value); const pattern = patternOf(expression, options); const deadline = patternDeadline(); const found = __velarTextCall(nativeRegExpExec, pattern, [value]) !== null; checkPatternDeadline(deadline); return found; }\nexport function findMatch(value, expression, options = {}) { value = valueOf(value); const pattern = patternOf(expression, options); const deadline = patternDeadline(); const match = __velarTextCall(nativeRegExpExec, pattern, [value]); checkPatternDeadline(deadline); return match === null ? null : publicMatchValue(checkedMatchValue(match, value), value); }\nexport function findMatches(value, expression, options = {}) { value = valueOf(value); const output = []; eachMatch(value, patternOf(expression, options, true), match => __velarTextAppend(output, match)); return output; }\nexport function replaceMatches(value, expression, replacement, options = {}) {\n value = valueOf(value); replacement = valueOf(replacement);\n const output = []; let end = 0, units = 0;\n eachMatch(value, patternOf(expression, options, true), (match, unitIndex) => {\n const before = __velarTextCall(__velarNativeStringSlice, value, [end, unitIndex]);\n units += before.length + replacement.length;\n if (units > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"replaceMatches output cannot exceed 16 MiB\");\n __velarTextAppend(output, before); __velarTextAppend(output, replacement);\n end = unitIndex + match.value.length;\n });\n const tail = __velarTextCall(__velarNativeStringSlice, value, [end]);\n if (units + tail.length > maxTextCodeUnits) throw new __velarTextNativeRangeError(\"replaceMatches output cannot exceed 16 MiB\");\n __velarTextAppend(output, tail);\n return __velarTextJoin(output, \"\");\n}\nexport function splitPattern(value, expression, options = {}) {\n value = valueOf(value); const output = []; let end = 0;\n eachMatch(value, patternOf(expression, options, true), (match, unitIndex) => { if (output.length >= maxTextItems) throw new __velarTextNativeRangeError(\"splitPattern cannot produce more than \" + maxTextItems + \" items\"); __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end, unitIndex])); end = unitIndex + match.value.length; });\n __velarTextAppend(output, __velarTextCall(__velarNativeStringSlice, value, [end])); return textList(output, \"splitPattern\");\n}\n","const __velarReactiveIterateKey = null;\nconst __velarReactiveStructureKey = null;\nfunction __velarReactiveRaw(value) { return value; }\nfunction __velarHostRaw(value) { return value; }\n\nfunction __velarReactiveCollectionRead(value, key, child) { return child === undefined ? null : child; }\nfunction __velarReactiveCollectionTrack() {}\nfunction __velarReactiveCollectionLink() {}\nfunction __velarReactiveCollectionTrigger() {}\nfunction __velarReactiveCollectionUnlink() {}\n\nexport {\n __velarReactiveIterateKey as reactiveIterateKey,\n __velarReactiveStructureKey as reactiveStructureKey,\n __velarReactiveRaw as reactiveRaw,\n __velarHostRaw as hostRaw,\n __velarReactiveCollectionRead as reactiveCollectionRead,\n __velarReactiveCollectionTrack as reactiveCollectionTrack,\n __velarReactiveCollectionLink as reactiveCollectionLink,\n __velarReactiveCollectionTrigger as reactiveCollectionTrigger,\n __velarReactiveCollectionUnlink as reactiveCollectionUnlink,\n};\n","const __velarCollectionNativeArray = globalThis.Array;\nconst __velarCollectionNativeMap = globalThis.Map;\nconst __velarCollectionNativeSet = globalThis.Set;\nconst __velarCollectionNativeObject = globalThis.Object;\nconst __velarCollectionNativeReflect = globalThis.Reflect;\nconst __velarCollectionNativeWeakMap = globalThis.WeakMap;\nconst __velarCollectionNativeTypeError = globalThis.TypeError;\nconst __velarCollectionGetOwnPropertyDescriptor = __velarCollectionNativeObject.getOwnPropertyDescriptor;\nconst __velarCollectionReflectApply = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"apply\")?.value;\nconst __velarCollectionArrayIsArray = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"isArray\")?.value;\nconst __velarCollectionGetPrototypeOf = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getPrototypeOf\")?.value;\nconst __velarCollectionObjectPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"prototype\")?.value;\nconst __velarCollectionMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeMap, \"prototype\")?.value;\nconst __velarCollectionSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeSet, \"prototype\")?.value;\nconst __velarCollectionMapSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"size\")?.get;\nconst __velarCollectionSetSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"size\")?.get;\nfunction __velarCollectionHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarCollectionReflectApply !== \"function\") throw new __velarCollectionNativeTypeError(\"The JavaScript collection runtime is unavailable\");\n return __velarCollectionReflectApply(operation, receiver, arguments_);\n}\nconst __velarCollectionWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeWeakMap, \"prototype\")?.value;\nconst __velarCollectionWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"get\")?.value;\nconst __velarCollectionWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"set\")?.value;\nconst __velarCollectionBrands = new __velarCollectionNativeWeakMap();\n// The only unforgeable, cross-realm Map/Set test JavaScript offers is invoking\n// the prototype 'size' getter and observing whether it throws, and a thrown and\n// caught exception costs roughly 1.8us -- paid by every Set membership test,\n// which probes Map first. Internal slots are fixed at construction, so the\n// verdict can never change for a given object: probe once, then answer from a\n// WeakMap. 0 = neither, 1 = Map, 2 = Set.\nfunction __velarCollectionBrand(value) {\n if (value === null || (typeof value !== \"object\" && typeof value !== \"function\")) return 0;\n const known = __velarCollectionHostCall(__velarCollectionWeakMapGetOperation, __velarCollectionBrands, [value]);\n if (known !== undefined) return known;\n let brand = 0;\n try { __velarCollectionHostCall(__velarCollectionMapSize, value, []); brand = 1; }\n catch {\n try { __velarCollectionHostCall(__velarCollectionSetSize, value, []); brand = 2; }\n catch { brand = 0; }\n }\n __velarCollectionHostCall(__velarCollectionWeakMapSetOperation, __velarCollectionBrands, [value, brand]);\n return brand;\n}\nfunction __velarIsMap(value) {\n return __velarCollectionBrand(value) === 1;\n}\nfunction __velarIsSet(value) {\n return __velarCollectionBrand(value) === 2;\n}\nfunction __velarIsRecord(value) {\n if (value === null || typeof value !== \"object\" || __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value])) return false;\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n return prototype === __velarCollectionObjectPrototype || prototype === null;\n}\n\nconst __velarCollectionListNativeNumber = globalThis.Number;\nconst __velarCollectionListNativeMath = globalThis.Math;\nconst __velarCollectionListNativeRangeError = globalThis.RangeError;\nconst __velarCollectionListArrayPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"prototype\")?.value;\nconst __velarCollectionListOwnNamesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionListOwnSymbolsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionListDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarCollectionListObjectIsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"is\")?.value;\nconst __velarCollectionListIntegerOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isInteger\")?.value;\nconst __velarCollectionListSafeIntegerOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isSafeInteger\")?.value;\nconst __velarCollectionListNaNOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isNaN\")?.value;\nconst __velarCollectionListFiniteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeNumber, \"isFinite\")?.value;\nconst __velarCollectionListMaximumOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeMath, \"max\")?.value;\nconst __velarCollectionListMinimumOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListNativeMath, \"min\")?.value;\nconst __velarCollectionListJoinOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"join\")?.value;\nconst __velarCollectionListSortOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"sort\")?.value;\nconst __velarCollectionListReverseOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionListArrayPrototype, \"reverse\")?.value;\nfunction __velarCollectionListIsArray(value) { return __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]); }\nfunction __velarCollectionListGetOwnPropertyDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarCollectionListOwnNames(value) { return __velarCollectionHostCall(__velarCollectionListOwnNamesOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionListOwnSymbols(value) { return __velarCollectionHostCall(__velarCollectionListOwnSymbolsOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionListDefineProperty(value, key, descriptor) { return __velarCollectionHostCall(__velarCollectionListDefinePropertyOperation, __velarCollectionNativeObject, [value, key, descriptor]); }\nfunction __velarCollectionListObjectIs(left, right) { return __velarCollectionHostCall(__velarCollectionListObjectIsOperation, __velarCollectionNativeObject, [left, right]); }\nfunction __velarCollectionListIsInteger(value) { return __velarCollectionHostCall(__velarCollectionListIntegerOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListIsSafeInteger(value) { return __velarCollectionHostCall(__velarCollectionListSafeIntegerOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListIsNaN(value) { return __velarCollectionHostCall(__velarCollectionListNaNOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListIsFinite(value) { return __velarCollectionHostCall(__velarCollectionListFiniteOperation, __velarCollectionListNativeNumber, [value]); }\nfunction __velarCollectionListMaximum(...values) { return __velarCollectionHostCall(__velarCollectionListMaximumOperation, __velarCollectionListNativeMath, values); }\nfunction __velarCollectionListMinimum(...values) { return __velarCollectionHostCall(__velarCollectionListMinimumOperation, __velarCollectionListNativeMath, values); }\nfunction __velarCollectionListHostJoin(value, separator) { return __velarCollectionHostCall(__velarCollectionListJoinOperation, value, [separator]); }\nfunction __velarCollectionListHostSort(value, compare) { return __velarCollectionHostCall(__velarCollectionListSortOperation, value, [compare]); }\nfunction __velarCollectionListHostReverse(value) { return __velarCollectionHostCall(__velarCollectionListReverseOperation, value, []); }\n\nconst __velarCollectionSetMapNativeRangeError = globalThis.RangeError;\nconst __velarCollectionSetMapFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nconst __velarCollectionSetAddOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"add\")?.value;\nconst __velarCollectionSetHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"has\")?.value;\nconst __velarCollectionSetDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"delete\")?.value;\nconst __velarCollectionSetClearOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"clear\")?.value;\nconst __velarCollectionSetValuesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"values\")?.value;\nconst __velarCollectionMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"get\")?.value;\nconst __velarCollectionMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"set\")?.value;\nconst __velarCollectionMapHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"has\")?.value;\nconst __velarCollectionMapDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"delete\")?.value;\nconst __velarCollectionMapClearOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"clear\")?.value;\nconst __velarCollectionMapKeysOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"keys\")?.value;\nconst __velarCollectionMapValuesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"values\")?.value;\nconst __velarCollectionMapEntriesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"entries\")?.value;\nconst __velarCollectionSetMapMapIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionMapEntriesOperation, new __velarCollectionNativeMap(), [])]);\nconst __velarCollectionSetMapSetIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionSetValuesOperation, new __velarCollectionNativeSet(), [])]);\nconst __velarCollectionSetMapMapIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetMapMapIteratorPrototype, \"next\")?.value;\nconst __velarCollectionSetMapSetIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetMapSetIteratorPrototype, \"next\")?.value;\nfunction __velarCollectionSetMapFreeze(value) { return __velarCollectionHostCall(__velarCollectionSetMapFreezeOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionSetMapSetSize(value) { return __velarCollectionHostCall(__velarCollectionSetSize, value, []); }\nfunction __velarCollectionSetMapMapSize(value) { return __velarCollectionHostCall(__velarCollectionMapSize, value, []); }\nfunction __velarCollectionSetMapSetAdd(value, item) { return __velarCollectionHostCall(__velarCollectionSetAddOperation, value, [item]); }\nfunction __velarCollectionSetMapSetHas(value, item) { return __velarCollectionHostCall(__velarCollectionSetHasOperation, value, [item]); }\nfunction __velarCollectionSetMapSetDelete(value, item) { return __velarCollectionHostCall(__velarCollectionSetDeleteOperation, value, [item]); }\nfunction __velarCollectionSetMapSetClear(value) { return __velarCollectionHostCall(__velarCollectionSetClearOperation, value, []); }\nfunction __velarCollectionSetMapSetValues(value) { return __velarCollectionHostCall(__velarCollectionSetValuesOperation, value, []); }\nfunction __velarCollectionSetMapSetNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetMapSetIteratorNext, iterator, []); }\nfunction __velarCollectionSetMapMapGet(value, key) { return __velarCollectionHostCall(__velarCollectionMapGetOperation, value, [key]); }\nfunction __velarCollectionSetMapMapSet(value, key, item) { return __velarCollectionHostCall(__velarCollectionMapSetOperation, value, [key, item]); }\nfunction __velarCollectionSetMapMapHas(value, key) { return __velarCollectionHostCall(__velarCollectionMapHasOperation, value, [key]); }\nfunction __velarCollectionSetMapMapDelete(value, key) { return __velarCollectionHostCall(__velarCollectionMapDeleteOperation, value, [key]); }\nfunction __velarCollectionSetMapMapClear(value) { return __velarCollectionHostCall(__velarCollectionMapClearOperation, value, []); }\nfunction __velarCollectionSetMapMapKeys(value) { return __velarCollectionHostCall(__velarCollectionMapKeysOperation, value, []); }\nfunction __velarCollectionSetMapMapValues(value) { return __velarCollectionHostCall(__velarCollectionMapValuesOperation, value, []); }\nfunction __velarCollectionSetMapMapEntries(value) { return __velarCollectionHostCall(__velarCollectionMapEntriesOperation, value, []); }\nfunction __velarCollectionSetMapMapNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetMapMapIteratorNext, iterator, []); }\n\nconst __velarCollectionRecordNativeRangeError = globalThis.RangeError;\nconst __velarCollectionRecordOwnNamesOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionRecordOwnSymbolsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionRecordDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarCollectionRecordObjectIsOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"is\")?.value;\nconst __velarCollectionRecordDeletePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"deleteProperty\")?.value;\nconst __velarCollectionRecordFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nfunction __velarCollectionRecordGetOwnPropertyDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarCollectionRecordOwnNames(value) { return __velarCollectionHostCall(__velarCollectionRecordOwnNamesOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionRecordOwnSymbols(value) { return __velarCollectionHostCall(__velarCollectionRecordOwnSymbolsOperation, __velarCollectionNativeObject, [value]); }\nfunction __velarCollectionRecordDefineProperty(value, key, descriptor) { return __velarCollectionHostCall(__velarCollectionRecordDefinePropertyOperation, __velarCollectionNativeObject, [value, key, descriptor]); }\nfunction __velarCollectionRecordObjectIs(left, right) { return __velarCollectionHostCall(__velarCollectionRecordObjectIsOperation, __velarCollectionNativeObject, [left, right]); }\nfunction __velarCollectionRecordDeleteProperty(value, key) { return __velarCollectionHostCall(__velarCollectionRecordDeletePropertyOperation, __velarCollectionNativeReflect, [value, key]); }\nfunction __velarCollectionRecordFreeze(value) { return __velarCollectionHostCall(__velarCollectionRecordFreezeOperation, __velarCollectionNativeObject, [value]); }\n\nexport {\n __velarCollectionNativeArray,\n __velarCollectionNativeMap,\n __velarCollectionNativeSet,\n __velarCollectionNativeObject,\n __velarCollectionNativeTypeError,\n __velarCollectionGetPrototypeOf,\n __velarCollectionObjectPrototype,\n __velarCollectionHostCall,\n __velarIsMap,\n __velarIsSet,\n __velarIsRecord,\n __velarCollectionListNativeRangeError,\n __velarCollectionListIsArray,\n __velarCollectionListGetOwnPropertyDescriptor,\n __velarCollectionListOwnNames,\n __velarCollectionListOwnSymbols,\n __velarCollectionListDefineProperty,\n __velarCollectionListObjectIs,\n __velarCollectionListIsInteger,\n __velarCollectionListIsSafeInteger,\n __velarCollectionListIsNaN,\n __velarCollectionListIsFinite,\n __velarCollectionListMaximum,\n __velarCollectionListMinimum,\n __velarCollectionListHostJoin,\n __velarCollectionListHostSort,\n __velarCollectionListHostReverse,\n __velarCollectionSetMapNativeRangeError,\n __velarCollectionSetMapFreeze,\n __velarCollectionSetMapSetSize,\n __velarCollectionSetMapMapSize,\n __velarCollectionSetMapSetAdd,\n __velarCollectionSetMapSetHas,\n __velarCollectionSetMapSetDelete,\n __velarCollectionSetMapSetClear,\n __velarCollectionSetMapSetValues,\n __velarCollectionSetMapSetNext,\n __velarCollectionSetMapMapGet,\n __velarCollectionSetMapMapSet,\n __velarCollectionSetMapMapHas,\n __velarCollectionSetMapMapDelete,\n __velarCollectionSetMapMapClear,\n __velarCollectionSetMapMapKeys,\n __velarCollectionSetMapMapValues,\n __velarCollectionSetMapMapEntries,\n __velarCollectionSetMapMapNext,\n __velarCollectionRecordNativeRangeError,\n __velarCollectionRecordGetOwnPropertyDescriptor,\n __velarCollectionRecordOwnNames,\n __velarCollectionRecordOwnSymbols,\n __velarCollectionRecordDefineProperty,\n __velarCollectionRecordObjectIs,\n __velarCollectionRecordDeleteProperty,\n __velarCollectionRecordFreeze,\n};\n","import {\n __velarCollectionNativeArray,\n __velarCollectionNativeMap,\n __velarCollectionNativeSet,\n __velarCollectionNativeObject,\n __velarCollectionNativeTypeError,\n __velarCollectionGetPrototypeOf,\n __velarCollectionObjectPrototype,\n __velarCollectionHostCall,\n __velarIsMap,\n __velarIsSet,\n __velarIsRecord,\n __velarCollectionListNativeRangeError,\n __velarCollectionListIsArray,\n __velarCollectionListGetOwnPropertyDescriptor,\n __velarCollectionListOwnNames,\n __velarCollectionListOwnSymbols,\n __velarCollectionListDefineProperty,\n __velarCollectionListObjectIs,\n __velarCollectionListIsInteger,\n __velarCollectionListIsSafeInteger,\n __velarCollectionListIsNaN,\n __velarCollectionListIsFinite,\n __velarCollectionListMaximum,\n __velarCollectionListMinimum,\n __velarCollectionListHostJoin,\n __velarCollectionListHostSort,\n __velarCollectionListHostReverse,\n __velarCollectionSetMapNativeRangeError,\n __velarCollectionSetMapFreeze,\n __velarCollectionSetMapSetSize,\n __velarCollectionSetMapMapSize,\n __velarCollectionSetMapSetAdd,\n __velarCollectionSetMapSetHas,\n __velarCollectionSetMapSetDelete,\n __velarCollectionSetMapSetClear,\n __velarCollectionSetMapSetValues,\n __velarCollectionSetMapSetNext,\n __velarCollectionSetMapMapGet,\n __velarCollectionSetMapMapSet,\n __velarCollectionSetMapMapHas,\n __velarCollectionSetMapMapDelete,\n __velarCollectionSetMapMapClear,\n __velarCollectionSetMapMapKeys,\n __velarCollectionSetMapMapValues,\n __velarCollectionSetMapMapEntries,\n __velarCollectionSetMapMapNext,\n __velarCollectionRecordNativeRangeError,\n __velarCollectionRecordGetOwnPropertyDescriptor,\n __velarCollectionRecordOwnNames,\n __velarCollectionRecordOwnSymbols,\n __velarCollectionRecordDefineProperty,\n __velarCollectionRecordObjectIs,\n __velarCollectionRecordDeleteProperty,\n __velarCollectionRecordFreeze,\n} from \"velar/compiler-runtime-collections-v1\";\nimport {\n reactiveIterateKey as __velarReactiveIterateKey,\n reactiveStructureKey as __velarReactiveStructureKey,\n reactiveRaw as __velarReactiveRaw,\n reactiveCollectionRead as __velarReactiveCollectionRead,\n reactiveCollectionTrack as __velarReactiveCollectionTrack,\n reactiveCollectionLink as __velarReactiveCollectionLink,\n reactiveCollectionTrigger as __velarReactiveCollectionTrigger,\n reactiveCollectionUnlink as __velarReactiveCollectionUnlink,\n} from \"velar/compiler-runtime-reactive-v1\";\nconst __velarIndexErrorNativeRangeError = globalThis.RangeError;\nconst __velarIndexErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarIndexError extends __velarIndexErrorNativeRangeError {\n constructor(message) {\n super(message);\n this.name = \"IndexError\";\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarIndexErrorDefineProperty(__VelarIndexError, \"name\", { value: \"IndexError\", writable: false, enumerable: false, configurable: true });\n\n\nconst __velarMaxCollectionItems = 1000000;\nconst __velarCollectionValue = value => value === undefined ? null : value;\nconst __velarSameValueZero = (left, right) => { left = __velarCollectionValue(left); right = __velarCollectionValue(right); return left === right || (left !== left && right !== right); };\nconst __velarListNativeWeakMap = globalThis.WeakMap;\nconst __velarListWeakMapPrototype = __velarCollectionListGetOwnPropertyDescriptor(__velarListNativeWeakMap, \"prototype\")?.value;\nconst __velarListWeakMapGetOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListWeakMapPrototype, \"get\")?.value;\nconst __velarListWeakMapSetOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListWeakMapPrototype, \"set\")?.value;\n// Ownership is the memo of a completed dense validation: the registry records\n// the element count the List had when it was proved dense. Any foreign length\n// change -- an unsafe push, a length assignment, a truncation -- breaks the\n// match and sends the List back through full validation, so a List that\n// crossed an unsafe boundary is never trusted on the strength of an older\n// check. Without the memo every index read on a List the compiler did not\n// build (a literal, anything velar/collections returns) revalidated every\n// element, making 'for i in range(n): values[i]' quadratic.\n//\n// COL-P1: the memo also records who wrote the elements, because that is what\n// decides how much a later read still has to prove. An *owned* List holds only\n// elements this runtime wrote: it either allocated and filled the array itself\n// (every copy, map, filter, slice, and sorted result) or started from the empty\n// List literal the compiler emitted __velarAdoptList for and took every element\n// since through a List mutation. Every slot is then an ordinary data element by\n// construction, and reading one is a plain load -- the same load List.sorted\n// already performs on its own copy. A *checked* List held elements this runtime\n// did not write when it first saw it, so every element read re-proves the slot\n// with a descriptor, and an accessor installed after validation is still\n// refused. Every array that arrives from JavaScript is checked, including one\n// handed over empty: the runtime cannot tell that array from a List literal, so\n// only the compiler ever adopts an empty array.\n//\n// Before the split every element read of every List allocated two property\n// descriptors, so summing a 1,000,000-element List by index ran ~7x slower\n// than the identical plain-JavaScript loop and 'for x in xs' ~9x slower.\n//\n// One registry answers both halves in one lookup, because a second WeakMap read\n// on the checked tier cost every literal-built List ~10% for nothing: an owned\n// List records the proved length, a checked List records its bitwise\n// complement, and a length is never negative, so the sign is the tier.\nconst __velarListMemos = new __velarListNativeWeakMap();\nconst __velarListIsFrozenOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"isFrozen\")?.value;\n// COL-U4: a frozen host array fails every mutability probe below; without\n// this check the author sees \"requires ordinary mutable List data elements\"\n// with no way out. Freezing is a whole-value verdict, so it is answered once\n// with the copy-on-the-JavaScript-side workflow.\nfunction __velarListRejectFrozen(value, name) {\n if (__velarCollectionHostCall(__velarListIsFrozenOperation, __velarCollectionNativeObject, [value])) {\n throw new __velarCollectionNativeTypeError(name + \" received a frozen JavaScript array; copy it on the JavaScript side — [...values] — before passing it to VelarScript\");\n }\n}\nfunction __velarListMemo(value) { return __velarCollectionHostCall(__velarListWeakMapGetOperation, __velarListMemos, [value]); }\n// The owned half of __velarListTier, for the callers that have already\n// validated the List and only need to know which element read to use.\nfunction __velarListIsOwned(value) { const memo = __velarListMemo(value); return memo !== undefined && memo === value.length; }\nfunction __velarAdoptList(value) { __velarCollectionHostCall(__velarListWeakMapSetOperation, __velarListMemos, [value, value.length]); return value; }\nfunction __velarMarkCheckedList(value) { __velarCollectionHostCall(__velarListWeakMapSetOperation, __velarListMemos, [value, ~value.length]); return value; }\n// A mutation re-records the proved length; it never changes which side of the\n// boundary the List came from, so a host List stays checked for its whole life.\nfunction __velarMarkOwnedList(value) {\n const memo = __velarListMemo(value);\n return memo !== undefined && memo < 0 ? __velarMarkCheckedList(value) : __velarAdoptList(value);\n}\n// COL-U4/COL-P1: freezing is the one foreign change that revokes the right to\n// mutate without moving the length, so it survives every memo hit. Every\n// operation that writes re-proves this descriptor -- one descriptor per\n// operation, never per element -- and no read has to, because reading a slot\n// does not require a mutable length. Without it a frozen List answers append,\n// index assignment, and pop with the host's own \"Cannot assign to read only\n// property 'length'\" instead of a VelarScript refusal.\nfunction __velarListRequireMutableLength(value, name) {\n const lengthDescriptor = __velarCollectionListGetOwnPropertyDescriptor(value, \"length\");\n if (!lengthDescriptor || !lengthDescriptor.writable || lengthDescriptor.enumerable || lengthDescriptor.configurable || !(\"value\" in lengthDescriptor)) throw new __velarCollectionNativeTypeError(name + \" requires an ordinary mutable List length\");\n}\nfunction __velarValidateDenseList(value, name) {\n value = __velarReactiveRaw(value);\n if (!__velarCollectionListIsArray(value) || value.length > __velarMaxCollectionItems || __velarCollectionListOwnSymbols(value).length > 0 || __velarCollectionListOwnNames(value).length !== value.length + 1) {\n throw new __velarCollectionNativeTypeError(name + \" requires a dense VelarScript List\");\n }\n __velarListRejectFrozen(value, name);\n __velarListRequireMutableLength(value, name);\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = __velarCollectionListGetOwnPropertyDescriptor(value, index);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable List data elements\");\n }\n // COL-P1: this runtime can vouch for a slot it wrote and for no other, and\n // full validation only ever runs on an array whose slots it did not write --\n // one that arrived from JavaScript, or one whose length moved behind its\n // back, which is itself proof the host is holding the array. The arrays this\n // runtime did write are adopted where they are built, and the empty List\n // literal is adopted by the code the compiler emitted for it, so nothing that\n // reaches here is owned, including an array the host handed over empty.\n return __velarMarkCheckedList(value);\n}\n// 0 = no memo this runtime can still stand behind, 1 = owned, 2 = checked.\n// The registry answers undefined for a primitive, and the recorded length is\n// only compared once it exists, so the length is never read off a non-object.\nfunction __velarListTier(value) {\n const memo = __velarListMemo(value);\n if (memo === undefined) return 0;\n if (memo === value.length) return 1;\n return ~memo === value.length ? 2 : 0;\n}\nfunction __velarValidateListTier(value, name, tier) {\n // An owned memo hit answers every probe below at once: this runtime wrote\n // every element, proved the array dense with an ordinary mutable length, and\n // re-recorded the length after each of its own mutations since. Reading is\n // all this entry point promises, so it does not re-prove the mutable length;\n // __velarValidateMutableList is the entry point for everything that writes.\n if (tier === 1) return value;\n if (tier === 0) return __velarValidateDenseList(value, name);\n // A checked memo hit already proved the array dense and in range; the length\n // descriptor is the one part of that verdict a foreign write can undo\n // without moving the length itself.\n __velarListRequireMutableLength(value, name);\n return value;\n}\nfunction __velarValidateOwnedList(value, name) {\n value = __velarReactiveRaw(value);\n return __velarValidateListTier(value, name, __velarListTier(value));\n}\n// The entry point for every operation that writes: it proves what a read\n// proves and re-proves the mutable length on top of it, on both memo tiers, so\n// a frozen List refuses in the same voice whoever built it.\nfunction __velarValidateMutableList(value, name) {\n value = __velarReactiveRaw(value);\n const tier = __velarListTier(value);\n if (tier === 0) return __velarValidateDenseList(value, name);\n __velarListRequireMutableLength(value, name);\n return value;\n}\nfunction __velarCheckedListElement(value, index, name) {\n const descriptor = __velarCollectionListGetOwnPropertyDescriptor(value, index);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable List data elements\");\n return descriptor.value;\n}\n// The load is the whole check on an owned List: this runtime wrote every slot,\n// so there is nothing left to prove about the shape of one. A slot that reads\n// as undefined is the one tamper the load still notices for free -- no List\n// element is ever undefined -- so that case pays for the descriptor probe and\n// reports the same refusal a checked List would. What it notices is a value\n// the load cannot account for, not every foreign edit: a host that keeps a\n// reference to a List this runtime owns and then rewrites a slot, installs an\n// accessor on it, or empties it while a polluted array prototype answers for\n// that index, gets its own value back. That is the residual the split accepts,\n// the same one a plain foreign write always had, and [COL-P1] pins it.\nfunction __velarOwnedListElement(value, index, name) {\n const element = value[index];\n return element === undefined ? __velarCheckedListElement(value, index, name) : element;\n}\nfunction __velarListElement(value, index, name, owned) {\n return owned ? __velarOwnedListElement(value, index, name) : __velarCheckedListElement(value, index, name);\n}\nfunction* __velarReactiveListIterator(value) { __velarReactiveCollectionTrack(value); value = __velarValidateOwnedList(value, \"List iteration\"); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) yield __velarReactiveCollectionRead(value, __velarReactiveIterateKey, __velarListElement(value, index, \"List iteration\", owned)); }\nfunction* __velarReactiveSetIterator(value) { const size = __velarCollectionSetMapSetSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); __velarReactiveCollectionTrack(value); const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return; yield __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); } }\nfunction* __velarReactiveMapKeyIterator(value) { const size = __velarCollectionSetMapMapSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const iterator = __velarCollectionSetMapMapKeys(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return; yield __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value); } }\nfunction* __velarReactiveRecordIterator(value) { const fields = __velarRecordFields(value, \"Record iteration\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); for (let index = 0; index < fields.length; index += 1) yield __velarReactiveCollectionRead(value, __velarReactiveStructureKey, fields[index]); }\nfunction __velarCopyList(value, name) {\n // Every callback operation snapshots through here, so this loop is what\n // decides what map costs before its first call: the ownership memo answers\n // the whole-List validation, and on an owned List each element is a load.\n value = __velarValidateOwnedList(value, name);\n const owned = __velarListIsOwned(value);\n const output = [];\n for (let index = 0; index < value.length; index += 1) output[index] = __velarCollectionValue(__velarListElement(value, index, name, owned));\n return __velarAdoptList(output);\n}\n// TXT-D1: ordered string comparison is code-point order (= UTF-8 binary\n// order) everywhere. UTF-16 code-unit order agrees exactly when neither\n// operand contains a surrogate, so the one native regex probe keeps the\n// decoded walk on surrogate-bearing strings only.\nconst __velarListNativeString = globalThis.String;\nconst __velarListStringPrototype = __velarCollectionListGetOwnPropertyDescriptor(__velarListNativeString, \"prototype\")?.value;\nconst __velarListStringCharCodeAt = __velarCollectionListGetOwnPropertyDescriptor(__velarListStringPrototype, \"charCodeAt\")?.value;\nconst __velarListSurrogatePattern = /[\\uD800-\\uDFFF]/;\nconst __velarListRegExpPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarListSurrogatePattern]);\nconst __velarListSurrogateExecOperation = __velarCollectionListGetOwnPropertyDescriptor(__velarListRegExpPrototype, \"exec\")?.value;\nfunction __velarListCharCode(value, index) { return __velarCollectionHostCall(__velarListStringCharCodeAt, value, [index]); }\nfunction __velarListHasSurrogate(value) { return __velarCollectionHostCall(__velarListSurrogateExecOperation, __velarListSurrogatePattern, [value]) !== null; }\nfunction __velarCodePointCompare(left, right) {\n if (left === right) return 0;\n if (!__velarListHasSurrogate(left) && !__velarListHasSurrogate(right)) return left < right ? -1 : 1;\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarListCharCode(left, leftOffset);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarListCharCode(left, leftOffset + 1);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarListCharCode(right, rightOffset);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarListCharCode(right, rightOffset + 1);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\nfunction __velarOrderedCompare(kind, left, right) {\n if (kind === \"string\") return __velarCodePointCompare(left, right);\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarRecordFields(value, name) {\n value = __velarReactiveRaw(value);\n if (!__velarIsRecord(value) || __velarCollectionRecordOwnSymbols(value).length > 0) throw new __velarCollectionNativeTypeError(name + \" requires a plain Record\");\n const fields = __velarCollectionRecordOwnNames(value);\n if (fields.length > __velarMaxCollectionItems) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n for (let index = 0; index < fields.length; index += 1) {\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, fields[index]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(name + \" requires ordinary mutable enumerable data fields\");\n }\n return fields;\n}\n\nfunction __velarCollectionIterator(value) {\n if (typeof value === \"string\") return String.prototype[Symbol.iterator].call(value);\n value = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(value)) return __velarReactiveListIterator(value);\n if (__velarIsMap(value)) return __velarReactiveMapKeyIterator(value);\n if (__velarIsSet(value)) return __velarReactiveSetIterator(value);\n if (__velarIsRecord(value)) return __velarReactiveRecordIterator(value);\n throw new __velarCollectionNativeTypeError(\"VelarScript iteration requires a List, Set, Map, or Record\");\n}\nfunction* __velarReactiveMapPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCheckedMapSize(raw, \"Map iteration\") > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarReactiveCollectionTrack(raw);\n const iterator = __velarCollectionSetMapMapEntries(raw);\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return; const entry = step.value; yield [__velarReactiveCollectionRead(raw, __velarReactiveIterateKey, entry[0]), __velarReactiveCollectionRead(raw, entry[0], entry[1])]; }\n}\nfunction* __velarReactiveRecordPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n const fields = __velarRecordFields(raw, \"Record iteration\");\n __velarReactiveCollectionTrack(raw);\n for (let index = 0; index < fields.length; index += 1) {\n const field = fields[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(raw, field);\n // COL-D1: the key snapshot can outlive the field — a body that removes\n // a later key must see that key skipped (Map iteration parity), not a\n // raw TypeError from reading a missing descriptor.\n if (descriptor === undefined) continue;\n yield [__velarReactiveCollectionRead(raw, __velarReactiveIterateKey, field), __velarReactiveCollectionRead(raw, field, descriptor.value)];\n }\n}\nfunction* __velarCollectionPairIterator(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarIsMap(raw)) { yield* __velarReactiveMapPairIterator(raw); return; }\n if (__velarIsRecord(raw)) { yield* __velarReactiveRecordPairIterator(raw); return; }\n let index = 0;\n for (const item of __velarCollectionIterator(value)) yield [item, index++];\n}\n\nfunction __velarCheckedMapSize(value, name) {\n try { return __velarCollectionSetMapMapSize(value); }\n catch { throw new __velarCollectionNativeTypeError(name + \" requires a Map\"); }\n}\nfunction __velarCheckedSetSize(value, name) {\n try { return __velarCollectionSetMapSetSize(value); }\n catch { throw new __velarCollectionNativeTypeError(name + \" requires a Set\"); }\n}\nfunction __velarListSize(value) { value = __velarValidateOwnedList(value, \"List size\"); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); return value.length; }\nfunction __velarMapSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const size = __velarCheckedMapSize(value, \"Map.size\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); return size; }\nfunction __velarSetSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); const size = __velarCheckedSetSize(value, \"Set.size\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); return size; }\nfunction __velarRecordSize(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey); return __velarRecordFields(value, \"Record size\").length; }\nfunction __velarCollectionSize(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListSize(raw);\n if (__velarIsRecord(raw)) return __velarRecordSize(raw);\n if (__velarIsMap(raw)) return __velarMapSize(raw);\n if (__velarIsSet(raw)) return __velarSetSize(raw);\n throw new __velarCollectionNativeTypeError(\"VelarScript size requires a List, Set, Map, or Record\");\n}\n\nfunction __velarCreateList(parts) {\n const output = [];\n __velarValidateDenseList(parts, \"List construction parts\");\n for (let partIndex = 0; partIndex < parts.length; partIndex += 1) {\n const part = __velarValidateDenseList(__velarCollectionListGetOwnPropertyDescriptor(parts, partIndex).value, \"List construction part\");\n const spread = part[0];\n const read = part[1];\n if (!spread) {\n if (output.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n output[output.length] = __velarCollectionValue(read());\n continue;\n }\n const values = __velarValidateOwnedList(read(), \"List spread\");\n const spreadOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let index = 0; index < values.length; index += 1) output[output.length] = __velarCollectionValue(__velarListElement(values, index, \"List spread\", spreadOwned));\n }\n return __velarAdoptList(output);\n}\nasync function __velarCreateListAsync(parts) {\n const output = [];\n __velarValidateDenseList(parts, \"List construction parts\");\n for (let partIndex = 0; partIndex < parts.length; partIndex += 1) {\n const part = __velarValidateDenseList(__velarCollectionListGetOwnPropertyDescriptor(parts, partIndex).value, \"List construction part\");\n const spread = part[0];\n const asynchronous = part[1];\n const read = part[2];\n if (!spread) {\n if (output.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n output[output.length] = __velarCollectionValue(asynchronous ? await read() : read());\n continue;\n }\n const values = __velarValidateOwnedList(asynchronous ? await read() : read(), \"List spread\");\n const spreadOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let index = 0; index < values.length; index += 1) output[output.length] = __velarCollectionValue(__velarListElement(values, index, \"List spread\", spreadOwned));\n }\n return __velarAdoptList(output);\n}\n\n// Members and keys are stored raw. Every membership and key lookup unwraps\n// its argument (docs/web-api.md: \"Map keys and Set members are unwrapped\n// before lookup\"), so a construction that stored a reactive proxy would split\n// member identity and make every later lookup miss.\nfunction __velarCreateSet(value) {\n const output = new __velarCollectionNativeSet();\n if (value === undefined) return output;\n value = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(value)) { const values = __velarValidateOwnedList(value, \"Set construction\"); const owned = __velarListIsOwned(values); for (let index = 0; index < values.length; index += 1) __velarCollectionSetMapSetAdd(output, __velarCollectionValue(__velarReactiveRaw(__velarListElement(values, index, \"Set construction\", owned)))); return output; }\n if (!__velarIsSet(value)) throw new __velarCollectionNativeTypeError(\"Set construction requires a List or Set\");\n if (__velarCollectionSetMapSetSize(value) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; __velarCollectionSetMapSetAdd(output, __velarCollectionValue(__velarReactiveRaw(step.value))); }\n}\n\nfunction __velarCreateMap(value) {\n const output = new __velarCollectionNativeMap();\n if (value === undefined) return output;\n value = __velarReactiveRaw(value);\n if (__velarIsMap(value)) {\n if (__velarCollectionSetMapMapSize(value) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const iterator = __velarCollectionSetMapMapEntries(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return output; const entry = step.value; __velarCollectionSetMapMapSet(output, __velarCollectionValue(__velarReactiveRaw(entry[0])), __velarCollectionValue(__velarReactiveRaw(entry[1]))); }\n }\n if (__velarCollectionListIsArray(value)) {\n const entries = __velarValidateOwnedList(value, \"Map construction\");\n const entriesOwned = __velarListIsOwned(entries);\n for (let index = 0; index < entries.length; index += 1) {\n const entry = __velarValidateOwnedList(__velarListElement(entries, index, \"Map construction\", entriesOwned), \"Map entry construction\");\n if (entry.length !== 2) throw new __velarCollectionNativeTypeError(\"Map entry construction requires exactly [key, value]\");\n const entryOwned = __velarListIsOwned(entry);\n __velarCollectionSetMapMapSet(output, __velarCollectionValue(__velarReactiveRaw(__velarListElement(entry, 0, \"Map entry construction\", entryOwned))), __velarCollectionValue(__velarReactiveRaw(__velarListElement(entry, 1, \"Map entry construction\", entryOwned))));\n }\n return output;\n }\n if (value && typeof value === \"object\") {\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n const names = __velarCollectionRecordOwnNames(value);\n if ((prototype !== __velarCollectionObjectPrototype && prototype !== null) || __velarCollectionRecordOwnSymbols(value).length > 0 || names.length > __velarMaxCollectionItems) throw new __velarCollectionNativeTypeError(\"Map record construction requires an ordinary record\");\n for (let index = 0; index < names.length; index += 1) {\n const name = names[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) throw new __velarCollectionNativeTypeError(\"Map record construction requires own enumerable data fields\");\n __velarCollectionSetMapMapSet(output, name, __velarCollectionValue(__velarReactiveRaw(descriptor.value)));\n }\n return output;\n }\n throw new __velarCollectionNativeTypeError(\"Map construction requires a Map, a List of [key, value] Lists, or a record\");\n}\n\nfunction __velarListGet(value, key) {\n value = __velarValidateOwnedList(value, \"List.get\");\n if (!__velarCollectionListIsInteger(key)) throw new __VelarIndexError(\"List.get index must be an integer\");\n const index = key < 0 ? value.length + key : key;\n if (index >= 0 && index < value.length) return __velarReactiveCollectionRead(value, index, __velarListElement(value, index, \"List.get\", __velarListIsOwned(value)));\n __velarReactiveCollectionTrack(value, key < 0 ? __velarReactiveIterateKey : index);\n __velarReactiveCollectionTrack(value);\n return null;\n}\nfunction __velarRecordGet(value, key) {\n value = __velarReactiveRaw(value);\n if (typeof key !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.get requires a string key\");\n __velarRecordFields(value, \"Record.get\");\n __velarReactiveCollectionTrack(value, key);\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, key);\n return descriptor === undefined ? null : __velarReactiveCollectionRead(value, key, descriptor.value);\n}\nfunction __velarMapGet(value, key) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedMapSize(value, \"Map.get\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n key = __velarReactiveRaw(key);\n __velarReactiveCollectionTrack(value, key);\n const item = __velarCollectionSetMapMapGet(value, key);\n return item === undefined ? null : __velarReactiveCollectionRead(value, key, item);\n}\nfunction __velarCollectionGet(value, key) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListGet(raw, key);\n if (__velarIsRecord(raw)) return __velarRecordGet(raw, key);\n return __velarMapGet(raw, key);\n}\n\nfunction __velarCollectionSlice(value, start = 0, end = null) {\n value = __velarValidateOwnedList(value, \"List.slice\");\n __velarReactiveCollectionTrack(value);\n if (end === null) end = value.length;\n // COL-I2: every List position error is an IndexError.\n if (!__velarCollectionListIsInteger(start) || !__velarCollectionListIsInteger(end)) {\n throw new __VelarIndexError(\"List.slice positions must be integers\");\n }\n const length = value.length;\n const first = start < 0 ? __velarCollectionListMaximum(length + start, 0) : __velarCollectionListMinimum(start, length);\n const last = end < 0 ? __velarCollectionListMaximum(length + end, 0) : __velarCollectionListMinimum(end, length);\n const owned = __velarListIsOwned(value);\n const output = [];\n for (let index = first; index < __velarCollectionListMaximum(first, last); index += 1) output[output.length] = __velarReactiveCollectionRead(value, index, __velarListElement(value, index, \"List.slice\", owned));\n return __velarAdoptList(output);\n}\n\n// ER-U2: the report names the index that was asked for and the size it was\n// asked of. Charter §18 already promises the field guard reports \"naming the\n// field\"; two compiler-injected guards cannot answer the same question two\n// ways, and \"must be an in-range integer\" told a reader nothing they did not\n// already know about the line they were looking at.\nfunction __velarListSizeText(length) {\n return length === 1 ? \"1 element\" : length + \" elements\";\n}\nfunction __velarStrictListIndex(value, requested) {\n if (!__velarCollectionListIsInteger(requested)) {\n // A hostile dynamic value must not be coerced by the report about it: a\n // `Symbol.toPrimitive` hook would run inside the guard that exists to keep\n // it out. Only a value that is already a number is named.\n throw new __VelarIndexError(typeof requested === \"number\"\n ? \"List index \" + requested + \" is not an integer\"\n : \"List index must be an integer\");\n }\n const index = requested < 0 ? value.length + requested : requested;\n if (index < 0 || index >= value.length) {\n throw new __VelarIndexError(\"List index \" + requested + \" is out of range for \" + __velarListSizeText(value.length));\n }\n return index;\n}\nfunction __velarListIndexGet(value, index) {\n value = __velarReactiveRaw(value);\n // The hottest read in the language, so it resolves the tier itself rather\n // than through __velarValidateOwnedList, which would read the owned registry\n // a second time. Past this branch the List is checked: a tier-0 value that\n // full validation adopts as owned was empty, and an empty List has no index\n // to read.\n const tier = __velarListTier(value);\n if (tier === 1) {\n index = __velarStrictListIndex(value, index);\n return __velarReactiveCollectionRead(value, index, __velarOwnedListElement(value, index, \"List index\"));\n }\n value = __velarValidateListTier(value, \"List index\", tier);\n index = __velarStrictListIndex(value, index);\n return __velarReactiveCollectionRead(value, index, __velarCheckedListElement(value, index, \"List index\"));\n}\nfunction __velarRecordIndexGet(value, index) {\n value = __velarReactiveRaw(value);\n if (typeof index !== \"string\") throw new __velarCollectionNativeTypeError(\"Record index requires a plain record and a string key\");\n __velarRecordFields(value, \"Record index\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, index);\n return __velarReactiveCollectionRead(value, index, descriptor?.value);\n}\nfunction __velarIndex(value, index) {\n const raw = __velarReactiveRaw(value);\n return __velarCollectionListIsArray(raw) ? __velarListIndexGet(raw, index) : __velarRecordIndexGet(raw, index);\n}\nfunction __velarOptionalIndex(value, index) {\n return value == null ? null : __velarIndex(value, index());\n}\nfunction __velarListIndexSet(value, index, next) {\n value = __velarValidateMutableList(value, \"List index assignment\");\n index = __velarStrictListIndex(value, index);\n const previous = __velarListElement(value, index, \"List index assignment\", __velarListIsOwned(value));\n next = __velarReactiveRaw(next);\n if (__velarCollectionListObjectIs(__velarReactiveRaw(previous), next)) return next;\n value[index] = next;\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, next);\n __velarReactiveCollectionTrigger(value, index, true, false);\n __velarMarkOwnedList(value);\n return next;\n}\nfunction __velarRecordIndexSet(value, index, next) {\n value = __velarReactiveRaw(value);\n if (typeof index !== \"string\") throw new __velarCollectionNativeTypeError(\"Record index assignment requires a plain record and a string key\");\n const fields = __velarRecordFields(value, \"Record index assignment\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, index);\n if (descriptor === undefined && fields.length >= 1000000) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n const previous = descriptor?.value;\n next = __velarReactiveRaw(next);\n if (descriptor !== undefined && __velarCollectionRecordObjectIs(__velarReactiveRaw(previous), next)) return next;\n __velarCollectionRecordDefineProperty(value, index, { value: next, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, next);\n __velarReactiveCollectionTrigger(value, index, true, descriptor === undefined);\n return next;\n}\nfunction __velarSetIndex(value, index, next) {\n const raw = __velarReactiveRaw(value);\n return __velarCollectionListIsArray(raw) ? __velarListIndexSet(raw, index, next) : __velarRecordIndexSet(raw, index, next);\n}\n\nfunction __velarListAppend(value, item) {\n value = __velarValidateMutableList(value, \"List.append\");\n if (value.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n item = __velarReactiveRaw(item);\n const index = value.length;\n __velarCollectionListDefineProperty(value, index, { value: item, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n __velarMarkOwnedList(value);\n return null;\n}\n\nfunction __velarListExtend(value, items) {\n value = __velarValidateMutableList(value, \"List.extend\");\n items = __velarValidateOwnedList(items, \"List.extend\");\n if (value.length + items.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n const start = value.length;\n const count = items.length;\n const itemsOwned = __velarListIsOwned(items);\n for (let index = 0; index < count; index += 1) { const item = __velarReactiveRaw(__velarListElement(items, index, \"List.extend\", itemsOwned)); __velarCollectionListDefineProperty(value, value.length, { value: item, writable: true, enumerable: true, configurable: true }); __velarReactiveCollectionLink(value, item); }\n if (count > 0) __velarReactiveCollectionTrigger(value, start, true, true, start);\n __velarMarkOwnedList(value);\n return null;\n}\n\nfunction __velarListInsert(value, index, item) {\n value = __velarValidateMutableList(value, \"List.insert\");\n // COL-I2: every List position error is an IndexError, and the accepted\n // range 0..size (inclusive) is the charter's insert contract.\n if (!__velarCollectionListIsInteger(index) || index < 0 || index > value.length) throw new __VelarIndexError(\"List.insert index must be an integer from 0 through size\");\n if (value.length >= __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n item = __velarReactiveRaw(item);\n // COL-P1: the tier is read before the new slot lands, because appending it\n // moves the length past the recorded one, and every shift below would then\n // take the descriptor path on a List this runtime wrote in full.\n const owned = __velarListIsOwned(value);\n __velarCollectionListDefineProperty(value, value.length, { value: item, writable: true, enumerable: true, configurable: true });\n for (let cursor = value.length - 1; cursor > index; cursor -= 1) value[cursor] = __velarListElement(value, cursor - 1, \"List.insert\", owned);\n value[index] = item;\n __velarMarkOwnedList(value);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n return null;\n}\n\nfunction __velarListPop(value, requested = -1) {\n value = __velarValidateMutableList(value, \"List.pop\");\n if (!__velarCollectionListIsInteger(requested)) throw new __VelarIndexError(\"List.pop index must be an integer\");\n const index = requested < 0 ? value.length + requested : requested;\n if (value.length === 0) throw new __VelarIndexError(\"List.pop requires a non-empty List\");\n if (index < 0 || index >= value.length) throw new __VelarIndexError(\"List.pop index must be an in-range integer\");\n const owned = __velarListIsOwned(value);\n const item = __velarListElement(value, index, \"List.pop\", owned);\n for (let cursor = index; cursor < value.length - 1; cursor += 1) value[cursor] = __velarListElement(value, cursor + 1, \"List.pop\", owned);\n value.length -= 1;\n __velarMarkOwnedList(value);\n __velarReactiveCollectionUnlink(value, item);\n __velarReactiveCollectionTrigger(value, index, true, true, index);\n return item;\n}\nfunction __velarListRemove(value, item) { value = __velarValidateOwnedList(value, \"List.remove\"); item = __velarReactiveRaw(item); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.remove\", owned)), item)) { __velarListPop(value, index); return true; } return false; }\nfunction __velarListCopy(value) { __velarReactiveCollectionTrack(value); return __velarCopyList(value, \"List.copy\"); }\nfunction __velarListCount(value, item) { value = __velarValidateOwnedList(value, \"List.count\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); let count = 0; for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.count\", owned)), item)) count += 1; return count; }\nfunction __velarListFind(value, predicate) { const items = __velarCopyList(value, \"List.find\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); const accepted = predicate(item, index); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.find predicate must return bool\"); if (accepted) return item; } return null; }\nfunction __velarListIndex(value, item) { value = __velarValidateOwnedList(value, \"List.index\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.index\", owned)), item)) return index; return null; }\nfunction __velarListSome(value, predicate) { const items = __velarCopyList(value, \"List.some\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const accepted = predicate(__velarReactiveCollectionRead(value, index, items[index]), index); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.some predicate must return bool\"); if (accepted) return true; } return false; }\nfunction __velarListEvery(value, predicate) { const items = __velarCopyList(value, \"List.every\"); __velarReactiveCollectionTrack(value); for (let index = 0; index < items.length; index += 1) { const accepted = predicate(__velarReactiveCollectionRead(value, index, items[index]), index); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.every predicate must return bool\"); if (!accepted) return false; } return true; }\nfunction __velarListMap(value, transform) { const items = __velarCopyList(value, \"List.map\"); __velarReactiveCollectionTrack(value); const output = new __velarCollectionNativeArray(items.length); for (let index = 0; index < items.length; index += 1) { const item = transform(__velarReactiveCollectionRead(value, index, items[index]), index); output[index] = item === undefined ? null : __velarReactiveRaw(item); } return __velarAdoptList(output); }\nfunction __velarListFilter(value, predicate) { const items = __velarCopyList(value, \"List.filter\"); __velarReactiveCollectionTrack(value); const output = []; for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); const accepted = predicate(item, index); if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.filter predicate must return bool\"); if (accepted) output[output.length] = __velarReactiveRaw(item); } return __velarAdoptList(output); }\n// D114 S3c: the combine receives an element, so it is an element callback like\n// the rest -- after the accumulator it takes the value and that value's\n// zero-based position in the snapshot being folded.\nfunction __velarListReduce(value, combine, initial) { const items = __velarCopyList(value, \"List.reduce\"); __velarReactiveCollectionTrack(value); let result = initial; for (let index = 0; index < items.length; index += 1) { const next = combine(result, __velarReactiveCollectionRead(value, index, items[index]), index); result = next === undefined ? null : next; } return result; }\n// D114 S3: the 16 MiB output bound came with the retired velar/collections\n// 'join'. It is the language's one text ceiling, and a mechanical rewrite off\n// the retired spelling must not quietly drop a checked boundary, so the member\n// carries it: the whole result is measured before the host join allocates.\nconst __velarMaxCollectionTextCodeUnits = 16 * 1024 * 1024;\nfunction __velarListJoin(value, separator = \"\") {\n value = __velarValidateOwnedList(value, \"List.join\");\n __velarReactiveCollectionTrack(value);\n if (typeof separator !== \"string\") throw new __velarCollectionNativeTypeError(\"List.join separator must be string\");\n const owned = __velarListIsOwned(value);\n let units = 0;\n for (let index = 0; index < value.length; index += 1) {\n const item = __velarListElement(value, index, \"List.join\", owned);\n if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"List.join requires string values\");\n if (item.length > __velarMaxCollectionTextCodeUnits - units) throw new __velarCollectionListNativeRangeError(\"List.join output cannot exceed 16 MiB\");\n units += item.length;\n }\n const separators = value.length > 1 ? value.length - 1 : 0;\n if (separators > 0 && separator.length * separators > __velarMaxCollectionTextCodeUnits - units) {\n throw new __velarCollectionListNativeRangeError(\"List.join output cannot exceed 16 MiB\");\n }\n return __velarCollectionListHostJoin(value, separator);\n}\nfunction __velarOrderedListValue(value, name, kind = null) { const current = typeof value; if (current === \"number\" && __velarCollectionListIsNaN(value)) throw new __velarCollectionNativeTypeError(name + \" found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\"); if ((current !== \"string\" && current !== \"number\") || (kind !== null && current !== kind)) throw new __velarCollectionNativeTypeError(name + \" requires uniform numbers or strings\"); return current; }\n// D114 S3: 'descending' reverses the comparison rather than the finished List,\n// so equal keys keep their input order in both directions -- the host sort is\n// stable and a negated comparison still answers 0 for a tie.\nfunction __velarListDirected(order, descending) { return descending ? (order < 0 ? 1 : order > 0 ? -1 : 0) : order; }\nfunction __velarListSorted(value, compare = null, by = null, descending = false) {\n if (compare !== null && by !== null) throw new __velarCollectionNativeTypeError(\"List.sorted accepts either a comparator or by, not both\");\n if (typeof descending !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.sorted descending must be bool\");\n if (compare !== null && descending) throw new __velarCollectionNativeTypeError(\"List.sorted comparator already states the order, so descending cannot be combined with it\");\n if (compare !== null && typeof compare !== \"function\") throw new __velarCollectionNativeTypeError(\"List.sorted comparator must be a function\");\n if (by !== null && typeof by !== \"function\") throw new __velarCollectionNativeTypeError(\"List.sorted by must be a function\");\n __velarReactiveCollectionTrack(value);\n const output = __velarCopyList(value, \"List.sorted\");\n if (by !== null) {\n let kind = null;\n const decorated = new __velarCollectionNativeArray(output.length);\n // D114 S3b item A: 'by' is an element callback, so it receives the value and\n // its zero-based position in the snapshot being read -- the position before\n // the sort, which is the only one that exists while the keys are computed.\n for (let index = 0; index < output.length; index += 1) { const item = output[index]; const key = by(__velarReactiveCollectionRead(value, index, item), index); kind = __velarOrderedListValue(key, \"List.sorted by\", kind); decorated[index] = { item, key }; }\n __velarCollectionListHostSort(decorated, (left, right) => __velarListDirected(__velarOrderedCompare(kind, left.key, right.key), descending));\n const selected = new __velarCollectionNativeArray(decorated.length);\n for (let index = 0; index < decorated.length; index += 1) selected[index] = decorated[index].item;\n return __velarAdoptList(selected);\n }\n let kind = null;\n if (compare === null) { for (let index = 0; index < output.length; index += 1) kind = __velarOrderedListValue(output[index], \"List.sorted()\", kind); }\n const compareValues = compare ?? ((left, right) => { kind = __velarOrderedListValue(left, \"List.sorted()\", kind); __velarOrderedListValue(right, \"List.sorted()\", kind); return __velarOrderedCompare(kind, left, right); });\n __velarCollectionListHostSort(output, (left, right) => { const order = compareValues(left, right); if (typeof order !== \"number\" || !__velarCollectionListIsFinite(order)) throw new __velarCollectionNativeTypeError(\"List.sorted comparator must return a finite number\"); return __velarListDirected(order, descending); });\n return output;\n}\nfunction __velarListSum(value) { const items = __velarCopyList(value, \"List.sum\"); __velarReactiveCollectionTrack(value); let total = 0; for (let index = 0; index < items.length; index += 1) { const item = __velarReactiveCollectionRead(value, index, items[index]); if (typeof item !== \"number\") throw new __velarCollectionNativeTypeError(\"List.sum requires numbers\"); if (__velarCollectionListIsNaN(item)) throw new __velarCollectionNativeTypeError(\"List.sum found NaN, which poisons the total; drop it with filter(x => not x.isNaN()) or fix the upstream computation\"); total += item; } return total; }\n// D114 S3: 'by' selects an ordered key per snapshot value, exactly as\n// sorted(by=) does, and the winning *element* is answered -- never its key.\nfunction __velarListExtremum(value, maximum, by = null) {\n const operation = maximum ? \"List.max\" : \"List.min\";\n if (by !== null && typeof by !== \"function\") throw new __velarCollectionNativeTypeError(operation + \" by must be a function\");\n const name = by === null ? operation : operation + \" by\";\n const items = __velarCopyList(value, operation);\n __velarReactiveCollectionTrack(value);\n if (items.length === 0) return null;\n let result = __velarReactiveCollectionRead(value, 0, items[0]);\n let selected = by === null ? result : by(result, 0);\n let kind = __velarOrderedListValue(selected, name);\n for (let index = 1; index < items.length; index += 1) {\n const item = __velarReactiveCollectionRead(value, index, items[index]);\n const candidate = by === null ? item : by(item, index);\n __velarOrderedListValue(candidate, name, kind);\n const order = __velarOrderedCompare(kind, candidate, selected);\n if (maximum ? order > 0 : order < 0) { result = item; selected = candidate; }\n }\n return result;\n}\nfunction __velarListMin(value, by = null) { return __velarListExtremum(value, false, by); }\nfunction __velarListMax(value, by = null) { return __velarListExtremum(value, true, by); }\nfunction __velarListReversed(value) { __velarReactiveCollectionTrack(value); const output = __velarCopyList(value, \"List.reversed\"); __velarCollectionListHostReverse(output); return output; }\n// COL-U1: map-then-flatten-one-level. The transform must return a List for\n// every element; its items append in order, under the one 1,000,000 budget.\nfunction __velarListFlatMap(value, transform) {\n const items = __velarCopyList(value, \"List.flatMap\");\n __velarReactiveCollectionTrack(value);\n const output = [];\n for (let index = 0; index < items.length; index += 1) {\n const part = transform(__velarReactiveCollectionRead(value, index, items[index]), index);\n const values = __velarValidateOwnedList(part, \"List.flatMap transform result\");\n const partOwned = __velarListIsOwned(values);\n if (output.length + values.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let cursor = 0; cursor < values.length; cursor += 1) output[output.length] = __velarCollectionValue(__velarReactiveRaw(__velarListElement(values, cursor, \"List.flatMap\", partOwned)));\n }\n return __velarAdoptList(output);\n}\n\n// D114 S3: the pipeline members the retired velar/collections module used to\n// spell as functions. Each reads the same checked shallow snapshot map/filter\n// read, answers a fresh container, and stays under the one 1,000,000 budget.\nfunction __velarListUnique(value) {\n const items = __velarCopyList(value, \"List.unique\");\n __velarReactiveCollectionTrack(value);\n const seen = new __velarCollectionNativeSet();\n const output = [];\n for (let index = 0; index < items.length; index += 1) {\n const item = __velarReactiveRaw(__velarReactiveCollectionRead(value, index, items[index]));\n if (__velarCollectionSetMapSetHas(seen, item)) continue;\n __velarCollectionSetMapSetAdd(seen, item);\n output[output.length] = item;\n }\n return __velarAdoptList(output);\n}\nfunction __velarListCompact(value) {\n const items = __velarCopyList(value, \"List.compact\");\n __velarReactiveCollectionTrack(value);\n const output = [];\n for (let index = 0; index < items.length; index += 1) {\n const item = __velarReactiveCollectionRead(value, index, items[index]);\n if (item === null || item === undefined) continue;\n output[output.length] = __velarReactiveRaw(item);\n }\n return __velarAdoptList(output);\n}\n// Exactly one level, like flatMap's second half: an element that is not a List\n// is refused rather than passed through.\nfunction __velarListFlatten(value) {\n const items = __velarCopyList(value, \"List.flatten\");\n __velarReactiveCollectionTrack(value);\n const output = [];\n for (let index = 0; index < items.length; index += 1) {\n const part = __velarValidateOwnedList(__velarReactiveCollectionRead(value, index, items[index]), \"List.flatten element\");\n const partOwned = __velarListIsOwned(part);\n if (output.length + part.length > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n for (let cursor = 0; cursor < part.length; cursor += 1) output[output.length] = __velarCollectionValue(__velarReactiveRaw(__velarListElement(part, cursor, \"List.flatten\", partOwned)));\n }\n return __velarAdoptList(output);\n}\nfunction __velarListChunk(value, size) {\n if (!__velarCollectionListIsSafeInteger(size) || size <= 0) throw new __velarCollectionListNativeRangeError(\"List.chunk size requires a positive integer\");\n const items = __velarCopyList(value, \"List.chunk\");\n __velarReactiveCollectionTrack(value);\n const output = [];\n for (let index = 0; index < items.length; index += size) {\n const length = __velarCollectionListMinimum(size, items.length - index);\n const part = new __velarCollectionNativeArray(length);\n for (let offset = 0; offset < length; offset += 1) part[offset] = __velarReactiveRaw(__velarReactiveCollectionRead(value, index + offset, items[index + offset]));\n output[output.length] = __velarAdoptList(part);\n }\n return __velarAdoptList(output);\n}\nfunction __velarListPartition(value, predicate) {\n const items = __velarCopyList(value, \"List.partition\");\n __velarReactiveCollectionTrack(value);\n const matches = [];\n const rest = [];\n for (let index = 0; index < items.length; index += 1) {\n const item = __velarReactiveCollectionRead(value, index, items[index]);\n const accepted = predicate(item, index);\n if (typeof accepted !== \"boolean\") throw new __velarCollectionNativeTypeError(\"List.partition predicate must return bool\");\n const output = accepted ? matches : rest;\n output[output.length] = __velarReactiveRaw(item);\n }\n return __velarCollectionRecordFreeze({ matches: __velarAdoptList(matches), rest: __velarAdoptList(rest) });\n}\nfunction __velarListKey(key, item, index, name) {\n if (typeof key !== \"function\") throw new __velarCollectionNativeTypeError(name + \" requires a function\");\n return __velarCollectionValue(__velarReactiveRaw(key(item, index)));\n}\nfunction __velarListGroupBy(value, key) {\n const items = __velarCopyList(value, \"List.groupBy\");\n __velarReactiveCollectionTrack(value);\n const output = new __velarCollectionNativeMap();\n const groups = [];\n for (let index = 0; index < items.length; index += 1) {\n const item = __velarReactiveCollectionRead(value, index, items[index]);\n const name = __velarListKey(key, item, index, \"List.groupBy\");\n const group = __velarCollectionSetMapMapGet(output, name);\n if (group === undefined) {\n const created = [__velarReactiveRaw(item)];\n groups[groups.length] = created;\n __velarCollectionSetMapMapSet(output, name, created);\n } else group[group.length] = __velarReactiveRaw(item);\n }\n for (let index = 0; index < groups.length; index += 1) __velarAdoptList(groups[index]);\n return output;\n}\nfunction __velarListKeyBy(value, key) {\n const items = __velarCopyList(value, \"List.keyBy\");\n __velarReactiveCollectionTrack(value);\n const output = new __velarCollectionNativeMap();\n for (let index = 0; index < items.length; index += 1) {\n const item = __velarReactiveCollectionRead(value, index, items[index]);\n __velarCollectionSetMapMapSet(output, __velarListKey(key, item, index, \"List.keyBy\"), __velarReactiveRaw(item));\n }\n return output;\n}\nfunction __velarListCountBy(value, key) {\n const items = __velarCopyList(value, \"List.countBy\");\n __velarReactiveCollectionTrack(value);\n const output = new __velarCollectionNativeMap();\n for (let index = 0; index < items.length; index += 1) {\n const name = __velarListKey(key, __velarReactiveCollectionRead(value, index, items[index]), index, \"List.countBy\");\n const current = __velarCollectionSetMapMapGet(output, name);\n __velarCollectionSetMapMapSet(output, name, (current === undefined ? 0 : current) + 1);\n }\n return output;\n}\nfunction __velarListZip(value, other) {\n const items = __velarCopyList(value, \"List.zip\");\n const partners = __velarCopyList(other, \"List.zip\");\n __velarReactiveCollectionTrack(value);\n __velarReactiveCollectionTrack(other);\n const length = __velarCollectionListMinimum(items.length, partners.length);\n const output = new __velarCollectionNativeArray(length);\n for (let index = 0; index < length; index += 1) {\n output[index] = __velarCollectionRecordFreeze({\n first: __velarReactiveRaw(__velarReactiveCollectionRead(value, index, items[index])),\n second: __velarReactiveRaw(__velarReactiveCollectionRead(other, index, partners[index])),\n });\n }\n return __velarAdoptList(output);\n}\n// The whole List, 'count' times -- the meaning string.repeat has.\nfunction __velarListRepeat(value, count) {\n if (!__velarCollectionListIsSafeInteger(count) || count < 0) throw new __velarCollectionListNativeRangeError(\"List.repeat count requires a non-negative integer\");\n const items = __velarCopyList(value, \"List.repeat\");\n __velarReactiveCollectionTrack(value);\n if (items.length * count > __velarMaxCollectionItems) throw new __velarCollectionListNativeRangeError(\"A List cannot exceed 1000000 items\");\n const output = new __velarCollectionNativeArray(items.length * count);\n let cursor = 0;\n for (let round = 0; round < count; round += 1) {\n for (let index = 0; index < items.length; index += 1) output[cursor++] = __velarReactiveRaw(__velarReactiveCollectionRead(value, index, items[index]));\n }\n return __velarAdoptList(output);\n}\n\nfunction __velarSetAdd(value, item) {\n value = __velarReactiveRaw(value);\n item = __velarReactiveRaw(item);\n const size = __velarCollectionSetMapSetSize(value);\n if (size >= __velarMaxCollectionItems && !__velarCollectionSetMapSetHas(value, item)) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n if (__velarCollectionSetMapSetHas(value, item)) return null;\n __velarCollectionSetMapSetAdd(value, item);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, item, true, true);\n return null;\n}\n\nfunction __velarSetUpdate(value, items) {\n value = __velarReactiveRaw(value);\n items = __velarReactiveRaw(items);\n if (!__velarCollectionListIsArray(items) && !__velarIsSet(items)) throw new __velarCollectionNativeTypeError(\"Set.update requires a List or Set\");\n let entries;\n if (__velarCollectionListIsArray(items)) entries = __velarCopyList(items, \"Set.update\");\n else { const sourceSize = __velarCollectionSetMapSetSize(items); if (sourceSize > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); entries = new __velarCollectionNativeArray(sourceSize); const iterator = __velarCollectionSetMapSetValues(items); let index = 0; while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; entries[index++] = step.value; } }\n const additions = new __velarCollectionNativeSet();\n for (let index = 0; index < entries.length; index += 1) { const item = __velarReactiveRaw(entries[index]); if (!__velarCollectionSetMapSetHas(value, item)) __velarCollectionSetMapSetAdd(additions, item); }\n const size = __velarCollectionSetMapSetSize(value);\n const added = __velarCollectionSetMapSetSize(additions);\n if (size + added > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const iterator = __velarCollectionSetMapSetValues(additions); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; const item = step.value; __velarCollectionSetMapSetAdd(value, item); __velarReactiveCollectionLink(value, item); }\n // Every member added publishes its own key exactly as Set.add does: a\n // membership observer (x in tags) tracks the member key, not the iterate\n // key, so triggering only iteration would leave it stale.\n const published = __velarCollectionSetMapSetValues(additions); while (true) { const step = __velarCollectionSetMapSetNext(published); if (step.done) break; __velarReactiveCollectionTrigger(value, step.value, true, true); }\n if (added > 0) __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true);\n return null;\n}\nfunction __velarSetCopy(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value); const size = __velarCollectionSetMapSetSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); const output = new __velarCollectionNativeSet(); const iterator = __velarCollectionSetMapSetValues(value); while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; __velarCollectionSetMapSetAdd(output, step.value); } }\n// COL-U2: Set algebra. Each method reads both operands, copies (never\n// mutates, exactly like sorted), and answers by SameValueZero membership.\nfunction __velarSetAlgebraOperands(value, other, name) {\n value = __velarReactiveRaw(value);\n other = __velarReactiveRaw(other);\n if (!__velarIsSet(other)) throw new __velarCollectionNativeTypeError(name + \" requires a Set\");\n if (__velarCollectionSetMapSetSize(value) > __velarMaxCollectionItems || __velarCollectionSetMapSetSize(other) > __velarMaxCollectionItems) {\n throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n }\n __velarReactiveCollectionTrack(value);\n __velarReactiveCollectionTrack(other);\n return [value, other];\n}\nfunction __velarSetUnion(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.union\");\n const output = new __velarCollectionNativeSet();\n const first = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(first); if (step.done) break; __velarCollectionSetMapSetAdd(output, step.value); }\n const second = __velarCollectionSetMapSetValues(operands[1]);\n while (true) {\n const step = __velarCollectionSetMapSetNext(second);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (!__velarCollectionSetMapSetHas(output, member) && __velarCollectionSetMapSetSize(output) >= __velarMaxCollectionItems) {\n throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n }\n __velarCollectionSetMapSetAdd(output, member);\n }\n return output;\n}\nfunction __velarSetIntersection(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.intersection\");\n const output = new __velarCollectionNativeSet();\n const iterator = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; if (__velarCollectionSetMapSetHas(operands[1], step.value)) __velarCollectionSetMapSetAdd(output, step.value); }\n}\nfunction __velarSetDifference(value, other) {\n const operands = __velarSetAlgebraOperands(value, other, \"Set.difference\");\n const output = new __velarCollectionNativeSet();\n const iterator = __velarCollectionSetMapSetValues(operands[0]);\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return output; if (!__velarCollectionSetMapSetHas(operands[1], step.value)) __velarCollectionSetMapSetAdd(output, step.value); }\n}\n\nfunction __velarMapSet(value, key, item) {\n value = __velarReactiveRaw(value);\n key = __velarReactiveRaw(key);\n item = __velarReactiveRaw(item);\n const size = __velarCollectionSetMapMapSize(value);\n if (size >= __velarMaxCollectionItems && !__velarCollectionSetMapMapHas(value, key)) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const present = __velarCollectionSetMapMapHas(value, key);\n const previous = present ? __velarCollectionSetMapMapGet(value, key) : undefined;\n if (present && __velarCollectionListObjectIs(__velarReactiveRaw(previous), item)) return null;\n __velarCollectionSetMapMapSet(value, key, item);\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, key);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, key, true, !present);\n return null;\n}\n\n// Map.get followed by a null check is the right spelling for a read, but it is\n// a poor grouping primitive: narrowing a collection value deliberately walks\n// that value again to catch stale flow facts. getOrSet performs the one atomic\n// map operation the algorithm means and returns V directly, so repeated bucket\n// appends remain linear without weakening narrowing checks anywhere else.\nfunction __velarMapGetOrSet(value, key, fallback) {\n value = __velarReactiveRaw(value);\n key = __velarReactiveRaw(key);\n fallback = __velarReactiveRaw(fallback);\n const size = __velarCheckedMapSize(value, \"Map.getOrSet\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarReactiveCollectionTrack(value, key);\n if (__velarCollectionSetMapMapHas(value, key)) {\n return __velarReactiveCollectionRead(value, key, __velarCollectionSetMapMapGet(value, key));\n }\n if (size >= __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarCollectionSetMapMapSet(value, key, fallback);\n __velarReactiveCollectionLink(value, key);\n __velarReactiveCollectionLink(value, fallback);\n __velarReactiveCollectionTrigger(value, key, true, true);\n return __velarReactiveCollectionRead(value, key, fallback);\n}\n\n// Expensive cache entries need the same atomic missing-key operation without\n// computing a value that the Map already owns. The zero-argument factory runs\n// exactly once, only after the capacity check and absence check succeed.\nfunction __velarMapGetOrSetWith(value, key, factory) {\n value = __velarReactiveRaw(value);\n key = __velarReactiveRaw(key);\n const size = __velarCheckedMapSize(value, \"Map.getOrSetWith\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n __velarReactiveCollectionTrack(value, key);\n if (__velarCollectionSetMapMapHas(value, key)) {\n return __velarReactiveCollectionRead(value, key, __velarCollectionSetMapMapGet(value, key));\n }\n if (size >= __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const created = __velarReactiveRaw(__velarCollectionHostCall(factory, undefined, []));\n __velarCollectionSetMapMapSet(value, key, created);\n __velarReactiveCollectionLink(value, key);\n __velarReactiveCollectionLink(value, created);\n __velarReactiveCollectionTrigger(value, key, true, true);\n return __velarReactiveCollectionRead(value, key, created);\n}\n\nfunction __velarMapUpdate(value, items) {\n value = __velarReactiveRaw(value);\n items = __velarReactiveRaw(items);\n if (!__velarIsMap(items)) throw new __velarCollectionNativeTypeError(\"Map.update requires a Map\");\n const sourceSize = __velarCollectionSetMapMapSize(items);\n if (sourceSize > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const size = __velarCollectionSetMapMapSize(value);\n let additions = 0;\n const keys = __velarCollectionSetMapMapKeys(items); while (true) { const step = __velarCollectionSetMapMapNext(keys); if (step.done) break; if (!__velarCollectionSetMapMapHas(value, step.value)) additions += 1; }\n if (size + additions > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const entries = __velarCollectionSetMapMapEntries(items); while (true) { const step = __velarCollectionSetMapMapNext(entries); if (step.done) break; const entry = step.value; __velarMapSet(value, entry[0], entry[1]); }\n return null;\n}\nfunction __velarMapCopy(value) { value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value); const size = __velarCollectionSetMapMapSize(value); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); const output = new __velarCollectionNativeMap(); const iterator = __velarCollectionSetMapMapEntries(value); while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return output; const entry = step.value; __velarCollectionSetMapMapSet(output, entry[0], entry[1]); } }\n\nfunction __velarRecordSet(value, key, item) {\n value = __velarReactiveRaw(value);\n if (typeof key !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.set requires a string key\");\n const fields = __velarRecordFields(value, \"Record.set\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, key);\n if (descriptor !== undefined && !descriptor.writable) throw new __velarCollectionNativeTypeError(\"Record.set requires a writable data field\");\n if (descriptor === undefined && fields.length >= __velarMaxCollectionItems) throw new __velarCollectionRecordNativeRangeError(\"A Record cannot exceed 1000000 fields\");\n const previous = descriptor?.value;\n item = __velarReactiveRaw(item);\n if (descriptor !== undefined && __velarCollectionRecordObjectIs(__velarReactiveRaw(previous), item)) return null;\n __velarCollectionRecordDefineProperty(value, key, { value: item, writable: true, enumerable: true, configurable: true });\n __velarReactiveCollectionUnlink(value, previous);\n __velarReactiveCollectionLink(value, item);\n __velarReactiveCollectionTrigger(value, key, true, descriptor === undefined);\n return null;\n}\nfunction __velarRecordCopy(value) {\n value = __velarReactiveRaw(value);\n const output = {};\n __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.copy\");\n for (let index = 0; index < fields.length; index += 1) {\n const field = fields[index];\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, field);\n __velarCollectionRecordDefineProperty(output, field, { value: __velarReactiveCollectionRead(value, field, descriptor.value), writable: true, enumerable: true, configurable: true });\n }\n return output;\n}\n\nfunction __velarListHas(value, item) { value = __velarValidateOwnedList(value, \"List.has\"); item = __velarReactiveRaw(item); __velarReactiveCollectionTrack(value); const owned = __velarListIsOwned(value); for (let index = 0; index < value.length; index += 1) if (__velarSameValueZero(__velarReactiveRaw(__velarListElement(value, index, \"List.has\", owned)), item)) return true; return false; }\nfunction __velarRecordHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.has requires a string key\"); __velarRecordFields(value, \"Record.has\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionRecordGetOwnPropertyDescriptor(value, item) !== undefined; }\nfunction __velarMapHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); const size = __velarCheckedMapSize(value, \"Map.has\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionSetMapMapHas(value, item); }\nfunction __velarSetHas(value, item) { value = __velarReactiveRaw(value); item = __velarReactiveRaw(item); const size = __velarCheckedSetSize(value, \"Set.has\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\"); __velarReactiveCollectionTrack(value, item); return __velarCollectionSetMapSetHas(value, item); }\nfunction __velarCollectionHas(value, item) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListHas(raw, item);\n if (__velarIsRecord(raw)) return __velarRecordHas(raw, item);\n if (__velarIsMap(raw)) return __velarMapHas(raw, item);\n if (__velarIsSet(raw)) return __velarSetHas(raw, item);\n throw new __velarCollectionNativeTypeError(\"VelarScript membership requires a List, Set, Map, or Record\");\n}\n// Membership keeps source evaluation order (item before container) while the\n// method-shaped helpers keep receiver-first order for values.has(item).\nfunction __velarListContains(item, value) { return __velarListHas(value, item); }\nfunction __velarMapContains(item, value) { return __velarMapHas(value, item); }\nfunction __velarSetContains(item, value) { return __velarSetHas(value, item); }\nfunction __velarRecordContains(item, value) { return __velarRecordHas(value, item); }\nfunction __velarContains(item, value) {\n if (typeof value === \"string\") { if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"String membership requires a string\"); return value.includes(item); }\n value = __velarReactiveRaw(value);\n if (__velarIsRecord(value)) {\n if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record membership requires a string key\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, item);\n if (descriptor !== undefined && (!descriptor.enumerable || !(\"value\" in descriptor))) throw new __velarCollectionNativeTypeError(\"Record fields must be enumerable data values\");\n __velarReactiveCollectionTrack(value, item);\n return descriptor !== undefined;\n }\n return __velarCollectionHas(value, item);\n}\n\n// D47 rule 81: equals(a, b) — deep structural comparison. Lists compare\n// ordered element-wise, Sets as the same member set, Maps as the same\n// key-value pairs, records as the same field set; leaves compare by\n// SameValueZero so NaN agrees with '=='. Cyclic structures throw (the same\n// stance stringify takes), and so does data nested past the validator depth\n// budget, so a pathological input never becomes a silent stack overflow.\nfunction __velarEquals(left, right) {\n return __velarEqualsVisit(left, right, [], 0);\n}\nfunction __velarEqualsVisit(left, right, active, depth) {\n left = __velarCollectionValue(__velarReactiveRaw(left));\n right = __velarCollectionValue(__velarReactiveRaw(right));\n if (left === right || (left !== left && right !== right)) return true;\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\") return false;\n if (depth >= 1000) throw new __velarCollectionNativeTypeError(\"equals cannot compare data nested more than 1000 collections deep\");\n for (let index = 0; index < active.length; index += 1) {\n if (active[index] === left || active[index] === right) throw new __velarCollectionNativeTypeError(\"equals cannot compare cyclic data\");\n }\n active[active.length] = left;\n active[active.length] = right;\n try {\n if (__velarCollectionListIsArray(left)) {\n if (!__velarCollectionListIsArray(right)) return false;\n const leftList = __velarValidateOwnedList(left, \"equals\");\n const rightList = __velarValidateOwnedList(right, \"equals\");\n __velarReactiveCollectionTrack(leftList);\n __velarReactiveCollectionTrack(rightList);\n if (leftList.length !== rightList.length) return false;\n const leftOwned = __velarListIsOwned(leftList);\n const rightOwned = __velarListIsOwned(rightList);\n for (let index = 0; index < leftList.length; index += 1) {\n if (!__velarEqualsVisit(__velarListElement(leftList, index, \"equals\", leftOwned), __velarListElement(rightList, index, \"equals\", rightOwned), active, depth + 1)) return false;\n }\n return true;\n }\n if (__velarIsSet(left)) {\n if (!__velarIsSet(right)) return false;\n const size = __velarCollectionSetMapSetSize(left);\n if (size > __velarMaxCollectionItems || __velarCollectionSetMapSetSize(right) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A collection cannot exceed 1000000 items\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (size !== __velarCollectionSetMapSetSize(right)) return false;\n // The native lookup already answers SameValueZero membership; only\n // structured members without an identical partner fall back to the\n // injective structural matching below. Structural equality is an\n // equivalence relation, so greedy matching is exact.\n const pending = [];\n const leftIterator = __velarCollectionSetMapSetValues(left);\n while (true) {\n const step = __velarCollectionSetMapSetNext(leftIterator);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (__velarCollectionSetMapSetHas(right, member)) continue;\n if (member === null || typeof member !== \"object\") return false;\n pending[pending.length] = member;\n }\n if (pending.length === 0) return true;\n const candidates = [];\n const rightIterator = __velarCollectionSetMapSetValues(right);\n while (true) {\n const step = __velarCollectionSetMapSetNext(rightIterator);\n if (step.done) break;\n const member = __velarCollectionValue(__velarReactiveRaw(step.value));\n if (__velarCollectionSetMapSetHas(left, member)) continue;\n if (member === null || typeof member !== \"object\") return false;\n candidates[candidates.length] = member;\n }\n if (candidates.length !== pending.length) return false;\n const used = new __velarCollectionNativeArray(candidates.length);\n for (let leftIndex = 0; leftIndex < pending.length; leftIndex += 1) {\n let matched = false;\n for (let rightIndex = 0; rightIndex < candidates.length; rightIndex += 1) {\n if (used[rightIndex]) continue;\n if (__velarEqualsVisit(pending[leftIndex], candidates[rightIndex], active, depth + 1)) {\n used[rightIndex] = true;\n matched = true;\n break;\n }\n }\n if (!matched) return false;\n }\n return true;\n }\n if (__velarIsMap(left)) {\n if (!__velarIsMap(right)) return false;\n const size = __velarCollectionSetMapMapSize(left);\n if (size > __velarMaxCollectionItems || __velarCollectionSetMapMapSize(right) > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A collection cannot exceed 1000000 items\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (size !== __velarCollectionSetMapMapSize(right)) return false;\n const pendingKeys = [];\n const pendingValues = [];\n const leftIterator = __velarCollectionSetMapMapEntries(left);\n while (true) {\n const step = __velarCollectionSetMapMapNext(leftIterator);\n if (step.done) break;\n const key = __velarCollectionValue(__velarReactiveRaw(step.value[0]));\n const value = step.value[1];\n if (__velarCollectionSetMapMapHas(right, key)) {\n if (!__velarEqualsVisit(value, __velarCollectionSetMapMapGet(right, key), active, depth + 1)) return false;\n continue;\n }\n if (key === null || typeof key !== \"object\") return false;\n pendingKeys[pendingKeys.length] = key;\n pendingValues[pendingValues.length] = value;\n }\n if (pendingKeys.length === 0) return true;\n const candidateKeys = [];\n const candidateValues = [];\n const rightIterator = __velarCollectionSetMapMapEntries(right);\n while (true) {\n const step = __velarCollectionSetMapMapNext(rightIterator);\n if (step.done) break;\n const key = __velarCollectionValue(__velarReactiveRaw(step.value[0]));\n if (__velarCollectionSetMapMapHas(left, key)) continue;\n if (key === null || typeof key !== \"object\") return false;\n candidateKeys[candidateKeys.length] = key;\n candidateValues[candidateValues.length] = step.value[1];\n }\n if (candidateKeys.length !== pendingKeys.length) return false;\n const used = new __velarCollectionNativeArray(candidateKeys.length);\n for (let leftIndex = 0; leftIndex < pendingKeys.length; leftIndex += 1) {\n let matched = false;\n for (let rightIndex = 0; rightIndex < candidateKeys.length; rightIndex += 1) {\n if (used[rightIndex]) continue;\n if (__velarEqualsVisit(pendingKeys[leftIndex], candidateKeys[rightIndex], active, depth + 1)\n && __velarEqualsVisit(pendingValues[leftIndex], candidateValues[rightIndex], active, depth + 1)) {\n used[rightIndex] = true;\n matched = true;\n break;\n }\n }\n if (!matched) return false;\n }\n return true;\n }\n if (__velarIsRecord(left)) {\n if (!__velarIsRecord(right)) return false;\n const leftFields = __velarRecordFields(left, \"equals\");\n const rightFields = __velarRecordFields(right, \"equals\");\n __velarReactiveCollectionTrack(left);\n __velarReactiveCollectionTrack(right);\n if (leftFields.length !== rightFields.length) return false;\n for (let index = 0; index < leftFields.length; index += 1) {\n const field = leftFields[index];\n const rightDescriptor = __velarCollectionRecordGetOwnPropertyDescriptor(right, field);\n if (!rightDescriptor || !rightDescriptor.enumerable || !(\"value\" in rightDescriptor)) return false;\n if (!__velarEqualsVisit(__velarCollectionRecordGetOwnPropertyDescriptor(left, field).value, rightDescriptor.value, active, depth + 1)) return false;\n }\n return true;\n }\n // Anything else — class instances, host objects — has no structural\n // content contract; the analyzer rejects those domains statically, so a\n // value reaching here came through 'any' and fails closed.\n return false;\n } finally {\n active.length -= 2;\n }\n}\n\nfunction __velarRecordRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n if (typeof item !== \"string\") throw new __velarCollectionNativeTypeError(\"Record.remove requires a string key\");\n __velarRecordFields(value, \"Record.remove\");\n const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, item);\n if (descriptor === undefined) return false;\n if (!descriptor.configurable) throw new __velarCollectionNativeTypeError(\"Record.remove requires a configurable data field\");\n if (!__velarCollectionRecordDeleteProperty(value, item)) throw new __velarCollectionNativeTypeError(\"Record.remove could not delete the field\");\n __velarReactiveCollectionUnlink(value, descriptor.value);\n __velarReactiveCollectionTrigger(value, item, true, true);\n return true;\n}\nfunction __velarMapRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n const size = __velarCheckedMapSize(value, \"Map.remove\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const previous = __velarCollectionSetMapMapGet(value, item);\n const removed = __velarCollectionSetMapMapDelete(value, item);\n if (removed) { __velarReactiveCollectionUnlink(value, item); __velarReactiveCollectionUnlink(value, previous); __velarReactiveCollectionTrigger(value, item, true, true); }\n return removed;\n}\nfunction __velarSetRemove(value, item) {\n value = __velarReactiveRaw(value); item = __velarReactiveRaw(item);\n const size = __velarCheckedSetSize(value, \"Set.remove\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const removed = __velarCollectionSetMapSetDelete(value, item);\n if (removed) { __velarReactiveCollectionUnlink(value, item); __velarReactiveCollectionTrigger(value, item, true, true); }\n return removed;\n}\nfunction __velarCollectionRemove(value, item) {\n const raw = __velarReactiveRaw(value);\n if (__velarIsRecord(raw)) return __velarRecordRemove(raw, item);\n if (__velarIsMap(raw)) return __velarMapRemove(raw, item);\n return __velarSetRemove(raw, item);\n}\n\nfunction __velarListClear(value) {\n value = __velarReactiveRaw(value);\n const previous = __velarCopyList(value, \"List.clear\");\n if (previous.length === 0) return null;\n __velarListRequireMutableLength(value, \"List.clear\");\n value.length = 0;\n __velarMarkOwnedList(value);\n for (let index = 0; index < previous.length; index += 1) __velarReactiveCollectionUnlink(value, previous[index]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, 0);\n return null;\n}\nfunction __velarRecordClear(value) {\n value = __velarReactiveRaw(value);\n const fields = __velarRecordFields(value, \"Record.clear\");\n if (fields.length === 0) return null;\n const previous = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const descriptor = __velarCollectionRecordGetOwnPropertyDescriptor(value, fields[index]); if (!descriptor.configurable) throw new __velarCollectionNativeTypeError(\"Record.clear requires configurable data fields\"); previous[index] = descriptor.value; }\n for (let index = 0; index < fields.length; index += 1) if (!__velarCollectionRecordDeleteProperty(value, fields[index])) throw new __velarCollectionNativeTypeError(\"Record.clear could not delete a field\");\n for (let index = 0; index < previous.length; index += 1) __velarReactiveCollectionUnlink(value, previous[index]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarMapClear(value) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedMapSize(value, \"Map.clear\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n if (size === 0) return null;\n const previous = new __velarCollectionNativeArray(size * 2);\n const iterator = __velarCollectionSetMapMapEntries(value);\n let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) break; previous[index++] = step.value[0]; previous[index++] = step.value[1]; }\n __velarCollectionSetMapMapClear(value);\n for (let previousIndex = 0; previousIndex < previous.length; previousIndex += 1) __velarReactiveCollectionUnlink(value, previous[previousIndex]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarSetClear(value) {\n value = __velarReactiveRaw(value);\n const size = __velarCheckedSetSize(value, \"Set.clear\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n if (size === 0) return null;\n const previous = new __velarCollectionNativeArray(size);\n const iterator = __velarCollectionSetMapSetValues(value);\n let index = 0;\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) break; previous[index++] = step.value; }\n __velarCollectionSetMapSetClear(value);\n for (let previousIndex = 0; previousIndex < previous.length; previousIndex += 1) __velarReactiveCollectionUnlink(value, previous[previousIndex]);\n __velarReactiveCollectionTrigger(value, __velarReactiveIterateKey, true, true, null, true);\n return null;\n}\nfunction __velarCollectionClear(value) {\n const raw = __velarReactiveRaw(value);\n if (__velarCollectionListIsArray(raw)) return __velarListClear(raw);\n if (__velarIsRecord(raw)) return __velarRecordClear(raw);\n if (__velarIsMap(raw)) return __velarMapClear(raw);\n return __velarSetClear(raw);\n}\n\nfunction __velarRecordKeys(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const fields = __velarRecordFields(value, \"Record.keys\");\n const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) output[index] = __velarReactiveCollectionRead(value, __velarReactiveStructureKey, fields[index]);\n return __velarAdoptList(output);\n}\nfunction __velarMapKeys(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const size = __velarCheckedMapSize(value, \"Map.keys\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapKeys(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value); }\n}\n// 这里不复用 Map.keys(),因为它的 VelarScript 契约是构造完整 List 快照。\n// 游标直接持有宿主 Map 的原生 key iterator,所以创建和每次 next 都是 O(1)。\n// next 的外层 null 只表示耗尽;真实 key 放在冻结的 {value} 中,因此 null key\n// 仍然可以无歧义地返回。宿主 keys/next/freeze 操作都已在运行时初始化时捕获,\n// 应用代码之后改写 JavaScript 原型也不能劫持这条路径。\nfunction __velarMapIterator(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value, __velarReactiveStructureKey);\n const size = __velarCheckedMapSize(value, \"Map.iterator\");\n if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const iterator = __velarCollectionSetMapMapKeys(value);\n let exhausted = false;\n const next = () => {\n if (exhausted) return null;\n const step = __velarCollectionSetMapMapNext(iterator);\n if (step.done) { exhausted = true; return null; }\n return __velarCollectionSetMapFreeze({value: __velarReactiveCollectionRead(value, __velarReactiveStructureKey, step.value)});\n };\n return __velarCollectionSetMapFreeze({next});\n}\nfunction __velarCollectionKeys(value) { value = __velarReactiveRaw(value); return __velarIsRecord(value) ? __velarRecordKeys(value) : __velarMapKeys(value); }\n\nfunction __velarRecordValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.values\"); const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const field = fields[index]; output[index] = __velarReactiveCollectionRead(value, field, __velarCollectionRecordGetOwnPropertyDescriptor(value, field).value); }\n return __velarAdoptList(output);\n}\nfunction __velarMapValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedMapSize(value, \"Map.values\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapValues(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); }\n}\nfunction __velarSetValues(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedSetSize(value, \"Set.values\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Set cannot exceed 1000000 items\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapSetValues(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapSetNext(iterator); if (step.done) return __velarAdoptList(output); output[index++] = __velarReactiveCollectionRead(value, __velarReactiveIterateKey, step.value); }\n}\nfunction __velarCollectionValues(value) {\n value = __velarReactiveRaw(value);\n if (__velarIsRecord(value)) return __velarRecordValues(value);\n if (__velarIsMap(value)) return __velarMapValues(value);\n return __velarSetValues(value);\n}\n\nfunction __velarRecordEntries(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const fields = __velarRecordFields(value, \"Record.entries\"); const output = new __velarCollectionNativeArray(fields.length);\n for (let index = 0; index < fields.length; index += 1) { const field = fields[index]; output[index] = __velarCollectionRecordFreeze({ key: __velarReactiveCollectionRead(value, __velarReactiveIterateKey, field), value: __velarReactiveCollectionRead(value, field, __velarCollectionRecordGetOwnPropertyDescriptor(value, field).value) }); }\n return __velarAdoptList(output);\n}\nfunction __velarMapEntries(value) {\n value = __velarReactiveRaw(value); __velarReactiveCollectionTrack(value);\n const size = __velarCheckedMapSize(value, \"Map.entries\"); if (size > __velarMaxCollectionItems) throw new __velarCollectionSetMapNativeRangeError(\"A Map cannot exceed 1000000 entries\");\n const output = new __velarCollectionNativeArray(size); const iterator = __velarCollectionSetMapMapEntries(value); let index = 0;\n while (true) { const step = __velarCollectionSetMapMapNext(iterator); if (step.done) return __velarAdoptList(output); const entry = step.value; output[index++] = __velarCollectionSetMapFreeze({ key: __velarReactiveCollectionRead(value, __velarReactiveIterateKey, entry[0]), value: __velarReactiveCollectionRead(value, entry[0], entry[1]) }); }\n}\nfunction __velarCollectionEntries(value) { value = __velarReactiveRaw(value); return __velarIsRecord(value) ? __velarRecordEntries(value) : __velarMapEntries(value); }\nfunction __velarOptionalCollection(value, operation) { return value == null ? null : operation(value); }\nexport {\n __velarMaxCollectionItems,\n __velarCollectionValue,\n __velarSameValueZero,\n __velarEquals,\n __velarValidateDenseList,\n __velarAdoptList,\n __velarReactiveListIterator,\n __velarReactiveSetIterator,\n __velarReactiveMapKeyIterator,\n __velarReactiveRecordIterator,\n __velarReactiveMapPairIterator,\n __velarReactiveRecordPairIterator,\n __velarCollectionIterator,\n __velarCollectionPairIterator,\n __velarCopyList,\n __velarOrderedListValue,\n __velarCreateList,\n __velarCreateListAsync,\n __velarCreateSet,\n __velarCreateMap,\n __velarCollectionSize,\n __velarListSize,\n __velarMapSize,\n __velarSetSize,\n __velarRecordSize,\n __velarCollectionGet,\n __velarListGet,\n __velarMapGet,\n __velarRecordGet,\n __velarCollectionSlice,\n __VelarIndexError,\n __velarIndex,\n __velarListIndexGet,\n __velarRecordIndexGet,\n __velarOptionalIndex,\n __velarSetIndex,\n __velarListIndexSet,\n __velarRecordIndexSet,\n __velarListAppend,\n __velarListExtend,\n __velarListInsert,\n __velarListRemove,\n __velarListPop,\n __velarListCopy,\n __velarListCount,\n __velarListIndex,\n __velarListFind,\n __velarListMap,\n __velarListFilter,\n __velarListReduce,\n __velarListEvery,\n __velarListSome,\n __velarListSum,\n __velarListExtremum,\n __velarListMin,\n __velarListMax,\n __velarListJoin,\n __velarListSorted,\n __velarListReversed,\n __velarListFlatMap,\n __velarListUnique,\n __velarListCompact,\n __velarListFlatten,\n __velarListChunk,\n __velarListPartition,\n __velarListGroupBy,\n __velarListKeyBy,\n __velarListCountBy,\n __velarListZip,\n __velarListRepeat,\n __velarSetAdd,\n __velarSetUpdate,\n __velarSetCopy,\n __velarSetUnion,\n __velarSetIntersection,\n __velarSetDifference,\n __velarMapSet,\n __velarMapGetOrSet,\n __velarMapGetOrSetWith,\n __velarMapUpdate,\n __velarMapCopy,\n __velarRecordFields,\n __velarRecordSet,\n __velarRecordCopy,\n __velarCollectionHas,\n __velarListHas,\n __velarMapHas,\n __velarSetHas,\n __velarRecordHas,\n __velarListContains,\n __velarMapContains,\n __velarSetContains,\n __velarRecordContains,\n __velarContains,\n __velarCollectionRemove,\n __velarMapRemove,\n __velarSetRemove,\n __velarRecordRemove,\n __velarCollectionClear,\n __velarListClear,\n __velarMapClear,\n __velarSetClear,\n __velarRecordClear,\n __velarCollectionKeys,\n __velarMapIterator,\n __velarMapKeys,\n __velarRecordKeys,\n __velarCollectionValues,\n __velarMapValues,\n __velarSetValues,\n __velarRecordValues,\n __velarCollectionEntries,\n __velarMapEntries,\n __velarRecordEntries,\n __velarOptionalCollection,\n};\n","import { __VelarIndexError } from \"velar/compiler-runtime-collection-lowering-v1\";\nconst __velarMaxTextCodeUnits = 16 * 1024 * 1024;\nconst __velarMaxTextItems = 1000000;\nconst __velarTextNativeArray = globalThis.Array;\nconst __velarTextNativeString = globalThis.String;\nconst __velarTextNativeNumber = globalThis.Number;\nconst __velarTextNativeMath = globalThis.Math;\nconst __velarTextNativeObject = globalThis.Object;\nconst __velarTextNativeMap = globalThis.Map;\nconst __velarTextNativeTypeError = globalThis.TypeError;\nconst __velarTextNativeRangeError = globalThis.RangeError;\nconst __velarTextGetOwnPropertyDescriptor = __velarTextNativeObject.getOwnPropertyDescriptor;\nconst __velarTextRuntimeGetPrototypeOf = __velarTextGetOwnPropertyDescriptor(__velarTextNativeObject, \"getPrototypeOf\")?.value;\nconst __velarTextReflectApply = __velarTextGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTextStringPrototype = __velarTextGetOwnPropertyDescriptor(__velarTextNativeString, \"prototype\")?.value;\nconst __velarTextArrayIsArray = __velarTextGetOwnPropertyDescriptor(__velarTextNativeArray, \"isArray\")?.value;\nconst __velarTextNumberIsSafeInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isSafeInteger\")?.value;\nconst __velarTextNumberIsInteger = __velarTextGetOwnPropertyDescriptor(__velarTextNativeNumber, \"isInteger\")?.value;\nconst __velarTextMathFloor = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"floor\")?.value;\nconst __velarTextMathMax = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"max\")?.value;\nconst __velarTextMathMin = __velarTextGetOwnPropertyDescriptor(__velarTextNativeMath, \"min\")?.value;\nconst __velarNativeStringIndexOf = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"indexOf\")?.value;\nconst __velarNativeStringSlice = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"slice\")?.value;\nconst __velarNativeStringCharCodeAt = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"charCodeAt\")?.value;\nconst __velarNativeStringTrim = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"trim\")?.value;\nconst __velarNativeStringUpper = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toUpperCase\")?.value;\nconst __velarNativeStringLower = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"toLowerCase\")?.value;\nconst __velarNativeStringSplit = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"split\")?.value;\nconst __velarNativeStringReplaceAll = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"replaceAll\")?.value;\nconst __velarNativeStringRepeat = __velarTextGetOwnPropertyDescriptor(__velarTextStringPrototype, \"repeat\")?.value;\nconst __velarTextMapPrototype = typeof __velarTextNativeMap === \"function\" ? __velarTextGetOwnPropertyDescriptor(__velarTextNativeMap, \"prototype\")?.value : null;\nconst __velarTextMapGet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"get\")?.value : null;\nconst __velarTextMapSet = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"set\")?.value : null;\nconst __velarTextMapClear = __velarTextMapPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextMapPrototype, \"clear\")?.value : null;\nconst __velarTextSurrogatePattern = /[\\u{10000}-\\u{10FFFF}\\uD800-\\uDFFF]/u;\nconst __velarTextRegExpPrototype = typeof __velarTextRuntimeGetPrototypeOf === \"function\" ? __velarTextRuntimeGetPrototypeOf(__velarTextSurrogatePattern) : null;\nconst __velarTextSurrogateExec = __velarTextRegExpPrototype ? __velarTextGetOwnPropertyDescriptor(__velarTextRegExpPrototype, \"exec\")?.value : null;\nfunction __velarTextCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarTextReflectApply !== \"function\") throw new __velarTextNativeTypeError(\"The JavaScript text runtime is unavailable\");\n return __velarTextReflectApply(operation, receiver, arguments_);\n}\n\nfunction __velarTextValue(value) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(\"String methods require a string receiver\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"Strings cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextArgument(value, name) {\n if (typeof value !== \"string\") throw new __velarTextNativeTypeError(name + \" must be a string\");\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextOutput(value, name) {\n if (value.length > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n return value;\n}\nfunction __velarTextCount(value, name) {\n if (!__velarTextCall(__velarTextNumberIsSafeInteger, __velarTextNativeNumber, [value]) || value < 0 || value > __velarMaxTextCodeUnits) {\n throw new __velarTextNativeRangeError(name + \" must be an integer from 0 through \" + __velarMaxTextCodeUnits);\n }\n return value;\n}\nfunction __velarTextList(values, name) {\n if (values.length > __velarMaxTextItems) throw new __velarTextNativeRangeError(name + \" cannot produce more than \" + __velarMaxTextItems + \" items\");\n return values;\n}\nfunction __velarTextNextCodePointOffset(value, offset) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n if (first < 0xD800 || first > 0xDBFF || offset + 1 >= value.length) return offset + 1;\n const second = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset + 1]);\n return second >= 0xDC00 && second <= 0xDFFF ? offset + 2 : offset + 1;\n}\n// D90 R7, performance half. Measuring a string used to be a whole-string job\n// every single time: the surrogate probe ran per call, and one astral character\n// anywhere forced every offset conversion to walk code points from zero, which\n// made a loop of char/slice calls quadratic: 20,000 char/slice calls over a\n// 200 KiB string with one leading astral character took 17.1 s, and 34 ms\n// once measurement was memoised. A measurement is a pure function of an\n// immutable value, so it is memoised: a dense string answers offset conversions in\n// O(1) when no surrogate pair splits it, and otherwise the checkpoint list\n// records the code-unit offset of every stride-th code point so a conversion\n// starts from the nearest checkpoint instead of from the start of the string.\n// The cache may only change the cost of an answer, never the answer.\nconst __velarTextCheckpointStride = 64;\nconst __velarTextMeasureMinimumUnits = 64;\n// The cache holds its keys strongly, so its budget is memory the program has\n// stopped using but cannot reclaim. Eight MiB buys the loops that matter and\n// bounds what a document-processing program leaves behind; a single string\n// larger than the budget still measures once and stays, because evicting the\n// string a loop is walking would put the cliff back. The entry count only\n// bounds the cache's own bookkeeping, so it is set well above the number of\n// strings a loop cycles through: a tighter count made a walk over 65 short\n// strings 15x slower than the same walk over 64.\nconst __velarTextMeasureCacheEntries = 512;\nconst __velarTextMeasureCacheUnits = 8 * 1024 * 1024;\nconst __velarTextMeasureCache = typeof __velarTextNativeMap === \"function\"\n && typeof __velarTextMapGet === \"function\" && typeof __velarTextMapSet === \"function\" && typeof __velarTextMapClear === \"function\"\n ? new __velarTextNativeMap() : null;\nlet __velarTextMeasureCacheCount = 0;\nlet __velarTextMeasureCacheHeld = 0;\nfunction __velarTextMeasureText(value) {\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [value]) === null) {\n return { length: value.length, dense: true, checkpoints: null };\n }\n const checkpoints = new __velarTextNativeArray();\n let length = 0, offset = 0;\n while (offset < value.length) {\n if (length % __velarTextCheckpointStride === 0) checkpoints[length / __velarTextCheckpointStride] = offset;\n offset = __velarTextNextCodePointOffset(value, offset);\n length += 1;\n }\n // A string that carries only unpaired surrogates still has one unit per code\n // point, so it keeps the O(1) path even though the probe matched.\n return { length: length, dense: length === value.length, checkpoints: checkpoints };\n}\nfunction __velarTextMeasure(value) {\n if (__velarTextMeasureCache === null || value.length < __velarTextMeasureMinimumUnits) return __velarTextMeasureText(value);\n const cached = __velarTextCall(__velarTextMapGet, __velarTextMeasureCache, [value]);\n if (cached !== undefined) return cached;\n const measured = __velarTextMeasureText(value);\n if (__velarTextMeasureCacheCount >= __velarTextMeasureCacheEntries\n || (__velarTextMeasureCacheCount > 0 && __velarTextMeasureCacheHeld + value.length > __velarTextMeasureCacheUnits)) {\n __velarTextCall(__velarTextMapClear, __velarTextMeasureCache, []);\n __velarTextMeasureCacheCount = 0;\n __velarTextMeasureCacheHeld = 0;\n }\n __velarTextCall(__velarTextMapSet, __velarTextMeasureCache, [value, measured]);\n __velarTextMeasureCacheCount += 1;\n __velarTextMeasureCacheHeld += value.length;\n return measured;\n}\nfunction __velarTextCodePointLength(value) {\n return __velarTextMeasure(value).length;\n}\nfunction __velarTextCodePointPrefix(value, count) { return __velarTextCall(__velarNativeStringSlice, value, [0, __velarTextCodeUnitOffset(value, count)]); }\nfunction __velarTextCodeUnitOffset(value, position) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return position < value.length ? position : value.length;\n if (position <= 0) return 0;\n const checkpoints = measured.checkpoints;\n let block = __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [position / __velarTextCheckpointStride]);\n if (block >= checkpoints.length) block = checkpoints.length - 1;\n let offset = checkpoints[block], current = block * __velarTextCheckpointStride;\n while (offset < value.length && current < position) { offset = __velarTextNextCodePointOffset(value, offset); current += 1; }\n return offset;\n}\nfunction __velarTextCodePointIndex(value, unitOffset) {\n const measured = __velarTextMeasure(value);\n if (measured.dense) return unitOffset <= value.length ? unitOffset : null;\n if (unitOffset < 0 || unitOffset > value.length) return null;\n const checkpoints = measured.checkpoints;\n let low = 0, high = checkpoints.length - 1;\n while (low < high) {\n const middle = low + __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(high - low + 1) / 2]);\n if (checkpoints[middle] <= unitOffset) low = middle; else high = middle - 1;\n }\n let offset = checkpoints[low], position = low * __velarTextCheckpointStride;\n while (offset < unitOffset && offset < value.length) { offset = __velarTextNextCodePointOffset(value, offset); position += 1; }\n return offset === unitOffset ? position : null;\n}\nfunction __velarTextCodePointDistance(value, start, end) {\n if (__velarTextMeasure(value).dense) return end >= start ? end - start : null;\n let offset = start, distance = 0;\n while (offset < end) { offset = __velarTextNextCodePointOffset(value, offset); distance += 1; }\n return offset === end ? distance : null;\n}\n// D90 R7: a code-unit offset sits between two code points unless it splits a\n// surrogate pair, and only an adjacent lead/trail pair can be split. The test\n// is O(1), so every search below can reject a mid-pair hit without measuring\n// the string.\nfunction __velarTextIsBoundary(value, offset) {\n if (offset <= 0 || offset >= value.length) return true;\n const lead = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset - 1]);\n if (lead < 0xD800 || lead > 0xDBFF) return true;\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, value, [offset]);\n return trail < 0xDC00 || trail > 0xDFFF;\n}\n// D90 R7, performance half. A match can only start inside a pair when the\n// needle starts with a trail surrogate, and can only end inside one when the\n// needle ends with a lead surrogate: the unit the gate reads at each end of a\n// match is the needle's own edge unit. Both are properties of the needle\n// alone, so one O(1) look says whether the native scan already answers what\n// the bounded scan answers, and an ordinary needle keeps native speed on any\n// haystack. The needle must not be empty; each caller handles that case.\nfunction __velarTextNeedsBoundaryCheck(search) {\n const first = __velarTextCall(__velarNativeStringCharCodeAt, search, [0]);\n if (first >= 0xDC00 && first <= 0xDFFF) return true;\n const last = __velarTextCall(__velarNativeStringCharCodeAt, search, [search.length - 1]);\n return last >= 0xD800 && last <= 0xDBFF;\n}\n// Every search operation goes through here so that a match is accepted only\n// when it starts and ends on a code-point boundary. A needle that begins or\n// ends with an unpaired surrogate therefore never matches inside a pair, which\n// is what keeps split/replace/replaceAll from manufacturing lone surrogates.\n// The needle must not be empty; each caller handles that case in its own voice.\nfunction __velarTextBoundedIndexOf(value, search, cursor) {\n if (!__velarTextNeedsBoundaryCheck(search)) return __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n while (cursor <= value.length) {\n const found = __velarTextCall(__velarNativeStringIndexOf, value, [search, cursor]);\n if (found < 0) return -1;\n if (__velarTextIsBoundary(value, found) && __velarTextIsBoundary(value, found + search.length)) return found;\n cursor = found + 1;\n }\n return -1;\n}\nfunction __velarTextReplacementOutputUnits(value, search, replacement, all) {\n let matches = 0;\n if (search === \"\") matches = all ? __velarTextCodePointLength(value) + 1 : 1;\n else {\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, search, cursor);\n if (index < 0) break;\n matches += 1;\n if (!all) break;\n cursor = index + search.length;\n }\n }\n if (replacement.length <= search.length || matches === 0) return value.length;\n const growth = replacement.length - search.length;\n if (matches > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [(__velarMaxTextCodeUnits - value.length) / growth])) return __velarMaxTextCodeUnits + 1;\n return value.length + matches * growth;\n}\n\n// TXT-D1: ordered string comparison uses code-point order (= UTF-8 binary\n// order). UTF-16 code-unit order already agrees when neither operand\n// contains a surrogate, so the native probe keeps the decoded walk on\n// surrogate-bearing strings only.\nfunction __velarStringCompare(left, right) {\n left = __velarTextValue(left);\n right = __velarTextValue(right);\n if (left === right) return 0;\n if (__velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [left]) === null\n && __velarTextCall(__velarTextSurrogateExec, __velarTextSurrogatePattern, [right]) === null) {\n return left < right ? -1 : 1;\n }\n let leftOffset = 0;\n let rightOffset = 0;\n while (leftOffset < left.length && rightOffset < right.length) {\n let first = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset]);\n let firstUnits = 1;\n if (first >= 0xD800 && first <= 0xDBFF && leftOffset + 1 < left.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, left, [leftOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { first = (first - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; firstUnits = 2; }\n }\n let second = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset]);\n let secondUnits = 1;\n if (second >= 0xD800 && second <= 0xDBFF && rightOffset + 1 < right.length) {\n const trail = __velarTextCall(__velarNativeStringCharCodeAt, right, [rightOffset + 1]);\n if (trail >= 0xDC00 && trail <= 0xDFFF) { second = (second - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; secondUnits = 2; }\n }\n if (first !== second) return first < second ? -1 : 1;\n leftOffset += firstUnits;\n rightOffset += secondUnits;\n }\n return leftOffset < left.length ? 1 : rightOffset < right.length ? -1 : 0;\n}\n// D41 item 61: two 'Comparable'-bounded values hold numbers or strings, and\n// which one is known only at runtime. A string pair keeps code-point order\n// (TXT-D1); everything else uses the plain relational order, exactly as a\n// monomorphic comparison of that category would.\n// D90 R6: one NaN policy. A NaN may be held and tested with .isNaN(), but an\n// operation that orders it raises instead of answering. Without this the\n// \"neither less nor greater\" arm returned 0, which made NaN compare both <=\n// and >= as true at a generic site while the same source on a plain number\n// answered false, and produced genuinely mis-sorted output.\nfunction __velarOrderCompare(left, right) {\n if (typeof left === \"string\" && typeof right === \"string\") return __velarStringCompare(left, right);\n if (left !== left || right !== right) throw new __velarTextNativeTypeError(\"ordered comparison found NaN, which has no ordering; drop it with filter(x => not x.isNaN()) or fix the upstream computation\");\n return left < right ? -1 : left > right ? 1 : 0;\n}\nfunction __velarStringSize(value) { return __velarTextCodePointLength(__velarTextValue(value)); }\nfunction __velarStringTrim(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []); }\nfunction __velarStringIsBlank(value) { return __velarTextCall(__velarNativeStringTrim, __velarTextValue(value), []) === \"\"; }\nfunction __velarStringUpper(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringUpper, __velarTextValue(value), []), \"String.upper\"); }\nfunction __velarStringLower(value) { return __velarTextOutput(__velarTextCall(__velarNativeStringLower, __velarTextValue(value), []), \"String.lower\"); }\n// CO-U4c: a String position is a position, so it raises what a List position\n// raises. `slice` clamps an out-of-range position rather than failing, so the\n// non-integer one is its whole position contract; the sentence is the one\n// `List.slice` already says, one receiver name apart.\nfunction __velarStringSlice(value, start = 0, end = null) {\n value = __velarTextValue(value);\n const total = __velarTextCodePointLength(value);\n if (end === null) end = total;\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start]) || !__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [end])) throw new __VelarIndexError(\"String.slice positions must be integers\");\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const last = end < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + end, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [end, total]);\n return __velarTextCall(__velarNativeStringSlice, value, [__velarTextCodeUnitOffset(value, first), __velarTextCodeUnitOffset(value, last)]);\n}\n// CO-U4: `char` reads forwards. Its index domain is 0 <= index < size, so a\n// negative index is an out-of-range position rather than a read from the end:\n// `\"abc\".char(-1)` used to answer \"c\", which is a whole different member than\n// the one the author wrote and the one every message about `char` describes.\n// Past the end stays `null`, because that is the absence the `string?` result\n// exists to report; before the beginning is a position that cannot exist.\n// The report names the index and the size, as List's own position guard does.\n// CO-U4b: and it raises the class List's guard raises. A plain RangeError\n// carries no name, so `catch error: if error is IndexError` did not match it\n// and `try` turned it into the `null` that reads like \"not found\" — the costume\n// charter §11 keeps the three integrity failures out of. The class is\n// `__VelarIndexError`, imported from the collection-lowering module when this\n// runtime is a project module and emitted beside it when it is inlined, so one\n// out-of-range position has one class however the program was built.\n// CO-U4c: the non-integer index is the other half of that same §11 sentence —\n// \"an out-of-range or non-integer position\" — and it was still raising a host\n// `TypeError`, which is not one of the three names `try` refuses to swallow. So\n// a fractional index that reached this guard at run time read as an absence,\n// the very costume CO-U4b took off the negative one. The sentence is the one\n// `List.get` says for the identical failure, one member name apart.\nfunction __velarStringChar(value, index) {\n value = __velarTextValue(value);\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [index])) throw new __VelarIndexError(\"String.char index must be an integer\");\n const total = __velarTextCodePointLength(value);\n if (index < 0) throw new __VelarIndexError(\"String.char index \" + index + \" is out of range for \" + total + (total === 1 ? \" character\" : \" characters\") + \"; the index domain is 0 through size - 1\");\n if (index >= total) return null;\n const start = __velarTextCodeUnitOffset(value, index);\n return __velarTextCall(__velarNativeStringSlice, value, [start, __velarTextNextCodePointOffset(value, start)]);\n}\nfunction __velarStringHas(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.has text\");\n return text === \"\" || __velarTextBoundedIndexOf(value, text, 0) >= 0;\n}\n// CO-U4c: `start` is a position as well, clamped when out of range and refused\n// when it is not an integer, so it raises the class the other two raise.\nfunction __velarStringIndex(value, text, start = 0) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.index text\");\n if (!__velarTextCall(__velarTextNumberIsInteger, __velarTextNativeNumber, [start])) throw new __VelarIndexError(\"String.index start must be an integer\");\n const total = __velarTextCodePointLength(value);\n const first = start < 0 ? __velarTextCall(__velarTextMathMax, __velarTextNativeMath, [total + start, 0]) : __velarTextCall(__velarTextMathMin, __velarTextNativeMath, [start, total]);\n const cursor = __velarTextCodeUnitOffset(value, first);\n if (text === \"\") return first;\n const found = __velarTextBoundedIndexOf(value, text, cursor);\n if (found < 0) return null;\n return __velarTextCodePointIndex(value, found);\n}\nfunction __velarStringCount(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.count text\");\n if (text === \"\") return __velarTextCodePointLength(value) + 1;\n let count = 0;\n let cursor = 0;\n while (true) {\n const index = __velarTextBoundedIndexOf(value, text, cursor);\n if (index < 0) return count;\n count += 1;\n cursor = index + text.length;\n }\n}\nfunction __velarStringStartsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.startsWith text\");\n return __velarTextCall(__velarNativeStringIndexOf, value, [text, 0]) === 0 && __velarTextIsBoundary(value, text.length);\n}\nfunction __velarStringEndsWith(value, text) {\n value = __velarTextValue(value); text = __velarTextArgument(text, \"String.endsWith text\");\n const start = value.length - text.length;\n return start >= 0 && __velarTextIsBoundary(value, start) && __velarTextCall(__velarNativeStringIndexOf, value, [text, start]) === start;\n}\nfunction __velarStringSplit(value, separator) {\n value = __velarTextValue(value); separator = __velarTextArgument(separator, \"String.split separator\");\n if (separator === \"\") {\n const count = __velarTextCodePointLength(value);\n if (count > __velarMaxTextItems) throw new __velarTextNativeRangeError(\"String.split cannot produce more than \" + __velarMaxTextItems + \" items\");\n const output = new __velarTextNativeArray(count);\n let offset = 0;\n for (let index = 0; index < count; index += 1) {\n const next = __velarTextNextCodePointOffset(value, offset);\n output[index] = __velarTextCall(__velarNativeStringSlice, value, [offset, next]);\n offset = next;\n }\n return output;\n }\n // The native split matches UTF-16 code units, so it would cut a surrogate\n // pair in half on a separator that begins or ends with an unpaired\n // surrogate. Every other separator makes the two scans agree match for\n // match, and the native one is the faster: its limit argument also stops it\n // before it can build an oversize array.\n if (!__velarTextNeedsBoundaryCheck(separator)) {\n return __velarTextList(__velarTextCall(__velarNativeStringSplit, value, [separator, __velarMaxTextItems + 1]), \"String.split\");\n }\n // Searching on code-point boundaries keeps every piece well formed; the\n // pieces themselves are still plain slices of the input.\n const parts = new __velarTextNativeArray();\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, separator, cursor);\n if (found < 0) break;\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor, found]);\n if (parts.length > __velarMaxTextItems) return __velarTextList(parts, \"String.split\");\n cursor = found + separator.length;\n }\n parts[parts.length] = __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n return __velarTextList(parts, \"String.split\");\n}\nfunction __velarStringReplace(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replace from\"); to = __velarTextArgument(to, \"String.replace to\");\n if (__velarTextReplacementOutputUnits(value, from, to, false) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replace output cannot exceed 16 MiB\");\n if (from === \"\") return to + value;\n const found = __velarTextBoundedIndexOf(value, from, 0);\n if (found < 0) return value;\n return __velarTextCall(__velarNativeStringSlice, value, [0, found]) + to + __velarTextCall(__velarNativeStringSlice, value, [found + from.length]);\n}\nfunction __velarStringReplaceAll(value, from, to) {\n value = __velarTextValue(value); from = __velarTextArgument(from, \"String.replaceAll from\"); to = __velarTextArgument(to, \"String.replaceAll to\");\n if (__velarTextReplacementOutputUnits(value, from, to, true) > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(\"String.replaceAll output cannot exceed 16 MiB\");\n if (from === \"\") {\n let output = to;\n let offset = 0;\n while (offset < value.length) { const next = __velarTextNextCodePointOffset(value, offset); output += __velarTextCall(__velarNativeStringSlice, value, [offset, next]) + to; offset = next; }\n return output;\n }\n // A separator that cannot split a pair leaves nothing for the bounded walk\n // to reject, so the native rewrite answers the same string faster. The\n // replacement is passed as a function so that a '$' in it stays literal.\n if (!__velarTextNeedsBoundaryCheck(from)) return __velarTextCall(__velarNativeStringReplaceAll, value, [from, () => to]);\n let output = \"\";\n let cursor = 0;\n while (true) {\n const found = __velarTextBoundedIndexOf(value, from, cursor);\n if (found < 0) break;\n output += __velarTextCall(__velarNativeStringSlice, value, [cursor, found]) + to;\n cursor = found + from.length;\n }\n return output + __velarTextCall(__velarNativeStringSlice, value, [cursor]);\n}\nfunction __velarStringPad(value, size, fill, start) {\n const name = start ? \"String.padStart\" : \"String.padEnd\";\n value = __velarTextValue(value); size = __velarTextCount(size, name + \" size\"); fill = __velarTextArgument(fill, name + \" fill\");\n const needed = size - __velarTextCodePointLength(value);\n if (needed <= 0 || fill.length === 0) return value;\n let outputUnits = value.length;\n let padding = \"\";\n let counted = 0, fillOffset = 0;\n while (counted < needed) {\n const next = __velarTextNextCodePointOffset(fill, fillOffset);\n const character = __velarTextCall(__velarNativeStringSlice, fill, [fillOffset, next]);\n outputUnits += character.length;\n if (outputUnits > __velarMaxTextCodeUnits) throw new __velarTextNativeRangeError(name + \" output cannot exceed 16 MiB\");\n padding += character;\n counted += 1;\n fillOffset = next === fill.length ? 0 : next;\n }\n return start ? padding + value : value + padding;\n}\nfunction __velarStringPadStart(value, size, fill = \" \") { return __velarStringPad(value, size, fill, true); }\nfunction __velarStringPadEnd(value, size, fill = \" \") { return __velarStringPad(value, size, fill, false); }\nfunction __velarStringRepeat(value, count) {\n value = __velarTextValue(value); count = __velarTextCount(count, \"String.repeat count\");\n if (value.length > 0 && count > __velarTextCall(__velarTextMathFloor, __velarTextNativeMath, [__velarMaxTextCodeUnits / value.length])) throw new __velarTextNativeRangeError(\"String.repeat output cannot exceed 16 MiB\");\n return __velarTextCall(__velarNativeStringRepeat, value, [count]);\n}\n\nconst __velarNumberNativeMath = globalThis.Math;\nconst __velarNumberNativeNumber = globalThis.Number;\nconst __velarNumberNativeObject = globalThis.Object;\nconst __velarNumberNativeTypeError = globalThis.TypeError;\nconst __velarNumberNativeRangeError = globalThis.RangeError;\nconst __velarNumberGetOwnPropertyDescriptor = __velarNumberNativeObject.getOwnPropertyDescriptor;\nconst __velarNumberReflectApply = __velarNumberGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarNumberPrototype = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"prototype\")?.value;\nconst __velarNumberMathAbs = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"abs\")?.value;\nconst __velarNumberMathRound = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"round\")?.value;\nconst __velarNumberMathFloor = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"floor\")?.value;\nconst __velarNumberMathCeil = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"ceil\")?.value;\nconst __velarNumberMathSign = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"sign\")?.value;\nconst __velarNumberMathTrunc = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeMath, \"trunc\")?.value;\nconst __velarNumberIsSafeInteger = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isSafeInteger\")?.value;\nconst __velarNumberNativeIsInteger = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isInteger\")?.value;\nconst __velarNumberNativeIsNaN = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isNaN\")?.value;\nconst __velarNumberNativeIsFinite = __velarNumberGetOwnPropertyDescriptor(__velarNumberNativeNumber, \"isFinite\")?.value;\nconst __velarNativeNumberToFixed = __velarNumberGetOwnPropertyDescriptor(__velarNumberPrototype, \"toFixed\")?.value;\nfunction __velarNumberCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarNumberReflectApply !== \"function\") throw new __velarNumberNativeTypeError(\"The JavaScript Number runtime is unavailable\");\n return __velarNumberReflectApply(operation, receiver, arguments_);\n}\nfunction __velarNumberValue(value) { if (typeof value !== \"number\") throw new __velarNumberNativeTypeError(\"Number methods require a number receiver\"); return value; }\nfunction __velarNumberAbs(value) { return __velarNumberCall(__velarNumberMathAbs, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberRound(value) { return __velarNumberCall(__velarNumberMathRound, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberFloor(value) { return __velarNumberCall(__velarNumberMathFloor, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberCeil(value) { return __velarNumberCall(__velarNumberMathCeil, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberSign(value) { return __velarNumberCall(__velarNumberMathSign, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberTrunc(value) { return __velarNumberCall(__velarNumberMathTrunc, __velarNumberNativeMath, [__velarNumberValue(value)]); }\nfunction __velarNumberToFixed(value, digits) {\n if (!__velarNumberCall(__velarNumberIsSafeInteger, __velarNumberNativeNumber, [digits]) || digits < 0 || digits > 100) throw new __velarNumberNativeRangeError(\"Number.toFixed digits must be an integer from 0 through 100\");\n return __velarNumberCall(__velarNativeNumberToFixed, __velarNumberValue(value), [digits]);\n}\nfunction __velarNumberIsInteger(value) { return __velarNumberCall(__velarNumberNativeIsInteger, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\nfunction __velarNumberIsNaN(value) { return __velarNumberCall(__velarNumberNativeIsNaN, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\nfunction __velarNumberIsFinite(value) { return __velarNumberCall(__velarNumberNativeIsFinite, __velarNumberNativeNumber, [__velarNumberValue(value)]); }\n\nexport {\n __velarStringSize as stringSize,\n __velarStringTrim as stringTrim,\n __velarStringUpper as stringUpper,\n __velarStringLower as stringLower,\n __velarStringSlice as stringSlice,\n __velarStringChar as stringChar,\n __velarStringHas as stringHas,\n __velarStringIndex as stringIndex,\n __velarStringCount as stringCount,\n __velarStringStartsWith as stringStartsWith,\n __velarStringEndsWith as stringEndsWith,\n __velarStringSplit as stringSplit,\n __velarStringReplace as stringReplace,\n __velarStringReplaceAll as stringReplaceAll,\n __velarStringPadStart as stringPadStart,\n __velarStringPadEnd as stringPadEnd,\n __velarStringRepeat as stringRepeat,\n __velarStringIsBlank as stringIsBlank,\n __velarStringCompare as stringCompare,\n __velarOrderCompare as orderCompare,\n __velarNumberAbs as numberAbs,\n __velarNumberRound as numberRound,\n __velarNumberFloor as numberFloor,\n __velarNumberCeil as numberCeil,\n __velarNumberSign as numberSign,\n __velarNumberTrunc as numberTrunc,\n __velarNumberToFixed as numberToFixed,\n __velarNumberIsInteger as numberIsInteger,\n __velarNumberIsNaN as numberIsNaN,\n __velarNumberIsFinite as numberIsFinite,\n};\n","const __velarClassNativeObject = globalThis.Object;\nconst __velarClassNativeReflect = globalThis.Reflect;\nconst __velarClassNativeTypeError = globalThis.TypeError;\nconst __velarClassGetOwnPropertyDescriptor = __velarClassNativeObject.getOwnPropertyDescriptor;\nconst __velarClassReflectApply = __velarClassGetOwnPropertyDescriptor(__velarClassNativeReflect, \"apply\")?.value;\nconst __velarClassReflectGet = __velarClassGetOwnPropertyDescriptor(__velarClassNativeReflect, \"get\")?.value;\nconst __velarClassGetPrototypeOf = __velarClassGetOwnPropertyDescriptor(__velarClassNativeObject, \"getPrototypeOf\")?.value;\nfunction __velarClassHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarClassReflectApply !== \"function\") throw new __velarClassNativeTypeError(\"The JavaScript class field runtime is unavailable\");\n return __velarClassReflectApply(operation, receiver, arguments_);\n}\nfunction __velarReadInstanceField(receiver, name) {\n const value = __velarClassHostCall(__velarClassReflectGet, __velarClassNativeReflect, [receiver, name]);\n if (value === undefined) throw new __velarClassNativeTypeError(\"Field '\" + name + \"' was read before initialization or contains undefined\");\n return value;\n}\nfunction __velarReadPrivateField(value, name) {\n if (value === undefined) throw new __velarClassNativeTypeError(\"Private field '\" + name + \"' was read before initialization or contains undefined\");\n return value;\n}\nfunction __velarReadStaticField(receiver, name, ownerDepth) {\n let owner = receiver;\n for (let depth = 0; depth < ownerDepth; depth += 1) owner = __velarClassHostCall(__velarClassGetPrototypeOf, __velarClassNativeObject, [owner]);\n const descriptor = owner == null ? null : __velarClassHostCall(__velarClassGetOwnPropertyDescriptor, __velarClassNativeObject, [owner, name]);\n if (!descriptor || !(\"value\" in descriptor) || descriptor.value === undefined) {\n throw new __velarClassNativeTypeError(\"Static field '\" + name + \"' was read before initialization\");\n }\n const value = __velarClassHostCall(__velarClassReflectGet, __velarClassNativeReflect, [receiver, name]);\n if (value === undefined) throw new __velarClassNativeTypeError(\"Static field '\" + name + \"' contains undefined\");\n return value;\n}\n\nexport {\n __velarReadInstanceField as readInstanceField,\n __velarReadPrivateField as readPrivateField,\n __velarReadStaticField as readStaticField,\n};\n","const __velarNarrowingNativeTypeError = globalThis.TypeError;\nconst __velarNarrowingDefineProperty = globalThis.Object.defineProperty;\nclass __VelarNarrowingError extends __velarNarrowingNativeTypeError {\n constructor(message) {\n super(message);\n this.name = \"NarrowingError\";\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarNarrowingDefineProperty(__VelarNarrowingError, \"name\", { value: \"NarrowingError\", writable: false, enumerable: false, configurable: true });\n// AS-U2: the report says where, in the file:line:column every other report in\n// this program uses. A byte offset is not a position an author can act on, and\n// the stack frame printed directly under it already spells the same place the\n// other way.\nfunction __velarNarrow(value, valid, expected, description, location) {\n if (!valid) throw new __VelarNarrowingError(\"Flow narrowing for '\" + description + \"' no longer holds: expected \" + expected + \" at \" + location);\n return value;\n}\n\nexport {\n __VelarNarrowingError as NarrowingError,\n __velarNarrow as narrow,\n};\n","const __velarNormalizeGlobal = globalThis;\nconst __velarNormalizeNativeObject = globalThis.Object;\nconst __velarNormalizeNativeReflect = globalThis.Reflect;\nconst __velarNormalizeNativeWeakMap = globalThis.WeakMap;\nconst __velarNormalizeNativePromise = globalThis.Promise;\nconst __velarNormalizeNativeSymbol = globalThis.Symbol;\nconst __velarNormalizeTypeError = globalThis.TypeError;\nconst __velarNormalizeGetOwnPropertyDescriptor = __velarNormalizeNativeObject.getOwnPropertyDescriptor;\nconst __velarNormalizeGetPrototypeOf = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeObject, \"getPrototypeOf\")?.value;\nconst __velarNormalizeDefineProperty = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeObject, \"defineProperty\")?.value;\nconst __velarNormalizeApply = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeReflect, \"apply\")?.value;\nconst __velarNormalizeWeakMapPrototype = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeWeakMap, \"prototype\")?.value;\nconst __velarNormalizeWeakMapHas = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"has\")?.value;\nconst __velarNormalizeWeakMapGet = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"get\")?.value;\nconst __velarNormalizeWeakMapSet = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeWeakMapPrototype, \"set\")?.value;\nconst __velarNormalizePromisePrototype = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativePromise, \"prototype\")?.value;\nconst __velarNormalizePromiseThen = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizePromisePrototype, \"then\")?.value;\nconst __velarNormalizeSymbolFor = __velarNormalizeGetOwnPropertyDescriptor(__velarNormalizeNativeSymbol, \"for\")?.value;\nfunction __velarNormalizeCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarNormalizeApply !== \"function\") throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n return __velarNormalizeApply(operation, receiver, arguments_);\n}\nconst __velarNormalizedPromiseRegistryKey = __velarNormalizeCall(__velarNormalizeSymbolFor, __velarNormalizeNativeSymbol, [\"velar.promise.normalization.v1\"]);\nconst __velarNormalizedPromiseValues = (() => {\n const descriptor = __velarNormalizeCall(__velarNormalizeGetOwnPropertyDescriptor, __velarNormalizeNativeObject, [__velarNormalizeGlobal, __velarNormalizedPromiseRegistryKey]);\n if (descriptor) {\n if (!(\"value\" in descriptor) || descriptor.enumerable || descriptor.configurable || descriptor.writable) {\n throw new __velarNormalizeTypeError(\"VelarScript Promise normalization registry ownership is invalid\");\n }\n try { __velarNormalizeCall(__velarNormalizeWeakMapHas, descriptor.value, [descriptor.value]); }\n catch { throw new __velarNormalizeTypeError(\"VelarScript Promise normalization registry is invalid\"); }\n return descriptor.value;\n }\n const registry = new __velarNormalizeNativeWeakMap();\n __velarNormalizeCall(__velarNormalizeDefineProperty, __velarNormalizeNativeObject, [__velarNormalizeGlobal, __velarNormalizedPromiseRegistryKey, {\n value: registry,\n enumerable: false,\n configurable: false,\n writable: false,\n }]);\n return registry;\n})();\nfunction __velarNormalizeOwnsPromise(candidate) {\n if ((typeof candidate !== \"object\" && typeof candidate !== \"function\") || candidate === null) return false;\n let prototype;\n try { prototype = __velarNormalizeCall(__velarNormalizeGetPrototypeOf, __velarNormalizeNativeObject, [candidate]); }\n catch { return false; }\n return prototype === __velarNormalizePromisePrototype;\n}\nfunction __velarNormalizePromiseValue(value) {\n if ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) throw new __velarNormalizeTypeError(\"Expected an actual Promise\");\n const known = __velarNormalizeCall(__velarNormalizeWeakMapGet, __velarNormalizedPromiseValues, [value]);\n if (known) return known;\n let settle;\n let fail;\n try {\n __velarNormalizeCall(__velarNormalizePromiseThen, value, [\n (resolved) => { if (typeof settle === \"function\") settle(resolved ?? null); },\n (reason) => { if (typeof fail === \"function\") fail(reason); },\n ]);\n }\n catch { throw new __velarNormalizeTypeError(\"Expected an actual Promise\"); }\n if (typeof __velarNormalizeNativePromise !== \"function\") throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n const normalized = new __velarNormalizeNativePromise((resolve, reject) => { settle = resolve; fail = reject; });\n if (typeof settle !== \"function\" || typeof fail !== \"function\" || !__velarNormalizeOwnsPromise(normalized)) throw new __velarNormalizeTypeError(\"The JavaScript Promise normalization runtime is unavailable\");\n __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [value, normalized]);\n __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [normalized, normalized]);\n return normalized;\n}\nfunction __velarAsyncResolvedValue(value) {\n if (value === undefined) return null;\n if ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) return value;\n try { return __velarNormalizePromiseValue(value); } catch {}\n let owner = value;\n for (let depth = 0; owner !== null && depth < 128; depth += 1) {\n let descriptor;\n try { descriptor = __velarNormalizeCall(__velarNormalizeGetOwnPropertyDescriptor, __velarNormalizeNativeObject, [owner, \"then\"]); }\n catch { throw new __velarNormalizeTypeError(\"An async result must not expose a callable 'then' or a 'then' getter\"); }\n if (descriptor) {\n if (!(\"value\" in descriptor) || typeof descriptor.value === \"function\") throw new __velarNormalizeTypeError(\"An async result must not expose a callable 'then' or a 'then' getter\");\n return value;\n }\n try { owner = __velarNormalizeCall(__velarNormalizeGetPrototypeOf, __velarNormalizeNativeObject, [owner]); }\n catch { throw new __velarNormalizeTypeError(\"An async result must have an inspectable prototype chain\"); }\n }\n if (owner !== null) throw new __velarNormalizeTypeError(\"An async result prototype chain is too deep\");\n return value;\n}\n\nexport {\n __velarNormalizePromiseValue as normalizePromiseValue,\n __velarAsyncResolvedValue as asyncResolvedValue,\n};\n","const __velarErrorNativeError = globalThis.Error;\nconst __velarErrorNativeString = globalThis.String;\nconst __velarErrorNativeObject = globalThis.Object;\nconst __velarErrorNativeReflect = globalThis.Reflect;\nconst __velarErrorNativeTypeError = globalThis.TypeError;\nconst __velarErrorGetOwnPropertyDescriptor = __velarErrorNativeObject.getOwnPropertyDescriptor;\nconst __velarErrorGetPrototypeOf = __velarErrorNativeObject.getPrototypeOf;\nconst __velarErrorReflectApply = __velarErrorGetOwnPropertyDescriptor(__velarErrorNativeReflect, \"apply\")?.value;\nconst __velarErrorIsErrorOperation = __velarErrorGetOwnPropertyDescriptor(__velarErrorNativeError, \"isError\")?.value;\nfunction __velarErrorApply(operation, receiver, arguments_, label) {\n if (typeof operation !== \"function\" || typeof __velarErrorReflectApply !== \"function\") {\n throw new __velarErrorNativeTypeError(\"The JavaScript \" + label + \" API is unavailable\");\n }\n return __velarErrorReflectApply(operation, receiver, arguments_);\n}\nfunction __velarIsError(value) {\n return __velarErrorApply(__velarErrorIsErrorOperation, __velarErrorNativeError, [value], \"Error.isError\");\n}\n// D50 rule 89: 'code' is the string projection of an error's declared class,\n// never a second taxonomy. The class lowering writes the declared name into\n// the instance's own 'name' property (rule 74), and this reads exactly that\n// property back — one source of truth, so the two can never diverge. A value\n// no Velar class declared (a host TypeError, a foreign Error) reports the base\n// contract it actually satisfies: \"Error\".\n//\n// D51 rule 107: 'is' is the only discrimination authority, so the own 'name'\n// counts only when the class the value was constructed from declares that same\n// name. A JavaScript caller writing e.name = \"FileNotFoundError\" on a host\n// TypeError produced an error whose 'code' said FileNotFoundError while 'is'\n// said false; the class behind the value is what answers now.\nfunction __velarErrorCode(value) {\n if (value === null || typeof value !== \"object\" && typeof value !== \"function\") return \"Error\";\n const descriptor = __velarErrorGetOwnPropertyDescriptor(value, \"name\");\n if (!descriptor || !(\"value\" in descriptor) || typeof descriptor.value !== \"string\" || descriptor.value.length === 0) return \"Error\";\n const prototype = __velarErrorGetPrototypeOf(value);\n const constructor = prototype === null ? null : __velarErrorGetOwnPropertyDescriptor(prototype, \"constructor\");\n if (!constructor || !(\"value\" in constructor) || typeof constructor.value !== \"function\") return \"Error\";\n const declared = __velarErrorGetOwnPropertyDescriptor(constructor.value, \"name\");\n return declared && \"value\" in declared && declared.value === descriptor.value ? descriptor.value : \"Error\";\n}\nfunction __velarNormalizeError(value) {\n if (__velarIsError(value)) return value;\n const kind = typeof value;\n let message;\n if (kind === \"string\") message = value;\n else if (value === null) message = \"null\";\n else if (kind === \"undefined\") message = \"undefined\";\n else if (kind === \"number\" || kind === \"boolean\" || kind === \"bigint\" || kind === \"symbol\") {\n message = __velarErrorApply(__velarErrorNativeString, globalThis, [value], \"String\");\n }\n else message = \"A non-Error value was thrown by JavaScript\";\n return new __velarErrorNativeError(message, { cause: value });\n}\n// AS-I1 + PR-U4 + CO-I6 + CO-U2: one frame policy, one implementation.\n//\n// Everything `velar run` prints goes through this: the uncaught path in the\n// launcher (packages/cli/src/uncaught-program-error.ts), the emitted host error\n// channel (a detached task's failure, a release that failed while another error\n// was in flight), and the Core runtime's own detached reporter in\n// packages/core/runtime/async.js — which used to write `failure.stack`\n// unfiltered, so `Promise.timeout` nested twice printed three internal frames\n// and ignored `--stack`, under a sentence that promised the opposite.\n//\n// A frame is the author's unless it is Node's own, or the language runtime's.\n// CO-U2: the runtime is recognized by the reserved name prefix its helpers\n// carry — a spelling no source may bind — rather than by the file it sits in,\n// because the compiler inlines those helpers into the program's own module,\n// where a path test left the required-value helper's own frame on screen,\n// pointing into a sandbox directory the run had already deleted. The shipped\n// runtime modules are matched by the package that serves them, because their\n// frames are anonymous callbacks that carry no name to match.\n//\n// The switch is a global the `velar run` launcher sets (the same `--stack` value\n// it compiles in). Absent — a built application, a test harness, any host that\n// is not that launcher — the trace is passed through untouched, because the line\n// that names `velar run --stack` would then name a command nobody ran.\nconst __velarHostErrorInternalFrame = /(?:^|\\s|\\()node:[a-z_]+(?:\\/|:)/u;\nconst __velarHostErrorRuntimeFrame = /\\bat\\s(?:async\\s)?(?:new\\s)?(?:[^\\s(]*\\.)?__[Vv]elar/u;\nfunction __velarHostErrorOwnedFrame(line) {\n return !__velarHostErrorInternalFrame.test(line)\n && !__velarHostErrorRuntimeFrame.test(line)\n && !line.includes(\"/node_modules/velar/\");\n}\nfunction __velarHostErrorTrace(error, fallback) {\n let trace = null;\n try { const stack = error.stack; if (typeof stack === \"string\" && stack !== \"\") trace = stack; } catch {}\n if (trace === null) {\n try { const message = error.message; if (typeof message === \"string\" && message !== \"\") return message; } catch {}\n return fallback;\n }\n let hiding = false;\n try { hiding = globalThis[Symbol.for(\"velar.run.stack\")] === false; } catch {}\n if (!hiding) return trace;\n const lines = trace.split(\"\\n\");\n const frames = lines.filter((line) => /^\\s+at\\s/u.test(line));\n const owned = frames.filter(__velarHostErrorOwnedFrame);\n const hidden = frames.length - owned.length;\n if (hidden === 0) return trace;\n const kept = lines.filter((line) => !/^\\s+at\\s/u.test(line)).concat(owned);\n kept.push(\" (\" + hidden + \" Node.js internal frame\" + (hidden === 1 ? \"\" : \"s\") + \" hidden; rerun with 'velar run --stack' for the full trace)\");\n return kept.join(\"\\n\");\n}\n\nconst __velarAssertionNativeError = globalThis.Error;\nconst __velarAssertionDefineProperty = globalThis.Object.defineProperty;\nclass __VelarAssertionError extends __velarAssertionNativeError {\n constructor(message) {\n super(message);\n this.name = \"AssertionError\";\n }\n}\n__velarAssertionDefineProperty(__VelarAssertionError, \"name\", { value: \"AssertionError\", writable: false, enumerable: false, configurable: true });\n\nconst __velarHostErrorNativeError = globalThis.Error;\nconst __velarHostErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarFileNotFoundError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"FileNotFoundError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarFileNotFoundError, \"name\", { value: \"FileNotFoundError\", writable: false, enumerable: false, configurable: true });\nclass __VelarPermissionError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"PermissionError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarPermissionError, \"name\", { value: \"PermissionError\", writable: false, enumerable: false, configurable: true });\nclass __VelarNotADirectoryError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"NotADirectoryError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarNotADirectoryError, \"name\", { value: \"NotADirectoryError\", writable: false, enumerable: false, configurable: true });\nclass __VelarFileExistsError extends __velarHostErrorNativeError {\n constructor(message, path = null) {\n super(message);\n this.name = \"FileExistsError\";\n this.path = path;\n }\n}\n// D51 rule 107: the class the value was constructed from is what 'code' reads,\n// so a compiler-owned class carries the source-level name it reports.\n__velarHostErrorDefineProperty(__VelarFileExistsError, \"name\", { value: \"FileExistsError\", writable: false, enumerable: false, configurable: true });\nclass __VelarAddressInUseError extends __velarHostErrorNativeError {\n constructor(message) {\n super(message);\n this.name = \"AddressInUseError\";\n }\n}\n__velarHostErrorDefineProperty(__VelarAddressInUseError, \"name\", { value: \"AddressInUseError\", writable: false, enumerable: false, configurable: true });\nclass __VelarTimeoutError extends __velarHostErrorNativeError {\n constructor(message) {\n super(message);\n this.name = \"TimeoutError\";\n }\n}\n__velarHostErrorDefineProperty(__VelarTimeoutError, \"name\", { value: \"TimeoutError\", writable: false, enumerable: false, configurable: true });\n\nexport {\n __VelarAssertionError as AssertionError,\n __velarErrorApply as errorApply,\n __velarErrorCode as errorCode,\n __velarIsError as isError,\n __velarNormalizeError as normalizeError,\n __velarHostErrorTrace as hostErrorTrace,\n __VelarFileNotFoundError as FileNotFoundError,\n __VelarPermissionError as PermissionError,\n __VelarNotADirectoryError as NotADirectoryError,\n __VelarFileExistsError as FileExistsError,\n __VelarAddressInUseError as AddressInUseError,\n __VelarTimeoutError as TimeoutError,\n};\n","const __velarCollectionNativeArray = globalThis.Array;\nconst __velarCollectionNativeMap = globalThis.Map;\nconst __velarCollectionNativeSet = globalThis.Set;\nconst __velarCollectionNativeObject = globalThis.Object;\nconst __velarCollectionNativeReflect = globalThis.Reflect;\nconst __velarCollectionNativeWeakMap = globalThis.WeakMap;\nconst __velarCollectionNativeTypeError = globalThis.TypeError;\nconst __velarCollectionGetOwnPropertyDescriptor = __velarCollectionNativeObject.getOwnPropertyDescriptor;\nconst __velarCollectionReflectApply = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"apply\")?.value;\nconst __velarCollectionArrayIsArray = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeArray, \"isArray\")?.value;\nconst __velarCollectionGetPrototypeOf = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getPrototypeOf\")?.value;\nconst __velarCollectionObjectPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"prototype\")?.value;\nconst __velarCollectionMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeMap, \"prototype\")?.value;\nconst __velarCollectionSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeSet, \"prototype\")?.value;\nconst __velarCollectionMapSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"size\")?.get;\nconst __velarCollectionSetSize = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"size\")?.get;\nfunction __velarCollectionHostCall(operation, receiver, arguments_) {\n if (typeof operation !== \"function\" || typeof __velarCollectionReflectApply !== \"function\") throw new __velarCollectionNativeTypeError(\"The JavaScript collection runtime is unavailable\");\n return __velarCollectionReflectApply(operation, receiver, arguments_);\n}\nconst __velarCollectionWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeWeakMap, \"prototype\")?.value;\nconst __velarCollectionWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"get\")?.value;\nconst __velarCollectionWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionWeakMapPrototype, \"set\")?.value;\nconst __velarCollectionBrands = new __velarCollectionNativeWeakMap();\n// The only unforgeable, cross-realm Map/Set test JavaScript offers is invoking\n// the prototype 'size' getter and observing whether it throws, and a thrown and\n// caught exception costs roughly 1.8us -- paid by every Set membership test,\n// which probes Map first. Internal slots are fixed at construction, so the\n// verdict can never change for a given object: probe once, then answer from a\n// WeakMap. 0 = neither, 1 = Map, 2 = Set.\nfunction __velarCollectionBrand(value) {\n if (value === null || (typeof value !== \"object\" && typeof value !== \"function\")) return 0;\n const known = __velarCollectionHostCall(__velarCollectionWeakMapGetOperation, __velarCollectionBrands, [value]);\n if (known !== undefined) return known;\n let brand = 0;\n try { __velarCollectionHostCall(__velarCollectionMapSize, value, []); brand = 1; }\n catch {\n try { __velarCollectionHostCall(__velarCollectionSetSize, value, []); brand = 2; }\n catch { brand = 0; }\n }\n __velarCollectionHostCall(__velarCollectionWeakMapSetOperation, __velarCollectionBrands, [value, brand]);\n return brand;\n}\nfunction __velarIsMap(value) {\n return __velarCollectionBrand(value) === 1;\n}\nfunction __velarIsSet(value) {\n return __velarCollectionBrand(value) === 2;\n}\nfunction __velarIsRecord(value) {\n if (value === null || typeof value !== \"object\" || __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value])) return false;\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n return prototype === __velarCollectionObjectPrototype || prototype === null;\n}\n\nconst __velarCollectionOwnNames = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertyNames\")?.value;\nconst __velarCollectionOwnSymbols = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"getOwnPropertySymbols\")?.value;\nconst __velarCollectionOwnKeys = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeReflect, \"ownKeys\")?.value;\nconst __velarCollectionMapEntries = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"entries\")?.value;\nconst __velarCollectionSetValues = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetPrototype, \"values\")?.value;\nconst __velarCollectionMapIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionMapEntries, new __velarCollectionNativeMap(), [])]);\nconst __velarCollectionSetIteratorPrototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [__velarCollectionHostCall(__velarCollectionSetValues, new __velarCollectionNativeSet(), [])]);\nconst __velarCollectionMapIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapIteratorPrototype, \"next\")?.value;\nconst __velarCollectionSetIteratorNext = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionSetIteratorPrototype, \"next\")?.value;\nfunction __velarCollectionMapTypeIterator(value) { return __velarCollectionHostCall(__velarCollectionMapEntries, value, []); }\nfunction __velarCollectionSetTypeIterator(value) { return __velarCollectionHostCall(__velarCollectionSetValues, value, []); }\nfunction __velarCollectionMapTypeNext(iterator) { return __velarCollectionHostCall(__velarCollectionMapIteratorNext, iterator, []); }\nfunction __velarCollectionSetTypeNext(iterator) { return __velarCollectionHostCall(__velarCollectionSetIteratorNext, iterator, []); }\n\nconst __velarTypeNativeWeakSet = globalThis.WeakSet;\nconst __velarTypeNativeObject = globalThis.Object;\nconst __velarTypeNativeTypeError = globalThis.TypeError;\nconst __velarTypeGetOwnPropertyDescriptor = __velarTypeNativeObject.getOwnPropertyDescriptor;\nconst __velarTypeDefineProperty = __velarTypeNativeObject.defineProperty;\nconst __velarTypeReflectApply = __velarTypeGetOwnPropertyDescriptor(globalThis.Reflect, \"apply\")?.value;\nconst __velarTypeSymbolFor = globalThis.Symbol.for;\nconst __velarTypeWeakSetPrototype = __velarTypeGetOwnPropertyDescriptor(__velarTypeNativeWeakSet, \"prototype\")?.value;\nconst __velarTypeWeakSetHas = __velarTypeGetOwnPropertyDescriptor(__velarTypeWeakSetPrototype, \"has\")?.value;\nconst __velarTypeWeakSetAdd = __velarTypeGetOwnPropertyDescriptor(__velarTypeWeakSetPrototype, \"add\")?.value;\nfunction __velarTypeCall(operation, receiver, arguments_) { if (typeof operation !== \"function\" || typeof __velarTypeReflectApply !== \"function\") throw new __velarTypeNativeTypeError(\"The JavaScript runtime Type registry API is unavailable\"); return __velarTypeReflectApply(operation, receiver, arguments_); }\nconst __velarRuntimeTypeRegistryKey = __velarTypeCall(__velarTypeSymbolFor, globalThis.Symbol, [\"velar.type.registry.v1\"]);\nconst __velarRuntimeTypeRegistry = (() => {\n const descriptor = __velarTypeGetOwnPropertyDescriptor(globalThis, __velarRuntimeTypeRegistryKey);\n if (descriptor) {\n if (!(\"value\" in descriptor) || descriptor.enumerable || descriptor.configurable || descriptor.writable) {\n throw new __velarTypeNativeTypeError(\"VelarScript runtime type registry descriptor is invalid\");\n }\n try { __velarTypeCall(__velarTypeWeakSetHas, descriptor.value, [descriptor.value]); }\n catch { throw new __velarTypeNativeTypeError(\"VelarScript runtime type registry is invalid\"); }\n return descriptor.value;\n }\n const registry = new __velarTypeNativeWeakSet();\n __velarTypeCall(__velarTypeDefineProperty, __velarTypeNativeObject, [globalThis, __velarRuntimeTypeRegistryKey, {\n value: registry,\n enumerable: false,\n configurable: false,\n writable: false,\n }]);\n return registry;\n})();\nfunction __velarRegisterRuntimeType(value) {\n __velarTypeCall(__velarTypeWeakSetAdd, __velarRuntimeTypeRegistry, [value]);\n return value;\n}\nfunction __velarRequireRuntimeType(value, name, optional = false) {\n if (optional && value == null) return null;\n // Registry membership proves the value was registered somewhere in this\n // realm; it does not prove it still presents the Type surface. A module built\n // by another generation registers into the same WeakSet whenever both\n // generations share the registry key, so the surface itself is asserted here:\n // 'is' and 'parse' are the two operations every caller of this helper goes on\n // to invoke.\n if (!value || typeof value !== \"object\" || !__velarTypeCall(__velarTypeWeakSetHas, __velarRuntimeTypeRegistry, [value])\n || typeof value.is !== \"function\" || typeof value.parse !== \"function\") {\n throw new __velarTypeNativeTypeError(name + \" requires a compiler-known VelarScript runtime type\");\n }\n return value;\n}\n\nconst __velarValidationNativeWeakMap = globalThis.WeakMap;\nconst __velarValidationNativeSet = globalThis.Set;\nconst __velarValidationNativePromise = globalThis.Promise;\nconst __velarValidationNativeFunction = globalThis.Function;\nconst __velarValidationNativeSymbol = globalThis.Symbol;\nconst __velarValidationWeakMapPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeWeakMap, \"prototype\")?.value;\nconst __velarValidationSetPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeSet, \"prototype\")?.value;\nconst __velarValidationFunctionPrototype = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeFunction, \"prototype\")?.value;\nconst __velarValidationHasInstanceSymbol = __velarCollectionGetOwnPropertyDescriptor(__velarValidationNativeSymbol, \"hasInstance\")?.value;\nconst __velarValidationWeakMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"get\")?.value;\nconst __velarValidationWeakMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"set\")?.value;\nconst __velarValidationWeakMapDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationWeakMapPrototype, \"delete\")?.value;\nconst __velarValidationSetHasOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"has\")?.value;\nconst __velarValidationSetAddOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"add\")?.value;\nconst __velarValidationSetDeleteOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"delete\")?.value;\nconst __velarValidationSetSizeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationSetPrototype, \"size\")?.get;\nconst __velarValidationFunctionHasInstanceOperation = __velarCollectionGetOwnPropertyDescriptor(__velarValidationFunctionPrototype, __velarValidationHasInstanceSymbol)?.value;\nconst __velarValidationFreezeOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"freeze\")?.value;\nconst __velarValidationDefinePropertyOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionNativeObject, \"defineProperty\")?.value;\nconst __velarValidationMapSetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"set\")?.value;\nconst __velarValidationMapGetOperation = __velarCollectionGetOwnPropertyDescriptor(__velarCollectionMapPrototype, \"get\")?.value;\n// D90 rule R5: the per-call graph state carries both the validator's cycle\n// guard and the copy memo, because parse runs one then the other over the same\n// object graph. 'copies' stays null until something is actually copied.\nfunction __velarValidationState() { return { active: new __velarValidationNativeWeakMap(), depth: 0, copies: null, copy: __velarValidationCopy }; }\nfunction __velarValidationSet() { return new __velarValidationNativeSet(); }\nfunction __velarValidationWeakMapGet(value, key) { return __velarCollectionHostCall(__velarValidationWeakMapGetOperation, value, [key]); }\nfunction __velarValidationWeakMapSet(value, key, item) { return __velarCollectionHostCall(__velarValidationWeakMapSetOperation, value, [key, item]); }\nfunction __velarValidationWeakMapDelete(value, key) { return __velarCollectionHostCall(__velarValidationWeakMapDeleteOperation, value, [key]); }\nfunction __velarValidationMapGet(value, key) { return __velarCollectionHostCall(__velarValidationMapGetOperation, value, [key]); }\nfunction __velarValidationMapSet(value, key, item) { return __velarCollectionHostCall(__velarValidationMapSetOperation, value, [key, item]); }\nfunction __velarValidationSetHas(value, item) { return __velarCollectionHostCall(__velarValidationSetHasOperation, value, [item]); }\nfunction __velarValidationSetAdd(value, item) { return __velarCollectionHostCall(__velarValidationSetAddOperation, value, [item]); }\nfunction __velarValidationSetDelete(value, item) { return __velarCollectionHostCall(__velarValidationSetDeleteOperation, value, [item]); }\nfunction __velarValidationSetSize(value) { return __velarCollectionHostCall(__velarValidationSetSizeOperation, value, []); }\nfunction __velarValidationIsArray(value) { return __velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]); }\nfunction __velarValidationOwnDescriptor(value, key) { return __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]); }\nfunction __velarValidationIsInstance(value, constructor) { return __velarCollectionHostCall(__velarValidationFunctionHasInstanceOperation, constructor, [value]); }\nfunction __velarValidationIsPromise(value) { return __velarValidationIsInstance(value, __velarValidationNativePromise); }\nfunction __velarValidationFreeze(value) { return __velarCollectionHostCall(__velarValidationFreezeOperation, __velarCollectionNativeObject, [value]); }\n// A record contract accepts only plain data objects: prototype null, or a\n// prototype that itself has none (some realm's Object.prototype). The check\n// is structural rather than an identity comparison so plain values from other\n// realms validate, while class instances, Error values, and host objects are\n// rejected — their prototypes always chain through another object.\nfunction __velarValidationIsPlainObject(value) {\n const prototype = __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [value]);\n if (prototype === null) return true;\n return __velarCollectionHostCall(__velarCollectionGetPrototypeOf, __velarCollectionNativeObject, [prototype]) === null;\n}\n// D90 rule R5: parse returns a copy, so \"validated\" means \"and it stays\n// valid\" rather than \"it was correct at the instant of the check\". The copy\n// follows the declared shape — the generated validators supply one callback\n// per element position — and the memo answers per source object *and* copy\n// plan, so a shared or cyclic subgraph is copied once per declared shape and\n// the copy preserves the sharing the source had. Keying on the source alone\n// would hand the second projection of one object the first projection's copy:\n// a value the caller never wrote and no declared type ever accepted. The four\n// container members are spelled with an \"Of\" suffix because this runtime\n// reaches every host collection through a captured operation: no member call\n// inside it may read as a get, set, has, add, or delete call, which is the\n// boundary gate's rule for this file.\nconst __velarValidationCopy = {\n seen(state, value, plan) {\n if (state.copies === null) return undefined;\n const plans = __velarValidationWeakMapGet(state.copies, value);\n return plans === undefined ? undefined : __velarValidationMapGet(plans, plan);\n },\n remember(state, value, copy, plan) {\n if (state.copies === null) state.copies = new __velarValidationNativeWeakMap();\n let plans = __velarValidationWeakMapGet(state.copies, value);\n if (plans === undefined) {\n plans = new __velarCollectionNativeMap();\n __velarValidationWeakMapSet(state.copies, value, plans);\n }\n __velarValidationMapSet(plans, plan, copy);\n return copy;\n },\n object(state, value, plan) {\n return __velarValidationCopy.remember(state, value, {}, plan);\n },\n // Fields are written through defineProperty so a field literally named\n // '__proto__' lands as an own data property instead of retargeting the\n // copy's prototype, and so every copied field is an ordinary mutable\n // enumerable data property whatever the source's descriptor said.\n field(target, name, value) {\n __velarCollectionHostCall(__velarValidationDefinePropertyOperation, __velarCollectionNativeObject, [target, name, { value: value, writable: true, enumerable: true, configurable: true }]);\n },\n // A null element callback means the element position has nothing to copy —\n // a primitive, an enum member, a class instance, or an opaque 'unknown'.\n // 'plan' is the container position's own stable identity: the emitter hoists\n // one function per distinct copy plan and hands it in as both the element\n // callback and the key this memo files the copy under.\n listOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, [], plan);\n const length = __velarValidationOwnDescriptor(value, \"length\")?.value ?? 0;\n for (let index = 0; index < length; index += 1) {\n const descriptor = __velarValidationOwnDescriptor(value, index);\n result[index] = item === null ? descriptor?.value : item(descriptor?.value, state);\n }\n return result;\n },\n setOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, __velarValidationSet(), plan);\n const iterator = __velarCollectionSetTypeIterator(value);\n while (true) {\n const step = __velarCollectionSetTypeNext(iterator);\n if (step.done) break;\n __velarValidationSetAdd(result, item === null ? step.value : item(step.value, state));\n }\n return result;\n },\n mapOf(value, state, key, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, new __velarCollectionNativeMap(), plan);\n const iterator = __velarCollectionMapTypeIterator(value);\n while (true) {\n const step = __velarCollectionMapTypeNext(iterator);\n if (step.done) break;\n const entry = step.value;\n __velarValidationMapSet(result, key === null ? entry[0] : key(entry[0], state), item === null ? entry[1] : item(entry[1], state));\n }\n return result;\n },\n recordOf(value, state, item, plan) {\n const found = __velarValidationCopy.seen(state, value, plan);\n if (found !== undefined) return found;\n const result = __velarValidationCopy.remember(state, value, {}, plan);\n const keys = __velarCollectionHostCall(__velarCollectionOwnKeys, __velarCollectionNativeReflect, [value]);\n for (let index = 0; index < keys.length; index += 1) {\n const name = keys[index];\n if (typeof name !== \"string\") continue;\n const descriptor = __velarValidationOwnDescriptor(value, name);\n if (!descriptor?.enumerable || !(\"value\" in descriptor)) continue;\n __velarValidationCopy.field(result, name, item === null ? descriptor.value : item(descriptor.value, state));\n }\n return result;\n },\n // A generic instantiation supplies a predicate per type argument but no copy\n // plan, and a structural or union position is validated as a shape the\n // predicate did not fully decide. Both copy the plain data they can see:\n // arrays, Maps, Sets, and plain objects recurse; anything else — a class\n // instance, a promise, a function, a binary buffer — is not plain data and\n // passes through by reference.\n plain(value, state) {\n if (value === null || typeof value !== \"object\") return value;\n const found = __velarValidationCopy.seen(state, value, __velarValidationCopy.plain);\n if (found !== undefined) return found;\n if (__velarValidationIsArray(value)) return __velarValidationCopy.listOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (__velarIsMap(value)) return __velarValidationCopy.mapOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (__velarIsSet(value)) return __velarValidationCopy.setOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n if (!__velarValidationIsPlainObject(value)) return value;\n return __velarValidationCopy.recordOf(value, state, __velarValidationCopy.plain, __velarValidationCopy.plain);\n },\n // A Type object from a target extension, or one emitted by an older build,\n // may carry no copy plan; the structural copy is what is left to fall back on.\n // A Type that does answer 'copy' owns its own plan identity — a declared\n // record files under its copy function, an instantiation under its arguments\n // — so nothing is threaded in from here.\n through(type, value, state) {\n const operation = type === null || type === undefined ? undefined : type.copy;\n if (typeof operation !== \"function\") return __velarValidationCopy.plain(value, state);\n return __velarCollectionHostCall(operation, type, [value, state]);\n },\n};\n// Teaching suffix for record parse failures caused by the plain-object rule.\nfunction __velarValidationRejectionHint(value) {\n if (value === null || typeof value !== \"object\" || __velarValidationIsArray(value) || __velarValidationIsPlainObject(value)) return \"\";\n return \"; a record accepts only plain data objects — project the fields into a record first, for example {x: instance.x}\";\n}\n\nfunction __velarListTypeIs(value, check) {\n if (!__velarCollectionHostCall(__velarCollectionArrayIsArray, __velarCollectionNativeArray, [value]) || value.length > 1000000 || __velarCollectionHostCall(__velarCollectionOwnSymbols, __velarCollectionNativeObject, [value]).length > 0 || __velarCollectionHostCall(__velarCollectionOwnNames, __velarCollectionNativeObject, [value]).length !== value.length + 1) return false;\n const lengthDescriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, \"length\"]);\n if (!lengthDescriptor || !lengthDescriptor.writable || lengthDescriptor.enumerable || lengthDescriptor.configurable || !(\"value\" in lengthDescriptor)) return false;\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, index]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor) || !check(descriptor.value)) return false;\n }\n return true;\n}\n\nfunction __velarSetTypeIs(value, check) {\n if (!__velarIsSet(value) || __velarCollectionHostCall(__velarCollectionSetSize, value, []) > 1000000) return false;\n const iterator = __velarCollectionSetTypeIterator(value);\n while (true) { const step = __velarCollectionSetTypeNext(iterator); if (step.done) break; if (!check(step.value)) return false; }\n return true;\n}\n\nfunction __velarMapTypeIs(value, check) {\n if (!__velarIsMap(value) || __velarCollectionHostCall(__velarCollectionMapSize, value, []) > 1000000) return false;\n const iterator = __velarCollectionMapTypeIterator(value);\n while (true) { const step = __velarCollectionMapTypeNext(iterator); if (step.done) break; const entry = step.value; if (!check(entry[0], entry[1])) return false; }\n return true;\n}\n\nfunction __velarRecordTypeIs(value, check) {\n if (!__velarIsRecord(value)) return false;\n const keys = __velarCollectionHostCall(__velarCollectionOwnKeys, __velarCollectionNativeReflect, [value]);\n if (keys.length > 1000000) return false;\n for (let index = 0; index < keys.length; index += 1) {\n const key = keys[index];\n if (typeof key !== \"string\") return false;\n const descriptor = __velarCollectionHostCall(__velarCollectionGetOwnPropertyDescriptor, __velarCollectionNativeObject, [value, key]);\n if (!descriptor?.enumerable || !descriptor.configurable || !descriptor.writable || !(\"value\" in descriptor) || !check(descriptor.value)) return false;\n }\n return true;\n}\n\nconst __velarValidationErrorDefineProperty = globalThis.Object.defineProperty;\nclass __VelarValidationError extends __velarCollectionNativeTypeError {\n constructor(message, detail) {\n super(message);\n this.name = \"ValidationError\";\n this.path = detail?.path ?? null;\n this.field = detail?.field ?? null;\n this.reason = detail?.reason ?? null;\n }\n}\n// D51 rule 107: 'code' answers with the class a value was constructed from, so\n// the compiler-owned class carries the source-level name it reports.\n__velarValidationErrorDefineProperty(__VelarValidationError, \"name\", { value: \"ValidationError\", writable: false, enumerable: false, configurable: true });\n\nexport {\n __velarRegisterRuntimeType as registerRuntimeType,\n __velarValidationState as validationState,\n __velarValidationSet as validationSet,\n __velarValidationWeakMapGet as validationWeakMapGet,\n __velarValidationWeakMapSet as validationWeakMapSet,\n __velarValidationWeakMapDelete as validationWeakMapDelete,\n __velarValidationSetHas as validationSetHas,\n __velarValidationSetAdd as validationSetAdd,\n __velarValidationSetDelete as validationSetDelete,\n __velarValidationSetSize as validationSetSize,\n __velarValidationIsArray as validationIsArray,\n __velarValidationOwnDescriptor as validationOwnDescriptor,\n __velarValidationIsInstance as validationIsInstance,\n __velarValidationIsPromise as validationIsPromise,\n __velarValidationIsPlainObject as validationIsPlainObject,\n __velarValidationRejectionHint as validationRejectionHint,\n __velarValidationFreeze as validationFreeze,\n __velarListTypeIs as listTypeIs,\n __velarSetTypeIs as setTypeIs,\n __velarMapTypeIs as mapTypeIs,\n __velarRecordTypeIs as recordTypeIs,\n __VelarValidationError as ValidationError,\n};\n","/// Per-connection bounds. Every operation is serialized through one Worker;\n/// queueCapacity bounds admitted operations waiting for that connection.\nimport {DatabaseExecutor, DatabaseStatement, trustedSql} from \"@velarscript-labs/database\"\nimport {sqliteWorkerSource, sqliteWorkerSourceFormatVersion} from \"./generated/worker-source.vel\"\n\nassert sqliteWorkerSourceFormatVersion == 1 else \"SQLite Worker source module has an unsupported format\"\n\nexport enum SqliteJournalMode:\n delete\n truncate\n persist\n memory\n wal\n off\n\nexport type SqliteOptions:\n busyTimeoutMilliseconds: number?\n queueCapacity: number?\n maxRows: number?\n maxResultBytes: number?\n statementCacheCapacity: number?\n journalMode: SqliteJournalMode?\n readOnly: bool?\n\nextern js`\n import { AsyncLocalStorage } from \"node:async_hooks\";\n import { Worker } from \"node:worker_threads\";\n\n const TOKEN = Object.freeze({});\n const connectionStates = new WeakMap();\n const transactionStates = new WeakMap();\n const transactionContext = new AsyncLocalStorage();\n\n export class NativeSqliteError extends Error {\n constructor(message = \"SQLite operation failed\", sqliteCode = null, operation = \"unknown\", retryable = false) {\n super(message);\n this.name = \"NativeSqliteError\";\n this.sqliteCode = sqliteCode;\n this.operation = operation;\n this.retryable = retryable;\n }\n }\n\n export class NativeSqliteBackpressureError extends NativeSqliteError {\n constructor(message = \"SQLite queue is full\") {\n super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true);\n this.name = \"NativeSqliteBackpressureError\";\n }\n }\n\n export class NativeSqliteConcurrencyError extends NativeSqliteError {\n constructor(message = \"SQLite connection cannot be used from its transaction callback\") {\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true);\n this.name = \"NativeSqliteConcurrencyError\";\n }\n }\n\n function integer(value, fallback, minimum, maximum, label) {\n const selected = value == null ? fallback : value;\n if (!Number.isSafeInteger(selected) || selected < minimum || selected > maximum) {\n throw new TypeError(label + \" must be an integer from \" + minimum + \" through \" + maximum);\n }\n return selected;\n }\n\n function checkedOptions(value) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TypeError(\"SQLite options must be a record\");\n const allowed = new Set([\"busyTimeoutMilliseconds\", \"queueCapacity\", \"maxRows\", \"maxResultBytes\", \"statementCacheCapacity\", \"journalMode\", \"readOnly\"]);\n for (const key of Object.keys(value)) if (!allowed.has(key)) throw new TypeError(\"Unknown SQLite option \" + key);\n const journalModes = new Set([\"delete\", \"truncate\", \"persist\", \"memory\", \"wal\", \"off\"]);\n const journalMode = value.journalMode == null ? null : value.journalMode;\n if (journalMode !== null && (typeof journalMode !== \"string\" || !journalModes.has(journalMode))) throw new TypeError(\"SQLite journalMode must name a supported mode\");\n if (value.readOnly != null && typeof value.readOnly !== \"boolean\") throw new TypeError(\"SQLite readOnly must be bool\");\n if (value.readOnly === true && journalMode !== null) throw new TypeError(\"SQLite readOnly connections cannot change journalMode\");\n return {\n busyTimeoutMilliseconds: integer(value.busyTimeoutMilliseconds, 2000, 1, 60000, \"SQLite busy timeout\"),\n queueCapacity: integer(value.queueCapacity, 64, 1, 1024, \"SQLite queue capacity\"),\n maxRows: integer(value.maxRows, 10000, 1, 1000000, \"SQLite row limit\"),\n maxResultBytes: integer(value.maxResultBytes, 64 * 1024 * 1024, 1, 128 * 1024 * 1024, \"SQLite result byte limit\"),\n statementCacheCapacity: integer(value.statementCacheCapacity, 128, 1, 1024, \"SQLite statement cache capacity\"),\n journalMode,\n readOnly: value.readOnly === true,\n };\n }\n\n function nativeError(value) {\n return new NativeSqliteError(value.message, value.sqliteCode, value.operation, value.retryable);\n }\n\n function failPending(state, error) {\n if (state.readyReject !== null) {\n state.readyReject(error);\n state.readyReject = null;\n state.readyResolve = null;\n }\n for (const pending of state.pending.values()) pending.reject(error);\n state.pending.clear();\n }\n\n function failWorker(state, error) {\n if (state.workerFailure !== null) return;\n state.workerFailure = error;\n state.closed = true;\n failPending(state, error);\n }\n\n function request(state, operation, fragments = [\"\"], params = []) {\n if (state.closed) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", operation));\n const id = state.nextId++;\n return new Promise((resolve, reject) => {\n state.pending.set(id, { resolve, reject, operation });\n try {\n state.worker.postMessage({ id, operation, fragments, params });\n } catch (error) {\n state.pending.delete(id);\n reject(error);\n }\n });\n }\n\n function stateOf(connection) {\n const state = connectionStates.get(connection);\n if (!state) throw new TypeError(\"Invalid SQLite connection\");\n return state;\n }\n\n function transactionStateOf(transaction) {\n const state = transactionStates.get(transaction);\n if (!state || !state.active) throw new NativeSqliteConcurrencyError(\"SQLite transaction is no longer active\");\n return state;\n }\n\n function transactionRequest(transaction, operation, fragments = [\"\"], params = []) {\n const state = transactionStateOf(transaction);\n if (state.busy) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite transaction operations must be awaited one at a time\"));\n state.busy = true;\n return request(state.connection, operation, fragments, params).finally(() => { state.busy = false; });\n }\n\n function enqueue(state, operation) {\n if (state.closed || state.closing) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", \"queue\"));\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError());\n if (state.queued >= state.queueCapacity) return Promise.reject(new NativeSqliteBackpressureError());\n state.queued += 1;\n const running = state.tail.then(operation, operation);\n state.tail = running.then(() => null, () => null);\n return running.finally(() => { state.queued -= 1; });\n }\n\n export class NativeSqliteTransaction {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"SQLite transactions are created by connection.transaction\");\n transactionStates.set(this, state);\n }\n\n execute(fragments, params = []) { return transactionRequest(this, \"execute\", fragments, params); }\n one(fragments, params = []) { return transactionRequest(this, \"one\", fragments, params); }\n all(fragments, params = []) { return transactionRequest(this, \"all\", fragments, params); }\n }\n\n export class NativeSqliteConnection {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"Use openSqlite to create a SQLite connection\");\n connectionStates.set(this, state);\n }\n\n execute(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"execute\", fragments, params));\n }\n\n one(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"one\", fragments, params));\n }\n\n all(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"all\", fragments, params));\n }\n\n transaction(operation) {\n if (typeof operation !== \"function\") return Promise.reject(new TypeError(\"SQLite transaction requires an async operation\"));\n const state = stateOf(this);\n return enqueue(state, async () => {\n await request(state, \"begin\");\n const transactionState = { connection: state, active: true, busy: false };\n const transaction = new NativeSqliteTransaction(TOKEN, transactionState);\n try {\n await transactionContext.run(state, () => operation(transaction));\n await transactionRequest(transaction, \"commit\");\n transactionState.active = false;\n return null;\n } catch (error) {\n try {\n if (transactionState.active) await transactionRequest(transaction, \"rollback\");\n } catch {\n state.closing = true;\n state.worker.terminate();\n } finally {\n transactionState.active = false;\n }\n throw error;\n }\n });\n }\n\n close() {\n const state = stateOf(this);\n if (state.closePromise !== null) return state.closePromise;\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite connection cannot close inside its transaction callback\"));\n state.closing = true;\n state.closePromise = state.tail.then(async () => {\n let closeError = null;\n try {\n if (!state.closed) await request(state, \"close\");\n } catch (error) {\n closeError = error;\n }\n try {\n await state.exited;\n if (closeError !== null) throw closeError;\n if (state.workerFailure !== null) throw state.workerFailure;\n } finally {\n state.closed = true;\n }\n });\n return state.closePromise;\n }\n }\n\n export async function openNativeSqlite(path, options = {}, workerSource = \"\") {\n if (typeof path !== \"string\" || path.trim() === \"\" || path.length > 4096 || path.includes(\"\\0\")) throw new TypeError(\"SQLite path must be non-empty bounded text\");\n if (typeof workerSource !== \"string\") throw new TypeError(\"SQLite Worker source must be text\");\n if (workerSource.length === 0 || workerSource.length > 4 * 1024 * 1024) throw new TypeError(\"SQLite Worker source must be non-empty bounded text\");\n const checked = checkedOptions(options);\n const workerUrl = new URL(\"data:text/javascript;charset=utf-8,\" + encodeURIComponent(workerSource));\n const worker = new Worker(workerUrl, { type: \"module\", workerData: { path, ...checked } });\n let readyResolve;\n let readyReject;\n let exitResolve;\n const ready = new Promise((resolve, reject) => { readyResolve = resolve; readyReject = reject; });\n const exited = new Promise(resolve => { exitResolve = resolve; });\n const state = {\n worker,\n readyResolve,\n readyReject,\n exited,\n pending: new Map(),\n nextId: 1,\n queueCapacity: checked.queueCapacity,\n queued: 0,\n tail: Promise.resolve(),\n closing: false,\n closed: false,\n closeAcknowledged: false,\n workerFailure: null,\n exitCode: null,\n closePromise: null,\n };\n worker.on(\"message\", message => {\n if (message.kind === \"ready\") {\n if (state.readyResolve === null) return;\n const resolve = state.readyResolve;\n const reject = state.readyReject;\n state.readyResolve = null;\n state.readyReject = null;\n if (message.error) reject(nativeError(message.error));\n else resolve();\n return;\n }\n if (message.kind !== \"response\") return;\n const pending = state.pending.get(message.id);\n if (!pending) return;\n state.pending.delete(message.id);\n if (pending.operation === \"close\") state.closeAcknowledged = true;\n if (message.error) pending.reject(nativeError(message.error));\n else pending.resolve(message.value);\n });\n worker.on(\"error\", error => {\n failWorker(state, new NativeSqliteError(error.message, \"SQLITE_WORKER\", \"worker\"));\n });\n worker.on(\"exit\", code => {\n state.exitCode = code;\n const expected = code === 0 && state.closeAcknowledged && state.workerFailure === null;\n if (!expected) {\n failWorker(state, new NativeSqliteError(\"SQLite Worker exited unexpectedly with code \" + code, \"SQLITE_WORKER\", \"worker\"));\n }\n state.closed = true;\n exitResolve(code);\n });\n try {\n await ready;\n } catch (error) {\n if (state.exitCode === null) await worker.terminate();\n await exited;\n throw error;\n }\n return new NativeSqliteConnection(TOKEN, state);\n }\n`:\n export class NativeSqliteError:\n const message: string\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n export class NativeSqliteBackpressureError:\n const message: string\n\n export class NativeSqliteConcurrencyError:\n const message: string\n\n export class NativeSqliteTransaction:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n\n export class NativeSqliteConnection:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n async def transaction(operation: (NativeSqliteTransaction) -> Promise<null>) -> null\n async def close() -> null\n\n export async def openNativeSqlite(path: string, options: SqliteOptions = {}, workerSource: string = \"\") -> NativeSqliteConnection\n\n/// A checked SQLite failure. sqliteCode preserves the driver result code when\n/// Node exposes one; retryable is true for busy, locked, and queue pressure.\nexport class SqliteError extends Error:\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n constructor(message: string, sqliteCode: string? = null, operation: string = \"unknown\", retryable: bool = false):\n super(message)\n self.sqliteCode = sqliteCode\n self.operation = operation\n self.retryable = retryable\n\nexport class SqliteBackpressureError extends SqliteError:\n constructor(message: string = \"SQLite queue is full\"): super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true)\n\nexport class SqliteConcurrencyError extends SqliteError:\n constructor(message: string = \"SQLite connection cannot be used from its transaction callback\"):\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true)\n\ndef sqliteFailure(error: NativeSqliteError) -> SqliteError:\n if error is NativeSqliteBackpressureError: return SqliteBackpressureError(error.message)\n if error is NativeSqliteConcurrencyError: return SqliteConcurrencyError(error.message)\n if error is NativeSqliteError: return SqliteError(error.message, error.sqliteCode, error.operation, error.retryable)\n return SqliteError(error.message)\n\n/// Produces a SQLite literal only for grammar positions where bound parameters\n/// are not legal, such as schema defaults and PRAGMA assignments. Ordinary\n/// query values must still use sqlParameter/sqlTuple/sqlRows.\nexport def sqliteLiteral(value: unknown) -> DatabaseStatement:\n if value == null: return trustedSql(\"NULL\")\n if value is bool: return trustedSql(value ? \"1\" : \"0\")\n if value is string: return trustedSql(\"'\" + value.replaceAll(\"'\", \"''\") + \"'\")\n if value is number:\n assert value.isFinite() else \"SQLite numeric literals must be finite\"\n assert not value.isInteger() or (value >= -9007199254740991 and value <= 9007199254740991) else \"SQLite integer literals must be safe integers\"\n return trustedSql(str(value))\n throw Error(\"SQLite literals support only null, bool, string, and finite number\")\n\n/// Quotes one SQLite identifier as a single name. Qualified names must compose\n/// separately quoted identifiers around trusted punctuation.\nexport def sqliteIdentifier(value: string) -> DatabaseStatement:\n assert not value.isBlank() and value.size <= 255 and not value.has(Text.fromCodePoint(0)) else \"SQLite identifiers must be non-blank text with no NUL and no longer than 255 characters\"\n return trustedSql(`\"` + value.replaceAll(`\"`, `\"\"`) + `\"`)\n\nexport class SqliteTransaction:\n constructor(private const native: NativeSqliteTransaction): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this transaction into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\nexport class SqliteConnection:\n constructor(private const native: NativeSqliteConnection): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this connection into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def transaction<T>(operation: (SqliteTransaction) -> Promise<T>) -> T:\n const results: List<T> = []\n async def run<T>(native: NativeSqliteTransaction): results.append(await operation(SqliteTransaction(native)))\n try:\n await self.native.transaction(run)\n assert results.size == 1 else \"SQLite transaction did not return exactly one result\"\n return results[0]\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw error\n\n async def close():\n try: await self.native.close()\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n @dispose: await self.close()\n\nexport async def openSqlite(path: string, options: SqliteOptions = {}) -> SqliteConnection:\n try: return SqliteConnection(await openNativeSqlite(path, options, sqliteWorkerSource))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n","/// Generated by the SQLite Worker resource pipeline. Do not edit.\nexport const sqliteWorkerSourceFormatVersion = 1\nexport const sqliteWorkerSource = `/*!\\n * # Third-party notices\\n *\\n * The generated SQLite Worker contains \\`sqlite3-parser\\` 0.7.1.\\n *\\n * ## sqlite3-parser\\n *\\n * MIT License\\n *\\n * Copyright (c) 2026 Jake Teton-Landis\\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy\\n * of this software and associated documentation files (the \"Software\"), to deal\\n * in the Software without restriction, including without limitation the rights\\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\n * copies of the Software, and to permit persons to whom the Software is\\n * furnished to do so, subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all\\n * copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\n * SOFTWARE.\\n *\\n * Additional notice regarding vendored SQLite sources:\\n *\\n * Some files under \\`vendor/\\` originate from the SQLite project. SQLite is in the\\n * public domain, and those upstream SQLite source files remain available under\\n * public-domain terms. Repository-specific modifications and original code in\\n * this repository are provided under the MIT license above unless otherwise\\n * noted.\\n */\\nvar Vn=Object.defineProperty;var Zn=(r,o)=>{for(var e in o)Vn(r,e,{get:o[e],enumerable:!0})};import{Buffer as d1}from\"node:buffer\";import{DatabaseSync as He,constants as i1}from\"node:sqlite\";import{isMainThread as ve,parentPort as p,workerData as W}from\"node:worker_threads\";var Q1=r=>r;var \\u{24}n=new Uint8Array([29,28,28,28,28,28,28,28,28,7,7,28,7,7,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,7,15,8,5,4,22,24,8,17,18,21,20,23,11,26,16,3,3,3,3,3,3,3,3,3,3,5,19,12,14,13,6,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,2,9,28,28,28,2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,2,28,10,28,25,28,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,30,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27]);function h1(r,o){let e=r.charCodeAt(o);return e!==e?29:e>255?27:\\u{24}n[e]}function v(r){return r===void 0?!1:r.charCodeAt(0)>=128?!0:r>=\"0\"&&r<=\"9\"||r>=\"A\"&&r<=\"Z\"||r>=\"a\"&&r<=\"z\"||r===\"_\"||r===\"\\u{24}\"}function q(r){return r!==void 0&&r>=\"0\"&&r<=\"9\"}function g1(r){return r===void 0?!1:r>=\"0\"&&r<=\"9\"||r>=\"A\"&&r<=\"F\"||r>=\"a\"&&r<=\"f\"}function V1(r){if(r===\" \")return!0;if(r===void 0)return!1;let o=r.charCodeAt(0);return o>=9&&o<=13}var qn=\"\";function Z1(r,o,e={}){let s=e.digitSeparator??qn,m=typeof s==\"string\"&&s.length===1,n=new Map,t=new Map;for(let u=0;u<r.constants.YYNTOKEN;u++){let f=r.symbols[u],E=u;n.set(f,E),t.set(E,f)}function i(u){let f=n.get(u);if(f===void 0)throw new Error(\\`tokenize.ts: parser defs are missing terminal token \"\\u{24}{u}\". This usually means the parser defs and tokenizer are out of sync.\\`);return f}let a={SPACE:i(\"SPACE\"),COMMENT:i(\"COMMENT\"),ILLEGAL:i(\"ILLEGAL\"),PTR:i(\"PTR\"),MINUS:i(\"MINUS\"),LP:i(\"LP\"),RP:i(\"RP\"),SEMI:i(\"SEMI\"),PLUS:i(\"PLUS\"),STAR:i(\"STAR\"),SLASH:i(\"SLASH\"),REM:i(\"REM\"),EQ:i(\"EQ\"),LE:i(\"LE\"),NE:i(\"NE\"),LT:i(\"LT\"),LSHIFT:i(\"LSHIFT\"),GE:i(\"GE\"),RSHIFT:i(\"RSHIFT\"),GT:i(\"GT\"),BITOR:i(\"BITOR\"),CONCAT:i(\"CONCAT\"),COMMA:i(\"COMMA\"),BITAND:i(\"BITAND\"),BITNOT:i(\"BITNOT\"),DOT:i(\"DOT\"),STRING:i(\"STRING\"),ID:i(\"ID\"),INTEGER:i(\"INTEGER\"),FLOAT:i(\"FLOAT\"),QNUMBER:i(\"QNUMBER\"),VARIABLE:i(\"VARIABLE\"),BLOB:i(\"BLOB\"),CASE:i(\"CASE\"),END:i(\"END\")},c=o.meta.maskFlags,A=Object.keys(c),I=e.flags??A,T=c.ALWAYS??Q1(0);for(let u of I)T=Q1(T|(c[u]??0));let C=[],k=0,M=0;for(let u of o.keywords){if((u.mask&T)===0)continue;M++;let f=u.name.length;f>k&&(k=f);let E=C[f];E===void 0&&(E={names:[],codes:[]},C[f]=E),E.names.push(u.name),E.codes.push(i(u.token))}function X(u,f,E){let l;switch(h1(u,f)){case 7:{for(l=f+1;V1(u[l]);l++);return E[0]=a.SPACE,l-f}case 11:{if(u[f+1]===\"-\"){for(l=f+2;u[l]!==void 0&&u[l]!==\\`\\n\\`;l++);return E[0]=a.COMMENT,l-f}return u[f+1]===\">\"?(E[0]=a.PTR,u[f+2]===\">\"?3:2):(E[0]=a.MINUS,1)}case 17:return E[0]=a.LP,1;case 18:return E[0]=a.RP,1;case 19:return E[0]=a.SEMI,1;case 20:return E[0]=a.PLUS,1;case 21:return E[0]=a.STAR,1;case 16:{if(u[f+1]!==\"*\"||u[f+2]===void 0)return E[0]=a.SLASH,1;l=f+3;let N=u[f+2];for(;u[l]!==void 0&&!(N===\"*\"&&u[l]===\"/\");)N=u[l],l++;return u[l]!==void 0&&l++,E[0]=a.COMMENT,l-f}case 22:return E[0]=a.REM,1;case 14:return E[0]=a.EQ,u[f+1]===\"=\"?2:1;case 12:{let N=u[f+1];return N===\"=\"?(E[0]=a.LE,2):N===\">\"?(E[0]=a.NE,2):N===\"<\"?(E[0]=a.LSHIFT,2):(E[0]=a.LT,1)}case 13:{let N=u[f+1];return N===\"=\"?(E[0]=a.GE,2):N===\">\"?(E[0]=a.RSHIFT,2):(E[0]=a.GT,1)}case 15:return u[f+1]===\"=\"?(E[0]=a.NE,2):(E[0]=a.ILLEGAL,1);case 10:return u[f+1]===\"|\"?(E[0]=a.CONCAT,2):(E[0]=a.BITOR,1);case 23:return E[0]=a.COMMA,1;case 24:return E[0]=a.BITAND,1;case 25:return E[0]=a.BITNOT,1;case 8:{let N=u[f],L;for(l=f+1;(L=u[l])!==void 0;l++)if(L===N)if(u[l+1]===N)l++;else break;return L===\"'\"?(E[0]=a.STRING,l-f+1):L!==void 0?(E[0]=a.ID,l-f+1):(E[0]=a.ILLEGAL,l-f)}case 26:return q(u[f+1])?H(u,f,E,!0):(E[0]=a.DOT,1);case 3:return H(u,f,E,!1);case 9:{for(l=f+1;u[l]!==void 0;l++)if(u[l]===\"]\")return E[0]=a.ID,l-f+1;return E[0]=a.ILLEGAL,l-f}case 6:{for(E[0]=a.VARIABLE,l=f+1;q(u[l]);l++);return l-f}case 4:case 5:{let N=0;for(E[0]=a.VARIABLE,l=f+1;u[l]!==void 0;){let L=u[l];if(v(L)){N++,l++;continue}if(L===\"(\"&&N>0){let x;do l++,x=u[l];while(x!==void 0&&!V1(x)&&x!==\")\");x===\")\"?l++:E[0]=a.ILLEGAL;break}if(L===\":\"&&u[l+1]===\":\"){l+=2;continue}break}return N===0&&(E[0]=a.ILLEGAL),l-f}case 1:{if(h1(u,f+1)>2){if(l=f+1,v(u[l])){for(l++;v(u[l]);)l++;return E[0]=a.ID,l-f}return g(u,f,l,E)}for(l=f+2;h1(u,l)<=2;l++);if(v(u[l])){for(l++;v(u[l]);)l++;return E[0]=a.ID,l-f}return g(u,f,l,E)}case 0:{if(u[f+1]===\"'\"){for(E[0]=a.BLOB,l=f+2;g1(u[l]);l++);if(u[l]!==\"'\"||(l-f-2)%2)for(E[0]=a.ILLEGAL;u[l]!==void 0&&u[l]!==\"'\";)l++;return u[l]!==void 0&&l++,l-f}for(l=f+1;v(u[l]);)l++;return E[0]=a.ID,l-f}case 2:case 27:{for(l=f+1;v(u[l]);)l++;return E[0]=a.ID,l-f}case 30:{if(u.charCodeAt(f+1)===187&&u.charCodeAt(f+2)===191)return E[0]=a.SPACE,3;for(l=f+1;v(u[l]);)l++;return E[0]=a.ID,l-f}case 29:return E[0]=a.ILLEGAL,0;default:return E[0]=a.ILLEGAL,1}}function H(u,f,E,l){let N=f;if(E[0]=a.INTEGER,!l&&u[f]===\"0\"&&(u[f+1]===\"x\"||u[f+1]===\"X\")&&g1(u[f+2])){for(N=f+3;u[N]!==void 0;N++)if(!g1(u[N])){if(m&&u[N]===s){E[0]=a.QNUMBER;continue}break}}else{if(!l){for(N=f;u[N]!==void 0;N++)if(!q(u[N])){if(m&&u[N]===s){E[0]=a.QNUMBER;continue}break}}if(l&&N===f||u[N]===\".\"){for(E[0]===a.INTEGER&&(E[0]=a.FLOAT),N=l?f+1:N+1;u[N]!==void 0;N++)if(!q(u[N])){if(m&&u[N]===s){E[0]=a.QNUMBER;continue}break}}if((u[N]===\"e\"||u[N]===\"E\")&&(q(u[N+1])||(u[N+1]===\"+\"||u[N+1]===\"-\")&&q(u[N+2]))){for(E[0]===a.INTEGER&&(E[0]=a.FLOAT),N+=2;u[N]!==void 0;N++)if(!q(u[N])){if(m&&u[N]===s){E[0]=a.QNUMBER;continue}break}}}for(;v(u[N]);)E[0]=a.ILLEGAL,N++;return N-f}function g(u,f,E,l){let N=E-f;if(N>=2&&N<=k){let L=C[N];if(L!==void 0){let x=L.names,O=L.codes,D=x.length;n:for(let U=0;U<D;U++){let S=x[U];for(let F=0;F<N;F++){let Z=u.charCodeAt(f+F),Y=S.charCodeAt(F);if(Z!==Y&&Z!==(Y|32))continue n}return l[0]=O[U],N}}}return l[0]=a.ID,N}let w=a.SPACE,n1=a.COMMENT,e1={done:!0,value:void 0};class l1{sql;len;emitTrivia;offset;line;col;_out=[0];_result={done:!1,value:void 0};constructor(f,E){this.sql=f,this.len=f.length,this.emitTrivia=E,this.offset=0,this.line=1,this.col=0}[Symbol.iterator](){return this}next(){let f=this.sql,E=this.len,l=this.emitTrivia,N=this._out,L=this.offset,x=this.line,O=this.col;for(;L<E;){let D=X(f,L,N),U=N[0];if(D===0)return this.offset=L,this.line=x,this.col=O,e1;let S=L,F=x,Z=O,Y=S+D;for(let \\u{24}=S;\\u{24}<Y;\\u{24}++)f.charCodeAt(\\u{24})===10?(x++,O=0):O++;if(L=Y,!(!l&&(U===w||U===n1)))return this.offset=L,this.line=x,this.col=O,this._result.value={type:U,text:f.slice(S,Y),span:{offset:S,length:D,line:F,col:Z}},this._result}return this.offset=L,this.line=x,this.col=O,e1}}function L1(u,{emitTrivia:f=!1}={}){return new l1(u,f)}return{tokens:a,tokenName:u=>t.get(u),tokenize:L1,_nextToken:X,_keywordCount:M}}function \\u{24}1(r){let o=r.constants,e=r.tables,s=e.yyFallback??[];function m(a,c){if(c>o.YY_MAX_SHIFT)return c;let A=a;for(;;){let T=e.yy_shift_ofst[c]+A;if(e.yy_lookahead[T]!==A){if(o.YYFALLBACK&&A<s.length){let C=s[A];if(C!==0){A=C;continue}}if(o.YYWILDCARD>0){let C=T-A+o.YYWILDCARD;if(C>=0&&C<e.yy_lookahead.length&&e.yy_lookahead[C]===o.YYWILDCARD&&A>0)return e.yy_action[C]}return e.yy_default[c]}return e.yy_action[T]}}function n(a,c){if(a>o.YY_REDUCE_COUNT)return e.yy_default[a];let A=e.yy_reduce_ofst[a]+c;return A<0||A>=o.YY_ACTTAB_COUNT||e.yy_lookahead[A]!==c?e.yy_default[a]:e.yy_action[A]}class t{#n=[{stateno:0,major:0,minor:void 0,span:{offset:0,length:0,line:1,col:0}}];#t=[];#e=\"running\";#r;#s;#o=0;#i;constructor(c,A){this.#i=c,this.#s=A}get phase(){return this.#e}get root(){return this.#r}get stack(){return this.#n}get errors(){return this.#t}get state(){return this.#s}next(c,A,I){if(this.#e!==\"running\")return;let T=this.#n,C=T[T.length-1].stateno;for(;;){let k=C;if(C=m(c,C),C>=o.YY_MIN_REDUCE){this.#a(C-o.YY_MIN_REDUCE),C=T[T.length-1].stateno;continue}if(C<=o.YY_MAX_SHIFTREDUCE){let M=C;M>o.YY_MAX_SHIFT&&(M+=o.YY_MIN_REDUCE-o.YY_MIN_SHIFTREDUCE),T.push({stateno:M,major:c,minor:A,span:I}),this.#o++;return}if(C===o.YY_ACCEPT_ACTION){this.#r=T[T.length-1].minor,this.#e=\"accepted\";return}this.#t.push({stateno:k,major:c,minor:A,tokenIndex:this.#o}),this.#e=\"errored\";return}}#a(c){let A=e.yyRuleInfoNRhs[c],I=e.yyRuleInfoLhs[c],T=this.#n,C=[];for(let g=0;g<A;g++){let w=T.pop();C.push({major:w.major,minor:w.minor,span:w.span})}C.reverse();let k;if(C.length===0){let g=T[T.length-1].span;k={offset:g.offset+g.length,length:0,line:g.line,col:g.col}}else{let g=C[0].span,w=C[C.length-1].span;k={offset:g.offset,length:w.offset+w.length-g.offset,line:g.line,col:g.col}}let M=this.#i(this.#s,c,C,k),X=T[T.length-1].stateno,H=n(X,I);T.push({stateno:H,major:I,minor:M,span:k})}}function i(a,c){return new t(a,c)}return i}function jn(r,o){let{filename:e}=r,{message:s,span:m,hints:n}=o,t=e?\\`At \\u{24}{e}:\\u{24}{m.line}:\\u{24}{m.col}:\\`:\\`At \\u{24}{m.line}:\\u{24}{m.col}:\\`,i=[s,\"\",t,J1(r,m,{indent:\" \"})];return n?.forEach(({message:a,span:c},A)=>{(A===0||c)&&i.push(\"\"),i.push(\\` hint: \\u{24}{a}\\`),c&&i.push(J1(r,c,{indent:\" \",contextBefore:0,contextAfter:0}))}),i.join(\\`\\n\\`)}var O1=class{#n;#t;#e;#r;constructor(o,e){if(!o)throw new TypeError(\\`Expected a ParseErrorContext, got \\u{24}{typeof o} (\\u{24}{o})\\`);this.#n=e,this.#t=o,this.#r=o.filename}get message(){return this.#n.message}get span(){return this.#n.span}get token(){return this.#n.token}get hints(){return this.#n.hints}get filename(){return this.#r}format(){if(this.#e!==void 0)return this.#e;if(!this.#t)throw new Error(\"ParserDiagnostic: context is required to format a diagnostic\");return this.#e=jn(this.#t,this.#n),this.#t=void 0,this.#e}toString(){return this.format()}toJSON(){return{message:this.message,span:this.span,token:this.token,hints:this.hints,filename:this.filename}}};function j(r,o){return o.map(e=>new O1(r,e))}function q1(r,o,e){let s=e?.line??1,m=e?.col??0;for(let n=e?.offset??0;n<o;n++)r.charCodeAt(n)===10?(s++,m=0):m++;return{line:s,col:m}}var j1=\"\\\\u2502 \";function J1(r,o,e){let{source:s}=r,m=Math.max(0,e?.contextBefore??1),n=Math.max(0,e?.contextAfter??1),t=e?.indent??\"\",i=Math.max(0,Math.min(o.offset,s.length)),a=Math.max(i,Math.min(o.offset+o.length,s.length)),c=s.split(\\`\\n\\`),A=o.offset===i?o:q1(s,i),I=q1(s,a,o),T=Math.max(1,A.line-m),C=Math.min(c.length,I.line+n),k=Math.max(2,String(C).length),M=[];for(let X=T;X<=C;X++){let H=c[X-1]??\"\";if(M.push(\\`\\u{24}{t}\\u{24}{String(X).padStart(k,\" \")}\\u{24}{j1}\\u{24}{H}\\`),X<A.line||X>I.line)continue;let g=X===A.line?A.col:0,w=X===I.line?I.col:H.length,n1=Math.max(1,w-g),e1=\" \".repeat(k)+j1+\" \".repeat(g);M.push(t+e1+\"^\".repeat(n1))}return M.join(\\`\\n\\`)}function z1(r){let o=[{message:Jn(r.text)}],e=JSON.stringify(r.text);return e.slice(1,-1)!==String(r.text)&&o.push({message:\\`escaped token text: \\u{24}{e}\\`}),{message:\\`unrecognized token: \"\\u{24}{r.text}\"\\`,span:r.span,token:r,hints:o}}function Jn(r){return r.startsWith(\"'\")?\"unterminated string literal\":r.startsWith('\"')||r.startsWith(\"\\`\")||r.startsWith(\"[\")?\"unterminated quoted identifier\":/^[0-9.]/.test(r)?\"malformed numeric literal\":\"the tokenizer could not classify this input\"}var y;(function(r){r[r.ExprStart=1]=\"ExprStart\",r[r.ItemStart=2]=\"ItemStart\",r[r.ItemEnd=4]=\"ItemEnd\",r[r.ClauseBoundary=8]=\"ClauseBoundary\",r[r.TableNameContext=16]=\"TableNameContext\",r[r.Hidden=32]=\"Hidden\",r[r.KeywordLike=64]=\"KeywordLike\",r[r.FallbackToId=128]=\"FallbackToId\"})(y||(y={}));var zn=[\"ID\",\"STRING\",\"ILLEGAL\",\"SPACE\",\"COMMENT\",\"COMMA\",\"SEMI\",\"LP\",\"RP\",\"CASE\",\"END\",\"FROM\",\"FILTER\",\"OVER\"],B=y.ExprStart|y.ItemStart|y.ItemEnd,K=y.ExprStart|y.ItemStart,h=y.ClauseBoundary,E1=y.TableNameContext,pn={\\u{24}:{display:\"end of input\"},SPACE:{flags:y.Hidden},COMMENT:{flags:y.Hidden},ILLEGAL:{flags:y.Hidden},ID:{display:\"identifier\",flags:B},STRING:{display:\"string literal\",flags:B},INTEGER:{display:\"integer literal\",flags:B},FLOAT:{display:\"float literal\",flags:B},QNUMBER:{display:\"numeric literal\",flags:B},BLOB:{display:\"blob literal\",flags:B},VARIABLE:{display:\"bind parameter\",flags:B},LP:{display:\"(\",flags:K},RP:{display:\")\",flags:y.ItemEnd},COMMA:{display:\",\"},SEMI:{display:\";\"},STAR:{display:\"*\",flags:K},DOT:{display:\".\"},PLUS:{display:\"+\",flags:K},MINUS:{display:\"-\",flags:K},SLASH:{display:\"/\"},REM:{display:\"%\"},EQ:{display:\"=\"},LT:{display:\"<\"},LE:{display:\"<=\"},GT:{display:\">\"},GE:{display:\">=\"},NE:{display:\"!=\"},CONCAT:{display:\"||\"},BITAND:{display:\"&\"},BITOR:{display:\"|\"},BITNOT:{display:\"~\",flags:K},LSHIFT:{display:\"<<\"},RSHIFT:{display:\">>\"},PTR:{display:\"->\"},NULL:{flags:B},CASE:{flags:K},CAST:{flags:K},EXISTS:{flags:K},NOT:{flags:K},CURRENT:{flags:B},CTIME_KW:{display:\"date/time literal\",flags:B},TRUEFALSE:{flags:y.ItemEnd},SELECT:{flags:y.ItemStart},VALUES:{flags:y.ItemStart|h},END:{flags:y.ItemEnd},FROM:{flags:h|E1},WHERE:{flags:h},GROUP:{flags:h},HAVING:{flags:h},WINDOW:{flags:h},ORDER:{flags:h},LIMIT:{flags:h},FILTER:{flags:h},OVER:{flags:h},JOIN:{flags:h|E1},ON:{flags:h},USING:{flags:h},UNION:{flags:h},INTERSECT:{flags:h},EXCEPT:{flags:h},THEN:{flags:h},ELSE:{flags:h},WHEN:{flags:h},DO:{flags:h},SET:{flags:h},RETURNING:{flags:h},INTO:{flags:E1},UPDATE:{flags:E1},JOIN_KW:{display:\"join operator\"}};function p1(r,o){let e=ee(r,o);return s=>te(e,s)}function ne(r){return r.text.length>0?\\`near \"\\u{24}{r.text}\": syntax error\\`:\"incomplete input\"}function ee(r,o){let e=r.constants.YYNTOKEN,s=new Map,m=new Array(e),n=new Uint16Array(e);for(let a=0;a<e;a++){let c=a,A=r.symbols[a],I=pn[A];s.set(A,c),m[a]=re(A,I),n[a]=I?.flags??0}let t=oe(s),i=r.tables.yyFallback??[];for(let a=0;a<e;a++)a!==t.ID&&(i[a]??0)===t.ID&&(n[a]|=y.FallbackToId);for(let a of o.keywords){let c=s.get(a.token);c!==void 0&&(c===t.ID||c===t.STRING||c===t.ILLEGAL||(n[c]|=y.KeywordLike))}return{defs:r,tok:t,displayById:m,flagsById:n}}function te(r,o){let{token:e,state:s,previousToken:m,sawOverSinceLastFilterOrSemi:n,openers:t}=o,i=ne(e),a=ie(r,s),c=le(r,{token:e,canonical:i,expected:a,previousToken:m,openers:t,sawOverSinceLastFilterOrSemi:n})??(a.length>0?[{message:\\`expected \\u{24}{ue(r,a)}\\`}]:void 0);return c?{message:i,span:e.span,token:e,hints:c}:{message:i,span:e.span,token:e}}function re(r,o){if(!((o?.flags??0)&y.Hidden))return o?.display?o.display:/^[A-Z_]+\\u{24}/.test(r)?r.replace(/_KW\\u{24}/,\"\").toLowerCase():r}function se(r,o){let e=r.get(o);if(e===void 0)throw new Error(\\`errors.ts: missing terminal token \"\\u{24}{o}\"\\`);return e}function oe(r){return Object.fromEntries(zn.map(o=>[o,se(r,o)]))}function ie(r,o){let e=r.defs.tables.yy_expected?.[o]??[],s=[];for(let m of e)nn(r,m)||s.push(m);return s}function nn(r,o){return Q(r,o,y.Hidden)}function en(r,o){return Q(r,o,y.FallbackToId)}function ae(r,o){for(let e of o)if(e===r.tok.ID||en(r,e))return!0;return!1}function A1(r,o){return r.includes(o)}function tn(r,o,e){for(let s of o)if(Q(r,s,e))return!0;return!1}function ce(r,o){if(!nn(r,o))return en(r,o)?x1(r,r.tok.ID):x1(r,o)}function me(r,o){let e=/^[^a-z0-9]/i.test(r),s=/^[^a-z0-9]/i.test(o);return e!==s?e?-1:1:r.localeCompare(o)}function ue(r,o){let e=new Set,s=[];for(let a of o){let c=ce(r,a);c===void 0||e.has(c)||(e.add(c),s.push(c))}s.sort(me);let m=s.slice(0,5);if(m.length===1)return m[0];if(m.length===2)return\\`\\u{24}{m[0]} or \\u{24}{m[1]}\\`;let n=m.slice(0,-1).join(\", \"),t=m[m.length-1],i=s.length>m.length?\", ...\":\"\";return\\`\\u{24}{n}, or \\u{24}{t}\\u{24}{i}\\`}function le(r,o){let{token:e,canonical:s,expected:m,previousToken:n,openers:t,sawOverSinceLastFilterOrSemi:i}=o,a=t[t.length-1],c=fe(r,e,n);if(c)return[{message:c}];if(s===\"incomplete input\")return rn(r,e,a)??[{message:\"query ended before a complete statement was formed\"}];let A=Ee(r,e,t);if(A)return[{message:A}];let I=Ae(r,e,i);if(I)return[{message:I}];let T=Ne(r,e,a);if(T)return T;let C=Ce(r,e,m,n);if(C)return[{message:C}];if(e.type===r.tok.FROM&&tn(r,m,y.ExprStart))return[{message:\"expected a result expression before FROM\"}];let k=Te(r,e,m);if(k)return[{message:k}]}function t1(r){return r.text.length===0?\"end of input\":\\`\"\\u{24}{r.text}\"\\`}function fe(r,o,e){if(!e||!Q(r,e.type,y.TableNameContext))return;let s=x1(r,e.type);if(b1(r,o))return\\`expected a table name after \\u{24}{s}\\`;if(!(o.type===r.tok.ID||o.type===r.tok.STRING))return\\`expected a table name after \\u{24}{s}\\`}function rn(r,o,e){if(!e)return;let s;if(e.type===r.tok.LP)s=\\`missing \")\" before \\u{24}{t1(o)}\\`;else if(e.type===r.tok.CASE)s=\\`missing END before \\u{24}{t1(o)}\\`;else return;return[{message:s},{message:\"opened here\",span:e.span}]}function Ee(r,o,e){if(o.type===r.tok.RP&&!e.some(s=>s.type===r.tok.LP))return'unexpected \")\" with no matching \"(\"'}function Ae(r,o,e){if(o.type===r.tok.FILTER)return e?\"FILTER clauses must appear before OVER clauses\":void 0}function Ne(r,o,e){if(!(!e||!sn(r,o)))return rn(r,o,e)}function Ce(r,o,e,s){if(o.type===r.tok.COMMA&&A1(e,r.tok.RP))return'remove this comma or add another list item before \")\"';if(b1(r,o)&&s?.type===r.tok.COMMA)return\"remove the trailing comma or add another list item before end of input\";if(s?.type===r.tok.COMMA&&sn(r,o))return\\`remove the trailing comma or add another list item before \\u{24}{t1(o)}\\`;if(!(!s||!Ie(r,o)||!de(r,s))){if(A1(e,r.tok.COMMA))return\\`missing comma before \\u{24}{t1(o)}\\`;if(A1(e,r.tok.RP)||A1(e,r.tok.SEMI)||tn(r,e,y.ClauseBoundary))return\\`possible missing comma or operator before \\u{24}{t1(o)}\\`}}function Te(r,o,e){if(ae(r,e)&&ye(r,o))return\\`if you intended \\u{24}{t1(o)} as an identifier here, quote it\\`}function Q(r,o,e){return(r.flagsById[o]&e)!==0}function b1(r,o){return o.type===0||o.type===r.tok.SEMI&&o.synthetic===!0}function sn(r,o){return b1(r,o)||Q(r,o.type,y.ClauseBoundary)}function Ie(r,o){return Q(r,o.type,y.ItemStart)}function de(r,o){return Q(r,o.type,y.ItemEnd)}function ye(r,o){return o.type===r.tok.ID||o.type===r.tok.STRING||o.type===r.tok.ILLEGAL?!1:Q(r,o.type,y.KeywordLike)}function x1(r,o){return r.displayById[o]??Le(r.defs,o)}function Le(r,o){return r.symbols[o]??String(o)}var Re=Symbol(\"Sqlite3ParserError\"),S1=class r extends Error{name=\"Sqlite3ParserError\";static wrap(o){return o instanceof r?o:new r(o.stack??\\`\\u{24}{o.name}: \\u{24}{o.message}\\`,{cause:o})}[Re]=!0;toJSON(){return Object.assign({name:this.name,message:this.message,stack:this.stack,cause:this.cause},this)}},a1=class extends S1{name=\"Sqlite3ParserDiagnosticError\";constructor(o){let e=\"\";switch(o.length){case 0:e=\"No diagnostics provided when constructing error\";break;case 1:e=o[0].format();break;default:e=\\`\\u{24}{o.length} diagnostics:\\n\\u{24}{o.map(s=>s.format()).join(\\`\\n\\`)}\\`}super(e),this.errors=o}};function ke(r){return r!==void 0&&r>=\"0\"&&r<=\"9\"}function he(r){return r===void 0?!1:r>=\"0\"&&r<=\"9\"||r>=\"A\"&&r<=\"F\"||r>=\"a\"&&r<=\"f\"}function ge(r){return r===\"'\"||r==='\"'||r===\"\\`\"||r===\"[\"}function V(r){if(r.length===0||!ge(r[0]))return r;let o=r[0]===\"[\"?\"]\":r[0],e=\"\";for(let s=1;s<r.length;s++){let m=r[s];if(m===o)if(r[s+1]===o)e+=o,s++;else break;else e+=m}return e}function an(r,o={}){let e=o.digitSeparator??\"_\",s=r[0]===\"0\"&&(r[1]===\"x\"||r[1]===\"X\"),m=s?he:ke,n=\"INTEGER\",t=\"\",i;for(let a=0;a<r.length;a++){let c=r[a];if(c!==e){t+=c,!s&&(c===\"e\"||c===\"E\"||c===\".\")&&(n=\"FLOAT\");continue}(!m(r[a-1])||!m(r[a+1]))&&(i=\\`unrecognized token: \"\\u{24}{r}\"\\`)}return i?{op:n,text:t,error:i}:{op:n,text:t}}function on(r){if(r===void 0)return NaN;let o=typeof r==\"string\"?r.charCodeAt(0):r|0;return o>=48&&o<=57?o-48:o>=65&&o<=70?o-65+10:o>=97&&o<=102?o-97+10:NaN}function cn(r){if(r[0]!==\"x\"&&r[0]!==\"X\"||r[1]!==\"'\"||r[r.length-1]!==\"'\")throw new Error(\\`not a blob literal: \\u{24}{JSON.stringify(r)}\\`);let o=r.slice(2,r.length-1);if(o.length%2!==0)throw new Error(\\`blob literal has odd hex digit count: \\u{24}{JSON.stringify(r)}\\`);let e=new Uint8Array(o.length/2);for(let s=0;s<o.length;s+=2)e[s/2]=on(o[s])<<4|on(o[s+1]);return e}function G(r,o,...e){return e.length>0?{message:r,span:o,hints:e}:{message:r,span:o}}function N1(r,o,e){return G(r,o,{message:\"first specified here\",span:e})}var Oe={offset:0,length:0,line:0,col:0};function xe(r,o){let e=mn(r),s=mn(o);return e&&s?Oe:e?o:s?r:{offset:r.offset,length:o.offset+o.length-r.offset,line:r.line,col:r.col}}function mn(r){return r.line===0&&r.offset===0&&r.length===0}var c1=r=>({type:\"Name\",text:V(r.text),span:r.span}),r1=r=>({type:\"Id\",name:V(r.text),span:r.span});function ln(r){let o=r.span,e=r.text.toUpperCase();if(e===\"CURRENT_DATE\")return{type:\"CurrentDateLiteral\",span:o};if(e===\"CURRENT_TIME\")return{type:\"CurrentTimeLiteral\",span:o};if(e===\"CURRENT_TIMESTAMP\")return{type:\"CurrentTimestampLiteral\",span:o};throw new Error(\\`unreachable CTIME_KW: \\u{24}{r.text}\\`)}var fn=r=>({type:\"NullLiteral\",span:r.span}),En=r=>({type:\"StringLiteral\",value:V(r.text),span:r.span}),An=r=>({type:\"BlobLiteral\",bytes:cn(r.text),span:r.span}),m1=r=>({type:\"NumericLiteral\",value:r.text,span:r.span}),Nn=r=>({type:\"KeywordLiteral\",value:r.text,span:r.span});function _1(r,o){if(r.type===o.MATCH)return\"Match\";let e=r.text.toUpperCase();if(e===\"LIKE\")return\"Like\";if(e===\"GLOB\")return\"Glob\";if(e===\"REGEXP\")return\"Regexp\";throw new Error(\\`unreachable LIKE_KW: \\u{24}{r.text}\\`)}function Cn(r,o){switch(r){case o.AND:return\"And\";case o.OR:return\"Or\";case o.LT:return\"Less\";case o.GT:return\"Greater\";case o.GE:return\"GreaterEquals\";case o.LE:return\"LessEquals\";case o.EQ:return\"Equals\";case o.NE:return\"NotEquals\";case o.BITAND:return\"BitwiseAnd\";case o.BITOR:return\"BitwiseOr\";case o.LSHIFT:return\"LeftShift\";case o.RSHIFT:return\"RightShift\";case o.PLUS:return\"Add\";case o.MINUS:return\"Subtract\";case o.STAR:return\"Multiply\";case o.SLASH:return\"Divide\";case o.REM:return\"Modulus\";case o.CONCAT:return\"Concat\";case o.IS:return\"Is\";case o.NOT:return\"IsNot\";default:throw new Error(\\`unreachable binary op token: \\u{24}{r}\\`)}}function Tn(r,o){switch(r){case o.BITNOT:return\"BitwiseNot\";case o.MINUS:return\"Negative\";case o.NOT:return\"Not\";case o.PLUS:return\"Positive\";default:throw new Error(\\`unreachable unary op token: \\u{24}{r}\\`)}}var In=r=>r.text===\"->>\"?\"ArrowRightShift\":\"ArrowRight\",D1=(r,o)=>({type:\"ParenthesizedExpr\",exprs:[r],span:o}),dn=r=>({type:\"VariableExpr\",name:r.text,span:r.span}),yn=(r,o,e)=>({type:\"CollateExpr\",expr:r,collation:V(o.text),span:e}),Ln=(r,o,e)=>({type:\"CastExpr\",expr:r,typeName:o,span:e}),J=(r,o,e,s)=>({type:\"BinaryExpr\",left:r,op:o,right:e,span:s}),s1=(r,o,e)=>({type:\"UnaryExpr\",op:r,expr:o,span:e}),Rn=(r,o,e,s,m)=>({type:\"BetweenExpr\",lhs:r,not:o,start:e,end:s,span:m}),kn=(r,o,e,s)=>({type:\"InListExpr\",lhs:r,not:o,rhs:e,span:s}),hn=(r,o,e,s)=>({type:\"InSelectExpr\",lhs:r,not:o,rhs:e,span:s}),gn=(r,o,e,s,m)=>({type:\"InTableExpr\",lhs:r,not:o,rhs:e,args:s,span:m}),On=(r,o)=>({type:\"SubqueryExpr\",select:r,span:o}),xn=(r,o)=>({type:\"ExistsExpr\",select:r,span:o});function bn(r,o,e,s){if(o===e.ISNULL)return{type:\"IsNullExpr\",expr:r,span:s};if(o===e.NOTNULL)return{type:\"NotNullExpr\",expr:r,span:s};throw new Error(\\`unreachable NULL-test token: \\u{24}{o}\\`)}function U1(r,o,e,s,m,n){return{type:\"LikeExpr\",lhs:r,not:o,op:e,rhs:s,escape:m,span:n}}function z(r,o,e,s,m,n,t){return e===\"Distinct\"&&(s?.length??0)!==1&&r.errors.push({message:\"DISTINCT aggregates must have exactly one argument\",span:o.span}),{type:\"FunctionCallExpr\",name:r1(o),distinctness:e,args:s,orderBy:m,filterOver:n,span:t}}var X1=(r,o,e)=>({type:\"FunctionCallStarExpr\",name:r1(r),filterOver:o,span:e}),M1=(r,o)=>({type:\"QualifiedName\",dbName:void 0,objName:r,alias:void 0,span:o}),w1=(r,o,e)=>({type:\"QualifiedName\",dbName:r,objName:o,alias:void 0,span:e}),Sn=(r,o,e)=>({type:\"QualifiedName\",dbName:void 0,objName:r,alias:o,span:e}),_n=(r,o,e,s)=>({type:\"QualifiedName\",dbName:r,objName:o,alias:e,span:s});function un(r){switch(r.toUpperCase()){case\"CROSS\":return 3;case\"FULL\":return 56;case\"INNER\":return 1;case\"LEFT\":return 40;case\"NATURAL\":return 4;case\"RIGHT\":return 48;case\"OUTER\":return 32;default:return}}function C1(r,o,e,s,m){let n=un(o.text);if(n===void 0)return r.errors.push({message:\\`unknown join type: \\u{24}{o.text}\\`,span:o.span}),{type:\"TypedJoinJoinOperator\",joinType:void 0,span:m};for(let A of[e,s]){if(A===void 0)continue;let I=un(A.text);if(I===void 0){r.errors.push({message:\\`unknown join type: \\u{24}{A.text}\\`,span:A.span});continue}n|=I}let t=1,i=8,a=16,c=32;return((n&(t|c))===(t|c)||(n&(c|i|a))===c)&&r.errors.push({message:\\`unknown join type: \\u{24}{o.text} \\u{24}{e?.text??\"\"} \\u{24}{s?.text??\"\"}\\`.trimEnd(),span:o.span}),{type:\"TypedJoinJoinOperator\",joinType:n,span:m}}var Dn=()=>({select:void 0,joins:[],pendingOp:void 0});function F1(r,o){return{type:\"FromClause\",select:r.select,joins:r.joins.length>0?r.joins.map(e=>({type:\"JoinedSelectTable\",operator:e.operator,table:e.table,constraint:e.constraint,span:e.operator.span})):void 0,span:o}}function u1(r,o,e,s){let m=o.pendingOp;o.pendingOp=void 0,m?(m.type===\"TypedJoinJoinOperator\"&&m.joinType!==void 0&&(m.joinType&4)!==0&&s&&r.errors.push({message:\"a NATURAL join may not have an ON or USING clause\",span:s.span}),o.joins.push({operator:m,table:e,constraint:s})):(s&&r.errors.push({message:\"a JOIN clause is required before ON\",span:s.span}),o.select=e)}function T1(r,o,e,s,m){return{type:\"Select\",with:r,select:o.select,compounds:o.compounds,orderBy:e,limit:s,span:m}}function Un(r,o){let e=r;e.compounds?e.compounds.push(o):e.compounds=[o]}function P1(r,o,e,s,m,n,t,i,a){let c=s===void 0?e.find(A=>A.type===\"StarResultColumn\"||A.type===\"TableStarResultColumn\"):void 0;return c&&r.errors.push({message:\"no tables specified\",span:c.span}),{type:\"SelectFrom\",distinctness:o,columns:e,from:s,whereClause:m,groupBy:n,having:t,windowClause:i,span:a}}function Xn(r,o,e,s){let m=o[0]?.values;if(m&&m.length!==e.length){let n=m.length>0?xe(m[0].span,m[m.length-1].span):void 0;r.errors.push(n?G(\"all VALUES must have the same number of terms\",s,{message:\\`first row has \\u{24}{m.length} terms\\`,span:n}):G(\"all VALUES must have the same number of terms\",s))}o.push({type:\"ValuesRow\",values:e,span:s})}function I1(r,o,e,s){let m=0;for(let n of e){let t=n.constraint;switch(t.type){case\"CollateColumnConstraint\":m|=512;break;case\"GeneratedColumnConstraint\":{m|=32,t.typ&&t.typ.name.toUpperCase()===\"STORED\"&&(m|=64);break}case\"PrimaryKeyColumnConstraint\":m|=9;break;case\"UniqueColumnConstraint\":m|=8;break;default:break}}return o&&o.name.length>0&&(m|=4),{type:\"ColumnDefinition\",colName:r,colType:o,constraints:e,flags:m,span:s}}function Y1(r,o,e){let s=e.colName.text;for(let m=0;m<o.length;m++){let n=o[m];if(n.colName.text===s){r.errors.push(N1(\\`duplicate column name: \\u{24}{s}\\`,e.colName.span,n.colName.span));return}}o.push(e)}function Mn(r,o,e,s){let m=e;for(let n of r)(n.flags&1)!==0&&(m|=4);return{type:\"ColumnsAndConstraintsCreateTableBody\",columns:r,constraints:o,flags:m,span:s}}function wn(r,o,e){let s=e.tblName.text;for(let m=0;m<o.length;m++){let n=o[m];if(n.tblName.text===s){r.errors.push(N1(\\`duplicate WITH table name: \\u{24}{s}\\`,e.tblName.span,n.tblName.span));return}}o.push(e)}function B1(r,o,e,s){for(let m of o)m.nulls&&r.errors.push({message:\\`unsupported use of NULLS \\u{24}{m.nulls===\"First\"?\"FIRST\":\"LAST\"}\\`,span:m.span});return{type:\"UpsertIndex\",targets:o,whereClause:e,span:s}}function Fn(r){let o=r.stmt;if(o===void 0)return;let e=r.explain===void 0?o:{type:\"ExplainStmt\",queryPlan:r.explain===\"QueryPlan\",stmt:o,span:o.span};r.cmds.push(e),r.stmt=void 0,r.explain=void 0}function Pn(r){let o=r.cmds,e=o[0]?.span,s=o[o.length-1]?.span,m=e!==void 0&&s!==void 0?{offset:e.offset,length:s.offset+s.length-e.offset,line:e.line,col:e.col}:{offset:0,length:0,line:1,col:1};return{type:\"CmdList\",cmds:o,span:m}}function G1(r,o,e){let{reduce:s,createState:m}=r,n=Z1(r,o,e),t=\\u{24}1(r),i=p1(r,o),{CASE:a,COMMENT:c,END:A,ILLEGAL:I,LP:T,RP:C,SEMI:k,SPACE:M}=n.tokens,X=Yn(r,\"FILTER\"),H=Yn(r,\"OVER\"),g=0;function w(u,f,E){let{filename:l,emitTokens:N,...L}=f,x={source:u,filename:l},O=[],D=N?[]:void 0,U=m(),S=t(s,U),F=[],Z,Y=!1;function \\u{24}(d){let R=S.errors[S.errors.length-1];return O.push(i({token:d,state:R.stateno,previousToken:Z,openers:F,sawOverSinceLastFilterOrSemi:Y})),O.push(...U.errors),{ok:!1,errors:j(x,O),tokens:D}}function Qn(d){let R=d.type;if(R===T||R===a)F.push(d);else if(R===C||R===A){let k1=F[F.length-1];k1&&(k1.type===T&&R===C||k1.type===a&&R===A)&&F.pop()}R===H?Y=!0:(R===X||R===k)&&(Y=!1),Z=d,K1=R}let K1,R1=u.length,f1=n.tokenize(u,L);for(let d of f1){if(d.type===M||d.type===c)continue;if(d.type===I)return D?.push(d),O.push(z1(d)),O.push(...U.errors),{ok:!1,errors:j(x,O),tokens:D};D?.push(d),S.next(d.type,d,d.span);let R=U.cmds.length>=1&&d.type!==k;if(R&&E.rejectTrailing)return O.push({message:\"expected end of input after single statement\",token:d,span:{offset:d.span.offset,length:u.length-d.span.offset,line:d.span.line,col:d.span.col}}),O.push(...U.errors),{ok:!1,errors:j(x,O),tokens:D};if(R&&E.firstStatement)return R1=d.span.offset,{ok:!0,state:U,tail:R1,tokens:D};if(S.phase===\"errored\")return \\u{24}(d);if(Qn(d),S.phase!==\"running\")break}if(S.phase===\"running\"){let d={offset:f1.offset,length:0,line:f1.line,col:f1.col};if(K1!==k){let R={type:k,text:\"\",span:d,synthetic:!0};if(D?.push(R),S.next(k,R,d),S.errors.length>0)return \\u{24}(R)}if(S.phase===\"running\"){let R={type:g,text:\"\",span:d,synthetic:!0};if(D?.push(R),S.next(g,R,d),S.errors.length>0)return \\u{24}(R)}}return O.push(...U.errors),O.length>0?{ok:!1,errors:j(x,O),tokens:D}:S.phase===\"accepted\"?{ok:!0,state:U,tail:R1,tokens:D}:{ok:!1,errors:j(x,[{message:\"parse did not accept input\",span:{offset:0,length:0,line:1,col:0}}]),tokens:D}}function n1(u,f={}){let E=w(u,f,{firstStatement:!1,rejectTrailing:!!e.singleStatement});return E.ok?{status:\"ok\",root:Pn(E.state),tokens:E.tokens}:{status:\"error\",errors:E.errors,tokens:E.tokens}}function e1(u,f){let E=n1(u,f);if(E.status===\"error\")throw new a1(E.errors);return E}function l1(u,f={}){let{allowTrailing:E=!1,...l}=f,N=w(u,l,{firstStatement:!0,rejectTrailing:!E});if(!N.ok)return{status:\"error\",errors:N.errors,tokens:N.tokens};let L=N.state.cmds[0];return L?{status:\"ok\",root:L,tail:N.tail,tokens:N.tokens}:{status:\"error\",errors:j({source:u,filename:f.filename},[{message:\"no SQL statement in input\",span:{offset:0,length:0,line:1,col:0}}]),tokens:N.tokens}}function L1(u,f={}){let E=l1(u,f);if(E.status===\"error\")throw new a1(E.errors);return E}return{parse:n1,parseOrThrow:e1,parseStmt:l1,parseStmtOrThrow:L1,tokenize:n.tokenize,tokenName:n.tokenName,createEngine:t,reduce:s,createState:m,withOptions:u=>G1(r,o,{...e,...u}),parserDefs:r,keywordDefs:o}}function Yn(r,o){let e=r.symbols.indexOf(o);if(e<0)throw new Error(\\`parser.ts: missing terminal token \"\\u{24}{o}\"\\`);return e}var W1={};Zn(W1,{constants:()=>be,createState:()=>We,reduce:()=>Ge,symbols:()=>Ye,tables:()=>Be,tokens:()=>o1});function Bn(){return{stmt:void 0,explain:void 0,cmds:[],constraintName:void 0,vtabArgs:[],vtabArgCurrent:\"\",errors:[]}}var o1={SEMI:1,EXPLAIN:2,QUERY:3,PLAN:4,BEGIN:5,TRANSACTION:6,DEFERRED:7,IMMEDIATE:8,EXCLUSIVE:9,COMMIT:10,END:11,ROLLBACK:12,SAVEPOINT:13,RELEASE:14,TO:15,TABLE:16,CREATE:17,IF:18,NOT:19,EXISTS:20,TEMP:21,LP:22,RP:23,AS:24,COMMA:25,WITHOUT:26,ABORT:27,ACTION:28,AFTER:29,ANALYZE:30,ASC:31,ATTACH:32,BEFORE:33,BY:34,CASCADE:35,CAST:36,CONFLICT:37,DATABASE:38,DESC:39,DETACH:40,EACH:41,FAIL:42,OR:43,AND:44,IS:45,MATCH:46,LIKE_KW:47,BETWEEN:48,IN:49,ISNULL:50,NOTNULL:51,NE:52,EQ:53,GT:54,LE:55,LT:56,GE:57,ESCAPE:58,ID:59,COLUMNKW:60,DO:61,FOR:62,IGNORE:63,INITIALLY:64,INSTEAD:65,NO:66,KEY:67,OF:68,OFFSET:69,PRAGMA:70,RAISE:71,RECURSIVE:72,REPLACE:73,RESTRICT:74,ROW:75,ROWS:76,TRIGGER:77,VACUUM:78,VIEW:79,VIRTUAL:80,WITH:81,NULLS:82,FIRST:83,LAST:84,CURRENT:85,FOLLOWING:86,PARTITION:87,PRECEDING:88,RANGE:89,UNBOUNDED:90,EXCLUDE:91,GROUPS:92,OTHERS:93,TIES:94,WITHIN:95,GENERATED:96,ALWAYS:97,MATERIALIZED:98,REINDEX:99,RENAME:100,CTIME_KW:101,ANY:102,BITAND:103,BITOR:104,LSHIFT:105,RSHIFT:106,PLUS:107,MINUS:108,STAR:109,SLASH:110,REM:111,CONCAT:112,PTR:113,COLLATE:114,BITNOT:115,ON:116,INDEXED:117,STRING:118,JOIN_KW:119,CONSTRAINT:120,DEFAULT:121,NULL:122,PRIMARY:123,UNIQUE:124,CHECK:125,REFERENCES:126,AUTOINCR:127,INSERT:128,DELETE:129,UPDATE:130,SET:131,DEFERRABLE:132,FOREIGN:133,DROP:134,UNION:135,ALL:136,EXCEPT:137,INTERSECT:138,SELECT:139,VALUES:140,DISTINCT:141,DOT:142,FROM:143,JOIN:144,USING:145,ORDER:146,GROUP:147,HAVING:148,LIMIT:149,WHERE:150,RETURNING:151,INTO:152,NOTHING:153,BLOB:154,FLOAT:155,INTEGER:156,VARIABLE:157,CASE:158,WHEN:159,THEN:160,ELSE:161,INDEX:162,ALTER:163,ADD:164,WINDOW:165,OVER:166,FILTER:167,COLUMN:168,AGG_FUNCTION:169,AGG_COLUMN:170,TRUEFALSE:171,ISNOT:172,FUNCTION:173,UPLUS:174,UMINUS:175,TRUTH:176,REGISTER:177,VECTOR:178,SELECT_COLUMN:179,IF_NULL_ROW:180,ASTERISK:181,SPAN:182,ERROR:183,QNUMBER:184,SPACE:185,COMMENT:186,ILLEGAL:187},be={YYNSTATE:586,YYNRULE:413,YYNTOKEN:188,YYNSYMBOL:314,YY_MAX_SHIFT:585,YY_MIN_SHIFTREDUCE:858,YY_MAX_SHIFTREDUCE:1270,YY_ERROR_ACTION:1271,YY_ACCEPT_ACTION:1272,YY_NO_ACTION:1273,YY_MIN_REDUCE:1274,YY_MAX_REDUCE:1686,YY_ACTTAB_COUNT:2353,YY_SHIFT_COUNT:585,YY_REDUCE_COUNT:405,YYWILDCARD:102,YYFALLBACK:1},Se=[490,230,579,133,130,188,579,1363,391,1337,579,382,579,402,579,383,579,1361,378,406,1396,579,48,48,274,1317,48,48,187,538,48,48,83,83,148,148,83,83,133,130,188,81,81,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,1320,984,335,223,1379,406,579,133,130,188,539,133,130,188,539,378,567,1015,560,533,1314,271,186,540,1319,1016,83,83,1328,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,384,137,137,137,137,136,136,135,135,135,134,131,445,1640,381,45,984,1642,539,380,1624,1640,553,570,570,570,1302,433,139,139,139,139,132,445,521,1632,406,1300,8,187,139,139,139,139,1549,137,137,137,137,136,136,135,135,135,134,131,445,133,130,188,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,1623,1592,137,137,137,137,136,136,135,135,135,134,131,445,137,137,137,137,136,136,135,135,135,134,131,445,1199,1681,1230,1681,1228,137,137,137,137,136,136,135,135,135,134,131,445,579,282,137,137,137,137,136,136,135,135,135,134,131,445,1272,1,1,585,3,1278,21,21,406,218,226,376,431,890,111,573,1632,364,1375,8,890,417,1585,136,136,135,135,135,134,131,445,1264,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,426,1302,1197,223,1379,244,520,223,1379,230,581,142,581,1354,443,442,567,1558,560,579,567,405,560,1143,890,891,890,896,1145,157,256,890,891,890,460,459,1144,486,1472,83,83,313,512,1355,249,137,137,137,137,136,136,135,135,135,134,131,445,6,478,449,428,537,1147,1147,579,406,281,239,372,515,367,514,269,376,534,545,327,561,363,298,1633,20,20,8,83,83,896,327,561,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,460,437,223,1379,488,436,406,223,1379,95,331,1662,585,3,1278,567,539,560,1658,226,567,1052,560,1199,1682,535,1682,1375,578,157,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,137,137,137,137,136,136,135,135,135,134,131,445,327,561,223,1379,579,577,579,443,442,264,275,1076,509,506,505,567,526,560,300,353,479,352,504,544,150,150,61,61,1063,256,327,561,1061,137,137,137,137,136,136,135,135,135,134,131,445,890,1197,488,223,1379,444,444,444,406,890,1147,1147,332,449,1683,399,567,527,560,1062,1064,1064,159,135,135,135,134,131,445,1367,1367,378,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,1365,1365,1244,890,536,406,967,968,425,274,96,890,891,890,264,557,161,509,506,505,890,891,890,401,412,890,305,504,47,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,984,137,137,137,137,136,136,135,135,135,134,131,445,584,1149,1278,1472,890,891,890,226,216,1379,1305,412,309,127,568,1375,4,337,982,928,525,567,1373,560,577,575,890,891,890,379,571,1623,137,137,137,137,136,136,135,135,135,134,131,445,223,1379,984,223,1379,374,513,171,406,446,223,1379,378,567,929,560,567,1298,560,1052,157,564,25,567,890,560,474,157,569,412,256,157,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,244,520,223,1379,1076,488,134,131,445,44,125,125,449,461,418,567,1630,560,126,8,446,580,446,890,429,1061,890,353,479,352,528,327,561,558,209,890,891,890,327,561,576,1625,327,561,484,137,137,137,137,136,136,135,135,135,134,131,445,1062,1064,1064,1065,36,223,1379,1631,223,1379,8,579,1623,406,890,7,255,360,567,308,560,567,236,560,890,891,890,890,891,890,1244,83,83,1155,1154,475,234,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,890,1222,1003,1222,406,413,117,98,510,1264,1052,1472,549,577,1221,323,1221,1223,407,1223,890,891,890,579,12,378,274,2,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,83,83,137,137,137,137,136,136,135,135,135,134,131,445,1222,890,891,890,984,224,1379,890,353,466,338,1264,46,1221,548,890,1223,575,567,406,560,422,439,910,210,1087,1087,1101,1104,472,246,137,137,137,137,136,136,135,135,135,134,131,445,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,406,577,579,890,902,984,1599,890,891,890,392,879,415,251,1623,890,891,890,454,462,579,41,50,50,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,579,51,51,1002,1091,579,137,137,137,137,136,136,135,135,135,134,131,445,579,890,21,21,890,891,890,21,21,1626,242,1380,1604,469,356,406,358,420,1602,1243,83,83,427,567,456,560,163,137,137,137,137,136,136,135,135,135,134,131,445,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,406,425,440,1124,170,890,891,890,342,897,868,869,870,267,266,265,577,1629,577,579,8,1597,579,416,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,83,83,1541,21,21,1488,137,137,137,137,136,136,135,135,135,134,131,445,312,1257,488,579,577,389,425,171,1558,1591,301,897,339,1628,341,406,8,237,441,1077,229,373,1655,83,83,1554,1556,137,137,137,137,136,136,135,135,135,134,131,445,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,406,291,579,1e3,1057,324,1151,1015,577,577,1150,371,501,1548,1374,1016,398,1269,303,310,144,370,66,66,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,268,579,1554,473,340,406,137,137,137,137,136,136,135,135,135,134,131,445,905,577,577,67,67,577,1370,468,237,1490,471,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,579,137,137,137,137,136,136,135,135,135,134,131,445,1270,247,555,1076,373,1655,1603,21,21,241,240,398,1198,411,414,190,425,1489,1472,905,1063,554,432,390,1061,171,1001,579,425,363,1236,1585,137,137,137,137,136,136,135,135,135,134,131,445,890,1172,579,21,21,530,579,373,1655,297,1172,1472,1062,1064,1064,425,1173,1222,220,223,1379,517,21,21,124,1173,23,23,572,1491,1221,1174,567,1223,560,464,579,221,304,1235,1174,423,1244,296,90,118,579,1270,977,486,350,114,952,976,1341,579,21,21,890,891,890,563,953,373,1655,406,52,52,457,1171,495,556,330,287,577,68,68,577,424,355,543,311,289,577,1204,406,579,547,357,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,579,406,53,53,541,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,69,69,579,293,186,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,579,557,70,70,268,137,137,137,137,136,136,135,135,135,134,131,445,579,577,579,71,71,579,328,1600,137,137,137,137,136,136,135,135,135,134,131,445,72,72,73,73,1340,54,54,579,137,137,137,137,136,136,135,135,135,134,131,445,579,465,579,1611,481,542,579,55,55,579,90,470,579,90,579,485,579,411,579,1580,56,56,58,58,90,122,59,59,579,60,60,326,74,74,146,146,147,147,75,75,90,117,579,99,233,406,492,1414,76,76,231,1353,977,940,123,1415,120,976,1194,494,400,242,77,77,451,406,579,453,359,140,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,1339,406,22,22,579,140,129,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,165,579,17,579,78,78,141,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,260,62,62,79,79,137,137,137,137,136,136,135,135,135,134,131,445,480,579,919,493,579,344,579,117,137,137,137,137,136,136,135,135,135,134,131,445,579,63,63,348,80,80,64,64,137,137,137,137,136,136,135,135,135,134,131,445,82,82,579,913,579,115,579,1357,406,579,482,579,1e3,349,1054,117,273,1338,487,39,273,366,174,174,175,175,87,87,377,65,65,149,149,306,91,1086,1086,1100,1103,1090,1090,138,138,139,139,139,139,1248,448,579,40,295,579,489,579,273,396,396,395,284,393,262,913,1251,579,502,361,270,117,84,84,294,172,172,151,151,193,1404,334,927,926,934,935,166,145,145,333,579,169,579,117,1425,137,137,137,137,136,136,135,135,135,134,131,445,1471,579,247,173,173,167,167,1131,127,568,1399,4,195,579,1127,579,270,1018,1019,579,179,155,155,156,1066,571,579,1001,127,568,579,4,579,154,154,152,152,10,579,153,153,194,579,1148,1148,571,86,86,446,322,88,88,85,85,1006,975,273,124,49,49,564,1648,57,57,562,972,1131,124,446,974,1411,124,1146,1146,551,894,408,162,1476,550,564,327,561,1066,497,1316,1301,1306,1290,252,1076,1289,1291,1282,551,288,125,125,318,552,319,13,518,320,126,458,446,580,446,397,1076,1061,299,250,254,1452,125,125,463,127,568,1457,4,302,126,346,446,580,446,1445,1462,1061,1461,507,491,1583,571,243,369,1337,1545,347,1544,1062,1064,1064,1065,36,307,351,565,388,227,228,1292,516,1264,1261,1408,446,1409,1606,1407,1062,1064,1064,1065,36,321,295,1406,564,238,1244,396,396,395,284,393,98,1608,1251,1607,207,235,551,184,1458,197,1550,550,14,248,1244,193,94,334,97,467,500,199,1076,203,200,333,201,202,125,125,115,204,1464,1463,127,568,126,4,446,580,446,1539,1584,1061,483,15,1582,211,1467,100,477,571,496,354,217,195,213,498,214,403,1360,1359,1358,179,430,106,156,1348,404,1331,1330,919,244,1325,446,1062,1064,1064,1065,36,1661,1248,448,368,194,295,564,1323,1324,1347,396,396,395,284,393,1322,143,1251,434,1654,435,1377,529,316,375,1244,317,11,1524,276,193,438,334,1430,1636,1635,1076,119,164,408,333,1429,125,125,327,561,1386,116,325,386,126,385,446,580,446,387,546,1061,1378,1376,43,582,127,568,1249,4,225,283,458,285,195,286,583,160,1287,1279,532,176,179,571,409,156,191,410,177,314,861,447,232,1062,1064,1064,1065,36,178,329,450,1189,452,194,92,455,446,93,253,336,192,196,1141,1139,180,198,1257,955,564,257,343,24,258,1244,345,1152,273,205,1159,1163,206,181,182,476,419,421,208,101,408,183,102,1165,259,327,561,261,1162,5,1076,103,212,16,878,104,125,125,981,499,89,568,370,4,126,263,446,580,446,458,215,1061,503,105,26,508,362,571,27,917,127,568,365,4,107,930,315,185,168,28,108,519,522,1241,511,523,110,571,109,524,446,1106,1206,1062,1064,1064,1065,36,18,1205,112,113,564,1122,1107,1105,966,290,245,272,446,124,292,219,1010,1004,1225,29,1227,30,1233,31,564,1244,32,1229,117,33,1234,1109,34,1110,1076,35,559,121,9,1170,125,125,277,37,566,19,278,1067,126,895,446,580,446,128,1076,1061,1211,42,574,38,125,125,222,189,158,279,280,1307,126,394,446,580,446,859,531,1061,858,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1062,1064,1064,1065,36,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1062,1064,1064,1065,36,1273,1273,1273,1273,1273,1244,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1273,1244],_e=[196,196,196,273,274,275,196,223,203,225,196,219,196,208,196,219,196,233,196,19,255,196,216,217,24,216,216,217,196,206,216,217,216,217,216,217,216,217,273,274,275,216,217,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,216,59,196,238,239,19,196,273,274,275,252,273,274,275,252,196,251,31,253,261,215,256,257,261,216,39,216,217,223,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,277,103,104,105,106,107,108,109,110,111,112,113,114,309,310,240,118,309,252,311,300,309,310,212,213,214,196,261,54,55,56,57,58,114,304,305,19,207,308,196,54,55,56,57,282,103,104,105,106,107,108,109,110,111,112,113,114,273,274,275,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,300,292,103,104,105,106,107,108,109,110,111,112,113,114,103,104,105,106,107,108,109,110,111,112,113,114,22,23,86,25,88,103,104,105,106,107,108,109,110,111,112,113,114,196,26,103,104,105,106,107,108,109,110,111,112,113,114,188,189,190,191,192,193,216,217,19,25,198,196,19,59,25,304,305,24,206,308,59,231,206,107,108,109,110,111,112,113,114,60,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,232,196,102,238,239,166,167,238,239,196,205,69,207,230,107,108,251,196,253,196,251,208,253,116,117,118,119,59,121,81,265,117,118,119,213,214,129,268,196,216,217,228,96,230,120,103,104,105,106,107,108,109,110,111,112,113,114,288,289,294,114,196,155,156,196,19,120,121,122,123,124,125,126,196,206,252,139,140,132,206,305,216,217,308,216,217,118,139,140,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,283,263,238,239,196,232,19,238,239,67,23,190,191,192,193,251,252,253,196,198,251,73,253,22,23,261,25,206,196,81,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114,139,140,238,239,196,196,196,107,108,120,201,101,123,124,125,251,206,253,267,128,129,130,133,196,216,217,216,217,118,265,139,140,122,103,104,105,106,107,108,109,110,111,112,113,114,59,102,196,238,239,212,213,214,19,59,155,156,23,294,297,298,251,252,253,154,155,156,72,109,110,111,112,113,114,235,236,196,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,235,236,184,59,135,19,137,138,196,24,24,117,118,119,120,146,72,123,124,125,117,118,119,210,211,59,267,133,240,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,59,103,104,105,106,107,108,109,110,111,112,113,114,191,11,193,196,117,118,119,198,238,239,210,211,206,19,20,206,22,262,109,35,95,251,206,253,196,196,117,118,119,201,36,300,103,104,105,106,107,108,109,110,111,112,113,114,238,239,118,238,239,241,66,243,19,59,238,239,196,251,74,253,251,206,253,73,81,71,22,251,59,253,263,81,210,211,265,81,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,166,167,238,239,101,196,112,113,114,240,107,108,294,121,61,251,305,253,115,308,117,118,119,59,131,122,59,128,129,130,206,139,140,206,22,117,118,119,139,140,302,303,139,140,116,103,104,105,106,107,108,109,110,111,112,113,114,154,155,156,157,158,238,239,305,238,239,308,196,300,19,59,22,15,23,251,267,253,251,151,253,117,118,119,117,118,119,184,216,217,128,129,130,151,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,59,76,144,76,19,199,25,152,23,60,73,196,87,196,89,252,89,92,201,92,117,118,119,196,22,196,24,22,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,216,217,103,104,105,106,107,108,109,110,111,112,113,114,76,117,118,119,59,238,239,59,128,129,130,60,240,89,146,59,92,196,251,19,253,263,252,23,22,46,47,48,49,280,196,103,104,105,106,107,108,109,110,111,112,113,114,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,19,196,196,59,23,118,201,117,118,119,16,21,196,120,300,117,118,119,125,268,196,22,216,217,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,196,216,217,144,122,196,103,104,105,106,107,108,109,110,111,112,113,114,196,59,216,217,117,118,119,216,217,303,25,239,196,80,77,19,79,231,196,23,216,217,231,251,196,253,22,103,104,105,106,107,108,109,110,111,112,113,114,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,19,196,252,124,23,117,118,119,16,59,7,8,9,128,129,130,196,305,196,196,308,201,196,201,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,216,217,162,216,217,272,103,104,105,106,107,108,109,110,111,112,113,114,231,25,196,196,196,241,196,243,196,201,262,118,77,305,79,19,308,143,252,23,196,306,307,216,217,213,214,103,104,105,106,107,108,109,110,111,112,113,114,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,19,23,196,25,23,252,29,31,196,196,33,122,19,201,201,39,22,23,262,267,22,132,216,217,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,46,196,283,65,162,19,103,104,105,106,107,108,109,110,111,112,113,114,59,196,196,216,217,196,201,201,143,272,201,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,196,103,104,105,106,107,108,109,110,111,112,113,114,102,119,66,101,306,307,196,216,217,107,108,22,23,116,295,296,196,272,196,117,118,85,231,241,122,243,144,196,196,132,94,206,103,104,105,106,107,108,109,110,111,112,113,114,59,12,196,216,217,19,196,306,307,100,12,196,154,155,156,196,27,76,231,238,239,109,216,217,25,27,216,217,87,272,89,42,251,92,253,245,196,231,262,147,42,263,184,134,254,160,196,102,136,268,262,116,63,141,226,196,216,217,117,118,119,63,73,306,307,19,216,217,196,23,289,231,163,164,196,216,217,196,263,201,145,262,201,196,98,19,196,146,201,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,196,19,216,217,19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,216,217,196,256,257,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,196,146,216,217,46,103,104,105,106,107,108,109,110,111,112,113,114,196,196,196,216,217,196,201,196,103,104,105,106,107,108,109,110,111,112,113,114,216,217,216,217,226,216,217,196,103,104,105,106,107,108,109,110,111,112,113,114,196,245,196,196,245,117,196,216,217,196,254,196,196,254,196,245,196,116,196,196,216,217,216,217,254,160,216,217,196,216,217,245,216,217,216,217,216,217,216,217,254,25,196,150,151,19,19,196,216,217,24,23,136,25,159,196,161,141,23,196,25,25,216,217,131,19,196,134,196,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,226,19,216,217,196,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,22,196,24,196,216,217,44,45,46,47,48,49,50,51,52,53,54,55,56,57,24,216,217,216,217,103,104,105,106,107,108,109,110,111,112,113,114,130,196,127,117,196,23,196,25,103,104,105,106,107,108,109,110,111,112,113,114,196,216,217,153,216,217,216,217,103,104,105,106,107,108,109,110,111,112,113,114,216,217,196,59,196,150,196,196,19,196,130,196,25,23,23,25,25,196,23,22,25,196,216,217,216,217,216,217,196,216,217,216,217,153,45,46,47,48,49,50,51,52,53,54,55,56,57,1,2,196,53,5,196,23,196,25,10,11,12,13,14,142,118,17,196,23,23,25,25,216,217,22,216,217,216,217,30,258,32,121,122,7,8,23,216,217,40,196,23,196,25,196,103,104,105,106,107,108,109,110,111,112,113,114,196,196,119,216,217,216,217,59,19,20,196,22,70,196,23,196,25,83,84,196,78,216,217,81,59,36,196,144,19,20,196,22,196,216,217,216,217,48,196,216,217,99,196,155,156,36,216,217,59,255,216,217,216,217,23,23,25,25,216,217,71,313,216,217,236,23,118,25,59,23,196,25,155,156,85,23,134,25,196,90,71,139,140,118,285,196,196,142,196,293,101,196,196,196,85,284,107,108,255,90,255,244,146,255,115,163,117,118,119,194,101,122,246,293,293,266,107,108,259,19,20,270,22,259,115,290,117,118,119,266,270,122,270,220,290,270,36,229,219,225,219,247,219,154,155,156,157,158,247,246,279,246,241,241,202,116,60,38,260,59,260,218,260,154,155,156,157,158,259,5,260,71,244,184,10,11,12,13,14,152,218,17,218,22,151,85,43,271,234,282,90,269,293,184,30,291,32,291,18,18,237,101,200,237,40,237,237,107,108,150,200,271,271,19,20,115,22,117,118,119,247,247,122,247,269,247,234,234,159,62,36,287,286,22,70,200,221,200,221,218,218,218,78,64,22,81,227,221,224,224,127,166,218,59,154,155,156,157,158,0,1,2,218,99,5,71,218,220,227,10,11,12,13,14,218,149,17,24,307,114,242,301,281,221,184,281,22,276,91,30,82,32,264,312,312,101,159,165,134,40,264,107,108,139,140,250,148,278,248,115,249,117,118,119,247,147,122,242,242,25,204,19,20,13,22,200,197,163,197,70,6,195,222,195,195,141,209,78,36,299,81,296,299,209,222,4,3,22,154,155,156,157,158,209,122,19,122,19,99,22,125,59,22,15,140,16,152,23,23,131,143,25,20,71,145,16,22,116,184,162,68,25,68,75,1,143,131,131,41,61,37,152,53,134,131,53,117,34,139,140,24,1,5,101,53,116,24,20,53,107,108,109,19,19,20,132,22,115,126,117,118,119,163,22,122,67,22,22,67,23,36,22,59,19,20,24,22,22,28,67,37,23,34,150,22,146,23,97,22,25,36,34,147,59,23,23,154,155,156,157,158,22,98,143,143,71,23,23,23,136,23,142,34,59,25,23,22,117,144,88,34,86,34,93,34,71,184,34,75,25,34,75,23,22,11,101,22,25,25,44,23,107,108,22,22,25,22,142,23,115,23,117,118,119,22,101,122,23,22,24,34,107,108,25,25,23,142,142,142,115,15,117,118,119,1,141,122,1,314,314,314,314,314,314,314,314,314,314,154,155,156,157,158,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,154,155,156,157,158,314,314,314,314,314,184,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,184,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188],De=[1696,2013,585,1918,585,333,581,229,1743,1763,1854,2168,2168,2168,574,229,229,229,229,229,0,44,44,327,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,188,188,1209,1209,428,218,218,218,218,119,223,372,476,520,624,733,776,848,887,959,998,1070,1109,1153,1314,1334,1495,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1515,1354,1535,1639,1639,1948,2056,2148,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,2168,76,88,88,88,88,88,88,88,105,150,401,437,478,195,600,1121,600,342,342,600,600,516,576,120,120,120,303,21,21,2353,2353,227,227,227,646,694,694,694,694,1257,1257,732,716,796,195,181,386,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,403,600,600,600,772,772,600,403,403,600,896,718,718,249,249,249,2353,2353,2353,2353,2353,2353,2353,1126,352,352,850,331,905,500,649,804,600,600,600,600,600,600,600,600,728,600,600,600,600,600,600,600,600,575,575,575,600,600,600,1106,600,600,600,793,1160,1266,600,600,600,600,600,600,600,600,600,799,644,1105,519,519,519,1637,1180,1020,205,740,610,1362,948,1357,1362,1357,1496,1505,610,610,1505,610,948,1496,1485,1497,1370,1104,1104,1104,1203,1203,1203,1203,1357,1267,1267,1364,1050,1385,1551,1793,1850,1793,1793,1873,1873,1781,1787,1915,1897,1934,1934,1934,1934,1935,1813,1935,1813,1787,1787,1813,1915,1813,1897,1897,1823,1921,1935,1965,1935,1965,1793,1793,1793,1933,1976,1976,1965,1793,1877,1793,1933,1793,1793,1839,1880,2007,1919,1919,1965,2018,1951,1951,1962,1962,1891,1886,1912,1922,1813,1880,1880,2048,1935,2064,2064,2078,2078,2078,2353,2353,2353,2353,2353,2353,2353,2353,827,1177,1009,1122,1213,902,967,900,1504,1402,1647,1592,1480,1530,1640,635,1641,1645,1680,1569,1692,1693,1594,1608,1724,1017,1715,1710,1254,1702,1745,1785,1688,1786,1796,1800,1642,1671,1806,1719,1699,2095,2097,2079,1986,2090,1988,2092,2091,2094,1989,2102,2103,2098,2099,1978,1968,1992,2100,2100,1981,2106,1983,2113,2108,2015,1971,2066,2110,2068,2062,2101,2137,1996,2009,2100,2010,2082,2107,2100,1993,2093,2096,2105,2109,2017,2033,2117,2130,2154,2151,2043,2136,2141,2147,2037,2046,2155,2112,2158,2159,2160,2163,2115,2127,2165,2104,2164,2169,2126,2157,2172,2162,2047,2176,2177,2171,2053,2180,2059,2185,2178,2186,2193,2118,2074,2075,2197,2198,2199,2087,2083,2201,2203,2206,2114,2192,2208,2088,2203,2200,2202,2204,2207,2145,2167,2149,2209,2170,2144,2218,2210,2223,2225,2226,2228,2227,2231,2235,2237,2236,2234,2238,2239,2241,2246,2240,2248,2250,2249,2252,2119,2138,2139,2140,2253,2256,2269,2287,2290],Ue=[46,206,149,400,252,50,1049,-177,-194,-190,-186,-184,-180,-132,154,397,407,446,506,509,-235,-208,-204,-114,24,749,754,843,1015,104,1055,1074,554,1108,618,767,-175,840,881,102,886,-168,-55,94,361,615,361,615,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-182,146,250,712,730,934,972,1078,1118,1127,1158,1176,1198,1216,1233,1235,1238,1260,1273,1275,1279,1282,1285,1287,1289,1291,1301,1315,1339,1361,1378,1380,1415,1418,1420,1434,1456,1458,1460,1463,1465,1503,1506,1508,1518,1541,1543,1559,1571,1573,1577,1584,1588,1590,1596,1600,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-270,-123,322,86,451,-216,620,-87,280,420,-195,789,-270,922,969,1025,735,-270,-270,-270,-270,-137,-137,-137,-136,193,293,491,880,281,299,251,56,419,-68,204,204,608,711,837,839,346,822,884,882,940,941,990,991,994,398,1044,606,1056,1046,1083,1087,1146,1149,1155,49,399,158,-178,123,393,441,669,838,1006,1234,597,729,782,347,391,453,943,1058,1225,1228,1239,1139,1255,-191,-158,-134,-196,64,207,217,269,682,722,779,785,791,898,1034,1140,1240,657,1276,1284,1292,1320,1328,1332,1341,1461,1096,1227,1327,1471,1475,1482,1469,1545,1558,1568,1548,1502,1582,1628,1636,217,1643,1644,1646,1649,1650,1651,1550,1553,1565,1597,1599,1602,1469,1611,1669,1574,1575,1605,1603,1620,1613,1617,1618,1589,1648,1614,1616,1655,1619,1657,1598,1667,1662,1668,1673,1675,1677,1652,1654,1656,1664,1663,1665,1666,1625,1659,1682,1706,1697,1653,1716,1718,1658,1660,1661,1670,1676,1708,1717,1720,1722,1723,1756,1727,1764,1728,1694,1695,1730,1709,1732,1746,1747,1698,1700,1789,1769,1791,1771,1775,1776,1777,1773,1778,1779,1780,1788,1801,1798,1795,1802,1810,1725,1792,1734,1755,1758,1816,1765,1735,1736,1782,1790,1783,1809,1815,1814,1821,1829,1830,1870,1879,1883,1885,1890,1892,1893,1794,1797,1799,1881,1888,1864,1876,1898],Xe=[1616,1616,1534,1616,1271,1271,1271,1405,1271,1271,1271,1534,1534,1534,1271,1271,1271,1271,1271,1271,1401,1433,1433,1594,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1532,1271,1271,1271,1271,1634,1634,1271,1618,1617,1271,1271,1271,1442,1271,1271,1271,1449,1271,1271,1271,1271,1271,1271,1535,1536,1271,1271,1271,1271,1593,1595,1551,1577,1456,1455,1454,1453,1444,1421,1447,1440,1528,1529,1527,1531,1535,1536,1271,1443,1495,1512,1494,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1504,1511,1510,1509,1518,1508,1505,1497,1496,1498,1499,1271,1271,1299,1271,1362,1271,1271,1271,1271,1271,1484,1500,1486,1485,1487,1271,1515,1501,1514,1513,1601,1304,1303,1552,1271,1271,1271,1271,1271,1271,1271,1634,1271,1271,1271,1271,1271,1598,1596,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1427,1271,1271,1271,1634,1634,1271,1427,1427,1271,1296,1634,1634,1308,1308,1308,1612,1395,1395,1395,1395,1405,1395,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1401,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1281,1679,1271,1569,1401,1401,1401,1403,1394,1283,1679,1679,1459,1448,1402,1424,1448,1424,1676,1446,1459,1459,1446,1459,1402,1676,1334,1671,1327,1433,1433,1433,1423,1423,1423,1423,1424,1427,1427,1530,1402,1394,1271,1364,1679,1364,1364,1678,1678,1552,1466,1469,1366,1372,1372,1372,1372,1293,1446,1293,1446,1466,1466,1446,1469,1446,1366,1366,1576,1574,1293,1542,1293,1542,1364,1364,1364,1349,1271,1271,1542,1364,1334,1364,1349,1364,1364,1656,1441,1271,1546,1546,1542,1537,1647,1647,1436,1436,1271,1385,1439,1437,1446,1441,1441,1352,1293,1666,1666,1280,1280,1280,1684,1684,1612,1315,1315,1336,1336,1315,1271,1271,1271,1271,1271,1271,1309,1271,1271,1271,1553,1271,1271,1271,1271,1271,1271,1271,1271,1412,1271,1271,1271,1271,1271,1271,1271,1271,1619,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1474,1271,1276,1609,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1450,1451,1271,1271,1271,1271,1271,1271,1271,1271,1573,1572,1271,1271,1271,1271,1271,1465,1271,1271,1271,1460,1271,1271,1271,1271,1271,1271,1271,1271,1413,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1332,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1381,1271,1271,1533,1271,1271,1271,1271,1271,1438,1271,1271,1271,1271,1271,1271,1271,1271,1271,1271,1428,1271,1271,1271,1389,1271,1271,1271,1271,1271,1271,1387,1271,1271,1271,1271,1271,1271,1271,1271,1653,1410,1475,1271,1479,1297,1271,1288,1271,1271],Me=[0,0,59,59,59,59,0,59,59,59,0,59,59,59,59,0,0,0,59,0,0,59,0,0,0,0,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,0,0,0,59,59,0,0,0,0,0,0,0,0,0,0,0,0,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],we=[190,190,192,192,191,193,195,195,195,194,194,194,194,193,193,193,193,193,193,200,200,199,199,202,202,205,205,207,207,203,203,208,196,196,210,210,210,210,211,211,209,209,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,224,224,220,220,222,222,225,225,225,225,226,226,226,226,226,223,223,227,227,227,204,204,228,228,229,230,230,230,230,230,233,233,218,218,234,234,235,235,193,237,237,193,193,193,206,206,206,238,238,243,243,243,243,239,239,239,251,239,253,253,244,244,244,254,245,245,245,255,255,255,246,246,257,257,256,256,256,256,201,201,262,262,262,262,258,258,258,258,258,260,260,260,259,259,259,241,241,231,231,219,219,219,264,264,264,248,248,249,249,242,242,242,242,193,247,247,266,266,266,266,193,267,267,267,267,193,193,270,270,270,270,270,270,271,271,268,268,269,269,263,263,217,217,217,217,216,216,216,216,217,217,217,217,217,217,217,217,217,217,217,216,217,217,217,217,217,217,217,217,217,273,273,217,217,217,217,217,217,217,217,217,217,217,217,274,274,217,275,275,217,217,217,217,217,217,278,278,279,279,277,277,261,261,252,252,276,276,193,280,280,221,221,232,232,281,281,193,193,193,282,282,193,193,193,193,193,283,283,283,283,213,213,214,193,284,284,284,284,285,285,285,285,286,286,287,287,288,288,290,290,289,289,289,289,217,217,236,236,236,193,193,193,292,292,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,294,296,297,297,298,265,265,265,301,301,301,300,240,240,302,302,303,304,304,304,304,304,304,305,305,305,308,308,308,310,310,311,311,309,309,309,312,312,313,313,313,313,250,272,272,272,307,307,306,216,188,189,189,190,197,197,198,205,212,212,229,235,254,217,283,290,291,291,293,293,295,295,296,299,299,299],Fe=[2,3,1,3,1,3,0,1,2,0,1,1,1,2,2,2,3,5,6,0,3,1,0,5,2,0,3,2,1,4,2,2,1,1,0,1,4,6,1,2,2,0,2,2,4,3,3,2,2,3,5,2,4,4,1,2,4,2,3,4,0,1,0,2,2,3,3,3,2,2,1,1,2,3,2,0,2,2,0,2,3,1,1,2,7,5,5,10,0,1,0,3,0,2,1,1,4,2,0,8,4,1,5,6,3,1,3,1,2,1,1,7,8,1,4,1,5,5,1,1,0,0,3,2,4,2,1,0,0,2,2,0,5,7,6,6,1,3,1,3,3,5,1,1,2,3,4,2,4,0,0,3,2,0,3,5,3,1,1,0,2,2,0,0,3,0,2,0,2,4,4,6,0,2,0,2,2,4,9,5,7,3,5,7,8,0,2,12,9,5,8,2,0,2,1,0,3,3,1,3,1,3,5,1,1,1,1,1,3,6,5,8,4,12,6,9,5,13,1,5,3,3,3,3,3,3,3,3,1,2,3,5,2,3,3,4,6,5,2,2,2,3,1,2,5,1,2,5,3,5,4,4,5,5,4,2,0,1,0,1,0,3,1,0,3,11,1,0,0,3,5,3,0,2,4,2,3,2,0,2,4,5,4,5,1,1,1,1,2,1,2,14,1,1,2,0,1,1,1,3,0,3,0,2,3,2,3,2,8,6,5,1,4,6,1,1,1,4,6,3,0,2,1,2,1,2,6,8,6,8,6,9,10,11,9,1,4,7,0,1,3,1,0,2,3,1,2,3,6,1,3,1,3,5,5,6,4,5,1,2,0,3,6,1,1,1,1,2,1,2,2,2,2,0,2,2,2,1,1,2,2,1,1,4,2,5,1,1,2,1,1,1,0,1,1,1,1,0,1,2,1,1,0,1,0,0,1,1,3,2,0,4,2],Pe=[[1,2,5,10,11,12,13,14,17,30,32,40,70,78,81,99,134,139,140,163],[0,1,2,5,10,11,12,13,14,17,30,32,40,70,78,81,99,134,139,140,163],[19,20,22,36,59,71,81,101,107,108,115,117,118,119,122,139,140,154,155,156,157,158,184],[5,10,11,12,13,14,17,30,32,40,70,78,81,99,134,139,140,163],[19,20,22,36,59,71,81,101,107,108,115,117,118,119,122,139,140,154,155,156,157,158,184],[73,81,128,129,130,139,140],[11,73,81,128,129,130,139,140],[81,139,140],[19,20,22,36,48,59,71,85,90,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,85,90,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,85,90,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[81,121,139,140],[81,139,140],[81,139,140],[81,139,140],[81,139,140],[81,139,140],[19,24,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,59,103,104,105,106,107,108,109,110,111,112,113,114,118],[19,31,39,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,31,39,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,67,103,104,105,106,107,108,109,110,111,112,113,114],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[59,107,108,116,117,118,119,121,129,155,156],[59,107,108,116,117,118,119,121,129,155,156],[59,76,87,89,92,117,118,119,146],[59,76,87,89,92,117,118,119,146],[59,117,118,119,120,123,124,125,133],[25,139,140],[25,139,140],[25,139,140],[25,139,140],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,86,88,103,104,105,106,107,108,109,110,111,112,113,114],[19,25,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,69,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,24,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114,151],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114,160],[19,23,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114,160],[19,24,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,44,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,45,46,47,48,49,50,51,52,53,54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,141,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,109,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,141,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[19,20,22,36,59,71,101,107,108,115,117,118,119,122,154,155,156,157,158,184],[54,55,56,57,58,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[54,55,56,57,103,104,105,106,107,108,109,110,111,112,113,114],[103,104,105,106,107,108,109,110,111,112,113,114],[107,108,109,110,111,112,113,114],[109,110,111,112,113,114],[59,72,117,118,119],[59,72,117,118,119],[26,59,117,118,119],[59,117,118,119],[19,46,116,132],[59,117,118,119],[107,108,155,156],[107,108,155,156],[59,117,118,119],[59,117,118,119],[95,166,167],[112,113,114],[166,167],[166,167],[166,167],[139,140],[114],[114],[],[],[19,24,96,114,120,121,122,123,124,125,126,132],[19,24,96,114,120,121,122,123,124,125,126,132],[19,24,96,114,120,121,122,123,124,125,126,132],[59,117,118,119,152],[22,59,117,118,119],[22,59,117,118,119],[22,59,117,118,119],[22,59,117,118,119],[12,27,42,63,73],[12,27,42,63,73],[22,59,117,118,119],[76,87,89,92,146],[22,59,117,118,119],[26,59,117,118,119],[22,23,25,102],[22,23,25,102],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[135,137,138,146],[59,117,118,119],[59,117,118,119],[59,117,118,119],[25,76,89,92],[25,76,89,92],[59,117,118,119],[135,137,138,146],[135,137,138,146],[59,117,118,119],[21,80,124,162],[76,89,92],[76,89,92],[59,118],[59,118],[59,118],[],[],[],[],[],[],[],[22,59,101,107,108,117,118,122,154,155,156,184],[101,118,122,154,155,156,184],[101,118,122,154,155,156,184],[22,59,117,118,119],[120,123,124,125,133],[22,59,117,118,119],[59,109,117,118,119],[59,117,118,119,144],[59,117,118,119,144],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[73,128,129,130],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[35,66,74,131],[35,66,74,131],[35,66,74,131],[59,117,118,119],[59,117,118,119],[59,117,118,119],[23,25,119,144],[59,117,118,119],[59,117,118,119],[59,117,118,119],[22,24,59,118],[66,85,94,147],[12,27,42,63],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[59,117,118,119],[60,120,125],[128,129,130],[29,33,65],[24,59,118],[24,59,118],[24,59,118],[25,119,144],[109,136,141],[7,8,9],[60,120],[15,60],[116,151],[150,151],[25,143],[19,117],[150,151],[19,117],[19,117],[25,150],[116,151],[116,151],[25,150],[116,151],[25,143],[19,117],[25,127],[23,25],[46,116],[31,39],[31,39],[31,39],[116,145],[116,145],[116,145],[116,145],[19,117],[25,146],[25,146],[159,161],[25,143],[136,141],[22,24],[116],[60],[116],[116],[38],[38],[152],[151],[22],[43],[18],[18],[18],[18],[18],[150],[18],[150],[151],[151],[150],[22],[150],[43],[43],[159],[62],[18],[22],[18],[22],[116],[116],[116],[64],[22],[22],[22],[116],[127],[116],[64],[116],[116],[166],[149],[24],[114],[114],[22],[22],[91],[91],[82],[82],[159],[165],[148],[147],[150],[149],[149],[25],[18],[13],[13],[6],[6],[6],[],[],[],[],[],[],[],[],[46,47,48,49,122],[100,134,163,164],[16,77,79,162],[22,23,102],[22,23,102],[128,129,130],[22,59,118],[16,77,79],[23,25],[131,134],[22,53],[23,25],[130,153],[130,153],[23,25],[22,61],[23,25],[23,25],[23,25],[24,142],[23,25],[23,25],[59,118],[121,122],[7,8],[122,132],[23,25],[23,146],[19,98],[59,118],[23,25],[23,25],[83,84],[23,25],[23,25],[23,25],[155,156],[155,156],[23,25],[59,118],[22,142],[4],[3],[22],[122],[19],[122],[19],[22],[22],[125],[15],[16],[23],[23],[140],[152],[131],[25],[25],[143],[20],[145],[16],[22],[116],[162],[68],[25],[68],[75],[41],[1],[143],[131],[25],[131],[61],[37],[25],[152],[53],[53],[53],[53],[131],[117],[34],[24],[1],[5],[116],[24],[20],[19],[132],[126],[22],[67],[22],[22],[23],[22],[67],[59],[24],[97],[28],[22],[67],[37],[23],[34],[150],[22],[23],[34],[146],[22],[147],[23],[25],[23],[22],[98],[143],[143],[23],[23],[23],[136],[142],[23],[25],[23],[117],[34],[22],[144],[25],[34],[34],[34],[34],[88],[75],[86],[44],[75],[93],[25],[34],[23],[22],[25],[22],[25],[23],[22],[11],[22],[25],[22],[23],[23],[22],[34],[23],[22],[24],[25],[142],[142],[142],[142],[25],[23],[15],[1],[1]],Ye=[\"\\u{24}\",\"SEMI\",\"EXPLAIN\",\"QUERY\",\"PLAN\",\"BEGIN\",\"TRANSACTION\",\"DEFERRED\",\"IMMEDIATE\",\"EXCLUSIVE\",\"COMMIT\",\"END\",\"ROLLBACK\",\"SAVEPOINT\",\"RELEASE\",\"TO\",\"TABLE\",\"CREATE\",\"IF\",\"NOT\",\"EXISTS\",\"TEMP\",\"LP\",\"RP\",\"AS\",\"COMMA\",\"WITHOUT\",\"ABORT\",\"ACTION\",\"AFTER\",\"ANALYZE\",\"ASC\",\"ATTACH\",\"BEFORE\",\"BY\",\"CASCADE\",\"CAST\",\"CONFLICT\",\"DATABASE\",\"DESC\",\"DETACH\",\"EACH\",\"FAIL\",\"OR\",\"AND\",\"IS\",\"MATCH\",\"LIKE_KW\",\"BETWEEN\",\"IN\",\"ISNULL\",\"NOTNULL\",\"NE\",\"EQ\",\"GT\",\"LE\",\"LT\",\"GE\",\"ESCAPE\",\"ID\",\"COLUMNKW\",\"DO\",\"FOR\",\"IGNORE\",\"INITIALLY\",\"INSTEAD\",\"NO\",\"KEY\",\"OF\",\"OFFSET\",\"PRAGMA\",\"RAISE\",\"RECURSIVE\",\"REPLACE\",\"RESTRICT\",\"ROW\",\"ROWS\",\"TRIGGER\",\"VACUUM\",\"VIEW\",\"VIRTUAL\",\"WITH\",\"NULLS\",\"FIRST\",\"LAST\",\"CURRENT\",\"FOLLOWING\",\"PARTITION\",\"PRECEDING\",\"RANGE\",\"UNBOUNDED\",\"EXCLUDE\",\"GROUPS\",\"OTHERS\",\"TIES\",\"WITHIN\",\"GENERATED\",\"ALWAYS\",\"MATERIALIZED\",\"REINDEX\",\"RENAME\",\"CTIME_KW\",\"ANY\",\"BITAND\",\"BITOR\",\"LSHIFT\",\"RSHIFT\",\"PLUS\",\"MINUS\",\"STAR\",\"SLASH\",\"REM\",\"CONCAT\",\"PTR\",\"COLLATE\",\"BITNOT\",\"ON\",\"INDEXED\",\"STRING\",\"JOIN_KW\",\"CONSTRAINT\",\"DEFAULT\",\"NULL\",\"PRIMARY\",\"UNIQUE\",\"CHECK\",\"REFERENCES\",\"AUTOINCR\",\"INSERT\",\"DELETE\",\"UPDATE\",\"SET\",\"DEFERRABLE\",\"FOREIGN\",\"DROP\",\"UNION\",\"ALL\",\"EXCEPT\",\"INTERSECT\",\"SELECT\",\"VALUES\",\"DISTINCT\",\"DOT\",\"FROM\",\"JOIN\",\"USING\",\"ORDER\",\"GROUP\",\"HAVING\",\"LIMIT\",\"WHERE\",\"RETURNING\",\"INTO\",\"NOTHING\",\"BLOB\",\"FLOAT\",\"INTEGER\",\"VARIABLE\",\"CASE\",\"WHEN\",\"THEN\",\"ELSE\",\"INDEX\",\"ALTER\",\"ADD\",\"WINDOW\",\"OVER\",\"FILTER\",\"COLUMN\",\"AGG_FUNCTION\",\"AGG_COLUMN\",\"TRUEFALSE\",\"ISNOT\",\"FUNCTION\",\"UPLUS\",\"UMINUS\",\"TRUTH\",\"REGISTER\",\"VECTOR\",\"SELECT_COLUMN\",\"IF_NULL_ROW\",\"ASTERISK\",\"SPAN\",\"ERROR\",\"QNUMBER\",\"SPACE\",\"COMMENT\",\"ILLEGAL\",\"input\",\"cmdlist\",\"ecmd\",\"cmdx\",\"explain\",\"cmd\",\"transtype\",\"trans_opt\",\"nm\",\"savepoint_opt\",\"createkw\",\"temp\",\"ifnotexists\",\"fullname\",\"create_table_args\",\"columnlist\",\"conslist_opt\",\"table_option_set\",\"select\",\"table_option\",\"columnname\",\"carglist\",\"typetoken\",\"typename\",\"signed\",\"plus_num\",\"minus_num\",\"ccons\",\"term\",\"expr\",\"onconf\",\"sortorder\",\"autoinc\",\"eidlist_opt\",\"refargs\",\"defer_subclause\",\"generated\",\"refarg\",\"refact\",\"init_deferred_pred_opt\",\"conslist\",\"tconscomma\",\"tcons\",\"sortlist\",\"eidlist\",\"defer_subclause_opt\",\"orconf\",\"resolvetype\",\"raisetype\",\"ifexists\",\"selectnowith\",\"oneselect\",\"wqlist\",\"orderby_opt\",\"limit_opt\",\"multiselect_op\",\"distinct\",\"selcollist\",\"from\",\"where_opt\",\"groupby_opt\",\"having_opt\",\"window_clause\",\"values\",\"nexprlist\",\"mvalues\",\"sclp\",\"as\",\"seltablist\",\"stl_prefix\",\"joinop\",\"indexed_opt\",\"on_using\",\"exprlist\",\"xfullname\",\"idlist\",\"nulls\",\"with\",\"where_opt_ret\",\"setlist\",\"insert_cmd\",\"idlist_opt\",\"upsert\",\"returning\",\"filter_over\",\"likeop\",\"between_op\",\"in_op\",\"paren_exprlist\",\"case_operand\",\"case_exprlist\",\"case_else\",\"uniqueflag\",\"collate\",\"vinto\",\"nmnum\",\"trigger_time\",\"trigger_event\",\"foreach_clause\",\"when_clause\",\"trigger_cmd_list\",\"trigger_cmd\",\"tridxby\",\"database_kw_opt\",\"key_opt\",\"kwcolumn_opt\",\"create_vtab\",\"vtabarglist\",\"vtabarg\",\"vtabargtoken\",\"lp\",\"anylist\",\"wqitem\",\"wqas\",\"windowdefn_list\",\"windowdefn\",\"window\",\"frame_opt\",\"filter_clause\",\"over_clause\",\"range_or_rows\",\"frame_bound\",\"frame_bound_s\",\"frame_bound_e\",\"frame_exclude_opt\",\"frame_exclude\"],Be={yy_action:Se,yy_lookahead:_e,yy_shift_ofst:De,yy_reduce_ofst:Ue,yy_default:Xe,yyFallback:Me,yyRuleInfoLhs:we,yyRuleInfoNRhs:Fe,yy_expected:Pe},Ge=(r,o,e,s)=>{let m=(n,t,...i)=>{r.errors.push({message:n,span:t,hints:i})};switch(o){case 0:case 1:{Fn(r);return}case 2:{r.explain=\"Explain\";return}case 3:{r.explain=\"QueryPlan\";return}case 4:return;case 5:{let n=e[1].minor,t=e[2].minor;r.stmt={type:\"BeginStmt\",tx:n,txName:t,span:s};return}case 6:case 7:{let n;return n=void 0,n}case 8:{let n=e[1].minor,t;return t=n,t}case 9:{let n;return n=void 0,n}case 10:{let n;return n=\"Deferred\",n}case 11:{let n;return n=\"Immediate\",n}case 12:{let n;return n=\"Exclusive\",n}case 13:{let n=e[1].minor;r.stmt={type:\"CommitStmt\",txName:n,span:s};return}case 14:{let n=e[1].minor;r.stmt={type:\"RollbackStmt\",txName:n,savepointName:void 0,span:s};return}case 15:{let n=e[1].minor;r.stmt={type:\"SavepointStmt\",savepointName:n,span:s};return}case 16:{let n=e[2].minor;r.stmt={type:\"ReleaseStmt\",savepointName:n,span:s};return}case 17:{let n=e[1].minor,t=e[4].minor;r.stmt={type:\"RollbackStmt\",txName:n,savepointName:t,span:s};return}case 18:{let n=e[1].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor;r.stmt={type:\"CreateTableStmt\",temporary:n,ifNotExists:t,tblName:i,body:a,span:s};return}case 19:{let n;return n=!1,n}case 20:case 21:{let n;return n=!0,n}case 22:{let n;return n=!1,n}case 23:{let n=e[1].minor,t=e[2].minor,i=e[4].minor,a;return a=Mn(n,t,i,s),a}case 24:{let n=e[1].minor,t;return t={type:\"AsSelectCreateTableBody\",select:n,span:s},t}case 25:{let n;return n=0,n}case 26:{let n=e[0].minor,t=e[2].minor,i;return i=n|t,i}case 27:{let n=e[1].minor,t;return n.text.toLowerCase()===\"rowid\"?t=128:(r.errors.push(G(\\`unknown table option: \\u{24}{n.text}\\`,n.span,{message:\"expected WITHOUT ROWID\",span:void 0})),t=0),t}case 28:{let n=e[0].minor,t;return n.text.toLowerCase()===\"strict\"?t=65536:(r.errors.push(G(\\`unknown table option: \\u{24}{n.text}\\`,n.span,{message:\"expected STRICT or WITHOUT ROWID\",span:void 0})),t=0),t}case 29:{let n=e[2].minor,t=e[3].minor,i=e[0].minor,a=I1(n.colName,n.colType,t,s);return Y1(r,i,a),i}case 30:{let n=e[0].minor,t=e[1].minor,i,a=I1(n.colName,n.colType,t,s);return i=[],Y1(r,i,a),i}case 31:{let n=e[0].minor,t=e[1].minor,i;return i={colName:n,colType:t,span:s},i}case 32:case 33:{let n=e[0].minor,t;return t=c1(n),t}case 34:{let n;return n=void 0,n}case 35:{let n=e[0].minor,t;return t={type:\"Type\",name:n,size:void 0,span:s},t}case 36:{let n=e[0].minor,t=e[2].minor,i;return i={type:\"Type\",name:n,size:{type:\"MaxSizeTypeSize\",size:t,span:s},span:s},i}case 37:{let n=e[0].minor,t=e[2].minor,i=e[4].minor,a;return a={type:\"Type\",name:n,size:{type:\"TypeSizeTypeSize\",size1:t,size2:i,span:s},span:s},a}case 38:{let n=e[0].minor,t;return t=V(n.text),t}case 39:{let n=e[1].minor,t=e[0].minor;return t=t+\" \"+V(n.text),t}case 40:{let n=e[1].minor,t=e[0].minor;return n&&t.push(n),t}case 41:{let n;return n=[],n}case 42:{let n=e[1].minor,t;return r.constraintName=n,t=void 0,t}case 43:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"DefaultColumnConstraint\",expr:n,span:s},span:s},r.constraintName=void 0,t}case 44:{let n=e[2].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"DefaultColumnConstraint\",expr:D1(n,s),span:s},span:s},r.constraintName=void 0,t}case 45:{let n=e[2].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"DefaultColumnConstraint\",expr:s1(\"Positive\",n,s),span:s},span:s},r.constraintName=void 0,t}case 46:{let n=e[2].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"DefaultColumnConstraint\",expr:s1(\"Negative\",n,s),span:s},span:s},r.constraintName=void 0,t}case 47:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"DefaultColumnConstraint\",expr:r1(n),span:s},span:s},r.constraintName=void 0,t}case 48:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"NotNullColumnConstraint\",nullable:!0,conflictClause:n,span:s},span:s},r.constraintName=void 0,t}case 49:{let n=e[2].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"NotNullColumnConstraint\",nullable:!1,conflictClause:n,span:s},span:s},r.constraintName=void 0,t}case 50:{let n=e[2].minor,t=e[3].minor,i=e[4].minor,a;return a={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"PrimaryKeyColumnConstraint\",order:n,conflictClause:t,autoIncrement:i,span:s},span:s},r.constraintName=void 0,a}case 51:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"UniqueColumnConstraint\",conflictClause:n,span:s},span:s},r.constraintName=void 0,t}case 52:{let n=e[2].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"CheckColumnConstraint\",expr:n,span:s},span:s},r.constraintName=void 0,t}case 53:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a;return a={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"ForeignKeyColumnConstraint\",clause:{type:\"ForeignKeyClause\",tblName:n,columns:t,args:i,span:s},deferClause:void 0,span:s},span:s},r.constraintName=void 0,a}case 54:{let n=e[0].minor,t;return t={type:\"NamedColumnConstraint\",name:void 0,constraint:{type:\"DeferColumnConstraint\",clause:n,span:s},span:s},t}case 55:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:{type:\"CollateColumnConstraint\",collationName:c1(n),span:s},span:s},r.constraintName=void 0,t}case 56:{let n=e[3].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:n,span:s},r.constraintName=void 0,t}case 57:{let n=e[1].minor,t;return t={type:\"NamedColumnConstraint\",name:r.constraintName,constraint:n,span:s},r.constraintName=void 0,t}case 58:{let n=e[1].minor,t;return t={type:\"GeneratedColumnConstraint\",expr:n,typ:void 0,span:s},t}case 59:{let n=e[1].minor,t=e[3].minor,i;return i={type:\"GeneratedColumnConstraint\",expr:n,typ:r1(t),span:s},i}case 60:{let n;return n=!1,n}case 61:{let n;return n=!0,n}case 62:{let n;return n=[],n}case 63:{let n=e[1].minor,t=e[0].minor;return t.push(n),t}case 64:{let n=e[1].minor,t;return t={type:\"MatchRefArg\",name:n,span:s},t}case 65:{let n=e[2].minor,t;return t={type:\"OnInsertRefArg\",action:n,span:s},t}case 66:{let n=e[2].minor,t;return t={type:\"OnDeleteRefArg\",action:n,span:s},t}case 67:{let n=e[2].minor,t;return t={type:\"OnUpdateRefArg\",action:n,span:s},t}case 68:{let n;return n=\"SetNull\",n}case 69:{let n;return n=\"SetDefault\",n}case 70:{let n;return n=\"Cascade\",n}case 71:{let n;return n=\"Restrict\",n}case 72:{let n;return n=\"NoAction\",n}case 73:{let n=e[2].minor,t;return t={type:\"DeferSubclause\",deferrable:!1,initDeferred:n,span:s},t}case 74:{let n=e[1].minor,t;return t={type:\"DeferSubclause\",deferrable:!0,initDeferred:n,span:s},t}case 75:{let n;return n=void 0,n}case 76:{let n;return n=\"InitiallyDeferred\",n}case 77:{let n;return n=\"InitiallyImmediate\",n}case 78:{let n;return n=void 0,n}case 79:{let n=e[1].minor,t;return t=n,t}case 80:{let n=e[2].minor,t=e[0].minor;return n&&t.push(n),t}case 81:{let n=e[0].minor,t;return t=n?[n]:[],t}case 82:{r.constraintName=void 0;return}case 83:{let n=e[1].minor,t;return r.constraintName=n,t=void 0,t}case 84:{let n=e[3].minor,t=e[4].minor,i=e[6].minor,a;return a={type:\"NamedTableConstraint\",name:r.constraintName,constraint:{type:\"PrimaryKeyTableConstraint\",columns:n,autoIncrement:t,conflictClause:i,span:s},span:s},r.constraintName=void 0,a}case 85:{let n=e[2].minor,t=e[4].minor,i;return i={type:\"NamedTableConstraint\",name:r.constraintName,constraint:{type:\"UniqueTableConstraint\",columns:n,conflictClause:t,span:s},span:s},r.constraintName=void 0,i}case 86:{let n=e[2].minor,t=e[4].minor,i;return i={type:\"NamedTableConstraint\",name:r.constraintName,constraint:{type:\"CheckTableConstraint\",expr:n,conflictClause:t,span:s},span:s},r.constraintName=void 0,i}case 87:{let n=e[3].minor,t=e[6].minor,i=e[7].minor,a=e[8].minor,c=e[9].minor,A;return A={type:\"NamedTableConstraint\",name:r.constraintName,constraint:{type:\"ForeignKeyTableConstraint\",columns:n,clause:{type:\"ForeignKeyClause\",tblName:t,columns:i,args:a,span:s},deferClause:c,span:s},span:s},r.constraintName=void 0,A}case 88:{let n;return n=void 0,n}case 89:{let n=e[0].minor,t;return t=n,t}case 90:{let n;return n=void 0,n}case 91:{let n=e[2].minor,t;return t=n,t}case 92:{let n;return n=void 0,n}case 93:{let n=e[1].minor,t;return t=n,t}case 94:{let n;return n=\"Ignore\",n}case 95:{let n;return n=\"Replace\",n}case 96:{let n=e[2].minor,t=e[3].minor;r.stmt={type:\"DropTableStmt\",ifExists:n,tblName:t,span:s};return}case 97:{let n;return n=!0,n}case 98:{let n;return n=!1,n}case 99:{let n=e[1].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor,c=e[7].minor;r.stmt={type:\"CreateViewStmt\",temporary:n,ifNotExists:t,viewName:i,columns:a,select:c,span:s};return}case 100:{let n=e[2].minor,t=e[3].minor;r.stmt={type:\"DropViewStmt\",ifExists:n,viewName:t,span:s};return}case 101:{let n=e[0].minor;r.stmt={type:\"SelectStmt\",body:n,span:s};return}case 102:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c;return c=T1({type:\"With\",recursive:!1,ctes:n,span:s},t,i,a,s),c}case 103:{let n=e[2].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor,c;return c=T1({type:\"With\",recursive:!0,ctes:n,span:s},t,i,a,s),c}case 104:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=T1(void 0,n,t,i,s),a}case 105:{let n=e[0].minor,t;return t={select:n,compounds:void 0},t}case 106:{let n=e[1].minor,t=e[2].minor,i=e[0].minor;return Un(i,{type:\"CompoundSelect\",operator:n,select:t,span:s}),i}case 107:{let n;return n=\"Union\",n}case 108:{let n;return n=\"UnionAll\",n}case 109:{let n;return n=\"Except\",n}case 110:{let n;return n=\"Intersect\",n}case 111:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c=e[5].minor,A=e[6].minor,I;return I=P1(r,n,t,i,a,c,A,void 0,s),I}case 112:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c=e[5].minor,A=e[6].minor,I=e[7].minor,T;return T=P1(r,n,t,i,a,c,A,I,s),T}case 113:{let n=e[0].minor,t;return t={type:\"SelectValues\",values:n,span:s},t}case 114:{let n=e[2].minor,t;return t=[{type:\"ValuesRow\",values:n,span:s}],t}case 115:{let n=e[0].minor,t;return t={type:\"SelectValues\",values:n,span:s},t}case 116:case 117:{let n=e[3].minor,t=e[0].minor;return Xn(r,t,n,s),t}case 118:{let n;return n=\"Distinct\",n}case 119:{let n;return n=\"All\",n}case 120:{let n;return n=void 0,n}case 121:{let n;return n=[],n}case 122:{let n=e[1].minor,t=e[2].minor,i=e[0].minor;return i.push({type:\"ExprResultColumn\",expr:n,alias:t,span:s}),i}case 123:{let n=e[0].minor;return n.push({type:\"StarResultColumn\",span:s}),n}case 124:{let n=e[1].minor,t=e[0].minor;return t.push({type:\"TableStarResultColumn\",table:n,span:s}),t}case 125:{let n=e[1].minor,t;return t={type:\"AsAs\",name:n,span:s},t}case 126:{let n=e[0].minor,t;return t={type:\"ElidedAs\",name:c1(n),span:s},t}case 127:{let n;return n=void 0,n}case 128:{let n;return n=void 0,n}case 129:{let n=e[1].minor,t;return t=F1(n,s),t}case 130:{let n=e[1].minor,t=e[0].minor;return t.pendingOp=n,t}case 131:{let n;return n=Dn(),n}case 132:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c=e[0].minor;return u1(r,c,{type:\"TableSelectTable\",tblName:n,alias:t,indexed:i,span:s},a),c}case 133:{let n=e[1].minor,t=e[3].minor,i=e[5].minor,a=e[6].minor,c=e[0].minor;return u1(r,c,{type:\"TableCallSelectTable\",tblName:n,args:t,alias:i,span:s},a),c}case 134:{let n=e[2].minor,t=e[4].minor,i=e[5].minor,a=e[0].minor;return u1(r,a,{type:\"SelectSelectTable\",select:n,alias:t,span:s},i),a}case 135:{let n=e[2].minor,t=e[4].minor,i=e[5].minor,a=e[0].minor;return u1(r,a,{type:\"SubSelectTable\",from:F1(n,s),alias:t,span:s},i),a}case 136:{let n=e[0].minor,t;return t=M1(n,s),t}case 137:{let n=e[0].minor,t=e[2].minor,i;return i=w1(n,t,s),i}case 138:{let n=e[0].minor,t;return t=M1(n,s),t}case 139:{let n=e[0].minor,t=e[2].minor,i;return i=w1(n,t,s),i}case 140:{let n=e[0].minor,t=e[2].minor,i;return i=Sn(n,t,s),i}case 141:{let n=e[0].minor,t=e[2].minor,i=e[4].minor,a;return a=_n(n,t,i,s),a}case 142:{let n;return n={type:\"CommaJoinOperator\",span:s},n}case 143:{let n;return n={type:\"TypedJoinJoinOperator\",joinType:void 0,span:s},n}case 144:{let n=e[0].minor,t;return t=C1(r,n,void 0,void 0,s),t}case 145:{let n=e[0].minor,t=e[1].minor,i;return i=C1(r,n,t,void 0,s),i}case 146:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=C1(r,n,t,i,s),a}case 147:{let n=e[1].minor,t;return t={type:\"OnJoinConstraint\",expr:n,span:s},t}case 148:{let n=e[2].minor,t;return t={type:\"UsingJoinConstraint\",columns:n,span:s},t}case 149:{let n;return n=void 0,n}case 150:{let n;return n=void 0,n}case 151:{let n=e[2].minor,t;return t={type:\"IndexedByIndexed\",idxName:n,span:s},t}case 152:{let n;return n={type:\"NotIndexedIndexed\",span:s},n}case 153:{let n;return n=void 0,n}case 154:{let n=e[2].minor,t;return t=n,t}case 155:{let n=e[2].minor,t=e[3].minor,i=e[4].minor,a=e[0].minor;return a.push({type:\"SortedColumn\",expr:n,order:t,nulls:i,span:s}),a}case 156:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=[{type:\"SortedColumn\",expr:n,order:t,nulls:i,span:s}],a}case 157:{let n;return n=\"Asc\",n}case 158:{let n;return n=\"Desc\",n}case 159:{let n;return n=void 0,n}case 160:{let n;return n=\"First\",n}case 161:{let n;return n=\"Last\",n}case 162:{let n;return n=void 0,n}case 163:{let n;return n=void 0,n}case 164:{let n=e[2].minor,t;return t=n,t}case 165:{let n;return n=void 0,n}case 166:{let n=e[1].minor,t;return t=n,t}case 167:{let n;return n=void 0,n}case 168:{let n=e[1].minor,t;return t={type:\"Limit\",expr:n,offset:void 0,span:s},t}case 169:{let n=e[1].minor,t=e[3].minor,i;return i={type:\"Limit\",expr:n,offset:t,span:s},i}case 170:{let n=e[1].minor,t=e[3].minor,i;return i={type:\"Limit\",expr:t,offset:n,span:s},i}case 171:{let n=e[0].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor;r.stmt={type:\"DeleteStmt\",with:n,tblName:t,indexed:i,whereClause:a.where,returning:a.returning,orderBy:void 0,limit:void 0,span:s};return}case 172:{let n;return n=void 0,n}case 173:{let n=e[1].minor,t;return t=n,t}case 174:{let n;return n={where:void 0,returning:void 0,span:s},n}case 175:{let n=e[1].minor,t;return t={where:n,returning:void 0,span:s},t}case 176:{let n=e[1].minor,t;return t={where:void 0,returning:n,span:s},t}case 177:{let n=e[1].minor,t=e[3].minor,i;return i={where:n,returning:t,span:s},i}case 178:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c=e[6].minor,A=e[7].minor,I=e[8].minor;r.stmt={type:\"UpdateStmt\",with:n,orConflict:t,tblName:i,indexed:a,sets:c,from:A,whereClause:I.where,returning:I.returning,orderBy:void 0,limit:void 0,span:s};return}case 179:{let n=e[2].minor,t=e[4].minor,i=e[0].minor;return i.push({type:\"SetAssignment\",colNames:[n],expr:t,span:s}),i}case 180:{let n=e[3].minor,t=e[6].minor,i=e[0].minor;return i.push({type:\"SetAssignment\",colNames:n,expr:t,span:s}),i}case 181:{let n=e[0].minor,t=e[2].minor,i;return i=[{type:\"SetAssignment\",colNames:[n],expr:t,span:s}],i}case 182:{let n=e[1].minor,t=e[4].minor,i;return i=[{type:\"SetAssignment\",colNames:n,expr:t,span:s}],i}case 183:{let n=e[0].minor,t=e[1].minor,i=e[3].minor,a=e[4].minor,c=e[5].minor,A=e[6].minor;r.stmt={type:\"InsertStmt\",with:n,orConflict:t,tblName:i,columns:a,body:{type:\"SelectInsertBody\",select:c,upsert:A.upsert,span:s},returning:A.returning,span:s};return}case 184:{let n=e[0].minor,t=e[1].minor,i=e[3].minor,a=e[4].minor,c=e[7].minor;r.stmt={type:\"InsertStmt\",with:n,orConflict:t,tblName:i,columns:a,body:{type:\"DefaultValuesInsertBody\",span:s},returning:c.columns,span:s};return}case 185:{let n;return n={upsert:void 0,returning:void 0,returningSpan:void 0,span:s},n}case 186:{let n=e[1].minor,t;return t={upsert:void 0,returning:n,returningSpan:s,span:s},t}case 187:{let n=e[3].minor,t=e[5].minor,i=e[9].minor,a=e[10].minor,c=e[11].minor,A;return A={upsert:{type:\"Upsert\",index:B1(r,n,t,s),doClause:{type:\"SetUpsertDo\",sets:i,whereClause:a,span:s},next:c.upsert,span:s},returning:c.returning,returningSpan:c.returningSpan,span:s},A}case 188:{let n=e[3].minor,t=e[5].minor,i=e[8].minor,a;return a={upsert:{type:\"Upsert\",index:B1(r,n,t,s),doClause:{type:\"NothingUpsertDo\",span:s},next:i.upsert,span:s},returning:i.returning,returningSpan:i.returningSpan,span:s},a}case 189:{let n=e[4].minor,t;return t={upsert:{type:\"Upsert\",index:void 0,doClause:{type:\"NothingUpsertDo\",span:s},next:void 0,span:s},returning:n.columns,returningSpan:n.span,span:s},t}case 190:{let n=e[5].minor,t=e[6].minor,i=e[7].minor,a;return a={upsert:{type:\"Upsert\",index:void 0,doClause:{type:\"SetUpsertDo\",sets:n,whereClause:t,span:s},next:void 0,span:s},returning:i.columns,returningSpan:i.span,span:s},a}case 191:{let n=e[1].minor,t;return t={columns:n,span:s},t}case 192:{let n;return n={columns:void 0,span:void 0},n}case 193:{let n=e[1].minor,t;return t=n,t}case 194:{let n;return n=\"Replace\",n}case 195:{let n;return n=void 0,n}case 196:{let n=e[1].minor,t;return t=n,t}case 197:{let n=e[2].minor,t=e[0].minor,i=t.find(a=>a.text===n.text);return i?r.errors.push(N1(\\`column \"\\u{24}{n.text}\" specified more than once\\`,n.span,i.span)):t.push(n),t}case 198:{let n=e[0].minor,t;return t=[n],t}case 199:{let n=e[1].minor,t;return t=D1(n,s),t}case 200:{let n=e[0].minor,t;return t=r1(n),t}case 201:{let n=e[0].minor,t=e[2].minor,i;return i={type:\"QualifiedExpr\",schema:void 0,table:n,column:t,span:s},i}case 202:{let n=e[0].minor,t=e[2].minor,i=e[4].minor,a;return a={type:\"QualifiedExpr\",schema:n,table:t,column:i,span:s},a}case 203:{let n=e[0].minor,t;return t=fn(n),t}case 204:{let n=e[0].minor,t;return t=An(n),t}case 205:{let n=e[0].minor,t;return t=En(n),t}case 206:{let n=e[0].minor,t;return t=m1(n),t}case 207:{let n=e[0].minor,t;return t=dn(n),t}case 208:{let n=e[0].minor,t=e[2].minor,i;return i=yn(n,t,s),i}case 209:{let n=e[2].minor,t=e[4].minor,i;return i=Ln(n,t,s),i}case 210:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a;return a=z(r,n,t,i,void 0,void 0,s),a}case 211:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[6].minor,c;return c=z(r,n,t,i,{type:\"SortListFunctionCallOrder\",columns:a,span:s},void 0,s),c}case 212:{let n=e[0].minor,t;return t=X1(n,void 0,s),t}case 213:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[10].minor,c;return c=z(r,n,t,i,{type:\"WithinGroupFunctionCallOrder\",expr:a,span:s},void 0,s),c}case 214:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[5].minor,c;return c=z(r,n,t,i,void 0,a,s),c}case 215:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[6].minor,c=e[8].minor,A;return A=z(r,n,t,i,{type:\"SortListFunctionCallOrder\",columns:a,span:s},c,s),A}case 216:{let n=e[0].minor,t=e[4].minor,i;return i=X1(n,t,s),i}case 217:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[10].minor,c=e[12].minor,A;return A=z(r,n,t,i,{type:\"WithinGroupFunctionCallOrder\",expr:a,span:s},c,s),A}case 218:{let n=e[0].minor,t;return t=ln(n),t}case 219:{let n=e[1].minor,t=e[3].minor,i;return i={type:\"ParenthesizedExpr\",exprs:[...n,t],span:s},i}case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=J(n,Cn(t.type,o1),i,s),a}case 228:{let n=e[0].minor,t;return t={not:!1,op:_1(n,o1),span:s},t}case 229:{let n=e[1].minor,t;return t={not:!0,op:_1(n,o1),span:s},t}case 230:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=U1(n,t.not,t.op,i,void 0,s),a}case 231:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a=e[4].minor,c;return c=U1(n,t.not,t.op,i,a,s),c}case 232:{let n=e[0].minor,t=e[1].minor,i;return i=bn(n,t.type,o1,s),i}case 233:{let n=e[0].minor,t;return t={type:\"NotNullExpr\",expr:n,span:s},t}case 234:{let n=e[0].minor,t=e[2].minor,i;return i=J(n,\"Is\",t,s),i}case 235:{let n=e[0].minor,t=e[3].minor,i;return i=J(n,\"IsNot\",t,s),i}case 236:{let n=e[0].minor,t=e[5].minor,i;return i=J(n,\"Is\",t,s),i}case 237:{let n=e[0].minor,t=e[4].minor,i;return i=J(n,\"IsNot\",t,s),i}case 238:case 239:case 240:{let n=e[0].minor,t=e[1].minor,i;return i=s1(Tn(n.type,o1),t,s),i}case 241:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=J(n,In(t),i,s),a}case 242:{let n;return n=!1,n}case 243:{let n;return n=!0,n}case 244:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a=e[4].minor,c;return c=Rn(n,t,i,a,s),c}case 245:{let n;return n=!1,n}case 246:{let n;return n=!0,n}case 247:{let n=e[0].minor,t=e[1].minor,i=e[3].minor,a;return a=kn(n,t,i,s),a}case 248:{let n=e[1].minor,t;return t=On(n,s),t}case 249:{let n=e[0].minor,t=e[1].minor,i=e[3].minor,a;return a=hn(n,t,i,s),a}case 250:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a=e[3].minor,c;return c=gn(n,t,i,a,s),c}case 251:{let n=e[2].minor,t;return t=xn(n,s),t}case 252:{let n=e[1].minor,t=e[2].minor,i=e[3].minor,a;return a={type:\"CaseExpr\",base:n,whenThenPairs:t,elseExpr:i,span:s},a}case 253:{let n=e[2].minor,t=e[4].minor,i=e[0].minor;return i.push({type:\"WhenThen\",when:n,then:t,span:s}),i}case 254:{let n=e[1].minor,t=e[3].minor,i;return i=[{type:\"WhenThen\",when:n,then:t,span:s}],i}case 255:{let n=e[1].minor,t;return t=n,t}case 256:{let n;return n=void 0,n}case 257:{let n=e[0].minor,t;return t=n,t}case 258:{let n;return n=void 0,n}case 259:{let n=e[0].minor,t;return t=n,t}case 260:{let n;return n=void 0,n}case 261:{let n=e[2].minor,t=e[0].minor;return t.push(n),t}case 262:{let n=e[0].minor,t;return t=[n],t}case 263:{let n;return n=void 0,n}case 264:{let n=e[1].minor,t;return t=n,t}case 265:{let n=e[1].minor,t=e[3].minor,i=e[4].minor,a=e[6].minor,c=e[8].minor,A=e[10].minor;r.stmt={type:\"CreateIndexStmt\",unique:n,ifNotExists:t,idxName:i,tblName:a,columns:c,whereClause:A,span:s};return}case 266:{let n;return n=!0,n}case 267:{let n;return n=!1,n}case 268:{let n;return n=void 0,n}case 269:{let n=e[1].minor,t;return t=n,t}case 270:{let n=e[2].minor,t=e[3].minor,i=e[4].minor,a=e[0].minor;return a.push({type:\"IndexedColumn\",colName:n,collationName:t,order:i,span:s}),a}case 271:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a=[{type:\"IndexedColumn\",colName:n,collationName:t,order:i,span:s}],a}case 272:{let n;return n=void 0,n}case 273:{let n=e[1].minor,t;return t=c1(n),t}case 274:{let n=e[2].minor,t=e[3].minor;r.stmt={type:\"DropIndexStmt\",ifExists:n,idxName:t,span:s};return}case 275:{let n=e[1].minor;r.stmt={type:\"VacuumStmt\",dbName:void 0,into:n,span:s};return}case 276:{let n=e[1].minor,t=e[2].minor;r.stmt={type:\"VacuumStmt\",dbName:n,into:t,span:s};return}case 277:{let n=e[1].minor,t;return t=n,t}case 278:{let n;return n=void 0,n}case 279:{let n=e[1].minor;r.stmt={type:\"PragmaStmt\",name:n,body:void 0,span:s};return}case 280:{let n=e[1].minor,t=e[3].minor;r.stmt={type:\"PragmaStmt\",name:n,body:{type:\"EqualsPragmaBody\",value:t,span:s},span:s};return}case 281:{let n=e[1].minor,t=e[3].minor;r.stmt={type:\"PragmaStmt\",name:n,body:{type:\"CallPragmaBody\",value:t,span:s},span:s};return}case 282:{let n=e[1].minor,t=e[3].minor;r.stmt={type:\"PragmaStmt\",name:n,body:{type:\"EqualsPragmaBody\",value:t,span:s},span:s};return}case 283:{let n=e[1].minor,t=e[3].minor;r.stmt={type:\"PragmaStmt\",name:n,body:{type:\"CallPragmaBody\",value:t,span:s},span:s};return}case 284:{let n=e[0].minor,t;return t={type:\"NameExpr\",name:n,span:s},t}case 285:case 286:case 287:{let n=e[0].minor,t;return t=Nn(n),t}case 288:{let n=e[1].minor,t;return t=s1(\"Positive\",m1(n),s),t}case 289:{let n=e[0].minor,t;return t=m1(n),t}case 290:{let n=e[1].minor,t;return t=s1(\"Negative\",m1(n),s),t}case 291:{let n=e[1].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor,c=e[6].minor,A=e[8].minor,I=e[9].minor,T=e[10].minor,C=e[12].minor;r.stmt={type:\"CreateTriggerStmt\",temporary:n,ifNotExists:t,triggerName:i,time:a,event:c,tblName:A,forEachRow:I,whenClause:T,commands:C,span:s};return}case 292:{let n;return n=\"Before\",n}case 293:{let n;return n=\"After\",n}case 294:{let n;return n=\"InsteadOf\",n}case 295:{let n;return n=void 0,n}case 296:{let n;return n={type:\"DeleteTriggerEvent\",span:s},n}case 297:{let n;return n={type:\"InsertTriggerEvent\",span:s},n}case 298:{let n;return n={type:\"UpdateTriggerEvent\",span:s},n}case 299:{let n=e[2].minor,t;return t={type:\"UpdateOfTriggerEvent\",columns:n,span:s},t}case 300:{let n;return n=!1,n}case 301:{let n;return n=!0,n}case 302:{let n;return n=void 0,n}case 303:{let n=e[1].minor,t;return t=n,t}case 304:{let n=e[1].minor,t=e[0].minor;return t.push(n),t}case 305:{let n=e[0].minor,t;return t=[n],t}case 306:{r.errors.push(G(\"the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\",s));return}case 307:{r.errors.push(G(\"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\",s));return}case 308:{let n=e[1].minor,t=e[2].minor,i=e[5].minor,a=e[6].minor,c=e[7].minor,A;return A={type:\"UpdateTriggerCmd\",orConflict:n,tblName:t,sets:i,from:a,whereClause:c,span:s},A}case 309:{let n=e[0].minor,t=e[2].minor,i=e[3].minor,a=e[4].minor,c=e[5].minor,A;return c.returning&&r.errors.push(G(\"cannot use RETURNING in a trigger\",c.returningSpan??s)),A={type:\"InsertTriggerCmd\",orConflict:n,tblName:t,colNames:i,select:a,upsert:c.upsert,span:s},A}case 310:{let n=e[2].minor,t=e[4].minor,i;return i={type:\"DeleteTriggerCmd\",tblName:n,whereClause:t,span:s},i}case 311:{let n=e[0].minor,t;return t={type:\"SelectTriggerCmd\",select:n,span:s},t}case 312:{let n;return n={type:\"RaiseExpr\",resolve:\"Ignore\",message:void 0,span:s},n}case 313:{let n=e[2].minor,t=e[4].minor,i;return i={type:\"RaiseExpr\",resolve:n,message:t,span:s},i}case 314:{let n;return n=\"Rollback\",n}case 315:{let n;return n=\"Abort\",n}case 316:{let n;return n=\"Fail\",n}case 317:{let n=e[2].minor,t=e[3].minor;r.stmt={type:\"DropTriggerStmt\",ifExists:n,triggerName:t,span:s};return}case 318:{let n=e[2].minor,t=e[4].minor,i=e[5].minor;r.stmt={type:\"AttachStmt\",expr:n,dbName:t,key:i,span:s};return}case 319:{let n=e[2].minor;r.stmt={type:\"DetachStmt\",expr:n,span:s};return}case 320:{let n;return n=void 0,n}case 321:{let n=e[1].minor,t;return t=n,t}case 322:{r.stmt={type:\"ReindexStmt\",objName:void 0,span:s};return}case 323:{let n=e[1].minor;r.stmt={type:\"ReindexStmt\",objName:n,span:s};return}case 324:{r.stmt={type:\"AnalyzeStmt\",objName:void 0,span:s};return}case 325:{let n=e[1].minor;r.stmt={type:\"AnalyzeStmt\",objName:n,span:s};return}case 326:{let n=e[2].minor,t=e[5].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"RenameToAlterTableBody\",name:t,span:s},span:s};return}case 327:{let n=e[2].minor,t=e[5].minor,i=e[6].minor,a=e[7].minor,c=I1(t,i,a,s);r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"AddColumnAlterTableBody\",column:c,span:s},span:s};return}case 328:{let n=e[2].minor,t=e[5].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"DropColumnAlterTableBody\",column:t,span:s},span:s};return}case 329:{let n=e[2].minor,t=e[5].minor,i=e[7].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"RenameColumnAlterTableBody\",old:t,new:i,span:s},span:s};return}case 330:{let n=e[2].minor,t=e[5].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"DropConstraintAlterTableBody\",name:t,span:s},span:s};return}case 331:{let n=e[2].minor,t=e[5].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"DropColumnNotNullAlterTableBody\",column:t,span:s},span:s};return}case 332:{let n=e[2].minor,t=e[5].minor,i=e[9].minor;r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"SetColumnNotNullAlterTableBody\",column:t,onConflict:i,span:s},span:s};return}case 333:{let n=e[2].minor,t=e[5].minor,i=e[8].minor,a=e[10].minor,c={type:\"CheckTableConstraint\",expr:i,conflictClause:a,span:s};r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"AddConstraintAlterTableBody\",constraint:{type:\"NamedTableConstraint\",name:t,constraint:c,span:s},span:s},span:s};return}case 334:{let n=e[2].minor,t=e[6].minor,i=e[8].minor,a={type:\"CheckTableConstraint\",expr:t,conflictClause:i,span:s};r.stmt={type:\"AlterTableStmt\",tblName:n,body:{type:\"AddConstraintAlterTableBody\",constraint:{type:\"NamedTableConstraint\",name:void 0,constraint:a,span:s},span:s},span:s};return}case 335:{let n=e[0].minor;r.stmt=n;return}case 336:{let n=e[0].minor;r.vtabArgCurrent.length>0&&(r.vtabArgs.push(r.vtabArgCurrent),r.vtabArgCurrent=\"\"),n.type===\"CreateVirtualTableStmt\"?r.stmt={...n,args:r.vtabArgs.slice(),span:s}:r.stmt=n,r.vtabArgs=[];return}case 337:{let n=e[3].minor,t=e[4].minor,i=e[6].minor,a;return a={type:\"CreateVirtualTableStmt\",ifNotExists:n,tblName:t,moduleName:i,args:void 0,span:s},a}case 338:{r.vtabArgCurrent.length>0&&r.vtabArgs.push(r.vtabArgCurrent),r.vtabArgCurrent=\"\";return}case 339:{let n=e[0].minor;r.vtabArgCurrent+=n.text;return}case 340:{let n=e[2].minor;r.vtabArgCurrent+=n.text;return}case 341:{let n=e[0].minor;r.vtabArgCurrent+=n.text;return}case 342:{let n;return n=void 0,n}case 343:{let n=e[1].minor,t;return t={type:\"With\",recursive:!1,ctes:n,span:s},t}case 344:{let n=e[2].minor,t;return t={type:\"With\",recursive:!0,ctes:n,span:s},t}case 345:{let n;return n=\"Any\",n}case 346:{let n;return n=\"Yes\",n}case 347:{let n;return n=\"No\",n}case 348:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a=e[4].minor,c;return c={type:\"CommonTableExpr\",tblName:n,columns:t,materialized:i,select:a,span:s},c}case 349:{let n=e[0].minor,t;return t=[n],t}case 350:{let n=e[2].minor,t=e[0].minor;return wn(r,t,n),t}case 351:{let n=e[0].minor,t;return t=[n],t}case 352:{let n=e[2].minor,t=e[0].minor;return t.push(n),t}case 353:{let n=e[0].minor,t=e[3].minor,i;return i={type:\"WindowDef\",name:n,window:t,span:s},i}case 354:{let n=e[2].minor,t=e[3].minor,i=e[4].minor,a;return a={type:\"Window\",base:void 0,partitionBy:n,orderBy:t,frameClause:i,span:s},a}case 355:{let n=e[0].minor,t=e[3].minor,i=e[4].minor,a=e[5].minor,c;return c={type:\"Window\",base:n,partitionBy:t,orderBy:i,frameClause:a,span:s},c}case 356:{let n=e[2].minor,t=e[3].minor,i;return i={type:\"Window\",base:void 0,partitionBy:void 0,orderBy:n,frameClause:t,span:s},i}case 357:{let n=e[0].minor,t=e[3].minor,i=e[4].minor,a;return a={type:\"Window\",base:n,partitionBy:void 0,orderBy:t,frameClause:i,span:s},a}case 358:{let n=e[0].minor,t;return t={type:\"Window\",base:void 0,partitionBy:void 0,orderBy:void 0,frameClause:n,span:s},t}case 359:{let n=e[0].minor,t=e[1].minor,i;return i={type:\"Window\",base:n,partitionBy:void 0,orderBy:void 0,frameClause:t,span:s},i}case 360:{let n;return n=void 0,n}case 361:{let n=e[0].minor,t=e[1].minor,i=e[2].minor,a;return a={type:\"FrameClause\",mode:n,start:t,end:void 0,exclude:i,span:s},a}case 362:{let n=e[0].minor,t=e[2].minor,i=e[4].minor,a=e[5].minor,c;return c={type:\"FrameClause\",mode:n,start:t,end:i,exclude:a,span:s},c}case 363:{let n;return n=\"Range\",n}case 364:{let n;return n=\"Rows\",n}case 365:{let n;return n=\"Groups\",n}case 366:{let n=e[0].minor,t;return t=n,t}case 367:{let n;return n={type:\"UnboundedPrecedingFrameBound\",span:s},n}case 368:{let n=e[0].minor,t;return t=n,t}case 369:{let n;return n={type:\"UnboundedFollowingFrameBound\",span:s},n}case 370:{let n=e[0].minor,t;return t={type:\"PrecedingFrameBound\",expr:n,span:s},t}case 371:{let n;return n={type:\"CurrentRowFrameBound\",span:s},n}case 372:{let n=e[0].minor,t;return t={type:\"FollowingFrameBound\",expr:n,span:s},t}case 373:{let n;return n=void 0,n}case 374:{let n=e[1].minor,t;return t=n,t}case 375:{let n;return n=\"NoOthers\",n}case 376:{let n;return n=\"CurrentRow\",n}case 377:{let n;return n=\"Group\",n}case 378:{let n;return n=\"Ties\",n}case 379:{let n=e[1].minor,t;return t=n,t}case 380:{let n=e[0].minor,t=e[1].minor,i;return i={type:\"FunctionTail\",filterClause:n,overClause:t,span:s},i}case 381:{let n=e[0].minor,t;return t={type:\"FunctionTail\",filterClause:void 0,overClause:n,span:s},t}case 382:{let n=e[0].minor,t;return t={type:\"FunctionTail\",filterClause:n,overClause:void 0,span:s},t}case 383:{let n=e[2].minor,t;return t={type:\"WindowOver\",window:n,span:s},t}case 384:{let n=e[1].minor,t;return t={type:\"NameOver\",name:n,span:s},t}case 385:{let n=e[3].minor,t;return t=n,t}case 386:{let n=e[0].minor,t,i=an(n.text,{digitSeparator:r.digitSeparator});return i.error&&r.errors.push(G(i.error,n.span,{message:\"digit separators must sit between two digits (e.g. 1_000, 0xDE_AD)\",span:void 0})),t={type:\"NumericLiteral\",value:i.text,span:n.span},t}case 387:case 388:case 389:case 390:case 391:return e[0].minor;case 392:return;case 393:return e[0].minor;case 394:return e[0].minor;case 395:case 396:return e[0].minor;case 397:return;case 398:return e[0].minor;case 399:return e[0].minor;case 400:case 401:return e[0].minor;case 402:return;case 403:return e[0].minor;case 404:case 405:return;case 406:case 407:case 408:case 409:return e[0].minor;case 410:return;case 411:case 412:return e[0].minor;default:return}},We=Bn;var Gn={meta:{maskFlags:{ALTER:1,ALWAYS:2,ANALYZE:4,ATTACH:8,AUTOINCR:16,CAST:32,COMPOUND:64,CONFLICT:128,EXPLAIN:256,FKEY:512,PRAGMA:1024,REINDEX:2048,SUBQUERY:4096,TRIGGER:8192,VACUUM:16384,VIEW:32768,VTAB:65536,AUTOVACUUM:131072,CTE:262144,UPSERT:524288,WINDOWFUNC:1048576,GENCOL:2097152,RETURNING:4194304,ORDERSET:8388608}},keywords:[{name:\"ABORT\",token:\"ABORT\",mask:8320},{name:\"ACTION\",token:\"ACTION\",mask:512},{name:\"ADD\",token:\"ADD\",mask:1},{name:\"AFTER\",token:\"AFTER\",mask:8192},{name:\"ALL\",token:\"ALL\",mask:2},{name:\"ALTER\",token:\"ALTER\",mask:1},{name:\"ALWAYS\",token:\"ALWAYS\",mask:2097152},{name:\"ANALYZE\",token:\"ANALYZE\",mask:4},{name:\"AND\",token:\"AND\",mask:2},{name:\"AS\",token:\"AS\",mask:2},{name:\"ASC\",token:\"ASC\",mask:2},{name:\"ATTACH\",token:\"ATTACH\",mask:8},{name:\"AUTOINCREMENT\",token:\"AUTOINCR\",mask:16},{name:\"BEFORE\",token:\"BEFORE\",mask:8192},{name:\"BEGIN\",token:\"BEGIN\",mask:2},{name:\"BETWEEN\",token:\"BETWEEN\",mask:2},{name:\"BY\",token:\"BY\",mask:2},{name:\"CASCADE\",token:\"CASCADE\",mask:512},{name:\"CASE\",token:\"CASE\",mask:2},{name:\"CAST\",token:\"CAST\",mask:32},{name:\"CHECK\",token:\"CHECK\",mask:2},{name:\"COLLATE\",token:\"COLLATE\",mask:2},{name:\"COLUMN\",token:\"COLUMNKW\",mask:1},{name:\"COMMIT\",token:\"COMMIT\",mask:2},{name:\"CONFLICT\",token:\"CONFLICT\",mask:128},{name:\"CONSTRAINT\",token:\"CONSTRAINT\",mask:2},{name:\"CREATE\",token:\"CREATE\",mask:2},{name:\"CROSS\",token:\"JOIN_KW\",mask:2},{name:\"CURRENT\",token:\"CURRENT\",mask:1048576},{name:\"CURRENT_DATE\",token:\"CTIME_KW\",mask:2},{name:\"CURRENT_TIME\",token:\"CTIME_KW\",mask:2},{name:\"CURRENT_TIMESTAMP\",token:\"CTIME_KW\",mask:2},{name:\"DATABASE\",token:\"DATABASE\",mask:8},{name:\"DEFAULT\",token:\"DEFAULT\",mask:2},{name:\"DEFERRED\",token:\"DEFERRED\",mask:2},{name:\"DEFERRABLE\",token:\"DEFERRABLE\",mask:512},{name:\"DELETE\",token:\"DELETE\",mask:2},{name:\"DESC\",token:\"DESC\",mask:2},{name:\"DETACH\",token:\"DETACH\",mask:8},{name:\"DISTINCT\",token:\"DISTINCT\",mask:2},{name:\"DO\",token:\"DO\",mask:524288},{name:\"DROP\",token:\"DROP\",mask:2},{name:\"END\",token:\"END\",mask:2},{name:\"EACH\",token:\"EACH\",mask:8192},{name:\"ELSE\",token:\"ELSE\",mask:2},{name:\"ESCAPE\",token:\"ESCAPE\",mask:2},{name:\"EXCEPT\",token:\"EXCEPT\",mask:64},{name:\"EXCLUSIVE\",token:\"EXCLUSIVE\",mask:2},{name:\"EXCLUDE\",token:\"EXCLUDE\",mask:1048576},{name:\"EXISTS\",token:\"EXISTS\",mask:2},{name:\"EXPLAIN\",token:\"EXPLAIN\",mask:256},{name:\"FAIL\",token:\"FAIL\",mask:8320},{name:\"FILTER\",token:\"FILTER\",mask:1048576},{name:\"FIRST\",token:\"FIRST\",mask:2},{name:\"FOLLOWING\",token:\"FOLLOWING\",mask:1048576},{name:\"FOR\",token:\"FOR\",mask:8192},{name:\"FOREIGN\",token:\"FOREIGN\",mask:512},{name:\"FROM\",token:\"FROM\",mask:2},{name:\"FULL\",token:\"JOIN_KW\",mask:2},{name:\"GENERATED\",token:\"GENERATED\",mask:2},{name:\"GLOB\",token:\"LIKE_KW\",mask:2},{name:\"GROUP\",token:\"GROUP\",mask:2},{name:\"GROUPS\",token:\"GROUPS\",mask:1048576},{name:\"HAVING\",token:\"HAVING\",mask:2},{name:\"IF\",token:\"IF\",mask:2},{name:\"IGNORE\",token:\"IGNORE\",mask:8320},{name:\"IMMEDIATE\",token:\"IMMEDIATE\",mask:2},{name:\"IN\",token:\"IN\",mask:2},{name:\"INDEX\",token:\"INDEX\",mask:2},{name:\"INDEXED\",token:\"INDEXED\",mask:2},{name:\"INITIALLY\",token:\"INITIALLY\",mask:512},{name:\"INNER\",token:\"JOIN_KW\",mask:2},{name:\"INSERT\",token:\"INSERT\",mask:2},{name:\"INSTEAD\",token:\"INSTEAD\",mask:8192},{name:\"INTERSECT\",token:\"INTERSECT\",mask:64},{name:\"INTO\",token:\"INTO\",mask:2},{name:\"IS\",token:\"IS\",mask:2},{name:\"ISNULL\",token:\"ISNULL\",mask:2},{name:\"JOIN\",token:\"JOIN\",mask:2},{name:\"KEY\",token:\"KEY\",mask:2},{name:\"LAST\",token:\"LAST\",mask:2},{name:\"LEFT\",token:\"JOIN_KW\",mask:2},{name:\"LIKE\",token:\"LIKE_KW\",mask:2},{name:\"LIMIT\",token:\"LIMIT\",mask:2},{name:\"MATCH\",token:\"MATCH\",mask:2},{name:\"MATERIALIZED\",token:\"MATERIALIZED\",mask:262144},{name:\"NATURAL\",token:\"JOIN_KW\",mask:2},{name:\"NO\",token:\"NO\",mask:1049088},{name:\"NOT\",token:\"NOT\",mask:2},{name:\"NOTHING\",token:\"NOTHING\",mask:524288},{name:\"NOTNULL\",token:\"NOTNULL\",mask:2},{name:\"NULL\",token:\"NULL\",mask:2},{name:\"NULLS\",token:\"NULLS\",mask:2},{name:\"OF\",token:\"OF\",mask:2},{name:\"OFFSET\",token:\"OFFSET\",mask:2},{name:\"ON\",token:\"ON\",mask:2},{name:\"OR\",token:\"OR\",mask:2},{name:\"ORDER\",token:\"ORDER\",mask:2},{name:\"OTHERS\",token:\"OTHERS\",mask:1048576},{name:\"OUTER\",token:\"JOIN_KW\",mask:2},{name:\"OVER\",token:\"OVER\",mask:1048576},{name:\"PARTITION\",token:\"PARTITION\",mask:1048576},{name:\"PLAN\",token:\"PLAN\",mask:256},{name:\"PRAGMA\",token:\"PRAGMA\",mask:1024},{name:\"PRECEDING\",token:\"PRECEDING\",mask:1048576},{name:\"PRIMARY\",token:\"PRIMARY\",mask:2},{name:\"QUERY\",token:\"QUERY\",mask:256},{name:\"RAISE\",token:\"RAISE\",mask:8192},{name:\"RANGE\",token:\"RANGE\",mask:1048576},{name:\"RECURSIVE\",token:\"RECURSIVE\",mask:262144},{name:\"REFERENCES\",token:\"REFERENCES\",mask:512},{name:\"REGEXP\",token:\"LIKE_KW\",mask:2},{name:\"REINDEX\",token:\"REINDEX\",mask:2048},{name:\"RELEASE\",token:\"RELEASE\",mask:2},{name:\"RENAME\",token:\"RENAME\",mask:1},{name:\"REPLACE\",token:\"REPLACE\",mask:128},{name:\"RESTRICT\",token:\"RESTRICT\",mask:512},{name:\"RETURNING\",token:\"RETURNING\",mask:4194304},{name:\"RIGHT\",token:\"JOIN_KW\",mask:2},{name:\"ROLLBACK\",token:\"ROLLBACK\",mask:2},{name:\"ROW\",token:\"ROW\",mask:8192},{name:\"ROWS\",token:\"ROWS\",mask:2},{name:\"SAVEPOINT\",token:\"SAVEPOINT\",mask:2},{name:\"SELECT\",token:\"SELECT\",mask:2},{name:\"SET\",token:\"SET\",mask:2},{name:\"TABLE\",token:\"TABLE\",mask:2},{name:\"TEMP\",token:\"TEMP\",mask:2},{name:\"TEMPORARY\",token:\"TEMP\",mask:2},{name:\"THEN\",token:\"THEN\",mask:2},{name:\"TIES\",token:\"TIES\",mask:1048576},{name:\"TO\",token:\"TO\",mask:2},{name:\"TRANSACTION\",token:\"TRANSACTION\",mask:2},{name:\"TRIGGER\",token:\"TRIGGER\",mask:8192},{name:\"UNBOUNDED\",token:\"UNBOUNDED\",mask:1048576},{name:\"UNION\",token:\"UNION\",mask:64},{name:\"UNIQUE\",token:\"UNIQUE\",mask:2},{name:\"UPDATE\",token:\"UPDATE\",mask:2},{name:\"USING\",token:\"USING\",mask:2},{name:\"VACUUM\",token:\"VACUUM\",mask:16384},{name:\"VALUES\",token:\"VALUES\",mask:2},{name:\"VIEW\",token:\"VIEW\",mask:32768},{name:\"VIRTUAL\",token:\"VIRTUAL\",mask:65536},{name:\"WHEN\",token:\"WHEN\",mask:2},{name:\"WHERE\",token:\"WHERE\",mask:2},{name:\"WINDOW\",token:\"WINDOW\",mask:1048576},{name:\"WITH\",token:\"WITH\",mask:262144},{name:\"WITHIN\",token:\"WITHIN\",mask:8388608},{name:\"WITHOUT\",token:\"WITHOUT\",mask:2}]};var P=G1(W1,Gn,{}),Rt=P.parse,kt=P.parseOrThrow,Wn=P.parseStmt,ht=P.parseStmtOrThrow,gt=P.tokenize,Ot=P.tokenName,xt=P.createEngine,bt=P.withOptions,St=P.reduce,_t=P.createState,Dt=P.parserDefs,Ut=P.keywordDefs;if(ve||p===null)throw new Error(\"SQLite runtime must execute inside its owned Worker\");var _=null,y1=null,H1=!1,Hn=!1;function b(r,o,e,s=!1){let m=new Error(r);return m.code=o,m.operation=e,m.retryable=s,m}function vn(r,o){let e=r instanceof Error?r.message:String(r),s=r&&typeof r==\"object\"?r.errstr??r.code??null:null,m=s==null?null:String(s),n=m==null?\"\":m.toUpperCase();return{message:e,sqliteCode:m,operation:r&&typeof r.operation==\"string\"?r.operation:o,retryable:r&&r.retryable===!0||n.includes(\"BUSY\")||n.includes(\"LOCKED\")}}function Ke(r,o){if(r===null)return null;if(typeof r==\"boolean\")return r?1:0;if(typeof r==\"string\")return o.value+=d1.byteLength(r,\"utf8\"),r;if(typeof r==\"number\"){if(!Number.isFinite(r))throw b(\"SQLite number parameters must be finite\",\"SQLITE_INPUT\",\"params\");if(Number.isInteger(r)&&!Number.isSafeInteger(r))throw b(\"SQLite integer parameters must be safe integers\",\"SQLITE_INPUT\",\"params\");return o.value+=8,r}if(r instanceof Uint8Array)return o.value+=r.byteLength,r;throw b(\"SQLite parameters support only null, bool, string, finite number, and Bytes\",\"SQLITE_INPUT\",\"params\")}function Qe(r){if(!Array.isArray(r)||r.length>999)throw b(\"SQLite parameters must be a List with at most 999 values\",\"SQLITE_INPUT\",\"params\");let o={value:0},e=r.map(s=>Ke(s,o));if(o.value>W.maxResultBytes)throw b(\"SQLite parameters exceed the connection byte limit\",\"SQLITE_INPUT\",\"params\");return e}function v1(r,o,e){if(!Array.isArray(r)||r.length!==o.length+1||r.length>1e3)throw b(\"SQLite statements require exactly one more SQL fragment than bound parameters\",\"SQLITE_INPUT\",e);let s=0,m=r.map(a=>{if(typeof a!=\"string\"||a.includes(\"\\\\0\")||a.includes(\"?\"))throw b(\"SQLite SQL fragments must be text without NUL or raw parameter placeholders\",\"SQLITE_INPUT\",e);return s+=d1.byteLength(a,\"utf8\"),a});if(s===0||s>1024*1024)throw b(\"SQLite SQL must be non-empty text no longer than 1 MiB\",\"SQLITE_INPUT\",e);let n=Qe(o),t=m.join(\"?\"),i=Wn(t);if(i.status!==\"ok\"){let a=i.errors.length===0?\"invalid statement\":i.errors[0].message;throw b(\"SQLite requires exactly one valid statement: \"+a,\"SQLITE_INPUT\",e)}return{fragments:m,bound:n}}function Ve(r,o){let e=typeof r==\"bigint\"?Number(r):r;if(!Number.isSafeInteger(e)||e<0)throw b(o+\" is outside VelarScript's safe integer range\",\"SQLITE_INTEGER_RANGE\",\"result\");return e}function Ze(r,o,e){if(r===null)return null;if(typeof r==\"string\")return o.value+=d1.byteLength(r,\"utf8\"),r;if(typeof r==\"number\"){if(!Number.isFinite(r))throw b(\"SQLite returned a non-finite number in \"+e,\"SQLITE_RESULT\",\"result\");return o.value+=8,r}if(typeof r==\"bigint\"){let s=Number(r);if(!Number.isSafeInteger(s))throw b(\"SQLite returned an integer outside VelarScript's safe range in \"+e,\"SQLITE_INTEGER_RANGE\",\"result\");return o.value+=8,s}if(r instanceof Uint8Array)return o.value+=r.byteLength,r;throw b(\"SQLite returned an unsupported value in \"+e,\"SQLITE_RESULT\",\"result\")}function Kn(r,o){if(r===null||typeof r!=\"object\"||Array.isArray(r))throw b(\"SQLite returned a non-record row\",\"SQLITE_RESULT\",\"result\");let e=Object.create(null);for(let s of Object.keys(r))if(o.value+=d1.byteLength(s,\"utf8\"),e[s]=Ze(r[s],o,s),o.value>W.maxResultBytes)throw b(\"SQLite result exceeds the connection byte limit\",\"SQLITE_RESULT_LIMIT\",\"result\");return e}function \\u{24}e(r){let o=v1(r.fragments,r.params,\"execute\"),e=y1.run(o.fragments,...o.bound);return Ve(e.changes,\"SQLite affected row count\")}function qe(r){let o=v1(r.fragments,r.params,\"one\"),e=y1.get(o.fragments,...o.bound);return e===void 0?null:Kn(e,{value:0})}function je(r){let o=v1(r.fragments,r.params,\"all\"),e=[],s={value:0};for(let m of y1.iterate(o.fragments,...o.bound)){if(e.length>=W.maxRows)throw b(\"SQLite result exceeds the connection row limit\",\"SQLITE_ROW_LIMIT\",\"all\");e.push(Kn(m,s))}return e}function Je(r){if(H1)throw b(\"SQLite connection is closed\",\"SQLITE_CLOSED\",r.operation);if(r.operation===\"execute\")return \\u{24}e(r);if(r.operation===\"one\")return qe(r);if(r.operation===\"all\")return je(r);if(r.operation===\"begin\"){if(_.isTransaction)throw b(\"SQLite transaction is already active\",\"SQLITE_TRANSACTION\",\"begin\",!0);return _.exec(\"BEGIN IMMEDIATE\"),null}if(r.operation===\"commit\"){if(!_.isTransaction)throw b(\"SQLite transaction is not active\",\"SQLITE_TRANSACTION\",\"commit\");return _.exec(\"COMMIT\"),null}if(r.operation===\"rollback\")return _.isTransaction&&_.exec(\"ROLLBACK\"),null;if(r.operation===\"close\"){let o=null;try{_.isTransaction&&_.exec(\"ROLLBACK\")}catch(e){o=e}try{_.close()}catch(e){o===null&&(o=e)}if(H1=!0,o!==null)throw o;return null}throw b(\"Unknown SQLite operation\",\"SQLITE_PROTOCOL\",String(r.operation))}try{_=new He(W.path,{timeout:W.busyTimeoutMilliseconds,readOnly:W.readOnly,enableForeignKeyConstraints:!0,enableDoubleQuotedStringLiterals:!1,allowExtension:!1,readBigInts:!0,allowBareNamedParameters:!1,allowUnknownNamedParameters:!1,defensive:!0,limits:{length:W.maxResultBytes,sqlLength:1024*1024,column:2e3,exprDepth:1e3,compoundSelect:500,vdbeOp:25e4,functionArg:1e3,attach:0,likePatternLength:5e4,variableNumber:999,triggerDepth:100}}),_.enableDefensive(!0),_.enableLoadExtension(!1),_.setAuthorizer((r,o,e)=>r===i1.SQLITE_ATTACH||r===i1.SQLITE_DETACH?i1.SQLITE_DENY:r===i1.SQLITE_FUNCTION&&typeof e==\"string\"&&e.toLowerCase()===\"load_extension\"?i1.SQLITE_DENY:i1.SQLITE_OK),y1=_.createTagStore(W.statementCacheCapacity),W.journalMode!==null&&_.exec(\"PRAGMA journal_mode = \"+W.journalMode.toUpperCase()),Hn=!0,p.postMessage({kind:\"ready\"})}catch(r){let o=vn(r,\"open\");try{_?.isTransaction===!0&&_.exec(\"ROLLBACK\")}catch{}try{_?.close()}catch{}H1=!0;try{p.postMessage({kind:\"ready\",error:o})}finally{p.close()}}Hn&&p.on(\"message\",r=>{let o;try{let e=Je(r);o={kind:\"response\",id:r.id,value:e}}catch(e){o={kind:\"response\",id:r.id,error:vn(e,r.operation)}}try{p.postMessage(o)}finally{r.operation===\"close\"&&p.close()}});\\n`\n","/// Per-connection bounds. Every operation is serialized through one Worker;\n/// queueCapacity bounds admitted operations waiting for that connection.\nimport {DatabaseExecutor, DatabaseStatement, trustedSql} from \"@velarscript-labs/database\"\nimport {sqliteWorkerSource, sqliteWorkerSourceFormatVersion} from \"./generated/worker-source.vel\"\n\nassert sqliteWorkerSourceFormatVersion == 1 else \"SQLite Worker source module has an unsupported format\"\n\nexport enum SqliteJournalMode:\n delete\n truncate\n persist\n memory\n wal\n off\n\nexport type SqliteOptions:\n busyTimeoutMilliseconds: number?\n queueCapacity: number?\n maxRows: number?\n maxResultBytes: number?\n statementCacheCapacity: number?\n journalMode: SqliteJournalMode?\n readOnly: bool?\n\nextern js`\n import { AsyncLocalStorage } from \"node:async_hooks\";\n import { Worker } from \"node:worker_threads\";\n\n const TOKEN = Object.freeze({});\n const connectionStates = new WeakMap();\n const transactionStates = new WeakMap();\n const transactionContext = new AsyncLocalStorage();\n\n export class NativeSqliteError extends Error {\n constructor(message = \"SQLite operation failed\", sqliteCode = null, operation = \"unknown\", retryable = false) {\n super(message);\n this.name = \"NativeSqliteError\";\n this.sqliteCode = sqliteCode;\n this.operation = operation;\n this.retryable = retryable;\n }\n }\n\n export class NativeSqliteBackpressureError extends NativeSqliteError {\n constructor(message = \"SQLite queue is full\") {\n super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true);\n this.name = \"NativeSqliteBackpressureError\";\n }\n }\n\n export class NativeSqliteConcurrencyError extends NativeSqliteError {\n constructor(message = \"SQLite connection cannot be used from its transaction callback\") {\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true);\n this.name = \"NativeSqliteConcurrencyError\";\n }\n }\n\n function integer(value, fallback, minimum, maximum, label) {\n const selected = value == null ? fallback : value;\n if (!Number.isSafeInteger(selected) || selected < minimum || selected > maximum) {\n throw new TypeError(label + \" must be an integer from \" + minimum + \" through \" + maximum);\n }\n return selected;\n }\n\n function checkedOptions(value) {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) throw new TypeError(\"SQLite options must be a record\");\n const allowed = new Set([\"busyTimeoutMilliseconds\", \"queueCapacity\", \"maxRows\", \"maxResultBytes\", \"statementCacheCapacity\", \"journalMode\", \"readOnly\"]);\n for (const key of Object.keys(value)) if (!allowed.has(key)) throw new TypeError(\"Unknown SQLite option \" + key);\n const journalModes = new Set([\"delete\", \"truncate\", \"persist\", \"memory\", \"wal\", \"off\"]);\n const journalMode = value.journalMode == null ? null : value.journalMode;\n if (journalMode !== null && (typeof journalMode !== \"string\" || !journalModes.has(journalMode))) throw new TypeError(\"SQLite journalMode must name a supported mode\");\n if (value.readOnly != null && typeof value.readOnly !== \"boolean\") throw new TypeError(\"SQLite readOnly must be bool\");\n if (value.readOnly === true && journalMode !== null) throw new TypeError(\"SQLite readOnly connections cannot change journalMode\");\n return {\n busyTimeoutMilliseconds: integer(value.busyTimeoutMilliseconds, 2000, 1, 60000, \"SQLite busy timeout\"),\n queueCapacity: integer(value.queueCapacity, 64, 1, 1024, \"SQLite queue capacity\"),\n maxRows: integer(value.maxRows, 10000, 1, 1000000, \"SQLite row limit\"),\n maxResultBytes: integer(value.maxResultBytes, 64 * 1024 * 1024, 1, 128 * 1024 * 1024, \"SQLite result byte limit\"),\n statementCacheCapacity: integer(value.statementCacheCapacity, 128, 1, 1024, \"SQLite statement cache capacity\"),\n journalMode,\n readOnly: value.readOnly === true,\n };\n }\n\n function nativeError(value) {\n return new NativeSqliteError(value.message, value.sqliteCode, value.operation, value.retryable);\n }\n\n function failPending(state, error) {\n if (state.readyReject !== null) {\n state.readyReject(error);\n state.readyReject = null;\n state.readyResolve = null;\n }\n for (const pending of state.pending.values()) pending.reject(error);\n state.pending.clear();\n }\n\n function failWorker(state, error) {\n if (state.workerFailure !== null) return;\n state.workerFailure = error;\n state.closed = true;\n failPending(state, error);\n }\n\n function request(state, operation, fragments = [\"\"], params = []) {\n if (state.closed) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", operation));\n const id = state.nextId++;\n return new Promise((resolve, reject) => {\n state.pending.set(id, { resolve, reject, operation });\n try {\n state.worker.postMessage({ id, operation, fragments, params });\n } catch (error) {\n state.pending.delete(id);\n reject(error);\n }\n });\n }\n\n function stateOf(connection) {\n const state = connectionStates.get(connection);\n if (!state) throw new TypeError(\"Invalid SQLite connection\");\n return state;\n }\n\n function transactionStateOf(transaction) {\n const state = transactionStates.get(transaction);\n if (!state || !state.active) throw new NativeSqliteConcurrencyError(\"SQLite transaction is no longer active\");\n return state;\n }\n\n function transactionRequest(transaction, operation, fragments = [\"\"], params = []) {\n const state = transactionStateOf(transaction);\n if (state.busy) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite transaction operations must be awaited one at a time\"));\n state.busy = true;\n return request(state.connection, operation, fragments, params).finally(() => { state.busy = false; });\n }\n\n function enqueue(state, operation) {\n if (state.closed || state.closing) return Promise.reject(new NativeSqliteError(\"SQLite connection is closed\", \"SQLITE_CLOSED\", \"queue\"));\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError());\n if (state.queued >= state.queueCapacity) return Promise.reject(new NativeSqliteBackpressureError());\n state.queued += 1;\n const running = state.tail.then(operation, operation);\n state.tail = running.then(() => null, () => null);\n return running.finally(() => { state.queued -= 1; });\n }\n\n export class NativeSqliteTransaction {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"SQLite transactions are created by connection.transaction\");\n transactionStates.set(this, state);\n }\n\n execute(fragments, params = []) { return transactionRequest(this, \"execute\", fragments, params); }\n one(fragments, params = []) { return transactionRequest(this, \"one\", fragments, params); }\n all(fragments, params = []) { return transactionRequest(this, \"all\", fragments, params); }\n }\n\n export class NativeSqliteConnection {\n constructor(token, state) {\n if (token !== TOKEN) throw new TypeError(\"Use openSqlite to create a SQLite connection\");\n connectionStates.set(this, state);\n }\n\n execute(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"execute\", fragments, params));\n }\n\n one(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"one\", fragments, params));\n }\n\n all(fragments, params = []) {\n const state = stateOf(this);\n return enqueue(state, () => request(state, \"all\", fragments, params));\n }\n\n transaction(operation) {\n if (typeof operation !== \"function\") return Promise.reject(new TypeError(\"SQLite transaction requires an async operation\"));\n const state = stateOf(this);\n return enqueue(state, async () => {\n await request(state, \"begin\");\n const transactionState = { connection: state, active: true, busy: false };\n const transaction = new NativeSqliteTransaction(TOKEN, transactionState);\n try {\n await transactionContext.run(state, () => operation(transaction));\n await transactionRequest(transaction, \"commit\");\n transactionState.active = false;\n return null;\n } catch (error) {\n try {\n if (transactionState.active) await transactionRequest(transaction, \"rollback\");\n } catch {\n state.closing = true;\n state.worker.terminate();\n } finally {\n transactionState.active = false;\n }\n throw error;\n }\n });\n }\n\n close() {\n const state = stateOf(this);\n if (state.closePromise !== null) return state.closePromise;\n if (transactionContext.getStore() === state) return Promise.reject(new NativeSqliteConcurrencyError(\"SQLite connection cannot close inside its transaction callback\"));\n state.closing = true;\n state.closePromise = state.tail.then(async () => {\n let closeError = null;\n try {\n if (!state.closed) await request(state, \"close\");\n } catch (error) {\n closeError = error;\n }\n try {\n await state.exited;\n if (closeError !== null) throw closeError;\n if (state.workerFailure !== null) throw state.workerFailure;\n } finally {\n state.closed = true;\n }\n });\n return state.closePromise;\n }\n }\n\n export async function openNativeSqlite(path, options = {}, workerSource = \"\") {\n if (typeof path !== \"string\" || path.trim() === \"\" || path.length > 4096 || path.includes(\"\\0\")) throw new TypeError(\"SQLite path must be non-empty bounded text\");\n if (typeof workerSource !== \"string\") throw new TypeError(\"SQLite Worker source must be text\");\n if (workerSource.length === 0 || workerSource.length > 4 * 1024 * 1024) throw new TypeError(\"SQLite Worker source must be non-empty bounded text\");\n const checked = checkedOptions(options);\n const workerUrl = new URL(\"data:text/javascript;charset=utf-8,\" + encodeURIComponent(workerSource));\n const worker = new Worker(workerUrl, { type: \"module\", workerData: { path, ...checked } });\n let readyResolve;\n let readyReject;\n let exitResolve;\n const ready = new Promise((resolve, reject) => { readyResolve = resolve; readyReject = reject; });\n const exited = new Promise(resolve => { exitResolve = resolve; });\n const state = {\n worker,\n readyResolve,\n readyReject,\n exited,\n pending: new Map(),\n nextId: 1,\n queueCapacity: checked.queueCapacity,\n queued: 0,\n tail: Promise.resolve(),\n closing: false,\n closed: false,\n closeAcknowledged: false,\n workerFailure: null,\n exitCode: null,\n closePromise: null,\n };\n worker.on(\"message\", message => {\n if (message.kind === \"ready\") {\n if (state.readyResolve === null) return;\n const resolve = state.readyResolve;\n const reject = state.readyReject;\n state.readyResolve = null;\n state.readyReject = null;\n if (message.error) reject(nativeError(message.error));\n else resolve();\n return;\n }\n if (message.kind !== \"response\") return;\n const pending = state.pending.get(message.id);\n if (!pending) return;\n state.pending.delete(message.id);\n if (pending.operation === \"close\") state.closeAcknowledged = true;\n if (message.error) pending.reject(nativeError(message.error));\n else pending.resolve(message.value);\n });\n worker.on(\"error\", error => {\n failWorker(state, new NativeSqliteError(error.message, \"SQLITE_WORKER\", \"worker\"));\n });\n worker.on(\"exit\", code => {\n state.exitCode = code;\n const expected = code === 0 && state.closeAcknowledged && state.workerFailure === null;\n if (!expected) {\n failWorker(state, new NativeSqliteError(\"SQLite Worker exited unexpectedly with code \" + code, \"SQLITE_WORKER\", \"worker\"));\n }\n state.closed = true;\n exitResolve(code);\n });\n try {\n await ready;\n } catch (error) {\n if (state.exitCode === null) await worker.terminate();\n await exited;\n throw error;\n }\n return new NativeSqliteConnection(TOKEN, state);\n }\n`:\n export class NativeSqliteError:\n const message: string\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n export class NativeSqliteBackpressureError:\n const message: string\n\n export class NativeSqliteConcurrencyError:\n const message: string\n\n export class NativeSqliteTransaction:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n\n export class NativeSqliteConnection:\n async def execute(fragments: readonly List<string>, params: readonly List<unknown> = []) -> number\n async def one(fragments: readonly List<string>, params: readonly List<unknown> = []) -> unknown\n async def all(fragments: readonly List<string>, params: readonly List<unknown> = []) -> List<unknown>\n async def transaction(operation: (NativeSqliteTransaction) -> Promise<null>) -> null\n async def close() -> null\n\n export async def openNativeSqlite(path: string, options: SqliteOptions = {}, workerSource: string = \"\") -> NativeSqliteConnection\n\n/// A checked SQLite failure. sqliteCode preserves the driver result code when\n/// Node exposes one; retryable is true for busy, locked, and queue pressure.\nexport class SqliteError extends Error:\n const sqliteCode: string?\n const operation: string\n const retryable: bool\n\n constructor(message: string, sqliteCode: string? = null, operation: string = \"unknown\", retryable: bool = false):\n super(message)\n self.sqliteCode = sqliteCode\n self.operation = operation\n self.retryable = retryable\n\nexport class SqliteBackpressureError extends SqliteError:\n constructor(message: string = \"SQLite queue is full\"): super(message, \"SQLITE_BACKPRESSURE\", \"queue\", true)\n\nexport class SqliteConcurrencyError extends SqliteError:\n constructor(message: string = \"SQLite connection cannot be used from its transaction callback\"):\n super(message, \"SQLITE_CONCURRENCY\", \"transaction\", true)\n\ndef sqliteFailure(error: NativeSqliteError) -> SqliteError:\n if error is NativeSqliteBackpressureError: return SqliteBackpressureError(error.message)\n if error is NativeSqliteConcurrencyError: return SqliteConcurrencyError(error.message)\n if error is NativeSqliteError: return SqliteError(error.message, error.sqliteCode, error.operation, error.retryable)\n return SqliteError(error.message)\n\n/// Produces a SQLite literal only for grammar positions where bound parameters\n/// are not legal, such as schema defaults and PRAGMA assignments. Ordinary\n/// query values must still use sqlParameter/sqlTuple/sqlRows.\nexport def sqliteLiteral(value: unknown) -> DatabaseStatement:\n if value == null: return trustedSql(\"NULL\")\n if value is bool: return trustedSql(value ? \"1\" : \"0\")\n if value is string: return trustedSql(\"'\" + value.replaceAll(\"'\", \"''\") + \"'\")\n if value is number:\n assert value.isFinite() else \"SQLite numeric literals must be finite\"\n assert not value.isInteger() or (value >= -9007199254740991 and value <= 9007199254740991) else \"SQLite integer literals must be safe integers\"\n return trustedSql(str(value))\n throw Error(\"SQLite literals support only null, bool, string, and finite number\")\n\n/// Quotes one SQLite identifier as a single name. Qualified names must compose\n/// separately quoted identifiers around trusted punctuation.\nexport def sqliteIdentifier(value: string) -> DatabaseStatement:\n assert not value.isBlank() and value.size <= 255 and not value.has(Text.fromCodePoint(0)) else \"SQLite identifiers must be non-blank text with no NUL and no longer than 255 characters\"\n return trustedSql(`\"` + value.replaceAll(`\"`, `\"\"`) + `\"`)\n\nexport class SqliteTransaction:\n constructor(private const native: NativeSqliteTransaction): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this transaction into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\nexport class SqliteConnection:\n constructor(private const native: NativeSqliteConnection): pass\n\n async def execute(statement: DatabaseStatement) -> number:\n const data = statement.data()\n try: return await self.native.execute(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n /// Projects this connection into the engine-neutral functional operation layer.\n def executor() -> DatabaseExecutor:\n async def executeStatement(statement: DatabaseStatement) -> number: return await self.execute(statement)\n\n async def oneRow(statement: DatabaseStatement) -> unknown:\n const data = statement.data()\n try: return await self.native.one(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def allRows(statement: DatabaseStatement) -> List<unknown>:\n const data = statement.data()\n try: return await self.native.all(data.fragments, data.parameters)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n return {execute: executeStatement, one: oneRow, all: allRows}\n\n async def one<T>(statement: DatabaseStatement, RowType: Type<T>) -> T?:\n const data = statement.data()\n try:\n const row = await self.native.one(data.fragments, data.parameters)\n if row == null: return null\n return RowType.parse(row)\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def all<T>(statement: DatabaseStatement, RowType: Type<T>) -> List<T>:\n const data = statement.data()\n try:\n const rows = await self.native.all(data.fragments, data.parameters)\n return rows.map(row => RowType.parse(row))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n async def transaction<T>(operation: (SqliteTransaction) -> Promise<T>) -> T:\n const results: List<T> = []\n async def run<T>(native: NativeSqliteTransaction): results.append(await operation(SqliteTransaction(native)))\n try:\n await self.native.transaction(run)\n assert results.size == 1 else \"SQLite transaction did not return exactly one result\"\n return results[0]\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw error\n\n async def close():\n try: await self.native.close()\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n\n @dispose: await self.close()\n\nexport async def openSqlite(path: string, options: SqliteOptions = {}) -> SqliteConnection:\n try: return SqliteConnection(await openNativeSqlite(path, options, sqliteWorkerSource))\n catch error:\n if error is NativeSqliteError: throw sqliteFailure(error)\n throw SqliteError(error.message)\n"],"mappings":"AAAA,IAAMA,GAAoC,WAAW,WAC/CC,GAAkC,WAAW,OAAO,eACpDC,GAAN,cAAgCF,EAAkC,CAChE,YAAYG,EAAS,CACnB,MAAMA,CAAO,EACb,KAAK,KAAO,YACd,CACF,EAGAF,GAAgCC,GAAmB,OAAQ,CAAE,MAAO,aAAc,SAAU,GAAO,WAAY,GAAO,aAAc,EAAK,CAAC,EAE1I,IAAME,GAA0B,GAAK,KAAO,KAE5C,IAAMC,GAAyB,WAAW,MACpCC,GAA0B,WAAW,OACrCC,GAA0B,WAAW,OACrCC,GAAwB,WAAW,KACnCC,EAA0B,WAAW,OACrCC,GAAuB,WAAW,IAClCC,GAA6B,WAAW,UACxCC,GAA8B,WAAW,WACzCC,EAAsCJ,EAAwB,yBAC9DK,GAAmCD,EAAoCJ,EAAyB,gBAAgB,GAAG,MACnHM,GAA0BF,EAAoC,WAAW,QAAS,OAAO,GAAG,MAC5FG,EAA6BH,EAAoCP,GAAyB,WAAW,GAAG,MACxGW,GAA0BJ,EAAoCR,GAAwB,SAAS,GAAG,MAClGa,GAAiCL,EAAoCN,GAAyB,eAAe,GAAG,MAChHY,GAA6BN,EAAoCN,GAAyB,WAAW,GAAG,MACxGa,GAAuBP,EAAoCL,GAAuB,OAAO,GAAG,MAC5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AAAN,CAAA,CAAA,EAC7C,IAAAT,EAAYgC,EAAAvB,EAAA,SAAA,CAAA","names":["__velarIndexErrorNativeRangeError","__velarIndexErrorDefineProperty","__VelarIndexError","message","__velarMaxTextCodeUnits","__velarTextNativeArray","__velarTextNativeString","__velarTextNativeNumber","__velarTextNativeMath","__velarTextNativeObject","__velarTextNativeMap","__velarTextNativeTypeError","__velarTextNativeRangeError","__velarTextGetOwnPropertyDescriptor","__velarTextRuntimeGetPrototypeOf","__velarTextReflectApply","__velarTextStringPrototype","__velarTextArrayIsArray","__velarTextNumberIsSafeInteger","__velarTextNumberIsInteger","__velarTextMathFloor","__velarTextMathMax","__velarTextMathMin","__velarNativeStringIndexOf","__velarNativeStringSlice","__velarNativeStringCharCodeAt","__velarNativeStringTrim","__velarNativeStringUpper","__velarNativeStringLower","__velarNativeStringSplit","__velarNativeStringReplaceAll","__velarNativeStringRepeat","__velarTextMapPrototype","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextSurrogatePattern","__velarTextRegExpPrototype","__velarTextSurrogateExec","__velarTextCall","operation","receiver","arguments_","__velarTextMeasureCacheUnits","__velarTextMeasureCache","__velarTextNativeMap","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarUtf8CharCodeAt","__velarUtf8ReflectApply","__velarTextGetOwnPropertyNames","__velarTextGetOwnPropertyDescriptor","__velarTextNativeObject","__velarTextGetOwnPropertySymbols","__velarTextGetPrototypeOf","__velarTextObjectPrototype","__velarTextObjectCreate","__velarTextObjectFreeze","__velarTextArrayPrototype","__velarTextNativeArray","__velarTextArrayJoin","__velarTextStringTrimStart","__velarTextStringPrototype","__velarTextStringTrimEnd","__velarTextStringNormalize","__velarTextNativeDate","__velarTextDateNow","nativeRegExpPrototype","NativeRegExp","nativeRegExpExec","__velarTextStringCodePointAt","__velarTextGetOwnPropertyDescriptor","__velarTextStringPrototype","__velarTextStringFromCodePoint","__velarTextNativeString","__velarTextLatinMarks","__velarTextBaselessMarks","fromCodePoint","value","__velarTextCall","__velarTextNumberIsSafeInteger","__velarTextNativeNumber","__velarTextNativeRangeError","__velarTextStringFromCodePoint","__velarTextNativeString","__velarReactiveCollectionRead","value","key","child","__velarCollectionNativeArray","__velarCollectionNativeMap","__velarCollectionNativeSet","__velarCollectionNativeObject","__velarCollectionNativeReflect","__velarCollectionNativeWeakMap","__velarCollectionNativeTypeError","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionReflectApply","__velarCollectionArrayIsArray","__velarCollectionGetPrototypeOf","__velarCollectionObjectPrototype","__velarCollectionMapPrototype","__velarCollectionSetPrototype","__velarCollectionMapSize","__velarCollectionSetSize","__velarCollectionHostCall","operation","receiver","arguments_","__velarCollectionWeakMapPrototype","__velarCollectionWeakMapGetOperation","__velarCollectionWeakMapSetOperation","__velarCollectionBrands","__velarCollectionListNativeNumber","__velarCollectionListNativeMath","__velarCollectionListNativeRangeError","__velarCollectionListArrayPrototype","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeArray","__velarCollectionListOwnNamesOperation","__velarCollectionNativeObject","__velarCollectionListOwnSymbolsOperation","__velarCollectionListDefinePropertyOperation","__velarCollectionListObjectIsOperation","__velarCollectionListIntegerOperation","__velarCollectionListSafeIntegerOperation","__velarCollectionListNaNOperation","__velarCollectionListFiniteOperation","__velarCollectionListMaximumOperation","__velarCollectionListMinimumOperation","__velarCollectionListJoinOperation","__velarCollectionListSortOperation","__velarCollectionListReverseOperation","__velarCollectionListIsArray","value","__velarCollectionHostCall","__velarCollectionArrayIsArray","__velarCollectionListGetOwnPropertyDescriptor","key","__velarCollectionListOwnNames","__velarCollectionListOwnSymbols","__velarCollectionListDefineProperty","descriptor","__velarCollectionListIsInteger","value","__velarCollectionHostCall","__velarCollectionListIntegerOperation","__velarCollectionListNativeNumber","__velarCollectionSetMapNativeRangeError","__velarCollectionSetMapFreezeOperation","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionSetAddOperation","__velarCollectionSetPrototype","__velarCollectionSetHasOperation","__velarCollectionSetDeleteOperation","__velarCollectionSetClearOperation","__velarCollectionSetValuesOperation","__velarCollectionMapGetOperation","__velarCollectionMapPrototype","__velarCollectionMapSetOperation","__velarCollectionMapHasOperation","__velarCollectionMapDeleteOperation","__velarCollectionMapClearOperation","__velarCollectionMapKeysOperation","__velarCollectionMapValuesOperation","__velarCollectionMapEntriesOperation","__velarCollectionSetMapMapIteratorPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeMap","__velarCollectionSetMapSetIteratorPrototype","__velarCollectionNativeSet","__velarCollectionSetMapMapIteratorNext","__velarCollectionSetMapSetIteratorNext","__velarCollectionRecordNativeRangeError","__velarCollectionRecordOwnNamesOperation","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionRecordOwnSymbolsOperation","__velarCollectionRecordDefinePropertyOperation","__velarCollectionRecordObjectIsOperation","__velarCollectionRecordDeletePropertyOperation","__velarCollectionNativeReflect","__velarCollectionRecordFreezeOperation","__velarIndexErrorNativeRangeError","__velarIndexErrorDefineProperty","__VelarIndexError","message","__velarMaxCollectionItems","__velarCollectionValue","value","__velarListNativeWeakMap","__velarListWeakMapPrototype","__velarCollectionListGetOwnPropertyDescriptor","__velarListWeakMapGetOperation","__velarListWeakMapSetOperation","__velarListMemos","__velarListIsFrozenOperation","__velarCollectionNativeObject","__velarListRejectFrozen","value","name","__velarCollectionHostCall","__velarCollectionNativeTypeError","__velarListMemo","__velarListIsOwned","memo","__velarAdoptList","__velarMarkCheckedList","__velarMarkOwnedList","__velarListRequireMutableLength","lengthDescriptor","__velarValidateDenseList","__velarCollectionListIsArray","__velarMaxCollectionItems","__velarCollectionListOwnSymbols","__velarCollectionListOwnNames","index","descriptor","__velarListTier","__velarValidateListTier","tier","__velarValidateOwnedList","__velarValidateMutableList","__velarCheckedListElement","__velarOwnedListElement","element","__velarListElement","owned","__velarCopyList","value","name","__velarValidateOwnedList","owned","__velarListIsOwned","output","index","__velarCollectionValue","__velarListElement","__velarAdoptList","__velarListNativeString","__velarListStringPrototype","__velarCollectionListGetOwnPropertyDescriptor","__velarListStringCharCodeAt","__velarListSurrogatePattern","__velarListRegExpPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeObject","__velarListSurrogateExecOperation","__velarListSize","value","__velarValidateOwnedList","__velarListSizeText","length","__velarStrictListIndex","value","requested","__velarCollectionListIsInteger","__VelarIndexError","index","__velarListIndexGet","tier","__velarListTier","__velarReactiveCollectionRead","__velarOwnedListElement","__velarValidateListTier","__velarCheckedListElement","__velarListAppend","value","item","__velarValidateMutableList","__velarMaxCollectionItems","__velarCollectionListNativeRangeError","index","__velarCollectionListDefineProperty","__velarMarkOwnedList","__velarListMap","value","transform","items","__velarCopyList","output","__velarCollectionNativeArray","index","item","__velarReactiveCollectionRead","__velarAdoptList","__velarMaxCollectionTextCodeUnits","__velarMaxTextCodeUnits","__velarTextNativeArray","__velarTextNativeString","__velarTextNativeNumber","__velarTextNativeMath","__velarTextNativeObject","__velarTextNativeMap","__velarTextNativeTypeError","__velarTextNativeRangeError","__velarTextGetOwnPropertyDescriptor","__velarTextRuntimeGetPrototypeOf","__velarTextReflectApply","__velarTextStringPrototype","__velarTextArrayIsArray","__velarTextNumberIsSafeInteger","__velarTextNumberIsInteger","__velarTextMathFloor","__velarTextMathMax","__velarTextMathMin","__velarNativeStringIndexOf","__velarNativeStringSlice","__velarNativeStringCharCodeAt","__velarNativeStringTrim","__velarNativeStringUpper","__velarNativeStringLower","__velarNativeStringSplit","__velarNativeStringReplaceAll","__velarNativeStringRepeat","__velarTextMapPrototype","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextSurrogatePattern","__velarTextRegExpPrototype","__velarTextSurrogateExec","__velarTextCall","operation","receiver","arguments_","__velarTextValue","value","__velarMaxTextCodeUnits","__velarTextArgument","name","__velarTextNextCodePointOffset","value","offset","first","__velarTextCall","__velarNativeStringCharCodeAt","second","__velarTextCheckpointStride","__velarTextMeasureMinimumUnits","__velarTextMeasureCacheEntries","__velarTextMeasureCacheUnits","__velarTextMeasureCache","__velarTextNativeMap","__velarTextMapGet","__velarTextMapSet","__velarTextMapClear","__velarTextMeasureCacheCount","__velarTextMeasureCacheHeld","__velarTextMeasureText","__velarTextSurrogateExec","__velarTextSurrogatePattern","checkpoints","__velarTextNativeArray","length","__velarTextMeasure","cached","measured","__velarTextCodePointLength","__velarTextIsBoundary","value","offset","lead","__velarTextCall","__velarNativeStringCharCodeAt","trail","__velarTextNeedsBoundaryCheck","search","first","last","__velarTextBoundedIndexOf","cursor","__velarNativeStringIndexOf","found","__velarTextReplacementOutputUnits","replacement","all","matches","__velarTextCodePointLength","index","growth","__velarTextMathFloor","__velarTextNativeMath","__velarMaxTextCodeUnits","__velarStringSize","value","__velarTextCodePointLength","__velarTextValue","__velarStringIsBlank","value","__velarTextCall","__velarNativeStringTrim","__velarTextValue","__velarStringHas","value","text","__velarTextValue","__velarTextArgument","__velarTextBoundedIndexOf","__velarStringReplaceAll","value","from","to","__velarTextValue","__velarTextArgument","__velarTextReplacementOutputUnits","__velarMaxTextCodeUnits","__velarTextNativeRangeError","output","offset","next","__velarTextNextCodePointOffset","__velarTextCall","__velarNativeStringSlice","__velarTextNeedsBoundaryCheck","__velarNativeStringReplaceAll","cursor","found","__velarTextBoundedIndexOf","__velarNumberNativeMath","__velarNumberNativeNumber","__velarNumberNativeObject","__velarNumberNativeTypeError","__velarNumberNativeRangeError","__velarNumberGetOwnPropertyDescriptor","__velarNumberReflectApply","__velarNumberPrototype","__velarNumberMathAbs","__velarNumberMathRound","__velarNumberMathFloor","__velarNumberMathCeil","__velarNumberMathSign","__velarNumberMathTrunc","__velarNumberIsSafeInteger","__velarNumberNativeIsInteger","__velarNumberNativeIsNaN","__velarNumberNativeIsFinite","__velarNativeNumberToFixed","__velarNumberCall","operation","receiver","arguments_","__velarNumberValue","value","__velarNumberIsInteger","value","__velarNumberCall","__velarNumberNativeIsInteger","__velarNumberNativeNumber","__velarNumberValue","__velarNumberIsFinite","value","__velarNumberCall","__velarNumberNativeIsFinite","__velarNumberNativeNumber","__velarNumberValue","__velarClassNativeObject","__velarClassNativeReflect","__velarClassNativeTypeError","__velarClassGetOwnPropertyDescriptor","__velarClassReflectApply","__velarClassReflectGet","__velarClassGetPrototypeOf","__velarClassHostCall","operation","receiver","arguments_","__velarReadInstanceField","name","value","__velarReadPrivateField","__velarNarrowingNativeTypeError","__velarNarrowingDefineProperty","__VelarNarrowingError","message","__velarNarrow","value","valid","expected","description","location","__velarNormalizeGlobal","__velarNormalizeNativeObject","__velarNormalizeNativeReflect","__velarNormalizeNativeWeakMap","__velarNormalizeNativePromise","__velarNormalizeNativeSymbol","__velarNormalizeTypeError","__velarNormalizeGetOwnPropertyDescriptor","__velarNormalizeGetPrototypeOf","__velarNormalizeDefineProperty","__velarNormalizeApply","__velarNormalizeWeakMapPrototype","__velarNormalizeWeakMapHas","__velarNormalizeWeakMapGet","__velarNormalizeWeakMapSet","__velarNormalizePromisePrototype","__velarNormalizePromiseThen","__velarNormalizeSymbolFor","__velarNormalizeCall","operation","receiver","arguments_","__velarNormalizedPromiseRegistryKey","__velarNormalizedPromiseValues","descriptor","registry","__velarNormalizeOwnsPromise","candidate","prototype","__velarNormalizePromiseValue","value","known","settle","fail","resolved","reason","normalized","resolve","reject","__velarAsyncResolvedValue","owner","depth","__velarErrorNativeError","__velarErrorNativeString","__velarErrorNativeObject","__velarErrorNativeReflect","__velarErrorNativeTypeError","__velarErrorGetOwnPropertyDescriptor","__velarErrorGetPrototypeOf","__velarErrorReflectApply","__velarErrorIsErrorOperation","__velarErrorApply","operation","receiver","arguments_","label","__velarIsError","value","__velarNormalizeError","value","__velarIsError","kind","message","__velarErrorApply","__velarErrorNativeString","__velarErrorNativeError","__velarAssertionNativeError","__velarAssertionDefineProperty","__VelarAssertionError","message","__velarHostErrorNativeError","__velarHostErrorDefineProperty","__VelarFileNotFoundError","path","__VelarPermissionError","__VelarNotADirectoryError","__VelarFileExistsError","__VelarAddressInUseError","__VelarTimeoutError","__velarCollectionNativeArray","__velarCollectionNativeMap","__velarCollectionNativeSet","__velarCollectionNativeObject","__velarCollectionNativeReflect","__velarCollectionNativeWeakMap","__velarCollectionNativeTypeError","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionReflectApply","__velarCollectionArrayIsArray","__velarCollectionGetPrototypeOf","__velarCollectionObjectPrototype","__velarCollectionMapPrototype","__velarCollectionSetPrototype","__velarCollectionMapSize","__velarCollectionSetSize","__velarCollectionHostCall","operation","receiver","arguments_","__velarCollectionWeakMapPrototype","__velarCollectionWeakMapGetOperation","__velarCollectionWeakMapSetOperation","__velarCollectionBrands","__velarCollectionBrand","value","known","brand","__velarIsMap","__velarIsSet","__velarCollectionOwnNames","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarCollectionOwnSymbols","__velarCollectionOwnKeys","__velarCollectionNativeReflect","__velarCollectionMapEntries","__velarCollectionMapPrototype","__velarCollectionSetValues","__velarCollectionSetPrototype","__velarCollectionMapIteratorPrototype","__velarCollectionHostCall","__velarCollectionGetPrototypeOf","__velarCollectionNativeMap","__velarCollectionSetIteratorPrototype","__velarCollectionNativeSet","__velarCollectionMapIteratorNext","__velarCollectionSetIteratorNext","__velarCollectionMapTypeIterator","value","__velarCollectionSetTypeIterator","__velarCollectionMapTypeNext","iterator","__velarCollectionSetTypeNext","__velarTypeNativeWeakSet","__velarTypeNativeObject","__velarTypeNativeTypeError","__velarTypeGetOwnPropertyDescriptor","__velarTypeDefineProperty","__velarTypeReflectApply","__velarTypeSymbolFor","__velarTypeWeakSetPrototype","__velarTypeWeakSetHas","__velarTypeWeakSetAdd","__velarTypeCall","operation","receiver","arguments_","__velarRuntimeTypeRegistryKey","__velarRuntimeTypeRegistry","descriptor","registry","__velarRegisterRuntimeType","__velarValidationNativeWeakMap","__velarValidationNativeSet","__velarValidationNativePromise","__velarValidationNativeFunction","__velarValidationNativeSymbol","__velarValidationWeakMapPrototype","__velarCollectionGetOwnPropertyDescriptor","__velarValidationSetPrototype","__velarValidationFunctionPrototype","__velarValidationHasInstanceSymbol","__velarValidationWeakMapGetOperation","__velarValidationWeakMapSetOperation","__velarValidationWeakMapDeleteOperation","__velarValidationSetHasOperation","__velarValidationSetAddOperation","__velarValidationSetDeleteOperation","__velarValidationSetSizeOperation","__velarValidationFunctionHasInstanceOperation","__velarValidationFreezeOperation","__velarCollectionNativeObject","__velarValidationDefinePropertyOperation","__velarValidationMapSetOperation","__velarCollectionMapPrototype","__velarValidationMapGetOperation","__velarValidationState","__velarValidationCopy","__velarValidationSet","__velarValidationWeakMapGet","value","key","__velarCollectionHostCall","__velarValidationWeakMapSet","item","__velarValidationMapGet","value","key","__velarCollectionHostCall","__velarValidationMapGetOperation","__velarValidationMapSet","item","__velarValidationMapSetOperation","__velarValidationSetAdd","value","item","__velarCollectionHostCall","__velarValidationSetAddOperation","__velarValidationIsArray","value","__velarCollectionHostCall","__velarCollectionArrayIsArray","__velarCollectionNativeArray","__velarValidationOwnDescriptor","key","__velarCollectionGetOwnPropertyDescriptor","__velarCollectionNativeObject","__velarValidationIsInstance","constructor","__velarValidationFunctionHasInstanceOperation","__velarValidationFreeze","value","__velarCollectionHostCall","__velarValidationFreezeOperation","__velarCollectionNativeObject","__velarValidationIsPlainObject","prototype","__velarCollectionGetPrototypeOf","__velarValidationCopy","state","plan","plans","__velarValidationWeakMapGet","__velarValidationMapGet","copy","__velarValidationNativeWeakMap","__velarCollectionNativeMap","__velarValidationWeakMapSet","__velarValidationMapSet","target","name","__velarValidationDefinePropertyOperation","item","found","result","length","__velarValidationOwnDescriptor","index","descriptor","__velarValidationSet","iterator","__velarCollectionSetTypeIterator","step","__velarCollectionSetTypeNext","__velarValidationSetAdd","key","__velarCollectionMapTypeIterator","__velarCollectionMapTypeNext","entry","keys","__velarCollectionOwnKeys","__velarCollectionNativeReflect","__velarValidationIsArray","__velarIsMap","__velarIsSet","type","operation","__velarValidationRejectionHint","__velarValidationErrorDefineProperty","__VelarValidationError","__velarCollectionNativeTypeError","message","detail","trustedSql","sqliteWorkerSource","AsyncLocalStorage","Worker","TOKEN","connectionStates","transactionStates","transactionContext","NativeSqliteError","message","sqliteCode","operation","retryable","NativeSqliteBackpressureError","NativeSqliteConcurrencyError","integer","value","fallback","minimum","maximum","label","selected","checkedOptions","allowed","key","journalModes","journalMode","nativeError","failPending","state","error","pending","failWorker","request","fragments","params","id","resolve","reject","stateOf","connection","transactionStateOf","transaction","transactionRequest","enqueue","running","NativeSqliteTransaction","token","NativeSqliteConnection","transactionState","closeError","openNativeSqlite","path","options","workerSource","checked","workerUrl","worker","readyResolve","readyReject","exitResolve","ready","exited","code","SqliteJournalMode","__velarRegisterRuntimeType","__velarValidationFreeze","__velarTypeExplain_SqliteOptions","value","SqliteError","operation","retryable","message","self","sqliteCode","SqliteBackpressureError","SqliteConcurrencyError","sqliteFailure","error","NativeSqliteBackpressureError","__velarValue","__velarNarrow","__velarValidationIsInstance","NativeSqliteConcurrencyError","NativeSqliteError","sqliteLiteral","trustedSql","__velarStringReplaceAll","__velarNumberIsFinite","__velarNumberIsInteger","sqliteIdentifier","__velarStringIsBlank","__velarStringSize","__velarStringHas","fromCodePoint","SqliteTransaction","data","statement","__velarNormalizePromiseValue","__velarReadPrivateField","#native","__velarReadInstanceField","executeStatement","oneRow","__velarAsyncResolvedValue","allRows","row","RowType","rows","__velarListMap","SqliteConnection","results","__velarAdoptList","run","native","__velarListAppend","__velarListSize","__velarListIndexGet","openSqlite","path","options","openNativeSqlite","sqliteWorkerSource"]}