@wcstack/state 4.0.0-rc.7 → 4.0.0-rc.8
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/README.ja.md +28 -33
- package/README.md +28 -33
- package/dist/auto.min.js +2 -1
- package/dist/auto.min.js.map +1 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -0
- package/dist/split/auto.js +2 -1
- package/dist/split/auto.js.map +1 -0
- package/dist/split/chunks/{chunk-V34ZHCK5.js → chunk-4NJBYXIT.js} +2 -1
- package/dist/split/chunks/chunk-4NJBYXIT.js.map +1 -0
- package/dist/split/chunks/{chunk-JMPQHCIT.js → chunk-55J45X6H.js} +2 -1
- package/dist/split/chunks/chunk-55J45X6H.js.map +1 -0
- package/dist/split/chunks/{chunk-LTBR3OV5.js → chunk-7AYOQHZH.js} +2 -1
- package/dist/split/chunks/chunk-7AYOQHZH.js.map +1 -0
- package/dist/split/chunks/chunk-EIMTT5I3.js +2 -0
- package/dist/split/chunks/chunk-EIMTT5I3.js.map +1 -0
- package/dist/split/chunks/chunk-L3PFEJP7.js +2 -0
- package/dist/split/chunks/chunk-L3PFEJP7.js.map +1 -0
- package/dist/split/chunks/chunk-LXEEVZIB.js +2 -0
- package/dist/split/chunks/chunk-LXEEVZIB.js.map +1 -0
- package/dist/split/chunks/{chunk-W5KT4PQ3.js → chunk-M5SODAAE.js} +2 -1
- package/dist/split/chunks/chunk-M5SODAAE.js.map +1 -0
- package/dist/split/chunks/{chunk-SPWZUBQS.js → chunk-NOPTR2L3.js} +2 -1
- package/dist/split/chunks/chunk-NOPTR2L3.js.map +1 -0
- package/dist/split/chunks/{chunk-ARPZVNKL.js → chunk-UD3AYVP2.js} +2 -1
- package/dist/split/chunks/chunk-UD3AYVP2.js.map +1 -0
- package/dist/split/chunks/{chunk-XF6V6DWR.js → chunk-W4KOY6GT.js} +2 -1
- package/dist/split/chunks/chunk-W4KOY6GT.js.map +1 -0
- package/dist/split/chunks/{chunk-2EGTC36Y.js → chunk-ZN52NEIB.js} +2 -1
- package/dist/split/chunks/chunk-ZN52NEIB.js.map +1 -0
- package/dist/split/core.js +2 -1
- package/dist/split/core.js.map +1 -0
- package/dist/split/features/devtools.js +2 -1
- package/dist/split/features/devtools.js.map +1 -0
- package/dist/split/features/diagnostics.js +2 -1
- package/dist/split/features/diagnostics.js.map +1 -0
- package/dist/split/features/formats.js +2 -1
- package/dist/split/features/formats.js.map +1 -0
- package/dist/split/features/list-keys.js +2 -1
- package/dist/split/features/list-keys.js.map +1 -0
- package/dist/split/features/native-commands.js +2 -1
- package/dist/split/features/native-commands.js.map +1 -0
- package/dist/split/features/recursion.js +2 -1
- package/dist/split/features/recursion.js.map +1 -0
- package/dist/split/features/scopes.js +2 -1
- package/dist/split/features/scopes.js.map +1 -0
- package/dist/split/features/ssr.js +2 -1
- package/dist/split/features/ssr.js.map +1 -0
- package/dist/split/features/temporal.js +2 -1
- package/dist/split/features/temporal.js.map +1 -0
- package/package.json +1 -1
- package/dist/split/chunks/chunk-27N3IPIZ.js +0 -1
- package/dist/split/chunks/chunk-7EWPQMA6.js +0 -1
- package/dist/split/chunks/chunk-ALVA5TQM.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ROOT","INDEX_PATH","PROTOTYPE_NAMES","Set","Object","getOwnPropertyNames","prototype","taskSeq","pinged","ping","nextTask","thisTask","MessageChannel","ch","port1","onmessage","unref","port2","postMessage","setTimeout","reads","g","changed","seen","stack","length","h","pop","has","add","s","sources","p","isUnder","depth","lists","getter","push","WatchRuntime","constructor","engine","watches","this","active","hits","Map","cutTask","reported","activate","clear","w","underGetter","last","WeakMap","prime","set","readUntracked","eachRow","row","read","error","console","path","hooks","noticed","type","phase","deactivate","k","parent","fn","list","childList","rows","hit","prev","landed","get","written","old","value","direct","wp","guard","getterReached","listSynced","before","pattern","r","drained","size","batch","cut","real","entries","filter","alive","sort","a","b","compareRows","cur","saved","ctx","feeding","is","test","getterOf","includes","handler","call","proxy","indexesOf","chainCut","paths","task","fresh","maxDepth","ia","ib","parentRow","unshift","index","i","STATUS","ERROR","internalWrite","hasAccessorOrMethod","target","name","o","getPrototypeOf","d","getOwnPropertyDescriptor","StreamRuntime","watch","ns","write","startAll","e","start","abortAll","restart","controller","abort","stopAll","Math","max","rootValue","FAILED","eager","args","kept","slice","untrack","then","raiseError","checkArgs","addDependent","ctrl","AbortController","initial","consume","signal","live","aborted","put","acc","producer","source","chunk","v","fold","getReader","reader","addEventListener","cancel","catch","done","Symbol","asyncIterator","TypeError","it","return","next","dependents","indexOf","splice","dependentSet","delete","UNSET","runtimes","rt","declare","decl","out","keys","declared","parseWatches","$watch","stream","$stream","status","errors","def","parseStreams","connected","element","document","documentElement","hasAttribute","NAMESPACES","temporal","install","chain","dollar","first","known","key","split","beforeWrite","handled","_engine","charCodeAt","temporal_default"],"sources":["../../../src/temporal/watch.ts","../../../src/temporal/stream.ts","../../../src/features/temporal.ts"],"sourcesContent":["/**\n * `$watch` — the headless subscription (README \"Watch\", docs/state-watch-hook-design.md).\n *\n * A handler fires at the end of a drain, once per location that landed in it: a write of its\n * path or of an object above it in the same row, a change that reached its getter, a row that\n * entered its list. `cur` is the value at the drain; `prev` the value before the batch's first\n * write when a primitive was written (for a getter: its previous evaluation). A change that reaches\n * a getter fires it, whether its value changed or not (3.x D4: a watch has no condition of its own).\n * A row's getter that no write of the batch changed — it read none of the written paths, directly or\n * through a getter it read — fires only if its value changed: a row a list kept when a write\n * re-synced or re-sorted the list (`items = [...items, x]`) is reached again through what it read\n * under the row, which did not change (#389). A write at the list (or above it) changes what a row\n * read there (`this.items.length`), not under its row.\n * Declaration order between handlers, ascending indexes between rows of one path.\n *\n * A handler's writes form the next batch. Each write carries a chain depth (as @wcstack/state\n * 3.4, #354): 0, or one more than the depth of what fired the handler making it — or restarted the\n * `$stream` making it (stream.ts: its run's values and end too, within the task the run started in).\n * For a data path that is the deepest write landing there in the batch; for a getter, the first write\n * since it was last evaluated (a reached getter is not reached again until it is read), and 0 when a\n * list re-synced in the drain reached it — loops through those are left to the render chain\n * (MAX_RENDER_CHAIN). A handler fired more than MAX_CHAIN deep does not\n * run (as 3.x: 33 links run): the chain is cut and reported once. Writes riding in the same batch (a\n * render's write-back) neither lengthen nor reset it.\n *\n * Differences from @wcstack/state 3.3 that rows make possible: a row watch needs neither a\n * `for` binding nor `$listKeys` (the watch keeps its lists synced itself), wildcard getters are\n * eager too, and a whole-array assignment fires only for the rows that entered the list (a row\n * kept by identity did not change).\n */\nimport type { Engine } from \"../engine\";\nimport type { Pattern } from \"../pattern\";\nimport type { StateList, StateRow } from \"../list\";\nimport { raiseError } from \"../parser/raiseError\";\nimport { hooks } from \"../hooks\";\n\ntype Handler = (this: unknown, cur: unknown, prev: unknown, ...indexes: number[]) => unknown;\n\ninterface Watch {\n readonly path: string;\n readonly p: Pattern;\n readonly handler: Handler;\n /** A getter (or under one): kept evaluated, `prev` is its previous evaluation. */\n getter: boolean;\n /** Previous evaluation by row (getter watches; the root's under ROOT): a removed row takes its entry with it. */\n last: WeakMap<object, unknown>;\n}\n\n/**\n * A landing of a batch: `prev` (the first write's), the deepest write's chain depth, and whether a\n * write landed there (not only a change that reached a getter).\n */\ntype Hit = [prev: unknown, depth: number, landed: boolean];\n\nexport const MAX_CHAIN = 32;\nconst ROOT = {};\n/**\n * An explicit index (`items.0.v`, read like a getter): a write to another row, a list change,\n * reaches it unchanged. A leading numeric segment is a root key (`2024.total`), not an index.\n */\nconst INDEX_PATH = /\\.\\d/;\nconst PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));\n\n/**\n * The current task's number, bumped in the next task after it is asked for: a MessageChannel message\n * (neither throttled in a background tab nor replaced by a faked timer), or a timer where there is none.\n */\nlet taskSeq = 0;\nlet pinged = false;\nlet ping: (() => void) | null = null;\nconst nextTask = (): void => {\n pinged = false;\n taskSeq++;\n};\nexport function thisTask(): number {\n if (ping === null) {\n if (typeof MessageChannel === \"function\") {\n const ch = new MessageChannel();\n ch.port1.onmessage = nextTask;\n // (Node: the port must not keep the process alive)\n (ch.port1 as { unref?: () => void }).unref?.();\n ping = () => ch.port2.postMessage(0);\n } else ping = () => setTimeout(nextTask, 0);\n }\n if (!pinged) {\n pinged = true;\n ping();\n }\n return taskSeq;\n}\n\n/** Whether a write at a path of `changed` changed what getter `g` read (directly, or through a getter it read). */\nfunction reads(g: Pattern, changed: Set<Pattern>): boolean {\n const seen = new Set<Pattern>();\n const stack = [g];\n while (stack.length > 0) {\n const h = stack.pop()!;\n if (seen.has(h)) continue;\n seen.add(h);\n for (const s of h.sources) {\n for (const p of changed) {\n // a write at the list a row is in (or above it) changes what was read there, not under the row\n if (s.isUnder(p) && (s.depth === p.depth || !(p.depth < h.depth && h.lists[p.depth + 1]!.isUnder(p)))) return true;\n }\n if (s.getter !== null) stack.push(s);\n }\n }\n return false;\n}\n\nexport function parseWatches(engine: Engine, decl: unknown): Watch[] {\n if (decl === undefined) return [];\n if (decl === null || typeof decl !== \"object\") raiseError(\"$watch must be an object mapping paths to handler functions.\");\n const out: Watch[] = [];\n for (const path of Object.keys(decl)) {\n const handler = (decl as Record<string, unknown>)[path];\n if (path === \"\" || path[0] === \"$\" || path.includes(\"@\") || PROTOTYPE_NAMES.has(path)) raiseError(`$watch path \"${path}\" is not a path of the state tree.`);\n if (typeof handler !== \"function\") raiseError(`$watch entry \"${path}\" must be a function.`);\n const p = engine.pattern(path);\n hooks.declared?.(engine, p, true);\n out.push({ path, p, handler: handler as Handler, getter: false, last: new WeakMap() });\n }\n return out;\n}\n\nexport class WatchRuntime {\n readonly engine: Engine;\n readonly watches: Watch[];\n active = false;\n /** Landings of the current batch: watch → row → hit. */\n private hits = new Map<Watch, Map<StateRow | null, Hit>>();\n /** The chain depth of a write made now: 0, or one more than what fired the running handler (or restart). */\n depth = 0;\n /**\n * The paths a cut reported in task `cutTask`. A chain carries its depth only synchronously (and\n * through a `$stream`'s values within the task its run started in): a cut of the same paths later\n * in the task is the same chain's — what it left running reaching the limit again.\n */\n private cutTask = -1;\n private reported = new Set<string>();\n /** The paths written in the batch (what a change reaching a getter may have come from). */\n private changed: Set<Pattern> | null = null;\n\n constructor(engine: Engine, watches: Watch[]) {\n this.engine = engine;\n this.watches = watches;\n }\n\n /** After `$connectedCallback` (and on reconnect): watches see the writes from now on. */\n activate(): void {\n const engine = this.engine;\n this.hits.clear();\n for (const w of this.watches) {\n w.getter = w.p.getter !== null || w.p.underGetter;\n w.last = new WeakMap();\n // (the list a row watch reads can be a getter that throws too)\n this.prime(w, () => {\n if (w.p.depth === 0) {\n if (w.getter) w.last.set(ROOT, engine.readUntracked(w.p, null));\n } else {\n // a row watch keeps its lists synced, rendered or not; a getter watch is eager per row\n this.eachRow(w.p, 1, null, (row) => {\n if (w.getter) this.prime(w, () => w.last.set(row, engine.readUntracked(w.p, row)));\n });\n }\n });\n }\n this.active = true;\n }\n\n /** What a watch reads before the writes (its `prev`): what throws is reported, the others go on. */\n private prime(w: Watch, read: () => void): void {\n try {\n read();\n } catch (error) {\n console.error(`[@wcstack/state] $watch initial evaluation of \"${w.path}\" threw.`, error);\n hooks.noticed?.(this.engine, { \"type\": \"state:watch-error\", \"phase\": \"prime\", \"path\": w.path, \"error\": error });\n }\n }\n\n deactivate(): void {\n this.active = false;\n this.hits.clear();\n }\n\n /** Calls fn for every row at p.depth, creating the lists on the way (they then stay synced). */\n private eachRow(p: Pattern, k: number, parent: StateRow | null, fn: (row: StateRow) => void): void {\n const engine = this.engine;\n const list = engine.childList(parent, p.lists[k]!);\n for (const row of list.rows) {\n if (k === p.depth) fn(row);\n else this.eachRow(p, k + 1, row, fn);\n }\n }\n\n /** Records a landing at the current depth: the first `prev` stays, the deepest write's depth wins. */\n private hit(w: Watch, row: StateRow | null, prev: unknown, landed: boolean): void {\n let rows = this.hits.get(w);\n if (rows === undefined) this.hits.set(w, (rows = new Map()));\n const h = rows.get(row);\n if (h === undefined) rows.set(row, [prev, this.depth, landed]);\n else {\n if (h[1] < this.depth) h[1] = this.depth;\n h[2] ||= landed;\n }\n }\n\n written(p: Pattern, row: StateRow | null, old: unknown, value: unknown, direct: boolean): void {\n if (!this.active) return;\n (this.changed ??= new Set()).add(p);\n for (const w of this.watches) {\n const wp = w.p;\n // the watched path, or an object above it in the same row (a getter's row replaced included)\n if (wp.depth !== p.depth || !wp.isUnder(p)) continue;\n // `prev`: a getter's previous evaluation; for data, the old value the same-value guard reads\n // when a primitive was written there (none when it is off, or above it)\n this.hit(w, row, w.getter ? w.last.get(row ?? ROOT) : wp === p && direct && this.engine.guard && (value === null || (typeof value !== \"object\" && typeof value !== \"function\")) ? old : undefined, true);\n }\n }\n\n getterReached(g: Pattern, row: StateRow | null): void {\n if (!this.active) return;\n // a getter, or a path under it in the same row — also one that became so after the activation\n // (a mounted component's exported getter, a volume's accessor grafted later)\n for (const w of this.watches) {\n if ((w.getter ||= w.p.getter !== null || w.p.underGetter) && w.p.depth === g.depth && w.p.isUnder(g)) this.hit(w, row, w.last.get(row ?? ROOT), false);\n }\n }\n\n /** Rows that entered a list a row watch ranges over fire (and nested lists under them sync). */\n listSynced(list: StateList, old: StateRow[]): void {\n if (!this.active) return;\n let before: Set<StateRow> | null = null;\n for (const w of this.watches) {\n const wp = w.p;\n if (wp.depth < list.depth || wp.lists[list.depth] !== list.pattern) continue;\n before ??= new Set(old);\n for (const row of list.rows) {\n if (before.has(row)) continue;\n if (wp.depth === list.depth) this.hit(w, row, undefined, true);\n else this.eachRow(wp, list.depth + 1, row, (r) => this.hit(w, r, undefined, true));\n }\n }\n }\n\n drained(): void {\n const changed = this.changed;\n this.changed = null;\n if (!this.active || this.hits.size === 0) return;\n const batch = this.hits;\n this.hits = new Map();\n const engine = this.engine;\n const cut: string[] = [];\n for (const w of this.watches) {\n const rows = batch.get(w);\n if (rows === undefined) continue;\n const entries = [...rows].filter(([row]) => row === null || row.alive);\n if (entries.length > 1) entries.sort((a, b) => compareRows(a[0]!, b[0]!));\n // (whether a write of the batch changed what the watched getter read: asked once, for an unchanged row)\n let real: boolean | undefined;\n for (const [row, [prev, depth, landed]] of entries) {\n let cur: unknown;\n // (DevTools: the handler fired, or what threw — the value's evaluation or the handler)\n let phase = \"evaluate\";\n const saved = engine.ctx;\n this.depth = depth + 1;\n engine.feeding++;\n try {\n // (read past the limit too: a getter's cache is then current, and its next change reaches it)\n cur = engine.readUntracked(w.p, row);\n if (w.getter) {\n w.last.set(row ?? ROOT, cur);\n // unchanged: an explicit index, or a row no write of the batch changed (a row a list kept, #389)\n if (Object.is(cur, prev) && (INDEX_PATH.test(w.path) || (row !== null && !landed && !(real ??= changed !== null && reads(getterOf(w.p), changed))))) continue;\n }\n // fired more than MAX_CHAIN deep: the chain stops here (the batch's other handlers run)\n if (depth > MAX_CHAIN) {\n if (!cut.includes(w.path)) cut.push(w.path);\n continue;\n }\n engine.ctx = row;\n hooks.noticed?.(engine, { \"type\": \"state:watch-fired\", \"path\": w.path });\n phase = \"handler\";\n w.handler.call(engine.proxy, cur, prev, ...engine.indexesOf(row));\n } catch (error) {\n console.error(`[@wcstack/state] $watch \"${w.path}\" failed; the other watches still run.`, error);\n hooks.noticed?.(engine, { \"type\": \"state:watch-error\", \"phase\": phase, \"path\": w.path, \"error\": error });\n } finally {\n engine.ctx = saved;\n this.depth = 0;\n engine.feeding--;\n }\n }\n }\n if (cut.length > 0) this.chainCut(cut);\n }\n\n /** A chain of handlers / stream restarts went past MAX_CHAIN: reported once a task for its paths (nothing is rolled back). */\n chainCut(paths: string[]): void {\n const task = thisTask();\n if (task !== this.cutTask) {\n this.cutTask = task;\n this.reported.clear();\n }\n const fresh = paths.filter((path) => !this.reported.has(path));\n if (fresh.length === 0) return;\n for (const path of fresh) this.reported.add(path);\n console.error(`[@wcstack/state] $watch handlers / $stream restarts kept writing for ${MAX_CHAIN} batches; the chain is cut (nothing is rolled back).`);\n hooks.noticed?.(this.engine, { \"type\": \"state:watch-chain-limit\", \"maxDepth\": MAX_CHAIN, \"paths\": fresh });\n }\n}\n\n/** The getter a watched path is, or lies under (in the same row). */\nfunction getterOf(p: Pattern): Pattern {\n while (p.getter === null && p.parent !== null) p = p.parent;\n return p;\n}\n\n/** Ascending indexes, outermost first. */\nfunction compareRows(a: StateRow, b: StateRow): number {\n const ia: number[] = [];\n const ib: number[] = [];\n for (let r: StateRow | null = a; r !== null; r = r.list.parentRow) ia.unshift(r.index);\n for (let r: StateRow | null = b; r !== null; r = r.list.parentRow) ib.unshift(r.index);\n for (let i = 0; i < ia.length && i < ib.length; i++) if (ia[i] !== ib[i]) return ia[i] - ib[i];\n return ia.length - ib.length;\n}\n","/**\n * `$stream` — an async producer folded into one reactive property (README \"Streams\",\n * packages/state/docs/streams.md).\n *\n * `args` runs as a getter of its own (a pattern with no path in the state), so the paths it reads\n * are tracked like any getter's; a change that reaches it restarts the stream at the end of the\n * drain, once (switchMap: abort, reset to `initial`, re-run `args`, call `source`). Its\n * dependencies are captured afresh on every run. `$streamStatus.<name>` / `$streamError.<name>` are\n * read-only companions kept on the state.\n *\n * A restart's writes are reactions: they continue the render chain (MAX_RENDER_CHAIN), and the\n * `$watch` chain (watch.ts) one deeper than the write that reached `args` (#354). That depth is the\n * deepest such write's for a data path `args` reads, but the first one's since `args` was last\n * evaluated when the change came through a getter (a reached getter is not reached again until it\n * is read), and 0 when a list re-synced in the drain reached it: such loops are left to the render\n * chain. A restart more than MAX_CHAIN deep is not made (the chain is cut and reported); the next\n * change of its inputs restarts it.\n *\n * A run's own writes after its start — a value its source yields, the status `done` / `error` — made\n * within the task the run started in (synchronously or in its microtasks) are as deep as the run: the\n * `$watch` handlers they fire and the restarts they cause continue its chain, so a loop through a\n * source that yields at once (a `$watch` on the value moving what `args` reads, two streams reading\n * each other's values) is cut instead of running on microtasks alone. From a later task (a network\n * response, a message, a timer) they are new input, as a write from code: they start a chain afresh.\n */\nimport type { Engine } from \"../engine\";\nimport { FAILED, UNSET, type Pattern } from \"../pattern\";\nimport { raiseError } from \"../parser/raiseError\";\nimport { MAX_CHAIN, thisTask, type WatchRuntime } from \"./watch\";\n\ntype Status = \"idle\" | \"active\" | \"done\" | \"error\";\n\ninterface Entry {\n readonly name: string;\n readonly source: (args: unknown, signal: AbortSignal) => unknown;\n readonly fold: ((acc: unknown, chunk: unknown) => unknown) | undefined;\n readonly initial: unknown;\n /** The `args` getter (null without args: start once). */\n readonly g: Pattern | null;\n readonly args: (() => unknown) | null;\n controller: AbortController | null;\n restart: boolean;\n /** The `$watch` chain depth of what asked for the restart (meaningful while `restart`). */\n depth: number;\n}\n\nconst STATUS = \"$streamStatus\";\nconst ERROR = \"$streamError\";\nconst PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));\n\n/** A read-only companion path is being written by the runtime itself. */\nexport let internalWrite = false;\n\nfunction hasAccessorOrMethod(target: object, name: string): boolean {\n for (let o: object | null = target; o !== null && o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n const d = Object.getOwnPropertyDescriptor(o, name);\n if (d !== undefined) return d.get !== undefined || d.set !== undefined || typeof d.value === \"function\";\n }\n return false;\n}\n\n/** Validates `$stream` and materializes the value property and the companions on `target`. */\nexport function parseStreams(engine: Engine, target: Record<string, any>): Entry[] {\n const decl = target.$stream;\n if (decl === undefined) return [];\n if (decl === null || typeof decl !== \"object\") raiseError(\"$stream must be an object mapping stream names to definitions.\");\n const entries: Entry[] = [];\n const status: Record<string, Status> = {};\n const errors: Record<string, unknown> = {};\n for (const name of Object.keys(decl)) {\n // the author's object: read by quoted keys (the build shortens internal property names)\n const def = decl[name];\n if (name === \"\" || name[0] === \"$\" || /[.*]/.test(name) || PROTOTYPE_NAMES.has(name)) raiseError(`$stream entry \"${name}\" must be a flat property name.`);\n if (def === null || typeof def !== \"object\") raiseError(`$stream entry \"${name}\" must be an object.`);\n const source = def[\"source\"];\n const fold = def[\"fold\"];\n const args = def[\"args\"];\n const initial = def[\"initial\"];\n if (typeof source !== \"function\") raiseError(`$stream entry \"${name}\" needs a source function.`);\n if (fold !== undefined && typeof fold !== \"function\") raiseError(`$stream entry \"${name}\": fold must be a function.`);\n if (fold !== undefined && !(\"initial\" in def)) raiseError(`$stream entry \"${name}\": fold needs an initial value.`);\n if (args !== undefined && typeof args !== \"function\") raiseError(`$stream entry \"${name}\": args must be a function.`);\n if (hasAccessorOrMethod(target, name)) raiseError(`$stream entry \"${name}\" collides with a getter, setter or method of the state.`);\n if (target[name] === undefined) target[name] = initial;\n status[name] = \"idle\";\n errors[name] = null;\n entries.push({\n name, source, fold, initial, controller: null, restart: false, depth: 0,\n g: args === undefined ? null : engine.pattern(`$streamArgs.${name}`),\n args: args === undefined ? null : function (this: unknown) { return args(this); },\n });\n }\n target[STATUS] = status;\n target[ERROR] = errors;\n return entries;\n}\n\nexport class StreamRuntime {\n readonly engine: Engine;\n readonly entries: Entry[];\n /** The engine's `$watch` runtime: it holds the depth of the write made now, and reports a cut. */\n readonly watch: WatchRuntime;\n\n constructor(engine: Engine, entries: Entry[], watch: WatchRuntime) {\n this.engine = engine;\n this.entries = entries;\n this.watch = watch;\n }\n\n private set(ns: string, name: string, value: unknown): void {\n internalWrite = true;\n try {\n this.engine.write(this.engine.pattern(`${ns}.${name}`), null, value);\n } finally {\n internalWrite = false;\n }\n }\n\n /** Eager start after `$connectedCallback`: an `args` failure is thrown as is. */\n startAll(): void {\n for (const e of this.entries) this.start(e, true);\n }\n\n /** A re-set replaced the state: the old runs stop without touching the new state. */\n abortAll(): void {\n for (const e of this.entries) {\n e.restart = false;\n e.controller?.abort();\n e.controller = null;\n }\n }\n\n stopAll(): void {\n for (const e of this.entries) {\n e.restart = false;\n if (e.controller !== null) {\n e.controller.abort();\n e.controller = null;\n }\n this.set(STATUS, e.name, \"idle\");\n }\n }\n\n getterReached(g: Pattern): void {\n const depth = this.watch.depth;\n for (const e of this.entries) {\n if (e.g !== g) continue;\n // (a restart a stop or a re-set dropped leaves its depth behind)\n e.depth = e.restart ? Math.max(e.depth, depth) : depth;\n e.restart = true;\n }\n }\n\n /** At the end of a drain (after the watches): each stream whose `args` inputs changed restarts once. */\n drained(): void {\n const engine = this.engine;\n const watch = this.watch;\n const cut: string[] = [];\n for (const e of this.entries) {\n if (!e.restart) continue;\n const depth = e.depth;\n e.restart = false;\n if (depth > MAX_CHAIN) {\n cut.push(e.name);\n // reached, not re-run: the next change of its inputs must reach it again\n e.g!.rootValue = FAILED;\n continue;\n }\n watch.depth = depth + 1;\n engine.feeding++;\n try {\n this.start(e, false);\n } finally {\n engine.feeding--;\n watch.depth = 0;\n }\n }\n if (cut.length > 0) watch.chainCut(cut);\n }\n\n private start(e: Entry, eager: boolean): void {\n const engine = this.engine;\n if (e.controller !== null) e.controller.abort();\n e.controller = null;\n let args: unknown;\n if (e.g !== null) {\n const g = e.g;\n // (re)attached on every start: a re-set forgets every accessor of the old state\n g.getter = e.args;\n const kept = g.sources.slice();\n untrack(g);\n try {\n args = engine.read(g, null);\n checkArgs(e.name, g, args);\n } catch (error) {\n // the dependencies of the last successful run stay: touching one retries\n untrack(g);\n for (const s of kept) s.addDependent(g);\n g.rootValue = FAILED;\n if (eager) throw error;\n this.set(ERROR, e.name, error);\n this.set(STATUS, e.name, \"error\");\n return;\n }\n }\n const ctrl = new AbortController();\n e.controller = ctrl;\n engine.write(engine.pattern(e.name), null, e.initial);\n this.set(ERROR, e.name, null);\n this.set(STATUS, e.name, \"active\");\n void this.consume(e, ctrl, args);\n }\n\n private async consume(e: Entry, ctrl: AbortController, args: unknown): Promise<void> {\n const engine = this.engine;\n const signal = ctrl.signal;\n const live = (): boolean => !signal.aborted && e.controller === ctrl;\n const p = engine.pattern(e.name);\n // the run's depth and task: what it writes in that task continues its chain\n const depth = this.watch.depth;\n const task = thisTask();\n const put = (fn: () => void): void => {\n if (thisTask() === task) this.watch.depth = depth;\n try {\n fn();\n } finally {\n this.watch.depth = 0;\n }\n };\n let acc = e.initial;\n try {\n const producer: any = await e.source(args, signal);\n if (!live()) return;\n const chunk = (v: unknown): void => {\n acc = e.fold !== undefined ? e.fold(acc, v) : v;\n put(() => engine.write(p, null, acc));\n };\n if (producer !== null && typeof producer?.getReader === \"function\") {\n // a ReadableStream: only reader.cancel() can unwind a parked read\n const reader = producer.getReader();\n signal.addEventListener(\"abort\", () => { reader.cancel().catch(() => {}); });\n for (;;) {\n const r = await reader.read();\n if (!live()) return;\n if (r.done) break;\n chunk(r.value);\n }\n } else if (producer !== null && typeof producer?.[Symbol.asyncIterator] === \"function\") {\n const it = producer[Symbol.asyncIterator]();\n signal.addEventListener(\"abort\", () => { void it.return?.(); });\n for (;;) {\n const r = await it.next();\n if (!live()) return;\n if (r.done) break;\n chunk(r.value);\n }\n } else {\n throw new TypeError(`$stream \"${e.name}\": source must return an async iterable or a ReadableStream`);\n }\n if (!live()) return;\n e.controller = null;\n put(() => this.set(STATUS, e.name, \"done\"));\n } catch (error) {\n if (!live()) return;\n e.controller = null;\n ctrl.abort();\n put(() => {\n this.set(ERROR, e.name, error);\n this.set(STATUS, e.name, \"error\");\n });\n }\n }\n}\n\n/** Forgets what a getter read (its dependencies are captured again by the next evaluation). */\nfunction untrack(g: Pattern): void {\n for (const s of g.sources) {\n const i = s.dependents.indexOf(g);\n if (i >= 0) s.dependents.splice(i, 1);\n (s as any).dependentSet.delete(g);\n }\n g.sources.length = 0;\n g.rootValue = UNSET;\n}\n\nfunction checkArgs(name: string, g: Pattern, args: unknown): void {\n if (args !== null && typeof (args as any)?.then === \"function\") raiseError(`$stream \"${name}\": args must be synchronous (it returned a Promise).`);\n for (const s of g.sources) {\n if (s.depth > 0) raiseError(`$stream \"${name}\": args must not read a wildcard path (\"${s.path}\").`);\n if (s.path === name || s.path === `${STATUS}.${name}` || s.path === `${ERROR}.${name}`) raiseError(`$stream \"${name}\": args must not read the stream itself (\"${s.path}\").`);\n }\n}\n","/**\n * The temporal add-on (@wcstack/state/features/temporal): `$watch` and `$stream`.\n * At the end of every drain, after its report (`$renderedCallback`): the watches, then the\n * stream restarts. Both start after `$connectedCallback` and stop on disconnect.\n */\nimport type { Engine } from \"../engine\";\nimport { chain, first, handled, hooks, known, type Feature } from \"../hooks\";\nimport { raiseError } from \"../parser/raiseError\";\nimport { parseWatches, WatchRuntime } from \"../temporal/watch\";\nimport { internalWrite, parseStreams, StreamRuntime } from \"../temporal/stream\";\n\ninterface Runtime {\n watch: WatchRuntime;\n stream: StreamRuntime;\n connected: boolean;\n /** The state it was made for: a re-set refused after it (list-keys, recursion) leaves the old one in place. */\n target: object;\n}\n\nconst runtimes = new WeakMap<Engine, Runtime>();\n/** The engine's runtime when it is its state's (not one a refused re-set left: that one never runs). */\nfunction live(engine: Engine): Runtime | undefined {\n const rt = runtimes.get(engine);\n return rt?.target === engine.target ? rt : undefined;\n}\n\nfunction declare(engine: Engine, target: Record<string, any>): void {\n const watch = new WatchRuntime(engine, parseWatches(engine, target.$watch));\n const stream = new StreamRuntime(engine, parseStreams(engine, target), watch);\n const old = runtimes.get(engine);\n if (old !== undefined) {\n old.watch.deactivate();\n old.stream.abortAll();\n }\n runtimes.set(engine, { watch, stream, connected: old?.connected ?? false, target });\n}\n\nfunction element(engine: Engine, phase: \"mounting\" | \"back\" | \"connected\" | \"disconnected\" | \"reset\"): void {\n const rt = runtimes.get(engine);\n // an engine made before the add-on was installed has no runtime (and declares nothing temporal);\n // a server render (@wcstack/server) keeps streams at their initial value and watches off\n if (rt === undefined || phase === \"mounting\" || document.documentElement?.hasAttribute(\"data-wcs-server\")) return;\n // (kept on a runtime a refused re-set left too: the next re-set takes it over. \"back\" comes after\n // \"disconnected\", before $connectedCallback runs again: not connected yet)\n if (phase !== \"reset\") rt.connected = phase === \"connected\";\n // a refused state's runtime never runs, nor stops (writes `$streamStatus`), on the state that stayed\n if (rt.target !== engine.target) return;\n if (phase === \"disconnected\") {\n rt.watch.deactivate();\n rt.stream.stopAll();\n return;\n }\n if (!rt.connected) return;\n rt.watch.activate();\n rt.stream.startAll();\n}\n\nconst NAMESPACES = [\"$streamStatus\", \"$streamError\"];\n\nexport const temporal: Feature = {\n name: \"temporal\",\n install(): void {\n hooks.declare = chain(hooks.declare, declare);\n hooks.element = chain(hooks.element, element);\n hooks.written = chain(hooks.written, (engine, p, row, old, value, direct) => live(engine)?.watch.written(p, row, old, value, direct));\n hooks.getterReached = chain(hooks.getterReached, (engine, g, row) => {\n const rt = live(engine);\n if (rt === undefined) return;\n rt.watch.getterReached(g, row);\n rt.stream.getterReached(g);\n });\n hooks.listSynced = chain(hooks.listSynced, (engine, list, old) => live(engine)?.watch.listSynced(list, old));\n hooks.drained = chain(hooks.drained, (engine) => {\n const rt = live(engine);\n if (rt === undefined) return;\n rt.watch.drained();\n rt.stream.drained();\n });\n // `this.$streamStatus` (the object, untracked) and `this[\"$streamStatus.x\"]` (tracked)\n hooks.dollar = first(known, hooks.dollar, (engine, key) => {\n const ns = key.split(\".\", 1)[0];\n if (!NAMESPACES.includes(ns)) return undefined;\n return ns === key ? engine.target[key] : engine.read(engine.pattern(key), null);\n });\n hooks.beforeWrite = first(handled, hooks.beforeWrite, (_engine, p) => {\n if (!internalWrite && p.path.charCodeAt(0) === 36 && NAMESPACES.includes(p.path.split(\".\", 1)[0])) {\n raiseError(`\"${p.path}\" is read-only (the stream runtime owns it).`);\n }\n return false;\n });\n },\n};\nexport default temporal;\n"],"mappings":"0IAsDO,IACDA,EAAO,CAAC,EAKRC,EAAa,OACbC,EAAkB,IAAIC,IAAIC,OAAOC,oBAAoBD,OAAOE,YAM9DC,EAAU,EACVC,GAAS,EACTC,EAA4B,KAC1BC,EAAW,KACfF,GAAS,EACTD,KAEK,SAASI,IACd,GAAa,OAATF,EACF,GAA8B,mBAAnBG,eAA+B,CACxC,IAAMC,EAAK,IAAID,eACfC,EAAGC,MAAMC,UAAYL,EAEpBG,EAAGC,MAAiCE,UACrCP,EAAO,IAAMI,EAAGI,MAAMC,YAAY,EACpC,MAAOT,EAAO,IAAMU,WAAWT,EAAU,GAE3C,OAAKF,IACHA,GAAS,EACTC,KAEKF,CACT,CAGA,SAASa,EAAMC,EAAYC,GACzB,IA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0C,EAAMsB,GAAaiI,EAAMvJ,EAAMsB,GAAY,CAAC7C,EAAQ+B,EAAMQ,IAAQqF,EAAK5H,IAAS+F,EAAMlD,GAAWd,EAAMQ,IACvGhB,EAAM0B,GAAU6H,EAAMvJ,EAAM0B,GAAUjD,IACpC,IAAMwJ,EAAK5B,EAAK5H,QACL,IAAPwJ,IACJA,EAAGzD,EAAM9C,KACTuG,EAAGQ,GAAO/G,QAGZ1B,EAAMwJ,GAASC,EAAMC,EAAO1J,EAAMwJ,GAAQ,CAAC/K,EAAQkL,KACjD,IAAMlF,EAAKkF,EAAIC,MAAM,IAAK,GAAG,GAC7B,GAAKR,EAAWvG,SAAS4B,GACzB,OAAOA,IAAOkF,EAAMlL,EAAOwF,OAAO0F,GAAOlL,EAAOmB,KAAKnB,EAAO+C,EAAQmI,GAAM,QAE5E3J,EAAM6J,GAAcJ,EAAMK,EAAS9J,EAAM6J,GAAa,CAACE,EAAS9L,MACzD8F,GAA0C,KAAzB9F,EAAE8B,EAAKiK,WAAW,IAAaZ,EAAWvG,SAAS5E,EAAE8B,EAAK6J,MAAM,IAAK,GAAG,KAC5F/D,EAAW,IAAI5H,EAAE8B,kDAEZ,GAEX,GAEKkK,EAAQZ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a="4.0.0-rc.7";export{a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./chunk-XF6V6DWR.js";import{a as t,d as n,e as l,j as i,k as r}from"./chunk-LTBR3OV5.js";import{a as o,g as s}from"./chunk-W5KT4PQ3.js";import{a as u}from"./chunk-2EGTC36Y.js";import{a,b as h,c,d as f,e as d,f as m,g as p,h as g,i as v,j as b,k as w,l as y,n as x}from"./chunk-SPWZUBQS.js";import{a as N,b as S}from"./chunk-ALVA5TQM.js";import{a as T}from"./chunk-V34ZHCK5.js";var k=new Map,j=new Set(["if","elseif","else","for"]),A=new Set([a,"if","elseif","for","..."]),E=new Set([d,m,p,f,h,c]);function F(e){let t=function(e){return w(e,";")}(e).map(v).filter(e=>e.length>0).map(e=>{let t=b(e,":");-1===t&&S(101,[e]);let n=e.slice(0,t).trim(),l=e.slice(t+1).trim(),i=n.split("#")[0].split("|")[0].trim();if(A.has(i)){let t;return i!==n&&S(102,[e,i]),i===a?(l.length>0&&S(103,[e]),t={Qe:"#else",Ze:[]}):"..."===i?(0===l.length&&S(104,[e]),t=x(l),t.Ze.length>0&&S(105,[e])):(t=x(l),"for"===i&&t.Ze.length>0&&S(121,[e])),{Se:i,$e:[i],on:[],j:[],...t,w:"..."===i?"spread":i}}let r=x(l),o=function(e){let[t,n]=y(e,"input",k),l=t.split("#").map(v);l.length>2&&S(115,[t]);let[i,r]=l,o=i.split(".").map(v);return!(o.length>1&&""===o[0])&&(0===i.length||o.some(e=>0===e.length))&&S(116,[e]),{Se:i,$e:o,on:r?r.split(",").map(v):[],j:n}}(n),[s]=o.$e;if(""===s&&o.$e.length>1){let e=o.$e.slice(1);return(e.includes("")||E.has(e[0]))&&S(106,[n]),{...o,Se:e.join("."),$e:e,...r,w:"prop"}}return{...o,...r,w:"radio"===i||"checkbox"===i?i:s===h||s.startsWith("on")?"event":"prop"}});return t.length>1&&t.some(e=>j.has(e.w))&&S(201,[e]),t}function $(e,t){if(null!==e)for(let n=0;n<e.length;n++)t=e[n](t);return t}function C(t){return 0===t.length?null:(e(),t.map(e=>s(e.Hn,e.args,e.literals)))}var L=Symbol.for("wcstack.state.view-transition-naming"),P=new WeakSet;function D(){let e=t("state");return null!==e&&"auto"===e.naming?e.namingLimit:-1}var O=new Set(["click","dblclick","input","change","submit","keydown","keyup","mousedown","mouseup","pointerdown","pointerup"]),K=0,R=2,W=3,U=4,M=5,V=["text","prop","prop","prop","prop","event","for","if","prop","radio","checkbox","prop","prop","event","spread"],G=(e,t,n,l)=>e.Gt(t,n.o?.t??n.Rt,l,V[n.i]),I=Symbol();function B(e,t,n){let l=t.K;return null===l||"state"===l||"auto"===l&&void 0!==e.v(t.o,n)?t.U:I}var q=class{constructor(e,t,n,l,i,r,o,s,u,a=null){this.te=!1,this.j=null,this.attribute=null,this.Tn=!1,this.engine=e,this.i=t,this.a=n,this.name=l,this.o=i,this.r=r,this.Pn=o,this.x=s,this.value=u,this._=a}nn(){return V[this.i]}apply(){if(null!==this._)return void this._.Et();let e=$(this.x,this.engine.read(this.o,this.r));if(e===this.value&&9!==this.i&&("object"!=typeof e||null===e||11===this.i||8===this.i||i(this.name)))return;if(this.value===I)return void(this.value=e);let t=this.a;if(11!==this.i)9===this.i?t.checked=void 0!==e&&this.rn()===e:10===this.i?t.checked=Array.isArray(e)&&e.includes(this.rn()):Z(this.i,t,this.name,e),this.value=e;else{if(void 0===e)return void(this.value=e);this.value=e,this.Tn=!0;try{t[this.name]!==e&&(t[this.name]=e)}finally{this.Tn=!1}null!==this.attribute&&function(e,t,n){try{if(null==n||!1===n)e.removeAttribute(t);else if(!0===n)e.setAttribute(t,"");else{let l=n;if("object"==typeof n)try{l=JSON.stringify(n)}catch{}e.setAttribute(t,String(l))}}catch{}}(t,this.attribute,e)}}rn(){return $(this.j,this.a.value)}ir(){let e,t=this.a,n=this.engine;if(9===this.i){if(!t.checked)return;e=this.rn()}else if(10===this.i){let l=this.rn(),i=n.v(this.o,this.r),r=Array.isArray(i)?i:[],o=r.includes(l);if(t.checked?o:!o)return;e=o?r.filter(e=>e!==l):[...r,l]}else e=$(this.j,t[this.name]),this.value=NaN;n.T(this.o,this.r,e,!1,!0)}},Q=e=>"textContent"===e||"innerText"===e||"innerHTML"===e;function Z(e,t,n,l){switch(e){case 0:return void(t.data=null==l?"":String(l));case 1:return void(Q(n)?t[n]="innerHTML"===n?r(l):null==l?"":String(l):i(n)?null==l&&"srcdoc"===n?t.removeAttribute(n):void 0!==l&&(t[n]=r(l)):void 0!==l&&(t[n]!==l&&!("value"===n&&t.value===String(l))&&(t[n]=l),("value"===n||"selectedIndex"===n)&&"select"===t.localName&&(t[H]=[n,l])));case 8:return void(t.innerHTML=r(l));case 2:return null!=l&&"boolean"!=typeof l&&S(401,[n,typeof l]),void t.classList.toggle(n,!0===l);case 3:return void(null==l?t.removeAttribute(n):t.setAttribute(n,String(l)));case 4:return void(n.includes("-")?null==l?t.style.removeProperty(n):t.style.setProperty(n,String(l)):t.style[n]=null==l?"":String(l))}}var H=Symbol();function X(e){let t="optgroup"===e.localName?e.parentNode:e,n=t?.[H];void 0!==n&&(t[n[0]]=n[1])}var z=class{constructor(e,t,n,l){this.y=!0,this.he=null,this.c=null,this.Nt=null,this.Fn=null,this.r=e,this.Ue=t,this.D=n,this.F=l}Qo(e,t){let n=t.target,l=this.F,i=[],r=null;for(let t of l.Re){if(t.name!==e)continue;let o=l.On[t.a],s=ue(null===this.D?this.Ue:this.D[o[0]],o,1);s.contains(n)&&(s!==r&&i.unshift([]),i[0].push(t),r=s)}for(let e of i){for(let n of e)n.An(t,this.r);if(t.cancelBubble)return!0}return!1}get s(){return null===this.D?this.Ue:this.D[this.D.length-1]}qe(){let e=this.Fn;return(null===e?null:e.Cn(this.Ue))??this.Ue}insertBefore(e,t){let n=this.s;for(let l=this.qe();;){let i=l.nextSibling;if(e.insertBefore(l,t),l===n)return;l=i}}wo(){null===this.D?this.Ue.remove():ae(this.qe(),this.s)}xe(e){if(this.y=!1,null!==this.Nt)for(let e of this.Nt)e();let t=this.he;if(null!==t)for(let n=0;n<t.length;n++)e.Nn(t[n]);if(null!==this.c)for(let e of this.c)e.xe()}},_=class extends z{constructor(e,t,n,l){super(e,t,n,l),this.bo=0,this.V=null,this.fe=0===l.ze.length?null:new Array(2*l.ze.length)}vo(e,t){let n=this.V??=new Array(this.F.ze.length),l=n[t];if(void 0===l){let i=this.F.ze[t],r=this.fe;l=n[t]=new q(e,i.i,r[2*t],i.name,i.o,this.r,this,i.x,r[2*t+1])}return l}uo(e,t){let n=this.F.ze;for(let l=0;l<n.length;l++)n[l].o.ee(t)&&e.en(this.vo(e,l))}xe(e){let t=this.r;t.E===this&&(t.E=null),super.xe(e)}};function J(e,t,n,i){let r=l(n,t.n);try{return e.We(r,t)}catch(n){return e.Gt(n,t.t,i,"for"),null===r?e.oe.get(t):r.c.get(t)}}function Y(e,t,n){n&&e.nr(t);let l=t.Pn;null!==l&&(l.he??=[]).push(t)}var ee=null;function te(){let e=ee;return ee=null,e}var ne=-1;function le(e,t,n,l,i=null){let r,o=t.On,s=t.build,u=t.ko,a=null,h=T.Oe?.(t,null===l?i:l.S,null!==l),c=!h&&t.In,f=h?document.createDocumentFragment():(c?t.root:t.sn).cloneNode(!0);if(!h)for(let e=0;e<s.length;e++){let t=s[e];u[t]=ue(f,o[t],c?1:0)}c?r=f:(a=h||[...f.childNodes],r=a[0]);let d,m=null;if(null!==l?(d=m=new _(n,r,a,t),null===l.map?n.E=m:l.map.set(n,m)):d=new z(n,r,a,t),ne>=0&&function(e,t,n,l){let i=null;if(null===t)i=1===e.nodeType?e:null;else for(let e=0;e<t.length&&null===i;e++)1===t[e].nodeType&&(i=t[e]);let r=i?.style;if(null===i||void 0===r||P.has(i))return;let o=globalThis[L]??={counter:0,assigned:0,warned:!1};o.assigned>=l?o.warned||(o.warned=!0,console.warn(`[@wcstack/state] ${N(25,[l])}`)):(P.add(i),o.assigned++,r.setProperty("view-transition-name",`wcs-${n}-${++o.counter}`),r.setProperty("view-transition-class",`wcs-${n}`))}(r,a,null!==l?"row":"branch",ne),t.Re.length>0){let t=e.Kn;if(null===a)r[t]=d;else for(let e of a)1===e.nodeType&&(e[t]=d)}let p=t.sr,g=e.De,v=t.lr?u.slice(0,o.length):u,b=null===m?null:m.fe;if(null!==b){let e=t.ze;for(let t=0;t<e.length;t++)b[2*t]=v[e[t].a],b[2*t+1]=e[t].U}for(let t=0;t<p.length;t++){let l=p[t],i=v[l.a],o=l.A;if(o>=0&&null!==b){let t=m.V?.[o];if(void 0!==t){t.te=!1,e.Ve(t);continue}try{let t=$(l.x,e.read(l.o,n));t!==l.U&&(Z(l.i,i,l.name,t),b[2*o+1]=t),null!==g&&e.po(l.o,n)}catch(t){e.xt(t,m.vo(e,o))}continue}switch(l.i){case 6:{let t=new se(e,l.F,J(e,l.o,n,i),i);(d.c??=[]).push(t),i===r&&(d.Fn=t),t.Et();break}case 7:{let t=re(e,l.G.map(e=>({F:e.F,o:e.o,x:e.x,S:v[e.a]})),n,d);(d.c??=[]).push(t),i===r&&(d.Fn=t);break}default:try{ie(e,l,i,n,d)}catch(t){G(e,t,l,i)}}}return ee=d,f}function ie(e,t,n,i,r){let o=n;switch(t.i){case 5:return void function(e,t,n,l,i){let r=n.An,o=e=>r(e,l);if(n.et){let l=e.ao(n.name),i=t[l];t[l]=void 0===i?o:e=>{i(e),o(e)},n.Ee&&t.addEventListener(n.name,e=>e.bubbles||o(e))}else t.addEventListener(n.name,o),n.yo&&null!==i&&(i.Nt??=[]).push(()=>t.removeEventListener(n.name,o))}(e,n,t,i,r);case 12:return void fe(e,t,o,r,n=>function(e,t,n,l,i){let r=t.name,o=e.command(t.Rt.slice(9)),s=null===i?T.or?.(n,r):null;s||(null===i&&me(1202,n,`command.${r}`),i.commands.has(r)||S(1203,[n.localName,r]));let u=new WeakRef(n),a=o.subscribe((...e)=>{let t=u.deref();if(void 0!==t)return t.isConnected?s?s(t,e):t[r](...e):void 0;a()});null!==l&&(l.Nt??=[]).push(a)}(e,t,o,r,n));case 13:return void fe(e,t,o,r,n=>function(e,t,n,l,i){let r=t.name;null===i&&me(1202,n,`eventToken.${r}`);let o=i.properties.get(r);void 0===o&&S(1204,[n.localName,r]);let s=t.Rt;n.addEventListener(o.event,n=>{t.Pt&&n.preventDefault(),t.Tt&&n.stopPropagation();try{e.Zo(s,n,l)}catch(e){console.error(e)}})}(e,t,o,i,n))}let s=t.o,u=l(i,s.n);if(14===t.i)return void fe(e,t,o,r,n=>function(e,t,n,l,i,r){null===r&&me(1501,n,`"...: ${t.o.t}"`);let o=new Set([...r.properties.keys(),...r.inputs.keys()]);for(let s of o){if(t.go?.includes(s))continue;let o=e.o(`${t.o.t}.${s}`),u=0===o.n?null:l;de(e,{...t,K:null,X:null},n,s,o,u,i,r)}}(e,t,o,u,r,n));if(t.Ee&&1===t.i)return void fe(e,t,o,r,n=>function(e,t,n,l,i,r){if(null!==r)return void de(e,t,n,t.name,t.o,l,i,r);let o=new q(e,1,n,t.name,t.o,l,i,t.x,B(e,t,l));o.j=t.j,!T.ar?.(o,t.ro)&&(Y(e,o,!0),e.Ve(o))}(e,t,o,u,r,n));let a=new q(e,t.i,n,t.name,s,u,r,t.x,B(e,t,u));a.j=t.j,Y(e,a,!0),e.Ve(a),null!==t.At&&n.addEventListener(t.At,()=>a.ir())}function re(e,t,n,i){let r=new oe(e,t,n),o=null;for(let s of t){if(null===s.o)continue;let t=s.o,u=new q(e,7,s.S,"if",t,l(n,t.n),i,null,void 0,r);Y(e,u,!0),null===i&&r.ce.push(u),o??=u}return e.Ve(o),r}var oe=class{constructor(e,t,n){this.y=!0,this.O=null,this.b=-1,this.ce=[],this.engine=e,this.G=t,this.r=n}Cn(e){return null!==this.O&&this.G[this.b].S===e?this.O.qe():null}Et(){let e=this.engine,t=-1;for(let n=0;n<this.G.length;n++){let i=this.G[n];if(null===i.o||$(i.x,e.read(i.o,l(this.r,i.o.n)))){t=n;break}}if(t!==this.b&&(ne=D(),null!==this.O&&(this.O.wo(),this.O.xe(e),this.O=null),this.b=t,t>=0)){let n=this.G[t],l=le(e,n.F,this.r,null,n.S);this.O=te();let i=n.S.parentNode;i.insertBefore(l,n.S),X(i)}}xe(){this.y=!1;for(let e of this.ce)this.engine.Nn(e);null!==this.O&&this.O.xe(this.engine)}},se=class{constructor(e,t,n,l){this.y=!0,this.Ne=[],this.engine=e,this.F=t,this.l=n,this.S=l,null===n.E?(n.E=this,this.map=null):((n.L??=[]).push(this),this.map=new Map)}Cn(e){return 0===this.Ne.length?null:this.Ne[0].qe()}Ft(e){return null===this.map?e.E:this.map.get(e)??null}Dt(e){let t=this.map;null!==t&&t.get(e.r)===e&&t.delete(e.r),e.xe(this.engine)}Et(){let e=this.engine,t=this.l.f,n=this.Ne;ne=D();let l=t.length,i=n.length,r=this.S,o=r.parentNode;if(0===l){if(i>0){let e=n[0].qe(),t=n[i-1].s,l=[];for(let n=o.firstChild;null!==n;n=n===e?t.nextSibling:n.nextSibling)if(n!==e){if(n!==r&&3!==n.nodeType){l=null;break}l.push(n)}null!==l?o.replaceChildren(...l):ae(e,t);for(let e=0;e<i;e++)this.Dt(n[e])}return void(this.Ne=[])}let s=new Array(l),u=0;for(;u<l&&u<i&&this.Ft(t[u])===n[u];)s[u]=n[u],u++;let a=i-1,h=l-1;for(;a>=u&&h>=u&&this.Ft(t[h])===n[a];)s[h]=n[a],a--,h--;for(let e=u;e<=a;e++){let t=n[e],l=t.r;l.y&&this.Ft(l)===t?t.bo=e:(t.wo(),this.Dt(t))}if(u<=h){let n=h-u+1,a=new Int32Array(n),c=!1;if(i>0)for(let e=0;e<n;e++){let n=this.Ft(t[u+e]);null!==n&&n.y?(a[e]=n.bo,c=!0):a[e]=-1}let f=h+1<l?s[h+1].qe():r;if(c){let l=function(e){let t=e.length,n=new Uint8Array(t),l=new Int32Array(t).fill(-1),i=[];for(let n=0;n<t;n++){let t=e[n];if(t<0)continue;let r=0,o=i.length;for(;r<o;){let n=r+o>>1;e[i[n]]<t?r=n+1:o=n}r>0&&(l[n]=i[r-1]),i[r]=n}let r=i.length>0?i[i.length-1]:-1;for(;r>=0;)n[r]=1,r=l[r];return n}(a),i=f;for(let r=n-1;r>=0;r--){let n=t[u+r],a=this.Ft(n);null!==a&&a.y?0===l[r]&&a.insertBefore(o,i):(o.insertBefore(le(e,this.F,n,this),i),a=te()),s[u+r]=a,i=a.qe()}}else{let n=document.createDocumentFragment();for(let l=u;l<=h;l++)n.appendChild(le(e,this.F,t[l],this)),s[l]=te();o.insertBefore(n,f)}}this.Ne=s,X(o)}xe(){this.y=!1;let e=this.l;if(e.E===this)e.E=null;else if(null!==e.L){let t=e.L.indexOf(this);t>=0&&e.L.splice(t,1),0===e.L.length&&(e.L=null)}for(let e of this.Ne)e.xe(this.engine);this.map?.clear()}};function ue(e,t,n){for(;n<t.length;n++){e=e.firstChild;for(let l=t[n];l>0;l--)e=e.nextSibling}return e}function ae(e,t){for(let n,l=e;l!==t;l=n)n=l.nextSibling,l.remove();t.remove()}var he=new WeakMap,ce=e=>e.customElementRegistry??customElements;function fe(e,t,n,l,i,r=!1){let o=n.localName;if(!o.includes("-"))return i(null);let s=ce(n);if(!r&&!n.isConnected&&void 0===s.get(o)&&"customElementRegistry"in n)return void queueMicrotask(()=>fe(e,t,n,l,i,!0));let u=()=>{let e=s.get(o);s.upgrade(n),i(e?function(e){if(he.has(e))return he.get(e);let t=e.wcBindable,n=null;if(null!==t&&"object"==typeof t&&"wc-bindable"===t.protocol&&Number.isInteger(t.version)&&t.version>=1){n={properties:new Map,inputs:new Map,commands:new Set};for(let e of t.properties??[])n.properties.set(e.name,{event:e.event,getter:"function"==typeof e.getter?e.getter:null,ho:"event"===e.semantics});for(let e of t.inputs??[])n.inputs.set(e.name,{attribute:"string"==typeof e.attribute?e.attribute:null});for(let e of t.commands??[])null!==e&&"object"==typeof e&&"string"==typeof e.name&&n.commands.add(e.name)}return he.set(e,n),n}(e):null)};if(!r&&void 0!==s.get(o))return u();null!==l&&!l.y||function(e,t,n){let l=n;null!==t&&(t.Nt??=[]).push(()=>{l=null}),e.then(()=>l?.())}(s.whenDefined(o),l,()=>{try{u()}catch(l){G(e,l,t,n)}e.Te()})}function de(e,t,n,l,i=t.o,r,o,s){let u=s.properties.get(l)??null,a=s.inputs.get(l),h=e._t;h&&null===u&&void 0===a&&S(38,[l]);let c=t.K;(null===u?"element"===c||"auto"===c:void 0===a&&("state"===c||"auto"===c))&&S(39,[c,l]),"connect"===t.X&&null===u&&S(40,[l]);let f=h&&null!==u&&void 0===a,d=new q(e,11,n,l,i,r,o,t.x,void 0);d.j=t.j,d.attribute=a?.attribute??null,Y(e,d,!f),null!==u&&!t.ro&&n.addEventListener(u.event,t=>{let i;null!==u.getter?i=u.getter(t):(i=t.detail,u.ho||T.detail?.(n,l,i)),(!d.Tn||!Object.is(i,d.value))&&(i=$(d.j,i),null===d.x&&(d.value=i),e.T(d.o,d.r,i,u.ho,!0))});let m=c??(f?"element":"state");if("state"===m)f||e.Ve(d);else if("element"===m||"auto"===m){let i=()=>{if(null!==o&&!o.y)return;if("auto"===m&&void 0!==e.v(d.o,d.r))return void(f||e.Ve(d));let t=n[l];null===d.x&&(d.value=t),e.T(d.o,d.r,t,!1,!0)};"connect"!==t.X||n.isConnected?i():Promise.resolve().then(i)}return d}function me(e,t,n){S(e,[t.localName,n])}var pe=()=>o.bindAttributeName;function ge(){return{a:0,i:1,name:"",o:null,x:null,U:u,An:null,F:null,G:null,j:null,At:null,Ee:!1,K:null,X:null,ro:!1,Pt:!1,Tt:!1,Rt:null,go:null,A:-1,et:!1,yo:!1}}var ve=["state","element","auto","none"],be=["call","connect"],we="$command.";function ye(e,t,n){g.test(t)&&(null===n&&S(1401,[t,Number(t.slice(1))]),t=`${n.t}.*.${t}`);let l=e.o(function(e,t){return 46!==e.charCodeAt(0)?e:(null===t&&S(1402,[e]),"."===e?`${t.t}.*`:`${t.t}.*${e}`)}(t,n)),i=null===n?0:n.n+1;l.n>i&&S(1401,[l.t,l.n,i]);for(let e=1;e<=l.n;e++){let t=e===i?n:n.h[e];l.h[e]!==t&&S(1403,[l.t,l.h[e].t,t.t])}return T.So?.(e,l),l}var xe=e=>1===e.i&&("outerHTML"===e.name||"outerText"===e.name),Ne=e=>8===e.i||xe(e)||1===e.i&&Q(e.name);function Se(e){S(202,[e])}function Te(e,t,l,r,o){let s=F(t).map(t=>function(e,t,l,r,o){let s=function(e,t){let n=t.find(e=>e.startsWith("on")),l=null,i=null;for(let n of t){let t=n.indexOf("=");if(t<0)continue;e._t||S(31);let r=n.slice(0,t).trim(),o=n.slice(t+1).trim(),s="init"===r;!s&&"sync"!==r&&S(33,[r,n]),null!==(s?l:i)&&S(34,[r]),(s?ve:be).includes(o)||S(35,[r,o]),s?l=o:i=o}return{ro:t.includes("ro"),Pt:t.includes("prevent"),Tt:t.includes("stop"),event:n?n.slice(2):null,K:l,X:i}}(e,t.on),u=r.localName.includes("-"),a=t.$e,h=t.Qe;if("event"===t.w){if(null!==s.K&&"none"!==s.K&&S(36),"eventToken"===a[0])return{...ge(),a:o,i:13,name:a.slice(1).join("."),Rt:h,Ee:u,Pt:s.Pt,Tt:s.Tt};let l=h.startsWith(we)?h.slice(9):null,{Pt:i,Tt:r}=s,c=t.Se.slice(2),f=t.on.includes("direct"),d=!f&&O.has(c);return d&&e.ao(c),{...ge(),a:o,i:5,name:c,et:d,Ee:u,yo:f,An(t,o){i&&t.preventDefault(),r&&t.stopPropagation();try{if(null!==l)e.er(l,t,o);else{let l=e.tr(h,t,o);n(l)&&l.then(void 0,e=>console.error(e))}}catch(e){console.error(e)}}}}if("spread"===t.w)return{...ge(),a:o,i:14,o:ye(e,h,l),Ee:u};if("command"===a[0]&&a.length>1)return h.startsWith(we)||S(1201,[t.Se,h]),{...ge(),a:o,i:12,name:a.slice(1).join("."),Rt:h,Ee:u};let c=ye(e,h,l),f={...ge(),a:o,i:1,name:t.Se,o:c,x:C(t.Ze),j:C(t.j),ro:s.ro,K:s.K,X:s.X};if("radio"===t.w||"checkbox"===t.w)return("element"===s.K||"auto"===s.K)&&S(37,[t.w,s.K]),f.i="radio"===t.w?9:10,s.ro||(f.At=s.event??"input"),f;if(a.length>1){let e=a.slice(1).join("."),t=a[0];if("class"===t||"attr"===t||"style"===t)return f.K=null,f.name=e,"class"===t?(f.i=2,f.U=r.classList.contains(e)):f.i="attr"===t?"srcdoc"===e&&"iframe"===r.localName?1:3:4,f}return"html"===t.Se?(f.i=8,f):(f.name="text"===t.Se?"textContent":t.Se,f.Ee=u&&!i(f.name),!u&&!s.ro&&function(e,t){let n=e.localName;if("input"===n){let n=(e.getAttribute("type")||"text").toLowerCase();return"button"!==n&&(("radio"===n||"checkbox"===n)&&"checked"===t||"value"===t||"valueAsNumber"===t||"valueAsDate"===t)}return("select"===n||"textarea"===n)&&"value"===t}(r,f.name)&&(f.At=s.event??("select"===r.localName?"change":"input")),f)}(e,t,l,r,o));for(let e=0;e<s.length;e++)14===s[e].i&&(s[e].go=s.slice(e+1).filter(e=>1===e.i).map(e=>e.name));return s}var ke=/\{\{([\s\S]+?)\}\}/g;function je(e){let t=e.data,n=[],l=0;ke.lastIndex=0;for(let i=ke.exec(t);null!==i;i=ke.exec(t)){let r=ke.lastIndex-i[0].length;r>l&&e.before(t.slice(l,r));let o=e.ownerDocument.createTextNode("");e.before(o),n.push({a:o,cr:i[1].trim()}),l=ke.lastIndex}return 0===n.length||(l<t.length&&e.before(t.slice(l)),e.remove()),n}function Ae(e,t,n,l){let i=function(e){return{Se:"textContent",$e:["textContent"],on:[],j:[],...x(e),w:"text"}}(t);return{...ge(),a:l,i:0,o:ye(e,i.Qe,n),x:C(i.Ze),U:""}}function Ee(e){let t=e.getAttribute(pe());if(null===t)return null;let n=F(t)[0];return void 0===n||"for"!==n.w&&"if"!==n.w&&"elseif"!==n.w&&"else"!==n.w?null:n}var Fe=(e,t)=>0===e?o.commentIfPrefix:null===t.o?o.commentElsePrefix:o.commentElseIfPrefix;function $e(e,t,n){let l=(t,l)=>({el:t,o:"else"===l.w?null:ye(e,l.Qe,n),x:"else"===l.w?null:C(l.Ze)}),i=[l(t,Ee(t))];for(let e=t.nextSibling;null!==e;e=e.nextSibling){if(3===e.nodeType&&""===e.data.trim()||8===e.nodeType)continue;if(1!==e.nodeType||"template"!==e.localName)break;let t=Ee(e);if(null===t||"elseif"!==t.w&&"else"!==t.w||(i.push(l(e,t)),"else"===t.w))break}return i}var Ce=new WeakSet;function Le(e,t,n,l,i,r,s,u){let a=(t,n)=>{let i=document.createComment(n);return t.replaceWith(i),l&&T.jn?.(e,i,t),i},h=t=>{for(let c=0;c<t.length;c++){let f=t[c];if(null!==f.parentNode)if(1===f.nodeType){let t=f,u=t.localName;if(l){if("script"===u||"style"===u||Ce.has(t))continue;if(Ce.add(t),u===o.tagNames.state){h([...t.childNodes]);continue}}let c="template"===u?Ee(t):null;if(null!==c){if("for"===c.w){let l=ye(e,c.Qe,n),r=Oe(e,t,l,!0);i(a(t,o.commentForPrefix),l,r)}else"if"===c.w?r($e(e,t,n).map((t,l)=>({F:Oe(e,t.el,n,!1),o:t.o,x:t.x,S:a(t.el,Fe(l,t))}))):Se(c.w);continue}let d=t.getAttribute(pe()),m=null===d?null:Te(e,d,n,t,0),p="noscript"!==u&&"iframe"!==u&&!m?.some(Ne)&&!T.$o?.(t);try{l&&p&&h([...t.childNodes])}finally{null!==m&&s(t,m)}!l&&p&&h([...t.childNodes])}else if(3===f.nodeType&&e.Mt&&f.data.includes("{{")&&!Ce.has(f))for(let{a:e,cr:t}of je(f))u(e,t);else if(8===f.nodeType){let e=Pe.exec(f.data),t=e&&f.parentNode.localName;if(null!==t&&"textarea"!==t&&"title"!==t){let t=document.createTextNode("");f.replaceWith(t),u(t,e[1])}}}};h(t)}var Pe=/^\s*@@\s*(?:wcs-text)?\s*:\s*([\s\S]+?)\s*$/,De=e=>{let t=document.createRange();return t.selectNodeContents(e),e.content??t.cloneContents()};function Oe(e,t,n,l){let i=document.importNode(De(t),!0),r=[],o=[],s=e=>r.push(e)-1;Le(e,[...i.childNodes],n,!1,(e,t,n)=>{o.push({...ge(),a:s(e),i:6,o:t,F:n})},e=>{let t=e.map(e=>({a:s(e.S),F:e.F,o:e.o,x:e.x}));o.push({...ge(),a:t[0].a,i:7,G:t})},(e,t)=>{let n=s(e);for(let e of t)xe(e)&&S(203,[e.name]),e.a=n;o.push(...t),e.removeAttribute(pe())},(t,l)=>{o.push(Ae(e,l,n,s(t)))}),Ue(i,new Set(r),!0);let u=r.map(e=>function(e,t){let n=[];for(let l=t;l!==e;l=l.parentNode){let e=0;for(let t=l.previousSibling;null!==t;t=t.previousSibling)e++;n.unshift(e)}return n}(i,e)),a=1===i.childNodes.length&&8!==i.firstChild.nodeType,h=o.some(e=>6===e.i||7===e.i),c=[],f=new Set,d=[],m=[],p=l?n.n+1:-1;for(let e of o){if(5===e.i&&e.et&&!e.Ee&&!Ke(r[e.a],i)){d.push(e);continue}m.push(e);let t=e.o;if(null!==t&&t.n===p&&t.h[p]===n&&Re(e)&&(e.A=c.push(e)-1),7===e.i)for(let t of e.G)f.add(t.a);else f.add(e.a)}let g=[...f].sort((e,t)=>e-t);return{sn:i,root:a?i.firstChild:null,On:u,build:g,Re:d,sr:m,In:a,lr:h,ko:[],ze:c}}function Ke(e,t){for(;e.parentNode!==t;e=e.parentNode){if(e.parentNode.localName.includes("-"))return!0;for(let t=e.previousSibling;t;t=t.previousSibling)if(8===t.nodeType)return!0}return!1}function Re(e){if(null!==e.K)return!1;switch(e.i){case 0:case 2:case 3:case 4:case 8:return!0;case 1:return!e.Ee&&null===e.At;default:return!1}}var We=new Set(["table","thead","tbody","tfoot","tr","colgroup","select","optgroup","datalist"]);function Ue(e,t,n){for(let l=e.firstChild;null!==l;){let e=l.nextSibling;3===l.nodeType?n&&!t.has(l)&&""===l.data.trim()&&l.remove():1===l.nodeType&&Ue(l,t,We.has(l.localName)),l=e}}var Me=new WeakMap;function Ve(e,t){let n=9===t.nodeType?t.body:t;e.root=t,Me.set(t,e),Ie(e,[...n.childNodes]),e.He()}function Ge(e,t,n){try{let l="template"===t.localName?Ee(t):null;null!==l&&!n&&S(204,[l.w]),Ie(e,[t])}catch(e){console.error(e)}e.He()}function Ie(e,t){Le(e,t,null,!0,(t,n,l)=>{new se(e,l,J(e,n,null,t),t).Et()},t=>{re(e,t,null,null)},(t,n)=>{T.jn?.(e,t,n);for(let l of n)ie(e,l,t,null,null)},(t,n)=>{T.jn?.(e,t,n),ie(e,Ae(e,n,null,0),t,null,null)})}export{F as a,ce as b,K as c,R as d,W as e,U as f,M as g,_ as h,se as i,xe as j,Ne as k,Ce as l,De as m,Me as n,Ve as o,Ge as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n,j as t}from"./chunk-V34ZHCK5.js";function i(t,i=[]){return n.Bo?.(t,i)??`#${t}${i.map(n=>` ${"string"==typeof n?JSON.stringify(n):String(n)}`).join("")}`}function o(n,o,r,s){t(i(n,o),r,s)}export{i as a,o as b};
|