@optionfactory/fml 9.0.0-rc28 → 9.0.0-rc29
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/client-errors.iife.js +21 -16
- package/dist/client-errors.iife.js.map +1 -1
- package/dist/client-errors.iife.min.js +1 -1
- package/dist/client-errors.iife.min.js.map +1 -1
- package/dist/custom-elements.json +16 -16
- package/dist/fml.css +13 -13
- package/dist/fml.css.map +1 -1
- package/dist/fml.iife.js +871 -883
- package/dist/fml.iife.js.map +1 -1
- package/dist/fml.iife.min.js +1 -1
- package/dist/fml.iife.min.js.map +1 -1
- package/dist/ftl.d.mts +3 -3
- package/dist/ftl.iife.js +275 -679
- package/dist/ftl.iife.js.map +1 -1
- package/dist/ftl.iife.min.js +1 -1
- package/dist/ftl.iife.min.js.map +1 -1
- package/dist/ftl.min.mjs +1 -1
- package/dist/ftl.min.mjs.map +1 -1
- package/dist/ftl.mjs +275 -679
- package/dist/ftl.mjs.map +1 -1
- package/dist/ful.css +13 -13
- package/dist/ful.css.map +1 -1
- package/dist/ful.d.mts +195 -71
- package/dist/ful.iife.js +564 -189
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +564 -189
- package/dist/ful.mjs.map +1 -1
- package/dist/httpc.d.mts +9 -7
- package/dist/httpc.iife.js +32 -15
- package/dist/httpc.iife.js.map +1 -1
- package/dist/httpc.iife.min.js +1 -1
- package/dist/httpc.iife.min.js.map +1 -1
- package/dist/httpc.min.mjs +1 -1
- package/dist/httpc.min.mjs.map +1 -1
- package/dist/httpc.mjs +32 -15
- package/dist/httpc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +13 -13
- package/dist/web-types.json +17 -17
- package/package.json +2 -2
package/dist/ftl.min.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ftl.min.mjs","sources":["../src/ftl/cache.mjs","../src/ftl/ast.mjs","../src/ftl/expressions-parser.peggy","../src/ftl/expressions.mjs","../src/ftl/dom.mjs","../src/ftl/template.mjs","../src/ftl/registry.mjs","../src/ftl/templates.mjs","../src/ftl/rendering.mjs","../src/ftl/parsed-element.mjs","../src/ftl/l10n.mjs"],"sourcesContent":["/**\n * A Map bounded by entry count, evicting the oldest entry when full. A hit does\n * not refresh an entry: eviction follows insertion order, not use.\n */\nclass BoundedCache {\n #max;\n #entries = new Map();\n /** @param {number} max */\n constructor(max) {\n this.#max = max;\n }\n /**\n * The cached value for the key, computing and caching it on a miss. A\n * computed null or undefined is cached like any value; a throwing compute\n * caches nothing.\n * @template K, V\n * @param {K} key\n * @param {(key: K) => V} compute\n * @returns {V}\n */\n getOrCompute(key, compute) {\n if (this.#entries.has(key)) {\n return this.#entries.get(key);\n }\n const value = compute(key);\n if (this.#entries.size >= this.#max) {\n this.#entries.delete(this.#entries.keys().next().value);\n }\n this.#entries.set(key, value);\n return value;\n }\n /** @returns {number} the number of entries held */\n get size() {\n return this.#entries.size;\n }\n}\n\nexport { BoundedCache };\n","const nodes = {\n ter: Symbol('ternary'),\n elv: Symbol('elvis'),\n nullc: Symbol('null-coalescence'),\n or: Symbol('or'),\n and: Symbol('and'),\n eq: Symbol('eq'),\n cmp: Symbol('cmp'),\n not: Symbol('not'),\n access: Symbol('access'),\n member: Symbol('access-member'),\n subscript: Symbol('access-subscript'),\n method: Symbol('access-method-call'),\n call: Symbol('module-function-call'),\n tstring: Symbol('tstring'),\n literal: Symbol('literal'),\n array: Symbol('array-literal'),\n dict: Symbol('dict-literal'),\n function: Symbol('module-function'),\n symbol: Symbol('symbol'),\n templated: {\n ten: Symbol('templated-node'),\n teh: Symbol('templated-html'),\n tet: Symbol('templated-text'),\n tel: Symbol('templated-literal'),\n },\n dom: {\n t: Symbol('text'),\n h: Symbol('html'),\n n: Symbol('node'),\n },\n};\n\nexport { nodes };\n","{{\n import { nodes } from \"./ast.mjs\";\n const keywords = new Map([\n ['true', true],\n ['false', false],\n ['null', null],\n ['undefined', undefined],\n ]);\n}}\n\nTemplatedRoot = TemplatedExpression*\n\nTemplatedExpression = value:(BeginNode @ExpressionRoot EndNode) { return {type:nodes.templated.ten, value}}\n\t/ value:(BeginHtml @ExpressionRoot EndHtml) { return {type:nodes.templated.teh, value}}\n\t/ value:(BeginText @ExpressionRoot EndText) { return {type:nodes.templated.tet, value}} \n\t/ value:TemplatedText { return {type:nodes.templated.tel, value}}\n\nBeginNode = '{{{{'\nEndNode = '}}}}'\t\nBeginHtml = '{{{'\nEndHtml = '}}}'\nBeginText = '{{'\nEndText = '}}'\n\nTemplatedText\n = parts:(\n $( [^\\\\{]+ )\n / '\\\\' c:. { return c; }\n / $('{' !'{')\n )+ { return parts.join(''); }\n\nExpressionRoot\n = _ r:Expression _ { return r; }\n\nExpression = TernaryExpression\n\nTernaryExpression \n = cond:ElvisExpression _ \"?\" _ ifTrue:TernaryExpression _ \":\" _ ifFalse:TernaryExpression { return {type:nodes.ter, cond, ifTrue, ifFalse}; }\n / ElvisExpression\n\nElvisExpression\n = cond:NullCoalescingExpression _ \"?:\" _ ifFalse:ElvisExpression {return {type:nodes.elv, cond, ifFalse}; }\n / NullCoalescingExpression\n\nNullCoalescingExpression\n = lhs:OrExpression _ \"??\" _ rhs:NullCoalescingExpression { return {type:nodes.nullc, lhs, rhs}; } \n / OrExpression\n\nOrExpression \n = head:AndExpression tail:(_ \"||\" _ @rhs:AndExpression)* {\n let result = head;\n for (const rhs of tail) {\n result = {type: nodes.or, lhs: result, rhs};\n }\n return result;\n }\n\nAndExpression\n = head:EqExpression tail:(_ \"&&\" _ @rhs:EqExpression)* { \n let result = head;\n for (const rhs of tail) {\n result = {type: nodes.and, lhs: result, rhs};\n }\n return result;\n }\n\nEqExpression\n = head:RelExpression tail:(_ op:EqualityOp _ rhs:RelExpression {return {op, rhs};})* { \n let result = head;\n for (const element of tail) {\n result = {type: nodes.eq, op: element.op, lhs: result, rhs: element.rhs};\n }\n return result;\n }\n\nRelExpression\n = head:NotExpression tail:(_ op:RelationalOp _ rhs:NotExpression {return {op, rhs};})* {\n let result = head;\n for (const element of tail) {\n result = {type: nodes.cmp, op: element.op, lhs: result, rhs: element.rhs};\n }\n return result;\n }\n\n\nNotExpression\n = \"!\" _ expr:NotExpression { return {type:nodes.not, expr} }\n / Access\n\n\nAccess \n = lhs:GroupingExpression _ rhs:(@AccessExpression _)+ { return {type: nodes.access, lhs, rhs} } \n / GroupingExpression\n\n\nAccessExpression \n = AccessMember\n / AccessSubscript \n / AccessMethodCall\n \nAccessMember \"member\"\n = op:(\"?.\"/\".\") _ rhs:Word {\n return {type: nodes.member, ns: op === '?.', rhs: rhs};\n }\n\nAccessSubscript \"subscript\" \n = op:\"?.\"? \"[\" _ rhs:Expression _ \"]\" { \n return {type: nodes.subscript, ns: op !== null, rhs}; \n } \n\nAccessMethodCall \"method-call\" \n = op:\"?.\"? \"(\" _ h:(@Expression _)? t:(\",\" _ @Expression _)* \")\" { \n return {type: nodes.method, ns: op !== null, args: h === null ? [] : [h, ...t]}; \n }\n\nGroupingExpression\n = \"(\" _ e:Expression _ \")\" { return e }\n / ModuleFunctionCall\n / AnyLiteral\n / Identifier\n\n\nModuleFunctionCall \"module-function-call\" \n = fn:ModuleFunction \"(\" _ h:(@Expression _)? t:(\",\" _ @Expression _)* \")\" {\n const args = h === null ? [] : [h, ...t];\n return {type: nodes.call, value: fn, args};\n }\n\nAnyLiteral\n = NumberLiteral\n / StringLiteral\n / ArrayLiteral\n / DictLiteral\n\nNumberLiteral \"number-literal\" \n = value:$( '-'? ([0-9]+ ('.' [0-9]*)? / '.' [0-9]+ ) ) {\n return { type: nodes.literal, value: parseFloat(value) };\n }\n\nStringLiteral \"string-literal\"\n = \"'\" value:$[^']* \"'\" { return {type: nodes.literal, value}; }\n / '\"' value:$[^\"]* '\"' { return {type: nodes.literal, value}; }\n / \"`\" parts:(TemplateStringExpression / TemplateStringLiteral)* \"`\" { \n return {type: nodes.tstring, parts}; \n }\n\nTemplateStringExpression \"tstring-expression\"\n = \"{\" _ expr:Expression _ \"}\" { \n return expr; \n }\n\nTemplateStringLiteral \"tstring-literal\"\n = parts:(\n $([^\\\\`{]+)\n / \"\\\\\" c:. { return c; }\n )+ {\n return { type: nodes.literal, value: parts.join('') };\n }\n / char:$(\"{\") { \n return { type: nodes.literal, value: char }; \n }\n\nArrayLiteral \"array-literal\" \n = \"[\" _ h:(Expression)? _ t:(\",\" _ @Expression _)* \"]\" { \n const value = h === null ? [] : [h, ...t];\n return {type: nodes.array, value};\n }\n\nDictLiteral \"dict-literal\" \n = \"{\" _ h:(@StringLiteral _ \":\" _ @Expression)? _ t:(\",\" _ @StringLiteral _ \":\" _ @Expression _)* \"}\" {\n var value = []\n if (h !== null){\n value.push(h);\n }\n value.push.apply(value, t);\n return {type: nodes.dict, value}; \n }\n\nModuleFunction \"module-function\"\n = '#' module:(@Word ':')? v:Word {\n return {type: nodes.function, module, value: v}\n }\n\nWord\n = $([a-zA-Z$_][a-zA-Z$_0-9]*)\n\nIdentifier \"identifier-or-keyword\"\n = s:Word {\n return keywords.has(s)\n ? {type: nodes.literal, value: keywords.get(s)}\n : {type: nodes.symbol, value: s};\n }\n\nEqualityOp\n = \"==\"\n / \"!=\"\n\nRelationalOp\n = \">=\"\n / \">\"\n / \"<=\"\n / \"<\"\n\n_ \"whitespaces\"\n = [ \\t\\n\\r]*\n\n","import { parse } from './expressions-parser.peggy';\nimport { nodes } from './ast.mjs';\nimport { BoundedCache } from './cache.mjs';\n\n/**\n * The one lookup against a data stack: the innermost overlay carrying the name\n * wins, `self` is the innermost overlay itself, and a function overlay counts\n * like an object one.\n * @param {any[]} dataStack\n * @param {string|symbol} prop\n * @returns {any} undefined when no overlay carries the name\n */\nconst resolveInStack = (dataStack, prop) => {\n if (prop === 'self') {\n return dataStack[dataStack.length - 1];\n }\n for (let i = dataStack.length - 1; i >= 0; i--) {\n const overlay = dataStack[i];\n if (overlay != null && (typeof overlay === 'object' || typeof overlay === 'function')) {\n if (prop in overlay) {\n return overlay[prop];\n }\n }\n }\n return undefined;\n};\n\n/**\n * Evaluates a parsed expression against a scope. One instance per evaluation:\n * it holds the modules and the data stack that names resolve against, and keeps\n * no state between visits.\n */\nclass EvaluatingVisitor {\n #modules;\n #dataStack;\n constructor(modules, dataStack) {\n this.#modules = modules;\n this.#dataStack = dataStack;\n }\n #resolve(prop) {\n return resolveInStack(this.#dataStack, prop);\n }\n /**\n * The name a missing-method report can carry: the called symbol for a bare\n * `boom()`, the member for a dotted `a.boom()`, nothing for anything else\n * (a subscript or a grouped left-hand side has no static name).\n */\n #reportableName(node, index) {\n const source = index === 0 ? node.lhs : node.rhs[index - 1];\n if (source.type === nodes.symbol) {\n return source.value;\n }\n if (source.type === nodes.member) {\n return source.rhs;\n }\n return null;\n }\n\n #cached_resolve_proxy;\n #resolve_proxy() {\n if (!this.#cached_resolve_proxy) {\n this.#cached_resolve_proxy = new Proxy(this.#dataStack, {\n get: (target, prop) => this.#resolve(prop),\n });\n }\n return this.#cached_resolve_proxy;\n }\n [nodes.and](node) {\n return this.visit(node.lhs) && this.visit(node.rhs);\n }\n [nodes.or](node) {\n return this.visit(node.lhs) || this.visit(node.rhs);\n }\n [nodes.nullc](node) {\n return this.visit(node.lhs) ?? this.visit(node.rhs);\n }\n [nodes.not](node) {\n return !this.visit(node.expr);\n }\n [nodes.eq](node) {\n const lhs = this.visit(node.lhs);\n const rhs = this.visit(node.rhs);\n const eq = lhs === rhs;\n return node.op === '==' ? eq : !eq;\n }\n [nodes.cmp](node) {\n const lhs = this.visit(node.lhs);\n const rhs = this.visit(node.rhs);\n switch (node.op) {\n case '>':\n return lhs > rhs;\n case '<':\n return lhs < rhs;\n case '>=':\n return lhs >= rhs;\n case '<=':\n return lhs <= rhs;\n default:\n throw new Error(`unknown cmp op ${node.op}`);\n }\n }\n [nodes.call](node) {\n const fnRef = node.value;\n const module = fnRef.module === null ? this.#modules : this.#modules?.[fnRef.module];\n if (!module) {\n throw new Error(`Module \"${fnRef.module}\" not found`);\n }\n const fn = module[fnRef.value];\n if (!fn) {\n throw new Error(`Function \"#${fnRef.module === null ? '' : `${fnRef.module}:`}${fnRef.value}\" not found`);\n }\n const args = node.args.map((arg) => this.visit(arg));\n return fn.apply(this.#resolve_proxy(), args);\n }\n [nodes.literal](node) {\n return node.value;\n }\n [nodes.tstring](node) {\n let result = '';\n const parts = node.parts;\n for (let i = 0, len = parts.length; i < len; i++) {\n const evaluated = this.visit(parts[i]);\n if (evaluated !== null && evaluated !== undefined) {\n result += evaluated;\n }\n }\n return result;\n }\n [nodes.symbol](node) {\n return this.#resolve(node.value);\n }\n [nodes.dict](node) {\n return Object.fromEntries(node.value.map((entry) => [this.visit(entry[0]), this.visit(entry[1])]));\n }\n [nodes.array](node) {\n return node.value.map((v) => this.visit(v));\n }\n [nodes.ter](node) {\n return this.visit(node.cond) ? this.visit(node.ifTrue) : this.visit(node.ifFalse);\n }\n [nodes.elv](node) {\n return this.visit(node.cond) || this.visit(node.ifFalse);\n }\n [nodes.access](node) {\n let prev;\n let cur = this.visit(node.lhs);\n for (let i = 0; i !== node.rhs.length; ++i) {\n const rhs = node.rhs[i];\n if (rhs.ns && cur == null) {\n return undefined;\n }\n let value;\n switch (rhs.type) {\n case nodes.member: {\n value = cur[rhs.rhs];\n break;\n }\n case nodes.subscript: {\n value = cur[this.visit(rhs.rhs)];\n break;\n }\n case nodes.method: {\n if (!cur) {\n const name = this.#reportableName(node, i);\n throw new Error(name === null ? 'Method missing' : `Method missing \"${name}\"`);\n }\n const args = rhs.args.map((arg) => this.visit(arg));\n value = cur.apply(prev, args);\n break;\n }\n }\n prev = cur;\n cur = value;\n }\n return cur;\n }\n visit(node, ...args) {\n return this[node.type](node, ...args);\n }\n visitRoot(ast, templated) {\n return !templated\n ? this.visit(ast)\n : ast.map((node) => {\n switch (node.type) {\n case nodes.templated.tel:\n return { type: nodes.dom.t, value: node.value };\n case nodes.templated.tet:\n return { type: nodes.dom.t, value: this.visit(node.value) };\n case nodes.templated.teh:\n return { type: nodes.dom.h, value: this.visit(node.value) };\n case nodes.templated.ten:\n return { type: nodes.dom.n, value: this.visit(node.value) };\n default:\n throw new Error(`unknown node type ${node.type.toString()}`);\n }\n });\n }\n}\n\n/**\n * The expression language: parsing to an ast, caching the parses, and\n * interpreting one against a scope. Member access and calls are unfiltered, so\n * an expression can do whatever the page's own javascript can. Expressions are\n * written by the page author; untrusted data is passed in as data and never\n * spliced into the expression text.\n */\nclass Expressions {\n /** Parses the whole text as one expression: `user.name`. */\n static MODE_EXPRESSION = Symbol('MODE_EXPRESSION');\n /**\n * Parses text with interpolations, `Hello {{ user.name }}`, evaluating to\n * its parts: `{ type, value }` for each literal run and each `{{ }}` (text),\n * `{{{ }}}` (html) or `{{{{ }}}}` (node) interpolation, in order.\n */\n static MODE_TEMPLATED = Symbol('MODE_TEMPLATED');\n\n static #astCache = new BoundedCache(1000);\n\n /**\n * Parses an expression, caching the ast by mode and text.\n * @param {string} expression\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] MODE_EXPRESSION when omitted\n * @returns {any} the ast\n * @throws a peggy syntax error when the text does not parse\n */\n static parse(expression, mode) {\n const key = mode?.toString() + expression;\n return this.#astCache.getOrCompute(key, () =>\n parse(expression, {\n startRule: mode === Expressions.MODE_TEMPLATED ? 'TemplatedRoot' : 'ExpressionRoot',\n }),\n );\n }\n /**\n * Evaluates a parsed ast against the modules and the data stack.\n * @param {{[k: string]: any } | null | undefined } modules\n * @param {any[]} dataStack innermost overlay last\n * @param {any} ast what `parse` answered\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] the mode it was parsed in\n * @returns {any} the value, or the list of parts in MODE_TEMPLATED\n */\n static evaluate(modules, dataStack, ast, mode) {\n return new EvaluatingVisitor(modules, dataStack).visitRoot(ast, mode === Expressions.MODE_TEMPLATED);\n }\n /**\n * Parses and evaluates an expression.\n * @param {{ [x: string]: any; } | null | undefined} modules\n * @param {any[]} dataStack innermost overlay last\n * @param {string} expression\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] MODE_EXPRESSION when omitted\n * @returns {any} the value, or the list of parts in MODE_TEMPLATED\n */\n static interpret(modules, dataStack, expression, mode) {\n return Expressions.evaluate(modules, dataStack, Expressions.parse(expression, mode), mode);\n }\n}\n\n/**\n * A scope: the modules that `#name:fn()` resolves against and the data stack\n * that a bare identifier resolves against, as a single value. Adding an overlay\n * returns a new evaluator instead of modifying this one, so a template can add\n * data for one subtree without affecting the rest of the render.\n */\nclass ExpressionEvaluator {\n #modules;\n #dataStack;\n /**\n * @param {{ [k: string]: any } | null | undefined} modules\n * @param {any[]} dataStack innermost overlay last\n */\n constructor(modules, dataStack) {\n this.#modules = modules;\n this.#dataStack = dataStack;\n }\n /**\n * A new evaluator with one more module: `#name:fn()` resolves into it, and an\n * empty name merges a whole map whose functions resolve bare, as `#fn()`.\n * @param {string} name\n * @param {object} value\n * @returns {ExpressionEvaluator}\n */\n withModule(name, value) {\n const module = name ? { [name]: value } : value;\n return new ExpressionEvaluator({ ...this.#modules, ...module }, this.#dataStack);\n }\n /**\n * A new evaluator with the data pushed as the innermost overlays, the last\n * one winning a shared name.\n * @param {...any} data\n * @returns {ExpressionEvaluator}\n */\n withOverlay(...data) {\n return new ExpressionEvaluator(\n this.#modules,\n data.length === 0 ? this.#dataStack : [...this.#dataStack, ...data],\n );\n }\n /**\n * Resolves a name against the data stack, with no parse round trip: the\n * lookup a template's bare identifier makes, for an imperative caller.\n * @param {string} name\n * @returns {any} undefined when no overlay carries the name\n */\n resolve(name) {\n return resolveInStack(this.#dataStack, name);\n }\n /**\n * Evaluates an expression against this scope.\n * @param {string} expression\n * @returns {any}\n */\n evaluateExpression(expression) {\n return Expressions.interpret(this.#modules, this.#dataStack, expression, Expressions.MODE_EXPRESSION);\n }\n /**\n * Evaluates a templated text, the `{{ }}` form, against this scope.\n * @param {string} text\n * @returns {{ type: symbol, value: any }[]} its parts, as MODE_TEMPLATED describes\n */\n evaluateTemplated(text) {\n return Expressions.interpret(this.#modules, this.#dataStack, text, Expressions.MODE_TEMPLATED);\n }\n}\n\nexport { Expressions, ExpressionEvaluator };\n","/** Creates, serializes and inspects DocumentFragments. */\nclass Fragments {\n /**\n * Parses html into a DocumentFragment adopted by the document, each piece\n * trimmed and the pieces joined.\n * @param {...string} html\n * @returns {DocumentFragment}\n */\n static fromHtml(...html) {\n const el = document.createElement('template');\n el.innerHTML = html.map((h) => h.trim()).join('');\n return document.adoptNode(el.content);\n }\n /**\n * Serializes a fragment, or a single node, to html, consuming it: the nodes\n * are moved out, not copied, and a fragment is left empty. Pass\n * `fragment.cloneNode(true)` to keep the original usable.\n * @param {DocumentFragment|Node} fragment\n * @returns {string}\n */\n static toHtml(fragment) {\n var el = document.createElement('template');\n el.content.appendChild(fragment);\n return el.innerHTML;\n }\n /**\n * Whether a fragment holds no element and no text but whitespace.\n * @param {DocumentFragment} fragment\n * @returns {boolean}\n */\n static isBlank(fragment) {\n return fragment.childElementCount === 0 && fragment.textContent.trim() === '';\n }\n /**\n * Moves the nodes, in order, into a new DocumentFragment.\n * @param {...Node} nodes\n * @returns {DocumentFragment}\n */\n static from(...nodes) {\n const fragment = new DocumentFragment();\n for (const node of nodes) {\n fragment.appendChild(node);\n }\n return fragment;\n }\n /**\n * Moves the children of a node into a new DocumentFragment, leaving the\n * node empty.\n * @param {Node} el\n * @returns {DocumentFragment}\n */\n static fromChildNodes(el) {\n const fragment = new DocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.firstChild);\n }\n return fragment;\n }\n}\n\n/** Attribute helpers: unique ids, defaults, prefixed forwarding, and writes where a nullish value removes the attribute. */\nclass Attributes {\n static id = 0;\n /**\n * A page-unique id under the prefix, as `prefix-n`.\n * @param {string} prefix\n * @returns {string}\n */\n static uid(prefix) {\n return `${prefix}-${++Attributes.id}`;\n }\n /**\n * Sets an attribute when the element does not carry it.\n * @param {Element} el\n * @param {string} k\n * @param {string} v\n * @returns {string|null} the attribute's value afterwards\n */\n static defaultValue(el, k, v) {\n if (!el.hasAttribute(k)) {\n el.setAttribute(k, v);\n }\n return el.getAttribute(k);\n }\n /**\n * Copies every attribute whose name starts with the prefix onto another\n * element, under the name without the prefix. `<prefix>class` adds its\n * classes to the target's instead of replacing them.\n * @param {string} prefix\n * @param {Element} from\n * @param {Element} to\n */\n static forward(prefix, from, to) {\n from.getAttributeNames()\n .filter((a) => a.startsWith(prefix))\n .forEach((a) => {\n const target = a.substring(prefix.length);\n if (target === 'class') {\n const classes =\n from\n .getAttribute(`${prefix}class`)\n ?.split(/\\s+/)\n .filter((a) => a.length) ?? [];\n to.classList.add(...classes);\n return;\n }\n to.setAttribute(target, /** @type {string} */ (from.getAttribute(a)));\n });\n }\n /**\n * Sets an attribute, or removes it when the value is nullish.\n * @param {Element} el\n * @param {string} attr\n * @param {string | null | undefined} value\n */\n static set(el, attr, value) {\n if (value == null) {\n el.removeAttribute(attr);\n } else {\n el.setAttribute(attr, value);\n }\n }\n}\n\n/**\n * Reads an element's light-dom slots: the named `<template slot=…>` and\n * `[slot=…]` children are removed and collected by name, and the remaining\n * children become the default slot. fml renders into the light dom, so this\n * replaces the slotting a shadow root would do.\n */\nclass LightSlots {\n /**\n * Takes an element's children apart into slots, leaving the element empty.\n * A named child is removed and contributes what `slotFromNode` answers;\n * children sharing a name are gathered in order. A child with an empty\n * `slot` belongs to the default slot, in document order among the rest.\n * @param {Element} el\n * @returns {Record<string, DocumentFragment>} the slots by name, `default` always present\n */\n static from(el) {\n for (const child of el.children) {\n if (child.matches('[slot=\"\"]')) {\n child.removeAttribute('slot');\n }\n }\n /** @type [string, Element|DocumentFragment][] */\n const namedSlots = Array.from(el.children)\n .filter((el) => el.matches('[slot]'))\n .map((el) => {\n el.remove();\n const slot = /** @type {string} */ (el.getAttribute('slot'));\n el.removeAttribute('slot');\n return [slot, LightSlots.slotFromNode(el)];\n });\n const slots = {};\n slots.default = new DocumentFragment();\n slots.default.append(...el.childNodes);\n for (const [name, el] of namedSlots) {\n if (!(name in slots)) {\n slots[name] = new DocumentFragment();\n }\n slots[name].append(el);\n }\n return slots;\n }\n /**\n * What a slotted node contributes: a template's content, the parsed markup\n * of a `<script type=\"text/html\">`, or the node itself.\n * @param {Element} el\n * @returns {Element|DocumentFragment}\n */\n static slotFromNode(el) {\n if (el instanceof HTMLTemplateElement) {\n return document.adoptNode(el.content);\n }\n if (el instanceof HTMLScriptElement && el.type === 'text/html') {\n return Fragments.fromHtml(el.innerHTML);\n }\n return el;\n }\n}\n\n/** Waits on the parser and the document, and queries an element's own children. */\nclass Nodes {\n /**\n * Whether the parser has moved past the element: the element, or one of\n * its ancestors, has a next sibling.\n * @param {Element} el\n * @returns {boolean}\n */\n static isParsed(el) {\n for (let c = /** @type {Node | null} */ (el); c; c = c.parentNode) {\n if (c.nextSibling) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Waits for the document's DOMContentLoaded. Resolves at once when that\n * moment already passed, and for a document with no view, which receives\n * no events. Never resolves early for a document still running its\n * deferred scripts.\n * @param {Document} doc\n * @returns {Promise<void>}\n */\n static waitDomContentLoaded(doc) {\n if (doc.readyState === 'loading') {\n return new Promise((resolve) => {\n doc.addEventListener('DOMContentLoaded', () => resolve(undefined), { once: true });\n });\n }\n if (doc.readyState === 'complete') {\n return Promise.resolve();\n }\n const win = doc.defaultView;\n if (win === null) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n const done = () => {\n win.removeEventListener('DOMContentLoaded', done);\n win.removeEventListener('load', done);\n resolve(undefined);\n };\n win.addEventListener('DOMContentLoaded', done);\n win.addEventListener('load', done);\n });\n }\n\n /**\n * Waits for the element's closing tag to be parsed: one MutationObserver\n * resolves once the element, or any of its ancestors, gains a next sibling,\n * which is the parser having moved past this subtree. The document's\n * DOMContentLoaded is the deadline. Resolves immediately for an element\n * that is already parsed.\n * @param {Element} el\n * @returns {Promise<Element>} the element\n */\n static waitParsed(el) {\n if (Nodes.isParsed(el)) {\n return Promise.resolve(el);\n }\n return new Promise((resolve) => {\n const observer = new MutationObserver(() => {\n if (!Nodes.isParsed(el)) {\n return;\n }\n observer.disconnect();\n resolve(el);\n });\n for (let c = el.parentNode; c; c = c.parentNode) {\n observer.observe(c, { childList: true });\n }\n Nodes.waitDomContentLoaded(el.ownerDocument).then(() => {\n observer.disconnect();\n resolve(el);\n });\n });\n }\n\n /**\n * The first child element matching the selector, descendants excluded.\n * @param {Element|DocumentFragment} el\n * @param {string} selector\n * @returns {Element|null}\n */\n static queryChildren(el, selector) {\n for (const c of el.children) {\n if (c.matches(selector)) {\n return c;\n }\n }\n return null;\n }\n /**\n * Every child element matching the selector, descendants excluded.\n * @param {Element|DocumentFragment} el\n * @param {string} selector\n * @returns {Element[]}\n */\n static queryChildrenAll(el, selector) {\n const r = [];\n for (const c of el.children) {\n if (c.matches(selector)) {\n r.push(c);\n }\n }\n return r;\n }\n}\n\nexport { Fragments, Attributes, LightSlots, Nodes };\n","import { nodes } from './ast.mjs';\nimport { BoundedCache } from './cache.mjs';\nimport { Fragments } from './dom.mjs';\nimport { ExpressionEvaluator } from './expressions.mjs';\n\n/**\n * Collects the changes a render makes to the tree it is traversing, deferring\n * those that would break the traversal: a node marked for removal stays in\n * place until the render finishes, so the iteration containing it completes.\n */\nclass NodeOperations {\n #forRemoval = new Set();\n removed(node) {\n return this.#forRemoval.has(node);\n }\n remove(node) {\n node.replaceChildren?.();\n Object.keys(node.dataset || {})\n .filter((k) => k.startsWith('tpl'))\n .forEach((k) => {\n delete node.dataset[k];\n });\n this.#forRemoval.add(node);\n }\n popData(node, key) {\n const v = node.dataset[key];\n delete node.dataset[key];\n return v;\n }\n prepend(ref, node) {\n ref.parentNode.insertBefore(node, ref);\n }\n append(ref, node) {\n ref.parentNode.insertBefore(node, ref.nextSibling);\n }\n replace(ref, node) {\n this.prepend(ref, node);\n this.remove(ref);\n }\n cleanup() {\n for (const node of this.#forRemoval) {\n node.remove();\n }\n this.#forRemoval.clear();\n }\n}\n\n/** The `data-tpl-*` commands, each taking the node it is written on and the scope it evaluates in. */\nclass CommandsHandler {\n /**\n * The order the commands run in on one element, each seeing the node as the\n * ones before left it: tplIf gates before tplWith and tplEach push their\n * overlay, tplWhen gates after, inside the scope that overlay opened.\n */\n static ORDERED_COMMANDS = [\n 'tplIf',\n 'tplWith',\n 'tplEach',\n 'tplWhen',\n 'tplClassAppend',\n 'tplAttrAppend',\n 'tplRemove',\n 'tplVerbatim',\n ];\n /** Removes the node when the expression is falsy, evaluated before tplWith and tplEach open their overlay. */\n static tplIf(node, expression, ops, evaluator) {\n const accept = evaluator.evaluateExpression(expression);\n if (!accept) {\n ops.remove(node);\n }\n }\n static tplWith(node, expression, ops, evaluator) {\n const evaluated = evaluator.evaluateExpression(expression);\n const varName = ops.popData(node, 'tplVar');\n const newNode = new Template(node, evaluator)\n .withOverlay(varName ? { [varName]: evaluated } : evaluated)\n .render();\n ops.replace(node, newNode);\n }\n /**\n * Renders the node once per entry, in place of the node. A Map iterates as\n * `{ key, value }` entries in its own order, a plain object as `{ key, value }`\n * entries in `Object.entries` order, and any other iterable as itself; a\n * value that is none of these throws. Each render sees its entry under\n * `data-tpl-var`, or as the whole overlay without one. `data-tpl-stat` names\n * an overlay beneath the entry carrying `index`, `count`, `size`, `first`,\n * `last`, `even` and `odd`, so an entry property of the same name wins; the\n * size, and so `last`, is null for a collection that knows neither its\n * `length` nor its `size`, which is never consumed to learn it.\n */\n static tplEach(node, expression, ops, evaluator) {\n const varName = ops.popData(node, 'tplVar');\n const statName = ops.popData(node, 'tplStat');\n const template = new Template(node, evaluator);\n const evaluated = evaluator.evaluateExpression(expression);\n const proto = evaluated === null || typeof evaluated !== 'object' ? undefined : Object.getPrototypeOf(evaluated);\n const plain = !evaluated?.[Symbol.iterator] && (proto === Object.prototype || proto === null);\n const dict = plain ? Object.entries(evaluated) : null;\n const keyed = evaluated instanceof Map ? [...evaluated] : dict;\n const entries = keyed === null ? evaluated : keyed.map(([key, value]) => ({ key, value }));\n if (!entries?.[Symbol.iterator]) {\n throw new Error(`Expected an iterable got '${evaluated}'`);\n }\n const measured = statName ? entries : null;\n const counted = typeof measured?.length === 'number' ? measured.length : measured?.size;\n const size = typeof counted === 'number' ? counted : null;\n let index = 0;\n for (const v of entries) {\n const item = varName ? { [varName]: v } : v;\n const stat = {\n index,\n count: index + 1,\n size,\n first: index === 0,\n last: size === null ? null : index === size - 1,\n even: index % 2 === 0,\n odd: index % 2 === 1,\n };\n const layers = statName ? [{ [statName]: stat }, item] : [item];\n ops.prepend(node, template.withOverlay(...layers).render());\n ++index;\n }\n ops.remove(node);\n }\n /** Removes the node when the expression is falsy, evaluated in the overlay tplWith or tplEach opened. */\n static tplWhen(node, expression, ops, evaluator) {\n const accept = evaluator.evaluateExpression(expression);\n if (!accept) {\n ops.remove(node);\n }\n }\n static tplVerbatim(node, expression, ops, evaluator) {\n const newNode = node.cloneNode(true);\n ops.replace(node, newNode);\n }\n static tplRemove(node, value, ops, evaluator) {\n switch (value.toLowerCase()) {\n case 'tag': {\n const fragment = Fragments.fromChildNodes(node);\n if ('tplVerbatim' in node.dataset) {\n ops.popData(node, 'tplVerbatim');\n ops.replace(node, fragment);\n } else {\n ops.append(node, fragment);\n ops.remove(node);\n }\n break;\n }\n case 'body':\n node.replaceChildren();\n break;\n case 'all':\n ops.remove(node);\n break;\n }\n }\n static tplClassAppend(node, expression, ops, evaluator) {\n const classes = evaluator.evaluateExpression(expression);\n if (!classes) {\n return;\n }\n const classesAsArray = Array.isArray(classes) ? classes : [classes];\n const cleanClasses = classesAsArray.flatMap((c) => (typeof c === 'string' ? c.split(' ') : c)).filter(Boolean);\n if (cleanClasses.length === 0) {\n return;\n }\n node.classList.add(...cleanClasses);\n }\n static tplAttrAppend(node, expression, ops, evaluator) {\n const attributesAndValues = evaluator.evaluateExpression(expression);\n if (!attributesAndValues || attributesAndValues.length === 0) {\n return;\n }\n const tuples = Array.isArray(attributesAndValues[0]) ? attributesAndValues : [attributesAndValues];\n tuples.forEach(([k, v]) => {\n node.setAttribute(k, v);\n });\n }\n static textNode(node, expression, ops, evaluator) {\n for (const v of evaluator.evaluateTemplated(expression)) {\n if (v.value == null) {\n continue;\n }\n switch (v.type) {\n case nodes.dom.t:\n ops.prepend(node, document.createTextNode(v.value));\n break;\n case nodes.dom.h:\n ops.prepend(node, Fragments.fromHtml(typeof v.value === 'string' ? v.value : String(v.value)));\n break;\n case nodes.dom.n:\n if (!(v.value instanceof Node)) {\n throw new TypeError(`Expected a Node, got '${typeof v.value}'`);\n }\n ops.prepend(node, v.value);\n break;\n }\n }\n ops.remove(node);\n }\n}\n\nconst attributeCache = new BoundedCache(1000);\n\n/**\n * The attribute a `tpl` dataset key targets: `tplAriaLabel` is `aria-label`.\n * @param {string} dataSetKey\n * @returns {string}\n */\nfunction toAttr(dataSetKey) {\n return attributeCache.getOrCompute(dataSetKey, (k) =>\n k\n .substring(3)\n .split(/(?=[A-Z])/)\n .join('-')\n .toLowerCase(),\n );\n}\n\n/**\n * A compiled fragment together with the scope it renders in. Both are\n * immutable: adding data or replacing the scope returns a new Template, so one\n * piece of compiled markup can be rendered against any number of scopes and a\n * registry can reuse a single template for every element that requests it.\n */\nclass Template {\n /**\n * Creates a template from html.\n * @param {string} html\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromHtml(html, modules, ...data) {\n return new Template(Fragments.fromHtml(html), new ExpressionEvaluator(modules, data));\n }\n\n /**\n * Creates a template from the content of the first element matching the\n * selector, which is adopted: the template element is left empty.\n * @param {string} selector for an HTMLTemplateElement\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n * @throws when the selector matches no template element\n */\n static fromSelector(selector, modules, ...data) {\n const templateEl = document.querySelector(selector);\n if (!(templateEl instanceof HTMLTemplateElement)) {\n throw new Error('template selector does not match any template tag');\n }\n return Template.fromTemplate(templateEl, modules, ...data);\n }\n\n /**\n * Creates a template from the content of a template element, which is\n * adopted: the template element is left empty.\n * @param {HTMLTemplateElement} templateEl\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromTemplate(templateEl, modules, ...data) {\n const fragment = document.adoptNode(templateEl.content);\n return new Template(fragment, new ExpressionEvaluator(modules, data));\n }\n\n /**\n * Creates a template over a fragment, which is imported afresh on every\n * render and never modified.\n * @param {DocumentFragment} fragment\n * @param { { [k: string] : any }? } [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromFragment(fragment, modules, ...data) {\n return new Template(fragment, new ExpressionEvaluator(modules, data));\n }\n #fragment;\n #evaluator;\n /**\n * Creates a template: a fragment plus the scope it renders in.\n * @param {DocumentFragment} fragment\n * @param {ExpressionEvaluator} evaluator the modules and data stack the expressions resolve against\n */\n constructor(fragment, evaluator) {\n this.#fragment = fragment;\n this.#evaluator = evaluator;\n }\n /**\n * Creates a new Template rendering in another scope: the one way to rebind\n * a compiled template to a registry's modules and data.\n * @param {ExpressionEvaluator} evaluator\n * @returns {Template}\n */\n withEvaluator(evaluator) {\n return new Template(this.#fragment, evaluator);\n }\n /**\n * Creates a new Template over another fragment, in the same scope.\n * @param {DocumentFragment} fragment\n * @returns {Template}\n */\n withFragment(fragment) {\n return new Template(fragment, this.#evaluator);\n }\n /**\n * Creates a new Template with a module added, as `ExpressionEvaluator.withModule` does.\n * @param {string?} name\n * @param {{[k: string]: any}} value\n * @returns {Template}\n */\n withModule(name, value) {\n return new Template(this.#fragment, this.#evaluator.withModule(name, value));\n }\n /**\n * Creates a new Template with the data pushed as the innermost overlays.\n * @param {...*} data\n * @returns {Template}\n */\n withOverlay(...data) {\n return new Template(this.#fragment, this.#evaluator.withOverlay(...data));\n }\n /**\n * Evaluates an expression in this template's scope, widened by the overlays.\n * @param {string} expression\n * @param {...*} data\n * @returns {any}\n */\n evaluateExpression(expression, ...data) {\n return this.#evaluator.withOverlay(...data).evaluateExpression(expression);\n }\n /**\n * Evaluates a templated text, the `{{ }}` form, in this template's scope.\n * @param {string} text\n * @param {...*} data\n * @returns {{ type: symbol, value: any }[]} the parts, as `Expressions.MODE_TEMPLATED` describes\n */\n evaluateTemplated(text, ...data) {\n return this.#evaluator.withOverlay(...data).evaluateTemplated(text);\n }\n /**\n * The scope this template renders in.\n * @returns {ExpressionEvaluator}\n */\n evaluator() {\n return this.#evaluator;\n }\n /**\n * Renders the template into a new fragment, applying the `data-tpl-*`\n * commands and bindings and the `{{ }}` interpolations.\n * @returns {DocumentFragment}\n * @throws {RenderError} naming the node and the directive that failed\n */\n render() {\n try {\n const ops = new NodeOperations();\n const imported = document.importNode(this.#fragment, true);\n const fragment = imported.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? imported : Fragments.from(imported);\n const iterator = document.createNodeIterator(\n fragment,\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,\n Template.#NODE_FILTER,\n );\n let node;\n while ((node = iterator.nextNode()) !== null) {\n ops.cleanup();\n if (node.nodeType === Node.TEXT_NODE) {\n try {\n CommandsHandler.textNode(node, node.nodeValue, ops, this.#evaluator);\n } catch (ex) {\n throw RenderError.wrap('Error evaluating text node', node, ex);\n }\n continue;\n }\n const el = /** @type {HTMLElement} */ (node);\n for (const command of CommandsHandler.ORDERED_COMMANDS) {\n if (!(command in el.dataset)) {\n continue;\n }\n const value = ops.popData(el, command);\n try {\n CommandsHandler[command](el, value, ops, this.#evaluator);\n } catch (ex) {\n throw RenderError.wrap(`Error evaluating data-tpl-${toAttr(command)}=\"${value}\"`, el, ex);\n }\n if (ops.removed(el)) {\n break;\n }\n }\n for (const dataSetKey of Object.keys(el.dataset || {})) {\n if (!dataSetKey.startsWith('tpl')) {\n continue;\n }\n const attributeName = toAttr(dataSetKey);\n const expression = ops.popData(el, dataSetKey);\n try {\n const evaluated = this.#evaluator.evaluateExpression(expression);\n if (typeof evaluated === 'boolean') {\n el.toggleAttribute(attributeName, evaluated);\n continue;\n }\n if (evaluated !== null && evaluated !== undefined) {\n el.setAttribute(attributeName, evaluated);\n }\n } catch (ex) {\n throw RenderError.wrap(`Error evaluating data-tpl-${attributeName}=\"${expression}\"`, el, ex);\n }\n }\n }\n ops.cleanup();\n return fragment;\n } catch (ex) {\n if (ex instanceof RenderError) {\n throw ex;\n }\n throw new RenderError('Error rendering template', this.#fragment, ex);\n }\n }\n /**\n * Renders this template into the element, replacing its children.\n * @param {Element} el\n * @throws {RenderError}\n */\n renderTo(el) {\n el.replaceChildren(this.render());\n }\n /**\n * Renders this template and appends the result to the element.\n * @param {Element} el\n * @throws {RenderError}\n */\n appendTo(el) {\n el.appendChild(this.render());\n }\n /**\n * Renders this template into the first element matching the selector,\n * replacing its children; does nothing when none matches.\n * @param {string} selector\n * @throws {RenderError}\n */\n renderToSelector(selector) {\n const el = document.querySelector(selector);\n if (el) {\n this.renderTo(el);\n }\n }\n /**\n * Renders this template and appends the result to the first element\n * matching the selector; does nothing when none matches.\n * @param {string} selector\n * @throws {RenderError}\n */\n appendToSelector(selector) {\n const el = document.querySelector(selector);\n if (el) {\n this.appendTo(el);\n }\n }\n static #NODE_FILTER(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n return node.nodeValue.includes('{{') && node.nodeValue.includes('}}')\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT;\n }\n for (const attr of node.attributes) {\n if (attr.name.startsWith('data-tpl-')) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n return NodeFilter.FILTER_SKIP;\n }\n}\n\n/**\n * A render failure, one frame per nesting level, chained through `cause` from\n * the outermost frame down to the error that failed the expression. A frame's\n * message names what was being evaluated and the node's open tag, with the\n * attributes it still carries: the directive being evaluated is already off\n * the tag. The subtree is not in the message; `html` serializes it on demand.\n */\nclass RenderError extends Error {\n /** How many frames a chain keeps: a deeper nesting drops the outermost ones and marks the chain `truncated`. */\n static FRAMES = 3;\n #node;\n #depth;\n /** Whether the chain dropped outer frames to stay within FRAMES. */\n truncated = false;\n /**\n * Frames a failure, unless the chain already holds FRAMES frames: then the\n * cause is returned as it is, marked `truncated`.\n * @param {string} message\n * @param {Node} nodeOrFragment the node that failed\n * @param {any} cause\n * @returns {RenderError}\n */\n static wrap(message, nodeOrFragment, cause) {\n if (cause instanceof RenderError && cause.depth >= RenderError.FRAMES) {\n cause.truncated = true;\n return cause;\n }\n return new RenderError(message, nodeOrFragment, cause);\n }\n /**\n * @param {string} message\n * @param {Node} nodeOrFragment the node that failed\n * @param {any} cause\n */\n constructor(message, nodeOrFragment, cause) {\n super(`${message} in \\`${RenderError.describe(nodeOrFragment)}\\``, { cause });\n this.name = 'RenderError';\n this.#node = nodeOrFragment;\n this.#depth = (cause instanceof RenderError ? cause.depth : 0) + 1;\n }\n /**\n * How many frames this chain carries, this one included.\n * @returns {number}\n */\n get depth() {\n return this.#depth;\n }\n /**\n * The node the render failed on, live in the fragment being built.\n * @returns {Node}\n */\n get node() {\n return this.#node;\n }\n /**\n * The failed node's markup, whitespace trimmed, serialized on each read.\n * @returns {string}\n */\n get html() {\n return RenderError.stringify(this.#node);\n }\n /**\n * What identifies a node in a frame: an element by its open tag, a text node\n * by its source, a fragment by the open tags of the elements it holds, cut\n * at 120 characters.\n * @param {Node} nodeOrFragment\n * @returns {string}\n */\n static describe(nodeOrFragment) {\n if (nodeOrFragment.nodeType === Node.TEXT_NODE) {\n return RenderError.#ellipsize(String(nodeOrFragment.nodeValue).trim());\n }\n if (nodeOrFragment.nodeType === Node.ELEMENT_NODE) {\n const el = /** @type Element */ (nodeOrFragment);\n const attrs = Array.from(el.attributes, (a) => ` ${a.name}=\"${a.value}\"`).join('');\n return RenderError.#ellipsize(`<${el.localName}${attrs}>`);\n }\n const children = Array.from(nodeOrFragment.childNodes)\n .filter((n) => n.nodeType === Node.ELEMENT_NODE || String(n.nodeValue ?? '').trim().length > 0)\n .map((n) => RenderError.describe(n));\n return RenderError.#ellipsize(children.join(''));\n }\n static #ellipsize(text) {\n return text.length > 120 ? `${text.slice(0, 120)}…` : text;\n }\n /**\n * A node's markup with its whitespace-only text dropped and the rest trimmed.\n * @param {Node} nodeOrFragment left untouched: a clone is serialized\n * @returns {string}\n */\n static stringify(nodeOrFragment) {\n return Fragments.toHtml(RenderError.#cleanup(nodeOrFragment.cloneNode(true)));\n }\n static #cleanup(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n node.nodeValue = node.nodeValue.trim();\n }\n for (let n = 0; n < node.childNodes.length; n++) {\n const child = node.childNodes[n];\n if (child.nodeType === Node.TEXT_NODE) {\n child.nodeValue = child.nodeValue.trim();\n if (child.nodeValue.length === 0) {\n node.removeChild(child);\n n--;\n }\n } else if (child.nodeType === Node.ELEMENT_NODE) {\n RenderError.#cleanup(child);\n }\n }\n return node;\n }\n}\n\nexport { Template, RenderError };\n","import { Nodes } from './dom.mjs';\nimport { ExpressionEvaluator } from './expressions.mjs';\nimport { Template } from './template.mjs';\n\nclass UpgradeQueue {\n #q = new Map();\n #readyResolve;\n #ready = new Promise((resolve) => {\n this.#readyResolve = resolve;\n });\n constructor() {\n Nodes.waitDomContentLoaded(document).then(() => {\n this.#start();\n });\n }\n ready() {\n return this.#ready;\n }\n async #start() {\n await this.settled();\n document.dispatchEvent(\n new CustomEvent('ftl:ready', {\n bubbles: false,\n cancelable: false,\n }),\n );\n this.#readyResolve();\n }\n enqueue(el) {\n if (this.#q.has(el)) {\n return;\n }\n const { promise: finished, resolve: markFinished } = /** @type {PromiseWithResolvers<void>} */ (\n Promise.withResolvers()\n );\n const upgrade = Nodes.waitParsed(el)\n .then(() => el.upgrade())\n .finally(() => {\n this.#q.delete(el);\n markFinished();\n });\n this.#q.set(el, { upgrade, finished });\n }\n async #drain(accept, pick) {\n for (;;) {\n const pending = Array.from(this.#q)\n .filter(([el]) => accept(el))\n .map(([, entry]) => pick(entry));\n if (pending.length === 0) {\n return;\n }\n await Promise.all(pending);\n }\n }\n /**\n * Waits for the whole queue to drain, the upgrades enqueued meanwhile included.\n * Never rejects: a failed upgrade counts as drained.\n * @returns {Promise<void>}\n */\n settled() {\n return this.#drain(() => true, (entry) => entry.finished);\n }\n /**\n * Waits for the accepted upgrades, the ones enqueued meanwhile included,\n * rejecting with the first that failed.\n * @param {(el: Element) => boolean} accept\n * @returns {Promise<void>}\n */\n upgraded(accept) {\n return this.#drain(accept, (entry) => entry.upgrade);\n }\n whenUpgraded(el) {\n return this.#q.get(el)?.upgrade;\n }\n pending() {\n return Array.from(this.#q.keys());\n }\n}\n\n/**\n * The page's single source of truth for elements, modules, data, components\n * and attribute mappers. Elements defined before configure() are deferred and\n * defined by it; from then on every defineElement takes effect immediately.\n * The exported `registry` singleton is the page's own; a `new Registry()` is a\n * separate instance with its own upgrade queue, which dispatches its own\n * ftl:ready on the document, while Rendering waits on the singleton alone.\n */\nclass Registry {\n #tagToClass = {};\n #configured = false;\n #mappers = {\n string: {\n unmarshal(str, name, el) {\n return str;\n },\n marshal(value, name, el) {\n return value == null ? null : String(value);\n },\n },\n number: {\n unmarshal(str, name, el) {\n return str === null ? null : Number(str);\n },\n marshal(value, name, el) {\n return value == null ? null : String(value);\n },\n },\n presence: {\n unmarshal(str, name, el) {\n return str !== null;\n },\n marshal(value, name, el) {\n return value ? '' : null;\n },\n },\n bool: {\n unmarshal(str, name, el) {\n return str === 'true';\n },\n marshal(value, name, el) {\n return value == null ? null : String(value === true);\n },\n },\n json: {\n unmarshal(str, name, el) {\n return str === null ? null : JSON.parse(str);\n },\n marshal(value, name, el) {\n return value == null ? null : JSON.stringify(value);\n },\n },\n csv: {\n unmarshal(str, name, el) {\n return str === null\n ? []\n : str\n .split(',')\n .map((e) => e.trim())\n .filter((e) => e);\n },\n marshal(value, name, el) {\n return value == null ? null : value.join(',');\n },\n },\n };\n #components = {};\n #modules;\n #data = [];\n #evaluator = new ExpressionEvaluator(undefined, []);\n #upgradeQueue = new UpgradeQueue();\n /**\n * Registers a custom element under its tag: the class is augmented with its\n * BITS (observed attributes, mappers, templates) and handed to the platform.\n * Before configure() the definition is deferred, so import order never\n * matters. The element resolves its templates and components through this\n * registry, whichever one a module imports, and its `static config` is read\n * here, so a page replacing it does so before the definition.\n * @param {string} tag\n * @param {*} klass a ParsedElement subclass\n * @returns {Registry} this registry\n */\n defineElement(tag, klass) {\n if (!this.#configured) {\n this.#tagToClass[tag] = klass;\n return this;\n }\n this.#augmentAndDefineElement(tag, klass);\n return this;\n }\n /**\n * The attribute declarations a class composes along its inheritance chain,\n * base first: `observed` stay live after the upgrade and drive the property\n * `propertyOf` names, `attributes` are the configuration read once at it and\n * drive no property at all. A subclass's entry for a name overrides its\n * ancestors', so a base class declares what every subclass keeps observing\n * (a protocol attribute such as Field's disabled claim) and a leaf refines a\n * mapping, or moves a name's position, without repeating the whole list.\n * The observed attributes are applied in the composed order, a re-declared\n * name taking the position of its last declaration.\n * @param {*} klass a ParsedElement subclass\n * @returns {{ observed: string[], attributes: string[] }}\n */\n static declarationsOf(klass) {\n const chain = [];\n for (let c = klass; c !== null && c !== HTMLElement; c = Object.getPrototypeOf(c)) {\n chain.unshift(c);\n }\n const own = (name) => chain.flatMap((c) => Object.getOwnPropertyDescriptor(c, name)?.value ?? []);\n return { observed: own('observed'), attributes: own('attributes') };\n }\n /**\n * The property an observed attribute drives, by the platform's own\n * dash-to-camel rule: the one `dataset` applies, so `clear-invalid-on-change`\n * would reach `clearInvalidOnChange` the way `data-clear-invalid-on-change`\n * reaches `dataset.clearInvalidOnChange`.\n *\n * Only this direction is mapped. A property never derives its attribute: a\n * setter reflects through `reflectTo`, naming the attribute it writes.\n * @param {string} attribute\n * @returns {string}\n */\n static propertyOf(attribute) {\n return attribute.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n }\n #augmentAndDefineElement(tag, klass) {\n const { observed, attributes } = Registry.declarationsOf(klass);\n const { template, templates, slots, mappers, config } = klass;\n const declaredNames = observed.map((a) => a.split(':')[0]);\n const observedNames = [...new Set(declaredNames.reverse())].reverse();\n const attrToMapper = [...attributes, ...observed].reduce((acc, a) => {\n const [attr, maybeType] = a.split(':');\n const type = maybeType ?? 'string';\n if (!(type in this.#mappers) && !(type in (mappers ?? {}))) {\n throw new Error(`unsupported attribute type: ${type}`);\n }\n acc[attr] = mappers?.[type] ?? this.#mappers[type];\n return acc;\n }, {});\n\n const namesAndTemplates = Object.entries(\n Object.assign({}, templates, template ? { default: template } : {}),\n ).map(([k, v]) => [k, Template.fromHtml(v)]);\n const nameToTemplate = Object.fromEntries(namesAndTemplates);\n\n klass.BITS = {\n registry: this,\n enqueue: (el) => this.#upgradeQueue.enqueue(el),\n SLOTS: slots,\n CONFIG: config,\n OBSERVED: observedNames,\n DECLARED: [...new Set([...observedNames, ...attributes.map((a) => a.split(':')[0])])],\n ATTR_TO_MAPPER: attrToMapper,\n ATTR_TO_PROPERTY: Object.fromEntries(observedNames.map((a) => [a, Registry.propertyOf(a)])),\n TEMPLATES: nameToTemplate,\n };\n customElements.define(tag, klass);\n }\n /**\n * Merges one module under its name, its functions resolving as\n * `#name:fn`; an empty name merges a whole map, whose keys resolve bare,\n * as `#fn`.\n * @param {string} name\n * @param {object} value\n * @returns {Registry} this registry\n */\n defineModule(name, value) {\n const module = name ? { [name]: value } : value;\n this.#modules = { ...this.#modules, ...module };\n this.#rebind();\n return this;\n }\n /**\n * Replaces the whole module map.\n * @param {object} ms\n * @returns {Registry} this registry\n */\n defineModules(ms) {\n this.#modules = ms;\n this.#rebind();\n return this;\n }\n /**\n * Registers a named component (a loader, a response mapper), fetched back\n * through component().\n * @param {string} name\n * @param {*} value\n * @returns {Registry} this registry\n */\n defineComponent(name, value) {\n this.#components[name] = value;\n return this;\n }\n /**\n * Replaces the data stack the templates evaluate over.\n * @param {...any} data\n * @returns {Registry} this registry\n */\n defineData(...data) {\n this.#data = data;\n this.#rebind();\n return this;\n }\n /**\n * Appends to the data stack, the later entry winning a shared name.\n * @param {...any} data\n * @returns {Registry} this registry\n */\n defineOverlay(...data) {\n this.#data = [...this.#data, ...data];\n this.#rebind();\n return this;\n }\n /**\n * Registers a custom attribute mapper type, available to every later\n * `name:type` declaration.\n * @param {string} k\n * @param {{ unmarshal(str: string|null, name: string, el: Element): any, marshal(value: any, name: string, el: Element): string|null }} v\n * @returns {Registry} this registry\n */\n defineMapper(k, v) {\n this.#mappers[k] = v;\n return this;\n }\n /**\n * Hands the registry over to the plugin's configure.\n * @param {{ configure(registry: Registry): void }} p\n * @returns {Registry} this registry\n */\n plugin(p) {\n p.configure(this);\n return this;\n }\n /**\n * Defines every element deferred so far; from then on, defineElement takes\n * effect immediately.\n * @returns {Registry} this registry\n */\n configure() {\n for (const [tag, klass] of Object.entries(this.#tagToClass)) {\n this.#augmentAndDefineElement(tag, klass);\n delete this.#tagToClass[tag];\n }\n this.#configured = true;\n return this;\n }\n /**\n * Waits for the queued upgrades the filter accepts, rejecting with the first\n * that failed, the upgrades enqueued meanwhile included: the rejecting\n * barrier Rendering is a facade over.\n * @param {(el: Element) => boolean} accept\n * @returns {Promise<void>}\n */\n settle(accept) {\n return this.#upgradeQueue.upgraded(accept);\n }\n /**\n * The pending upgrade of one element: resolving when it has rendered,\n * rejecting with what its upgrade threw.\n * @param {Element} el\n * @returns {Promise<void>|undefined} undefined when the element is not queued\n */\n whenUpgraded(el) {\n return this.#upgradeQueue.whenUpgraded(el);\n }\n /**\n * The elements whose upgrade is still pending, in queue order.\n * @returns {Element[]}\n */\n pending() {\n return this.#upgradeQueue.pending();\n }\n /**\n * Waits for this registry's readiness: resolves right after its ftl:ready\n * event is dispatched on the document, and immediately when that already\n * happened. Never rejects: a failed upgrade counts as settled, and its\n * rejection is left unhandled so it still reaches the console and the\n * page's error reporting.\n * @returns {Promise<void>}\n */\n ready() {\n return this.#upgradeQueue.ready();\n }\n #rebind() {\n this.#evaluator = new ExpressionEvaluator(this.#modules, this.#data);\n }\n /**\n * The scope every template on this registry renders in: the modules and the\n * data stack, as one value. Replaced whenever either is defined, so a holder\n * of an older one keeps rendering against what it was handed.\n * @returns {ExpressionEvaluator}\n */\n evaluator() {\n return this.#evaluator;\n }\n /**\n * The component registered under the name.\n * @param {string} name\n * @returns {any} undefined when none is\n */\n component(name) {\n return this.#components[name];\n }\n}\n\nconst registry = new Registry();\n\nexport { Registry, registry };\n","import { registry } from './registry.mjs';\nimport { Template } from './template.mjs';\n\n/** The Template factories bound to the page's own registry: the same four sources, with its modules and data already applied. */\nclass Templates {\n /**\n * @param {string} html\n * @returns {Template}\n */\n static fromHtml(html) {\n return Template.fromHtml(html).withEvaluator(registry.evaluator());\n }\n /**\n * @param {string} selector for an HTMLTemplateElement\n * @returns {Template}\n */\n static fromSelector(selector) {\n return Template.fromSelector(selector).withEvaluator(registry.evaluator());\n }\n /**\n * @param {HTMLTemplateElement} templateEl consumed: its content is adopted\n * @returns {Template}\n */\n static fromTemplate(templateEl) {\n return Template.fromTemplate(templateEl).withEvaluator(registry.evaluator());\n }\n /**\n * @param {DocumentFragment} fragment\n * @returns {Template}\n */\n static fromFragment(fragment) {\n return Template.fromFragment(fragment).withEvaluator(registry.evaluator());\n }\n}\n\nexport { Templates };\n","import { registry } from './registry.mjs';\n\n/**\n * Waits for elements queued on the page's `registry` to render. Unlike\n * `registry.ready()`, these reject when an awaited upgrade fails. An element\n * defined by another Registry is awaited through that registry instead.\n */\nclass Rendering {\n /**\n * Waits for the element and its descendants, the ones their own renders\n * enqueue included.\n * @param {Element} el\n * @returns {Promise<void>} rejecting with the first upgrade that failed\n */\n static waitFor(el) {\n return registry.settle((child) => el.contains(child));\n }\n /**\n * Waits for the element's descendants, the element itself excluded: what a\n * component awaits from inside its own render.\n * @param {Element} el\n * @returns {Promise<void>} rejecting with the first upgrade that failed\n */\n static waitForChildren(el) {\n return registry.settle((child) => el !== child && el.contains(child));\n }\n}\n\nexport { Rendering };\n","import { Attributes, LightSlots } from './dom.mjs';\nimport { registry } from './registry.mjs';\nimport { Template } from './template.mjs';\n\n/**\n * An attribute Mapper.\n *\n * @typedef {object} Mapper\n * @property {(val: string|null|undefined, name: string, el: Element) => any} unmarshal\n * @property {(val: any, name: string, el: Element) => string|null} marshal\n */\n\n/**\n * The base of every fml element. A subclass declares its attributes, slots and\n * templates in statics and builds its dom in `render`; the base reads the light\n * slots, reads the declared attributes through their mappers, renders once, and\n * then forwards observed attribute writes to the matching properties. An element\n * resolves templates and components through the registry that defined it.\n */\nclass ParsedElement extends HTMLElement {\n static BITS = {\n registry,\n enqueue: (el) => {},\n SLOTS: false,\n /** @type {object|undefined} */\n CONFIG: undefined,\n /** @type {string[]} */\n OBSERVED: [],\n /** @type {string[]} */\n DECLARED: [],\n /** @type {Record<string, Mapper>} */\n ATTR_TO_MAPPER: {},\n /** @type {Record<string, string>} */\n ATTR_TO_PROPERTY: {},\n TEMPLATES: {},\n };\n static get observedAttributes() {\n return this.BITS.OBSERVED;\n }\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n /**\n * The element's ElementInternals, attached by the base for every element: a\n * subclass never calls attachInternals itself, since a second call throws.\n * A subclass declaring `static formAssociated` gets the form apis here.\n * A subclass must not redeclare the field: a class field without an\n * initializer assigns undefined after super() returns, wiping it.\n * @type {ElementInternals}\n */\n internals;\n #parsed = false;\n #started = false;\n /** the attributes whose own reflection is in flight */\n #reflecting = new Set();\n /** the observed snapshot between the upgrade's start and its render's end */\n #pending = /** @type {{ [k: string]: any } | null} */ (null);\n /** the configuration tier, read once at the upgrade and kept for the element's life */\n #frozen = /** @type {{ [k: string]: any }} */ ({});\n #bits() {\n return /** @type {typeof ParsedElement} */ (this.constructor).BITS;\n }\n #mapper(attr) {\n const mapper = this.#bits().ATTR_TO_MAPPER[attr];\n if (!mapper) {\n throw new Error(\n `${this.constructor.name} declares no attribute '${attr}': declare it in static observed or static attributes, or read it with getAttribute`,\n );\n }\n return mapper;\n }\n /**\n * Reads an attribute value through the mapper it was declared with.\n * @param {string} attr\n * @param {string|null} str\n * @returns {any}\n * @throws when the class declares no such attribute; read undeclared ones with getAttribute\n */\n unmarshal(attr, str) {\n return this.#mapper(attr).unmarshal(str, attr, this);\n }\n /**\n * Writes a value as the attribute string its declared mapper produces.\n * @param {string} attr\n * @param {any} value\n * @returns {string|null} null for a value that removes the attribute\n * @throws when the class declares no such attribute\n */\n marshal(attr, value) {\n return this.#mapper(attr).marshal(value, attr, this);\n }\n /**\n * The registry that defined this element, the page's own for an undefined one.\n * @returns {typeof registry}\n */\n get _registry() {\n return this.#bits().registry;\n }\n /**\n * The component registered under the name on this element's registry, the\n * one every ful loader and mapper resolves through.\n * @param {string} name\n * @returns {any} undefined when none is registered\n */\n component(name) {\n return this.#bits().registry.component(name);\n }\n /**\n * One of the class's templates, bound to its registry's scope with the\n * class's `static config` overlaid as `config`.\n * @param {string} [name] 'default', the `static template`, when omitted\n * @returns {Template}\n * @throws when the class declares no template of that name\n */\n template(name) {\n const target = this.#bits().TEMPLATES[name ?? 'default'];\n if (!target) {\n throw new Error(`no template named '${name ?? 'default'}' on ${this.constructor.name}`);\n }\n const t = target.withEvaluator(this.#bits().registry.evaluator());\n const config = this.#bits().CONFIG;\n return config ? t.withOverlay({ config }) : t;\n }\n connectedCallback() {\n if (this.#started) {\n return;\n }\n this.#bits().enqueue(this);\n }\n attributeChangedCallback(attr, oldValue, newValue) {\n if (oldValue === newValue) {\n return;\n }\n if (this.#reflecting.has(attr)) {\n return;\n }\n if (!this.#parsed) {\n if (this.#pending !== null && attr in this.#pending) {\n this.#pending[attr] = this.unmarshal(attr, newValue);\n }\n return;\n }\n this[this.#bits().ATTR_TO_PROPERTY[attr]] = this.unmarshal(attr, newValue);\n }\n /**\n * Upgrades once, however often the element is connected: reads the declared\n * attributes, keeps the observed ones open to writes made while the render is\n * pending, renders, then applies the observed values to their properties in\n * the order the registry composed them, a base class's before a subclass's.\n * Only then do attribute writes forward to properties, and the element gains\n * the `rendered` custom state. A render that throws leaves the forwarding\n * shut and the state unset.\n *\n * An observed attribute drives the property the registry's `propertyOf`\n * names, so a hyphenated attribute is authored with its dashes and read as\n * a camelCase property.\n * @returns {Promise<void>} rejecting with what the render threw\n */\n async upgrade() {\n if (this.#started) {\n return;\n }\n this.#started = true;\n const slots = this.#bits().SLOTS ? LightSlots.from(this) : undefined;\n const declared = Object.fromEntries(\n this.#bits().DECLARED.map((attribute) => [\n attribute,\n this.unmarshal(attribute, this.getAttribute(attribute)),\n ]),\n );\n const observedNames = new Set(this.#bits().OBSERVED);\n this.#frozen = Object.fromEntries(Object.entries(declared).filter(([name]) => !observedNames.has(name)));\n this.#pending = declared;\n try {\n await this.render({ slots });\n const properties = this.#bits().ATTR_TO_PROPERTY;\n for (const name of this.#bits().OBSERVED) {\n this[properties[name]] = declared[name];\n }\n this.#parsed = true;\n this.internals.states.add('rendered');\n } finally {\n this.#pending = null;\n }\n }\n /**\n * Renders the element from its slots alone: it builds the dom its setters\n * drive, and the base applies the declared state onto the properties as\n * soon as it returns. A render needing a declared value while it builds\n * reads it through `declared(name)`. The slots are undefined for an element\n * declaring no slots. It may be async; the upgrade awaits it.\n * @param {{ slots: Record<string, DocumentFragment> | undefined }} c\n * @returns {void | Promise<void>}\n */\n render(c) {}\n /**\n * The declared value of an attribute, unmarshalled through its mapper.\n *\n * A `static attributes` name is the configuration tier: read once when the\n * upgrade starts and answered unchanged for the element's life, so a later\n * attribute write does not quietly change how the element behaves. An\n * observed name answers the snapshot while the render is pending, kept\n * open to attribute writes landing in that window, and the live attribute\n * afterwards, the property being live by then.\n * @param {string} name\n * @returns {any}\n * @throws when the class declares no such attribute\n */\n declared(name) {\n if (name in this.#frozen) {\n return this.#frozen[name];\n }\n if (this.#pending !== null && name in this.#pending) {\n return this.#pending[name];\n }\n return this.unmarshal(name, this.getAttribute(name));\n }\n /**\n * Whether the element's render completed: the moment its properties went\n * live, which css reads as `:state(rendered)`. Unlike `:defined`, which holds\n * from the constructor, it is false until the dom exists.\n * @returns {boolean}\n */\n get rendered() {\n return this.#parsed;\n }\n /**\n * Projects a property back onto its observed attribute, marshalled through\n * the mapper the attribute was declared with.\n *\n * A value the attribute already carries is not written at all, so reflecting\n * what an attribute write just delivered ends there rather than looping, and\n * only the attribute being written is muted while it happens.\n * @param {string} attr\n * @param {any} value\n */\n reflectTo(attr, value) {\n const marshalled = this.marshal(attr, value);\n if (marshalled === this.getAttribute(attr)) {\n return;\n }\n this.#reflecting.add(attr);\n try {\n Attributes.set(this, attr, marshalled);\n } finally {\n this.#reflecting.delete(attr);\n }\n }\n}\n\nexport { ParsedElement };\n","import { BoundedCache } from './cache.mjs';\nimport { registry } from './registry.mjs';\n\n/**\n * A flat translations map: dotted keys pointing to a message, or to a plural\n * leaf carrying a CLDR plural category for each of its forms ('other' is\n * required, the missing categories of a language fall back to it).\n *\n * @typedef {Record<string, string | Record<string, string>>} Messages\n */\n\n/**\n * The receiver contract of the module functions: bound to a proxy over the\n * data stack when called from a template, or to a plain object by Localization.of().\n *\n * @typedef {{ l10n?: Messages, locale?: string }} Receiver\n */\n\nconst PLACEHOLDER = /\\{(\\w+)\\}/g;\nconst POSITIONAL = /\\{(\\d+)\\}/g;\n/** @param {any} v @returns {v is Record<string, string>} */\nconst isPlainObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);\n\n/** @param {any} problem @returns {string|undefined} the reason, unless it is missing or blank */\nconst reasonOf = (problem) =>\n typeof problem?.reason === 'string' && problem.reason.trim() !== '' ? problem.reason : undefined;\n\nconst warned = new Set();\nconst warnOnce = (problem) => {\n if (!warned.has(problem)) {\n warned.add(problem);\n console.warn(`l10n: ${problem}`);\n }\n};\n\nconst formatters = new BoundedCache(100);\n/**\n * An Intl instance, memoized by constructor, locale and options.\n * @param {{ new (locale: string | undefined, options: any): any }} ctor\n * @param {string | undefined} locale\n * @param {any} [options]\n */\nconst formatter = (ctor, locale, options) => {\n const key = `${ctor.name}|${locale ?? ''}|${options === undefined ? '' : JSON.stringify(options)}`;\n return formatters.getOrCompute(key, () => new ctor(locale, options));\n};\n\n/**\n * The translations as a template module: `#l10n:t()` for messages, plus date,\n * number and bytes formatting in the page's locale. The template form and the\n * imperative `of()` facade both resolve through the registry's scope, so they\n * always produce the same result for the same key.\n */\nclass Localization {\n /**\n * Resolves a message from the translations and interpolates its arguments.\n * A single plain object argument interpolates named placeholders\n * ({name}); anything else interpolates positional ones ({0}).\n * A plural leaf selects its form through Intl.PluralRules over the\n * numeric {count} named argument.\n *\n * @param {string} key\n * @param {...any} args\n * Each problem (a missing key, placeholder or plural form) is warned once\n * per page.\n *\n * @this {Receiver}\n * @returns {string} the message, or the key itself when the translations do not carry it\n */\n static t(key, ...args) {\n const messages = this.l10n ?? {};\n let message = Object.hasOwn(messages, key) ? messages[key] : undefined;\n if (message === undefined) {\n warnOnce(`missing message \"${key}\"`);\n return key;\n }\n const named = args.length === 1 && isPlainObject(args[0]) ? args[0] : null;\n if (isPlainObject(message)) {\n if (typeof named?.count !== 'number') {\n warnOnce(`plural message \"${key}\" needs a numeric {count}`);\n message = message.other;\n } else {\n const locale = this.locale ?? navigator?.language ?? 'en';\n const category = formatter(Intl.PluralRules, locale).select(named.count);\n message = message[category] ?? message.other;\n }\n }\n if (message === undefined || typeof message === 'object') {\n warnOnce(`plural message \"${key}\" has no \"other\" form`);\n return key;\n }\n if (named) {\n return message.replace(PLACEHOLDER, (literal, name) => {\n if (!Object.hasOwn(named, name)) {\n warnOnce(`message \"${key}\" wants {${name}}`);\n return literal;\n }\n return String(named[name]);\n });\n }\n if (args.length > 0) {\n return message.replace(POSITIONAL, (literal, index) => {\n const i = Number(index);\n if (i >= args.length) {\n warnOnce(`message \"${key}\" wants {${index}}`);\n return literal;\n }\n return String(args[i]);\n });\n }\n return message;\n }\n\n /**\n * Formats a date through Intl.DateTimeFormat in the receiver's locale.\n *\n * @param {Date | number} value\n * @param {Intl.DateTimeFormatOptions} [options]\n * @this {Receiver}\n * @returns {string}\n */\n static date(value, options) {\n return formatter(Intl.DateTimeFormat, this.locale, options).format(value);\n }\n\n /**\n * Formats a number through Intl.NumberFormat in the receiver's locale.\n *\n * @param {number} value\n * @param {Intl.NumberFormatOptions} [options]\n * @this {Receiver}\n * @returns {string}\n */\n static number(value, options) {\n return formatter(Intl.NumberFormat, this.locale, options).format(value);\n }\n\n /**\n * Formats a byte size with binary thresholds and literal unit suffixes:\n * the digits honor the locale, the units are the near-universal KiB/MiB/GiB.\n * A size exactly on a threshold takes the larger unit: 1024 is 1KiB.\n *\n * @param {number} value\n * @this {Receiver}\n * @returns {string}\n */\n static bytes(value) {\n const format = formatter(Intl.NumberFormat, this.locale, { maximumFractionDigits: 2 }).format;\n if (value >= 1024 * 1024 * 1024) {\n return `${format(value / 1024 / 1024 / 1024)}GiB`;\n }\n if (value >= 1024 * 1024) {\n return `${format(value / 1024 / 1024)}MiB`;\n }\n if (value >= 1024) {\n return `${format(value / 1024)}KiB`;\n }\n return `${format(value)}B`;\n }\n\n /**\n * What went wrong, as text for the reader. A value carrying a non-empty\n * `problems` array reads as their reasons, one per line, a blank or missing\n * reason reading as the `failure.no-reason` message. Any other value with a\n * `message` reads as that message; anything else as its string form, and\n * null or undefined as the empty string.\n *\n * @param {any} value what was thrown or rejected with\n * @this {Receiver}\n * @returns {string}\n */\n static failure(value) {\n if (Array.isArray(value?.problems) && value.problems.length > 0) {\n return value.problems.map((p) => reasonOf(p) ?? Localization.t.call(this, 'failure.no-reason')).join('\\n');\n }\n if (value?.message !== undefined) {\n return String(value.message);\n }\n return value == null ? '' : String(value);\n }\n\n /**\n * An imperative facade over the module functions, resolving the translations\n * and the locale from the registry overlays on every call, the same lookup a\n * template makes: a facade taken at module scope, before the plugin\n * configures, still sees the translations.\n *\n * @param {{ locale?: string }} [overrides] an explicit locale, winning over the registry one\n * @returns {{ t: (key: string, ...args: any[]) => string, date: (value: Date | number, options?: Intl.DateTimeFormatOptions) => string, number: (value: number, options?: Intl.NumberFormatOptions) => string, bytes: (value: number) => string, failure: (value: any) => string }}\n */\n static of(overrides = {}) {\n const resolve = (prop) => registry.evaluator().resolve(prop);\n /** @param {any} fn */\n const bind =\n (fn) =>\n (...args) =>\n fn.apply({ l10n: resolve('l10n'), locale: overrides.locale ?? resolve('locale') }, args);\n return {\n t: bind(Localization.t),\n date: bind(Localization.date),\n number: bind(Localization.number),\n bytes: bind(Localization.bytes),\n failure: bind(Localization.failure),\n };\n }\n}\n\nexport { Localization };\n"],"names":["BoundedCache","max","entries","Map","constructor","this","getOrCompute","key","compute","has","get","value","size","delete","keys","next","set","nodes","ter","Symbol","elv","nullc","or","and","eq","cmp","not","access","member","subscript","method","call","tstring","literal","array","dict","function","symbol","templated","ten","teh","tet","tel","dom","t","h","n","$top_level_initializer","resolveInStack","dataStack","prop","length","i","overlay","EvaluatingVisitor","modules","resolve","reportableName","node","index","source","lhs","rhs","type","cached_resolve_proxy","resolve_proxy","Proxy","target","visit","expr","op","Error","fnRef","module","fn","args","map","arg","apply","result","parts","len","evaluated","Object","fromEntries","entry","v","cond","ifTrue","ifFalse","prev","cur","ns","name","visitRoot","ast","toString","Expressions","static","parse","expression","mode","astCache","peg$f4","c","peg$f12","head","peg$f14","peg$f28","TemplatedRoot","s0","s1","peg$parseTemplatedExpression","peg$FAILED","push","TemplatedExpression","peg$currPos","s2","input","substr","peg$c1","peg$silentFails","peg$fail","peg$e0","peg$parseBeginNode","s3","peg$parseExpressionRoot","s4","peg$c2","peg$e1","peg$parseEndNode","peg$c3","peg$e2","peg$parseBeginHtml","peg$c4","peg$e3","peg$parseEndHtml","peg$f1","peg$c5","peg$e4","peg$parseBeginText","peg$c6","peg$e5","peg$parseEndText","peg$f2","charAt","peg$r0","test","peg$e6","substring","charCodeAt","peg$c7","peg$e7","peg$e8","peg$c9","peg$e9","s5","s6","undefined","join","peg$parseTemplatedText","peg$f3","ExpressionRoot","peg$parse_","r","peg$parseTernaryExpression","TernaryExpression","peg$parseElvisExpression","peg$c13","peg$e10","s7","peg$c15","peg$e11","s9","ElvisExpression","peg$parseNullCoalescingExpression","peg$c17","peg$e12","NullCoalescingExpression","peg$parseOrExpression","peg$c19","peg$e13","OrExpression","peg$parseAndExpression","tail","peg$c22","peg$e14","peg$f10","AndExpression","peg$parseEqExpression","peg$c24","peg$e15","peg$f11","EqExpression","peg$parseRelExpression","peg$parseEqualityOp","element","peg$f13","RelExpression","peg$parseNotExpression","peg$parseRelationalOp","peg$f15","NotExpression","peg$c26","peg$e16","peg$parseGroupingExpression","peg$parseAccessExpression","peg$parseAccess","AccessExpression","peg$c28","peg$e18","peg$c29","peg$e19","peg$parseWord","peg$e17","peg$parseAccessMember","peg$c30","peg$e21","peg$c31","peg$e22","peg$e20","peg$parseAccessSubscript","peg$c32","peg$e24","peg$c34","peg$e25","peg$c36","peg$e26","peg$e23","peg$parseAccessMethodCall","GroupingExpression","e","peg$c45","peg$e44","peg$e43","peg$parseModuleFunction","peg$f22","peg$e27","peg$parseModuleFunctionCall","peg$c39","peg$e29","peg$r1","peg$e30","s8","parseFloat","peg$e28","peg$parseNumberLiteral","peg$parseStringLiteral","peg$f31","peg$e41","peg$parseArrayLiteral","s11","s13","peg$c43","peg$e38","peg$e42","peg$parseDictLiteral","peg$parseAnyLiteral","s","keywords","peg$e47","peg$parseIdentifier","StringLiteral","peg$c40","peg$e32","peg$r2","peg$e33","peg$c41","peg$e34","peg$r3","peg$e35","peg$c42","peg$e36","peg$parseTemplateStringExpression","peg$parseTemplateStringLiteral","peg$e31","TemplateStringExpression","peg$e37","TemplateStringLiteral","peg$r4","peg$e40","char","peg$e39","Word","peg$r5","peg$e45","peg$r6","peg$e46","EqualityOp","peg$c49","peg$e48","peg$c50","peg$e49","RelationalOp","peg$c51","peg$e50","peg$c52","peg$e51","peg$c53","peg$e52","peg$c54","peg$e53","_","peg$r7","peg$e54","startRule","MODE_TEMPLATED","evaluate","interpret","ExpressionEvaluator","withModule","withOverlay","data","evaluateExpression","MODE_EXPRESSION","evaluateTemplated","text","Fragments","fromHtml","html","el","document","createElement","innerHTML","trim","adoptNode","content","toHtml","fragment","appendChild","isBlank","childElementCount","textContent","from","DocumentFragment","fromChildNodes","firstChild","Attributes","uid","prefix","id","defaultValue","k","hasAttribute","setAttribute","getAttribute","forward","to","getAttributeNames","filter","a","startsWith","forEach","classes","split","classList","add","attr","removeAttribute","LightSlots","child","children","matches","namedSlots","Array","remove","slot","slotFromNode","slots","default","append","childNodes","HTMLTemplateElement","HTMLScriptElement","Nodes","isParsed","parentNode","nextSibling","waitDomContentLoaded","doc","readyState","Promise","addEventListener","once","win","defaultView","done","removeEventListener","waitParsed","observer","MutationObserver","disconnect","observe","childList","ownerDocument","then","queryChildren","selector","queryChildrenAll","NodeOperations","forRemoval","Set","removed","replaceChildren","dataset","popData","prepend","ref","insertBefore","replace","cleanup","clear","CommandsHandler","tplIf","ops","evaluator","tplWith","varName","newNode","Template","render","tplEach","statName","template","proto","getPrototypeOf","iterator","prototype","keyed","measured","counted","item","stat","count","first","last","even","odd","layers","tplWhen","tplVerbatim","cloneNode","tplRemove","toLowerCase","tplClassAppend","cleanClasses","isArray","flatMap","Boolean","tplAttrAppend","attributesAndValues","textNode","createTextNode","String","Node","TypeError","attributeCache","toAttr","dataSetKey","fromSelector","templateEl","querySelector","fromTemplate","fromFragment","withEvaluator","withFragment","imported","importNode","nodeType","DOCUMENT_FRAGMENT_NODE","createNodeIterator","NodeFilter","SHOW_ELEMENT","SHOW_TEXT","NODE_FILTER","nextNode","TEXT_NODE","nodeValue","ex","RenderError","wrap","command","ORDERED_COMMANDS","attributeName","toggleAttribute","renderTo","appendTo","renderToSelector","appendToSelector","includes","FILTER_ACCEPT","FILTER_REJECT","attributes","FILTER_SKIP","depth","truncated","message","nodeOrFragment","cause","FRAMES","super","describe","stringify","ellipsize","ELEMENT_NODE","attrs","localName","slice","removeChild","UpgradeQueue","q","readyResolve","ready","start","settled","dispatchEvent","CustomEvent","bubbles","cancelable","enqueue","promise","finished","markFinished","withResolvers","upgrade","finally","drain","accept","pick","pending","all","upgraded","whenUpgraded","Registry","tagToClass","configured","mappers","string","unmarshal","str","marshal","number","Number","presence","bool","json","JSON","csv","components","upgradeQueue","defineElement","tag","klass","augmentAndDefineElement","declarationsOf","chain","HTMLElement","unshift","own","getOwnPropertyDescriptor","observed","propertyOf","attribute","toUpperCase","templates","config","declaredNames","observedNames","reverse","attrToMapper","reduce","acc","maybeType","namesAndTemplates","assign","nameToTemplate","BITS","registry","SLOTS","CONFIG","OBSERVED","DECLARED","ATTR_TO_MAPPER","ATTR_TO_PROPERTY","TEMPLATES","customElements","define","defineModule","rebind","defineModules","ms","defineComponent","defineData","defineOverlay","defineMapper","plugin","p","configure","settle","component","Templates","Rendering","waitFor","contains","waitForChildren","ParsedElement","observedAttributes","internals","attachInternals","parsed","started","reflecting","frozen","bits","mapper","_registry","connectedCallback","attributeChangedCallback","oldValue","newValue","declared","properties","states","rendered","reflectTo","marshalled","PLACEHOLDER","POSITIONAL","isPlainObject","warned","warnOnce","problem","console","warn","formatters","formatter","ctor","locale","options","Localization","messages","l10n","hasOwn","named","other","navigator","language","Intl","PluralRules","select","date","DateTimeFormat","format","NumberFormat","bytes","maximumFractionDigits","failure","problems","reasonOf","reason","of","overrides","bind"],"mappings":"AAIA,MAAMA,EACFC,GACAC,GAAW,IAAIC,IAEf,WAAAC,CAAYH,GACRI,MAAKJ,EAAOA,CAChB,CAUA,YAAAK,CAAaC,EAAKC,GACd,GAAIH,MAAKH,EAASO,IAAIF,GAClB,OAAOF,MAAKH,EAASQ,IAAIH,GAE7B,MAAMI,EAAQH,EAAQD,GAKtB,OAJIF,MAAKH,EAASU,MAAQP,MAAKJ,GAC3BI,MAAKH,EAASW,OAAOR,MAAKH,EAASY,OAAOC,OAAOJ,OAErDN,MAAKH,EAASc,IAAIT,EAAKI,GAChBA,CACX,CAEA,QAAIC,GACA,OAAOP,MAAKH,EAASU,IACzB,EClCJ,MAAMK,EAAQ,CACVC,IAAKC,OAAO,WACZC,IAAKD,OAAO,SACZE,MAAOF,OAAO,oBACdG,GAAIH,OAAO,MACXI,IAAKJ,OAAO,OACZK,GAAIL,OAAO,MACX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CAWA,YAAOmoB,CAAMnoB,GACT,MAAMioB,EAASjB,EAAUY,KAAKM,aAAcxoB,KAAKwnB,OAAQ,CAAEkB,sBAAuB,IAAKH,OACvF,OAAIjoB,GAAS,WACF,GAAGioB,EAAOjoB,EAAQ,KAAO,KAAO,WAEvCA,GAAS,QACF,GAAGioB,EAAOjoB,EAAQ,KAAO,WAEhCA,GAAS,KACF,GAAGioB,EAAOjoB,EAAQ,WAEtB,GAAGioB,EAAOjoB,KACrB,CAaA,cAAOqoB,CAAQroB,GACX,OAAIiW,MAAMkF,QAAQnb,GAAOsoB,WAAatoB,EAAMsoB,SAAS9lB,OAAS,EACnDxC,EAAMsoB,SAASrkB,IAAKwgB,IAAM8D,OArJ3B3B,EAqJoCnC,GApJvB,iBAApBmC,GAAS4B,QAAiD,KAA1B5B,EAAQ4B,OAAO/U,OAAgBmT,EAAQ4B,YAASrf,IAoJ/Bie,EAAanlB,EAAEb,KAAK1B,KAAM,qBArJrE,IAACknB,IAqJ0Fxd,KAAK,WAElFD,IAAnBnJ,GAAOqe,QACA3C,OAAO1b,EAAMqe,SAER,MAATre,EAAgB,GAAK0b,OAAO1b,EACvC,CAWA,SAAOyoB,CAAGC,EAAY,IAClB,MAAM7lB,EAAWN,GAAS+gB,EAASlK,YAAYvW,QAAQN,GAEjDomB,EACD5kB,GACD,IAAIC,IACAD,EAAGI,MAAM,CAAEmjB,KAAMzkB,EAAQ,QAASqkB,OAAQwB,EAAUxB,QAAUrkB,EAAQ,WAAamB,GAC3F,MAAO,CACH/B,EAAG0mB,EAAKvB,EAAanlB,GACrB8lB,KAAMY,EAAKvB,EAAaW,MACxB7G,OAAQyH,EAAKvB,EAAalG,QAC1BiH,MAAOQ,EAAKvB,EAAae,OACzBE,QAASM,EAAKvB,EAAaiB,SAEnC"}
|
|
1
|
+
{"version":3,"file":"ftl.min.mjs","sources":["../src/ftl/cache.mjs","../src/ftl/ast.mjs","../src/ftl/expressions-parser.peggy","../src/ftl/expressions.mjs","../src/ftl/dom.mjs","../src/ftl/template.mjs","../src/ftl/registry.mjs","../src/ftl/templates.mjs","../src/ftl/rendering.mjs","../src/ftl/parsed-element.mjs","../src/ftl/l10n.mjs"],"sourcesContent":["/**\n * A Map bounded by entry count, evicting the oldest entry when full. A hit does\n * not refresh an entry: eviction follows insertion order, not use.\n */\nclass BoundedCache {\n #max;\n #entries = new Map();\n /** @param {number} max */\n constructor(max) {\n this.#max = max;\n }\n /**\n * The cached value for the key, computing and caching it on a miss. A\n * computed null or undefined is cached like any value; a throwing compute\n * caches nothing.\n * @template K, V\n * @param {K} key\n * @param {(key: K) => V} compute\n * @returns {V}\n */\n getOrCompute(key, compute) {\n if (this.#entries.has(key)) {\n return this.#entries.get(key);\n }\n const value = compute(key);\n if (this.#entries.size >= this.#max) {\n this.#entries.delete(this.#entries.keys().next().value);\n }\n this.#entries.set(key, value);\n return value;\n }\n /** @returns {number} the number of entries held */\n get size() {\n return this.#entries.size;\n }\n}\n\nexport { BoundedCache };\n","const nodes = {\n ter: Symbol('ternary'),\n elv: Symbol('elvis'),\n nullc: Symbol('null-coalescence'),\n or: Symbol('or'),\n and: Symbol('and'),\n eq: Symbol('eq'),\n cmp: Symbol('cmp'),\n not: Symbol('not'),\n access: Symbol('access'),\n member: Symbol('access-member'),\n subscript: Symbol('access-subscript'),\n method: Symbol('access-method-call'),\n call: Symbol('module-function-call'),\n tstring: Symbol('tstring'),\n literal: Symbol('literal'),\n array: Symbol('array-literal'),\n dict: Symbol('dict-literal'),\n function: Symbol('module-function'),\n symbol: Symbol('symbol'),\n templated: {\n ten: Symbol('templated-node'),\n teh: Symbol('templated-html'),\n tet: Symbol('templated-text'),\n tel: Symbol('templated-literal'),\n },\n dom: {\n t: Symbol('text'),\n h: Symbol('html'),\n n: Symbol('node'),\n },\n};\n\nexport { nodes };\n","{{\n import { nodes } from \"./ast.mjs\";\n const keywords = new Map([\n ['true', true],\n ['false', false],\n ['null', null],\n ['undefined', undefined],\n ]);\n}}\n\nTemplatedRoot = TemplatedExpression*\n\nTemplatedExpression = value:(BeginNode @ExpressionRoot EndNode) { return {type:nodes.templated.ten, value}}\n\t/ value:(BeginHtml @ExpressionRoot EndHtml) { return {type:nodes.templated.teh, value}}\n\t/ value:(BeginText @ExpressionRoot EndText) { return {type:nodes.templated.tet, value}} \n\t/ value:TemplatedText { return {type:nodes.templated.tel, value}}\n\nBeginNode = '{{{{'\nEndNode = '}}}}'\t\nBeginHtml = '{{{'\nEndHtml = '}}}'\nBeginText = '{{'\nEndText = '}}'\n\nTemplatedText\n = parts:(\n $( [^\\\\{]+ )\n / '\\\\' c:. { return c; }\n / $('{' !'{')\n )+ { return parts.join(''); }\n\nExpressionRoot\n = _ r:Expression _ { return r; }\n\nExpression = TernaryExpression\n\nTernaryExpression \n = cond:ElvisExpression _ \"?\" _ ifTrue:TernaryExpression _ \":\" _ ifFalse:TernaryExpression { return {type:nodes.ter, cond, ifTrue, ifFalse}; }\n / ElvisExpression\n\nElvisExpression\n = cond:NullCoalescingExpression _ \"?:\" _ ifFalse:ElvisExpression {return {type:nodes.elv, cond, ifFalse}; }\n / NullCoalescingExpression\n\nNullCoalescingExpression\n = lhs:OrExpression _ \"??\" _ rhs:NullCoalescingExpression { return {type:nodes.nullc, lhs, rhs}; } \n / OrExpression\n\nOrExpression \n = head:AndExpression tail:(_ \"||\" _ @rhs:AndExpression)* {\n let result = head;\n for (const rhs of tail) {\n result = {type: nodes.or, lhs: result, rhs};\n }\n return result;\n }\n\nAndExpression\n = head:EqExpression tail:(_ \"&&\" _ @rhs:EqExpression)* { \n let result = head;\n for (const rhs of tail) {\n result = {type: nodes.and, lhs: result, rhs};\n }\n return result;\n }\n\nEqExpression\n = head:RelExpression tail:(_ op:EqualityOp _ rhs:RelExpression {return {op, rhs};})* { \n let result = head;\n for (const element of tail) {\n result = {type: nodes.eq, op: element.op, lhs: result, rhs: element.rhs};\n }\n return result;\n }\n\nRelExpression\n = head:NotExpression tail:(_ op:RelationalOp _ rhs:NotExpression {return {op, rhs};})* {\n let result = head;\n for (const element of tail) {\n result = {type: nodes.cmp, op: element.op, lhs: result, rhs: element.rhs};\n }\n return result;\n }\n\n\nNotExpression\n = \"!\" _ expr:NotExpression { return {type:nodes.not, expr} }\n / Access\n\n\nAccess \n = lhs:GroupingExpression _ rhs:(@AccessExpression _)+ { return {type: nodes.access, lhs, rhs} } \n / GroupingExpression\n\n\nAccessExpression \n = AccessMember\n / AccessSubscript \n / AccessMethodCall\n \nAccessMember \"member\"\n = op:(\"?.\"/\".\") _ rhs:Word {\n return {type: nodes.member, ns: op === '?.', rhs: rhs};\n }\n\nAccessSubscript \"subscript\" \n = op:\"?.\"? \"[\" _ rhs:Expression _ \"]\" { \n return {type: nodes.subscript, ns: op !== null, rhs}; \n } \n\nAccessMethodCall \"method-call\" \n = op:\"?.\"? \"(\" _ h:(@Expression _)? t:(\",\" _ @Expression _)* \")\" { \n return {type: nodes.method, ns: op !== null, args: h === null ? [] : [h, ...t]}; \n }\n\nGroupingExpression\n = \"(\" _ e:Expression _ \")\" { return e }\n / ModuleFunctionCall\n / AnyLiteral\n / Identifier\n\n\nModuleFunctionCall \"module-function-call\" \n = fn:ModuleFunction \"(\" _ h:(@Expression _)? t:(\",\" _ @Expression _)* \")\" {\n const args = h === null ? [] : [h, ...t];\n return {type: nodes.call, value: fn, args};\n }\n\nAnyLiteral\n = NumberLiteral\n / StringLiteral\n / ArrayLiteral\n / DictLiteral\n\nNumberLiteral \"number-literal\" \n = value:$( '-'? ([0-9]+ ('.' [0-9]*)? / '.' [0-9]+ ) ) {\n return { type: nodes.literal, value: parseFloat(value) };\n }\n\nStringLiteral \"string-literal\"\n = \"'\" value:$[^']* \"'\" { return {type: nodes.literal, value}; }\n / '\"' value:$[^\"]* '\"' { return {type: nodes.literal, value}; }\n / \"`\" parts:(TemplateStringExpression / TemplateStringLiteral)* \"`\" { \n return {type: nodes.tstring, parts}; \n }\n\nTemplateStringExpression \"tstring-expression\"\n = \"{\" _ expr:Expression _ \"}\" { \n return expr; \n }\n\nTemplateStringLiteral \"tstring-literal\"\n = parts:(\n $([^\\\\`{]+)\n / \"\\\\\" c:. { return c; }\n )+ {\n return { type: nodes.literal, value: parts.join('') };\n }\n / char:$(\"{\") { \n return { type: nodes.literal, value: char }; \n }\n\nArrayLiteral \"array-literal\" \n = \"[\" _ h:(Expression)? _ t:(\",\" _ @Expression _)* \"]\" { \n const value = h === null ? [] : [h, ...t];\n return {type: nodes.array, value};\n }\n\nDictLiteral \"dict-literal\" \n = \"{\" _ h:(@StringLiteral _ \":\" _ @Expression)? _ t:(\",\" _ @StringLiteral _ \":\" _ @Expression _)* \"}\" {\n var value = []\n if (h !== null){\n value.push(h);\n }\n value.push.apply(value, t);\n return {type: nodes.dict, value}; \n }\n\nModuleFunction \"module-function\"\n = '#' module:(@Word ':')? v:Word {\n return {type: nodes.function, module, value: v}\n }\n\nWord\n = $([a-zA-Z$_][a-zA-Z$_0-9]*)\n\nIdentifier \"identifier-or-keyword\"\n = s:Word {\n return keywords.has(s)\n ? {type: nodes.literal, value: keywords.get(s)}\n : {type: nodes.symbol, value: s};\n }\n\nEqualityOp\n = \"==\"\n / \"!=\"\n\nRelationalOp\n = \">=\"\n / \">\"\n / \"<=\"\n / \"<\"\n\n_ \"whitespaces\"\n = [ \\t\\n\\r]*\n\n","import { parse } from './expressions-parser.peggy';\nimport { nodes } from './ast.mjs';\nimport { BoundedCache } from './cache.mjs';\n\n/**\n * The one lookup against a data stack: the innermost overlay carrying the name\n * wins, `self` is the innermost overlay itself, and a function overlay counts\n * like an object one.\n * @param {any[]} dataStack\n * @param {string|symbol} prop\n * @returns {any} undefined when no overlay carries the name\n */\nconst resolveInStack = (dataStack, prop) => {\n if (prop === 'self') {\n return dataStack[dataStack.length - 1];\n }\n for (let i = dataStack.length - 1; i >= 0; i--) {\n const overlay = dataStack[i];\n if (overlay != null && (typeof overlay === 'object' || typeof overlay === 'function')) {\n if (prop in overlay) {\n return overlay[prop];\n }\n }\n }\n return undefined;\n};\n\n/**\n * Evaluates a parsed expression against a scope. One instance per evaluation:\n * it holds the modules and the data stack that names resolve against, and keeps\n * no state between visits.\n */\nclass EvaluatingVisitor {\n #modules;\n #dataStack;\n constructor(modules, dataStack) {\n this.#modules = modules;\n this.#dataStack = dataStack;\n }\n #resolve(prop) {\n return resolveInStack(this.#dataStack, prop);\n }\n /**\n * The name a missing-method report can carry: the called symbol for a bare\n * `boom()`, the member for a dotted `a.boom()`, nothing for anything else\n * (a subscript or a grouped left-hand side has no static name).\n */\n #reportableName(node, index) {\n const source = index === 0 ? node.lhs : node.rhs[index - 1];\n if (source.type === nodes.symbol) {\n return source.value;\n }\n if (source.type === nodes.member) {\n return source.rhs;\n }\n return null;\n }\n\n #cached_resolve_proxy;\n #resolve_proxy() {\n if (!this.#cached_resolve_proxy) {\n this.#cached_resolve_proxy = new Proxy(this.#dataStack, {\n get: (target, prop) => this.#resolve(prop),\n });\n }\n return this.#cached_resolve_proxy;\n }\n [nodes.and](node) {\n return this.visit(node.lhs) && this.visit(node.rhs);\n }\n [nodes.or](node) {\n return this.visit(node.lhs) || this.visit(node.rhs);\n }\n [nodes.nullc](node) {\n return this.visit(node.lhs) ?? this.visit(node.rhs);\n }\n [nodes.not](node) {\n return !this.visit(node.expr);\n }\n [nodes.eq](node) {\n const lhs = this.visit(node.lhs);\n const rhs = this.visit(node.rhs);\n const eq = lhs === rhs;\n return node.op === '==' ? eq : !eq;\n }\n [nodes.cmp](node) {\n const lhs = this.visit(node.lhs);\n const rhs = this.visit(node.rhs);\n switch (node.op) {\n case '>':\n return lhs > rhs;\n case '<':\n return lhs < rhs;\n case '>=':\n return lhs >= rhs;\n case '<=':\n return lhs <= rhs;\n default:\n throw new Error(`unknown cmp op ${node.op}`);\n }\n }\n [nodes.call](node) {\n const fnRef = node.value;\n const module = fnRef.module === null ? this.#modules : this.#modules?.[fnRef.module];\n if (!module) {\n throw new Error(`Module \"${fnRef.module}\" not found`);\n }\n const fn = module[fnRef.value];\n if (!fn) {\n throw new Error(`Function \"#${fnRef.module === null ? '' : `${fnRef.module}:`}${fnRef.value}\" not found`);\n }\n const args = node.args.map((arg) => this.visit(arg));\n return fn.apply(this.#resolve_proxy(), args);\n }\n [nodes.literal](node) {\n return node.value;\n }\n [nodes.tstring](node) {\n let result = '';\n const parts = node.parts;\n for (let i = 0, len = parts.length; i < len; i++) {\n const evaluated = this.visit(parts[i]);\n if (evaluated !== null && evaluated !== undefined) {\n result += evaluated;\n }\n }\n return result;\n }\n [nodes.symbol](node) {\n return this.#resolve(node.value);\n }\n [nodes.dict](node) {\n return Object.fromEntries(node.value.map((entry) => [this.visit(entry[0]), this.visit(entry[1])]));\n }\n [nodes.array](node) {\n return node.value.map((v) => this.visit(v));\n }\n [nodes.ter](node) {\n return this.visit(node.cond) ? this.visit(node.ifTrue) : this.visit(node.ifFalse);\n }\n [nodes.elv](node) {\n return this.visit(node.cond) || this.visit(node.ifFalse);\n }\n [nodes.access](node) {\n let prev;\n let cur = this.visit(node.lhs);\n for (let i = 0; i !== node.rhs.length; ++i) {\n const rhs = node.rhs[i];\n if (rhs.ns && cur == null) {\n return undefined;\n }\n let value;\n switch (rhs.type) {\n case nodes.member: {\n value = cur[rhs.rhs];\n break;\n }\n case nodes.subscript: {\n value = cur[this.visit(rhs.rhs)];\n break;\n }\n case nodes.method: {\n if (!cur) {\n const name = this.#reportableName(node, i);\n throw new Error(name === null ? 'Method missing' : `Method missing \"${name}\"`);\n }\n const args = rhs.args.map((arg) => this.visit(arg));\n value = cur.apply(prev, args);\n break;\n }\n }\n prev = cur;\n cur = value;\n }\n return cur;\n }\n visit(node, ...args) {\n return this[node.type](node, ...args);\n }\n visitRoot(ast, templated) {\n return !templated\n ? this.visit(ast)\n : ast.map((node) => {\n switch (node.type) {\n case nodes.templated.tel:\n return { type: nodes.dom.t, value: node.value };\n case nodes.templated.tet:\n return { type: nodes.dom.t, value: this.visit(node.value) };\n case nodes.templated.teh:\n return { type: nodes.dom.h, value: this.visit(node.value) };\n case nodes.templated.ten:\n return { type: nodes.dom.n, value: this.visit(node.value) };\n default:\n throw new Error(`unknown node type ${node.type.toString()}`);\n }\n });\n }\n}\n\n/**\n * The expression language: parsing to an ast, caching the parses, and\n * interpreting one against a scope. Member access and calls are unfiltered, so\n * an expression can do whatever the page's own javascript can. Expressions are\n * written by the page author; untrusted data is passed in as data and never\n * spliced into the expression text.\n */\nclass Expressions {\n /** Parses the whole text as one expression: `user.name`. */\n static MODE_EXPRESSION = Symbol('MODE_EXPRESSION');\n /**\n * Parses text with interpolations, `Hello {{ user.name }}`, evaluating to\n * its parts: `{ type, value }` for each literal run and each `{{ }}` (text),\n * `{{{ }}}` (html) or `{{{{ }}}}` (node) interpolation, in order.\n */\n static MODE_TEMPLATED = Symbol('MODE_TEMPLATED');\n\n static #astCache = new BoundedCache(1000);\n\n /**\n * Parses an expression, caching the ast by mode and text.\n * @param {string} expression\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] MODE_EXPRESSION when omitted\n * @returns {any} the ast\n * @throws a peggy syntax error when the text does not parse\n */\n static parse(expression, mode) {\n const key = mode?.toString() + expression;\n return this.#astCache.getOrCompute(key, () =>\n parse(expression, {\n startRule: mode === Expressions.MODE_TEMPLATED ? 'TemplatedRoot' : 'ExpressionRoot',\n }),\n );\n }\n /**\n * Evaluates a parsed ast against the modules and the data stack.\n * @param {{[k: string]: any } | null | undefined } modules\n * @param {any[]} dataStack innermost overlay last\n * @param {any} ast what `parse` answered\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] the mode it was parsed in\n * @returns {any} the value, or the list of parts in MODE_TEMPLATED\n */\n static evaluate(modules, dataStack, ast, mode) {\n return new EvaluatingVisitor(modules, dataStack).visitRoot(ast, mode === Expressions.MODE_TEMPLATED);\n }\n /**\n * Parses and evaluates an expression.\n * @param {{ [x: string]: any; } | null | undefined} modules\n * @param {any[]} dataStack innermost overlay last\n * @param {string} expression\n * @param {(typeof Expressions.MODE_EXPRESSION | typeof Expressions.MODE_TEMPLATED)?} [mode] MODE_EXPRESSION when omitted\n * @returns {any} the value, or the list of parts in MODE_TEMPLATED\n */\n static interpret(modules, dataStack, expression, mode) {\n return Expressions.evaluate(modules, dataStack, Expressions.parse(expression, mode), mode);\n }\n}\n\n/**\n * A scope: the modules that `#name:fn()` resolves against and the data stack\n * that a bare identifier resolves against, as a single value. Adding an overlay\n * returns a new evaluator instead of modifying this one, so a template can add\n * data for one subtree without affecting the rest of the render.\n */\nclass ExpressionEvaluator {\n #modules;\n #dataStack;\n /**\n * @param {{ [k: string]: any } | null | undefined} modules\n * @param {any[]} dataStack innermost overlay last\n */\n constructor(modules, dataStack) {\n this.#modules = modules;\n this.#dataStack = dataStack;\n }\n /**\n * A new evaluator with one more module: `#name:fn()` resolves into it, and an\n * empty name merges a whole map whose functions resolve bare, as `#fn()`.\n * @param {string} name\n * @param {object} value\n * @returns {ExpressionEvaluator}\n */\n withModule(name, value) {\n const module = name ? { [name]: value } : value;\n return new ExpressionEvaluator({ ...this.#modules, ...module }, this.#dataStack);\n }\n /**\n * A new evaluator with the data pushed as the innermost overlays, the last\n * one winning a shared name.\n * @param {...any} data\n * @returns {ExpressionEvaluator}\n */\n withOverlay(...data) {\n return new ExpressionEvaluator(\n this.#modules,\n data.length === 0 ? this.#dataStack : [...this.#dataStack, ...data],\n );\n }\n /**\n * Resolves a name against the data stack, with no parse round trip: the\n * lookup a template's bare identifier makes, for an imperative caller.\n * @param {string} name\n * @returns {any} undefined when no overlay carries the name\n */\n resolve(name) {\n return resolveInStack(this.#dataStack, name);\n }\n /**\n * Evaluates an expression against this scope.\n * @param {string} expression\n * @returns {any}\n */\n evaluateExpression(expression) {\n return Expressions.interpret(this.#modules, this.#dataStack, expression, Expressions.MODE_EXPRESSION);\n }\n /**\n * Evaluates a templated text, the `{{ }}` form, against this scope.\n * @param {string} text\n * @returns {{ type: symbol, value: any }[]} its parts, as MODE_TEMPLATED describes\n */\n evaluateTemplated(text) {\n return Expressions.interpret(this.#modules, this.#dataStack, text, Expressions.MODE_TEMPLATED);\n }\n}\n\nexport { Expressions, ExpressionEvaluator };\n","/** Creates, serializes and inspects DocumentFragments. */\nclass Fragments {\n /**\n * Parses html into a DocumentFragment adopted by the document, each piece\n * trimmed and the pieces joined.\n * @param {...string} html\n * @returns {DocumentFragment}\n */\n static fromHtml(...html) {\n const el = document.createElement('template');\n el.innerHTML = html.map((h) => h.trim()).join('');\n return document.adoptNode(el.content);\n }\n /**\n * Serializes a fragment, or a single node, to html, consuming it: the nodes\n * are moved out, not copied, and a fragment is left empty. Pass\n * `fragment.cloneNode(true)` to keep the original usable.\n * @param {DocumentFragment|Node} fragment\n * @returns {string}\n */\n static toHtml(fragment) {\n var el = document.createElement('template');\n el.content.appendChild(fragment);\n return el.innerHTML;\n }\n /**\n * Whether a fragment holds no element and no text but whitespace.\n * @param {DocumentFragment} fragment\n * @returns {boolean}\n */\n static isBlank(fragment) {\n return fragment.childElementCount === 0 && fragment.textContent.trim() === '';\n }\n /**\n * Moves the nodes, in order, into a new DocumentFragment.\n * @param {...Node} nodes\n * @returns {DocumentFragment}\n */\n static from(...nodes) {\n const fragment = new DocumentFragment();\n for (const node of nodes) {\n fragment.appendChild(node);\n }\n return fragment;\n }\n /**\n * Moves the children of a node into a new DocumentFragment, leaving the\n * node empty.\n * @param {Node} el\n * @returns {DocumentFragment}\n */\n static fromChildNodes(el) {\n const fragment = new DocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.firstChild);\n }\n return fragment;\n }\n}\n\n/** Attribute helpers: unique ids, defaults, prefixed forwarding, and writes where a nullish value removes the attribute. */\nclass Attributes {\n static id = 0;\n /**\n * A page-unique id under the prefix, as `prefix-n`.\n * @param {string} prefix\n * @returns {string}\n */\n static uid(prefix) {\n return `${prefix}-${++Attributes.id}`;\n }\n /**\n * Sets an attribute when the element does not carry it.\n * @param {Element} el\n * @param {string} k\n * @param {string} v\n * @returns {string|null} the attribute's value afterwards\n */\n static defaultValue(el, k, v) {\n if (!el.hasAttribute(k)) {\n el.setAttribute(k, v);\n }\n return el.getAttribute(k);\n }\n /**\n * Copies every attribute whose name starts with the prefix onto another\n * element, under the name without the prefix. `<prefix>class` adds its\n * classes to the target's instead of replacing them.\n * @param {string} prefix\n * @param {Element} from\n * @param {Element} to\n */\n static forward(prefix, from, to) {\n from.getAttributeNames()\n .filter((a) => a.startsWith(prefix))\n .forEach((a) => {\n const target = a.substring(prefix.length);\n if (target === 'class') {\n const classes =\n from\n .getAttribute(`${prefix}class`)\n ?.split(/\\s+/)\n .filter((a) => a.length) ?? [];\n to.classList.add(...classes);\n return;\n }\n to.setAttribute(target, /** @type {string} */ (from.getAttribute(a)));\n });\n }\n /**\n * Sets an attribute, or removes it when the value is nullish.\n * @param {Element} el\n * @param {string} attr\n * @param {string | null | undefined} value\n */\n static set(el, attr, value) {\n if (value == null) {\n el.removeAttribute(attr);\n } else {\n el.setAttribute(attr, value);\n }\n }\n}\n\n/**\n * Reads an element's light-dom slots: the named `<template slot=…>` and\n * `[slot=…]` children are removed and collected by name, and the remaining\n * children become the default slot. fml renders into the light dom, so this\n * replaces the slotting a shadow root would do.\n */\nclass LightSlots {\n /**\n * Takes an element's children apart into slots, leaving the element empty.\n * A named child is removed and contributes what `slotFromNode` answers;\n * children sharing a name are gathered in order. A child with an empty\n * `slot` belongs to the default slot, in document order among the rest.\n * @param {Element} el\n * @returns {Record<string, DocumentFragment>} the slots by name, `default` always present\n */\n static from(el) {\n for (const child of el.children) {\n if (child.matches('[slot=\"\"]')) {\n child.removeAttribute('slot');\n }\n }\n /** @type [string, Element|DocumentFragment][] */\n const namedSlots = Array.from(el.children)\n .filter((el) => el.matches('[slot]'))\n .map((el) => {\n el.remove();\n const slot = /** @type {string} */ (el.getAttribute('slot'));\n el.removeAttribute('slot');\n return [slot, LightSlots.slotFromNode(el)];\n });\n const slots = Object.create(null);\n slots.default = new DocumentFragment();\n slots.default.append(...el.childNodes);\n for (const [name, el] of namedSlots) {\n if (!(name in slots)) {\n slots[name] = new DocumentFragment();\n }\n slots[name].append(el);\n }\n return slots;\n }\n /**\n * What a slotted node contributes: a template's content, the parsed markup\n * of a `<script type=\"text/html\">`, or the node itself.\n * @param {Element} el\n * @returns {Element|DocumentFragment}\n */\n static slotFromNode(el) {\n if (el instanceof HTMLTemplateElement) {\n return document.adoptNode(el.content);\n }\n if (el instanceof HTMLScriptElement && el.type === 'text/html') {\n return Fragments.fromHtml(el.innerHTML);\n }\n return el;\n }\n}\n\n/** Waits on the parser and the document, and queries an element's own children. */\nclass Nodes {\n /**\n * Whether the parser has moved past the element: the element, or one of\n * its ancestors, has a next sibling.\n * @param {Element} el\n * @returns {boolean}\n */\n static isParsed(el) {\n for (let c = /** @type {Node | null} */ (el); c; c = c.parentNode) {\n if (c.nextSibling) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Waits for the document's DOMContentLoaded. Resolves at once when that\n * moment already passed, and for a document with no view, which receives\n * no events. Never resolves early for a document still running its\n * deferred scripts.\n * @param {Document} doc\n * @returns {Promise<void>}\n */\n static waitDomContentLoaded(doc) {\n if (doc.readyState === 'loading') {\n return new Promise((resolve) => {\n doc.addEventListener('DOMContentLoaded', () => resolve(undefined), { once: true });\n });\n }\n if (doc.readyState === 'complete') {\n return Promise.resolve();\n }\n const win = doc.defaultView;\n if (win === null) {\n return Promise.resolve();\n }\n // interactive spans both the deferred scripts and the time between DOMContentLoaded and load\n const [navigation] = /** @type {PerformanceNavigationTiming[]} */ (\n win.performance?.getEntriesByType('navigation') ?? []\n );\n if (navigation?.domContentLoadedEventStart > 0) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n const done = () => {\n win.removeEventListener('DOMContentLoaded', done);\n win.removeEventListener('load', done);\n resolve(undefined);\n };\n win.addEventListener('DOMContentLoaded', done);\n win.addEventListener('load', done);\n });\n }\n\n /**\n * Waits for the element's closing tag to be parsed: one MutationObserver\n * resolves once the element, or any of its ancestors, gains a next sibling,\n * which is the parser having moved past this subtree. The document's\n * DOMContentLoaded is the deadline. Resolves immediately for an element\n * that is already parsed, or once the parser has finished the document.\n * @param {Element} el\n * @returns {Promise<Element>} the element\n */\n static waitParsed(el) {\n if (Nodes.isParsed(el) || el.ownerDocument.readyState !== 'loading') {\n return Promise.resolve(el);\n }\n return new Promise((resolve) => {\n const observer = new MutationObserver(() => {\n if (!Nodes.isParsed(el)) {\n return;\n }\n observer.disconnect();\n resolve(el);\n });\n for (let c = el.parentNode; c; c = c.parentNode) {\n observer.observe(c, { childList: true });\n }\n Nodes.waitDomContentLoaded(el.ownerDocument).then(() => {\n observer.disconnect();\n resolve(el);\n });\n });\n }\n\n /**\n * The first child element matching the selector, descendants excluded.\n * @param {Element|DocumentFragment} el\n * @param {string} selector\n * @returns {Element|null}\n */\n static queryChildren(el, selector) {\n for (const c of el.children) {\n if (c.matches(selector)) {\n return c;\n }\n }\n return null;\n }\n /**\n * Every child element matching the selector, descendants excluded.\n * @param {Element|DocumentFragment} el\n * @param {string} selector\n * @returns {Element[]}\n */\n static queryChildrenAll(el, selector) {\n const r = [];\n for (const c of el.children) {\n if (c.matches(selector)) {\n r.push(c);\n }\n }\n return r;\n }\n}\n\nexport { Fragments, Attributes, LightSlots, Nodes };\n","import { nodes } from './ast.mjs';\nimport { BoundedCache } from './cache.mjs';\nimport { Fragments } from './dom.mjs';\nimport { ExpressionEvaluator } from './expressions.mjs';\n\n/**\n * Collects the changes a render makes to the tree it is traversing, deferring\n * those that would break the traversal: a node marked for removal stays in\n * place until the render finishes, so the iteration containing it completes.\n */\nclass NodeOperations {\n #forRemoval = new Set();\n removed(node) {\n return this.#forRemoval.has(node);\n }\n remove(node) {\n node.replaceChildren?.();\n Object.keys(node.dataset || {})\n .filter((k) => k.startsWith('tpl'))\n .forEach((k) => {\n delete node.dataset[k];\n });\n this.#forRemoval.add(node);\n }\n popData(node, key) {\n const v = node.dataset[key];\n delete node.dataset[key];\n return v;\n }\n prepend(ref, node) {\n ref.parentNode.insertBefore(node, ref);\n }\n append(ref, node) {\n ref.parentNode.insertBefore(node, ref.nextSibling);\n }\n replace(ref, node) {\n this.prepend(ref, node);\n this.remove(ref);\n }\n cleanup() {\n for (const node of this.#forRemoval) {\n node.remove();\n }\n this.#forRemoval.clear();\n }\n}\n\n/** The `data-tpl-*` commands, each taking the node it is written on and the scope it evaluates in. */\nclass CommandsHandler {\n /**\n * The order the commands run in on one element, each seeing the node as the\n * ones before left it: tplIf gates before tplWith and tplEach push their\n * overlay, tplWhen gates after, inside the scope that overlay opened.\n */\n static ORDERED_COMMANDS = [\n 'tplIf',\n 'tplWith',\n 'tplEach',\n 'tplWhen',\n 'tplClassAppend',\n 'tplAttrAppend',\n 'tplRemove',\n 'tplVerbatim',\n ];\n /** Removes the node when the expression is falsy, evaluated before tplWith and tplEach open their overlay. */\n static tplIf(node, expression, ops, evaluator) {\n const accept = evaluator.evaluateExpression(expression);\n if (!accept) {\n ops.remove(node);\n }\n }\n static tplWith(node, expression, ops, evaluator) {\n const evaluated = evaluator.evaluateExpression(expression);\n const varName = ops.popData(node, 'tplVar');\n const newNode = new Template(node, evaluator)\n .withOverlay(varName ? { [varName]: evaluated } : evaluated)\n .render();\n ops.replace(node, newNode);\n }\n /**\n * Renders the node once per entry, in place of the node. A Map iterates as\n * `{ key, value }` entries in its own order, a plain object as `{ key, value }`\n * entries in `Object.entries` order, and any other iterable as itself; a\n * value that is none of these throws. Each render sees its entry under\n * `data-tpl-var`, or as the whole overlay without one. `data-tpl-stat` names\n * an overlay beneath the entry carrying `index`, `count`, `size`, `first`,\n * `last`, `even` and `odd`, so an entry property of the same name wins; the\n * size, and so `last`, is null for a collection that knows neither its\n * `length` nor its `size`, which is never consumed to learn it.\n */\n static tplEach(node, expression, ops, evaluator) {\n const varName = ops.popData(node, 'tplVar');\n const statName = ops.popData(node, 'tplStat');\n const template = new Template(node, evaluator);\n const evaluated = evaluator.evaluateExpression(expression);\n const proto =\n evaluated === null || typeof evaluated !== 'object' ? undefined : Object.getPrototypeOf(evaluated);\n const plain = !evaluated?.[Symbol.iterator] && (proto === Object.prototype || proto === null);\n const dict = plain ? Object.entries(evaluated) : null;\n const keyed = evaluated instanceof Map ? [...evaluated] : dict;\n const entries = keyed === null ? evaluated : keyed.map(([key, value]) => ({ key, value }));\n if (!entries?.[Symbol.iterator]) {\n throw new Error(`Expected an iterable got '${evaluated}'`);\n }\n const measured = statName ? entries : null;\n const counted = typeof measured?.length === 'number' ? measured.length : measured?.size;\n const size = typeof counted === 'number' ? counted : null;\n let index = 0;\n for (const v of entries) {\n const item = varName ? { [varName]: v } : v;\n const stat = {\n index,\n count: index + 1,\n size,\n first: index === 0,\n last: size === null ? null : index === size - 1,\n even: index % 2 === 0,\n odd: index % 2 === 1,\n };\n const layers = statName ? [{ [statName]: stat }, item] : [item];\n ops.prepend(node, template.withOverlay(...layers).render());\n ++index;\n }\n ops.remove(node);\n }\n /** Removes the node when the expression is falsy, evaluated in the overlay tplWith or tplEach opened. */\n static tplWhen(node, expression, ops, evaluator) {\n const accept = evaluator.evaluateExpression(expression);\n if (!accept) {\n ops.remove(node);\n }\n }\n static tplVerbatim(node, expression, ops, evaluator) {\n const newNode = node.cloneNode(true);\n ops.replace(node, newNode);\n }\n static tplRemove(node, value, ops, evaluator) {\n switch (value.toLowerCase()) {\n case 'tag': {\n const fragment = Fragments.fromChildNodes(node);\n if ('tplVerbatim' in node.dataset) {\n ops.popData(node, 'tplVerbatim');\n ops.replace(node, fragment);\n } else {\n ops.append(node, fragment);\n ops.remove(node);\n }\n break;\n }\n case 'body':\n node.replaceChildren();\n break;\n case 'all':\n ops.remove(node);\n break;\n }\n }\n static tplClassAppend(node, expression, ops, evaluator) {\n const classes = evaluator.evaluateExpression(expression);\n if (!classes) {\n return;\n }\n const classesAsArray = Array.isArray(classes) ? classes : [classes];\n const cleanClasses = classesAsArray.flatMap((c) => (typeof c === 'string' ? c.split(' ') : c)).filter(Boolean);\n if (cleanClasses.length === 0) {\n return;\n }\n node.classList.add(...cleanClasses);\n }\n static tplAttrAppend(node, expression, ops, evaluator) {\n const attributesAndValues = evaluator.evaluateExpression(expression);\n if (!attributesAndValues || attributesAndValues.length === 0) {\n return;\n }\n const tuples = Array.isArray(attributesAndValues[0]) ? attributesAndValues : [attributesAndValues];\n tuples.forEach(([k, v]) => {\n if (v === null || v === undefined) {\n return;\n }\n node.setAttribute(k, v);\n });\n }\n static textNode(node, expression, ops, evaluator) {\n for (const v of evaluator.evaluateTemplated(expression)) {\n if (v.value == null) {\n continue;\n }\n switch (v.type) {\n case nodes.dom.t:\n ops.prepend(node, document.createTextNode(v.value));\n break;\n case nodes.dom.h:\n ops.prepend(node, Fragments.fromHtml(typeof v.value === 'string' ? v.value : String(v.value)));\n break;\n case nodes.dom.n:\n if (!(v.value instanceof Node)) {\n throw new TypeError(`Expected a Node, got '${typeof v.value}'`);\n }\n ops.prepend(node, v.value);\n break;\n }\n }\n ops.remove(node);\n }\n}\n\nconst attributeCache = new BoundedCache(1000);\n\n/**\n * The attribute a `tpl` dataset key targets: `tplAriaLabel` is `aria-label`.\n * @param {string} dataSetKey\n * @returns {string}\n */\nfunction toAttr(dataSetKey) {\n return attributeCache.getOrCompute(dataSetKey, (k) =>\n k\n .substring(3)\n .split(/(?=[A-Z])/)\n .join('-')\n .toLowerCase(),\n );\n}\n\n/**\n * A compiled fragment together with the scope it renders in. Both are\n * immutable: adding data or replacing the scope returns a new Template, so one\n * piece of compiled markup can be rendered against any number of scopes and a\n * registry can reuse a single template for every element that requests it.\n */\nclass Template {\n /**\n * Creates a template from html.\n * @param {string} html\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromHtml(html, modules, ...data) {\n return new Template(Fragments.fromHtml(html), new ExpressionEvaluator(modules, data));\n }\n\n /**\n * Creates a template from the content of the first element matching the\n * selector, which is adopted: the template element is left empty.\n * @param {string} selector for an HTMLTemplateElement\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n * @throws when the selector matches no template element\n */\n static fromSelector(selector, modules, ...data) {\n const templateEl = document.querySelector(selector);\n if (!(templateEl instanceof HTMLTemplateElement)) {\n throw new Error('template selector does not match any template tag');\n }\n return Template.fromTemplate(templateEl, modules, ...data);\n }\n\n /**\n * Creates a template from the content of a template element, which is\n * adopted: the template element is left empty.\n * @param {HTMLTemplateElement} templateEl\n * @param {{ [k: string] : any }?} [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromTemplate(templateEl, modules, ...data) {\n const fragment = document.adoptNode(templateEl.content);\n return new Template(fragment, new ExpressionEvaluator(modules, data));\n }\n\n /**\n * Creates a template over a fragment, which is imported afresh on every\n * render and never modified.\n * @param {DocumentFragment} fragment\n * @param { { [k: string] : any }? } [modules]\n * @param {...*} data the data stack, innermost last\n * @returns {Template}\n */\n static fromFragment(fragment, modules, ...data) {\n return new Template(fragment, new ExpressionEvaluator(modules, data));\n }\n #fragment;\n #evaluator;\n /**\n * Creates a template: a fragment plus the scope it renders in.\n * @param {DocumentFragment} fragment\n * @param {ExpressionEvaluator} evaluator the modules and data stack the expressions resolve against\n */\n constructor(fragment, evaluator) {\n this.#fragment = fragment;\n this.#evaluator = evaluator;\n }\n /**\n * Creates a new Template rendering in another scope: the one way to rebind\n * a compiled template to a registry's modules and data.\n * @param {ExpressionEvaluator} evaluator\n * @returns {Template}\n */\n withEvaluator(evaluator) {\n return new Template(this.#fragment, evaluator);\n }\n /**\n * Creates a new Template over another fragment, in the same scope.\n * @param {DocumentFragment} fragment\n * @returns {Template}\n */\n withFragment(fragment) {\n return new Template(fragment, this.#evaluator);\n }\n /**\n * Creates a new Template with a module added, as `ExpressionEvaluator.withModule` does.\n * @param {string?} name\n * @param {{[k: string]: any}} value\n * @returns {Template}\n */\n withModule(name, value) {\n return new Template(this.#fragment, this.#evaluator.withModule(name, value));\n }\n /**\n * Creates a new Template with the data pushed as the innermost overlays.\n * @param {...*} data\n * @returns {Template}\n */\n withOverlay(...data) {\n return new Template(this.#fragment, this.#evaluator.withOverlay(...data));\n }\n /**\n * Evaluates an expression in this template's scope, widened by the overlays.\n * @param {string} expression\n * @param {...*} data\n * @returns {any}\n */\n evaluateExpression(expression, ...data) {\n return this.#evaluator.withOverlay(...data).evaluateExpression(expression);\n }\n /**\n * Evaluates a templated text, the `{{ }}` form, in this template's scope.\n * @param {string} text\n * @param {...*} data\n * @returns {{ type: symbol, value: any }[]} the parts, as `Expressions.MODE_TEMPLATED` describes\n */\n evaluateTemplated(text, ...data) {\n return this.#evaluator.withOverlay(...data).evaluateTemplated(text);\n }\n /**\n * The scope this template renders in.\n * @returns {ExpressionEvaluator}\n */\n evaluator() {\n return this.#evaluator;\n }\n /**\n * Renders the template into a new fragment, applying the `data-tpl-*`\n * commands and bindings and the `{{ }}` interpolations.\n * @returns {DocumentFragment}\n * @throws {RenderError} naming the node and the directive that failed\n */\n render() {\n try {\n const ops = new NodeOperations();\n const imported = document.importNode(this.#fragment, true);\n const fragment = imported.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? imported : Fragments.from(imported);\n const iterator = document.createNodeIterator(\n fragment,\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,\n Template.#NODE_FILTER,\n );\n let node;\n while ((node = iterator.nextNode()) !== null) {\n ops.cleanup();\n if (node.nodeType === Node.TEXT_NODE) {\n try {\n CommandsHandler.textNode(node, node.nodeValue, ops, this.#evaluator);\n } catch (ex) {\n throw RenderError.wrap('Error evaluating text node', node, ex);\n }\n continue;\n }\n const el = /** @type {HTMLElement} */ (node);\n for (const command of CommandsHandler.ORDERED_COMMANDS) {\n if (!(command in el.dataset)) {\n continue;\n }\n const value = ops.popData(el, command);\n try {\n CommandsHandler[command](el, value, ops, this.#evaluator);\n } catch (ex) {\n throw RenderError.wrap(`Error evaluating data-tpl-${toAttr(command)}=\"${value}\"`, el, ex);\n }\n if (ops.removed(el)) {\n break;\n }\n }\n for (const dataSetKey of Object.keys(el.dataset || {})) {\n if (!dataSetKey.startsWith('tpl')) {\n continue;\n }\n const attributeName = toAttr(dataSetKey);\n const expression = ops.popData(el, dataSetKey);\n try {\n const evaluated = this.#evaluator.evaluateExpression(expression);\n if (typeof evaluated === 'boolean') {\n el.toggleAttribute(attributeName, evaluated);\n continue;\n }\n if (evaluated !== null && evaluated !== undefined) {\n el.setAttribute(attributeName, evaluated);\n }\n } catch (ex) {\n throw RenderError.wrap(`Error evaluating data-tpl-${attributeName}=\"${expression}\"`, el, ex);\n }\n }\n }\n ops.cleanup();\n return fragment;\n } catch (ex) {\n if (ex instanceof RenderError) {\n throw ex;\n }\n throw new RenderError('Error rendering template', this.#fragment, ex);\n }\n }\n /**\n * Renders this template into the element, replacing its children.\n * @param {Element} el\n * @throws {RenderError}\n */\n renderTo(el) {\n el.replaceChildren(this.render());\n }\n /**\n * Renders this template and appends the result to the element.\n * @param {Element} el\n * @throws {RenderError}\n */\n appendTo(el) {\n el.appendChild(this.render());\n }\n /**\n * Renders this template into the first element matching the selector,\n * replacing its children; does nothing when none matches.\n * @param {string} selector\n * @throws {RenderError}\n */\n renderToSelector(selector) {\n const el = document.querySelector(selector);\n if (el) {\n this.renderTo(el);\n }\n }\n /**\n * Renders this template and appends the result to the first element\n * matching the selector; does nothing when none matches.\n * @param {string} selector\n * @throws {RenderError}\n */\n appendToSelector(selector) {\n const el = document.querySelector(selector);\n if (el) {\n this.appendTo(el);\n }\n }\n static #NODE_FILTER(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n return node.nodeValue.includes('{{') && node.nodeValue.includes('}}')\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT;\n }\n for (const attr of node.attributes) {\n if (attr.name.startsWith('data-tpl-')) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n return NodeFilter.FILTER_SKIP;\n }\n}\n\n/**\n * A render failure, one frame per nesting level, chained through `cause` from\n * the outermost frame down to the error that failed the expression. A frame's\n * message names what was being evaluated and the node's open tag, with the\n * attributes it still carries: the directive being evaluated is already off\n * the tag. The subtree is not in the message; `html` serializes it on demand.\n */\nclass RenderError extends Error {\n /** How many frames a chain keeps: a deeper nesting drops the outermost ones and marks the chain `truncated`. */\n static FRAMES = 3;\n #node;\n #depth;\n /** Whether the chain dropped outer frames to stay within FRAMES. */\n truncated = false;\n /**\n * Frames a failure, unless the chain already holds FRAMES frames: then the\n * cause is returned as it is, marked `truncated`.\n * @param {string} message\n * @param {Node} nodeOrFragment the node that failed\n * @param {any} cause\n * @returns {RenderError}\n */\n static wrap(message, nodeOrFragment, cause) {\n if (cause instanceof RenderError && cause.depth >= RenderError.FRAMES) {\n cause.truncated = true;\n return cause;\n }\n return new RenderError(message, nodeOrFragment, cause);\n }\n /**\n * @param {string} message\n * @param {Node} nodeOrFragment the node that failed\n * @param {any} cause\n */\n constructor(message, nodeOrFragment, cause) {\n super(`${message} in \\`${RenderError.describe(nodeOrFragment)}\\``, { cause });\n this.name = 'RenderError';\n this.#node = nodeOrFragment;\n this.#depth = (cause instanceof RenderError ? cause.depth : 0) + 1;\n }\n /**\n * How many frames this chain carries, this one included.\n * @returns {number}\n */\n get depth() {\n return this.#depth;\n }\n /**\n * The node the render failed on, live in the fragment being built.\n * @returns {Node}\n */\n get node() {\n return this.#node;\n }\n /**\n * The failed node's markup, whitespace trimmed, serialized on each read.\n * @returns {string}\n */\n get html() {\n return RenderError.stringify(this.#node);\n }\n /**\n * What identifies a node in a frame: an element by its open tag, a text node\n * by its source, a fragment by the open tags of the elements it holds, cut\n * at 120 characters.\n * @param {Node} nodeOrFragment\n * @returns {string}\n */\n static describe(nodeOrFragment) {\n if (nodeOrFragment.nodeType === Node.TEXT_NODE) {\n return RenderError.#ellipsize(String(nodeOrFragment.nodeValue).trim());\n }\n if (nodeOrFragment.nodeType === Node.ELEMENT_NODE) {\n const el = /** @type Element */ (nodeOrFragment);\n const attrs = Array.from(el.attributes, (a) => ` ${a.name}=\"${a.value}\"`).join('');\n return RenderError.#ellipsize(`<${el.localName}${attrs}>`);\n }\n const children = Array.from(nodeOrFragment.childNodes)\n .filter((n) => n.nodeType === Node.ELEMENT_NODE || String(n.nodeValue ?? '').trim().length > 0)\n .map((n) => RenderError.describe(n));\n return RenderError.#ellipsize(children.join(''));\n }\n static #ellipsize(text) {\n return text.length > 120 ? `${text.slice(0, 120)}…` : text;\n }\n /**\n * A node's markup with its whitespace-only text dropped and the rest trimmed.\n * @param {Node} nodeOrFragment left untouched: a clone is serialized\n * @returns {string}\n */\n static stringify(nodeOrFragment) {\n return Fragments.toHtml(RenderError.#cleanup(nodeOrFragment.cloneNode(true)));\n }\n static #cleanup(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n node.nodeValue = node.nodeValue.trim();\n }\n for (let n = 0; n < node.childNodes.length; n++) {\n const child = node.childNodes[n];\n if (child.nodeType === Node.TEXT_NODE) {\n child.nodeValue = child.nodeValue.trim();\n if (child.nodeValue.length === 0) {\n node.removeChild(child);\n n--;\n }\n } else if (child.nodeType === Node.ELEMENT_NODE) {\n RenderError.#cleanup(child);\n }\n }\n return node;\n }\n}\n\nexport { Template, RenderError };\n","import { Nodes } from './dom.mjs';\nimport { ExpressionEvaluator } from './expressions.mjs';\nimport { Template } from './template.mjs';\n\nclass UpgradeQueue {\n #q = new Map();\n #readyResolve;\n #ready = new Promise((resolve) => {\n this.#readyResolve = resolve;\n });\n constructor() {\n Nodes.waitDomContentLoaded(document).then(() => {\n this.#start();\n });\n }\n ready() {\n return this.#ready;\n }\n async #start() {\n await this.settled();\n document.dispatchEvent(\n new CustomEvent('ftl:ready', {\n bubbles: false,\n cancelable: false,\n }),\n );\n this.#readyResolve();\n }\n enqueue(el) {\n if (this.#q.has(el)) {\n return;\n }\n const { promise: finished, resolve: markFinished } = /** @type {PromiseWithResolvers<void>} */ (\n Promise.withResolvers()\n );\n const upgrade = Nodes.waitParsed(el)\n .then(() => el.upgrade())\n .finally(() => {\n this.#q.delete(el);\n markFinished();\n });\n this.#q.set(el, { upgrade, finished });\n }\n async #drain(accept, pick) {\n for (;;) {\n const pending = Array.from(this.#q)\n .filter(([el]) => accept(el))\n .map(([, entry]) => pick(entry));\n if (pending.length === 0) {\n return;\n }\n await Promise.all(pending);\n }\n }\n /**\n * Waits for the whole queue to drain, the upgrades enqueued meanwhile included.\n * Never rejects: a failed upgrade counts as drained.\n * @returns {Promise<void>}\n */\n settled() {\n return this.#drain(() => true, (entry) => entry.finished);\n }\n /**\n * Waits for the accepted upgrades, the ones enqueued meanwhile included,\n * rejecting with the first that failed.\n * @param {(el: Element) => boolean} accept\n * @returns {Promise<void>}\n */\n upgraded(accept) {\n return this.#drain(accept, (entry) => entry.upgrade);\n }\n whenUpgraded(el) {\n return this.#q.get(el)?.upgrade;\n }\n pending() {\n return Array.from(this.#q.keys());\n }\n}\n\n/**\n * The page's single source of truth for elements, modules, data, components\n * and attribute mappers. Elements defined before configure() are deferred and\n * defined by it; from then on every defineElement takes effect immediately.\n * The exported `registry` singleton is the page's own; a `new Registry()` is a\n * separate instance with its own upgrade queue, which dispatches its own\n * ftl:ready on the document, while Rendering waits on the singleton alone.\n */\nclass Registry {\n #tagToClass = {};\n #configured = false;\n #mappers = {\n string: {\n unmarshal(str, name, el) {\n return str;\n },\n marshal(value, name, el) {\n return value == null ? null : String(value);\n },\n },\n number: {\n unmarshal(str, name, el) {\n return str === null ? null : Number(str);\n },\n marshal(value, name, el) {\n return value == null ? null : String(value);\n },\n },\n presence: {\n unmarshal(str, name, el) {\n return str !== null;\n },\n marshal(value, name, el) {\n return value ? '' : null;\n },\n },\n bool: {\n unmarshal(str, name, el) {\n return str === 'true';\n },\n marshal(value, name, el) {\n return value == null ? null : String(value === true);\n },\n },\n json: {\n unmarshal(str, name, el) {\n return str === null ? null : JSON.parse(str);\n },\n marshal(value, name, el) {\n return value == null ? null : JSON.stringify(value);\n },\n },\n csv: {\n unmarshal(str, name, el) {\n return str === null\n ? []\n : str\n .split(',')\n .map((e) => e.trim())\n .filter((e) => e);\n },\n marshal(value, name, el) {\n return value == null ? null : value.join(',');\n },\n },\n };\n #components = {};\n #modules;\n #data = [];\n #evaluator = new ExpressionEvaluator(undefined, []);\n #upgradeQueue = new UpgradeQueue();\n /**\n * Registers a custom element under its tag: the class is augmented with its\n * BITS (observed attributes, mappers, templates) and handed to the platform.\n * Before configure() the definition is deferred, so import order never\n * matters. The element resolves its templates and components through this\n * registry, whichever one a module imports, and its `static config` is read\n * here, so a page replacing it does so before the definition.\n * @param {string} tag\n * @param {*} klass a ParsedElement subclass\n * @returns {Registry} this registry\n */\n defineElement(tag, klass) {\n if (!this.#configured) {\n this.#tagToClass[tag] = klass;\n return this;\n }\n this.#augmentAndDefineElement(tag, klass);\n return this;\n }\n /**\n * The attribute declarations a class composes along its inheritance chain,\n * base first: `observed` stay live after the upgrade and drive the property\n * `propertyOf` names, `attributes` are the configuration read once at it and\n * drive no property at all. A subclass's entry for a name overrides its\n * ancestors', so a base class declares what every subclass keeps observing\n * (a protocol attribute such as Field's disabled claim) and a leaf refines a\n * mapping, or moves a name's position, without repeating the whole list.\n * The observed attributes are applied in the composed order, a re-declared\n * name taking the position of its last declaration.\n * @param {*} klass a ParsedElement subclass\n * @returns {{ observed: string[], attributes: string[] }}\n */\n static declarationsOf(klass) {\n const chain = [];\n for (let c = klass; c !== null && c !== HTMLElement; c = Object.getPrototypeOf(c)) {\n chain.unshift(c);\n }\n const own = (name) => chain.flatMap((c) => Object.getOwnPropertyDescriptor(c, name)?.value ?? []);\n return { observed: own('observed'), attributes: own('attributes') };\n }\n /**\n * The property an observed attribute drives, by the platform's own\n * dash-to-camel rule: the one `dataset` applies, so `clear-invalid-on-change`\n * would reach `clearInvalidOnChange` the way `data-clear-invalid-on-change`\n * reaches `dataset.clearInvalidOnChange`.\n *\n * Only this direction is mapped. A property never derives its attribute: a\n * setter reflects through `reflectTo`, naming the attribute it writes.\n * @param {string} attribute\n * @returns {string}\n */\n static propertyOf(attribute) {\n return attribute.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n }\n #augmentAndDefineElement(tag, klass) {\n const { observed, attributes } = Registry.declarationsOf(klass);\n const { template, templates, slots, mappers, config } = klass;\n const declaredNames = observed.map((a) => a.split(':')[0]);\n const observedNames = [...new Set(declaredNames.reverse())].reverse();\n const attrToMapper = [...attributes, ...observed].reduce((acc, a) => {\n const [attr, maybeType] = a.split(':');\n const type = maybeType ?? 'string';\n if (!(type in this.#mappers) && !(type in (mappers ?? {}))) {\n throw new Error(`unsupported attribute type: ${type}`);\n }\n acc[attr] = mappers?.[type] ?? this.#mappers[type];\n return acc;\n }, {});\n\n const namesAndTemplates = Object.entries(\n Object.assign({}, templates, template ? { default: template } : {}),\n ).map(([k, v]) => [k, Template.fromHtml(v)]);\n const nameToTemplate = Object.fromEntries(namesAndTemplates);\n\n klass.BITS = {\n registry: this,\n enqueue: (el) => this.#upgradeQueue.enqueue(el),\n SLOTS: slots,\n CONFIG: config,\n OBSERVED: observedNames,\n DECLARED: [...new Set([...observedNames, ...attributes.map((a) => a.split(':')[0])])],\n ATTR_TO_MAPPER: attrToMapper,\n ATTR_TO_PROPERTY: Object.fromEntries(observedNames.map((a) => [a, Registry.propertyOf(a)])),\n TEMPLATES: nameToTemplate,\n };\n customElements.define(tag, klass);\n }\n /**\n * Merges one module under its name, its functions resolving as\n * `#name:fn`; an empty name merges a whole map, whose keys resolve bare,\n * as `#fn`.\n * @param {string} name\n * @param {object} value\n * @returns {Registry} this registry\n */\n defineModule(name, value) {\n const module = name ? { [name]: value } : value;\n this.#modules = { ...this.#modules, ...module };\n this.#rebind();\n return this;\n }\n /**\n * Replaces the whole module map.\n * @param {object} ms\n * @returns {Registry} this registry\n */\n defineModules(ms) {\n this.#modules = ms;\n this.#rebind();\n return this;\n }\n /**\n * Registers a named component (a loader, a response mapper), fetched back\n * through component().\n * @param {string} name\n * @param {*} value\n * @returns {Registry} this registry\n */\n defineComponent(name, value) {\n this.#components[name] = value;\n return this;\n }\n /**\n * Replaces the data stack the templates evaluate over.\n * @param {...any} data\n * @returns {Registry} this registry\n */\n defineData(...data) {\n this.#data = data;\n this.#rebind();\n return this;\n }\n /**\n * Appends to the data stack, the later entry winning a shared name.\n * @param {...any} data\n * @returns {Registry} this registry\n */\n defineOverlay(...data) {\n this.#data = [...this.#data, ...data];\n this.#rebind();\n return this;\n }\n /**\n * Registers a custom attribute mapper type, available to every later\n * `name:type` declaration.\n * @param {string} k\n * @param {{ unmarshal(str: string|null, name: string, el: Element): any, marshal(value: any, name: string, el: Element): string|null }} v\n * @returns {Registry} this registry\n */\n defineMapper(k, v) {\n this.#mappers[k] = v;\n return this;\n }\n /**\n * Hands the registry over to the plugin's configure.\n * @param {{ configure(registry: Registry): void }} p\n * @returns {Registry} this registry\n */\n plugin(p) {\n p.configure(this);\n return this;\n }\n /**\n * Defines every element deferred so far; from then on, defineElement takes\n * effect immediately.\n * @returns {Registry} this registry\n */\n configure() {\n for (const [tag, klass] of Object.entries(this.#tagToClass)) {\n this.#augmentAndDefineElement(tag, klass);\n delete this.#tagToClass[tag];\n }\n this.#configured = true;\n return this;\n }\n /**\n * Waits for the queued upgrades the filter accepts, rejecting with the first\n * that failed, the upgrades enqueued meanwhile included: the rejecting\n * barrier Rendering is a facade over.\n * @param {(el: Element) => boolean} accept\n * @returns {Promise<void>}\n */\n settle(accept) {\n return this.#upgradeQueue.upgraded(accept);\n }\n /**\n * The pending upgrade of one element: resolving when it has rendered,\n * rejecting with what its upgrade threw.\n * @param {Element} el\n * @returns {Promise<void>|undefined} undefined when the element is not queued\n */\n whenUpgraded(el) {\n return this.#upgradeQueue.whenUpgraded(el);\n }\n /**\n * The elements whose upgrade is still pending, in queue order.\n * @returns {Element[]}\n */\n pending() {\n return this.#upgradeQueue.pending();\n }\n /**\n * Waits for this registry's readiness: resolves right after its ftl:ready\n * event is dispatched on the document, and immediately when that already\n * happened. Never rejects: a failed upgrade counts as settled, and its\n * rejection is left unhandled so it still reaches the console and the\n * page's error reporting.\n * @returns {Promise<void>}\n */\n ready() {\n return this.#upgradeQueue.ready();\n }\n #rebind() {\n this.#evaluator = new ExpressionEvaluator(this.#modules, this.#data);\n }\n /**\n * The scope every template on this registry renders in: the modules and the\n * data stack, as one value. Replaced whenever either is defined, so a holder\n * of an older one keeps rendering against what it was handed.\n * @returns {ExpressionEvaluator}\n */\n evaluator() {\n return this.#evaluator;\n }\n /**\n * The component registered under the name.\n * @param {string} name\n * @returns {any} undefined when none is\n */\n component(name) {\n return this.#components[name];\n }\n}\n\nconst registry = new Registry();\n\nexport { Registry, registry };\n","import { registry } from './registry.mjs';\nimport { Template } from './template.mjs';\n\n/** The Template factories bound to the page's own registry: the same four sources, with its modules and data already applied. */\nclass Templates {\n /**\n * @param {string} html\n * @returns {Template}\n */\n static fromHtml(html) {\n return Template.fromHtml(html).withEvaluator(registry.evaluator());\n }\n /**\n * @param {string} selector for an HTMLTemplateElement\n * @returns {Template}\n */\n static fromSelector(selector) {\n return Template.fromSelector(selector).withEvaluator(registry.evaluator());\n }\n /**\n * @param {HTMLTemplateElement} templateEl consumed: its content is adopted\n * @returns {Template}\n */\n static fromTemplate(templateEl) {\n return Template.fromTemplate(templateEl).withEvaluator(registry.evaluator());\n }\n /**\n * @param {DocumentFragment} fragment\n * @returns {Template}\n */\n static fromFragment(fragment) {\n return Template.fromFragment(fragment).withEvaluator(registry.evaluator());\n }\n}\n\nexport { Templates };\n","import { registry } from './registry.mjs';\n\n/**\n * Waits for elements queued on the page's `registry` to render. Unlike\n * `registry.ready()`, these reject when an awaited upgrade fails. An element\n * defined by another Registry is awaited through that registry instead.\n */\nclass Rendering {\n /**\n * Waits for the element and its descendants, the ones their own renders\n * enqueue included.\n * @param {Element} el\n * @returns {Promise<void>} rejecting with the first upgrade that failed\n */\n static waitFor(el) {\n return registry.settle((child) => el.contains(child));\n }\n /**\n * Waits for the element's descendants, the element itself excluded: what a\n * component awaits from inside its own render.\n * @param {Element} el\n * @returns {Promise<void>} rejecting with the first upgrade that failed\n */\n static waitForChildren(el) {\n return registry.settle((child) => el !== child && el.contains(child));\n }\n}\n\nexport { Rendering };\n","import { Attributes, LightSlots } from './dom.mjs';\nimport { registry } from './registry.mjs';\nimport { Template } from './template.mjs';\n\n/**\n * An attribute Mapper.\n *\n * @typedef {object} Mapper\n * @property {(val: string|null|undefined, name: string, el: Element) => any} unmarshal\n * @property {(val: any, name: string, el: Element) => string|null} marshal\n */\n\n/**\n * The base of every fml element. A subclass declares its attributes, slots and\n * templates in statics and builds its dom in `render`; the base reads the light\n * slots, reads the declared attributes through their mappers, renders once, and\n * then forwards observed attribute writes to the matching properties. An element\n * resolves templates and components through the registry that defined it.\n */\nclass ParsedElement extends HTMLElement {\n static BITS = {\n registry,\n enqueue: (el) => {},\n SLOTS: false,\n /** @type {object|undefined} */\n CONFIG: undefined,\n /** @type {string[]} */\n OBSERVED: [],\n /** @type {string[]} */\n DECLARED: [],\n /** @type {Record<string, Mapper>} */\n ATTR_TO_MAPPER: {},\n /** @type {Record<string, string>} */\n ATTR_TO_PROPERTY: {},\n TEMPLATES: {},\n };\n static get observedAttributes() {\n return this.BITS.OBSERVED;\n }\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n /**\n * The element's ElementInternals, attached by the base for every element: a\n * subclass never calls attachInternals itself, since a second call throws.\n * A subclass declaring `static formAssociated` gets the form apis here.\n * A subclass must not redeclare the field: a class field without an\n * initializer assigns undefined after super() returns, wiping it.\n * @type {ElementInternals}\n */\n internals;\n #parsed = false;\n #started = false;\n /** the attributes whose own reflection is in flight */\n #reflecting = new Set();\n /** the observed snapshot between the upgrade's start and its render's end */\n #pending = /** @type {{ [k: string]: any } | null} */ (null);\n /** the configuration tier, read once at the upgrade and kept for the element's life */\n #frozen = /** @type {{ [k: string]: any }} */ ({});\n #bits() {\n return /** @type {typeof ParsedElement} */ (this.constructor).BITS;\n }\n #mapper(attr) {\n const mapper = this.#bits().ATTR_TO_MAPPER[attr];\n if (!mapper) {\n throw new Error(\n `${this.constructor.name} declares no attribute '${attr}': declare it in static observed or static attributes, or read it with getAttribute`,\n );\n }\n return mapper;\n }\n /**\n * Reads an attribute value through the mapper it was declared with.\n * @param {string} attr\n * @param {string|null} str\n * @returns {any}\n * @throws when the class declares no such attribute; read undeclared ones with getAttribute\n */\n unmarshal(attr, str) {\n return this.#mapper(attr).unmarshal(str, attr, this);\n }\n /**\n * Writes a value as the attribute string its declared mapper produces.\n * @param {string} attr\n * @param {any} value\n * @returns {string|null} null for a value that removes the attribute\n * @throws when the class declares no such attribute\n */\n marshal(attr, value) {\n return this.#mapper(attr).marshal(value, attr, this);\n }\n /**\n * The registry that defined this element, the page's own for an undefined one.\n * @returns {typeof registry}\n */\n get _registry() {\n return this.#bits().registry;\n }\n /**\n * The component registered under the name on this element's registry, the\n * one every ful loader and mapper resolves through.\n * @param {string} name\n * @returns {any} undefined when none is registered\n */\n component(name) {\n return this.#bits().registry.component(name);\n }\n /**\n * One of the class's templates, bound to its registry's scope with the\n * class's `static config` overlaid as `config`.\n * @param {string} [name] 'default', the `static template`, when omitted\n * @returns {Template}\n * @throws when the class declares no template of that name\n */\n template(name) {\n const target = this.#bits().TEMPLATES[name ?? 'default'];\n if (!target) {\n throw new Error(`no template named '${name ?? 'default'}' on ${this.constructor.name}`);\n }\n const t = target.withEvaluator(this.#bits().registry.evaluator());\n const config = this.#bits().CONFIG;\n return config ? t.withOverlay({ config }) : t;\n }\n connectedCallback() {\n if (this.#started) {\n return;\n }\n this.#bits().enqueue(this);\n }\n attributeChangedCallback(attr, oldValue, newValue) {\n if (oldValue === newValue) {\n return;\n }\n if (this.#reflecting.has(attr)) {\n return;\n }\n if (!this.#parsed) {\n if (this.#pending !== null && attr in this.#pending) {\n this.#pending[attr] = this.unmarshal(attr, newValue);\n }\n return;\n }\n this[this.#bits().ATTR_TO_PROPERTY[attr]] = this.unmarshal(attr, newValue);\n }\n /**\n * Upgrades once, however often the element is connected: reads the declared\n * attributes, keeps the observed ones open to writes made while the render is\n * pending, renders, then applies the observed values to their properties in\n * the order the registry composed them, a base class's before a subclass's.\n * Only then do attribute writes forward to properties, and the element gains\n * the `rendered` custom state. A render that throws leaves the forwarding\n * shut and the state unset.\n *\n * An observed attribute drives the property the registry's `propertyOf`\n * names, so a hyphenated attribute is authored with its dashes and read as\n * a camelCase property.\n * @returns {Promise<void>} rejecting with what the render threw\n */\n async upgrade() {\n if (this.#started) {\n return;\n }\n this.#started = true;\n const slots = this.#bits().SLOTS ? LightSlots.from(this) : undefined;\n const declared = Object.fromEntries(\n this.#bits().DECLARED.map((attribute) => [\n attribute,\n this.unmarshal(attribute, this.getAttribute(attribute)),\n ]),\n );\n const observedNames = new Set(this.#bits().OBSERVED);\n this.#frozen = Object.fromEntries(Object.entries(declared).filter(([name]) => !observedNames.has(name)));\n this.#pending = declared;\n try {\n await this.render({ slots });\n const properties = this.#bits().ATTR_TO_PROPERTY;\n for (const name of this.#bits().OBSERVED) {\n this[properties[name]] = declared[name];\n }\n this.#parsed = true;\n this.internals.states.add('rendered');\n } finally {\n this.#pending = null;\n }\n }\n /**\n * Renders the element from its slots alone: it builds the dom its setters\n * drive, and the base applies the declared state onto the properties as\n * soon as it returns. A render needing a declared value while it builds\n * reads it through `declared(name)`. The slots are undefined for an element\n * declaring no slots. It may be async; the upgrade awaits it.\n * @param {{ slots: Record<string, DocumentFragment> | undefined }} c\n * @returns {void | Promise<void>}\n */\n render(c) {}\n /**\n * The declared value of an attribute, unmarshalled through its mapper.\n *\n * A `static attributes` name is the configuration tier: read once when the\n * upgrade starts and answered unchanged for the element's life, so a later\n * attribute write does not quietly change how the element behaves. An\n * observed name answers the snapshot while the render is pending, kept\n * open to attribute writes landing in that window, and the live attribute\n * afterwards, the property being live by then.\n * @param {string} name\n * @returns {any}\n * @throws when the class declares no such attribute\n */\n declared(name) {\n if (name in this.#frozen) {\n return this.#frozen[name];\n }\n if (this.#pending !== null && name in this.#pending) {\n return this.#pending[name];\n }\n return this.unmarshal(name, this.getAttribute(name));\n }\n /**\n * Whether the element's render completed: the moment its properties went\n * live, which css reads as `:state(rendered)`. Unlike `:defined`, which holds\n * from the constructor, it is false until the dom exists.\n * @returns {boolean}\n */\n get rendered() {\n return this.#parsed;\n }\n /**\n * Projects a property back onto its observed attribute, marshalled through\n * the mapper the attribute was declared with.\n *\n * A value the attribute already carries is not written at all, so reflecting\n * what an attribute write just delivered ends there rather than looping, and\n * only the attribute being written is muted while it happens.\n * @param {string} attr\n * @param {any} value\n */\n reflectTo(attr, value) {\n const marshalled = this.marshal(attr, value);\n if (marshalled === this.getAttribute(attr)) {\n return;\n }\n this.#reflecting.add(attr);\n try {\n Attributes.set(this, attr, marshalled);\n } finally {\n this.#reflecting.delete(attr);\n }\n }\n}\n\nexport { ParsedElement };\n","import { BoundedCache } from './cache.mjs';\nimport { registry } from './registry.mjs';\n\n/**\n * A flat translations map: dotted keys pointing to a message, or to a plural\n * leaf carrying a CLDR plural category for each of its forms ('other' is\n * required, the missing categories of a language fall back to it).\n *\n * @typedef {Record<string, string | Record<string, string>>} Messages\n */\n\n/**\n * The receiver contract of the module functions: bound to a proxy over the\n * data stack when called from a template, or to a plain object by Localization.of().\n *\n * @typedef {{ l10n?: Messages, locale?: string }} Receiver\n */\n\nconst PLACEHOLDER = /\\{(\\w+)\\}/g;\nconst POSITIONAL = /\\{(\\d+)\\}/g;\n/** @param {any} v @returns {v is Record<string, string>} */\nconst isPlainObject = (v) =>\n typeof v === 'object' && v !== null && [Object.prototype, null].includes(Object.getPrototypeOf(v));\n\n/** @param {any} problem @returns {string|undefined} the reason, unless it is missing or blank */\nconst reasonOf = (problem) =>\n typeof problem?.reason === 'string' && problem.reason.trim() !== '' ? problem.reason : undefined;\n\nconst warned = new Set();\nconst warnOnce = (problem) => {\n if (!warned.has(problem)) {\n warned.add(problem);\n console.warn(`l10n: ${problem}`);\n }\n};\n\nconst formatters = new BoundedCache(100);\n/**\n * An Intl instance, memoized by constructor, locale and options.\n * @param {{ new (locale: string | undefined, options: any): any }} ctor\n * @param {string | undefined} locale\n * @param {any} [options]\n */\nconst formatter = (ctor, locale, options) => {\n const key = `${ctor.name}|${locale ?? ''}|${options === undefined ? '' : JSON.stringify(options)}`;\n return formatters.getOrCompute(key, () => new ctor(locale, options));\n};\n\n/**\n * The translations as a template module: `#l10n:t()` for messages, plus date,\n * number and bytes formatting in the page's locale. The template form and the\n * imperative `of()` facade both resolve through the registry's scope, so they\n * always produce the same result for the same key.\n */\nclass Localization {\n /**\n * Resolves a message from the translations and interpolates its arguments.\n * A single plain object argument (an object literal, or one with a null\n * prototype) interpolates named placeholders ({name}); anything else interpolates positional ones ({0}).\n * A plural leaf selects its form through Intl.PluralRules over the\n * numeric {count} named argument.\n *\n * @param {string} key\n * @param {...any} args\n * Each problem (a missing key, placeholder or plural form) is warned once\n * per page.\n *\n * @this {Receiver}\n * @returns {string} the message, or the key itself when the translations do not carry it\n */\n static t(key, ...args) {\n const messages = this.l10n ?? {};\n let message = Object.hasOwn(messages, key) ? messages[key] : undefined;\n if (message === undefined) {\n warnOnce(`missing message \"${key}\"`);\n return key;\n }\n const named = args.length === 1 && isPlainObject(args[0]) ? args[0] : null;\n if (isPlainObject(message)) {\n if (typeof named?.count !== 'number') {\n warnOnce(`plural message \"${key}\" needs a numeric {count}`);\n message = message.other;\n } else {\n const locale = this.locale ?? navigator?.language ?? 'en';\n const category = formatter(Intl.PluralRules, locale).select(named.count);\n message = message[category] ?? message.other;\n }\n }\n if (message === undefined || typeof message === 'object') {\n warnOnce(`plural message \"${key}\" has no \"other\" form`);\n return key;\n }\n if (named) {\n return message.replace(PLACEHOLDER, (literal, name) => {\n if (!Object.hasOwn(named, name)) {\n warnOnce(`message \"${key}\" wants {${name}}`);\n return literal;\n }\n return String(named[name]);\n });\n }\n if (args.length > 0) {\n return message.replace(POSITIONAL, (literal, index) => {\n const i = Number(index);\n if (i >= args.length) {\n warnOnce(`message \"${key}\" wants {${index}}`);\n return literal;\n }\n return String(args[i]);\n });\n }\n return message;\n }\n\n /**\n * Formats a date through Intl.DateTimeFormat in the receiver's locale.\n *\n * @param {Date | number} value\n * @param {Intl.DateTimeFormatOptions} [options]\n * @this {Receiver}\n * @returns {string}\n */\n static date(value, options) {\n return formatter(Intl.DateTimeFormat, this.locale, options).format(value);\n }\n\n /**\n * Formats a number through Intl.NumberFormat in the receiver's locale.\n *\n * @param {number} value\n * @param {Intl.NumberFormatOptions} [options]\n * @this {Receiver}\n * @returns {string}\n */\n static number(value, options) {\n return formatter(Intl.NumberFormat, this.locale, options).format(value);\n }\n\n /**\n * Formats a byte size with binary thresholds and literal unit suffixes:\n * the digits honor the locale, the units are the near-universal KiB/MiB/GiB.\n * A size exactly on a threshold takes the larger unit: 1024 is 1KiB.\n *\n * @param {number} value\n * @this {Receiver}\n * @returns {string}\n */\n static bytes(value) {\n const format = formatter(Intl.NumberFormat, this.locale, { maximumFractionDigits: 2 }).format;\n if (value >= 1024 * 1024 * 1024) {\n return `${format(value / 1024 / 1024 / 1024)}GiB`;\n }\n if (value >= 1024 * 1024) {\n return `${format(value / 1024 / 1024)}MiB`;\n }\n if (value >= 1024) {\n return `${format(value / 1024)}KiB`;\n }\n return `${format(value)}B`;\n }\n\n /**\n * What went wrong, as text for the reader. A value carrying a non-empty\n * `problems` array reads as their reasons, one per line, a blank or missing\n * reason reading as the `failure.no-reason` message. Any other value with a\n * `message` reads as that message; anything else as its string form, and\n * null or undefined as the empty string.\n *\n * @param {any} value what was thrown or rejected with\n * @this {Receiver}\n * @returns {string}\n */\n static failure(value) {\n if (Array.isArray(value?.problems) && value.problems.length > 0) {\n return value.problems.map((p) => reasonOf(p) ?? Localization.t.call(this, 'failure.no-reason')).join('\\n');\n }\n if (value?.message !== undefined) {\n return String(value.message);\n }\n return value == null ? '' : String(value);\n }\n\n /**\n * An imperative facade over the module functions, resolving the translations\n * and the locale from the registry overlays on every call, the same lookup a\n * template makes: a facade taken at module scope, before the plugin\n * configures, still sees the translations.\n *\n * @param {{ locale?: string }} [overrides] an explicit locale, winning over the registry one\n * @returns {{ t: (key: string, ...args: any[]) => string, date: (value: Date | number, options?: Intl.DateTimeFormatOptions) => string, number: (value: number, options?: Intl.NumberFormatOptions) => string, bytes: (value: number) => string, failure: (value: any) => string }}\n */\n static of(overrides = {}) {\n const resolve = (prop) => registry.evaluator().resolve(prop);\n /** @param {any} fn */\n const bind =\n (fn) =>\n (...args) =>\n fn.apply({ l10n: resolve('l10n'), locale: overrides.locale ?? resolve('locale') }, args);\n return {\n t: bind(Localization.t),\n date: bind(Localization.date),\n number: bind(Localization.number),\n bytes: bind(Localization.bytes),\n failure: bind(Localization.failure),\n };\n }\n}\n\nexport { Localization };\n"],"names":["BoundedCache","max","entries","Map","constructor","this","getOrCompute","key","compute","has","get","value","size","delete","keys","next","set","nodes","ter","Symbol","elv","nullc","or","and","eq","cmp","not","access","member","subscript","method","call","tstring","literal","array","dict","function","symbol","templated","ten","teh","tet","tel","dom","t","h","n","$top_level_initializer","resolveInStack","dataStack","prop","length","i","overlay","EvaluatingVisitor","modules","resolve","reportableName","node","index","source","lhs","rhs","type","cached_resolve_proxy","resolve_proxy","Proxy","target","visit","expr","op","Error","fnRef","module","fn","args","map","arg","apply","result","parts","len","evaluated","Object","fromEntries","entry","v","cond","ifTrue","ifFalse","prev","cur","ns","name","visitRoot","ast","toString","Expressions","static","parse","expression","mode","astCache","peg$f4","c","peg$f12","head","peg$f14","peg$f28","TemplatedRoot","s0","s1","peg$parseTemplatedExpression","peg$FAILED","push","TemplatedExpression","peg$currPos","s2","input","substr","peg$c1","peg$silentFails","peg$fail","peg$e0","peg$parseBeginNode","s3","peg$parseExpressionRoot","s4","peg$c2","peg$e1","peg$parseEndNode","peg$c3","peg$e2","peg$parseBeginHtml","peg$c4","peg$e3","peg$parseEndHtml","peg$f1","peg$c5","peg$e4","peg$parseBeginText","peg$c6","peg$e5","peg$parseEndText","peg$f2","charAt","peg$charCode","charCodeAt","peg$e6","substring","peg$c7","peg$e7","peg$e8","peg$c9","peg$e9","s5","s6","undefined","join","peg$parseTemplatedText","peg$f3","ExpressionRoot","peg$parse_","r","peg$parseTernaryExpression","TernaryExpression","peg$parseElvisExpression","peg$c13","peg$e10","s7","peg$c15","peg$e11","s9","ElvisExpression","peg$parseNullCoalescingExpression","peg$c17","peg$e12","NullCoalescingExpression","peg$parseOrExpression","peg$c19","peg$e13","OrExpression","peg$parseAndExpression","tail","peg$c22","peg$e14","peg$f10","AndExpression","peg$parseEqExpression","peg$c24","peg$e15","peg$f11","EqExpression","peg$parseRelExpression","peg$parseEqualityOp","element","peg$f13","RelExpression","peg$parseNotExpression","peg$parseRelationalOp","peg$f15","NotExpression","peg$c26","peg$e16","peg$parseGroupingExpression","peg$parseAccessExpression","peg$parseAccess","AccessExpression","peg$c28","peg$e18","peg$c29","peg$e19","peg$parseWord","peg$e17","peg$parseAccessMember","peg$c30","peg$e21","peg$c31","peg$e22","peg$e20","peg$parseAccessSubscript","peg$c32","peg$e24","peg$c34","peg$e25","peg$c36","peg$e26","peg$e23","peg$parseAccessMethodCall","GroupingExpression","e","peg$c45","peg$e44","peg$e43","peg$parseModuleFunction","peg$f22","peg$e27","peg$parseModuleFunctionCall","peg$c39","peg$e29","peg$e30","s8","parseFloat","peg$e28","peg$parseNumberLiteral","peg$parseStringLiteral","peg$f31","peg$e41","peg$parseArrayLiteral","s11","s13","peg$c43","peg$e38","peg$e42","peg$parseDictLiteral","peg$parseAnyLiteral","s","keywords","peg$e47","peg$parseIdentifier","StringLiteral","peg$c40","peg$e32","peg$e33","peg$c41","peg$e34","peg$e35","peg$c42","peg$e36","peg$parseTemplateStringExpression","peg$parseTemplateStringLiteral","peg$e31","TemplateStringExpression","peg$e37","TemplateStringLiteral","peg$e40","char","peg$e39","Word","peg$e45","peg$e46","EqualityOp","peg$c49","peg$e48","peg$c50","peg$e49","RelationalOp","peg$c51","peg$e50","peg$c52","peg$e51","peg$c53","peg$e52","peg$c54","peg$e53","_","peg$e54","startRule","MODE_TEMPLATED","evaluate","interpret","ExpressionEvaluator","withModule","withOverlay","data","evaluateExpression","MODE_EXPRESSION","evaluateTemplated","text","Fragments","fromHtml","html","el","document","createElement","innerHTML","trim","adoptNode","content","toHtml","fragment","appendChild","isBlank","childElementCount","textContent","from","DocumentFragment","fromChildNodes","firstChild","Attributes","uid","prefix","id","defaultValue","k","hasAttribute","setAttribute","getAttribute","forward","to","getAttributeNames","filter","a","startsWith","forEach","classes","split","classList","add","attr","removeAttribute","LightSlots","child","children","matches","namedSlots","Array","remove","slot","slotFromNode","slots","create","default","append","childNodes","HTMLTemplateElement","HTMLScriptElement","Nodes","isParsed","parentNode","nextSibling","waitDomContentLoaded","doc","readyState","Promise","addEventListener","once","win","defaultView","navigation","performance","getEntriesByType","domContentLoadedEventStart","done","removeEventListener","waitParsed","ownerDocument","observer","MutationObserver","disconnect","observe","childList","then","queryChildren","selector","queryChildrenAll","NodeOperations","forRemoval","Set","removed","replaceChildren","dataset","popData","prepend","ref","insertBefore","replace","cleanup","clear","CommandsHandler","tplIf","ops","evaluator","tplWith","varName","newNode","Template","render","tplEach","statName","template","proto","getPrototypeOf","iterator","prototype","keyed","measured","counted","item","stat","count","first","last","even","odd","layers","tplWhen","tplVerbatim","cloneNode","tplRemove","toLowerCase","tplClassAppend","cleanClasses","isArray","flatMap","Boolean","tplAttrAppend","attributesAndValues","textNode","createTextNode","String","Node","TypeError","attributeCache","toAttr","dataSetKey","fromSelector","templateEl","querySelector","fromTemplate","fromFragment","withEvaluator","withFragment","imported","importNode","nodeType","DOCUMENT_FRAGMENT_NODE","createNodeIterator","NodeFilter","SHOW_ELEMENT","SHOW_TEXT","NODE_FILTER","nextNode","TEXT_NODE","nodeValue","ex","RenderError","wrap","command","ORDERED_COMMANDS","attributeName","toggleAttribute","renderTo","appendTo","renderToSelector","appendToSelector","includes","FILTER_ACCEPT","FILTER_REJECT","attributes","FILTER_SKIP","depth","truncated","message","nodeOrFragment","cause","FRAMES","super","describe","stringify","ellipsize","ELEMENT_NODE","attrs","localName","slice","removeChild","UpgradeQueue","q","readyResolve","ready","start","settled","dispatchEvent","CustomEvent","bubbles","cancelable","enqueue","promise","finished","markFinished","withResolvers","upgrade","finally","drain","accept","pick","pending","all","upgraded","whenUpgraded","Registry","tagToClass","configured","mappers","string","unmarshal","str","marshal","number","Number","presence","bool","json","JSON","csv","components","upgradeQueue","defineElement","tag","klass","augmentAndDefineElement","declarationsOf","chain","HTMLElement","unshift","own","getOwnPropertyDescriptor","observed","propertyOf","attribute","toUpperCase","templates","config","declaredNames","observedNames","reverse","attrToMapper","reduce","acc","maybeType","namesAndTemplates","assign","nameToTemplate","BITS","registry","SLOTS","CONFIG","OBSERVED","DECLARED","ATTR_TO_MAPPER","ATTR_TO_PROPERTY","TEMPLATES","customElements","define","defineModule","rebind","defineModules","ms","defineComponent","defineData","defineOverlay","defineMapper","plugin","p","configure","settle","component","Templates","Rendering","waitFor","contains","waitForChildren","ParsedElement","observedAttributes","internals","attachInternals","parsed","started","reflecting","frozen","bits","mapper","_registry","connectedCallback","attributeChangedCallback","oldValue","newValue","declared","properties","states","rendered","reflectTo","marshalled","PLACEHOLDER","POSITIONAL","isPlainObject","warned","warnOnce","problem","console","warn","formatters","formatter","ctor","locale","options","Localization","messages","l10n","hasOwn","named","other","navigator","language","Intl","PluralRules","select","date","DateTimeFormat","format","NumberFormat","bytes","maximumFractionDigits","failure","problems","reasonOf","reason","of","overrides","bind"],"mappings":"AAIA,MAAMA,EACFC,GACAC,GAAW,IAAIC,IAEf,WAAAC,CAAYH,GACRI,MAAKJ,EAAOA,CAChB,CAUA,YAAAK,CAAaC,EAAKC,GACd,GAAIH,MAAKH,EAASO,IAAIF,GAClB,OAAOF,MAAKH,EAASQ,IAAIH,GAE7B,MAAMI,EAAQH,EAAQD,GAKtB,OAJIF,MAAKH,EAASU,MAAQP,MAAKJ,GAC3BI,MAAKH,EAASW,OAAOR,MAAKH,EAASY,OAAOC,OAAOJ,OAErDN,MAAKH,EAASc,IAAIT,EAAKI,GAChBA,CACX,CAEA,QAAIC,GACA,OAAOP,MAAKH,EAASU,IACzB,EClCJ,MA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