@benev/web 0.1.0-3 → 0.1.0-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -7
- package/s/bconfig.ts +9 -0
- package/s/css/parts/common.csstext.ts +38 -0
- package/s/css/parts/core.csstext.ts +1 -1
- package/s/css/parts/vars.csstext.ts +2 -2
- package/s/dom/account/account.ts +7 -0
- package/s/dom/account/style.css.ts +6 -0
- package/s/dom/account/view.ts +16 -0
- package/s/dom/footer/style.css.ts +6 -0
- package/s/dom/footer/view.ts +13 -0
- package/s/dom/header/view.ts +8 -14
- package/s/dom/loader/loader.ts +2 -2
- package/s/dom/loader/style.css.ts +3 -0
- package/s/dom/loader/view.ts +2 -1
- package/s/dom/menu/view.ts +1 -1
- package/s/dom/tools/shadow-duplex.ts +17 -0
- package/s/index-ssg.ts +4 -0
- package/s/index.html.ts +5 -2
- package/s/index.ts +2 -1
- package/s/ssg/top-nav.ts +18 -0
- package/s/types.ts +5 -0
- package/s/vitals/setup.ts +17 -9
- package/s/vitals/shell.ts +3 -3
- package/x/bconfig.d.ts +11 -0
- package/x/bconfig.js +8 -0
- package/x/bconfig.js.map +1 -0
- package/x/css/parts/common.csstext.js +38 -0
- package/x/css/parts/common.csstext.js.map +1 -1
- package/x/css/parts/core.csstext.js +1 -1
- package/x/css/parts/vars.csstext.js +2 -2
- package/x/css/parts/vars.csstext.js.map +1 -1
- package/x/dom/account/account.d.ts +5 -0
- package/x/dom/account/account.js +7 -0
- package/x/dom/account/account.js.map +1 -0
- package/x/dom/account/style.css.d.ts +2 -0
- package/x/dom/account/style.css.js +5 -0
- package/x/dom/account/style.css.js.map +1 -0
- package/x/dom/account/view.d.ts +2 -0
- package/x/dom/account/view.js +11 -0
- package/x/dom/account/view.js.map +1 -0
- package/x/dom/footer/style.css.d.ts +2 -0
- package/x/dom/footer/style.css.js +5 -0
- package/x/dom/footer/style.css.js.map +1 -0
- package/x/dom/footer/view.d.ts +1 -0
- package/x/dom/footer/view.js +10 -0
- package/x/dom/footer/view.js.map +1 -0
- package/x/dom/header/view.d.ts +1 -2
- package/x/dom/header/view.js +5 -12
- package/x/dom/header/view.js.map +1 -1
- package/x/dom/loader/loader.js +2 -2
- package/x/dom/loader/loader.js.map +1 -1
- package/x/dom/loader/style.css.js +3 -0
- package/x/dom/loader/style.css.js.map +1 -1
- package/x/dom/loader/view.js +1 -1
- package/x/dom/loader/view.js.map +1 -1
- package/x/dom/menu/view.d.ts +1 -1
- package/x/dom/menu/view.js +1 -1
- package/x/dom/tools/shadow-duplex.d.ts +2 -0
- package/x/dom/tools/shadow-duplex.js +10 -0
- package/x/dom/tools/shadow-duplex.js.map +1 -0
- package/x/index-ssg.d.ts +3 -0
- package/x/index-ssg.js +3 -0
- package/x/index-ssg.js.map +1 -1
- package/x/index.d.ts +2 -1
- package/x/index.html +47 -4
- package/x/index.html.js +5 -2
- package/x/index.html.js.map +1 -1
- package/x/index.js +2 -1
- package/x/index.js.map +1 -1
- package/x/main.bundle.min.js +386 -69
- package/x/main.bundle.min.js.LEGAL.txt +7 -0
- package/x/main.bundle.min.js.map +4 -4
- package/x/ssg/top-nav.d.ts +2 -0
- package/x/ssg/top-nav.js +12 -0
- package/x/ssg/top-nav.js.map +1 -0
- package/x/types.d.ts +2 -0
- package/x/types.js +2 -0
- package/x/types.js.map +1 -0
- package/x/vitals/setup.d.ts +7 -2
- package/x/vitals/setup.js +16 -9
- package/x/vitals/setup.js.map +1 -1
- package/x/vitals/shell.js +3 -3
- package/x/vitals/shell.js.map +1 -1
- package/s/consts.ts +0 -5
- package/x/consts.d.ts +0 -3
- package/x/consts.js +0 -4
- package/x/consts.js.map +0 -1
package/x/main.bundle.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../node_modules/@lit/reactive-element/src/css-tag.ts", "../node_modules/@lit/reactive-element/src/reactive-element.ts", "../node_modules/lit-html/src/lit-html.ts", "../node_modules/lit-element/src/lit-element.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-fns.ts", "../node_modules/@e280/sly/s/dom/parts/el.ts", "../node_modules/@e280/sly/s/dom/parts/mk.ts", "../node_modules/@e280/sly/s/dom/parts/eve.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/on-attrs.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-proxies.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-spec.ts", "../node_modules/@e280/sly/s/dom/attrs/attrs.ts", "../node_modules/@e280/sly/s/dom/parts/elmer.ts", "../node_modules/@e280/sly/s/dom/parts/queries.ts", "../node_modules/@e280/sly/s/dom/parts/dom-scope.ts", "../node_modules/@e280/sly/s/dom/parts/dashify.ts", "../node_modules/@e280/sly/s/dom/parts/register.ts", "../node_modules/@e280/sly/s/dom/dom.ts", "../node_modules/@e280/stz/s/defer.ts", "../node_modules/@e280/stz/s/debounce/microbounce.ts", "../node_modules/@e280/stz/s/deep/index.barrel.ts", "../node_modules/@e280/stz/s/deep/clone.ts", "../node_modules/@e280/stz/s/is.ts", "../node_modules/@e280/stz/s/deep/equal.ts", "../node_modules/@e280/stz/s/deep/freeze.ts", "../node_modules/@e280/stz/s/ok/fns/got.ts", "../node_modules/@e280/stz/s/utensils/got.ts", "../node_modules/@e280/stz/s/utensils/map.ts", "../node_modules/@e280/stz/s/cycle.ts", "../node_modules/@e280/stz/s/ev.ts", "../node_modules/@e280/stz/s/nap.ts", "../node_modules/@e280/stz/s/templating.ts", "../node_modules/@e280/strata/s/tracker/tracker.ts", "../node_modules/@e280/strata/s/tracker/global.ts", "../node_modules/@e280/strata/s/signals/signal.ts", "../node_modules/@e280/strata/s/signals/batch.ts", "../node_modules/@e280/strata/s/prism/utils/immute.ts", "../node_modules/@e280/strata/s/prism/utils/optic-symbol.ts", "../node_modules/@e280/strata/s/prism/utils/cache-cell.ts", "../node_modules/@e280/strata/s/prism/lens.ts", "../node_modules/@e280/strata/s/wait/parts/get.ts", "../node_modules/@e280/strata/s/wait/parts/is.ts", "../node_modules/@e280/strata/s/wait/parts/select.ts", "../node_modules/@e280/sly/s/view/common/css-reset.ts", "../node_modules/@e280/sly/s/view/common/sly-shadow.ts", "../node_modules/@e280/sly/s/view/parts/cx.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/hooks.ts", "../node_modules/@e280/sly/s/view/parts/reactivity.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/mounts.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/hookscope.ts", "../node_modules/lit-html/src/directive-helpers.ts", "../node_modules/lit-html/src/directive.ts", "../node_modules/lit-html/src/async-directive.ts", "../node_modules/@e280/sly/s/view/elements/shadow.ts", "../node_modules/@e280/sly/s/view/hooks/use-once.ts", "../node_modules/@e280/sly/s/view/hooks/use-ref.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/use-cx.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/use-shadow-cx.ts", "../node_modules/@e280/sly/s/view/hooks/use-host.ts", "../node_modules/@e280/sly/s/view/hooks/use-mount.ts", "../node_modules/@e280/sly/s/view/hooks/use-rendered.ts", "../node_modules/@e280/sly/s/view/hooks/use-shadow.ts", "../node_modules/@e280/sly/s/view/parts/apply-styles.ts", "../node_modules/@e280/sly/s/view/hooks/use-css.ts", "../node_modules/@e280/sly/s/view/hooks/use-mounted.ts", "../node_modules/@e280/sly/s/view/hooks/use-name.ts", "../node_modules/@e280/sly/s/view/hooks/use-signal.ts", "../node_modules/@e280/sly/s/view/hooks/use-styles.ts", "../node_modules/@e280/sly/s/view/hooks/use-wake.ts", "../node_modules/@e280/sly/s/view/parts/apply-attrs.ts", "../node_modules/@e280/sly/s/view/shadow.ts", "../node_modules/@e280/sly/s/spinner/parts/ascii-anim.ts", "../node_modules/@e280/sly/s/spinner/parts/error-display.ts", "../node_modules/@e280/sly/s/spinner/make-spinner.ts", "../node_modules/@e280/sly/s/spinner/spinners/dots.ts", "../node_modules/@e280/sly/s/spinner/spinners/earth.ts", "../node_modules/@e280/sly/s/spinner/spinners/moon.ts", "../node_modules/@e280/sly/s/spinner/spinners/spinner.ts", "../node_modules/@e280/sly/s/spinner/spinners/wave.ts", "../s/consts.ts", "../s/vitals/shell.ts", "../s/css/parts/vars.csstext.ts", "../s/css/parts/core.csstext.ts", "../s/css/parts/page.csstext.ts", "../s/css/parts/common.csstext.ts", "../s/css/benev.csstext.ts", "../s/css/theme.css.ts", "../s/assets/b.png.ts", "../s/dom/loader/style.css.ts", "../s/dom/loader/view.ts", "../s/dom/menu/style.css.ts", "../s/dom/header/style.css.ts", "../s/dom/header/view.ts", "../s/dom/menu/utils/on-keypress.ts", "../s/dom/menu/utils/click-backdrop.ts", "../s/dom/menu/utils/use-after-first-render.ts", "../s/dom/menu/view.ts", "../s/vitals/setup.ts", "../s/dom/loader/loader.ts", "../s/main.bundle.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n\n /**\n * When `true`, uses the initial value of the property as the default value,\n * which changes how attributes are handled:\n * - The initial value does *not* reflect, even if the `reflect` option is `true`.\n * Subsequent changes to the property will reflect, even if they are equal to the\n * default value.\n * - When the attribute is removed, the property is set to the default value\n * - The initial value will not trigger an old value in the `changedProperties` map\n * argument to update lifecycle methods.\n *\n * When set, properties must be initialized, either with a field initializer, or an\n * assignment in the constructor. Not initializing the property may lead to\n * improper handling of subsequent property assignments.\n *\n * While this behavior is opt-in, most properties that reflect to attributes should\n * use `useDefault: true` so that their initial values do not reflect.\n */\n useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n useDefault: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n // Whether this property is wrapping accessors.\n // Helps control the initial value change and reflection logic.\n if (this.prototype.hasOwnProperty(name)) {\n options = Object.create(options);\n options.wrapped = true;\n }\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get,\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set?.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Records property default values when the\n * `useDefault` option is used.\n */\n private __defaultValues?: Map<PropertyKey, unknown>;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that must run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs.\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n const convertedValue = converter.fromAttribute!(value, options.type);\n this[propName as keyof this] =\n convertedValue ??\n this.__defaultValues?.get(propName) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (convertedValue as any);\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @param useNewValue if true, the newValue argument is used instead of\n * reading the property value. This is important to use if the reactive\n * property is a standard private accessor, as opposed to a plain\n * property, since private members can't be dynamically read by name.\n * @param newValue the new value of the property. This is only used if\n * `useNewValue` is true.\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration,\n useNewValue = false,\n newValue?: unknown\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n const ctor = this.constructor as typeof ReactiveElement;\n if (useNewValue === false) {\n newValue = this[name as keyof this];\n }\n options ??= ctor.getPropertyOptions(name);\n const changed =\n (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n // When there is no change, check a corner case that can occur when\n // 1. there's a initial value which was not reflected\n // 2. the property is subsequently set to this value.\n // For example, `prop: {useDefault: true, reflect: true}`\n // and el.prop = 'foo'. This should be considered a change if the\n // attribute is not set because we will now reflect the property to the attribute.\n (options.useDefault &&\n options.reflect &&\n newValue === this.__defaultValues?.get(name) &&\n !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n if (changed) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n {useDefault, reflect, wrapped}: PropertyDeclaration,\n initializeValue?: unknown\n ) {\n // Record default value when useDefault is used. This allows us to\n // restore this value when the attribute is removed.\n if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n this.__defaultValues.set(\n name,\n initializeValue ?? oldValue ?? this[name as keyof this]\n );\n // if this is not wrapping an accessor, it must be an initial setting\n // and in this case we do not want to record the change or reflect.\n if (wrapped !== true || initializeValue !== undefined) {\n return;\n }\n }\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n // On the initial change, the old value should be `undefined`, except\n // with `useDefault`\n if (!this.hasUpdated && !useDefault) {\n oldValue = undefined;\n }\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // `changedProperties` map, but only for the case of properties created\n // via `createProperty` on accessors, which will not have already\n // populated the `changedProperties` map since they are not set.\n // We can't know if these accessors had initializers, so we just set\n // them anyway - a difference from experimental decorators on fields and\n // standard decorators on auto-accessors.\n // For context see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n const {wrapped} = options;\n const value = this[p as keyof this];\n if (\n wrapped === true &&\n !this._$changedProperties.has(p) &&\n value !== undefined\n ) {\n this._$changeProperty(p, undefined, options, value);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.1.2');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib/index.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n });\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\n/**\n * The root DOM node for rendering.\n */\nexport type RenderRootNode = HTMLElement | SVGElement | DocumentFragment;\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for child parts\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives\n * in those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start !== this._$endNode) {\n // The non-null assertion is safe because if _$startNode.nextSibling is\n // null, then _$endNode is also null, and we would not have entered this\n // loop.\n const n = wrap(start!).nextSibling;\n wrap(start!).remove();\n start = n;\n }\n }\n\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.3.3');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n });\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: RenderRootNode,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobal.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litElementPolyfillSupportDevMode\n : global.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.2.2');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "\nimport {AttrValue} from \"../../types.js\"\n\n/** get html attributes */\nexport const attrGet = {\n\tstring: (e: HTMLElement, key: string) => {\n\t\treturn e.getAttribute(key) ?? undefined\n\t},\n\tnumber: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn (raw === null || !raw)\n\t\t\t? undefined\n\t\t\t: Number(raw)\n\t},\n\tboolean: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn raw !== null\n\t},\n}\n\n/** set html attributes */\nexport const attrSet = {\n\tstring: (e: HTMLElement, key: string, value: string | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value)\n\t\treturn true\n\t},\n\tnumber: (e: HTMLElement, key: string, value: number | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value.toString())\n\t\treturn true\n\t},\n\tboolean: (e: HTMLElement, key: string, value: boolean | undefined) => {\n\t\tif (value) e.setAttribute(key, \"\")\n\t\telse e.removeAttribute(key)\n\t\treturn true\n\t},\n\n\tany: (element: HTMLElement, key: string, value: AttrValue) => {\n\t\tif (value === undefined || value === null)\n\t\t\telement.removeAttribute(key)\n\n\t\telse if (typeof value === \"string\")\n\t\t\telement.setAttribute(key, value)\n\n\t\telse if (typeof value === \"number\")\n\t\t\telement.setAttribute(key, value.toString())\n\n\t\telse if (typeof value === \"boolean\") {\n\t\t\tif (value === true)\n\t\t\t\telement.setAttribute(key, \"\")\n\t\t\telse\n\t\t\t\telement.removeAttribute(key)\n\t\t}\n\n\t\telse console.warn(`invalid attribute \"${key}\" type is \"${typeof value}\"`)\n\t},\n\n\tentries: (element: HTMLElement, entries: Iterable<[key: string, value: AttrValue]>) => {\n\t\tfor (const [key, value] of entries)\n\t\t\tattrSet.any(element, key, value)\n\t},\n\n\trecord: (element: HTMLElement, record: Record<string, AttrValue>) => {\n\t\treturn attrSet.entries(element, Object.entries(record))\n\t},\n}\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function el<E extends HTMLElement>(\n\t\ttagName: string,\n\t\tattrs: Record<string, AttrValue> = {},\n\t) {\n\n\tconst element = document.createElement(tagName) as E\n\tattrSet.record(element, attrs)\n\treturn element\n}\n\n", "\nimport {render, TemplateResult} from \"lit\"\n\nexport function mk<E extends Element = HTMLElement>(template: TemplateResult) {\n\tconst fragment = document.createDocumentFragment()\n\trender(template, fragment)\n\treturn fragment.firstElementChild as E\n}\n\n", "\nexport type EveFn = (event: any) => void\nexport type EveConfig = [options: AddEventListenerOptions, fn: EveFn]\nexport type EveHandler = EveFn | EveConfig\nexport type EveSpec = {[eventName: string]: EveHandler}\n\nexport function eve(target: EventTarget, events: EveSpec) {\n\tlet detachers: (() => void)[] = []\n\n\tfor (const [eventName, handler] of Object.entries(events)) {\n\t\tif (typeof handler === \"function\") {\n\t\t\ttarget.addEventListener(eventName, handler)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, handler))\n\t\t}\n\t\telse {\n\t\t\tconst [options, fn] = handler\n\t\t\ttarget.addEventListener(eventName, fn, options)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, fn))\n\t\t}\n\t}\n\n\treturn () => detachers.forEach(d => d())\n}\n\n", "\n/** respond when any attribute changes on the html element */\nexport function onAttrs(element: HTMLElement, fn: MutationCallback) {\n\tconst observer = new MutationObserver(fn)\n\tobserver.observe(element, {attributes: true})\n\treturn () => observer.disconnect()\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\n\n/** a typed proxy accessor for html attributes */\nexport class AttrProxies {\n\tconstructor(public element: HTMLElement) {}\n\n\tstrings = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.string(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: string | undefined) => (\n\t\t\tattrSet.string(this.element, key, value)\n\t\t),\n\t}) as Record<string, string | undefined>\n\n\tnumbers = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.number(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: number | undefined) => (\n\t\t\tattrSet.number(this.element, key, value)\n\t\t),\n\t}) as Record<string, number | undefined>\n\n\tbooleans = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.boolean(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: boolean | undefined) => (\n\t\t\tattrSet.boolean(this.element, key, value)\n\t\t),\n\t}) as Record<string, boolean | undefined>\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\nimport {AttrSpec, AttrTypes} from \"../../types.js\"\n\nexport type AttrSpecOptions = {\n\tbeforeSet?: (attrKey: string) => void\n\tafterSet?: (attrKey: string) => void\n}\n\n/** specify available html attributes and their types and create a proxy accessor */\nexport const attrSpec = <A extends AttrSpec>(\n\t\te: HTMLElement,\n\t\tspec: A,\n\t\toptions: AttrSpecOptions = {},\n\t) => new Proxy(spec, {\n\n\tget: (_target, key: string) => {\n\t\tswitch (spec[key]) {\n\t\t\tcase String: return attrGet.string(e, key)\n\t\t\tcase Number: return attrGet.number(e, key)\n\t\t\tcase Boolean: return attrGet.boolean(e, key)\n\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t}\n\t},\n\n\tset: (_target, key: string, value: any) => {\n\t\ttry {\n\t\t\toptions.beforeSet?.(key)\n\t\t\tswitch (spec[key]) {\n\t\t\t\tcase String: return attrSet.string(e, key, value)\n\t\t\t\tcase Number: return attrSet.number(e, key, value)\n\t\t\t\tcase Boolean: return attrSet.boolean(e, key, value)\n\t\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\toptions.afterSet?.(key)\n\t\t}\n\t},\n}) as any as AttrTypes<A>\n\n", "\nimport {AttrSpec} from \"../types.js\"\nimport {onAttrs} from \"./parts/on-attrs.js\"\nimport {AttrProxies} from \"./parts/attr-proxies.js\"\nimport {attrGet, attrSet} from \"./parts/attr-fns.js\"\nimport {attrSpec, AttrSpecOptions} from \"./parts/attr-spec.js\"\n\nexport function attrs(element: HTMLElement) {\n\tconst proxies = new AttrProxies(element)\n\treturn {\n\t\tstrings: proxies.strings,\n\t\tnumbers: proxies.numbers,\n\t\tbooleans: proxies.booleans,\n\t\ton: (fn: MutationCallback) => onAttrs(element, fn),\n\t\tspec: <A extends AttrSpec>(spec: A, options: AttrSpecOptions = {}) => attrSpec(element, spec, options),\n\t}\n}\n\nattrs.get = attrGet\nattrs.set = attrSet\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function elmer<E extends HTMLElement = HTMLElement>(tagName: string) {\n\treturn new Elmer<E>(tagName)\n}\n\nexport class Elmer<E extends HTMLElement = HTMLElement> {\n\t#attrs = new Map<string, AttrValue>()\n\t#children: (Node | string)[] = []\n\n\tconstructor(public tagName: string) {}\n\n\tattr(key: string, value: AttrValue = true) {\n\t\tthis.#attrs.set(key, value)\n\t\treturn this\n\t}\n\n\tattrs(record: Record<string, AttrValue>) {\n\t\tfor (const [key, value] of Object.entries(record))\n\t\t\tthis.attr(key, value)\n\t\treturn this\n\t}\n\n\tchildren(...elements: (Node | string)[]) {\n\t\tthis.#children.push(...elements)\n\t\treturn this\n\t}\n\n\tdone() {\n\t\tconst element = document.createElement(this.tagName)\n\t\tattrSet.entries(element, this.#attrs)\n\t\telement.append(...this.#children)\n\t\treturn element as E\n\t}\n}\n\n", "\nimport {Queryable} from \"../types.js\"\n\nexport function queryRequire<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\tconst e = container.querySelector<E>(selector)\n\tif (!e) throw new Error(`element not found (${selector})`)\n\treturn e\n}\n\nexport function queryMaybe<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn container.querySelector<E>(selector)\n}\n\nexport function queryAll<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn Array.from(container.querySelectorAll<E>(selector))\n}\n\n", "\nimport {render} from \"lit\"\nimport {eve, EveSpec} from \"./eve.js\"\nimport {attrs} from \"../attrs/attrs.js\"\nimport {Content} from \"../../view/types.js\"\nimport {Attrs, Queryable, Renderable} from \"../types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./queries.js\"\n\nexport class Dom<C extends Queryable> {\n\t#attrs?: Attrs\n\n\tconstructor(public element: C) {}\n\n\tin<E extends Queryable>(selectorOrElement: string | E) {\n\t\treturn new Dom<E>(\n\t\t\t(typeof selectorOrElement === \"string\")\n\t\t\t\t? queryRequire(selectorOrElement, this.element) as E\n\t\t\t\t: selectorOrElement\n\t\t)\n\t}\n\n\trequire<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryRequire<E>(selector, this.element)\n\t}\n\n\tmaybe<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryMaybe<E>(selector, this.element)\n\t}\n\n\tall<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryAll<E>(selector, this.element)\n\t}\n\n\trender(...content: Content[]) {\n\t\treturn render(content, this.element as Renderable)\n\t}\n\n\tget attrs(): Attrs {\n\t\treturn this.#attrs ??= attrs(this.element as HTMLElement)\n\t}\n\n\tevents(spec: EveSpec) {\n\t\treturn eve(this.element, spec)\n\t}\n}\n\n", "\n/**\n * Convert a camel-case name into a dashed name\n * - for example\n * dashify(\"BigManStyle\")\n * // \"big-man-style\"\n */\nexport function dashify(camel: string) {\n\treturn camel.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase()\n}\n\n", "\nimport {dashify} from \"./dashify.js\"\nimport {HTMLElementClasses, RegisterOptions} from \"../types.js\"\n\n/**\n * register custom elements (web components) to the dom\n * - takes an object full of custom html elements, and automatically dashes the names\n * - eg, `MyCoolElement` is registered as `<my-cool-element></my-cool-element>`\n * - calls `customElements.define`\n * - option `soft`\n * - `false` (default) will throw errors if elements are already defined\n * - `true` will do nothing if an element is already defined\n * - option `upgrade`\n * - `true` (default) will run `customElements.upgrade` where appropriate\n * - `false` will NOT upgrade any existing elements on the page\n */\nexport function register<E extends HTMLElementClasses>(\n\t\telements: E,\n\t\toptions: Partial<RegisterOptions> = {},\n\t) {\n\n\tconst {\n\t\tsoft = false,\n\t\tupgrade = true,\n\t} = options\n\n\tfor (const [name, Element] of Object.entries(elements)) {\n\t\tconst tag = dashify(name)\n\t\tconst already = customElements.get(tag)\n\n\t\tif (soft && already)\n\t\t\tcontinue\n\n\t\tcustomElements.define(tag, Element)\n\n\t\tif (upgrade)\n\t\t\tdocument.querySelectorAll(tag).forEach(element => {\n\t\t\t\tif (element.constructor === HTMLElement)\n\t\t\t\t\tcustomElements.upgrade(element)\n\t\t\t})\n\t}\n}\n\n", "\nimport {render} from \"lit\"\nimport {el} from \"./parts/el.js\"\nimport {mk} from \"./parts/mk.js\"\nimport {eve} from \"./parts/eve.js\"\nimport {attrs} from \"./attrs/attrs.js\"\nimport {elmer} from \"./parts/elmer.js\"\nimport {Content} from \"../view/types.js\"\nimport {Dom} from \"./parts/dom-scope.js\"\nimport {register} from \"./parts/register.js\"\nimport {Queryable, Renderable} from \"./types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./parts/queries.js\"\n\nexport function dom<E extends HTMLElement>(selector: string, container: Queryable = document) {\n\treturn queryRequire<E>(selector, container)\n}\n\ndom.in = <E extends Queryable>(selectorOrElement: string | E, container: Queryable = document) => {\n\treturn new Dom(container).in(selectorOrElement)\n}\n\ndom.need = queryRequire\ndom.maybe = queryMaybe\ndom.all = queryAll\n\ndom.el = el\ndom.elmer = elmer\ndom.mk = mk\ndom.events = eve\ndom.attrs = attrs\ndom.register = register\ndom.render = (container: Renderable, ...content: Content[]) => {\n\treturn render(content, container)\n}\n\n", "\n/** a promise which can be resolved from the outside */\nexport type Deferred<R = void> = {\n\tpromise: Promise<R>\n\tresolve: (result: R) => void\n\treject: (reason: any) => void\n\n\t/** ties the fate of this deferred promise to the outcome of the provided outsidePromise */\n\tentangle: (outsidePromise: Promise<R>) => Promise<R>\n}\n\n/** returns a deferred promise with exposed resolve and reject fns */\nexport function defer<R = void>(): Deferred<R> {\n\tlet resolve!: (result: R) => void\n\tlet reject!: (reason: any) => void\n\n\tconst promise = new Promise<R>((res, rej) => {\n\t\tresolve = res\n\t\treject = rej\n\t})\n\n\tfunction entangle(outside: Promise<R>) {\n\t\toutside.then(resolve).catch(reject)\n\t\treturn promise\n\t}\n\n\treturn {promise, resolve, reject, entangle}\n}\n\n", "\nimport {defer, Deferred} from \"../defer.js\"\n\nexport function microbounce<F extends (...params: any[]) => any>(fn: F) {\n\tlet scheduled: {\n\t\tparams: any[]\n\t\tdeferred: Deferred<any>\n\t} | null = null\n\n\treturn ((...params: any[]) => {\n\t\tif (scheduled) {\n\t\t\tscheduled.params = params\n\t\t}\n\t\telse {\n\t\t\tscheduled = {params, deferred: defer()}\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst {params, deferred} = scheduled!\n\t\t\t\tscheduled = null\n\t\t\t\tPromise.resolve(fn(...params))\n\t\t\t\t\t.then(deferred.resolve)\n\t\t\t\t\t.catch(deferred.reject)\n\t\t\t})\n\t\t}\n\t\treturn scheduled.deferred.promise\n\t}) as ((...params: Parameters<F>) => Promise<Awaited<ReturnType<F>>>)\n}\n\n", "\nexport * from \"./clone.js\"\nexport * from \"./equal.js\"\nexport * from \"./freeze.js\"\n\n", "\nexport function clone<T>(data: T, refs = new Set<any>()): T {\n\n\tif (refs.has(data))\n\t\tthrow new Error(\"cannot clone circular reference\")\n\n\tlet copy = undefined as T\n\n\tif (typeof data === \"function\" || (data !== null && typeof data === \"object\")) {\n\t\trefs.add(data)\n\n\t\tif (Array.isArray(data))\n\t\t\tcopy = data.map(d => clone(d, new Set(refs))) as T\n\n\t\telse if (data.constructor === Object)\n\t\t\tcopy = Object.fromEntries(\n\t\t\t\tObject.entries(data)\n\t\t\t\t\t.map(([key, d]) => [key, clone(d, new Set(refs))])\n\t\t\t) as T\n\n\t\telse if (data instanceof Map)\n\t\t\tcopy = new Map(Array.from(data, ([key, val]) => [key, clone(val, new Set(refs))])) as T\n\n\t\telse if (data instanceof Set)\n\t\t\tcopy = new Set(Array.from(data, val => clone(val, new Set(refs)))) as T\n\n\t\telse if (data instanceof Date)\n\t\t\tcopy = new Date(data.getTime()) as T\n\n\t\telse\n\t\t\tcopy = data\n\n\t\trefs.delete(data) // Remove current data from refs once we're done with this branch of the object tree\n\t}\n\n\telse\n\t\tcopy = data\n\n\treturn copy\n}\n\n", "\n/** not null or undefined */\nexport function happy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** null or undefined */\nexport function sad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\nexport const is = Object.freeze({\n\n\t/** not null or undefined */\n\thappy,\n\n\t/** null or undefined */\n\tsad,\n\n\tboolean: (x: any): x is boolean =>\n\t\ttypeof x === \"boolean\",\n\n\tnumber: (x: any): x is number =>\n\t\ttypeof x === \"number\",\n\n\tstring: (x: any): x is string =>\n\t\ttypeof x === \"string\",\n\n\tbigint: (x: any): x is bigint =>\n\t\ttypeof x === \"bigint\",\n\n\tobject: <X>(x: X): x is object & NonNullable<X> =>\n\t\ttypeof x === \"object\" && x !== null,\n\n\tarray: (x: any | any[]): x is any[] =>\n\t\tArray.isArray(x),\n\n\tfn: (x: any): x is (...a: any[]) => any =>\n\t\ttypeof x === \"function\",\n\n\tsymbol: (x: any): x is symbol =>\n\t\ttypeof x === \"symbol\",\n})\n\n", "\nimport {is} from \"../is.js\"\n\nexport const equal = (alpha: any, bravo: any): boolean => {\n\n\tfunction recurse(alpha: any, bravo: any, parents: object[]) {\n\t\tif (!is.object(alpha) || !is.object(bravo))\n\t\t\treturn alpha === bravo\n\n\t\tif (parents.includes(alpha))\n\t\t\tthrow new Error(`forbidden circularity detected in deep equal comparison`)\n\n\t\tconst newParents = [...parents, alpha]\n\n\t\tif (alpha instanceof Map && bravo instanceof Map) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const [key, val] of alpha)\n\t\t\t\tif (!bravo.has(key) || !recurse(val, bravo.get(key), newParents))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse if (alpha instanceof Set && bravo instanceof Set) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const item of alpha)\n\t\t\t\tif (!Array.from(bravo).some(bItem => recurse(item, bItem, newParents)))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse {\n\t\t\tconst keys1 = Object.keys(alpha)\n\t\t\tconst keys2 = Object.keys(bravo)\n\n\t\t\tif (keys1.length !== keys2.length)\n\t\t\t\treturn false\n\n\t\t\tfor (const key of keys1) {\n\t\t\t\tif (!keys2.includes(key))\n\t\t\t\t\treturn false\n\t\t\t\tif (!recurse(alpha[key], bravo[key], newParents))\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn recurse(alpha, bravo, [])\n}\n\n", "\nimport {is} from \"../is.js\"\n\nexport function freeze<X>(item: X): X {\n\tfunction recurse(x: X, parents: object[]) {\n\t\tif (!is.object(x) || parents.includes(x))\n\t\t\treturn x\n\n\t\tconst newParents = [...parents, x]\n\n\t\tif (x instanceof Map)\n\t\t\tfor (const arr of x.entries())\n\t\t\t\tfor (const y of arr)\n\t\t\t\t\trecurse(y, newParents)\n\n\t\telse if (x instanceof Set)\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse if (Array.isArray(x))\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse\n\t\t\tfor (const y of Object.values(x))\n\t\t\t\trecurse(y, newParents)\n\n\t\treturn Object.freeze(x)\n\t}\n\n\treturn recurse(item, [])\n}\n\n", "\nimport type {Result} from \"../types/result.js\"\n\n/** return ok value, otherwise throw error */\nexport function gotOk<Value, E>(result: Result<Value, E>): Value {\n\tif (result.ok)\n\t\treturn result.value\n\n\tconst {error} = result\n\n\tif (error instanceof Error)\n\t\tthrow error\n\n\telse if (typeof error === \"string\")\n\t\tthrow new Error(error)\n\n\telse\n\t\tthrow new Error(\"unknown\")\n}\n\n/** return error, otherwise throw error */\nexport function gotErr<E>(result: Result<unknown, E>): E {\n\tif (result.ok) throw new Error(\"didn't get needed error\")\n\treturn result.error\n}\n\n/** @deprecated renamed to `gotOk` */\nexport const needOk = gotOk\n\n/** @deprecated renamed to `gotErr` */\nexport const needErr = gotErr\n\n", "\nexport function got<X>(thing: X | undefined | null, err = \"got failed\"): X {\n\tif (thing === undefined || thing === null) throw new Error(err)\n\treturn thing\n}\n\n", "\ntype MapLike<K, V> = {\n\thas(key: K): boolean\n\tget(key: K): V | undefined\n\tset(key: K, value: V): unknown\n}\n\nexport function need<K, V>(\n\t\tmap: Pick<MapLike<K, V>, \"has\" | \"get\">,\n\t\tkey: K,\n\t\terr = (typeof key === \"string\" ? `needed key not found \"${key}\"` : \"needed key not found\"),\n\t) {\n\tif (map.has(key))\n\t\treturn map.get(key) as V\n\telse\n\t\tthrow new Error(err)\n}\n\nexport function guarantee<K, V>(map: MapLike<K, V>, key: K, make: () => V) {\n\tif (map.has(key))\n\t\treturn map.get(key)!\n\telse {\n\t\tconst value = make()\n\t\tmap.set(key, value)\n\t\treturn value\n\t}\n}\n\nexport function inserts<K, V, M extends Pick<MapLike<K, V>, \"set\">>(map: M, entries: Iterable<[K, V]>) {\n\tfor (const [key, value] of entries)\n\t\tmap.set(key, value)\n\treturn map\n}\n\n", "\n/**\n * repeat the given async function over and over.\n * - consider using `nap` in your fn to create a delay\n */\nexport function cycle(fn: (stop: () => void) => unknown | Promise<unknown>) {\n\tlet timeout: any\n\tlet stopped = false\n\n\tconst stop = () => {\n\t\tstopped = true\n\t\tclearTimeout(timeout)\n\t}\n\n\tconst tick = async() => {\n\t\tif (stopped) return\n\t\tawait fn(stop)\n\t\tif (stopped) return\n\t\ttimeout = setTimeout(tick, 0)\n\t}\n\n\ttick()\n\treturn stop\n}\n\n", "\nexport type EvFn = (...a: any[]) => void\n\nexport type EvTarget<N extends string> = {\n\taddEventListener(name: N, fn: EvFn): void\n\tremoveEventListener(name: N, fn: EvFn): void\n}\n\nexport function ev<N extends string>(target: EvTarget<N>, fns: Record<N, EvFn>) {\n\tconst entries = Object.entries(fns) as [N, EvFn][]\n\n\tfor (const [name, fn] of entries)\n\t\ttarget.addEventListener(name, fn)\n\n\treturn () => {\n\t\tfor (const [name, fn] of entries)\n\t\t\ttarget.removeEventListener(name, fn)\n\t}\n}\n\n", "\n/** create a promise that waits for a number of milliseconds. */\nexport const nap = (milliseconds: number = 0) => (\n\tnew Promise<void>(resolve => setTimeout(resolve, milliseconds))\n)\n\n", "\nexport type TemplateParts = {\n\tstrings: TemplateStringsArray\n\tvalues: any[]\n}\n\nexport function templateParts(\n\t\tstrings: TemplateStringsArray,\n\t\t...values: any[]\n\t): TemplateParts {\n\n\treturn {strings, values}\n}\n\nexport function templateString(strings: TemplateStringsArray, ...values: any[]) {\n\tconst lastIndex = strings.length - 1\n\treturn strings\n\t\t.slice(0, lastIndex)\n\t\t.reduce((a, b, c) => a + b + values[c], \"\")\n\t\t\t+ strings[lastIndex]\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\n\nexport type Trackable = object | symbol\n\n/**\n * reactivity integration hub\n */\nexport class Tracker<Item extends Trackable = any> {\n\t#busy = new Set<() => void>()\n\t#observationLayers: Set<Item>[] = []\n\t#subscriptions = new WeakMap<Item, Set<() => void>>()\n\n\t#batchDepth = 0\n\t#batchPending = new Set<() => void>()\n\n\t/** indicate to observers that this item was accessed */\n\tread(item: Item) {\n\t\tconst top = this.#observationLayers.at(-1)\n\t\ttop?.add(item)\n\t}\n\n\t/** invoke all subscriptions for this item */\n\twrite(item: Item) {\n\t\tconst fns = this.#subscriptions.get(item)\n\t\tif (!fns) return\n\n\t\tfor (const fn of fns)\n\t\t\tthis.#batchPending.add(fn)\n\n\t\tif (this.#batchDepth === 0)\n\t\t\tthis.#flush()\n\t}\n\n\t/** collect items that were read during fn */\n\tobserve<Value>(fn: () => Value) {\n\t\tconst seen = new Set<Item>()\n\t\tthis.#observationLayers.push(seen)\n\t\ttry {\n\t\t\tconst value = fn()\n\t\t\treturn {seen, value}\n\t\t}\n\t\tfinally {\n\t\t\tthis.#observationLayers.pop()\n\t\t}\n\t}\n\n\t/** fn will be called when item changes */\n\tsubscribe(item: Item, fn: () => void) {\n\t\tconst fns = guarantee(this.#subscriptions, item, () => new Set())\n\t\tfns.add(fn)\n\t\treturn () => {\n\t\t\tfns.delete(fn)\n\t\t\tif (fns.size === 0)\n\t\t\t\tthis.#subscriptions.delete(item)\n\t\t}\n\t}\n\n\tbatch = <R>(fn: () => R) => {\n\t\tthis.#batchDepth++\n\t\ttry {\n\t\t\treturn fn()\n\t\t}\n\t\tfinally {\n\t\t\tthis.#batchDepth--\n\t\t\tif (this.#batchDepth === 0)\n\t\t\t\tthis.#flush()\n\t\t}\n\t}\n\n\t#run(fn: () => void) {\n\t\tif (this.#busy.has(fn))\n\t\t\tthrow new Error(\"circularity forbidden\")\n\t\tthis.#busy.add(fn)\n\t\ttry { fn() }\n\t\tfinally { this.#busy.delete(fn) }\n\t}\n\n\t#flush() {\n\t\twhile (this.#batchPending.size > 0) {\n\t\t\tconst pending = [...this.#batchPending]\n\t\t\tthis.#batchPending.clear()\n\n\t\t\tfor (const fn of pending)\n\t\t\t\tthis.#run(fn)\n\t\t}\n\t}\n}\n\n", "\nimport {Tracker} from \"./tracker.js\"\n\n/** standard global tracker for integrations */\nexport const tracker: Tracker = (globalThis as any)[Symbol.for(\"e280.tracker.2\")] ??= new Tracker()\n\n", "\nimport {Signal} from \"./types.js\"\nimport {tracker} from \"../tracker/global.js\"\n\nexport function signal<Value>(value: Value): Signal<Value> {\n\treturn function sig() {\n\t\tif (arguments.length === 0) {\n\t\t\ttracker.read(sig)\n\t\t\treturn value\n\t\t}\n\t\telse {\n\t\t\tvalue = arguments[0]\n\t\t\ttracker.write(sig)\n\t\t\treturn value\n\t\t}\n\t}\n}\n\n", "\nimport {tracker} from \"../tracker/global.js\"\n\nexport const batch = tracker.batch\n\n", "\nimport {deep} from \"@e280/stz\"\nimport {Immutable} from \"../types.js\"\n\nexport function immute<S>(s: S) {\n\treturn deep.freeze(deep.clone(s)) as Immutable<S>\n}\n\n", "\nexport const _optic = Symbol(\"optic\")\n\n", "\nexport class CacheCell<R> {\n\t#dirty = false\n\t#value: R\n\n\tconstructor(private calculate: () => R) {\n\t\tthis.#value = calculate()\n\t}\n\n\tget() {\n\t\tif (this.#dirty) {\n\t\t\tthis.#dirty = false\n\t\t\tthis.#value = this.calculate()\n\t\t}\n\t\treturn this.#value\n\t}\n\n\tinvalidate() {\n\t\tthis.#dirty = true\n\t}\n}\n\n", "\nimport {deep} from \"@e280/stz\"\nimport {immute} from \"./utils/immute.js\"\nimport {tracker} from \"../tracker/global.js\"\nimport {_optic} from \"./utils/optic-symbol.js\"\nimport {CacheCell} from \"./utils/cache-cell.js\"\nimport {Immutable, LensLike, Optic} from \"./types.js\"\n\n/** reactive view into a state prism, with formalized mutations */\nexport class Lens<State> implements LensLike<State> {\n\t;[_optic]: Optic<State>\n\t#previous: State\n\t#stateCache: CacheCell<State>\n\t#frozenCache: CacheCell<Immutable<State>>\n\n\tconstructor(optic: Optic<State>) {\n\t\tthis[_optic] = optic\n\t\tthis.#previous = deep.clone(optic.getState())\n\t\tthis.#stateCache = new CacheCell(() => deep.clone(optic.getState()))\n\t\tthis.#frozenCache = new CacheCell(() => immute(optic.getState()))\n\t}\n\n\tupdate() {\n\t\tconst state = this[_optic].getState()\n\t\tconst isChanged = !deep.equal(state, this.#previous)\n\t\tif (isChanged) {\n\t\t\tthis.#stateCache.invalidate()\n\t\t\tthis.#frozenCache.invalidate()\n\t\t\tthis.#previous = deep.clone(state)\n\t\t\ttracker.write(this)\n\t\t}\n\t}\n\n\t/** get a snapshot of the current state. it's typed as mutable, but you should not mutate it. */\n\tget state() {\n\t\ttracker.read(this)\n\t\treturn this.#stateCache.get()\n\t}\n\n\t/** get an immutable readonly snapshot of the current state. */\n\tget frozen() {\n\t\ttracker.read(this)\n\t\treturn this.#frozenCache.get()\n\t}\n\n\tmutate<R>(fn: (state: State) => R) {\n\t\treturn this[_optic].mutate(fn)\n\t}\n\n\tlens<State2>(selector: (state: State) => State2) {\n\t\tconst lens = new Lens<State2>({\n\t\t\tgetState: () => selector(this[_optic].getState()),\n\t\t\tmutate: fn => this[_optic].mutate(state => fn(selector(state))),\n\t\t\tregisterLens: this[_optic].registerLens,\n\t\t})\n\t\tthis[_optic].registerLens(lens)\n\t\treturn lens\n\t}\n}\n\n", "\nimport {getErr, getOk, gotOk, gotErr} from \"@e280/stz\"\nimport {Wait} from \"./type.js\"\n\nexport function waitGet<Value>(wait: Wait<Value>) {\n\treturn wait.done\n\t\t? getOk(wait)\n\t\t: undefined\n}\n\nexport function waitGot<Value>(wait: Wait<Value>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotOk(wait)\n}\n\nexport function waitGetErr<E = unknown>(wait: Wait<unknown, E>) {\n\treturn wait.done\n\t\t? getErr(wait)\n\t\t: undefined\n}\n\nexport function waitGotErr<E = unknown>(wait: Wait<unknown, E>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotErr(wait)\n}\n\n/** @deprecated renamed to `waitGet` */\nexport const waitGetOk = waitGet\n\n/** @deprecated renamed to `waitGot` */\nexport const waitNeedOk = waitGot\n\n/** @deprecated renamed to `waitGotErr` */\nexport const waitNeedErr = waitGotErr\n\n", "\nimport {Wait, WaitResult, WaitErr, WaitOk, WaitPending} from \"./type.js\"\n\nexport const isWaitPending = (wait: Wait<unknown>): wait is WaitPending => !wait.done\nexport const isWaitDone = <Value, E = unknown>(wait: Wait<Value, E>): wait is WaitResult<Value, E> => wait.done\nexport const isWaitOk = <Value>(wait: Wait<Value, unknown>): wait is WaitOk<Value> => wait.done && wait.ok\nexport const isWaitErr = <E = unknown>(wait: Wait<unknown, E>): wait is WaitErr<E> => wait.done && !wait.ok\n\n", "\nimport {Wait} from \"./type.js\"\nimport {isWaitOk, isWaitPending} from \"./is.js\"\nimport {waitGotErr, waitGot} from \"./get.js\"\n\nexport function waitSelect<Ret, Value, E = unknown>(wait: Wait<Value, E>, select: {\n\t\tpending?: () => Ret\n\t\tok?: (value: Value) => Ret\n\t\terr?: (error: E) => Ret\n\t}) {\n\n\tconst {\n\t\tpending = () => {},\n\t\tok = () => {},\n\t\terr = () => {},\n\t} = select\n\n\tif (isWaitPending(wait))\n\t\treturn pending()\n\n\telse if (isWaitOk(wait))\n\t\treturn ok(waitGot(wait))\n\n\telse\n\t\treturn err(waitGotErr(wait))\n}\n\n", "\nimport {css, CSSResultGroup} from \"lit\"\n\nexport const cssReset: CSSResultGroup = css`\n\t* {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tbox-sizing: border-box;\n\n\t\tscrollbar-width: thin;\n\t\tscrollbar-color: #888 transparent;\n\t}\n\n\t::-webkit-scrollbar { width: 8px; }\n\t::-webkit-scrollbar-track { background: transparent; }\n\t::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n\t::-webkit-scrollbar-thumb:hover { background: #999; }\n`\n\n", "\nimport {dom} from \"../../dom/dom.js\"\n\nexport class SlyShadow extends HTMLElement {\n\tstatic register() {\n\t\tdom.register({SlyShadow}, {soft: true})\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.hasAttribute(\"view\"))\n\t\t\tthis.setAttribute(\"view\", \"\")\n\t}\n}\n\n", "\nimport {defer} from \"@e280/stz\"\n\nexport class LightCx {\n\tcount = 0\n\trendered = defer<void>()\n\n\tconstructor(public render: () => Promise<void>) {}\n\n\tdoneRender() {\n\t\tthis.count++\n\t\tthis.rendered.resolve()\n\t\tthis.rendered = defer()\n\t}\n}\n\nexport class ShadowCx extends LightCx {\n\tconstructor(\n\t\t\trender: () => Promise<void>,\n\t\t\tpublic host: HTMLElement,\n\t\t\tpublic shadow: ShadowRoot,\n\t\t) {\n\t\tsuper(render)\n\t}\n}\n\n", "\nimport {Hookscope} from \"./hookscope.js\"\n\nexport class Hooks {\n\t#scopes: Hookscope[] = []\n\n\tget scope() {\n\t\tconst scope = this.#scopes.at(-1)\n\t\tif (!scope) throw new Error(\"hooks must be called within a render fn\")\n\t\treturn scope\n\t}\n\n\tincrement() {\n\t\tconst scope = this.scope\n\t\tconst position = scope.position++\n\t\treturn {scope, position}\n\t}\n\n\twrap<Ret>(scope: Hookscope, fn: () => Ret) {\n\t\tscope.position = 0\n\t\tthis.#scopes.push(scope)\n\t\ttry { return fn() }\n\t\tfinally { this.#scopes.pop() }\n\t}\n}\n\nexport const hooks: Hooks = (globalThis as any)[Symbol.for(\"e280.hooks\")] ??= new Hooks()\n\n", "\nimport {tracker} from \"@e280/strata\"\n\nexport class Reactivity {\n\t#stoppers: (() => void)[] = []\n\n\tclear() {\n\t\tthis.#stoppers.forEach(stop => stop())\n\t\tthis.#stoppers = []\n\t}\n\n\tobserve<X>(fn: () => X, rerender: () => Promise<void>) {\n\t\tconst {seen, value} = tracker.observe(fn)\n\t\tthis.clear()\n\t\tfor (const item of seen) {\n\t\t\tconst stop = tracker.subscribe(item, rerender)\n\t\t\tthis.#stoppers.push(stop)\n\t\t}\n\t\treturn value\n\t}\n}\n\n", "\nexport class Mounts {\n\t#mounters: (() => () => void)[] = []\n\t#unmounters: (() => void)[] = []\n\n\tmount(mount: () => () => void) {\n\t\tthis.#mounters.push(mount)\n\t\tthis.#unmounters.push(mount())\n\t}\n\n\tunmountAll() {\n\t\tfor (const unmount of this.#unmounters)\n\t\t\tunmount()\n\t\tthis.#unmounters = []\n\t}\n\n\tremountAll() {\n\t\tfor (const mount of this.#mounters)\n\t\t\tthis.#unmounters.push(mount())\n\t}\n}\n\n", "\nimport {Mounts} from \"./mounts.js\"\nimport {LightCx, ShadowCx} from \"../../parts/cx.js\"\n\nexport class Hookscope {\n\tposition = 0\n\tvalues = new Map<number, any>()\n\tmounts = new Mounts()\n\tconstructor(public cx: LightCx | ShadowCx) {}\n}\n\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$clear();\n part._$startNode.remove();\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {Content} from \"../types.js\"\nimport {ShadowCx} from \"../parts/cx.js\"\nimport {hooks} from \"../hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"../parts/reactivity.js\"\nimport {Hookscope} from \"../hooks/plumbing/hookscope.js\"\n\nexport function shadowElement(view: () => Content): new() => HTMLElement {\n\treturn class extends HTMLElement {\n\t\t#cx\n\t\t#hookscope\n\t\t#reactivity = new Reactivity()\n\t\t#shadow = this.attachShadow({mode: \"open\"})\n\n\t\tconstructor() {\n\t\t\tsuper()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent()\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, this, this.#shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent() {\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view()),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender() {\n\t\t\tlitRender(this.#renderContent(), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\t}\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\n/** run the fn only one time */\nexport function useOnce<Value>(fn: () => Value) {\n\tconst {scope, position} = hooks.increment()\n\treturn guarantee(scope.values, position, fn) as Value\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\n\nexport function useRef<Value>(initial: Value) {\n\treturn useOnce(() => new Ref(initial))\n}\n\nexport class Ref<Value> {\n\tconstructor(public current: Value) {}\n}\n\n", "\nimport {hooks} from \"./hooks.js\"\n\nexport function useCx() {\n\treturn hooks.increment().scope.cx\n}\n\n", "\nimport {useCx} from \"./use-cx.js\"\nimport {ShadowCx} from \"../../parts/cx.js\"\n\nexport function useShadowCx() {\n\tconst cx = useCx()\n\n\tif (!(cx instanceof ShadowCx))\n\t\tthrow new Error(\"this hook only works on shadow views (but was called in a light view)\")\n\n\treturn cx\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow view's host element */\nexport function useHost() {\n\treturn useShadowCx().host\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\nexport function useMount(fn: () => () => void) {\n\tconst {scope} = hooks.increment()\n\treturn useOnce(() => scope.mounts.mount(fn))\n}\n\n", "\nimport {useCx} from \"./plumbing/use-cx.js\"\n\n/** return a promise that resolves after the next render is complete */\nexport function useRendered() {\n\treturn useCx().rendered.promise\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow root */\nexport function useShadow() {\n\treturn useShadowCx().shadow\n}\n\n", "\nimport {adoptStyles, CSSResultGroup, CSSResultOrNative, getCompatibleStyle} from \"lit\"\n\nexport function applyStyles(shadow: ShadowRoot, styles?: CSSResultGroup) {\n\tadoptStyles(shadow, prepareStyles(styles))\n}\n\nfunction prepareStyles(styles?: CSSResultGroup): Array<CSSResultOrNative> {\n\tconst elementStyles = []\n\n\tif (Array.isArray(styles)) {\n\t\tconst set = new Set((styles as Array<unknown>).flat(Infinity).reverse())\n\t\tfor (const s of set)\n\t\t\telementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative))\n\t}\n\telse if (styles !== undefined)\n\t\telementStyles.push(getCompatibleStyle(styles))\n\n\treturn elementStyles\n}\n\n", "\nimport {CSSResultGroup} from \"lit\"\nimport {useOnce} from \"./use-once.js\"\nimport {useShadow} from \"./use-shadow.js\"\nimport {applyStyles} from \"../parts/apply-styles.js\"\n\n/** attach stylesheets to the shadow root */\nexport function useCss(...styles: CSSResultGroup[]) {\n\tconst shadow = useShadow()\n\tuseOnce(() => applyStyles(shadow, styles))\n}\n\n", "\nimport {useRef} from \"./use-ref.js\"\nimport {useMount} from \"./use-mount.js\"\n\n/** mount/unmount lifecycle, but also return a value */\nexport function useMounted<Value>(fn: () => [value: Value, dispose: () => void]) {\n\tconst ref = useRef<Value>(undefined as Value)\n\n\tuseMount(() => {\n\t\tconst [value, dispose] = fn()\n\t\tref.current = value\n\t\treturn dispose\n\t})\n\n\treturn ref.current\n}\n\n/** @deprecated renamed to `useMounted` */\nexport const useLifecycle = useMounted\n\n", "\nimport {useHost} from \"./use-host.js\"\nimport {useOnce} from \"./use-once.js\"\n\n/** sets the host element's \"data-view\" attribute */\nexport function useName(name = \"\") {\n\tconst host = useHost()\n\tuseOnce(() => host.setAttribute(\"view\", name))\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {useOnce} from \"./use-once.js\"\n\nexport function useSignal<Value>(value: Value) {\n\treturn useOnce(() => signal(value))\n}\n\n", "\nimport {useCss} from \"./use-css.js\"\n\n/** alias for `useCss` */\nexport const useStyles = useCss\n\n", "\nimport {useMounted} from \"./use-mounted.js\"\n\n/** run the fn whenever the view is mounted */\nexport function useWake<Value>(fn: () => Value) {\n\treturn useMounted(() => [fn(), () => {}])\n}\n\n", "\nimport {ViewAttr, ViewAttrs} from \"../types.js\"\n\nexport function applyAttrs(element: HTMLElement, attrs: ViewAttrs) {\n\tfor (const [name, value] of Object.entries(attrs))\n\t\tapplyAttr(element, name, value)\n}\n\nfunction applyAttr(element: HTMLElement, name: string, value: ViewAttr) {\n\tconst existing = element.getAttribute(name)\n\tconst v = coerce(value)\n\tif (v === existing) return\n\tif (v === null) element.removeAttribute(name)\n\telse element.setAttribute(name, v)\n}\n\nfunction coerce(value: ViewAttr) {\n\tif (typeof value === \"string\") return value\n\telse if (typeof value === \"number\") return value.toString()\n\treturn value ? \"\" : null\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {ShadowCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {SlyShadow} from \"./common/sly-shadow.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {applyAttrs} from \"./parts/apply-attrs.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {View, Placement, ShadowSetup, ShadowView} from \"./types.js\"\nimport {AsyncDirective, directive, PartInfo} from \"lit/async-directive.js\"\n\nexport function shadowSetup(): ShadowSetup {\n\tSlyShadow.register()\n\tconst host = document.createElement(\"sly-shadow\")\n\tconst shadow = host.attachShadow({mode: \"open\"})\n\treturn {host, shadow}\n}\n\nexport function shadow<Props extends any[]>(view: View<Props>) {\n\treturn rawShadow(shadowSetup, view)\n}\n\nshadow.setup = (setup: () => ShadowSetup) => (\n\t<Props extends any[]>(view: View<Props>) => (\n\t\trawShadow(setup, view)\n\t)\n)\n\nfunction rawShadow<Props extends any[]>(\n\t\tsetup: () => ShadowSetup,\n\t\tview: View<Props>,\n\t) {\n\n\tconst directiveFn = directive(class extends AsyncDirective {\n\t\t#cx\n\t\t#hookscope\n\t\t#props!: Props\n\t\t#reactivity = new Reactivity()\n\n\t\tconstructor(part: PartInfo) {\n\t\t\tsuper(part)\n\t\t\tconst {host, shadow} = setup()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent(this.#props)\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, host, shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent(props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender({props, children, attrs}: Placement<Props>) {\n\t\t\tconst {host} = this.#cx\n\t\t\tif (!this.isConnected) return host\n\t\t\tif (attrs) applyAttrs(host, attrs)\n\t\t\tlitRender(children, this.#cx.host)\n\t\t\tlitRender(this.#renderContent(props), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t\treturn host\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tlitRender(null, this.#cx.shadow)\n\t\t\tlitRender(null, this.#cx.host)\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as ShadowView<[Placement<Props>]>\n\n\tfunction shadowView(...props: Props) {\n\t\treturn directiveFn({props})\n\t}\n\n\tshadowView.with = directiveFn\n\n\treturn shadowView as ShadowView<Props>\n}\n\n", "\nimport {css} from \"lit\"\nimport {nap, cycle} from \"@e280/stz\"\nimport {Content} from \"../../view/types.js\"\nimport {cssReset, shadow, useMount, useName, useSignal, useStyles} from \"../../view/index.js\"\n\nexport function makeAsciiAnim(hz: number, frames: string[]): () => Content {\n\treturn () => AsciiAnim({hz, frames})\n}\n\nexport const AsciiAnim = shadow(({hz, frames}: {\n\t\thz: number,\n\t\tframes: string[],\n\t}) => {\n\n\tuseName(\"loading\")\n\tuseStyles(cssReset, style)\n\n\tconst $frame = useSignal(0)\n\n\tuseMount(() => cycle(async() => {\n\t\tawait nap(1000 / hz)\n\t\tconst next = $frame() + 1\n\t\t$frame(next >= frames.length ? 0 : next)\n\t}))\n\n\treturn frames.at($frame())\n})\n\nconst style = css`\n:host {\n\tfont-family: monospace;\n\twhite-space: pre;\n\tuser-select: none;\n}\n`\n\n", "\nimport {css, html} from \"lit\"\nimport {shadow} from \"../../view/shadow.js\"\nimport {cssReset, useName, useStyles} from \"../../view/index.js\"\n\nexport const ErrorDisplay = shadow((error: any) => {\n\tuseName(\"error\")\n\tuseStyles(cssReset, style)\n\n\tif (typeof error === \"string\")\n\t\treturn error\n\n\telse if (error instanceof Error)\n\t\treturn html`<strong>${error.name}:</strong> <span>${error.message}</span>`\n\n\telse\n\t\treturn `error`\n})\n\nconst style = css`\n\t:host {\n\t\tfont-family: monospace;\n\t\tcolor: red;\n\t}\n`\n\n", "\nimport {waitSelect} from \"@e280/strata\"\n\nimport {Spinner} from \"./types.js\"\nimport {Content} from \"../view/types.js\"\n\nexport function makeSpinner(\n\t\tpending: () => Content,\n\t\terr: (error: unknown) => Content,\n\t): Spinner {\n\t\n\treturn (wait, ok) => waitSelect(wait, {pending, err, ok})\n}\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const dotsSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\" \",\n\t\t\" \",\n\t\t\". \",\n\t\t\".. \",\n\t\t\"...\",\n\t\t\" ..\",\n\t\t\" .\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const earthSpinner = makeSpinner(\n\tmakeAsciiAnim(3, [\"\uD83C\uDF0E\", \"\uD83C\uDF0F\", \"\uD83C\uDF0D\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const moonSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\"\uD83C\uDF12\",\n\t\t\"\uD83C\uDF13\",\n\t\t\"\uD83C\uDF14\",\n\t\t\"\uD83C\uDF15\",\n\t\t\"\uD83C\uDF16\",\n\t\t\"\uD83C\uDF17\",\n\t\t\"\uD83C\uDF18\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const spinner = makeSpinner(\n\tmakeAsciiAnim(16, [\"|\", \"/\", \"-\", \"\\\\\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const waveSpinner = makeSpinner(\n\tmakeAsciiAnim(20, [\n\t\t\":....\",\n\t\t\":....\",\n\t\t\"::...\",\n\t\t\".::..\",\n\t\t\"..::.\",\n\t\t\"...::\",\n\t\t\"....:\",\n\t\t\"....:\",\n\t\t\"...::\",\n\t\t\"..::.\",\n\t\t\".::..\",\n\t\t\"::...\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nexport const consts = {\n\tanim: 300,\n}\n\n", "\nimport {tracker} from \"@e280/strata\"\nimport {got, nap} from \"@e280/stz\"\nimport {consts} from \"../consts.js\"\n\nexport class Shell {\n\t#dialog?: HTMLDialogElement\n\t#closeToken = 0\n\n\tget dialog() {\n\t\ttracker.read(this)\n\t\treturn this.#dialog\n\t}\n\n\tget open() {\n\t\tconst dialog = this.dialog\n\t\treturn !!dialog?.open && !dialog.hasAttribute(\"data-closing\")\n\t}\n\n\tattach(dialog: HTMLDialogElement) {\n\t\tthis.#dialog = dialog\n\t\tdialog.onclose = () => tracker.write(this)\n\t\tdialog.oncancel = event => {\n\t\t\tevent.preventDefault()\n\t\t\tthis.toggle(false)\n\t\t}\n\t}\n\n\ttoggle = (please = !this.open) => {\n\t\tconst dialog = got(this.dialog)\n\n\t\tif (please)\n\t\t\tthis.#open(dialog)\n\t\telse\n\t\t\tthis.#close(dialog)\n\n\t\ttracker.write(this)\n\t}\n\n\t#open(dialog: HTMLDialogElement) {\n\t\tthis.#closeToken++\n\t\tdialog.removeAttribute(\"data-closing\")\n\n\t\tif (!dialog.open)\n\t\t\tdialog.showModal()\n\t}\n\n\t#close(dialog: HTMLDialogElement) {\n\t\tif (!dialog.open)\n\t\t\treturn\n\n\t\tconst token = ++this.#closeToken\n\t\tdialog.setAttribute(\"data-closing\", \"\")\n\n\t\tnap(consts.anim).then(() => {\n\t\t\tif (token !== this.#closeToken)\n\t\t\t\treturn\n\n\t\t\tif (dialog.hasAttribute(\"data-closing\"))\n\t\t\t\tdialog.close()\n\n\t\t\tdialog.removeAttribute(\"data-closing\")\n\t\t\ttracker.write(this)\n\t\t})\n\t}\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport {consts} from \"../../consts.js\"\nexport default css`\n\n--benev-font-size: 18px;\n--benev-site-width: 62em;\n--benev-copy-width: 70ch;\n--benev-headroom: 2.5em;\n\n--benev-bg: #111;\n--benev-prime: #ebb935;\n--benev-tray: #453e2ca8;\n--benev-text: color-mix(in oklch, var(--benev-prime), #fffc 90%);\n--benev-intense: white;\n--benev-focus: 2px solid cyan;\n--benev-link: aqua;\n--benev-b-size: 1.5em;\n--benev-code: #0f0;\n\n--benev-select-bg: #f60;\n--benev-select-color: #ff8;\n\n--benev-line: #ebb93588;\n--benev-thin: 1px;\n--benev-thick: 3px;\n--benev-border: var(--benev-thin) solid color-mix(in oklch, transparent, var(--benev-line) 50%);\n\n--benev-pad: 0.5em;\n--benev-space: 1em;\n--benev-anim: ${consts.anim}ms;\n--benev-round: 0.5em;\n--benev-blur: blur(1em);\n--benev-backdrop: #0008;\n\n--benev-box-shadow: 0 0.5em 2em #0008;\n--benev-text-shadow: 0.04em 0.08em 0.1em #0008;\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\n&, *, ::before, ::after {\n\tmargin: 0;\n\tpadding: 0;\n\tbox-sizing: border-box;\n\tscrollbar-width: thin;\n}\n\n:focus-visible {\n\toutline: var(--benev-focus);\n\toutline-offset: 0.2em;\n}\n\n::selection {\n\tcolor: var(--benev-select-color);\n\tbackground: var(--benev-select-bg);\n}\n\na {\n\tcolor: var(--benev-link);\n\ttext-decoration: none;\n\n\t&:visited {\n\t\tcolor: var(--benev-link);\n\t}\n\n\t&:hover, &:focus-visible {\n\t\tcolor: color-mix(in srgb, var(--benev-link), white 15%);\n\t\ttext-decoration: underline;\n\t}\n\n\t&:active {\n\t\tcolor: color-mix(in srgb, var(--benev-link), white 50%);\n\t}\n\n\t&[benev-cardlink] {\n\t\tcolor: inherit;\n\n\t\t&:hover, &:focus-visible {\n\t\t\tcolor: inherit;\n\t\t\ttext-decoration: none;\n\t\t\tfilter: brightness(105%);\n\t\t}\n\n\t\t&:active {\n\t\t\tcolor: inherit;\n\t\t\tfilter: brightness(95%);\n\t\t}\n\t}\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\ncolor-scheme: dark;\n\n&:is(html) {\n\tfont-family: sans-serif;\n\tfont-size: var(--benev-font-size);\n\n\tscrollbar-gutter: stable;\n\tscrollbar-width: thin;\n\n\tcolor: var(--benev-text);\n\tbackground: var(--benev-bg);\n\ttext-shadow: var(--benev-text-shadow);\n}\n\nbody {\n\tmin-height: 100dvh;\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\nbutton, [benev-button] {\n\tfont: inherit;\n\ttext-decoration: none;\n\n\tdisplay: inline-flex;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tpadding: var(--benev-pad) var(--benev-space);\n\n\tfont-weight: bold;\n\ttext-transform: uppercase;\n\tcolor: var(--benev-prime);\n\tbackground: oklch(from var(--benev-bg) l c h / 50%);\n\tbackdrop-filter: var(--benev-blur);\n\tbox-shadow: var(--benev-box-shadow);\n\tborder: var(--benev-thick) solid currentColor;\n\tborder-radius: var(--benev-round);\n\n\t&[disabled] {\n\t\topacity: 0.3;\n\t}\n\n\t&:not([disabled]) {\n\t\tcursor: pointer;\n\t\ttransform: scale(100%);\n\t\ttransition: all var(--benev-anim) ease;\n\t\t&:hover, &:focus-visible { transform: scale(105%); filter: brightness(120%); }\n\t\t&:active { transform: scale(100%); filter: brightness(100%); }\n\t}\n\n\t&[benev-button=\"naked\"] {\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t\tbackdrop-filter: none;\n\t\tbox-shadow: none;\n\t\tpadding: 0;\n\t\tborder-radius: 0;\n\t\tborder: none;\n\t\ttext-transform: unset;\n\t\tfont-weight: inherit;\n\t\ttext-transform: inherit;\n\t}\n\n\t&[benev-button=\"juicy\"] {\n\t\topacity: 1;\n\t\tcolor: black;\n\t\tborder: var(--benev-thick) solid var(--benev-prime);\n\t\tbackground: linear-gradient(\n\t\t\tto bottom,\n\t\t\toklch(from var(--benev-prime) calc(l * 1.5) c h),\n\t\t\toklch(from var(--benev-prime) l calc(c * 1.5) h)\n\t\t);\n\t\t&:is(:hover, :focus-visible) {\n\t\t\tbox-shadow: 0 0 2em color-mix(in oklch, transparent, var(--benev-prime));\n\t\t}\n\t}\n}\n\n[benev-slice] {\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\nbenev-menu:not(:defined) {\n\tdisplay: none;\n}\n\nbenev-header {\n\tdisplay: flex;\n\tjustify-content: end;\n\talign-items: center;\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin: 0 auto;\n\n\t&:not(:defined) {\n\t\tpadding: var(--benev-pad);\n\t\tgap: var(--benev-space);\n\n\t\t&::before {\n\t\t\tcontent: \"\";\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-right: auto;\n\t\t\twidth: var(--benev-b-size);\n\t\t\theight: var(--benev-b-size);\n\t\t}\n\t}\n}\n\n[benev-prose] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--benev-pad);\n\n\th1 {\n\t\tfont-size: 2.5em;\n\t\tcolor: var(--benev-intense);\n\t\ta { color: inherit; }\n\t}\n\n\th2 {\n\t\tfont-size: 1.5em;\n\t\tcolor: var(--benev-prime);\n\t}\n\n\th3, h4, h5, h6 {\n\t\tcolor: var(--benev-prime);\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tmargin-top: var(--benev-space);\n\t}\n\n\tp {\n\t\tmax-width: var(--benev-copy-width);\n\t}\n\n\tp:has(> img) {\n\t\tmax-width: 100%;\n\t}\n\n\tul, ol {\n\t\tpadding-left: 1.5em;\n\t}\n\n\timg {\n\t\tmax-width: 100%;\n\t\tbackground: #0004;\n\t\tborder-radius: var(--benev-round);\n\t\tbox-shadow: var(--benev-box-shadow);\n\t}\n\n\tblockquote {\n\t\tcolor: oklch(from currentColor l 0 h / 50%);\n\t\tpadding-left: var(--benev-pad);\n\t\tmargin-left: var(--benev-pad);\n\t\tfont-style: italic;\n\t\tborder-left: var(--benev-thick) solid currentColor;\n\t}\n\n\thr {\n\t\tborder: none;\n\t\tdisplay: block;\n\t\theight: var(--benev-thick);\n\t\tbackground: oklch(from var(--benev-text) l c h / 25%);\n\t\tmargin: var(--benev-space) 0;\n\t}\n\n\tcode {\n\t\tfont-size: 0.8em;\n\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\toverflow: auto;\n\n\t\tpadding: var(--benev-space);\n\t\tcolor: var(--benev-code);\n\t\tbackground: var(--benev-backdrop);\n\t\tborder-radius: var(--benev-round);\n\t\tborder: var(--benev-border);\n\t\tborder-color: oklch(from var(--benev-code) l c h / 33%);\n\t\tbox-shadow: var(--benev-box-shadow);\n\t}\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport varsCsstext from \"./parts/vars.csstext.js\"\nimport coreCsstext from \"./parts/core.csstext.js\"\nimport pageCsstext from \"./parts/page.csstext.js\"\nimport commonCsstext from \"./parts/common.csstext.js\"\n\nexport const benevCssText = css`\n\n@layer\n\tbenev.vars,\n\tbenev.core,\n\tbenev.common,\n\tbenev.page;\n\n@layer benev.vars {\n\t[benev], :host {\n\t\t${varsCsstext}\n\t}\n}\n\n@layer benev.core {\n\t[benev], :host {\n\t\t${coreCsstext}\n\t}\n}\n\n@layer benev.common {\n\t[benev], :host {\n\t\t${commonCsstext}\n\t}\n}\n\n@layer benev.page {\n\t[benev], :host {\n\t\t${pageCsstext}\n\t}\n}\n\n`\n\n", "\nimport {benevCssText} from \"./benev.csstext.js\"\n\nexport const themeCss = [benevCssText].map(text => {\n\tconst sheet = new CSSStyleSheet()\n\tsheet.replaceSync(text)\n\treturn sheet\n})\n\n", "\nexport const bDataPng = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjAAAAIwBAMAAABq30xcAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAB5QTFRFAAAA7s5d7spM7cQ59dly9t6D/u2W+OGT9+CN////QXakHAAAAAp0Uk5TAP77/d2oDDJqAeHntT4AACB8SURBVHic7V1de9vGlUb7xKB4txzQbXoXAnbrXhJQtrmUZGrjvYtlKlbvkNailDs7sT56Jzt2pN4xfVq3+beLAT8EUpzBewYzwIE377ObOLsmiHk5c+Z8H8/jgJ8nk1T+z9Tzpk2/S9OYTC4ubm4OD0cSu71erz8a9fL/ODw8vLm+uDifpE2/Yy2YTOd74cPJzeF4tCvCKCkiXPvvOAzDjKiMo/PJpNlXd4/JxfvxqBcVVq5AKLEgKh70RvtHF+dNv70b+Cfvx7vRghEVIRso6s0Jigej0dH5x7V3JCn5PonDAU7JCkQY5uxke+f645A9GSkjIUkh7BLN/pnRm22dptdVDVZJWSFn0D+6/rbp5Zkh2yq7cg1WSVlA0h33s1PV9Cqp8C/GIpZXsKlMASCFTjh6/rem14qhm/2vf/pOilrK3WMGKZHjQV/um67cO3yVZvlmJ++Fbamig9w3g/0f06aXXgL/dBzS9BQ73IT9o5ce3y3jn2UqXOxQrCgRyW1znTZNwGb8+312V8QNsJJDyGvqedo0CXdxMs5erYnNcovsSA2eMNP8TsZR1MgZWoWI4vgJI73vQ/O7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Mnih3zelBQggLzMBuw/yHvl/m1CRx/3py94F+RgtVvPTYbZhMvpjxMqcmHB2dp4XHTU7eZdcWebtkh5OZD/w4MuZFIkySJO6N9g9vJN6PRxlZJrT0BLPx1q8jk1WscpNRUUBo9sCEk4Mq9d8mlfbLEiKcw/QBASuz2j8wkJFOIBJOLnC6auoM0adNk1EAI16CISPJexyx4aWXMOrs9rraNW0V0aOm2VjCH1u6jmwg4nMjdXb5HKNeELO5kTqPGfHSS75smo85fP8tn2OU8fKwaUKW6NBCPW7BSMAQmhe6R8TJ/403L3SOCI841ABCCZ5jRPHXxEi4U+CNBBwjiLlcSDPAA44cI8ou6gpzs+2DULTpEhGz/ULpbuMS/HjB2106hEj48UJo++OQl208Z6IuUOqfHSFKSFk2NaFxxVdEyf20aRY2AJ437YqXTLww0upuAU8PdoNIpmT5GyK7jaNRiyBKYm2WRJNokBiRUDL46galeMgqwiQZPE9LMrEaw5RUhmeXlvgJw0t6ien3lcP4BpA5EKxpyfCsdmJkPkT/iONFtILHIgxFbeQIyUrcv049z7S3VV14HC9yNmQyyxp6AzEYhKEd+zuUpIRh/+g8Y6X7bdr0yktw9v5wPMohZuzkWM3+KSAu0AaP5xDhPJ0o3L/+tukFG+DDJMPF5GKGy8ubOd4fHkriloRkatkKV0u2Br0iWfO/uyC0t3993vQKXSFnbnKS05bzdbjYabodlv2Vw6OLSdr021vHVK+CTT7Mybq8yZian0v5p8Ob6+uL80nx+uEucH9BrZj4sx2Ryn/ku4zfBvk/inIx2z+WCl8AAAAASUVORK5CYII=`\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n:host {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.veil {\n\tposition: absolute;\n\tinset: 0;\n\tbackground: var(--benev-bg);\n\tpointer-events: none;\n\n\topacity: 1;\n\tvisibility: visible;\n\n\ttransition:\n\t\topacity var(--benev-anim) linear,\n\t\tvisiblity 0ms linear allow-discrete;\n}\n\n:host(:not([loading])) .veil {\n\topacity: 0;\n\tvisiblity: hidden;\n}\n\n.veil {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tgap: var(--benev-space);\n\n\t> img {\n\t\twidth: 100%;\n\t\tmax-width: 10em;\n\t\taspect-ratio: 1 / 1;\n\t}\n}\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {shadowElement, useCss} from \"@e280/sly\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {bDataPng} from \"../../assets/b.png.js\"\nimport styleCss from \"./style.css.js\"\n\nexport const BenevLoader = shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\n\treturn html`\n\t\t<slot></slot>\n\n\t\t<div class=veil>\n\t\t\t<img src=\"${bDataPng}\" alt=\"\" draggable=\"false\"/>\n\t\t\t<slot name=loading></slot>\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\ndialog {\n\tborder: 0;\n\tpadding: 0;\n\tbackground: transparent;\n\toverflow: visible;\n\tmax-height: unset;\n\tfont: inherit;\n\tcolor: inherit;\n\n\tposition: fixed;\n\tinset: 0 0 auto 0;\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin: auto;\n\n\ttransition: all var(--benev-anim) ease allow-discrete;\n\topacity: 0;\n\ttransform: translateY(-100%);\n}\n\ndialog > section:focus {\n\toutline: none;\n}\n\ndialog > section {\n\t--theight: min(20em, calc(100dvh - var(--benev-headroom)));\n\twidth: 100%;\n\theight: var(--theight);\n\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\n\tbackground: linear-gradient(\n\t\tto bottom right,\n\t\tvar(--benev-tray),\n\t\toklch(from var(--benev-tray) calc(l * 0.6) calc(c * 1.2) h / alpha)\n\t);\n\tbox-shadow: var(--benev-box-shadow);\n\tbox-shadow: 0 0 4em oklch(from var(--benev-tray) l c h / 60%);\n\tborder-radius: 0 0 var(--benev-round) var(--benev-round);\n\tborder: var(--benev-thick) solid oklch(from var(--benev-tray) calc(l * 1.2) calc(c * 1.2) h / alpha);\n\tborder-top: 0;\n}\n\ndialog[open] {\n\topacity: 1;\n\ttransform: translateY(0);\n}\n\ndialog[open][data-closing] {\n\topacity: 0;\n\ttransform: translateY(-100%);\n}\n\ndialog::backdrop {\n\tbackground: rgb(0 0 0 / 0%);\n\tbackdrop-filter: blur(0);\n\ttransition: all var(--benev-anim) ease allow-discrete;\n}\n\ndialog[open]::backdrop {\n\tbackground: var(--benev-backdrop);\n\tbackdrop-filter: var(--benev-blur);\n}\n\ndialog[open][data-closing]::backdrop {\n\tbackground: rgb(0 0 0 / 0%);\n\tbackdrop-filter: blur(0);\n}\n\n@starting-style {\n\tdialog[open] {\n\t\topacity: 0;\n\t\ttransform: translateY(-100%);\n\t}\n\n\tdialog[open]::backdrop {\n\t\tbackground: rgb(0 0 0 / 0%);\n\t\tbackdrop-filter: blur(0);\n\t}\n}\n\n}`\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n:host {\n\twidth: 100%;\n\tpointer-events: none;\n}\n\nnav > *, ::slotted(*) {\n\tpointer-events: all;\n}\n\nnav {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: end;\n\talign-items: center;\n\tgap: var(--benev-space);\n\tpadding: var(--benev-pad);\n}\n\nbutton {\n\tdisplay: block;\n\tmargin-right: auto;\n\n\timg {\n\t\tdisplay: block;\n\t\twidth: var(--benev-b-size);\n\t\theight: var(--benev-b-size);\n\t}\n}\n\nslot {\n\tdisplay: contents;\n}\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {shadow, shadowElement, useCss, useName} from \"@e280/sly\"\nimport {Shell} from \"../../vitals/shell.js\"\nimport {bDataPng} from \"../../assets/b.png.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport styleCss from \"./style.css.js\"\n\nconst Header = (shell: Shell) => {\n\tconst click = () => shell.toggle()\n\treturn html`\n\t\t<nav part=nav ?data-opened=${shell.open} ?data-closed=${!shell.open}>\n\t\t\t<button benev-button=naked title=\"b menu\" @click=${click}>\n\t\t\t\t<img part=img src=\"${bDataPng}\" alt=\"\"/>\n\t\t\t</button>\n\t\t\t<slot></slot>\n\t\t</nav>\n\t`\n}\n\nexport const HeaderView = shadow((shell: Shell) => {\n\tuseName(\"header\")\n\tuseCss(themeCss, styleCss)\n\treturn Header(shell)\n})\n\nexport const headerElement = (shell: Shell) => shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\treturn Header(shell)\n})\n\n", "\nimport {ev} from \"@e280/stz\"\n\nexport function onKeypress(keys: string[], fn: () => void) {\n\treturn () => ev(window, {\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tconst target = event.target as HTMLElement\n\t\t\tconst typing = (\n\t\t\t\ttarget instanceof HTMLInputElement ||\n\t\t\t\ttarget instanceof HTMLTextAreaElement ||\n\t\t\t\ttarget.isContentEditable\n\t\t\t)\n\t\t\tif (typing)\n\t\t\t\treturn\n\t\t\tif (keys.includes(event.code)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tfn()\n\t\t\t}\n\t\t},\n\t})\n}\n\n", "\nexport function clickBackdrop(fn: (event: Event) => void) {\n\treturn (event: Event) => {\n\t\tif (event.target === event.currentTarget)\n\t\t\tfn(event)\n\t}\n}\n\n", "\nimport {useRendered, useShadow, useWake} from \"@e280/sly\"\n\nexport function useAfterFirstRender(fn: (shadow: ShadowRoot) => void) {\n\tconst shadow = useShadow()\n\tconst rendered = useRendered()\n\tuseWake(() => rendered.then(() => fn(shadow)))\n}\n\n", "\nimport {html} from \"lit\"\nimport {dom, shadowElement, useCss, useMount} from \"@e280/sly\"\nimport styleCss from \"./style.css.js\"\nimport {Shell} from \"../../vitals/shell.js\"\nimport {HeaderView} from \"../header/view.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {onKeypress} from \"./utils/on-keypress.js\"\nimport {clickBackdrop} from \"./utils/click-backdrop.js\"\nimport {useAfterFirstRender} from \"./utils/use-after-first-render.js\"\n\nexport const menuComponent = (shell: Shell) => shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\tuseAfterFirstRender(shadow => shell.attach(dom(\"dialog\", shadow)))\n\tuseMount(onKeypress([\"KeyB\", \"Escape\"], () => shell.toggle()))\n\n\tconst click = clickBackdrop(() => shell.toggle(false))\n\tconst renderMenuContent = () => html`<slot></slot>`\n\n\treturn html`\n\t\t<dialog @click=${click}>\n\t\t\t<section class=plate autofocus tabindex=\"-1\">\n\t\t\t\t${shell.dialog?.open\n\t\t\t\t\t? renderMenuContent()\n\t\t\t\t\t: null}\n\t\t\t</section>\n\n\t\t\t${HeaderView(shell)}\n\t\t</dialog>\n\t`\n})\n\n", "\nimport {Shell} from \"./shell.js\"\nimport {BenevLoader} from \"../dom/loader/view.js\"\nimport {menuComponent} from \"../dom/menu/view.js\"\nimport {headerElement} from \"../dom/header/view.js\"\n\nexport async function setupBenev() {\n\tconst shell = new Shell()\n\n\tconst elements = {\n\t\tBenevHeader: headerElement(shell),\n\t\tBenevMenu: menuComponent(shell),\n\t\tBenevLoader: BenevLoader,\n\t}\n\n\treturn {\n\t\tshell,\n\t\telements,\n\t}\n}\n\n", "\nimport {nap} from \"@e280/stz\"\nimport {Content, dom} from \"@e280/sly\"\nimport {consts} from \"../../consts.js\"\n\nexport class Loader {\n\toriginal\n\n\t#loading\n\t#content\n\t#operation = 0\n\n\tconstructor(\n\t\t\tpublic element: HTMLElement,\n\t\t\tpublic anim = consts.anim,\n\t\t) {\n\n\t\tthis.original = document.createElement(\"template\")\n\t\tthis.original.innerHTML = element.innerHTML\n\n\t\tthis.#loading = document.createElement(\"div\")\n\t\tthis.#loading.style.display = \"contents\"\n\t\tthis.#loading.slot = \"loading\"\n\n\t\tthis.#content = document.createElement(\"div\")\n\t\tthis.#content.style.display = \"contents\"\n\t\tdom.render(this.#content, Array.from(element.childNodes))\n\n\t\tthis.element.replaceChildren()\n\t\tthis.element.append(\n\t\t\tthis.#loading,\n\t\t\tthis.#content,\n\t\t)\n\t}\n\n\tasync load(\n\t\t\tgetLoading: () => Content,\n\t\t\tgetContent: () => Promise<Content>,\n\t\t) {\n\n\t\tthis.#operation += 1\n\t\tconst operation = this.#operation\n\t\tconst isLatest = () => (this.#operation === operation)\n\t\tthis.element.inert = true\n\t\tthis.element.toggleAttribute(\"loading\", true)\n\t\tdom.render(this.#loading, getLoading())\n\n\t\ttry {\n\t\t\tconst [content] = await Promise.all([\n\t\t\t\tgetContent(),\n\t\t\t\tnap(this.anim * 2),\n\t\t\t])\n\n\t\t\tif (isLatest()) {\n\t\t\t\tthis.element.toggleAttribute(\"loading\", false)\n\t\t\t\tthis.element.inert = false\n\t\t\t\tdom.render(this.#content, content)\n\t\t\t\tawait nap(this.anim)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\tif (isLatest()) {\n\t\t\t\tthis.element.toggleAttribute(\"loading\", false)\n\t\t\t\tthis.element.inert = false\n\t\t\t\tdom.render(this.#loading, null)\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "\nimport {html} from \"lit\"\nimport {dom} from \"@e280/sly\"\nimport {nap} from \"@e280/stz\"\nimport {setupBenev} from \"./vitals/setup.js\"\nimport {Loader} from \"./dom/loader/loader.js\"\n\nconst {elements} = await setupBenev()\ndom.register(elements)\n\nconst loader = new Loader(dom(\"benev-loader\"))\n\ndom(\".testloader\").onclick = async() => {\n\tawait loader.load(\n\t\t() => \"loading...\",\n\t\tasync() => nap(1000).then(() => html`<main benev-slice>new content</main>`),\n\t)\n}\n\n"],
|
|
5
|
-
"mappings": "6FAMA,IAGMA,GAASC,WAKFC,GACXF,GAAOG,aACNH,GAAOI,WADDD,QAC2BH,GAAOI,SAASC,eAClD,uBAAwBC,SAASC,WACjC,YAAaC,cAAcD,UAkBvBE,GAAoBC,OAAAA,EAEpBC,GAAc,IAAIC,QASXC,GATWD,KASXC,CAOX,YACEC,EACAC,EACAC,EAAAA,CAEA,GAVFC,KAAe,aAAA,GAUTD,I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B,UAAW,EAAK,EAC7C,KAAK,QAAQ,MAAQ,GACrBJ,EAAI,OAAO,KAAKL,GAAUU,CAAO,EACjC,MAAMC,EAAI,KAAK,IAAI,EAErB,SAEKF,EAAQ,IACX,KAAK,QAAQ,gBAAgB,UAAW,EAAK,EAC7C,KAAK,QAAQ,MAAQ,GACrBJ,EAAI,OAAO,KAAKN,GAAU,IAAI,EAEhC,CACD,GC5DD,GAAM,CAAC,SAAAa,EAAQ,EAAI,MAAMC,GAAU,EACnCC,EAAI,SAASF,EAAQ,EAErB,IAAMG,GAAS,IAAIC,GAAOF,EAAI,cAAc,CAAC,EAE7CA,EAAI,aAAa,EAAE,QAAU,SAAU,CACtC,MAAMC,GAAO,KACZ,IAAM,aACN,SAAWE,EAAI,GAAI,EAAE,KAAK,IAAMC,uCAA0C,CAAC,CAE7E",
|
|
6
|
-
"names": ["global", "globalThis", "supportsAdoptingStyleSheets", "ShadowRoot", "ShadyCSS", "nativeShadow", "Document", "prototype", "CSSStyleSheet", "constructionToken", "Symbol", "cssTagCache", "WeakMap", "CSSResult", "cssText", "strings", "safeToken", "this", "Error", "_strings", "styleSheet", "_styleSheet", "cacheable", "length", "get", "replaceSync", "set", "toString", "unsafeCSS", "value", "String", "css", "values", "reduce", "acc", "v", "idx", "adoptStyles", "renderRoot", "styles", "adoptedStyleSheets", "map", "s", "style", "document", "createElement", "nonce", "setAttribute", "textContent", "appendChild", "getCompatibleStyle", "sheet", "rule", "cssRules", "is", "defineProperty", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "Object", "global", "globalThis", "trustedTypes", "emptyStringForBooleanAttribute", "emptyScript", "polyfillSupport", "reactiveElementPolyfillSupport", "JSCompiler_renameProperty", "prop", "_obj", "defaultConverter", "value", "type", "Boolean", "Array", "JSON", "stringify", "fromValue", "Number", "parse", "e", "notEqual", "old", "defaultPropertyDeclaration", "attribute", "String", "converter", "reflect", "useDefault", "hasChanged", "Symbol", "metadata", "litPropertyMetadata", "WeakMap", "ReactiveElement", "HTMLElement", "initializer", "this", "__prepare", "_initializers", "push", "observedAttributes", "finalize", "__attributeToPropertyMap", "keys", "name", "options", "state", "prototype", "hasOwnProperty", "create", "wrapped", "elementProperties", "set", "noAccessor", "key", "descriptor", "getPropertyDescriptor", "get", "v", "oldValue", "call", "requestUpdate", "configurable", "enumerable", "superCtor", "Map", "finalized", "props", "properties", "propKeys", "p", "createProperty", "attr", "__attributeNameForProperty", "elementStyles", "finalizeStyles", "styles", "isArray", "Set", "flat", "Infinity", "reverse", "s", "unshift", "getCompatibleStyle", "toLowerCase", "constructor", "super", "__instanceProperties", "isUpdatePending", "hasUpdated", "__reflectingProperty", "__initialize", "__updatePromise", "Promise", "res", "enableUpdating", "_$changedProperties", "__saveInstanceProperties", "forEach", "i", "controller", "__controllers", "add", "renderRoot", "isConnected", "hostConnected", "delete", "instanceProperties", "size", "createRenderRoot", "shadowRoot", "attachShadow", "shadowRootOptions", "adoptStyles", "connectedCallback", "c", "_requestedUpdate", "disconnectedCallback", "hostDisconnected", "_old", "_$attributeToProperty", "attrValue", "toAttribute", "removeAttribute", "setAttribute", "ctor", "propName", "getPropertyOptions", "fromAttribute", "convertedValue", "__defaultValues", "useNewValue", "newValue", "hasAttribute", "_$changeProperty", "__enqueueUpdate", "initializeValue", "has", "__reflectingProperties", "reject", "result", "scheduleUpdate", "performUpdate", "shouldUpdate", "changedProperties", "willUpdate", "hostUpdate", "update", "__markUpdated", "_$didUpdate", "_changedProperties", "hostUpdated", "firstUpdated", "updated", "updateComplete", "getUpdateComplete", "__propertyToAttribute", "mode", "reactiveElementVersions", "global", "globalThis", "wrap", "node", "trustedTypes", "policy", "createPolicy", "createHTML", "s", "boundAttributeSuffix", "marker", "Math", "random", "toFixed", "slice", "markerMatch", "nodeMarker", "d", "document", "createMarker", "createComment", "isPrimitive", "value", "isArray", "Array", "isIterable", "Symbol", "iterator", "SPACE_CHAR", "textEndRegex", "commentEndRegex", "comment2EndRegex", "tagEndRegex", "RegExp", "singleQuoteAttrEndRegex", "doubleQuoteAttrEndRegex", "rawTextElement", "tag", "type", "strings", "values", "_$litType$", "html", "svg", "mathml", "noChange", "for", "nothing", "templateCache", "WeakMap", "walker", "createTreeWalker", "trustFromTemplateString", "tsa", "stringFromTSA", "hasOwnProperty", "Error", "getTemplateHtml", "l", "length", "attrNames", "rawTextEndRegex", "regex", "i", "attrName", "match", "attrNameEndIndex", "lastIndex", "exec", "test", "end", "startsWith", "push", "Template", "constructor", "options", "this", "parts", "nodeIndex", "attrNameIndex", "partCount", "el", "createElement", "currentNode", "content", "wrapper", "firstChild", "replaceWith", "childNodes", "nextNode", "nodeType", "hasAttributes", "name", "getAttributeNames", "endsWith", "realName", "statics", "getAttribute", "split", "m", "index", "ctor", "PropertyPart", "BooleanAttributePart", "EventPart", "AttributePart", "removeAttribute", "tagName", "textContent", "emptyScript", "append", "data", "indexOf", "_options", "innerHTML", "resolveDirective", "part", "parent", "attributeIndex", "currentDirective", "__directives", "__directive", "nextDirectiveConstructor", "_$initialize", "_$resolve", "TemplateInstance", "template", "_$parts", "_$disconnectableChildren", "_$template", "_$parent", "parentNode", "_$isConnected", "fragment", "creationScope", "importNode", "partIndex", "templatePart", "ChildPart", "nextSibling", "ElementPart", "_$setValue", "__isConnected", "startNode", "endNode", "_$committedValue", "_$startNode", "_$endNode", "isConnected", "directiveParent", "_$clear", "_commitText", "_commitTemplateResult", "_commitNode", "_commitIterable", "insertBefore", "_insert", "createTextNode", "result", "_$getTemplate", "h", "_update", "instance", "_clone", "get", "set", "itemParts", "itemPart", "item", "start", "from", "_$notifyConnectionChanged", "n", "remove", "element", "fill", "String", "valueIndex", "noCommit", "change", "v", "_commitValue", "setAttribute", "toggleAttribute", "super", "newListener", "oldListener", "shouldRemoveListener", "capture", "once", "passive", "shouldAddListener", "removeEventListener", "addEventListener", "event", "call", "host", "handleEvent", "_$LH", "_boundAttributeSuffix", "_marker", "_markerMatch", "_HTML_RESULT", "_getTemplateHtml", "_TemplateInstance", "_isIterable", "_resolveDirective", "_ChildPart", "_AttributePart", "_BooleanAttributePart", "_EventPart", "_PropertyPart", "_ElementPart", "polyfillSupport", "litHtmlPolyfillSupport", "litHtmlVersions", "render", "container", "partOwnerNode", "renderBefore", "global", "globalThis", "LitElement", "ReactiveElement", "constructor", "this", "renderOptions", "host", "__childPart", "createRenderRoot", "renderRoot", "super", "renderBefore", "firstChild", "changedProperties", "value", "render", "hasUpdated", "isConnected", "update", "connectedCallback", "setConnected", "disconnectedCallback", "noChange", "litElementHydrateSupport", "polyfillSupport", "litElementPolyfillSupport", "global", "litElementVersions", "push", "attrGet", "e", "key", "raw", "attrSet", "value", "element", "entries", "record", "el", "tagName", "attrs", "element", "attrSet", "mk", "template", "fragment", "D", "eve", "target", "events", "detachers", "eventName", "handler", "options", "fn", "d", "onAttrs", "element", "fn", "observer", "AttrProxies", "element", "_t", "key", "attrGet", "value", "attrSet", "attrSpec", "e", "spec", "options", "_target", "key", "attrGet", "value", "attrSet", "attrs", "element", "proxies", "AttrProxies", "fn", "onAttrs", "spec", "options", "attrSpec", "attrGet", "attrSet", "elmer", "tagName", "Elmer", "#attrs", "#children", "key", "value", "record", "elements", "element", "attrSet", "queryRequire", "selector", "container", "e", "queryMaybe", "queryAll", "Dom", "_Dom", "#attrs", "element", "selectorOrElement", "queryRequire", "selector", "queryMaybe", "queryAll", "content", "D", "attrs", "spec", "eve", "dashify", "camel", "register", "elements", "options", "soft", "upgrade", "name", "Element", "tag", "dashify", "already", "element", "dom", "selector", "container", "queryRequire", "selectorOrElement", "Dom", "queryMaybe", "queryAll", "el", "elmer", "mk", "eve", "attrs", "register", "content", "D", "defer", "resolve", "reject", "promise", "res", "rej", "entangle", "outside", "microbounce", "fn", "scheduled", "params", "defer", "deferred", "index_barrel_exports", "__export", "clone", "equal", "freeze", "clone", "data", "refs", "copy", "d", "key", "val", "happy", "x", "sad", "is", "equal", "alpha", "bravo", "recurse", "parents", "is", "newParents", "key", "val", "item", "bItem", "keys1", "keys2", "freeze", "item", "recurse", "x", "parents", "is", "newParents", "arr", "y", "gotOk", "result", "error", "gotErr", "got", "thing", "err", "guarantee", "map", "key", "make", "value", "cycle", "fn", "timeout", "stopped", "stop", "tick", "ev", "target", "fns", "entries", "name", "fn", "nap", "milliseconds", "resolve", "templateString", "strings", "values", "lastIndex", "a", "b", "c", "Tracker", "#busy", "#observationLayers", "#subscriptions", "#batchDepth", "#batchPending", "item", "fns", "fn", "#flush", "seen", "value", "guarantee", "#run", "pending", "tracker", "Tracker", "signal", "value", "sig", "tracker", "batch", "tracker", "immute", "s", "index_barrel_exports", "_optic", "CacheCell", "#dirty", "#value", "calculate", "Lens", "_Lens", "_optic", "#previous", "#stateCache", "#frozenCache", "optic", "index_barrel_exports", "CacheCell", "immute", "state", "tracker", "fn", "selector", "lens", "waitGot", "wait", "gotOk", "waitGotErr", "wait", "gotErr", "isWaitPending", "wait", "isWaitOk", "wait", "waitSelect", "wait", "select", "pending", "ok", "err", "isWaitPending", "isWaitOk", "waitGot", "waitGotErr", "cssReset", "i", "SlyShadow", "_SlyShadow", "dom", "LightCx", "defer", "render", "ShadowCx", "host", "shadow", "Hooks", "#scopes", "scope", "position", "fn", "hooks", "Reactivity", "#stoppers", "stop", "fn", "rerender", "seen", "value", "tracker", "item", "Mounts", "#mounters", "#unmounters", "mount", "unmount", "Hookscope", "Mounts", "cx", "_ChildPart", "ChildPart", "_$LH", "isSingleExpression", "part", "strings", "PartType", "ATTRIBUTE", "CHILD", "PROPERTY", "BOOLEAN_ATTRIBUTE", "EVENT", "ELEMENT", "directive", "c", "values", "_$litDirective$", "Directive", "_partInfo", "_$isConnected", "this", "_$parent", "part", "parent", "attributeIndex", "__part", "__attributeIndex", "props", "update", "_part", "render", "notifyChildrenConnectedChanged", "parent", "isConnected", "children", "_$disconnectableChildren", "obj", "removeDisconnectableFromParent", "_$parent", "delete", "size", "addDisconnectableToParent", "Set", "has", "add", "installDisconnectAPI", "reparentDisconnectables", "newParent", "this", "notifyChildPartConnectedChanged", "isClearingValue", "fromPartIndex", "value", "_$committedValue", "Array", "isArray", "i", "length", "type", "PartType", "CHILD", "_$notifyConnectionChanged", "_$reparentDisconnectables", "AsyncDirective", "Directive", "constructor", "part", "attributeIndex", "super", "_$initialize", "_$isConnected", "isClearingDirective", "reconnected", "disconnected", "isSingleExpression", "__part", "_$setValue", "newValues", "__attributeIndex", "shadowElement", "view", "#cx", "#hookscope", "#reactivity", "Reactivity", "#shadow", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "hooks", "useOnce", "fn", "scope", "position", "hooks", "guarantee", "useRef", "initial", "useOnce", "Ref", "current", "useCx", "hooks", "useShadowCx", "cx", "useCx", "ShadowCx", "useHost", "useShadowCx", "useMount", "fn", "scope", "hooks", "useOnce", "useRendered", "useCx", "useShadow", "useShadowCx", "applyStyles", "shadow", "styles", "S", "prepareStyles", "elementStyles", "set", "s", "c", "useCss", "styles", "shadow", "useShadow", "useOnce", "applyStyles", "useMounted", "fn", "ref", "useRef", "useMount", "value", "dispose", "useName", "name", "host", "useHost", "useOnce", "useSignal", "value", "useOnce", "signal", "useStyles", "useCss", "useWake", "fn", "useMounted", "applyAttrs", "element", "attrs", "name", "value", "applyAttr", "existing", "v", "coerce", "shadowSetup", "SlyShadow", "host", "shadow", "view", "rawShadow", "setup", "directiveFn", "e", "f", "#cx", "#hookscope", "#props", "#reactivity", "Reactivity", "part", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "props", "hooks", "children", "attrs", "applyAttrs", "shadowView", "makeAsciiAnim", "hz", "frames", "AsciiAnim", "shadow", "useName", "useStyles", "cssReset", "style", "$frame", "useSignal", "useMount", "cycle", "nap", "next", "i", "ErrorDisplay", "shadow", "error", "useName", "useStyles", "cssReset", "style", "b", "i", "makeSpinner", "pending", "err", "wait", "ok", "waitSelect", "dotsSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "earthSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "moonSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "spinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "waveSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "consts", "Shell", "#dialog", "#closeToken", "tracker", "dialog", "event", "please", "got", "#open", "#close", "token", "nap", "consts", "vars_csstext_default", "templateString", "consts", "core_csstext_default", "templateString", "page_csstext_default", "templateString", "common_csstext_default", "templateString", "benevCssText", "templateString", "vars_csstext_default", "core_csstext_default", "common_csstext_default", "page_csstext_default", "themeCss", "benevCssText", "text", "sheet", "bDataPng", "style_css_default", "i", "BenevLoader", "shadowElement", "useCss", "themeCss", "style_css_default", "b", "bDataPng", "style_css_default", "i", "style_css_default", "i", "Header", "shell", "click", "b", "bDataPng", "HeaderView", "shadow", "useName", "useCss", "themeCss", "style_css_default", "headerElement", "shadowElement", "onKeypress", "keys", "fn", "ev", "event", "target", "clickBackdrop", "fn", "event", "useAfterFirstRender", "fn", "shadow", "useShadow", "rendered", "useRendered", "useWake", "menuComponent", "shell", "shadowElement", "useCss", "themeCss", "style_css_default", "useAfterFirstRender", "shadow", "dom", "useMount", "onKeypress", "click", "clickBackdrop", "renderMenuContent", "b", "HeaderView", "setupBenev", "shell", "Shell", "elements", "headerElement", "menuComponent", "BenevLoader", "Loader", "#loading", "#content", "#operation", "element", "anim", "consts", "dom", "getLoading", "getContent", "operation", "isLatest", "content", "nap", "elements", "setupBenev", "dom", "loader", "Loader", "nap", "b"]
|
|
3
|
+
"sources": ["../node_modules/@lit/reactive-element/src/css-tag.ts", "../node_modules/@lit/reactive-element/src/reactive-element.ts", "../node_modules/lit-html/src/lit-html.ts", "../node_modules/lit-element/src/lit-element.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-fns.ts", "../node_modules/@e280/sly/s/dom/parts/el.ts", "../node_modules/@e280/sly/s/dom/parts/mk.ts", "../node_modules/@e280/sly/s/dom/parts/eve.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/on-attrs.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-proxies.ts", "../node_modules/@e280/sly/s/dom/attrs/parts/attr-spec.ts", "../node_modules/@e280/sly/s/dom/attrs/attrs.ts", "../node_modules/@e280/sly/s/dom/parts/elmer.ts", "../node_modules/@e280/sly/s/dom/parts/queries.ts", "../node_modules/@e280/sly/s/dom/parts/dom-scope.ts", "../node_modules/@e280/sly/s/dom/parts/dashify.ts", "../node_modules/@e280/sly/s/dom/parts/register.ts", "../node_modules/@e280/sly/s/dom/dom.ts", "../node_modules/@e280/stz/s/data/bytes.ts", "../node_modules/@e280/stz/s/data/base-x.ts", "../node_modules/@e280/stz/s/data/base-x-codecs.ts", "../node_modules/@e280/stz/s/data/txt.ts", "../node_modules/@e280/stz/s/debounce/debounce.ts", "../node_modules/@e280/stz/s/defer.ts", "../node_modules/@e280/stz/s/debounce/microbounce.ts", "../node_modules/@e280/stz/s/deep/index.barrel.ts", "../node_modules/@e280/stz/s/deep/clone.ts", "../node_modules/@e280/stz/s/is.ts", "../node_modules/@e280/stz/s/deep/equal.ts", "../node_modules/@e280/stz/s/deep/freeze.ts", "../node_modules/@e280/stz/s/ok/fns/ok.ts", "../node_modules/@e280/stz/s/ok/fns/err.ts", "../node_modules/@e280/stz/s/ok/fns/got.ts", "../node_modules/@e280/stz/s/dig/dig.ts", "../node_modules/@e280/stz/s/utensils/got.ts", "../node_modules/@e280/stz/s/utensils/map.ts", "../node_modules/@e280/stz/s/cycle.ts", "../node_modules/@e280/stz/s/disposer.ts", "../node_modules/@e280/stz/s/error-string.ts", "../node_modules/@e280/stz/s/ev.ts", "../node_modules/@e280/stz/s/nap.ts", "../node_modules/@e280/stz/s/pubsub.ts", "../node_modules/@e280/stz/s/templating.ts", "../node_modules/@e280/stz/s/time.ts", "../node_modules/@e280/strata/s/tracker/tracker.ts", "../node_modules/@e280/strata/s/tracker/global.ts", "../node_modules/@e280/strata/s/signals/signal.ts", "../node_modules/@e280/strata/s/signals/utils/watch.ts", "../node_modules/@e280/strata/s/signals/effect.ts", "../node_modules/@e280/strata/s/signals/helpers/after-effect.ts", "../node_modules/@e280/strata/s/signals/batch.ts", "../node_modules/@e280/strata/s/prism/utils/immute.ts", "../node_modules/@e280/strata/s/prism/utils/optic-symbol.ts", "../node_modules/@e280/strata/s/prism/utils/cache-cell.ts", "../node_modules/@e280/strata/s/prism/lens.ts", "../node_modules/@e280/strata/s/wait/parts/get.ts", "../node_modules/@e280/strata/s/wait/parts/is.ts", "../node_modules/@e280/strata/s/wait/parts/select.ts", "../node_modules/@e280/sly/s/view/common/css-reset.ts", "../node_modules/@e280/sly/s/view/common/sly-shadow.ts", "../node_modules/@e280/sly/s/view/parts/cx.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/hooks.ts", "../node_modules/@e280/sly/s/view/parts/reactivity.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/mounts.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/hookscope.ts", "../node_modules/lit-html/src/directive-helpers.ts", "../node_modules/lit-html/src/directive.ts", "../node_modules/lit-html/src/async-directive.ts", "../node_modules/@e280/sly/s/view/elements/shadow.ts", "../node_modules/@e280/sly/s/view/hooks/use-once.ts", "../node_modules/@e280/sly/s/view/hooks/use-ref.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/use-cx.ts", "../node_modules/@e280/sly/s/view/hooks/plumbing/use-shadow-cx.ts", "../node_modules/@e280/sly/s/view/hooks/use-host.ts", "../node_modules/@e280/sly/s/view/hooks/use-mount.ts", "../node_modules/@e280/sly/s/view/hooks/use-rendered.ts", "../node_modules/@e280/sly/s/view/hooks/use-shadow.ts", "../node_modules/@e280/sly/s/view/parts/apply-styles.ts", "../node_modules/@e280/sly/s/view/hooks/use-css.ts", "../node_modules/@e280/sly/s/view/hooks/use-mounted.ts", "../node_modules/@e280/sly/s/view/hooks/use-name.ts", "../node_modules/@e280/sly/s/view/hooks/use-signal.ts", "../node_modules/@e280/sly/s/view/hooks/use-styles.ts", "../node_modules/@e280/sly/s/view/hooks/use-wake.ts", "../node_modules/@e280/sly/s/view/parts/apply-attrs.ts", "../node_modules/@e280/sly/s/view/shadow.ts", "../node_modules/@e280/sly/s/spinner/parts/ascii-anim.ts", "../node_modules/@e280/sly/s/spinner/parts/error-display.ts", "../node_modules/@e280/sly/s/spinner/make-spinner.ts", "../node_modules/@e280/sly/s/spinner/spinners/dots.ts", "../node_modules/@e280/sly/s/spinner/spinners/earth.ts", "../node_modules/@e280/sly/s/spinner/spinners/moon.ts", "../node_modules/@e280/sly/s/spinner/spinners/spinner.ts", "../node_modules/@e280/sly/s/spinner/spinners/wave.ts", "../node_modules/@e280/authlocal/s/lib/core/errs/err.ts", "../node_modules/@e280/authlocal/s/lib/core/errs/token-err.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/decode-token.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/token-time.ts", "../node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js", "../node_modules/@noble/curves/node_modules/@noble/hashes/utils.js", "../node_modules/@noble/curves/node_modules/@noble/hashes/_md.js", "../node_modules/@noble/curves/node_modules/@noble/hashes/sha2.js", "../node_modules/@noble/curves/utils.js", "../node_modules/@noble/curves/abstract/modular.js", "../node_modules/@noble/curves/abstract/curve.js", "../node_modules/@noble/curves/abstract/edwards.js", "../node_modules/@noble/curves/ed25519.js", "../node_modules/@e280/authlocal/s/lib/core/cryp/key-bytes.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/verify-bytes.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/utils/assert-fresh.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/verify-token.ts", "../node_modules/@e280/authlocal/s/lib/core/alco/proof/verify.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/derive-id.ts", "../node_modules/@e280/authlocal/s/lib/core/alco/delegate/verify.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/token-header.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/sign-bytes.ts", "../node_modules/@e280/authlocal/s/lib/core/tok/sign-token.ts", "../node_modules/@e280/authlocal/s/lib/core/alco/claim/sign.ts", "../node_modules/@e280/authlocal/s/consts.ts", "../node_modules/@awasm/noble/utils.js", "../node_modules/@awasm/noble/hashes-abstract.js", "../node_modules/@awasm/noble/constants.js", "../node_modules/@awasm/noble/hashes.js", "../node_modules/@awasm/noble/targets/wasm/blake3.js", "../node_modules/@awasm/noble/ciphers-abstract.js", "../node_modules/@awasm/noble/ciphers.js", "../node_modules/@awasm/noble/targets/wasm/chacha_poly1305.js", "../node_modules/@awasm/noble/targets/wasm/index.js", "../node_modules/@e280/authlocal/s/lib/core/cryp/utils/cryption.ts", "../node_modules/@e280/authlocal/s/lib/core/errs/cryption-err.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/decrypt.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/encrypt.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/generate-secret.ts", "../node_modules/@e280/authlocal/s/lib/core/cryp/hash.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/phonemes/phonemes.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/phonemes/prefixes.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/phonemes/suffixes.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/phonemes/words.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/address/address.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/address/color.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/emojis/emojis.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/address/emoji.ts", "../node_modules/@e280/authlocal/s/lib/core/ergo/address/moniker.ts", "../node_modules/@e280/authlocal/s/lib/core/alco/proof/decode.ts", "../node_modules/@e280/authlocal/s/lib/protocol/parts/is-session-valid.ts", "../node_modules/@e280/authlocal/s/lib/protocol/user.ts", "../node_modules/@e280/authlocal/s/lib/protocol/parts/session-petitions.ts", "../node_modules/@e280/authlocal/s/lib/protocol/parts/open-popup.ts", "../node_modules/@e280/renraku/s/core/base/errors.ts", "../node_modules/@e280/renraku/s/core/base/endpoint.ts", "../node_modules/@e280/renraku/s/core/base/remote.ts", "../node_modules/@e280/renraku/s/core/messenger/types.ts", "../node_modules/@e280/renraku/s/core/messenger/messenger.ts", "../node_modules/@e280/renraku/s/core/portal/auto-transfer.ts", "../node_modules/@e280/renraku/s/core/portal/portal.ts", "../node_modules/@e280/renraku/s/web/ports/consts.ts", "../node_modules/@e280/renraku/s/web/ports/recv-ports.ts", "../node_modules/@e280/renraku/s/web/web-transferable.ts", "../node_modules/@e280/authlocal/s/lib/protocol/parts/ask-for-delegates.ts", "../node_modules/@e280/kv/s/utils/json-codec.ts", "../node_modules/@e280/kv/s/utils/lex-sort.ts", "../node_modules/@e280/kv/s/utils/scan-match.ts", "../node_modules/@e280/kv/s/utils/scan-entries.ts", "../node_modules/@e280/kv/s/magazines/memory.ts", "../node_modules/@e280/kv/s/magazines/storage.ts", "../node_modules/@e280/kv/s/utils/cell-operator.ts", "../node_modules/@e280/kv/s/cell.ts", "../node_modules/@e280/kv/s/consts.ts", "../node_modules/@e280/kv/s/utils/prefix-end.ts", "../node_modules/@e280/kv/s/subtree.ts", "../node_modules/@e280/kv/s/utils/operator.ts", "../node_modules/@e280/kv/s/utils/prefixer.ts", "../node_modules/@e280/kv/s/utils/validate-scan.ts", "../node_modules/@e280/kv/s/utils/validate-scopes.ts", "../node_modules/@e280/kv/s/kv.ts", "../node_modules/@e280/authlocal/s/lib/protocol/parts/default-auth-options.ts", "../node_modules/@e280/authlocal/s/lib/protocol/auth.ts", "../node_modules/@e280/shiny/s/theme/parts/core.ts", "../node_modules/@e280/shiny/s/theme/parts/vars.ts", "../node_modules/@e280/shiny/s/theme/parts/reset.ts", "../node_modules/@e280/shiny/s/theme/theme-string.ts", "../node_modules/@e280/shiny/s/theme/theme.css.ts", "../node_modules/@e280/shiny/s/views/copy/style.css.ts", "../node_modules/@e280/shiny/s/icons/tabler/clipboard.svg.ts", "../node_modules/@e280/shiny/s/icons/tabler/clipboard-x-filled.svg.ts", "../node_modules/@e280/shiny/s/icons/tabler/clipboard-check-filled.svg.ts", "../node_modules/@e280/shiny/s/views/copy/parts/determine-base-status.ts", "../node_modules/@e280/shiny/s/views/copy/parts/use-copier.ts", "../node_modules/@e280/shiny/s/views/copy/view.ts", "../node_modules/@e280/authlocal/s/lib/ui/views/card/style.css.ts", "../node_modules/@e280/authlocal/s/lib/ui/uitheme.ts", "../node_modules/@e280/authlocal/s/lib/ui/views/card/view.ts", "../node_modules/@e280/authlocal/s/lib/ui/views/widget/style.css.ts", "../node_modules/@e280/authlocal/s/lib/ui/icons/tabler/lock.icon.ts", "../node_modules/@e280/authlocal/s/lib/ui/icons/tabler/logout.icon.ts", "../node_modules/@e280/authlocal/s/lib/ui/views/widget/view.ts", "../s/bconfig.ts", "../s/vitals/shell.ts", "../s/dom/account/account.ts", "../s/dom/loader/style.css.ts", "../s/css/parts/vars.csstext.ts", "../s/css/parts/core.csstext.ts", "../s/css/parts/page.csstext.ts", "../s/css/parts/common.csstext.ts", "../s/css/benev.csstext.ts", "../s/css/theme.css.ts", "../s/assets/b.png.ts", "../s/dom/loader/view.ts", "../s/dom/menu/style.css.ts", "../s/dom/header/style.css.ts", "../s/dom/tools/shadow-duplex.ts", "../s/dom/header/view.ts", "../s/dom/menu/utils/on-keypress.ts", "../s/dom/menu/utils/click-backdrop.ts", "../s/dom/menu/utils/use-after-first-render.ts", "../s/dom/menu/view.ts", "../s/dom/footer/style.css.ts", "../s/dom/footer/view.ts", "../s/dom/account/style.css.ts", "../s/dom/account/view.ts", "../s/vitals/setup.ts", "../s/dom/loader/loader.ts", "../s/main.bundle.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n\n /**\n * When `true`, uses the initial value of the property as the default value,\n * which changes how attributes are handled:\n * - The initial value does *not* reflect, even if the `reflect` option is `true`.\n * Subsequent changes to the property will reflect, even if they are equal to the\n * default value.\n * - When the attribute is removed, the property is set to the default value\n * - The initial value will not trigger an old value in the `changedProperties` map\n * argument to update lifecycle methods.\n *\n * When set, properties must be initialized, either with a field initializer, or an\n * assignment in the constructor. Not initializing the property may lead to\n * improper handling of subsequent property assignments.\n *\n * While this behavior is opt-in, most properties that reflect to attributes should\n * use `useDefault: true` so that their initial values do not reflect.\n */\n useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n useDefault: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n // Whether this property is wrapping accessors.\n // Helps control the initial value change and reflection logic.\n if (this.prototype.hasOwnProperty(name)) {\n options = Object.create(options);\n options.wrapped = true;\n }\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get,\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set?.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Records property default values when the\n * `useDefault` option is used.\n */\n private __defaultValues?: Map<PropertyKey, unknown>;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that must run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs.\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n const convertedValue = converter.fromAttribute!(value, options.type);\n this[propName as keyof this] =\n convertedValue ??\n this.__defaultValues?.get(propName) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (convertedValue as any);\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @param useNewValue if true, the newValue argument is used instead of\n * reading the property value. This is important to use if the reactive\n * property is a standard private accessor, as opposed to a plain\n * property, since private members can't be dynamically read by name.\n * @param newValue the new value of the property. This is only used if\n * `useNewValue` is true.\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration,\n useNewValue = false,\n newValue?: unknown\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n const ctor = this.constructor as typeof ReactiveElement;\n if (useNewValue === false) {\n newValue = this[name as keyof this];\n }\n options ??= ctor.getPropertyOptions(name);\n const changed =\n (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n // When there is no change, check a corner case that can occur when\n // 1. there's a initial value which was not reflected\n // 2. the property is subsequently set to this value.\n // For example, `prop: {useDefault: true, reflect: true}`\n // and el.prop = 'foo'. This should be considered a change if the\n // attribute is not set because we will now reflect the property to the attribute.\n (options.useDefault &&\n options.reflect &&\n newValue === this.__defaultValues?.get(name) &&\n !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n if (changed) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n {useDefault, reflect, wrapped}: PropertyDeclaration,\n initializeValue?: unknown\n ) {\n // Record default value when useDefault is used. This allows us to\n // restore this value when the attribute is removed.\n if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n this.__defaultValues.set(\n name,\n initializeValue ?? oldValue ?? this[name as keyof this]\n );\n // if this is not wrapping an accessor, it must be an initial setting\n // and in this case we do not want to record the change or reflect.\n if (wrapped !== true || initializeValue !== undefined) {\n return;\n }\n }\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n // On the initial change, the old value should be `undefined`, except\n // with `useDefault`\n if (!this.hasUpdated && !useDefault) {\n oldValue = undefined;\n }\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // `changedProperties` map, but only for the case of properties created\n // via `createProperty` on accessors, which will not have already\n // populated the `changedProperties` map since they are not set.\n // We can't know if these accessors had initializers, so we just set\n // them anyway - a difference from experimental decorators on fields and\n // standard decorators on auto-accessors.\n // For context see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n const {wrapped} = options;\n const value = this[p as keyof this];\n if (\n wrapped === true &&\n !this._$changedProperties.has(p) &&\n value !== undefined\n ) {\n this._$changeProperty(p, undefined, options, value);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.1.2');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib/index.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n });\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\n/**\n * The root DOM node for rendering.\n */\nexport type RenderRootNode = HTMLElement | SVGElement | DocumentFragment;\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for child parts\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives\n * in those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start !== this._$endNode) {\n // The non-null assertion is safe because if _$startNode.nextSibling is\n // null, then _$endNode is also null, and we would not have entered this\n // loop.\n const n = wrap(start!).nextSibling;\n wrap(start!).remove();\n start = n;\n }\n }\n\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.3.3');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n });\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: RenderRootNode,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobal.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litElementPolyfillSupportDevMode\n : global.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.2.2');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "\nimport {AttrValue} from \"../../types.js\"\n\n/** get html attributes */\nexport const attrGet = {\n\tstring: (e: HTMLElement, key: string) => {\n\t\treturn e.getAttribute(key) ?? undefined\n\t},\n\tnumber: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn (raw === null || !raw)\n\t\t\t? undefined\n\t\t\t: Number(raw)\n\t},\n\tboolean: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn raw !== null\n\t},\n}\n\n/** set html attributes */\nexport const attrSet = {\n\tstring: (e: HTMLElement, key: string, value: string | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value)\n\t\treturn true\n\t},\n\tnumber: (e: HTMLElement, key: string, value: number | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value.toString())\n\t\treturn true\n\t},\n\tboolean: (e: HTMLElement, key: string, value: boolean | undefined) => {\n\t\tif (value) e.setAttribute(key, \"\")\n\t\telse e.removeAttribute(key)\n\t\treturn true\n\t},\n\n\tany: (element: HTMLElement, key: string, value: AttrValue) => {\n\t\tif (value === undefined || value === null)\n\t\t\telement.removeAttribute(key)\n\n\t\telse if (typeof value === \"string\")\n\t\t\telement.setAttribute(key, value)\n\n\t\telse if (typeof value === \"number\")\n\t\t\telement.setAttribute(key, value.toString())\n\n\t\telse if (typeof value === \"boolean\") {\n\t\t\tif (value === true)\n\t\t\t\telement.setAttribute(key, \"\")\n\t\t\telse\n\t\t\t\telement.removeAttribute(key)\n\t\t}\n\n\t\telse console.warn(`invalid attribute \"${key}\" type is \"${typeof value}\"`)\n\t},\n\n\tentries: (element: HTMLElement, entries: Iterable<[key: string, value: AttrValue]>) => {\n\t\tfor (const [key, value] of entries)\n\t\t\tattrSet.any(element, key, value)\n\t},\n\n\trecord: (element: HTMLElement, record: Record<string, AttrValue>) => {\n\t\treturn attrSet.entries(element, Object.entries(record))\n\t},\n}\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function el<E extends HTMLElement>(\n\t\ttagName: string,\n\t\tattrs: Record<string, AttrValue> = {},\n\t) {\n\n\tconst element = document.createElement(tagName) as E\n\tattrSet.record(element, attrs)\n\treturn element\n}\n\n", "\nimport {render, TemplateResult} from \"lit\"\n\nexport function mk<E extends Element = HTMLElement>(template: TemplateResult) {\n\tconst fragment = document.createDocumentFragment()\n\trender(template, fragment)\n\treturn fragment.firstElementChild as E\n}\n\n", "\nexport type EveFn = (event: any) => void\nexport type EveConfig = [options: AddEventListenerOptions, fn: EveFn]\nexport type EveHandler = EveFn | EveConfig\nexport type EveSpec = {[eventName: string]: EveHandler}\n\nexport function eve(target: EventTarget, events: EveSpec) {\n\tlet detachers: (() => void)[] = []\n\n\tfor (const [eventName, handler] of Object.entries(events)) {\n\t\tif (typeof handler === \"function\") {\n\t\t\ttarget.addEventListener(eventName, handler)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, handler))\n\t\t}\n\t\telse {\n\t\t\tconst [options, fn] = handler\n\t\t\ttarget.addEventListener(eventName, fn, options)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, fn))\n\t\t}\n\t}\n\n\treturn () => detachers.forEach(d => d())\n}\n\n", "\n/** respond when any attribute changes on the html element */\nexport function onAttrs(element: HTMLElement, fn: MutationCallback) {\n\tconst observer = new MutationObserver(fn)\n\tobserver.observe(element, {attributes: true})\n\treturn () => observer.disconnect()\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\n\n/** a typed proxy accessor for html attributes */\nexport class AttrProxies {\n\tconstructor(public element: HTMLElement) {}\n\n\tstrings = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.string(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: string | undefined) => (\n\t\t\tattrSet.string(this.element, key, value)\n\t\t),\n\t}) as Record<string, string | undefined>\n\n\tnumbers = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.number(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: number | undefined) => (\n\t\t\tattrSet.number(this.element, key, value)\n\t\t),\n\t}) as Record<string, number | undefined>\n\n\tbooleans = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.boolean(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: boolean | undefined) => (\n\t\t\tattrSet.boolean(this.element, key, value)\n\t\t),\n\t}) as Record<string, boolean | undefined>\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\nimport {AttrSpec, AttrTypes} from \"../../types.js\"\n\nexport type AttrSpecOptions = {\n\tbeforeSet?: (attrKey: string) => void\n\tafterSet?: (attrKey: string) => void\n}\n\n/** specify available html attributes and their types and create a proxy accessor */\nexport const attrSpec = <A extends AttrSpec>(\n\t\te: HTMLElement,\n\t\tspec: A,\n\t\toptions: AttrSpecOptions = {},\n\t) => new Proxy(spec, {\n\n\tget: (_target, key: string) => {\n\t\tswitch (spec[key]) {\n\t\t\tcase String: return attrGet.string(e, key)\n\t\t\tcase Number: return attrGet.number(e, key)\n\t\t\tcase Boolean: return attrGet.boolean(e, key)\n\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t}\n\t},\n\n\tset: (_target, key: string, value: any) => {\n\t\ttry {\n\t\t\toptions.beforeSet?.(key)\n\t\t\tswitch (spec[key]) {\n\t\t\t\tcase String: return attrSet.string(e, key, value)\n\t\t\t\tcase Number: return attrSet.number(e, key, value)\n\t\t\t\tcase Boolean: return attrSet.boolean(e, key, value)\n\t\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\toptions.afterSet?.(key)\n\t\t}\n\t},\n}) as any as AttrTypes<A>\n\n", "\nimport {AttrSpec} from \"../types.js\"\nimport {onAttrs} from \"./parts/on-attrs.js\"\nimport {AttrProxies} from \"./parts/attr-proxies.js\"\nimport {attrGet, attrSet} from \"./parts/attr-fns.js\"\nimport {attrSpec, AttrSpecOptions} from \"./parts/attr-spec.js\"\n\nexport function attrs(element: HTMLElement) {\n\tconst proxies = new AttrProxies(element)\n\treturn {\n\t\tstrings: proxies.strings,\n\t\tnumbers: proxies.numbers,\n\t\tbooleans: proxies.booleans,\n\t\ton: (fn: MutationCallback) => onAttrs(element, fn),\n\t\tspec: <A extends AttrSpec>(spec: A, options: AttrSpecOptions = {}) => attrSpec(element, spec, options),\n\t}\n}\n\nattrs.get = attrGet\nattrs.set = attrSet\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function elmer<E extends HTMLElement = HTMLElement>(tagName: string) {\n\treturn new Elmer<E>(tagName)\n}\n\nexport class Elmer<E extends HTMLElement = HTMLElement> {\n\t#attrs = new Map<string, AttrValue>()\n\t#children: (Node | string)[] = []\n\n\tconstructor(public tagName: string) {}\n\n\tattr(key: string, value: AttrValue = true) {\n\t\tthis.#attrs.set(key, value)\n\t\treturn this\n\t}\n\n\tattrs(record: Record<string, AttrValue>) {\n\t\tfor (const [key, value] of Object.entries(record))\n\t\t\tthis.attr(key, value)\n\t\treturn this\n\t}\n\n\tchildren(...elements: (Node | string)[]) {\n\t\tthis.#children.push(...elements)\n\t\treturn this\n\t}\n\n\tdone() {\n\t\tconst element = document.createElement(this.tagName)\n\t\tattrSet.entries(element, this.#attrs)\n\t\telement.append(...this.#children)\n\t\treturn element as E\n\t}\n}\n\n", "\nimport {Queryable} from \"../types.js\"\n\nexport function queryRequire<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\tconst e = container.querySelector<E>(selector)\n\tif (!e) throw new Error(`element not found (${selector})`)\n\treturn e\n}\n\nexport function queryMaybe<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn container.querySelector<E>(selector)\n}\n\nexport function queryAll<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn Array.from(container.querySelectorAll<E>(selector))\n}\n\n", "\nimport {render} from \"lit\"\nimport {eve, EveSpec} from \"./eve.js\"\nimport {attrs} from \"../attrs/attrs.js\"\nimport {Content} from \"../../view/types.js\"\nimport {Attrs, Queryable, Renderable} from \"../types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./queries.js\"\n\nexport class Dom<C extends Queryable> {\n\t#attrs?: Attrs\n\n\tconstructor(public element: C) {}\n\n\tin<E extends Queryable>(selectorOrElement: string | E) {\n\t\treturn new Dom<E>(\n\t\t\t(typeof selectorOrElement === \"string\")\n\t\t\t\t? queryRequire(selectorOrElement, this.element) as E\n\t\t\t\t: selectorOrElement\n\t\t)\n\t}\n\n\trequire<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryRequire<E>(selector, this.element)\n\t}\n\n\tmaybe<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryMaybe<E>(selector, this.element)\n\t}\n\n\tall<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryAll<E>(selector, this.element)\n\t}\n\n\trender(...content: Content[]) {\n\t\treturn render(content, this.element as Renderable)\n\t}\n\n\tget attrs(): Attrs {\n\t\treturn this.#attrs ??= attrs(this.element as HTMLElement)\n\t}\n\n\tevents(spec: EveSpec) {\n\t\treturn eve(this.element, spec)\n\t}\n}\n\n", "\n/**\n * Convert a camel-case name into a dashed name\n * - for example\n * dashify(\"BigManStyle\")\n * // \"big-man-style\"\n */\nexport function dashify(camel: string) {\n\treturn camel.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase()\n}\n\n", "\nimport {dashify} from \"./dashify.js\"\nimport {HTMLElementClasses, RegisterOptions} from \"../types.js\"\n\n/**\n * register custom elements (web components) to the dom\n * - takes an object full of custom html elements, and automatically dashes the names\n * - eg, `MyCoolElement` is registered as `<my-cool-element></my-cool-element>`\n * - calls `customElements.define`\n * - option `soft`\n * - `false` (default) will throw errors if elements are already defined\n * - `true` will do nothing if an element is already defined\n * - option `upgrade`\n * - `true` (default) will run `customElements.upgrade` where appropriate\n * - `false` will NOT upgrade any existing elements on the page\n */\nexport function register<E extends HTMLElementClasses>(\n\t\telements: E,\n\t\toptions: Partial<RegisterOptions> = {},\n\t) {\n\n\tconst {\n\t\tsoft = false,\n\t\tupgrade = true,\n\t} = options\n\n\tfor (const [name, Element] of Object.entries(elements)) {\n\t\tconst tag = dashify(name)\n\t\tconst already = customElements.get(tag)\n\n\t\tif (soft && already)\n\t\t\tcontinue\n\n\t\tcustomElements.define(tag, Element)\n\n\t\tif (upgrade)\n\t\t\tdocument.querySelectorAll(tag).forEach(element => {\n\t\t\t\tif (element.constructor === HTMLElement)\n\t\t\t\t\tcustomElements.upgrade(element)\n\t\t\t})\n\t}\n}\n\n", "\nimport {render} from \"lit\"\nimport {el} from \"./parts/el.js\"\nimport {mk} from \"./parts/mk.js\"\nimport {eve} from \"./parts/eve.js\"\nimport {attrs} from \"./attrs/attrs.js\"\nimport {elmer} from \"./parts/elmer.js\"\nimport {Content} from \"../view/types.js\"\nimport {Dom} from \"./parts/dom-scope.js\"\nimport {register} from \"./parts/register.js\"\nimport {Queryable, Renderable} from \"./types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./parts/queries.js\"\n\nexport function dom<E extends HTMLElement>(selector: string, container: Queryable = document) {\n\treturn queryRequire<E>(selector, container)\n}\n\ndom.in = <E extends Queryable>(selectorOrElement: string | E, container: Queryable = document) => {\n\treturn new Dom(container).in(selectorOrElement)\n}\n\ndom.need = queryRequire\ndom.maybe = queryMaybe\ndom.all = queryAll\n\ndom.el = el\ndom.elmer = elmer\ndom.mk = mk\ndom.events = eve\ndom.attrs = attrs\ndom.register = register\ndom.render = (container: Renderable, ...content: Content[]) => {\n\treturn render(content, container)\n}\n\n", "\nexport const bytes = Object.freeze({\n\teq(a: Uint8Array, b: Uint8Array) {\n\t\tif (a.length !== b.length) return false\n\t\tlet diff = 0\n\t\tfor (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]\n\t\treturn diff === 0\n\t},\n\n\trandom(count: number) {\n\t\treturn crypto.getRandomValues(new Uint8Array(count))\n\t},\n\n\tconcat(parts: Uint8Array[]) {\n\t\tlet size = 0\n\t\tfor (const part of parts) size += part.byteLength\n\n\t\tconst bytes = new Uint8Array(size)\n\n\t\tlet offset = 0\n\t\tfor (const part of parts) {\n\t\t\tbytes.set(part, offset)\n\t\t\toffset += part.byteLength\n\t\t}\n\n\t\treturn bytes as Uint8Array\n\t},\n})\n\n", "\nimport {bytes} from \"./bytes.js\"\n\nexport type Lexicon = {\n\tcharacters: string\n\tnegativePrefix?: string\n\tcaseInsensitive?: boolean\n\tpadding?: {\n\t\tcharacter: string\n\t\tsize: number\n\t}\n}\n\nexport interface BaseX {\n\t(bytes: Uint8Array): string\n}\n\nexport class BaseX {\n\tstatic lexicons = Object.freeze({\n\t\tbase2: {characters: \"01\"},\n\t\thex: {characters: \"0123456789abcdef\", caseInsensitive: true},\n\t\tbase36: {characters: \"0123456789abcdefghijklmnopqrstuvwxyz\"},\n\t\tbase58: {characters: \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"},\n\t\tbase62: {characters: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"},\n\t\tbase64url: {\n\t\t\tnegativePrefix: \"~\",\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n\t\t},\n\t\tbase64: {\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n\t\t\tpadding: {character: \"=\", size: 4},\n\t\t},\n\t})\n\n\tprivate lookup: Record<string, number>\n\tprivate negativePrefix: string\n\n\tconstructor(public lexicon: Lexicon) {\n\t\tthis.lookup = Object.fromEntries(\n\t\t\t[...lexicon.characters].map((char, i) => [char, i])\n\t\t)\n\t\tthis.negativePrefix = lexicon.negativePrefix ?? \"-\"\n\n\t\tconst fn = this.fromBytes.bind(this)\n\t\tObject.setPrototypeOf(fn, new.target.prototype)\n\t\tObject.assign(fn, this)\n\t\treturn fn as BaseX\n\t}\n\n\ttoBytes(s: string): Uint8Array {\n\t\tif (this.lexicon.caseInsensitive) s = s.toLowerCase()\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tconst output: number[] = []\n\n\t\t\tfor (const char of s) {\n\t\t\t\tif (char === this.lexicon.padding?.character) continue\n\t\t\t\tconst val = this.lookup[char]\n\t\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\t\tbitBuffer = (bitBuffer << bitsPerChar) | val\n\t\t\t\tbitCount += bitsPerChar\n\n\t\t\t\twhile (bitCount >= 8) {\n\t\t\t\t\tbitCount -= 8\n\t\t\t\t\toutput.push((bitBuffer >> bitCount) & 0xFF)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new Uint8Array(output)\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tlet num = 0n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t}\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (s[leadingZeroBytes] === zeroCharacter)\n\t\t\tleadingZeroBytes++\n\t\ts = s.slice(leadingZeroBytes)\n\t\tfor (const char of s) {\n\t\t\tconst val = this.lookup[char]\n\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tnum = num * base + BigInt(val)\n\t\t}\n\t\tconst out = new Uint8Array(leadingZeroBytes + (num === 0n ? 0 : this.countBytes(num)))\n\t\tlet writeIndex = out.length\n\t\twhile (num > 0n) {\n\t\t\tout[--writeIndex] = Number(num % 256n)\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn out\n\t}\n\n\tfromBytes(bytes: Uint8Array): string {\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tlet out = \"\"\n\n\t\t\tfor (const byte of bytes) {\n\t\t\t\tbitBuffer = (bitBuffer << 8) | byte\n\t\t\t\tbitCount += 8\n\n\t\t\t\twhile (bitCount >= bitsPerChar) {\n\t\t\t\t\tbitCount -= bitsPerChar\n\t\t\t\t\tconst index = (bitBuffer >> bitCount) & ((1 << bitsPerChar) - 1)\n\t\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \uD83E\uDE79 flush remaining bits\n\t\t\tif (bitCount > 0) {\n\t\t\t\tconst index = (bitBuffer << (bitsPerChar - bitCount)) & ((1 << bitsPerChar) - 1)\n\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t}\n\n\t\t\t// Add padding if applicable\n\t\t\tif (this.lexicon.padding) {\n\t\t\t\twhile (out.length % this.lexicon.padding.size !== 0)\n\t\t\t\t\tout += this.lexicon.padding.character\n\t\t\t}\n\n\t\t\treturn out\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tif (bytes.length === 0) return \"\"\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (bytes[leadingZeroBytes] === 0)\n\t\t\tleadingZeroBytes++\n\t\tlet num = 0n\n\t\tfor (const byte of bytes.slice(leadingZeroBytes))\n\t\t\tnum = (num << 8n) + BigInt(byte)\n\n\t\tif (num === 0n) return zeroCharacter.repeat(leadingZeroBytes)\n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn zeroCharacter.repeat(leadingZeroBytes) + out\n\t}\n\n\ttoInteger(s: string) {\n\t\tif (!s) return 0\n\t\tlet n = 0n\n\t\tlet negative = false\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t\tnegative = true\n\t\t}\n\t\tfor (const char of s) {\n\t\t\tconst value = this.lookup[char]\n\t\t\tif (value === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tn = n * base + BigInt(value)\n\t\t}\n\t\treturn Number(negative ? -n : n)\n\t}\n\n\tfromInteger(n: number) {\n\t\tn = Math.floor(n)\n\t\tconst negative = n < 0\n\t\tlet num = BigInt(negative ? -n : n)\n\t\tif (num === 0n) return this.lexicon.characters[0]\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn negative ? `${this.negativePrefix}${out}` : out\n\t}\n\n\trandom(count = 32) {\n\t\treturn this.fromBytes(bytes.random(count))\n\t}\n\n\tprivate countBytes(num: bigint) {\n\t\tlet count = 0\n\t\twhile (num > 0n) {\n\t\t\tcount++\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn count\n\t}\n}\n", "\nimport {BaseX} from \"./base-x.js\"\n\nexport const hex = new BaseX(BaseX.lexicons.hex)\nexport const base2 = new BaseX(BaseX.lexicons.base2)\nexport const base36 = new BaseX(BaseX.lexicons.base36)\nexport const base58 = new BaseX(BaseX.lexicons.base58)\nexport const base62 = new BaseX(BaseX.lexicons.base62)\nexport const base64 = new BaseX(BaseX.lexicons.base64)\nexport const base64url = new BaseX(BaseX.lexicons.base64url)\n\n", "\nconst fromBytes = (bytes: Uint8Array) => new TextDecoder().decode(bytes)\nconst toBytes = (string: string): Uint8Array => new TextEncoder().encode(string)\n\nexport function txt(bytes: Uint8Array) {\n\treturn fromBytes(bytes)\n}\ntxt.fromBytes = fromBytes\ntxt.toBytes = toBytes\n\n", "\nimport {AnyFunction, DebounceReturn} from \"./types.js\"\n\nexport function debounce<xAction extends AnyFunction>(\n\t\tdelay: number,\n\t\taction: xAction,\n\t): DebounceReturn<xAction> {\n\n\tlet latestArgs: any[]\n\tlet timeout: any\n\n\tlet waitingQueue: {\n\t\tresolve: (r: ReturnType<xAction>) => void\n\t\treject: (reason: any) => void\n\t}[] = []\n\n\tfunction reset() {\n\t\tlatestArgs = []\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\t\ttimeout = undefined\n\t\twaitingQueue = []\n\t}\n\n\treset()\n\n\treturn <DebounceReturn<xAction>>((...args) => {\n\t\tlatestArgs = args\n\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\twaitingQueue.push({resolve, reject})\n\t\t})\n\n\t\ttimeout = setTimeout(() => {\n\t\t\tPromise.resolve()\n\t\t\t\t.then(() => action(...latestArgs))\n\t\t\t\t.then(r => {\n\t\t\t\t\tfor (const {resolve} of waitingQueue)\n\t\t\t\t\t\tresolve(r)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tfor (const {reject} of waitingQueue)\n\t\t\t\t\t\treject(err)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t}, delay)\n\n\t\treturn promise\n\t})\n}\n", "\n/** a promise which can be resolved from the outside */\nexport type Deferred<R = void> = {\n\tpromise: Promise<R>\n\tresolve: (result: R) => void\n\treject: (reason: any) => void\n\n\t/** ties the fate of this deferred promise to the outcome of the provided outsidePromise */\n\tentangle: (outsidePromise: Promise<R>) => Promise<R>\n}\n\n/** returns a deferred promise with exposed resolve and reject fns */\nexport function defer<R = void>(): Deferred<R> {\n\tlet resolve!: (result: R) => void\n\tlet reject!: (reason: any) => void\n\n\tconst promise = new Promise<R>((res, rej) => {\n\t\tresolve = res\n\t\treject = rej\n\t})\n\n\tfunction entangle(outside: Promise<R>) {\n\t\toutside.then(resolve).catch(reject)\n\t\treturn promise\n\t}\n\n\treturn {promise, resolve, reject, entangle}\n}\n\n", "\nimport {defer, Deferred} from \"../defer.js\"\n\nexport function microbounce<F extends (...params: any[]) => any>(fn: F) {\n\tlet scheduled: {\n\t\tparams: any[]\n\t\tdeferred: Deferred<any>\n\t} | null = null\n\n\treturn ((...params: any[]) => {\n\t\tif (scheduled) {\n\t\t\tscheduled.params = params\n\t\t}\n\t\telse {\n\t\t\tscheduled = {params, deferred: defer()}\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst {params, deferred} = scheduled!\n\t\t\t\tscheduled = null\n\t\t\t\tPromise.resolve(fn(...params))\n\t\t\t\t\t.then(deferred.resolve)\n\t\t\t\t\t.catch(deferred.reject)\n\t\t\t})\n\t\t}\n\t\treturn scheduled.deferred.promise\n\t}) as ((...params: Parameters<F>) => Promise<Awaited<ReturnType<F>>>)\n}\n\n", "\nexport * from \"./clone.js\"\nexport * from \"./equal.js\"\nexport * from \"./freeze.js\"\n\n", "\nexport function clone<T>(data: T, refs = new Set<any>()): T {\n\n\tif (refs.has(data))\n\t\tthrow new Error(\"cannot clone circular reference\")\n\n\tlet copy = undefined as T\n\n\tif (typeof data === \"function\" || (data !== null && typeof data === \"object\")) {\n\t\trefs.add(data)\n\n\t\tif (Array.isArray(data))\n\t\t\tcopy = data.map(d => clone(d, new Set(refs))) as T\n\n\t\telse if (data.constructor === Object)\n\t\t\tcopy = Object.fromEntries(\n\t\t\t\tObject.entries(data)\n\t\t\t\t\t.map(([key, d]) => [key, clone(d, new Set(refs))])\n\t\t\t) as T\n\n\t\telse if (data instanceof Map)\n\t\t\tcopy = new Map(Array.from(data, ([key, val]) => [key, clone(val, new Set(refs))])) as T\n\n\t\telse if (data instanceof Set)\n\t\t\tcopy = new Set(Array.from(data, val => clone(val, new Set(refs)))) as T\n\n\t\telse if (data instanceof Date)\n\t\t\tcopy = new Date(data.getTime()) as T\n\n\t\telse\n\t\t\tcopy = data\n\n\t\trefs.delete(data) // Remove current data from refs once we're done with this branch of the object tree\n\t}\n\n\telse\n\t\tcopy = data\n\n\treturn copy\n}\n\n", "\n/** not null or undefined */\nexport function happy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** null or undefined */\nexport function sad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\nexport const is = Object.freeze({\n\n\t/** not null or undefined */\n\thappy,\n\n\t/** null or undefined */\n\tsad,\n\n\tboolean: (x: any): x is boolean =>\n\t\ttypeof x === \"boolean\",\n\n\tnumber: (x: any): x is number =>\n\t\ttypeof x === \"number\",\n\n\tstring: (x: any): x is string =>\n\t\ttypeof x === \"string\",\n\n\tbigint: (x: any): x is bigint =>\n\t\ttypeof x === \"bigint\",\n\n\tobject: <X>(x: X): x is object & NonNullable<X> =>\n\t\ttypeof x === \"object\" && x !== null,\n\n\tarray: (x: any | any[]): x is any[] =>\n\t\tArray.isArray(x),\n\n\tfn: (x: any): x is (...a: any[]) => any =>\n\t\ttypeof x === \"function\",\n\n\tsymbol: (x: any): x is symbol =>\n\t\ttypeof x === \"symbol\",\n})\n\n", "\nimport {is} from \"../is.js\"\n\nexport const equal = (alpha: any, bravo: any): boolean => {\n\n\tfunction recurse(alpha: any, bravo: any, parents: object[]) {\n\t\tif (!is.object(alpha) || !is.object(bravo))\n\t\t\treturn alpha === bravo\n\n\t\tif (parents.includes(alpha))\n\t\t\tthrow new Error(`forbidden circularity detected in deep equal comparison`)\n\n\t\tconst newParents = [...parents, alpha]\n\n\t\tif (alpha instanceof Map && bravo instanceof Map) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const [key, val] of alpha)\n\t\t\t\tif (!bravo.has(key) || !recurse(val, bravo.get(key), newParents))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse if (alpha instanceof Set && bravo instanceof Set) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const item of alpha)\n\t\t\t\tif (!Array.from(bravo).some(bItem => recurse(item, bItem, newParents)))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse {\n\t\t\tconst keys1 = Object.keys(alpha)\n\t\t\tconst keys2 = Object.keys(bravo)\n\n\t\t\tif (keys1.length !== keys2.length)\n\t\t\t\treturn false\n\n\t\t\tfor (const key of keys1) {\n\t\t\t\tif (!keys2.includes(key))\n\t\t\t\t\treturn false\n\t\t\t\tif (!recurse(alpha[key], bravo[key], newParents))\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn recurse(alpha, bravo, [])\n}\n\n", "\nimport {is} from \"../is.js\"\n\nexport function freeze<X>(item: X): X {\n\tfunction recurse(x: X, parents: object[]) {\n\t\tif (!is.object(x) || parents.includes(x))\n\t\t\treturn x\n\n\t\tconst newParents = [...parents, x]\n\n\t\tif (x instanceof Map)\n\t\t\tfor (const arr of x.entries())\n\t\t\t\tfor (const y of arr)\n\t\t\t\t\trecurse(y, newParents)\n\n\t\telse if (x instanceof Set)\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse if (Array.isArray(x))\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse\n\t\t\tfor (const y of Object.values(x))\n\t\t\t\trecurse(y, newParents)\n\n\t\treturn Object.freeze(x)\n\t}\n\n\treturn recurse(item, [])\n}\n\n", "\nimport type {Ok} from \"../types/ok.js\"\n\n/** success */\nexport function ok<Value>(value: Value): Ok<Value> {\n\treturn {ok: true, value}\n}\n\n", "\nimport type {Err} from \"../types/err.js\"\n\n/** failure */\nexport function err<E>(error: E): Err<E> {\n\treturn {ok: false, error}\n}\n\n", "\nimport type {Result} from \"../types/result.js\"\n\n/** return ok value, otherwise throw error */\nexport function gotOk<Value, E>(result: Result<Value, E>): Value {\n\tif (result.ok)\n\t\treturn result.value\n\n\tconst {error} = result\n\n\tif (error instanceof Error)\n\t\tthrow error\n\n\telse if (typeof error === \"string\")\n\t\tthrow new Error(error)\n\n\telse\n\t\tthrow new Error(\"unknown\")\n}\n\n/** return error, otherwise throw error */\nexport function gotErr<E>(result: Result<unknown, E>): E {\n\tif (result.ok) throw new Error(\"didn't get needed error\")\n\treturn result.error\n}\n\n/** @deprecated renamed to `gotOk` */\nexport const needOk = gotOk\n\n/** @deprecated renamed to `gotErr` */\nexport const needErr = gotErr\n\n", "\nimport {is} from \"../is.js\"\nimport {ok, err} from \"../ok/index.js\"\n\n/** drill into an object/array tree and return the value at the given path */\nexport function dig<Value>(\n\t\ttarget: any,\n\t\tpath: (string | number)[],\n\t) {\n\n\tlet current: any = target\n\n\tfor (const key of path) {\n\t\tif (!(is.object(current) || is.array(current)))\n\t\t\treturn err(\"not traversable\" as const)\n\n\t\tif (!Object.hasOwn(current, key))\n\t\t\treturn err(\"not found\" as const)\n\n\t\tcurrent = current[key]\n\t}\n\n\treturn ok(current as Value)\n}\n\n", "\nexport function got<X>(thing: X | undefined | null, err = \"got failed\"): X {\n\tif (thing === undefined || thing === null) throw new Error(err)\n\treturn thing\n}\n\n", "\ntype MapLike<K, V> = {\n\thas(key: K): boolean\n\tget(key: K): V | undefined\n\tset(key: K, value: V): unknown\n}\n\nexport function need<K, V>(\n\t\tmap: Pick<MapLike<K, V>, \"has\" | \"get\">,\n\t\tkey: K,\n\t\terr = (typeof key === \"string\" ? `needed key not found \"${key}\"` : \"needed key not found\"),\n\t) {\n\tif (map.has(key))\n\t\treturn map.get(key) as V\n\telse\n\t\tthrow new Error(err)\n}\n\nexport function guarantee<K, V>(map: MapLike<K, V>, key: K, make: () => V) {\n\tif (map.has(key))\n\t\treturn map.get(key)!\n\telse {\n\t\tconst value = make()\n\t\tmap.set(key, value)\n\t\treturn value\n\t}\n}\n\nexport function inserts<K, V, M extends Pick<MapLike<K, V>, \"set\">>(map: M, entries: Iterable<[K, V]>) {\n\tfor (const [key, value] of entries)\n\t\tmap.set(key, value)\n\treturn map\n}\n\n", "\n/**\n * repeat the given async function over and over.\n * - consider using `nap` in your fn to create a delay\n */\nexport function cycle(fn: (stop: () => void) => unknown | Promise<unknown>) {\n\tlet timeout: any\n\tlet stopped = false\n\n\tconst stop = () => {\n\t\tstopped = true\n\t\tclearTimeout(timeout)\n\t}\n\n\tconst tick = async() => {\n\t\tif (stopped) return\n\t\tawait fn(stop)\n\t\tif (stopped) return\n\t\ttimeout = setTimeout(tick, 0)\n\t}\n\n\ttick()\n\treturn stop\n}\n\n", "\nexport type Disposer = {\n\t(): void\n\tschedule: (...fns: (() => void)[]) => Disposer\n}\n\nexport function disposer(): Disposer {\n\tlet fns: (() => void)[] = []\n\n\tfunction d() {\n\t\tfor (const fn of fns) fn()\n\t\tfns = []\n\t}\n\n\td.schedule = (...newFns: (() => void)[]) => {\n\t\tfns.push(...newFns)\n\t\treturn d\n\t}\n\n\treturn d\n}\n\n", "\nexport function errorString(error: unknown, fallback = \"error\"): string {\n\tif (typeof error === \"string\") return error\n\telse if (error instanceof Error) return error.message\n\telse return fallback\n}\n\n", "\nexport type EvFn = (...a: any[]) => void\n\nexport type EvTarget<N extends string> = {\n\taddEventListener(name: N, fn: EvFn): void\n\tremoveEventListener(name: N, fn: EvFn): void\n}\n\nexport function ev<N extends string>(target: EvTarget<N>, fns: Record<N, EvFn>) {\n\tconst entries = Object.entries(fns) as [N, EvFn][]\n\n\tfor (const [name, fn] of entries)\n\t\ttarget.addEventListener(name, fn)\n\n\treturn () => {\n\t\tfor (const [name, fn] of entries)\n\t\t\ttarget.removeEventListener(name, fn)\n\t}\n}\n\n", "\n/** create a promise that waits for a number of milliseconds. */\nexport const nap = (milliseconds: number = 0) => (\n\tnew Promise<void>(resolve => setTimeout(resolve, milliseconds))\n)\n\n", "\nimport {defer} from \"./defer.js\"\n\nexport type Listener<A extends any[]> = (...a: A) => (void | Promise<void>)\n\nexport interface Xub<A extends any[] = []> {\n\n\t/** publish to all subscribed listeners. */\n\tpublish(...a: A): Promise<void>\n\n\t/** subscribe a listener function. */\n\tsubscribe(fn: Listener<A>): () => void\n\n\t/** publish to all subscribed listeners, with pubsub facilities. */\n\tpub: Pub<A>\n\n\t/** subscribe a listener function, with pubsub facilities. */\n\tsub: Sub<A>\n\n\t/**\n\t * subscribe a listener function.\n\t * @alias subscribe\n\t */\n\ton(fn: Listener<A>): () => void\n\n\t/** wait for the next published value */\n\tnext(fn?: Listener<A>): Promise<A>\n\n\t/** wipe all listeners attached to this. */\n\tclear(): void\n}\n\n/** subscriber fn that can be published to. */\nexport interface Sub<A extends any[] = []> extends Xub<A> {\n\t(fn: Listener<A>): () => void\n}\n\n/** publisher fn that can be published to. */\nexport interface Pub<A extends any[] = []> extends Xub<A> {\n\t(...a: A): Promise<void>\n}\n\n/** make pubsub facilities */\nexport function xub<A extends any[] = []>() {\n\tconst set = new Set<Listener<A>>()\n\n\tasync function publish(...a: A) {\n\t\tawait Promise.all([...set].map(fn => fn(...a)))\n\t}\n\n\tfunction subscribe(fn: Listener<A>) {\n\t\tset.add(fn)\n\t\treturn () => { set.delete(fn) }\n\t}\n\n\tasync function pub(...a: A) {\n\t\treturn publish(...a)\n\t}\n\n\tfunction sub(fn: Listener<A>) {\n\t\treturn subscribe(fn)\n\t}\n\n\tasync function next(fn?: Listener<A>) {\n\t\tconst {promise, resolve} = defer<A>()\n\t\tconst unsubscribe = sub(async(...a) => {\n\t\t\tif (fn) await fn(...a)\n\t\t\tresolve(a)\n\t\t\tunsubscribe()\n\t\t})\n\t\treturn promise\n\t}\n\n\tfunction clear() {\n\t\tset.clear()\n\t}\n\n\tconst x = {\n\t\tpub,\n\t\tsub,\n\t\tpublish,\n\t\tsubscribe,\n\t\ton: subscribe,\n\t\tnext,\n\t\tclear,\n\t} as Xub<A>\n\n\tObject.assign(sub, x)\n\tObject.assign(pub, x)\n\treturn x\n}\n\n/** create a subscriber fn that also has pubsub facilities */\nexport function sub<A extends any[] = []>(listener?: Listener<A>): Sub<A> {\n\tconst x = xub<A>()\n\tif (listener) x.sub(listener)\n\treturn x.sub\n}\n\n/** create a publisher fn that also has pubsub facilities */\nexport function pub<A extends any[] = []>(listener?: Listener<A>): Pub<A> {\n\tconst x = xub<A>()\n\tif (listener) x.sub(listener)\n\treturn x.pub\n}\n\n", "\nexport type TemplateParts = {\n\tstrings: TemplateStringsArray\n\tvalues: any[]\n}\n\nexport function templateParts(\n\t\tstrings: TemplateStringsArray,\n\t\t...values: any[]\n\t): TemplateParts {\n\n\treturn {strings, values}\n}\n\nexport function templateString(strings: TemplateStringsArray, ...values: any[]) {\n\tconst lastIndex = strings.length - 1\n\treturn strings\n\t\t.slice(0, lastIndex)\n\t\t.reduce((a, b, c) => a + b + values[c], \"\")\n\t\t\t+ strings[lastIndex]\n}\n\n", "\nexport const time = {\n\tseconds: (n: number) => (n * 1000),\n\tminutes: (n: number) => (n * time.seconds(60)),\n\thours: (n: number) => (n * time.minutes(60)),\n\tdays: (n: number) => (n * time.hours(24)),\n\n\tfuture: {\n\t\tseconds: (n: number) => (Date.now() + time.seconds(n)),\n\t\tminutes: (n: number) => (Date.now() + time.minutes(n)),\n\t\thours: (n: number) => (Date.now() + time.hours(n)),\n\t\tdays: (n: number) => (Date.now() + time.days(n)),\n\t},\n\n\tpast: {\n\t\tseconds: (n: number) => (Date.now() - time.seconds(n)),\n\t\tminutes: (n: number) => (Date.now() - time.minutes(n)),\n\t\thours: (n: number) => (Date.now() - time.hours(n)),\n\t\tdays: (n: number) => (Date.now() - time.days(n)),\n\t},\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\n\nexport type Trackable = object | symbol\n\n/**\n * reactivity integration hub\n */\nexport class Tracker<Item extends Trackable = any> {\n\t#busy = new Set<() => void>()\n\t#observationLayers: Set<Item>[] = []\n\t#subscriptions = new WeakMap<Item, Set<() => void>>()\n\n\t#batchDepth = 0\n\t#batchPending = new Set<() => void>()\n\n\t/** indicate to observers that this item was accessed */\n\tread(item: Item) {\n\t\tconst top = this.#observationLayers.at(-1)\n\t\ttop?.add(item)\n\t}\n\n\t/** invoke all subscriptions for this item */\n\twrite(item: Item) {\n\t\tconst fns = this.#subscriptions.get(item)\n\t\tif (!fns) return\n\n\t\tfor (const fn of fns)\n\t\t\tthis.#batchPending.add(fn)\n\n\t\tif (this.#batchDepth === 0)\n\t\t\tthis.#flush()\n\t}\n\n\t/** collect items that were read during fn */\n\tobserve<Value>(fn: () => Value) {\n\t\tconst seen = new Set<Item>()\n\t\tthis.#observationLayers.push(seen)\n\t\ttry {\n\t\t\tconst value = fn()\n\t\t\treturn {seen, value}\n\t\t}\n\t\tfinally {\n\t\t\tthis.#observationLayers.pop()\n\t\t}\n\t}\n\n\t/** fn will be called when item changes */\n\tsubscribe(item: Item, fn: () => void) {\n\t\tconst fns = guarantee(this.#subscriptions, item, () => new Set())\n\t\tfns.add(fn)\n\t\treturn () => {\n\t\t\tfns.delete(fn)\n\t\t\tif (fns.size === 0)\n\t\t\t\tthis.#subscriptions.delete(item)\n\t\t}\n\t}\n\n\tbatch = <R>(fn: () => R) => {\n\t\tthis.#batchDepth++\n\t\ttry {\n\t\t\treturn fn()\n\t\t}\n\t\tfinally {\n\t\t\tthis.#batchDepth--\n\t\t\tif (this.#batchDepth === 0)\n\t\t\t\tthis.#flush()\n\t\t}\n\t}\n\n\t#run(fn: () => void) {\n\t\tif (this.#busy.has(fn))\n\t\t\tthrow new Error(\"circularity forbidden\")\n\t\tthis.#busy.add(fn)\n\t\ttry { fn() }\n\t\tfinally { this.#busy.delete(fn) }\n\t}\n\n\t#flush() {\n\t\twhile (this.#batchPending.size > 0) {\n\t\t\tconst pending = [...this.#batchPending]\n\t\t\tthis.#batchPending.clear()\n\n\t\t\tfor (const fn of pending)\n\t\t\t\tthis.#run(fn)\n\t\t}\n\t}\n}\n\n", "\nimport {Tracker} from \"./tracker.js\"\n\n/** standard global tracker for integrations */\nexport const tracker: Tracker = (globalThis as any)[Symbol.for(\"e280.tracker.2\")] ??= new Tracker()\n\n", "\nimport {Signal} from \"./types.js\"\nimport {tracker} from \"../tracker/global.js\"\n\nexport function signal<Value>(value: Value): Signal<Value> {\n\treturn function sig() {\n\t\tif (arguments.length === 0) {\n\t\t\ttracker.read(sig)\n\t\t\treturn value\n\t\t}\n\t\telse {\n\t\t\tvalue = arguments[0]\n\t\t\ttracker.write(sig)\n\t\t\treturn value\n\t\t}\n\t}\n}\n\n", "\nimport {tracker} from \"../../tracker/global.js\"\n\nexport function watch<Value>(collector: () => Value, onChange: () => void) {\n\tconst {seen, value} = tracker.observe(collector)\n\tconst disposers = [...seen].map(item => tracker.subscribe(item, onChange))\n\tconst dispose = () => disposers.forEach(d => d())\n\treturn {value, dispose}\n}\n\n", "\nimport {watch} from \"./utils/watch.js\"\n\nexport function effect(fn: () => void) {\n\tlet unwatch = () => {}\n\n\tconst dispose = () => {\n\t\tunwatch()\n\t\tunwatch = () => {}\n\t}\n\n\tconst update = () => {\n\t\tdispose()\n\t\tconst watched = watch(fn, update)\n\t\tunwatch = watched.dispose\n\t}\n\n\tupdate()\n\n\treturn dispose\n}\n\n", "\nimport {effect} from \"../effect.js\"\n\nexport function afterEffect<C>(\n\t\tcollector: () => C,\n\t\tresponder: (collected: C) => void,\n\t) {\n\n\tlet initialized = false\n\n\treturn effect(() => {\n\t\tconst collected = collector()\n\n\t\tif (initialized)\n\t\t\tresponder(collected)\n\n\t\tinitialized = true\n\t})\n}\n\n", "\nimport {tracker} from \"../tracker/global.js\"\n\nexport const batch = tracker.batch\n\n", "\nimport {deep} from \"@e280/stz\"\nimport {Immutable} from \"../types.js\"\n\nexport function immute<S>(s: S) {\n\treturn deep.freeze(deep.clone(s)) as Immutable<S>\n}\n\n", "\nexport const _optic = Symbol(\"optic\")\n\n", "\nexport class CacheCell<R> {\n\t#dirty = false\n\t#value: R\n\n\tconstructor(private calculate: () => R) {\n\t\tthis.#value = calculate()\n\t}\n\n\tget() {\n\t\tif (this.#dirty) {\n\t\t\tthis.#dirty = false\n\t\t\tthis.#value = this.calculate()\n\t\t}\n\t\treturn this.#value\n\t}\n\n\tinvalidate() {\n\t\tthis.#dirty = true\n\t}\n}\n\n", "\nimport {deep} from \"@e280/stz\"\nimport {immute} from \"./utils/immute.js\"\nimport {tracker} from \"../tracker/global.js\"\nimport {_optic} from \"./utils/optic-symbol.js\"\nimport {CacheCell} from \"./utils/cache-cell.js\"\nimport {Immutable, LensLike, Optic} from \"./types.js\"\n\n/** reactive view into a state prism, with formalized mutations */\nexport class Lens<State> implements LensLike<State> {\n\t;[_optic]: Optic<State>\n\t#previous: State\n\t#stateCache: CacheCell<State>\n\t#frozenCache: CacheCell<Immutable<State>>\n\n\tconstructor(optic: Optic<State>) {\n\t\tthis[_optic] = optic\n\t\tthis.#previous = deep.clone(optic.getState())\n\t\tthis.#stateCache = new CacheCell(() => deep.clone(optic.getState()))\n\t\tthis.#frozenCache = new CacheCell(() => immute(optic.getState()))\n\t}\n\n\tupdate() {\n\t\tconst state = this[_optic].getState()\n\t\tconst isChanged = !deep.equal(state, this.#previous)\n\t\tif (isChanged) {\n\t\t\tthis.#stateCache.invalidate()\n\t\t\tthis.#frozenCache.invalidate()\n\t\t\tthis.#previous = deep.clone(state)\n\t\t\ttracker.write(this)\n\t\t}\n\t}\n\n\t/** get a snapshot of the current state. it's typed as mutable, but you should not mutate it. */\n\tget state() {\n\t\ttracker.read(this)\n\t\treturn this.#stateCache.get()\n\t}\n\n\t/** get an immutable readonly snapshot of the current state. */\n\tget frozen() {\n\t\ttracker.read(this)\n\t\treturn this.#frozenCache.get()\n\t}\n\n\tmutate<R>(fn: (state: State) => R) {\n\t\treturn this[_optic].mutate(fn)\n\t}\n\n\tlens<State2>(selector: (state: State) => State2) {\n\t\tconst lens = new Lens<State2>({\n\t\t\tgetState: () => selector(this[_optic].getState()),\n\t\t\tmutate: fn => this[_optic].mutate(state => fn(selector(state))),\n\t\t\tregisterLens: this[_optic].registerLens,\n\t\t})\n\t\tthis[_optic].registerLens(lens)\n\t\treturn lens\n\t}\n}\n\n", "\nimport {getErr, getOk, gotOk, gotErr} from \"@e280/stz\"\nimport {Wait} from \"./type.js\"\n\nexport function waitGet<Value>(wait: Wait<Value>) {\n\treturn wait.done\n\t\t? getOk(wait)\n\t\t: undefined\n}\n\nexport function waitGot<Value>(wait: Wait<Value>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotOk(wait)\n}\n\nexport function waitGetErr<E = unknown>(wait: Wait<unknown, E>) {\n\treturn wait.done\n\t\t? getErr(wait)\n\t\t: undefined\n}\n\nexport function waitGotErr<E = unknown>(wait: Wait<unknown, E>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotErr(wait)\n}\n\n/** @deprecated renamed to `waitGet` */\nexport const waitGetOk = waitGet\n\n/** @deprecated renamed to `waitGot` */\nexport const waitNeedOk = waitGot\n\n/** @deprecated renamed to `waitGotErr` */\nexport const waitNeedErr = waitGotErr\n\n", "\nimport {Wait, WaitResult, WaitErr, WaitOk, WaitPending} from \"./type.js\"\n\nexport const isWaitPending = (wait: Wait<unknown>): wait is WaitPending => !wait.done\nexport const isWaitDone = <Value, E = unknown>(wait: Wait<Value, E>): wait is WaitResult<Value, E> => wait.done\nexport const isWaitOk = <Value>(wait: Wait<Value, unknown>): wait is WaitOk<Value> => wait.done && wait.ok\nexport const isWaitErr = <E = unknown>(wait: Wait<unknown, E>): wait is WaitErr<E> => wait.done && !wait.ok\n\n", "\nimport {Wait} from \"./type.js\"\nimport {isWaitOk, isWaitPending} from \"./is.js\"\nimport {waitGotErr, waitGot} from \"./get.js\"\n\nexport function waitSelect<Ret, Value, E = unknown>(wait: Wait<Value, E>, select: {\n\t\tpending?: () => Ret\n\t\tok?: (value: Value) => Ret\n\t\terr?: (error: E) => Ret\n\t}) {\n\n\tconst {\n\t\tpending = () => {},\n\t\tok = () => {},\n\t\terr = () => {},\n\t} = select\n\n\tif (isWaitPending(wait))\n\t\treturn pending()\n\n\telse if (isWaitOk(wait))\n\t\treturn ok(waitGot(wait))\n\n\telse\n\t\treturn err(waitGotErr(wait))\n}\n\n", "\nimport {css, CSSResultGroup} from \"lit\"\n\nexport const cssReset: CSSResultGroup = css`\n\t* {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tbox-sizing: border-box;\n\n\t\tscrollbar-width: thin;\n\t\tscrollbar-color: #888 transparent;\n\t}\n\n\t::-webkit-scrollbar { width: 8px; }\n\t::-webkit-scrollbar-track { background: transparent; }\n\t::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n\t::-webkit-scrollbar-thumb:hover { background: #999; }\n`\n\n", "\nimport {dom} from \"../../dom/dom.js\"\n\nexport class SlyShadow extends HTMLElement {\n\tstatic register() {\n\t\tdom.register({SlyShadow}, {soft: true})\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.hasAttribute(\"view\"))\n\t\t\tthis.setAttribute(\"view\", \"\")\n\t}\n}\n\n", "\nimport {defer} from \"@e280/stz\"\n\nexport class LightCx {\n\tcount = 0\n\trendered = defer<void>()\n\n\tconstructor(public render: () => Promise<void>) {}\n\n\tdoneRender() {\n\t\tthis.count++\n\t\tthis.rendered.resolve()\n\t\tthis.rendered = defer()\n\t}\n}\n\nexport class ShadowCx extends LightCx {\n\tconstructor(\n\t\t\trender: () => Promise<void>,\n\t\t\tpublic host: HTMLElement,\n\t\t\tpublic shadow: ShadowRoot,\n\t\t) {\n\t\tsuper(render)\n\t}\n}\n\n", "\nimport {Hookscope} from \"./hookscope.js\"\n\nexport class Hooks {\n\t#scopes: Hookscope[] = []\n\n\tget scope() {\n\t\tconst scope = this.#scopes.at(-1)\n\t\tif (!scope) throw new Error(\"hooks must be called within a render fn\")\n\t\treturn scope\n\t}\n\n\tincrement() {\n\t\tconst scope = this.scope\n\t\tconst position = scope.position++\n\t\treturn {scope, position}\n\t}\n\n\twrap<Ret>(scope: Hookscope, fn: () => Ret) {\n\t\tscope.position = 0\n\t\tthis.#scopes.push(scope)\n\t\ttry { return fn() }\n\t\tfinally { this.#scopes.pop() }\n\t}\n}\n\nexport const hooks: Hooks = (globalThis as any)[Symbol.for(\"e280.hooks\")] ??= new Hooks()\n\n", "\nimport {tracker} from \"@e280/strata\"\n\nexport class Reactivity {\n\t#stoppers: (() => void)[] = []\n\n\tclear() {\n\t\tthis.#stoppers.forEach(stop => stop())\n\t\tthis.#stoppers = []\n\t}\n\n\tobserve<X>(fn: () => X, rerender: () => Promise<void>) {\n\t\tconst {seen, value} = tracker.observe(fn)\n\t\tthis.clear()\n\t\tfor (const item of seen) {\n\t\t\tconst stop = tracker.subscribe(item, rerender)\n\t\t\tthis.#stoppers.push(stop)\n\t\t}\n\t\treturn value\n\t}\n}\n\n", "\nexport class Mounts {\n\t#mounters: (() => () => void)[] = []\n\t#unmounters: (() => void)[] = []\n\n\tmount(mount: () => () => void) {\n\t\tthis.#mounters.push(mount)\n\t\tthis.#unmounters.push(mount())\n\t}\n\n\tunmountAll() {\n\t\tfor (const unmount of this.#unmounters)\n\t\t\tunmount()\n\t\tthis.#unmounters = []\n\t}\n\n\tremountAll() {\n\t\tfor (const mount of this.#mounters)\n\t\t\tthis.#unmounters.push(mount())\n\t}\n}\n\n", "\nimport {Mounts} from \"./mounts.js\"\nimport {LightCx, ShadowCx} from \"../../parts/cx.js\"\n\nexport class Hookscope {\n\tposition = 0\n\tvalues = new Map<number, any>()\n\tmounts = new Mounts()\n\tconstructor(public cx: LightCx | ShadowCx) {}\n}\n\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$clear();\n part._$startNode.remove();\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {Content} from \"../types.js\"\nimport {ShadowCx} from \"../parts/cx.js\"\nimport {hooks} from \"../hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"../parts/reactivity.js\"\nimport {Hookscope} from \"../hooks/plumbing/hookscope.js\"\n\nexport function shadowElement(view: () => Content): new() => HTMLElement {\n\treturn class extends HTMLElement {\n\t\t#cx\n\t\t#hookscope\n\t\t#reactivity = new Reactivity()\n\t\t#shadow = this.attachShadow({mode: \"open\"})\n\n\t\tconstructor() {\n\t\t\tsuper()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent()\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, this, this.#shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent() {\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view()),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender() {\n\t\t\tlitRender(this.#renderContent(), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\t}\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\n/** run the fn only one time */\nexport function useOnce<Value>(fn: () => Value) {\n\tconst {scope, position} = hooks.increment()\n\treturn guarantee(scope.values, position, fn) as Value\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\n\nexport function useRef<Value>(initial: Value) {\n\treturn useOnce(() => new Ref(initial))\n}\n\nexport class Ref<Value> {\n\tconstructor(public current: Value) {}\n}\n\n", "\nimport {hooks} from \"./hooks.js\"\n\nexport function useCx() {\n\treturn hooks.increment().scope.cx\n}\n\n", "\nimport {useCx} from \"./use-cx.js\"\nimport {ShadowCx} from \"../../parts/cx.js\"\n\nexport function useShadowCx() {\n\tconst cx = useCx()\n\n\tif (!(cx instanceof ShadowCx))\n\t\tthrow new Error(\"this hook only works on shadow views (but was called in a light view)\")\n\n\treturn cx\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow view's host element */\nexport function useHost() {\n\treturn useShadowCx().host\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\nexport function useMount(fn: () => () => void) {\n\tconst {scope} = hooks.increment()\n\treturn useOnce(() => scope.mounts.mount(fn))\n}\n\n", "\nimport {useCx} from \"./plumbing/use-cx.js\"\n\n/** return a promise that resolves after the next render is complete */\nexport function useRendered() {\n\treturn useCx().rendered.promise\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow root */\nexport function useShadow() {\n\treturn useShadowCx().shadow\n}\n\n", "\nimport {adoptStyles, CSSResultGroup, CSSResultOrNative, getCompatibleStyle} from \"lit\"\n\nexport function applyStyles(shadow: ShadowRoot, styles?: CSSResultGroup) {\n\tadoptStyles(shadow, prepareStyles(styles))\n}\n\nfunction prepareStyles(styles?: CSSResultGroup): Array<CSSResultOrNative> {\n\tconst elementStyles = []\n\n\tif (Array.isArray(styles)) {\n\t\tconst set = new Set((styles as Array<unknown>).flat(Infinity).reverse())\n\t\tfor (const s of set)\n\t\t\telementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative))\n\t}\n\telse if (styles !== undefined)\n\t\telementStyles.push(getCompatibleStyle(styles))\n\n\treturn elementStyles\n}\n\n", "\nimport {CSSResultGroup} from \"lit\"\nimport {useOnce} from \"./use-once.js\"\nimport {useShadow} from \"./use-shadow.js\"\nimport {applyStyles} from \"../parts/apply-styles.js\"\n\n/** attach stylesheets to the shadow root */\nexport function useCss(...styles: CSSResultGroup[]) {\n\tconst shadow = useShadow()\n\tuseOnce(() => applyStyles(shadow, styles))\n}\n\n", "\nimport {useRef} from \"./use-ref.js\"\nimport {useMount} from \"./use-mount.js\"\n\n/** mount/unmount lifecycle, but also return a value */\nexport function useMounted<Value>(fn: () => [value: Value, dispose: () => void]) {\n\tconst ref = useRef<Value>(undefined as Value)\n\n\tuseMount(() => {\n\t\tconst [value, dispose] = fn()\n\t\tref.current = value\n\t\treturn dispose\n\t})\n\n\treturn ref.current\n}\n\n/** @deprecated renamed to `useMounted` */\nexport const useLifecycle = useMounted\n\n", "\nimport {useHost} from \"./use-host.js\"\nimport {useOnce} from \"./use-once.js\"\n\n/** sets the host element's \"data-view\" attribute */\nexport function useName(name = \"\") {\n\tconst host = useHost()\n\tuseOnce(() => host.setAttribute(\"view\", name))\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {useOnce} from \"./use-once.js\"\n\nexport function useSignal<Value>(value: Value) {\n\treturn useOnce(() => signal(value))\n}\n\n", "\nimport {useCss} from \"./use-css.js\"\n\n/** alias for `useCss` */\nexport const useStyles = useCss\n\n", "\nimport {useMounted} from \"./use-mounted.js\"\n\n/** run the fn whenever the view is mounted */\nexport function useWake<Value>(fn: () => Value) {\n\treturn useMounted(() => [fn(), () => {}])\n}\n\n", "\nimport {ViewAttr, ViewAttrs} from \"../types.js\"\n\nexport function applyAttrs(element: HTMLElement, attrs: ViewAttrs) {\n\tfor (const [name, value] of Object.entries(attrs))\n\t\tapplyAttr(element, name, value)\n}\n\nfunction applyAttr(element: HTMLElement, name: string, value: ViewAttr) {\n\tconst existing = element.getAttribute(name)\n\tconst v = coerce(value)\n\tif (v === existing) return\n\tif (v === null) element.removeAttribute(name)\n\telse element.setAttribute(name, v)\n}\n\nfunction coerce(value: ViewAttr) {\n\tif (typeof value === \"string\") return value\n\telse if (typeof value === \"number\") return value.toString()\n\treturn value ? \"\" : null\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {ShadowCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {SlyShadow} from \"./common/sly-shadow.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {applyAttrs} from \"./parts/apply-attrs.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {View, Placement, ShadowSetup, ShadowView} from \"./types.js\"\nimport {AsyncDirective, directive, PartInfo} from \"lit/async-directive.js\"\n\nexport function shadowSetup(): ShadowSetup {\n\tSlyShadow.register()\n\tconst host = document.createElement(\"sly-shadow\")\n\tconst shadow = host.attachShadow({mode: \"open\"})\n\treturn {host, shadow}\n}\n\nexport function shadow<Props extends any[]>(view: View<Props>) {\n\treturn rawShadow(shadowSetup, view)\n}\n\nshadow.setup = (setup: () => ShadowSetup) => (\n\t<Props extends any[]>(view: View<Props>) => (\n\t\trawShadow(setup, view)\n\t)\n)\n\nfunction rawShadow<Props extends any[]>(\n\t\tsetup: () => ShadowSetup,\n\t\tview: View<Props>,\n\t) {\n\n\tconst directiveFn = directive(class extends AsyncDirective {\n\t\t#cx\n\t\t#hookscope\n\t\t#props!: Props\n\t\t#reactivity = new Reactivity()\n\n\t\tconstructor(part: PartInfo) {\n\t\t\tsuper(part)\n\t\t\tconst {host, shadow} = setup()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent(this.#props)\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, host, shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent(props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender({props, children, attrs}: Placement<Props>) {\n\t\t\tconst {host} = this.#cx\n\t\t\tif (!this.isConnected) return host\n\t\t\tif (attrs) applyAttrs(host, attrs)\n\t\t\tlitRender(children, this.#cx.host)\n\t\t\tlitRender(this.#renderContent(props), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t\treturn host\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tlitRender(null, this.#cx.shadow)\n\t\t\tlitRender(null, this.#cx.host)\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as ShadowView<[Placement<Props>]>\n\n\tfunction shadowView(...props: Props) {\n\t\treturn directiveFn({props})\n\t}\n\n\tshadowView.with = directiveFn\n\n\treturn shadowView as ShadowView<Props>\n}\n\n", "\nimport {css} from \"lit\"\nimport {nap, cycle} from \"@e280/stz\"\nimport {Content} from \"../../view/types.js\"\nimport {cssReset, shadow, useMount, useName, useSignal, useStyles} from \"../../view/index.js\"\n\nexport function makeAsciiAnim(hz: number, frames: string[]): () => Content {\n\treturn () => AsciiAnim({hz, frames})\n}\n\nexport const AsciiAnim = shadow(({hz, frames}: {\n\t\thz: number,\n\t\tframes: string[],\n\t}) => {\n\n\tuseName(\"loading\")\n\tuseStyles(cssReset, style)\n\n\tconst $frame = useSignal(0)\n\n\tuseMount(() => cycle(async() => {\n\t\tawait nap(1000 / hz)\n\t\tconst next = $frame() + 1\n\t\t$frame(next >= frames.length ? 0 : next)\n\t}))\n\n\treturn frames.at($frame())\n})\n\nconst style = css`\n:host {\n\tfont-family: monospace;\n\twhite-space: pre;\n\tuser-select: none;\n}\n`\n\n", "\nimport {css, html} from \"lit\"\nimport {shadow} from \"../../view/shadow.js\"\nimport {cssReset, useName, useStyles} from \"../../view/index.js\"\n\nexport const ErrorDisplay = shadow((error: any) => {\n\tuseName(\"error\")\n\tuseStyles(cssReset, style)\n\n\tif (typeof error === \"string\")\n\t\treturn error\n\n\telse if (error instanceof Error)\n\t\treturn html`<strong>${error.name}:</strong> <span>${error.message}</span>`\n\n\telse\n\t\treturn `error`\n})\n\nconst style = css`\n\t:host {\n\t\tfont-family: monospace;\n\t\tcolor: red;\n\t}\n`\n\n", "\nimport {waitSelect} from \"@e280/strata\"\n\nimport {Spinner} from \"./types.js\"\nimport {Content} from \"../view/types.js\"\n\nexport function makeSpinner(\n\t\tpending: () => Content,\n\t\terr: (error: unknown) => Content,\n\t): Spinner {\n\t\n\treturn (wait, ok) => waitSelect(wait, {pending, err, ok})\n}\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const dotsSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\" \",\n\t\t\" \",\n\t\t\". \",\n\t\t\".. \",\n\t\t\"...\",\n\t\t\" ..\",\n\t\t\" .\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const earthSpinner = makeSpinner(\n\tmakeAsciiAnim(3, [\"\uD83C\uDF0E\", \"\uD83C\uDF0F\", \"\uD83C\uDF0D\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const moonSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\"\uD83C\uDF12\",\n\t\t\"\uD83C\uDF13\",\n\t\t\"\uD83C\uDF14\",\n\t\t\"\uD83C\uDF15\",\n\t\t\"\uD83C\uDF16\",\n\t\t\"\uD83C\uDF17\",\n\t\t\"\uD83C\uDF18\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const spinner = makeSpinner(\n\tmakeAsciiAnim(16, [\"|\", \"/\", \"-\", \"\\\\\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const waveSpinner = makeSpinner(\n\tmakeAsciiAnim(20, [\n\t\t\":....\",\n\t\t\":....\",\n\t\t\"::...\",\n\t\t\".::..\",\n\t\t\"..::.\",\n\t\t\"...::\",\n\t\t\"....:\",\n\t\t\"....:\",\n\t\t\"...::\",\n\t\t\"..::.\",\n\t\t\".::..\",\n\t\t\"::...\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nexport class Err extends Error {\n\tname = this.constructor.name\n}\n\n", "\nimport {Err} from \"./err.js\"\n\nexport class TokenErr extends Err {}\n\n", "\nimport {base64url, txt} from \"@e280/stz\"\nimport {TokenErr} from \"../errs/token-err.js\"\nimport {TokenHeader, Payload, WebToken} from \"./types.js\"\n\nexport function decodeToken<P extends Payload>(token: string): WebToken<P> {\n\tconst [headerText, payloadText, signatureText] = token.split(\".\")\n\tif (!headerText || !payloadText || !signatureText)\n\t\tthrow new TokenErr(\"invalid jwt structure\")\n\n\tconst headerBytes = base64url.toBytes(headerText)\n\tconst headerJson = txt.fromBytes(headerBytes)\n\tconst header: TokenHeader = JSON.parse(headerJson)\n\n\tconst payloadBytes = base64url.toBytes(payloadText)\n\tconst payloadJson = txt.fromBytes(payloadBytes)\n\tconst payload: P = JSON.parse(payloadJson)\n\n\tconst signature = base64url.toBytes(signatureText)\n\treturn {header, payload, signature}\n}\n\n", "\nimport {decodeToken} from \"./decode-token.js\"\n\nexport const tokenTime = {\n\n\t/** convert jwt seconds to js milliseconds */\n\ttoMs: (t: number) => t * 1000,\n\n\t/** convert js milliseconds to jwt seconds */\n\tat: (ms: number) => {\n\t\tconst valid = typeof ms === \"number\" && Number.isFinite(ms)\n\t\tif (!valid) throw new Error(`invalid token time input`)\n\t\treturn Math.floor(ms / 1000)\n\t},\n\n\t/** convert js milliseconds to jwt seconds, or undefined */\n\tmaybe: (ms?: number) => ms !== undefined\n\t\t? ms / 1000\n\t\t: undefined,\n\n\t/** read token expiry time in js milliseconds */\n\treadExpiresAt(token: string) {\n\t\tconst {exp} = decodeToken(token).payload\n\t\treturn exp === undefined\n\t\t\t? undefined\n\t\t\t: tokenTime.toMs(exp)\n\t},\n\n\t/** read token issued time in js milliseconds */\n\treadIssuedAt(token: string) {\n\t\tconst {iat} = decodeToken(token).payload\n\t\treturn iat === undefined\n\t\t\t? undefined\n\t\t\t: tokenTime.toMs(iat)\n\t},\n\n\t/** return true if the jwt is expired */\n\tisExpired(token: string, time = Date.now()) {\n\t\tconst expiresAt = this.readExpiresAt(token)\n\t\treturn expiresAt === undefined\n\t\t\t? false\n\t\t\t: time >= expiresAt\n\t},\n\n\t/** obscure a timestamp using some randomness */\n\tfuzz({time, randomness, additive}: {\n\t\t\ttime: number\n\t\t\trandomness: number\n\t\t\tadditive: boolean\n\t\t}) {\n\t\tconst resolution = randomness / 10\n\t\tconst bucketed = Math.floor(\n\t\t\tadditive\n\t\t\t\t? Math.ceil(time / resolution) * resolution\n\t\t\t\t: Math.floor(time / resolution) * resolution\n\t\t)\n\t\tconst offset = Math.floor(Math.random() * randomness)\n\t\treturn additive\n\t\t\t? bucketed + offset\n\t\t\t: bucketed - offset\n\t},\n}\n\n", "const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n", "/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 \u00A710.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n", "/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 \u00A76.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 \u00A76.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 \u00A76.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 \u00A76.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n", "/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 \u00A75.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 \u00A76.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 \u00A76.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 \u00A76.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 \u00A76.2 and \u00A78.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 \u00A75.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 \u00A76.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 \u00A76.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 \u00A76.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 \u00A76.3 and \u00A76.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 \u00A76.3 and \u00A76.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 \u00A76.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 \u00A76.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n", "/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { abytes as abytes_, anumber as anumber_, bytesToHex as bytesToHex_, concatBytes as concatBytes_, hexToBytes as hexToBytes_, isBytes as isBytes_, randomBytes as randomBytes_, } from '@noble/hashes/utils.js';\n/**\n * Validates that a value is an array, optionally validating each element.\n * @param item - Value to validate.\n * @param title - Label included in thrown errors.\n * @param inner - Optional per-element validator, called with the element and its label.\n * @returns The validated array.\n * @example\n * Validate an array of points before batch processing.\n *\n * ```ts\n * aarray([1n, 2n], 'scalars');\n * ```\n */\nexport function aarray(item, title, inner = () => { }) {\n if (!Array.isArray(item))\n throw new TypeError(`\"${title}\" expected array, got type=${typeof item}`);\n for (let i = 0; i < item.length; i++)\n inner(item[i], `${title}[${i}]`);\n return item;\n}\n/**\n * Validates that a value is a byte array.\n * @param value - Value to validate.\n * @param length - Optional exact byte length.\n * @param title - Optional field name.\n * @returns Original byte array.\n * @example\n * Reject non-byte input before passing data into curve code.\n *\n * ```ts\n * abytes(new Uint8Array(1));\n * ```\n */\nexport const abytes = (value, length, title) => abytes_(value, length, title);\n/**\n * Validates that a value is a non-negative safe integer.\n * @param n - Value to validate.\n * @param title - Optional field name.\n * @returns The validated number.\n * @example\n * Validate a numeric length before allocating buffers.\n *\n * ```ts\n * anumber(1);\n * ```\n */\nexport const anumber = anumber_;\n/**\n * Asserts something is a string.\n * @param value - Value to validate.\n * @param title - Label included in thrown errors.\n * @returns The validated string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a label string.\n *\n * ```ts\n * astring('example', 'label');\n * ```\n */\nexport function astring(value, title = '') {\n if (typeof value !== 'string') {\n const prefix = title && `\"${title}\" `;\n throw new TypeError(prefix + 'expected string, got type=' + typeof value);\n }\n return value;\n}\n/**\n * Asserts something is a plain object-ish value, not null or array.\n * @param value - Value to validate.\n * @param title - Label included in thrown errors.\n * @returns The validated object.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate an options object before checking fields.\n *\n * ```ts\n * aobject({ flag: true });\n * ```\n */\nexport function aobject(value, title = 'object') {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError(title === 'object'\n ? 'expected valid options object'\n : `\"${title}\" expected object, got type=${typeof value}`);\n return value;\n}\n/**\n * Asserts something is a function.\n * @param value - Value to validate.\n * @param title - Label included in thrown errors.\n * @returns The validated function.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a required method before calling it.\n *\n * ```ts\n * afunction(() => true, 'predicate');\n * ```\n */\nexport function afunction(value, title) {\n if (typeof value !== 'function')\n throw new TypeError(`\"${title}\" is invalid: expected function, got ${typeof value}`);\n return value;\n}\n/**\n * Encodes bytes as lowercase hex.\n * @param bytes - Bytes to encode.\n * @returns Lowercase hex string.\n * @example\n * Serialize bytes as hex for logging or fixtures.\n *\n * ```ts\n * bytesToHex(Uint8Array.of(1, 2, 3));\n * ```\n */\nexport const bytesToHex = bytesToHex_;\n/**\n * Concatenates byte arrays.\n * @param arrays - Byte arrays to join.\n * @returns Concatenated bytes.\n * @example\n * Join domain-separated chunks into one buffer.\n *\n * ```ts\n * concatBytes(Uint8Array.of(1), Uint8Array.of(2));\n * ```\n */\nexport const concatBytes = (...arrays) => concatBytes_(...arrays);\n/**\n * Decodes lowercase or uppercase hex into bytes.\n * @param hex - Hex string to decode.\n * @returns Decoded bytes.\n * @example\n * Parse fixture hex into bytes before hashing.\n *\n * ```ts\n * hexToBytes('0102');\n * ```\n */\nexport const hexToBytes = (hex) => hexToBytes_(hex);\n/**\n * Checks whether a value is a Uint8Array.\n * @param a - Value to inspect.\n * @returns `true` when `a` is a Uint8Array.\n * @example\n * Branch on byte input before decoding it.\n *\n * ```ts\n * isBytes(new Uint8Array(1));\n * ```\n */\nexport const isBytes = isBytes_;\n/**\n * Reads random bytes from the platform CSPRNG.\n * @param bytesLength - Number of random bytes to read.\n * @returns Fresh random bytes.\n * @example\n * Generate a random seed for a keypair.\n *\n * ```ts\n * randomBytes(2);\n * ```\n */\nexport const randomBytes = (bytesLength) => randomBytes_(bytesLength);\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Validates that a flag is boolean.\n * @param value - Value to validate.\n * @param title - Optional field name.\n * @returns Original value.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Reject non-boolean option flags early.\n *\n * ```ts\n * abool(true);\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Validates that a value is a non-negative bigint or safe integer.\n * @param n - Value to validate.\n * @returns The same validated value.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate one integer-like value before serializing it.\n *\n * ```ts\n * abignumber(1n);\n * ```\n */\nexport function abignumber(n) {\n if (typeof n === 'bigint') {\n if (!isPosBig(n))\n throw new RangeError('positive bigint expected, got ' + n);\n }\n else\n anumber(n);\n return n;\n}\n/**\n * Validates that a value is a safe integer.\n * @param value - Integer to validate.\n * @param title - Optional field name.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a window size before scalar arithmetic uses it.\n *\n * ```ts\n * asafenumber(1);\n * ```\n */\nexport function asafenumber(value, title = '') {\n if (typeof value !== 'number') {\n const prefix = title && `\"${title}\" `;\n throw new TypeError(prefix + 'expected number, got type=' + typeof value);\n }\n if (!Number.isSafeInteger(value)) {\n const prefix = title && `\"${title}\" `;\n throw new RangeError(prefix + 'expected safe integer, got ' + value);\n }\n}\n/**\n * Encodes a bigint into even-length big-endian hex.\n * The historical \"unpadded\" name only means \"no fixed-width field padding\"; odd-length hex still\n * gets one leading zero nibble so the result always represents whole bytes.\n * @param num - Number to encode.\n * @returns Big-endian hex string.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Encode a scalar into hex without a `0x` prefix.\n *\n * ```ts\n * numberToHexUnpadded(255n);\n * ```\n */\nexport function numberToHexUnpadded(num) {\n const hex = abignumber(num).toString(16);\n return hex.length & 1 ? '0' + hex : hex;\n}\n/**\n * Parses a big-endian hex string into bigint.\n * Accepts odd-length hex through the native `BigInt('0x' + hex)` parser and currently surfaces the\n * same native `SyntaxError` for malformed hex instead of wrapping it in a library-specific error.\n * @param hex - Hex string without `0x`.\n * @returns Parsed bigint value.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Parse a scalar from fixture hex.\n *\n * ```ts\n * hexToNumber('ff');\n * ```\n */\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n// BE: Big Endian, LE: Little Endian\n/**\n * Parses big-endian bytes into bigint.\n * @param bytes - Bytes in big-endian order.\n * @returns Parsed bigint value.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Read a scalar encoded in network byte order.\n *\n * ```ts\n * bytesToNumberBE(Uint8Array.of(1, 0));\n * ```\n */\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex_(bytes));\n}\n/**\n * Parses little-endian bytes into bigint.\n * @param bytes - Bytes in little-endian order.\n * @returns Parsed bigint value.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Read a scalar encoded in little-endian form.\n *\n * ```ts\n * bytesToNumberLE(Uint8Array.of(1, 0));\n * ```\n */\nexport function bytesToNumberLE(bytes) {\n return hexToNumber(bytesToHex_(copyBytes(abytes_(bytes)).reverse()));\n}\n/**\n * Encodes a bigint into fixed-length big-endian bytes.\n * @param n - Number to encode.\n * @param len - Output length in bytes. Must be greater than zero.\n * @returns Big-endian byte array.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * Serialize a scalar into a 32-byte field element.\n *\n * ```ts\n * numberToBytesBE(255n, 2);\n * ```\n */\nexport function numberToBytesBE(n, len) {\n anumber_(len);\n if (len === 0)\n throw new Error('zero output length is invalid');\n n = abignumber(n);\n const expectedLen = len * 2;\n const hex = n.toString(16);\n // Detect overflow before hex parsing so oversized values don't leak the shared odd-hex error.\n if (hex.length > expectedLen)\n throw new RangeError('number is too large');\n return hexToBytes_(hex.padStart(expectedLen, '0'));\n}\n/**\n * Encodes a bigint into fixed-length little-endian bytes.\n * @param n - Number to encode.\n * @param len - Output length in bytes.\n * @returns Little-endian byte array.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * Serialize a scalar for little-endian protocols.\n *\n * ```ts\n * numberToBytesLE(255n, 2);\n * ```\n */\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\n/**\n * Encodes a bigint into variable-length big-endian bytes.\n * @param n - Number to encode.\n * @returns Variable-length big-endian bytes.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Serialize a bigint without fixed-width padding.\n *\n * ```ts\n * numberToVarBytesBE(255n);\n * ```\n */\nexport function numberToVarBytesBE(n) {\n return hexToBytes_(numberToHexUnpadded(abignumber(n)));\n}\n// Compares 2 u8a-s in kinda constant time\n/**\n * Compares two byte arrays in constant-ish time.\n * @param a - Left byte array.\n * @param b - Right byte array.\n * @returns `true` when bytes match.\n * @example\n * Compare two encoded points without early exit.\n *\n * ```ts\n * equalBytes(Uint8Array.of(1), Uint8Array.of(1));\n * ```\n */\nexport function equalBytes(a, b) {\n a = abytes(a);\n b = abytes(b);\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n}\n/**\n * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer,\n * and Buffer#slice creates mutable copy. Never use Buffers!\n * @param bytes - Bytes to copy.\n * @returns Detached copy.\n * @example\n * Make an isolated copy before mutating serialized bytes.\n *\n * ```ts\n * copyBytes(Uint8Array.of(1, 2, 3));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols\n * Should be safe to use for things expected to be ASCII.\n * Returns exact same result as `TextEncoder` for ASCII or throws.\n * @param ascii - ASCII input text.\n * @returns Encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode an ASCII domain-separation tag.\n *\n * ```ts\n * asciiToBytes('ABC');\n * ```\n */\nexport function asciiToBytes(ascii) {\n if (typeof ascii !== 'string')\n throw new TypeError('ascii string expected, got ' + typeof ascii);\n return Uint8Array.from(ascii, (c, i) => {\n const charCode = c.charCodeAt(0);\n if (c.length !== 1 || charCode > 127) {\n throw new RangeError(`string contains non-ASCII character \"${ascii[i]}\" with code ${charCode} at position ${i}`);\n }\n return charCode;\n });\n}\n/**\n * Checks whether n is non-negative bigint. Historical name.\n * @param n - candidate value\n * @returns `true` when the value is bigint and 0 or larger\n * @example\n * Check a candidate scalar before range validation.\n *\n * ```ts\n * isPosBig(2n);\n * ```\n */\nexport function isPosBig(n) {\n return typeof n === 'bigint' && _0n <= n;\n}\n/**\n * Checks whether a bigint lies inside a half-open range.\n * @param n - Candidate value.\n * @param min - Inclusive lower bound.\n * @param max - Exclusive upper bound.\n * @returns `true` when the value is inside the range.\n * @example\n * Check whether a candidate scalar fits the field order.\n *\n * ```ts\n * inRange(2n, 1n, 3n);\n * ```\n */\nexport function inRange(n, min, max) {\n return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n/**\n * Asserts `min <= n < max`. NOTE: upper bound is exclusive.\n * @param title - Value label for error messages.\n * @param n - Candidate value.\n * @param min - Inclusive lower bound.\n * @param max - Exclusive upper bound.\n * Wrong-type inputs are not separated from out-of-range values here: they still flow through the\n * shared `RangeError` path because this is only a throwing wrapper around `inRange(...)`.\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Assert that a bigint stays within one half-open range.\n *\n * ```ts\n * aInRange('x', 2n, 1n, 256n);\n * ```\n */\nexport function aInRange(title, n, min, max) {\n // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n // consider P=256n, min=0n, max=P\n // - a for min=0 would require -1: `inRange('x', x, -1n, P)`\n // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)`\n // - our way is the cleanest: `inRange('x', x, 0n, P)\n if (!inRange(n, min, max))\n throw new RangeError('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n * @param n - Value to inspect.\n * @returns Bit length.\n * @throws If the value is negative. {@link Error}\n * @example\n * Measure the bit length of a scalar before serialization.\n *\n * ```ts\n * bitLen(8n);\n * ```\n */\nexport function bitLen(n) {\n // Size callers in this repo only use non-negative orders / scalars, so negative inputs are a\n // contract bug and must not silently collapse to zero bits.\n if (n < _0n)\n throw new Error('expected non-negative bigint, got ' + n);\n // Native radix conversion beats a shift loop at every size, and the loop is quadratic in bits.\n return n === _0n ? 0 : n.toString(2).length;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n * @param n - Source value.\n * @param pos - Bit position. Negative positions are passed through to raw\n * bigint shift semantics; because the mask is built as `1n << pos`,\n * they currently collapse to `0n` and make the helper a no-op.\n * @returns Bit as bigint.\n * @example\n * Gets single bit at position.\n *\n * ```ts\n * bitGet(5n, 0);\n * ```\n */\nexport function bitGet(n, pos) {\n if (typeof n !== 'bigint')\n throw new TypeError('\"n\" expected bigint, got type=' + typeof n);\n asafenumber(pos, 'pos');\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n * @param n - Source value.\n * @param pos - Bit position. Negative positions are passed through to raw bigint shift semantics,\n * so they currently behave like left shifts.\n * @param value - Whether the bit should be set.\n * @returns Updated bigint.\n * @example\n * Sets single bit at position.\n *\n * ```ts\n * bitSet(0n, 1, true);\n * ```\n */\nexport function bitSet(n, pos, value) {\n if (typeof n !== 'bigint')\n throw new TypeError('\"n\" expected bigint, got type=' + typeof n);\n asafenumber(pos, 'pos');\n abool(value, 'value');\n const mask = _1n << BigInt(pos);\n // Clearing needs AND-not here; OR with zero leaves an already-set bit untouched.\n return value ? n | mask : n & ~mask;\n}\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n * @param n - Number of bits. Negative widths are currently passed through to raw bigint shift\n * semantics and therefore produce `-1n`.\n * @returns Bitmask value.\n * @example\n * Calculate mask for N bits.\n *\n * ```ts\n * bitMask(4);\n * ```\n */\nexport const bitMask = (n) => {\n asafenumber(n, 'n');\n return (_1n << BigInt(n)) - _1n;\n};\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @param hashLen - Hash output size in bytes. Callers are expected to pass a positive length; `0`\n * is not rejected here and would make the internal generate loop non-progressing.\n * @param qByteLen - Requested output size in bytes. Callers are expected to pass a positive length.\n * @param hmacFn - HMAC implementation.\n * @returns Function that will call DRBG until the predicate returns anything\n * other than `undefined`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Build a deterministic nonce generator for RFC6979-style signing.\n *\n * ```ts\n * import { createHmacDrbg } from '@noble/curves/utils.js';\n * import { hmac } from '@noble/hashes/hmac.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hmacFn = (key: Uint8Array, msg: Uint8Array) => hmac(sha256, key, msg);\n * const drbg = createHmacDrbg(32, 32, hmacFn);\n * const seed = new Uint8Array(32);\n * drbg(seed, (bytes) => bytes);\n * ```\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n anumber_(hashLen, 'hashLen');\n anumber_(qByteLen, 'qByteLen');\n if (typeof hmacFn !== 'function')\n throw new TypeError('hmacFn must be a function');\n // creates Uint8Array\n const u8n = (len) => new Uint8Array(len);\n const NULL = Uint8Array.of();\n const byte0 = Uint8Array.of(0x00);\n const byte1 = Uint8Array.of(0x01);\n const _maxDrbgIters = 1000;\n // Step B, Step C: set hashLen to 8*ceil(hlen/8).\n // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 signatures.\n let v = u8n(hashLen);\n // Steps B and C of RFC6979 3.2.\n let k = u8n(hashLen);\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n // hmac(k)(v, ...values)\n const h = (...msgs) => hmacFn(k, concatBytes(v, ...msgs));\n const reseed = (seed = NULL) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(byte0, seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(byte1, seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= _maxDrbgIters)\n throw new Error('drbg: tried max amount of iterations');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until the predicate accepts a candidate.\n // Falsy values like 0 are valid outputs.\n while ((res = pred(gen())) === undefined)\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * Extra keys are intentionally ignored because many callers validate only the subset they use from\n * richer option bags or runtime objects.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `aobject()`, `afunction()`, `abool()`, or `asafenumber()` instead.\n * @param object - Object to validate.\n * @param fields - Required field types.\n * @param optFields - Optional field types.\n * @param title - Object label included in thrown errors.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Check user options before building a curve helper.\n *\n * ```ts\n * validateObject({ flag: true }, { flag: 'boolean' });\n * ```\n */\nexport function validateObject(object, fields = {}, optFields = {}, title = 'object') {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n}\n/**\n * Throws not implemented error.\n * @returns Never returns.\n * @throws If the unfinished code path is reached. {@link Error}\n * @example\n * Surface the placeholder error from an unfinished code path.\n *\n * ```ts\n * try {\n * notImplemented();\n * } catch {}\n * ```\n */\nexport const notImplemented = () => {\n throw new Error('not implemented');\n};\n", "/**\n * Utils for modular division and fields.\n * Field over 11 is a finite (Galois) field is integer number operations `mod 11`.\n * There is no division: it is replaced by modular multiplicative inverse.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { aarray, abool, abytes, afunction, anumber, aobject, asafenumber, bitLen, bytesToNumberBE, bytesToNumberLE, numberToBytesBE, numberToBytesLE, } from \"../utils.js\";\n// Numbers aren't used in x25519 / x448 builds\n// prettier-ignore\nconst _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2);\n// prettier-ignore\nconst _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5);\n// prettier-ignore\nconst _7n = /* @__PURE__ */ BigInt(7), _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9);\nconst _15n = /* @__PURE__ */ BigInt(15), _16n = /* @__PURE__ */ BigInt(16);\n// 2^64: exponents below this use plain square-and-multiply in pow()/FpPow(); the windowed path's\n// table build (14 multiplications) only pays off for longer exponents (break-even ~50 bits).\nconst POW_WINDOWED_MIN = /* @__PURE__ */ BigInt('0x10000000000000000');\n/**\n * @param a - Dividend value.\n * @param b - Positive modulus.\n * @returns Reduced value in `[0, b)` only when `b` is positive.\n * @throws If the modulus is not positive. {@link Error}\n * @example\n * Normalize a bigint into one field residue.\n *\n * ```ts\n * mod(-1n, 5n);\n * ```\n */\nexport function mod(a, b) {\n if (b <= _0n)\n throw new Error('mod: expected positive modulus, got ' + b);\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to a power with modular reduction.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * Low-level helper: callers that need canonical residues must pass a valid `num` for the chosen\n * modulus instead of relying on the `power===0/1` fast paths to normalize it.\n * @param num - Base value.\n * @param power - Exponent value.\n * @param modulo - Reduction modulus.\n * @returns Modular exponentiation result.\n * @throws If the modulus or exponent is invalid. {@link Error}\n * @example\n * Raise one bigint to a modular power.\n *\n * ```ts\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n * ```\n */\nexport function pow(num, power, modulo) {\n if (modulo <= _1n)\n throw new Error('pow: expected modulus > 1, got ' + modulo);\n // Non-bigint exponents coerce every comparison below to false and would silently return 1.\n if (typeof power !== 'bigint')\n throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);\n if (power < _0n)\n throw new Error('invalid exponent, negatives unsupported');\n if (power === _0n)\n return _1n;\n if (power === _1n)\n return num;\n let d = num % modulo;\n if (d < _0n)\n d += modulo;\n // Control flow in both branches below depends only on the exponent, never on `num` \u2014 invertCt()\n // relies on that for its (public-exponent) secret-independence guarantee.\n if (power < POW_WINDOWED_MIN) {\n // Square-and-multiply: cheaper than the windowed path for short exponents.\n let p = _1n;\n while (power > _0n) {\n if (power & _1n)\n p = (p * d) % modulo;\n d = (d * d) % modulo;\n power >>= _1n;\n }\n return p;\n }\n // Fixed 4-bit windows, MSB-first: a 14-multiplication table drops per-window cost to <1\n // multiplication (vs ~2 per window for square-and-multiply), ~25-30% faster for the dense\n // 256-bit exponents of sqrt / Legendre / invertCt.\n const digits = [];\n while (power > _0n) {\n digits.push(Number(power & _15n));\n power >>= _4n;\n }\n const table = new Array(16);\n table[0] = _1n;\n table[1] = d;\n for (let i = 2; i < 16; i++)\n table[i] = (table[i - 1] * d) % modulo;\n let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0\n for (let w = digits.length - 2; w >= 0; w--) {\n p = (p * p) % modulo;\n p = (p * p) % modulo;\n p = (p * p) % modulo;\n p = (p * p) % modulo;\n const digit = digits[w];\n if (digit !== 0)\n p = (p * table[digit]) % modulo;\n }\n return p;\n}\n/**\n * Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)`.\n * Low-level helper: callers that need canonical residues must pass a valid `x` for the chosen\n * modulus; the `power===0` fast path intentionally returns the input unchanged.\n * @param x - Base value.\n * @param power - Number of squarings.\n * @param modulo - Reduction modulus.\n * @returns Repeated-squaring result.\n * @throws If the exponent is negative. {@link Error}\n * @example\n * Apply repeated squaring inside one field.\n *\n * ```ts\n * pow2(3n, 2n, 11n);\n * ```\n */\nexport function pow2(x, power, modulo) {\n if (modulo <= _1n)\n throw new Error('pow2: expected modulus > 1, got ' + modulo);\n if (power < _0n)\n throw new Error('pow2: expected non-negative exponent, got ' + power);\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n/**\n * Inverses number over modulo.\n * Implemented using the {@link https://brilliant.org/wiki/extended-euclidean-algorithm/ | extended Euclidean algorithm}.\n * @param number - Value to invert.\n * @param modulo - Modulus greater than 1.\n * @returns Multiplicative inverse.\n * @throws If the modulus is invalid or the inverse does not exist. {@link Error}\n * @example\n * Compute one modular inverse with the extended Euclidean algorithm.\n *\n * ```ts\n * invert(3n, 11n);\n * ```\n */\nexport function invert(number, modulo) {\n if (number === _0n)\n throw new Error('invert: expected non-zero number');\n // modulo = 1 is the zero ring: gcd(x, 1) = 1 makes the loop below \"succeed\" and return the\n // useless inverse 0. Reject it like pow() and invertCt() do.\n if (modulo <= _1n)\n throw new Error('invert: expected modulus > 1, got ' + modulo);\n // This is variable-time: the loop count depends on `number`. For a secret-independent\n // (Fermat) alternative over a prime modulus, see {@link invertCt} (~4x slower).\n let a = mod(number, modulo);\n let b = modulo;\n // Only the B\u00E9zout coefficient of `number` (x/u chain) is tracked; the coefficient of `modulo`\n // never affects the output, so it is not computed.\n // prettier-ignore\n let x = _0n, u = _1n;\n while (a !== _0n) {\n const q = b / a;\n const r = b - a * q;\n const m = x - u * q;\n // prettier-ignore\n b = a, a = r, x = u, u = m;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n/**\n * Inverses number over modulo using Fermat's little theorem: `a^(p-2) \u2261 a\u207B\u00B9 (mod p)`.\n *\n * Unlike {@link invert} (extended Euclidean), the exponent `p-2` is a public constant, so the\n * underlying square-and-multiply has the same control flow for every secret `a`: there is no\n * data-dependent branching or loop count that could leak `a` through timing (e.g. Minerva-style\n * ECDSA nonce-inversion attacks). This is only \"algorithmically\" constant-time \u2014 JS bigint\n * multiplication/reduction is still value-dependent \u2014 and it is roughly 4x slower than\n * {@link invert}.\n *\n * REQUIRES a prime modulus; Fermat's theorem does not hold otherwise. The result is verified to be\n * a real inverse, so a non-prime modulus (or a non-invertible input) fails closed with an error\n * instead of returning a wrong value.\n * @param a - Value to invert.\n * @param prime - Prime modulus.\n * @returns Multiplicative inverse in `[1, prime)`.\n * @throws If the modulus is below 2, the input reduces to zero, or the inverse does not exist.\n * {@link Error}\n * @example\n * Compute one modular inverse without secret-dependent branching.\n *\n * ```ts\n * invertCt(3n, 11n); // 4n, since 3 * 4 = 12 \u2261 1 (mod 11)\n * ```\n */\nexport function invertCt(a, prime) {\n if (prime <= _1n)\n throw new Error('invertCt: expected prime modulus > 1, got ' + prime);\n const an = mod(a, prime);\n if (an === _0n)\n throw new Error('invertCt: expected non-zero number');\n // Exponent (prime - 2) is public, so FpPow's square-and-multiply is secret-independent.\n const inverse = pow(an, prime - _2n, prime);\n // O(1) safety net: verifies the inverse and rejects composite moduli where a^(p-2) is not one.\n if (mod(an * inverse, prime) !== _1n)\n throw new Error('invertCt: does not exist');\n return inverse;\n}\nfunction assertIsSquare(Fp, root, n) {\n const F = Fp;\n if (!F.eql(F.sqr(root), n))\n throw new Error('Cannot find square root');\n}\n// The Legendre symbol and every sqrt variant here are only defined over an odd (prime) modulus.\n// An even ORDER makes their integer divisions \u2014 (p-1)/2, (p+1)/4, (p-5)/8, (p+7)/16 \u2014 truncate and\n// silently return a wrong result, so reject it explicitly at the entry points instead. This is a\n// cheap necessary-condition check, not a primality test (composite odd moduli are caught later by\n// the Legendre-result / assertIsSquare checks).\nfunction aoddModulus(order, fnName) {\n if ((order & _1n) === _0n)\n throw new Error(fnName + ': expected odd modulus, got ' + order);\n}\n// Not all roots are possible! Example which will throw:\n// const NUM =\n// n = 72057594037927816n;\n// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'));\nfunction sqrt3mod4(Fp, n) {\n const F = Fp;\n const p1div4 = (F.ORDER + _1n) / _4n;\n const root = F.pow(n, p1div4);\n assertIsSquare(F, root, n);\n return root;\n}\n// Equivalent `q = 5 (mod 8)` square-root formula (Atkin-style), not the RFC Appendix I.2 CMOV\n// pseudocode verbatim.\nfunction sqrt5mod8(Fp, n) {\n const F = Fp;\n const p5div8 = (F.ORDER - _5n) / _8n;\n const n2 = F.mul(n, _2n);\n const v = F.pow(n2, p5div8);\n const nv = F.mul(n, v);\n const i = F.mul(F.mul(nv, _2n), v);\n const root = F.mul(nv, F.sub(i, F.ONE));\n assertIsSquare(F, root, n);\n return root;\n}\n// Based on RFC9380, Kong algorithm\n// prettier-ignore\nfunction sqrt9mod16(P) {\n const Fp_ = Field(P);\n const tn = tonelliShanks(P);\n const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n return ((Fp, n) => {\n const F = Fp;\n let tv1 = F.pow(n, c4); // 1. tv1 = x^c4\n let tv2 = F.mul(tv1, c1); // 2. tv2 = c1 * tv1\n const tv3 = F.mul(tv1, c2); // 3. tv3 = c2 * tv1\n const tv4 = F.mul(tv1, c3); // 4. tv4 = c3 * tv1\n const e1 = F.eql(F.sqr(tv2), n); // 5. e1 = (tv2^2) == x\n const e2 = F.eql(F.sqr(tv3), n); // 6. e2 = (tv3^2) == x\n tv1 = F.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n tv2 = F.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n const e3 = F.eql(F.sqr(tv2), n); // 9. e3 = (tv2^2) == x\n const root = F.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2\n assertIsSquare(F, root, n);\n return root;\n });\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * This implementation is variable-time: it searches data-dependently for the first non-residue `Z`\n * and for the smallest `i` in the main loop, unlike RFC 9380 Appendix I.4's constant-time shape.\n * 1. {@link https://eprint.iacr.org/2012/685.pdf | eprint 2012/685}, page 12\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * @param P - field order\n * @returns function that takes field Fp (created from P) and number n\n * @throws If the field is too small, non-prime, or the square root does not exist. {@link Error}\n * @example\n * Construct a square-root helper for primes that need Tonelli-Shanks.\n *\n * ```ts\n * import { Field, tonelliShanks } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const sqrt = tonelliShanks(17n)(Fp, 4n);\n * ```\n */\nexport function tonelliShanks(P) {\n // Initialization (precomputation).\n // Caching initialization could boost perf by 7%.\n if (P < _3n)\n throw new Error('sqrt is not defined for small field');\n aoddModulus(P, 'tonelliShanks');\n // Factor P - 1 = Q * 2^S, where Q is odd\n let Q = P - _1n;\n let S = 0;\n while (Q % _2n === _0n) {\n Q /= _2n;\n S++;\n }\n // Find the first quadratic non-residue Z >= 2\n let Z = _2n;\n const _Fp = Field(P);\n while (FpLegendre(_Fp, Z) === 1) {\n // Basic primality test for P. After x iterations, chance of\n // not finding quadratic non-residue is 2^x, so 2^1000.\n if (Z++ > 1000)\n throw new Error('Cannot find square root: probably non-prime P');\n }\n // Fast-path; usually done before Z, but we do \"primality test\".\n if (S === 1)\n return sqrt3mod4;\n // Slow-path\n // TODO: test on Fp2 and others\n let cc = _Fp.pow(Z, Q); // c = z^Q\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n const F = Fp;\n if (F.is0(n))\n return n;\n // Check if n is a quadratic residue using Legendre symbol\n if (FpLegendre(F, n) !== 1)\n throw new Error('Cannot find square root');\n // Initialize variables for the main loop\n let M = S;\n let c = F.mul(F.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp\n let t = F.pow(n, Q); // t = n^Q, first guess at the fudge factor\n let R = F.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root\n // Main loop\n // while t != 1\n while (!F.eql(t, F.ONE)) {\n // Unreachable over a genuine field (no zero divisors; n=0 already returned above). A zero t\n // means composite ORDER, where a fabricated root would be wrong: fail closed instead.\n if (F.is0(t))\n throw new Error('Cannot find square root: probably non-prime P');\n let i = 1;\n // Find the smallest i >= 1 such that t^(2^i) \u2261 1 (mod P)\n let t_tmp = F.sqr(t); // t^(2^1)\n while (!F.eql(t_tmp, F.ONE)) {\n i++;\n t_tmp = F.sqr(t_tmp); // t^(2^2)...\n if (i === M)\n throw new Error('Cannot find square root');\n }\n // Calculate the exponent for b: 2^(M - i - 1)\n const exponent = _1n << BigInt(M - i - 1); // bigint is important\n const b = F.pow(c, exponent); // b = 2^(M - i - 1)\n // Update variables\n M = i;\n c = F.sqr(b); // c = b^2\n t = F.mul(t, c); // t = (t * b^2)\n R = F.mul(R, b); // R = R*b\n }\n return R;\n };\n}\n/**\n * Square root for a finite field. Will try optimized versions first:\n *\n * 1. P \u2261 3 (mod 4)\n * 2. P \u2261 5 (mod 8)\n * 3. P \u2261 9 (mod 16)\n * 4. Tonelli-Shanks algorithm\n *\n * Different algorithms can give different roots, it is up to user to decide which one they want.\n * For example there is FpSqrtOdd/FpSqrtEven to choose a root by oddness\n * (used for hash-to-curve).\n * @param P - Field order.\n * @returns Square-root helper. The generic fallback inherits Tonelli-Shanks' variable-time\n * behavior and this selector assumes prime-field-style integer moduli.\n * @throws If the field is unsupported or the square root does not exist. {@link Error}\n * @example\n * Choose the square-root helper appropriate for one field modulus.\n *\n * ```ts\n * import { Field, FpSqrt } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const sqrt = FpSqrt(17n)(Fp, 4n);\n * ```\n */\nexport function FpSqrt(P) {\n aoddModulus(P, 'Fp.sqrt');\n // P \u2261 3 (mod 4) => \u221An = n^((P+1)/4)\n if (P % _4n === _3n)\n return sqrt3mod4;\n // P \u2261 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf\n if (P % _8n === _5n)\n return sqrt5mod8;\n // P \u2261 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4)\n if (P % _16n === _9n)\n return sqrt9mod16(P);\n // Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n/**\n * @param num - Value to inspect.\n * @param modulo - Field modulus.\n * @returns `true` when the least-significant little-endian bit is set.\n * @throws If the modulus is invalid for `mod(...)`. {@link Error}\n * @example\n * Inspect the low bit used by little-endian sign conventions.\n *\n * ```ts\n * isNegativeLE(3n, 11n);\n * ```\n */\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\n// Arithmetic-only subset checked by validateField(). This is intentionally not the full runtime\n// IField contract: helpers like `isValidNot0`, `invertBatch`, `toBytes`, `fromBytes`, `cmov`, and\n// field-specific extras like `isOdd` are left to the callers that actually need them.\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\n/**\n * @param field - Field implementation.\n * @returns Validated field. This only checks the arithmetic subset needed by generic helpers; it\n * does not guarantee full runtime-method coverage for serialization, batching, `cmov`, or\n * field-specific extras beyond positive `BYTES` / `BITS`.\n * @throws If the field shape or numeric metadata are invalid. {@link Error}\n * @example\n * Check that a field implementation exposes the operations curve code expects.\n *\n * ```ts\n * import { Field, validateField } from '@noble/curves/abstract/modular.js';\n * const Fp = validateField(Field(17n));\n * ```\n */\nexport function validateField(field) {\n aobject(field, 'field');\n if (typeof field.ORDER !== 'bigint')\n throw new TypeError('param \"ORDER\" is invalid: expected bigint, got ' + typeof field.ORDER);\n // Runtime field implementations must expose real integer byte/bit sizes; fractional / NaN /\n // infinite metadata breaks encoders and caches.\n asafenumber(field.BYTES, 'BYTES');\n asafenumber(field.BITS, 'BITS');\n for (const name of FIELD_FIELDS)\n afunction(field[name], 'field.' + name);\n // Runtime field implementations must expose positive byte/bit sizes; zero leaks through the\n // numeric shape checks above but still breaks encoding helpers and cached-length assumptions.\n if (field.BYTES < 1 || field.BITS < 1)\n throw new Error('invalid field: expected BYTES/BITS > 0');\n if (field.ORDER <= _1n)\n throw new Error('invalid field: expected ORDER > 1, got ' + field.ORDER);\n return field;\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @param Fp - Field implementation.\n * @param num - Base value.\n * @param power - Exponent value.\n * @returns Powered field element.\n * @throws If the exponent is negative. {@link Error}\n * @example\n * Raise one field element to a public exponent.\n *\n * ```ts\n * import { Field, FpPow } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const x = FpPow(Fp, 3n, 5n);\n * ```\n */\nexport function FpPow(Fp, num, power) {\n validateField(Fp);\n const F = Fp;\n // Non-bigint exponents (e.g. an accidental field element) coerce every comparison below to\n // false and would silently return ONE.\n if (typeof power !== 'bigint')\n throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);\n if (power < _0n)\n throw new Error('invalid exponent, negatives unsupported');\n if (power === _0n)\n return F.ONE;\n if (power === _1n)\n return num;\n if (power < POW_WINDOWED_MIN) {\n // Square-and-multiply: cheaper than the windowed path for short exponents (e.g. poseidon\n // sbox x^5), which would waste the 14-multiplication table build.\n let p = F.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = F.mul(p, d);\n d = F.sqr(d);\n power >>= _1n;\n }\n return p;\n }\n // Fixed 4-bit windows, MSB-first \u2014 same shape as pow() above, over generic field ops.\n // Speeds up dense long exponents (extension-field sqrt / Legendre, e.g. Fp2 decompression).\n const digits = [];\n while (power > _0n) {\n digits.push(Number(power & _15n));\n power >>= _4n;\n }\n const table = new Array(16);\n table[0] = F.ONE;\n table[1] = num;\n for (let i = 2; i < 16; i++)\n table[i] = F.mul(table[i - 1], num);\n let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0\n for (let w = digits.length - 2; w >= 0; w--) {\n p = F.sqr(F.sqr(F.sqr(F.sqr(p))));\n const digit = digits[w];\n if (digit !== 0)\n p = F.mul(p, table[digit]);\n }\n return p;\n}\nexport function FpInvertBatch(Fp, nums, passZero = false) {\n validateField(Fp);\n aarray(nums, 'nums');\n abool(passZero, 'passZero');\n const F = Fp;\n const inverted = new Array(nums.length).fill(passZero ? F.ZERO : undefined);\n // Walk from first to last, multiply them by each other MOD p\n const multipliedAcc = nums.reduce((acc, num, i) => {\n if (F.is0(num))\n return acc;\n inverted[i] = acc;\n return F.mul(acc, num);\n }, F.ONE);\n // Invert last element\n const invertedAcc = F.inv(multipliedAcc);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (F.is0(num))\n return acc;\n // Non-zero `num` means the forward pass already stored a defined prefix product at index i.\n inverted[i] = F.mul(acc, inverted[i]);\n return F.mul(acc, num);\n }, invertedAcc);\n return inverted;\n}\n/**\n * @param Fp - Field implementation.\n * @param lhs - Dividend value.\n * @param rhs - Divisor value.\n * @returns Division result.\n * @throws If the divisor is non-invertible. {@link Error}\n * @example\n * Divide one field element by another.\n *\n * ```ts\n * import { Field, FpDiv } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const x = FpDiv(Fp, 6n, 3n);\n * ```\n */\nexport function FpDiv(Fp, lhs, rhs) {\n validateField(Fp);\n const F = Fp;\n return F.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, F.ORDER) : F.inv(rhs));\n}\n/**\n * Legendre symbol.\n * Legendre constant is used to calculate Legendre symbol (a | p)\n * which denotes the value of a^((p-1)/2) (mod p).\n *\n * * (a | p) \u2261 1 if a is a square (mod p), quadratic residue\n * * (a | p) \u2261 -1 if a is not a square (mod p), quadratic non residue\n * * (a | p) \u2261 0 if a \u2261 0 (mod p)\n * @param Fp - Field implementation.\n * @param n - Value to inspect.\n * @returns Legendre symbol.\n * @throws If the powered value does not match a valid Legendre symbol. {@link Error}\n * @example\n * Compute the Legendre symbol of one field element.\n *\n * ```ts\n * import { Field, FpLegendre } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const symbol = FpLegendre(Fp, 4n);\n * ```\n */\nexport function FpLegendre(Fp, n) {\n validateField(Fp);\n const F = Fp;\n aoddModulus(F.ORDER, 'FpLegendre');\n // We can use 3rd argument as optional cache of this value\n // but seems unneeded for now. The operation is very fast.\n const p1mod2 = (F.ORDER - _1n) / _2n;\n const powered = F.pow(n, p1mod2);\n const yes = F.eql(powered, F.ONE);\n const zero = F.eql(powered, F.ZERO);\n const no = F.eql(powered, F.neg(F.ONE));\n if (!yes && !zero && !no)\n throw new Error('invalid Legendre symbol result');\n return yes ? 1 : zero ? 0 : -1;\n}\n/**\n * @param Fp - Field implementation.\n * @param n - Value to inspect.\n * @returns `true` when `Fp.sqrt(n)` exists. This includes `0`, even though strict \"quadratic\n * residue\" terminology often reserves that name for the non-zero square class.\n * @throws If the field returns an invalid Legendre symbol value. {@link Error}\n * @example\n * Check whether one field element has a square root in the field.\n *\n * ```ts\n * import { Field, FpIsSquare } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const isSquare = FpIsSquare(Fp, 4n);\n * ```\n */\nexport function FpIsSquare(Fp, n) {\n const l = FpLegendre(Fp, n);\n // Zero is a square too: 0 = 0^2, and Fp.sqrt(0) already returns 0.\n return l !== -1;\n}\n/**\n * @param n - Curve order. Callers are expected to pass a positive order.\n * @param nBitLength - Optional cached bit length. Callers are expected to pass a positive cached\n * value when overriding the derived bit length.\n * @returns Byte and bit lengths.\n * @throws If the order or cached bit length is invalid. {@link Error}\n * @example\n * Measure the encoding sizes needed for one modulus.\n *\n * ```ts\n * nLength(255n);\n * ```\n */\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n if (nBitLength !== undefined)\n anumber(nBitLength);\n if (n <= _0n)\n throw new Error('invalid n length: expected positive n, got ' + n);\n if (nBitLength !== undefined && nBitLength < 1)\n throw new Error('invalid n length: expected positive bit length, got ' + nBitLength);\n const bits = bitLen(n);\n // Cached bit lengths smaller than ORDER would truncate serialized scalars/elements and poison\n // any math that relies on the derived field metadata.\n if (nBitLength !== undefined && nBitLength < bits)\n throw new Error(`invalid n length: expected nBitLength (${nBitLength}) >= bitLen(n) (${bits})`);\n const _nBitLength = nBitLength !== undefined ? nBitLength : bits;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n// Keep the lazy sqrt cache off-instance so Field(...) can return a frozen object. Otherwise the\n// cached helper write would keep the field surface externally mutable.\nconst FIELD_SQRT = new WeakMap();\nclass _Field {\n ORDER;\n BITS;\n BYTES;\n isLE;\n ZERO = _0n;\n ONE = _1n;\n _lengths;\n _mod;\n constructor(ORDER, opts = {}) {\n // ORDER <= 1 is degenerate: ONE would not be a valid field element and helpers like pow/inv\n // would stop modeling field arithmetic.\n if (ORDER <= _1n)\n throw new Error('invalid field: expected ORDER > 1, got ' + ORDER);\n let _nbitLength = undefined;\n this.isLE = false;\n if (opts != null && typeof opts === 'object') {\n // Cached bit lengths are trusted here and should already be positive / consistent with ORDER.\n if (typeof opts.BITS === 'number')\n _nbitLength = opts.BITS;\n if (typeof opts.sqrt === 'function')\n // `_Field.prototype` is frozen below, so custom sqrt hooks must become own properties\n // explicitly instead of relying on writable prototype shadowing via assignment.\n Object.defineProperty(this, 'sqrt', { value: opts.sqrt, enumerable: true });\n if (typeof opts.isLE === 'boolean')\n this.isLE = opts.isLE;\n if (opts.allowedLengths)\n this._lengths = Object.freeze(opts.allowedLengths.slice());\n if (typeof opts.modFromBytes === 'boolean')\n this._mod = opts.modFromBytes;\n }\n const { nBitLength, nByteLength } = nLength(ORDER, _nbitLength);\n if (nByteLength > 2048)\n throw new Error('invalid field: expected ORDER of <= 2048 bytes');\n this.ORDER = ORDER;\n this.BITS = nBitLength;\n this.BYTES = nByteLength;\n Object.freeze(this);\n }\n create(num) {\n return mod(num, this.ORDER);\n }\n isValid(num) {\n if (typeof num !== 'bigint')\n throw new TypeError('invalid field element: expected bigint, got ' + typeof num);\n return _0n <= num && num < this.ORDER; // 0 is valid element, but it's not invertible\n }\n is0(num) {\n return num === _0n;\n }\n // is valid and invertible\n isValidNot0(num) {\n return !this.is0(num) && this.isValid(num);\n }\n isOdd(num) {\n return (num & _1n) === _1n;\n }\n neg(num) {\n return mod(-num, this.ORDER);\n }\n eql(lhs, rhs) {\n return lhs === rhs;\n }\n sqr(num) {\n return mod(num * num, this.ORDER);\n }\n add(lhs, rhs) {\n return mod(lhs + rhs, this.ORDER);\n }\n sub(lhs, rhs) {\n return mod(lhs - rhs, this.ORDER);\n }\n mul(lhs, rhs) {\n return mod(lhs * rhs, this.ORDER);\n }\n pow(num, power) {\n return pow(num, power, this.ORDER);\n }\n div(lhs, rhs) {\n return mod(lhs * invert(rhs, this.ORDER), this.ORDER);\n }\n // Same as above, but doesn't normalize\n sqrN(num) {\n return num * num;\n }\n addN(lhs, rhs) {\n return lhs + rhs;\n }\n subN(lhs, rhs) {\n return lhs - rhs;\n }\n mulN(lhs, rhs) {\n return lhs * rhs;\n }\n inv(num) {\n return invert(num, this.ORDER);\n }\n sqrt(num) {\n // Caching sqrt helpers speeds up sqrt9mod16 by 5x and Tonelli-Shanks by about 10% without keeping\n // the field instance itself mutable.\n let sqrt = FIELD_SQRT.get(this);\n if (!sqrt)\n FIELD_SQRT.set(this, (sqrt = FpSqrt(this.ORDER)));\n return sqrt(this, num);\n }\n toBytes(num) {\n // Serialize fixed-width limbs without re-validating the field range. Callers that need a\n // canonical encoding must pass a valid element; some protocols intentionally serialize raw\n // residues here and reduce or validate them elsewhere.\n return this.isLE ? numberToBytesLE(num, this.BYTES) : numberToBytesBE(num, this.BYTES);\n }\n fromBytes(bytes, skipValidation = false) {\n abytes(bytes);\n const { _lengths: allowedLengths, BYTES, isLE, ORDER, _mod: modFromBytes } = this;\n if (allowedLengths) {\n // `allowedLengths` must list real positive byte lengths; otherwise empty input would get\n // padded into zero and silently decode as a field element.\n if (bytes.length < 1 || !allowedLengths.includes(bytes.length) || bytes.length > BYTES) {\n throw new Error('Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length);\n }\n const padded = new Uint8Array(BYTES);\n // isLE add 0 to right, !isLE to the left.\n padded.set(bytes, isLE ? 0 : padded.length - bytes.length);\n bytes = padded;\n }\n if (bytes.length !== BYTES)\n throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length);\n let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n if (modFromBytes)\n scalar = mod(scalar, ORDER);\n if (!skipValidation)\n if (!this.isValid(scalar))\n throw new Error('invalid field element: outside of range 0..ORDER');\n // Range validation is optional here because some protocols intentionally decode raw residues\n // and reduce or validate them elsewhere.\n return scalar;\n }\n // TODO: we don't need it here, move out to separate fn\n invertBatch(lst) {\n // `passZero` keeps the `bigint[]` contract honest: zero inputs map to `0` instead of leaking\n // `undefined` into a `bigint[]`. Callers that must distinguish non-invertible inputs should use\n // `FpInvertBatch` directly, whose default omits `passZero` and returns `(bigint | undefined)[]`.\n return FpInvertBatch(this, lst, true);\n }\n // We can't move this out because Fp6, Fp12 implement it\n // and it's unclear what to return in there.\n cmov(a, b, condition) {\n // Field elements have `isValid(...)`; the CMOV branch bit is a direct runtime input, so reject\n // non-boolean selectors here instead of letting JS truthiness silently change arithmetic.\n abool(condition, 'condition');\n return condition ? b : a;\n }\n}\n/**\n * Creates a finite field. Major performance optimizations:\n * * 1. Denormalized operations like mulN instead of mul.\n * * 2. Identical object shape: never add or remove keys.\n * * 3. Frozen stable object shape; the lazy sqrt cache lives in a module-level `WeakMap`.\n * Fragile: always run a benchmark on a change.\n * Security note: operations and low-level serializers like `toBytes` don't check `isValid` for\n * all elements for performance and protocol-flexibility reasons; callers are responsible for\n * supplying valid elements when they need canonical field behavior.\n * This is low-level code, please make sure you know what you're doing.\n *\n * Note about field properties:\n * * CHARACTERISTIC p = prime number, number of elements in main subgroup.\n * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`.\n *\n * @param ORDER - field order, probably prime, or could be composite\n * @param opts - Field options such as bit length or endianness. See {@link FieldOpts}.\n * @returns Frozen field instance with a stable object shape. This wrapper forwards `opts` straight\n * into `_Field`, so it inherits `_Field`'s assumptions about cached sizes and `allowedLengths`.\n * @example\n * Construct one prime field with optional overrides.\n *\n * ```ts\n * Field(11n);\n * ```\n */\nexport function Field(ORDER, opts = {}) {\n // Freeze the shared method surface before any instance is reachable; otherwise callers can\n // poison every Field instance by monkey-patching `_Field.prototype` even if each instance is\n // frozen. Freezing here instead of module scope keeps `_Field` tree-shakeable for importers\n // that never construct a field; the call is idempotent and cheap.\n Object.freeze(_Field.prototype);\n return new _Field(ORDER, opts);\n}\n/**\n * @param Fp - Field implementation.\n * @param elm - Value to square-root.\n * @returns Odd square root when two roots exist. The special case `elm = 0` still returns `0`,\n * which is the only square root but is not odd.\n * @throws If the field lacks oddness checks or the square root does not exist. {@link Error}\n * @example\n * Select the odd square root when two roots exist.\n *\n * ```ts\n * import { Field, FpSqrtOdd } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const root = FpSqrtOdd(Fp, 4n);\n * ```\n */\nexport function FpSqrtOdd(Fp, elm) {\n validateField(Fp);\n const F = Fp;\n if (!F.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = F.sqrt(elm);\n return F.isOdd(root) ? root : F.neg(root);\n}\n/**\n * @param Fp - Field implementation.\n * @param elm - Value to square-root.\n * @returns Even square root.\n * @throws If the field lacks oddness checks or the square root does not exist. {@link Error}\n * @example\n * Select the even square root when two roots exist.\n *\n * ```ts\n * import { Field, FpSqrtEven } from '@noble/curves/abstract/modular.js';\n * const Fp = Field(17n);\n * const root = FpSqrtEven(Fp, 4n);\n * ```\n */\nexport function FpSqrtEven(Fp, elm) {\n validateField(Fp);\n const F = Fp;\n if (!F.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = F.sqrt(elm);\n return F.isOdd(root) ? F.neg(root) : root;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder - number of field elements, usually CURVE.n. Callers are expected to pass an\n * order greater than 1.\n * @returns byte length of field\n * @throws If the field order is not a bigint. {@link Error}\n * @example\n * Read the fixed-width byte length of one field.\n *\n * ```ts\n * getFieldBytesLength(255n);\n * ```\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n // Valid field elements are in 0..ORDER-1, so ORDER <= 1 would make the encoded range degenerate.\n if (fieldOrder <= _1n)\n throw new Error('field order must be greater than 1');\n // Valid field elements are < ORDER, so the maximal encoded element is ORDER - 1.\n const bitLength = bitLen(fieldOrder - _1n);\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * This is the reduction / modulo-bias lower bound; higher-level helpers may still impose a larger\n * absolute floor for policy reasons.\n * @param fieldOrder - number of field elements greater than 1, usually CURVE.n.\n * @returns byte length of target hash\n * @throws If the field order is invalid. {@link Error}\n * @example\n * Compute the minimum hash length needed for field reduction.\n *\n * ```ts\n * getMinHashLength(255n);\n * ```\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key. The implementation also keeps a hard\n * 16-byte minimum even when `getMinHashLength(...)` is smaller, so toy-small inputs do not look\n * accidentally acceptable for real scalar derivation.\n * See {@link https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ | Kudelski's modulo-bias guide},\n * {@link https://csrc.nist.gov/publications/detail/fips/186/5/final | FIPS 186-5 appendix A.2}, and\n * {@link https://www.rfc-editor.org/rfc/rfc9380#section-5 | RFC 9380 section 5}. Unlike RFC 9380\n * `hash_to_field`, this helper intentionally maps into the non-zero private-scalar range `1..n-1`.\n * @param key - Uniform input bytes.\n * @param fieldOrder - Size of subgroup.\n * @param isLE - interpret hash bytes as LE num\n * @returns valid private scalar\n * @throws If the hash length or field order is invalid for scalar reduction. {@link Error}\n * @example\n * Map hash output into a private scalar range.\n *\n * ```ts\n * mapHashToField(new Uint8Array(48).fill(1), 255n);\n * ```\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n abytes(key);\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = Math.max(getMinHashLength(fieldOrder), 16);\n // No toy-small inputs: the helper is for real scalar derivation, not tiny test curves. No huge\n // inputs: easier to reason about JS timing / allocation behavior.\n if (len < minLen || len > 1024)\n throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len);\n const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);\n // Map into the non-zero scalar range [1, fieldOrder-1]: reduce mod (fieldOrder-1) to land in\n // [0, fieldOrder-2], then add 1. This shifts the range off zero; it is NOT equal to\n // `mod(num, fieldOrder)` (which spans [0, fieldOrder-1] and can be 0). A residual modulo bias\n // remains but is negligible (~2^-(nBits/2), e.g. ~2^-128 for a 256-bit order) because `key` is\n // required to be at least `getMinHashLength(fieldOrder)` (~1.5x field size) bytes of input.\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n", "/**\n * Methods for elliptic curve multiplication by scalars.\n * Contains wNAF-based ScalarMultiplier, pippenger.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { aarray, abool, afunction, aobject, bitLen, bitMask, bytesToNumberBE, inRange, isBytes, isPosBig, validateObject, } from \"../utils.js\";\nimport { Field, FpInvertBatch, validateField } from \"./modular.js\";\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _4n = /* @__PURE__ */ BigInt(4);\nconst BLIND_BYTES = 16;\nconst BLIND_BITS = 128;\n// Fixed-window width for the constant-time multiply of un-precomputed points (W===1).\n// A flat 2^FW_WINDOW table has a small, scalar-independent build cost that amortizes over a single\n// multiply, unlike the larger per-point wNAF tables that only pay off when cached.\nconst FW_WINDOW = 5;\n// Precompute tables are capped at ~2 GiB of estimated heap. Rejecting larger windows up front\n// turns a typo'd window size into an immediate error instead of a multi-GB allocation (or an\n// effective hang) when the lazy table is built on first multiply.\nconst TABLE_BYTES_MAX = /* @__PURE__ */ (() => 2 ** 31)();\n/**\n * Validates the static surface of a point constructor.\n * This is only a cheap sanity check for the constructor hooks and fields consumed by generic\n * factories; it does not certify `BASE`/`ZERO` semantics or prove the curve implementation itself.\n * @param Point - Runtime point constructor.\n * @throws On missing constructor hooks or malformed field metadata. {@link TypeError}\n * @example\n * Check that one point constructor exposes the static hooks generic helpers need.\n *\n * ```ts\n * import { ed25519 } from '@noble/curves/ed25519.js';\n * import { validatePointCons } from '@noble/curves/abstract/curve.js';\n * validatePointCons(ed25519.Point);\n * ```\n */\nexport function validatePointCons(Point) {\n const pc = Point;\n if (typeof pc !== 'function')\n throw new TypeError('\"Point\" expected constructor, got type=' + typeof Point);\n afunction(pc.fromAffine, 'Point.fromAffine');\n afunction(pc.fromBytes, 'Point.fromBytes');\n afunction(pc.fromHex, 'Point.fromHex');\n // Generic helpers (ScalarMultiplier, normalizeZ, MSM) dereference BASE / ZERO:\n // fail here with a typed error instead of an `undefined` access later.\n aobject(pc.BASE, 'Point.BASE');\n aobject(pc.ZERO, 'Point.ZERO');\n validateField(pc.Fp);\n validateField(pc.Fn);\n}\n/**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n * Input points are left unchanged; the normalized points are returned as fresh instances.\n * @param c - Point constructor.\n * @param points - Projective points.\n * @returns Fresh projective points reconstructed from normalized affine coordinates.\n * @example\n * Batch-normalize projective points with a single shared inversion.\n *\n * ```ts\n * import { normalizeZ } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const points = normalizeZ(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()]);\n * ```\n */\nexport function normalizeZ(c, points) {\n // Match MSM helpers: reject malformed public inputs before reading projective internals.\n validatePointCons(c);\n validateMSMPoints(points, c);\n // Identity points (Z=0) rely on an implicit contract: FpInvertBatch without `passZero`\n // yields `undefined` for zero inputs, and `toAffine(undefined)` falls back to its internal\n // is0 handling instead of using the batch inverse.\n const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z));\n return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i])));\n}\nfunction validateW(W, bits, min = 1) {\n if (!Number.isSafeInteger(W) || W < min || W > bits)\n throw new Error('invalid window size, expected [' + min + '..' + bits + '], got W=' + W);\n}\n// Rough per-point heap estimate for the {@link TABLE_BYTES_MAX} cap: up to 4 projective/extended\n// coordinates of Fp.BYTES each, plus bigint/object overhead. Callers pass the point count of the\n// largest table the checked parameters can produce.\nfunction validateTableBytes(numPoints, fpBytes) {\n const bytes = numPoints * (4 * fpBytes + 128);\n if (bytes > TABLE_BYTES_MAX)\n throw new Error('invalid window size: table would need ~' +\n Math.ceil(bytes / 2 ** 20) +\n ' MiB, max ' +\n TABLE_BYTES_MAX / 2 ** 20 +\n ' MiB');\n}\n/**\n * Probes an RNG once, at construction time: returns `undefined` when it is unavailable \u2014\n * throws or returns malformed bytes \u2014 so callers can downgrade to their unblinded /\n * deterministic constant-time fallback. Blinding is defense-in-depth (DPA/template\n * hardening), not a correctness or key-secrecy requirement, so availability-based\n * downgrade is acceptable.\n *\n * The downgrade decision is deliberately static. After a successful probe the RNG becomes\n * part of the trusted contract: later misbehavior must fail closed in per-call validation\n * (throw), never downgrade \u2014 a dynamic fallback would let a tampered RNG silently strip\n * blinding on demand. A probe can only ever classify broken environments, not adversarial\n * RNGs: a stateful RNG can always behave while probed and misbehave later.\n * @param randomBytes - RNG to probe, or `undefined` when the environment provides none.\n * @param length - Byte length requested from the probe call.\n * @returns The RNG when the probe produced `length` valid bytes; `undefined` otherwise.\n * @example\n * Probe an RNG once before enabling scalar blinding.\n *\n * ```ts\n * import { probeRandomBytes } from '@noble/curves/abstract/curve.js';\n * import { randomBytes } from '@noble/hashes/utils.js';\n * const rng = probeRandomBytes(randomBytes, 16);\n * ```\n */\nexport function probeRandomBytes(randomBytes, length) {\n if (randomBytes === undefined)\n return undefined;\n afunction(randomBytes, 'randomBytes');\n try {\n const probe = randomBytes(length);\n if (!isBytes(probe) || probe.length !== length)\n return undefined;\n }\n catch {\n return undefined;\n }\n return randomBytes;\n}\nfunction validateMSMPoints(points, c) {\n aarray(points, 'points');\n points.forEach((p, i) => {\n if (!(p instanceof c))\n throw new Error('invalid point at index ' + i);\n });\n}\n// Default bound is field membership (0 <= s < field.ORDER); a `maxScalar` override widens it\n// to 0 <= s < maxScalar for callers that accept oversized scalars.\nfunction validateMSMScalars(scalars, field, maxScalar) {\n if (!Array.isArray(scalars))\n throw new Error('array of scalars expected');\n scalars.forEach((s, i) => {\n const ok = maxScalar === undefined ? field.isValid(s) : isPosBig(s) && s < maxScalar;\n if (!ok)\n throw new Error('invalid scalar at index ' + i);\n });\n}\nconst pointWindowSizes = new WeakMap();\nfunction getWindowSize(P) {\n // `1` is the uncached sentinel: use the non-precomputed (wNAF / fixed-window) path.\n return pointWindowSizes.get(P) || 1;\n}\n/** Table of odd multiples [1P, 3P, ..., (2\u22C5size\u22121)P]; width-W wNAF uses size = 2^(W\u22122). */\nfunction oddMultiples(p, size) {\n const dbl = p.double();\n const t = [p];\n for (let j = 1; j < size; j++)\n t.push(t[j - 1].add(dbl));\n return t;\n}\n/**\n * Width-W wNAF signed-digit recoding (W >= 2), LSB-first: digits are 0 or odd with\n * |digit| < 2^(W\u22121); nonzero density ~1/(W+1) (a nonzero digit is followed by W\u22121 zeros).\n */\nfunction wnafDigits(n, W) {\n const size = 2 ** W;\n const half = size / 2;\n const mask = BigInt(size - 1);\n const d = [];\n while (n > _0n) {\n let w = 0;\n if (n & _1n) {\n w = Number(n & mask); // n mod 2^W, odd\n if (w >= half)\n w -= size; // signed residue\n n -= BigInt(w); // n - w \u2261 0 mod 2^W: next W\u22121 digits are zero\n }\n d.push(w);\n n >>= _1n;\n }\n return d;\n}\n/**\n * Fixed-position signed-window recoding for precomputed wNAF: `n = \u03A3 digits[w]\u22C52^(w\u22C5W)` with\n * digits in `[\u22122^(W\u22121)+1, 2^(W\u22121)]`. Digit count is fixed by `windows` (callers reserve one\n * extra window for the final carry), so recoding length does not depend on the scalar.\n */\nfunction signedWindowDigits(n, W, windows) {\n const size = 2 ** W;\n const half = size / 2;\n const mask = BigInt(size - 1);\n const shiftBy = BigInt(W);\n const d = [];\n for (let w = 0; w < windows; w++) {\n let v = Number(n & mask);\n n >>= shiftBy;\n if (v > half) {\n v -= size; // negative digit, carry into the next window\n n += _1n;\n }\n d.push(v);\n }\n // Internal invariant: leftover bits mean the window count did not cover the scalar.\n if (n !== _0n)\n throw new Error('invalid wnaf');\n return d;\n}\n/**\n * Shared vartime walk over per-scalar wNAF digit streams: one doubling of a single shared\n * accumulator per bit position of the longest recoding, one signed table addition per\n * nonzero digit. `tables[i]` must hold the odd multiples of the i-th point.\n */\nfunction wnafWalk(zero, tables, digits) {\n let max = 0;\n for (const d of digits)\n max = Math.max(max, d.length);\n let acc = zero;\n for (let bit = max - 1; bit >= 0; bit--) {\n if (bit !== max - 1)\n acc = acc.double();\n for (let i = 0; i < digits.length; i++) {\n const w = digits[i][bit]; // reads past shorter recodings yield undefined, skipped below\n if (w) {\n const item = tables[i][(Math.abs(w) - 1) >> 1];\n acc = acc.add(w < 0 ? item.negate() : item);\n }\n }\n }\n return acc;\n}\n/**\n * Elliptic curve multiplication of Point by scalar.\n * Routes between cached-table, fixed-window, and one-shot wNAF paths; entry points validate\n * their own scalars (`mulCT`/`mulCTBlinded`: `1 <= s < Fn.ORDER`; `mulUnsafe`: up to the\n * `Fn.ORDER^4` DoS cap via {@link mulAddUnsafe}).\n * Table generation is expensive and happens on first call of `multiply()`\n * (or eagerly via `precompute(W, false)`). By default, `BASE` point is precomputed.\n *\n * Cached algorithm is signed fixed-window wNAF:\n * - table stores, for every window w, the multiples `[1..2^(W\u22121)]\u22C52^(w\u22C5W)\u22C5P` \u2014 all doublings\n * are baked in, so a multiplication is exactly one table addition per window\n * - window count is fixed (`ceil(bits/W) + 1`), so the point-operation count is scalar-independent\n * (basis of the constant-time path)\n * - for a 256-bit curve and W=6: 44\u22C532 = 1408 table points, 44 additions per multiply\n * - secret scalars are additionally blinded (see {@link ScalarMultiplier.mulCTBlinded}), which\n * widens tables by 128 bits\n * @param Point - Point constructor.\n * @param randomBytes - RNG used for scalar blinding; required by the blinded secret path.\n * @example\n * Elliptic curve multiplication of Point by scalar.\n *\n * ```ts\n * import { ScalarMultiplier } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const mul = new ScalarMultiplier(p256.Point);\n * ```\n */\nexport class ScalarMultiplier {\n Point;\n BASE;\n ZERO;\n randomBytes;\n wnafPrecomputes = new WeakMap();\n baseCanBeBlinded;\n bits;\n // Parametrized with a given Point class (not individual point)\n constructor(Point, randomBytes) {\n validatePointCons(Point);\n // Probe the RNG once (see {@link probeRandomBytes}): in environments without working\n // randomness (e.g. no WebCrypto), shouldBlind() then routes secret multiplication to the\n // unblinded constant-time path instead of throwing on every multiply(). The shape of\n // returned bytes is still validated on every blinded call, where breakage fails closed.\n this.randomBytes = probeRandomBytes(randomBytes, BLIND_BYTES);\n this.Point = Point;\n this.BASE = Point.BASE;\n this.ZERO = Point.ZERO;\n this.bits = Point.Fn.BITS;\n }\n /**\n * Creates a signed fixed-window wNAF precomputation table: for every window w, the\n * multiples `[1..2^(W\u22121)]\u22C52^(w\u22C5W)\u22C5P`, flattened. All doublings are baked into the table,\n * so cached multiplication is additions-only. `windows = ceil(bits/W) + 1`: the extra\n * window absorbs the final carry of signed-digit recoding.\n * For a 256-bit curve and W=6, the table is 44\u22C532 = 1408 points.\n * @param point - Point instance\n * @param W - window size\n * @param bits - scalar bitlength the table must cover\n */\n buildWnafTable(point, W, bits) {\n // W needs no re-validation: its only source is setWindowSize(), which enforces\n // 1 <= W <= Fn.BITS <= bits (the blinded path only ever widens bits) and caps the\n // resulting table at ~2 GiB (sized against the wider blinded layout).\n const windows = Math.ceil(bits / W) + 1;\n const half = 2 ** (W - 1);\n const comp = [];\n let base = point;\n for (let w = 0; w < windows; w++) {\n let acc = base;\n for (let i = 0; i < half; i++) {\n comp.push(acc);\n acc = acc.add(base);\n }\n base = comp[comp.length - 1].double(); // 2\u22C5(2^(W\u22121)\u22C5base) = next window's base\n }\n return { W, bits, windows, comp };\n }\n /**\n * Implements ec multiplication using precomputed signed fixed-window wNAF tables.\n * Constant-time: fixed window count with one table addition per window \u2014 zero digits feed\n * the fake accumulator \u2014 and no doublings; the lookup scans the whole window slice.\n * Scalar bounds are validated by the public entry points ({@link ScalarMultiplier.mulCT},\n * {@link ScalarMultiplier.mulCTBlinded}, {@link ScalarMultiplier.mulUnsafe});\n * signedWindowDigits throws if `n` exceeds the table.\n * @returns real and fake (for const-time) points\n */\n wnafCachedCT(precomputes, n) {\n const { W, windows, comp } = precomputes;\n const half = 2 ** (W - 1);\n const digits = signedWindowDigits(n, W, windows);\n let p = this.ZERO;\n let f = this.BASE;\n for (let w = 0; w < windows; w++) {\n const digit = digits[w];\n const start = w * half;\n // Data-oblivious select: touch every entry of the window before the digit branch.\n const idx = Math.abs(digit) - 1; // -1 for zero digits: matches nothing, `sel` unused\n let sel = comp[start];\n for (let i = 1; i < half; i++)\n sel = i === idx ? comp[start + i] : sel;\n const neg = sel.negate(); // compute both signs; the digit only picks one\n if (digit === 0)\n f = f.add(comp[start]);\n else\n p = p.add(digit < 0 ? neg : sel);\n }\n return { p, f };\n }\n // Cache key is point identity plus (W, bits); at most two entries exist per point (public-width\n // `Fn.BITS` and blinded `Fn.BITS + BLIND_BITS`). Callers must not reuse the same point with\n // incompatible `transform(...)` layouts and expect a separate cache entry.\n getWnafPrecomputes(W, point, bits, transform) {\n let entries = this.wnafPrecomputes.get(point);\n let comp = entries?.find((entry) => entry.W === W && entry.bits === bits);\n if (!comp) {\n comp = this.buildWnafTable(point, W, bits);\n if (typeof transform === 'function')\n comp = { ...comp, comp: transform(comp.comp) };\n if (!entries) {\n entries = [];\n this.wnafPrecomputes.set(point, entries);\n }\n entries.push(comp);\n }\n return comp;\n }\n assertPoint(point) {\n if (!(point instanceof this.Point))\n throw new TypeError('\"point\" expected Point instance, got type=' + typeof point);\n }\n // Shared prologue of the constant-time entry points. Rejects scalar 0: in key/signature-style\n // callers a zero scalar means broken upstream plumbing, and concrete Points already reject it.\n // Uses inRange instead of Fn.isValidNot0: validateField() only certifies the arithmetic subset.\n validateMulInput(point, scalar) {\n this.assertPoint(point);\n if (!inRange(scalar, _1n, this.Point.Fn.ORDER))\n throw new Error('invalid scalar');\n }\n // Constant-time dispatch shared by mulCT / mulCTBlinded. Un-precomputed points (W===1, e.g.\n // ECDH peer keys) skip building a throwaway cached table in favor of a small fixed-window\n // multiply. `n` must be < 2^bits.\n runCT(point, n, bits, transform) {\n const W = getWindowSize(point);\n if (W === 1)\n return this.fixedWindowCT(point, n, bits);\n return this.wnafCachedCT(this.getWnafPrecomputes(W, point, bits, transform), n);\n }\n mulCT(point, scalar, transform) {\n this.validateMulInput(point, scalar);\n return this.runCT(point, scalar, this.bits, transform);\n }\n mulCTBlinded(point, scalar, transform) {\n this.validateMulInput(point, scalar);\n // Blinding computes n = scalar + blind*Fn.ORDER, then n*P via a constant-time multiply. This\n // equals scalar*P only when Fn.ORDER*P == O; callers guarantee that via shouldBlind() (always\n // for cofactor-1 curves; for cofactored curves only BASE, and only after checking BASE*n == O).\n // Fail before building the (large) precompute table if randomness is unavailable.\n if (this.randomBytes === undefined)\n throw new Error('randomBytes is required for scalar blinding');\n const bits = this.Point.Fn.BITS + BLIND_BITS;\n const blind = this.randomBytes(BLIND_BYTES);\n if (!isBytes(blind) || blind.length !== BLIND_BYTES)\n throw new Error('randomBytes returned invalid byte array');\n // Force the top two bits of the 128-bit blind to 10xxxxxx, so blind is in [2^127, 1.5*2^127):\n // * `| 0x80` (bit 127 = 1) is the load-bearing part: it guarantees blind >= 2^127, so the blind\n // is always a full-width, nonzero factor and the scalar is masked even with a degenerate RNG.\n // * `& 0x3f` (bit 126 = 0) is a safety margin: it caps blind < 1.5*2^127, keeping\n // blind*Fn.ORDER + scalar < 0.75*2^(nBits+128), i.e. ~half a window below the 2^(nBits+128)\n // ceiling. Not strictly required for the bound (see below), but it reserves headroom so the\n // guarantee does not rest on the tight `Fn.ORDER < 2^Fn.BITS` fact and the final carry window\n // only ever holds a small carry, never a full digit.\n blind[0] = (blind[0] & 0x3f) | 0x80;\n // Even at the extreme (blind < 2^128, scalar < Fn.ORDER < 2^nBits): n <= 2^128*Fn.ORDER - 1 <\n // 2^(nBits+128), so n stays below 2^bits and within the blinded table's\n // window count. Both cached CT kernels run a fixed number of windows/rows with one point-add\n // each, so the add count is independent of scalar (constant-time).\n const n = scalar + bytesToNumberBE(blind) * this.Point.Fn.ORDER;\n return this.runCT(point, n, bits, transform);\n }\n /**\n * Constant-time multiplication `n*point` for an un-precomputed point, via a small fixed window.\n * A cached wNAF table only pays off when reused; a flat 2^FW_WINDOW table (`size-1` adds) is\n * far cheaper to build for a single use. The point-operation sequence is independent of `n`:\n * build the table, then per window exactly FW_WINDOW doublings, a data-oblivious scan over\n * every table entry, and one addition (adds the identity when the window digit is 0 \u2014 never\n * skipped).\n *\n * `n` must be `< 2^bits`. Assumes complete addition (adding the identity costs the same as any\n * add), which holds for the Weierstrass/Edwards point types used here. The table is left in\n * projective form (no normalizeZ): normalizing this small a table costs more than the\n * mixed-add savings it would buy for a single multiply.\n * @returns real point `p`; `f` duplicates it only to match {@link wnafCachedCT}'s return shape\n * (this path needs no fake accumulator \u2014 its op-count is already scalar-independent).\n */\n fixedWindowCT(point, n, bits) {\n const W = FW_WINDOW;\n const size = 1 << W;\n const mask = bitMask(W);\n // Flat table [O, point, 2*point, ..., (size-1)*point].\n const table = new Array(size);\n table[0] = this.ZERO;\n for (let i = 1; i < size; i++)\n table[i] = table[i - 1].add(point);\n // Horner MSB->LSB. windows*W >= bits and n < 2^bits, so every bit of n is consumed.\n const windows = Math.ceil(bits / W);\n let acc = this.ZERO;\n for (let window = windows - 1; window >= 0; window--) {\n // W doublings per window; skipped for the first (topmost) window, where acc is still the\n // identity. The skip is scalar-independent: it depends only on the loop index.\n if (window !== windows - 1)\n for (let d = 0; d < W; d++)\n acc = acc.double();\n const digit = Number((n >> BigInt(window * W)) & mask);\n // Data-oblivious select: touch every entry, same as wnafCachedCT.\n let sel = table[0];\n for (let i = 1; i < size; i++)\n sel = i === digit ? table[i] : sel;\n acc = acc.add(sel); // one add per window, even for digit 0\n }\n return { p: acc, f: acc };\n }\n shouldBlind(point, cofactor) {\n // No usable RNG (probed in the constructor): blinding is impossible, use the plain CT path.\n if (this.randomBytes === undefined)\n return false;\n if (cofactor === _1n)\n return true;\n if (point !== this.BASE)\n return false;\n if (this.baseCanBeBlinded === undefined)\n this.baseCanBeBlinded = this.mulUnsafe(this.BASE, this.Point.Fn.ORDER).is0();\n return this.baseCanBeBlinded;\n }\n mulSecret(point, scalar, cofactor, transform) {\n return this.shouldBlind(point, cofactor)\n ? this.mulCTBlinded(point, scalar, transform)\n : this.mulCT(point, scalar, transform);\n }\n mulUnsafe(point, scalar, transform) {\n this.assertPoint(point);\n if (!isPosBig(scalar))\n throw new Error('invalid scalar');\n const W = getWindowSize(point);\n // W === 1 (un-precomputed): one-shot width-4 wNAF via {@link mulAddUnsafe} with L=1 \u2014\n // a cached table would be thrown away after one use. `allowOversized` swaps the\n // `s < Fn.ORDER` check for mulAddUnsafe's `Fn.ORDER^4` DoS cap.\n //\n // Oversized scalar could happen when:\n // a) user passes large scalar on their own (rare)\n // b) `assertValidity()` calls `isTorsionFree()`, which multiplies point by `Fn.ORDER`\n if (W === 1 || scalar >= this.Point.Fn.ORDER)\n return mulAddUnsafe(this.Point, [point], [scalar], true);\n // Precomputed points reuse the CT kernel (fake accumulator discarded): with W=6 only\n // ~1/64 of window-adds are skippable, so a dedicated vartime kernel saved just ~6% on\n // this path while doubling the cached-table code surface.\n const precomputes = this.getWnafPrecomputes(W, point, this.bits, transform);\n return this.wnafCachedCT(precomputes, scalar).p;\n }\n // Remembers the window size used for precomputed wNAF multiplication of the given point\n // and drops any previously built tables. Usually only the base point is precomputed.\n // W=1 resets the point to the un-precomputed (table-less) paths.\n // W is additionally capped so tables stay under ~2 GiB ({@link TABLE_BYTES_MAX}).\n setWindowSize(point, W) {\n this.assertPoint(point);\n validateW(W, this.bits);\n // Size against the widest table this W can produce: the blinded path adds BLIND_BITS.\n const windows = Math.ceil((this.bits + BLIND_BITS) / W) + 1;\n validateTableBytes(windows * 2 ** (W - 1), this.Point.Fp.BYTES);\n pointWindowSizes.set(point, W);\n this.wnafPrecomputes.delete(point);\n }\n // True when a window size is set: tables themselves are built lazily on first multiply.\n hasWindowSize(point) {\n return getWindowSize(point) !== 1;\n }\n}\n/**\n * Combined multi-scalar multiplication `\u03A3 scalars[i]\u22C5points[i]` via interleaved width-4 wNAF\n * (Strauss\u2013Shamir). Every input gets its own table of odd multiples `[1P, 3P, 5P, 7P]` and\n * signed-digit recoding, but all walks share one doubling chain, so total cost is\n * `~bits` doublings + `L\u22C5bits/5` additions instead of `L\u22C5bits` doublings for separate\n * multiplications. Intended for the 2-4 point shapes of signature verification\n * (`R = u1\u22C5G + u2\u22C5P`); use {@link pippenger} for larger batches.\n *\n * Not constant-time: only for public inputs. Scalars must satisfy `0 <= s < Fn.ORDER`;\n * fold negative signs into the points before calling.\n * @param c - Point constructor.\n * @param points - Array of curve points.\n * @param scalars - Array of non-negative scalars, same length as points.\n * @param allowOversized - Replace the `s < Fn.ORDER` scalar check with a `Fn.ORDER^4` DoS cap.\n * Off by default. For scalars that must NOT be reduced mod ORDER: torsion checks\n * (`Fn.ORDER\u22C5P \u225F O`) and cofactor-clearing multiples. Walk length grows with `bitLen(s)`.\n * @returns Combined multiplication result; identity for empty input.\n * @throws If the point set or scalar set is invalid. {@link Error}\n * @example\n * Combined multi-scalar multiplication via Strauss\u2013Shamir.\n *\n * ```ts\n * import { mulAddUnsafe } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const G = p256.Point.BASE;\n * const R = mulAddUnsafe(p256.Point, [G, G.double()], [2n, 3n]); // 2\u22C5G + 3\u22C5(2\u22C5G)\n * ```\n */\nexport function mulAddUnsafe(c, points, scalars, allowOversized = false) {\n validatePointCons(c);\n validateMSMPoints(points, c);\n abool(allowOversized, 'allowOversized');\n // Oversized cap is ORDER^4: hard bound to mitigate DoS, walk length grows with bitLen(s).\n validateMSMScalars(scalars, c.Fn, allowOversized ? c.Fn.ORDER ** _4n : undefined);\n if (points.length !== scalars.length)\n throw new Error('arrays of points and scalars must have equal length');\n const tables = points.map((p) => oddMultiples(p, 4));\n const digits = scalars.map((n) => wnafDigits(n, 4));\n return wnafWalk(c.ZERO, tables, digits);\n}\n/**\n * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * 30x faster vs naive addition on L=4096, 10x faster than precomputes.\n * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.\n * Point-operation count is scalar-independent (for same L), even when 1 point + scalar, or when\n * scalar = 0 \u2014 but bucket indices are scalar windows, so the memory-access pattern is\n * scalar-dependent: do not rely on this for secret scalars.\n *\n * A repaired LFG bucket-set variant from ePrint 2024/750 was benchmarked on BLS12-381 G1\n * against this implementation: ~1.4x faster at 2048 points and ~1.1-1.25x faster at\n * 4096-32768 points, at the cost of extra recoding and multiplier-table complexity.\n * @param c - Curve Point constructor\n * @param points - array of L curve points\n * @param scalars - array of L scalars (aka secret keys / bigints)\n * @returns MSM result point. Empty input is accepted and returns the identity.\n * @throws If the point set, scalar set, or MSM sizing is invalid. {@link Error}\n * @example\n * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n *\n * ```ts\n * import { pippenger } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const point = pippenger(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()], [2n, 3n]);\n * ```\n */\nexport function pippenger(c, points, scalars) {\n // 0 is accepted in scalars\n validatePointCons(c);\n const fieldN = c.Fn;\n validateMSMPoints(points, c);\n validateMSMScalars(scalars, fieldN);\n const plength = points.length;\n const slength = scalars.length;\n if (plength !== slength)\n throw new Error('arrays of points and scalars must have equal length');\n const zero = c.ZERO;\n // Without this, the window loop below would still run ~Fn.BITS doublings of ZERO.\n if (plength === 0)\n return zero;\n const wbits = bitLen(BigInt(plength));\n let windowSize = 1; // bits\n if (wbits > 12)\n windowSize = wbits - 3;\n else if (wbits > 4)\n windowSize = wbits - 2;\n else if (wbits > 0)\n windowSize = 2;\n const MASK = bitMask(windowSize);\n const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array\n const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;\n let sum = zero;\n for (let i = lastBits; i >= 0; i -= windowSize) {\n buckets.fill(zero);\n for (let j = 0; j < slength; j++) {\n const scalar = scalars[j];\n const wbits = Number((scalar >> BigInt(i)) & MASK);\n buckets[wbits] = buckets[wbits].add(points[j]);\n }\n let resI = zero; // not using this will do small speed-up, but will lose ct\n // Skip first bucket, because it is zero\n for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {\n sumI = sumI.add(buckets[j]);\n resI = resI.add(sumI);\n }\n sum = sum.add(resI);\n if (i !== 0)\n for (let j = 0; j < windowSize; j++)\n sum = sum.double();\n }\n return sum;\n}\n/**\n * Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...) over a FIXED set\n * of points: each point gets a one-time table of odd multiples\n * `[1P, 3P, ..., (2^(W\u22121)\u22121)P]`, and the returned closure evaluates MSMs against those\n * tables. All scalars share one doubling chain (Straus 1964) \u2014 one doubling per scalar bit\n * plus one signed table addition per nonzero width-W wNAF digit (density ~1/(W+1)) \u2014 the\n * \"interleaving\" method of M\u00F6ller, \"Algorithms for multi-exponentiation\" (SAC 2001).\n *\n * Table memory is `L\u22C52^(W\u22122)` points, capped at ~2 GiB. Prefer this over {@link pippenger}\n * when the same points are reused across many MSMs (fixed-base commitments etc.) and up to a\n * few hundred points; prefer pippenger for one-shot MSMs or thousands of points, where\n * bucketing beats per-point tables.\n *\n * Not constant-time (zero digits are skipped): public inputs only.\n * @param c - Curve Point constructor\n * @param points - array of L curve points, captured by the returned closure\n * @param windowSize - window width W in bits, from 2 to Fn.BITS; also capped so the\n * per-closure tables stay under ~2 GiB\n * @returns Function which multiplies points with scalars. The closure accepts at most\n * `points.length` scalars, and omitted trailing scalars are treated as zero.\n * @throws If the point set or precompute window is invalid. {@link Error}\n * @example\n * Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n *\n * ```ts\n * import { interleavedMSMUnsafe } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const msm = interleavedMSMUnsafe(p256.Point, [p256.Point.BASE], 4);\n * const point = msm([3n]);\n * ```\n */\nexport function interleavedMSMUnsafe(c, points, windowSize) {\n validatePointCons(c);\n const fieldN = c.Fn;\n // Signed odd digits need at least width 2 (W=2 is plain NAF with a single-entry table).\n validateW(windowSize, fieldN.BITS, 2);\n validateMSMPoints(points, c);\n validateTableBytes(points.length * 2 ** (windowSize - 2), c.Fp.BYTES);\n const tables = points.map((p) => oddMultiples(p, 2 ** (windowSize - 2)));\n return (scalars) => {\n validateMSMScalars(scalars, fieldN);\n if (scalars.length > points.length)\n throw new Error('array of scalars must not be larger than array of points');\n return wnafWalk(c.ZERO, tables, scalars.map((n) => wnafDigits(n, windowSize)));\n };\n}\nfunction createField(order, field, isLE) {\n if (field) {\n // Reuse supplied field overrides as-is; `isLE` only affects freshly constructed fallback\n // fields, and validateField() below only checks the arithmetic subset, not full byte/cmov\n // behavior.\n if (field.ORDER !== order)\n throw new Error('Field.ORDER must match order: Fp == p, Fn == n');\n validateField(field);\n return field;\n }\n else {\n return Field(order, { isLE });\n }\n}\n/**\n * Validates basic CURVE shape and field membership, then creates fields.\n * This does not prove that the generator is on-curve, that subgroup/order data are consistent, or\n * that the curve equation itself is otherwise sane.\n * @param type - Curve family.\n * @param CURVE - Curve parameters.\n * @param curveOpts - Optional field overrides. See {@link FpFn}:\n * - `Fp` (optional): Optional base-field override.\n * - `Fn` (optional): Optional scalar-field override.\n * @param FpFnLE - Whether field encoding is little-endian.\n * @returns Frozen curve parameters and fields.\n * @throws If the curve parameters or field overrides are invalid. {@link Error}\n * @example\n * Build curve fields from raw constants before constructing a curve instance.\n *\n * ```ts\n * const curve = createCurveFields('weierstrass', {\n * p: 17n,\n * n: 19n,\n * h: 1n,\n * a: 2n,\n * b: 2n,\n * Gx: 5n,\n * Gy: 1n,\n * });\n * ```\n */\nexport function createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {\n if (type !== 'weierstrass' && type !== 'edwards')\n throw new Error('expected curve type \"weierstrass\" or \"edwards\"');\n if (FpFnLE === undefined)\n FpFnLE = type === 'edwards';\n if (!CURVE || typeof CURVE !== 'object')\n throw new Error(`expected valid ${type} CURVE object`);\n // Validate before reading Fp/Fn so explicit null fails with an options-object error.\n validateObject(curveOpts);\n for (const p of ['p', 'n', 'h']) {\n const val = CURVE[p];\n if (!(isPosBig(val) && val !== _0n))\n throw new Error(`CURVE.${p} must be positive bigint`);\n }\n const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE);\n const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE);\n const _b = type === 'weierstrass' ? 'b' : 'd';\n const params = ['Gx', 'Gy', 'a', _b];\n for (const p of params) {\n // @ts-ignore\n if (!Fp.isValid(CURVE[p]))\n throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);\n }\n CURVE = Object.freeze(Object.assign({}, CURVE));\n return { CURVE, Fp, Fn };\n}\n/**\n * @param randomSecretKey - Secret-key generator.\n * @param getPublicKey - Public-key derivation helper.\n * @returns Keypair generator.\n * @example\n * Build a `keygen()` helper from existing secret-key and public-key primitives.\n *\n * ```ts\n * import { createKeygen } from '@noble/curves/abstract/curve.js';\n * import { p256 } from '@noble/curves/nist.js';\n * const keygen = createKeygen(p256.utils.randomSecretKey, p256.getPublicKey);\n * const pair = keygen();\n * ```\n */\nexport function createKeygen(randomSecretKey, getPublicKey) {\n return function keygen(seed) {\n const secretKey = randomSecretKey(seed);\n return { secretKey, publicKey: getPublicKey(secretKey) };\n };\n}\n", "/**\n * Twisted Edwards curve. The formula is: ax\u00B2 + y\u00B2 = 1 + dx\u00B2y\u00B2.\n * For design rationale of types / exports, see weierstrass module documentation.\n * Untwisted Edwards curves exist, but they aren't used in real-world protocols.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { abool, abytes, aInRange, asafenumber, bytesToHex, bytesToNumberLE, concatBytes, copyBytes, hexToBytes, isBytes, notImplemented, validateObject, randomBytes as wcRandomBytes, } from \"../utils.js\";\nimport { createCurveFields, createKeygen, normalizeZ, ScalarMultiplier, validatePointCons, } from \"./curve.js\";\nimport { FpLegendre } from \"./modular.js\";\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _4n = /* @__PURE__ */ BigInt(4), _8n = /* @__PURE__ */ BigInt(8);\n// Affine Edwards-equation check only; this does not prove subgroup membership, canonical\n// encoding, prime-order base-point requirements, or identity exclusion.\nfunction isEdValidXY(Fp, CURVE, x, y) {\n const x2 = Fp.sqr(x);\n const y2 = Fp.sqr(y);\n const left = Fp.add(Fp.mul(CURVE.a, x2), y2);\n const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2)));\n return Fp.eql(left, right);\n}\n/**\n * @param params - Curve parameters. See {@link EdwardsOpts}.\n * @param extraOpts - Optional helpers and overrides. See {@link EdwardsExtraOpts}.\n * @returns Edwards point constructor. Generator validation here only checks\n * that `(Gx, Gy)` satisfies the affine Edwards equation.\n * RFC 8032 base-point constraints like `B != (0,1)` and `[L]B = 0`\n * are left to the caller's chosen parameters, since eager subgroup\n * validation here adds about 10-15ms to heavyweight imports like ed448.\n * The returned constructor also eagerly marks `Point.BASE` for W=6\n * precompute caching. Some code paths still assume\n * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.\n * @throws If the curve parameters or Edwards overrides are invalid. {@link Error}\n * @example\n * ```ts\n * import { edwards } from '@noble/curves/abstract/edwards.js';\n * import { jubjub } from '@noble/curves/misc.js';\n * // Build a point constructor from explicit curve parameters, then use its base point.\n * const Point = edwards(jubjub.Point.CURVE());\n * Point.BASE.toHex();\n * ```\n */\nexport function edwards(params, extraOpts = {}) {\n validateObject(extraOpts, {}, {}, 'extraOpts');\n const opts = extraOpts;\n const validated = createCurveFields('edwards', params, opts, opts.FpFnLE);\n const { Fp, Fn } = validated;\n let CURVE = validated.CURVE;\n const { h: cofactor } = CURVE;\n // The unified add-2008-hwcd formulas (see EdwardsPoint.add/double) are complete \u2014\n // exception-free for every input pair \u2014 only when a is a square and d a non-square in Fp\n // (Bernstein\u2013Birkner\u2013Joye\u2013Lange\u2013Peters, \"Twisted Edwards curves\", thm 3.3). The constant-time\n // kernels in curve.ts assume completeness, so an incomplete curve could silently produce\n // wrong results on exceptional inputs. Fail construction instead.\n if (FpLegendre(Fp, CURVE.a) !== 1)\n throw new Error('edwards: CURVE.a must be a square in Fp for complete addition formulas');\n if (FpLegendre(Fp, CURVE.d) !== -1)\n throw new Error('edwards: CURVE.d must be a non-square in Fp for complete addition formulas');\n validateObject(opts, {}, { uvRatio: 'function', randomBytes: 'function' });\n const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;\n // Coordinate and ZIP-215 bounds follow the base-field byte container, not scalar bytes.\n const MASK = _2n << (BigInt(Fp.BYTES * 8) - _1n);\n function isOdd(n) {\n if (!Fp.isOdd)\n throw new Error('Field does not have .isOdd()');\n return Fp.isOdd(n);\n }\n // sqrt(u/v)\n const uvRatio = opts.uvRatio === undefined\n ? (u, v) => {\n try {\n return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) };\n }\n catch (e) {\n return { isValid: false, value: _0n };\n }\n }\n : opts.uvRatio;\n // Validate whether the passed curve params are valid.\n // equation ax\u00B2 + y\u00B2 = 1 + dx\u00B2y\u00B2 should work for generator point.\n if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy))\n throw new Error('bad curve params: generator point');\n // Multiplication by param `a` sits on the double() / add() hot paths. For the common twists\n // a=-1 (ed25519, jubjub) and a=1 (ed448) the full field multiplication is replaced with\n // negation / identity. Selection depends only on public curve constants.\n const mulA = Fp.eql(CURVE.a, Fp.neg(Fp.ONE)) ? (x) => Fp.neg(x)\n : Fp.eql(CURVE.a, Fp.ONE) ? (x) => x\n : (x) => Fp.mul(CURVE.a, x); // prettier-ignore\n /**\n * Asserts coordinate is valid: 0 <= n < MASK.\n * Coordinates >= Fp.ORDER are allowed for zip215.\n */\n function acoord(title, n, banZero = false) {\n const min = banZero ? _1n : _0n;\n aInRange('coordinate ' + title, n, min, MASK);\n return n;\n }\n function aedpoint(other) {\n if (!(other instanceof Point))\n throw new Error('EdwardsPoint expected');\n }\n // Extended Point works in extended coordinates: (X, Y, Z, T) \u220B (x=X/Z, y=Y/Z, T=xy).\n // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates\n class Point {\n static BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE, Fp.mul(CURVE.Gx, CURVE.Gy));\n static ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ONE, Fp.ZERO);\n static Fp = Fp;\n static Fn = Fn;\n X;\n Y;\n Z;\n T;\n constructor(X, Y, Z, T) {\n this.X = acoord('x', X);\n this.Y = acoord('y', Y);\n this.Z = acoord('z', Z, true);\n this.T = acoord('t', T);\n Object.freeze(this);\n }\n static CURVE() {\n return CURVE;\n }\n /**\n * Create one extended Edwards point from affine coordinates.\n * Does NOT validate that the point is on-curve or torsion-free.\n * Use `.assertValidity()` on adversarial inputs.\n */\n static fromAffine(p) {\n if (p instanceof Point)\n throw new Error('extended point not allowed');\n const { x, y } = p || {};\n acoord('x', x);\n acoord('y', y);\n return new Point(x, y, Fp.ONE, Fp.mul(x, y));\n }\n // Uses algo from RFC8032 5.1.3.\n static fromBytes(bytes, zip215 = false) {\n const len = Fp.BYTES;\n const { a, d } = CURVE;\n bytes = copyBytes(abytes(bytes, len, 'point'));\n abool(zip215, 'zip215');\n const normed = copyBytes(bytes); // copy again, we'll manipulate it\n const lastByte = bytes[len - 1]; // select last byte\n normed[len - 1] = lastByte & ~0x80; // clear last bit\n const y = bytesToNumberLE(normed);\n // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5.\n // RFC8032 prohibits >= p, but ZIP215 doesn't\n // zip215=true: 0 <= y < MASK (2^256 for ed25519)\n // zip215=false: 0 <= y < P (2^255-19 for ed25519)\n const max = zip215 ? MASK : Fp.ORDER;\n aInRange('point.y', y, _0n, max);\n // Ed25519: x\u00B2 = (y\u00B2-1)/(dy\u00B2+1) mod p. Ed448: x\u00B2 = (y\u00B2-1)/(dy\u00B2-1) mod p. Generic case:\n // ax\u00B2+y\u00B2=1+dx\u00B2y\u00B2 => y\u00B2-1=dx\u00B2y\u00B2-ax\u00B2 => y\u00B2-1=x\u00B2(dy\u00B2-a) => x\u00B2=(y\u00B2-1)/(dy\u00B2-a)\n const y2 = Fp.sqr(y); // denominator is always non-0 mod p.\n const u = Fp.sub(y2, Fp.ONE); // u = y\u00B2 - 1\n const v = Fp.sub(Fp.mulN(d, y2), a); // v = d y\u00B2 - a.\n let { isValid, value: x } = uvRatio(u, v); // \u221A(u/v)\n if (!isValid)\n throw new Error('bad point: invalid y coordinate');\n const isXOdd = isOdd(x); // There are 2 square roots. Use x_0 bit to select proper\n const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit\n if (!zip215 && Fp.is0(x) && isLastByteOdd)\n // if x=0 and x_0 = 1, fail\n throw new Error('bad point: x=0 and x_0=1');\n if (isLastByteOdd !== isXOdd)\n x = Fp.neg(x); // if x_0 != x mod 2, set x = p-x\n return Point.fromAffine({ x, y });\n }\n static fromHex(hex, zip215 = false) {\n return Point.fromBytes(hexToBytes(hex), zip215);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n precompute(windowSize = 6, isLazy = true) {\n wnaf.setWindowSize(this, windowSize);\n if (!isLazy)\n this.multiply(_2n); // random number\n return this;\n }\n // Useful in fromAffine() - not for fromBytes(), which always created valid points.\n assertValidity() {\n const p = this;\n const { a, d } = CURVE;\n // Keep generic Edwards validation fail-closed on the neutral point.\n // Even though ZERO is algebraically valid and can roundtrip through encodings, higher-level\n // callers often reach it only through broken hash/scalar plumbing; rejecting it here avoids\n // silently treating that degenerate state as an ordinary public point.\n if (p.is0())\n throw new Error('bad point: ZERO'); // TODO: optimize, with vars below?\n // Equation in affine coordinates: ax\u00B2 + y\u00B2 = 1 + dx\u00B2y\u00B2\n // Equation in projective coordinates (X/Z, Y/Z, Z): (aX\u00B2 + Y\u00B2)Z\u00B2 = Z\u2074 + dX\u00B2Y\u00B2\n const { X, Y, Z, T } = p;\n const X2 = Fp.sqr(X); // X\u00B2\n const Y2 = Fp.sqr(Y); // Y\u00B2\n const Z2 = Fp.sqr(Z); // Z\u00B2\n const Z4 = Fp.sqr(Z2); // Z\u2074\n const aX2 = Fp.mul(X2, a); // aX\u00B2\n const left = Fp.mul(Fp.add(aX2, Y2), Z2); // (aX\u00B2 + Y\u00B2)Z\u00B2\n const right = Fp.add(Z4, Fp.mul(d, Fp.mul(X2, Y2))); // Z\u2074 + dX\u00B2Y\u00B2\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right (1)');\n // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T\n const XY = Fp.mul(X, Y);\n const ZT = Fp.mul(Z, T);\n if (!Fp.eql(XY, ZT))\n throw new Error('bad point: equation left != right (2)');\n }\n // Compare one point to another.\n equals(other) {\n aedpoint(other);\n const { X: X1, Y: Y1, Z: Z1 } = this;\n const { X: X2, Y: Y2, Z: Z2 } = other;\n const X1Z2 = Fp.mul(X1, Z2);\n const X2Z1 = Fp.mul(X2, Z1);\n const Y1Z2 = Fp.mul(Y1, Z2);\n const Y2Z1 = Fp.mul(Y2, Z1);\n return Fp.eql(X1Z2, X2Z1) && Fp.eql(Y1Z2, Y2Z1);\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n negate() {\n // Flips point sign to a negative one (-x, y in affine coords)\n return new Point(Fp.neg(this.X), this.Y, this.Z, Fp.neg(this.T));\n }\n // Fast algo for doubling Extended Point.\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // Cost: 4M + 4S + 1*a + 6add + 1*2.\n double() {\n const { X: X1, Y: Y1, Z: Z1 } = this;\n const A = Fp.sqr(X1); // A = X12\n const B = Fp.sqr(Y1); // B = Y12\n const C = Fp.mul(Fp.sqr(Z1), _2n); // C = 2*Z12\n const D = mulA(A); // D = a*A\n const x1y1 = Fp.addN(X1, Y1);\n const E = Fp.sub(Fp.subN(Fp.sqr(x1y1), A), B); // E = (X1+Y1)2-A-B\n const G = Fp.addN(D, B); // G = D+B\n const F = Fp.subN(G, C); // F = G-C\n const H = Fp.subN(D, B); // H = D-B\n const X3 = Fp.mul(E, F); // X3 = E*F\n const Y3 = Fp.mul(G, H); // Y3 = G*H\n const T3 = Fp.mul(E, H); // T3 = E*H\n const Z3 = Fp.mul(F, G); // Z3 = F*G\n return new Point(X3, Y3, Z3, T3);\n }\n // Fast algo for adding 2 Extended Points.\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // Cost: 9M + 1*a + 1*d + 7add.\n add(other) {\n aedpoint(other);\n const { d } = CURVE;\n const { X: X1, Y: Y1, Z: Z1, T: T1 } = this;\n const { X: X2, Y: Y2, Z: Z2, T: T2 } = other;\n const A = Fp.mul(X1, X2); // A = X1*X2\n const B = Fp.mul(Y1, Y2); // B = Y1*Y2\n const C = Fp.mul(Fp.mulN(T1, d), T2); // C = T1*d*T2\n const D = Fp.mul(Z1, Z2); // D = Z1*Z2\n // E = (X1+Y1)*(X2+Y2)-A-B\n const E = Fp.sub(Fp.subN(Fp.mulN(Fp.addN(X1, Y1), Fp.addN(X2, Y2)), A), B);\n const F = Fp.subN(D, C); // F = D-C\n const G = Fp.addN(D, C); // G = D+C\n const H = Fp.sub(B, mulA(A)); // H = B-a*A\n const X3 = Fp.mul(E, F); // X3 = E*F\n const Y3 = Fp.mul(G, H); // Y3 = G*H\n const T3 = Fp.mul(E, H); // T3 = E*H\n const Z3 = Fp.mul(F, G); // Z3 = F*G\n return new Point(X3, Y3, Z3, T3);\n }\n subtract(other) {\n // Validate before calling `negate()` so wrong inputs fail with the point guard\n // instead of leaking a foreign `negate()` error.\n aedpoint(other);\n return this.add(other.negate());\n }\n // Constant-time multiplication.\n multiply(scalar) {\n // 1 <= scalar < L\n // Keep the subgroup-scalar contract strict instead of reducing 0 / n to ZERO.\n // In keygen/signing-style callers, those values usually mean broken hash/scalar plumbing,\n // and failing closed is safer than silently producing the identity point.\n if (!Fn.isValidNot0(scalar))\n throw new RangeError('invalid scalar: expected 1 <= sc < curve.n');\n const { p, f } = wnaf.mulSecret(this, scalar, cofactor, normalize);\n return normalize([p, f])[0];\n }\n // Non-constant-time multiplication. Uses double-and-add algorithm.\n // It's faster, but should only be used when you don't care about\n // an exposed private key e.g. sig verification.\n // Keeps the same subgroup-scalar contract: 0 is allowed for public-scalar callers, but\n // n and larger values are rejected instead of being reduced mod n to the identity point.\n multiplyUnsafe(scalar) {\n // 0 <= scalar < L\n if (!Fn.isValid(scalar))\n throw new RangeError('invalid scalar: expected 0 <= sc < curve.n');\n if (scalar === _0n)\n return Point.ZERO;\n if (this.is0() || scalar === _1n)\n return this;\n return wnaf.mulUnsafe(this, scalar, normalize);\n }\n // Checks if point is of small order.\n // If you add something to small order point, you will have \"dirty\"\n // point with torsion component.\n // Clears cofactor and checks if the result is 0.\n isSmallOrder() {\n return this.clearCofactor().is0();\n }\n // Multiplies point by curve order and checks if the result is 0.\n // Returns `false` is the point is dirty.\n isTorsionFree() {\n return wnaf.mulUnsafe(this, CURVE.n).is0();\n }\n // Converts Extended point to default (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n toAffine(invertedZ) {\n const p = this;\n let iz = invertedZ;\n if (iz != null && typeof iz !== 'bigint')\n throw new TypeError('\"invertedZ\" expected bigint, got type=' + typeof iz);\n const { X, Y, Z } = p;\n const is0 = p.is0();\n if (iz == null)\n iz = is0 ? Fp.create(_8n) : Fp.inv(Z);\n const x = Fp.mul(X, iz);\n const y = Fp.mul(Y, iz);\n const zz = Fp.mul(Z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ONE };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x, y };\n }\n clearCofactor() {\n if (cofactor === _1n)\n return this;\n // 2.8-3.8x speed-up vs naive\n if (cofactor === _2n)\n return this.double();\n if (cofactor === _4n)\n return this.double().double();\n if (cofactor === _8n)\n return this.double().double().double();\n return this.multiplyUnsafe(cofactor);\n }\n toBytes() {\n const { x, y } = this.toAffine();\n // Fp.toBytes() allows non-canonical encoding of y (>= p).\n const bytes = Fp.toBytes(y);\n // Each y has 2 valid points: (x, y), (x,-y).\n // When compressing, it's enough to store y and use the last byte to encode sign of x\n bytes[bytes.length - 1] |= isOdd(x) ? 0x80 : 0;\n return bytes;\n }\n toHex() {\n return bytesToHex(this.toBytes());\n }\n toString() {\n return `<Point ${this.is0() ? 'ZERO' : this.toHex()}>`;\n }\n }\n // Keep constructor work cheap: subgroup/generator validation belongs to the caller's curve\n // parameters, and doing the extra checks here adds about 10-15ms to heavy module imports.\n // Callers that construct custom curves are responsible for supplying the correct base point.\n // try {\n // Point.BASE.assertValidity();\n // if (!Point.BASE.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup');\n // } catch {\n // throw new Error('bad curve params: generator point');\n // }\n const normalize = (points) => normalizeZ(Point, points);\n const wnaf = new ScalarMultiplier(Point, randomBytes);\n // Enable W=6 wNAF precomputes. Slows down first publicKey computation.\n // Disable for tiny toy curves, with scalar fields < 6 bits.\n if (wnaf.bits >= 6)\n Point.BASE.precompute(6);\n Object.freeze(Point.prototype);\n Object.freeze(Point);\n return Point;\n}\n/**\n * Base class for prime-order points like Ristretto255 and Decaf448.\n * These points eliminate cofactor issues by representing equivalence classes\n * of Edwards curve points. Multiple Edwards representatives can describe the\n * same abstract wrapper element, so wrapper validity is not the same thing as\n * the hidden representative being torsion-free.\n * @param ep - Backing Edwards point.\n * @example\n * Base class for prime-order points like Ristretto255 and Decaf448.\n *\n * ```ts\n * import { ristretto255 } from '@noble/curves/ed25519.js';\n * const point = ristretto255.Point.BASE.multiply(2n);\n * ```\n */\nexport class PrimeEdwardsPoint {\n static BASE;\n static ZERO;\n static Fp;\n static Fn;\n ep;\n /**\n * Wrap one internal Edwards representative directly.\n * This is not a canonical encoding boundary: alternate Edwards\n * representatives may still describe the same abstract wrapper element.\n */\n constructor(ep) {\n this.ep = ep;\n }\n // Static methods that must be implemented by subclasses\n static fromBytes(_bytes) {\n notImplemented();\n }\n static fromHex(_hex) {\n notImplemented();\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n // Common implementations\n clearCofactor() {\n // no-op for the abstract prime-order wrapper group; this is about the\n // wrapper element, not the hidden Edwards representative.\n return this;\n }\n assertValidity() {\n // Keep wrapper validity at the abstract-group boundary. Canonical decode\n // may choose Edwards representatives that differ by small torsion, so\n // checking `this.ep.isTorsionFree()` here would reject valid wrapper points.\n this.ep.assertValidity();\n }\n /**\n * Return affine coordinates of the current internal Edwards representative.\n * This is a convenience helper, not a canonical Ristretto/Decaf encoding.\n * Equal abstract elements may expose different `x` / `y`; use\n * `toBytes()` / `fromBytes()` for canonical roundtrips.\n */\n toAffine(invertedZ) {\n return this.ep.toAffine(invertedZ);\n }\n toHex() {\n return bytesToHex(this.toBytes());\n }\n toString() {\n return this.toHex();\n }\n isTorsionFree() {\n // Abstract Ristretto/Decaf elements are already prime-order even when the\n // hidden Edwards representative is not torsion-free.\n return true;\n }\n isSmallOrder() {\n return false;\n }\n add(other) {\n this.assertSame(other);\n return this.init(this.ep.add(other.ep));\n }\n subtract(other) {\n this.assertSame(other);\n return this.init(this.ep.subtract(other.ep));\n }\n multiply(scalar) {\n return this.init(this.ep.multiply(scalar));\n }\n multiplyUnsafe(scalar) {\n return this.init(this.ep.multiplyUnsafe(scalar));\n }\n double() {\n return this.init(this.ep.double());\n }\n negate() {\n return this.init(this.ep.negate());\n }\n precompute(windowSize, isLazy) {\n this.ep.precompute(windowSize, isLazy);\n // Keep the wrapper identity stable like the backing Edwards API instead of\n // allocating a fresh wrapper around the same cached point.\n return this;\n }\n}\n/**\n * Initializes EdDSA signatures over given Edwards curve.\n * @param Point - Edwards point constructor.\n * @param cHash - Hash function.\n * @param eddsaOpts - Optional signature helpers. See {@link EdDSAOpts}.\n * @returns EdDSA helper namespace.\n * @throws If the hash function, options, or derived point operations are invalid. {@link Error}\n * @example\n * Initializes EdDSA signatures over given Edwards curve.\n *\n * ```ts\n * import { eddsa } from '@noble/curves/abstract/edwards.js';\n * import { jubjub } from '@noble/curves/misc.js';\n * import { sha512 } from '@noble/hashes/sha2.js';\n * const sigs = eddsa(jubjub.Point, sha512);\n * const { secretKey, publicKey } = sigs.keygen();\n * const msg = new TextEncoder().encode('hello noble');\n * const sig = sigs.sign(msg, secretKey);\n * const isValid = sigs.verify(sig, msg, publicKey);\n * ```\n */\nexport function eddsa(Point, cHash, eddsaOpts = {}) {\n validatePointCons(Point);\n if (typeof cHash !== 'function')\n throw new Error('\"hash\" function param is required');\n const hash = cHash;\n const opts = eddsaOpts;\n validateObject(opts, {}, {\n adjustScalarBytes: 'function',\n randomBytes: 'function',\n domain: 'function',\n prehash: 'function',\n zip215: 'boolean',\n mapToCurve: 'function',\n toMontgomery: 'function',\n toMontgomerySecret: 'function',\n });\n const { prehash } = opts;\n const { BASE, Fp, Fn } = Point;\n const outputLen = hash.outputLen;\n const expectedLen = 2 * Fp.BYTES;\n // When hash metadata is available, reject incompatible EdDSA wrappers at construction time\n // instead of deferring the mismatch until the first keygen/sign call.\n if (outputLen !== undefined) {\n asafenumber(outputLen, 'hash.outputLen');\n if (outputLen !== expectedLen)\n throw new Error(`hash.outputLen must be ${expectedLen}, got ${outputLen}`);\n }\n const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;\n const toMontgomery = opts.toMontgomery;\n const toMontgomerySecret = opts.toMontgomerySecret;\n const adjustScalarBytes = opts.adjustScalarBytes === undefined\n ? (bytes) => bytes\n : opts.adjustScalarBytes;\n const domain = opts.domain === undefined\n ? (data, ctx, phflag) => {\n abool(phflag, 'phflag');\n if (ctx.length || phflag)\n throw new Error('Contexts/pre-hash are not supported');\n return data;\n }\n : opts.domain; // NOOP\n // Parse an EdDSA digest as a little-endian integer and reduce it modulo the scalar field order.\n function modN_LE(hash) {\n return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit\n }\n // Get the hashed private scalar per RFC8032 5.1.5\n function getPrivateScalar(key) {\n const len = lengths.secretKey;\n abytes(key, lengths.secretKey, 'secretKey');\n // Hash private key with curve's hash function to produce uniformingly random input\n // Check byte lengths: ensure(64, h(ensure(32, key)))\n const hashed = abytes(hash(key), 2 * len, 'hashedSecretKey');\n // Slice before clamping so in-place adjustors don't corrupt the prefix half.\n const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE\n const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6)\n const scalar = modN_LE(head); // The actual private scalar\n return { head, prefix, scalar };\n }\n /** Convenience method that creates public key from scalar. RFC8032 5.1.5\n * Also exposes the derived scalar/prefix tuple and point form reused by sign().\n */\n function getExtendedPublicKey(secretKey) {\n const { head, prefix, scalar } = getPrivateScalar(secretKey);\n const point = BASE.multiply(scalar); // Point on Edwards curve aka public key\n const pointBytes = point.toBytes();\n return { head, prefix, scalar, point, pointBytes };\n }\n /** Calculates EdDSA pub key. RFC8032 5.1.5. */\n function getPublicKey(secretKey) {\n return getExtendedPublicKey(secretKey).pointBytes;\n }\n // Hash domain-separated chunks into a little-endian scalar modulo the group order.\n function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {\n const msg = concatBytes(...msgs);\n return modN_LE(hash(domain(msg, abytes(context, undefined, 'context'), !!prehash)));\n }\n /** Signs message with secret key. RFC8032 5.1.6 */\n function sign(msg, secretKey, options = {}) {\n validateObject(options, {}, {}, 'options');\n // Snapshot once: nonce and challenge must use the same invocation-time message bytes.\n msg = copyBytes(abytes(msg, undefined, 'message'));\n if (prehash)\n msg = prehash(msg); // for ed25519ph etc.\n const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey);\n const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M)\n // RFC 8032 5.1.6 allows r mod L = 0, and SUPERCOP ref10 accepts the resulting identity-point\n // signature.\n // We intentionally keep the safe multiply() rejection here so a miswired all-zero hash provider\n // fails loudly instead of silently producing a degenerate signature.\n const R = BASE.multiply(r).toBytes(); // R = rG\n const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M)\n const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L\n if (!Fn.isValid(s))\n throw new Error('sign failed: invalid s'); // 0 <= s < L\n const rs = concatBytes(R, Fn.toBytes(s));\n return abytes(rs, lengths.signature, 'result');\n }\n // Keep the shared helper strict by default: RFC 8032 / NIST-style wrappers should reject\n // non-canonical encodings unless they explicitly opt into ZIP-215's more permissive decode rules.\n const verifyOpts = {\n zip215: opts.zip215,\n };\n /**\n * Verifies EdDSA signature against message and public key. RFC 8032 \u00A7\u00A75.1.7 and 5.2.7.\n * A cofactored verification equation is checked.\n */\n function verify(sig, msg, publicKey, options = verifyOpts) {\n // Validate before destructuring so explicit null follows the standard options error.\n validateObject(options);\n // Preserve the wrapper-selected default for `{}` / `{ zip215: undefined }`, not just omitted opts.\n const { context } = options;\n const zip215 = options.zip215 === undefined ? !!verifyOpts.zip215 : options.zip215;\n const len = lengths.signature;\n sig = abytes(sig, len, 'signature');\n msg = abytes(msg, undefined, 'message');\n publicKey = abytes(publicKey, lengths.publicKey, 'publicKey');\n if (zip215 !== undefined)\n abool(zip215, 'zip215');\n if (prehash)\n msg = prehash(msg); // for ed25519ph, etc\n const mid = len / 2;\n const r = sig.subarray(0, mid);\n const s = bytesToNumberLE(sig.subarray(mid, len));\n let A, R, SB;\n try {\n // ZIP-215 is more permissive than RFC 8032 / NIST186-5. Use it only for wrappers that\n // explicitly want consensus-style unreduced encoding acceptance.\n // zip215=true: 0 <= y < MASK (2^256 for ed25519)\n // zip215=false: 0 <= y < P (2^255-19 for ed25519)\n A = Point.fromBytes(publicKey, zip215);\n R = Point.fromBytes(r, zip215);\n SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside\n }\n catch (error) {\n return false;\n }\n // RFC 8032 \u00A7\u00A75.1.7/5.2.7 and FIPS 186-5 \u00A7\u00A77.7.2/7.8.2 only decode A' and check the cofactored\n // verification equation; they do not add a separate low-order-public-key rejection here.\n // Strict mode still rejects small-order A' intentionally for SBS-style non-repudiation and to\n // avoid ambiguous verification outcomes where unusual low-order keys can make distinct\n // key/signature/message combinations verify.\n if (!zip215 && A.isSmallOrder())\n return false;\n // ZIP-215 accepts noncanonical / unreduced point encodings, so the challenge hash must use the\n // exact signature/public-key bytes rather than canonicalized re-encodings of the decoded points.\n const k = hashDomainToScalar(context, r, publicKey, msg);\n const RkA = R.add(A.multiplyUnsafe(k));\n // Check the cofactored verification equation via the curve cofactor h.\n // [h][S]B = [h]R + [h][k]A'\n return RkA.subtract(SB).clearCofactor().is0();\n }\n const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448\n const lengths = {\n secretKey: _size,\n publicKey: _size,\n signature: 2 * _size,\n seed: _size,\n };\n function randomSecretKey(seed) {\n seed = seed === undefined ? randomBytes(lengths.seed) : seed;\n return abytes(seed, lengths.seed, 'seed');\n }\n function isValidSecretKey(key) {\n return isBytes(key) && key.length === lengths.secretKey;\n }\n function isValidPublicKey(key, zip215) {\n try {\n // Preserve the wrapper-selected default for omitted / `undefined` ZIP-215 flags here too.\n return !!Point.fromBytes(key, zip215 === undefined ? verifyOpts.zip215 : zip215);\n }\n catch (error) {\n return false;\n }\n }\n const utils = {\n getExtendedPublicKey,\n randomSecretKey,\n isValidSecretKey,\n isValidPublicKey,\n /** Converts an Edwards public key to a companion Montgomery public key. */\n toMontgomery(publicKey) {\n if (toMontgomery === undefined)\n throw new Error('Montgomery conversion is not supported for this curve');\n return toMontgomery(Point.fromBytes(publicKey));\n },\n toMontgomerySecret(secretKey) {\n if (toMontgomerySecret === undefined)\n throw new Error('Montgomery conversion is not supported for this curve');\n return toMontgomerySecret(secretKey);\n },\n };\n Object.freeze(lengths);\n Object.freeze(utils);\n return Object.freeze({\n keygen: createKeygen(randomSecretKey, getPublicKey),\n getPublicKey,\n sign,\n verify,\n utils,\n Point,\n lengths,\n });\n}\n", "/**\n * ed25519 Twisted Edwards curve with following addons:\n * - X25519 ECDH\n * - Ristretto cofactor elimination\n * - Elligator hash-to-group / point indistinguishability\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha512 } from '@noble/hashes/sha2.js';\nimport { abytes, concatBytes, hexToBytes } from '@noble/hashes/utils.js';\nimport {} from \"./abstract/curve.js\";\nimport { eddsa, edwards, PrimeEdwardsPoint, } from \"./abstract/edwards.js\";\nimport { createFROST } from \"./abstract/frost.js\";\nimport { _DST_scalar, createHasher, expand_message_xmd, } from \"./abstract/hash-to-curve.js\";\nimport { FpInvertBatch, FpSqrtEven, isNegativeLE, mod, pow2, } from \"./abstract/modular.js\";\nimport { montgomery } from \"./abstract/montgomery.js\";\nimport { createOPRF } from \"./abstract/oprf.js\";\nimport { asciiToBytes, bytesToNumberLE, equalBytes } from \"./utils.js\";\n// prettier-ignore\nconst _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3);\n// prettier-ignore\nconst _5n = /* @__PURE__ */ BigInt(5), _8n = /* @__PURE__ */ BigInt(8);\n// P = 2n**255n - 19n\nconst ed25519_CURVE_p = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed');\n// N = 2n**252n + 27742317777372353535851937790883648493n\n// a = Fp.create(BigInt(-1))\n// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666))\nconst ed25519_CURVE = /* @__PURE__ */ (() => ({\n p: ed25519_CURVE_p,\n n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'),\n h: _8n,\n a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'),\n d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'),\n Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'),\n Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'),\n}))();\nfunction ed25519_pow_2_252_3(x) {\n // prettier-ignore\n const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);\n const P = ed25519_CURVE_p;\n const x2 = (x * x) % P;\n const b2 = (x2 * x) % P; // x^3, 11\n const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111\n const b5 = (pow2(b4, _1n, P) * x) % P; // x^31\n const b10 = (pow2(b5, _5n, P) * b5) % P;\n const b20 = (pow2(b10, _10n, P) * b10) % P;\n const b40 = (pow2(b20, _20n, P) * b20) % P;\n const b80 = (pow2(b40, _40n, P) * b40) % P;\n const b160 = (pow2(b80, _80n, P) * b80) % P;\n const b240 = (pow2(b160, _80n, P) * b80) % P;\n const b250 = (pow2(b240, _10n, P) * b10) % P;\n const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P;\n // ^ This is x^((p-5)/8); multiply by x once more to get x^((p+3)/8).\n return { pow_p_5_8, b2 };\n}\n// Mutates and returns the provided 32-byte buffer in place.\nfunction adjustScalarBytes(bytes) {\n // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar,\n // set the three least significant bits of the first byte\n bytes[0] &= 248; // 0b1111_1000\n // and the most significant bit of the last to zero,\n bytes[31] &= 127; // 0b0111_1111\n // set the second most significant bit of the last byte to 1\n bytes[31] |= 64; // 0b0100_0000\n return bytes;\n}\n// \u221A(-1) aka \u221A(a) aka 2^((p-1)/4)\n// Fp.sqrt(Fp.neg(1))\nconst ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752');\n// sqrt(u/v). Returns `{ isValid, value }`; on non-squares `value` is still a\n// dummy root-shaped field element so callers can stay constant-time.\nfunction uvRatio(u, v) {\n const P = ed25519_CURVE_p;\n const v3 = mod(v * v * v, P); // v\u00B3\n const v7 = mod(v3 * v3 * v, P); // v\u2077\n // (p+3)/8 and (p-5)/8\n const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;\n let x = mod(u * v3 * pow, P); // (uv\u00B3)(uv\u2077)^(p-5)/8\n const vx2 = mod(v * x * x, P); // vx\u00B2\n const root1 = x; // First root candidate\n const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate\n const useRoot1 = vx2 === u; // If vx\u00B2 = u (mod p), x is a square root\n const useRoot2 = vx2 === mod(-u, P); // If vx\u00B2 = -u, set x <-- x * 2^((p-1)/4)\n const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx\u00B2 = -u\u221A(-1)\n if (useRoot1)\n x = root1;\n if (useRoot2 || noRoot)\n x = root2; // We return root2 anyway, for const-time\n if (isNegativeLE(x, P))\n x = mod(-x, P);\n return { isValid: useRoot1 || useRoot2, value: x };\n}\nconst ed25519_Point = /* @__PURE__ */ edwards(ed25519_CURVE, { uvRatio });\n// Public field alias stays stricter than the RFC 8032 Appendix A sample code:\n// `Fp.inv(0)` throws instead of returning `0`.\nconst Fp = /* @__PURE__ */ (() => ed25519_Point.Fp)();\nfunction toMontgomery(point) {\n // Birational map from Ed25519 to Curve25519 / X25519:\n // (u, v) = ((1 + y) / (1 - y), sqrt(-486664) * u / x)\n // (x, y) = (sqrt(-486664) * u / v, (u - 1) / (u + 1))\n const { y } = point;\n return Fp.toBytes(Fp.div(_1n + y, _1n - y));\n}\nfunction toMontgomerySecret(secretKey) {\n const size = ed25519_Point.Fp.BYTES;\n abytes(secretKey, size);\n return adjustScalarBytes(sha512(secretKey.subarray(0, size))).subarray(0, size);\n}\nconst Fn = /* @__PURE__ */ (() => ed25519_Point.Fn)();\n// RFC 8032 `dom2` helper for ctx/ph variants only. Plain Ed25519 keeps the\n// empty-domain path in `ed()` and would be wrong if routed through this helper.\nfunction ed25519_domain(data, ctx, phflag) {\n if (ctx.length > 255)\n throw new Error('Context is too big');\n return concatBytes(asciiToBytes('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data);\n}\nfunction ed(opts) {\n // Ed25519 keeps ZIP-215 default verification semantics for consensus compatibility.\n return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes, toMontgomery, toMontgomerySecret, zip215: true }, opts));\n}\n/**\n * ed25519 curve with EdDSA signatures.\n * Seeded `keygen(seed)` / `utils.randomSecretKey(seed)` reuse the provided\n * 32-byte seed buffer instead of copying it.\n * @example\n * Generate one Ed25519 keypair, sign a message, and verify it.\n *\n * ```js\n * import { ed25519 } from '@noble/curves/ed25519.js';\n * const { secretKey, publicKey } = ed25519.keygen();\n * // const publicKey = ed25519.getPublicKey(secretKey);\n * const msg = new TextEncoder().encode('hello noble');\n * const sig = ed25519.sign(msg, secretKey);\n * const isValid = ed25519.verify(sig, msg, publicKey); // ZIP215\n * // RFC8032 / FIPS 186-5\n * const isValid2 = ed25519.verify(sig, msg, publicKey, { zip215: false });\n * ```\n */\nexport const ed25519 = /* @__PURE__ */ ed({});\n/**\n * Context version of ed25519 (ctx for domain separation). See {@link ed25519}\n * Seeded `keygen(seed)` / `utils.randomSecretKey(seed)` reuse the provided\n * 32-byte seed buffer instead of copying it.\n * @example\n * Sign and verify with Ed25519ctx under one explicit context.\n *\n * ```ts\n * const context = new TextEncoder().encode('docs');\n * const { secretKey, publicKey } = ed25519ctx.keygen();\n * const msg = new TextEncoder().encode('hello noble');\n * const sig = ed25519ctx.sign(msg, secretKey, { context });\n * const isValid = ed25519ctx.verify(sig, msg, publicKey, { context });\n * ```\n */\nexport const ed25519ctx = /* @__PURE__ */ ed({ domain: ed25519_domain });\n/**\n * Prehashed version of ed25519. See {@link ed25519}\n * Seeded `keygen(seed)` / `utils.randomSecretKey(seed)` reuse the provided\n * 32-byte seed buffer instead of copying it.\n * @example\n * Use the prehashed Ed25519 variant for one message.\n *\n * ```ts\n * const { secretKey, publicKey } = ed25519ph.keygen();\n * const msg = new TextEncoder().encode('hello noble');\n * const sig = ed25519ph.sign(msg, secretKey);\n * const isValid = ed25519ph.verify(sig, msg, publicKey);\n * ```\n */\nexport const ed25519ph = /* @__PURE__ */ ed({ domain: ed25519_domain, prehash: sha512 });\n/**\n * FROST threshold signatures over ed25519. RFC 9591.\n * @example\n * Create one trusted-dealer package for 2-of-3 ed25519 signing.\n *\n * ```ts\n * const alice = ed25519_FROST.Identifier.derive('alice@example.com');\n * const bob = ed25519_FROST.Identifier.derive('bob@example.com');\n * const carol = ed25519_FROST.Identifier.derive('carol@example.com');\n * const deal = ed25519_FROST.trustedDealer({ min: 2, max: 3 }, [alice, bob, carol]);\n * ```\n */\nexport const ed25519_FROST = /* @__PURE__ */ (() => createFROST({\n name: 'FROST-ED25519-SHA512-v1',\n Point: ed25519_Point,\n validatePoint: (p) => {\n p.assertValidity();\n if (!p.isTorsionFree())\n throw new Error('bad point: not torsion-free');\n },\n hash: sha512,\n // RFC 9591 keeps H2 undecorated here for RFC 8032 compatibility. In createFROST(),\n // `H2: ''` becomes an empty DST prefix; the built-in hashToScalar fallback treats\n // that the same as omitted DST, even though custom hooks can still observe the empty bag.\n H2: '',\n}))();\n/**\n * ECDH using curve25519 aka x25519.\n * `getSharedSecret()` rejects low-order peer inputs by default, and seeded\n * `keygen(seed)` reuses the provided 32-byte seed buffer instead of copying it.\n * @example\n * Derive one shared secret between two X25519 peers.\n *\n * ```js\n * import { x25519 } from '@noble/curves/ed25519.js';\n * const alice = x25519.keygen();\n * const bob = x25519.keygen();\n * const alicePublic = x25519.getPublicKey(alice.secretKey);\n * const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey);\n * ```\n */\nexport const x25519 = /* @__PURE__ */ (() => {\n const P = ed25519_CURVE_p;\n const powPminus2 = (x) => {\n // x^(p-2) aka x^(2^255-21)\n const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);\n return mod(pow2(pow_p_5_8, _3n, P) * b2, P);\n };\n return montgomery({\n P,\n type: 'x25519',\n powPminus2,\n adjustScalarBytes,\n // ~3x faster fixed-base: [k]B on the birationally-equivalent Edwards curve using cached\n // base tables, mapped back via u = (1+y)/(1-y) = (Z+Y)/(Z-Y) with one Fermat inversion.\n // Same construction as libsodium's crypto_scalarmult_curve25519_base.\n scalarMultBase: (k) => {\n // Clamped k (\u22482^254) exceeds n, but B has prime order n, so [k]B == [k mod n]B.\n const kn = mod(k, ed25519_Point.Fn.ORDER);\n // k \u2261 0 (mod n): [k]B is the point at infinity, whose u is 0 in the x-only ladder;\n // returning 0 makes montgomery() reject it exactly like the ladder path.\n if (kn === _0n)\n return _0n;\n const p = ed25519_Point.BASE.multiply(kn);\n // Z-Y == 0 only at the identity, which kn != 0 excludes.\n return mod((p.Z + p.Y) * powPminus2(mod(p.Z - p.Y, P)), P);\n },\n });\n})();\n// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator)\n// RFC 9380 Appendix G.2.2 / Err4730 requires `sgn0(c1) = 0` for the Edwards\n// map constant below, so use the even root explicitly.\n// 1. c1 = (q + 3) / 8 # Integer arithmetic\nconst ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)();\nconst ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1\nconst ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1)\nconst ELL2_J = /* @__PURE__ */ BigInt(486662);\n/**\n * RFC 9380 method `map_to_curve_elligator2_curve25519`. Experimental name: may be renamed later.\n * @private\n */\n// prettier-ignore\nexport function _map_to_curve_elligator2_curve25519(u) {\n // 4. c4 = (q - 5) / 8: tv2^c4 below reuses the ed25519_pow_2_252_3 addition chain,\n // whose pow_p_5_8 output is exactly x^((p-5)/8).\n let tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1\n // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not\n let xd = Fp.add(tv1, Fp.ONE);\n let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2)\n let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2\n let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3\n let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd\n gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd\n gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2\n gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2\n let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2\n tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4\n tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3\n tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3\n tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7\n let y11 = ed25519_pow_2_252_3(tv2).pow_p_5_8; // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)\n y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8)\n let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3\n tv2 = Fp.sqr(y11); // 19. tv2 = y11^2\n tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd\n let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1\n // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt\n let y1 = Fp.cmov(y12, y11, e1);\n let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd\n let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u\n y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2\n let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3\n let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1)\n tv2 = Fp.sqr(y21); // 28. tv2 = y21^2\n tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd\n let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2\n // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt\n let y2 = Fp.cmov(y22, y21, e2);\n tv2 = Fp.sqr(y1); // 32. tv2 = y1^2\n tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd\n let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1\n let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2\n let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2\n let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y\n y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4)\n return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1)\n}\n// sgn0(c1) MUST equal 0\nconst ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))();\nfunction map_to_curve_elligator2_edwards25519(u) {\n // 1. (xMn, xMd, yMn, yMd) = map_to_curve_elligator2_curve25519(u)\n const { xMn, xMd, yMn, yMd } = _map_to_curve_elligator2_curve25519(u);\n // map_to_curve_elligator2_curve25519(u)\n let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd\n xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1\n let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM\n let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd\n // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d)\n let yd = Fp.add(xMn, xMd);\n let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd\n let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0\n xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e)\n xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e)\n yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e)\n yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e)\n const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division\n // Noble normalizes the RFC rational representation to affine `{ x, y }`\n // before returning from the internal helper.\n return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd)\n}\n/**\n * Hashing to ed25519 points / field. RFC 9380 methods.\n * Public `mapToCurve()` returns the cofactor-cleared subgroup point; the\n * internal map callback below consumes one field element bigint, not `[bigint]`.\n * @example\n * Hash one message onto the ed25519 curve.\n *\n * ```ts\n * const point = ed25519_hasher.hashToCurve(new TextEncoder().encode('hello noble'));\n * ```\n */\nexport const ed25519_hasher = /* @__PURE__ */ (() => createHasher(ed25519_Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {\n DST: 'edwards25519_XMD:SHA-512_ELL2_RO_',\n encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_',\n p: ed25519_CURVE_p,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha512,\n}))();\n// \u221A(-1) aka \u221A(a) aka 2^((p-1)/4)\nconst SQRT_M1 = ED25519_SQRT_M1;\n// \u221A(ad - 1)\nconst SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235');\n// 1 / \u221A(a-d)\nconst INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578');\n// 1-d\u00B2\nconst ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838');\n// (d-1)\u00B2\nconst D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952');\n// `SQRT_RATIO_M1(1, number)` specialization. Returns `{ isValid, value }`,\n// where non-squares get the nonnegative `sqrt(SQRT_M1 / number)` branch.\nconst invertSqrt = (number) => uvRatio(_1n, number);\nconst MAX_255B = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');\n// RFC 9496 \u00A74.3.4 MAP parser: masks bit 255 and reduces modulo p for element\n// derivation. The decode path has the opposite contract and rejects that bit.\nconst bytes255ToNumberLE = (bytes) => Fp.create(bytesToNumberLE(bytes) & MAX_255B);\n/**\n * Computes Elligator map for Ristretto255.\n * Primary formula source is RFC 9496 \u00A74.3.4 MAP; RFC 9380 Appendix B builds\n * `hash_to_ristretto255` on top of this helper.\n * Returns an internal Edwards representative, not a public `_RistrettoPoint`.\n */\nfunction calcElligatorRistrettoMap(r0) {\n const { d } = ed25519_CURVE;\n const r = Fp.mul(Fp.mulN(SQRT_M1, r0), r0); // 1\n const Ns = Fp.mul(Fp.addN(r, _1n), ONE_MINUS_D_SQ); // 2\n let c = BigInt(-1); // 3\n const D = Fp.mul(Fp.subN(c, Fp.mulN(d, r)), Fp.add(r, d)); // 4\n let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5\n let s_ = Fp.mul(s, r0); // 6\n if (!Fp.isOdd(s_))\n s_ = Fp.neg(s_);\n if (!Ns_D_is_sq)\n s = s_; // 7\n if (!Ns_D_is_sq)\n c = r; // 8\n const Nt = Fp.sub(Fp.mulN(Fp.mulN(c, Fp.subN(r, _1n)), D_MINUS_ONE_SQ), D); // 9\n const s2 = Fp.sqrN(s);\n const W0 = Fp.mul(Fp.addN(s, s), D); // 10\n const W1 = Fp.mul(Nt, SQRT_AD_MINUS_ONE); // 11\n const W2 = Fp.sub(_1n, s2); // 12\n const W3 = Fp.add(_1n, s2); // 13\n return new ed25519_Point(Fp.mul(W0, W3), Fp.mul(W2, W1), Fp.mul(W1, W3), Fp.mul(W0, W2));\n}\n/**\n * Wrapper over Edwards Point for ristretto255.\n *\n * Each ed25519/EdwardsPoint has 8 different equivalent points. This can be\n * a source of bugs for protocols like ring signatures. Ristretto was created to solve this.\n * Ristretto point operates in X:Y:Z:T extended coordinates like EdwardsPoint,\n * but it should work in its own namespace: do not combine those two.\n * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496).\n */\nclass _RistrettoPoint extends PrimeEdwardsPoint {\n // Do NOT change syntax: the following gymnastics is done,\n // because typescript strips comments, which makes bundlers disable tree-shaking.\n // prettier-ignore\n static BASE = \n /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.BASE))();\n // prettier-ignore\n static ZERO = \n /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.ZERO))();\n // prettier-ignore\n static Fp = \n /* @__PURE__ */ (() => Fp)();\n // prettier-ignore\n static Fn = \n /* @__PURE__ */ (() => Fn)();\n constructor(ep) {\n super(ep);\n }\n /**\n * Create one Ristretto255 point from affine Edwards coordinates.\n * This wraps the internal Edwards representative directly and is not a\n * canonical ristretto255 decoding path.\n * Use `toBytes()` / `fromBytes()` if canonical ristretto255 bytes matter.\n */\n static fromAffine(ap) {\n return new _RistrettoPoint(ed25519_Point.fromAffine(ap));\n }\n assertSame(other) {\n if (!(other instanceof _RistrettoPoint))\n throw new Error('RistrettoPoint expected');\n }\n init(ep) {\n return new _RistrettoPoint(ep);\n }\n static fromBytes(bytes) {\n abytes(bytes, 32);\n const { a, d } = ed25519_CURVE;\n const s = bytes255ToNumberLE(bytes);\n // 1. Check that s_bytes is the canonical encoding of a field element, or else abort.\n // 3. Check that s is non-negative, or else abort\n if (!equalBytes(Fp.toBytes(s), bytes) || Fp.isOdd(s))\n throw new Error('invalid ristretto255 encoding 1');\n const s2 = Fp.sqr(s);\n const u1 = Fp.add(_1n, Fp.mulN(a, s2)); // 4 (a is -1)\n const u2 = Fp.sub(_1n, Fp.mulN(a, s2)); // 5\n const u1_2 = Fp.sqr(u1);\n const u2_2 = Fp.sqr(u2);\n const v = Fp.sub(Fp.mulN(Fp.mulN(a, d), u1_2), u2_2); // 6\n const { isValid, value: I } = invertSqrt(Fp.mul(v, u2_2)); // 7\n const Dx = Fp.mul(I, u2); // 8\n const Dy = Fp.mul(Fp.mulN(I, Dx), v); // 9\n let x = Fp.mul(Fp.addN(s, s), Dx); // 10\n if (Fp.isOdd(x))\n x = Fp.neg(x); // 10\n const y = Fp.mul(u1, Dy); // 11\n const t = Fp.mul(x, y); // 12\n if (!isValid || Fp.isOdd(t) || Fp.is0(y))\n throw new Error('invalid ristretto255 encoding 2');\n return new _RistrettoPoint(new ed25519_Point(x, y, Fp.ONE, t));\n }\n /**\n * Converts ristretto-encoded string to ristretto point.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode).\n * @param hex - Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding\n */\n static fromHex(hex) {\n return _RistrettoPoint.fromBytes(hexToBytes(hex));\n }\n /**\n * Encodes ristretto point to Uint8Array.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode).\n */\n toBytes() {\n let { X, Y, Z, T } = this.ep;\n const u1 = Fp.mul(Fp.add(Z, Y), Fp.sub(Z, Y)); // 1\n const u2 = Fp.mul(X, Y); // 2\n // Square root always exists\n const u2sq = Fp.sqr(u2);\n const { value: invsqrt } = invertSqrt(Fp.mul(u1, u2sq)); // 3\n const D1 = Fp.mul(invsqrt, u1); // 4\n const D2 = Fp.mul(invsqrt, u2); // 5\n const zInv = Fp.mul(Fp.mulN(D1, D2), T); // 6\n let D; // 7\n if (Fp.isOdd(Fp.mul(T, zInv))) {\n let _x = Fp.mul(Y, SQRT_M1);\n let _y = Fp.mul(X, SQRT_M1);\n X = _x;\n Y = _y;\n D = Fp.mul(D1, INVSQRT_A_MINUS_D);\n }\n else {\n D = D2; // 8\n }\n if (Fp.isOdd(Fp.mul(X, zInv)))\n Y = Fp.neg(Y); // 9\n let s = Fp.mul(Fp.subN(Z, Y), D); // 10 (check footer's note, no sqrt(-a))\n if (Fp.isOdd(s))\n s = Fp.neg(s);\n return Fp.toBytes(s); // 11\n }\n /**\n * Compares two Ristretto points.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals).\n */\n equals(other) {\n this.assertSame(other);\n const { X: X1, Y: Y1 } = this.ep;\n const { X: X2, Y: Y2 } = other.ep;\n // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2)\n const one = Fp.eql(Fp.mul(X1, Y2), Fp.mul(Y1, X2));\n const two = Fp.eql(Fp.mul(Y1, Y2), Fp.mul(X1, X2));\n return one || two;\n }\n is0() {\n return this.equals(_RistrettoPoint.ZERO);\n }\n}\n/** Prime-order Ristretto255 group bundle. */\nexport const ristretto255 = /* @__PURE__ */ (() => {\n Object.freeze(_RistrettoPoint.BASE);\n Object.freeze(_RistrettoPoint.ZERO);\n Object.freeze(_RistrettoPoint.prototype);\n Object.freeze(_RistrettoPoint);\n return Object.freeze({ Point: _RistrettoPoint });\n})();\n/**\n * Hashing to ristretto255 points / field. RFC 9380 methods.\n * `hashToCurve()` is RFC 9380 Appendix B, `deriveToCurve()` is the RFC 9496\n * \u00A74.3.4 element-derivation building block, and `hashToScalar()` is a\n * library-specific helper for OPRF-style use.\n * @example\n * Hash one message onto ristretto255.\n *\n * ```ts\n * const point = ristretto255_hasher.hashToCurve(new TextEncoder().encode('hello noble'));\n * ```\n */\nexport const ristretto255_hasher = \n/* @__PURE__ */ Object.freeze({\n Point: _RistrettoPoint,\n /**\n * Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats:\n * * There are no test vectors\n * * encodeToCurve / mapToCurve is undefined\n * * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map!\n * * hashToScalar is undefined too, so we just use OPRF implementation\n * * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC\n (os2ip -> bytes255ToNumberLE)\n * * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map\n * * hashToScalar is undefined in RFC9380 for ristretto, so we use the OPRF\n version here. Using `bytes255ToNumblerLE` will create a different result\n if we use `bytes255ToNumberLE` as os2ip\n * * current version is closest to spec.\n */\n hashToCurve(msg, options) {\n // == 'hash_to_ristretto255'\n // Preserve explicit empty/invalid DST overrides so expand_message_xmd() can reject them.\n const DST = options?.DST === undefined ? 'ristretto255_XMD:SHA-512_R255MAP_RO_' : options.DST;\n const xmd = expand_message_xmd(msg, DST, 64, sha512);\n // NOTE: RFC 9380 incorrectly calls this function `ristretto255_map`.\n // In RFC 9496, `map` was the per-point function inside the construction.\n // That also led to confusion that `ristretto255_map` is `mapToCurve`.\n // It is not: it is the older hash-to-curve construction.\n return ristretto255_hasher.deriveToCurve(xmd);\n },\n hashToScalar(msg, options) {\n const DST = options?.DST === undefined ? _DST_scalar : options.DST;\n const xmd = expand_message_xmd(msg, DST, 64, sha512);\n return Fn.create(bytesToNumberLE(xmd));\n },\n /**\n * HashToCurve-like construction based on RFC 9496 (Element Derivation).\n * Converts 64 uniform random bytes into a curve point.\n *\n * WARNING: This represents an older hash-to-curve construction from before\n * RFC 9380 was finalized.\n * It was later reused as a component in the newer\n * `hash_to_ristretto255` function defined in RFC 9380.\n */\n deriveToCurve(bytes) {\n // https://www.rfc-editor.org/rfc/rfc9496.html#name-element-derivation\n abytes(bytes, 64);\n const r1 = bytes255ToNumberLE(bytes.subarray(0, 32));\n const R1 = calcElligatorRistrettoMap(r1);\n const r2 = bytes255ToNumberLE(bytes.subarray(32, 64));\n const R2 = calcElligatorRistrettoMap(r2);\n return new _RistrettoPoint(R1.add(R2));\n },\n});\n/**\n * ristretto255 OPRF/VOPRF/POPRF bundle, defined in RFC 9497.\n * @example\n * Run one blind/evaluate/finalize OPRF round over ristretto255.\n *\n * ```ts\n * const input = new TextEncoder().encode('hello noble');\n * const keys = ristretto255_oprf.oprf.generateKeyPair();\n * const blind = ristretto255_oprf.oprf.blind(input);\n * const evaluated = ristretto255_oprf.oprf.blindEvaluate(keys.secretKey, blind.blinded);\n * const output = ristretto255_oprf.oprf.finalize(input, blind.blind, evaluated);\n * ```\n */\nexport const ristretto255_oprf = /* @__PURE__ */ (() => createOPRF({\n name: 'ristretto255-SHA512',\n Point: _RistrettoPoint,\n hash: sha512,\n hashToGroup: ristretto255_hasher.hashToCurve,\n hashToScalar: ristretto255_hasher.hashToScalar,\n}))();\n/**\n * FROST threshold signatures over ristretto255. RFC 9591.\n * @example\n * Create one trusted-dealer package for 2-of-3 ristretto255 signing.\n *\n * ```ts\n * const alice = ristretto255_FROST.Identifier.derive('alice@example.com');\n * const bob = ristretto255_FROST.Identifier.derive('bob@example.com');\n * const carol = ristretto255_FROST.Identifier.derive('carol@example.com');\n * const deal = ristretto255_FROST.trustedDealer({ min: 2, max: 3 }, [alice, bob, carol]);\n * ```\n */\nexport const ristretto255_FROST = /* @__PURE__ */ (() => createFROST({\n name: 'FROST-RISTRETTO255-SHA512-v1',\n Point: _RistrettoPoint,\n validatePoint: (p) => {\n // Prime-order wrappers are torsion-free at the abstract-group level.\n p.assertValidity();\n },\n hash: sha512,\n}))();\n/**\n * Weird / bogus points, useful for debugging.\n * All 8 ed25519 points of 8-torsion subgroup can be generated from the point\n * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`.\n * The subgroup generated by `T` is `{ O, T, 2T, 3T, 4T, 5T, 6T, 7T }`; the\n * array below is that set, not the powers in that exact index order.\n * @example\n * Decode one known torsion point for debugging.\n *\n * ```ts\n * import { ED25519_TORSION_SUBGROUP, ed25519 } from '@noble/curves/ed25519.js';\n * const point = ed25519.Point.fromHex(ED25519_TORSION_SUBGROUP[1]);\n * ```\n */\nexport const ED25519_TORSION_SUBGROUP = /* @__PURE__ */ Object.freeze([\n '0100000000000000000000000000000000000000000000000000000000000000',\n 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a',\n '0000000000000000000000000000000000000000000000000000000000000080',\n '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05',\n 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f',\n '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85',\n '0000000000000000000000000000000000000000000000000000000000000000',\n 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa',\n]);\n", "\nimport {hex} from \"@e280/stz\"\nimport {Hex} from \"./types.js\"\n\n/** convert hex key to bytes */\nexport function keyBytes(key: Hex) {\n\tconst keyBytes = hex.toBytes(key)\n\n\tif (keyBytes.length !== 32)\n\t\tthrow new Error(\"invalid hex key\")\n\n\treturn keyBytes\n}\n\n", "\nimport {ed25519} from \"@noble/curves/ed25519.js\"\nimport {Id} from \"./types.js\"\nimport {keyBytes} from \"./key-bytes.js\"\n\nexport function verifyBytes(id: Id, message: Uint8Array, signature: Uint8Array) {\n\treturn ed25519.verify(signature, message, keyBytes(id))\n}\n\n", "\nimport {happy} from \"@e280/stz\"\nimport {Payload} from \"../types.js\"\nimport {tokenTime} from \"../token-time.js\"\nimport {TokenErr} from \"../../errs/token-err.js\"\n\nexport function assertFresh<P extends Payload>(payload: P, atTime: number, maxAge?: number) {\n\tif (maxAge === undefined)\n\t\treturn payload\n\n\tif (!happy(payload.iat))\n\t\tthrow new TokenErr(`iat required`)\n\n\tconst issuedAt = tokenTime.toMs(payload.iat)\n\tconst staleAt = issuedAt + maxAge\n\n\tif (atTime >= staleAt)\n\t\tthrow new TokenErr(`exceeded max age`)\n\n\treturn payload\n}\n\n", "\nimport {happy} from \"@e280/stz\"\nimport {Id} from \"../cryp/types.js\"\nimport {tokenTime} from \"./token-time.js\"\nimport {TokenErr} from \"../errs/token-err.js\"\nimport {decodeToken} from \"./decode-token.js\"\nimport {verifyBytes} from \"../cryp/verify-bytes.js\"\nimport {assertFresh} from \"./utils/assert-fresh.js\"\nimport {Payload, TokenVerifications} from \"./types.js\"\n\nexport function verifyToken<P extends Payload>(\n\t\tid: Id,\n\t\ttoken: string,\n\t\toptions: TokenVerifications = {},\n\t): P {\n\n\tconst {\n\t\tatTime = Date.now(),\n\t\tmaxAge,\n\t\tallowedIssuers,\n\t\tallowedAudiences,\n\t} = options\n\n\tconst [headerText, payloadText] = token.split(\".\")\n\tconst {payload, signature} = decodeToken<P>(token)\n\tconst signingText = `${headerText}.${payloadText}`\n\tconst signingBytes = new TextEncoder().encode(signingText)\n\n\tif (!verifyBytes(id, signingBytes, signature))\n\t\tthrow new TokenErr(`bad signature`)\n\n\tif (happy(payload.exp)) {\n\t\tconst expiresAt = tokenTime.toMs(payload.exp)\n\t\tif (atTime >= expiresAt)\n\t\t\tthrow new TokenErr(`expired`)\n\t}\n\n\tif (happy(payload.nbf)) {\n\t\tconst notBefore = tokenTime.toMs(payload.nbf)\n\t\tif (atTime < notBefore)\n\t\t\tthrow new TokenErr(`too soon for nbf`)\n\t}\n\n\tif (allowedIssuers) {\n\t\tif (!payload.iss)\n\t\t\tthrow new TokenErr(`missing iss`)\n\t\tif (!allowedIssuers.includes(payload.iss))\n\t\t\tthrow new TokenErr(`bad iss \"${payload.iss}\"`)\n\t}\n\n\tif (allowedAudiences) {\n\t\tif (!payload.aud)\n\t\t\tthrow new TokenErr(`missing aud`)\n\t\tif (!allowedAudiences.includes(payload.aud))\n\t\t\tthrow new TokenErr(`bad aud \"${payload.aud}\"`)\n\t}\n\n\tif (payload.aud && !allowedAudiences)\n\t\tthrow new TokenErr(`aud requires allowedAudiences but it was not provided`)\n\n\tassertFresh(payload, atTime, maxAge)\n\n\treturn payload\n}\n\n", "\nimport {Proof} from \"./types.js\"\nimport {Payload} from \"../../tok/types.js\"\nimport {TokenErr} from \"../../errs/token-err.js\"\nimport {verifyToken} from \"../../tok/verify-token.js\"\nimport {decodeToken} from \"../../tok/decode-token.js\"\n\nexport function verifyProof(proofToken: string, options: {\n\t\tallowedAudiences: string[]\n\n\t\tatTime?: number\n\t\tmaxAge?: number\n\t\tallowedIssuers?: string[]\n\t\tallowedPurposes?: string[]\n\t\tallowedScopes?: string[]\n\t}): Proof {\n\n\tconst {\n\t\tatTime = Date.now(),\n\t\tmaxAge,\n\t\tallowedIssuers,\n\t\tallowedAudiences,\n\t\tallowedScopes,\n\t\tallowedPurposes,\n\t} = options\n\n\tconst decoded = decodeToken<Payload<{proof: Proof}>>(proofToken)\n\n\tconst {proof} = verifyToken<Payload<{proof: Proof}>>(\n\t\tdecoded.payload.proof.id,\n\t\tproofToken,\n\t\t{atTime, maxAge, allowedIssuers, allowedAudiences},\n\t)\n\t\n\tif (allowedPurposes && !allowedPurposes.includes(proof.purpose))\n\t\tthrow new TokenErr(`purpose not allowed \"${proof.purpose}\"`)\n\n\tif (allowedScopes && !allowedScopes.includes(proof.scope))\n\t\tthrow new TokenErr(`scope not allowed \"${proof.scope}\"`)\n\n\treturn proof\n}\n\n", "\nimport {hex} from \"@e280/stz\"\nimport {ed25519} from \"@noble/curves/ed25519.js\"\n\nimport {Id, Secret} from \"./types.js\"\nimport {keyBytes} from \"./key-bytes.js\"\n\nexport function deriveId(secret: Secret): Id {\n\tconst secretBytes = keyBytes(secret)\n\tconst idBytes = ed25519.getPublicKey(secretBytes)\n\treturn hex.fromBytes(idBytes)\n}\n\n", "\nimport {Delegate} from \"./types.js\"\nimport {Proof} from \"../proof/types.js\"\nimport {verifyProof} from \"../proof/verify.js\"\nimport {deriveId} from \"../../cryp/derive-id.js\"\nimport {TokenErr} from \"../../errs/token-err.js\"\n\nexport function verifyDelegate(delegate: Delegate, options: {\n\t\tallowedPurposes: string[]\n\t\tallowedAudiences: string[]\n\t\tallowedScopes?: string[]\n\t\tallowedIssuers?: string[]\n\t\tatTime?: number\n\t\tmaxAge?: number\n\t}): {delegate: Delegate, proof: Proof} {\n\n\tconst proof = verifyProof(delegate.proofToken, options)\n\n\tif (deriveId(delegate.secret) !== proof.delegateId)\n\t\tthrow new TokenErr(\"delegateId mismatch\")\n\n\treturn {delegate, proof}\n}\n\n", "\nimport {TokenHeader} from \"./types.js\"\n\nexport const tokenHeader: TokenHeader = {typ: \"JWT\", alg: \"EdDSA\"}\n\n", "\nimport {ed25519} from \"@noble/curves/ed25519.js\"\nimport {keyBytes} from \"./key-bytes.js\"\nimport {Secret} from \"./types.js\"\n\nexport function signBytes(secret: Secret, message: Uint8Array) {\n\treturn ed25519.sign(message, keyBytes(secret))\n}\n\n", "\nimport {base64url, txt} from \"@e280/stz\"\nimport {Payload} from \"./types.js\"\nimport {Secret} from \"../cryp/types.js\"\nimport {tokenHeader} from \"./token-header.js\"\nimport {signBytes} from \"../cryp/sign-bytes.js\"\n\nexport function signToken<P extends Payload>(secret: Secret, payload: P): string {\n\tconst headerBytes = txt.toBytes(JSON.stringify(tokenHeader))\n\tconst headerText = base64url.fromBytes(headerBytes)\n\n\tconst payloadBytes = txt.toBytes(JSON.stringify(payload))\n\tconst payloadText = base64url.fromBytes(payloadBytes)\n\n\tconst signingText = `${headerText}.${payloadText}`\n\tconst signingBytes = new TextEncoder().encode(signingText)\n\tconst signature = base64url.fromBytes(signBytes(secret, signingBytes))\n\n\treturn `${signingText}.${signature}`\n}\n\n", "\nimport {happy, hex} from \"@e280/stz\"\nimport {Secret} from \"../../cryp/types.js\"\nimport {ClaimOptions} from \"./types/options.js\"\nimport {signToken} from \"../../tok/sign-token.js\"\nimport {tokenTime} from \"../../tok/token-time.js\"\n\nexport function signClaim<X>(\n\t\tdelegate: {secret: Secret, proofToken: string},\n\t\tclaim: X,\n\t\toptions: ClaimOptions = {}\n\t) {\n\n\tconst {secret, proofToken} = delegate\n\tconst {audience, expiresAt, atTime = Date.now()} = options\n\n\treturn signToken(secret, {\n\t\tclaim,\n\t\tproofToken,\n\t\tjti: hex.random(16),\n\t\tiat: tokenTime.at(atTime),\n\t\taud: audience,\n\t\texp: happy(expiresAt)\n\t\t\t? tokenTime.at(expiresAt)\n\t\t\t: undefined,\n\t})\n}\n\n", "\nimport {deep, time} from \"@e280/stz\"\n\nexport const consts = deep.freeze({\n\tnamespace: \"authlocal4\",\n\tdelegatorUrl: \"https://authlocal.org/\",\n\tdelegateProtocol: \"authlocal/delegate/v1\",\n\tpurposes: {auth: \"auth\", crypt: \"crypt\"},\n\tstandardLifespan: time.days(30),\n\tstandardCryptScope: \"\",\n\tmaxAliasLength: 32,\n\tenableDelegationLog: false,\n})\n\n", "/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\nconst assertLE = (littleEndian = isLE) => {\n if (littleEndian)\n return;\n // Fail closed on BE for now: qemu-smoke checks still showed broken wasm outputs, and the JS\n // target would need a dedicated BE compilation path that is not currently generated.\n throw new Error('big-endian platforms are unsupported');\n};\nassertLE();\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\n/**\n * Checks whether a value is a byte-oriented Uint8Array view.\n * @param a - value to inspect.\n * @returns True when the value is a Uint8Array-compatible byte view.\n * @example\n * ```ts\n * import { isBytes } from '@awasm/noble/utils.js';\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n/**\n * Asserts something is boolean.\n * @param b - value to validate.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { abool } from '@awasm/noble/utils.js';\n * abool(true);\n * ```\n */\nexport function abool(b) {\n if (typeof b !== 'boolean')\n throw new TypeError(`boolean expected, not ${b}`);\n}\n/**\n * Asserts something is a non-negative safe integer.\n * @param n - value to validate.\n * @param title - optional field name for error messages.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { anumber } from '@awasm/noble/utils.js';\n * anumber(7, 'count');\n * ```\n */\nexport function anumber(n, title = '') {\n const prefix = title && `\"${title}\" `;\n if (typeof n !== 'number')\n throw new TypeError(`${prefix}expected number, got ${typeof n}`);\n if (!Number.isSafeInteger(n) || n < 0) {\n throw new RangeError(`${prefix}expected integer >= 0, got ${n}`);\n }\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - byte array candidate.\n * @param length - optional exact length requirement.\n * @param title - optional field name for error messages.\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { abytes } from '@awasm/noble/utils.js';\n * abytes(new Uint8Array([1, 2, 3]), 3, 'msg');\n * ```\n */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n const prefix = title && `\"${title}\" `;\n if (!bytes)\n throw new TypeError(prefix + 'expected Uint8Array, got type=' + typeof value);\n if (needsLen && len !== length)\n throw new RangeError(prefix + 'expected Uint8Array of length ' + length + ', got length=' + len);\n return value;\n}\n/**\n * Asserts a hash-like instance has not been destroyed or finished.\n * @param instance - instance to validate.\n * @param checkFinished - whether to reject already-finished instances.\n * @throws If the documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { aexists } from '@awasm/noble/utils.js';\n * aexists({ destroyed: false, finished: false });\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/**\n * Asserts an output buffer is a byte array with sufficient capacity.\n * @param out - destination buffer.\n * @param instance - object exposing `outputLen`.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { aoutput } from '@awasm/noble/utils.js';\n * aoutput(new Uint8Array(32), { outputLen: 32 });\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n const min = instance.outputLen;\n if (out.length < min) {\n // Shared digestInto() contracts treat undersized destinations as a range problem, not a\n // generic runtime failure, so callers can distinguish \"wrong type\" from \"too short\".\n throw new RangeError('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/**\n * Asserts a hash surface looks like one produced by the hash factory.\n * @param h - hash surface to validate.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { sha256 } from '@awasm/noble';\n * import { ahash } from '@awasm/noble/utils.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('Hash must created by hashes.mkHash');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1)\n throw new Error('\"outputLen\" must be >= 1');\n if (h.blockLen < 1)\n throw new Error('\"blockLen\" must be >= 1');\n}\n/**\n * Casts a typed-array view to bytes over the same memory region.\n * Shared buffer view in native memory order; used for internal state init, not endian-normalized serialization.\n * @param arr - source typed-array view.\n * @returns Byte view over the same buffer region.\n * @example\n * ```ts\n * import { u8 } from '@awasm/noble/utils.js';\n * u8(new Uint32Array([1]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed-array view to 32-bit words over the same memory region.\n * Shared native-order word view; byteOffset must be 4-byte aligned and trailing 1..3 bytes are ignored.\n * @param arr - source typed-array view.\n * @returns Uint32Array view over the same buffer region.\n * @example\n * ```ts\n * import { u32 } from '@awasm/noble/utils.js';\n * u32(new Uint8Array([1, 2, 3, 4]));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Byte-swaps each 32-bit word on big-endian platforms.\n * @param arr - word array to normalize in place.\n * @returns The input array after any required byte swaps.\n * @example\n * ```ts\n * import { swap32IfBE } from '@awasm/noble/utils.js';\n * const words = new Uint32Array([0x11223344]);\n * swap32IfBE(words);\n * ```\n */\nexport function swap32IfBE(arr) {\n if (isLE)\n return arr;\n for (let i = 0; i < arr.length; i++) {\n const x = arr[i];\n arr[i] = ((x << 24) | ((x & 0xff00) << 8) | ((x >>> 8) & 0xff00) | (x >>> 24)) >>> 0;\n }\n return arr;\n}\n/**\n * Zeroize typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros.\n * @example\n * ```ts\n * import { clean } from '@awasm/noble/utils.js';\n * const buf = new Uint8Array([1, 2, 3]);\n * clean(buf);\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n// JS `.fill(0)` can be surprisingly slow on large buffers; chunked `.set` tends to be faster.\n// This is used by ciphers to clear large staging buffers without making perf unusable.\n/**\n * Fast zeroization for large byte buffers.\n * @param dst - destination buffer.\n * @param len - prefix length to clear.\n * @example\n * ```ts\n * import { cleanFast } from '@awasm/noble/utils.js';\n * cleanFast(new Uint8Array(16), 8);\n * ```\n */\nexport const cleanFast = (() => {\n let zero;\n return (dst, len = dst.length) => {\n abytes(dst);\n anumber(len, 'len');\n if (len > dst.length)\n throw new Error(`\"len\" expected <= dst.length, got len=${len} dst.length=${dst.length}`);\n if (!len)\n return;\n // Keep the zero chunk inside the export so bundles that don't use cleanFast can drop it too.\n const chunk = zero || (zero = /* @__PURE__ */ new Uint8Array(1024 * 1024));\n let off = 0;\n for (; off + chunk.length <= len; off += chunk.length)\n dst.set(chunk, off);\n if (off < len)\n dst.fill(0, off, len);\n };\n})();\n/**\n * Create a DataView over the same buffer region; writes through it mutate the original array.\n * @param arr - source typed-array view.\n * @returns DataView over the same buffer region.\n * @example\n * ```ts\n * import { createView } from '@awasm/noble/utils.js';\n * createView(new Uint8Array(8));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Checks if two byte arrays overlap in the same underlying buffer.\n * This is invalid and can corrupt data.\n * @param a - first byte view.\n * @param b - second byte view.\n * @returns True when the byte ranges overlap.\n * @example\n * ```ts\n * import { overlapBytes } from '@awasm/noble/utils.js';\n * const buf = new Uint8Array(8);\n * overlapBytes(buf.subarray(0, 4), buf.subarray(2, 6));\n * ```\n */\nexport function overlapBytes(a, b) {\n // Zero-length views cannot overwrite anything, even if their offset sits inside another range.\n if (!a.byteLength || !b.byteLength)\n return false;\n return (a.buffer === b.buffer &&\n a.byteOffset < b.byteOffset + b.byteLength &&\n b.byteOffset < a.byteOffset + a.byteLength);\n}\nexport const __TEST = /* @__PURE__ */ Object.freeze({\n assertLE,\n});\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @param bytes - bytes to encode.\n * @returns Lowercase hex string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { bytesToHex } from '@awasm/noble/utils.js';\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23]));\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hex string to decode.\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { hexToBytes } from '@awasm/noble/utils.js';\n * hexToBytes('cafe0123');\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n // @ts-ignore\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n * This yields to the Promise/microtask scheduler queue, not to timers or the full macrotask event loop.\n * @example\n * ```ts\n * import { nextTick } from '@awasm/noble/utils.js';\n * await nextTick();\n * ```\n */\nexport const nextTick = async () => { };\n/**\n * Returns control to the Promise/microtask scheduler every `tick` ms to avoid blocking long loops.\n * @param iters - number of loop iterations.\n * @param tick - maximum milliseconds to spend before yielding.\n * @param cb - callback invoked for each iteration index.\n */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform TextEncoder.\n * @param str - string to encode.\n * @returns UTF-8 bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { utf8ToBytes } from '@awasm/noble/utils.js';\n * utf8ToBytes('abc');\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Convert byte array to string, assuming UTF8 encoding.\n * Input validation and malformed-sequence handling are delegated to TextDecoder:\n * invalid UTF-8 is replacement-decoded, not rejected.\n * @param bytes - bytes to decode.\n * @returns UTF-8 string.\n * @example\n * ```ts\n * import { bytesToUtf8 } from '@awasm/noble/utils.js';\n * bytesToUtf8(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport function bytesToUtf8(bytes) {\n return new TextDecoder().decode(bytes);\n}\n/**\n * Checks whether a byte array is aligned to a 4-byte offset.\n * @param bytes - byte view to inspect.\n * @returns True when the view is 32-bit aligned.\n * @example\n * ```ts\n * import { isAligned32 } from '@awasm/noble/utils.js';\n * isAligned32(new Uint8Array(8));\n * ```\n */\nexport function isAligned32(bytes) {\n return bytes.byteOffset % 4 === 0;\n}\n/**\n * By default, returns u8a of expected length.\n * When `out` is specified, it checks it for validity and uses it.\n * @param expectedLength - expected output length in bytes.\n * @param out - optional caller-provided destination buffer.\n * @param onlyAligned - whether to require 32-bit alignment for `out`.\n * @returns Output buffer with the expected length.\n * @throws On wrong argument types. {@link TypeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { getOutput } from '@awasm/noble/utils.js';\n * getOutput(16);\n * ```\n */\nexport function getOutput(expectedLength, out, onlyAligned = true) {\n if (out === undefined)\n return new Uint8Array(expectedLength);\n // Keep Buffer/cross-realm Uint8Array support here instead of trusting a shape-compatible object.\n abytes(out, undefined, 'output');\n if (out.length !== expectedLength)\n throw new Error('\"output\" expected Uint8Array of length ' + expectedLength + ', got: ' + out.length);\n if (onlyAligned && !isAligned32(out))\n throw new Error('invalid output, must be aligned');\n return out;\n}\n/**\n * Encodes the AEAD length block as aadLength || dataLength.\n * Callers pass lengths already scaled to the mode's unit:\n * octets for ChaCha20-Poly1305, bits for GCM/GCM-SIV.\n * @param dataLength - encoded data length.\n * @param aadLength - encoded AAD length.\n * @param isLE - whether to write values in little-endian order.\n * @returns Encoded 16-byte length block.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { u64Lengths } from '@awasm/noble/utils.js';\n * u64Lengths(16, 8, true);\n * ```\n */\nexport function u64Lengths(dataLength, aadLength, isLE) {\n // Reject coercible non-number lengths like '10' and true before BigInt(...) accepts them.\n anumber(dataLength);\n anumber(aadLength);\n abool(isLE);\n const num = new Uint8Array(16);\n const view = createView(num);\n view.setBigUint64(0, BigInt(aadLength), isLE);\n view.setBigUint64(8, BigInt(dataLength), isLE);\n return num;\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - string or bytes input.\n * @param errorTitle - optional field name for byte validation.\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { kdfInputToBytes } from '@awasm/noble/utils.js';\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate.\n * @returns Concatenated bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { concatBytes } from '@awasm/noble/utils.js';\n * concatBytes(new Uint8Array([1]), new Uint8Array([2, 3]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Fast copy for validated, in-bounds byte ranges.\n * Overlap is intentionally unsupported here for speed: hot callers only pass disjoint ranges,\n * and same-buffer moves must use copyWithin()/set() at the call site instead.\n * @param dst - destination byte array.\n * @param dstPos - write offset in destination.\n * @param src - source byte array.\n * @param srcPos - read offset in source.\n * @param len - number of bytes to copy.\n * @example\n * ```ts\n * import { copyFast } from '@awasm/noble/utils.js';\n * const dst = new Uint8Array(4);\n * copyFast(dst, 1, new Uint8Array([7, 8]), 0, 2);\n * ```\n */\nexport function copyFast(dst, dstPos, src, srcPos, len) {\n if (len <= 0)\n return;\n if (len <= 64)\n for (let i = 0; i < len; i++)\n dst[dstPos + i] = src[srcPos + i];\n else\n dst.set(src.subarray(srcPos, srcPos + len), dstPos);\n}\n/**\n * Fast copy for validated, in-bounds 32-bit word ranges.\n * Overlap is intentionally unsupported here for speed: hot callers only pass disjoint ranges,\n * and same-buffer moves must use copyWithin()/set() at the call site instead.\n * @param dst - destination word array.\n * @param dstPos - write offset in destination.\n * @param src - source word array.\n * @param srcPos - read offset in source.\n * @param len - number of words to copy.\n * @example\n * ```ts\n * import { copyFast32 } from '@awasm/noble/utils.js';\n * const dst = new Uint32Array(4);\n * copyFast32(dst, 1, new Uint32Array([7, 8]), 0, 2);\n * ```\n */\nexport function copyFast32(dst, dstPos, src, srcPos, len) {\n if (len <= 0)\n return;\n if (len <= 64)\n for (let i = 0; i < len; i++)\n dst[dstPos + i] = src[srcPos + i];\n else\n dst.set(src.subarray(srcPos, srcPos + len), dstPos);\n}\n/**\n * Callers must pass a validated byte array; Uint8Array.from() would otherwise coerce arbitrary iterables.\n * Copies into a detached Uint8Array instead of using slice(), because Buffer.slice() aliases memory.\n * @param bytes - bytes to copy.\n * @returns Detached copy of the input bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { copyBytes } from '@awasm/noble/utils.js';\n * copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02.\n * Current callers pass one-byte hashAlgs suffixes for 2.16.840.1.101.3.4.2.<suffix>,\n * so the DER length byte stays 0x09.\n * @param suffix - final OID suffix byte.\n * @returns DER-encoded OID bytes.\n * @example\n * ```ts\n * import { oidNist } from '@awasm/noble/utils.js';\n * oidNist(1);\n * ```\n */\nexport const oidNist = (suffix) => Uint8Array.from([\n 0x06,\n 0x09,\n 0x60,\n 0x86,\n 0x48,\n 0x01,\n 0x65,\n 0x03,\n 0x04,\n 0x02,\n suffix,\n]);\n/**\n * Merges default options and passed options.\n * This mutates `defaults`, so callers pass fresh defaults when they need reuse.\n * @param defaults - default option object.\n * @param opts - caller-provided overrides.\n * @returns Merged options object.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { checkOpts } from '@awasm/noble/utils.js';\n * checkOpts({ a: 1 }, { b: 2 });\n * ```\n */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new TypeError('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/**\n * Build sync and async wrappers from the same generator body.\n * @param cb_ - generator callback shared by sync and async variants.\n * @returns Function exposing both sync and `.async(...)` entrypoints.\n * @example\n * ```ts\n * import { mkAsync } from '@awasm/noble/utils.js';\n * const twice = mkAsync(function* (_setup, value: number) {\n * return value * 2;\n * });\n * await twice.async(2);\n * ```\n */\nexport function mkAsync(cb_) {\n const cb = cb_;\n const genSetup = (canReturn) => {\n let setupDone = false;\n let progressTotal = -1;\n let done = 0;\n let stateBytes = 0;\n let state;\n let onSave = (_state) => { };\n let onRestore = (_state) => { };\n /**\n * Default scheduler yields to the Promise microtask queue.\n * Callers can pass `nextTick` when they need a custom scheduler.\n */\n let onNextTick = async () => { };\n return {\n save: () => {\n if (!canReturn || !stateBytes)\n return;\n if (!state)\n state = new Uint8Array(stateBytes);\n onSave(state);\n },\n restore: () => {\n if (!canReturn || !state)\n return;\n onRestore(state);\n },\n nextTick: () => onNextTick(),\n onEnd: () => {\n // setup() can be skipped on explicit sync fast-paths.\n if (progressTotal < 0)\n return;\n if (done !== progressTotal)\n throw new Error(`done (${done}) < progressTotal(${progressTotal})`);\n },\n setup: (_opts) => {\n const rawOpts = _opts;\n if (setupDone)\n throw new Error('setup already called');\n setupDone = true;\n if (!canReturn) {\n anumber(rawOpts.total, 'total');\n progressTotal = rawOpts.total;\n const onProgress = rawOpts.onProgress;\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('onProgress must be a function');\n if (!onProgress) {\n return (inc = 1) => {\n done += inc;\n return false;\n };\n }\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n return (inc = 1) => {\n done += inc;\n if (!(done % callbackPer) || done === progressTotal)\n onProgress(progressTotal ? done / progressTotal : 1);\n return false;\n };\n }\n const opts = { ...rawOpts };\n if (opts.asyncTick === undefined)\n delete opts.asyncTick; // will override defaults otherwise\n const { asyncTick, onProgress, stateBytes: _stateBytes, save, restore, nextTick, total, } = checkOpts({ asyncTick: 10 }, opts);\n anumber(asyncTick, 'asyncTick');\n anumber(total, 'total');\n progressTotal = total;\n for (const [k, v] of Object.entries({ onProgress, save, restore, nextTick })) {\n if (v !== undefined && typeof v !== 'function')\n throw new Error(`${k} must be a function`);\n }\n if (_stateBytes !== undefined)\n anumber(_stateBytes, 'stateBytes');\n if (_stateBytes !== undefined)\n stateBytes = _stateBytes;\n if ((save !== undefined || restore !== undefined) && !stateBytes)\n throw new Error('stateBytes must be a positive integer when save/restore is used');\n if (save !== undefined)\n onSave = save;\n if (restore !== undefined)\n onRestore = restore;\n if (nextTick !== undefined)\n onNextTick = nextTick;\n let needReturn = () => false;\n if (canReturn) {\n let ts = Date.now();\n needReturn = () => {\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < asyncTick)\n return false;\n ts += diff;\n return true;\n };\n }\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n let progress = (inc = 1) => {\n done += inc;\n return needReturn();\n };\n if (onProgress) {\n progress = (inc = 1) => {\n done += inc;\n if (onProgress && (!(done % callbackPer) || done === total))\n onProgress(total ? done / total : 1);\n return needReturn();\n };\n }\n return progress;\n },\n };\n };\n const res = (...args) => {\n let setupDone = false;\n let progressTotal = -1;\n let done = 0;\n const setup = ((opts) => {\n const rawOpts = opts;\n if (setupDone)\n throw new Error('setup already called');\n setupDone = true;\n anumber(rawOpts.total, 'total');\n progressTotal = rawOpts.total;\n const onProgress = rawOpts.onProgress;\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('onProgress must be a function');\n if (!onProgress) {\n return (inc = 1) => {\n done += inc;\n return false;\n };\n }\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n return (inc = 1) => {\n done += inc;\n // Keep zero-total sync progress aligned with the async path for empty-input callers.\n if (!(done % callbackPer) || done === progressTotal)\n onProgress(progressTotal ? done / progressTotal : 1);\n return false;\n };\n });\n setup.isAsync = false;\n const g = cb(setup, ...args);\n let r = g.next();\n while (!r.done)\n r = g.next();\n if (progressTotal >= 0 && done !== progressTotal)\n throw new Error(`done (${done}) < progressTotal(${progressTotal})`);\n return r.value;\n };\n res.async = async (...args) => {\n const { setup, save, restore, onEnd, nextTick } = genSetup(true);\n const setupMode = setup;\n setupMode.isAsync = true;\n const g = cb(setupMode, ...args);\n let r = g.next();\n while (!r.done) {\n save();\n await nextTick();\n restore();\n r = g.next();\n }\n onEnd();\n return r.value;\n };\n return res;\n}\n/**\n * Compares two byte arrays in kinda constant time once lengths already match.\n * Different lengths return false immediately.\n * @param a - first byte array.\n * @param b - second byte array.\n * @returns True when the byte arrays are equal.\n * @example\n * ```ts\n * import { equalBytes } from '@awasm/noble/utils.js';\n * equalBytes(new Uint8Array([1, 2]), new Uint8Array([1, 2]));\n * ```\n */\nexport function equalBytes(a, b) {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n}\n/**\n * Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate.\n * @returns Random bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { randomBytes } from '@awasm/noble/utils.js';\n * randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Validate upfront so fractional / coercible lengths do not silently\n // truncate through Uint8Array().\n anumber(bytesLength);\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Uses CSPRNG for nonce and injects it into ciphertext.\n * For `encrypt`, a `nonceLength`-byte nonce is fetched from CSPRNG and\n * prepended to encrypted ciphertext. For `decrypt`, the first `nonceLength`\n * bytes of ciphertext are treated as nonce.\n *\n * The wrapper always allocates a fresh `nonce || ciphertext` buffer on encrypt\n * and intentionally does not support caller-provided destination buffers.\n * Too-short decrypt inputs are split into short/empty nonce views and then\n * delegated to the wrapped cipher instead of being rejected here first.\n *\n * NOTE: Under the same key, using random nonces (e.g. `managedNonce`) with AES-GCM and ChaCha\n * should be limited to `2**23` (8M) messages to get a collision chance of\n * `2**-50`. Stretching to `2**32` (4B) messages would raise that chance to\n * `2**-33`, still negligible but creeping up.\n * @param fn - nonce-taking cipher factory.\n * @param randomBytes_ - CSPRNG used to generate nonces.\n * @returns Cipher factory that prepends managed nonces to ciphertext.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { managedNonce } from '@awasm/noble/utils.js';\n * import { xchacha20poly1305 } from '@awasm/noble';\n * const cipher = managedNonce(xchacha20poly1305)(new Uint8Array(32));\n * const sealed = cipher.encrypt(new Uint8Array([1, 2, 3]));\n * cipher.decrypt(sealed);\n * ```\n */\nexport function managedNonce(fn, randomBytes_ = randomBytes) {\n const { nonceLength } = fn;\n const nonceLen = nonceLength;\n anumber(nonceLen);\n const addNonce = (nonce, ciphertext, plaintext) => {\n const out = concatBytes(nonce, ciphertext);\n // Wrapped ciphers may alias caller plaintext on encrypt(); don't wipe caller-owned bytes here.\n if (!overlapBytes(plaintext, ciphertext))\n ciphertext.fill(0);\n return out;\n };\n // NOTE: we cannot support DST here, it would be a mistake:\n // - we don't know how much dst length cipher requires\n // - nonce may unalign dst and break everything\n // - we create new u8a anyway (concatBytes)\n // - previously all args were passed-through to a cipher, but that was a mistake\n const res = ((key, ...args) => ({\n encrypt(plaintext) {\n abytes(plaintext);\n const nonce = randomBytes_(nonceLen);\n const encrypted = fn(key, nonce, ...args).encrypt(plaintext);\n // @ts-ignore\n if (encrypted instanceof Promise)\n return encrypted.then((ct) => addNonce(nonce, ct, plaintext));\n return addNonce(nonce, encrypted, plaintext);\n },\n decrypt(ciphertext) {\n abytes(ciphertext);\n const nonce = ciphertext.subarray(0, nonceLen);\n const decrypted = ciphertext.subarray(nonceLen);\n return fn(key, nonce, ...args).decrypt(decrypted);\n },\n }));\n // awasm tests and callers still treat managed wrappers as cipher factories, so preserve metadata.\n if ('blockSize' in fn)\n res.blockSize = fn.blockSize;\n res.nonceLength = nonceLen;\n if ('tagLength' in fn)\n res.tagLength = fn.tagLength;\n if (fn.withAAD)\n res.withAAD = true;\n return res;\n}\n", "/**\n * Abstract logic for hashes.\n * @module\n */\nimport { abool, abytes, anumber, clean, concatBytes, copyBytes, copyFast, isBytes, mkAsync, } from \"./utils.js\";\nconst checkParallelOutput = (opts, count, outputLen, canXOF) => {\n const raw = (isBytes(opts) ? {} : opts || {});\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n const dkLen = (raw.dkLen === undefined ? outputLen : raw.dkLen) | 0;\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n if (Array.isArray(raw.out)) {\n if (raw.outPos !== undefined && raw.outPos !== 0)\n throw new Error('outPos is not supported with output view arrays');\n if (raw.out.length !== count)\n throw new RangeError('output array length must match messages length');\n for (let i = 0; i < count; i++)\n abytes(raw.out[i], dkLen, 'output');\n return { dkLen, out: raw.out };\n }\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n const out = raw.out || new Uint8Array(dkLen * count);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen * count > out.length)\n throw new RangeError('out/outPos too small');\n const slices = [];\n for (let i = 0; i < count; i++) {\n const pos = outPos + i * dkLen;\n slices.push(out.subarray(pos, pos + dkLen));\n }\n return { dkLen, out: slices };\n};\nconst BRAND = /* @__PURE__ */ Symbol('hash_impl_brand');\nconst brandSet = /* @__PURE__ */ new WeakSet();\nfunction isBranded(x) {\n return typeof x === 'function' || (typeof x === 'object' && x !== null)\n ? brandSet.has(x)\n : false;\n}\n// Universal generic wrapper\nexport function mkHash(modFn, def_, platform) {\n const def = def_;\n const { outputLen, blockLen, suffix = 0, init, canXOF, oid } = def;\n const outBlockLen = def.outputBlockLen ? def.outputBlockLen : def.outputLen;\n let hashImpl;\n let hashAsyncImpl;\n let chunksImpl;\n let chunksAsyncImpl;\n let parallelImpl;\n let parallelAsyncImpl;\n let createImpl;\n let cleanStateImpl;\n let inited = false;\n function lazyInit() {\n if (inited)\n throw new Error('second lazyInit call');\n const mod = modFn();\n inited = true;\n const { processBlocks, processOutBlocks, padding, reset } = mod;\n const BUFFER = mod.segments.buffer;\n const STATE = mod.segments.state_chunks[0];\n const STATE_CHUNKS = mod.segments.state_chunks;\n const parallelChunks = mod.segments.state_chunks.length;\n const maxBlocks = Math.floor(BUFFER.length / blockLen);\n const chunks = maxBlocks - 2; // 2 for padding\n if (chunks < 1)\n throw new Error('wrong chunks');\n const maxOutBlocks = Math.floor(BUFFER.length / outBlockLen);\n const prefixStates = new WeakSet();\n function initHash(opts, batchPos = 0) {\n const rawOpts = opts;\n reset(batchPos, 1, 0, outBlockLen, maxOutBlocks);\n let blocks = 0;\n let streamOutputLen = outputLen;\n if (rawOpts.dkLen !== undefined) {\n anumber(rawOpts.dkLen, 'opts.dkLen');\n streamOutputLen = rawOpts.dkLen | 0;\n if (!canXOF && streamOutputLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${streamOutputLen}`);\n }\n if (init) {\n const i = init(batchPos, maxBlocks, mod, hash, rawOpts);\n if (i && i.blocks !== undefined)\n blocks = i.blocks;\n if (i && i.outputLen !== undefined)\n streamOutputLen = i.outputLen;\n }\n return { blocks, outputLen: streamOutputLen };\n }\n // reset(0, 1);\n function processMessage(msg, blocks) {\n // Preloaded blocks from init(): e.g., keyed BLAKE2 writes key||zeros into BUFFER\n // Invariant: these are full blocks, already in BUFFER, and must *not* be treated as 'last'.\n if (blocks > 0) {\n if (msg.length === 0) {\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n processBlocks(0, 1, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0;\n do {\n const take = Math.min(msg.length - pos, chunks * blockLen);\n copyFast(BUFFER, 0, msg, pos, take);\n const isLast = pos + take == msg.length;\n // How many full/partial blocks do we have here? Can be zero.\n let blocks = Math.ceil(take / blockLen);\n // now, we need position where we add padding? take?\n // How much space remains? blockLen-rem, except rem=0.\n const left = blocks * blockLen - take;\n let padBlocks = 0;\n if (isLast) {\n // suffix for sha3 and length for blake1, nothing for others\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix);\n blocks += padBlocks;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n } while (pos < msg.length); // no extra final take=0 pass\n }\n function processMessages(parts, blocks, prefix) {\n // TODO: cleanup, garbage.\n const cap = (chunks * blockLen) | 0; // max bytes per batch\n // total length to keep isLast identical to single-buffer path\n const prefixLen = prefix ? prefix.buf.length : 0;\n let totalLen = prefixLen;\n for (let k = 0; k < parts.length; k++)\n totalLen += parts[k].length;\n // Preloaded blocks from init():\n // those are full blocks, already in BUFFER, and must NOT be treated as 'last'.\n if (blocks > 0) {\n if (totalLen === 0) {\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n processBlocks(0, 1, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0; // global position in virtual concatenation\n let idx = 0; // which part\n let off = 0; // offset within current part\n while (pos < totalLen) {\n const take = Math.min(totalLen - pos, cap) | 0;\n // fill BUFFER[0..take) from parts[idx..] without concat\n let written = 0;\n if (prefix && pos < prefixLen) {\n const n = Math.min(take, prefixLen - pos) | 0;\n copyFast(BUFFER, written, prefix.buf, pos, n);\n written += n;\n }\n while (written < take) {\n const cur = parts[idx];\n const rem = (cur.length - off) | 0;\n const n = (take - written < rem ? take - written : rem) | 0;\n copyFast(BUFFER, written, cur, off, n);\n written += n;\n off += n;\n if (off === cur.length) {\n idx++;\n off = 0;\n }\n }\n const isLast = pos + take === totalLen;\n let blocks = Math.ceil(take / blockLen) | 0;\n const left = (blocks * blockLen - take) | 0;\n let padBlocks = 0;\n if (isLast) {\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix) | 0;\n blocks = (blocks + padBlocks) | 0;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n }\n return;\n }\n // same as processMessage but with chunkPos.\n function processMessageParallel(msg, chunkPos, chunkLen, blocks, maxBlocks, prefix) {\n const chunks = maxBlocks - 2;\n if (chunks < 1)\n throw new Error('wrong chunks');\n const prefixLen = prefix ? prefix.buf.length : 0;\n const msgLen = msg[chunkPos].length;\n const totalLen = prefixLen + msgLen;\n const copyLane = (dst, lane, pos, take) => {\n let written = 0;\n if (prefix && pos < prefixLen) {\n const n = Math.min(take, prefixLen - pos);\n copyFast(BUFFER, dst, prefix.buf, pos, n);\n written += n;\n }\n if (written < take)\n copyFast(BUFFER, dst + written, lane, pos + written - prefixLen, take - written);\n };\n // Caller validates per-group size equality before touching module state.\n if (blocks > 0) {\n if (totalLen === 0) {\n // No more message input: do a normal finalization over an empty tail.\n // Keep 'left' consistent with the wrapper contract for take=0: left=0.\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n for (let j = 0; j < chunkLen; j++) {\n const pb2 = padding(j, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n if (pb2 !== padBlocks)\n throw new Error('different padding across batch');\n }\n processBlocks(0, chunkLen, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, chunkLen, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0;\n do {\n const take = Math.min(totalLen - pos, chunks * blockLen);\n for (let i = 0; i < chunkLen; i++) {\n copyLane(i * maxBlocks * blockLen, msg[chunkPos + i], pos, take);\n }\n const isLast = pos + take == totalLen;\n // How many full/partial blocks do we have here? Can be zero.\n let blocks = Math.ceil(take / blockLen);\n // How much space remains? blockLen-rem, except rem=0.\n const left = blocks * blockLen - take;\n let padBlocks = 0;\n if (isLast) {\n // suffix for sha3 and length for blake1, nothing for others\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix);\n for (let j = 1; j < chunkLen; j++) {\n const pb2 = padding(j, take, maxBlocks, left, blockLen, suffix);\n if (pb2 !== padBlocks)\n throw new Error('parallel batch: different padding');\n }\n blocks += padBlocks;\n }\n processBlocks(0, chunkLen, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n } while (pos < totalLen); // no extra final take=0 pass\n return;\n }\n function checkOutputOpts(o = {}, bytes, defaultLen = outputLen) {\n const raw = o;\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n if (bytes !== undefined)\n anumber(bytes, 'xof.bytes');\n let dkLen = bytes !== undefined ? bytes : (raw.dkLen === undefined ? defaultLen : raw.dkLen) | 0;\n // Old awasm hash output opts intentionally allow requesting a shorter fixed digest, but\n // must reject oversize lengths instead of silently clamping or zero-extending the tail.\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n const out = raw.out || new Uint8Array(dkLen);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen > out.length)\n throw new RangeError('out/outPos too small');\n return { dkLen, out: out, outPos };\n }\n function processOutput(o = {}, checked = checkOutputOpts(o)) {\n const { dkLen, out, outPos } = checked;\n const batch = chunks | 0;\n const blocksTotal = ((dkLen + outBlockLen - 1) / outBlockLen) | 0; // ceil div\n let produced = 0, blocksLeft = blocksTotal;\n let maxWritten = 0;\n while (blocksLeft > 0) {\n const takeBlocks = blocksLeft > batch ? batch : blocksLeft;\n const isLast = blocksLeft === takeBlocks ? 1 : 0;\n processOutBlocks(0, 1, takeBlocks, maxOutBlocks, outBlockLen, isLast);\n const emitted = takeBlocks * outBlockLen;\n const need = dkLen - produced;\n const takeBytes = need < emitted ? need : emitted;\n copyFast(out, outPos + produced, BUFFER, 0, takeBytes);\n maxWritten = Math.max(maxWritten, takeBytes, takeBlocks * outBlockLen);\n produced += takeBytes;\n blocksLeft -= takeBlocks;\n }\n // NOTE: it would be nice to return slices subarray here, but it is not free!\n return { maxWritten, out };\n }\n function processOutputParallel(chunkLen, maxOutBlocks, checked, outOffset) {\n const chunks = maxOutBlocks;\n const { dkLen, out } = checked;\n let maxWritten = 0;\n const batch = chunks | 0;\n const blocksTotal = ((dkLen + outBlockLen - 1) / outBlockLen) | 0; // ceil div\n let produced = 0, blocksLeft = blocksTotal;\n while (blocksLeft > 0) {\n const takeBlocks = blocksLeft > batch ? batch : blocksLeft;\n const isLast = blocksLeft === takeBlocks ? 1 : 0;\n processOutBlocks(0, chunkLen, takeBlocks, maxOutBlocks, outBlockLen, isLast);\n const emitted = takeBlocks * outBlockLen;\n const need = dkLen - produced;\n const takeBytes = need < emitted ? need : emitted;\n for (let i = 0; i < chunkLen; i++) {\n copyFast(out[outOffset + i], produced, BUFFER, i * outBlockLen * maxOutBlocks, takeBytes);\n // Some modules (e.g. blake3) may write full output blocks even when only part is copied out.\n // Track emitted block span for reset() so unread bytes are also zeroized.\n maxWritten = Math.max(maxWritten, takeBytes, emitted);\n }\n produced += takeBytes;\n blocksLeft -= takeBlocks;\n }\n // NOTE: it would be nice to return slices subarray here, but it is not free!\n return { out, maxWritten };\n }\n const stateBytes = (state) => {\n if (!isBytes(state))\n throw new Error('prefixState is not from this hash');\n if (state.length < STATE.length)\n throw new Error('prefixState is too short');\n // Byte-state backends serialize only `state || partialBlock`; a full block must be flushed.\n if (state.length >= STATE.length + blockLen)\n throw new Error('prefixState is too long');\n if (!prefixStates.has(state))\n throw new Error('prefixState is not from this hash');\n return state;\n };\n const prefixState = (opts = {}) => {\n const raw = opts;\n if (raw.prefixState === undefined)\n return;\n const state = stateBytes(raw.prefixState);\n return { state: state.subarray(0, STATE.length), buf: state.subarray(STATE.length) };\n };\n class StreamHash {\n canXOF;\n blockLen;\n outputLen;\n buf;\n pos;\n state;\n finished;\n destroyed;\n constructor(opts) {\n if (opts.streamBufLen % blockLen || opts.streamBufLen < blockLen)\n throw new Error('wrong streamBufLen');\n this.finished = false;\n this.destroyed = false;\n // this.reserve = blockLen; // TODO: change when sha2\n this.buf = new Uint8Array(opts.streamBufLen);\n this.pos = 0;\n if (opts.blocks !== undefined) {\n if (opts.blocks * blockLen > this.buf.length)\n throw new Error('too much blocks');\n copyFast(this.buf, 0, BUFFER, 0, opts.blocks * blockLen);\n this.pos = opts.blocks * blockLen;\n }\n this.canXOF = !!canXOF;\n this.blockLen = blockLen;\n this.outputLen = opts.outputLen;\n this.state = copyBytes(STATE);\n reset(0, 1, 0, outBlockLen, maxOutBlocks); // cleanup\n }\n restoreState() {\n copyFast(STATE, 0, this.state, 0, STATE.length);\n }\n saveState() {\n this.state = copyBytes(STATE);\n }\n update(msg) {\n abytes(msg);\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n let msgPos = 0;\n let blocks = Math.ceil((this.pos + msg.length) / blockLen) - 1; // never process last block here!\n if (blocks > 0) {\n this.restoreState();\n let takeBlocks = Math.min(chunks, blocks);\n // first can be unaligned!\n const msgFirstLen = takeBlocks * blockLen - this.pos;\n copyFast(BUFFER, 0, this.buf, 0, this.pos);\n copyFast(BUFFER, this.pos, msg, msgPos, msgFirstLen);\n this.pos = 0;\n msgPos += msgFirstLen;\n processBlocks(0, 1, takeBlocks, maxBlocks, blockLen, 0, 0, 0);\n blocks -= takeBlocks;\n for (; msgPos < msg.length && blocks;) {\n const takeBlocks = Math.min(chunks, blocks);\n copyFast(BUFFER, 0, msg, msgPos, takeBlocks * blockLen);\n processBlocks(0, 1, takeBlocks, maxBlocks, blockLen, 0, 0, 0);\n blocks -= takeBlocks;\n msgPos += takeBlocks * blockLen;\n }\n this.saveState();\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n }\n // save leftovers\n const leftover = msg.length - msgPos;\n if (leftover) {\n copyFast(this.buf, this.pos, msg, msgPos, leftover);\n this.pos += leftover;\n }\n return this;\n }\n finish() {\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n this.restoreState();\n this.finished = true;\n const isLast = true;\n let take = this.pos;\n let blocks = Math.ceil(take / blockLen);\n copyFast(BUFFER, 0, this.buf, 0, this.pos);\n const left = blocks * blockLen - take; // how much space we have. blockLen-rem except when rem=0\n let padBlocks = 0;\n if (isLast) {\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix); // suffix for sha3 and length for blake1, nothing for others\n blocks += padBlocks;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 1, left, padBlocks);\n this.pos = outBlockLen;\n return blocks * blockLen;\n }\n digest(opts = {}) {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n const outChecked = checkOutputOpts(opts, undefined, this.outputLen);\n this.finish();\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n this.destroy();\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n }\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n this.buf.fill(0);\n }\n xof(bytes, opts = {}) {\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n const outChecked = checkOutputOpts(opts, bytes);\n if (!this.finished) {\n this.finish();\n this.saveState();\n }\n // XOF mutates module state via processOutBlocks(). Snapshot/restore around calls so\n // stream instances don't leak squeeze state into global hash wrappers.\n this.restoreState();\n const { out, outPos } = outChecked;\n for (let pos = 0; pos < bytes;) {\n if (this.pos >= outBlockLen) {\n // get next squeeze block\n processOutBlocks(0, 1, 1, maxOutBlocks, outBlockLen, 0); // never 'last' in XOF\n copyFast(this.buf, 0, BUFFER, 0, outBlockLen);\n this.pos = 0;\n }\n const take = (outBlockLen - this.pos < bytes - pos ? outBlockLen - this.pos : bytes - pos) | 0;\n copyFast(out, (outPos + pos) | 0, this.buf, this.pos, take);\n this.pos = (this.pos + take) | 0;\n pos = (pos + take) | 0;\n }\n this.saveState();\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n return out;\n }\n // old api\n digestInto(buf) {\n // digestInto is the fixed-size surface even for XOF hashes, but callers may provide a\n // larger workspace buffer and expect the tail to stay untouched.\n abytes(buf, undefined, 'output');\n if (buf.length < this.outputLen)\n // Keep short digest destinations aligned with the shared noble-hashes contract:\n // wrong output type -> TypeError, too-short output -> RangeError.\n throw new RangeError('digestInto() expects output buffer of length at least ' + this.outputLen);\n this.digest({ out: buf.subarray(0, this.outputLen), dkLen: this.outputLen });\n }\n xofInto(buf) {\n return this.xof(buf.length, { out: buf });\n }\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n _cloneInto(to) {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n // Allocate target if needed (ensure same stream buffer capacity).\n const dst = to || new this.constructor({ streamBufLen: this.buf.length });\n if (!(dst instanceof StreamHash))\n throw new Error('wrong instance');\n if (dst.buf.length !== this.buf.length)\n throw new Error('wrong buffer length');\n // Clones must preserve the public stream metadata too. digest()/digestInto() allocate and\n // validate against outputLen, xof()/xofInto() gate on canXOF, and callers may read blockLen.\n dst.blockLen = this.blockLen;\n dst.outputLen = this.outputLen;\n dst.canXOF = this.canXOF;\n // Copy tail / XOF cache content up to bufPos.\n if (this.pos)\n copyFast(dst.buf, 0, this.buf, 0, this.pos);\n dst.pos = this.pos | 0;\n // Snapshot of full engine state used by restoreState().\n dst.state = copyBytes(this.state);\n // Flags\n dst.finished = !!this.finished;\n dst.destroyed = !!this.destroyed;\n return dst;\n }\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n exportState() {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n // update() keeps one full tail block unprocessed for finalization; export must absorb it\n // so a full-block prefix is represented only by the engine state plus a short leftover.\n if (this.pos === blockLen) {\n this.restoreState();\n copyFast(BUFFER, 0, this.buf, 0, blockLen);\n processBlocks(0, 1, 1, maxBlocks, blockLen, 0, 0, 0);\n this.saveState();\n this.pos = 0;\n this.buf.fill(0);\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n }\n // Returned bytes are exactly `state || partialBlock`, with no outputLen, pos, or header.\n const out = new Uint8Array(this.state.length + this.pos);\n out.set(this.state);\n if (this.pos)\n out.set(this.buf.subarray(0, this.pos), this.state.length);\n prefixStates.add(out);\n return out;\n }\n }\n const hashSync = (msg, opts = {}) => {\n abytes(msg);\n const outChecked = checkOutputOpts(opts);\n const { blocks } = initHash(opts);\n processMessage(msg, blocks);\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n };\n const chunksSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n let total = 0;\n for (const p of parts) {\n abytes(p);\n total += p.length;\n }\n const prefix = prefixState(opts);\n if (prefix && total === 0)\n throw new Error('prefixState requires a non-empty message');\n const outChecked = checkOutputOpts(opts);\n if (prefix) {\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n copyFast(STATE, 0, prefix.state, 0, prefix.state.length);\n processMessages(parts, 0, prefix);\n }\n else {\n const { blocks } = initHash(opts);\n processMessages(parts, blocks);\n }\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n };\n const parallelSync = (chunks, opts = {}) => {\n if (!Array.isArray(chunks))\n throw new Error('expected array of messages');\n const prefix = prefixState(opts);\n if (prefix && chunks.length === 0)\n throw new Error('prefixState requires a non-empty message');\n // At least 3 blocks (for padding).\n const maxGroups = Math.floor(BUFFER.length / (blockLen * 3));\n const maxOutGroups = Math.floor(BUFFER.length / outBlockLen);\n // Validate user input first. Wrong input must throw before touching module state/memory.\n for (let i = 0; i < chunks.length; i += parallelChunks) {\n const groupLen = Math.min(parallelChunks, chunks.length - i, maxGroups, maxOutGroups);\n for (let j = 0; j < groupLen; j++)\n if (!isBytes(chunks[i + j]))\n throw new Error(`expected Uint8Array, got type=${typeof chunks[i + j]}`);\n if (prefix && chunks[i].length === 0)\n throw new Error('prefixState requires a non-empty message');\n for (let j = 1; j < groupLen; j++) {\n if (chunks[i + j].length !== chunks[i].length)\n throw new Error('different sizes inside chunk');\n }\n }\n const outChecked = checkParallelOutput(opts, chunks.length, outputLen, canXOF);\n for (let i = 0; i < chunks.length; i += parallelChunks) {\n const groupLen = Math.min(parallelChunks, chunks.length - i, maxGroups, maxOutGroups);\n const maxBlocks = Math.floor(BUFFER.length / (blockLen * groupLen));\n const maxOutBlocks = Math.floor(BUFFER.length / (outBlockLen * groupLen));\n let blocks = 0;\n if (prefix) {\n reset(0, groupLen, 0, outBlockLen, maxOutBlocks);\n for (let j = 0; j < groupLen; j++)\n copyFast(STATE_CHUNKS[j], 0, prefix.state, 0, prefix.state.length);\n }\n else if (init) {\n const i = init(0, maxBlocks, mod, hash, opts);\n if (i && i.blocks !== undefined)\n blocks = i.blocks;\n for (let j = 0; j < groupLen; j++) {\n const t = init(j, maxBlocks, mod, hash, opts);\n if ((t && t.blocks) !== (i && i.blocks))\n throw new Error('inconsistent init blocks inside parallel group');\n }\n }\n processMessageParallel(chunks, i, groupLen, blocks, maxBlocks, prefix);\n const { maxWritten } = processOutputParallel(groupLen, maxOutBlocks, outChecked, i);\n reset(0, groupLen, maxWritten, outBlockLen, maxOutBlocks);\n }\n return outChecked.out;\n };\n const setupTick = (setup, total, opts) => {\n const rawSetup = setup;\n const rawOpts = opts;\n return !rawSetup.isAsync\n ? !rawOpts?.onProgress\n ? (rawSetup({ total: 0 }), (_inc) => false)\n : rawSetup({ total, onProgress: rawOpts.onProgress })\n : rawSetup({\n total,\n asyncTick: rawOpts?.asyncTick,\n onProgress: rawOpts?.onProgress,\n nextTick: rawOpts?.nextTick,\n });\n };\n const hashRun = mkAsync(function* (setup, msg, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return hashSync(msg, opts);\n const tick = setupTick(setupMode, msg.length, opts);\n const out = hashSync(msg, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(msg.length))\n yield;\n return out;\n });\n const chunksRun = mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return chunksSync(parts, opts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, opts);\n const out = chunksSync(parts, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(total))\n yield;\n return out;\n });\n const parallelRun = mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return parallelSync(parts, opts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, opts);\n const out = parallelSync(parts, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(total))\n yield;\n return out;\n });\n hashImpl = (msg, opts = {}) => hashSync(msg, opts);\n hashAsyncImpl = async (msg, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return hashSync(msg, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? hashRun.async(msg, rawOpts)\n : hashSync(msg, rawOpts);\n };\n chunksImpl = (parts, opts = {}) => chunksSync(parts, opts);\n chunksAsyncImpl = async (parts, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return chunksSync(parts, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? chunksRun.async(parts, rawOpts)\n : chunksSync(parts, rawOpts);\n };\n parallelImpl = (parts, opts = {}) => parallelSync(parts, opts);\n parallelAsyncImpl = async (parts, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return parallelSync(parts, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? parallelRun.async(parts, rawOpts)\n : parallelSync(parts, rawOpts);\n };\n createImpl = (opts = {}) => {\n const rawOpts = opts;\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n const { blocks, outputLen } = initHash(rawOpts);\n return new StreamHash({ ...rawOpts, streamBufLen: blockLen, blocks, outputLen });\n };\n cleanStateImpl = (state) => {\n const bytes = stateBytes(state);\n clean(bytes);\n prefixStates.delete(bytes);\n };\n }\n // Trampoline: init only on first usage\n hashImpl = (msg, opts) => {\n lazyInit();\n return hashImpl(msg, opts);\n };\n hashAsyncImpl = (msg, opts) => {\n lazyInit();\n return hashAsyncImpl(msg, opts);\n };\n chunksImpl = (parts, opts) => {\n lazyInit();\n return chunksImpl(parts, opts);\n };\n chunksAsyncImpl = (parts, opts) => {\n lazyInit();\n return chunksAsyncImpl(parts, opts);\n };\n parallelImpl = (chunks, opts) => {\n lazyInit();\n return parallelImpl(chunks, opts);\n };\n parallelAsyncImpl = (chunks, opts) => {\n lazyInit();\n return parallelAsyncImpl(chunks, opts);\n };\n createImpl = (opts) => {\n lazyInit();\n return createImpl(opts);\n };\n cleanStateImpl = (state) => {\n lazyInit();\n return cleanStateImpl(state);\n };\n const hash = ((msg, opts = {}) => hashImpl(msg, opts));\n const chunksFn = (parts, opts = {}) => chunksImpl(parts, opts);\n Object.assign(chunksFn, {\n async: (parts, opts) => chunksAsyncImpl(parts, opts),\n });\n const parallel = (chunks, opts = {}) => parallelImpl(chunks, opts);\n Object.assign(parallel, {\n async: (chunks, opts) => parallelAsyncImpl(chunks, opts),\n });\n Object.assign(hash, {\n async: (msg, opts) => hashAsyncImpl(msg, opts),\n chunks: chunksFn,\n parallel,\n create: (opts = {}) => createImpl(opts),\n cleanState: (state) => cleanStateImpl(state),\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nexport function mkHashNoble(def_, impl_, platform = 'noble') {\n const def = def_;\n const impl = impl_;\n const { outputLen, blockLen, canXOF, oid } = def;\n const rawOutputOpts = (opts) => (isBytes(opts) ? {} : opts || {});\n const hasOutputOpts = (opts) => {\n const raw = rawOutputOpts(opts);\n return raw.dkLen !== undefined || raw.out !== undefined || raw.outPos !== undefined;\n };\n const prefixStates = new WeakSet();\n const stateStream = (state) => {\n if ((typeof state !== 'object' && typeof state !== 'function') || state === null)\n throw new Error('prefixState is not from this hash');\n const stream = state;\n if (!prefixStates.has(stream))\n throw new Error('prefixState is not from this hash');\n return stream;\n };\n const prefixState = (opts) => {\n const raw = rawOutputOpts(opts);\n if (raw.prefixState === undefined)\n return;\n return stateStream(raw.prefixState);\n };\n const checkOutput = (opts, bytes, defaultLen = outputLen) => {\n const raw = rawOutputOpts(opts);\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n if (bytes !== undefined)\n anumber(bytes, 'xof.bytes');\n const dkLen = (bytes !== undefined ? bytes : raw.dkLen === undefined ? defaultLen : raw.dkLen) | 0;\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n const hasOut = raw.out !== undefined;\n const out = raw.out || new Uint8Array(dkLen);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen > out.length)\n throw new RangeError('out/outPos too small');\n return { dkLen, out: out, outPos, hasOut };\n };\n const writeInto = (inner, out, dkLen, tmp) => {\n const rawInner = inner;\n const rawOut = out;\n let rawTmp = tmp;\n if (canXOF) {\n rawInner.xofInto(rawOut.subarray(0, dkLen));\n return rawTmp;\n }\n // noble BLAKE2 streams require aligned digestInto() views, but awasm outPos is byte-granular.\n if (dkLen === outputLen && (rawOut.byteOffset & 3) === 0)\n rawInner.digestInto(rawOut);\n else {\n if (!rawTmp || rawTmp.length < outputLen)\n rawTmp = new Uint8Array(outputLen);\n rawInner.digestInto(rawTmp);\n if (dkLen)\n copyFast(rawOut, 0, rawTmp, 0, dkLen);\n }\n return rawTmp;\n };\n class Stream {\n canXOF = !!canXOF;\n blockLen = blockLen;\n outputLen;\n inner;\n constructor(inner, outputLen) {\n this.inner = inner;\n this.outputLen = outputLen;\n }\n update(msg) {\n abytes(msg);\n this.inner.update(msg);\n return this;\n }\n digest(opts) {\n if (!hasOutputOpts(opts) && !canXOF && this.outputLen === outputLen)\n return this.inner.digest();\n const checked = checkOutput(opts, undefined, this.outputLen);\n const tmp = writeInto(this.inner, checked.out.subarray(checked.outPos, checked.outPos + checked.dkLen), checked.dkLen);\n if (tmp)\n clean(tmp);\n return checked.out;\n }\n destroy() {\n this.inner.destroy();\n }\n xof(bytes, opts) {\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n if (!hasOutputOpts(opts)) {\n anumber(bytes, 'xof.bytes');\n if (this.inner.xof)\n return this.inner.xof(bytes);\n const out = new Uint8Array(bytes);\n this.inner.xofInto(out);\n return out;\n }\n const checked = checkOutput(opts, bytes);\n this.inner.xofInto(checked.out.subarray(checked.outPos, checked.outPos + checked.dkLen));\n return checked.out;\n }\n digestInto(buf) {\n abytes(buf, undefined, 'output');\n if (buf.length < this.outputLen)\n throw new RangeError('digestInto() expects output buffer of length at least ' + this.outputLen);\n const tmp = writeInto(this.inner, buf.subarray(0, this.outputLen), this.outputLen);\n if (tmp)\n clean(tmp);\n }\n xofInto(buf) {\n abytes(buf, undefined, 'output');\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n this.inner.xofInto(buf);\n return buf;\n }\n _cloneInto(to) {\n if (to !== undefined && !(to instanceof Stream))\n throw new Error('wrong instance');\n const inner = this.inner._cloneInto(to?.inner);\n if (to) {\n to.inner = inner;\n to.outputLen = this.outputLen;\n return to;\n }\n return new Stream(inner, this.outputLen);\n }\n clone() {\n return this._cloneInto();\n }\n exportState() {\n // Native noble streams may carry structured state, e.g. BLAKE3. The clone itself is the state.\n const state = this.inner._cloneInto();\n prefixStates.add(state);\n return state;\n }\n }\n const createSync = (opts = {}) => {\n if (!impl.create)\n throw new Error('streaming is not supported');\n const inner = impl.create(opts);\n const raw = rawOutputOpts(opts);\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n const fallback = inner.outputLen || outputLen;\n const len = raw.dkLen === undefined ? fallback : raw.dkLen;\n if (!canXOF && len > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${len}`);\n return new Stream(inner, len);\n };\n const hashSync = (msg, opts = {}) => {\n abytes(msg);\n const raw = rawOutputOpts(opts);\n if (raw.out === undefined &&\n raw.outPos === undefined &&\n (raw.dkLen === undefined || (canXOF && raw.dkLen !== undefined)))\n return impl.hash(msg, opts);\n const checked = checkOutput(opts);\n const res = impl.hash(msg, opts);\n const { dkLen, out, outPos, hasOut } = checked;\n if (res.length < dkLen)\n throw new RangeError('output is too small');\n if (!hasOut && res.length === dkLen)\n return res;\n if (dkLen)\n copyFast(out, outPos, res, 0, dkLen);\n if (out !== res)\n clean(res);\n return out;\n };\n const chunksSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n let total = 0;\n for (const p of parts) {\n abytes(p);\n total += p.length;\n }\n const prefix = prefixState(opts);\n if (prefix && total === 0)\n throw new Error('prefixState requires a non-empty message');\n if (prefix) {\n const h = new Stream(prefix._cloneInto(), outputLen);\n for (const p of parts)\n h.update(p);\n return h.digest(rawOutputOpts(opts));\n }\n if (impl.create) {\n const h = createSync(opts);\n for (const p of parts)\n h.update(p);\n return h.digest(rawOutputOpts(opts));\n }\n const joined = concatBytes(...parts);\n try {\n return hashSync(joined, opts);\n }\n finally {\n clean(joined);\n }\n };\n const parallelSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n for (const p of parts)\n abytes(p);\n const prefix = prefixState(opts);\n if (prefix && parts.length === 0)\n throw new Error('prefixState requires a non-empty message');\n if (prefix)\n for (const p of parts)\n if (p.length === 0)\n throw new Error('prefixState requires a non-empty message');\n const checked = checkParallelOutput(opts, parts.length, outputLen, canXOF);\n let tmp;\n const base = prefix || (impl.create ? impl.create(opts) : undefined);\n let work;\n for (let i = 0; i < parts.length; i++) {\n const lane = checked.out[i];\n if (base) {\n work = base._cloneInto(work);\n work.update(parts[i]);\n tmp = writeInto(work, lane, checked.dkLen, tmp);\n }\n else {\n const outOpts = (isBytes(opts)\n ? { key: opts, out: lane, outPos: 0, dkLen: checked.dkLen }\n : { ...(opts || {}), out: lane, outPos: 0, dkLen: checked.dkLen });\n hashSync(parts[i], outOpts);\n }\n }\n if (tmp)\n clean(tmp);\n if (work)\n work.destroy();\n if (base && base !== prefix)\n base.destroy();\n return checked.out;\n };\n const setupTick = (setup, total, opts) => {\n const rawSetup = setup;\n const rawOpts = opts;\n return !rawSetup.isAsync\n ? !rawOpts?.onProgress\n ? (rawSetup({ total: 0 }), (_inc) => false)\n : rawSetup({ total, onProgress: rawOpts.onProgress })\n : rawSetup({\n total,\n asyncTick: rawOpts?.asyncTick,\n onProgress: rawOpts?.onProgress,\n nextTick: rawOpts?.nextTick,\n });\n };\n const hash = ((msg, opts = {}) => hashSync(msg, opts));\n const chunks = (parts, opts = {}) => chunksSync(parts, opts);\n Object.assign(chunks, {\n async: mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return chunksSync(parts, rawOpts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, rawOpts);\n const out = chunksSync(parts, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(total))\n yield;\n return out;\n }).async,\n });\n const parallel = (parts, opts = {}) => parallelSync(parts, opts);\n Object.assign(parallel, {\n async: mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return parallelSync(parts, rawOpts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, rawOpts);\n const out = parallelSync(parts, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(total))\n yield;\n return out;\n }).async,\n });\n Object.assign(hash, {\n async: mkAsync(function* (setup, msg, opts = {}) {\n const setupMode = setup;\n // TArg expands byte-like option unions here; keep the cast local to the async shim.\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return hashSync(msg, rawOpts);\n const tick = setupTick(setupMode, msg.length, rawOpts);\n const out = hashSync(msg, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(msg.length))\n yield;\n return out;\n }).async,\n chunks,\n parallel,\n create: (opts = {}) => createSync(opts),\n cleanState(state) {\n const stream = stateStream(state);\n stream.destroy();\n prefixStates.delete(stream);\n },\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nconst copyOutput = (out, opts, outputLen, canXOF) => {\n const rawLen = opts?.dkLen;\n if (rawLen !== undefined)\n anumber(rawLen, 'dkLen');\n const dkLen = rawLen === undefined ? outputLen : rawLen;\n anumber(dkLen, 'dkLen');\n // Old awasm hash output opts intentionally allow requesting a shorter fixed digest, but\n // must reject oversize lengths instead of silently clamping or zero-extending the tail.\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n if (out.length < dkLen)\n throw new RangeError(`expected output length >= dkLen, got ${out.length}`);\n const msg = out.subarray(0, dkLen);\n if (!opts?.out) {\n const res = copyBytes(msg);\n clean(out);\n return res;\n }\n const outPos = opts?.outPos || 0;\n anumber(outPos, 'outPos');\n if (opts.out.length < outPos + dkLen)\n throw new RangeError('output is too small');\n opts.out.set(msg, outPos);\n clean(out);\n return opts.out;\n};\nconst copyParallelOutput = (outs, views, dkLen, outputLen, canXOF) => {\n if (views.length !== outs.length)\n throw new RangeError('output array length must match messages length');\n for (let i = 0; i < outs.length; i++)\n copyOutput(outs[i], { out: views[i], dkLen }, outputLen, canXOF);\n return views;\n};\nconst hashSyncError = () => {\n throw new Error('sync is not supported');\n};\nexport function mkHashAsync(def_, impl_, platform = 'webcrypto', isSupported, meta) {\n const def = def_;\n const impl = impl_;\n const { outputLen, blockLen, canXOF, oid } = def;\n const hash = ((_msg) => hashSyncError());\n const hashAsync = async (msg, opts = {}) => {\n abytes(msg);\n const out = await impl.hash(msg, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n };\n const chunks = ((_parts) => hashSyncError());\n const chunksAsync = async (parts, opts = {}) => {\n if (opts.prefixState !== undefined)\n throw new Error('prefixState is not supported');\n for (let i = 0; i < parts.length; i++)\n abytes(parts[i]);\n if (impl.chunks) {\n const out = await impl.chunks(parts, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n }\n const joined = concatBytes(...parts);\n try {\n const out = await impl.hash(joined, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n }\n finally {\n clean(joined);\n }\n };\n Object.assign(chunks, { async: chunksAsync });\n const parallel = ((_parts) => hashSyncError());\n const parallelAsync = async (parts, opts = {}) => {\n if (opts.prefixState !== undefined)\n throw new Error('prefixState is not supported');\n for (let i = 0; i < parts.length; i++)\n abytes(parts[i]);\n const checked = checkParallelOutput(opts, parts.length, outputLen, canXOF);\n const runOpts = { ...opts, out: undefined, outPos: undefined };\n const out = impl.parallel\n ? await impl.parallel(parts, runOpts)\n : await Promise.all(parts.map((i) => impl.hash(i, runOpts)));\n return copyParallelOutput(out, checked.out, checked.dkLen, outputLen, canXOF);\n };\n Object.assign(parallel, { async: parallelAsync });\n Object.assign(hash, {\n async: hashAsync,\n chunks,\n parallel,\n create: () => {\n throw new Error('streaming is not supported');\n },\n cleanState: () => {\n throw new Error('prefixState is not supported');\n },\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n if (meta)\n Object.assign(hash, meta);\n if (isSupported)\n hash.isSupported = isSupported;\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nexport function mkHashStub(def_) {\n const def = def_;\n const { outputLen, blockLen, canXOF, oid } = def;\n let inner;\n function checkInner(inner) {\n if (inner === undefined)\n throw new Error('implementation not installed');\n }\n const hash = ((msg, opts = {}) => {\n checkInner(inner);\n return inner(msg, opts);\n });\n const chunks = (parts, opts = {}) => {\n checkInner(inner);\n return inner.chunks(parts, opts);\n };\n Object.assign(chunks, {\n async: async (parts, opts = {}) => {\n checkInner(inner);\n return inner.chunks.async(parts, opts);\n },\n });\n const parallel = (chunks, opts = {}) => {\n checkInner(inner);\n return inner.parallel(chunks, opts);\n };\n Object.assign(parallel, {\n async(chunks, opts = {}) {\n checkInner(inner);\n return inner.parallel.async(chunks, opts);\n },\n });\n Object.assign(hash, {\n async: async (msg, opts = {}) => {\n checkInner(inner);\n return inner.async(msg, opts);\n },\n chunks,\n parallel,\n create(opts = {}) {\n checkInner(inner);\n return inner.create(opts);\n },\n cleanState(state) {\n checkInner(inner);\n return inner.cleanState(state);\n },\n getPlatform: () => {\n checkInner(inner);\n return inner.getPlatform();\n },\n getDefinition: () => {\n checkInner(inner);\n return inner.getDefinition();\n },\n install: (impl, opts = {}) => {\n const { onlyMissing } = opts;\n if (onlyMissing !== undefined)\n abool(onlyMissing);\n if (onlyMissing && inner !== undefined)\n return;\n // install() accepts only constructor-created hashes: WeakSet branding rejects copied fields,\n // and exact definition identity rejects same-shaped but different hash families.\n if (!isBranded(impl))\n throw new Error('install: non-branded implementation');\n // NOTE: this strict check works because all implementations will use exact same frozen definition\n // which means it is impossible to use same blockLen/outputLen hash from different definition\n if (impl.getDefinition() !== def)\n throw new Error('wrong implementation definition');\n inner = impl;\n },\n canXOF,\n outputLen,\n blockLen,\n oid,\n });\n return Object.freeze(hash);\n}\n", "/**\n * Constants for hashes and ciphers. Mostly initial state.\n * @module\n */\nimport { u8 } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\nexport const SHA256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n];\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\nexport const SHA256_IV_U8 = /* @__PURE__ */ u8(SHA256_IV);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\nexport const SHA224_IV_U8 = /* @__PURE__ */ u8(SHA224_IV);\n// Round constants\n// RFC 6234 \u00A75.2:\n// first 64 bits of the fractional parts of the cube roots of the first 80 primes.\n// prettier-ignore\nexport const SHA512_K = /* @__PURE__ */ [\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817',\n].map((n) => BigInt(n));\n// 64-bit SHA-2 IV words are stored as [lo, hi] u32 pairs.\n// This lets u8(...) seed native module state directly.\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,\n 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,\n]);\nexport const SHA512_IV_U8 = /* @__PURE__ */ u8(SHA512_IV);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0xcbbb9d5d, 0x367cd507, 0x629a292a, 0x3070dd17, 0x9159015a, 0xf70e5939, 0x152fecd8,\n 0xffc00b31, 0x67332667, 0x68581511, 0x8eb44a87, 0x64f98fa7, 0xdb0c2e0d, 0xbefa4fa4, 0x47b5481d,\n]);\nexport const SHA384_IV_U8 = /* @__PURE__ */ u8(SHA384_IV);\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n */\n// Derived SHA-512/t IVs also use [lo, hi] u32 pairs here.\n// That lets hashes.ts seed the shared SHA-512 state layout directly.\n/** SHA512/224 IV */\nconst SHA512_224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x19544da2, 0x8c3d37c8, 0x89dcd4d6, 0x73e19966, 0x32ff9c82, 0x1dfab7ae, 0x582f9fcf, 0x679dd514,\n 0x7bd44da8, 0x0f6d2b69, 0x04c48942, 0x77e36f73, 0x6a1d36c8, 0x3f9d85a8, 0x91d692a1, 0x1112e6ad,\n]);\nexport const SHA512_224_IV_U8 = /* @__PURE__ */ u8(SHA512_224_IV);\n/** SHA512/256 IV */\nconst SHA512_256_IV = /* @__PURE__ */ Uint32Array.from([\n 0xfc2bf72c, 0x22312194, 0xc84c64c2, 0x9f555fa3, 0x6f53b151, 0x2393b86b, 0x5940eabd, 0x96387719,\n 0xa88effe3, 0x96283ee2, 0x53863992, 0xbe5e1e25, 0x2c85b8aa, 0x2b0199fc, 0x81c52ca2, 0x0eb72ddc,\n]);\nexport const SHA512_256_IV_U8 = /* @__PURE__ */ u8(SHA512_256_IV);\n// RFC 7693 \u00A72.6 / Appendix C: BLAKE2b reuses the SHA-512 IV words.\n// This file keeps them as LE [lo, hi] u32 halves for the BLAKE2b helpers.\n// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc.\nexport const B2B_IV = /* @__PURE__ */ Uint32Array.from([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,\n 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,\n]);\nexport const B2B_IV_U8 = /* @__PURE__ */ u8(B2B_IV);\nconst _32n = /* @__PURE__ */ BigInt(32);\nexport const B2B_IV_U64 = /* @__PURE__ */ [\n '0x6a09e667f3bcc908',\n '0xbb67ae8584caa73b',\n '0x3c6ef372fe94f82b',\n '0xa54ff53a5f1d36f1',\n '0x510e527fade682d1',\n '0x9b05688c2b3e6c1f',\n '0x1f83d9abfb41bd6b',\n '0x5be0cd19137e2179',\n].map((n) => BigInt(n));\n// RFC 7693 \u00A72.6 / Appendix D: BLAKE2s reuses the SHA-256 IV words as-is.\nexport const B2S_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\nexport const B2S_IV_U8 = /* @__PURE__ */ u8(B2S_IV);\n// SHA-3 proposal BLAKE v1.2 \u00A72.1.1 Table 2.1 / RFC 7693 \u00A72.7:\n// rows 0..9 are the published SIGMA table; rows 10..11 repeat 0..1 for BLAKE2b;\n// rows 10..13 satisfy SHA-3 proposal BLAKE v1.2 \u00A72.2.2's sigma[r mod 10] reuse for 14-round\n// BLAKE-64; rows 14..15 extend that modulo-10 reuse for the legacy 16-round\n// Blake1 path.\n// prettier-ignore\nexport const BSIGMA = /* @__PURE__ */ Uint8Array.from([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n // Blake1, unused in others\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n]);\n// blake1\n// first half of C512\n// SHA-3 proposal BLAKE v1.2 \u00A72.1.1: BLAKE-32 uses c0..c15,\n// starting at 0x243f6a88 and ending at 0xb5470917.\nexport const B32C = /* @__PURE__ */ Uint32Array.from([\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n]);\n// prettier-ignore\n// SHA-3 proposal BLAKE v1.2 \u00A72.2.1 c0..c15 are stored as [lo32, hi32] halves.\n// generateTBL512_new rebuilds each 64-bit constant with (hi << 32n) | lo.\nexport const B64C = /* @__PURE__ */ (() => Uint32Array.from([\n B32C[1], B32C[0], B32C[3], B32C[2], B32C[5], B32C[4], B32C[7], B32C[6], // le<->be\n B32C[9], B32C[8], B32C[11], B32C[10], B32C[13], B32C[12], B32C[15], B32C[14],\n 0x8979fb1b, 0x9216d5d9, 0x98dfb5ac, 0xd1310ba6, 0xd01adfb7, 0x2ffd72db, 0x6a267e96, 0xb8e1afed,\n 0xf12c7f99, 0xba7c9045, 0xb3916cf7, 0x24a19947, 0x858efc16, 0x0801f2e2, 0x71574e69, 0x636920d8,\n]))();\nexport const B64C_U64 = /* @__PURE__ */ [\n // first half\n '0x243f6a8885a308d3',\n '0x13198a2e03707344',\n '0xa4093822299f31d0',\n '0x082efa98ec4e6c89',\n '0x452821e638d01377',\n '0xbe5466cf34e90c6c',\n '0xc0ac29b7c97c50dd',\n '0x3f84d5b5b5470917',\n // second half\n '0x9216d5d98979fb1b',\n '0xd1310ba698dfb5ac',\n '0x2ffd72dbd01adfb7',\n '0xb8e1afed6a267e96',\n '0xba7c9045f12c7f99',\n '0x24a19947b3916cf7',\n '0x0801f2e2858efc16',\n '0x636920d871574e69',\n].map((n) => BigInt(n));\nexport const B256_IV = /* @__PURE__ */ SHA256_IV.slice();\n// SHA-3 proposal BLAKE v1.2 \u00A72.2.1: legacy Blake1-64 keeps the SHA-512 IV in canonical\n// [hi32, lo32] order, unlike SHA512_IV above, which is laid out as [lo, hi]\n// for module-state seeding.\nexport const B512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\nfunction generateTBL256() {\n const TBL = [];\n for (let i = 0, j = 0; i < 14; i++, j += 16) {\n for (let offset = 1; offset < 16; offset += 2) {\n TBL.push(B32C[BSIGMA[j + offset]]);\n TBL.push(B32C[BSIGMA[j + offset - 1]]);\n }\n }\n return TBL;\n}\nexport const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute\nfunction generateTBL512_new() {\n const TBL = [];\n for (let r = 0, k = 0; r < 16; r++, k += 16) {\n for (let offset = 1; offset < 16; offset += 2) {\n const l0 = B64C[BSIGMA[k + offset] * 2 + 1];\n const h0 = B64C[BSIGMA[k + offset] * 2 + 0];\n const l1 = B64C[BSIGMA[k + offset - 1] * 2 + 1];\n const h1 = B64C[BSIGMA[k + offset - 1] * 2 + 0];\n TBL.push((BigInt(l0) << _32n) | BigInt(h0));\n TBL.push((BigInt(l1) << _32n) | BigInt(h1));\n }\n }\n return TBL;\n}\nexport const TBL512 = /* @__PURE__ */ generateTBL512_new();\n/** Initial SHA-1 state from RFC 3174 \u00A76.1. */\nexport const SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\nexport const SHA1_IV_U8 = /* @__PURE__ */ u8(SHA1_IV);\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 \u00A73.4 / Appendix A.3 `T[1..64]` table. */\nexport const MD5_K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/**\n * RFC 1321 \u00A73.3 / Appendix A.3 MD5 initial state.\n * It matches the first four SHA-1 words, so slice() copies them without\n * aliasing SHA1_IV.\n */\nexport const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\nexport const MD5_IV_U8 = /* @__PURE__ */ u8(MD5_IV);\n/** RIPEMD-160 initial state; same five 32-bit words as SHA-1. */\nexport const RIPEMD160_IV = /* @__PURE__ */ new Uint32Array([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\nexport const RIPEMD160_IV_U8 = /* @__PURE__ */ u8(RIPEMD160_IV);\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nexport const RIPEMD160_idxL = /* @__PURE__ */ (() => idxLR[0])();\nexport const RIPEMD160_idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nexport const RIPEMD160_shiftsL160 = /* @__PURE__ */ RIPEMD160_idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nexport const RIPEMD160_shiftsR160 = /* @__PURE__ */ RIPEMD160_idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nexport const RIPEMD160_Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nexport const RIPEMD160_Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\n// FIPS 202 Algorithm 5 rc():\n// when the outgoing bit is 1, the 8-bit LFSR xors taps 0, 4, 5, and 6.\n// That compresses to the feedback mask `0x71`.\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\n// Grouped export destructuring sticks in bundles even when SHA3 is unused, so generate\n// each table in its own pure IIFE instead of exporting all three from one object.\n// FIPS 202 \u00A73.2.2 / \u00A73.2.3 walk the 24 non-(0,0) lanes.\n// This table stores each lane as 5*y + x for the u64 state layout.\nexport const SHA3_PI2 = /* @__PURE__ */ (() => {\n const SHA3_PI2 = [];\n for (let round = 0, x = 1, y = 0; round < 24; round++) {\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI2.push(5 * y + x);\n }\n return SHA3_PI2;\n})();\nexport const SHA3_ROTL = /* @__PURE__ */ (() => {\n const SHA3_ROTL = [];\n for (let round = 0, x = 1, y = 0; round < 24; round++) {\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n }\n return SHA3_ROTL;\n})();\nexport const SHA3_IOTA = /* @__PURE__ */ (() => {\n const SHA3_IOTA = [];\n for (let round = 0, R = _1n; round < 24; round++) {\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n SHA3_IOTA.push(t);\n }\n return SHA3_IOTA;\n})();\n// Flag bitset\n// BLAKE3 compression-domain flags from Table~\\ref{tab:flags}.\nexport const B3_Flags = {\n CHUNK_START: 0b1,\n CHUNK_END: 0b10,\n PARENT: 0b100,\n ROOT: 0b1000,\n KEYED_HASH: 0b10000,\n DERIVE_KEY_CONTEXT: 0b100000,\n DERIVE_KEY_MATERIAL: 0b1000000,\n};\n// Default BLAKE3 IV, cloned from the shared BLAKE2s / SHA-256 IV basis.\nexport const B3_IV = /* @__PURE__ */ SHA256_IV.slice();\nexport const B3_IV_U8 = /* @__PURE__ */ u8(B3_IV);\n// Seven 16-word rounds of the BLAKE3 message schedule.\n// Generated by repeatedly applying the adopted single permutation.\nexport const B3_SIGMA = /* @__PURE__ */ (() => {\n const Id = Array.from({ length: 16 }, (_, i) => i);\n const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]);\n const res = [];\n for (let i = 0, v = Id; i < 7; i++, v = permute(v))\n res.push(...v);\n return Uint8Array.from(res);\n})();\n// Replaces `TextEncoder` for ASCII literals, which is enough for sigma constants.\n// Non-ASCII input would not match UTF-8 `TextEncoder` output.\nconst encodeStr = (str) => Uint8Array.from(str.split(''), (c) => c.charCodeAt(0));\n// RFC 8439 \u00A72.3 / RFC 7539 \u00A72.3 only define the 256-bit-key constants; this 16-byte sigma is\n// kept for legacy allowShortKeys Salsa/ChaCha variants.\nexport const ARX_SIGMA16 = /* @__PURE__ */ encodeStr('expand 16-byte k');\n// RFC 8439 \u00A72.3 / RFC 7539 \u00A72.3 define words 0-3 as\n// `0x61707865 0x3320646e 0x79622d32 0x6b206574`, i.e. `expand 32-byte k`.\nexport const ARX_SIGMA32 = /* @__PURE__ */ encodeStr('expand 32-byte k');\n", "/**\n * Hash definitions. Common logic for all targets.\n * Doesn't contain WASM-specific/JS-specific code.\n * @module\n */\nimport * as constants from \"./constants.js\";\nimport {} from \"./hashes-abstract.js\";\nimport { mkArgon2d, mkArgon2i, mkArgon2id, mkScrypt } from \"./kdf.js\";\nimport { abytes, anumber, isBytes, oidNist, u32 } from \"./utils.js\";\n// FIPS 202 \u00A76.1 appends SHA-3 suffix bits `01`; this byte-level wrapper uses `0x06`\n// so the shared Keccak padding path applies those domain bits before pad10*1.\nexport const sha3_224 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 144,\n outputLen: 28,\n outputBlockLen: 144,\n oid: /* @__PURE__ */ oidNist(0x07),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n oid: /* @__PURE__ */ oidNist(0x08),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_384 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 104,\n outputLen: 48,\n outputBlockLen: 104,\n oid: /* @__PURE__ */ oidNist(0x09),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_512 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 72,\n outputLen: 64,\n outputBlockLen: 72,\n oid: /* @__PURE__ */ oidNist(0x0a),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// Legacy Keccak keeps the original 0x01 domain suffix on Keccak-f[1600].\n// Unlike FIPS 202 SHA3-*, it does not use the SHA-3 0x06 suffix or expose\n// NIST hash OIDs here.\nexport const keccak_224 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 144,\n outputLen: 28,\n outputBlockLen: 144,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_384 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 104,\n outputLen: 48,\n outputBlockLen: 104,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_512 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 72,\n outputLen: 64,\n outputBlockLen: 72,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// FIPS 202 \u00A76.2: SHAKE128 uses the 1111 domain suffix.\n// It is `0x1f` in this byte-oriented padding path and stays XOF-capable; this\n// wrapper keeps a 16-byte library default while callers can request any dkLen.\nexport const shake128 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 168,\n outputLen: 16,\n outputBlockLen: 168,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0b),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// FIPS 202 \u00A76.2: SHAKE256 uses the same 1111 domain suffix (`0x1f` here).\n// It stays XOF-capable; this wrapper keeps a 32-byte library default while\n// callers can request any dkLen.\nexport const shake256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0c),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// This keeps the SHAKE128 algorithm and OID from FIPS 202 Appendix C.\n// It chooses the 32-byte \"NIST version\" default while staying XOF-capable for\n// any requested dkLen.\nexport const shake128_32 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 168,\n outputLen: 32,\n outputBlockLen: 168,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0b),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// This keeps the SHAKE256 algorithm and OID from FIPS 202 Appendix C.\n// It chooses the 64-byte \"NIST version\" default while staying XOF-capable for\n// any requested dkLen.\nexport const shake256_64 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 136,\n outputLen: 64,\n outputBlockLen: 136,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0c),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha256 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 32,\n oid: /* @__PURE__ */ oidNist(0x01),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA256_IV_U8);\n },\n});\n// RFC 6234 \u00A76.2: SHA-224 shares the SHA-256 compression core and eight-word state, but\n// exposes only the leftmost 224 bits, so this wrapper keeps 32-byte backend output blocks\n// while truncating the public digest to 28 bytes.\nexport const sha224 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 28,\n outputBlockLen: 32,\n oid: /* @__PURE__ */ oidNist(0x04),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA224_IV_U8);\n },\n});\nexport const sha512 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 64,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x03),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_IV_U8);\n },\n});\n// RFC 4634 \u00A76.4: SHA-384 shares the SHA-512 compression core and eight-word state, but\n// exposes only H(N)0..H(N)5, so this wrapper keeps 64-byte backend output blocks while\n// truncating the public digest to 48 bytes.\nexport const sha384 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 48,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x02),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA384_IV_U8);\n },\n});\n// This variant uses the shared SHA-512 backend with the derived SHA-512/224 IV, so backend\n// output blocks stay 64 bytes while the public digest truncates to 28 bytes.\nexport const sha512_224 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 28,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x05),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_224_IV_U8);\n },\n});\n// This variant uses the shared SHA-512 backend with the derived SHA-512/256 IV, so backend\n// output blocks stay 64 bytes while the public digest truncates to 32 bytes.\nexport const sha512_256 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 32,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x06),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_256_IV_U8);\n },\n});\nexport const sha1 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 20,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA1_IV_U8);\n },\n});\nexport const ripemd160 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 20,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.RIPEMD160_IV_U8);\n },\n});\nexport const md5 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 16,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.MD5_IV_U8);\n },\n});\nfunction blake1Salt(batchPos, mod, opts) {\n if (opts.salt !== undefined) {\n const slt = opts.salt;\n const salt_chunks = mod.segments['state.salt_chunks'];\n abytes(slt, salt_chunks[batchPos].length, 'salt');\n salt_chunks[batchPos].set(slt);\n }\n}\nexport const blake256 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 32,\n // SHA-3 proposal BLAKE v1.2 \u00A72.1.1 / \u00A72.1.3:\n // BLAKE-32 starts from the SHA-256 IV, and the 256-bit variant\n // keeps the pre-length padding bit set to 1, so this wrapper uses suffix 0x01.\n suffix: 0b0000_0001,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA256_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake224 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 28,\n // SHA-3 proposal BLAKE v1.2 \u00A72.3:\n // BLAKE-28 reuses the BLAKE-32 core with the SHA-224 IV, replaces the\n // pre-length padding bit with 0, and truncates the public digest to 224 bits, so this\n // wrapper keeps 32-byte backend output blocks and leaves suffix at the default 0.\n outputBlockLen: 32,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA224_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake384 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 48,\n // SHA-3 proposal BLAKE v1.2 \u00A72.4:\n // BLAKE-48 reuses the BLAKE-64 core with the SHA-384 IV, replaces the\n // pre-length padding bit with 0, and truncates the public digest to 384 bits, so this\n // wrapper keeps 64-byte backend output blocks and leaves suffix at the default 0.\n outputBlockLen: 64,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA384_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake512 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 64,\n // SHA-3 proposal BLAKE v1.2 \u00A72.2.1 / \u00A72.2.3:\n // BLAKE-64 starts from the SHA-512 IV, and the 512-bit variant\n // keeps the pre-length padding bit set to 1, so this wrapper uses suffix 0x01 and falls\n // back to 64-byte output blocks.\n suffix: 0b0000_0001,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nfunction blake2Init(batchPos, outputLen, maxBlocks, blockLen, mod, opts) {\n if (opts.dkLen !== undefined)\n anumber(opts.dkLen, 'opts.dkLen');\n const dkLen = opts.dkLen === undefined ? outputLen : opts.dkLen;\n let keyLength = 0;\n let blocks = 0;\n // RFC 7693 uses digest length nn in 1..outputLen, so zero-length output is invalid here.\n if (dkLen <= 0 || dkLen > outputLen)\n throw new Error('outputLen bigger than keyLen');\n const { key, salt, personalization } = opts;\n if (key !== undefined) {\n if (key.length < 1 || key.length > outputLen)\n throw new Error('\"key\" expected to be undefined or of length=1..' + outputLen);\n abytes(key);\n const keyPos = batchPos * maxBlocks * blockLen;\n // RFC 7693 \u00A73.3: keyed BLAKE2 pads the key with zeros and prepends it as d[0],\n // so preload one full block here and report blocks=1 to the shared absorber.\n mod.segments.buffer.fill(0, keyPos, keyPos + blockLen);\n mod.segments.buffer.set(key, keyPos);\n keyLength = key.length;\n blocks = 1;\n }\n const salt_chunk = mod.segments['init.salt_chunks'][batchPos];\n const pers_chunk = mod.segments['init.personalization_chunks'][batchPos];\n if (salt !== undefined) {\n abytes(salt, salt_chunk.length, 'salt');\n salt_chunk.set(salt);\n }\n if (personalization !== undefined) {\n abytes(personalization, pers_chunk.length, 'personalization');\n pers_chunk.set(personalization);\n }\n mod.initBlake2(batchPos, 1, 1, dkLen, keyLength);\n // Streaming BLAKE2 instances keep dkLen as their fixed digest size, so create({ dkLen })\n // must carry that value into digest() / digestInto() instead of falling back to the family max.\n return { blocks, outputLen: dkLen };\n}\nexport const blake2s = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n // RFC 7693 \u00A74: the default named surface here is BLAKE2s-256 (nn = 32);\n // shorter digests come from opts.dkLen, and OID support is optional so oid stays unset.\n outputLen: 32,\n init: (batchPos, maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.B2S_IV_U8);\n return blake2Init(batchPos, 32, maxBlocks, 64, mod, opts);\n },\n});\nexport const blake2b = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n // RFC 7693 \u00A74: the default named surface here is BLAKE2b-512 (nn = 64);\n // shorter digests come from opts.dkLen, and OID support is optional so oid stays unset.\n outputLen: 64,\n suffix: 0,\n init: (batchPos, maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.B2B_IV_U8);\n return blake2Init(batchPos, 64, maxBlocks, 128, mod, opts);\n },\n});\nexport const blake3 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n // BLAKE3's default hash is the 32-byte root chaining value, but XOF output repeats\n // the full 64-byte ROOT compression blocks, so outputBlockLen stays 64 while outputLen is 32.\n outputBlockLen: 64,\n outputLen: 32,\n chunks: /* @__PURE__ */ (() => 10 * 1024 * 16)(),\n canXOF: true,\n init(batchPos, _maxBlocks, mod, hash, opts = {}) {\n const { key, context, _keyContext } = opts;\n if (opts.dkLen !== undefined)\n anumber(opts.dkLen, 'opts.dkLen');\n let flags = 0 >>> 0;\n let IV = constants.B3_IV_U8;\n if (key !== undefined) {\n abytes(key, 32, 'key');\n if (context !== undefined || _keyContext !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n // PRF/HMAC/MAC\n IV = key;\n flags = constants.B3_Flags.KEYED_HASH;\n }\n else if (_keyContext !== undefined) {\n if (context !== undefined || key !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n flags = constants.B3_Flags.DERIVE_KEY_CONTEXT;\n }\n else if (context !== undefined) {\n abytes(context, undefined, 'context');\n if (_keyContext !== undefined || key !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n if (_keyContext !== undefined && typeof _keyContext !== 'boolean')\n throw new Error('wrong type for _keyContext');\n // BLAKE3 derive_key is two-stage: first hash the context under\n // DERIVE_KEY_CONTEXT, then use that 32-byte output as the key words for key material.\n const derive = hash;\n IV = derive(context, { dkLen: 32, _keyContext: true });\n flags = constants.B3_Flags.DERIVE_KEY_MATERIAL;\n }\n mod.segments['state.iv_chunks'][batchPos].set(IV);\n mod.segments['state.state_chunks'][batchPos].set(IV);\n u32(mod.segments['state.flags_chunks'][batchPos])[0] = flags;\n },\n});\n// Normalize both legacy mac(msg, key) and newer mac(msg, { key }) call shapes without cloning.\nconst getMacKey = (opts) => (isBytes(opts) ? opts : opts.key);\n// RFC 8439 \u00A72.5: Poly1305 consumes a fresh 32-byte one-time key per message.\n// It emits a 16-byte tag over 16-byte blocks.\nexport const poly1305 = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 32, got type=undefined');\n abytes(key, 32, 'key');\n mod.segments['state.poly.key_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// RFC 4493 \u00A72.4 / FIPS 197-upd1 \u00A73.1:\n// AES-CMAC uses AES's 16-byte block size and fixed 16-byte tag, while this\n// wrapper accepts AES-128/192/256 keys.\nexport const cmac = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"cmac key\" expected Uint8Array of length 16/24/32, got length=undefined');\n abytes(key, undefined, 'cmac key');\n if (key.length !== 16 && key.length !== 24 && key.length !== 32)\n throw new Error('\"cmac key\" expected Uint8Array of length 16/24/32, got length=' + key.length);\n mod.segments['state.key_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos, key.length);\n },\n});\n// NIST SP 800-38D \u00A76.4 / \u00A77.1:\n// raw GHASH takes the 16-byte hash subkey H = CIPH_K(0^128), not the AES key K.\nexport const ghash = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 16, got type=undefined');\n abytes(key, 16, 'key');\n mod.segments['state.ghash.h_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// RFC 8452 \u00A73 / Appendix A:\n// raw POLYVAL takes a 16-byte field element H and shares the GHASH core via\n// the reversed byte/bit convention.\nexport const polyval = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 16, got type=undefined');\n abytes(key, 16, 'key');\n mod.segments['state.ghash.h_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// NOTE: safe for tree-shaking since used only in building process\n// prettier-ignore\nconst defs = {\n sha3_224, sha3_256, sha3_384, sha3_512, // sha3\n keccak_224, keccak_256, keccak_384, keccak_512, // keccak\n shake128, shake256, shake128_32, shake256_64, // shake\n sha224, sha256, sha384, sha512, sha512_224, sha512_256, // sha2\n sha1, ripemd160, md5, // legacy\n blake224, blake256, blake384, blake512, blake2s, blake2b, blake3, // blake\n poly1305, ghash, polyval, cmac, // MAC\n};\n// Map each name to module\nconst MOD_OF = {\n // sha3\n sha3_224: 'keccak24',\n sha3_256: 'keccak24',\n sha3_384: 'keccak24',\n sha3_512: 'keccak24',\n // keccak\n keccak_224: 'keccak24',\n keccak_256: 'keccak24',\n keccak_384: 'keccak24',\n keccak_512: 'keccak24',\n // shake\n shake128: 'keccak24',\n shake256: 'keccak24',\n shake128_32: 'keccak24',\n shake256_64: 'keccak24',\n // sha2\n sha224: 'sha256',\n sha256: 'sha256',\n sha384: 'sha512',\n sha512: 'sha512',\n sha512_224: 'sha512',\n sha512_256: 'sha512',\n // legacy\n sha1: 'sha1',\n ripemd160: 'ripemd160',\n md5: 'md5',\n // blake1/2/3\n blake224: 'blake256',\n blake256: 'blake256',\n blake384: 'blake512',\n blake512: 'blake512',\n blake2s: 'blake2s',\n blake2b: 'blake2b',\n blake3: 'blake3',\n // Mac\n poly1305: 'poly1305',\n ghash: 'ghash',\n polyval: 'polyval',\n cmac: 'cmac',\n};\n// Verifies that definition actually can be used with module\nfunction buildDefinitions(defs, modOf) {\n const out = {};\n for (const k in defs)\n out[k] = { mod: modOf[k], def: defs[k] };\n return out;\n}\nexport const Definitions = /* @__PURE__ */ buildDefinitions(defs, MOD_OF);\n// Generic definitions can be used for non-hash/cipher surfaces that still need\n// a specific wrapper function.\n// KDF stubs compare factory identity, so installed implementations carry the public wrapper here.\nexport const scrypt = ((mod, deps, platform) => mkScrypt(mod, deps, platform, scrypt));\nexport const argon2d = ((mod, deps, platform) => mkArgon2d(mod, deps, platform, argon2d));\nexport const argon2i = ((mod, deps, platform) => mkArgon2i(mod, deps, platform, argon2i));\nexport const argon2id = ((mod, deps, platform) => mkArgon2id(mod, deps, platform, argon2id));\n// type GenericDefinition<T, DEPS extends Record<string, any>, RET> = (\n// mod: T,\n// deps: DEPS,\n// platform: string\n// ) => RET;\n// const genDefs = { scrypt, argon2d, argon2i, argon2id } satisfies Record<\n// string,\n// GenericDefinition<any, any, any>\n// >;\nconst KDFStub = { path: 'kdf.ts', fn: 'mkKDFStub' };\nexport const GenericDefinitions = {\n scrypt: { mod: 'scrypt', deps: ['sha256'], stub: KDFStub },\n argon2d: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n argon2i: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n argon2id: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n};\n", "// WARNING: This file is auto-generated. Any changes will be lost.\nfunction init_module(_imports = {}, pool) {\n const _importsEmbed = { env: {} };\n _imports = { ..._importsEmbed, ..._imports, env: { ..._importsEmbed.env, ..._imports.env } };\n ;\n if (!_imports.env._memory)\n _imports.env._memory = new WebAssembly.Memory({ initial: 241, maximum: 241, shared: false });\n const code = Uint8Array.from(atob('AGFzbQEAAAAB3wESYAN/f38AYAJ/fwBgBn9/f39/fwF/YAh/f39/f39/fwBgCX9/f39/f39/fwBgBn9/f39/fwBgBX9/f39/AGACfn8Cfn9gAX8Bf2ALf397e3t7e3t7e38Lf397e3t7e3t7e39gCHt7e3t7e3t7CHt7e3t7e3t7YAAAYAt/f39/f39/f39/fwt/f39/f39/f39/f2AIf39/f39/f38If39/f39/f39gCX97e3t7e3t7ewl/e3t7e3t7e3tgCX9/f39/f39/fwl/f39/f39/f39gA397ewN/e3tgAn9+An9+AwkIAAECAwQDBQYFBgEB8QHxAQebAQkGbWVtb3J5AgAPY29tcHJlc3NQYXJlbnRzAAATY29tcHJlc3NQYXJlbnRzRnVsbAABB3BhZGRpbmcAAhZwcm9jY2Vzc0NodW5rc1BhcmFsbGVsAAMYcHJvY2Nlc3NDaHVua3NTZXF1ZW50aWFsAAQNcHJvY2Vzc0Jsb2NrcwAFEHByb2Nlc3NPdXRCbG9ja3MABgVyZXNldAAHCqunBAizJAH9A38gAEHgEGxBIGoiAygCACEEIAN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A0ODxQVFhccHR4f/QsEACAVIJ0HIJ8H/Q0EBQYHDA0ODxQVFhccHR4f/QsEACAVQRBqIKEHIKMH/Q0EBQYHDA0ODxQVFhccHR4f/QsEAAwBCyANQeAQbEHAAGogDUHgEGxBIGpBIPwKAAAgDUHgEGxBoBFqIA1B4BBsQYARakEg/AoAACANQeAQbEGAImogDUHgEGxB4CFqQSD8CgAAIA1B4BBsQeAyaiANQeAQbEHAMmpBIPwKAAALIA0LIQ0gDUEEaiGkByCkByCkByAJSQ0AGiCkBwshDCAMCyELIAsLIQogCQIIIaUHIKUHIKUHIAhJRQ0AGiClBwIIIaYHIKYHAwghpwcgpwcCCCGoByCoB0HgEGxBwABqIaoHIKgHQeAQbEEgaiKpBygCACGrByCpB0EEaiKsBygCACGtByCsB0EEaiKuBygCACGvByCuB0EEaiKwBygCACGxByCwB0EEaiKyBygCACGzByCyB0EEaiK0BygCACG1ByC0B0EEaiK2BygCACG3ByC2B0EEaigCACG4ByCoB0HgEGxBFGooAgAhuQcgqAdB4BBsKQMAIboHIKgHQeAQbEEQaigCACG7ByCqBygCACG8ByCqB0EEaiK9BygCACG+ByC9B0EEaiK/BygCACHAByC/B0EEaiLBBygCACHCByDBB0EEaiLDBygCACHEByDDB0EEaiLFBygCACHGByDFB0EEaiLHBygCACHIByDHB0EEaigCACHJB0EAQQAgvAcgvgcgwAcgwgcgxAcgxgcgyAcgyQcguQcCDCHUByHTByHSByHRByHQByHPByHOByHNByHMByHLByHKByDKByDLByDMByDNByDOByDPByDQByDRByDSByDTByDUByDKByACSUUNABoaGhoaGhoaGhoaIMoHIMsHIMwHIM0HIM4HIM8HINAHINEHINIHINMHINQHAgwh3wch3gch3Qch3Ach2wch2gch2Qch2Ach1wch1gch1Qcg1Qcg1gcg1wcg2Acg2Qcg2gcg2wcg3Acg3Qcg3gcg3wcDDCHqByHpByHoByHnByHmByHlByHkByHjByHiByHhByHgByDgByDhByDiByDjByDkByDlByDmByDnByDoByDpByDqBwIMIfUHIfQ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KczYCACDECkEEaiLFCiCUCiCbCiCeCnNBB3ginwog2QZqaiKvCiCfCiCmCiCNCiCvCnNBEHgisApqIrEKc0EMeCKyCiDsBmpqIrMKIJYKIJ0KIKQKIIsKII4Kc0EHeCKPCiDiBmpqIr0Kc0EQeCK+CmoivwogvgogvQogjwogvwpzQQx4IsAKIO4GamoiwQpzQQh4IsIKaiLDCnM2AgAgxQpBBGoixgogugogqgogqQogrApzQQh4Iq0KaiKuCnM2AgAgxgpBBGoixwogwQogsQogsAogswpzQQh4IrQKaiK1CnM2AgAgxwpBBGoiyAogwAogwwpzQQd4ILQKczYCACDICkEEaiLJCiCrCiCuCnNBB3gguwpzNgIAIMkKQQRqIsoKILIKILUKc0EHeCDCCnM2AgAgygpBBGoiywoguQogvApzQQd4IK0KczYCACDLCkEEaiLMCiD4BiC8CnM2AgAgzApBBGoizQog+gYgwwpzNgIAIM0KQQRqIs4KIPwGIK4KczYCACDOCkEEaiLPCiD+BiC1CnM2AgAgzwpBBGoi0AoggAcgtApzNgIAINAKQQRqItEKIIIHILsKczYCACDRCkEEaiLSCiCEByDCCnM2AgAg0gpBBGoghQcgrQpzNgIAIPYGQgF8IdMKIPcGINMKIPcGIAJJDQAaGiD3BiDTCgsh9gYh9QYg9QYg9gYLIfQGIfMGIM4GQeAQbEEIaiD0BjcDACDOBgshzgYgzgZBAWoh1Aog1Aog1AogBkkNABog1AoLIc0GIM0GCyHMBiDMBgshywYLdAEFfyAAQeAQbEEAQeAQIAFs/AsAQQACCCEFIAUgBSABSUUNABogBQIIIQYgBgMIIQcgBwIIIQggACAIaiAEbEEGdEGAwwBqQQAgAvwLACAICyEIIAhBAWohCSAJIAkgAUkNABogCQshByAHCyEGIAYLIQUL'), char => char.charCodeAt(0));\n const module = new WebAssembly.Module(code);\n const instance = new WebAssembly.Instance(module, _imports);\n ;\n const _exports = instance.exports;\n const buffer = _exports.memory ? _exports.memory.buffer : new ArrayBuffer(0);\n const memoryExport = new Uint8Array(buffer, 0, 15737216);\n const segments = Object.freeze({ state: new Uint8Array(memoryExport.buffer, 0, 8576),\n state_chunks: Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 2144, 2144))),\n \"state.chunksDone_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 2144, 8))),\n \"state.chunkOut_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 8 + i * 2144, 8))),\n \"state.flags_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 16 + i * 2144, 4))),\n \"state.chunkPos_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 20 + i * 2144, 4))),\n \"state.stackPos_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 24 + i * 2144, 4))),\n \"state.lastBlockRem_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 28 + i * 2144, 4))),\n \"state.iv_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 32 + i * 2144, 32))),\n \"state.state_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 64 + i * 2144, 32))),\n \"state.stack_chunks\": Object.freeze(Array.from({ length: 4 }, (_, i) => new Uint8Array(memoryExport.buffer, 96 + i * 2144, 2048))),\n buffer: new Uint8Array(memoryExport.buffer, 8576, 10485760),\n buffer_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 8576 + i * 10485760, 10485760))),\n stackBuffer: new Uint8Array(memoryExport.buffer, 10494336, 5242880),\n stackBuffer_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 10494336 + i * 5242880, 5242880)))\n });\n return Object.freeze({ ..._exports, memory: memoryExport, segments });\n}\nlet _cache;\nexport default function blake3(_imports = {}, pool) {\n if (_cache)\n return _cache;\n return (_cache = init_module(_imports, pool));\n}\n", "/**\n * Abstract logic for ciphers.\n * @module\n */\nimport { abool, abytes, clean, cleanFast, copyBytes, copyFast, isBytes, mkAsync, } from \"./utils.js\";\nconst brandSet = new WeakSet();\nconst isBranded = (x) => typeof x === 'function' || (typeof x === 'object' && x !== null)\n ? brandSet.has(x)\n : false;\nconst getOutput = (len, out, exact = false) => {\n if (!out)\n return new Uint8Array(len);\n if (exact && out.length !== len)\n throw new Error('\"output\" expected Uint8Array of length ' + len + ', got: ' + out.length);\n if (out.length < len)\n throw new Error('output is too small');\n return out;\n};\nconst equalBytes = (a, b) => {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n};\nexport const mkCipher = (modFn, def_, platform) => {\n const def = def_;\n let mod;\n let BUFFER;\n let STATE;\n let maxBlocks = 0;\n const { blockLen, tagLength, tagLeft, padding, noStream, twoPass } = def;\n const multiPass = def.multiPass || 0;\n const multiPassResult = def.multiPassResult;\n const multiPassOut = def.multiPassOut;\n const hasTag = !!tagLength;\n const paddingLeft = def.paddingLeft || 0;\n const padFull = def.padFull !== undefined ? def.padFull : true;\n const padZeroOk = !!paddingLeft || !padFull;\n const lengthError = (dir) => def.lengthError || (dir === 'encrypt' ? def.lengthErrorEnc : def.lengthErrorDec);\n const padError = () => def.padError || def.lengthError || 'invalid padding';\n const emptyError = () => def.emptyError || def.padError || def.lengthError || 'invalid padding';\n const passResult = (dir) => {\n if (multiPassResult && typeof multiPassResult === 'object')\n return !!multiPassResult[dir];\n return !!multiPassResult;\n };\n const lazyInit = () => {\n if (mod)\n return;\n mod = modFn();\n const bufAny = mod.segments.buffer;\n BUFFER =\n bufAny instanceof Uint8Array\n ? bufAny\n : new Uint8Array(bufAny.buffer, bufAny.byteOffset, bufAny.byteLength);\n STATE = mod.segments.state;\n maxBlocks = Math.floor(BUFFER.length / blockLen);\n if (maxBlocks < 1)\n throw new Error('blockLen is too large for buffer');\n };\n const reset = (maxWritten) => {\n if (!mod)\n throw new Error('missing module');\n if (platform === 'js') {\n // JS `.fill(0)` is slow on large buffers. Clear the written prefix via `cleanFast`,\n // and ask the module to reset only its state/small scratch.\n if (maxWritten)\n cleanFast(BUFFER, maxWritten);\n cleanFast(STATE);\n mod.reset(0);\n return;\n }\n mod.reset(maxWritten);\n };\n const runBlocks = (dir, blocks, isLast, left, round) => {\n if (!mod)\n throw new Error('missing module');\n if (dir === 'encrypt')\n mod.encryptBlocks(blocks, isLast, left, round);\n else\n mod.decryptBlocks(blocks, isLast, left, round);\n };\n const getTag = () => {\n if (!def.getTag)\n throw new Error('missing getTag');\n return def.getTag(mod);\n };\n const initCipher = (dir, key, args) => {\n if (!mod)\n throw new Error('missing module');\n const res = def.init(mod, dir, key, ...args);\n if (!padding || !res || typeof res !== 'object')\n return false;\n return !!res.disablePadding;\n };\n const process = (dir, data, output, key, args) => {\n if (dir === 'encrypt' && def.lengthLimitEnc)\n def.lengthLimitEnc(data.length, args);\n if (dir === 'decrypt' && def.lengthLimitDec)\n def.lengthLimitDec(data.length, args);\n let overlapCopy;\n const cleanInput = () => {\n if (!overlapCopy)\n return;\n cleanFast(overlapCopy);\n overlapCopy = undefined;\n };\n // Avoid overlapping input/output corrupting tags or ciphertext in-place.\n if (output && output.buffer === data.buffer) {\n const aStart = data.byteOffset;\n const aEnd = aStart + data.byteLength;\n const bStart = output.byteOffset;\n const bEnd = bStart + output.byteLength;\n if (aStart < bEnd && bStart < aEnd) {\n if (def.noOverlap)\n throw new Error('input and output cannot overlap');\n overlapCopy = copyBytes(data);\n data = overlapCopy;\n }\n }\n // initCipher writes key material into module memory; any validation error after this point\n // must still trigger a reset, otherwise zero-check will catch the leaked state.\n const disablePadding = initCipher(dir, key, args);\n try {\n if (padding && hasTag)\n throw new Error('padding with tag is not supported');\n const tagLen = tagLength || 0;\n let msg = data;\n let passedTag;\n if (hasTag && dir === 'decrypt') {\n if (data.length < tagLen)\n throw new Error(lengthError('decrypt') || 'invalid data length');\n if (tagLeft) {\n passedTag = data.subarray(0, tagLen);\n msg = data.subarray(tagLen);\n }\n else {\n passedTag = data.subarray(data.length - tagLen);\n msg = data.subarray(0, data.length - tagLen);\n }\n }\n if (!mod)\n throw new Error('missing module');\n const m = mod;\n if (multiPass && def.dataOffset)\n throw new Error('multiPass with dataOffset is not supported');\n if (multiPass && paddingLeft) {\n if (!m.addPadding || !m.verifyPadding)\n throw new Error('missing padding');\n const rem = msg.length % blockLen;\n const pad = padding && dir === 'encrypt' && !disablePadding\n ? rem === 0\n ? padFull\n ? blockLen\n : 0\n : blockLen - rem\n : 0;\n const totalLen = dir === 'encrypt' ? paddingLeft + msg.length + pad : msg.length;\n if (totalLen > BUFFER.length) {\n // Use a work buffer to support KWP large inputs with padding.\n const work = new Uint8Array(totalLen);\n if (dir === 'encrypt') {\n if (msg.length)\n copyFast(work, paddingLeft, msg, 0, msg.length);\n if (pad)\n work.fill(0, paddingLeft + msg.length, paddingLeft + msg.length + pad);\n m.addPadding(msg.length, pad, blockLen);\n copyFast(work, 0, BUFFER, 0, paddingLeft);\n }\n else {\n copyFast(work, 0, msg, 0, msg.length);\n }\n const totalBlocks = totalLen / blockLen;\n const rBlocks = totalBlocks - 1;\n const maxR = maxBlocks - 1;\n if (maxR < 1)\n throw new Error('blockLen is too large for buffer');\n const a = new Uint8Array(paddingLeft);\n copyFast(a, 0, work, 0, paddingLeft);\n let maxWritten = 0;\n try {\n for (let round = 0; round < multiPass; round++) {\n if (dir === 'encrypt') {\n let pos = 0;\n while (pos < rBlocks) {\n const chunkR = Math.min(maxR, rBlocks - pos);\n const start = paddingLeft + pos * blockLen;\n const bytes = chunkR * blockLen;\n copyFast(BUFFER, 0, a, 0, paddingLeft);\n copyFast(BUFFER, paddingLeft, work, start, bytes);\n const roundBase = round * rBlocks + pos + 1;\n // `runBlocks` may throw on decrypt integrity/padding checks.\n // Mark the touched prefix first so reset still scrubs on exceptional exits.\n maxWritten = Math.max(maxWritten, paddingLeft + bytes);\n runBlocks(dir, chunkR + 1, 1, 0, roundBase);\n copyFast(a, 0, BUFFER, 0, paddingLeft);\n copyFast(work, start, BUFFER, paddingLeft, bytes);\n pos += chunkR;\n }\n }\n else {\n let pos = rBlocks;\n while (pos > 0) {\n const chunkR = Math.min(maxR, pos);\n const start = paddingLeft + (pos - chunkR) * blockLen;\n const bytes = chunkR * blockLen;\n copyFast(BUFFER, 0, a, 0, paddingLeft);\n copyFast(BUFFER, paddingLeft, work, start, bytes);\n const roundBase = (multiPass - 1 - round) * rBlocks + pos;\n // `runBlocks` may throw on decrypt integrity/padding checks.\n // Mark the touched prefix first so reset still scrubs on exceptional exits.\n maxWritten = Math.max(maxWritten, paddingLeft + bytes);\n runBlocks(dir, chunkR + 1, 1, 0, roundBase);\n copyFast(a, 0, BUFFER, 0, paddingLeft);\n copyFast(work, start, BUFFER, paddingLeft, bytes);\n pos -= chunkR;\n }\n }\n copyFast(work, 0, a, 0, paddingLeft);\n }\n if (dir === 'decrypt') {\n copyFast(BUFFER, 0, a, 0, paddingLeft);\n const gotPad = m.verifyPadding(totalLen, blockLen);\n if (gotPad > blockLen || (!padZeroOk && gotPad === 0))\n throw new Error(padError());\n const outLen = totalLen - paddingLeft - gotPad;\n const out = getOutput(totalLen - paddingLeft, output, !!def.exactOutput);\n copyFast(out, 0, work, paddingLeft, outLen);\n cleanInput();\n return out.subarray(0, outLen);\n }\n const out = getOutput(totalLen, output, !!def.exactOutput);\n copyFast(out, 0, work, 0, totalLen);\n cleanInput();\n return out;\n }\n finally {\n cleanFast(work);\n cleanFast(a);\n reset(maxWritten);\n }\n }\n const blocks = Math.ceil(totalLen / blockLen);\n if (blocks * blockLen !== totalLen)\n throw new Error(lengthError(dir) || 'invalid data length');\n let maxWritten = 0;\n try {\n // This branch writes/reads [0..totalLen) in the module buffer.\n // If decrypt integrity checks throw, scrub the full touched prefix instead of\n // leaving ciphertext/plaintext in buffer.\n maxWritten = totalLen;\n if (dir === 'encrypt') {\n if (msg.length)\n copyFast(BUFFER, paddingLeft, msg, 0, msg.length);\n if (pad)\n BUFFER.fill(0, paddingLeft + msg.length, paddingLeft + msg.length + pad);\n m.addPadding(msg.length, pad, blockLen);\n // Run all rounds inside the module when paddingLeft is used.\n runBlocks(dir, blocks, 1, 0, 0xffffffff);\n const out = getOutput(totalLen, output, !!def.exactOutput);\n copyFast(out, 0, BUFFER, 0, totalLen);\n cleanInput();\n return out;\n }\n if (msg.length)\n copyFast(BUFFER, 0, msg, 0, msg.length);\n // Run all rounds inside the module when paddingLeft is used.\n runBlocks(dir, blocks, 1, 0, 0xffffffff);\n const gotPad = m.verifyPadding(totalLen, blockLen);\n if (gotPad > blockLen || (!padZeroOk && gotPad === 0))\n throw new Error(padError());\n const outLen = totalLen - paddingLeft - gotPad;\n const out = getOutput(outLen, output, !!def.exactOutput);\n copyFast(out, 0, BUFFER, paddingLeft, outLen);\n cleanInput();\n return out;\n }\n finally {\n reset(maxWritten);\n }\n }\n if (multiPass) {\n if (padding && dir === 'decrypt' && !disablePadding && msg.length % blockLen !== 0)\n throw new Error(lengthError('decrypt') || 'invalid data length');\n if (padding && dir === 'decrypt' && !disablePadding && msg.length === 0)\n throw new Error(emptyError());\n if (padding && disablePadding && msg.length % blockLen !== 0)\n throw new Error(lengthError(dir) || 'invalid data length');\n const rem = msg.length % blockLen;\n const pad = padding && dir === 'encrypt' && !disablePadding\n ? rem === 0\n ? padFull\n ? blockLen\n : 0\n : blockLen - rem\n : 0;\n const cipherOutLen = msg.length + pad;\n const tagPrefix = dir === 'encrypt' && tagLeft ? tagLen : 0;\n const tagSuffix = dir === 'encrypt' && hasTag && !tagLeft ? tagLen : 0;\n const outLen = tagPrefix + cipherOutLen + tagSuffix;\n const out = getOutput(outLen || 0, output, !!def.exactOutput);\n if (hasTag && dir === 'decrypt') {\n if (!passedTag)\n throw new Error(def.tagError || 'invalid tag');\n const tagSeg = m.segments?.['state.tag'];\n if (tagSeg)\n tagSeg.set(passedTag);\n }\n const useResult = passResult(dir);\n const outRound = multiPassOut && typeof multiPassOut === 'object' && multiPassOut[dir] !== undefined\n ? multiPassOut[dir]\n : multiPass - 1;\n const workOwned = useResult && multiPass > 1;\n const work = workOwned\n ? new Uint8Array(cipherOutLen)\n : out.subarray(tagPrefix, tagPrefix + cipherOutLen);\n const work2Owned = useResult ? multiPass > 2 : true;\n const work2 = work2Owned\n ? new Uint8Array(cipherOutLen)\n : useResult && multiPass > 1\n ? work\n : new Uint8Array(cipherOutLen);\n const runPass = (input, output, round, applyPadding, applyVerify) => {\n let pos = 0;\n let outPos = 0;\n let maxWritten = 0;\n let lastBytes = 0;\n let processed = false;\n while (pos < input.length) {\n const remaining = input.length - pos;\n const isLast = remaining <= maxBlocks * blockLen ? 1 : 0;\n const blocks = isLast ? Math.ceil(remaining / blockLen) : maxBlocks;\n const take = remaining < blocks * blockLen ? remaining : blocks * blockLen;\n const left = blocks * blockLen - take;\n if (take)\n copyFast(BUFFER, 0, input, pos, take);\n if (left)\n BUFFER.fill(0, take, take + left);\n let padBlocks = 0;\n if (isLast && applyPadding) {\n if (!m.addPadding)\n throw new Error('missing padding');\n padBlocks = m.addPadding(take, left, blockLen);\n }\n const padApplied = applyPadding;\n const totalBlocks = blocks + padBlocks;\n runBlocks(dir, totalBlocks, isLast, padApplied ? 0 : left, round);\n const bytes = padApplied\n ? totalBlocks * blockLen\n : padBlocks\n ? totalBlocks * blockLen\n : take;\n if (bytes) {\n copyFast(output, outPos, BUFFER, 0, bytes);\n maxWritten = Math.max(maxWritten, totalBlocks * blockLen);\n outPos += bytes;\n }\n if (isLast)\n lastBytes = bytes;\n pos += take;\n processed = processed || totalBlocks > 0 || isLast === 1;\n if (isLast)\n break;\n }\n if (!processed)\n runBlocks(dir, 0, 1, 0, round);\n if (applyVerify) {\n if (!m.verifyPadding)\n throw new Error('missing padding');\n const pad = m.verifyPadding(lastBytes, blockLen);\n if (pad > blockLen || (!padZeroOk && pad === 0))\n throw new Error(padError());\n return [outPos - pad, maxWritten];\n }\n return [outPos, maxWritten];\n };\n let cur = msg;\n let outPos = 0;\n let outTouched = 0;\n let maxWritten = 0;\n try {\n for (let round = 0; round < multiPass; round++) {\n const hasPadding = !!padding;\n const applyPadding = hasPadding && dir === 'encrypt' && !disablePadding && round === 0;\n const applyVerify = hasPadding && dir === 'decrypt' && !disablePadding && round === multiPass - 1;\n const writeOut = round === outRound;\n const target = writeOut\n ? out.subarray(tagPrefix)\n : useResult\n ? round % 2 === 0\n ? work\n : work2\n : work2;\n const res = runPass(cur, target, round, applyPadding, applyVerify);\n outPos = res[0];\n maxWritten = Math.max(maxWritten, res[1]);\n if (writeOut)\n outTouched = Math.max(outTouched, tagPrefix + res[0]);\n if (round !== multiPass - 1 && useResult)\n cur = target;\n }\n if (hasTag) {\n const tag = getTag();\n if (dir === 'encrypt') {\n if (tagLeft)\n copyFast(out, 0, tag, 0, tagLen);\n else\n copyFast(out, tagPrefix + cipherOutLen, tag, 0, tagLen);\n }\n else if (!equalBytes(tag, passedTag)) {\n // Optional output buffers are scratch space.\n // Earlier decrypt passes may have written candidate plaintext, so clear the\n // touched prefix before surfacing invalid-tag failure.\n if (outTouched)\n cleanFast(out, outTouched);\n throw new Error(def.tagError || 'invalid tag');\n }\n }\n cleanInput();\n return out.subarray(0, tagPrefix + outPos + tagSuffix);\n }\n finally {\n if (work2Owned && work2 !== work)\n cleanFast(work2);\n if (workOwned)\n cleanFast(work);\n reset(maxWritten);\n }\n }\n if (twoPass) {\n if (!hasTag)\n throw new Error('missing tag length');\n if (padding)\n throw new Error('padding with tag is not supported');\n const macBlocks = m.macBlocks;\n const tagInit = m.tagInit;\n if (!macBlocks)\n throw new Error('missing macBlocks');\n if (!tagInit)\n throw new Error('missing tagInit');\n if (dir === 'decrypt' && !passedTag)\n throw new Error(def.tagError || 'invalid tag');\n const tagPrefix = dir === 'encrypt' && tagLeft ? tagLen : 0;\n const tagSuffix = dir === 'encrypt' && hasTag && !tagLeft ? tagLen : 0;\n const outLen = tagPrefix + msg.length + tagSuffix;\n const out = getOutput(outLen || 0, output, !!def.exactOutput);\n let pos = 0;\n let outPos = 0;\n let maxWritten = 0;\n let processed = false;\n const runMac = (input) => {\n pos = 0;\n processed = false;\n while (pos < input.length) {\n const remaining = input.length - pos;\n const isLast = remaining <= maxBlocks * blockLen ? 1 : 0;\n const blocks = isLast ? Math.ceil(remaining / blockLen) : maxBlocks;\n const take = remaining < blocks * blockLen ? remaining : blocks * blockLen;\n const left = blocks * blockLen - take;\n if (take)\n copyFast(BUFFER, 0, input, pos, take);\n if (left)\n BUFFER.fill(0, take, take + left);\n macBlocks(blocks, isLast, left);\n maxWritten = Math.max(maxWritten, blocks * blockLen);\n pos += take;\n processed = processed || blocks > 0 || isLast === 1;\n if (isLast)\n break;\n }\n if (!processed)\n macBlocks(0, 1, 0);\n };\n const runCipher = (dir, input, outBase) => {\n pos = 0;\n processed = false;\n while (pos < input.length) {\n const remaining = input.length - pos;\n const isLast = remaining <= maxBlocks * blockLen ? 1 : 0;\n const blocks = isLast ? Math.ceil(remaining / blockLen) : maxBlocks;\n const take = remaining < blocks * blockLen ? remaining : blocks * blockLen;\n const left = blocks * blockLen - take;\n if (take)\n copyFast(BUFFER, 0, input, pos, take);\n if (left)\n BUFFER.fill(0, take, take + left);\n runBlocks(dir, blocks, isLast, left, -1);\n if (take) {\n copyFast(out, outBase + outPos, BUFFER, 0, take);\n maxWritten = Math.max(maxWritten, blocks * blockLen);\n outPos += take;\n }\n pos += take;\n processed = processed || blocks > 0 || isLast === 1;\n if (isLast)\n break;\n }\n if (!processed)\n runBlocks(dir, 0, 1, 0, -1);\n };\n try {\n if (dir === 'encrypt') {\n runMac(msg);\n const tag = getTag();\n tagInit();\n outPos = 0;\n runCipher('encrypt', msg, tagPrefix);\n if (tagLeft)\n copyFast(out, 0, tag, 0, tagLen);\n else\n copyFast(out, tagPrefix + msg.length, tag, 0, tagLen);\n cleanInput();\n return out;\n }\n const tagSeg = m.segments['state.tag'];\n tagSeg.set(passedTag);\n tagInit();\n outPos = 0;\n runCipher('decrypt', msg, 0);\n runMac(out.subarray(0, msg.length));\n const computed = getTag();\n if (!equalBytes(computed, passedTag))\n throw new Error(def.tagError || 'invalid tag');\n cleanInput();\n return out.subarray(0, msg.length);\n }\n finally {\n reset(maxWritten);\n }\n }\n if (paddingLeft) {\n if (!m.addPadding || !m.verifyPadding)\n throw new Error('missing padding');\n const rem = msg.length % blockLen;\n const pad = padding && dir === 'encrypt' && !disablePadding\n ? rem === 0\n ? padFull\n ? blockLen\n : 0\n : blockLen - rem\n : 0;\n const totalLen = dir === 'encrypt' ? paddingLeft + msg.length + pad : msg.length;\n if (totalLen > BUFFER.length)\n throw new Error('input is too large');\n const blocks = Math.ceil(totalLen / blockLen);\n if (blocks * blockLen !== totalLen)\n throw new Error(lengthError(dir) || 'invalid data length');\n let maxWritten = 0;\n try {\n if (dir === 'encrypt') {\n if (msg.length)\n copyFast(BUFFER, paddingLeft, msg, 0, msg.length);\n if (pad)\n BUFFER.fill(0, paddingLeft + msg.length, paddingLeft + msg.length + pad);\n m.addPadding(msg.length, pad, blockLen);\n runBlocks(dir, blocks, 1, 0, -1);\n const out = getOutput(totalLen, output, !!def.exactOutput);\n copyFast(out, 0, BUFFER, 0, totalLen);\n maxWritten = Math.max(maxWritten, totalLen);\n cleanInput();\n return out;\n }\n if (msg.length)\n copyFast(BUFFER, 0, msg, 0, msg.length);\n runBlocks(dir, blocks, 1, 0, -1);\n const gotPad = m.verifyPadding(totalLen, blockLen);\n if (gotPad > blockLen || (!padZeroOk && gotPad === 0))\n throw new Error(padError());\n const outLen = totalLen - paddingLeft - gotPad;\n const out = getOutput(outLen, output, !!def.exactOutput);\n copyFast(out, 0, BUFFER, paddingLeft, outLen);\n maxWritten = Math.max(maxWritten, totalLen);\n cleanInput();\n return out;\n }\n finally {\n reset(maxWritten);\n }\n }\n if (padding && dir === 'decrypt' && !disablePadding && msg.length % blockLen !== 0)\n throw new Error(lengthError('decrypt') || 'invalid data length');\n if (padding && dir === 'decrypt' && !disablePadding && msg.length === 0)\n throw new Error(emptyError());\n if (padding && disablePadding && msg.length % blockLen !== 0)\n throw new Error(lengthError(dir) || 'invalid data length');\n const rem = msg.length % blockLen;\n const pad = padding && dir === 'encrypt' && !disablePadding\n ? rem === 0\n ? padFull\n ? blockLen\n : 0\n : blockLen - rem\n : 0;\n const cipherOutLen = msg.length + pad;\n const tagPrefix = dir === 'encrypt' && tagLeft ? tagLen : 0;\n const tagSuffix = dir === 'encrypt' && hasTag && !tagLeft ? tagLen : 0;\n const outLen = tagPrefix + cipherOutLen + tagSuffix;\n const out = getOutput(outLen || 0, output, !!def.exactOutput);\n let pos = 0;\n let outPos = 0;\n let outTouched = 0;\n let maxWritten = 0;\n let lastBytes = 0;\n let processed = false;\n const dataOffset = def.dataOffset || 0;\n let offsetUsed = false;\n const nextOffset = () => {\n if (!offsetUsed && dataOffset) {\n offsetUsed = true;\n return dataOffset;\n }\n return 0;\n };\n try {\n while (pos < msg.length) {\n const remaining = msg.length - pos;\n const off = nextOffset();\n let maxHere = off ? 1 : maxBlocks;\n let capacity = off ? blockLen - off : maxHere * blockLen;\n if (!off &&\n padding &&\n dir === 'encrypt' &&\n !disablePadding &&\n maxHere === maxBlocks &&\n maxBlocks > 1 &&\n remaining === capacity) {\n // Leave room for a full padding block when the input fills the buffer exactly.\n maxHere -= 1;\n capacity = maxHere * blockLen;\n }\n const isLast = remaining <= capacity ? 1 : 0;\n const blocks = isLast ? Math.ceil(remaining / blockLen) : maxHere;\n const blockBytes = off ? blockLen - off : blocks * blockLen;\n const take = remaining < blockBytes ? remaining : blockBytes;\n const leftPad = off ? blockLen - off - take : 0;\n const left = off ? blockLen - take : blocks * blockLen - take;\n if (off)\n BUFFER.fill(0, 0, off);\n if (take)\n copyFast(BUFFER, off, msg, pos, take);\n if (leftPad)\n BUFFER.fill(0, off + take, off + take + leftPad);\n let padBlocks = 0;\n if (isLast && padding && dir === 'encrypt' && !disablePadding) {\n if (!m.addPadding)\n throw new Error('missing padding');\n padBlocks = m.addPadding(take, left, blockLen);\n }\n // Ensure PKCS#7 bytes are encrypted/emitted as full blocks.\n const padApplied = padding && dir === 'encrypt' && !disablePadding;\n const totalBlocks = blocks + padBlocks;\n runBlocks(dir, totalBlocks, isLast, padApplied ? 0 : left, -1);\n const bytes = padApplied\n ? totalBlocks * blockLen\n : padBlocks\n ? totalBlocks * blockLen\n : take;\n if (bytes) {\n copyFast(out, tagPrefix + outPos, BUFFER, off, bytes);\n maxWritten = Math.max(maxWritten, off + totalBlocks * blockLen);\n outTouched = Math.max(outTouched, tagPrefix + outPos + bytes);\n outPos += bytes;\n }\n if (isLast)\n lastBytes = bytes;\n pos += take;\n processed = processed || totalBlocks > 0 || isLast === 1;\n if (isLast)\n break;\n }\n if (!processed) {\n if (padding && dir === 'encrypt' && !disablePadding) {\n // Empty plaintext still emits a full padding block.\n if (!m.addPadding)\n throw new Error('missing padding');\n const padBlocks = m.addPadding(0, 0, blockLen);\n runBlocks(dir, padBlocks, 1, 0, -1);\n const bytes = padBlocks * blockLen;\n if (bytes) {\n copyFast(out, tagPrefix + outPos, BUFFER, 0, bytes);\n maxWritten = Math.max(maxWritten, bytes);\n outTouched = Math.max(outTouched, tagPrefix + outPos + bytes);\n outPos += bytes;\n }\n }\n else {\n runBlocks(dir, 0, 1, 0, -1);\n }\n }\n if (padding && dir === 'decrypt' && !disablePadding) {\n if (!m.verifyPadding)\n throw new Error('missing padding');\n const pad = m.verifyPadding(lastBytes, blockLen);\n if (pad > blockLen || (!padZeroOk && pad === 0))\n throw new Error(padError());\n outPos -= pad;\n }\n if (hasTag) {\n const tag = getTag();\n if (dir === 'encrypt') {\n if (tagLeft)\n copyFast(out, 0, tag, 0, tagLen);\n else\n copyFast(out, tagPrefix + cipherOutLen, tag, 0, tagLen);\n }\n else if (!equalBytes(tag, passedTag)) {\n // Optional output buffers are scratch space.\n // Earlier decrypt passes may have written candidate plaintext, so clear the\n // touched prefix before surfacing invalid-tag failure.\n if (outTouched)\n cleanFast(out, outTouched);\n throw new Error(def.tagError || 'invalid tag');\n }\n }\n cleanInput();\n return out.subarray(0, tagPrefix + outPos + tagSuffix);\n }\n finally {\n reset(maxWritten);\n }\n }\n catch (e) {\n cleanInput();\n reset(0);\n throw e;\n }\n };\n class StreamCipher {\n buf;\n pos;\n state;\n finished;\n destroyed;\n dir;\n key;\n args;\n disablePadding;\n offsetUsed;\n constructor(dir, key, args, from) {\n this.dir = dir;\n this.key = key;\n this.args = args;\n this.finished = false;\n this.destroyed = false;\n this.offsetUsed = false;\n this.buf = new Uint8Array(blockLen * maxBlocks);\n this.pos = 0;\n if (!mod)\n throw new Error('missing module');\n if (from) {\n // clone() can reuse the captured stream state directly.\n // Re-running initCipher here only does setup work that clone immediately overwrites.\n this.disablePadding = from.disablePadding;\n this.state = copyBytes(from.state);\n return;\n }\n this.disablePadding = initCipher(dir, key, args);\n this.state = copyBytes(STATE);\n mod.reset(0);\n }\n _restoreState() {\n copyFast(STATE, 0, this.state, 0, STATE.length);\n }\n _saveState() {\n copyFast(this.state, 0, STATE, 0, STATE.length);\n }\n saveState() {\n return copyBytes(this.state);\n }\n restoreState(state) {\n if (state.length !== this.state.length)\n throw new Error('invalid state');\n copyFast(this.state, 0, state, 0, state.length);\n }\n update(data, output) {\n abytes(data);\n if (this.destroyed)\n throw new Error('Cipher instance has been destroyed');\n if (this.finished)\n throw new Error('Cipher#finish() has already been called');\n if (this.dir === 'encrypt' && def.lengthLimitEnc)\n def.lengthLimitEnc(data.length, this.args, this.pos);\n if (this.dir === 'decrypt' && def.lengthLimitDec)\n def.lengthLimitDec(data.length, this.args, this.pos);\n if (padding && this.disablePadding && data.length % blockLen !== 0)\n throw new Error(lengthError(this.dir) || 'invalid data length');\n const holdLast = padding && !this.disablePadding && this.dir === 'decrypt' ? blockLen : 0;\n const bufferPartial = hasTag;\n const prevPos = this.pos;\n const total = data.length + prevPos;\n const dataOffset = def.dataOffset || 0;\n const offPending = bufferPartial && dataOffset && !this.offsetUsed;\n // dataOffset makes the first block shorter; compute output length accordingly.\n const outLen = (() => {\n if (offPending) {\n const cap = blockLen - dataOffset;\n if (total < cap)\n return 0;\n const rest = total - cap;\n return cap + Math.floor(rest / blockLen) * blockLen;\n }\n const totalRem = total % blockLen;\n return bufferPartial && totalRem ? total - totalRem : total;\n })();\n const out = getOutput(outLen, output, !!def.exactOutput);\n let outPos = 0;\n let msgPos = 0;\n let maxWritten = 0;\n const nextOffset = () => {\n if (!this.offsetUsed && dataOffset) {\n this.offsetUsed = true;\n return dataOffset;\n }\n return 0;\n };\n this._restoreState();\n if (!mod)\n throw new Error('missing module');\n try {\n if (!this.offsetUsed && dataOffset && this.pos > blockLen - dataOffset) {\n // Drain the first dataOffset block from the buffer before appending new data.\n const off = dataOffset;\n const cap = blockLen - off;\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, this.buf, 0, cap);\n runBlocks(this.dir, 1, 0, off, -1);\n copyFast(out, outPos, BUFFER, off, cap);\n maxWritten = Math.max(maxWritten, off + blockLen);\n outPos += cap;\n this.buf.copyWithin(0, cap, this.pos);\n this.pos -= cap;\n this.offsetUsed = true;\n }\n if (holdLast) {\n copyFast(this.buf, this.pos, data, 0, data.length);\n this.pos += data.length;\n while (this.pos >= blockLen * 2) {\n const blocks = Math.min(maxBlocks, Math.floor((this.pos - blockLen) / blockLen));\n const bytes = blocks * blockLen;\n const off = nextOffset();\n if (off)\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, this.buf, 0, bytes);\n runBlocks(this.dir, blocks, 0, 0, -1);\n copyFast(out, outPos, BUFFER, off, bytes);\n maxWritten = Math.max(maxWritten, off + bytes);\n outPos += bytes;\n this.buf.copyWithin(0, bytes, this.pos);\n this.pos -= bytes;\n }\n this._saveState();\n return out.subarray(0, outPos);\n }\n if (this.pos) {\n // dataOffset reduces first-block capacity; honor it for buffered updates.\n const off = !this.offsetUsed && dataOffset ? dataOffset : 0;\n const cap = off ? blockLen - off : blockLen;\n const need = cap - this.pos;\n const take = Math.min(need, data.length);\n copyFast(this.buf, this.pos, data, 0, take);\n this.pos += take;\n msgPos += take;\n if (this.pos === cap && (!holdLast || data.length - msgPos + cap > holdLast)) {\n if (off)\n this.offsetUsed = true;\n if (off)\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, this.buf, 0, cap);\n runBlocks(this.dir, 1, 0, off, -1);\n copyFast(out, outPos, BUFFER, off, cap);\n maxWritten = Math.max(maxWritten, off + blockLen);\n outPos += cap;\n this.pos = 0;\n }\n }\n for (; msgPos + blockLen <= data.length - holdLast;) {\n const remaining = data.length - msgPos - holdLast;\n const off = nextOffset();\n const maxHere = off ? 1 : maxBlocks;\n const blocks = Math.min(maxHere, Math.floor(remaining / blockLen));\n if (!blocks)\n break;\n const take = off ? Math.min(remaining, blockLen - off) : blocks * blockLen;\n const left = off ? blockLen - take : 0;\n if (off)\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, data, msgPos, take);\n runBlocks(this.dir, blocks, 0, left, -1);\n copyFast(out, outPos, BUFFER, off, take);\n maxWritten = Math.max(maxWritten, off + blocks * blockLen);\n outPos += take;\n msgPos += take;\n }\n const leftover = data.length - msgPos;\n if (leftover) {\n // Buffer tail so chunked updates do not advance the block counter early.\n // This keeps CTR/stream semantics correct.\n copyFast(this.buf, this.pos, data, msgPos, leftover);\n this.pos += leftover;\n }\n this._saveState();\n }\n finally {\n reset(maxWritten);\n }\n return out.subarray(0, outPos);\n }\n finish(tag) {\n if (this.destroyed)\n throw new Error('Cipher instance has been destroyed');\n if (this.finished)\n throw new Error('Cipher#finish() has already been called');\n this.finished = true;\n if (padding && this.disablePadding && this.pos !== 0)\n throw new Error(lengthError(this.dir) || 'invalid data length');\n this._restoreState();\n if (!mod)\n throw new Error('missing module');\n const m = mod;\n let maxWritten = 0;\n let data = new Uint8Array(0);\n let tagOut = undefined;\n const dataOffset = def.dataOffset || 0;\n let off = 0;\n try {\n if (this.pos && !this.offsetUsed && dataOffset && this.pos > blockLen - dataOffset) {\n // Split the buffered data to match dataOffset streaming semantics.\n this.offsetUsed = true;\n off = dataOffset;\n const firstTake = blockLen - off;\n const rest = this.pos - firstTake;\n const out = new Uint8Array(this.pos);\n if (off)\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, this.buf, 0, firstTake);\n runBlocks(this.dir, 1, 0, off, -1);\n copyFast(out, 0, BUFFER, off, firstTake);\n maxWritten = Math.max(maxWritten, off + blockLen);\n if (rest) {\n copyFast(BUFFER, 0, this.buf, firstTake, rest);\n if (rest < blockLen)\n BUFFER.fill(0, rest, rest + (blockLen - rest));\n runBlocks(this.dir, 1, 1, blockLen - rest, -1);\n copyFast(out, firstTake, BUFFER, 0, rest);\n maxWritten = Math.max(maxWritten, blockLen);\n }\n data = out;\n }\n else {\n let padBlocks = 0;\n let left = 0;\n let blocks = 0;\n if (this.pos) {\n if (!this.offsetUsed && dataOffset) {\n this.offsetUsed = true;\n off = dataOffset;\n }\n if (off) {\n // dataOffset shifts data into block; match single-shot left/zeroing semantics.\n blocks = 1;\n left = blockLen - this.pos;\n BUFFER.fill(0, 0, off);\n copyFast(BUFFER, off, this.buf, 0, this.pos);\n const leftPad = blockLen - off - this.pos;\n if (leftPad)\n BUFFER.fill(0, off + this.pos, off + this.pos + leftPad);\n }\n else {\n const used = this.pos;\n blocks = Math.ceil(used / blockLen);\n left = blocks * blockLen - used;\n copyFast(BUFFER, 0, this.buf, 0, this.pos);\n if (left)\n BUFFER.fill(0, this.pos, this.pos + left);\n }\n }\n if (padding && this.dir === 'encrypt' && !this.disablePadding) {\n if (!m.addPadding)\n throw new Error('missing padding');\n padBlocks = m.addPadding(this.pos, left, blockLen);\n }\n const padApplied = padding && this.dir === 'encrypt' && !this.disablePadding;\n const totalBlocks = blocks + padBlocks;\n const outLeft = padApplied ? 0 : left;\n runBlocks(this.dir, totalBlocks, 1, outLeft, -1);\n maxWritten = Math.max(maxWritten, off + totalBlocks * blockLen);\n if (padding && this.dir === 'decrypt' && !this.disablePadding) {\n if (!m.verifyPadding)\n throw new Error('missing padding');\n if (blocks * blockLen === 0)\n throw new Error(emptyError());\n const pad = m.verifyPadding(blocks * blockLen, blockLen);\n if (pad < 1 || pad > blockLen)\n throw new Error(padError());\n const outLen = blocks * blockLen - pad;\n // m.reset() clears BUFFER/state; copy out before returning.\n data = copyBytes(BUFFER.subarray(off, off + outLen));\n if (hasTag && this.dir === 'decrypt') {\n const computed = getTag();\n if (!tag)\n throw new Error(def.tagError || 'invalid tag');\n if (!equalBytes(computed, tag))\n throw new Error(def.tagError || 'invalid tag');\n }\n return { data, tag: tagOut };\n }\n // Include padding block(s) in output length for encrypt+padding.\n const outBlocks = padApplied ? totalBlocks : blocks;\n const rawLen = outBlocks * blockLen - outLeft;\n const outLen = rawLen;\n if (!outLen)\n data = new Uint8Array(0);\n else\n data = copyBytes(BUFFER.subarray(off, off + outLen));\n }\n if (hasTag) {\n // tagFinish writes length block into BUFFER; copy data before computing tag.\n const computed = getTag();\n if (this.dir === 'encrypt')\n // m.reset() clears state; return a copy.\n tagOut = copyBytes(computed.slice(0, tagLength));\n else {\n if (!tag)\n throw new Error(def.tagError || 'invalid tag');\n if (!equalBytes(computed, tag))\n throw new Error(def.tagError || 'invalid tag');\n }\n }\n return { data, tag: tagOut };\n }\n finally {\n reset(maxWritten);\n }\n }\n destroy() {\n this.destroyed = true;\n cleanFast(this.state);\n cleanFast(this.buf);\n }\n _cloneInto(to) {\n if (this.destroyed)\n throw new Error('Cipher instance has been destroyed');\n const dst = to || new StreamCipher(this.dir, this.key, this.args, this);\n if (!(dst instanceof StreamCipher))\n throw new Error('wrong instance');\n if (dst.buf.length !== this.buf.length)\n throw new Error('wrong buffer length');\n if (this.pos)\n copyFast(dst.buf, 0, this.buf, 0, this.pos);\n dst.pos = this.pos;\n if (to) {\n if (dst.state.length !== this.state.length)\n throw new Error('wrong state length');\n copyFast(dst.state, 0, this.state, 0, this.state.length);\n dst.disablePadding = this.disablePadding;\n }\n dst.finished = !!this.finished;\n dst.destroyed = !!this.destroyed;\n return dst;\n }\n clone() {\n return this._cloneInto();\n }\n }\n const cipherFactory = ((key, ...args) => {\n lazyInit();\n abytes(key);\n if (def.nonceLength !== undefined) {\n const nonce = args[0];\n abytes(nonce, def.varSizeNonce ? undefined : def.nonceLength, 'nonce');\n }\n const aadStart = def.nonceLength !== undefined ? 1 : 0;\n // No-AAD constructors otherwise silently ignore byte args meant as AAD.\n if (!def.withAAD) {\n for (let i = aadStart; i < args.length; i++)\n if (isBytes(args[i]))\n throw new Error('AAD not supported');\n }\n if (def.withAAD && args[aadStart] !== undefined)\n abytes(args[aadStart], undefined, 'AAD');\n if (def.validate)\n def.validate(key, ...args);\n let used = false;\n const make = (dir) => {\n const fn = (data, output) => {\n abytes(data);\n if (output !== undefined && def.noOutput)\n throw new Error('cipher output not supported');\n if (dir === 'encrypt') {\n if (used)\n throw new Error('cannot encrypt() twice with same key + nonce');\n used = true;\n }\n return process(dir, data, output, key, args);\n };\n let run;\n Object.assign(fn, {\n async: (data, output, opts) => (run ||\n (run = mkAsync(function* (setup, data, output, opts) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return fn(data, output);\n const tick = !setupMode.isAsync\n ? !opts?.onProgress\n ? (setupMode({ total: 0 }), (_inc) => false)\n : setupMode({ total: data.length, onProgress: opts.onProgress })\n : setupMode({\n total: data.length,\n asyncTick: opts?.asyncTick,\n onProgress: opts?.onProgress,\n nextTick: opts?.nextTick,\n stateBytes: STATE.length,\n save: (state) => state.set(STATE),\n restore: (state) => STATE.set(state),\n });\n const out = fn(data, output);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(data.length))\n yield;\n return out;\n }))).async(data, output, opts),\n create: () => {\n if (noStream)\n throw new Error('streaming is not supported');\n return new StreamCipher(dir, key, args);\n },\n });\n return fn;\n };\n return { encrypt: make('encrypt'), decrypt: make('decrypt') };\n });\n Object.assign(cipherFactory, {\n blockSize: def.blockLen,\n blockLen: def.blockLen,\n nonceLength: def.nonceLength,\n tagLength: def.tagLength,\n varSizeNonce: def.varSizeNonce,\n getPlatform: () => platform,\n getDefinition: () => def,\n });\n if (def.withAAD)\n cipherFactory.withAAD = true;\n brandSet.add(cipherFactory);\n return Object.freeze(cipherFactory);\n};\nconst cipherSyncError = () => {\n throw new Error('sync is not supported');\n};\nconst copyCipherOutput = (res, out) => {\n if (!out)\n return res;\n if (out.length < res.length)\n throw new Error('output is too small');\n if (out === res)\n return out;\n out.set(res.subarray(0, res.length), 0);\n clean(res);\n return out;\n};\nexport const mkCipherNoble = (def_, init_, platform = 'noble') => {\n const def = def_;\n const init = init_;\n const factory = ((key, ...args) => {\n abytes(key, undefined, 'key');\n if (def.nonceLength !== undefined) {\n const nonce = args[0];\n abytes(nonce, def.varSizeNonce ? undefined : def.nonceLength, 'nonce');\n }\n const aadStart = def.nonceLength !== undefined ? 1 : 0;\n if (!def.withAAD) {\n for (let i = aadStart; i < args.length; i++)\n if (isBytes(args[i]))\n throw new Error('AAD not supported');\n }\n if (def.withAAD && args[aadStart] !== undefined)\n abytes(args[aadStart], undefined, 'AAD');\n if (def.validate)\n def.validate(key, ...args);\n const impl = init(key, ...args);\n let used = false;\n const mk = (dir, run) => {\n const fn = (data, output) => {\n abytes(data);\n if (output !== undefined && def.noOutput)\n throw new Error('cipher output not supported');\n if (output !== undefined)\n abytes(output, undefined, 'output');\n if (dir === 'encrypt') {\n if (used)\n throw new Error('cannot encrypt() twice with same key + nonce');\n used = true;\n }\n const tagLen = def.tagLength || 0;\n const exactLen = tagLen && dir === 'encrypt'\n ? data.length + tagLen\n : tagLen && dir === 'decrypt'\n ? data.length - tagLen\n : data.length;\n // Native tag-left wrappers either reject `out` or use a pretag buffer layout.\n const runOut = output !== undefined && !def.padding && !def.tagLeft && output.length === exactLen\n ? output\n : undefined;\n const res = run(data, runOut);\n if (output && def.exactOutput && output.length !== res.length)\n throw new Error('\"output\" expected Uint8Array of length ' + res.length + ', got: ' + output.length);\n return copyCipherOutput(res, output);\n };\n let runAsync;\n Object.assign(fn, {\n async: (data, output, opts) => (runAsync ||\n (runAsync = mkAsync(function* (setup, data, output, opts) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return fn(data, output);\n const tick = !setupMode.isAsync\n ? !opts?.onProgress\n ? (setupMode({ total: 0 }), (_inc) => false)\n : setupMode({ total: data.length, onProgress: opts.onProgress })\n : setupMode({\n total: data.length,\n asyncTick: opts?.asyncTick,\n onProgress: opts?.onProgress,\n nextTick: opts?.nextTick,\n });\n const out = fn(data, output);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(data.length))\n yield;\n return out;\n }))).async(data, output, opts),\n create: () => {\n throw new Error('streaming is not supported');\n },\n });\n return fn;\n };\n return {\n encrypt: mk('encrypt', impl.encrypt),\n decrypt: mk('decrypt', impl.decrypt),\n };\n });\n Object.assign(factory, {\n blockSize: def.blockLen,\n blockLen: def.blockLen,\n nonceLength: def.nonceLength,\n tagLength: def.tagLength,\n varSizeNonce: def.varSizeNonce,\n getPlatform: () => platform,\n getDefinition: () => def,\n });\n if (def.withAAD)\n factory.withAAD = true;\n brandSet.add(factory);\n return Object.freeze(factory);\n};\nexport const mkCipherAsync = (def_, init_, platform = 'webcrypto', isSupported) => {\n const def = def_;\n const init = init_;\n const factory = ((key, ...args) => {\n abytes(key, undefined, 'key');\n const aadStart = def.nonceLength !== undefined ? 1 : 0;\n // Async wrappers share the sync no-AAD rule so WebCrypto ciphers cannot ignore AAD.\n if (!def.withAAD) {\n for (let i = aadStart; i < args.length; i++)\n if (isBytes(args[i]))\n throw new Error('AAD not supported');\n }\n if (def.withAAD && args[aadStart] !== undefined)\n abytes(args[aadStart], undefined, 'AAD');\n if (def.validate)\n def.validate(key, ...args);\n const impl = init(key, ...args);\n const mk = (run) => {\n const fn = ((_, _out) => cipherSyncError());\n fn.async = async (data, out, _opts) => {\n abytes(data, undefined, 'data');\n const rawRun = run;\n const res = await rawRun(data);\n return copyCipherOutput(res, out);\n };\n fn.create = () => {\n throw new Error('streaming is not supported');\n };\n return fn;\n };\n return { encrypt: mk(impl.encrypt), decrypt: mk(impl.decrypt) };\n });\n Object.assign(factory, {\n blockSize: def.blockLen,\n blockLen: def.blockLen,\n nonceLength: def.nonceLength,\n tagLength: def.tagLength,\n varSizeNonce: def.varSizeNonce,\n getPlatform: () => platform,\n getDefinition: () => def,\n });\n if (def.withAAD)\n factory.withAAD = true;\n if (isSupported)\n factory.isSupported = isSupported;\n brandSet.add(factory);\n return Object.freeze(factory);\n};\nexport function mkCipherStub(def_) {\n const def = def_;\n let inner;\n const checkInner = () => {\n if (inner === undefined)\n throw new Error('implementation not installed');\n };\n const stub = ((key, ...args) => {\n checkInner();\n const impl = inner;\n return impl(key, ...args);\n });\n Object.assign(stub, {\n getPlatform: () => {\n checkInner();\n const impl = inner;\n return impl.getPlatform();\n },\n getDefinition: () => {\n checkInner();\n const impl = inner;\n return impl.getDefinition();\n },\n install: (impl, opts = {}) => {\n const { onlyMissing } = opts;\n if (onlyMissing !== undefined)\n abool(onlyMissing);\n if (onlyMissing && inner !== undefined)\n return;\n if (!isBranded(impl))\n throw new Error('install: non-branded implementation');\n if (impl.getDefinition() !== def)\n throw new Error('wrong implementation definition');\n inner = impl;\n },\n blockSize: def.blockLen,\n blockLen: def.blockLen,\n nonceLength: def.nonceLength,\n tagLength: def.tagLength,\n varSizeNonce: def.varSizeNonce,\n });\n if (def.withAAD)\n stub.withAAD = true;\n return Object.freeze(stub);\n}\n", "import { ARX_SIGMA16, ARX_SIGMA32 } from \"./constants.js\";\nimport { abytes, anumber, u32 } from \"./utils.js\";\nexport const limit = (name, min, max) => (value) => {\n if (!Number.isSafeInteger(value) || min > value || value > max) {\n const minmax = '[' + min + '..' + max + ']';\n throw new Error('' + name + ': expected value in range ' + minmax + ', got ' + value);\n }\n};\nconst setCounter = (counterSeg, counter) => {\n counterSeg[0] = counter >>> 0;\n counterSeg[1] = 0;\n};\nconst arxLimit = (len, args, pending = 0) => {\n const opts = args?.[1];\n const counter = opts?.counter === undefined ? 0 : opts.counter;\n const avail = pending > 0 && pending < 64 ? 64 - pending : 0;\n const blocks = Math.ceil(Math.max(0, len - avail) / 64);\n if (blocks > 0 && counter > 2 ** 32 - 1 - blocks)\n throw new Error('arx: counter overflow');\n};\n// Validations live in validate() because init() is lazy; tests expect errors at factory creation.\nexport const initArx = (mod, key, nonce, opts, cfg) => {\n const { allowShortKeys, extendNonce, counterLength, counterRight } = cfg;\n const counter = opts?.counter === undefined ? 0 : opts.counter;\n let k = key;\n let sigma = key.length === 16 ? ARX_SIGMA16 : ARX_SIGMA32;\n if (key.length === 16 && allowShortKeys) {\n const kk = new Uint8Array(32);\n kk.set(key);\n kk.set(key, 16);\n k = kk;\n sigma = ARX_SIGMA16;\n }\n let n = nonce;\n if (extendNonce) {\n if (!mod.derive)\n throw new Error('arx: extendNonce requires derive');\n mod.segments['state.sigma'].set(sigma);\n mod.segments['state.key'].set(k);\n mod.segments['derive.nonce'].set(nonce.subarray(0, 16));\n mod.derive();\n k = mod.segments['derive.out'];\n n = nonce.subarray(16);\n }\n const nonceNcLen = 16 - counterLength;\n if (nonceNcLen !== 12) {\n const nc = new Uint8Array(12);\n const off = counterRight ? 0 : 12 - n.length;\n nc.set(n, off);\n n = nc;\n }\n mod.segments['state.sigma'].set(sigma);\n mod.segments['state.key'].set(k);\n const nonceBytes = mod.segments['state.nonce'].length;\n mod.segments['state.nonce'].set(n.length === nonceBytes ? n : n.subarray(0, nonceBytes));\n setCounter(u32(mod.segments['state.counter']), counter);\n};\n// Factory-time validation: mkCipher init is lazy.\nconst validateArx = (key, nonce, opts, cfg) => {\n const { allowShortKeys, extendNonce, counterLength } = cfg;\n abytes(key, undefined, 'key');\n abytes(nonce, undefined, 'nonce');\n const counter = opts?.counter === undefined ? 0 : opts.counter;\n anumber(counter, 'counter');\n if (counter < 0 || counter >= 2 ** 32 - 1)\n throw new Error('arx: counter overflow');\n if (key.length === 32) {\n // ok\n }\n else if (key.length === 16 && allowShortKeys) {\n // ok\n }\n else {\n abytes(key, 32, 'arx key');\n throw new Error('invalid key size');\n }\n let n = nonce;\n if (extendNonce) {\n if (nonce.length !== 24)\n throw new Error('arx: extended nonce must be 24 bytes');\n n = nonce.subarray(16);\n }\n const nonceNcLen = 16 - counterLength;\n if (nonceNcLen !== n.length)\n throw new Error(`arx: nonce must be ${nonceNcLen} or 16 bytes`);\n};\nconst arxBase = (cfg) => ({\n blockLen: 64,\n // Match noble-ciphers raw stream semantics: caller-provided outputs must be the exact plaintext length.\n exactOutput: true,\n lengthLimitEnc: arxLimit,\n lengthLimitDec: arxLimit,\n validate: (key, nonce, opts) => {\n validateArx(key, nonce, opts, cfg);\n },\n init: (mod, _dir, key, nonce, opts) => {\n const iv = nonce;\n initArx(mod, key, iv, opts, cfg);\n },\n});\nexport const salsa20 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({ allowShortKeys: true, counterLength: 8, counterRight: true }),\n nonceLength: 8,\n}))();\nexport const xsalsa20 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({\n allowShortKeys: true,\n counterLength: 8,\n counterRight: true,\n extendNonce: true,\n }),\n nonceLength: 24,\n}))();\nexport const chacha20orig = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({ allowShortKeys: true, counterLength: 8, counterRight: false }),\n nonceLength: 8,\n}))();\nexport const chacha20 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({ allowShortKeys: false, counterLength: 4, counterRight: false }),\n nonceLength: 12,\n}))();\nexport const xchacha20 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({\n allowShortKeys: false,\n counterLength: 8,\n counterRight: false,\n extendNonce: true,\n }),\n nonceLength: 24,\n}))();\nexport const chacha8 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({ allowShortKeys: false, counterLength: 4, counterRight: false }),\n nonceLength: 12,\n}))();\nexport const chacha12 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxBase({ allowShortKeys: false, counterLength: 4, counterRight: false }),\n nonceLength: 12,\n}))();\nconst arxAeadBase = (cfg, tagLeft = false, withAAD = true) => ({\n blockLen: 64,\n tagLength: 16,\n ...(withAAD ? { withAAD: true } : {}),\n tagLeft,\n tagError: 'invalid tag',\n validate: (key, nonce, aad) => {\n validateArx(key, nonce, undefined, cfg);\n if (withAAD && aad !== undefined)\n abytes(aad, undefined, 'AAD');\n },\n init: (mod, dir, key, nonce, aad) => {\n const iv = nonce;\n const aadBytes = withAAD ? aad : undefined;\n initArx(mod, key, iv, undefined, cfg);\n const [aadLo, aadHi] = splitLen(aadBytes ? aadBytes.length : 0);\n if (dir === 'encrypt')\n mod.encryptInit(aadLo, aadHi);\n else\n mod.decryptInit(aadLo, aadHi);\n if (aadBytes && aadBytes.length)\n aadBlocks(mod, aadBytes);\n },\n getTag: (mod) => {\n mod.tagFinish();\n return mod.segments['state.poly.tag'].subarray(0, 16);\n },\n});\nexport const chacha20poly1305 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxAeadBase({\n allowShortKeys: false,\n counterLength: 4,\n counterRight: false,\n }),\n nonceLength: 12,\n}))();\nexport const xchacha20poly1305 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxAeadBase({\n allowShortKeys: false,\n counterLength: 8,\n counterRight: false,\n extendNonce: true,\n }),\n nonceLength: 24,\n}))();\n// XSalsa20-Poly1305 secretbox has no standard AAD.\nexport const xsalsa20poly1305 = /* @__PURE__ */ (() => Object.freeze({\n ... /* @__PURE__ */arxAeadBase({ allowShortKeys: true, counterLength: 8, counterRight: true, extendNonce: true }, true, false),\n dataOffset: 32,\n nonceLength: 24,\n}))();\nconst AES_LEN_ENC = 'aec/(cbc-ecb): unpadded plaintext with disabled padding';\nconst AES_LEN_DEC = 'aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size 16';\nconst AES_PAD_EMPTY = 'aes/pcks5: empty ciphertext not allowed';\n// Match noble-ciphers invalid-padding wording for compatibility tests.\nconst AES_PAD_BAD = 'aes: bad decrypt';\nconst aesKey = (key) => {\n abytes(key, undefined, 'aes key');\n if (key.length !== 16 && key.length !== 24 && key.length !== 32) {\n throw new Error('\"aes key\" expected Uint8Array of length 16/24/32, got length=' + key.length);\n }\n};\nconst aesInit = (mod, key, iv, dir, useDec) => {\n const keySeg = mod.segments['state.key'];\n keySeg.set(key);\n if (iv !== undefined)\n mod.segments['state.iv'].set(iv);\n if (dir === 'encrypt' || !useDec)\n mod.encryptInit(key.length);\n else\n mod.decryptInit(key.length);\n};\nconst aesInitCtr = (mod, key, nonce, dir) => {\n const keySeg = mod.segments['state.key'];\n keySeg.set(key);\n if (nonce !== undefined)\n mod.segments['state.nonce'].set(nonce);\n if (dir === 'encrypt')\n mod.encryptInit(key.length);\n else\n mod.decryptInit(key.length);\n};\n// NIST SP 800-38A \u00A76.1: ECB repeats ciphertext blocks for repeated plaintext blocks under a key.\nexport const ecb = {\n blockLen: 16,\n padding: true,\n lengthErrorEnc: AES_LEN_ENC,\n lengthErrorDec: AES_LEN_DEC,\n padError: AES_PAD_BAD,\n emptyError: AES_PAD_EMPTY,\n validate: (key) => {\n aesKey(key);\n },\n init: (mod, dir, key, opts) => {\n aesInit(mod, key, undefined, dir, true);\n const o = opts;\n return { disablePadding: !!o?.disablePadding };\n },\n};\n// NIST SP 800-38A \u00A75.3: CBC callers must supply an unpredictable 16-byte IV; this wrapper only validates its length.\nexport const cbc = {\n blockLen: 16,\n nonceLength: 16,\n padding: true,\n lengthErrorEnc: AES_LEN_ENC,\n lengthErrorDec: AES_LEN_DEC,\n padError: AES_PAD_BAD,\n emptyError: AES_PAD_EMPTY,\n validate: (key, iv) => {\n aesKey(key);\n if (iv !== undefined)\n abytes(iv, 16, 'iv');\n },\n init: (mod, dir, key, iv, opts) => {\n aesInit(mod, key, iv, dir, true);\n const o = opts;\n return { disablePadding: !!o?.disablePadding };\n },\n};\n// NIST SP 800-38A \u00A7\u00A75.3 and 6.3: CFB callers must supply an unpredictable 16-byte IV; this wrapper fixes s to the 128-bit AES block size.\nexport const cfb = {\n blockLen: 16,\n nonceLength: 16,\n noOverlap: true,\n validate: (key, iv) => {\n aesKey(key);\n if (iv !== undefined)\n abytes(iv, 16, 'iv');\n },\n init: (mod, dir, key, iv) => {\n aesInit(mod, key, iv, dir, false);\n },\n};\n// NIST SP 800-38A \u00A76.4: OFB callers must supply a unique 16-byte IV for each use under a given key; this wrapper only validates its length.\nexport const ofb = {\n blockLen: 16,\n nonceLength: 16,\n validate: (key, iv) => {\n aesKey(key);\n if (iv !== undefined)\n abytes(iv, 16, 'iv');\n },\n init: (mod, dir, key, iv) => {\n aesInit(mod, key, iv, dir, false);\n },\n};\n// NIST SP 800-38A \u00A76.5 and Appendix B: CTR callers must supply a unique 16-byte initial counter block under each key; this wrapper only validates its length.\nexport const ctr = {\n blockLen: 16,\n nonceLength: 16,\n validate: (key, nonce) => {\n aesKey(key);\n if (nonce !== undefined)\n abytes(nonce, 16, 'nonce');\n },\n init: (mod, dir, key, nonce) => {\n aesInitCtr(mod, key, nonce, dir);\n },\n};\n// AEAD backends take 64-bit length inputs as [lo, hi] u32 words via u64.fromN('u32', ...).\nconst _0xffffffffn = /* @__PURE__ */ BigInt(0xffffffff);\nconst _32n = /* @__PURE__ */ BigInt(32);\nconst splitLen = (len) => {\n const v = BigInt(len);\n return [Number(v & _0xffffffffn), Number((v >> _32n) & _0xffffffffn)];\n};\n// Feed full blocks through the module buffer, zero-filling the unused tail so callbacks can finalize partial last blocks safely.\nconst streamBlocks = (mod, data, blockLen, run) => {\n const buffer = mod.segments.buffer;\n const maxBlocks = Math.floor(buffer.length / blockLen);\n let pos = 0;\n while (pos < data.length) {\n const remaining = data.length - pos;\n const blocks = Math.min(maxBlocks, Math.ceil(remaining / blockLen));\n const take = Math.min(remaining, blocks * blockLen);\n const left = blocks * blockLen - take;\n if (take)\n buffer.set(data.subarray(pos, pos + take), 0);\n if (left)\n buffer.fill(0, take, take + left);\n run(blocks, remaining <= maxBlocks * blockLen ? 1 : 0, left);\n buffer.fill(0, 0, blocks * blockLen);\n pos += take;\n }\n};\nconst aadBlocks = (mod, data) => {\n streamBlocks(mod, data, 16, (blocks, isLast, left) => {\n mod.aadBlocks(blocks, isLast, left);\n });\n};\n// NIST SP 800-38D \u00A7\u00A75.2.1.1 and 8: GCM IVs must be unique per key; this wrapper supports variable-length byte IVs but only enforces a local minimum length.\nexport const gcm = {\n blockLen: 16,\n nonceLength: 12,\n tagLength: 16,\n withAAD: true,\n varSizeNonce: true,\n noOutput: true,\n validate: (key, nonce, aad) => {\n const iv = nonce;\n abytes(iv, undefined, 'nonce');\n if (iv.length < 8)\n throw new Error('aes/gcm: invalid nonce length');\n aesKey(key);\n if (aad !== undefined)\n abytes(aad, undefined, 'AAD');\n },\n init: (mod, dir, key, nonce, aad) => {\n const iv = nonce;\n const aadBytes = aad;\n mod.segments['state.key'].set(key);\n if (iv.length === 12) {\n mod.segments['state.nonce'].set(iv);\n }\n const [aadLo, aadHi] = splitLen(aadBytes ? aadBytes.length : 0);\n const nonceBits = iv.length === 12 ? [0, 0] : splitLen(iv.length * 8);\n if (dir === 'encrypt')\n mod.encryptInit(key.length, iv.length, nonceBits[0], nonceBits[1], aadLo, aadHi);\n else\n mod.decryptInit(key.length, iv.length, nonceBits[0], nonceBits[1], aadLo, aadHi);\n mod.aadInit();\n if (iv.length !== 12) {\n aadBlocks(mod, iv);\n mod.nonceFinish(nonceBits[0], nonceBits[1]);\n }\n if (aadBytes && aadBytes.length) {\n aadBlocks(mod, aadBytes);\n }\n },\n getTag: (mod) => {\n mod.tagFinish();\n return mod.segments['state.tag'].subarray(0, 16);\n },\n};\nexport const gcmsiv = /* @__PURE__ */ (() => {\n const GCMSIV_AAD = /* @__PURE__ */ limit('AAD', 0, 2 ** 36);\n const GCMSIV_PLAIN = /* @__PURE__ */ limit('plaintext', 0, 2 ** 36);\n const GCMSIV_CIPHER = /* @__PURE__ */ limit('ciphertext', 16, 2 ** 36 + 16);\n const GCMSIV_NONCE = /* @__PURE__ */ limit('nonce', 12, 12);\n return {\n blockLen: 16,\n nonceLength: 12,\n tagLength: 16,\n withAAD: true,\n varSizeNonce: true,\n noOutput: true,\n noStream: true,\n // RFC 8452 \u00A7\u00A74-5, 9: AES-GCM-SIV decrypt must not release plaintext before tag confirmation, so round-0 output stays internal.\n multiPass: 2,\n multiPassResult: { encrypt: false, decrypt: true },\n multiPassOut: { decrypt: 0 },\n lengthLimitEnc: (len) => GCMSIV_PLAIN(len),\n lengthLimitDec: (len) => GCMSIV_CIPHER(len),\n validate: (key, nonce, aad) => {\n const iv = nonce;\n const aadBytes = aad;\n abytes(iv, undefined, 'nonce');\n // RFC 8452 standardizes only 16-byte and 32-byte keys; 24-byte AES-192 is a local extension.\n aesKey(key);\n GCMSIV_NONCE(iv.length);\n if (aadBytes) {\n abytes(aadBytes, undefined, 'AAD');\n GCMSIV_AAD(aadBytes.length);\n }\n },\n init: (mod, dir, key, nonce, aad) => {\n const iv = nonce;\n const aadBytes = aad;\n mod.segments['state.key'].set(key);\n mod.segments['state.nonce'].set(iv);\n const [aadLo, aadHi] = splitLen(aadBytes ? aadBytes.length : 0);\n if (dir === 'encrypt')\n mod.encryptInit(key.length, aadLo, aadHi);\n else\n mod.decryptInit(key.length, aadLo, aadHi);\n if (aadBytes && aadBytes.length)\n aadBlocks(mod, aadBytes);\n },\n getTag: (mod) => mod.segments['state.tag'].subarray(0, 16),\n };\n})();\nexport const aessiv = {\n blockLen: 16,\n tagLength: 16,\n withAAD: true,\n tagLeft: true,\n noStream: true,\n multiPass: 2,\n multiPassResult: { encrypt: false, decrypt: true },\n multiPassOut: { decrypt: 0 },\n // RFC 5297 \u00A72.7 verifies after CTR on decrypt, so mkCipher clears any round-0 candidate\n // plaintext it wrote into caller output before surfacing invalid-tag failure.\n // RFC 5297 \u00A7\u00A73, 7: extra args are S2V AD components; nonce-based callers pass the nonce last, and plaintext is the 127th component so AD is capped at 126 entries.\n validate: (_key, ...aadList) => {\n const aad = aadList;\n if (aad.length > 126)\n throw new Error('\"AAD\" number of elements must be less than or equal to 126');\n const key = _key;\n abytes(key, undefined, 'aes key');\n if (key.length !== 32 && key.length !== 48 && key.length !== 64) {\n throw new Error('\"aes key\" expected Uint8Array of length 32/48/64, got length=' + key.length);\n }\n for (const a of aad)\n abytes(a);\n },\n init: (mod, dir, key, ...aadList) => {\n const aad = aadList;\n const half = key.length / 2;\n mod.segments['state.key1'].set(key.subarray(0, half));\n mod.segments['state.key'].set(key.subarray(half));\n if (dir === 'encrypt')\n mod.encryptInit(half);\n else\n mod.decryptInit(half);\n for (const a of aad) {\n if (a.length)\n aadBlocks(mod, a);\n else\n mod.aadBlocks(0, 1, 0);\n }\n },\n getTag: (mod) => mod.segments['state.tag'].subarray(0, 16),\n};\nconst AESKW_PLAIN = 'invalid plaintext length';\nconst AESKW_CIPHER = 'invalid ciphertext length';\nconst AESKW_SHORT = '8-byte keys not allowed in AESKW, use AESKWP instead';\nconst AESKW_PLAIN_4G = 'plaintext should be less than 4gb';\nconst AESKW_CIPHER_4G = 'ciphertext should be less than 4gb';\nconst aeskwInit = (mod, dir, key) => {\n mod.segments['state.key'].set(key);\n if (dir === 'encrypt')\n mod.encryptInit(key.length);\n else\n mod.decryptInit(key.length);\n};\n// RFC 3394 \u00A72 leaves AES-KW input length unbounded; these wrappers still cap inputs below 2^32 bytes because callers and outputs are Uint8Array-sized.\nconst kwPlainLimit = (len) => {\n if (len >= 2 ** 32)\n throw new Error(AESKW_PLAIN_4G);\n if (len === 8)\n throw new Error(AESKW_SHORT);\n if (!len || len % 8 !== 0)\n throw new Error(AESKW_PLAIN);\n};\n// RFC 3394 unwrap consumes (n+1) 64-bit blocks with n>=2, so AES-KW ciphertext is at least 24 bytes; this wrapper also keeps the local Uint8Array-sized cap below 2^32+8 bytes.\nconst kwCipherLimit = (len) => {\n if (len - 8 >= 2 ** 32)\n throw new Error(AESKW_CIPHER_4G);\n if (len % 8 !== 0 || len < 24)\n throw new Error(AESKW_CIPHER);\n};\n// RFC 5649 allows 1..2^32 octets before padding; this Uint8Array API can only realize lengths below 2^32.\nconst kwpPlainLimit = (len) => {\n if (len >= 2 ** 32)\n throw new Error(AESKW_PLAIN_4G);\n if (!len)\n throw new Error(AESKW_PLAIN);\n};\n// RFC 5649 unwrap works on two or more 64-bit blocks; this helper preflights only the min/max bound, and the shared paddingLeft branch rejects non-8-byte ciphertext lengths before module work.\nconst kwpCipherLimit = (len) => {\n if (len - 8 >= 2 ** 32)\n throw new Error(AESKW_CIPHER_4G);\n if (len < 16)\n throw new Error(AESKW_CIPHER);\n};\nexport const aeskw = {\n blockLen: 8,\n // RFC 3394 wraps a leading 64-bit A/C0 register plus six outer passes over A || R[1..n].\n paddingLeft: 8,\n noStream: true,\n noOutput: true,\n padError: 'integrity check failed',\n multiPass: 6,\n multiPassResult: true,\n validate: (key) => {\n aesKey(key);\n },\n lengthLimitEnc: kwPlainLimit,\n lengthLimitDec: kwCipherLimit,\n init: (mod, dir, key) => {\n aeskwInit(mod, dir, key);\n },\n};\nexport const aeskwp = {\n blockLen: 8,\n // RFC 5649 wraps a leading 64-bit AIV register, pads only to the next 64-bit boundary, and uses the RFC 3394 six-pass path once more than one plaintext block is present.\n paddingLeft: 8,\n padding: true,\n padFull: false,\n noStream: true,\n noOutput: true,\n padError: 'integrity check failed',\n multiPass: 6,\n multiPassResult: true,\n validate: (key) => {\n aesKey(key);\n },\n lengthLimitEnc: kwpPlainLimit,\n lengthLimitDec: kwpCipherLimit,\n init: (mod, dir, key) => {\n aeskwInit(mod, dir, key);\n },\n};\n// NOTE: safe for tree-shaking since used only in building process\n// prettier-ignore\nconst defs = {\n ctr, cbc, ofb, cfb, ecb, gcm, gcmsiv, aessiv, aeskw, aeskwp, // AES\n salsa20, xsalsa20, chacha8, chacha12, chacha20, chacha20orig, xchacha20, // ARX\n chacha20poly1305, xchacha20poly1305, xsalsa20poly1305 // ARX AED\n};\n// Map each name to module\nconst MOD_OF = {\n salsa20: 'salsa20',\n xsalsa20: 'salsa20',\n chacha8: 'chacha8',\n chacha12: 'chacha12',\n chacha20: 'chacha20',\n chacha20orig: 'chacha20',\n xchacha20: 'chacha20',\n chacha20poly1305: 'chacha_poly1305',\n xchacha20poly1305: 'chacha_poly1305',\n xsalsa20poly1305: 'salsa_poly1305',\n ctr: 'aes_ctr',\n cbc: 'aes_cbc',\n cfb: 'aes_cfb',\n ecb: 'aes_ecb',\n gcm: 'aes_gcm',\n gcmsiv: 'aes_gcmsiv',\n aessiv: 'aes_siv',\n aeskw: 'aes_kw',\n aeskwp: 'aes_kwp',\n ofb: 'aes_ofb',\n};\n// Verifies that definition actually can be used with module\nfunction buildDefinitions(defs, modOf) {\n const out = {};\n for (const k in defs)\n out[k] = { mod: modOf[k], def: defs[k] };\n return out;\n}\nexport const Definitions = /* @__PURE__ */ buildDefinitions(defs, MOD_OF);\n", "// WARNING: This file is auto-generated. Any changes will be lost.\nfunction init_module(_imports = {}, pool) {\n const _importsEmbed = { env: {} };\n _imports = { ..._importsEmbed, ..._imports, env: { ..._importsEmbed.env, ..._imports.env } };\n ;\n if (!_imports.env._memory)\n _imports.env._memory = new WebAssembly.Memory({ initial: 41, maximum: 41, shared: false });\n const code = Uint8Array.from(atob('AGFzbQEAAAABPQlgA39/fwBgAABgAn9/AGAEf39/fwBgBX9/f39/AGABfwBgAn9+An9+YAZ/f39/f38Gf39/f39/YAF/AX8DDw4AAQACAQACAwEBAAQFAQUEAQEpKQeyAQ8GbWVtb3J5AgAJYWFkQmxvY2tzAAAHYWFkSW5pdAABDWRlY3J5cHRCbG9ja3MAAgtkZWNyeXB0SW5pdAADBmRlcml2ZQAEDWVuY3J5cHRCbG9ja3MABQtlbmNyeXB0SW5pdAAGC21hY0Jsb2Nrc0F0AAcJbWFjRmluaXNoAAgHbWF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KALYBiEpQQAoAuAGISpBACgC6AYhK0EAKALwBiEsAgEgAUEESSACIANBAEdxckUNAAIBIAFBAEdFDQBBACgC0AYhLUEAKALYBiEuQQAoAuAGIS9BACgC6AYhMEEAKALwBiExQQAgLSAuIC8gMCAxAgchNyE2ITUhNCEzITIgMiAzIDQgNSA2IDcDByE9ITwhOyE6ITkhOCA4QQFqIT4gAEEEdiA4akEEdEHwB2oiPygCACFAID9BBGoiQSgCACFCIEFBBGoiQygCACFEIENBBGooAgAhRSA5IEBBAHZB////H3FqIkatIBOtfiA6IEBBGnYgQkEGdHJB////H3FqIketICetfnwgOyBCQRR2IERBDHRyQf///x9xaiJIrSAmrX58IDwgREEOdiBFQRJ0ckH///8fcWoiSa0gJa1+fCA9IEVBCHZBAEGAgIAIIAIgOEEBaiABRiADQQBHcXEbckH///8fcWoiSq0gJK1+fCJLQv///x+DIkxC////H4MgS0IaiCBMQhqIfCBGrSAUrX4gR60gE61+fCBIrSAnrX58IEmtICatfnwgSq0gJa1+fHwiTUIaiCBNQv///x+DIk5CGoh8IEatIBWtfiBHrSAUrX58IEitIBOtfnwgSa0gJ61+fCBKrSAmrX58fCJPQhqIIE9C////H4MiUEIaiHwgRq0gFq1+IEetIBWtfnwgSK0gFK1+fCBJrSATrX58IEqtICetfnx8IlFCGoggUUL///8fgyJSQhqIfCBGrSAXrX4gR60gFq1+fCBIrSAVrX58IEmtIBStfnwgSq0gE61+fHwiU0IaiCBTQv///x+DIlRCGoh8QgV+fCJVQv///x+DpyFWIE5C////H4MgVUIaiHynIVcgUEL///8fg6chWCBSQv///x+DpyFZIFRC////H4OnIVogPiBWIFcgWCBZIFogPiABSQ0AGhoaGhoaID4gViBXIFggWSBaCyE9ITwhOyE6ITkhOCA4IDkgOiA7IDwgPQshNyE2ITUhNCEzITJBACAzrTcD0AZBACA0rTcD2AZBACA1rTcD4AZBACA2rTcD6AZBACA3rTcD8AYLCwIBIAFBAnZBAEcgAkEARiADQQBGcnFFDQAgAUECdiFbQQAgKCApICogKyAsAgchYSFgIV8hXiFdIVwgXCBdIF4gXyBgIGEDByFnIWYhZSFkIWMhYiBiQQFqIWggAEEEdiBiQQJ0ImlqQQR0QfAHaiJqKAIAIWsgakEEaiJsKAIAIW0gbEEEaiJuKAIAIW8gbkEEaigCACFwIABBBHYgaUEBampBBHRB8AdqInEoAgAhciBxQQRqInMoAgAhdCBzQQRqInUoAgAhdiB1QQRqKAIAIXcgAEEEdiBpQQJqakEEdEHwB2oieCgCACF5IHhBBGoieigCACF7IHpBBGoifCgCACF9IHxBBGooAgAhfiAAQQR2IGlBA2pqQQR0QfAHaiJ/KAIAIYABIH9BBGoigQEoAgAhggEggQFBBGoigwEoAgAhhAEggwFBBGooAgAhhQEgYyBrQQB2Qf///x9xaq0ihgEgBK0ihwF+IGQga0EadiBtQQZ0ckH///8fcWqtIogBIButIpEBfnwgZSBtQRR2IG9BDHRyQf///x9xaq0iigEgGq0ijwF+fCBmIG9BDnYgcEESdHJB////H3FqrSKNASAZrSKMAX58IGcgcEEIdkGAgIAIckH///8fcWqtIpABIBitfnwgckEAdkH///8fca0ikgEgCa0ikwF+IHJBGnYgdEEGdHJB////H3GtIpQBIB+tIp0BfnwgdEEUdiB2QQx0ckH///8fca0ilgEgHq0imwF+fCB2QQ52IHdBEnRyQf///x9xrSKZASAdrSKYAX58IHdBCHZBgICACHJB////H3GtIpwBIBytfnx8IHlBAHZB////H3GtIp4BIA6tIp8BfiB5QRp2IHtBBnRyQf///x9xrSKgASAjrSKpAX58IHtBFHYgfUEMdHJB////H3GtIqIBICKtIqcBfnwgfUEOdiB+QRJ0ckH///8fca0ipQEgIa0ipAF+fCB+QQh2QYCAgAhyQf///x9xrSKoASAgrX58IIABQQB2Qf///x9xrSKqASATrSKrAX4ggAFBGnYgggFBBnRyQf///x9xrSKsASAnrSK1AX58IIIBQRR2IIQBQQx0ckH///8fca0irgEgJq0iswF+fCCEAUEOdiCFAUESdHJB////H3GtIrEBICWtIrABfnwghQFBCHZBgICACHJB////H3GtIrQBICStfnx8fCK2AUL///8fgyCGASAIrX4giAEgB60ijgF+fCCKASAGrSKLAX58II0BIAWtIokBfnwgkAEghwF+fCCSASANrX4glAEgDK0imgF+fCCWASALrSKXAX58IJkBIAqtIpUBfnwgnAEgkwF+fHwgngEgEq1+IKABIBGtIqYBfnwgogEgEK0iowF+fCClASAPrSKhAX58IKgBIJ8BfnwgqgEgF61+IKwBIBatIrIBfnwgrgEgFa0irwF+fCCxASAUrSKtAX58ILQBIKsBfnx8fCCGASCOAX4giAEgiwF+fCCKASCJAX58II0BIIcBfnwgkAEgkQF+fCCSASCaAX4glAEglwF+fCCWASCVAX58IJkBIJMBfnwgnAEgnQF+fHwgngEgpgF+IKABIKMBfnwgogEgoQF+fCClASCfAX58IKgBIKkBfnwgqgEgsgF+IKwBIK8BfnwgrgEgrQF+fCCxASCrAX58ILQBILUBfnx8fCCGASCLAX4giAEgiQF+fCCKASCHAX58II0BIJEBfnwgkAEgjwF+fCCSASCXAX4glAEglQF+fCCWASCTAX58IJkBIJ0BfnwgnAEgmwF+fHwgngEgowF+IKABIKEBfnwgogEgnwF+fCClASCpAX58IKgBIKcBfnwgqgEgrwF+IKwBIK0BfnwgrgEgqwF+fCCxASC1AX58ILQBILMBfnx8fCCGASCJAX4giAEghwF+fCCKASCRAX58II0BII8BfnwgkAEgjAF+fCCSASCVAX4glAEgkwF+fCCWASCdAX58IJkBIJsBfnwgnAEgmAF+fHwgngEgoQF+IKABIJ8BfnwgogEgqQF+fCClASCnAX58IKgBIKQBfnwgqgEgrQF+IKwBIKsBfnwgrgEgtQF+fCCxASCzAX58ILQBILABfnx8fCC2AUIaiHwitwFCGoh8IrgBQhqIfCK5AUIaiHwiugFCGohCBX58IrsBQv///x+DpyG8ASC3AUL///8fgyC7AUIaiHynIb0BILgBQv///x+DpyG+ASC5AUL///8fg6chvwEgugFC////H4OnIcABIGggvAEgvQEgvgEgvwEgwAEgaCBbSQ0AGhoaGhoaIGggvAEgvQEgvgEgv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tAGkhHkEALQBqIR9BAC0AbSEhQQAtAG4hIkEAIBlB/wFxIBdB/wFxQQh0IBhB/wFxQRB0cnIgEEH/AXFBD3FBGHRyIhpBAHZB////H3EiJK03A/ACQQAgJK0gJK1+IBpBGnYgFEH/AXFB/AFxIBtB/wFxQQh0IBxB/wFxQRB0cnIgEUH/AXFBD3FBGHRyIh1BBnRyQf///x9xIiWtIBZB/wFxQfwBcSAhQf8BcUEIdCAiQf8BcUEQdHJyIBNB/wFxQQ9xQRh0ciIjQQh2Qf///x9xIihBBWwiLK1+fCAdQRR2IBVB/wFxQfwBcSAeQf8BcUEIdCAfQf8BcUEQdHJyIBJB/wFxQQ9xQRh0ciIgQQx0ckH///8fcSImrSAgQQ52ICNBEnRyQf///x9xIidBBWwiK61+fCAnrSAmQQVsIiqtfnwgKK0gJUEFbCIprX58Ii1C////H4MiLkL///8fgyAtQhqIIC5CGoh8ICStICWtfiAlrSAkrX58ICatICytfnwgJ60gK61+fCAorSAqrX58fCIvQhqIIC9C////H4MiMEIaiHwgJK0gJq1+ICWtICWtfnwgJq0gJK1+fCAnrSAsrX58ICitICutfnx8IjFCGoggMUL///8fgyIyQhqIfCAkrSAnrX4gJa0gJq1+fCAmrSAlrX58ICetICStfnwgKK0gLK1+fHwiM0IaiCAzQv///x+DIjRCGoh8ICStICitfiAlrSAnrX58ICatICatfnwgJ60gJa1+fCAorSAkrX58fCI1QhqIIDVC////H4MiNkIaiHxCBX58IjdC////H4OnIjitNwOgAkEAIDitICStfiAwQv///x+DIDdCGoh8pyI5rSAsrX58IDJC////H4OnIjqtICutfnwgNEL///8fg6ciO60gKq1+fCA2Qv///x+DpyI8rSAprX58Ij1C////H4MiPkL///8fgyA9QhqIID5CGoh8IDitICWtfiA5rSAkrX58IDqtICytfnwgO60gK61+fCA8rSAqrX58fCI/QhqIID9C////H4MiQEIaiHwgOK0gJq1+IDmtICWtfnwgOq0gJK1+fCA7rSAsrX58IDytICutfnx8IkFCGoggQUL///8fgyJCQhqIfCA4rSAnrX4gOa0gJq1+fCA6rSAlrX58IDutICStfnwgPK0gLK1+fHwiQ0IaiCBDQv///x+DIkRCGoh8IDitICitfiA5rSAnrX58IDqtICatfnwgO60gJa1+fCA8rSAkrX58fCJFQhqIIEVC////H4MiRkIaiHxCBX58IkdC////H4OnIkitNwPQAUEAIEitICStfiBAQv///x+DIEdCGoh8pyJJrSAsrX58IEJC////H4OnIkqtICutfnwgREL///8fg6ciS60gKq1+fCBGQv///x+DpyJMrSAprX58Ik1C////H4MiTkL///8fgyBNQhqIIE5CGoh8IEitICWtfiBJrSAkrX58IEqtICytfnwgS60gK61+fCBMrSAqrX58fCJPQhqIIE9C////H4MiUEIaiHwgSK0gJq1+IEmtICWtfnwgSq0gJK1+fCBLrSAsrX58IEytICutfnx8IlFCGoggUUL///8fgyJSQhqIfCBIrSAnrX4gSa0gJq1+fCBKrSAlrX58IEutICStfnwgTK0gLK1+fHwiU0IaiCBTQv///x+DIlRCGoh8IEitICitfiBJrSAnrX58IEqtICatfnwgS60gJa1+fCBMrSAkrX58fCJVQhqIIFVC////H4MiVkIaiHxCBX58IldC////H4OnIlitNwOAAUEAICRBBWytNwOwBUEAIDhBBWytNwPgBEEAIEhBBWytNwOQBEEAIFhBBWytNwPAA0EAICWtNwP4AkEAIDmtNwOoAkEAIEmtNwPYAUEAIFBC////H4MgV0IaiHynIlmtNwOIAUEAICVBBWytNwO4BUEAIDlBBWytNwPoBEEAIElBBWytNwOYBEEAIFlBBWytNwPIA0EAICatNwOAA0EAIDqtNwOwAkEAIEqtNwPgAUEAIFJC////H4OnIlqtNwOQAUEAICZBBWytNwPABUEAIDpBBWytNwPwBEEAIEpBBWytNwOgBEEAIFpBBWytNwPQA0EAICetNwOIA0EAIDutNwO4AkEAIEutNwPoAUEAIFRC////H4OnIlutNwOYAUEAICdBBWytNwPIBUEAIDtBBWytNwP4BEEAIEtBBWytNwOoBEEAIFtBBWytNwPYA0EAICitNwOQA0EAIDytNwPAAkEAIEytNwPwAU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CGDiCGDiACSQ0AGiCGDgsh2ggg2ggLIdkIINkICyHYCCDGCAshxgggxghBAWohhw4ghw4ghw4gBUkNABoghw4LIcUIIMUICyHECCDECAshwwgLIgBBAEEAQfAH/AsAQfCHoAFBAEEw/AsAQfAHQQAgAPwLAAtIAQJ+QQApA1AhAEEAKQNYIQFBACAApzYC8AdBACAAQiCIpzYC9AdBACABpzYC+AdBACABQiCIpzYC/AdBAEEBQQBBABAHEAgL'), char => char.charCodeAt(0));\n const module = new WebAssembly.Module(code);\n const instance = new WebAssembly.Instance(module, _imports);\n ;\n const _exports = instance.exports;\n const buffer = _exports.memory ? _exports.memory.buffer : new ArrayBuffer(0);\n const memoryExport = new Uint8Array(buffer, 0, 2622496);\n const segments = Object.freeze({ state: new Uint8Array(memoryExport.buffer, 0, 1008),\n state_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 1008, 1008))),\n \"state.counter\": new Uint8Array(memoryExport.buffer, 0, 8),\n \"state.counter_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 8, 8))),\n \"state.sigma\": new Uint8Array(memoryExport.buffer, 16, 16),\n \"state.sigma_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 16 + i * 16, 16))),\n \"state.key\": new Uint8Array(memoryExport.buffer, 32, 32),\n \"state.key_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 32 + i * 32, 32))),\n \"state.nonce\": new Uint8Array(memoryExport.buffer, 64, 12),\n \"state.nonce_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 64 + i * 12, 12))),\n \"state.aadLen\": new Uint8Array(memoryExport.buffer, 80, 8),\n \"state.aadLen_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 80 + i * 8, 8))),\n \"state.dataLen\": new Uint8Array(memoryExport.buffer, 88, 8),\n \"state.dataLen_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 88 + i * 8, 8))),\n \"state.poly\": new Uint8Array(memoryExport.buffer, 96, 912),\n \"state.poly_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 96 + i * 912, 912))),\n \"state.poly.key\": new Uint8Array(memoryExport.buffer, 96, 32),\n \"state.poly.key_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 96 + i * 32, 32))),\n \"state.poly.r\": new Uint8Array(memoryExport.buffer, 128, 320),\n \"state.poly.r_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 128 + i * 320, 320))),\n \"state.poly.r5\": new Uint8Array(memoryExport.buffer, 448, 320),\n \"state.poly.r5_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 448 + i * 320, 320))),\n \"state.poly.msg\": new Uint8Array(memoryExport.buffer, 768, 80),\n \"state.poly.msg_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 768 + i * 80, 80))),\n \"state.poly.h\": new Uint8Array(memoryExport.buffer, 848, 80),\n \"state.poly.h_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 848 + i * 80, 80))),\n \"state.poly.pad\": new Uint8Array(memoryExport.buffer, 928, 64),\n \"state.poly.pad_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 928 + i * 64, 64))),\n \"state.poly.tag\": new Uint8Array(memoryExport.buffer, 992, 16),\n \"state.poly.tag_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 992 + i * 16, 16))),\n buffer: new Uint8Array(memoryExport.buffer, 1008, 2621440),\n buffer_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 1008 + i * 2621440, 2621440))),\n derive: new Uint8Array(memoryExport.buffer, 2622448, 48),\n derive_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 2622448 + i * 48, 48))),\n \"derive.nonce\": new Uint8Array(memoryExport.buffer, 2622448, 16),\n \"derive.nonce_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 2622448 + i * 16, 16))),\n \"derive.out\": new Uint8Array(memoryExport.buffer, 2622464, 32),\n \"derive.out_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 2622464 + i * 32, 32)))\n });\n return Object.freeze({ ..._exports, memory: memoryExport, segments });\n}\nlet _cache;\nexport default function arx(_imports = {}, pool) {\n if (_cache)\n return _cache;\n return (_cache = init_module(_imports, pool));\n}\n", "import { mkHash } from \"../../hashes-abstract.js\";\nimport { sha3_224 as def_sha3_224 } from \"../../hashes.js\";\nimport mod_sha3_224 from './keccak24.js';\nimport { sha3_256 as def_sha3_256 } from \"../../hashes.js\";\nimport mod_sha3_256 from './keccak24.js';\nimport { sha3_384 as def_sha3_384 } from \"../../hashes.js\";\nimport mod_sha3_384 from './keccak24.js';\nimport { sha3_512 as def_sha3_512 } from \"../../hashes.js\";\nimport mod_sha3_512 from './keccak24.js';\nimport { keccak_224 as def_keccak_224 } from \"../../hashes.js\";\nimport mod_keccak_224 from './keccak24.js';\nimport { keccak_256 as def_keccak_256 } from \"../../hashes.js\";\nimport mod_keccak_256 from './keccak24.js';\nimport { keccak_384 as def_keccak_384 } from \"../../hashes.js\";\nimport mod_keccak_384 from './keccak24.js';\nimport { keccak_512 as def_keccak_512 } from \"../../hashes.js\";\nimport mod_keccak_512 from './keccak24.js';\nimport { shake128 as def_shake128 } from \"../../hashes.js\";\nimport mod_shake128 from './keccak24.js';\nimport { shake256 as def_shake256 } from \"../../hashes.js\";\nimport mod_shake256 from './keccak24.js';\nimport { shake128_32 as def_shake128_32 } from \"../../hashes.js\";\nimport mod_shake128_32 from './keccak24.js';\nimport { shake256_64 as def_shake256_64 } from \"../../hashes.js\";\nimport mod_shake256_64 from './keccak24.js';\nimport { sha224 as def_sha224 } from \"../../hashes.js\";\nimport mod_sha224 from './sha256.js';\nimport { sha256 as def_sha256 } from \"../../hashes.js\";\nimport mod_sha256 from './sha256.js';\nimport { sha384 as def_sha384 } from \"../../hashes.js\";\nimport mod_sha384 from './sha512.js';\nimport { sha512 as def_sha512 } from \"../../hashes.js\";\nimport mod_sha512 from './sha512.js';\nimport { sha512_224 as def_sha512_224 } from \"../../hashes.js\";\nimport mod_sha512_224 from './sha512.js';\nimport { sha512_256 as def_sha512_256 } from \"../../hashes.js\";\nimport mod_sha512_256 from './sha512.js';\nimport { sha1 as def_sha1 } from \"../../hashes.js\";\nimport mod_sha1 from './sha1.js';\nimport { ripemd160 as def_ripemd160 } from \"../../hashes.js\";\nimport mod_ripemd160 from './ripemd160.js';\nimport { md5 as def_md5 } from \"../../hashes.js\";\nimport mod_md5 from './md5.js';\nimport { blake224 as def_blake224 } from \"../../hashes.js\";\nimport mod_blake224 from './blake256.js';\nimport { blake256 as def_blake256 } from \"../../hashes.js\";\nimport mod_blake256 from './blake256.js';\nimport { blake384 as def_blake384 } from \"../../hashes.js\";\nimport mod_blake384 from './blake512.js';\nimport { blake512 as def_blake512 } from \"../../hashes.js\";\nimport mod_blake512 from './blake512.js';\nimport { blake2s as def_blake2s } from \"../../hashes.js\";\nimport mod_blake2s from './blake2s.js';\nimport { blake2b as def_blake2b } from \"../../hashes.js\";\nimport mod_blake2b from './blake2b.js';\nimport { blake3 as def_blake3 } from \"../../hashes.js\";\nimport mod_blake3 from './blake3.js';\nimport { poly1305 as def_poly1305 } from \"../../hashes.js\";\nimport mod_poly1305 from './poly1305.js';\nimport { ghash as def_ghash } from \"../../hashes.js\";\nimport mod_ghash from './ghash.js';\nimport { polyval as def_polyval } from \"../../hashes.js\";\nimport mod_polyval from './polyval.js';\nimport { cmac as def_cmac } from \"../../hashes.js\";\nimport mod_cmac from './cmac.js';\nimport { mkCipher } from \"../../ciphers-abstract.js\";\nimport { ctr as def_ctr } from \"../../ciphers.js\";\nimport mod_ctr from './aes_ctr.js';\nimport { cbc as def_cbc } from \"../../ciphers.js\";\nimport mod_cbc from './aes_cbc.js';\nimport { ofb as def_ofb } from \"../../ciphers.js\";\nimport mod_ofb from './aes_ofb.js';\nimport { cfb as def_cfb } from \"../../ciphers.js\";\nimport mod_cfb from './aes_cfb.js';\nimport { ecb as def_ecb } from \"../../ciphers.js\";\nimport mod_ecb from './aes_ecb.js';\nimport { gcm as def_gcm } from \"../../ciphers.js\";\nimport mod_gcm from './aes_gcm.js';\nimport { gcmsiv as def_gcmsiv } from \"../../ciphers.js\";\nimport mod_gcmsiv from './aes_gcmsiv.js';\nimport { aessiv as def_aessiv } from \"../../ciphers.js\";\nimport mod_aessiv from './aes_siv.js';\nimport { aeskw as def_aeskw } from \"../../ciphers.js\";\nimport mod_aeskw from './aes_kw.js';\nimport { aeskwp as def_aeskwp } from \"../../ciphers.js\";\nimport mod_aeskwp from './aes_kwp.js';\nimport { salsa20 as def_salsa20 } from \"../../ciphers.js\";\nimport mod_salsa20 from './salsa20.js';\nimport { xsalsa20 as def_xsalsa20 } from \"../../ciphers.js\";\nimport mod_xsalsa20 from './salsa20.js';\nimport { chacha8 as def_chacha8 } from \"../../ciphers.js\";\nimport mod_chacha8 from './chacha8.js';\nimport { chacha12 as def_chacha12 } from \"../../ciphers.js\";\nimport mod_chacha12 from './chacha12.js';\nimport { chacha20 as def_chacha20 } from \"../../ciphers.js\";\nimport mod_chacha20 from './chacha20.js';\nimport { chacha20orig as def_chacha20orig } from \"../../ciphers.js\";\nimport mod_chacha20orig from './chacha20.js';\nimport { xchacha20 as def_xchacha20 } from \"../../ciphers.js\";\nimport mod_xchacha20 from './chacha20.js';\nimport { chacha20poly1305 as def_chacha20poly1305 } from \"../../ciphers.js\";\nimport mod_chacha20poly1305 from './chacha_poly1305.js';\nimport { xchacha20poly1305 as def_xchacha20poly1305 } from \"../../ciphers.js\";\nimport mod_xchacha20poly1305 from './chacha_poly1305.js';\nimport { xsalsa20poly1305 as def_xsalsa20poly1305 } from \"../../ciphers.js\";\nimport mod_xsalsa20poly1305 from './salsa_poly1305.js';\nimport { scrypt as def_scrypt } from \"../../hashes.js\";\nimport mod_scrypt from './scrypt.js';\nimport { argon2d as def_argon2d } from \"../../hashes.js\";\nimport mod_argon2d from './argon2.js';\nimport { argon2i as def_argon2i } from \"../../hashes.js\";\nimport mod_argon2i from './argon2.js';\nimport { argon2id as def_argon2id } from \"../../hashes.js\";\nimport mod_argon2id from './argon2.js';\n/**\n * SHA3-224 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_224 } from '@awasm/noble';\n * sha3_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ mkHash(mod_sha3_224, def_sha3_224, 'wasm');\n/**\n * SHA3-256 hash function. Different from keccak-256.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_256 } from '@awasm/noble';\n * sha3_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ mkHash(mod_sha3_256, def_sha3_256, 'wasm');\n/**\n * SHA3-384 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_384 } from '@awasm/noble';\n * sha3_384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ mkHash(mod_sha3_384, def_sha3_384, 'wasm');\n/**\n * SHA3-512 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_512 } from '@awasm/noble';\n * sha3_512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ mkHash(mod_sha3_512, def_sha3_512, 'wasm');\n/**\n * keccak-224 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_224 } from '@awasm/noble';\n * keccak_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ mkHash(mod_keccak_224, def_keccak_224, 'wasm');\n/**\n * keccak-256 hash function. Different from SHA3-256.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_256 } from '@awasm/noble';\n * keccak_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ mkHash(mod_keccak_256, def_keccak_256, 'wasm');\n/**\n * keccak-384 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_384 } from '@awasm/noble';\n * keccak_384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ mkHash(mod_keccak_384, def_keccak_384, 'wasm');\n/**\n * keccak-512 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_512 } from '@awasm/noble';\n * keccak_512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ mkHash(mod_keccak_512, def_keccak_512, 'wasm');\n/**\n * SHAKE128 XOF with 128-bit security.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake128 } from '@awasm/noble';\n * shake128(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake128 = /* @__PURE__ */ mkHash(mod_shake128, def_shake128, 'wasm');\n/**\n * SHAKE256 XOF with 256-bit security.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake256 } from '@awasm/noble';\n * shake256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake256 = /* @__PURE__ */ mkHash(mod_shake256, def_shake256, 'wasm');\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake128_32 } from '@awasm/noble';\n * shake128_32(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake128_32 = /* @__PURE__ */ mkHash(mod_shake128_32, def_shake128_32, 'wasm');\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake256_64 } from '@awasm/noble';\n * shake256_64(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake256_64 = /* @__PURE__ */ mkHash(mod_shake256_64, def_shake256_64, 'wasm');\n/**\n * SHA2-224 hash function from RFC 4634\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha224 } from '@awasm/noble';\n * sha224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ mkHash(mod_sha224, def_sha224, 'wasm');\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha256 } from '@awasm/noble';\n * sha256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ mkHash(mod_sha256, def_sha256, 'wasm');\n/**\n * SHA2-384 hash function from RFC 4634.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha384 } from '@awasm/noble';\n * sha384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ mkHash(mod_sha384, def_sha384, 'wasm');\n/**\n * SHA2-512 hash function from RFC 4634.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512 } from '@awasm/noble';\n * sha512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ mkHash(mod_sha512, def_sha512, 'wasm');\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on truncated SHA512.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512_224 } from '@awasm/noble';\n * sha512_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ mkHash(mod_sha512_224, def_sha512_224, 'wasm');\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on truncated SHA512.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512_256 } from '@awasm/noble';\n * sha512_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ mkHash(mod_sha512_256, def_sha512_256, 'wasm');\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha1 } from '@awasm/noble';\n * sha1(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ mkHash(mod_sha1, def_sha1, 'wasm');\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * *\n * *\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { ripemd160 } from '@awasm/noble';\n * ripemd160(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ mkHash(mod_ripemd160, def_ripemd160, 'wasm');\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { md5 } from '@awasm/noble';\n * md5(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ mkHash(mod_md5, def_md5, 'wasm');\n/**\n * blake1-224 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake224 } from '@awasm/noble';\n * blake224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake224 = /* @__PURE__ */ mkHash(mod_blake224, def_blake224, 'wasm');\n/**\n * blake1-256 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake256 } from '@awasm/noble';\n * blake256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake256 = /* @__PURE__ */ mkHash(mod_blake256, def_blake256, 'wasm');\n/**\n * blake1-384 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake384 } from '@awasm/noble';\n * blake384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake384 = /* @__PURE__ */ mkHash(mod_blake384, def_blake384, 'wasm');\n/**\n * blake1-512 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake512 } from '@awasm/noble';\n * blake512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake512 = /* @__PURE__ */ mkHash(mod_blake512, def_blake512, 'wasm');\n/**\n * Blake2s hash function. Focuses on 8-bit to 32-bit platforms.\n * 1.5x faster than blake2b in JS.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake2Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake2s } from '@awasm/noble';\n * blake2s(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake2s = /* @__PURE__ */ mkHash(mod_blake2s, def_blake2s, 'wasm');\n/**\n * Blake2b hash function. 64-bit.\n * 1.5x slower than blake2s in JS.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake2Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake2b } from '@awasm/noble';\n * blake2b(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake2b = /* @__PURE__ */ mkHash(mod_blake2b, def_blake2b, 'wasm');\n/**\n * BLAKE3 hash function. Can be used as MAC and KDF.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake3Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake3 } from '@awasm/noble';\n * const data = new Uint8Array(32);\n * const hash = blake3(data);\n * const mac = blake3(data, { key: new Uint8Array(32) });\n * const kdf = blake3(data, { context: new Uint8Array([1, 2, 3]) });\n * ```\n */\nexport const blake3 = /* @__PURE__ */ mkHash(mod_blake3, def_blake3, 'wasm');\n/**\n * Poly1305 MAC from RFC 8439.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { poly1305 } from '@awasm/noble';\n * poly1305(new Uint8Array([1, 2, 3]), { key: new Uint8Array(32) });\n * ```\n */\nexport const poly1305 = /* @__PURE__ */ mkHash(mod_poly1305, def_poly1305, 'wasm');\n/**\n * GHash MAC for AES-GCM.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { ghash } from '@awasm/noble';\n * ghash(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const ghash = /* @__PURE__ */ mkHash(mod_ghash, def_ghash, 'wasm');\n/**\n * Polyval MAC for AES-SIV.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { polyval } from '@awasm/noble';\n * polyval(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const polyval = /* @__PURE__ */ mkHash(mod_polyval, def_polyval, 'wasm');\n/**\n * AES-CMAC (Cipher-based Message Authentication Code).\n * Specs: RFC 4493.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { cmac } from '@awasm/noble';\n * cmac(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const cmac = /* @__PURE__ */ mkHash(mod_cmac, def_cmac, 'wasm');\n/**\n * CTR (Counter Mode): Turns a block cipher into a stream cipher using a counter and IV (nonce).\n * Efficient and parallelizable. Requires a unique nonce per encryption. Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ctr } from '@awasm/noble';\n * ctr(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const ctr = /* @__PURE__ */ mkCipher(mod_ctr, def_ctr, 'wasm');\n/**\n * CBC (Cipher Block Chaining): Each plaintext block is XORed with the\n * previous block of ciphertext before encryption.\n * Hard to use: requires proper padding and an IV. Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { cbc } from '@awasm/noble';\n * cbc(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const cbc = /* @__PURE__ */ mkCipher(mod_cbc, def_cbc, 'wasm');\n/**\n * OFB mode for AES block cipher.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ofb } from '@awasm/noble';\n * ofb(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const ofb = /* @__PURE__ */ mkCipher(mod_ofb, def_ofb, 'wasm');\n/**\n * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output.\n * Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { cfb } from '@awasm/noble';\n * cfb(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const cfb = /* @__PURE__ */ mkCipher(mod_cfb, def_cfb, 'wasm');\n/**\n * ECB (Electronic Codebook): Deterministic encryption; identical plaintext blocks yield\n * identical ciphertexts. Not secure due to pattern leakage.\n * See AES Penguin.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ecb } from '@awasm/noble';\n * ecb(new Uint8Array(16));\n * ```\n */\nexport const ecb = /* @__PURE__ */ mkCipher(mod_ecb, def_ecb, 'wasm');\n/**\n * GCM (Galois/Counter Mode): Combines CTR mode with polynomial MAC. Efficient and widely used.\n * Not perfect:\n * a) conservative key wear-out is '232' (4B) msgs.\n * b) key wear-out under random nonces is even smaller: '223' (8M) messages for '2-50' chance.\n * c) MAC can be forged: see Poly1305 documentation.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { gcm } from '@awasm/noble';\n * gcm(new Uint8Array(16), new Uint8Array(12));\n * ```\n */\nexport const gcm = /* @__PURE__ */ mkCipher(mod_gcm, def_gcm, 'wasm');\n/**\n * SIV (Synthetic IV): GCM with nonce-misuse resistance.\n * Repeating nonces reveal only the fact plaintexts are identical.\n * Also suffers from GCM issues: key wear-out limits & MAC forging.\n * See RFC 8452.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { gcmsiv } from '@awasm/noble';\n * gcmsiv(new Uint8Array(16), new Uint8Array(12));\n * ```\n */\nexport const gcmsiv = /* @__PURE__ */ mkCipher(mod_gcmsiv, def_gcmsiv, 'wasm');\n/**\n * SIV: Synthetic Initialization Vector (SIV) Authenticated Encryption\n * Nonce is derived from the plaintext and AAD using the S2V function.\n * See RFC 5297.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aessiv } from '@awasm/noble';\n * aessiv(new Uint8Array(32));\n * ```\n */\nexport const aessiv = /* @__PURE__ */ mkCipher(mod_aessiv, def_aessiv, 'wasm');\n/**\n * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times.\n * Reduces block size from 16 to 8 bytes.\n * For padded version, use aeskwp.\n * RFC 3394,\n * NIST.SP.800-38F.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aeskw } from '@awasm/noble';\n * aeskw(new Uint8Array(16));\n * ```\n */\nexport const aeskw = /* @__PURE__ */ mkCipher(mod_aeskw, def_aeskw, 'wasm');\n/**\n * AES-KW, but with padding and allows random keys.\n * Second u32 of IV is used as counter for length.\n * RFC 5649\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aeskwp } from '@awasm/noble';\n * aeskwp(new Uint8Array(16));\n * ```\n */\nexport const aeskwp = /* @__PURE__ */ mkCipher(mod_aeskwp, def_aeskwp, 'wasm');\n/**\n * Salsa20 from original paper. 12-byte nonce.\n * With smaller nonce, it's not safe to make it random (CSPRNG), due to collision chance.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { salsa20 } from '@awasm/noble';\n * salsa20(new Uint8Array(32), new Uint8Array(8));\n * ```\n */\nexport const salsa20 = /* @__PURE__ */ mkCipher(mod_salsa20, def_salsa20, 'wasm');\n/**\n * xsalsa20 eXtended-nonce salsa. With 24-byte nonce, it's safe to make it random (CSPRNG).\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xsalsa20 } from '@awasm/noble';\n * xsalsa20(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xsalsa20 = /* @__PURE__ */ mkCipher(mod_xsalsa20, def_xsalsa20, 'wasm');\n/**\n * Reduced 8-round chacha, described in original paper.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha8 } from '@awasm/noble';\n * chacha8(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha8 = /* @__PURE__ */ mkCipher(mod_chacha8, def_chacha8, 'wasm');\n/**\n * Reduced 12-round chacha, described in original paper.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha12 } from '@awasm/noble';\n * chacha12(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha12 = /* @__PURE__ */ mkCipher(mod_chacha12, def_chacha12, 'wasm');\n/**\n * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter.\n * With smaller nonce, it's not safe to make it random (CSPRNG), due to collision chance.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20 } from '@awasm/noble';\n * chacha20(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha20 = /* @__PURE__ */ mkCipher(mod_chacha20, def_chacha20, 'wasm');\n/**\n * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20orig } from '@awasm/noble';\n * chacha20orig(new Uint8Array(32), new Uint8Array(8));\n * ```\n */\nexport const chacha20orig = /* @__PURE__ */ mkCipher(mod_chacha20orig, def_chacha20orig, 'wasm');\n/**\n * XChaCha eXtended-nonce ChaCha. With 24-byte nonce, it's safe to make it random (CSPRNG).\n * See IRTF draft.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xchacha20 } from '@awasm/noble';\n * xchacha20(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xchacha20 = /* @__PURE__ */ mkCipher(mod_xchacha20, def_xchacha20, 'wasm');\n/**\n * ChaCha20-Poly1305 from RFC 8439.\n * Unsafe to use random nonces under the same key, due to collision chance.\n * Prefer XChaCha instead.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20poly1305 } from '@awasm/noble';\n * chacha20poly1305(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha20poly1305 = /* @__PURE__ */ mkCipher(mod_chacha20poly1305, def_chacha20poly1305, 'wasm');\n/**\n * XChaCha20-Poly1305 extended-nonce chacha.\n * Can be safely used with random nonces (CSPRNG).\n * See IRTF draft.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xchacha20poly1305 } from '@awasm/noble';\n * xchacha20poly1305(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xchacha20poly1305 = /* @__PURE__ */ mkCipher(mod_xchacha20poly1305, def_xchacha20poly1305, 'wasm');\n/**\n * xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa.\n * With 24-byte nonce, it's safe to make it random (CSPRNG).\n * Also known as 'secretbox' from libsodium / nacl.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xsalsa20poly1305 } from '@awasm/noble';\n * xsalsa20poly1305(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xsalsa20poly1305 = /* @__PURE__ */ mkCipher(mod_xsalsa20poly1305, def_xsalsa20poly1305, 'wasm');\n/**\n * Scrypt KDF\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { scrypt } from '@awasm/noble';\n * scrypt('password', 'salt', { N: 16, r: 1, p: 1, dkLen: 32 });\n * ```\n */\nexport const scrypt = /* @__PURE__ */ def_scrypt(mod_scrypt, { sha256 }, 'wasm');\n/**\n * argon2d GPU-resistant version.\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2d } from '@awasm/noble';\n * argon2d('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2d = /* @__PURE__ */ def_argon2d(mod_argon2d, { blake2b }, 'wasm');\n/**\n * argon2i side-channel-resistant version.\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2i } from '@awasm/noble';\n * argon2i('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2i = /* @__PURE__ */ def_argon2i(mod_argon2i, { blake2b }, 'wasm');\n/**\n * argon2id, combining i+d, the most popular version from RFC 9106\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2id } from '@awasm/noble';\n * argon2id('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2id = /* @__PURE__ */ def_argon2id(mod_argon2id, { blake2b }, 'wasm');\n/**\n * Alias to xsalsa20poly1305, for compatibility with libsodium / nacl.\n * Check out for crypto_box.\n *\n * @param key - secret key bytes.\n * @param nonce - nonce bytes.\n * @returns Configured secretbox helper.\n * @example\n * ```ts\n * import { secretbox } from '@awasm/noble';\n * secretbox(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const secretbox = (key, nonce) => {\n const xs = xsalsa20poly1305(key, nonce);\n return { seal: xs.encrypt, open: xs.decrypt };\n};\n", "\nexport const cryption = {\n\tversion: 1,\n\tnonceByteCount: 24,\n\tversionLength: 1,\n\ttagLength: 16,\n}\n\n", "\nimport {Err} from \"./err.js\"\n\nexport class CryptionErr extends Err {}\n\n", "\nimport {bytes} from \"@e280/stz\"\nimport {xchacha20poly1305} from \"@awasm/noble\"\nimport {Secret} from \"./types.js\"\nimport {keyBytes} from \"./key-bytes.js\"\nimport {cryption} from \"./utils/cryption.js\"\nimport {CryptionErr} from \"../errs/cryption-err.js\"\n\nexport function decrypt(secret: Secret, buffer: Uint8Array, aad?: Uint8Array) {\n\tconst minimum = cryption.versionLength + cryption.nonceByteCount + cryption.tagLength\n\n\tif (buffer.length < minimum)\n\t\tthrow new CryptionErr(\"buffer too small\")\n\n\tconst version = buffer.at(0)\n\tconst rest = buffer.slice(1)\n\n\tswitch (version) {\n\t\tcase cryption.version: break\n\t\tdefault: throw new CryptionErr(\"unsupported version\")\n\t}\n\n\tconst nonce = rest.slice(0, cryption.nonceByteCount)\n\tconst ciphertext = rest.slice(cryption.nonceByteCount)\n\tconst authenticated = bytes.concat([\n\t\tnew Uint8Array([version]),\n\t\taad ?? new Uint8Array(),\n\t])\n\n\tconst key = new Uint8Array(keyBytes(secret))\n\tconst cipher = xchacha20poly1305(key, nonce, authenticated)\n\n\treturn cipher.decrypt(ciphertext)\n}\n\n", "\nimport {bytes} from \"@e280/stz\"\nimport {xchacha20poly1305} from \"@awasm/noble\"\nimport {Secret} from \"./types.js\"\nimport {keyBytes} from \"./key-bytes.js\"\nimport {cryption} from \"./utils/cryption.js\"\n\nexport function encrypt(secret: Secret, buffer: Uint8Array, aad?: Uint8Array) {\n\tconst version = new Uint8Array([cryption.version])\n\tconst authenticated = bytes.concat([version, aad ?? new Uint8Array()])\n\tconst nonce = bytes.random(cryption.nonceByteCount)\n\tconst cipher = xchacha20poly1305(keyBytes(secret), nonce, authenticated)\n\tconst ciphertext = cipher.encrypt(buffer)\n\treturn bytes.concat([version, nonce, ciphertext])\n}\n\n", "\nimport {hex} from \"@e280/stz\"\nimport {Secret} from \"./types.js\"\n\n/** generate a secret hex key, 32 bytes, 64 characters */\nexport function generateSecret(): Secret {\n\treturn hex.random(32)\n}\n\n", "\nimport {txt} from \"@e280/stz\"\nimport {blake3} from \"@awasm/noble\"\n\nexport function hash(...parts: (string | Uint8Array)[]) {\n\tconst hasher = blake3.create()\n\n\tfor (const part of parts) {\n\t\tconst bytes = typeof part === \"string\"\n\t\t\t? txt.toBytes(part)\n\t\t\t: part\n\n\t\tconst length = new Uint8Array(4)\n\t\tnew DataView(length.buffer).setUint32(0, bytes.length)\n\n\t\thasher.update(length)\n\t\thasher.update(bytes)\n\t}\n\n\treturn hasher.digest() as Uint8Array\n}\n\n", "\nexport class Phonemes extends Map<number, string> {\n\tindex: Map<string, number>\n\n\tconstructor(array: string[]) {\n\t\tsuper(array.entries())\n\n\t\tthis.index = new Map(\n\t\t\t[...array.entries()]\n\t\t\t\t.map(([index, phoneme]) => [phoneme, index])\n\t\t)\n\t}\n}\n\n", "\nimport {Phonemes} from \"./phonemes.js\"\n\n// inspired by urbit's @p naming system\nexport const prefixes = new Phonemes([\n\t\"nop\", \"bem\", \"bin\", \"bor\", \"buf\", \"cal\", \"cem\", \"cin\", \"cor\", \"cub\", \"dal\", \"dem\", \"din\", \"dor\", \"yol\", \"fal\",\n\t\"fen\", \"fir\", \"fol\", \"fum\", \"gal\", \"gem\", \"gin\", \"gor\", \"gul\", \"hal\", \"hem\", \"hin\", \"hor\", \"hul\", \"kal\", \"kem\",\n\t\"kin\", \"kor\", \"kul\", \"lam\", \"len\", \"lin\", \"lor\", \"lum\", \"mal\", \"men\", \"min\", \"mor\", \"mul\", \"nal\", \"nem\", \"nin\",\n\t\"nor\", \"nul\", \"pal\", \"pem\", \"pin\", \"por\", \"pul\", \"ral\", \"rem\", \"rin\", \"ror\", \"rum\", \"sal\", \"sem\", \"sin\", \"sor\",\n\t\"sun\", \"tal\", \"tem\", \"tin\", \"tor\", \"tul\", \"val\", \"vem\", \"vin\", \"vor\", \"vul\", \"wel\", \"wem\", \"win\", \"wor\", \"mel\",\n\t\"xel\", \"xin\", \"xor\", \"xul\", \"yal\", \"yen\", \"yin\", \"yor\", \"zul\", \"zan\", \"zen\", \"zin\", \"zor\", \"zun\", \"bac\", \"bed\",\n\t\"bod\", \"bun\", \"cad\", \"cog\", \"cus\", \"dab\", \"den\", \"dig\", \"dus\", \"fab\", \"fid\", \"fob\", \"gad\", \"gid\", \"gob\", \"hab\",\n\t\"hid\", \"hob\", \"jab\", \"jid\", \"job\", \"kab\", \"kid\", \"kob\", \"lab\", \"lid\", \"lob\", \"mab\", \"mid\", \"mob\", \"nab\", \"nid\",\n\t\"nob\", \"pab\", \"pid\", \"pob\", \"rab\", \"rid\", \"rob\", \"sab\", \"sid\", \"sob\", \"tab\", \"tid\", \"tob\", \"vab\", \"vid\", \"vob\",\n\t\"wab\", \"wid\", \"wob\", \"yab\", \"yid\", \"yob\", \"zab\", \"zid\", \"zob\", \"bar\", \"bel\", \"bol\", \"bur\", \"car\", \"cel\", \"col\",\n\t\"cur\", \"dar\", \"del\", \"dol\", \"dur\", \"far\", \"fel\", \"fur\", \"gar\", \"gel\", \"gol\", \"gur\", \"har\", \"hel\", \"hol\", \"bag\",\n\t\"bob\", \"jar\", \"jel\", \"jol\", \"jur\", \"kar\", \"kel\", \"kol\", \"kur\", \"lar\", \"lel\", \"lol\", \"lur\", \"mar\", \"bef\", \"mol\",\n\t\"mur\", \"nar\", \"nel\", \"nol\", \"nur\", \"par\", \"pel\", \"pol\", \"pur\", \"rar\", \"rel\", \"rol\", \"rur\", \"sar\", \"sel\", \"sol\",\n\t\"sur\", \"tar\", \"tel\", \"tol\", \"tur\", \"var\", \"vel\", \"vol\", \"vur\", \"war\", \"wol\", \"wur\", \"yar\", \"yel\", \"ded\", \"yur\",\n\t\"zar\", \"zel\", \"zol\", \"zur\", \"bam\", \"ban\", \"bat\", \"cam\", \"can\", \"cat\", \"dam\", \"dan\", \"dat\", \"fam\", \"fan\", \"ter\",\n\t\"ham\", \"han\", \"hat\", \"jam\", \"jan\", \"jat\", \"kam\", \"kan\", \"kat\", \"lan\", \"lat\", \"mam\", \"man\", \"mat\", \"wex\", \"wix\",\n])\n\n", "\nimport {Phonemes} from \"./phonemes.js\"\n\n// inspired by urbit's @p naming system\nexport const suffixes = new Phonemes([\n\t\"nop\", \"ryx\", \"rux\", \"rak\", \"ruk\", \"rad\", \"ren\", \"ryd\", \"zex\", \"zyx\", \"zok\", \"bob\", \"zud\", \"zen\", \"zyn\", \"lax\",\n\t\"nox\", \"max\", \"dax\", \"rax\", \"kex\", \"ken\", \"kyn\", \"kor\", \"kur\", \"kad\", \"ker\", \"ked\", \"kaz\", \"kez\", \"lek\", \"lex\",\n\t\"lyx\", \"lur\", \"lan\", \"len\", \"lod\", \"lum\", \"myn\", \"myr\", \"mox\", \"mux\", \"mak\", \"med\", \"nek\", \"nyx\", \"nor\", \"nex\",\n\t\"nux\", \"nod\", \"nur\", \"pak\", \"pex\", \"pyr\", \"pyx\", \"rex\", \"sak\", \"syd\", \"syr\", \"tek\", \"tyx\", \"tux\", \"tor\", \"tur\",\n\t\"vek\", \"vex\", \"vyr\", \"vox\", \"wex\", \"wyn\", \"wyr\", \"wux\", \"nyl\", \"yex\", \"yod\", \"yux\", \"zor\", \"zyl\", \"wok\", \"bex\",\n\t\"bry\", \"bur\", \"car\", \"coy\", \"cry\", \"cur\", \"dar\", \"dex\", \"dyr\", \"dur\", \"far\", \"fex\", \"fyr\", \"fur\", \"gar\", \"gex\",\n\t\"gyr\", \"gur\", \"har\", \"hex\", \"het\", \"hur\", \"jox\", \"jex\", \"ray\", \"rey\", \"kar\", \"kyr\", \"lar\", \"lyr\", \"mar\", \"mex\",\n\t\"mur\", \"nar\", \"par\", \"pur\", \"rar\", \"raz\", \"roy\", \"sar\", \"sur\", \"tar\", \"tex\", \"tyr\", \"var\", \"vur\", \"war\", \"wur\",\n\t\"yar\", \"yer\", \"yur\", \"zar\", \"zop\", \"zur\", \"bak\", \"bok\", \"buk\", \"dak\", \"dek\", \"dok\", \"duk\", \"fek\", \"fok\", \"gak\",\n\t\"gek\", \"gok\", \"hak\", \"hek\", \"hok\", \"koy\", \"key\", \"kay\", \"kak\", \"kek\", \"kel\", \"lak\", \"lok\", \"mek\", \"mok\", \"nak\",\n\t\"nok\", \"pek\", \"pok\", \"rek\", \"rok\", \"sek\", \"sok\", \"tak\", \"tok\", \"vak\", \"vok\", \"wak\", \"wek\", \"yak\", \"yek\", \"yok\",\n\t\"vyk\", \"vyx\", \"wyk\", \"wyx\", \"mer\", \"yax\", \"mac\", \"bek\", \"bax\", \"hax\", \"dox\", \"fox\", \"fyx\", \"gyn\", \"gyx\", \"hon\",\n\t\"hop\", \"jan\", \"jeb\", \"kan\", \"kog\", \"lyk\", \"myk\", \"myx\", \"nyk\", \"pyk\", \"ryk\", \"syk\", \"syx\", \"tyk\", \"vod\", \"wyd\",\n\t\"dyd\", \"zan\", \"zer\", \"yen\", \"yew\", \"zyd\", \"byd\", \"byr\", \"dyb\", \"fyd\", \"gyd\", \"hen\", \"red\", \"lyd\", \"myd\", \"daz\",\n\t\"nyd\", \"pyd\", \"tyd\", \"vyn\", \"zek\", \"byn\", \"dyn\", \"fyn\", \"gen\", \"lyn\", \"nyn\", \"ryn\", \"syn\", \"tyn\", \"myl\", \"bef\",\n\t\"lyt\", \"wyz\", \"wuk\", \"kax\", \"sax\", \"kew\", \"wen\", \"ryt\", \"tyv\", \"kon\", \"ryz\", \"zad\", \"tyz\", \"vuz\", \"ron\", \"rez\",\n])\n\n", "\nimport {need} from \"@e280/stz\"\nimport {prefixes} from \"./prefixes.js\"\nimport {suffixes} from \"./suffixes.js\"\n\nexport function *wordsFromBytes(buffer: Iterable<number>) {\n\tfor (const [a, b] of pairwise(buffer))\n\t\tyield wordFromPair(a, b)\n}\n\nexport function *wordsToBytes(motes: Iterable<string>) {\n\tfor (const mote of motes) {\n\t\tconst [a, b] = wordToPair(mote)\n\t\tyield a\n\t\tyield b\n\t}\n}\n\nexport function wordFromPair(a: number, b: number) {\n\treturn need(prefixes, a) + need(suffixes, b)\n}\n\nexport function wordToPair(mote: string) {\n\tconst prefix = mote.slice(0, 3)\n\tconst suffix = mote.slice(3, 6)\n\treturn [\n\t\tneed(prefixes.index, prefix),\n\t\tneed(suffixes.index, suffix),\n\t] as [number, number]\n}\n\nfunction *pairwise(buffer: Iterable<number>) {\n\tlet a: number | null = null\n\n\tfor (const byte of buffer) {\n\t\tif (a === null) a = byte\n\t\telse {\n\t\t\tyield [a, byte] as [number, number]\n\t\t\ta = null\n\t\t}\n\t}\n}\n\n", "\nimport {base58} from \"@e280/stz\"\nimport {hash} from \"../../cryp/hash.js\"\nimport {keyBytes} from \"../../cryp/key-bytes.js\"\nimport {delimiter, addrByteSize} from \"./utils/options.js\"\nimport {wordsFromBytes} from \"../phonemes/words.js\"\n\n/** convert a hex id into an address string, looks like `gurkon_bodwyx_6xbtp7e6EWrUNGNavzF9MnuuerYcEDpEtmKoPVioXG8P` */\nexport function address(id: string) {\n\tconst b = keyBytes(id)\n\tif (b.length !== 32) throw new Error(`invalid id length expected 32, got ${b.length} from ${id} ${id.length}`)\n\n\tconst checksum = hash(id).slice(0, addrByteSize)\n\tconst addr = [...wordsFromBytes(checksum)].join(delimiter)\n\tconst bulk = base58.fromBytes(b)\n\n\treturn addr + delimiter + bulk\n}\n\n", "\nimport {hash} from \"../../cryp/hash.js\"\n\n/** derive a color from a hex id */\nexport function addressColor(id: string) {\n\tconst [a, b] = [...hash(\"color\", id)]\n\tconst hue = ((a / 255) * 360).toFixed(2)\n\tconst chroma = ((b / 255) * 0.2).toFixed(2)\n\treturn `oklch(0.8 ${chroma} ${hue})`\n}\n\n", "\nexport const emojis = [\n\t\"\uD83D\uDC35\",\n\t\"\uD83D\uDC12\",\n\t\"\uD83E\uDD8D\",\n\t\"\uD83E\uDDA7\",\n\t\"\uD83D\uDC36\",\n\t\"\uD83D\uDC15\",\n\t\"\uD83E\uDDAE\",\n\t\"\uD83D\uDC15\u200D\uD83E\uDDBA\",\n\t\"\uD83D\uDC29\",\n\t\"\uD83D\uDC3A\",\n\t\"\uD83E\uDD8A\",\n\t\"\uD83E\uDD9D\",\n\t\"\uD83D\uDC31\",\n\t\"\uD83D\uDC08\",\n\t\"\uD83D\uDC08\u200D\u2B1B\",\n\t\"\uD83E\uDD81\",\n\t\"\uD83D\uDC2F\",\n\t\"\uD83D\uDC05\",\n\t\"\uD83D\uDC06\",\n\t\"\uD83D\uDC34\",\n\t\"\uD83E\uDECE\",\n\t\"\uD83E\uDECF\",\n\t\"\uD83D\uDC0E\",\n\t\"\uD83E\uDD84\",\n\t\"\uD83E\uDD93\",\n\t\"\uD83E\uDD8C\",\n\t\"\uD83E\uDDAC\",\n\t\"\uD83D\uDC2E\",\n\t\"\uD83D\uDC02\",\n\t\"\uD83D\uDC03\",\n\t\"\uD83D\uDC04\",\n\t\"\uD83D\uDC37\",\n\t\"\uD83D\uDC16\",\n\t\"\uD83D\uDC17\",\n\t\"\uD83D\uDC3D\",\n\t\"\uD83D\uDC0F\",\n\t\"\uD83D\uDC11\",\n\t\"\uD83D\uDC10\",\n\t\"\uD83D\uDC2A\",\n\t\"\uD83D\uDC2B\",\n\t\"\uD83E\uDD99\",\n\t\"\uD83E\uDD92\",\n\t\"\uD83D\uDC18\",\n\t\"\uD83E\uDDA3\",\n\t\"\uD83E\uDD8F\",\n\t\"\uD83E\uDD9B\",\n\t\"\uD83D\uDC2D\",\n\t\"\uD83D\uDC01\",\n\t\"\uD83D\uDC00\",\n\t\"\uD83D\uDC39\",\n\t\"\uD83D\uDC30\",\n\t\"\uD83D\uDC07\",\n\t\"\uD83D\uDC3F\uFE0F\",\n\t\"\uD83E\uDDAB\",\n\t\"\uD83E\uDD94\",\n\t\"\uD83E\uDD87\",\n\t\"\uD83D\uDC3B\",\n\t\"\uD83D\uDC3B\u200D\u2744\uFE0F\",\n\t\"\uD83D\uDC28\",\n\t\"\uD83D\uDC3C\",\n\t\"\uD83E\uDDA5\",\n\t\"\uD83E\uDDA6\",\n\t\"\uD83E\uDDA8\",\n\t\"\uD83E\uDD98\",\n\t\"\uD83E\uDDA1\",\n\t\"\uD83D\uDC3E\",\n\t\"\uD83E\uDD83\",\n\t\"\uD83D\uDC14\",\n\t\"\uD83D\uDC13\",\n\t\"\uD83D\uDC23\",\n\t\"\uD83D\uDC24\",\n\t\"\uD83D\uDC25\",\n\t\"\uD83D\uDC26\",\n\t\"\uD83D\uDC27\",\n\t\"\uD83D\uDD4A\uFE0F\",\n\t\"\uD83E\uDD85\",\n\t\"\uD83E\uDD86\",\n\t\"\uD83E\uDDA2\",\n\t\"\uD83E\uDD89\",\n\t\"\uD83E\uDDA4\",\n\t\"\uD83E\uDEB6\",\n\t\"\uD83E\uDDA9\",\n\t\"\uD83E\uDD9A\",\n\t\"\uD83E\uDD9C\",\n\t\"\uD83E\uDEBD\",\n\t\"\uD83D\uDC26\u200D\u2B1B\",\n\t\"\uD83E\uDEBF\",\n\t\"\uD83D\uDC26\u200D\uD83D\uDD25\",\n\t\"\uD83D\uDC38\",\n\t\"\uD83D\uDC0A\",\n\t\"\uD83D\uDC22\",\n\t\"\uD83E\uDD8E\",\n\t\"\uD83D\uDC0D\",\n\t\"\uD83D\uDC32\",\n\t\"\uD83D\uDC09\",\n\t\"\uD83E\uDD95\",\n\t\"\uD83E\uDD96\",\n\t\"\uD83D\uDC33\",\n\t\"\uD83D\uDC0B\",\n\t\"\uD83D\uDC2C\",\n\t\"\uD83E\uDECD\",\n\t\"\uD83E\uDDAD\",\n\t\"\uD83D\uDC1F\",\n\t\"\uD83D\uDC20\",\n\t\"\uD83D\uDC21\",\n\t\"\uD83E\uDD88\",\n\t\"\uD83D\uDC19\",\n\t\"\uD83D\uDC1A\",\n\t\"\uD83E\uDEB8\",\n\t\"\uD83E\uDEBC\",\n\t\"\uD83E\uDD80\",\n\t\"\uD83E\uDD9E\",\n\t\"\uD83E\uDD90\",\n\t\"\uD83E\uDD91\",\n\t\"\uD83E\uDDAA\",\n\t\"\uD83D\uDC0C\",\n\t\"\uD83E\uDD8B\",\n\t\"\uD83D\uDC1B\",\n\t\"\uD83D\uDC1C\",\n\t\"\uD83D\uDC1D\",\n\t\"\uD83E\uDEB2\",\n\t\"\uD83D\uDC1E\",\n\t\"\uD83E\uDD97\",\n\t\"\uD83E\uDEB3\",\n\t\"\uD83D\uDD77\uFE0F\",\n\t\"\uD83D\uDD78\uFE0F\",\n\t\"\uD83E\uDD82\",\n\t\"\uD83E\uDD9F\",\n\t\"\uD83E\uDEB0\",\n\t\"\uD83E\uDEB1\",\n\t\"\uD83E\uDDA0\",\n\t\"\uD83D\uDE3A\",\n\t\"\uD83D\uDE38\",\n\t\"\uD83D\uDE39\",\n\t\"\uD83D\uDE3B\",\n\t\"\uD83D\uDE3C\",\n\t\"\uD83D\uDE3D\",\n\t\"\uD83D\uDE40\",\n\t\"\uD83D\uDE3F\",\n\t\"\uD83D\uDE3E\",\n\t\"\uD83D\uDE48\",\n\t\"\uD83D\uDE49\",\n\t\"\uD83D\uDE4A\",\n\t\"\uD83D\uDE00\",\n\t\"\uD83D\uDE03\",\n\t\"\uD83D\uDE04\",\n\t\"\uD83D\uDE01\",\n\t\"\uD83D\uDE06\",\n\t\"\uD83D\uDE05\",\n\t\"\uD83E\uDD23\",\n\t\"\uD83D\uDE02\",\n\t\"\uD83D\uDE42\",\n\t\"\uD83D\uDE43\",\n\t\"\uD83E\uDEE0\",\n\t\"\uD83D\uDE09\",\n\t\"\uD83D\uDE0A\",\n\t\"\uD83D\uDE07\",\n\t\"\uD83E\uDD70\",\n\t\"\uD83D\uDE0D\",\n\t\"\uD83E\uDD29\",\n\t\"\uD83D\uDE18\",\n\t\"\uD83D\uDE17\",\n\t\"\u263A\uFE0F\",\n\t\"\uD83D\uDE1A\",\n\t\"\uD83D\uDE19\",\n\t\"\uD83E\uDD72\",\n\t\"\uD83D\uDE0B\",\n\t\"\uD83D\uDE1B\",\n\t\"\uD83D\uDE1C\",\n\t\"\uD83E\uDD2A\",\n\t\"\uD83D\uDE1D\",\n\t\"\uD83E\uDD11\",\n\t\"\uD83E\uDD17\",\n\t\"\uD83E\uDD2D\",\n\t\"\uD83E\uDEE2\",\n\t\"\uD83E\uDEE3\",\n\t\"\uD83E\uDD2B\",\n\t\"\uD83E\uDD14\",\n\t\"\uD83E\uDEE1\",\n\t\"\uD83E\uDD20\",\n\t\"\uD83E\uDD73\",\n\t\"\uD83E\uDD78\",\n\t\"\uD83D\uDE0E\",\n\t\"\uD83E\uDD13\",\n\t\"\uD83E\uDDD0\",\n\t\"\uD83D\uDCA9\",\n\t\"\uD83E\uDD21\",\n\t\"\uD83D\uDC79\",\n\t\"\uD83D\uDC7A\",\n\t\"\uD83D\uDC7B\",\n\t\"\uD83D\uDC7D\",\n\t\"\uD83D\uDC7E\",\n\t\"\uD83E\uDD16\",\n\t\"\uD83E\uDD10\",\n\t\"\uD83E\uDD28\",\n\t\"\uD83D\uDE36\u200D\uD83C\uDF2B\uFE0F\",\n\t\"\uD83D\uDE0F\",\n\t\"\uD83D\uDE12\",\n\t\"\uD83D\uDE44\",\n\t\"\uD83D\uDE2C\",\n\t\"\uD83D\uDE2E\u200D\uD83D\uDCA8\",\n\t\"\uD83E\uDD25\",\n\t\"\uD83E\uDEE8\",\n\t\"\uD83D\uDE42\u200D\u2194\uFE0F\",\n\t\"\uD83D\uDE42\u200D\u2195\uFE0F\",\n\t\"\uD83D\uDE37\",\n\t\"\uD83E\uDD12\",\n\t\"\uD83E\uDD15\",\n\t\"\uD83E\uDD22\",\n\t\"\uD83E\uDD2E\",\n\t\"\uD83E\uDD27\",\n\t\"\uD83E\uDD75\",\n\t\"\uD83E\uDD76\",\n\t\"\uD83E\uDD74\",\n\t\"\uD83D\uDE35\",\n\t\"\uD83D\uDE35\u200D\uD83D\uDCAB\",\n\t\"\uD83E\uDD2F\",\n\t\"\uD83D\uDE15\",\n\t\"\uD83E\uDEE4\",\n\t\"\uD83D\uDE1F\",\n\t\"\uD83D\uDE41\",\n\t\"\u2639\uFE0F\",\n\t\"\uD83D\uDE2E\",\n\t\"\uD83D\uDE2F\",\n\t\"\uD83D\uDE32\",\n\t\"\uD83D\uDE33\",\n\t\"\uD83E\uDEEA\",\n\t\"\uD83E\uDD7A\",\n\t\"\uD83E\uDD79\",\n\t\"\uD83D\uDE26\",\n\t\"\uD83D\uDE27\",\n\t\"\uD83D\uDE28\",\n\t\"\uD83D\uDE30\",\n\t\"\uD83D\uDE25\",\n\t\"\uD83D\uDE22\",\n\t\"\uD83D\uDE2D\",\n\t\"\uD83D\uDE31\",\n\t\"\uD83D\uDE16\",\n\t\"\uD83D\uDE23\",\n\t\"\uD83D\uDE1E\",\n\t\"\uD83D\uDE13\",\n\t\"\uD83D\uDE29\",\n\t\"\uD83D\uDE2B\",\n\t\"\uD83E\uDD71\",\n\t\"\uD83D\uDE24\",\n\t\"\uD83D\uDE21\",\n\t\"\uD83D\uDE20\",\n\t\"\uD83E\uDD2C\",\n\t\"\uD83D\uDE08\",\n\t\"\uD83D\uDC7F\",\n\t\"\uD83D\uDC80\",\n\t\"\u2620\uFE0F\",\n\t\"\uD83D\uDE0C\",\n\t\"\uD83E\uDD24\",\n\t\"\uD83D\uDE34\",\n\t\"\uD83E\uDEE9\",\n]\n\n", "\nimport {got} from \"@e280/stz\"\nimport {hash} from \"../../cryp/hash.js\"\nimport {emojis} from \"../emojis/emojis.js\"\n\n/** derive an emoji from a hex id */\nexport function addressEmoji(id: string) {\n\tconst byte = got(hash(\"emoji\", id).at(0))\n\treturn emojis.at(byte)\n}\n\n", "\nimport {address} from \"./address.js\"\n\n/** convert a hex id into a truncated address string, looks like `gurkon_bodwyx` */\nexport function addressMoniker(id: string) {\n\treturn address(id).slice(0, 13)\n}\n\n", "\nimport {Proof} from \"./types.js\"\nimport {Payload} from \"../../tok/types.js\"\nimport {decodeToken} from \"../../tok/decode-token.js\"\n\nexport function decodeProof(token: string) {\n\treturn decodeToken<Payload<{proof: Proof}>>(token).payload.proof\n}\n\n", "\nimport {consts} from \"../../../consts.js\"\nimport {Session} from \"../types/session.js\"\nimport {verifyDelegate} from \"../../core/alco/delegate/verify.js\"\n\nexport function isSessionValid(\n\t\tsession: Session,\n\t\tappOrigin = window.location.origin,\n\t) {\n\n\ttry {\n\t\tconst auth = verifyDelegate(session.auth, {\n\t\t\tallowedAudiences: [appOrigin],\n\t\t\tallowedPurposes: [consts.purposes.auth],\n\t\t})\n\n\t\tconst crypt = verifyDelegate(session.crypt, {\n\t\t\tallowedAudiences: [appOrigin],\n\t\t\tallowedPurposes: [consts.purposes.crypt],\n\t\t})\n\n\t\treturn auth.proof.id === crypt.proof.id\n\t}\n\tcatch (error) {\n\t\tconsole.error(error)\n\t\treturn false\n\t}\n}\n\n", "\nimport {Session} from \"./types/session.js\"\nimport {encrypt} from \"../core/cryp/encrypt.js\"\nimport {decrypt} from \"../core/cryp/decrypt.js\"\nimport {tokenTime} from \"../core/tok/token-time.js\"\nimport {signClaim} from \"../core/alco/claim/sign.js\"\nimport {decodeProof} from \"../core/alco/proof/decode.js\"\nimport {isSessionValid} from \"./parts/is-session-valid.js\"\nimport {ClaimOptions} from \"../core/alco/claim/types/options.js\"\n\nexport class User {\n\t#proof\n\n\tconstructor(public readonly session: Session) {\n\t\tthis.#proof = decodeProof(session.auth.proofToken)\n\t}\n\n\t/** user's public id, in hex (eg, \"cd967edd1a3a82e142faa5003eda67d167a2b5f76d0e97e8158defe59e2a2c89\"). */\n\tget id() {\n\t\treturn this.#proof.id\n\t}\n\n\t/** user's public nickname (eg, \"Gandalf the Gray\"). */\n\tget alias() {\n\t\treturn this.session.auth.alias\n\t}\n\n\t/** stable private key for end-to-end encryption purposes (eg, \"34631de533fd0b5dc627fda139d6190556b330a74b521d0d7c590990abd53aee\"). */\n\tget cryptSecret() {\n\t\treturn this.session.crypt.secret\n\t}\n\n\t/** time when this session expires in js milliseconds. */\n\tget expiresAt() {\n\t\treturn tokenTime.readExpiresAt(this.session.auth.proofToken)\n\t}\n\n\t/** return true if this user session is currently valid. */\n\tget valid() {\n\t\treturn isSessionValid(this.session)\n\t}\n\n\t/** encrypt data with the crypt delegate secret. */\n\tencrypt(buffer: Uint8Array, aad?: Uint8Array) {\n\t\treturn encrypt(this.session.crypt.secret, buffer, aad)\n\t}\n\n\t/** decrypt data with the crypt delegate secret. */\n\tdecrypt(ciphertext: Uint8Array, aad?: Uint8Array) {\n\t\treturn decrypt(this.session.crypt.secret, ciphertext, aad)\n\t}\n\n\t/** sign a claim token on behalf of the user (with the auth delegate). */\n\tsignClaim<X>(data: X, options: ClaimOptions = {}) {\n\t\treturn signClaim(this.session.auth, data, options)\n\t}\n}\n\n", "\nimport {consts} from \"../../../consts.js\"\nimport {Petition} from \"../../core/alco/delegate/types.js\"\nimport {SessionOptions} from \"../types/session-options.js\"\nimport {generateSecret} from \"../../core/cryp/generate-secret.js\"\n\nexport function sessionPetitions({\n\t\texpiresAt = Date.now() + consts.standardLifespan,\n\t\tcryptScope = consts.standardCryptScope,\n\t}: Partial<SessionOptions>): Petition[] {\n\n\treturn [\n\t\t{purpose: consts.purposes.auth, scope: generateSecret(), expiresAt},\n\t\t{purpose: consts.purposes.crypt, scope: cryptScope},\n\t]\n}\n\n", "\nimport {got} from \"@e280/stz\"\n\nexport function openPopup(target: string, url: string) {\n\tconst width = 700\n\tconst height = 800\n\n\tconst centerX = window.screenX + (window.outerWidth / 2)\n\tconst centerY = window.screenY + (window.outerHeight / 2)\n\n\tconst left = centerX - (width / 2)\n\tconst top = centerY - (height / 2)\n\n\tconst features = [\n\t\t`width=${width}`,\n\t\t`height=${height}`,\n\t\t`left=${left}`,\n\t\t`top=${top}`,\n\t\t`resizable=yes`,\n\t\t`scrollbars=yes`,\n\t].join(\",\")\n\n\treturn got(window.open(url, target, features), \"failed to open popup\")\n}\n\n", "\nexport class RemoteError extends Error {}\n\nexport class ExposedError extends Error {}\n\n", "\nimport {dig, err, ok} from \"@e280/stz\"\nimport {ExposedError} from \"./errors.js\"\nimport {Endpoint, Fn, Fns} from \"./types.js\"\n\nexport function makeEndpoint(fns: Fns): Endpoint {\n\treturn async([path, ...params]) => {\n\t\tconst fnResult = dig<Fn>(fns, path)\n\n\t\tif (!fnResult.ok)\n\t\t\treturn err(\"not found\")\n\n\t\ttry {\n\t\t\tconst fn = fnResult.value\n\t\t\tconst value = await fn(...params)\n\t\t\treturn ok(value)\n\t\t}\n\t\tcatch (error) {\n\t\t\treturn (error instanceof ExposedError)\n\t\t\t\t? err(error.message)\n\t\t\t\t: err(\"error\")\n\t\t}\n\t}\n}\n\n", "\nimport {RemoteError} from \"./errors.js\"\nimport {Endpoint, Fns, Remote} from \"./types.js\"\n\nexport function makeRemote<F extends Fns>(endpoint: Endpoint) {\n\tfunction makeProxy(endpoint: Endpoint, path: string[]) {\n\t\treturn new Proxy(() => {}, {\n\t\t\tget(_target, key) {\n\t\t\t\tif (typeof key !== \"string\" || key === \"then\")\n\t\t\t\t\treturn undefined\n\t\t\t\treturn makeProxy(endpoint, [...path, key])\n\t\t\t},\n\n\t\t\tasync apply(_target, _thisArg, params) {\n\t\t\t\tconst result = await endpoint([path, ...params])\n\t\t\t\tif (!result.ok)\n\t\t\t\t\tthrow new RemoteError(result.error)\n\t\t\t\treturn result.value\n\t\t\t},\n\t\t})\n\t}\n\n\treturn makeProxy(endpoint, []) as any as Remote<F>\n}\n\n", "\nimport {Call, Ret} from \"../base/types.js\"\n\nexport enum MessageKind {Request, Response}\nexport type Request = [kind: MessageKind.Request, id: number, call: Call]\nexport type Response = [kind: MessageKind.Response, id: number, ret: Ret]\nexport type Message = Request | Response\n\n", "\nimport {defer, Deferred, err, errorString, nap} from \"@e280/stz\"\nimport {Fns, Ret} from \"../base/types.js\"\nimport {defaultTimeout} from \"./consts.js\"\nimport {makeRemote} from \"../base/remote.js\"\nimport {makeEndpoint} from \"../base/endpoint.js\"\nimport {Request, Message, MessageKind, Response} from \"./types.js\"\n\n/** bidirectional messenger */\nexport class Messenger<RemoteFns extends Fns> {\n\t#id = 0\n\t#localEndpoint\n\t#pending = new Map<number, Deferred<Ret>>()\n\n\tconstructor(private options: {\n\t\t\tsend: (msg: Message) => void\n\t\t\tfns?: Fns\n\t\t\ttimeout?: number\n\t\t}) {\n\t\tthis.#localEndpoint = makeEndpoint(options.fns ?? {})\n\t}\n\n\tremote = makeRemote<RemoteFns>(async call => {\n\t\tconst id = this.#id++\n\t\tconst deferred = defer<Ret>()\n\t\tthis.#pending.set(id, deferred)\n\t\tconst timeout = this.options.timeout ?? defaultTimeout\n\t\tif (timeout !== Infinity)\n\t\t\tnap(timeout).then(() => {\n\t\t\t\tconst deferred = this.#pending.get(id)\n\t\t\t\tif (deferred) {\n\t\t\t\t\tthis.#pending.delete(id)\n\t\t\t\t\tdeferred.resolve(err(\"timed out\"))\n\t\t\t\t}\n\t\t\t})\n\t\ttry {\n\t\t\tthis.options.send([MessageKind.Request, id, call])\n\t\t}\n\t\tcatch (error) {\n\t\t\tthis.#pending.delete(id)\n\t\t\tdeferred.resolve(err(errorString(error, \"send failed\")))\n\t\t}\n\t\treturn deferred.promise\n\t})\n\n\trecv = async(msg: Message) => {\n\t\tswitch (msg[0]) {\n\t\t\tcase MessageKind.Request: return this.#recvCall(msg)\n\t\t\tcase MessageKind.Response: return this.#recvRet(msg)\n\t\t}\n\t}\n\n\tasync #recvCall([, id, call]: Request) {\n\t\tconst ret = await this.#localEndpoint(call)\n\t\tthis.options.send([MessageKind.Response, id, ret])\n\t}\n\n\tasync #recvRet([, id, ret]: Response) {\n\t\tconst pending = this.#pending.get(id)\n\t\tif (pending) {\n\t\t\tthis.#pending.delete(id)\n\t\t\tpending.resolve(ret)\n\t\t}\n\t}\n}\n\n", "\nimport {is} from \"@e280/stz\"\n\nexport const noTransfer = () => undefined\n\nexport function makeAutoTransfer(shouldTransfer: (x: unknown) => boolean) {\n\treturn (tree: unknown) => auto_transfer_algo(tree, shouldTransfer)\n}\n\nfunction auto_transfer_algo(\n\t\ttree: unknown,\n\t\tshouldTransfer: (x: unknown) => boolean,\n\t): Transferable[] {\n\n\tconst transfers = new Set<Transferable>()\n\tconst seen = new WeakSet<object>()\n\n\tfunction visit(x: unknown) {\n\t\tif (!is.object(x)) return\n\t\tif (seen.has(x)) return\n\t\tseen.add(x)\n\n\t\tif (shouldTransfer(x)) {\n\t\t\ttransfers.add(x)\n\t\t\treturn\n\t\t}\n\n\t\tif (ArrayBuffer.isView(x) && shouldTransfer(x.buffer)) {\n\t\t\ttransfers.add(x.buffer as ArrayBuffer)\n\t\t\treturn\n\t\t}\n\n\t\tif (x instanceof Map) {\n\t\t\tfor (const [key, value] of x) {\n\t\t\t\tvisit(key)\n\t\t\t\tvisit(value)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tif (x instanceof Set) {\n\t\t\tfor (const value of x)\n\t\t\t\tvisit(value)\n\t\t\treturn\n\t\t}\n\n\t\tfor (const value of Object.values(x))\n\t\t\tvisit(value)\n\t}\n\n\tvisit(tree)\n\treturn [...transfers]\n}\n\n", "\nimport {Fns} from \"../base/types.js\"\nimport {AutoTransfer, Port} from \"./types.js\"\nimport {Messenger} from \"../messenger/messenger.js\"\n\nexport class Portal<RemoteFns extends Fns> {\n\tclose\n\t#messenger\n\n\tconstructor({port, autoTransfer, fns, timeout}: {\n\t\t\tport: Port,\n\t\t\tautoTransfer: AutoTransfer,\n\t\t\tfns?: Fns,\n\t\t\ttimeout?: number,\n\t\t}) {\n\n\t\tthis.#messenger = new Messenger<RemoteFns>({\n\t\t\tfns,\n\t\t\ttimeout,\n\t\t\tsend: msg => port.postMessage(msg, autoTransfer(msg)),\n\t\t})\n\n\t\tport.addEventListener(\"message\", event => this.#messenger.recv(event.data))\n\t\tport.start()\n\t\tthis.close = () => port.close()\n\t}\n\n\tget remote() {\n\t\treturn this.#messenger.remote\n\t}\n}\n\n", "\nexport const portOffer = \"port_offer\"\nexport const portAccepted = \"port_accepted\"\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {portAccepted, portOffer} from \"./consts.js\"\n\nexport function recvPorts({topic, from, fromOrigin, onPort}: {\n\t\ttopic: string\n\t\tfrom: Window | WindowProxy\n\t\tfromOrigin: string\n\t\tonPort: (port: MessagePort) => void\n\t}) {\n\n\treturn ev(globalThis, {message: (event: MessageEvent) => {\n\t\tif (\n\t\t\tevent.source === from &&\n\t\t\tevent.origin === fromOrigin &&\n\t\t\tevent.data?.kind === portOffer &&\n\t\t\tevent.data.topic === topic\n\t\t) {\n\t\t\tconst [port] = event.ports\n\t\t\tconst id = event.data?.id\n\t\t\tfrom.postMessage(\n\t\t\t\t{kind: portAccepted, topic, id},\n\t\t\t\t{targetOrigin: fromOrigin},\n\t\t\t)\n\t\t\tonPort(port)\n\t\t}\n\t}})\n}\n\n", "\nimport {is} from \"@e280/stz\"\nimport {makeAutoTransfer} from \"../core/portal/auto-transfer.js\"\n\nexport const webAutoTransfer = makeAutoTransfer(\n\t(x: unknown) => is.object(x) && [\n\t\twindow.ArrayBuffer,\n\t\twindow.MessagePort,\n\t\twindow.ImageBitmap,\n\t\twindow.OffscreenCanvas,\n\n\t\twindow.AudioData,\n\t\twindow.VideoFrame,\n\t\twindow.MediaSourceHandle,\n\t\twindow.MediaStreamTrack,\n\t\twindow.MIDIAccess,\n\t\twindow.RTCDataChannel,\n\n\t\twindow.ReadableStream,\n\t\twindow.WritableStream,\n\t\twindow.TransformStream,\n\t].filter(is.happy).some(Thing => x instanceof Thing)\n)\n\n", "\nimport {defer} from \"@e280/stz\"\nimport {Portal} from \"@e280/renraku\"\nimport {recvPorts, webAutoTransfer} from \"@e280/renraku/web\"\nimport {DelegatorApi} from \"./types.js\"\nimport {consts} from \"../../../consts.js\"\nimport {Delegate, Petition} from \"../../core/alco/delegate/types.js\"\n\nexport async function askForDelegates(\n\t\tpopup: Window,\n\t\tdelegatorOrigin: string,\n\t\tpetitions: Petition[],\n\t) {\n\n\tconst deferred = defer<Delegate[]>()\n\n\tconst stop = recvPorts({\n\t\tfrom: popup,\n\t\tfromOrigin: delegatorOrigin,\n\t\ttopic: consts.namespace,\n\t\tonPort: port => {\n\t\t\tconst portal = new Portal<DelegatorApi>({\n\t\t\t\tport,\n\t\t\t\ttimeout: Infinity,\n\t\t\t\tautoTransfer: webAutoTransfer,\n\t\t\t})\n\t\t\tdeferred.entangle(portal.remote.v1.requestDelegates(petitions))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tportal.close()\n\t\t\t\t\tpopup.close()\n\t\t\t\t\tstop()\n\t\t\t\t})\n\t\t},\n\t})\n\n\treturn deferred.promise\n}\n\n", "\nimport {Codec, Value} from \"../types.js\"\n\nexport class JsonCodec implements Codec {\n\tencode = (value: Value) => JSON.stringify(value)\n\tdecode = <X>(text: string): X | undefined => {\n\t\ttry { return JSON.parse(text) }\n\t\tcatch { return undefined }\n\t}\n}\n\n", "\nexport const lexSort = (a: string, b: string) => (\n\ta < b ? -1 : a > b ? 1 : 0\n)\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function scanMatch(key: string, {start, end}: Scan) {\n\tif (start !== undefined && key < start) return false\n\tif (end !== undefined && key >= end) return false\n\treturn true\n}\n\n", "\nimport {Scan} from \"../types.js\"\nimport {lexSort} from \"./lex-sort.js\"\nimport {scanMatch} from \"./scan-match.js\"\n\nexport function* scanEntries<V>(scan: Scan, entries: [string, V][]) {\n\tif (scan.limit === 0)\n\t\treturn\n\n\tconst matches = entries\n\t\t.filter(([key, value]) => value !== undefined && scanMatch(key, scan))\n\t\t.sort(([a], [b]) => lexSort(a, b))\n\n\tif (scan.reverse)\n\t\tmatches.reverse()\n\n\tyield* matches.slice(0, scan.limit ?? Infinity)\n}\n\n", "\nimport {scanEntries} from \"../utils/scan-entries.js\"\nimport {Op, Magazine, Scan, Value} from \"../types.js\"\n\nexport class MemoryMagazine implements Magazine {\n\t#map = new Map<string, Value>()\n\n\tasync commit(ops: Op<Value>[]) {\n\t\tfor (const [key, value] of ops) {\n\t\t\tif (value === undefined)\n\t\t\t\tthis.#map.delete(key)\n\t\t\telse\n\t\t\t\tthis.#map.set(key, structuredClone(value))\n\t\t}\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn keys.map(key => structuredClone(this.#map.get(key)))\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tyield* scanEntries(scan, [...this.#map.entries()].map(([key, value]) => [key, structuredClone(value)]))\n\t}\n}\n\n", "\nimport {JsonCodec} from \"../utils/json-codec.js\"\nimport {scanEntries} from \"../utils/scan-entries.js\"\nimport {Op, Magazine, Scan, Codec, Value} from \"../types.js\"\n\nexport class StorageMagazine implements Magazine {\n\t#storage\n\t#codec\n\n\tconstructor(storage: Storage = window.localStorage, options: {codec?: Codec} = {}) {\n\t\tthis.#storage = storage\n\t\tthis.#codec = options.codec ?? new JsonCodec()\n\t}\n\n\tasync commit(ops: Op<Value>[]) {\n\t\tfor (const [key, value] of ops) {\n\t\t\tif (value === undefined)\n\t\t\t\tthis.#storage.removeItem(key)\n\t\t\telse\n\t\t\t\tthis.#storage.setItem(key, this.#codec.encode(value))\n\t\t}\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn keys.map(key => {\n\t\t\tconst item = this.#storage.getItem(key)\n\t\t\treturn item === null\n\t\t\t\t? undefined\n\t\t\t\t: this.#codec.decode(item)\n\t\t})\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tfor (const [key, text] of scanEntries<string>(scan, Object.entries(this.#storage))) {\n\t\t\tconst value = this.#codec.decode(text)\n\t\t\tif (value !== undefined)\n\t\t\t\tyield [key, value] as [string, Value]\n\t\t}\n\t}\n}\n\n", "\nimport {Value} from \"../types.js\"\nimport {Operator} from \"./operator.js\"\n\nexport class CellOperator<V = Value> {\n\t#key\n\t#parent\n\n\tconstructor(key: string, parent: Operator<V>) {\n\t\tthis.#key = key\n\t\tthis.#parent = parent\n\t}\n\n\tset(value: V | undefined) {\n\t\treturn this.#parent.set(this.#key, value)\n\t}\n\n\tdelete() {\n\t\treturn this.#parent.delete(this.#key)\n\t}\n}\n\n", "\nimport {Cubby, got} from \"@e280/stz\"\nimport {Kv} from \"./kv.js\"\nimport {Value} from \"./types.js\"\nimport {CellOperator} from \"./utils/cell-operator.js\"\n\nexport class Cell<V = Value> implements Cubby<V> {\n\top\n\n\tconstructor(public kv: Kv, public key: string) {\n\t\tthis.op = new CellOperator(key, kv.op)\n\t}\n\n\tasync set(value: V | undefined) {\n\t\treturn this.kv.set(this.key, value)\n\t}\n\n\tasync get(): Promise<V | undefined> {\n\t\treturn this.kv.get(this.key)\n\t}\n\n\tasync has(): Promise<boolean> {\n\t\treturn (await this.get()) !== undefined\n\t}\n\n\tasync need(): Promise<V> {\n\t\treturn got(await this.get(), `key not found \"${this.key}\"`)\n\t}\n\n\tasync delete() {\n\t\treturn this.kv.set(this.key, undefined)\n\t}\n}\n\n", "\nimport {deep} from \"@e280/stz\"\n\nexport const consts = deep.freeze({\n\tdivisor: \".\",\n\tdelimiter: \":\",\n\tchunkSize: 1024,\n})\n\n", "\nexport function prefixEnd(prefix: string) {\n\tfor (let index = prefix.length - 1; index >= 0; index--) {\n\t\tconst code = prefix.charCodeAt(index)\n\n\t\tif (code < 0xFFFF) {\n\t\t\treturn (\n\t\t\t\tprefix.slice(0, index) +\n\t\t\t\tString.fromCharCode(code + 1)\n\t\t\t)\n\t\t}\n\t}\n\n\treturn undefined\n}\n\n", "\nimport {consts} from \"./consts.js\"\nimport {Magazine, Op, Scan} from \"./types.js\"\nimport {prefixEnd} from \"./utils/prefix-end.js\"\n\nexport class Subtree {\n\t#magazine\n\t#scans: Scan[] = [{}]\n\n\tconstructor(magazine: Magazine, scopes: string[]) {\n\t\tthis.#magazine = magazine\n\n\t\tif (scopes.length) {\n\t\t\tconst pre = scopes.join(consts.divisor)\n\t\t\tconst divised = pre + \".\"\n\t\t\tconst delimited = pre + \":\"\n\t\t\tthis.#scans = [\n\t\t\t\t{start: delimited, end: prefixEnd(delimited)},\n\t\t\t\t{start: divised, end: prefixEnd(divised)},\n\t\t\t]\n\t\t}\n\t}\n\n\tasync count() {\n\t\tlet count = 0\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const _ of this.#magazine.entries(scan))\n\t\t\t\tcount++\n\t\t}\n\n\t\treturn count\n\t}\n\n\tasync clear() {\n\t\tlet changes: Op<string>[] = []\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const [key] of this.#magazine.entries(scan)) {\n\t\t\t\tchanges.push([key, undefined])\n\t\t\t\tif (changes.length >= 1024) {\n\t\t\t\t\tawait this.#magazine.commit(changes)\n\t\t\t\t\tchanges = []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.#magazine.commit(changes)\n\t}\n}\n\n", "\nimport {Op, Value} from \"../types.js\"\nimport {Prefixer} from \"./prefixer.js\"\n\nexport class Operator<V = Value> {\n\t#prefixer: Prefixer\n\n\tconstructor(prefixer: Prefixer) {\n\t\tthis.#prefixer = prefixer\n\t}\n\n\tset<X extends V = V>(key: string, value: X | undefined): Op<X> {\n\t\treturn [this.#prefixer.prefix(key), value]\n\t}\n\n\tdelete(key: string): Op<undefined> {\n\t\treturn [this.#prefixer.prefix(key), undefined]\n\t}\n}\n\n", "\nimport {consts} from \"../consts.js\"\nimport {Options, Scan} from \"../types.js\"\nimport {prefixEnd} from \"./prefix-end.js\"\n\nconst {divisor, delimiter} = consts\n\nexport class Prefixer {\n\t#prefix: string\n\t#end: string | undefined\n\n\tconstructor(options: Options) {\n\t\tconst {scopes} = options\n\t\tthis.#prefix = scopes.join(divisor) + delimiter\n\t\tthis.#end = prefixEnd(this.#prefix)\n\t}\n\n\tprefix = (key: string) => {\n\t\treturn this.#prefix + key\n\t}\n\n\tunprefix = (fullkey: string) => {\n\t\treturn fullkey.slice(this.#prefix.length)\n\t}\n\n\tscan = (scan: Scan): Scan => {\n\t\tconst {start, end, limit, reverse} = scan\n\n\t\treturn {\n\t\t\tstart: this.#prefix + (start ?? \"\"),\n\t\t\tend: end === undefined\n\t\t\t\t? this.#end\n\t\t\t\t: this.#prefix + end,\n\t\t\tlimit,\n\t\t\treverse,\n\t\t}\n\t}\n}\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function validateScan(scan: Scan) {\n\tconst limit = scan.limit\n\n\tif (limit !== undefined) {\n\t\tif (!Number.isInteger(limit))\n\t\t\tthrow new Error(\"scan limit must be integer\")\n\n\t\tif (limit < 0)\n\t\t\tthrow new Error(\"scan limit must be positive\")\n\t}\n\n\treturn scan\n}\n\n", "\nexport function validateScopes(scopes: string[]) {\n\tfor (const scope of scopes) {\n\t\tif (scope === \"\") throw new Error(`invalid scope empty string`)\n\t\tforbidden(scope, \".\")\n\t\tforbidden(scope, \":\")\n\t}\n\treturn scopes\n}\n\nfunction forbidden(scope: string, illegal: string) {\n\tif (scope.includes(illegal))\n\t\tthrow new Error(`invalid scope \"${scope}\" contains illegal \"${illegal}\"`)\n}\n\n", "\nimport {got} from \"@e280/stz\"\nimport {Cell} from \"./cell.js\"\nimport {consts} from \"./consts.js\"\nimport {Subtree} from \"./subtree.js\"\nimport {Operator} from \"./utils/operator.js\"\nimport {Prefixer} from \"./utils/prefixer.js\"\nimport {MemoryMagazine} from \"./magazines/memory.js\"\nimport {validateScan} from \"./utils/validate-scan.js\"\nimport {validateScopes} from \"./utils/validate-scopes.js\"\nimport {Magazine, Op, Options, Scan, Pair, Value} from \"./types.js\"\n\nexport class Kv<V = Value> {\n\n\t/** facility for writing operations that could be committed. */\n\treadonly op\n\n\t/** methods that can access all entries under this scope, including child scopes. */\n\treadonly subtree\n\n\t#magazine\n\t#prefixer\n\t#preprocess\n\t#options: Options\n\n\tconstructor(\n\t\t\tmagazine: Magazine = new MemoryMagazine(),\n\t\t\toptions: Partial<Options> = {},\n\t\t) {\n\t\tthis.#magazine = magazine\n\t\tthis.#options = {\n\t\t\tstrict: false,\n\t\t\tscopes: [],\n\t\t\t...options,\n\t\t}\n\t\tvalidateScopes(this.#options.scopes)\n\t\tthis.#prefixer = new Prefixer(this.#options)\n\t\tthis.op = new Operator<V>(this.#prefixer)\n\t\tthis.subtree = new Subtree(this.#magazine, this.#options.scopes)\n\t\tthis.#preprocess = this.#options.strict\n\t\t\t? (value: Value) => JSON.parse(JSON.stringify(value))\n\t\t\t: (value: Value) => value\n\t}\n\n\t/** create a cell which can set or get on a single key */\n\tcell<X extends V = V>(key: string) {\n\t\treturn new Cell<X>(this, key)\n\t}\n\n\t/** create a sub kv where all keys inherit a prefix */\n\tscope<X = Value>(...scopes: string[]) {\n\t\treturn new Kv<X>(this.#magazine, {\n\t\t\t...this.#options,\n\t\t\tscopes: [...this.#options.scopes, ...scopes],\n\t\t})\n\t}\n\n\tasync commit(ops: Op<V>[]) {\n\t\tawait this.#magazine.commit(\n\t\t\tops.map(([key, value]) => [key, (\n\t\t\t\t(value === undefined)\n\t\t\t\t\t? undefined\n\t\t\t\t\t: this.#preprocess(value)\n\t\t\t)])\n\t\t)\n\t}\n\n\tasync set<X extends V = V>(key: string, value: X | undefined) {\n\t\treturn this.commit([this.op.set(key, value)])\n\t}\n\n\tasync setMany<X extends V = V>(changes: [key: string, value: X | undefined][]) {\n\t\treturn this.commit(changes.map(([key, value]) => this.op.set(key, value)))\n\t}\n\n\tasync delete(...keys: string[]) {\n\t\treturn this.commit(keys.map(key => this.op.delete(key)))\n\t}\n\n\tasync getMany<X extends V = V>(keys: string[]) {\n\t\tkeys = keys.map(key => this.#prefixer.prefix(key))\n\t\treturn (await this.#magazine.getMany(keys)).map(value =>\n\t\t\t(value === undefined)\n\t\t\t\t? undefined\n\t\t\t\t: value as X\n\t\t)\n\t}\n\n\tasync get<X extends V = V>(key: string) {\n\t\tconst [value] = await this.getMany<X>([key])\n\t\treturn value\n\t}\n\n\tasync has(key: string) {\n\t\treturn (await this.get(key)) !== undefined\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync need<X extends V = V>(key: string) {\n\t\treturn got(await this.get<X>(key), `key not found \"${key}\"`)\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync needMany<X extends V = V>(keys: string[]) {\n\t\tconst values = await this.getMany<X>(keys)\n\t\tfor (const [index, key] of keys.entries())\n\t\t\tgot(values[index], `key not found \"${key}\"`)\n\t\treturn values as X[]\n\t}\n\n\tasync* entries<X extends V = V>(scan: Scan = {}) {\n\t\tscan = validateScan(this.#prefixer.scan(scan))\n\n\t\tfor await (const [key, value] of this.#magazine.entries(scan)) {\n\t\t\tconst key2 = this.#prefixer.unprefix(key)\n\t\t\tif (value !== undefined)\n\t\t\t\tyield [key2, value] as Pair<X>\n\t\t}\n\t}\n\n\t[Symbol.asyncIterator]() {\n\t\treturn this.entries()\n\t}\n\n\tasync* keys(scan: Scan = {}) {\n\t\tfor await (const [key] of this.entries(scan))\n\t\t\tyield key\n\t}\n\n\tasync* values<X extends V = V>(scan: Scan = {}) {\n\t\tfor await (const [, value] of this.entries(scan))\n\t\t\tyield value as X\n\t}\n\n\tasync count(scan: Scan = {}) {\n\t\tlet count = 0\n\t\tfor await (const _ of this.keys(scan)) count++\n\t\treturn count\n\t}\n\n\tasync clear(scan: Scan = {}) {\n\t\tlet changes: Op<V>[] = []\n\n\t\tfor await (const [key] of this.entries(scan)) {\n\t\t\tchanges.push(this.op.delete(key))\n\t\t\tif (changes.length >= consts.chunkSize) {\n\t\t\t\tawait this.commit(changes)\n\t\t\t\tchanges = []\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.commit(changes)\n\t}\n}\n\n", "\nimport {Kv, StorageMagazine} from \"@e280/kv\"\nimport {consts} from \"../../../consts.js\"\nimport {Session} from \"../types/session.js\"\nimport {AuthOptions} from \"../types/auth-options.js\"\n\nexport const defaultAuthOptions = (options: Partial<AuthOptions> = {}): AuthOptions => ({\n\n\t/** delegator app used for logins, defaults to `\"https://authlocal.org/\"`. */\n\tdelegatorUrl: options.delegatorUrl ?? (\n\t\t\"https://authlocal.org/\"\n\t),\n\n\t/** stores the user session. */\n\tsessionCubby: options.sessionCubby ?? (\n\t\tnew Kv(new StorageMagazine())\n\t\t\t.scope(consts.namespace)\n\t\t\t.cell<Session>(\"session\")\n\t),\n\n\t/** broadcast channel for cross-tab sync. */\n\tbroadcastChannel: options.broadcastChannel ?? (\n\t\tnew BroadcastChannel(`${consts.namespace}.auth`)\n\t),\n})\n\n", "\nimport {afterEffect, signal} from \"@e280/strata\"\nimport {disposer, ev, nap, sub} from \"@e280/stz\"\n\nimport {User} from \"./user.js\"\nimport {AuthLike} from \"./types/auth-like.js\"\nimport {openPopup} from \"./parts/open-popup.js\"\nimport {AuthOptions} from \"./types/auth-options.js\"\nimport {SessionOptions} from \"./types/session-options.js\"\nimport {isSessionValid} from \"./parts/is-session-valid.js\"\nimport {sessionPetitions} from \"./parts/session-petitions.js\"\nimport {askForDelegates} from \"./parts/ask-for-delegates.js\"\nimport {defaultAuthOptions} from \"./parts/default-auth-options.js\"\n\n/** auth facility for logging in and out. */\nexport class Auth implements AuthLike {\n\tdispose = disposer()\n\ton = sub<[User | null]>()\n\t#options\n\t#$user = signal<User | null>(null)\n\n\tconstructor(options: Partial<AuthOptions> = {}) {\n\t\tthis.#options = defaultAuthOptions(options)\n\n\t\tthis.dispose.schedule(\n\t\t\tev(this.#options.broadcastChannel, {\n\t\t\t\tmessage: () => nap().then(() => this.remember())\n\t\t\t})\n\t\t)\n\n\t\tthis.dispose.schedule(\n\t\t\tafterEffect(\n\t\t\t\t() => this.#$user(),\n\t\t\t\tuser => this.on.publish(user),\n\t\t\t)\n\t\t)\n\t}\n\n\t/** validate and return the current session, otherwise return null. */\n\tget user() {\n\t\tconst user = this.#$user()\n\t\treturn (user && isSessionValid(user.session))\n\t\t\t? user\n\t\t\t: null\n\t}\n\n\t/** remember a previous login from persistent storage. */\n\tasync remember() {\n\t\tconst session = await this.#options.sessionCubby.get()\n\t\tconst user = session\n\t\t\t? new User(session)\n\t\t\t: null\n\t\tthis.#$user(user)\n\t\treturn this.user\n\t}\n\n\t/** log out immediately. */\n\tasync logout() {\n\t\tawait this.#options.sessionCubby.set(undefined)\n\t\tthis.#$user(null)\n\t\tthis.#options.broadcastChannel.postMessage(true)\n\t}\n\n\t/** ask for a new login from the delegator */\n\tasync loginViaPopup(options: Partial<SessionOptions> = {}) {\n\t\tif (window.crossOriginIsolated)\n\t\t\tthrow new Error(\"popup flow prohibited by window.crossOriginIsolated\")\n\n\t\tconst petitions = sessionPetitions(options)\n\t\tconst delegatorOrigin = new URL(this.#options.delegatorUrl, window.location.href).origin\n\n\t\tconst popup = openPopup(\"auth\", this.#options.delegatorUrl)\n\t\tconst [auth, crypt] = await askForDelegates(popup, delegatorOrigin, petitions)\n\n\t\tconst user = new User({auth, crypt})\n\t\tawait this.#options.sessionCubby.set(user.session)\n\t\tthis.#$user(user)\n\t\tthis.#options.broadcastChannel.postMessage(true)\n\t\treturn this.user\n\t}\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const coreString = css`@layer core {\n\n::selection {\n\tcolor: var(--selection);\n\tbackground-color: var(--selection-bg);\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #444; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #666; }\n\na {\n\tcolor: var(--link);\n\ttext-decoration: none;\n\n\t&:visited {\n\t\tcolor: color-mix(in srgb, purple, var(--link) 70%);\n\t}\n\n\t&:hover {\n\t\tcolor: color-mix(in srgb, white, var(--link) 90%);\n\t\ttext-decoration: underline;\n\t}\n\n\t&:active {\n\t\tcolor: color-mix(in srgb, white, var(--link) 50%);\n\t}\n}\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const varsString = css`@layer vars {\n\n:is(:root, :host) {\n\t${renderVars({\n\t\t\"bg\": \"#111\",\n\t\t\"alpha\": \"#def\",\n\n\t\t\"rounded\": \"0.5em\",\n\t\t\"padding\": \"0.5em\",\n\n\t\t\"prime\": \"#d068ff\",\n\t\t\"code\": \"#3f1\",\n\t\t\"link\": \"cyan\",\n\t\t\"selection\": \"white\",\n\t\t\"selection-bg\": \"#f70\",\n\n\t\t\"lame\": \"#8888\",\n\t\t\"angry\": \"#f50\",\n\t\t\"zesty\": \"#cf0\",\n\t\t\"happy\": \"#0fa\",\n\t\t\"calm\": \"#0af\",\n\t\t\"sad\": \"#74f\",\n\t\t\"quirky\": \"#f49\",\n\n\t\t\"inactive-opacity\": \"0.5\",\n\t\t\"anim-duration\": \"150ms\",\n\t})}\n}\n\n}`\n\nfunction renderVar([name, value]: [string, string]) {\n\treturn `--${name}: var(--shiny-${name}, ${value});`\n}\n\nfunction renderVars(varsObject: Record<string, string>) {\n\treturn Object.entries(varsObject).map(renderVar).join(\"\\n\")\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const resetString = css`@layer reset {\n\n* {\n\tmargin: 0;\n\tpadding: 0;\n\tbox-sizing: border-box;\n\n\tscrollbar-width: thin;\n\tscrollbar-color: #888 transparent;\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #999; }\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport {coreString} from \"./parts/core.js\"\nimport {varsString} from \"./parts/vars.js\"\nimport {resetString} from \"./parts/reset.js\"\nexport const themeString = css`\n\n@layer vars, reset, core, underlay, view, overlay;\n\n${varsString}\n${resetString}\n${coreString}\n\n`\n\n", "\nimport {themeString} from \"./theme-string.js\"\n\nexport const themeCss = new CSSStyleSheet()\n\nthemeCss.replaceSync(themeString)\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\nbutton {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: inherit;\n}\n\nbutton {\n\topacity: var(--inactive-opacity);\n\tdisplay: flex;\n\talign-items: center;\n\n\tcursor: copy;\n\tcolor: inherit;\n\ttransition: all var(--anim-duration) linear;\n\n\t&:is(:hover, :focus-visible) {\n\t\topacity: 1;\n\t}\n\n\t> span {\n\t\tdisplay: flex;\n\t}\n}\n\n[data-status=\"invalid\"] {\n\tcolor: var(--lame);\n}\n\n[data-status=\"good\"] {\n\topacity: 1;\n\tcolor: var(--happy);\n\tfilter: drop-shadow(0 0 0.3em color-mix(in oklab, transparent, currentColor 50%));\n}\n\n[data-status=\"bad\"] {\n\topacity: 1;\n\tcolor: var(--angry);\n\tfilter: drop-shadow(0 0 0.3em color-mix(in oklab, transparent, currentColor 50%));\n}\n\nsvg {\n\twidth: 1em;\n\theight: 1em;\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon icon-tabler icons-tabler-outline icon-tabler-clipboard\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2\" /><path d=\"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z\" /></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"icon icon-tabler icons-tabler-filled icon-tabler-clipboard-x\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M17.997 4.17a3 3 0 0 1 2.003 2.83v12a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 2.003 -2.83a4 4 0 0 0 3.997 3.83h4a4 4 0 0 0 3.98 -3.597zm-7.29 7.123a1 1 0 0 0 -1.414 0l-.083 .094a1 1 0 0 0 .083 1.32l1.292 1.293l-1.292 1.293a1 1 0 0 0 0 1.414l.094 .083a1 1 0 0 0 1.32 -.083l1.293 -1.293l1.293 1.293a1 1 0 0 0 1.414 0l.083 -.094a1 1 0 0 0 -.083 -1.32l-1.293 -1.293l1.293 -1.293a1 1 0 0 0 0 -1.414l-.094 -.083a1 1 0 0 0 -1.32 .083l-1.293 1.292zm3.293 -9.293a2 2 0 1 1 0 4h-4a2 2 0 1 1 0 -4z\" /></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"icon icon-tabler icons-tabler-filled icon-tabler-clipboard-check\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M17.997 4.17a3 3 0 0 1 2.003 2.83v12a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 2.003 -2.83a4 4 0 0 0 3.997 3.83h4a4 4 0 0 0 3.98 -3.597zm-3.704 7.123l-3.293 3.292l-1.293 -1.292a1 1 0 1 0 -1.414 1.414l2 2a1 1 0 0 0 1.414 0l4 -4a1 1 0 0 0 -1.414 -1.414m-.293 -9.293a2 2 0 1 1 0 4h-4a2 2 0 1 1 0 -4z\" /></svg>`\n\n", "\nexport function determineBaseStatus(text: string | undefined) {\n\treturn text === undefined\n\t\t? \"invalid\"\n\t\t: \"neutral\"\n}\n\n", "\nimport {debounce} from \"@e280/stz\"\nimport {useOnce, useSignal} from \"@e280/sly\"\n\nimport {CopyStatus} from \"./copy-status.js\"\nimport {determineBaseStatus} from \"./determine-base-status.js\"\n\nexport function useCopier(text: string | undefined, ms: number) {\n\tconst $status = useSignal<CopyStatus>(determineBaseStatus(text))\n\n\tconst reset = useOnce(() => debounce(ms, () => $status(determineBaseStatus(text))))\n\n\tconst flash = useOnce(() => async(status: CopyStatus) => {\n\t\t$status(status)\n\t\tawait reset()\n\t})\n\n\treturn {reset, flash, status: $status()}\n}\n\n", "\nimport {html} from \"lit\"\nimport {shadow, useCss, useName} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport clipboardSvg from \"../../icons/tabler/clipboard.svg.js\"\nimport clipboardXFilledSvg from \"../../icons/tabler/clipboard-x-filled.svg.js\"\nimport clipboardCheckFilledSvg from \"../../icons/tabler/clipboard-check-filled.svg.js\"\n\nimport {useCopier} from \"./parts/use-copier.js\"\nimport {themeCss} from \"../../theme/theme.css.js\"\n\nexport const ShinyCopy = shadow((\n\t\ttext: string | undefined,\n\t\toptions: {ms?: number, fail?: boolean} = {},\n\t) => {\n\n\tuseName(\"shiny-copy\")\n\tuseCss(themeCss, styleCss)\n\tconst copier = useCopier(text, options.ms ?? 1000)\n\n\tasync function click() {\n\t\tif (text === undefined) return\n\t\ttry {\n\t\t\tif (options.fail)\n\t\t\t\tthrow new Error(\"copy failed on purpose for testing purposes\")\n\t\t\tawait navigator.clipboard.writeText(text)\n\t\t\tawait copier.flash(\"good\")\n\t\t}\n\t\tcatch (error) {\n\t\t\tconsole.error(error)\n\t\t\tawait copier.flash(\"bad\")\n\t\t}\n\t}\n\n\treturn html`\n\t\t<button data-status=\"${copier.status}\" @click=\"${click}\" part=button>\n\t\t\t<span part=icon>\n\t\t\t\t${(() => {switch (copier.status) {\n\t\t\t\t\tcase \"neutral\":\n\t\t\t\t\t\treturn clipboardSvg\n\n\t\t\t\t\tcase \"invalid\":\n\t\t\t\t\t\treturn clipboardSvg\n\n\t\t\t\t\tcase \"good\":\n\t\t\t\t\t\treturn clipboardCheckFilledSvg\n\n\t\t\t\t\tcase \"bad\":\n\t\t\t\t\t\treturn clipboardXFilledSvg\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(`unknown copy status`)\n\t\t\t\t}})()}\n\t\t\t</span>\n\t\t\t<slot></slot>\n\t\t</button>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`\n\n[part=\"card\"] {\n\t--fg: var(--color);\n\n\tdisplay: flex;\n\talign-items: center;\n\tflex-direction: row;\n\n\tgap: var(--pad);\n\tpadding: var(--pad);\n\tborder-radius: var(--round);\n\n\tcolor: var(--fg);\n\tborder: var(--lines) solid color-mix(in oklch, transparent, var(--fg) 25%);\n\n\tbackground: color-mix(in oklch, transparent, var(--fg) 10%);\n\tbackdrop-filter: blur(0.4em);\n\n\t[part=\"icon\"] {\n\t\ttransform: scale(150%);\n\t}\n\n\t[part=\"alias\"] {\n\t\tfont-weight: bold;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n}\n\n`\n\n", "\nimport {css} from \"lit\"\nimport {cssReset} from \"@e280/sly\"\nexport default css`\n\n${cssReset}\n\n:host {\n\t--alpha: #00ff93;\n\n\t--gap: 0.2em;\n\t--pad: 0.5em;\n\t--space: 1em;\n\t--round: 0.5em;\n\t--lines: 0.1em;\n\t--shadow: 0.02em 0.04em 0.08em #0008;\n\n\ttext-shadow: var(--shadow);\n}\n\n`\n\n", "\nimport {html} from \"lit\"\nimport {ShinyCopy} from \"@e280/shiny\"\nimport {shadow, useCss, useName} from \"@e280/sly\"\nimport styleCss from \"./style.css.js\"\nimport uitheme from \"../../uitheme.js\"\nimport {address} from \"../../../core/ergo/address/address.js\"\nimport {addressColor} from \"../../../core/ergo/address/color.js\"\nimport {addressEmoji} from \"../../../core/ergo/address/emoji.js\"\nimport {addressMoniker} from \"../../../core/ergo/address/moniker.js\"\n\nexport const Card = shadow((user: {id: string, alias?: string}) => {\n\tuseName(\"card\")\n\tuseCss(uitheme, styleCss)\n\n\tconst addr = address(user.id)\n\tconst color = `--color: ${addressColor(user.id)};`\n\n\treturn html`\n\t\t<div part=card style=\"${color}\">\n\t\t\t<div part=icon>${addressEmoji(user.id)}</div>\n\n\t\t\t<div part=alias>${user.alias || addressMoniker(user.id)}</div>\n\n\t\t\t${ShinyCopy.with({\n\t\t\t\tprops: [addr],\n\t\t\t\tattrs: {\n\t\t\t\t\tpart: \"copy\",\n\t\t\t\t\ttitle: `copy address \"${addr.slice(0, 20)}...\"`,\n\t\t\t\t},\n\t\t\t})}\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`\n\n[part=\"box\"] {\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 0.25em;\n\twidth: max-content;\n\tmax-width: 100%;\n}\n\n[view=\"card\"] {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\nbutton {\n\t--fg: #aaa;\n\t--bg: #222;\n\t--color0: color-mix(in oklch, transparent, var(--fg) 40%);\n\t--color1: color-mix(in oklch, transparent, var(--fg) 40%);\n\t--color2: color-mix(in oklch, transparent, var(--bg) 40%);\n\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tgap: var(--gap);\n\n\tfont-size: 1em;\n\tpadding: var(--pad);\n\tfont-weight: bold;\n\n\tcursor: pointer;\n\tcolor: var(--fg);\n\tborder: var(--lines) solid var(--color0);\n\tborder-radius: var(--round);\n\ttext-shadow: var(--shadow);\n\n\tbackground: linear-gradient(\n\t\tto bottom,\n\t\tvar(--color1),\n\t\tvar(--color2)\n\t);\n\n\t&:is(:hover, :focus-visible) {\n\t\tfilter: brightness(120%);\n\t}\n\n\t&:active {\n\t\tfilter: brightness(90%);\n\t}\n\n\tsvg {\n\t\twidth: 1em;\n\t\theight: 1em;\n\t\tfilter: drop-shadow(var(--shadow));\n\t}\n\n\t&.sign-in {\n\t\tflex: 1 1 auto;\n\t\t--fg: color-mix(in oklch, #aaa, var(--alpha));\n\n\t\tsvg, strong {\n\t\t\tcolor: var(--alpha);\n\t\t}\n\t}\n\n\t&.sign-out {\n\t\tflex: 0 0 auto;\n\n\t\t&::before {\n\t\t\tcontent: \"\\\\200b\";\n\t\t}\n\t}\n}\n\n`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"icon icon-tabler icons-tabler-filled icon-tabler-lock\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" /><path d=\"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3\" /></svg>\n`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon icon-tabler icons-tabler-outline icon-tabler-logout\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" /><path d=\"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2\" /><path d=\"M9 12h12l-3 -3\" /><path d=\"M18 15l3 -3\" /></svg>\n`\n\n", "\nimport {html} from \"lit\"\nimport {shadow, shadowElement, useCss, useName} from \"@e280/sly\"\n\nimport {Card} from \"../card/view.js\"\nimport styleCss from \"./style.css.js\"\nimport uitheme from \"../../uitheme.js\"\nimport {User} from \"../../../protocol/user.js\"\nimport lockIcon from \"../../icons/tabler/lock.icon.js\"\nimport logoutIcon from \"../../icons/tabler/logout.icon.js\"\nimport {AuthLike} from \"../../../protocol/types/auth-like.js\"\nimport {addressColor} from \"../../../core/ergo/address/color.js\"\nimport {SessionOptions} from \"../../../protocol/types/session-options.js\"\n\nconst renderWidget = (auth: AuthLike, options?: Partial<SessionOptions>) => {\n\tuseName(\"widget\")\n\tuseCss(uitheme, styleCss)\n\n\tconst {user} = auth\n\tconst color = user ? `--color: ${addressColor(user.id)};` : ``\n\n\tconst renderSignIn = () => html`\n\t\t<button\n\t\t\tclass=sign-in\n\t\t\t@click=\"${() => auth.loginViaPopup(options)}\">\n\t\t\t${lockIcon}\n\t\t\t<slot></slot>\n\t\t</button>\n\t`\n\n\tconst renderUser = (user: User) => html`\n\t\t${Card(user)}\n\t\t<button\n\t\t\tclass=sign-out\n\t\t\t@click=\"${() => auth.logout()}\"\n\t\t\ttitle=\"Sign-out\">\n\t\t\t${logoutIcon}\n\t\t</button>\n\t`\n\n\treturn html`\n\t\t<div part=box style=\"${color}\">\n\t\t\t${user\n\t\t\t\t? renderUser(user)\n\t\t\t\t: renderSignIn()}\n\t\t</div>\n\t`\n}\n\nexport const Widget = shadow(renderWidget)\nexport const makeAuthWidget = (auth: AuthLike, options?: Partial<SessionOptions>) => shadowElement(() => renderWidget(auth, options))\n\n", "\nexport const bconfig = {\n\tanim: 300,\n\tzones: {\n\t\tgames: {path: \"/\"},\n\t\tdevlog: {path: \"/d/\"},\n\t},\n}\n\n", "\nimport {got, nap} from \"@e280/stz\"\nimport {tracker} from \"@e280/strata\"\nimport {bconfig} from \"../bconfig.js\"\n\nexport class Shell {\n\t#dialog?: HTMLDialogElement\n\t#closeToken = 0\n\n\tget dialog() {\n\t\ttracker.read(this)\n\t\treturn this.#dialog\n\t}\n\n\tget open() {\n\t\tconst dialog = this.dialog\n\t\treturn !!dialog?.open && !dialog.hasAttribute(\"data-closing\")\n\t}\n\n\tattach(dialog: HTMLDialogElement) {\n\t\tthis.#dialog = dialog\n\t\tdialog.onclose = () => tracker.write(this)\n\t\tdialog.oncancel = event => {\n\t\t\tevent.preventDefault()\n\t\t\tthis.toggle(false)\n\t\t}\n\t}\n\n\ttoggle = (please = !this.open) => {\n\t\tconst dialog = got(this.dialog)\n\n\t\tif (please)\n\t\t\tthis.#open(dialog)\n\t\telse\n\t\t\tthis.#close(dialog)\n\n\t\ttracker.write(this)\n\t}\n\n\t#open(dialog: HTMLDialogElement) {\n\t\tthis.#closeToken++\n\t\tdialog.removeAttribute(\"data-closing\")\n\n\t\tif (!dialog.open)\n\t\t\tdialog.showModal()\n\t}\n\n\t#close(dialog: HTMLDialogElement) {\n\t\tif (!dialog.open)\n\t\t\treturn\n\n\t\tconst token = ++this.#closeToken\n\t\tdialog.setAttribute(\"data-closing\", \"\")\n\n\t\tnap(bconfig.anim).then(() => {\n\t\t\tif (token !== this.#closeToken)\n\t\t\t\treturn\n\n\t\t\tif (dialog.hasAttribute(\"data-closing\"))\n\t\t\t\tdialog.close()\n\n\t\t\tdialog.removeAttribute(\"data-closing\")\n\t\t\ttracker.write(this)\n\t\t})\n\t}\n}\n\n", "\nimport {Auth} from \"@e280/authlocal\"\n\nexport class Account {\n\tconstructor(public auth: Auth) {}\n}\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n:host {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.veil {\n\tposition: absolute;\n\tinset: 0;\n\tbackground: var(--benev-bg);\n\tpointer-events: none;\n\n\topacity: 1;\n\ttransform: scale(100%);\n\tvisibility: visible;\n\n\ttransition:\n\t\topacity var(--benev-anim) linear,\n\t\ttransform var(--benev-anim) ease,\n\t\tvisiblity 0ms linear allow-discrete;\n}\n\n:host(:not([loading])) .veil {\n\topacity: 0;\n\ttransform: scale(0%);\n\tvisiblity: hidden;\n}\n\n.veil {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tgap: var(--benev-space);\n\n\t> img {\n\t\twidth: 100%;\n\t\tmax-width: 10em;\n\t\taspect-ratio: 1 / 1;\n\t}\n}\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport {bconfig} from \"../../bconfig.js\"\nexport default css`\n\n--benev-font-size: 18px;\n--benev-site-width: 62em;\n--benev-copy-width: 70ch;\n--benev-headroom: 2.5em;\n\n--benev-bg: #111;\n--benev-prime: #ebb935;\n--benev-tray: #453e2ca8;\n--benev-text: color-mix(in oklch, var(--benev-prime), #fffc 90%);\n--benev-intense: white;\n--benev-focus: 2px solid cyan;\n--benev-link: aqua;\n--benev-b-size: 1.5em;\n--benev-code: #0f0;\n\n--benev-select-bg: #f60;\n--benev-select-color: #ff8;\n\n--benev-line: #ebb93588;\n--benev-thin: 1px;\n--benev-thick: 3px;\n--benev-border: var(--benev-thin) solid color-mix(in oklch, transparent, var(--benev-line) 50%);\n\n--benev-pad: 0.5em;\n--benev-space: 1em;\n--benev-anim: ${bconfig.anim}ms;\n--benev-round: 0.5em;\n--benev-blur: blur(1em);\n--benev-backdrop: #0008;\n\n--benev-box-shadow: 0 0.5em 2em #0008;\n--benev-text-shadow: 0.04em 0.08em 0.1em #0008;\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\n&, *, ::before, ::after {\n\tmargin: 0;\n\tpadding: 0;\n\tbox-sizing: border-box;\n\tscrollbar-width: thin;\n}\n\n:focus-visible {\n\toutline: var(--benev-focus);\n\toutline-offset: 0.2em;\n}\n\n::selection {\n\tcolor: var(--benev-select-color);\n\tbackground: var(--benev-select-bg);\n}\n\na {\n\tcolor: var(--benev-link);\n\ttext-decoration: none;\n\n\t&:visited {\n\t\tcolor: var(--benev-link);\n\t}\n\n\t&:hover, &:focus-visible {\n\t\tcolor: color-mix(in srgb, var(--benev-link), white 15%);\n\t\ttext-decoration: underline;\n\t}\n\n\t&:active {\n\t\tcolor: color-mix(in srgb, var(--benev-link), white 50%);\n\t}\n\n\t&[benev-cardlink] {\n\t\tcolor: inherit;\n\n\t\t&:hover, &:focus-visible {\n\t\t\tcolor: inherit;\n\t\t\ttext-decoration: none;\n\t\t\tfilter: brightness(110%);\n\t\t}\n\n\t\t&:active {\n\t\t\tcolor: inherit;\n\t\t\tfilter: brightness(95%);\n\t\t}\n\t}\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\ncolor-scheme: dark;\n\n&:is(html) {\n\tfont-family: sans-serif;\n\tfont-size: var(--benev-font-size);\n\n\tscrollbar-gutter: stable;\n\tscrollbar-width: thin;\n\n\tcolor: var(--benev-text);\n\tbackground: var(--benev-bg);\n\ttext-shadow: var(--benev-text-shadow);\n}\n\nbody {\n\tmin-height: 100dvh;\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport default css`\n\nbutton, [benev-button] {\n\tfont: inherit;\n\ttext-decoration: none;\n\n\tdisplay: inline-flex;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tpadding: var(--benev-pad) var(--benev-space);\n\n\tfont-weight: bold;\n\ttext-transform: uppercase;\n\tcolor: var(--benev-prime);\n\tbackground: oklch(from var(--benev-bg) l c h / 50%);\n\tbackdrop-filter: var(--benev-blur);\n\tbox-shadow: var(--benev-box-shadow);\n\tborder: var(--benev-thick) solid currentColor;\n\tborder-radius: var(--benev-round);\n\n\t&[disabled] {\n\t\topacity: 0.3;\n\t}\n\n\t&:not([disabled]) {\n\t\tcursor: pointer;\n\t\ttransform: scale(100%);\n\t\ttransition: all var(--benev-anim) ease;\n\t\t&:hover, &:focus-visible { transform: scale(105%); filter: brightness(120%); }\n\t\t&:active { transform: scale(100%); filter: brightness(100%); }\n\t}\n\n\t&[benev-button=\"naked\"] {\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t\tbackdrop-filter: none;\n\t\tbox-shadow: none;\n\t\tpadding: 0;\n\t\tborder-radius: 0;\n\t\tborder: none;\n\t\ttext-transform: unset;\n\t\tfont-weight: inherit;\n\t\ttext-transform: inherit;\n\t}\n\n\t&[benev-button=\"juicy\"] {\n\t\topacity: 1;\n\t\tcolor: black;\n\t\tborder: var(--benev-thick) solid var(--benev-prime);\n\t\tbackground: linear-gradient(\n\t\t\tto bottom,\n\t\t\toklch(from var(--benev-prime) calc(l * 1.5) c h),\n\t\t\toklch(from var(--benev-prime) l calc(c * 1.5) h)\n\t\t);\n\t\t&:is(:hover, :focus-visible) {\n\t\t\tbox-shadow: 0 0 2em color-mix(in oklch, transparent, var(--benev-prime));\n\t\t}\n\t}\n}\n\n[benev-slice] {\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\nbenev-menu:not(:defined) {\n\tdisplay: none;\n}\n\nbenev-header {\n\tdisplay: flex;\n\tjustify-content: end;\n\talign-items: center;\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin: 0 auto;\n\n\t&:not(:defined) {\n\t\tpadding: var(--benev-pad);\n\t\tgap: var(--benev-space);\n\n\t\t&::before {\n\t\t\tcontent: \"\";\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-right: auto;\n\t\t\twidth: var(--benev-b-size);\n\t\t\theight: var(--benev-b-size);\n\t\t}\n\t}\n\n\ta {\n\t\tposition: relative;\n\t\tcolor: var(--benev-prime);\n\t\tpadding: 0.2em;\n\t\tfont-size: 1.2em;\n\n\t\t&[data-active] {\n\t\t\ttext-shadow: 0 0 0.5em currentColor;\n\n\t\t\t&::after {\n\t\t\t\tcontent: \"\u2022\";\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 90%;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tline-height: 0;\n\t\t\t\ttext-align: center;\n\t\t\t\ttext-shadow:\n\t\t\t\t\t0 0 0.5em currentColor,\n\t\t\t\t\t0 0 0.5em currentColor;\n\t\t\t}\n\t\t}\n\t}\n}\n\nbenev-footer {\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin-left: auto;\n\tmargin-right: auto;\n\n\tdisplay: flex;\n\tgap: var(--benev-space);\n\tjustify-content: end;\n\tpadding: var(--benev-space);\n\t--benev-link: #fffa;\n}\n\n[benev-prose] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--benev-pad);\n\n\th1 {\n\t\tfont-size: 2.5em;\n\t\tcolor: var(--benev-intense);\n\t\ta { color: inherit; }\n\t}\n\n\th2 {\n\t\tfont-size: 1.5em;\n\t\tcolor: var(--benev-prime);\n\t}\n\n\th3, h4, h5, h6 {\n\t\tcolor: var(--benev-prime);\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tmargin-top: var(--benev-space);\n\t}\n\n\tp {\n\t\tmax-width: var(--benev-copy-width);\n\t}\n\n\tp:has(> img) {\n\t\tmax-width: 100%;\n\t}\n\n\tul, ol {\n\t\tpadding-left: 1.5em;\n\t}\n\n\timg {\n\t\tmax-width: 100%;\n\t\tbackground: #0004;\n\t\tborder-radius: var(--benev-round);\n\t\tbox-shadow: var(--benev-box-shadow);\n\t}\n\n\tblockquote {\n\t\tcolor: oklch(from currentColor l 0 h / 50%);\n\t\tpadding-left: var(--benev-pad);\n\t\tmargin-left: var(--benev-pad);\n\t\tfont-style: italic;\n\t\tborder-left: var(--benev-thick) solid currentColor;\n\t}\n\n\thr {\n\t\tborder: none;\n\t\tdisplay: block;\n\t\theight: var(--benev-thick);\n\t\tbackground: oklch(from var(--benev-text) l c h / 25%);\n\t\tmargin: var(--benev-space) 0;\n\t}\n\n\tcode {\n\t\tfont-size: 0.8em;\n\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\toverflow: auto;\n\n\t\tpadding: var(--benev-space);\n\t\tcolor: var(--benev-code);\n\t\tbackground: var(--benev-backdrop);\n\t\tborder-radius: var(--benev-round);\n\t\tborder: var(--benev-border);\n\t\tborder-color: oklch(from var(--benev-code) l c h / 33%);\n\t\tbox-shadow: var(--benev-box-shadow);\n\t}\n}\n\n`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport varsCsstext from \"./parts/vars.csstext.js\"\nimport coreCsstext from \"./parts/core.csstext.js\"\nimport pageCsstext from \"./parts/page.csstext.js\"\nimport commonCsstext from \"./parts/common.csstext.js\"\n\nexport const benevCssText = css`\n\n@layer\n\tbenev.vars,\n\tbenev.core,\n\tbenev.common,\n\tbenev.page;\n\n@layer benev.vars {\n\t[benev], :host {\n\t\t${varsCsstext}\n\t}\n}\n\n@layer benev.core {\n\t[benev], :host {\n\t\t${coreCsstext}\n\t}\n}\n\n@layer benev.common {\n\t[benev], :host {\n\t\t${commonCsstext}\n\t}\n}\n\n@layer benev.page {\n\t[benev], :host {\n\t\t${pageCsstext}\n\t}\n}\n\n`\n\n", "\nimport {benevCssText} from \"./benev.csstext.js\"\n\nexport const themeCss = [benevCssText].map(text => {\n\tconst sheet = new CSSStyleSheet()\n\tsheet.replaceSync(text)\n\treturn sheet\n})\n\n", "\nexport const bDataPng = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjAAAAIwBAMAAABq30xcAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAB5QTFRFAAAA7s5d7spM7cQ59dly9t6D/u2W+OGT9+CN////QXakHAAAAAp0Uk5TAP77/d2oDDJqAeHntT4AACB8SURBVHic7V1de9vGlUb7xKB4txzQbXoXAnbrXhJQtrmUZGrjvYtlKlbvkNailDs7sT56Jzt2pN4xfVq3+beLAT8EUpzBewYzwIE377ObOLsmiHk5c+Z8H8/jgJ8nk1T+z9Tzpk2/S9OYTC4ubm4OD0cSu71erz8a9fL/ODw8vLm+uDifpE2/Yy2YTOd74cPJzeF4tCvCKCkiXPvvOAzDjKiMo/PJpNlXd4/JxfvxqBcVVq5AKLEgKh70RvtHF+dNv70b+Cfvx7vRghEVIRso6s0Jigej0dH5x7V3JCn5PonDAU7JCkQY5uxke+f645A9GSkjIUkh7BLN/pnRm22dptdVDVZJWSFn0D+6/rbp5Zkh2yq7cg1WSVlA0h33s1PV9Cqp8C/GIpZXsKlMASCFTjh6/rem14qhm/2vf/pOilrK3WMGKZHjQV/um67cO3yVZvlmJ++Fbamig9w3g/0f06aXXgL/dBzS9BQ73IT9o5ce3y3jn2UqXOxQrCgRyW1znTZNwGb8+312V8QNsJJDyGvqedo0CXdxMs5erYnNcovsSA2eMNP8TsZR1MgZWoWI4vgJI73vQ/O7ZYFMpRw8edk0IV6ut/z7aUMSdzMyQTfcP/d+bpyZd6I5ibsZ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MqcmHB2dp4XHTU7eZdcWebtkh5OZD/w4MuZFIkySJO6N9g9vJN6PRxlZJrT0BLPx1q8jk1WscpNRUUBo9sCEk4Mq9d8mlfbLEiKcw/QBASuz2j8wkJFOIBJOLnC6auoM0adNk1EAI16CISPJexyx4aWXMOrs9rraNW0V0aOm2VjCH1u6jmwg4nMjdXb5HKNeELO5kTqPGfHSS75smo85fP8tn2OU8fKwaUKW6NBCPW7BSMAQmhe6R8TJ/403L3SOCI841ABCCZ5jRPHXxEi4U+CNBBwjiLlcSDPAA44cI8ou6gpzs+2DULTpEhGz/ULpbuMS/HjB2106hEj48UJo++OQl208Z6IuUOqfHSFKSFk2NaFxxVdEyf20aRY2AJ437YqXTLww0upuAU8PdoNIpmT5GyK7jaNRiyBKYm2WRJNokBiRUDL46galeMgqwiQZPE9LMrEaw5RUhmeXlvgJw0t6ien3lcP4BpA5EKxpyfCsdmJkPkT/iONFtILHIgxFbeQIyUrcv049z7S3VV14HC9yNmQyyxp6AzEYhKEd+zuUpIRh/+g8Y6X7bdr0yktw9v5wPMohZuzkWM3+KSAu0AaP5xDhPJ0o3L/+tukFG+DDJMPF5GKGy8ubOd4fHkriloRkatkKV0u2Br0iWfO/uyC0t3993vQKXSFnbnKS05bzdbjYabodlv2Vw6OLSdr021vHVK+CTT7Mybq8yZian0v5p8Ob6+uL80nx+uEucH9BrZj4sx2Ryn/ku4zfBvk/inIx2z+WCl8AAAAASUVORK5CYII=`\n\n", "\nimport {html} from \"lit\"\nimport {shadowElement, useCss} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {bDataPng} from \"../../assets/b.png.js\"\n\nexport const BenevLoader = shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\n\treturn html`\n\t\t<slot></slot>\n\n\t\t<div class=veil>\n\t\t\t<img src=\"${bDataPng}\" alt=\"\" draggable=\"false\"/>\n\t\t\t<slot name=loading></slot>\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\ndialog {\n\tborder: 0;\n\tpadding: 0;\n\tbackground: transparent;\n\toverflow: visible;\n\tmax-height: unset;\n\tfont: inherit;\n\tcolor: inherit;\n\n\tposition: fixed;\n\tinset: 0 0 auto 0;\n\twidth: 100%;\n\tmax-width: var(--benev-site-width);\n\tmargin: auto;\n\n\ttransition: all var(--benev-anim) ease allow-discrete;\n\topacity: 0;\n\ttransform: translateY(-100%);\n}\n\ndialog > section:focus {\n\toutline: none;\n}\n\ndialog > section {\n\t--theight: min(20em, calc(100dvh - var(--benev-headroom)));\n\twidth: 100%;\n\theight: var(--theight);\n\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\n\tbackground: linear-gradient(\n\t\tto bottom right,\n\t\tvar(--benev-tray),\n\t\toklch(from var(--benev-tray) calc(l * 0.6) calc(c * 1.2) h / alpha)\n\t);\n\tbox-shadow: var(--benev-box-shadow);\n\tbox-shadow: 0 0 4em oklch(from var(--benev-tray) l c h / 60%);\n\tborder-radius: 0 0 var(--benev-round) var(--benev-round);\n\tborder: var(--benev-thick) solid oklch(from var(--benev-tray) calc(l * 1.2) calc(c * 1.2) h / alpha);\n\tborder-top: 0;\n}\n\ndialog[open] {\n\topacity: 1;\n\ttransform: translateY(0);\n}\n\ndialog[open][data-closing] {\n\topacity: 0;\n\ttransform: translateY(-100%);\n}\n\ndialog::backdrop {\n\tbackground: rgb(0 0 0 / 0%);\n\tbackdrop-filter: blur(0);\n\ttransition: all var(--benev-anim) ease allow-discrete;\n}\n\ndialog[open]::backdrop {\n\tbackground: var(--benev-backdrop);\n\tbackdrop-filter: var(--benev-blur);\n}\n\ndialog[open][data-closing]::backdrop {\n\tbackground: rgb(0 0 0 / 0%);\n\tbackdrop-filter: blur(0);\n}\n\n@starting-style {\n\tdialog[open] {\n\t\topacity: 0;\n\t\ttransform: translateY(-100%);\n\t}\n\n\tdialog[open]::backdrop {\n\t\tbackground: rgb(0 0 0 / 0%);\n\t\tbackdrop-filter: blur(0);\n\t}\n}\n\n}`\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n:host {\n\twidth: 100%;\n\tpointer-events: none;\n}\n\nnav > *, ::slotted(*) {\n\tpointer-events: all;\n}\n\nnav {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: end;\n\talign-items: center;\n\tgap: var(--benev-space);\n\tpadding: var(--benev-pad);\n}\n\nbutton {\n\tdisplay: block;\n\tmargin-right: auto;\n\n\timg {\n\t\tdisplay: block;\n\t\twidth: var(--benev-b-size);\n\t\theight: var(--benev-b-size);\n\t}\n}\n\nslot {\n\tdisplay: contents;\n}\n\n}`\n\n", "\nimport {Content, shadow, shadowElement, useName} from \"@e280/sly\"\n\nexport function shadowDuplex<P extends any[]>(name: string, render: (...p: P) => Content) {\n\tconst view = shadow((...p: P) => {\n\t\tuseName(name)\n\t\treturn render(...p)\n\t})\n\n\tconst makeElement = (...p: P) => shadowElement(() => render(...p))\n\n\treturn [view, makeElement] as [\n\t\tview: typeof view,\n\t\tmakeElement: typeof makeElement,\n\t]\n}\n\n", "\nimport {html} from \"lit\"\nimport {useCss} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport {Shell} from \"../../vitals/shell.js\"\nimport {bDataPng} from \"../../assets/b.png.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {shadowDuplex} from \"../tools/shadow-duplex.js\"\n\nexport const [HeaderView, makeBenevHeader] = shadowDuplex(\"benev-header\", (shell: Shell) => {\n\tuseCss(themeCss, styleCss)\n\n\tconst click = () => shell.toggle()\n\n\treturn html`\n\t\t<nav part=nav ?data-opened=${shell.open} ?data-closed=${!shell.open}>\n\t\t\t<button benev-button=naked title=\"b menu\" @click=${click}>\n\t\t\t\t<img part=img src=\"${bDataPng}\" alt=\"\"/>\n\t\t\t</button>\n\t\t\t<slot></slot>\n\t\t</nav>\n\t`\n})\n\n", "\nimport {ev} from \"@e280/stz\"\n\nexport function onKeypress(keys: string[], fn: () => void) {\n\treturn () => ev(window, {\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tconst target = event.target as HTMLElement\n\t\t\tconst typing = (\n\t\t\t\ttarget instanceof HTMLInputElement ||\n\t\t\t\ttarget instanceof HTMLTextAreaElement ||\n\t\t\t\ttarget.isContentEditable\n\t\t\t)\n\t\t\tif (typing)\n\t\t\t\treturn\n\t\t\tif (keys.includes(event.code)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tfn()\n\t\t\t}\n\t\t},\n\t})\n}\n\n", "\nexport function clickBackdrop(fn: (event: Event) => void) {\n\treturn (event: Event) => {\n\t\tif (event.target === event.currentTarget)\n\t\t\tfn(event)\n\t}\n}\n\n", "\nimport {useRendered, useShadow, useWake} from \"@e280/sly\"\n\nexport function useAfterFirstRender(fn: (shadow: ShadowRoot) => void) {\n\tconst shadow = useShadow()\n\tconst rendered = useRendered()\n\tuseWake(() => rendered.then(() => fn(shadow)))\n}\n\n", "\nimport {html} from \"lit\"\nimport {dom, shadowElement, useCss, useMount} from \"@e280/sly\"\nimport styleCss from \"./style.css.js\"\nimport {Shell} from \"../../vitals/shell.js\"\nimport {HeaderView} from \"../header/view.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {onKeypress} from \"./utils/on-keypress.js\"\nimport {clickBackdrop} from \"./utils/click-backdrop.js\"\nimport {useAfterFirstRender} from \"./utils/use-after-first-render.js\"\n\nexport const makeBenevMenu = (shell: Shell) => shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\tuseAfterFirstRender(shadow => shell.attach(dom(\"dialog\", shadow)))\n\tuseMount(onKeypress([\"KeyB\", \"Escape\"], () => shell.toggle()))\n\n\tconst click = clickBackdrop(() => shell.toggle(false))\n\tconst renderMenuContent = () => html`<slot></slot>`\n\n\treturn html`\n\t\t<dialog @click=${click}>\n\t\t\t<section class=plate autofocus tabindex=\"-1\">\n\t\t\t\t${shell.dialog?.open\n\t\t\t\t\t? renderMenuContent()\n\t\t\t\t\t: null}\n\t\t\t</section>\n\n\t\t\t${HeaderView(shell)}\n\t\t</dialog>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {useCss} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\nimport {shadowDuplex} from \"../tools/shadow-duplex.js\"\n\nexport const [FooterView, makeBenevFooter] = shadowDuplex(\"benev-footer\", () => {\n\tuseCss(themeCss, styleCss)\n\treturn html`<slot></slot>`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer benev.view {\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {shadowElement, useCss} from \"@e280/sly\"\n\nimport {Account} from \"./account.js\"\nimport styleCss from \"./style.css.js\"\nimport {themeCss} from \"../../css/theme.css.js\"\n\nexport const makeBenevAccount = (_account: Account) => shadowElement(() => {\n\tuseCss(themeCss, styleCss)\n\n\treturn html`\n\t\t<benev-auth>Sign in</benev-auth>\n\t`\n})\n\n", "\nimport {Auth, makeAuthWidget} from \"@e280/authlocal\"\nimport {Shell} from \"./shell.js\"\nimport {Account} from \"../dom/account/account.js\"\nimport {BenevLoader} from \"../dom/loader/view.js\"\nimport {makeBenevMenu} from \"../dom/menu/view.js\"\nimport {makeBenevFooter} from \"../dom/footer/view.js\"\nimport {makeBenevHeader} from \"../dom/header/view.js\"\nimport {makeBenevAccount} from \"../dom/account/view.js\"\n\nexport async function setupBenev() {\n\tconst shell = new Shell()\n\tconst auth = new Auth()\n\tconst account = new Account(auth)\n\n\tconst elements = {\n\t\tBenevLoader,\n\t\tBenevFooter: makeBenevFooter(),\n\t\tBenevMenu: makeBenevMenu(shell),\n\t\tBenevHeader: makeBenevHeader(shell),\n\t\tBenevAccount: makeBenevAccount(account),\n\t\tBenevAuth: makeAuthWidget(account.auth),\n\t}\n\n\tawait auth.remember()\n\n\treturn {account, shell, elements}\n}\n\n", "\nimport {nap} from \"@e280/stz\"\nimport {Content, dom} from \"@e280/sly\"\nimport {bconfig} from \"../../bconfig.js\"\n\nexport class Loader {\n\toriginal\n\n\t#loading\n\t#content\n\t#operation = 0\n\n\tconstructor(\n\t\t\tpublic element: HTMLElement,\n\t\t\tpublic anim = bconfig.anim,\n\t\t) {\n\n\t\tthis.original = document.createElement(\"template\")\n\t\tthis.original.innerHTML = element.innerHTML\n\n\t\tthis.#loading = document.createElement(\"div\")\n\t\tthis.#loading.style.display = \"contents\"\n\t\tthis.#loading.slot = \"loading\"\n\n\t\tthis.#content = document.createElement(\"div\")\n\t\tthis.#content.style.display = \"contents\"\n\t\tdom.render(this.#content, Array.from(element.childNodes))\n\n\t\tthis.element.replaceChildren()\n\t\tthis.element.append(\n\t\t\tthis.#loading,\n\t\t\tthis.#content,\n\t\t)\n\t}\n\n\tasync load(\n\t\t\tgetLoading: () => Content,\n\t\t\tgetContent: () => Promise<Content>,\n\t\t) {\n\n\t\tthis.#operation += 1\n\t\tconst operation = this.#operation\n\t\tconst isLatest = () => (this.#operation === operation)\n\t\tthis.element.inert = true\n\t\tthis.element.toggleAttribute(\"loading\", true)\n\t\tdom.render(this.#loading, getLoading())\n\n\t\ttry {\n\t\t\tconst [content] = await Promise.all([\n\t\t\t\tgetContent(),\n\t\t\t\tnap(this.anim * 2),\n\t\t\t])\n\n\t\t\tif (isLatest()) {\n\t\t\t\tthis.element.toggleAttribute(\"loading\", false)\n\t\t\t\tthis.element.inert = false\n\t\t\t\tdom.render(this.#content, content)\n\t\t\t\tawait nap(this.anim)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\tif (isLatest()) {\n\t\t\t\tthis.element.toggleAttribute(\"loading\", false)\n\t\t\t\tthis.element.inert = false\n\t\t\t\tdom.render(this.#loading, null)\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "\nimport {html} from \"lit\"\nimport {dom} from \"@e280/sly\"\nimport {nap} from \"@e280/stz\"\nimport {setupBenev} from \"./vitals/setup.js\"\nimport {Loader} from \"./dom/loader/loader.js\"\n\nconst {elements} = await setupBenev()\ndom.register(elements)\n\nconst loader = new Loader(dom(\"benev-loader\"))\n\ndom(\".testloader\").onclick = async() => {\n\tawait loader.load(\n\t\t() => \"loading...\",\n\t\tasync() => nap(1000).then(() => html`<main benev-slice>new content</main>`),\n\t)\n}\n\n"],
|
|
5
|
+
"mappings": "6FAMA,IAGMA,GAASC,WAKFC,GACXF,GAAOG,aACNH,GAAOI,WADDD,QAC2BH,GAAOI,SAASC,eAClD,uBAAwBC,SAASC,WACjC,YAAaC,cAAcD,UAkBvBE,GAAoBC,OAAAA,EAEpBC,GAAc,IAAIC,QASXC,GATWD,KASXC,CAOX,YACEC,EACAC,EACAC,EAAAA,CAEA,GAVFC,KAAe,aAAA,GAUTD,IAAcP,GAChB,MAAUS,MACR,mEAAA,EAGJD,KAAKH,QAAUA,EACfG,KAAKE,EAAWJ,CAClB,CAIA,IAAA,YAAIK,CAGF,IAAIA,EAAaH,KAAKI,EAChBN,EAAUE,KAAKE,EACrB,GAAIjB,IAA+BkB,IAA/BlB,OAAyD,CAC3D,IAAMoB,EAAYP,IAAZO,QAAqCP,EAAQQ,SAAW,EAC1DD,IACFF,EAAaT,GAAYa,IAAIT,CAAAA,GAE3BK,IAF2BL,UAG5BE,KAAKI,EAAcD,EAAa,IAAIZ,eAAiBiB,YACpDR,KAAKH,OAAAA,EAEHQ,GACFX,GAAYe,IAAIX,EAASK,CAAAA,EAG/B,CACA,OAAOA,CACT,CAEA,UAAAO,CACE,OAAOV,KAAKH,OACd,CAAA,EAiCWc,GAAaC,GACxB,IAAKhB,GACc,OAAVgB,GAAU,SAAWA,EAAeA,EAAPC,GAAAA,OAEpCrB,EAAAA,EAWSsB,GAAM,CACjBhB,KACGiB,IAAAA,CAEH,IAAMlB,EACJC,EAAQQ,SAAW,EACfR,EAAQ,CAAA,EACRiB,EAAOC,OACL,CAACC,EAAKC,EAAGC,IAAQ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EAAOC,GAAO,UAAUP,CAAC,EAE/B,OAAOI,EAAO,IAAYE,CAC3B,CCbM,SAAUE,GAAaC,EAAU,CACtC,GAAM,CAACC,EAAGC,CAAC,EAAI,CAAC,GAAGC,GAAK,QAASH,CAAE,CAAC,EAC9BI,GAAQH,EAAI,IAAO,KAAK,QAAQ,CAAC,EAEvC,MAAO,cADUC,EAAI,IAAO,IAAK,QAAQ,CAAC,CAChB,IAAIE,CAAG,GAClC,CCRO,IAAMC,GAAS,CACrB,YACA,YACA,YACA,YACA,YACA,YACA,YACA,2BACA,YACA,YACA,YACA,YACA,YACA,YACA,wBACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,kBACA,YACA,YACA,YACA,YACA,8BACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,kBACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,wBACA,YACA,2BACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,kBACA,kBACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,eACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,Y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AK,QAAQ,MAAQ,GACrB,KAAK,QAAQ,gBAAgB,UAAW,EAAI,EAC5CH,GAAI,OAAO,KAAKN,GAAUO,EAAU,CAAE,EAEtC,GAAI,CACH,GAAM,CAACI,CAAO,EAAI,MAAM,QAAQ,IAAI,CACnCH,EAAU,EACVI,GAAI,KAAK,KAAO,CAAC,EACjB,EAEGF,EAAQ,IACX,KAAK,QAAQ,gBAAgB,UAAW,EAAK,EAC7C,KAAK,QAAQ,MAAQ,GACrBJ,GAAI,OAAO,KAAKL,GAAUU,CAAO,EACjC,MAAMC,GAAI,KAAK,IAAI,EAErB,SAEKF,EAAQ,IACX,KAAK,QAAQ,gBAAgB,UAAW,EAAK,EAC7C,KAAK,QAAQ,MAAQ,GACrBJ,GAAI,OAAO,KAAKN,GAAU,IAAI,EAEhC,CACD,GC5DD,GAAM,CAAC,SAAAa,EAAQ,EAAI,MAAMC,GAAU,EACnCC,GAAI,SAASF,EAAQ,EAErB,IAAMG,GAAS,IAAIC,GAAOF,GAAI,cAAc,CAAC,EAE7CA,GAAI,aAAa,EAAE,QAAU,SAAU,CACtC,MAAMC,GAAO,KACZ,IAAM,aACN,SAAWE,GAAI,GAAI,EAAE,KAAK,IAAMC,wCAA0C,CAAC,CAE7E",
|
|
6
|
+
"names": ["global", "globalThis", "supportsAdoptingStyleSheets", "ShadowRoot", "ShadyCSS", "nativeShadow", "Document", "prototype", "CSSStyleSheet", "constructionToken", "Symbol", "cssTagCache", "WeakMap", "CSSResult", "cssText", "strings", "safeToken", "this", "Error", "_strings", "styleSheet", "_styleSheet", "cacheable", "length", "get", "replaceSync", "set", "toString", "unsafeCSS", "value", "String", "css", "values", "reduce", "acc", "v", "idx", "adoptStyles", "renderRoot", "styles", "adoptedStyleSheets", "map", "s", "style", "document", "createElement", "nonce", "setAttribute", "textContent", "appendChild", "getCompatibleStyle", "sheet", "rule", "cssRules", "is", "defineProperty", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "Object", "global", "globalThis", "trustedTypes", "emptyStringForBooleanAttribute", "emptyScript", "polyfillSupport", "reactiveElementPolyfillSupport", "JSCompiler_renameProperty", "prop", "_obj", "defaultConverter", "value", "type", "Boolean", "Array", "JSON", "stringify", "fromValue", "Number", "parse", "e", "notEqual", "old", "defaultPropertyDeclaration", "attribute", "String", "converter", "reflect", "useDefault", "hasChanged", "Symbol", "metadata", "litPropertyMetadata", "WeakMap", "ReactiveElement", "HTMLElement", "initializer", "this", "__prepare", "_initializers", "push", "observedAttributes", "finalize", "__attributeToPropertyMap", "keys", "name", "options", "state", "prototype", "hasOwnProperty", "create", "wrapped", "elementProperties", "set", "noAccessor", "key", "descriptor", "getPropertyDescriptor", "get", "v", "oldValue", "call", "requestUpdate", "configurable", "enumerable", "superCtor", "Map", "finalized", "props", "properties", "propKeys", "p", "createProperty", "attr", "__attributeNameForProperty", "elementStyles", "finalizeStyles", "styles", "isArray", "Set", "flat", "Infinity", "reverse", "s", "unshift", "getCompatibleStyle", "toLowerCase", "constructor", "super", "__instanceProperties", "isUpdatePending", "hasUpdated", "__reflectingProperty", "__initialize", "__updatePromise", "Promise", "res", "enableUpdating", "_$changedProperties", "__saveInstanceProperties", "forEach", "i", "controller", "__controllers", "add", "renderRoot", "isConnected", "hostConnected", "delete", "instanceProperties", "size", "createRenderRoot", "shadowRoot", "attachShadow", "shadowRootOptions", "adoptStyles", "connectedCallback", "c", "_requestedUpdate", "disconnectedCallback", "hostDisconnected", "_old", "_$attributeToProperty", "attrValue", "toAttribute", "removeAttribute", "setAttribute", "ctor", "propName", "getPropertyOptions", "fromAttribute", "convertedValue", "__defaultValues", "useNewValue", "newValue", "hasAttribute", "_$changeProperty", "__enqueueUpdate", "initializeValue", "has", "__reflectingProperties", "reject", "result", "scheduleUpdate", "performUpdate", "shouldUpdate", "changedProperties", "willUpdate", "hostUpdate", "update", "__markUpdated", "_$didUpdate", "_changedProperties", "hostUpdated", "firstUpdated", "updated", "updateComplete", "getUpdateComplete", "__propertyToAttribute", "mode", "reactiveElementVersions", "global", "globalThis", "wrap", "node", "trustedTypes", "policy", "createPolicy", "createHTML", "s", "boundAttributeSuffix", "marker", "Math", "random", "toFixed", "slice", "markerMatch", "nodeMarker", "d", "document", "createMarker", "createComment", "isPrimitive", "value", "isArray", "Array", "isIterable", "Symbol", "iterator", "SPACE_CHAR", "textEndRegex", "commentEndRegex", "comment2EndRegex", "tagEndRegex", "RegExp", "singleQuoteAttrEndRegex", "doubleQuoteAttrEndRegex", "rawTextElement", "tag", "type", "strings", "values", "_$litType$", "html", "svg", "mathml", "noChange", "for", "nothing", "templateCache", "WeakMap", "walker", "createTreeWalker", "trustFromTemplateString", "tsa", "stringFromTSA", "hasOwnProperty", "Error", "getTemplateHtml", "l", "length", "attrNames", "rawTextEndRegex", "regex", "i", "attrName", "match", "attrNameEndIndex", "lastIndex", "exec", "test", "end", "startsWith", "push", "Template", "constructor", "options", "this", "parts", "nodeIndex", "attrNameIndex", "partCount", "el", "createElement", "currentNode", "content", "wrapper", "firstChild", "replaceWith", "childNodes", "nextNode", "nodeType", "hasAttributes", "name", "getAttributeNames", "endsWith", "realName", "statics", "getAttribute", "split", "m", "index", "ctor", "PropertyPart", "BooleanAttributePart", "EventPart", "AttributePart", "removeAttribute", "tagName", "textContent", "emptyScript", "append", "data", "indexOf", "_options", "innerHTML", "resolveDirective", "part", "parent", "attributeIndex", "currentDirective", "__directives", "__directive", "nextDirectiveConstructor", "_$initialize", "_$resolve", "TemplateInstance", "template", "_$parts", "_$disconnectableChildren", "_$template", "_$parent", "parentNode", "_$isConnected", "fragment", "creationScope", "importNode", "partIndex", "templatePart", "ChildPart", "nextSibling", "ElementPart", "_$setValue", "__isConnected", "startNode", "endNode", "_$committedValue", "_$startNode", "_$endNode", "isConnected", "directiveParent", "_$clear", "_commitText", "_commitTemplateResult", "_commitNode", "_commitIterable", "insertBefore", "_insert", "createTextNode", "result", "_$getTemplate", "h", "_update", "instance", "_clone", "get", "set", "itemParts", "itemPart", "item", "start", "from", "_$notifyConnectionChanged", "n", "remove", "element", "fill", "String", "valueIndex", "noCommit", "change", "v", "_commitValue", "setAttribute", "toggleAttribute", "super", "newListener", "oldListener", "shouldRemoveListener", "capture", "once", "passive", "shouldAddListener", "removeEventListener", "addEventListener", "event", "call", "host", "handleEvent", "_$LH", "_boundAttributeSuffix", "_marker", "_markerMatch", "_HTML_RESULT", "_getTemplateHtml", "_TemplateInstance", "_isIterable", "_resolveDirective", "_ChildPart", "_AttributePart", "_BooleanAttributePart", "_EventPart", "_PropertyPart", "_ElementPart", "polyfillSupport", "litHtmlPolyfillSupport", "litHtmlVersions", "render", "container", "partOwnerNode", "renderBefore", "global", "globalThis", "LitElement", "ReactiveElement", "constructor", "this", "renderOptions", "host", "__childPart", "createRenderRoot", "renderRoot", "super", "renderBefore", "firstChild", "changedProperties", "value", "render", "hasUpdated", "isConnected", "update", "connectedCallback", "setConnected", "disconnectedCallback", "noChange", "litElementHydrateSupport", "polyfillSupport", "litElementPolyfillSupport", "global", "litElementVersions", "push", "attrGet", "key", "raw", "attrSet", "value", "element", "entries", "record", "el", "tagName", "attrs", "element", "attrSet", "mk", "template", "fragment", "D", "eve", "target", "events", "detachers", "eventName", "handler", "options", "fn", "d", "onAttrs", "element", "fn", "observer", "AttrProxies", "element", "_t", "key", "attrGet", "value", "attrSet", "attrSpec", "spec", "options", "_target", "key", "attrGet", "value", "attrSet", "attrs", "element", "proxies", "AttrProxies", "fn", "onAttrs", "spec", "options", "attrSpec", "attrGet", "attrSet", "elmer", "tagName", "Elmer", "#attrs", "#children", "key", "value", "record", "elements", "element", "attrSet", "queryRequire", "selector", "container", "e", "queryMaybe", "queryAll", "Dom", "_Dom", "#attrs", "element", "selectorOrElement", "queryRequire", "selector", "queryMaybe", "queryAll", "content", "D", "attrs", "spec", "eve", "dashify", "camel", "register", "elements", "options", "soft", "upgrade", "name", "Element", "tag", "dashify", "already", "element", "dom", "selector", "container", "queryRequire", "selectorOrElement", "Dom", "queryMaybe", "queryAll", "el", "elmer", "mk", "eve", "attrs", "register", "content", "D", "bytes", "a", "b", "diff", "i", "count", "parts", "size", "part", "offset", "BaseX", "lexicon", "char", "i", "fn", "s", "bitsPerChar", "bitBuffer", "bitCount", "output", "val", "num", "base", "zeroCharacter", "leadingZeroBytes", "out", "writeIndex", "bytes", "byte", "index", "n", "negative", "value", "count", "hex", "BaseX", "base2", "base36", "base58", "base62", "base64", "base64url", "fromBytes", "bytes", "toBytes", "string", "txt", "debounce", "delay", "action", "latestArgs", "timeout", "waitingQueue", "reset", "args", "promise", "resolve", "reject", "r", "err", "defer", "resolve", "reject", "promise", "res", "rej", "entangle", "outside", "microbounce", "fn", "scheduled", "params", "defer", "deferred", "index_barrel_exports", "__export", "clone", "equal", "freeze", "clone", "data", "refs", "copy", "d", "key", "val", "happy", "x", "sad", "is", "equal", "alpha", "bravo", "recurse", "parents", "is", "newParents", "key", "val", "item", "bItem", "keys1", "keys2", "freeze", "item", "recurse", "x", "parents", "is", "newParents", "arr", "y", "ok", "value", "err", "error", "gotOk", "result", "error", "gotErr", "dig", "target", "path", "current", "key", "is", "err", "ok", "got", "thing", "err", "need", "map", "key", "err", "guarantee", "make", "value", "cycle", "fn", "timeout", "stopped", "stop", "tick", "disposer", "fns", "d", "fn", "newFns", "errorString", "error", "fallback", "ev", "target", "fns", "entries", "name", "fn", "nap", "milliseconds", "resolve", "xub", "set", "publish", "a", "fn", "subscribe", "pub", "sub", "next", "promise", "resolve", "defer", "unsubscribe", "clear", "x", "listener", "templateString", "strings", "values", "lastIndex", "a", "b", "c", "time", "n", "Tracker", "#busy", "#observationLayers", "#subscriptions", "#batchDepth", "#batchPending", "item", "fns", "fn", "#flush", "seen", "value", "guarantee", "#run", "pending", "tracker", "Tracker", "signal", "value", "sig", "tracker", "watch", "collector", "onChange", "seen", "value", "tracker", "disposers", "item", "d", "effect", "fn", "unwatch", "dispose", "update", "watch", "afterEffect", "collector", "responder", "initialized", "effect", "collected", "batch", "tracker", "immute", "s", "index_barrel_exports", "_optic", "CacheCell", "#dirty", "#value", "calculate", "Lens", "_Lens", "_optic", "#previous", "#stateCache", "#frozenCache", "optic", "index_barrel_exports", "CacheCell", "immute", "state", "tracker", "fn", "selector", "lens", "waitGot", "wait", "gotOk", "waitGotErr", "wait", "gotErr", "isWaitPending", "wait", "isWaitOk", "wait", "waitSelect", "wait", "select", "pending", "ok", "err", "isWaitPending", "isWaitOk", "waitGot", "waitGotErr", "cssReset", "i", "SlyShadow", "_SlyShadow", "dom", "LightCx", "defer", "render", "ShadowCx", "host", "shadow", "Hooks", "#scopes", "scope", "position", "fn", "hooks", "Reactivity", "#stoppers", "stop", "fn", "rerender", "seen", "value", "tracker", "item", "Mounts", "#mounters", "#unmounters", "mount", "unmount", "Hookscope", "Mounts", "cx", "_ChildPart", "ChildPart", "_$LH", "isSingleExpression", "part", "strings", "PartType", "ATTRIBUTE", "CHILD", "PROPERTY", "BOOLEAN_ATTRIBUTE", "EVENT", "ELEMENT", "directive", "c", "values", "_$litDirective$", "Directive", "_partInfo", "_$isConnected", "this", "_$parent", "part", "parent", "attributeIndex", "__part", "__attributeIndex", "props", "update", "_part", "render", "notifyChildrenConnectedChanged", "parent", "isConnected", "children", "_$disconnectableChildren", "obj", "removeDisconnectableFromParent", "_$parent", "delete", "size", "addDisconnectableToParent", "Set", "has", "add", "installDisconnectAPI", "reparentDisconnectables", "newParent", "this", "notifyChildPartConnectedChanged", "isClearingValue", "fromPartIndex", "value", "_$committedValue", "Array", "isArray", "i", "length", "type", "PartType", "CHILD", "_$notifyConnectionChanged", "_$reparentDisconnectables", "AsyncDirective", "Directive", "constructor", "part", "attributeIndex", "super", "_$initialize", "_$isConnected", "isClearingDirective", "reconnected", "disconnected", "isSingleExpression", "__part", "_$setValue", "newValues", "__attributeIndex", "shadowElement", "view", "#cx", "#hookscope", "#reactivity", "Reactivity", "#shadow", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "hooks", "useOnce", "fn", "scope", "position", "hooks", "guarantee", "useRef", "initial", "useOnce", "Ref", "current", "useCx", "hooks", "useShadowCx", "cx", "useCx", "ShadowCx", "useHost", "useShadowCx", "useMount", "fn", "scope", "hooks", "useOnce", "useRendered", "useCx", "useShadow", "useShadowCx", "applyStyles", "shadow", "styles", "S", "prepareStyles", "elementStyles", "set", "s", "c", "useCss", "styles", "shadow", "useShadow", "useOnce", "applyStyles", "useMounted", "fn", "ref", "useRef", "useMount", "value", "dispose", "useName", "name", "host", "useHost", "useOnce", "useSignal", "value", "useOnce", "signal", "useStyles", "useCss", "useWake", "fn", "useMounted", "applyAttrs", "element", "attrs", "name", "value", "applyAttr", "existing", "v", "coerce", "shadowSetup", "SlyShadow", "host", "shadow", "view", "rawShadow", "setup", "directiveFn", "e", "f", "#cx", "#hookscope", "#props", "#reactivity", "Reactivity", "part", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "props", "hooks", "children", "attrs", "applyAttrs", "shadowView", "makeAsciiAnim", "hz", "frames", "AsciiAnim", "shadow", "useName", "useStyles", "cssReset", "style", "$frame", "useSignal", "useMount", "cycle", "nap", "next", "i", "ErrorDisplay", "shadow", "error", "useName", "useStyles", "cssReset", "style", "b", "i", "makeSpinner", "pending", "err", "wait", "ok", "waitSelect", "dotsSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "earthSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "moonSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "spinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "waveSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "Err", "TokenErr", "Err", "decodeToken", "token", "headerText", "payloadText", "signatureText", "TokenErr", "headerBytes", "base64url", "headerJson", "txt", "header", "payloadBytes", "payloadJson", "payload", "signature", "tokenTime", "t", "ms", "token", "exp", "decodeToken", "iat", "time", "expiresAt", "randomness", "additive", "resolution", "bucketed", "offset", "U32_MASK64", "_32n", "fromBig", "n", "le", "split", "lst", "len", "Ah", "Al", "h", "l", "fromNumH", "n", "fromNumL", "setU64FromNum", "view", "byteOffset", "isLE", "h", "l", "shrSH", "_l", "s", "shrSL", "rotrSH", "rotrSL", "rotrBH", "rotrBL", "add", "Ah", "Al", "Bh", "Bl", "l", "add3L", "Cl", "add3H", "low", "Ch", "add4L", "Dl", "add4H", "Dh", "add5L", "El", "add5H", "Eh", "isBytes", "a", "atitle", "title", "anumber", "n", "abytes", "value", "length", "title", "isBytes", "anumber", "bytes", "ofLen", "got", "message", "atitle", "aobject", "value", "label", "aopts", "proto", "aexists", "instance", "checkFinished", "aoutput", "out", "abytes", "min", "clean", "arrays", "i", "createView", "arr", "hasHexBuiltin", "hexes", "_", "i", "bytesToHex", "bytes", "abytes", "hex", "asciiToBase16", "ch", "hexToBytes", "error", "hl", "al", "array", "ai", "hi", "n1", "n2", "char", "concatBytes", "arrays", "sum", "i", "a", "abytes", "res", "pad", "checkOpts", "defaults", "opts", "title", "aopts", "createHasher", "hashCons", "info", "hashC", "msg", "tmp", "randomBytes", "bytesLength", "anumber", "cr", "oidNist", "suffix", "HashMD", "blockLen", "outputLen", "padOffset", "isLE", "createView", "data", "aexists", "abytes", "view", "buffer", "len", "processed", "pos", "take", "dataView", "out", "aoutput", "setU64FromNum", "oview", "outLen", "state", "i", "res", "to", "length", "finished", "destroyed", "SHA512_IV", "K512", "split", "n", "SHA512_Kh", "SHA512_Kl", "SHA512_W_H", "SHA512_W_L", "SHA2_64B", "HashMD", "outputLen", "IV", "Ah", "Al", "Bh", "Bl", "Ch", "Cl", "Dh", "Dl", "Eh", "El", "Fh", "Fl", "Gh", "Gl", "Hh", "Hl", "to", "view", "offset", "i", "W15h", "W15l", "s0h", "rotrSH", "shrSH", "s0l", "rotrSL", "shrSL", "W2h", "W2l", "s1h", "rotrBH", "s1l", "rotrBL", "SUMl", "add4L", "SUMh", "add4H", "sigma1h", "sigma1l", "CHIh", "CHIl", "T1ll", "add5L", "T1h", "add5H", "T1l", "sigma0h", "sigma0l", "MAJh", "MAJl", "add", "All", "add3L", "add3H", "clean", "_SHA512", "SHA512_IV", "sha512", "createHasher", "_SHA512", "oidNist", "aarray", "item", "title", "inner", "i", "abytes", "value", "length", "anumber", "aobject", "value", "title", "afunction", "bytesToHex", "concatBytes", "arrays", "hexToBytes", "hex", "isBytes", "randomBytes", "bytesLength", "_0n", "_1n", "atitle", "abool", "abignumber", "n", "isPosBig", "anumber", "asafenumber", "prefix", "hexToNumber", "hex", "_0n", "bytesToNumberBE", "bytes", "bytesToHex", "bytesToNumberLE", "copyBytes", "abytes", "numberToBytesBE", "n", "len", "anumber", "abignumber", "expectedLen", "hexToBytes", "numberToBytesLE", "copyBytes", "bytes", "abytes", "isPosBig", "n", "_0n", "inRange", "min", "max", "aInRange", "title", "bitLen", "bitMask", "n", "asafenumber", "_1n", "validateObject", "object", "fields", "optFields", "title", "aobject", "checkField", "fieldName", "expectedType", "isOpt", "label", "val", "current", "iter", "f", "k", "v", "_0n", "_1n", "_2n", "_3n", "_4n", "_5n", "_7n", "_8n", "_9n", "_15n", "_16n", "POW_WINDOWED_MIN", "mod", "a", "b", "result", "pow", "num", "power", "modulo", "d", "p", "digits", "table", "i", "w", "digit", "pow2", "x", "res", "invert", "number", "u", "q", "r", "m", "assertIsSquare", "Fp", "root", "n", "F", "aoddModulus", "order", "fnName", "_1n", "_0n", "sqrt3mod4", "p1div4", "_4n", "sqrt5mod8", "p5div8", "_5n", "_8n", "n2", "_2n", "v", "nv", "i", "sqrt9mod16", "P", "Fp_", "Field", "tn", "tonelliShanks", "c1", "c2", "c3", "c4", "_7n", "_16n", "tv1", "tv2", "tv3", "tv4", "e1", "e2", "e3", "_3n", "Q", "S", "Z", "_Fp", "FpLegendre", "cc", "Q1div2", "M", "c", "t", "t_tmp", "exponent", "b", "FpSqrt", "_9n", "isNegativeLE", "num", "modulo", "mod", "FIELD_FIELDS", "validateField", "field", "aobject", "asafenumber", "name", "afunction", "FpInvertBatch", "Fp", "nums", "passZero", "validateField", "aarray", "abool", "F", "inverted", "multipliedAcc", "acc", "num", "i", "invertedAcc", "FpLegendre", "Fp", "n", "validateField", "F", "aoddModulus", "p1mod2", "_1n", "_2n", "powered", "yes", "zero", "no", "nLength", "n", "nBitLength", "anumber", "_0n", "bits", "bitLen", "_nBitLength", "nByteLength", "FIELD_SQRT", "_Field", "_1n", "ORDER", "opts", "_nbitLength", "num", "mod", "lhs", "rhs", "power", "pow", "invert", "sqrt", "FpSqrt", "numberToBytesLE", "numberToBytesBE", "bytes", "skipValidation", "abytes", "allowedLengths", "BYTES", "isLE", "modFromBytes", "padded", "scalar", "bytesToNumberLE", "bytesToNumberBE", "lst", "FpInvertBatch", "a", "b", "condition", "abool", "Field", "_0n", "_1n", "_4n", "BLIND_BYTES", "BLIND_BITS", "FW_WINDOW", "TABLE_BYTES_MAX", "validatePointCons", "Point", "pc", "afunction", "aobject", "validateField", "normalizeZ", "c", "points", "validateMSMPoints", "invertedZs", "FpInvertBatch", "p", "i", "validateW", "W", "bits", "min", "validateTableBytes", "numPoints", "fpBytes", "bytes", "probeRandomBytes", "randomBytes", "length", "probe", "isBytes", "aarray", "validateMSMScalars", "scalars", "field", "maxScalar", "s", "isPosBig", "pointWindowSizes", "getWindowSize", "P", "oddMultiples", "size", "dbl", "t", "j", "wnafDigits", "n", "half", "mask", "d", "w", "signedWindowDigits", "windows", "shiftBy", "v", "wnafWalk", "zero", "tables", "digits", "max", "acc", "bit", "item", "ScalarMultiplier", "point", "comp", "base", "precomputes", "f", "digit", "start", "idx", "sel", "neg", "transform", "entries", "entry", "scalar", "inRange", "blind", "bytesToNumberBE", "bitMask", "table", "window", "cofactor", "mulAddUnsafe", "allowOversized", "abool", "createField", "order", "field", "isLE", "validateField", "Field", "createCurveFields", "type", "CURVE", "curveOpts", "FpFnLE", "validateObject", "p", "val", "isPosBig", "_0n", "Fp", "Fn", "params", "createKeygen", "randomSecretKey", "getPublicKey", "seed", "secretKey", "_0n", "_1n", "_2n", "_4n", "_8n", "isEdValidXY", "Fp", "CURVE", "x", "y", "x2", "y2", "left", "right", "edwards", "params", "extraOpts", "validateObject", "opts", "validated", "createCurveFields", "Fn", "cofactor", "FpLegendre", "randomBytes", "MASK", "isOdd", "n", "uvRatio", "u", "v", "mulA", "acoord", "title", "banZero", "min", "aInRange", "aedpoint", "other", "Point", "X", "Y", "Z", "T", "p", "bytes", "zip215", "len", "a", "d", "copyBytes", "abytes", "abool", "normed", "lastByte", "bytesToNumberLE", "max", "isValid", "isXOdd", "isLastByteOdd", "hex", "hexToBytes", "windowSize", "isLazy", "wnaf", "X2", "Y2", "Z2", "Z4", "aX2", "XY", "ZT", "X1", "Y1", "Z1", "X1Z2", "X2Z1", "Y1Z2", "Y2Z1", "A", "B", "C", "D", "x1y1", "E", "G", "F", "H", "X3", "Y3", "T3", "Z3", "T1", "T2", "scalar", "f", "normalize", "invertedZ", "iz", "is0", "zz", "bytesToHex", "points", "normalizeZ", "ScalarMultiplier", "eddsa", "Point", "cHash", "eddsaOpts", "validatePointCons", "hash", "opts", "validateObject", "prehash", "BASE", "Fp", "Fn", "outputLen", "expectedLen", "asafenumber", "randomBytes", "toMontgomery", "toMontgomerySecret", "adjustScalarBytes", "bytes", "domain", "data", "ctx", "phflag", "abool", "modN_LE", "bytesToNumberLE", "getPrivateScalar", "key", "len", "lengths", "abytes", "hashed", "head", "prefix", "scalar", "getExtendedPublicKey", "secretKey", "point", "pointBytes", "getPublicKey", "hashDomainToScalar", "context", "msgs", "msg", "concatBytes", "sign", "options", "copyBytes", "r", "R", "k", "s", "rs", "verifyOpts", "verify", "sig", "publicKey", "zip215", "mid", "A", "SB", "_size", "randomSecretKey", "seed", "isValidSecretKey", "isBytes", "isValidPublicKey", "utils", "createKeygen", "_1n", "_2n", "_5n", "_8n", "ed25519_CURVE_p", "ed25519_CURVE", "ed25519_pow_2_252_3", "x", "_10n", "_20n", "_40n", "_80n", "P", "b2", "b4", "pow2", "_2n", "b5", "_1n", "b10", "b20", "b40", "b80", "b160", "b240", "b250", "adjustScalarBytes", "bytes", "ED25519_SQRT_M1", "uvRatio", "u", "v", "v3", "mod", "v7", "pow", "vx2", "root1", "root2", "useRoot1", "useRoot2", "noRoot", "isNegativeLE", "ed25519_Point", "edwards", "Fp", "toMontgomery", "point", "y", "toMontgomerySecret", "secretKey", "size", "abytes", "sha512", "ed", "opts", "eddsa", "ed25519_Point", "sha512", "adjustScalarBytes", "toMontgomery", "toMontgomerySecret", "ed25519", "keyBytes", "key", "hex", "verifyBytes", "id", "message", "signature", "ed25519", "keyBytes", "assertFresh", "payload", "atTime", "maxAge", "happy", "TokenErr", "staleAt", "tokenTime", "verifyToken", "id", "token", "options", "atTime", "maxAge", "allowedIssuers", "allowedAudiences", "headerText", "payloadText", "payload", "signature", "decodeToken", "signingText", "signingBytes", "verifyBytes", "TokenErr", "happy", "expiresAt", "tokenTime", "notBefore", "assertFresh", "verifyProof", "proofToken", "options", "atTime", "maxAge", "allowedIssuers", "allowedAudiences", "allowedScopes", "allowedPurposes", "decoded", "decodeToken", "proof", "verifyToken", "TokenErr", "deriveId", "secret", "secretBytes", "keyBytes", "idBytes", "ed25519", "hex", "verifyDelegate", "delegate", "options", "proof", "verifyProof", "deriveId", "TokenErr", "tokenHeader", "signBytes", "secret", "message", "ed25519", "keyBytes", "signToken", "secret", "payload", "headerBytes", "txt", "tokenHeader", "headerText", "base64url", "payloadBytes", "payloadText", "signingText", "signingBytes", "signature", "signBytes", "signClaim", "delegate", "claim", "options", "secret", "proofToken", "audience", "expiresAt", "atTime", "signToken", "hex", "tokenTime", "happy", "consts", "index_barrel_exports", "time", "isLE", "assertLE", "littleEndian", "isBytes", "a", "anumber", "n", "title", "prefix", "abytes", "value", "length", "bytes", "isBytes", "len", "needsLen", "u8", "arr", "u32", "clean", "arrays", "i", "cleanFast", "zero", "dst", "len", "abytes", "anumber", "chunk", "off", "copyFast", "dst", "dstPos", "src", "srcPos", "len", "copyBytes", "bytes", "abytes", "checkOpts", "defaults", "opts", "mkAsync", "cb_", "cb", "genSetup", "canReturn", "setupDone", "progressTotal", "done", "stateBytes", "state", "onSave", "_state", "onRestore", "onNextTick", "_opts", "rawOpts", "anumber", "onProgress", "inc", "callbackPer", "asyncTick", "_stateBytes", "save", "restore", "nextTick", "total", "k", "v", "needReturn", "ts", "diff", "progress", "res", "args", "setup", "g", "r", "onEnd", "setupMode", "checkParallelOutput", "opts", "count", "outputLen", "canXOF", "raw", "isBytes", "anumber", "dkLen", "i", "abytes", "out", "outPos", "slices", "pos", "BRAND", "brandSet", "mkHash", "modFn", "def_", "platform", "def", "outputLen", "blockLen", "suffix", "init", "canXOF", "oid", "outBlockLen", "hashImpl", "hashAsyncImpl", "chunksImpl", "chunksAsyncImpl", "parallelImpl", "parallelAsyncImpl", "createImpl", "cleanStateImpl", "inited", "lazyInit", "mod", "processBlocks", "processOutBlocks", "padding", "reset", "BUFFER", "STATE", "STATE_CHUNKS", "parallelChunks", "maxBlocks", "chunks", "maxOutBlocks", "prefixStates", "initHash", "opts", "batchPos", "rawOpts", "blocks", "streamOutputLen", "anumber", "i", "hash", "processMessage", "msg", "padBlocks", "pos", "take", "copyFast", "isLast", "left", "processMessages", "parts", "prefix", "cap", "prefixLen", "totalLen", "k", "idx", "off", "written", "n", "cur", "rem", "processMessageParallel", "chunkPos", "chunkLen", "msgLen", "copyLane", "dst", "lane", "j", "checkOutputOpts", "o", "bytes", "defaultLen", "raw", "abytes", "dkLen", "out", "outPos", "processOutput", "checked", "batch", "blocksTotal", "produced", "blocksLeft", "maxWritten", "takeBlocks", "emitted", "need", "takeBytes", "processOutputParallel", "outOffset", "stateBytes", "state", "isBytes", "prefixState", "StreamHash", "copyBytes", "msgPos", "msgFirstLen", "leftover", "outChecked", "res", "buf", "to", "hashSync", "chunksSync", "total", "parallelSync", "maxGroups", "maxOutGroups", "groupLen", "checkParallelOutput", "t", "setupTick", "setup", "rawSetup", "_inc", "hashRun", "mkAsync", "setupMode", "tick", "chunksRun", "parallelRun", "clean", "chunksFn", "parallel", "BRAND", "brandSet", "SHA256_IV", "B3_Flags", "B3_IV", "SHA256_IV", "B3_IV_U8", "u8", "encodeStr", "str", "c", "ARX_SIGMA16", "ARX_SIGMA32", "blake3", "batchPos", "_maxBlocks", "mod", "hash", "opts", "key", "context", "_keyContext", "anumber", "flags", "IV", "B3_IV_U8", "abytes", "B3_Flags", "u32", "init_module", "_imports", "pool", "_importsEmbed", "code", "char", "module", "_exports", "buffer", "memoryExport", "segments", "_", "i", "_cache", "blake3", "brandSet", "getOutput", "len", "out", "exact", "equalBytes", "a", "b", "diff", "i", "mkCipher", "modFn", "def_", "platform", "def", "mod", "BUFFER", "STATE", "maxBlocks", "blockLen", "tagLength", "tagLeft", "padding", "noStream", "twoPass", "multiPass", "multiPassResult", "multiPassOut", "hasTag", "paddingLeft", "padFull", "padZeroOk", "lengthError", "dir", "padError", "emptyError", "passResult", "lazyInit", "bufAny", "reset", "maxWritten", "cleanFast", "runBlocks", "blocks", "isLast", "left", "round", "getTag", "initCipher", "key", "args", "res", "process", "data", "output", "overlapCopy", "cleanInput", "aStart", "aEnd", "bStart", "bEnd", "copyBytes", "disablePadding", "tagLen", "msg", "passedTag", "m", "rem", "pad", "totalLen", "work", "copyFast", "rBlocks", "maxR", "pos", "chunkR", "start", "bytes", "roundBase", "gotPad", "outLen", "cipherOutLen", "tagPrefix", "tagSuffix", "tagSeg", "useResult", "outRound", "workOwned", "work2Owned", "work2", "runPass", "input", "applyPadding", "applyVerify", "outPos", "lastBytes", "processed", "remaining", "take", "padBlocks", "padApplied", "totalBlocks", "cur", "outTouched", "hasPadding", "writeOut", "target", "tag", "macBlocks", "tagInit", "runMac", "runCipher", "outBase", "computed", "dataOffset", "offsetUsed", "nextOffset", "off", "maxHere", "capacity", "blockBytes", "leftPad", "e", "StreamCipher", "from", "state", "abytes", "holdLast", "bufferPartial", "prevPos", "total", "offPending", "cap", "rest", "totalRem", "msgPos", "need", "leftover", "tagOut", "firstTake", "used", "outLeft", "to", "dst", "cipherFactory", "nonce", "aadStart", "isBytes", "make", "fn", "run", "opts", "mkAsync", "setup", "setupMode", "tick", "_inc", "brandSet", "setCounter", "counterSeg", "counter", "initArx", "mod", "key", "nonce", "opts", "cfg", "allowShortKeys", "extendNonce", "counterLength", "counterRight", "counter", "k", "sigma", "ARX_SIGMA16", "ARX_SIGMA32", "kk", "n", "nc", "off", "nonceBytes", "setCounter", "u32", "validateArx", "abytes", "anumber", "nonceNcLen", "arxAeadBase", "cfg", "tagLeft", "withAAD", "key", "nonce", "aad", "validateArx", "abytes", "mod", "dir", "iv", "aadBytes", "initArx", "aadLo", "aadHi", "splitLen", "aadBlocks", "xchacha20poly1305", "arxAeadBase", "_0xffffffffn", "_32n", "splitLen", "len", "v", "streamBlocks", "mod", "data", "blockLen", "run", "buffer", "maxBlocks", "pos", "remaining", "blocks", "take", "left", "aadBlocks", "isLast", "init_module", "_imports", "pool", "_importsEmbed", "code", "char", "module", "_exports", "buffer", "memoryExport", "segments", "_", "i", "_cache", "arx", "blake3", "mkHash", "xchacha20poly1305", "mkCipher", "arx", "cryption", "CryptionErr", "Err", "decrypt", "secret", "buffer", "aad", "minimum", "cryption", "CryptionErr", "version", "rest", "nonce", "ciphertext", "authenticated", "bytes", "key", "keyBytes", "xchacha20poly1305", "encrypt", "secret", "buffer", "aad", "version", "cryption", "authenticated", "bytes", "nonce", "ciphertext", "xchacha20poly1305", "keyBytes", "generateSecret", "hex", "hash", "parts", "hasher", "blake3", "part", "bytes", "txt", "length", "Phonemes", "array", "index", "phoneme", "prefixes", "Phonemes", "suffixes", "Phonemes", "wordsFromBytes", "buffer", "a", "b", "pairwise", "wordFromPair", "wordFromPair", "a", "b", "need", "prefixes", "suffixes", "pairwise", "buffer", "a", "byte", "address", "id", "b", "keyBytes", "checksum", "hash", "addr", "wordsFromBytes", "bulk", "base58", "addressColor", "id", "a", "b", "hash", "hue", "emojis", "addressEmoji", "id", "byte", "got", "hash", "emojis", "addressMoniker", "id", "address", "decodeProof", "token", "decodeToken", "isSessionValid", "session", "appOrigin", "auth", "verifyDelegate", "consts", "crypt", "error", "User", "#proof", "session", "decodeProof", "tokenTime", "isSessionValid", "buffer", "aad", "encrypt", "ciphertext", "decrypt", "data", "options", "signClaim", "sessionPetitions", "expiresAt", "consts", "cryptScope", "generateSecret", "openPopup", "target", "url", "centerX", "centerY", "left", "top", "features", "got", "RemoteError", "ExposedError", "makeEndpoint", "fns", "path", "params", "fnResult", "dig", "err", "fn", "value", "ok", "error", "ExposedError", "makeRemote", "endpoint", "makeProxy", "path", "_target", "key", "_thisArg", "params", "result", "RemoteError", "MessageKind", "Messenger", "#id", "#localEndpoint", "#pending", "options", "makeEndpoint", "makeRemote", "call", "id", "deferred", "defer", "timeout", "nap", "err", "MessageKind", "error", "errorString", "msg", "#recvCall", "#recvRet", "ret", "pending", "makeAutoTransfer", "shouldTransfer", "tree", "auto_transfer_algo", "transfers", "seen", "visit", "x", "is", "key", "value", "Portal", "#messenger", "port", "autoTransfer", "fns", "timeout", "Messenger", "msg", "event", "portOffer", "portAccepted", "recvPorts", "topic", "from", "fromOrigin", "onPort", "ev", "event", "portOffer", "port", "id", "portAccepted", "webAutoTransfer", "makeAutoTransfer", "x", "is", "Thing", "askForDelegates", "popup", "delegatorOrigin", "petitions", "deferred", "defer", "stop", "recvPorts", "consts", "port", "portal", "Portal", "webAutoTransfer", "JsonCodec", "value", "text", "lexSort", "a", "b", "scanMatch", "key", "start", "end", "scanEntries", "scan", "entries", "matches", "key", "value", "scanMatch", "a", "b", "lexSort", "MemoryMagazine", "#map", "ops", "key", "value", "keys", "scan", "scanEntries", "StorageMagazine", "#storage", "#codec", "storage", "options", "JsonCodec", "ops", "key", "value", "keys", "item", "scan", "text", "scanEntries", "CellOperator", "#key", "#parent", "key", "parent", "value", "Cell", "kv", "key", "CellOperator", "value", "got", "consts", "index_barrel_exports", "prefixEnd", "prefix", "index", "code", "Subtree", "#magazine", "#scans", "magazine", "scopes", "pre", "consts", "divised", "delimited", "prefixEnd", "count", "scan", "_", "changes", "key", "Operator", "#prefixer", "prefixer", "key", "value", "divisor", "delimiter", "consts", "Prefixer", "#prefix", "#end", "options", "scopes", "prefixEnd", "key", "fullkey", "scan", "start", "end", "limit", "reverse", "validateScan", "scan", "limit", "validateScopes", "scopes", "scope", "forbidden", "illegal", "Kv", "_Kv", "#magazine", "#prefixer", "#preprocess", "#options", "magazine", "MemoryMagazine", "options", "validateScopes", "Prefixer", "Operator", "Subtree", "value", "key", "Cell", "scopes", "ops", "changes", "keys", "got", "values", "index", "scan", "validateScan", "key2", "count", "_", "consts", "defaultAuthOptions", "options", "Kv", "StorageMagazine", "consts", "Auth", "disposer", "sub", "#options", "#$user", "signal", "options", "defaultAuthOptions", "ev", "nap", "afterEffect", "user", "isSessionValid", "session", "User", "petitions", "sessionPetitions", "delegatorOrigin", "popup", "openPopup", "auth", "crypt", "askForDelegates", "coreString", "templateString", "varsString", "templateString", "renderVars", "renderVar", "name", "value", "varsObject", "resetString", "templateString", "themeString", "templateString", "varsString", "resetString", "coreString", "themeCss", "themeString", "style_css_default", "i", "clipboard_svg_default", "w", "clipboard_x_filled_svg_default", "w", "clipboard_check_filled_svg_default", "w", "determineBaseStatus", "text", "useCopier", "text", "ms", "$status", "useSignal", "determineBaseStatus", "reset", "useOnce", "debounce", "flash", "status", "ShinyCopy", "shadow", "text", "options", "useName", "useCss", "themeCss", "style_css_default", "copier", "useCopier", "click", "error", "b", "clipboard_svg_default", "clipboard_check_filled_svg_default", "clipboard_x_filled_svg_default", "style_css_default", "i", "uitheme_default", "i", "cssReset", "Card", "shadow", "user", "useName", "useCss", "uitheme_default", "style_css_default", "addr", "address", "color", "addressColor", "b", "addressEmoji", "addressMoniker", "ShinyCopy", "style_css_default", "i", "lock_icon_default", "w", "logout_icon_default", "w", "renderWidget", "auth", "options", "useName", "useCss", "uitheme_default", "style_css_default", "user", "color", "addressColor", "b", "Card", "logout_icon_default", "lock_icon_default", "Widget", "shadow", "makeAuthWidget", "shadowElement", "bconfig", "Shell", "#dialog", "#closeToken", "tracker", "dialog", "event", "please", "got", "#open", "#close", "token", "nap", "bconfig", "Account", "auth", "style_css_default", "i", "vars_csstext_default", "templateString", "bconfig", "core_csstext_default", "templateString", "page_csstext_default", "templateString", "common_csstext_default", "templateString", "benevCssText", "templateString", "vars_csstext_default", "core_csstext_default", "common_csstext_default", "page_csstext_default", "themeCss", "benevCssText", "text", "sheet", "bDataPng", "BenevLoader", "shadowElement", "useCss", "themeCss", "style_css_default", "b", "bDataPng", "style_css_default", "i", "style_css_default", "i", "shadowDuplex", "name", "render", "shadow", "p", "useName", "shadowElement", "HeaderView", "makeBenevHeader", "shadowDuplex", "shell", "useCss", "themeCss", "style_css_default", "click", "b", "bDataPng", "onKeypress", "keys", "fn", "ev", "event", "target", "clickBackdrop", "fn", "event", "useAfterFirstRender", "fn", "shadow", "useShadow", "rendered", "useRendered", "useWake", "makeBenevMenu", "shell", "shadowElement", "useCss", "themeCss", "style_css_default", "useAfterFirstRender", "shadow", "dom", "useMount", "onKeypress", "click", "clickBackdrop", "renderMenuContent", "b", "HeaderView", "style_css_default", "i", "FooterView", "makeBenevFooter", "shadowDuplex", "useCss", "themeCss", "style_css_default", "b", "style_css_default", "i", "makeBenevAccount", "_account", "shadowElement", "useCss", "themeCss", "style_css_default", "b", "setupBenev", "shell", "Shell", "auth", "Auth", "account", "Account", "elements", "BenevLoader", "makeBenevFooter", "makeBenevMenu", "makeBenevHeader", "makeBenevAccount", "makeAuthWidget", "Loader", "#loading", "#content", "#operation", "element", "anim", "bconfig", "dom", "getLoading", "getContent", "operation", "isLatest", "content", "nap", "elements", "setupBenev", "dom", "loader", "Loader", "nap", "b"]
|
|
7
7
|
}
|